From 319d2bb4f1332e2e35d70a6acccb3b12b87dfd89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Fri, 25 Jun 2010 03:02:20 +0200 Subject: [PATCH] [gdk] Remove GdkWindowObject public structure Fixes https://bugzilla.gnome.org/show_bug.cgi?id=622677 --- docs/reference/gdk/gdk3-sections.txt | 1 - gdk/gdkinternals.h | 5 +-- gdk/gdkwindow.h | 62 ---------------------------- gtk/gtktestutils.c | 8 +--- tests/testwindows.c | 19 ++++----- 5 files changed, 11 insertions(+), 84 deletions(-) diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt index b253eaeeb2..7c5a049f3a 100644 --- a/docs/reference/gdk/gdk3-sections.txt +++ b/docs/reference/gdk/gdk3-sections.txt @@ -726,7 +726,6 @@ gdk_window_get_effective_toplevel GDK_WINDOW GDK_WINDOW_GET_CLASS -GDK_WINDOW_OBJECT GDK_TYPE_WINDOW GDK_IS_WINDOW GDK_WINDOW_CLASS diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index becfb15676..4e2b074de6 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -188,9 +188,10 @@ typedef void (* GdkDisplayPointerInfoForeach) (GdkDisplay *display, is public for historical reasons. Don't change that part */ typedef struct _GdkWindowPaint GdkWindowPaint; +#define GDK_WINDOW_OBJECT(object) ((GdkWindowObject *) GDK_WINDOW (object)) + struct _GdkWindowObject { - /* vvvvvvv THIS PART IS PUBLIC. DON'T CHANGE vvvvvvvvvvvvvv */ GdkDrawable parent_instance; GdkDrawable *impl; /* window-system-specific delegate object */ @@ -239,8 +240,6 @@ struct _GdkWindowObject GdkWindowRedirect *redirect; - /* ^^^^^^^^^^ THIS PART IS PUBLIC. DON'T CHANGE ^^^^^^^^^^ */ - /* The GdkWindowObject that has the impl, ref:ed if another window. * This ref is required to keep the wrapper of the impl window alive * for as long as any GdkWindow references the impl. */ diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h index 1e15438c71..cdc250043c 100644 --- a/gdk/gdkwindow.h +++ b/gdk/gdkwindow.h @@ -491,68 +491,6 @@ typedef struct _GdkWindowObjectClass GdkWindowObjectClass; #define GDK_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW)) #define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowObjectClass)) -#ifndef GDK_DISABLE_DEPRECATED -#define GDK_WINDOW_OBJECT(object) ((GdkWindowObject *) GDK_WINDOW (object)) - -#ifndef GDK_COMPILATION - -/* We used to export all of GdkWindowObject, but we don't want to keep doing so. - However, there are various parts of it accessed by macros and other code, - so we keep the old exported version public, but in reality it is larger. */ - -/**** DON'T CHANGE THIS STRUCT, the real version is in gdkinternals.h ****/ -struct _GdkWindowObject -{ - GdkDrawable parent_instance; - - GdkDrawable *GSEAL (impl); /* window-system-specific delegate object */ - - GdkWindowObject *GSEAL (parent); - - gpointer GSEAL (user_data); - - gint GSEAL (x); - gint GSEAL (y); - - gint GSEAL (extension_events); - - GList *GSEAL (filters); - GList *GSEAL (children); - - GdkColor GSEAL (bg_color); - GdkPixmap *GSEAL (bg_pixmap); - - GSList *GSEAL (paint_stack); - - cairo_region_t *GSEAL (update_area); - guint GSEAL (update_freeze_count); - - guint8 GSEAL (window_type); - guint8 GSEAL (depth); - guint8 GSEAL (resize_count); - - GdkWindowState GSEAL (state); - - guint GSEAL (guffaw_gravity) : 1; - guint GSEAL (input_only) : 1; - guint GSEAL (modal_hint) : 1; - guint GSEAL (composited) : 1; - - guint GSEAL (destroyed) : 2; - - guint GSEAL (accept_focus) : 1; - guint GSEAL (focus_on_map) : 1; - guint GSEAL (shaped) : 1; - guint GSEAL (support_multidevice) : 1; - - GdkEventMask GSEAL (event_mask); - - guint GSEAL (update_and_descendants_freeze_count); - - GdkWindowRedirect *GSEAL (redirect); -}; -#endif -#endif struct _GdkWindowObjectClass { diff --git a/gtk/gtktestutils.c b/gtk/gtktestutils.c index ab9e267f0c..dac8f1daec 100644 --- a/gtk/gtktestutils.c +++ b/gtk/gtktestutils.c @@ -18,10 +18,6 @@ * Boston, MA 02111-1307, USA. */ -/* need to get the prototypes of all get_type functions */ -#undef GTK_DISABLE_DEPRECATED -/* Need to get GDK_WINDOW_OBJECT */ -#undef GDK_DISABLE_DEPRECATED #include "config.h" @@ -92,13 +88,13 @@ test_find_widget_input_windows (GtkWidget *widget, GSList *matches = NULL; gpointer udata; gdk_window_get_user_data (widget->window, &udata); - if (udata == widget && (!input_only || (GDK_IS_WINDOW (widget->window) && GDK_WINDOW_OBJECT (widget->window)->input_only))) + if (udata == widget && (!input_only || (GDK_IS_WINDOW (widget->window) && gdk_window_is_input_only (GDK_WINDOW (widget->window))))) matches = g_slist_prepend (matches, widget->window); children = gdk_window_get_children (gtk_widget_get_parent_window (widget)); for (node = children; node; node = node->next) { gdk_window_get_user_data (node->data, &udata); - if (udata == widget && (!input_only || (GDK_IS_WINDOW (node->data) && GDK_WINDOW_OBJECT (node->data)->input_only))) + if (udata == widget && (!input_only || (GDK_IS_WINDOW (node->data) && gdk_window_is_input_only (GDK_WINDOW (node->data))))) matches = g_slist_prepend (matches, node->data); } return g_slist_reverse (matches); diff --git a/tests/testwindows.c b/tests/testwindows.c index 24c31546b4..457072a8fa 100644 --- a/tests/testwindows.c +++ b/tests/testwindows.c @@ -1,4 +1,3 @@ -#undef GDK_DISABLE_DEPRECATED #include #ifdef GDK_WINDOWING_X11 #include @@ -12,13 +11,6 @@ static void update_store (void); static GtkWidget *main_window; -static gboolean -window_has_impl (GdkWindow *window) -{ - GdkWindowObject *w; - w = (GdkWindowObject *)window; - return w->parent == NULL || w->parent->impl != w->impl; -} GdkWindow * create_window (GdkWindow *parent, @@ -272,7 +264,7 @@ save_window (GString *s, g_string_append_printf (s, "%d,%d %dx%d (%d,%d,%d) %d %d\n", x, y, w, h, color->red, color->green, color->blue, - window_has_impl (window), + gdk_window_has_native (window), g_list_length (gdk_window_peek_children (window))); save_children (s, window); @@ -749,6 +741,7 @@ render_window_cell (GtkTreeViewColumn *tree_column, GtkTreeIter *iter, gpointer data) { + GdkColor *color = NULL; GdkWindow *window; char *name; @@ -757,14 +750,16 @@ render_window_cell (GtkTreeViewColumn *tree_column, 0, &window, -1); - if (window_has_impl (window)) + if (gdk_window_has_native (window)) name = g_strdup_printf ("%p (native)", window); else name = g_strdup_printf ("%p", window); + + gdk_window_get_background (window, color); g_object_set (cell, "text", name, - "background-gdk", &((GdkWindowObject *)window)->bg_color, - NULL); + "background-gdk", color, + NULL); } static void