[gtk+] Make it compile again for Windows
- From: Tor Lillqvist <tml src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Make it compile again for Windows
- Date: Wed, 6 Oct 2010 22:32:13 +0000 (UTC)
commit e346d26f700139ba29c38e67f1878a8e65d2f5a7
Author: Tor Lillqvist <tml iki fi>
Date: Thu Oct 7 01:14:46 2010 +0300
Make it compile again for Windows
gdk/win32/gdkdnd-win32.c | 15 +++--
gdk/win32/gdkdrawable-win32.c | 32 +---------
gdk/win32/gdkevents-win32.c | 126 -----------------------------------------
gtk/gtkplug-win32.c | 1 +
gtk/gtksocket-win32.c | 1 +
gtk/gtkwin32embedwidget.c | 4 +-
6 files changed, 16 insertions(+), 163 deletions(-)
---
diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c
index 9d429f7..46b871b 100644
--- a/gdk/win32/gdkdnd-win32.c
+++ b/gdk/win32/gdkdnd-win32.c
@@ -1212,7 +1212,7 @@ target_context_new (GdkWindow *window)
target_drag_context *result;
GdkDragContextPrivateWin32 *private;
GdkDevice *device;
- GdkDeviceManager device_manager;
+ GdkDeviceManager *device_manager;
result = g_new0 (target_drag_context, 1);
@@ -1222,7 +1222,7 @@ target_context_new (GdkWindow *window)
result->context->protocol = GDK_DRAG_PROTO_OLE2;
result->context->is_source = FALSE;
- device_manager = gdk_display_get_device_manager (_gtk_display);
+ device_manager = gdk_display_get_device_manager (_gdk_display);
device = gdk_device_manager_get_client_pointer (device_manager);
gdk_drag_context_set_device (result->context, device);
@@ -1253,6 +1253,7 @@ source_context_new (GdkWindow *window,
source_drag_context *result;
GdkDragContextPrivateWin32 *private;
GdkDevice *device;
+ GdkDeviceManager *device_manager;
result = g_new0 (source_drag_context, 1);
@@ -1262,7 +1263,7 @@ source_context_new (GdkWindow *window,
result->context->protocol = GDK_DRAG_PROTO_OLE2;
result->context->is_source = TRUE;
- device_manager = gdk_display_get_device_manager (_gtk_display);
+ device_manager = gdk_display_get_device_manager (_gdk_display);
device = gdk_device_manager_get_client_pointer (device_manager);
gdk_drag_context_set_device (result->context, device);
@@ -1488,7 +1489,7 @@ gdk_dropfiles_filter (GdkXEvent *xev,
context->protocol = GDK_DRAG_PROTO_WIN32_DROPFILES;
context->is_source = FALSE;
- device_manager = gdk_display_get_device_manager (_gtk_display);
+ device_manager = gdk_display_get_device_manager (_gdk_display);
device = gdk_device_manager_get_client_pointer (device_manager);
gdk_drag_context_set_device (context, device);
@@ -1724,7 +1725,7 @@ local_send_enter (GdkDragContext *context,
new_context->protocol = GDK_DRAG_PROTO_LOCAL;
new_context->is_source = FALSE;
- device_manager = gdk_display_get_device_manager (_gtk_display);
+ device_manager = gdk_display_get_device_manager (_gdk_display);
device = gdk_device_manager_get_client_pointer (device_manager);
gdk_drag_context_set_device (new_context, device);
@@ -1859,13 +1860,13 @@ gdk_drag_begin (GdkWindow *window,
{
GdkDragContext *new_context;
GdkDevice *device;
- GdkDeviceManager device_manager;
+ GdkDeviceManager *device_manager;
g_return_val_if_fail (window != NULL, NULL);
new_context = gdk_drag_context_new ();
- device_manager = gdk_display_get_device_manager (_gtk_display);
+ device_manager = gdk_display_get_device_manager (_gdk_display);
device = gdk_device_manager_get_client_pointer (device_manager);
gdk_drag_context_set_device (new_context, device);
diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c
index d2e0348..c6c8b61 100644
--- a/gdk/win32/gdkdrawable-win32.c
+++ b/gdk/win32/gdkdrawable-win32.c
@@ -113,30 +113,9 @@ _gdk_win32_drawable_acquire_dc (GdkDrawable *drawable)
if (!impl->hdc)
{
- if (GDK_IS_PIXMAP_IMPL_WIN32 (impl))
- {
- impl->hdc = CreateCompatibleDC (NULL);
- if (!impl->hdc)
- WIN32_GDI_FAILED ("CreateCompatibleDC");
-
- if (impl->hdc)
- {
- impl->saved_dc_bitmap = SelectObject (impl->hdc,
- impl->handle);
- if (!impl->saved_dc_bitmap)
- {
- WIN32_GDI_FAILED ("CreateCompatibleDC");
- DeleteDC (impl->hdc);
- impl->hdc = NULL;
- }
- }
- }
- else
- {
- impl->hdc = GetDC (impl->handle);
- if (!impl->hdc)
- WIN32_GDI_FAILED ("GetDC");
- }
+ impl->hdc = GetDC (impl->handle);
+ if (!impl->hdc)
+ WIN32_GDI_FAILED ("GetDC");
}
if (impl->hdc)
@@ -175,10 +154,7 @@ _gdk_win32_drawable_release_dc (GdkDrawable *drawable)
if (impl->hdc)
{
- if (GDK_IS_PIXMAP_IMPL_WIN32 (impl))
- GDI_CALL (DeleteDC, (impl->hdc));
- else
- GDI_CALL (ReleaseDC, (impl->handle, impl->hdc));
+ GDI_CALL (ReleaseDC, (impl->handle, impl->hdc));
impl->hdc = NULL;
}
}
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 5dd9a78..fb8a7d0 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -1193,102 +1193,6 @@ synthesize_enter_or_leave_event (GdkWindow *window,
_gdk_device_wintab_update_window_coords (window);
}
-static void
-synthesize_expose_events (GdkWindow *window)
-{
- RECT r;
- HDC hdc;
- GdkDrawableImplWin32 *impl = GDK_DRAWABLE_IMPL_WIN32 (((GdkWindowObject *) window)->impl);
- GList *list = gdk_window_get_children (window);
- GList *head = list;
- GdkEvent *event;
- int k;
-
- while (list)
- {
- synthesize_expose_events ((GdkWindow *) list->data);
- list = list->next;
- }
-
- g_list_free (head);
-
- if (((GdkWindowObject *) window)->input_only)
- ;
- else if (!(hdc = GetDC (impl->handle)))
- WIN32_GDI_FAILED ("GetDC");
- else
- {
- if ((k = GetClipBox (hdc, &r)) == ERROR)
- WIN32_GDI_FAILED ("GetClipBox");
- else if (k != NULLREGION)
- {
- event = gdk_event_new (GDK_EXPOSE);
- event->expose.window = window;
- event->expose.area.x = r.left;
- event->expose.area.y = r.top;
- event->expose.area.width = r.right - r.left;
- event->expose.area.height = r.bottom - r.top;
- event->expose.region = cairo_region_create_rectangle (&(event->expose.area));
- event->expose.count = 0;
-
- append_event (event);
- }
- GDI_CALL (ReleaseDC, (impl->handle, hdc));
- }
-}
-
-static void
-update_colors (GdkWindow *window,
- gboolean top)
-{
- HDC hdc;
- GdkDrawableImplWin32 *impl = GDK_DRAWABLE_IMPL_WIN32 (((GdkWindowObject *) window)->impl);
- GList *list = gdk_window_get_children (window);
- GList *head = list;
-
- GDK_NOTE (COLORMAP, (top ? g_print ("update_colors:") : (void) 0));
-
- while (list)
- {
- update_colors ((GdkWindow *) list->data, FALSE);
- list = list->next;
- }
- g_list_free (head);
-
- if (((GdkWindowObject *) window)->input_only ||
- impl->colormap == NULL)
- return;
-
- if (!(hdc = GetDC (impl->handle)))
- WIN32_GDI_FAILED ("GetDC");
- else
- {
- GdkColormapPrivateWin32 *cmapp = GDK_WIN32_COLORMAP_DATA (impl->colormap);
- HPALETTE holdpal;
- gint k;
-
- if ((holdpal = SelectPalette (hdc, cmapp->hpal, TRUE)) == NULL)
- WIN32_GDI_FAILED ("SelectPalette");
- else if ((k = RealizePalette (hdc)) == GDI_ERROR)
- WIN32_GDI_FAILED ("RealizePalette");
- else
- {
- GDK_NOTE (COLORMAP,
- (k > 0 ?
- g_print (" %p pal=%p: realized %d colors\n"
- "update_colors:",
- impl->handle, cmapp->hpal, k) :
- (void) 0,
- g_print (" %p", impl->handle)));
- GDI_CALL (UpdateColors, (hdc));
- SelectPalette (hdc, holdpal, TRUE);
- RealizePalette (hdc);
- }
- GDI_CALL (ReleaseDC, (impl->handle, hdc));
- }
- GDK_NOTE (COLORMAP, (top ? g_print ("\n") : (void) 0));
-}
-
/* The check_extended flag controls whether to check if the windows want
* events from extended input devices and if the message should be skipped
* because an extended input device is active
@@ -1840,7 +1744,6 @@ gdk_event_translate (MSG *msg,
GdkDeviceGrabInfo *pointer_grab = NULL;
GdkWindow *grab_window = NULL;
- static gint update_colors_counter = 0;
gint button;
GdkAtom target;
@@ -2438,35 +2341,6 @@ gdk_event_translate (MSG *msg,
(g_print (" %d", HIWORD (msg->wParam)), 0) : 0));
break;
- case WM_QUERYNEWPALETTE:
- if (gdk_visual_get_system ()->type == GDK_VISUAL_PSEUDO_COLOR)
- {
- synthesize_expose_events (window);
- update_colors_counter = 0;
- }
- return_val = TRUE;
- break;
-
- case WM_PALETTECHANGED:
- GDK_NOTE (EVENTS_OR_COLORMAP, g_print (" %p", (HWND) msg->wParam));
- if (gdk_visual_get_system ()->type != GDK_VISUAL_PSEUDO_COLOR)
- break;
-
- return_val = TRUE;
-
- if (msg->hwnd == (HWND) msg->wParam)
- break;
-
- if (++update_colors_counter == 5)
- {
- synthesize_expose_events (window);
- update_colors_counter = 0;
- break;
- }
-
- update_colors (window, TRUE);
- break;
-
case WM_MOUSEACTIVATE:
{
GdkWindow *tmp;
diff --git a/gtk/gtkplug-win32.c b/gtk/gtkplug-win32.c
index 15031fa..8b80bf3 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 "gtkdebug.h"
#include "win32/gdkwin32.h"
diff --git a/gtk/gtksocket-win32.c b/gtk/gtksocket-win32.c
index d300304..5c96d55 100644
--- a/gtk/gtksocket-win32.c
+++ b/gtk/gtksocket-win32.c
@@ -34,6 +34,7 @@
#include "gtkprivate.h"
#include "gtksocket.h"
#include "gtksocketprivate.h"
+#include "gtkdebug.h"
#include "win32/gdkwin32.h"
diff --git a/gtk/gtkwin32embedwidget.c b/gtk/gtkwin32embedwidget.c
index 02af7a1..7ab456d 100644
--- a/gtk/gtkwin32embedwidget.c
+++ b/gtk/gtkwin32embedwidget.c
@@ -250,7 +250,7 @@ gtk_win32_embed_widget_realize (GtkWidget *widget)
static void
gtk_win32_embed_widget_show (GtkWidget *widget)
{
- GTK_WIDGET_SET_FLAGS (widget, GTK_VISIBLE);
+ gtk_widget_set_visible (widget, TRUE);
gtk_widget_realize (widget);
gtk_container_check_resize (GTK_CONTAINER (widget));
@@ -260,7 +260,7 @@ gtk_win32_embed_widget_show (GtkWidget *widget)
static void
gtk_win32_embed_widget_hide (GtkWidget *widget)
{
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
+ gtk_widget_set_visible (widget, FALSE);
gtk_widget_unmap (widget);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]