[gtk+] win32: ported backend specific code to now backend specific API



commit a2b1da064a7868a8e6960afd5ffd05c43e701135
Author: Hans Breuer <hans breuer org>
Date:   Sun Jan 2 12:06:38 2011 +0100

    win32: ported backend specific code to now backend specific API

 gtk/gtkplug-win32.c           |    5 +++--
 gtk/gtkplug.c                 |    7 +++++++
 gtk/gtkprintoperation-win32.c |    2 +-
 gtk/gtkwin32embedwidget.c     |   10 ++++++----
 4 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkplug-win32.c b/gtk/gtkplug-win32.c
index 8b80bf3..7116b31 100644
--- a/gtk/gtkplug-win32.c
+++ b/gtk/gtkplug-win32.c
@@ -29,6 +29,7 @@
 #include "gtkmarshalers.h"
 #include "gtkplug.h"
 #include "gtkplugprivate.h"
+#include "gtkwindowprivate.h"
 #include "gtkdebug.h"
 
 #include "win32/gdkwin32.h"
@@ -211,7 +212,7 @@ _gtk_plug_windowing_filter_func (GdkXEvent *gdk_xevent,
 	      /* Start of embedding protocol */
 
 	      GTK_NOTE (PLUGSOCKET, g_printerr ("start of embedding\n"));
-	      priv->socket_window = gdk_window_lookup_for_display (display, (GdkNativeWindow) parent);
+	      priv->socket_window = gdk_win32_window_lookup_for_display (display, (GdkNativeWindow) parent);
 	      if (priv->socket_window)
 		{
 		  gpointer user_data = NULL;
@@ -230,7 +231,7 @@ _gtk_plug_windowing_filter_func (GdkXEvent *gdk_xevent,
 		}
 	      else
 		{
-		  priv->socket_window = gdk_window_foreign_new_for_display (display, (GdkNativeWindow) parent);
+		  priv->socket_window = gdk_win32_window_foreign_new_for_display (display, (GdkNativeWindow) parent);
 		  if (!priv->socket_window) /* Already gone */
 		    break;
 		}
diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c
index 9cf7ff4..174375f 100644
--- a/gtk/gtkplug.c
+++ b/gtk/gtkplug.c
@@ -40,6 +40,9 @@
 #ifdef GDK_WINDOWING_X11
 #include "x11/gdkx.h"
 #endif
+#ifdef GDK_WINDOWING_WIN32
+#include "win32/gdkwin32.h"
+#endif
 
 /**
  * SECTION:gtkplug
@@ -546,6 +549,10 @@ gtk_plug_construct_for_display (GtkPlug         *plug,
       if (GDK_IS_X11_DISPLAY (display))
         priv->socket_window = gdk_x11_window_foreign_new_for_display (display, socket_id);
 #endif
+#ifdef GDK_WINDOWING_WIN32
+      if (GDK_IS_WIN32_DISPLAY (display))
+        priv->socket_window = gdk_win32_window_foreign_new_for_display (display, socket_id);
+#endif
 
       if (priv->socket_window) {
 	g_signal_emit (plug, plug_signals[EMBEDDED], 0);
diff --git a/gtk/gtkprintoperation-win32.c b/gtk/gtkprintoperation-win32.c
index aee3b50..29550b7 100644
--- a/gtk/gtkprintoperation-win32.c
+++ b/gtk/gtkprintoperation-win32.c
@@ -655,7 +655,7 @@ static HWND
 get_parent_hwnd (GtkWidget *widget)
 {
   gtk_widget_realize (widget);
-  return gdk_win32_drawable_get_handle (gtk_widget_get_window (widget));
+  return gdk_win32_window_get_handle (gtk_widget_get_window (widget));
 }
 
 static void
diff --git a/gtk/gtkwin32embedwidget.c b/gtk/gtkwin32embedwidget.c
index 7ab456d..059be66 100644
--- a/gtk/gtkwin32embedwidget.c
+++ b/gtk/gtkwin32embedwidget.c
@@ -31,6 +31,7 @@
 #include "gtkwin32embedwidget.h"
 #include "gtkintl.h"
 #include "gtkprivate.h"
+#include "gtkwindowprivate.h"
 
 
 static void            gtk_win32_embed_widget_realize               (GtkWidget        *widget);
@@ -95,12 +96,12 @@ _gtk_win32_embed_widget_new (GdkNativeWindow parent_id)
   embed_widget = g_object_new (GTK_TYPE_WIN32_EMBED_WIDGET, NULL);
   
   embed_widget->parent_window =
-    gdk_window_lookup_for_display (gdk_display_get_default (),
-				   parent_id);
+    gdk_win32_window_lookup_for_display (gdk_display_get_default (),
+					 parent_id);
   
   if (!embed_widget->parent_window)
     embed_widget->parent_window =
-      gdk_window_foreign_new_for_display (gdk_display_get_default (),
+      gdk_win32_window_foreign_new_for_display (gdk_display_get_default (),
 					  parent_id);
   
   return GTK_WIDGET (embed_widget);
@@ -149,7 +150,8 @@ gtk_win32_embed_widget_window_process (HWND hwnd, UINT msg, WPARAM wparam, LPARA
   GtkWin32EmbedWidget *embed_widget;
   gpointer user_data;
 
-  window = gdk_window_lookup ((GdkNativeWindow)hwnd);
+  window = gdk_win32_window_lookup_for_display (gdk_display_get_default (),
+						(GdkNativeWindow)hwnd);
   if (window == NULL) {
     g_warning ("No such window!");
     return 0;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]