diff options
Diffstat (limited to 'gdk/x11')
-rw-r--r-- | gdk/x11/gdkcairocontext-x11.c | 1 | ||||
-rw-r--r-- | gdk/x11/gdkdevice-core-x11.c | 21 | ||||
-rw-r--r-- | gdk/x11/gdkdevice-xi2.c | 6 | ||||
-rw-r--r-- | gdk/x11/gdkdevicemanager-core-x11.c | 5 | ||||
-rw-r--r-- | gdk/x11/gdkdevicemanager-xi2.c | 4 | ||||
-rw-r--r-- | gdk/x11/gdkdisplay-x11.c | 16 | ||||
-rw-r--r-- | gdk/x11/gdkdrag-x11.c | 17 | ||||
-rw-r--r-- | gdk/x11/gdkdrop-x11.c | 4 | ||||
-rw-r--r-- | gdk/x11/gdkglcontext-x11.c | 10 | ||||
-rw-r--r-- | gdk/x11/gdkprivate-x11.h | 14 | ||||
-rw-r--r-- | gdk/x11/gdksurface-x11. | 0 | ||||
-rw-r--r-- | gdk/x11/gdksurface-x11.c | 264 | ||||
-rw-r--r-- | gdk/x11/gdksurface-x11.h | 36 |
13 files changed, 188 insertions, 210 deletions
diff --git a/gdk/x11/gdkcairocontext-x11.c b/gdk/x11/gdkcairocontext-x11.c index 00a3e18be3..3409e30b97 100644 --- a/gdk/x11/gdkcairocontext-x11.c +++ b/gdk/x11/gdkcairocontext-x11.c @@ -25,6 +25,7 @@ #include "gdkprivate-x11.h" #include "gdkcairo.h" +#include "gdksurfaceprivate.h" #include "gdkinternals.h" #include <X11/Xlib.h> diff --git a/gdk/x11/gdkdevice-core-x11.c b/gdk/x11/gdkdevice-core-x11.c index 20318618ca..59eca14b31 100644 --- a/gdk/x11/gdkdevice-core-x11.c +++ b/gdk/x11/gdkdevice-core-x11.c @@ -21,8 +21,6 @@ #include "gdkx11device-core.h" #include "gdkdeviceprivate.h" -#include "gdkinternals.h" -#include "gdksurface.h" #include "gdkprivate-x11.h" #include "gdkdisplay-x11.h" #include "gdkasync.h" @@ -112,15 +110,13 @@ gdk_x11_device_core_get_history (GdkDevice *device, { XTimeCoord *xcoords; GdkTimeCoord **coords; - GdkSurface *impl_surface; - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; int tmp_n_events; int i, j; - impl_surface = gdk_surface_get_impl_surface (surface); - impl = GDK_SURFACE_IMPL_X11 (impl_surface->impl); + impl = GDK_X11_SURFACE (surface); xcoords = XGetMotionEvents (GDK_SURFACE_XDISPLAY (surface), - GDK_SURFACE_XID (impl_surface), + GDK_SURFACE_XID (surface), start, stop, &tmp_n_events); if (!xcoords) return FALSE; @@ -226,7 +222,7 @@ gdk_x11_device_core_query_state (GdkDevice *device, else { xwindow = GDK_SURFACE_XID (surface); - scale = GDK_SURFACE_IMPL_X11 (surface->impl)->surface_scale; + scale = GDK_X11_SURFACE (surface)->surface_scale; } if (!GDK_X11_DISPLAY (display)->trusted_client || @@ -293,9 +289,6 @@ gdk_x11_device_core_grab (GdkDevice *device, xwindow = GDK_SURFACE_XID (surface); - if (confine_to) - confine_to = gdk_surface_get_impl_surface (confine_to); - if (!confine_to || GDK_SURFACE_DESTROYED (confine_to)) xconfine_to = None; else @@ -382,7 +375,7 @@ gdk_x11_device_core_surface_at_position (GdkDevice *device, GdkModifierType *mask, gboolean get_toplevel) { - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; GdkDisplay *display; Display *xdisplay; GdkSurface *surface; @@ -432,7 +425,7 @@ gdk_x11_device_core_surface_at_position (GdkDevice *device, for (list = toplevels; list != NULL; list = list->next) { surface = GDK_SURFACE (list->data); - impl = GDK_SURFACE_IMPL_X11 (surface->impl); + impl = GDK_X11_SURFACE (surface); xwindow = GDK_SURFACE_XID (surface); gdk_x11_display_error_trap_push (display); XQueryPointer (xdisplay, xwindow, @@ -500,7 +493,7 @@ gdk_x11_device_core_surface_at_position (GdkDevice *device, surface = gdk_x11_surface_lookup_for_display (display, last); impl = NULL; if (surface) - impl = GDK_SURFACE_IMPL_X11 (surface->impl); + impl = GDK_X11_SURFACE (surface); if (win_x) *win_x = (surface) ? (double)xwin_x / impl->surface_scale : -1; diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c index 255cad2ba4..f6b94da061 100644 --- a/gdk/x11/gdkdevice-xi2.c +++ b/gdk/x11/gdkdevice-xi2.c @@ -318,7 +318,7 @@ gdk_x11_device_xi2_query_state (GdkDevice *device, else { xwindow = GDK_SURFACE_XID (surface); - scale = GDK_SURFACE_IMPL_X11 (surface->impl)->surface_scale; + scale = GDK_X11_SURFACE (surface)->surface_scale; } if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_SLAVE) @@ -467,7 +467,7 @@ gdk_x11_device_xi2_surface_at_position (GdkDevice *device, GdkModifierType *mask, gboolean get_toplevel) { - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; GdkX11DeviceXI2 *device_xi2 = GDK_X11_DEVICE_XI2 (device); GdkDisplay *display; GdkX11Screen *screen; @@ -616,7 +616,7 @@ gdk_x11_device_xi2_surface_at_position (GdkDevice *device, surface = gdk_x11_surface_lookup_for_display (display, last); impl = NULL; if (surface) - impl = GDK_SURFACE_IMPL_X11 (surface->impl); + impl = GDK_X11_SURFACE (surface); if (mask) *mask = _gdk_x11_device_xi2_translate_state (&mod_state, &button_state, &group_state); diff --git a/gdk/x11/gdkdevicemanager-core-x11.c b/gdk/x11/gdkdevicemanager-core-x11.c index dc0a51be55..927eb4c078 100644 --- a/gdk/x11/gdkdevicemanager-core-x11.c +++ b/gdk/x11/gdkdevicemanager-core-x11.c @@ -22,6 +22,7 @@ #include "gdkx11device-core.h" #include "gdkdeviceprivate.h" +#include "gdksurfaceprivate.h" #include "gdkseatdefaultprivate.h" #include "gdkdisplayprivate.h" #include "gdkeventtranslator.h" @@ -342,7 +343,7 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator, GdkEvent *event, const XEvent *xevent) { - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; GdkX11DeviceManagerCore *device_manager; GdkSurface *surface; gboolean return_val; @@ -360,7 +361,7 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator, return FALSE; g_object_ref (surface); - impl = GDK_SURFACE_IMPL_X11 (surface->impl); + impl = GDK_X11_SURFACE (surface); scale = impl->surface_scale; } diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c index 0f0f0aadce..372dc82719 100644 --- a/gdk/x11/gdkdevicemanager-xi2.c +++ b/gdk/x11/gdkdevicemanager-xi2.c @@ -1428,7 +1428,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator, GdkDevice *device, *source_device; gboolean return_val = TRUE; GdkSurface *surface; - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; int scale; XIEvent *ev; @@ -1454,7 +1454,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator, scale = 1; if (surface) { - impl = GDK_SURFACE_IMPL_X11 (surface->impl); + impl = GDK_X11_SURFACE (surface); scale = impl->surface_scale; } diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 398ce7b22c..5b3f7c74cd 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -34,6 +34,7 @@ #include "gdkframeclockprivate.h" #include "gdkinternals.h" #include "gdkdeviceprivate.h" +#include "gdksurfaceprivate.h" #include "gdkkeysprivate.h" #include "gdkmarshalers.h" #include "xsettings-client.h" @@ -638,7 +639,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, Window xwindow; GdkSurface *surface; gboolean is_substructure; - GdkSurfaceImplX11 *surface_impl = NULL; + GdkX11Surface *surface_impl = NULL; GdkX11Screen *x11_screen = NULL; GdkToplevelX11 *toplevel = NULL; GdkX11Display *display_x11 = GDK_X11_DISPLAY (display); @@ -668,7 +669,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, x11_screen = GDK_SURFACE_SCREEN (surface); toplevel = _gdk_x11_surface_get_toplevel (surface); - surface_impl = GDK_SURFACE_IMPL_X11 (surface->impl); + surface_impl = GDK_X11_SURFACE (surface); g_object_ref (surface); } @@ -1209,8 +1210,8 @@ _gdk_wm_protocols_filter (const XEvent *xevent, * in the message for everything that gets stuffed in */ if (xevent->xclient.message_type == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_FRAME_DRAWN")) { - GdkSurfaceImplX11 *surface_impl; - surface_impl = GDK_SURFACE_IMPL_X11 (win->impl); + GdkX11Surface *surface_impl; + surface_impl = GDK_X11_SURFACE (win); if (surface_impl->toplevel) { guint32 d0 = xevent->xclient.data.l[0]; @@ -1247,8 +1248,8 @@ _gdk_wm_protocols_filter (const XEvent *xevent, if (xevent->xclient.message_type == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_FRAME_TIMINGS")) { - GdkSurfaceImplX11 *surface_impl; - surface_impl = GDK_SURFACE_IMPL_X11 (win->impl); + GdkX11Surface *surface_impl; + surface_impl = GDK_X11_SURFACE (win); if (surface_impl->toplevel) { guint32 d0 = xevent->xclient.data.l[0]; @@ -3020,7 +3021,6 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class) object_class->dispose = gdk_x11_display_dispose; object_class->finalize = gdk_x11_display_finalize; - display_class->surface_type = GDK_TYPE_X11_SURFACE; display_class->cairo_context_type = GDK_TYPE_X11_CAIRO_CONTEXT; #ifdef GDK_RENDERING_VULKAN display_class->vk_context_type = GDK_TYPE_X11_VULKAN_CONTEXT; @@ -3042,7 +3042,7 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class) display_class->get_next_serial = gdk_x11_display_get_next_serial; display_class->get_startup_notification_id = gdk_x11_display_get_startup_notification_id; display_class->notify_startup_complete = gdk_x11_display_notify_startup_complete; - display_class->create_surface_impl = _gdk_x11_display_create_surface_impl; + display_class->create_surface = _gdk_x11_display_create_surface; display_class->get_keymap = gdk_x11_display_get_keymap; display_class->text_property_to_utf8_list = _gdk_x11_display_text_property_to_utf8_list; display_class->utf8_to_string_target = _gdk_x11_display_utf8_to_string_target; diff --git a/gdk/x11/gdkdrag-x11.c b/gdk/x11/gdkdrag-x11.c index f40ff8de5c..8ca3f3fb8d 100644 --- a/gdk/x11/gdkdrag-x11.c +++ b/gdk/x11/gdkdrag-x11.c @@ -33,6 +33,7 @@ #include "gdkdeviceprivate.h" #include "gdkdisplay-x11.h" #include "gdkdragprivate.h" +#include "gdksurfaceprivate.h" #include "gdkinternals.h" #include "gdkintl.h" #include "gdkproperty.h" @@ -532,14 +533,14 @@ gdk_surface_cache_new (GdkDisplay *display) { GList *toplevel_windows, *list; GdkSurface *surface; - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; gint x, y, width, height; toplevel_windows = gdk_x11_display_get_toplevel_windows (display); for (list = toplevel_windows; list; list = list->next) { surface = GDK_SURFACE (list->data); - impl = GDK_SURFACE_IMPL_X11 (surface->impl); + impl = GDK_X11_SURFACE (surface); gdk_surface_get_geometry (surface, &x, &y, &width, &height); gdk_surface_cache_add (result, GDK_SURFACE_XID (surface), x * impl->surface_scale, y * impl->surface_scale, @@ -1401,11 +1402,11 @@ drag_find_window_cache (GdkX11Drag *drag_x11, } static Window -gdk_x11_drag_find_surface (GdkDrag *drag, - GdkSurface *drag_surface, - gint x_root, - gint y_root, - GdkDragProtocol *protocol) +gdk_x11_drag_find_surface (GdkDrag *drag, + GdkSurface *drag_surface, + gint x_root, + gint y_root, + GdkDragProtocol *protocol) { GdkX11Screen *screen_x11; GdkX11Drag *drag_x11 = GDK_X11_DRAG (drag); @@ -1420,7 +1421,7 @@ gdk_x11_drag_find_surface (GdkDrag *drag, window_cache = drag_find_window_cache (drag_x11, display); dest = get_client_window_at_coords (window_cache, - drag_surface && GDK_SURFACE_IS_X11 (drag_surface) ? + drag_surface && GDK_IS_X11_SURFACE (drag_surface) ? GDK_SURFACE_XID (drag_surface) : None, x_root * screen_x11->surface_scale, y_root * screen_x11->surface_scale); diff --git a/gdk/x11/gdkdrop-x11.c b/gdk/x11/gdkdrop-x11.c index bb5fbef238..7c8712c09f 100644 --- a/gdk/x11/gdkdrop-x11.c +++ b/gdk/x11/gdkdrop-x11.c @@ -621,7 +621,7 @@ static gboolean xdnd_position_filter (GdkSurface *surface, const XEvent *xevent) { - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; Window source_window = xevent->xclient.data.l[0]; gint16 x_root = xevent->xclient.data.l[2] >> 16; gint16 y_root = xevent->xclient.data.l[2] & 0xffff; @@ -647,7 +647,7 @@ xdnd_position_filter (GdkSurface *surface, if ((drop != NULL) && (drop_x11->source_window == source_window)) { - impl = GDK_SURFACE_IMPL_X11 (gdk_drop_get_surface (drop)->impl); + impl = GDK_X11_SURFACE (gdk_drop_get_surface (drop)); drop_x11->suggested_action = xdnd_action_from_atom (display, action); gdk_x11_drop_update_actions (drop_x11); diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c index 5de9d55cf0..b95a18517c 100644 --- a/gdk/x11/gdkglcontext-x11.c +++ b/gdk/x11/gdkglcontext-x11.c @@ -410,7 +410,7 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context, GDK_DISPLAY_NOTE (GDK_DISPLAY (display_x11), OPENGL, g_message ("Using GLX_EXT_texture_from_pixmap to draw surface")); - surface = gdk_gl_context_get_surface (paint_context)->impl_surface; + surface = gdk_gl_context_get_surface (paint_context); surface_scale = gdk_surface_get_scale_factor (surface); gdk_surface_get_unscaled_size (surface, NULL, &unscaled_surface_height); @@ -679,7 +679,7 @@ gdk_x11_gl_context_realize (GdkGLContext *context, xvisinfo = find_xvisinfo_for_fbconfig (display, context_x11->glx_config); - info = get_glx_drawable_info (surface->impl_surface); + info = get_glx_drawable_info (surface); if (info == NULL) { XSetWindowAttributes attrs; @@ -708,7 +708,7 @@ gdk_x11_gl_context_realize (GdkGLContext *context, if (GDK_X11_DISPLAY (display)->glx_version >= 13) { info->glx_drawable = glXCreateWindow (dpy, context_x11->glx_config, - gdk_x11_surface_get_xid (surface->impl_surface), + gdk_x11_surface_get_xid (surface), NULL); info->dummy_glx = glXCreateWindow (dpy, context_x11->glx_config, info->dummy_xwin, NULL); } @@ -727,12 +727,12 @@ gdk_x11_gl_context_realize (GdkGLContext *context, return FALSE; } - set_glx_drawable_info (surface->impl_surface, info); + set_glx_drawable_info (surface, info); } XFree (xvisinfo); - context_x11->attached_drawable = info->glx_drawable ? info->glx_drawable : gdk_x11_surface_get_xid (surface->impl_surface); + context_x11->attached_drawable = info->glx_drawable ? info->glx_drawable : gdk_x11_surface_get_xid (surface); context_x11->unattached_drawable = info->dummy_glx ? info->dummy_glx : info->dummy_xwin; context_x11->is_direct = glXIsDirect (dpy, context_x11->glx_context); diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h index abb32a9fc8..2e2b420560 100644 --- a/gdk/x11/gdkprivate-x11.h +++ b/gdk/x11/gdkprivate-x11.h @@ -180,9 +180,14 @@ void _gdk_x11_display_get_default_cursor_size (GdkDisplay *display, void _gdk_x11_display_get_maximal_cursor_size (GdkDisplay *display, guint *width, guint *height); -void _gdk_x11_display_create_surface_impl (GdkDisplay *display, - GdkSurface *window, - GdkSurface *real_parent); + +GdkSurface * _gdk_x11_display_create_surface (GdkDisplay *display, + GdkSurfaceType surface_type, + GdkSurface *parent, + int x, + int y, + int width, + int height); GList * gdk_x11_display_get_toplevel_windows (GdkDisplay *display); void _gdk_x11_precache_atoms (GdkDisplay *display, @@ -244,7 +249,6 @@ extern const gint _gdk_x11_event_mask_table_size; #define GDK_SURFACE_SCREEN(win) (GDK_X11_DISPLAY (gdk_surface_get_display (win))->screen) #define GDK_SURFACE_DISPLAY(win) (gdk_surface_get_display (win)) #define GDK_SURFACE_XROOTWIN(win) (GDK_X11_SCREEN (GDK_SURFACE_SCREEN (win))->xroot_window) -#define GDK_SURFACE_IS_X11(win) (GDK_IS_SURFACE_IMPL_X11 ((win)->impl)) /* override some macros from gdkx.h with direct-access variants */ #undef GDK_DISPLAY_XDISPLAY @@ -254,7 +258,7 @@ extern const gint _gdk_x11_event_mask_table_size; #define GDK_DISPLAY_XDISPLAY(display) (GDK_X11_DISPLAY(display)->xdisplay) #define GDK_SURFACE_XDISPLAY(win) (GDK_X11_SCREEN (GDK_SURFACE_SCREEN (win))->xdisplay) -#define GDK_SURFACE_XID(win) (GDK_SURFACE_IMPL_X11(GDK_SURFACE (win)->impl)->xid) +#define GDK_SURFACE_XID(win) (GDK_X11_SURFACE (win)->xid) #define GDK_SCREEN_XDISPLAY(screen) (GDK_X11_SCREEN (screen)->xdisplay) #endif /* __GDK_PRIVATE_X11_H__ */ diff --git a/gdk/x11/gdksurface-x11. b/gdk/x11/gdksurface-x11. new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/gdk/x11/gdksurface-x11. diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c index fe27a00e20..956c23d7d3 100644 --- a/gdk/x11/gdksurface-x11.c +++ b/gdk/x11/gdksurface-x11.c @@ -27,12 +27,11 @@ #include "gdksurface-x11.h" -#include "gdksurface.h" -#include "gdksurfaceimpl.h" +#include "gdksurfaceprivate.h" #include "gdkvisual-x11.h" #include "gdkinternals.h" #include "gdkdeviceprivate.h" -#include "gdkframeclockprivate.h" +#include "gdkframeclockidleprivate.h" #include "gdkasync.h" #include "gdkeventsource.h" #include "gdkdisplay-x11.h" @@ -108,8 +107,6 @@ static void set_wm_name (GdkDisplay *display, const gchar *name); static void move_to_current_desktop (GdkSurface *surface); -static void gdk_surface_impl_x11_finalize (GObject *object); - #define SURFACE_IS_TOPLEVEL(surface) \ (GDK_SURFACE_TYPE (surface) == GDK_SURFACE_TOPLEVEL || \ GDK_SURFACE_TYPE (surface) == GDK_SURFACE_TEMP) @@ -122,31 +119,10 @@ static void gdk_surface_impl_x11_finalize (GObject *object); (( time1 < time2 ) && ( time2 - time1 > ((guint32)-1)/2 )) \ ) -struct _GdkX11Surface { - GdkSurface parent; -}; - -struct _GdkX11SurfaceClass { - GdkSurfaceClass parent_class; -}; - G_DEFINE_TYPE (GdkX11Surface, gdk_x11_surface, GDK_TYPE_SURFACE) static void -gdk_x11_surface_class_init (GdkX11SurfaceClass *x11_surface_class) -{ -} - -static void -gdk_x11_surface_init (GdkX11Surface *x11_surface) -{ -} - - -G_DEFINE_TYPE (GdkSurfaceImplX11, gdk_surface_impl_x11, GDK_TYPE_SURFACE_IMPL) - -static void -gdk_surface_impl_x11_init (GdkSurfaceImplX11 *impl) +gdk_x11_surface_init (GdkX11Surface *impl) { impl->surface_scale = 1; impl->frame_sync_enabled = TRUE; @@ -155,14 +131,14 @@ gdk_surface_impl_x11_init (GdkSurfaceImplX11 *impl) GdkToplevelX11 * _gdk_x11_surface_get_toplevel (GdkSurface *surface) { - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL); if (!SURFACE_IS_TOPLEVEL (surface)) return NULL; - impl = GDK_SURFACE_IMPL_X11 (surface->impl); + impl = GDK_X11_SURFACE (surface); if (!impl->toplevel) { @@ -175,13 +151,13 @@ _gdk_x11_surface_get_toplevel (GdkSurface *surface) /** * _gdk_x11_surface_update_size: - * @impl: a #GdkSurfaceImplX11. + * @impl: a #GdkX11Surface. * * Updates the state of the surface (in particular the drawable's * cairo surface) when its size has changed. **/ void -_gdk_x11_surface_update_size (GdkSurfaceImplX11 *impl) +_gdk_x11_surface_update_size (GdkX11Surface *impl) { if (impl->cairo_surface) { @@ -195,7 +171,7 @@ gdk_x11_surface_get_unscaled_size (GdkSurface *surface, int *unscaled_width, int *unscaled_height) { - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); if (unscaled_width) *unscaled_width = impl->unscaled_width; @@ -228,18 +204,18 @@ void gdk_x11_surface_pre_damage (GdkSurface *surface) { GdkSurface *toplevel_surface = surface; - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; if (!toplevel_surface || !SURFACE_IS_TOPLEVEL (toplevel_surface)) return; - impl = GDK_SURFACE_IMPL_X11 (toplevel_surface->impl); + impl = GDK_X11_SURFACE (toplevel_surface); if (impl->toplevel->in_frame && impl->toplevel->current_counter_value % 2 == 0) { impl->toplevel->current_counter_value += 1; - set_sync_counter (GDK_SURFACE_XDISPLAY (impl->wrapper), + set_sync_counter (GDK_SURFACE_XDISPLAY (surface), impl->toplevel->extended_update_counter, impl->toplevel->current_counter_value); } @@ -249,7 +225,7 @@ static void on_surface_changed (void *data) { GdkSurface *surface = data; - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); if (impl->tracking_damage) gdk_x11_surface_pre_damage (surface); @@ -267,7 +243,7 @@ on_surface_changed (void *data) static void hook_surface_changed (GdkSurface *surface) { - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); if (impl->cairo_surface) { @@ -284,7 +260,7 @@ hook_surface_changed (GdkSurface *surface) static void unhook_surface_changed (GdkSurface *surface) { - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); if (impl->cairo_surface) { @@ -299,7 +275,7 @@ unhook_surface_changed (GdkSurface *surface) static void gdk_x11_surface_predict_presentation_time (GdkSurface *surface) { - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); GdkFrameClock *clock; GdkFrameTimings *timings; gint64 presentation_time; @@ -346,11 +322,11 @@ static void gdk_x11_surface_begin_frame (GdkSurface *surface, gboolean force_frame) { - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; g_return_if_fail (GDK_IS_SURFACE (surface)); - impl = GDK_SURFACE_IMPL_X11 (surface->impl); + impl = GDK_X11_SURFACE (surface); if (!SURFACE_IS_TOPLEVEL (surface) || impl->toplevel->extended_update_counter == None) @@ -387,11 +363,11 @@ gdk_x11_surface_end_frame (GdkSurface *surface) { GdkFrameClock *clock; GdkFrameTimings *timings; - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; g_return_if_fail (GDK_IS_SURFACE (surface)); - impl = GDK_SURFACE_IMPL_X11 (surface->impl); + impl = GDK_X11_SURFACE (surface); if (!SURFACE_IS_TOPLEVEL (surface) || impl->toplevel->extended_update_counter == None || @@ -428,7 +404,7 @@ gdk_x11_surface_end_frame (GdkSurface *surface) else impl->toplevel->current_counter_value += 1; - set_sync_counter(GDK_SURFACE_XDISPLAY (impl->wrapper), + set_sync_counter(GDK_SURFACE_XDISPLAY (surface), impl->toplevel->extended_update_counter, impl->toplevel->current_counter_value); @@ -463,25 +439,22 @@ gdk_x11_surface_end_frame (GdkSurface *surface) *****************************************************/ static void -gdk_surface_impl_x11_finalize (GObject *object) +gdk_x11_surface_finalize (GObject *object) { - GdkSurface *wrapper; - GdkSurfaceImplX11 *impl; - - g_return_if_fail (GDK_IS_SURFACE_IMPL_X11 (object)); + GdkX11Surface *impl; - impl = GDK_SURFACE_IMPL_X11 (object); + g_return_if_fail (GDK_IS_X11_SURFACE (object)); - wrapper = impl->wrapper; + impl = GDK_X11_SURFACE (object); - if (SURFACE_IS_TOPLEVEL (wrapper) && impl->toplevel->in_frame) - unhook_surface_changed (wrapper); + if (SURFACE_IS_TOPLEVEL (impl) && impl->toplevel->in_frame) + unhook_surface_changed (GDK_SURFACE (impl)); - _gdk_x11_surface_grab_check_destroy (wrapper); + _gdk_x11_surface_grab_check_destroy (GDK_SURFACE (impl)); - if (!GDK_SURFACE_DESTROYED (wrapper)) + if (!GDK_SURFACE_DESTROYED (impl)) { - GdkDisplay *display = GDK_SURFACE_DISPLAY (wrapper); + GdkDisplay *display = GDK_SURFACE_DISPLAY (GDK_SURFACE (impl)); _gdk_x11_display_remove_window (display, impl->xid); if (impl->toplevel && impl->toplevel->focus_window) @@ -493,7 +466,7 @@ gdk_surface_impl_x11_finalize (GObject *object) if (impl->cursor) g_object_unref (impl->cursor); - G_OBJECT_CLASS (gdk_surface_impl_x11_parent_class)->finalize (object); + G_OBJECT_CLASS (gdk_x11_surface_parent_class)->finalize (object); } typedef struct { @@ -708,7 +681,7 @@ setup_toplevel_window (GdkSurface *surface, GdkX11Screen *x11_screen) { GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (surface); - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); GdkDisplay *display = gdk_surface_get_display (surface); Display *xdisplay = GDK_SURFACE_XDISPLAY (surface); XID xid = GDK_SURFACE_XID (surface); @@ -795,9 +768,9 @@ on_frame_clock_after_paint (GdkFrameClock *clock, static void connect_frame_clock (GdkSurface *surface) { - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; - impl = GDK_SURFACE_IMPL_X11 (surface->impl); + impl = GDK_X11_SURFACE (surface); if (SURFACE_IS_TOPLEVEL (surface) && !impl->frame_clock_connected) { GdkFrameClock *frame_clock = gdk_surface_get_frame_clock (surface); @@ -811,12 +784,18 @@ connect_frame_clock (GdkSurface *surface) } } -void -_gdk_x11_display_create_surface_impl (GdkDisplay *display, - GdkSurface *surface, - GdkSurface *real_parent) +GdkSurface * +_gdk_x11_display_create_surface (GdkDisplay *display, + GdkSurfaceType surface_type, + GdkSurface *parent, + int x, + int y, + int width, + int height) { - GdkSurfaceImplX11 *impl; + GdkSurface *surface; + GdkFrameClock *frame_clock; + GdkX11Surface *impl; GdkX11Screen *x11_screen; GdkX11Display *display_x11; @@ -836,14 +815,27 @@ _gdk_x11_display_create_surface_impl (GdkDisplay *display, display_x11 = GDK_X11_DISPLAY (display); x11_screen = GDK_X11_SCREEN (display_x11->screen); - if (real_parent) - xparent = GDK_SURFACE_XID (real_parent); + if (parent) + xparent = GDK_SURFACE_XID (parent); else xparent = GDK_SCREEN_XROOTWIN (x11_screen); - impl = g_object_new (GDK_TYPE_SURFACE_IMPL_X11, NULL); - surface->impl = GDK_SURFACE_IMPL (impl); - impl->wrapper = GDK_SURFACE (surface); + frame_clock = _gdk_frame_clock_idle_new (); + + surface = g_object_new (GDK_TYPE_X11_SURFACE, + "display", display, + "frame-clock", frame_clock, + NULL); + + g_object_unref (frame_clock); + + surface->surface_type = surface_type; + surface->x = x; + surface->y = y; + surface->width = width; + surface->height = height; + + impl = GDK_X11_SURFACE (surface); impl->surface_scale = x11_screen->surface_scale; xdisplay = x11_screen->xdisplay; @@ -933,6 +925,8 @@ _gdk_x11_display_create_surface_impl (GdkDisplay *display, connect_frame_clock (surface); gdk_surface_freeze_toplevel_updates (surface); + + return surface; } static void @@ -973,7 +967,7 @@ static void gdk_x11_surface_destroy (GdkSurface *surface, gboolean foreign_destroy) { - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); GdkToplevelX11 *toplevel; g_return_if_fail (GDK_IS_SURFACE (surface)); @@ -1000,9 +994,9 @@ gdk_x11_surface_destroy (GdkSurface *surface, static void gdk_x11_surface_destroy_notify (GdkSurface *surface) { - GdkSurfaceImplX11 *surface_impl; + GdkX11Surface *surface_impl; - surface_impl = GDK_SURFACE_IMPL_X11 ((surface)->impl); + surface_impl = GDK_X11_SURFACE (surface); if (!GDK_SURFACE_DESTROYED (surface)) { @@ -1202,7 +1196,7 @@ set_initial_hints (GdkSurface *surface) } static void -gdk_surface_x11_show (GdkSurface *surface, gboolean already_mapped) +gdk_x11_surface_show (GdkSurface *surface, gboolean already_mapped) { GdkDisplay *display; GdkX11Display *display_x11; @@ -1236,7 +1230,7 @@ gdk_surface_x11_show (GdkSurface *surface, gboolean already_mapped) } static void -gdk_surface_x11_withdraw (GdkSurface *surface) +gdk_x11_surface_withdraw (GdkSurface *surface) { if (!surface->destroyed) { @@ -1253,7 +1247,7 @@ gdk_surface_x11_withdraw (GdkSurface *surface) } static void -gdk_surface_x11_hide (GdkSurface *surface) +gdk_x11_surface_hide (GdkSurface *surface) { /* We'll get the unmap notify eventually, and handle it then, * but checking here makes things more consistent if we are @@ -1267,7 +1261,7 @@ gdk_surface_x11_hide (GdkSurface *surface) { case GDK_SURFACE_TOPLEVEL: case GDK_SURFACE_TEMP: /* ? */ - gdk_surface_x11_withdraw (surface); + gdk_x11_surface_withdraw (surface); return; default: @@ -1281,11 +1275,11 @@ gdk_surface_x11_hide (GdkSurface *surface) } static inline void -surface_x11_move (GdkSurface *surface, +x11_surface_move (GdkSurface *surface, gint x, gint y) { - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); XMoveWindow (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XID (surface), @@ -1299,11 +1293,11 @@ surface_x11_move (GdkSurface *surface, } static inline void -surface_x11_resize (GdkSurface *surface, +x11_surface_resize (GdkSurface *surface, gint width, gint height) { - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); if (width < 1) width = 1; @@ -1323,7 +1317,7 @@ surface_x11_resize (GdkSurface *surface, impl->unscaled_height = height * impl->surface_scale; surface->width = width; surface->height = height; - _gdk_x11_surface_update_size (GDK_SURFACE_IMPL_X11 (surface->impl)); + _gdk_x11_surface_update_size (GDK_X11_SURFACE (surface)); } else { @@ -1333,13 +1327,13 @@ surface_x11_resize (GdkSurface *surface, } static inline void -surface_x11_move_resize (GdkSurface *surface, +x11_surface_move_resize (GdkSurface *surface, gint x, gint y, gint width, gint height) { - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); if (width < 1) width = 1; @@ -1364,7 +1358,7 @@ surface_x11_move_resize (GdkSurface *surface, surface->width = width; surface->height = height; - _gdk_x11_surface_update_size (GDK_SURFACE_IMPL_X11 (surface->impl)); + _gdk_x11_surface_update_size (GDK_X11_SURFACE (surface)); } else { @@ -1374,7 +1368,7 @@ surface_x11_move_resize (GdkSurface *surface, } static void -gdk_surface_x11_move_resize (GdkSurface *surface, +gdk_x11_surface_move_resize (GdkSurface *surface, gboolean with_move, gint x, gint y, @@ -1382,13 +1376,13 @@ gdk_surface_x11_move_resize (GdkSurface *surface, gint height) { if (with_move && (width < 0 && height < 0)) - surface_x11_move (surface, x, y); + x11_surface_move (surface, x, y); else { if (with_move) - surface_x11_move_resize (surface, x, y, width, height); + x11_surface_move_resize (surface, x, y, width, height); else - surface_x11_resize (surface, width, height); + x11_surface_resize (surface, width, height); } } @@ -1396,11 +1390,11 @@ void _gdk_x11_surface_set_surface_scale (GdkSurface *surface, int scale) { - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; GdkToplevelX11 *toplevel; GdkSurfaceHints geom_mask; - impl = GDK_SURFACE_IMPL_X11 (surface->impl); + impl = GDK_X11_SURFACE (surface); impl->surface_scale = scale; if (impl->cairo_surface) @@ -1434,13 +1428,13 @@ _gdk_x11_surface_set_surface_scale (GdkSurface *surface, } static void -gdk_surface_x11_raise (GdkSurface *surface) +gdk_x11_surface_raise (GdkSurface *surface) { XRaiseWindow (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XID (surface)); } static void -gdk_surface_x11_restack_toplevel (GdkSurface *surface, +gdk_x11_surface_restack_toplevel (GdkSurface *surface, GdkSurface *sibling, gboolean above) { @@ -1455,7 +1449,7 @@ gdk_surface_x11_restack_toplevel (GdkSurface *surface, } static void -gdk_surface_x11_lower (GdkSurface *surface) +gdk_x11_surface_lower (GdkSurface *surface) { XLowerWindow (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XID (surface)); } @@ -1875,7 +1869,7 @@ gdk_x11_surface_set_geometry_hints (GdkSurface *surface, const GdkGeometry *geometry, GdkSurfaceHints geom_mask) { - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); XSizeHints size_hints; GdkToplevelX11 *toplevel; @@ -1992,7 +1986,7 @@ gdk_surface_get_geometry_hints (GdkSurface *surface, GdkGeometry *geometry, GdkSurfaceHints *geom_mask) { - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; XSizeHints *size_hints; glong junk_supplied_mask = 0; @@ -2006,7 +2000,7 @@ gdk_surface_get_geometry_hints (GdkSurface *surface, !SURFACE_IS_TOPLEVEL (surface)) return; - impl = GDK_SURFACE_IMPL_X11 (surface->impl); + impl = GDK_X11_SURFACE (surface); size_hints = XAllocSizeHints (); if (!size_hints) @@ -2220,23 +2214,23 @@ gdk_x11_surface_set_transient_for (GdkSurface *surface, GdkCursor * _gdk_x11_surface_get_cursor (GdkSurface *surface) { - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL); - impl = GDK_SURFACE_IMPL_X11 (surface->impl); + impl = GDK_X11_SURFACE (surface); return impl->cursor; } static void -gdk_surface_x11_get_geometry (GdkSurface *surface, +gdk_x11_surface_get_geometry (GdkSurface *surface, gint *x, gint *y, gint *width, gint *height) { - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; Window root; gint tx; gint ty; @@ -2247,7 +2241,7 @@ gdk_surface_x11_get_geometry (GdkSurface *surface, if (!GDK_SURFACE_DESTROYED (surface)) { - impl = GDK_SURFACE_IMPL_X11 (surface->impl); + impl = GDK_X11_SURFACE (surface); XGetGeometry (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XID (surface), @@ -2265,13 +2259,13 @@ gdk_surface_x11_get_geometry (GdkSurface *surface, } static void -gdk_surface_x11_get_root_coords (GdkSurface *surface, +gdk_x11_surface_get_root_coords (GdkSurface *surface, gint x, gint y, gint *root_x, gint *root_y) { - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); Window child; gint tx; gint ty; @@ -2293,7 +2287,7 @@ gdk_x11_surface_get_frame_extents (GdkSurface *surface, GdkRectangle *rect) { GdkDisplay *display; - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; Window xwindow; Window xparent; Window root; @@ -2319,7 +2313,7 @@ gdk_x11_surface_get_frame_extents (GdkSurface *surface, rect->width = 1; rect->height = 1; - impl = GDK_SURFACE_IMPL_X11 (surface->impl); + impl = GDK_X11_SURFACE (surface); /* Refine our fallback answer a bit using local information */ rect->x = surface->x * impl->surface_scale; @@ -2457,7 +2451,7 @@ gdk_x11_surface_get_frame_extents (GdkSurface *surface, } static gboolean -gdk_surface_x11_get_device_state (GdkSurface *surface, +gdk_x11_surface_get_device_state (GdkSurface *surface, GdkDevice *device, gdouble *x, gdouble *y, @@ -2477,13 +2471,13 @@ gdk_surface_x11_get_device_state (GdkSurface *surface, } static void -gdk_surface_x11_input_shape_combine_region (GdkSurface *surface, +gdk_x11_surface_input_shape_combine_region (GdkSurface *surface, const cairo_region_t *shape_region, gint offset_x, gint offset_y) { #ifdef ShapeInput - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); if (GDK_SURFACE_DESTROYED (surface)) return; @@ -2665,7 +2659,7 @@ gdk_x11_surface_set_shadow_width (GdkSurface *surface, int top, int bottom) { - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); Atom frame_extents; gulong data[4] = { left * impl->surface_scale, @@ -3570,7 +3564,7 @@ wmspec_send_message (GdkDisplay *display, gint action, gint button) { - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); XClientMessageEvent xclient; memset (&xclient, 0, sizeof (xclient)); @@ -3947,7 +3941,7 @@ _gdk_x11_moveresize_handle_event (const XEvent *event) guint button_mask = 0; GdkDisplay *display = gdk_x11_lookup_xdisplay (event->xany.display); MoveResizeData *mv_resize = get_move_resize_data (display, FALSE); - GdkSurfaceImplX11 *impl; + GdkX11Surface *impl; if (!mv_resize || !mv_resize->moveresize_surface) { @@ -3955,7 +3949,7 @@ _gdk_x11_moveresize_handle_event (const XEvent *event) return FALSE; } - impl = GDK_SURFACE_IMPL_X11 (mv_resize->moveresize_surface->impl); + impl = GDK_X11_SURFACE (mv_resize->moveresize_surface); if (mv_resize->moveresize_button != 0) button_mask = GDK_BUTTON1_MASK << (mv_resize->moveresize_button - 1); @@ -4270,7 +4264,7 @@ gdk_x11_surface_begin_resize_drag (GdkSurface *surface, !SURFACE_IS_TOPLEVEL (surface)) return; - gdk_surface_x11_get_root_coords (surface, x, y, &root_x, &root_y); + gdk_x11_surface_get_root_coords (surface, x, y, &root_x, &root_y); /* Avoid EWMH for touch devices */ if (_should_perform_ewmh_drag (surface, device)) @@ -4298,7 +4292,7 @@ gdk_x11_surface_begin_move_drag (GdkSurface *surface, else direction = _NET_WM_MOVERESIZE_MOVE; - gdk_surface_x11_get_root_coords (surface, x, y, &root_x, &root_y); + gdk_x11_surface_get_root_coords (surface, x, y, &root_x, &root_y); /* Avoid EWMH for touch devices */ if (_should_perform_ewmh_drag (surface, device)) @@ -4430,13 +4424,13 @@ gdk_x11_get_server_time (GdkSurface *surface) XID gdk_x11_surface_get_xid (GdkSurface *surface) { - return GDK_SURFACE_IMPL_X11 (surface->impl)->xid; + return GDK_X11_SURFACE (surface)->xid; } static gint gdk_x11_surface_get_scale_factor (GdkSurface *surface) { - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); if (GDK_SURFACE_DESTROYED (surface)) return 1; @@ -4460,14 +4454,14 @@ void gdk_x11_surface_set_frame_sync_enabled (GdkSurface *surface, gboolean frame_sync_enabled) { - GDK_SURFACE_IMPL_X11 (surface->impl)->frame_sync_enabled = FALSE; + GDK_X11_SURFACE (surface)->frame_sync_enabled = FALSE; } static void gdk_x11_surface_set_opaque_region (GdkSurface *surface, cairo_region_t *region) { - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); GdkDisplay *display; int nitems; gulong *data; @@ -4514,7 +4508,7 @@ static gboolean gdk_x11_surface_show_window_menu (GdkSurface *surface, GdkEvent *event) { - GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (surface->impl); + GdkX11Surface *impl = GDK_X11_SURFACE (surface); GdkDisplay *display = GDK_SURFACE_DISPLAY (surface); GdkDevice *device; int device_id; @@ -4536,7 +4530,7 @@ gdk_x11_surface_show_window_menu (GdkSurface *surface, return FALSE; gdk_event_get_coords (event, &x, &y); - gdk_surface_x11_get_root_coords (surface, x, y, &x_root, &y_root); + gdk_x11_surface_get_root_coords (surface, x, y, &x_root, &y_root); device = gdk_event_get_device (event); g_object_get (G_OBJECT (device), "device-id", &device_id, @@ -4561,24 +4555,24 @@ gdk_x11_surface_show_window_menu (GdkSurface *surface, } static void -gdk_surface_impl_x11_class_init (GdkSurfaceImplX11Class *klass) +gdk_x11_surface_class_init (GdkX11SurfaceClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_CLASS (klass); + GdkSurfaceClass *impl_class = GDK_SURFACE_CLASS (klass); - object_class->finalize = gdk_surface_impl_x11_finalize; + object_class->finalize = gdk_x11_surface_finalize; - impl_class->show = gdk_surface_x11_show; - impl_class->hide = gdk_surface_x11_hide; - impl_class->withdraw = gdk_surface_x11_withdraw; - impl_class->raise = gdk_surface_x11_raise; - impl_class->lower = gdk_surface_x11_lower; - impl_class->restack_toplevel = gdk_surface_x11_restack_toplevel; - impl_class->move_resize = gdk_surface_x11_move_resize; - impl_class->get_geometry = gdk_surface_x11_get_geometry; - impl_class->get_root_coords = gdk_surface_x11_get_root_coords; - impl_class->get_device_state = gdk_surface_x11_get_device_state; - impl_class->input_shape_combine_region = gdk_surface_x11_input_shape_combine_region; + impl_class->show = gdk_x11_surface_show; + impl_class->hide = gdk_x11_surface_hide; + impl_class->withdraw = gdk_x11_surface_withdraw; + impl_class->raise = gdk_x11_surface_raise; + impl_class->lower = gdk_x11_surface_lower; + impl_class->restack_toplevel = gdk_x11_surface_restack_toplevel; + impl_class->move_resize = gdk_x11_surface_move_resize; + impl_class->get_geometry = gdk_x11_surface_get_geometry; + impl_class->get_root_coords = gdk_x11_surface_get_root_coords; + impl_class->get_device_state = gdk_x11_surface_get_device_state; + impl_class->input_shape_combine_region = gdk_x11_surface_input_shape_combine_region; impl_class->destroy = gdk_x11_surface_destroy; impl_class->beep = gdk_x11_surface_beep; diff --git a/gdk/x11/gdksurface-x11.h b/gdk/x11/gdksurface-x11.h index 07c67d6666..6ffdbf24e6 100644 --- a/gdk/x11/gdksurface-x11.h +++ b/gdk/x11/gdksurface-x11.h @@ -22,11 +22,11 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#ifndef __GDK_SURFACE_X11_H__ -#define __GDK_SURFACE_X11_H__ +#ifndef __GDK_X11_SURFACE__ +#define __GDK_X11_SURFACE__ -#include "gdk/x11/gdkprivate-x11.h" -#include "gdk/gdksurfaceimpl.h" +#include "gdksurfaceprivate.h" +#include "gdkx11surface.h" #include <X11/Xlib.h> @@ -42,25 +42,11 @@ G_BEGIN_DECLS typedef struct _GdkToplevelX11 GdkToplevelX11; -typedef struct _GdkSurfaceImplX11 GdkSurfaceImplX11; -typedef struct _GdkSurfaceImplX11Class GdkSurfaceImplX11Class; typedef struct _GdkXPositionInfo GdkXPositionInfo; -/* Window implementation for X11 - */ - -#define GDK_TYPE_SURFACE_IMPL_X11 (gdk_surface_impl_x11_get_type ()) -#define GDK_SURFACE_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL_X11, GdkSurfaceImplX11)) -#define GDK_SURFACE_IMPL_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL_X11, GdkSurfaceImplX11Class)) -#define GDK_IS_SURFACE_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL_X11)) -#define GDK_IS_SURFACE_IMPL_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL_X11)) -#define GDK_SURFACE_IMPL_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL_X11, GdkSurfaceImplX11Class)) - -struct _GdkSurfaceImplX11 +struct _GdkX11Surface { - GdkSurfaceImpl parent_instance; - - GdkSurface *wrapper; + GdkSurface parent_instance; Window xid; @@ -91,9 +77,9 @@ struct _GdkSurfaceImplX11 #endif }; -struct _GdkSurfaceImplX11Class +struct _GdkX11SurfaceClass { - GdkSurfaceImplClass parent_class; + GdkSurfaceClass parent_class; }; struct _GdkToplevelX11 @@ -184,13 +170,11 @@ struct _GdkToplevelX11 #endif }; -GType gdk_surface_impl_x11_get_type (void); - GdkToplevelX11 *_gdk_x11_surface_get_toplevel (GdkSurface *window); GdkCursor *_gdk_x11_surface_get_cursor (GdkSurface *window); -void _gdk_x11_surface_update_size (GdkSurfaceImplX11 *impl); +void _gdk_x11_surface_update_size (GdkX11Surface *impl); void _gdk_x11_surface_set_surface_scale (GdkSurface *window, int scale); @@ -198,4 +182,4 @@ void gdk_x11_surface_pre_damage (GdkSurface *surface); G_END_DECLS -#endif /* __GDK_SURFACE_X11_H__ */ +#endif /* __GDK_X11_SURFACE__ */ |