Commit 319d2bb4 authored by Javier Jardón's avatar Javier Jardón

[gdk] Remove GdkWindowObject public structure

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=622677
parent df106318
......@@ -726,7 +726,6 @@ gdk_window_get_effective_toplevel
<SUBSECTION Standard>
GDK_WINDOW
GDK_WINDOW_GET_CLASS
GDK_WINDOW_OBJECT
GDK_TYPE_WINDOW
GDK_IS_WINDOW
GDK_WINDOW_CLASS
......
......@@ -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. */
......
......@@ -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
{
......
......@@ -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);
......
#undef GDK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#ifdef GDK_WINDOWING_X11
#include <X11/Xlib.h>
......@@ -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,13 +750,15 @@ 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,
"background-gdk", color,
NULL);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment