GdkWindow -> GdkSurface initial type rename

This renames the GdkWindow class and related classes (impl, backend
subclasses) to surface. Additionally it renames related types:
GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType,
GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge

This is an automatic conversion using the below commands:

git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass

git sed -f g GdkWindow GdkSurface
git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing
git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING
git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2"
git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE
git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo

git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE"
git sed -f g "broadway_window" "broadway_surface"
git sed -f g "BroadwayWindow" "BroadwaySurface"
git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE"
git sed -f g "wayland_window" "wayland_surface"
git sed -f g "WaylandWindow" "WaylandSurface"
git sed -f g "X11_WINDOW" "X11_SURFACE"
git sed -f g "x11_window" "x11_surface"
git sed -f g "X11Window" "X11Surface"
git sed -f g "WIN32_WINDOW" "WIN32_SURFACE"
git sed -f g "win32_window" "win32_surface"
git sed -f g "Win32Window" "Win32Surface"
git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE"
git sed -f g "quartz_window" "quartz_surface"
git sed -f g "QuartzWindow" "QuartzSurface"

git checkout NEWS* po-properties
This commit is contained in:
Alexander Larsson 2018-03-20 11:40:08 +01:00
parent f7326ff828
commit 391727bd0d
227 changed files with 7939 additions and 7939 deletions

View File

@ -473,11 +473,11 @@ static void
window_state_changed (GtkWidget *widget) window_state_changed (GtkWidget *widget)
{ {
DemoApplicationWindow *window = (DemoApplicationWindow *)widget; DemoApplicationWindow *window = (DemoApplicationWindow *)widget;
GdkWindowState new_state; GdkSurfaceState new_state;
new_state = gdk_window_get_state (gtk_widget_get_window (widget)); new_state = gdk_surface_get_state (gtk_widget_get_window (widget));
window->maximized = (new_state & GDK_WINDOW_STATE_MAXIMIZED) != 0; window->maximized = (new_state & GDK_SURFACE_STATE_MAXIMIZED) != 0;
window->fullscreen = (new_state & GDK_WINDOW_STATE_FULLSCREEN) != 0; window->fullscreen = (new_state & GDK_SURFACE_STATE_FULLSCREEN) != 0;
} }
static void static void

View File

@ -68,19 +68,19 @@ enum
static GtkWidget * static GtkWidget *
find_toplevel_at_pointer (GdkDisplay *display) find_toplevel_at_pointer (GdkDisplay *display)
{ {
GdkWindow *pointer_window; GdkSurface *pointer_window;
GtkWidget *widget = NULL; GtkWidget *widget = NULL;
pointer_window = gdk_device_get_window_at_position (gtk_get_current_event_device (), pointer_window = gdk_device_get_window_at_position (gtk_get_current_event_device (),
NULL, NULL); NULL, NULL);
/* The user data field of a GdkWindow is used to store a pointer /* The user data field of a GdkSurface is used to store a pointer
* to the widget that created it. * to the widget that created it.
*/ */
if (pointer_window) if (pointer_window)
{ {
gpointer widget_ptr; gpointer widget_ptr;
gdk_window_get_user_data (pointer_window, &widget_ptr); gdk_surface_get_user_data (pointer_window, &widget_ptr);
widget = widget_ptr; widget = widget_ptr;
} }

View File

@ -137,7 +137,7 @@ checkerboard_draw (GtkDrawingArea *da,
/* At the start of a draw handler, a clip region has been set on /* At the start of a draw handler, a clip region has been set on
* the Cairo context, and the contents have been cleared to the * the Cairo context, and the contents have been cleared to the
* widget's background color. The docs for * widget's background color. The docs for
* gdk_window_begin_paint_region() give more details on how this * gdk_surface_begin_paint_region() give more details on how this
* works. * works.
*/ */

View File

@ -37,7 +37,7 @@ enum
static Bug data[] = static Bug data[] =
{ {
{ FALSE, 60482, "Normal", "scrollable notebooks and hidden tabs" }, { FALSE, 60482, "Normal", "scrollable notebooks and hidden tabs" },
{ FALSE, 60620, "Critical", "gdk_window_clear_area (gdkwindow-win32.c) is not thread-safe" }, { FALSE, 60620, "Critical", "gdk_surface_clear_area (gdkwindow-win32.c) is not thread-safe" },
{ FALSE, 50214, "Major", "Xft support does not clean up correctly" }, { FALSE, 50214, "Major", "Xft support does not clean up correctly" },
{ TRUE, 52877, "Major", "GtkFileSelection needs a refresh method. " }, { TRUE, 52877, "Major", "GtkFileSelection needs a refresh method. " },
{ FALSE, 56070, "Normal", "Can't click button after setting in sensitive" }, { FALSE, 56070, "Normal", "Can't click button after setting in sensitive" },

View File

@ -250,7 +250,7 @@ static gchar *types[] =
"GtkTreeSelection ", "GtkTreeSelection ",
"GdkDisplay ", "GdkDisplay ",
"GdkScreen ", "GdkScreen ",
"GdkWindow ", "GdkSurface ",
"GdkEventButton ", "GdkEventButton ",
"GdkCursor ", "GdkCursor ",
"GtkTreeIter ", "GtkTreeIter ",

View File

@ -64,7 +64,7 @@ get_idle (gpointer data)
GtkApplication *app = gtk_window_get_application (GTK_WINDOW (window)); GtkApplication *app = gtk_window_get_application (GTK_WINDOW (window));
gtk_widget_set_sensitive (window, TRUE); gtk_widget_set_sensitive (window, TRUE);
gdk_window_set_cursor (gtk_widget_get_window (window), NULL); gdk_surface_set_cursor (gtk_widget_get_window (window), NULL);
g_application_unmark_busy (G_APPLICATION (app)); g_application_unmark_busy (G_APPLICATION (app));
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
@ -81,7 +81,7 @@ get_busy (GSimpleAction *action,
g_application_mark_busy (G_APPLICATION (app)); g_application_mark_busy (G_APPLICATION (app));
cursor = gdk_cursor_new_from_name ("wait", NULL); cursor = gdk_cursor_new_from_name ("wait", NULL);
gdk_window_set_cursor (gtk_widget_get_window (window), cursor); gdk_surface_set_cursor (gtk_widget_get_window (window), cursor);
g_object_unref (cursor); g_object_unref (cursor);
g_timeout_add (5000, get_idle, window); g_timeout_add (5000, get_idle, window);

View File

@ -26,13 +26,13 @@ Refer to the file widget_system.txt which covers widget flags and the
resulting invariants in a detailed way. resulting invariants in a detailed way.
GdkWindow pointers may be NULL in GdkEvents GdkSurface pointers may be NULL in GdkEvents
------------------------------------------- -------------------------------------------
The notification nature of the signal mechanism might cause events to The notification nature of the signal mechanism might cause events to
be emitted that have their GdkWindow pointer set to NULL. be emitted that have their GdkSurface pointer set to NULL.
This is due to the fact that certain events need to be emitted after the This is due to the fact that certain events need to be emitted after the
real GdkWindow of a widget is not any longer pertinent. real GdkSurface of a widget is not any longer pertinent.
It's up to the signal handling function (application) to check for the It's up to the signal handling function (application) to check for the
window field of the event structure to be != NULL, if it is going to window field of the event structure to be != NULL, if it is going to
perform any operations through Gdk calls on it. perform any operations through Gdk calls on it.
@ -51,10 +51,10 @@ GDK_EXPOSE GtkWidget::expose_event
Writing Gdk functions Writing Gdk functions
--------------------- ---------------------
When writing Gdk functions that operate on GdkWindow structures in any When writing Gdk functions that operate on GdkSurface structures in any
meaningful sense, that is casting to a GdkWindowPrivate structure for meaningful sense, that is casting to a GdkSurfacePrivate structure for
access to fields other then GdkWindow.user_data, the programmer is access to fields other then GdkSurface.user_data, the programmer is
recommended to check for the GdkWindowPrivate.destroyed field to be == recommended to check for the GdkSurfacePrivate.destroyed field to be ==
FALSE, especially if the GdkWindowPrivate.xwindow field is used. FALSE, especially if the GdkSurfacePrivate.xwindow field is used.
Silent abortion of the Gdk function is the correct behaviour if this Silent abortion of the Gdk function is the correct behaviour if this
condition isn't met. condition isn't met.

View File

@ -81,19 +81,19 @@ GdkAtom gdk_drag_get_selection (GdkDragContext *context);
/* Source side */ /* Source side */
GdkDragContext * gdk_drag_begin (GdkWindow *window, GdkDragContext * gdk_drag_begin (GdkSurface *window,
GList *targets, GList *targets,
GdkDragAction actions); GdkDragAction actions);
gboolean gdk_drag_get_protocol (guint32 xid, gboolean gdk_drag_get_protocol (guint32 xid,
GdkDragProtocol *protocol); GdkDragProtocol *protocol);
void gdk_drag_find_window (GdkDragContext *context, void gdk_drag_find_window (GdkDragContext *context,
GdkWindow *drag_window, GdkSurface *drag_window,
gint x_root, gint x_root,
gint y_root, gint y_root,
GdkWindow **dest_window, GdkSurface **dest_window,
GdkDragProtocol *protocol); GdkDragProtocol *protocol);
gboolean gdk_drag_motion (GdkDragContext *context, gboolean gdk_drag_motion (GdkDragContext *context,
GdkWindow *dest_window, GdkSurface *dest_window,
GdkDragProtocol protocol, GdkDragProtocol protocol,
gint x_root, gint x_root,
gint y_root, gint y_root,

View File

@ -47,12 +47,12 @@ gdk_scroll_direction_get_type
gdk_setting_action_get_type gdk_setting_action_get_type
gdk_status_get_type gdk_status_get_type
gdk_visibility_state_get_type gdk_visibility_state_get_type
gdk_window_attributes_type_get_type gdk_surface_attributes_type_get_type
gdk_window_edge_get_type gdk_surface_edge_get_type
gdk_window_hints_get_type gdk_surface_hints_get_type
gdk_window_state_get_type gdk_surface_state_get_type
gdk_window_type_get_type gdk_surface_type_get_type
gdk_window_type_hint_get_type gdk_surface_type_hint_get_type
gdk_wm_decoration_get_type gdk_wm_decoration_get_type
gdk_wm_function_get_type gdk_wm_function_get_type
GDK_AVAILABLE_IN_4_0 GDK_AVAILABLE_IN_4_0
@ -169,186 +169,186 @@ gdk_rgba_get_type
<SECTION> <SECTION>
<TITLE>Windows</TITLE> <TITLE>Windows</TITLE>
<FILE>windows</FILE> <FILE>windows</FILE>
GdkWindow GdkSurface
GdkWindowType GdkSurfaceType
GdkWindowClass GdkSurfaceClass
GdkWindowHints GdkSurfaceHints
GdkGeometry GdkGeometry
GdkGravity GdkGravity
GdkAnchorHints GdkAnchorHints
GdkWindowEdge GdkSurfaceEdge
GdkWindowTypeHint GdkSurfaceTypeHint
GdkWindowState GdkSurfaceState
gdk_window_new_toplevel gdk_surface_new_toplevel
gdk_window_new_popup gdk_surface_new_popup
gdk_window_new_temp gdk_surface_new_temp
gdk_window_new_child gdk_surface_new_child
gdk_window_destroy gdk_surface_destroy
gdk_window_get_window_type gdk_surface_get_window_type
gdk_window_get_display gdk_surface_get_display
gdk_window_show gdk_surface_show
gdk_window_show_unraised gdk_surface_show_unraised
gdk_window_hide gdk_surface_hide
gdk_window_is_destroyed gdk_surface_is_destroyed
gdk_window_is_visible gdk_surface_is_visible
gdk_window_is_viewable gdk_surface_is_viewable
gdk_window_is_input_only gdk_surface_is_input_only
gdk_window_is_shaped gdk_surface_is_shaped
gdk_window_get_state gdk_surface_get_state
gdk_window_withdraw gdk_surface_withdraw
gdk_window_iconify gdk_surface_iconify
gdk_window_deiconify gdk_surface_deiconify
gdk_window_stick gdk_surface_stick
gdk_window_unstick gdk_surface_unstick
gdk_window_maximize gdk_surface_maximize
gdk_window_unmaximize gdk_surface_unmaximize
gdk_window_fullscreen gdk_surface_fullscreen
gdk_window_fullscreen_on_monitor gdk_surface_fullscreen_on_monitor
gdk_window_unfullscreen gdk_surface_unfullscreen
GdkFullscreenMode GdkFullscreenMode
gdk_window_get_fullscreen_mode gdk_surface_get_fullscreen_mode
gdk_window_set_fullscreen_mode gdk_surface_set_fullscreen_mode
gdk_window_set_keep_above gdk_surface_set_keep_above
gdk_window_set_keep_below gdk_surface_set_keep_below
gdk_window_set_opacity gdk_surface_set_opacity
gdk_window_set_pass_through gdk_surface_set_pass_through
gdk_window_get_pass_through gdk_surface_get_pass_through
gdk_window_move gdk_surface_move
gdk_window_resize gdk_surface_resize
gdk_window_move_resize gdk_surface_move_resize
gdk_window_scroll gdk_surface_scroll
gdk_window_move_region gdk_surface_move_region
gdk_window_has_native gdk_surface_has_native
gdk_window_raise gdk_surface_raise
gdk_window_lower gdk_surface_lower
gdk_window_restack gdk_surface_restack
gdk_window_focus gdk_surface_focus
gdk_window_register_dnd gdk_surface_register_dnd
gdk_window_begin_resize_drag gdk_surface_begin_resize_drag
gdk_window_begin_resize_drag_for_device gdk_surface_begin_resize_drag_for_device
gdk_window_begin_move_drag gdk_surface_begin_move_drag
gdk_window_begin_move_drag_for_device gdk_surface_begin_move_drag_for_device
gdk_window_show_window_menu gdk_surface_show_window_menu
gdk_window_constrain_size gdk_surface_constrain_size
gdk_window_beep gdk_surface_beep
gdk_window_get_scale_factor gdk_surface_get_scale_factor
gdk_window_set_opaque_region gdk_surface_set_opaque_region
gdk_window_create_gl_context gdk_surface_create_gl_context
gdk_window_create_vulkan_context gdk_surface_create_vulkan_context
<SUBSECTION> <SUBSECTION>
gdk_window_get_clip_region gdk_surface_get_clip_region
gdk_window_begin_draw_frame gdk_surface_begin_draw_frame
gdk_window_end_draw_frame gdk_surface_end_draw_frame
gdk_window_get_visible_region gdk_surface_get_visible_region
<SUBSECTION> <SUBSECTION>
gdk_window_invalidate_rect gdk_surface_invalidate_rect
gdk_window_invalidate_region gdk_surface_invalidate_region
GdkWindowChildFunc GdkSurfaceChildFunc
gdk_window_invalidate_maybe_recurse gdk_surface_invalidate_maybe_recurse
gdk_window_get_update_area gdk_surface_get_update_area
gdk_window_freeze_updates gdk_surface_freeze_updates
gdk_window_thaw_updates gdk_surface_thaw_updates
gdk_window_get_frame_clock gdk_surface_get_frame_clock
<SUBSECTION> <SUBSECTION>
gdk_window_set_user_data gdk_surface_set_user_data
gdk_window_set_accept_focus gdk_surface_set_accept_focus
gdk_window_get_accept_focus gdk_surface_get_accept_focus
gdk_window_set_focus_on_map gdk_surface_set_focus_on_map
gdk_window_get_focus_on_map gdk_surface_get_focus_on_map
gdk_window_shape_combine_region gdk_surface_shape_combine_region
gdk_window_set_child_shapes gdk_surface_set_child_shapes
gdk_window_merge_child_shapes gdk_surface_merge_child_shapes
gdk_window_input_shape_combine_region gdk_surface_input_shape_combine_region
gdk_window_set_child_input_shapes gdk_surface_set_child_input_shapes
gdk_window_merge_child_input_shapes gdk_surface_merge_child_input_shapes
gdk_window_set_title gdk_surface_set_title
GDK_PARENT_RELATIVE GDK_PARENT_RELATIVE
gdk_window_set_cursor gdk_surface_set_cursor
gdk_window_get_cursor gdk_surface_get_cursor
gdk_window_get_user_data gdk_surface_get_user_data
gdk_window_get_geometry gdk_surface_get_geometry
gdk_window_set_geometry_hints gdk_surface_set_geometry_hints
gdk_window_get_width gdk_surface_get_width
gdk_window_get_height gdk_surface_get_height
gdk_window_set_icon_list gdk_surface_set_icon_list
gdk_window_set_modal_hint gdk_surface_set_modal_hint
gdk_window_get_modal_hint gdk_surface_get_modal_hint
gdk_window_set_type_hint gdk_surface_set_type_hint
gdk_window_get_type_hint gdk_surface_get_type_hint
gdk_window_set_shadow_width gdk_surface_set_shadow_width
gdk_window_set_skip_taskbar_hint gdk_surface_set_skip_taskbar_hint
gdk_window_set_skip_pager_hint gdk_surface_set_skip_pager_hint
gdk_window_set_urgency_hint gdk_surface_set_urgency_hint
gdk_window_get_position gdk_surface_get_position
gdk_window_get_root_origin gdk_surface_get_root_origin
gdk_window_get_frame_extents gdk_surface_get_frame_extents
gdk_window_get_origin gdk_surface_get_origin
gdk_window_get_root_coords gdk_surface_get_root_coords
gdk_window_get_device_position gdk_surface_get_device_position
gdk_window_get_device_position_double gdk_surface_get_device_position_double
GdkModifierType GdkModifierType
GdkModifierIntent GdkModifierIntent
gdk_window_get_parent gdk_surface_get_parent
gdk_window_get_toplevel gdk_surface_get_toplevel
gdk_window_get_children gdk_surface_get_children
gdk_window_get_children_with_user_data gdk_surface_get_children_with_user_data
gdk_window_peek_children gdk_surface_peek_children
gdk_window_get_events gdk_surface_get_events
gdk_window_set_events gdk_surface_set_events
gdk_window_set_icon_name gdk_surface_set_icon_name
gdk_window_set_transient_for gdk_surface_set_transient_for
gdk_window_set_role gdk_surface_set_role
gdk_window_set_startup_id gdk_surface_set_startup_id
gdk_window_set_group gdk_surface_set_group
gdk_window_get_group gdk_surface_get_group
gdk_window_set_decorations gdk_surface_set_decorations
gdk_window_get_decorations gdk_surface_get_decorations
GdkWMDecoration GdkWMDecoration
gdk_window_set_functions gdk_surface_set_functions
GdkWMFunction GdkWMFunction
<SUBSECTION> <SUBSECTION>
gdk_window_get_support_multidevice gdk_surface_get_support_multidevice
gdk_window_set_support_multidevice gdk_surface_set_support_multidevice
gdk_window_get_device_cursor gdk_surface_get_device_cursor
gdk_window_set_device_cursor gdk_surface_set_device_cursor
gdk_window_get_device_events gdk_surface_get_device_events
gdk_window_set_device_events gdk_surface_set_device_events
<SUBSECTION> <SUBSECTION>
gdk_window_coords_from_parent gdk_surface_coords_from_parent
gdk_window_coords_to_parent gdk_surface_coords_to_parent
<SUBSECTION Standard> <SUBSECTION Standard>
GDK_WINDOW GDK_SURFACE
GDK_WINDOW_GET_CLASS GDK_SURFACE_GET_CLASS
GDK_TYPE_WINDOW GDK_TYPE_SURFACE
GDK_IS_WINDOW GDK_IS_SURFACE
GDK_WINDOW_CLASS GDK_SURFACE_CLASS
GDK_IS_WINDOW_CLASS GDK_IS_SURFACE_CLASS
GDK_TYPE_FILTER_RETURN GDK_TYPE_FILTER_RETURN
GDK_TYPE_GRAVITY GDK_TYPE_GRAVITY
GDK_TYPE_MODIFIER_TYPE GDK_TYPE_MODIFIER_TYPE
GDK_TYPE_WINDOW_ATTRIBUTES_TYPE GDK_TYPE_SURFACE_ATTRIBUTES_TYPE
GDK_TYPE_WINDOW_EDGE GDK_TYPE_SURFACE_EDGE
GDK_TYPE_WINDOW_HINTS GDK_TYPE_SURFACE_HINTS
GDK_TYPE_WINDOW_TYPE GDK_TYPE_SURFACE_TYPE
GDK_TYPE_WINDOW_TYPE_HINT GDK_TYPE_SURFACE_TYPE_HINT
GDK_TYPE_WM_DECORATION GDK_TYPE_WM_DECORATION
GDK_TYPE_WM_FUNCTION GDK_TYPE_WM_FUNCTION
GDK_TYPE_WINDOW_STATE GDK_TYPE_SURFACE_STATE
<SUBSECTION Private> <SUBSECTION Private>
gdk_window_get_type gdk_surface_get_type
gdk_window_window_class_get_type gdk_surface_window_class_get_type
GdkWindowClass GdkSurfaceClass
GdkWindowImpl GdkSurfaceImpl
GdkWindowImplClass GdkSurfaceImplClass
GdkWindowRedirect GdkSurfaceRedirect
gdk_window_impl_get_type gdk_surface_impl_get_type
gdk_fullscreen_mode_get_type gdk_fullscreen_mode_get_type
</SECTION> </SECTION>
@ -417,8 +417,8 @@ gdk_pango_layout_line_get_clip_region
<SECTION> <SECTION>
<TITLE>Cairo Interaction</TITLE> <TITLE>Cairo Interaction</TITLE>
<FILE>cairo_interaction</FILE> <FILE>cairo_interaction</FILE>
gdk_window_create_similar_surface gdk_surface_create_similar_surface
gdk_window_create_similar_image_surface gdk_surface_create_similar_image_surface
gdk_cairo_get_clip_rectangle gdk_cairo_get_clip_rectangle
gdk_cairo_get_drawing_context gdk_cairo_get_drawing_context
gdk_cairo_set_source_rgba gdk_cairo_set_source_rgba
@ -828,7 +828,7 @@ gdk_drag_context_get_type
<INCLUDE>gdk/gdkx.h</INCLUDE> <INCLUDE>gdk/gdkx.h</INCLUDE>
<TITLE>X Window System Interaction</TITLE> <TITLE>X Window System Interaction</TITLE>
<FILE>x_interaction</FILE> <FILE>x_interaction</FILE>
GDK_WINDOW_XID GDK_SURFACE_XID
GDK_DISPLAY_XDISPLAY GDK_DISPLAY_XDISPLAY
GDK_POINTER_TO_XID GDK_POINTER_TO_XID
GDK_XID_TO_POINTER GDK_XID_TO_POINTER
@ -864,16 +864,16 @@ gdk_x11_screen_lookup_visual
gdk_x11_screen_supports_net_wm_hint gdk_x11_screen_supports_net_wm_hint
gdk_x11_screen_get_number_of_desktops gdk_x11_screen_get_number_of_desktops
gdk_x11_screen_get_current_desktop gdk_x11_screen_get_current_desktop
gdk_x11_window_foreign_new_for_display gdk_x11_surface_foreign_new_for_display
gdk_x11_window_lookup_for_display gdk_x11_surface_lookup_for_display
gdk_x11_window_get_xid gdk_x11_surface_get_xid
gdk_x11_window_set_theme_variant gdk_x11_surface_set_theme_variant
gdk_x11_window_set_user_time gdk_x11_surface_set_user_time
gdk_x11_window_move_to_current_desktop gdk_x11_surface_move_to_current_desktop
gdk_x11_window_move_to_desktop gdk_x11_surface_move_to_desktop
gdk_x11_window_get_desktop gdk_x11_surface_get_desktop
gdk_x11_window_set_utf8_property gdk_x11_surface_set_utf8_property
gdk_x11_window_set_frame_sync_enabled gdk_x11_surface_set_frame_sync_enabled
gdk_x11_keymap_get_group_for_state gdk_x11_keymap_get_group_for_state
gdk_x11_keymap_key_is_modifier gdk_x11_keymap_key_is_modifier
gdk_x11_visual_get_xvisual gdk_x11_visual_get_xvisual
@ -966,12 +966,12 @@ GDK_X11_VISUAL_CLASS
GDK_IS_X11_VISUAL GDK_IS_X11_VISUAL
GDK_IS_X11_VISUAL_CLASS GDK_IS_X11_VISUAL_CLASS
GDK_X11_VISUAL_GET_CLASS GDK_X11_VISUAL_GET_CLASS
GDK_TYPE_X11_WINDOW GDK_TYPE_X11_SURFACE
GDK_X11_WINDOW GDK_X11_SURFACE
GDK_X11_WINDOW_CLASS GDK_X11_SURFACE_CLASS
GDK_IS_X11_WINDOW GDK_IS_X11_SURFACE
GDK_IS_X11_WINDOW_CLASS GDK_IS_X11_SURFACE_CLASS
GDK_X11_WINDOW_GET_CLASS GDK_X11_SURFACE_GET_CLASS
<SUBSECTION Private> <SUBSECTION Private>
gdk_x11_app_launch_context_get_type gdk_x11_app_launch_context_get_type
@ -988,8 +988,8 @@ gdk_x11_drag_context_get_type
gdk_x11_keymap_get_type gdk_x11_keymap_get_type
gdk_x11_screen_get_type gdk_x11_screen_get_type
gdk_x11_visual_get_type gdk_x11_visual_get_type
gdk_x11_window_get_type gdk_x11_surface_get_type
gdk_window_impl_x11_get_type gdk_surface_impl_x11_get_type
</SECTION> </SECTION>
<SECTION> <SECTION>
@ -1003,13 +1003,13 @@ gdk_wayland_device_get_wl_seat
gdk_wayland_display_get_wl_compositor gdk_wayland_display_get_wl_compositor
gdk_wayland_display_get_wl_display gdk_wayland_display_get_wl_display
gdk_wayland_display_query_registry gdk_wayland_display_query_registry
gdk_wayland_window_new_subsurface gdk_wayland_surface_new_subsurface
gdk_wayland_window_get_wl_surface gdk_wayland_surface_get_wl_surface
gdk_wayland_window_set_use_custom_surface gdk_wayland_surface_set_use_custom_surface
GdkWaylandWindowExported GdkWaylandSurfaceExported
gdk_wayland_window_export_handle gdk_wayland_surface_export_handle
gdk_wayland_window_unexport_handle gdk_wayland_surface_unexport_handle
gdk_wayland_window_set_transient_for_exported gdk_wayland_surface_set_transient_for_exported
<SUBSECTION Standard> <SUBSECTION Standard>
GDK_TYPE_WAYLAND_DEVICE GDK_TYPE_WAYLAND_DEVICE
@ -1030,18 +1030,18 @@ GDK_WAYLAND_DISPLAY_MANAGER_CLASS
GDK_WAYLAND_DISPLAY_MANAGER_GET_CLASS GDK_WAYLAND_DISPLAY_MANAGER_GET_CLASS
GDK_IS_WAYLAND_DISPLAY_MANAGER GDK_IS_WAYLAND_DISPLAY_MANAGER
GDK_IS_WAYLAND_DISPLAY_MANAGER_CLASS GDK_IS_WAYLAND_DISPLAY_MANAGER_CLASS
GDK_TYPE_WAYLAND_WINDOW GDK_TYPE_WAYLAND_SURFACE
GDK_WAYLAND_WINDOW GDK_WAYLAND_SURFACE
GDK_WAYLAND_WINDOW_CLASS GDK_WAYLAND_SURFACE_CLASS
GDK_WAYLAND_WINDOW_GET_CLASS GDK_WAYLAND_SURFACE_GET_CLASS
GDK_IS_WAYLAND_WINDOW GDK_IS_WAYLAND_SURFACE
GDK_IS_WAYLAND_WINDOW_CLASS GDK_IS_WAYLAND_SURFACE_CLASS
<SUBSECTION Private> <SUBSECTION Private>
gdk_wayland_device_get_type gdk_wayland_device_get_type
gdk_wayland_display_get_type gdk_wayland_display_get_type
gdk_wayland_display_manager_get_type gdk_wayland_display_manager_get_type
gdk_wayland_window_get_type gdk_wayland_surface_get_type
</SECTION> </SECTION>

View File

@ -11,7 +11,7 @@ gdk_gl_context_get_type
gdk_keymap_get_type gdk_keymap_get_type
gdk_monitor_get_type gdk_monitor_get_type
gdk_seat_get_type gdk_seat_get_type
gdk_window_get_type gdk_surface_get_type
gdk_content_serializer_get_type gdk_content_serializer_get_type
gdk_content_deserializer_get_type gdk_content_deserializer_get_type
gdk_clipboard_get_type gdk_clipboard_get_type

View File

@ -90,7 +90,7 @@
<link linkend="GdkEvent"><structname>GdkEvent</structname></link> <link linkend="GdkEvent"><structname>GdkEvent</structname></link>
structures and sends them on to the GTK layer. In turn, the GTK layer structures and sends them on to the GTK layer. In turn, the GTK layer
finds the widget that corresponds to a particular finds the widget that corresponds to a particular
<classname>GdkWindow</classname> and emits the corresponding event <classname>GdkSurface</classname> and emits the corresponding event
signals on that widget. signals on that widget.
</para> </para>
@ -207,17 +207,17 @@
<para> <para>
Normally, there is only a single cairo context which is used in Normally, there is only a single cairo context which is used in
the entire repaint, rather than one per GdkWindow. This means you the entire repaint, rather than one per GdkSurface. This means you
have to respect (and not reset) existing clip and transformations have to respect (and not reset) existing clip and transformations
set on it. set on it.
</para> </para>
<para> <para>
Most widgets, including those that create their own GdkWindows have Most widgets, including those that create their own GdkSurfaces have
a transparent background, so they draw on top of whatever widgets a transparent background, so they draw on top of whatever widgets
are below them. This was not the case in GTK+ 2 where the theme set are below them. This was not the case in GTK+ 2 where the theme set
the background of most widgets to the default background color. (In the background of most widgets to the default background color. (In
fact, transparent GdkWindows used to be impossible.) fact, transparent GdkSurfaces used to be impossible.)
</para> </para>
<para> <para>
@ -263,10 +263,10 @@
<para> <para>
Two basic functions in GDK form the core of the double-buffering Two basic functions in GDK form the core of the double-buffering
mechanism: <link mechanism: <link
linkend="gdk_window_begin_paint_region"><function>gdk_window_begin_paint_region()</function></link> linkend="gdk_surface_begin_paint_region"><function>gdk_surface_begin_paint_region()</function></link>
and <link and <link
linkend="gdk_window_end_paint"><function>gdk_window_end_paint()</function></link>. linkend="gdk_surface_end_paint"><function>gdk_surface_end_paint()</function></link>.
The first function tells a <classname>GdkWindow</classname> to The first function tells a <classname>GdkSurface</classname> to
create a temporary off-screen buffer for drawing. All create a temporary off-screen buffer for drawing. All
subsequent drawing operations to this window get automatically subsequent drawing operations to this window get automatically
redirected to that buffer. The second function actually paints redirected to that buffer. The second function actually paints
@ -278,16 +278,16 @@
<para> <para>
It would be inconvenient for all widgets to call It would be inconvenient for all widgets to call
<function>gdk_window_begin_paint_region()</function> and <function>gdk_surface_begin_paint_region()</function> and
<function>gdk_window_end_paint()</function> at the beginning <function>gdk_surface_end_paint()</function> at the beginning
and end of their draw handlers. and end of their draw handlers.
</para> </para>
<para> <para>
To make this easier, GTK+ normally calls To make this easier, GTK+ normally calls
<function>gdk_window_begin_paint_region()</function> <function>gdk_surface_begin_paint_region()</function>
before emitting the #GtkWidget::draw signal, and before emitting the #GtkWidget::draw signal, and
then it calls <function>gdk_window_end_paint()</function> then it calls <function>gdk_surface_end_paint()</function>
after the signal has been emitted. This is convenient for after the signal has been emitted. This is convenient for
most widgets, as they do not need to worry about creating most widgets, as they do not need to worry about creating
their own temporary drawing buffers or about calling those their own temporary drawing buffers or about calling those
@ -335,8 +335,8 @@ my_widget_init (MyWidget *widget)
<para> <para>
Even if you turn off double buffering on a widget, you Even if you turn off double buffering on a widget, you
can still call can still call
<function>gdk_window_begin_paint_region()</function> and <function>gdk_surface_begin_paint_region()</function> and
<function>gdk_window_end_paint()</function> by hand to use <function>gdk_surface_end_paint()</function> by hand to use
temporary drawing buffers. temporary drawing buffers.
</para> </para>
</refsect2> </refsect2>

View File

@ -137,7 +137,7 @@
<para> <para>
This is the step in a <glossterm This is the step in a <glossterm
linkend="widget">widget's</glossterm> life cycle where it linkend="widget">widget's</glossterm> life cycle where it
actually shows the GdkWindows it created when it was actually shows the GdkSurfaces it created when it was
<glossterm linkend="realization">realized</glossterm>. When a <glossterm linkend="realization">realized</glossterm>. When a
widget is mapped, it must turn on its widget is mapped, it must turn on its
%GTK_MAPPED <link linkend="GtkWidgetFlags">flag</link>. %GTK_MAPPED <link linkend="GtkWidgetFlags">flag</link>.
@ -146,7 +146,7 @@
<para> <para>
Note that due to the asynchronous nature of the X window Note that due to the asynchronous nature of the X window
system, a widget's window may not appear on the screen system, a widget's window may not appear on the screen
immediatly after one calls gdk_window_show(): immediatly after one calls gdk_surface_show():
you must wait for the corresponding map <glossterm you must wait for the corresponding map <glossterm
linkend="event">event</glossterm> to be received. You can do linkend="event">event</glossterm> to be received. You can do
this with the <link this with the <link
@ -193,7 +193,7 @@
<glossterm>no-window widget</glossterm> <glossterm>no-window widget</glossterm>
<glossdef> <glossdef>
<para> <para>
A widget that does not have a GdkWindow of its own on which to A widget that does not have a GdkSurface of its own on which to
draw its contents, but rather shares its <glossterm draw its contents, but rather shares its <glossterm
linkend="parent">parent's</glossterm>. This can be tested with linkend="parent">parent's</glossterm>. This can be tested with
the gtk_widget_get_has_window() function. the gtk_widget_get_has_window() function.
@ -218,20 +218,20 @@
<para> <para>
This is the step in a <glossterm This is the step in a <glossterm
linkend="widget">widget's</glossterm> life cycle where it linkend="widget">widget's</glossterm> life cycle where it
creates its own GdkWindow, or otherwise associates itself with creates its own GdkSurface, or otherwise associates itself with
its <glossterm linkend="parent">parent's</glossterm> its <glossterm linkend="parent">parent's</glossterm>
GdkWindow. If the widget has its own window, then it must GdkSurface. If the widget has its own window, then it must
also attach a <glossterm linkend="style">style</glossterm> to also attach a <glossterm linkend="style">style</glossterm> to
it. A widget becomes unrealized by destroying its associated it. A widget becomes unrealized by destroying its associated
GdkWindow. When a widget is realized, it must turn on its GdkSurface. When a widget is realized, it must turn on its
%GTK_REALIZED <link linkend="GtkWidgetFlags">flag</link>. %GTK_REALIZED <link linkend="GtkWidgetFlags">flag</link>.
</para> </para>
<para> <para>
Widgets that don't own the GdkWindow on which they draw are Widgets that don't own the GdkSurface on which they draw are
called <glossterm linkend="no-window">no-window widgets</glossterm>. called <glossterm linkend="no-window">no-window widgets</glossterm>.
This can be tested with the gtk_widget_get_has_window() function. Normally, This can be tested with the gtk_widget_get_has_window() function. Normally,
these widgets draw on their parent's GdkWindow. these widgets draw on their parent's GdkSurface.
</para> </para>
<para> <para>

View File

@ -91,7 +91,7 @@
<title>Event propagation</title> <title>Event propagation</title>
<para> <para>
For widgets which have a #GdkWindow set, events are received from the For widgets which have a #GdkSurface set, events are received from the
windowing system and passed to gtk_main_do_event(). See its documentation windowing system and passed to gtk_main_do_event(). See its documentation
for details of what it does: compression of enter/leave events, for details of what it does: compression of enter/leave events,
identification of the widget receiving the event, pushing the event onto a identification of the widget receiving the event, pushing the event onto a
@ -101,11 +101,11 @@
<para> <para>
When a GDK backend produces an input event, it is tied to a #GdkDevice and When a GDK backend produces an input event, it is tied to a #GdkDevice and
a #GdkWindow, which in turn represents a windowing system surface in the a #GdkSurface, which in turn represents a windowing system surface in the
backend. If a widget has grabbed the current input device, or all input backend. If a widget has grabbed the current input device, or all input
devices, the event is propagated to that #GtkWidget. Otherwise, it is devices, the event is propagated to that #GtkWidget. Otherwise, it is
propagated to the the #GtkWidget which called gtk_widget_register_window() propagated to the the #GtkWidget which called gtk_widget_register_window()
on the #GdkWindow receiving the event. on the #GdkSurface receiving the event.
</para> </para>
<para> <para>
@ -113,7 +113,7 @@
specific input device (gtk_device_grab_add()), is sent events in specific input device (gtk_device_grab_add()), is sent events in
preference to a global grab (gtk_grab_add()). Input grabs only have effect preference to a global grab (gtk_grab_add()). Input grabs only have effect
within the #GtkWindowGroup containing the #GtkWidget which registered the within the #GtkWindowGroup containing the #GtkWidget which registered the
events #GdkWindow. If this #GtkWidget is a child of the grab widget, the events #GdkSurface. If this #GtkWidget is a child of the grab widget, the
event is propagated to the child — this is the basis for propagating event is propagated to the child — this is the basis for propagating
events within modal dialogs. events within modal dialogs.
</para> </para>
@ -186,15 +186,15 @@
Each widget instance has a basic event mask and another per input device, Each widget instance has a basic event mask and another per input device,
which determine the types of input event it receives. Each event mask set which determine the types of input event it receives. Each event mask set
on a widget is added to the corresponding (basic or per-device) event mask on a widget is added to the corresponding (basic or per-device) event mask
for the widgets #GdkWindow, and all child #GdkWindows. for the widgets #GdkSurface, and all child #GdkSurfaces.
</para> </para>
<para> <para>
Filtering events against event masks happens inside #GdkWindow, which Filtering events against event masks happens inside #GdkSurface, which
exposes event masks to the windowing system to reduce the number of events exposes event masks to the windowing system to reduce the number of events
GDK receives from it. On receiving an event, it is filtered against the GDK receives from it. On receiving an event, it is filtered against the
#GdkWindows mask for the input device, if set. Otherwise, it is filtered #GdkSurfaces mask for the input device, if set. Otherwise, it is filtered
against the #GdkWindows basic event mask. against the #GdkSurfaces basic event mask.
</para> </para>
<para> <para>

View File

@ -79,13 +79,13 @@
<title>Review your window creation flags</title> <title>Review your window creation flags</title>
<para> <para>
GTK+ 4 removes the GDK_WA_CURSOR flag. Instead, just use GTK+ 4 removes the GDK_WA_CURSOR flag. Instead, just use
gdk_window_set_cursor() to set a cursor on the window after gdk_surface_set_cursor() to set a cursor on the window after
creating it. creating it.
</para> </para>
<para> <para>
GTK+ 4 also removes the GDK_WA_VISUAL flag, and always uses GTK+ 4 also removes the GDK_WA_VISUAL flag, and always uses
an RGBA visual for windows. To prepare your code for this, an RGBA visual for windows. To prepare your code for this,
use gdk_window_set_visual (gdk_screen_get_rgba_visual ()) after use gdk_surface_set_visual (gdk_screen_get_rgba_visual ()) after
creating your window. creating your window.
</para> </para>
<para> <para>
@ -194,7 +194,7 @@
<title>Stop using the root window</title> <title>Stop using the root window</title>
<para> <para>
The root window is an X11-centric concept that is no longer exposed in the The root window is an X11-centric concept that is no longer exposed in the
backend-neutral GDK API. gdk_window_get_parent() will return %NULL for toplevel backend-neutral GDK API. gdk_surface_get_parent() will return %NULL for toplevel
windows. If you need to interact with the X11 root window, you can use windows. If you need to interact with the X11 root window, you can use
gdk_x11_display_get_xrootwindow() to get its XID. gdk_x11_display_get_xrootwindow() to get its XID.
</para> </para>
@ -217,12 +217,12 @@
</section> </section>
<section> <section>
<title>Adapt to GdkWindow API changes</title> <title>Adapt to GdkSurface API changes</title>
<para> <para>
The gdk_window_new() function has been replaced by a number of more The gdk_surface_new() function has been replaced by a number of more
specialized constructors: gdk_window_new_toplevel(), gdk_window_new_popup(), specialized constructors: gdk_surface_new_toplevel(), gdk_surface_new_popup(),
gdk_window_new_temp(), gdk_window_new_child(), gdk_window_new_input(), gdk_surface_new_temp(), gdk_surface_new_child(), gdk_surface_new_input(),
gdk_wayland_window_new_subsurface(). Use the appropriate ones to create gdk_wayland_surface_new_subsurface(). Use the appropriate ones to create
your windows. your windows.
</para> </para>
<para> <para>
@ -230,7 +230,7 @@
complicating the code and could not be supported across backends. complicating the code and could not be supported across backends.
</para> </para>
<para> <para>
gdk_window_reparent() is no longer available. gdk_surface_reparent() is no longer available.
</para> </para>
</section> </section>
@ -244,7 +244,7 @@
</section> </section>
<section> <section>
<title>Stop using gdk_window_set_event_compression</title> <title>Stop using gdk_surface_set_event_compression</title>
<para> <para>
Event compression is now always enabled. If you need to see the uncoalesced Event compression is now always enabled. If you need to see the uncoalesced
motion history, use gdk_event_get_motion_history(). motion history, use gdk_event_get_motion_history().
@ -367,7 +367,7 @@
</section> </section>
<section> <section>
<title>Stop using APIs to query GdkWindows</title> <title>Stop using APIs to query GdkSurfaces</title>
<para> <para>
A number of APIs for querying special-purpose windows have been removed, A number of APIs for querying special-purpose windows have been removed,
since these windows are no longer publically available: since these windows are no longer publically available:

View File

@ -391,14 +391,14 @@ This comes up when using bitfields; in C you can write the following
code: code:
<informalexample> <informalexample>
<programlisting> <programlisting>
gdk_window_set_events (gdk_window, gdk_surface_set_events (gdk_surface,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
</programlisting> </programlisting>
</informalexample> </informalexample>
while in C++ you must write: while in C++ you must write:
<informalexample> <informalexample>
<programlisting> <programlisting>
gdk_window_set_events (gdk_window, gdk_surface_set_events (gdk_surface,
(GdkEventMask) GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); (GdkEventMask) GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
</programlisting> </programlisting>
</informalexample> </informalexample>

View File

@ -211,20 +211,20 @@ static GList *toplevels;
static guint shot_id; static guint shot_id;
static gboolean static gboolean
window_is_csd (GdkWindow *window) window_is_csd (GdkSurface *window)
{ {
gboolean set; gboolean set;
GdkWMDecoration decorations = 0; GdkWMDecoration decorations = 0;
/* FIXME: is this accurate? */ /* FIXME: is this accurate? */
set = gdk_window_get_decorations (window, &decorations); set = gdk_surface_get_decorations (window, &decorations);
return (set && (decorations == 0)); return (set && (decorations == 0));
} }
static gboolean static gboolean
shoot_one (WidgetInfo *info) shoot_one (WidgetInfo *info)
{ {
GdkWindow *window; GdkSurface *window;
XID id; XID id;
GdkPixbuf *screenshot = NULL; GdkPixbuf *screenshot = NULL;
DecorationType decor = DECOR_FRAME; DecorationType decor = DECOR_FRAME;
@ -236,7 +236,7 @@ shoot_one (WidgetInfo *info)
} }
window = gtk_widget_get_window (info->window); window = gtk_widget_get_window (info->window);
id = gdk_x11_window_get_xid (window); id = gdk_x11_surface_get_xid (window);
if (window_is_csd (window)) if (window_is_csd (window))
decor = (info->include_decorations) ? DECOR_NONE : DECOR_WINDOW_FRAME; decor = (info->include_decorations) ? DECOR_NONE : DECOR_WINDOW_FRAME;
screenshot = take_window_shot (id, decor); screenshot = take_window_shot (id, decor);

View File

@ -62,23 +62,23 @@ GtkWidget, public flags:
GTK_TOPLEVEL: GTK_TOPLEVEL:
Widgets without a real parent, as there are GtkWindows and Widgets without a real parent, as there are GtkWindows and
GtkMenus have this flag set throughout their lifetime. GtkMenus have this flag set throughout their lifetime.
Toplevel widgets always contain their own GdkWindow. Toplevel widgets always contain their own GdkSurface.
GTK_NO_WINDOW: GTK_NO_WINDOW:
This flag is indicative for a widget that does not provide This flag is indicative for a widget that does not provide
its own GdkWindow. Visible action (e.g. drawing) is performed its own GdkSurface. Visible action (e.g. drawing) is performed
on the parent's GdkWindow. on the parent's GdkSurface.
GTK_REALIZED: GTK_REALIZED:
Set by gtk_widget_realize, unset by gtk_widget_unrealize. Set by gtk_widget_realize, unset by gtk_widget_unrealize.
Relies on ((widget->parent && widget->parent->window) Relies on ((widget->parent && widget->parent->window)
|| GTK_WIDGET_TOPLEVEL (widget)); || GTK_WIDGET_TOPLEVEL (widget));
Means: widget has an associated GdkWindow (XWindow). Means: widget has an associated GdkSurface (XWindow).
GTK_MAPPED: GTK_MAPPED:
Set by gtk_widget_map, unset by gtk_widget_unmap. Set by gtk_widget_map, unset by gtk_widget_unmap.
May only be set if GTK_WIDGET_REALIZED (widget). May only be set if GTK_WIDGET_REALIZED (widget).
Means: gdk_window_show() has been called on the widgets window(s). Means: gdk_surface_show() has been called on the widgets window(s).
GTK_VISIBLE: GTK_VISIBLE:
Set by gtk_widget_show. Set by gtk_widget_show.
@ -382,7 +382,7 @@ The Map signal
-------------- --------------
1) Set the MAPPED flag 1) Set the MAPPED flag
2) If the widget has any windows, gdk_window_show those windows 2) If the widget has any windows, gdk_surface_show those windows
3) call gtk_widget_map for all child widgets that are 3) call gtk_widget_map for all child widgets that are
VISIBLE, CHILD_VISIBLE and !MAPPED. (A widget will only VISIBLE, CHILD_VISIBLE and !MAPPED. (A widget will only
be !CHILD_VISIBLE if the container set it that way, so be !CHILD_VISIBLE if the container set it that way, so
@ -395,7 +395,7 @@ The Unmap signal
When a widget receives the unmap signal, it must: When a widget receives the unmap signal, it must:
1) If the widget has a window, gdk_window_hide that window, 1) If the widget has a window, gdk_surface_hide that window,
2) If the widget does not have a window, unmap all child widgets 2) If the widget does not have a window, unmap all child widgets
3) Do any other functions related to taking the widget offscreen 3) Do any other functions related to taking the widget offscreen
(for instance, removing popup windows...) (for instance, removing popup windows...)
@ -409,8 +409,8 @@ When a widget receives the unrealize signal, it must
1) For any windows other than widget->window do: 1) For any windows other than widget->window do:
gdk_window_set_user_data (window, NULL); gdk_surface_set_user_data (window, NULL);
gdk_window_destroy (window); gdk_surface_destroy (window);
2) Call the parent's unrealize handler 2) Call the parent's unrealize handler

View File

@ -32,7 +32,7 @@ size_allocate_cb (GtkWidget *widget,
if (gtk_widget_get_window (widget)) if (gtk_widget_get_window (widget))
{ {
surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget), surface = gdk_surface_create_similar_surface (gtk_widget_get_window (widget),
CAIRO_CONTENT_COLOR, CAIRO_CONTENT_COLOR,
gtk_widget_get_width (widget), gtk_widget_get_width (widget),
gtk_widget_get_height (widget)); gtk_widget_get_height (widget));

View File

@ -22,33 +22,33 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/ */
#ifndef __GDK_BROADWAY_WINDOW_H__ #ifndef __GDK_BROADWAY_SURFACE_H__
#define __GDK_BROADWAY_WINDOW_H__ #define __GDK_BROADWAY_SURFACE_H__
#include <gdk/gdk.h> #include <gdk/gdk.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GDK_TYPE_BROADWAY_WINDOW (gdk_broadway_window_get_type ()) #define GDK_TYPE_BROADWAY_SURFACE (gdk_broadway_surface_get_type ())
#define GDK_BROADWAY_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_WINDOW, GdkBroadwayWindow)) #define GDK_BROADWAY_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_SURFACE, GdkBroadwaySurface))
#define GDK_BROADWAY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_WINDOW, GdkBroadwayWindowClass)) #define GDK_BROADWAY_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_SURFACE, GdkBroadwaySurfaceClass))
#define GDK_IS_BROADWAY_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_WINDOW)) #define GDK_IS_BROADWAY_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_SURFACE))
#define GDK_IS_BROADWAY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_WINDOW)) #define GDK_IS_BROADWAY_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_SURFACE))
#define GDK_BROADWAY_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_WINDOW, GdkBroadwayWindowClass)) #define GDK_BROADWAY_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_SURFACE, GdkBroadwaySurfaceClass))
#ifdef GDK_COMPILATION #ifdef GDK_COMPILATION
typedef struct _GdkBroadwayWindow GdkBroadwayWindow; typedef struct _GdkBroadwaySurface GdkBroadwaySurface;
#else #else
typedef GdkWindow GdkBroadwayWindow; typedef GdkSurface GdkBroadwaySurface;
#endif #endif
typedef struct _GdkBroadwayWindowClass GdkBroadwayWindowClass; typedef struct _GdkBroadwaySurfaceClass GdkBroadwaySurfaceClass;
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GType gdk_broadway_window_get_type (void); GType gdk_broadway_surface_get_type (void);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
guint32 gdk_broadway_get_last_seen_time (GdkWindow *window); guint32 gdk_broadway_get_last_seen_time (GdkSurface *window);
G_END_DECLS G_END_DECLS
#endif /* __GDK_BROADWAY_WINDOW_H__ */ #endif /* __GDK_BROADWAY_SURFACE_H__ */

View File

@ -24,45 +24,45 @@
#include "gdkprivate-broadway.h" #include "gdkprivate-broadway.h"
static gboolean gdk_broadway_device_get_history (GdkDevice *device, static gboolean gdk_broadway_device_get_history (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
guint32 start, guint32 start,
guint32 stop, guint32 stop,
GdkTimeCoord ***events, GdkTimeCoord ***events,
gint *n_events); gint *n_events);
static void gdk_broadway_device_get_state (GdkDevice *device, static void gdk_broadway_device_get_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gdouble *axes, gdouble *axes,
GdkModifierType *mask); GdkModifierType *mask);
static void gdk_broadway_device_set_window_cursor (GdkDevice *device, static void gdk_broadway_device_set_window_cursor (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkCursor *cursor); GdkCursor *cursor);
static void gdk_broadway_device_warp (GdkDevice *device, static void gdk_broadway_device_warp (GdkDevice *device,
gdouble x, gdouble x,
gdouble y); gdouble y);
static void gdk_broadway_device_query_state (GdkDevice *device, static void gdk_broadway_device_query_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkWindow **child_window, GdkSurface **child_window,
gdouble *root_x, gdouble *root_x,
gdouble *root_y, gdouble *root_y,
gdouble *win_x, gdouble *win_x,
gdouble *win_y, gdouble *win_y,
GdkModifierType *mask); GdkModifierType *mask);
static GdkGrabStatus gdk_broadway_device_grab (GdkDevice *device, static GdkGrabStatus gdk_broadway_device_grab (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gboolean owner_events, gboolean owner_events,
GdkEventMask event_mask, GdkEventMask event_mask,
GdkWindow *confine_to, GdkSurface *confine_to,
GdkCursor *cursor, GdkCursor *cursor,
guint32 time_); guint32 time_);
static void gdk_broadway_device_ungrab (GdkDevice *device, static void gdk_broadway_device_ungrab (GdkDevice *device,
guint32 time_); guint32 time_);
static GdkWindow * gdk_broadway_device_window_at_position (GdkDevice *device, static GdkSurface * gdk_broadway_device_window_at_position (GdkDevice *device,
gdouble *win_x, gdouble *win_x,
gdouble *win_y, gdouble *win_y,
GdkModifierType *mask, GdkModifierType *mask,
gboolean get_toplevel); gboolean get_toplevel);
static void gdk_broadway_device_select_window_events (GdkDevice *device, static void gdk_broadway_device_select_window_events (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkEventMask event_mask); GdkEventMask event_mask);
@ -97,7 +97,7 @@ gdk_broadway_device_init (GdkBroadwayDevice *device_core)
static gboolean static gboolean
gdk_broadway_device_get_history (GdkDevice *device, gdk_broadway_device_get_history (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
guint32 start, guint32 start,
guint32 stop, guint32 stop,
GdkTimeCoord ***events, GdkTimeCoord ***events,
@ -108,13 +108,13 @@ gdk_broadway_device_get_history (GdkDevice *device,
static void static void
gdk_broadway_device_get_state (GdkDevice *device, gdk_broadway_device_get_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gdouble *axes, gdouble *axes,
GdkModifierType *mask) GdkModifierType *mask)
{ {
gdouble x, y; gdouble x, y;
gdk_window_get_device_position_double (window, device, &x, &y, mask); gdk_surface_get_device_position_double (window, device, &x, &y, mask);
if (axes) if (axes)
{ {
@ -125,7 +125,7 @@ gdk_broadway_device_get_state (GdkDevice *device,
static void static void
gdk_broadway_device_set_window_cursor (GdkDevice *device, gdk_broadway_device_set_window_cursor (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkCursor *cursor) GdkCursor *cursor)
{ {
} }
@ -139,8 +139,8 @@ gdk_broadway_device_warp (GdkDevice *device,
static void static void
gdk_broadway_device_query_state (GdkDevice *device, gdk_broadway_device_query_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkWindow **child_window, GdkSurface **child_window,
gdouble *root_x, gdouble *root_x,
gdouble *root_y, gdouble *root_y,
gdouble *win_x, gdouble *win_x,
@ -177,7 +177,7 @@ gdk_broadway_device_query_state (GdkDevice *device,
*mask = mask32; *mask = mask32;
if (child_window) if (child_window)
{ {
GdkWindow *mouse_toplevel; GdkSurface *mouse_toplevel;
mouse_toplevel = g_hash_table_lookup (broadway_display->id_ht, GUINT_TO_POINTER (mouse_toplevel_id)); mouse_toplevel = g_hash_table_lookup (broadway_display->id_ht, GUINT_TO_POINTER (mouse_toplevel_id));
if (window == NULL) if (window == NULL)
@ -190,10 +190,10 @@ gdk_broadway_device_query_state (GdkDevice *device,
} }
void void
_gdk_broadway_window_grab_check_unmap (GdkWindow *window, _gdk_broadway_surface_grab_check_unmap (GdkSurface *window,
gulong serial) gulong serial)
{ {
GdkDisplay *display = gdk_window_get_display (window); GdkDisplay *display = gdk_surface_get_display (window);
GdkSeat *seat; GdkSeat *seat;
GList *devices, *d; GList *devices, *d;
@ -212,9 +212,9 @@ _gdk_broadway_window_grab_check_unmap (GdkWindow *window,
void void
_gdk_broadway_window_grab_check_destroy (GdkWindow *window) _gdk_broadway_surface_grab_check_destroy (GdkSurface *window)
{ {
GdkDisplay *display = gdk_window_get_display (window); GdkDisplay *display = gdk_surface_get_display (window);
GdkSeat *seat; GdkSeat *seat;
GdkDeviceGrabInfo *grab; GdkDeviceGrabInfo *grab;
GList *devices, *d; GList *devices, *d;
@ -244,10 +244,10 @@ _gdk_broadway_window_grab_check_destroy (GdkWindow *window)
static GdkGrabStatus static GdkGrabStatus
gdk_broadway_device_grab (GdkDevice *device, gdk_broadway_device_grab (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gboolean owner_events, gboolean owner_events,
GdkEventMask event_mask, GdkEventMask event_mask,
GdkWindow *confine_to, GdkSurface *confine_to,
GdkCursor *cursor, GdkCursor *cursor,
guint32 time_) guint32 time_)
{ {
@ -266,7 +266,7 @@ gdk_broadway_device_grab (GdkDevice *device,
{ {
/* Device is a pointer */ /* Device is a pointer */
return _gdk_broadway_server_grab_pointer (broadway_display->server, return _gdk_broadway_server_grab_pointer (broadway_display->server,
GDK_WINDOW_IMPL_BROADWAY (window->impl)->id, GDK_SURFACE_IMPL_BROADWAY (window->impl)->id,
owner_events, owner_events,
event_mask, event_mask,
time_); time_);
@ -311,14 +311,14 @@ gdk_broadway_device_ungrab (GdkDevice *device,
} }
} }
static GdkWindow * static GdkSurface *
gdk_broadway_device_window_at_position (GdkDevice *device, gdk_broadway_device_window_at_position (GdkDevice *device,
gdouble *win_x, gdouble *win_x,
gdouble *win_y, gdouble *win_y,
GdkModifierType *mask, GdkModifierType *mask,
gboolean get_toplevel) gboolean get_toplevel)
{ {
GdkWindow *window; GdkSurface *window;
gdk_broadway_device_query_state (device, NULL, &window, NULL, NULL, win_x, win_y, mask); gdk_broadway_device_query_state (device, NULL, &window, NULL, NULL, win_x, win_y, mask);
@ -327,7 +327,7 @@ gdk_broadway_device_window_at_position (GdkDevice *device,
static void static void
gdk_broadway_device_select_window_events (GdkDevice *device, gdk_broadway_device_select_window_events (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkEventMask event_mask) GdkEventMask event_mask)
{ {
} }

View File

@ -181,10 +181,10 @@ _gdk_broadway_display_size_changed (GdkDisplay *display,
toplevels = broadway_display->toplevels; toplevels = broadway_display->toplevels;
for (l = toplevels; l != NULL; l = l->next) for (l = toplevels; l != NULL; l = l->next)
{ {
GdkWindowImplBroadway *toplevel_impl = l->data; GdkSurfaceImplBroadway *toplevel_impl = l->data;
if (toplevel_impl->maximized) if (toplevel_impl->maximized)
gdk_window_move_resize (toplevel_impl->wrapper, 0, 0, msg->width, msg->height); gdk_surface_move_resize (toplevel_impl->wrapper, 0, 0, msg->width, msg->height);
} }
} }
@ -313,7 +313,7 @@ gdk_broadway_display_has_pending (GdkDisplay *display)
return FALSE; return FALSE;
} }
static GdkWindow * static GdkSurface *
gdk_broadway_display_get_default_group (GdkDisplay *display) gdk_broadway_display_get_default_group (GdkDisplay *display)
{ {
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
@ -520,7 +520,7 @@ gdk_broadway_display_class_init (GdkBroadwayDisplayClass * class)
object_class->dispose = gdk_broadway_display_dispose; object_class->dispose = gdk_broadway_display_dispose;
object_class->finalize = gdk_broadway_display_finalize; object_class->finalize = gdk_broadway_display_finalize;
display_class->window_type = GDK_TYPE_BROADWAY_WINDOW; display_class->window_type = GDK_TYPE_BROADWAY_SURFACE;
display_class->get_name = gdk_broadway_display_get_name; display_class->get_name = gdk_broadway_display_get_name;
display_class->beep = gdk_broadway_display_beep; display_class->beep = gdk_broadway_display_beep;

View File

@ -84,7 +84,7 @@ gdk_broadway_drag_context_finalize (GObject *object)
/* Drag Contexts */ /* Drag Contexts */
GdkDragContext * GdkDragContext *
_gdk_broadway_window_drag_begin (GdkWindow *window, _gdk_broadway_surface_drag_begin (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
GdkContentProvider *content, GdkContentProvider *content,
GdkDragAction actions, GdkDragAction actions,
@ -94,10 +94,10 @@ _gdk_broadway_window_drag_begin (GdkWindow *window,
GdkDragContext *new_context; GdkDragContext *new_context;
g_return_val_if_fail (window != NULL, NULL); g_return_val_if_fail (window != NULL, NULL);
g_return_val_if_fail (GDK_WINDOW_IS_BROADWAY (window), NULL); g_return_val_if_fail (GDK_SURFACE_IS_BROADWAY (window), NULL);
new_context = g_object_new (GDK_TYPE_BROADWAY_DRAG_CONTEXT, new_context = g_object_new (GDK_TYPE_BROADWAY_DRAG_CONTEXT,
"display", gdk_window_get_display (window), "display", gdk_surface_get_display (window),
"content", content, "content", content,
NULL); NULL);
@ -145,7 +145,7 @@ gdk_broadway_drag_context_drop_finish (GdkDragContext *context,
} }
void void
_gdk_broadway_window_register_dnd (GdkWindow *window) _gdk_broadway_surface_register_dnd (GdkSurface *window)
{ {
} }

View File

@ -88,7 +88,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
GdkDisplay *display; GdkDisplay *display;
GdkBroadwayDisplay *display_broadway; GdkBroadwayDisplay *display_broadway;
GdkSeat *seat; GdkSeat *seat;
GdkWindow *window; GdkSurface *window;
GdkEvent *event = NULL; GdkEvent *event = NULL;
GList *node; GList *node;
GSList *list, *d; GSList *list, *d;

View File

@ -42,30 +42,30 @@ void _gdk_broadway_resync_windows (void);
guint32 gdk_broadway_display_ensure_texture (GdkDisplay *display, guint32 gdk_broadway_display_ensure_texture (GdkDisplay *display,
GdkTexture *texture); GdkTexture *texture);
void gdk_broadway_window_set_nodes (GdkWindow *window, void gdk_broadway_surface_set_nodes (GdkSurface *window,
GArray *nodes, GArray *nodes,
GPtrArray *node_textures); GPtrArray *node_textures);
void _gdk_broadway_window_register_dnd (GdkWindow *window); void _gdk_broadway_surface_register_dnd (GdkSurface *window);
GdkDragContext * _gdk_broadway_window_drag_begin (GdkWindow *window, GdkDragContext * _gdk_broadway_surface_drag_begin (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
GdkContentProvider *content, GdkContentProvider *content,
GdkDragAction actions, GdkDragAction actions,
gint dx, gint dx,
gint dy); gint dy);
void _gdk_broadway_window_translate (GdkWindow *window, void _gdk_broadway_surface_translate (GdkSurface *window,
cairo_region_t *area, cairo_region_t *area,
gint dx, gint dx,
gint dy); gint dy);
gboolean _gdk_broadway_moveresize_handle_event (GdkDisplay *display, gboolean _gdk_broadway_moveresize_handle_event (GdkDisplay *display,
BroadwayInputMsg *msg); BroadwayInputMsg *msg);
gboolean _gdk_broadway_moveresize_configure_done (GdkDisplay *display, gboolean _gdk_broadway_moveresize_configure_done (GdkDisplay *display,
GdkWindow *window); GdkSurface *window);
void _gdk_broadway_roundtrip_notify (GdkWindow *window, void _gdk_broadway_roundtrip_notify (GdkSurface *window,
guint32 tag, guint32 tag,
gboolean local_reply); gboolean local_reply);
void _gdk_broadway_window_grab_check_destroy (GdkWindow *window); void _gdk_broadway_surface_grab_check_destroy (GdkSurface *window);
void _gdk_broadway_window_grab_check_unmap (GdkWindow *window, void _gdk_broadway_surface_grab_check_unmap (GdkSurface *window,
gulong serial); gulong serial);
void _gdk_keymap_keys_changed (GdkDisplay *display); void _gdk_keymap_keys_changed (GdkDisplay *display);
@ -100,10 +100,10 @@ void _gdk_broadway_display_get_maximal_cursor_size (GdkDisplay *display,
guint *width, guint *width,
guint *height); guint *height);
void _gdk_broadway_display_create_window_impl (GdkDisplay *display, void _gdk_broadway_display_create_window_impl (GdkDisplay *display,
GdkWindow *window, GdkSurface *window,
GdkWindow *real_parent, GdkSurface *real_parent,
GdkEventMask event_mask, GdkEventMask event_mask,
GdkWindowAttr *attributes); GdkSurfaceAttr *attributes);
gint _gdk_broadway_display_text_property_to_utf8_list (GdkDisplay *display, gint _gdk_broadway_display_text_property_to_utf8_list (GdkDisplay *display,
GdkAtom encoding, GdkAtom encoding,
gint format, gint format,
@ -120,11 +120,11 @@ BroadwayInputMsg * _gdk_broadway_display_block_for_input (GdkDisplay *display,
gboolean remove); gboolean remove);
/* Window methods - testing */ /* Window methods - testing */
void _gdk_broadway_window_resize_surface (GdkWindow *window); void _gdk_broadway_surface_resize_surface (GdkSurface *window);
void _gdk_broadway_cursor_update_theme (GdkCursor *cursor); void _gdk_broadway_cursor_update_theme (GdkCursor *cursor);
void _gdk_broadway_cursor_display_finalize (GdkDisplay *display); void _gdk_broadway_cursor_display_finalize (GdkDisplay *display);
#define GDK_WINDOW_IS_BROADWAY(win) (GDK_IS_WINDOW_IMPL_BROADWAY (((GdkWindow *)win)->impl)) #define GDK_SURFACE_IS_BROADWAY(win) (GDK_IS_SURFACE_IMPL_BROADWAY (((GdkSurface *)win)->impl))
#endif /* __GDK_PRIVATE_BROADWAY_H__ */ #endif /* __GDK_PRIVATE_BROADWAY_H__ */

File diff suppressed because it is too large Load Diff

View File

@ -22,31 +22,31 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/ */
#ifndef __GDK_WINDOW_BROADWAY_H__ #ifndef __GDK_SURFACE_BROADWAY_H__
#define __GDK_WINDOW_BROADWAY_H__ #define __GDK_SURFACE_BROADWAY_H__
#include <gdk/gdkwindowimpl.h> #include <gdk/gdkwindowimpl.h>
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct _GdkWindowImplBroadway GdkWindowImplBroadway; typedef struct _GdkSurfaceImplBroadway GdkSurfaceImplBroadway;
typedef struct _GdkWindowImplBroadwayClass GdkWindowImplBroadwayClass; typedef struct _GdkSurfaceImplBroadwayClass GdkSurfaceImplBroadwayClass;
/* Window implementation for Broadway /* Window implementation for Broadway
*/ */
#define GDK_TYPE_WINDOW_IMPL_BROADWAY (gdk_window_impl_broadway_get_type ()) #define GDK_TYPE_SURFACE_IMPL_BROADWAY (gdk_surface_impl_broadway_get_type ())
#define GDK_WINDOW_IMPL_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_BROADWAY, GdkWindowImplBroadway)) #define GDK_SURFACE_IMPL_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL_BROADWAY, GdkSurfaceImplBroadway))
#define GDK_WINDOW_IMPL_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL_BROADWAY, GdkWindowImplBroadwayClass)) #define GDK_SURFACE_IMPL_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL_BROADWAY, GdkSurfaceImplBroadwayClass))
#define GDK_IS_WINDOW_IMPL_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_BROADWAY)) #define GDK_IS_SURFACE_IMPL_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL_BROADWAY))
#define GDK_IS_WINDOW_IMPL_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_BROADWAY)) #define GDK_IS_SURFACE_IMPL_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL_BROADWAY))
#define GDK_WINDOW_IMPL_BROADWAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_BROADWAY, GdkWindowImplBroadwayClass)) #define GDK_SURFACE_IMPL_BROADWAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL_BROADWAY, GdkSurfaceImplBroadwayClass))
struct _GdkWindowImplBroadway struct _GdkSurfaceImplBroadway
{ {
GdkWindowImpl parent_instance; GdkSurfaceImpl parent_instance;
GdkWindow *wrapper; GdkSurface *wrapper;
GdkCursor *cursor; GdkCursor *cursor;
@ -66,19 +66,19 @@ struct _GdkWindowImplBroadway
gboolean last_synced; gboolean last_synced;
GdkGeometry geometry_hints; GdkGeometry geometry_hints;
GdkWindowHints geometry_hints_mask; GdkSurfaceHints geometry_hints_mask;
GArray *node_data; GArray *node_data;
GPtrArray *node_data_textures; GPtrArray *node_data_textures;
}; };
struct _GdkWindowImplBroadwayClass struct _GdkSurfaceImplBroadwayClass
{ {
GdkWindowImplClass parent_class; GdkSurfaceImplClass parent_class;
}; };
GType gdk_window_impl_broadway_get_type (void); GType gdk_surface_impl_broadway_get_type (void);
G_END_DECLS G_END_DECLS
#endif /* __GDK_WINDOW_BROADWAY_H__ */ #endif /* __GDK_SURFACE_BROADWAY_H__ */

View File

@ -36,7 +36,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkKeymap, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkMonitor, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkMonitor, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkSeat, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkSeat, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkVulkanContext, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkVulkanContext, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkWindow, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkSurface, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentFormats, gdk_content_formats_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentFormats, gdk_content_formats_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkEvent, gdk_event_free) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkEvent, gdk_event_free)

View File

@ -10,17 +10,17 @@ GdkDisplay * gdk_display_open_default (void);
gboolean gdk_device_grab_info (GdkDisplay *display, gboolean gdk_device_grab_info (GdkDisplay *display,
GdkDevice *device, GdkDevice *device,
GdkWindow **grab_window, GdkSurface **grab_window,
gboolean *owner_events); gboolean *owner_events);
void gdk_pre_parse (void); void gdk_pre_parse (void);
void gdk_window_freeze_toplevel_updates (GdkWindow *window); void gdk_surface_freeze_toplevel_updates (GdkSurface *window);
void gdk_window_thaw_toplevel_updates (GdkWindow *window); void gdk_surface_thaw_toplevel_updates (GdkSurface *window);
gboolean gdk_window_supports_edge_constraints (GdkWindow *window); gboolean gdk_surface_supports_edge_constraints (GdkSurface *window);
void gdk_window_move_to_rect (GdkWindow *window, void gdk_surface_move_to_rect (GdkSurface *window,
const GdkRectangle *rect, const GdkRectangle *rect,
GdkGravity rect_anchor, GdkGravity rect_anchor,
GdkGravity window_anchor, GdkGravity window_anchor,

View File

@ -33,9 +33,9 @@
* can be used with GDK. GTK+ does all of its drawing using cairo. * can be used with GDK. GTK+ does all of its drawing using cairo.
* *
* GDK does not wrap the cairo API, instead it allows to create cairo * GDK does not wrap the cairo API, instead it allows to create cairo
* contexts which can be used to draw on #GdkWindows. Additional * contexts which can be used to draw on #GdkSurfaces. Additional
* functions allow use #GdkRectangles with cairo and to use #GdkRGBAs, * functions allow use #GdkRectangles with cairo and to use #GdkRGBAs,
* #GdkPixbufs and #GdkWindows as sources for drawing operations. * #GdkPixbufs and #GdkSurfaces as sources for drawing operations.
*/ */
@ -251,14 +251,14 @@ gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
cairo_surface_t * cairo_surface_t *
gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf, gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf,
int scale, int scale,
GdkWindow *for_window) GdkSurface *for_window)
{ {
cairo_format_t format; cairo_format_t format;
cairo_surface_t *surface; cairo_surface_t *surface;
g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL); g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
g_return_val_if_fail (scale >= 0, NULL); g_return_val_if_fail (scale >= 0, NULL);
g_return_val_if_fail (for_window == NULL || GDK_IS_WINDOW (for_window), NULL); g_return_val_if_fail (for_window == NULL || GDK_IS_SURFACE (for_window), NULL);
if (gdk_pixbuf_get_n_channels (pixbuf) == 3) if (gdk_pixbuf_get_n_channels (pixbuf) == 3)
format = CAIRO_FORMAT_RGB24; format = CAIRO_FORMAT_RGB24;
@ -266,7 +266,7 @@ gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf,
format = CAIRO_FORMAT_ARGB32; format = CAIRO_FORMAT_ARGB32;
surface = surface =
gdk_window_create_similar_image_surface (for_window, gdk_surface_create_similar_image_surface (for_window,
format, format,
gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_width (pixbuf),
gdk_pixbuf_get_height (pixbuf), gdk_pixbuf_get_height (pixbuf),

View File

@ -58,10 +58,10 @@ cairo_region_t *
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
cairo_surface_t * gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf, cairo_surface_t * gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf,
int scale, int scale,
GdkWindow *for_window); GdkSurface *for_window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_cairo_draw_from_gl (cairo_t *cr, void gdk_cairo_draw_from_gl (cairo_t *cr,
GdkWindow *window, GdkSurface *window,
int source, int source,
int source_type, int source_type,
int buffer_scale, int buffer_scale,

View File

@ -48,7 +48,7 @@
* *
* Cursors by themselves are not very interesting, they must be * Cursors by themselves are not very interesting, they must be
* bound to a window for users to see them. This is done with * bound to a window for users to see them. This is done with
* gdk_window_set_cursor() or gdk_window_set_device_cursor(). * gdk_surface_set_cursor() or gdk_surface_set_device_cursor().
* Applications will typically use higher-level GTK+ functions such * Applications will typically use higher-level GTK+ functions such
* as gtk_widget_set_cursor() instead. * as gtk_widget_set_cursor() instead.
* *
@ -69,7 +69,7 @@
* gdk_display_get_maximal_cursor_size() for the limitations that might apply. * gdk_display_get_maximal_cursor_size() for the limitations that might apply.
* *
* To ease work with unsupported cursors, a fallback cursor can be provided. * To ease work with unsupported cursors, a fallback cursor can be provided.
* If a #GdkWindow cannot use a cursor because of the reasons mentioned above, * If a #GdkSurface cannot use a cursor because of the reasons mentioned above,
* it will try the fallback cursor. Of course, fallback cursors can themselves * it will try the fallback cursor. Of course, fallback cursors can themselves
* have fallback cursors again, so it is possible to provide a chain of * have fallback cursors again, so it is possible to provide a chain of
* progressively easier to support cursors. If none of the provided cursors * progressively easier to support cursors. If none of the provided cursors

View File

@ -502,7 +502,7 @@ gdk_device_get_property (GObject *object,
/** /**
* gdk_device_get_state: (skip) * gdk_device_get_state: (skip)
* @device: a #GdkDevice. * @device: a #GdkDevice.
* @window: a #GdkWindow. * @window: a #GdkSurface.
* @axes: (nullable) (array): an array of doubles to store the values of * @axes: (nullable) (array): an array of doubles to store the values of
* the axes of @device in, or %NULL. * the axes of @device in, or %NULL.
* @mask: (optional) (out): location to store the modifiers, or %NULL. * @mask: (optional) (out): location to store the modifiers, or %NULL.
@ -514,13 +514,13 @@ gdk_device_get_property (GObject *object,
*/ */
void void
gdk_device_get_state (GdkDevice *device, gdk_device_get_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gdouble *axes, gdouble *axes,
GdkModifierType *mask) GdkModifierType *mask)
{ {
g_return_if_fail (GDK_IS_DEVICE (device)); g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD); g_return_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD);
g_return_if_fail (GDK_IS_WINDOW (window)); g_return_if_fail (GDK_IS_SURFACE (window));
g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE || g_return_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
gdk_display_device_is_grabbed (gdk_device_get_display (device), device)); gdk_display_device_is_grabbed (gdk_device_get_display (device), device));
@ -609,16 +609,16 @@ gdk_device_get_position (GdkDevice *device,
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE, * function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
* unless there is an ongoing grab on them, see gdk_device_grab(). * unless there is an ongoing grab on them, see gdk_device_grab().
* *
* Returns: (nullable) (transfer none): the #GdkWindow under the * Returns: (nullable) (transfer none): the #GdkSurface under the
* device position, or %NULL. * device position, or %NULL.
**/ **/
GdkWindow * GdkSurface *
gdk_device_get_window_at_position_double (GdkDevice *device, gdk_device_get_window_at_position_double (GdkDevice *device,
gdouble *win_x, gdouble *win_x,
gdouble *win_y) gdouble *win_y)
{ {
gdouble tmp_x, tmp_y; gdouble tmp_x, tmp_y;
GdkWindow *window; GdkSurface *window;
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL); g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
@ -630,7 +630,7 @@ gdk_device_get_window_at_position_double (GdkDevice *device,
/* This might need corrections, as the native window returned /* This might need corrections, as the native window returned
may contain client side children */ may contain client side children */
if (window) if (window)
window = _gdk_window_find_descendant_at (window, window = _gdk_surface_find_descendant_at (window,
tmp_x, tmp_y, tmp_x, tmp_y,
&tmp_x, &tmp_y); &tmp_x, &tmp_y);
@ -657,16 +657,16 @@ gdk_device_get_window_at_position_double (GdkDevice *device,
* function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE, * function may not be called on devices of type %GDK_DEVICE_TYPE_SLAVE,
* unless there is an ongoing grab on them, see gdk_device_grab(). * unless there is an ongoing grab on them, see gdk_device_grab().
* *
* Returns: (nullable) (transfer none): the #GdkWindow under the * Returns: (nullable) (transfer none): the #GdkSurface under the
* device position, or %NULL. * device position, or %NULL.
**/ **/
GdkWindow * GdkSurface *
gdk_device_get_window_at_position (GdkDevice *device, gdk_device_get_window_at_position (GdkDevice *device,
gint *win_x, gint *win_x,
gint *win_y) gint *win_y)
{ {
gdouble tmp_x, tmp_y; gdouble tmp_x, tmp_y;
GdkWindow *window; GdkSurface *window;
window = window =
gdk_device_get_window_at_position_double (device, &tmp_x, &tmp_y); gdk_device_get_window_at_position_double (device, &tmp_x, &tmp_y);
@ -698,7 +698,7 @@ gdk_device_get_window_at_position (GdkDevice *device,
* be returned. (This is not distinguishable from the case where * be returned. (This is not distinguishable from the case where
* motion history is supported and no events were found.) * motion history is supported and no events were found.)
* *
* Note that there is also gdk_window_set_event_compression() to get * Note that there is also gdk_surface_set_event_compression() to get
* more motion events delivered directly, independent of the windowing * more motion events delivered directly, independent of the windowing
* system. * system.
* *
@ -707,7 +707,7 @@ gdk_device_get_window_at_position (GdkDevice *device,
**/ **/
gboolean gboolean
gdk_device_get_history (GdkDevice *device, gdk_device_get_history (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
guint32 start, guint32 start,
guint32 stop, guint32 stop,
GdkTimeCoord ***events, GdkTimeCoord ***events,
@ -715,7 +715,7 @@ gdk_device_get_history (GdkDevice *device,
{ {
g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE); g_return_val_if_fail (GDK_IS_DEVICE (device), FALSE);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, FALSE); g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, FALSE);
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE);
if (n_events) if (n_events)
*n_events = 0; *n_events = 0;
@ -723,7 +723,7 @@ gdk_device_get_history (GdkDevice *device,
if (events) if (events)
*events = NULL; *events = NULL;
if (GDK_WINDOW_DESTROYED (window)) if (GDK_SURFACE_DESTROYED (window))
return FALSE; return FALSE;
if (!GDK_DEVICE_GET_CLASS (device)->get_history) if (!GDK_DEVICE_GET_CLASS (device)->get_history)
@ -1311,7 +1311,7 @@ get_native_grab_event_mask (GdkEventMask grab_mask)
* or gdk_event_get_device() if the grab is in reaction to an event. Also, you can use * or gdk_event_get_device() if the grab is in reaction to an event. Also, you can use
* gdk_seat_get_pointer() but only in code that isnt triggered by a * gdk_seat_get_pointer() but only in code that isnt triggered by a
* #GdkEvent and there arent other means to get a meaningful #GdkDevice to operate on. * #GdkEvent and there arent other means to get a meaningful #GdkDevice to operate on.
* @window: the #GdkWindow which will own the grab (the grab window) * @window: the #GdkSurface which will own the grab (the grab window)
* @grab_ownership: specifies the grab ownership. * @grab_ownership: specifies the grab ownership.
* @owner_events: if %FALSE then all device events are reported with respect to * @owner_events: if %FALSE then all device events are reported with respect to
* @window and are only reported if selected by @event_mask. If * @window and are only reported if selected by @event_mask. If
@ -1357,7 +1357,7 @@ get_native_grab_event_mask (GdkEventMask grab_mask)
**/ **/
GdkGrabStatus GdkGrabStatus
gdk_device_grab (GdkDevice *device, gdk_device_grab (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkGrabOwnership grab_ownership, GdkGrabOwnership grab_ownership,
gboolean owner_events, gboolean owner_events,
GdkEventMask event_mask, GdkEventMask event_mask,
@ -1365,15 +1365,15 @@ gdk_device_grab (GdkDevice *device,
guint32 time_) guint32 time_)
{ {
GdkGrabStatus res; GdkGrabStatus res;
GdkWindow *native; GdkSurface *native;
g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_GRAB_FAILED); g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_GRAB_FAILED);
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED); g_return_val_if_fail (GDK_IS_SURFACE (window), GDK_GRAB_FAILED);
g_return_val_if_fail (gdk_window_get_display (window) == gdk_device_get_display (device), GDK_GRAB_FAILED); g_return_val_if_fail (gdk_surface_get_display (window) == gdk_device_get_display (device), GDK_GRAB_FAILED);
native = gdk_window_get_toplevel (window); native = gdk_surface_get_toplevel (window);
if (native == NULL || GDK_WINDOW_DESTROYED (native)) if (native == NULL || GDK_SURFACE_DESTROYED (native))
return GDK_GRAB_NOT_VIEWABLE; return GDK_GRAB_NOT_VIEWABLE;
res = GDK_DEVICE_GET_CLASS (device)->grab (device, res = GDK_DEVICE_GET_CLASS (device)->grab (device,
@ -1389,7 +1389,7 @@ gdk_device_grab (GdkDevice *device,
GdkDisplay *display; GdkDisplay *display;
gulong serial; gulong serial;
display = gdk_window_get_display (window); display = gdk_surface_get_display (window);
serial = _gdk_display_get_next_serial (display); serial = _gdk_display_get_next_serial (display);
_gdk_display_add_device_grab (display, _gdk_display_add_device_grab (display,
@ -1567,7 +1567,7 @@ find_axis_info (GArray *array,
gboolean gboolean
_gdk_device_translate_window_coord (GdkDevice *device, _gdk_device_translate_window_coord (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
guint index_, guint index_,
gdouble value, gdouble value,
gdouble *axis_value) gdouble *axis_value)
@ -1608,8 +1608,8 @@ _gdk_device_translate_window_coord (GdkDevice *device,
x_min = axis_info_x->min_value; x_min = axis_info_x->min_value;
y_min = axis_info_y->min_value; y_min = axis_info_y->min_value;
window_width = gdk_window_get_width (window); window_width = gdk_surface_get_width (window);
window_height = gdk_window_get_height (window); window_height = gdk_surface_get_height (window);
x_resolution = axis_info_x->resolution; x_resolution = axis_info_x->resolution;
y_resolution = axis_info_y->resolution; y_resolution = axis_info_y->resolution;
@ -1665,7 +1665,7 @@ _gdk_device_translate_window_coord (GdkDevice *device,
gboolean gboolean
_gdk_device_translate_screen_coord (GdkDevice *device, _gdk_device_translate_screen_coord (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gdouble window_root_x, gdouble window_root_x,
gdouble window_root_y, gdouble window_root_y,
gdouble screen_width, gdouble screen_width,
@ -1746,8 +1746,8 @@ _gdk_device_translate_axis (GdkDevice *device,
void void
_gdk_device_query_state (GdkDevice *device, _gdk_device_query_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkWindow **child_window, GdkSurface **child_window,
gdouble *root_x, gdouble *root_x,
gdouble *root_y, gdouble *root_y,
gdouble *win_x, gdouble *win_x,
@ -1764,7 +1764,7 @@ _gdk_device_query_state (GdkDevice *device,
mask); mask);
} }
GdkWindow * GdkSurface *
_gdk_device_window_at_position (GdkDevice *device, _gdk_device_window_at_position (GdkDevice *device,
gdouble *win_x, gdouble *win_x,
gdouble *win_y, gdouble *win_y,
@ -1790,11 +1790,11 @@ _gdk_device_window_at_position (GdkDevice *device,
* *
* Returns: (transfer none) (allow-none): the last window the device * Returns: (transfer none) (allow-none): the last window the device
*/ */
GdkWindow * GdkSurface *
gdk_device_get_last_event_window (GdkDevice *device) gdk_device_get_last_event_window (GdkDevice *device)
{ {
GdkDisplay *display; GdkDisplay *display;
GdkPointerWindowInfo *info; GdkPointerSurfaceInfo *info;
g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL); g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);

View File

@ -163,7 +163,7 @@ void gdk_device_set_axis_use (GdkDevice *device,
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_device_get_state (GdkDevice *device, void gdk_device_get_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gdouble *axes, gdouble *axes,
GdkModifierType *mask); GdkModifierType *mask);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
@ -171,7 +171,7 @@ void gdk_device_get_position (GdkDevice *device,
gint *x, gint *x,
gint *y); gint *y);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow * GdkSurface *
gdk_device_get_window_at_position gdk_device_get_window_at_position
(GdkDevice *device, (GdkDevice *device,
gint *win_x, gint *win_x,
@ -181,14 +181,14 @@ void gdk_device_get_position_double (GdkDevice *device,
gdouble *x, gdouble *x,
gdouble *y); gdouble *y);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow * GdkSurface *
gdk_device_get_window_at_position_double gdk_device_get_window_at_position_double
(GdkDevice *device, (GdkDevice *device,
gdouble *win_x, gdouble *win_x,
gdouble *win_y); gdouble *win_y);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_device_get_history (GdkDevice *device, gboolean gdk_device_get_history (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
guint32 start, guint32 start,
guint32 stop, guint32 stop,
GdkTimeCoord ***events, GdkTimeCoord ***events,
@ -225,7 +225,7 @@ GdkDeviceType gdk_device_get_device_type (GdkDevice *device);
GDK_DEPRECATED_FOR(gdk_seat_grab) GDK_DEPRECATED_FOR(gdk_seat_grab)
GdkGrabStatus gdk_device_grab (GdkDevice *device, GdkGrabStatus gdk_device_grab (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkGrabOwnership grab_ownership, GdkGrabOwnership grab_ownership,
gboolean owner_events, gboolean owner_events,
GdkEventMask event_mask, GdkEventMask event_mask,
@ -242,7 +242,7 @@ void gdk_device_warp (GdkDevice *device,
gint y); gint y);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow *gdk_device_get_last_event_window (GdkDevice *device); GdkSurface *gdk_device_get_last_event_window (GdkDevice *device);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
const gchar *gdk_device_get_vendor_id (GdkDevice *device); const gchar *gdk_device_get_vendor_id (GdkDevice *device);

View File

@ -71,49 +71,49 @@ struct _GdkDeviceClass
GObjectClass parent_class; GObjectClass parent_class;
gboolean (* get_history) (GdkDevice *device, gboolean (* get_history) (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
guint32 start, guint32 start,
guint32 stop, guint32 stop,
GdkTimeCoord ***events, GdkTimeCoord ***events,
gint *n_events); gint *n_events);
void (* get_state) (GdkDevice *device, void (* get_state) (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gdouble *axes, gdouble *axes,
GdkModifierType *mask); GdkModifierType *mask);
void (* set_window_cursor) (GdkDevice *device, void (* set_window_cursor) (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkCursor *cursor); GdkCursor *cursor);
void (* warp) (GdkDevice *device, void (* warp) (GdkDevice *device,
gdouble x, gdouble x,
gdouble y); gdouble y);
void (* query_state) (GdkDevice *device, void (* query_state) (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkWindow **child_window, GdkSurface **child_window,
gdouble *root_x, gdouble *root_x,
gdouble *root_y, gdouble *root_y,
gdouble *win_x, gdouble *win_x,
gdouble *win_y, gdouble *win_y,
GdkModifierType *mask); GdkModifierType *mask);
GdkGrabStatus (* grab) (GdkDevice *device, GdkGrabStatus (* grab) (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gboolean owner_events, gboolean owner_events,
GdkEventMask event_mask, GdkEventMask event_mask,
GdkWindow *confine_to, GdkSurface *confine_to,
GdkCursor *cursor, GdkCursor *cursor,
guint32 time_); guint32 time_);
void (*ungrab) (GdkDevice *device, void (*ungrab) (GdkDevice *device,
guint32 time_); guint32 time_);
GdkWindow * (* window_at_position) (GdkDevice *device, GdkSurface * (* window_at_position) (GdkDevice *device,
double *win_x, double *win_x,
double *win_y, double *win_y,
GdkModifierType *mask, GdkModifierType *mask,
gboolean get_toplevel); gboolean get_toplevel);
void (* select_window_events) (GdkDevice *device, void (* select_window_events) (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkEventMask event_mask); GdkEventMask event_mask);
}; };
@ -139,13 +139,13 @@ void _gdk_device_set_keys (GdkDevice *device,
guint num_keys); guint num_keys);
gboolean _gdk_device_translate_window_coord (GdkDevice *device, gboolean _gdk_device_translate_window_coord (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
guint index, guint index,
gdouble value, gdouble value,
gdouble *axis_value); gdouble *axis_value);
gboolean _gdk_device_translate_screen_coord (GdkDevice *device, gboolean _gdk_device_translate_screen_coord (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gdouble window_root_x, gdouble window_root_x,
gdouble window_root_y, gdouble window_root_y,
gdouble screen_width, gdouble screen_width,
@ -167,14 +167,14 @@ void _gdk_device_add_slave (GdkDevice *device,
void _gdk_device_remove_slave (GdkDevice *device, void _gdk_device_remove_slave (GdkDevice *device,
GdkDevice *slave); GdkDevice *slave);
void _gdk_device_query_state (GdkDevice *device, void _gdk_device_query_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkWindow **child_window, GdkSurface **child_window,
gdouble *root_x, gdouble *root_x,
gdouble *root_y, gdouble *root_y,
gdouble *win_x, gdouble *win_x,
gdouble *win_y, gdouble *win_y,
GdkModifierType *mask); GdkModifierType *mask);
GdkWindow * _gdk_device_window_at_position (GdkDevice *device, GdkSurface * _gdk_device_window_at_position (GdkDevice *device,
gdouble *win_x, gdouble *win_x,
gdouble *win_y, gdouble *win_y,
GdkModifierType *mask, GdkModifierType *mask,

View File

@ -171,7 +171,7 @@ gdk_display_class_init (GdkDisplayClass *class)
object_class->get_property = gdk_display_get_property; object_class->get_property = gdk_display_get_property;
class->get_app_launch_context = gdk_display_real_get_app_launch_context; class->get_app_launch_context = gdk_display_real_get_app_launch_context;
class->window_type = GDK_TYPE_WINDOW; class->window_type = GDK_TYPE_SURFACE;
class->opened = gdk_display_real_opened; class->opened = gdk_display_real_opened;
class->make_default = gdk_display_real_make_default; class->make_default = gdk_display_real_make_default;
@ -326,10 +326,10 @@ gdk_display_class_init (GdkDisplayClass *class)
} }
static void static void
free_pointer_info (GdkPointerWindowInfo *info) free_pointer_info (GdkPointerSurfaceInfo *info)
{ {
g_clear_object (&info->window_under_pointer); g_clear_object (&info->window_under_pointer);
g_slice_free (GdkPointerWindowInfo, info); g_slice_free (GdkPointerSurfaceInfo, info);
} }
static void static void
@ -516,14 +516,14 @@ gdk_display_put_event (GdkDisplay *display,
static void static void
generate_grab_broken_event (GdkDisplay *display, generate_grab_broken_event (GdkDisplay *display,
GdkWindow *window, GdkSurface *window,
GdkDevice *device, GdkDevice *device,
gboolean implicit, gboolean implicit,
GdkWindow *grab_window) GdkSurface *grab_window)
{ {
g_return_if_fail (window != NULL); g_return_if_fail (window != NULL);
if (!GDK_WINDOW_DESTROYED (window)) if (!GDK_SURFACE_DESTROYED (window))
{ {
GdkEvent *event; GdkEvent *event;
@ -559,8 +559,8 @@ _gdk_display_get_last_device_grab (GdkDisplay *display,
GdkDeviceGrabInfo * GdkDeviceGrabInfo *
_gdk_display_add_device_grab (GdkDisplay *display, _gdk_display_add_device_grab (GdkDisplay *display,
GdkDevice *device, GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkWindow *native_window, GdkSurface *native_window,
GdkGrabOwnership grab_ownership, GdkGrabOwnership grab_ownership,
gboolean owner_events, gboolean owner_events,
GdkEventMask event_mask, GdkEventMask event_mask,
@ -619,23 +619,23 @@ _gdk_display_add_device_grab (GdkDisplay *display,
return info; return info;
} }
static GdkWindow * static GdkSurface *
get_current_toplevel (GdkDisplay *display, get_current_toplevel (GdkDisplay *display,
GdkDevice *device, GdkDevice *device,
int *x_out, int *x_out,
int *y_out, int *y_out,
GdkModifierType *state_out) GdkModifierType *state_out)
{ {
GdkWindow *pointer_window; GdkSurface *pointer_window;
gdouble x, y; gdouble x, y;
GdkModifierType state; GdkModifierType state;
pointer_window = _gdk_device_window_at_position (device, &x, &y, &state, TRUE); pointer_window = _gdk_device_window_at_position (device, &x, &y, &state, TRUE);
if (pointer_window != NULL && if (pointer_window != NULL &&
(GDK_WINDOW_DESTROYED (pointer_window) || (GDK_SURFACE_DESTROYED (pointer_window) ||
GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_ROOT || GDK_SURFACE_TYPE (pointer_window) == GDK_SURFACE_ROOT ||
GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_FOREIGN)) GDK_SURFACE_TYPE (pointer_window) == GDK_SURFACE_FOREIGN))
pointer_window = NULL; pointer_window = NULL;
*x_out = round (x); *x_out = round (x);
@ -654,8 +654,8 @@ switch_to_pointer_grab (GdkDisplay *display,
guint32 time, guint32 time,
gulong serial) gulong serial)
{ {
GdkWindow *new_toplevel; GdkSurface *new_toplevel;
GdkPointerWindowInfo *info; GdkPointerSurfaceInfo *info;
GList *old_grabs; GList *old_grabs;
GdkModifierType state; GdkModifierType state;
int x = 0, y = 0; int x = 0, y = 0;
@ -768,7 +768,7 @@ _gdk_display_device_grab_update (GdkDisplay *display,
if ((next_grab == NULL && current_grab->implicit_ungrab) || if ((next_grab == NULL && current_grab->implicit_ungrab) ||
(next_grab != NULL && current_grab->window != next_grab->window)) (next_grab != NULL && current_grab->window != next_grab->window))
generate_grab_broken_event (display, GDK_WINDOW (current_grab->window), generate_grab_broken_event (display, GDK_SURFACE (current_grab->window),
device, device,
current_grab->implicit, current_grab->implicit,
next_grab? next_grab->window : NULL); next_grab? next_grab->window : NULL);
@ -837,7 +837,7 @@ gboolean
_gdk_display_end_device_grab (GdkDisplay *display, _gdk_display_end_device_grab (GdkDisplay *display,
GdkDevice *device, GdkDevice *device,
gulong serial, gulong serial,
GdkWindow *if_child, GdkSurface *if_child,
gboolean implicit) gboolean implicit)
{ {
GdkDeviceGrabInfo *grab; GdkDeviceGrabInfo *grab;
@ -851,7 +851,7 @@ _gdk_display_end_device_grab (GdkDisplay *display,
grab = l->data; grab = l->data;
if (grab && if (grab &&
(if_child == NULL || (if_child == NULL ||
_gdk_window_event_parent_of (if_child, grab->window))) _gdk_surface_event_parent_of (if_child, grab->window)))
{ {
grab->serial_end = serial; grab->serial_end = serial;
grab->implicit_ungrab = implicit; grab->implicit_ungrab = implicit;
@ -916,11 +916,11 @@ _gdk_display_check_grab_ownership (GdkDisplay *display,
return TRUE; return TRUE;
} }
GdkPointerWindowInfo * GdkPointerSurfaceInfo *
_gdk_display_get_pointer_info (GdkDisplay *display, _gdk_display_get_pointer_info (GdkDisplay *display,
GdkDevice *device) GdkDevice *device)
{ {
GdkPointerWindowInfo *info; GdkPointerSurfaceInfo *info;
if (device && gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD) if (device && gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
device = gdk_device_get_associated_device (device); device = gdk_device_get_associated_device (device);
@ -932,7 +932,7 @@ _gdk_display_get_pointer_info (GdkDisplay *display,
if (G_UNLIKELY (!info)) if (G_UNLIKELY (!info))
{ {
info = g_slice_new0 (GdkPointerWindowInfo); info = g_slice_new0 (GdkPointerSurfaceInfo);
g_hash_table_insert (display->pointers_info, device, info); g_hash_table_insert (display->pointers_info, device, info);
} }
@ -951,7 +951,7 @@ _gdk_display_pointer_info_foreach (GdkDisplay *display,
while (g_hash_table_iter_next (&iter, &key, &value)) while (g_hash_table_iter_next (&iter, &key, &value))
{ {
GdkPointerWindowInfo *info = value; GdkPointerSurfaceInfo *info = value;
GdkDevice *device = key; GdkDevice *device = key;
(func) (display, device, info, user_data); (func) (display, device, info, user_data);
@ -975,7 +975,7 @@ _gdk_display_pointer_info_foreach (GdkDisplay *display,
gboolean gboolean
gdk_device_grab_info (GdkDisplay *display, gdk_device_grab_info (GdkDisplay *display,
GdkDevice *device, GdkDevice *device,
GdkWindow **grab_window, GdkSurface **grab_window,
gboolean *owner_events) gboolean *owner_events)
{ {
GdkDeviceGrabInfo *info; GdkDeviceGrabInfo *info;
@ -1105,12 +1105,12 @@ gdk_display_flush (GdkDisplay *display)
* *
* Returns the default group leader window for all toplevel windows * Returns the default group leader window for all toplevel windows
* on @display. This window is implicitly created by GDK. * on @display. This window is implicitly created by GDK.
* See gdk_window_set_group(). * See gdk_surface_set_group().
* *
* Returns: (transfer none): The default group leader window * Returns: (transfer none): The default group leader window
* for @display * for @display
**/ **/
GdkWindow * GdkSurface *
gdk_display_get_default_group (GdkDisplay *display) gdk_display_get_default_group (GdkDisplay *display)
{ {
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
@ -1162,7 +1162,7 @@ gdk_display_get_primary_clipboard (GdkDisplay *display)
* gdk_display_supports_shapes: * gdk_display_supports_shapes:
* @display: a #GdkDisplay * @display: a #GdkDisplay
* *
* Returns %TRUE if gdk_window_shape_combine_mask() can * Returns %TRUE if gdk_surface_shape_combine_mask() can
* be used to create shaped windows on @display. * be used to create shaped windows on @display.
* *
* Returns: %TRUE if shaped windows are supported * Returns: %TRUE if shaped windows are supported
@ -1179,7 +1179,7 @@ gdk_display_supports_shapes (GdkDisplay *display)
* gdk_display_supports_input_shapes: * gdk_display_supports_input_shapes:
* @display: a #GdkDisplay * @display: a #GdkDisplay
* *
* Returns %TRUE if gdk_window_input_shape_combine_mask() can * Returns %TRUE if gdk_surface_input_shape_combine_mask() can
* be used to modify the input shape of windows on @display. * be used to modify the input shape of windows on @display.
* *
* Returns: %TRUE if windows with modified input shape are supported * Returns: %TRUE if windows with modified input shape are supported
@ -1315,10 +1315,10 @@ _gdk_display_event_data_free (GdkDisplay *display,
void void
_gdk_display_create_window_impl (GdkDisplay *display, _gdk_display_create_window_impl (GdkDisplay *display,
GdkWindow *window, GdkSurface *window,
GdkWindow *real_parent, GdkSurface *real_parent,
GdkEventMask event_mask, GdkEventMask event_mask,
GdkWindowAttr *attributes) GdkSurfaceAttr *attributes)
{ {
GDK_DISPLAY_GET_CLASS (display)->create_window_impl (display, GDK_DISPLAY_GET_CLASS (display)->create_window_impl (display,
window, window,
@ -1327,7 +1327,7 @@ _gdk_display_create_window_impl (GdkDisplay *display,
attributes); attributes);
} }
GdkWindow * GdkSurface *
_gdk_display_create_window (GdkDisplay *display) _gdk_display_create_window (GdkDisplay *display)
{ {
return g_object_new (GDK_DISPLAY_GET_CLASS (display)->window_type, return g_object_new (GDK_DISPLAY_GET_CLASS (display)->window_type,
@ -1433,7 +1433,7 @@ gdk_display_set_composited (GdkDisplay *display,
* to check if that is the case. * to check if that is the case.
* *
* For setting an overall opacity for a top-level window, see * For setting an overall opacity for a top-level window, see
* gdk_window_set_opacity(). * gdk_surface_set_opacity().
* *
* On modern displays, this value is always %TRUE. * On modern displays, this value is always %TRUE.
* *
@ -1675,7 +1675,7 @@ gdk_display_get_monitor_at_point (GdkDisplay *display,
/** /**
* gdk_display_get_monitor_at_window: * gdk_display_get_monitor_at_window:
* @display: a #GdkDisplay * @display: a #GdkDisplay
* @window: a #GdkWindow * @window: a #GdkSurface
* *
* Gets the monitor in which the largest area of @window * Gets the monitor in which the largest area of @window
* resides, or a monitor close to @window if it is outside * resides, or a monitor close to @window if it is outside
@ -1685,7 +1685,7 @@ gdk_display_get_monitor_at_point (GdkDisplay *display,
*/ */
GdkMonitor * GdkMonitor *
gdk_display_get_monitor_at_window (GdkDisplay *display, gdk_display_get_monitor_at_window (GdkDisplay *display,
GdkWindow *window) GdkSurface *window)
{ {
GdkRectangle win; GdkRectangle win;
int n_monitors, i; int n_monitors, i;
@ -1704,8 +1704,8 @@ gdk_display_get_monitor_at_window (GdkDisplay *display,
return best; return best;
} }
gdk_window_get_geometry (window, &win.x, &win.y, &win.width, &win.height); gdk_surface_get_geometry (window, &win.x, &win.y, &win.width, &win.height);
gdk_window_get_origin (window, &win.x, &win.y); gdk_surface_get_origin (window, &win.x, &win.y);
n_monitors = gdk_display_get_n_monitors (display); n_monitors = gdk_display_get_n_monitors (display);
for (i = 0; i < n_monitors; i++) for (i = 0; i < n_monitors; i++)

View File

@ -80,7 +80,7 @@ GDK_AVAILABLE_IN_ALL
GdkDisplay *gdk_display_get_default (void); GdkDisplay *gdk_display_get_default (void);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow *gdk_display_get_default_group (GdkDisplay *display); GdkSurface *gdk_display_get_default_group (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkClipboard * gdk_display_get_clipboard (GdkDisplay *display); GdkClipboard * gdk_display_get_clipboard (GdkDisplay *display);
@ -117,7 +117,7 @@ GdkMonitor * gdk_display_get_monitor_at_point (GdkDisplay *display,
int y); int y);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkMonitor * gdk_display_get_monitor_at_window (GdkDisplay *display, GdkMonitor * gdk_display_get_monitor_at_window (GdkDisplay *display,
GdkWindow *window); GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkKeymap * gdk_display_get_keymap (GdkDisplay *display); GdkKeymap * gdk_display_get_keymap (GdkDisplay *display);

View File

@ -40,8 +40,8 @@ typedef struct _GdkDisplayClass GdkDisplayClass;
/* Tracks information about the device grab on this display */ /* Tracks information about the device grab on this display */
typedef struct typedef struct
{ {
GdkWindow *window; GdkSurface *window;
GdkWindow *native_window; GdkSurface *native_window;
gulong serial_start; gulong serial_start;
gulong serial_end; /* exclusive, i.e. not active on serial_end */ gulong serial_end; /* exclusive, i.e. not active on serial_end */
guint event_mask; guint event_mask;
@ -63,12 +63,12 @@ typedef struct
*/ */
typedef struct typedef struct
{ {
GdkWindow *window_under_pointer; /* window that last got a normal enter event */ GdkSurface *window_under_pointer; /* window that last got a normal enter event */
gdouble toplevel_x, toplevel_y; gdouble toplevel_x, toplevel_y;
guint32 state; guint32 state;
guint32 button; guint32 button;
GdkDevice *last_slave; GdkDevice *last_slave;
} GdkPointerWindowInfo; } GdkPointerSurfaceInfo;
struct _GdkDisplay struct _GdkDisplay
{ {
@ -86,7 +86,7 @@ struct _GdkDisplay
GdkClipboard *clipboard; GdkClipboard *clipboard;
GdkClipboard *primary_clipboard; GdkClipboard *primary_clipboard;
GHashTable *pointers_info; /* GdkPointerWindowInfo for each device */ GHashTable *pointers_info; /* GdkPointerSurfaceInfo for each device */
guint32 last_event_time; /* Last reported event time from server */ guint32 last_event_time; /* Last reported event time from server */
guint double_click_time; /* Maximum time between clicks in msecs */ guint double_click_time; /* Maximum time between clicks in msecs */
@ -125,7 +125,7 @@ struct _GdkDisplayClass
gboolean (*has_pending) (GdkDisplay *display); gboolean (*has_pending) (GdkDisplay *display);
void (*queue_events) (GdkDisplay *display); void (*queue_events) (GdkDisplay *display);
void (*make_default) (GdkDisplay *display); void (*make_default) (GdkDisplay *display);
GdkWindow * (*get_default_group) (GdkDisplay *display); GdkSurface * (*get_default_group) (GdkDisplay *display);
gboolean (*supports_shapes) (GdkDisplay *display); gboolean (*supports_shapes) (GdkDisplay *display);
gboolean (*supports_input_shapes) (GdkDisplay *display); gboolean (*supports_input_shapes) (GdkDisplay *display);
@ -141,10 +141,10 @@ struct _GdkDisplayClass
void (*event_data_free) (GdkDisplay *display, void (*event_data_free) (GdkDisplay *display,
GdkEvent *event); GdkEvent *event);
void (*create_window_impl) (GdkDisplay *display, void (*create_window_impl) (GdkDisplay *display,
GdkWindow *window, GdkSurface *window,
GdkWindow *real_parent, GdkSurface *real_parent,
GdkEventMask event_mask, GdkEventMask event_mask,
GdkWindowAttr *attributes); GdkSurfaceAttr *attributes);
GdkKeymap * (*get_keymap) (GdkDisplay *display); GdkKeymap * (*get_keymap) (GdkDisplay *display);
@ -167,7 +167,7 @@ struct _GdkDisplayClass
int index); int index);
GdkMonitor * (*get_primary_monitor) (GdkDisplay *display); GdkMonitor * (*get_primary_monitor) (GdkDisplay *display);
GdkMonitor * (*get_monitor_at_window) (GdkDisplay *display, GdkMonitor * (*get_monitor_at_window) (GdkDisplay *display,
GdkWindow *window); GdkSurface *window);
gboolean (*get_setting) (GdkDisplay *display, gboolean (*get_setting) (GdkDisplay *display,
const char *name, const char *name,
GValue *value); GValue *value);
@ -185,7 +185,7 @@ struct _GdkDisplayClass
typedef void (* GdkDisplayPointerInfoForeach) (GdkDisplay *display, typedef void (* GdkDisplayPointerInfoForeach) (GdkDisplay *display,
GdkDevice *device, GdkDevice *device,
GdkPointerWindowInfo *device_info, GdkPointerSurfaceInfo *device_info,
gpointer user_data); gpointer user_data);
void _gdk_display_update_last_event (GdkDisplay *display, void _gdk_display_update_last_event (GdkDisplay *display,
@ -198,8 +198,8 @@ GdkDeviceGrabInfo * _gdk_display_get_last_device_grab (GdkDisplay *display,
GdkDevice *device); GdkDevice *device);
GdkDeviceGrabInfo * _gdk_display_add_device_grab (GdkDisplay *display, GdkDeviceGrabInfo * _gdk_display_add_device_grab (GdkDisplay *display,
GdkDevice *device, GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkWindow *native_window, GdkSurface *native_window,
GdkGrabOwnership grab_ownership, GdkGrabOwnership grab_ownership,
gboolean owner_events, gboolean owner_events,
GdkEventMask event_mask, GdkEventMask event_mask,
@ -212,12 +212,12 @@ GdkDeviceGrabInfo * _gdk_display_has_device_grab (GdkDisplay *display
gboolean _gdk_display_end_device_grab (GdkDisplay *display, gboolean _gdk_display_end_device_grab (GdkDisplay *display,
GdkDevice *device, GdkDevice *device,
gulong serial, gulong serial,
GdkWindow *if_child, GdkSurface *if_child,
gboolean implicit); gboolean implicit);
gboolean _gdk_display_check_grab_ownership (GdkDisplay *display, gboolean _gdk_display_check_grab_ownership (GdkDisplay *display,
GdkDevice *device, GdkDevice *device,
gulong serial); gulong serial);
GdkPointerWindowInfo * _gdk_display_get_pointer_info (GdkDisplay *display, GdkPointerSurfaceInfo * _gdk_display_get_pointer_info (GdkDisplay *display,
GdkDevice *device); GdkDevice *device);
void _gdk_display_pointer_info_foreach (GdkDisplay *display, void _gdk_display_pointer_info_foreach (GdkDisplay *display,
GdkDisplayPointerInfoForeach func, GdkDisplayPointerInfoForeach func,
@ -231,11 +231,11 @@ void _gdk_display_event_data_copy (GdkDisplay *display
void _gdk_display_event_data_free (GdkDisplay *display, void _gdk_display_event_data_free (GdkDisplay *display,
GdkEvent *event); GdkEvent *event);
void _gdk_display_create_window_impl (GdkDisplay *display, void _gdk_display_create_window_impl (GdkDisplay *display,
GdkWindow *window, GdkSurface *window,
GdkWindow *real_parent, GdkSurface *real_parent,
GdkEventMask event_mask, GdkEventMask event_mask,
GdkWindowAttr *attributes); GdkSurfaceAttr *attributes);
GdkWindow * _gdk_display_create_window (GdkDisplay *display); GdkSurface * _gdk_display_create_window (GdkDisplay *display);
gboolean gdk_display_make_gl_context_current (GdkDisplay *display, gboolean gdk_display_make_gl_context_current (GdkDisplay *display,
GdkGLContext *context); GdkGLContext *context);

View File

@ -174,11 +174,11 @@ gdk_drag_context_get_selected_action (GdkDragContext *context)
* gdk_drag_context_get_source_window: * gdk_drag_context_get_source_window:
* @context: a #GdkDragContext * @context: a #GdkDragContext
* *
* Returns the #GdkWindow where the DND operation started. * Returns the #GdkSurface where the DND operation started.
* *
* Returns: (transfer none): a #GdkWindow * Returns: (transfer none): a #GdkSurface
**/ **/
GdkWindow * GdkSurface *
gdk_drag_context_get_source_window (GdkDragContext *context) gdk_drag_context_get_source_window (GdkDragContext *context)
{ {
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL); g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
@ -192,9 +192,9 @@ gdk_drag_context_get_source_window (GdkDragContext *context)
* *
* Returns the destination window for the DND operation. * Returns the destination window for the DND operation.
* *
* Returns: (transfer none): a #GdkWindow * Returns: (transfer none): a #GdkSurface
**/ **/
GdkWindow * GdkSurface *
gdk_drag_context_get_dest_window (GdkDragContext *context) gdk_drag_context_get_dest_window (GdkDragContext *context)
{ {
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL); g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
@ -794,7 +794,7 @@ gdk_drop_read_finish (GdkDragContext *context,
* *
* Returns: (nullable) (transfer none): the drag window, or %NULL * Returns: (nullable) (transfer none): the drag window, or %NULL
*/ */
GdkWindow * GdkSurface *
gdk_drag_context_get_drag_window (GdkDragContext *context) gdk_drag_context_get_drag_window (GdkDragContext *context)
{ {
g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL); g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);

View File

@ -98,9 +98,9 @@ GDK_AVAILABLE_IN_ALL
GdkDragAction gdk_drag_context_get_selected_action (GdkDragContext *context); GdkDragAction gdk_drag_context_get_selected_action (GdkDragContext *context);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow *gdk_drag_context_get_source_window (GdkDragContext *context); GdkSurface *gdk_drag_context_get_source_window (GdkDragContext *context);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow *gdk_drag_context_get_dest_window (GdkDragContext *context); GdkSurface *gdk_drag_context_get_dest_window (GdkDragContext *context);
/* Destination side */ /* Destination side */
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
@ -132,7 +132,7 @@ GInputStream * gdk_drop_read_finish (GdkDragContext *
/* Source side */ /* Source side */
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkDragContext * gdk_drag_begin (GdkWindow *window, GdkDragContext * gdk_drag_begin (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
GdkContentProvider *content, GdkContentProvider *content,
GdkDragAction actions, GdkDragAction actions,
@ -147,7 +147,7 @@ void gdk_drag_drop_done (GdkDragContext *context,
gboolean success); gboolean success);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow *gdk_drag_context_get_drag_window (GdkDragContext *context); GdkSurface *gdk_drag_context_get_drag_window (GdkDragContext *context);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_drag_context_set_hotspot (GdkDragContext *context, void gdk_drag_context_set_hotspot (GdkDragContext *context,

View File

@ -57,7 +57,7 @@ struct _GdkDragContextClass {
GAsyncResult *result, GAsyncResult *result,
GError **error); GError **error);
gboolean (*drop_status) (GdkDragContext *context); gboolean (*drop_status) (GdkDragContext *context);
GdkWindow* (*get_drag_window) (GdkDragContext *context); GdkSurface* (*get_drag_window) (GdkDragContext *context);
void (*set_hotspot) (GdkDragContext *context, void (*set_hotspot) (GdkDragContext *context,
gint hot_x, gint hot_x,
gint hot_y); gint hot_y);
@ -87,9 +87,9 @@ struct _GdkDragContext {
GdkDisplay *display; GdkDisplay *display;
gboolean is_source; gboolean is_source;
GdkWindow *source_window; GdkSurface *source_window;
GdkWindow *dest_window; GdkSurface *dest_window;
GdkWindow *drag_window; GdkSurface *drag_window;
GdkContentProvider *content; GdkContentProvider *content;
GdkContentFormats *formats; GdkContentFormats *formats;

View File

@ -49,7 +49,7 @@
typedef struct _GdkDrawContextPrivate GdkDrawContextPrivate; typedef struct _GdkDrawContextPrivate GdkDrawContextPrivate;
struct _GdkDrawContextPrivate { struct _GdkDrawContextPrivate {
GdkWindow *window; GdkSurface *window;
guint is_drawing : 1; guint is_drawing : 1;
}; };
@ -148,13 +148,13 @@ gdk_draw_context_class_init (GdkDrawContextClass *klass)
/** /**
* GdkDrawContext:window: * GdkDrawContext:window:
* *
* The #GdkWindow the gl context is bound to. * The #GdkSurface the gl context is bound to.
*/ */
pspecs[PROP_WINDOW] = pspecs[PROP_WINDOW] =
g_param_spec_object ("window", g_param_spec_object ("window",
P_("Window"), P_("Window"),
P_("The GDK window bound to the context"), P_("The GDK window bound to the context"),
GDK_TYPE_WINDOW, GDK_TYPE_SURFACE,
G_PARAM_READWRITE | G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS); G_PARAM_STATIC_STRINGS);
@ -257,18 +257,18 @@ gdk_draw_context_get_display (GdkDrawContext *context)
g_return_val_if_fail (GDK_IS_DRAW_CONTEXT (context), NULL); g_return_val_if_fail (GDK_IS_DRAW_CONTEXT (context), NULL);
return priv->window ? gdk_window_get_display (priv->window) : NULL; return priv->window ? gdk_surface_get_display (priv->window) : NULL;
} }
/** /**
* gdk_draw_context_get_window: * gdk_draw_context_get_window:
* @context: a #GdkDrawContext * @context: a #GdkDrawContext
* *
* Retrieves the #GdkWindow used by the @context. * Retrieves the #GdkSurface used by the @context.
* *
* Returns: (nullable) (transfer none): a #GdkWindow or %NULL * Returns: (nullable) (transfer none): a #GdkSurface or %NULL
*/ */
GdkWindow * GdkSurface *
gdk_draw_context_get_window (GdkDrawContext *context) gdk_draw_context_get_window (GdkDrawContext *context)
{ {
GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (context); GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (context);

View File

@ -40,7 +40,7 @@ GType gdk_draw_context_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkDisplay * gdk_draw_context_get_display (GdkDrawContext *context); GdkDisplay * gdk_draw_context_get_display (GdkDrawContext *context);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_draw_context_get_window (GdkDrawContext *context); GdkSurface * gdk_draw_context_get_window (GdkDrawContext *context);
G_END_DECLS G_END_DECLS

View File

@ -21,13 +21,13 @@
* @Short_description: Drawing context for GDK windows * @Short_description: Drawing context for GDK windows
* *
* #GdkDrawingContext is an object that represents the current drawing * #GdkDrawingContext is an object that represents the current drawing
* state of a #GdkWindow. * state of a #GdkSurface.
* *
* It's possible to use a #GdkDrawingContext to draw on a #GdkWindow * It's possible to use a #GdkDrawingContext to draw on a #GdkSurface
* via rendering API like Cairo or OpenGL. * via rendering API like Cairo or OpenGL.
* *
* A #GdkDrawingContext can only be created by calling gdk_window_begin_draw_frame() * A #GdkDrawingContext can only be created by calling gdk_surface_begin_draw_frame()
* and will be valid until a call to gdk_window_end_draw_frame(). * and will be valid until a call to gdk_surface_end_draw_frame().
* *
* #GdkDrawingContext is available since GDK 3.22 * #GdkDrawingContext is available since GDK 3.22
*/ */
@ -56,7 +56,7 @@
typedef struct _GdkDrawingContextPrivate GdkDrawingContextPrivate; typedef struct _GdkDrawingContextPrivate GdkDrawingContextPrivate;
struct _GdkDrawingContextPrivate { struct _GdkDrawingContextPrivate {
GdkWindow *window; GdkSurface *window;
GdkDrawContext *paint_context; GdkDrawContext *paint_context;
cairo_region_t *clip; cairo_region_t *clip;
@ -114,7 +114,7 @@ gdk_drawing_context_set_property (GObject *gobject,
{ {
g_critical ("The drawing context of type %s does not have a window " g_critical ("The drawing context of type %s does not have a window "
"associated to it. Drawing contexts can only be created " "associated to it. Drawing contexts can only be created "
"using gdk_window_begin_draw_frame().", "using gdk_surface_begin_draw_frame().",
G_OBJECT_TYPE_NAME (gobject)); G_OBJECT_TYPE_NAME (gobject));
return; return;
} }
@ -173,11 +173,11 @@ gdk_drawing_context_class_init (GdkDrawingContextClass *klass)
/** /**
* GdkDrawingContext:window: * GdkDrawingContext:window:
* *
* The #GdkWindow that created the drawing context. * The #GdkSurface that created the drawing context.
*/ */
obj_property[PROP_WINDOW] = obj_property[PROP_WINDOW] =
g_param_spec_object ("window", "Window", "The window that created the context", g_param_spec_object ("window", "Window", "The window that created the context",
GDK_TYPE_WINDOW, GDK_TYPE_SURFACE,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_READWRITE | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS); G_PARAM_STATIC_STRINGS);
@ -242,7 +242,7 @@ gdk_cairo_get_drawing_context (cairo_t *cr)
* gdk_drawing_context_get_cairo_context: * gdk_drawing_context_get_cairo_context:
* @context: a #GdkDrawingContext created with a %NULL paint context * @context: a #GdkDrawingContext created with a %NULL paint context
* *
* Retrieves a Cairo context to be used to draw on the #GdkWindow * Retrieves a Cairo context to be used to draw on the #GdkSurface
* that created the #GdkDrawingContext. The @context must have been * that created the #GdkDrawingContext. The @context must have been
* created without a #GdkDrawContext for this function to work. If * created without a #GdkDrawContext for this function to work. If
* gdk_drawing_context_get_paint_context() does not return %NULL, * gdk_drawing_context_get_paint_context() does not return %NULL,
@ -250,10 +250,10 @@ gdk_cairo_get_drawing_context (cairo_t *cr)
* *
* The returned context is guaranteed to be valid as long as the * The returned context is guaranteed to be valid as long as the
* #GdkDrawingContext is valid, that is between a call to * #GdkDrawingContext is valid, that is between a call to
* gdk_window_begin_draw_frame() and gdk_window_end_draw_frame(). * gdk_surface_begin_draw_frame() and gdk_surface_end_draw_frame().
* *
* Returns: (transfer none) (nullable): a Cairo context to be used to draw * Returns: (transfer none) (nullable): a Cairo context to be used to draw
* the contents of the #GdkWindow. The context is owned by the * the contents of the #GdkSurface. The context is owned by the
* #GdkDrawingContext and should not be destroyed. %NULL is * #GdkDrawingContext and should not be destroyed. %NULL is
* returned when a paint context is in used. * returned when a paint context is in used.
*/ */
@ -263,7 +263,7 @@ gdk_drawing_context_get_cairo_context (GdkDrawingContext *context)
GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (context); GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_DRAWING_CONTEXT (context), NULL); g_return_val_if_fail (GDK_IS_DRAWING_CONTEXT (context), NULL);
g_return_val_if_fail (GDK_IS_WINDOW (priv->window), NULL); g_return_val_if_fail (GDK_IS_SURFACE (priv->window), NULL);
if (priv->paint_context != NULL) if (priv->paint_context != NULL)
return NULL; return NULL;
@ -273,12 +273,12 @@ gdk_drawing_context_get_cairo_context (GdkDrawingContext *context)
cairo_region_t *region; cairo_region_t *region;
cairo_surface_t *surface; cairo_surface_t *surface;
surface = _gdk_window_ref_cairo_surface (priv->window); surface = _gdk_surface_ref_cairo_surface (priv->window);
priv->cr = cairo_create (surface); priv->cr = cairo_create (surface);
gdk_cairo_set_drawing_context (priv->cr, context); gdk_cairo_set_drawing_context (priv->cr, context);
region = gdk_window_get_current_paint_region (priv->window); region = gdk_surface_get_current_paint_region (priv->window);
cairo_region_union (region, priv->clip); cairo_region_union (region, priv->clip);
gdk_cairo_region (priv->cr, region); gdk_cairo_region (priv->cr, region);
cairo_clip (priv->cr); cairo_clip (priv->cr);
@ -296,9 +296,9 @@ gdk_drawing_context_get_cairo_context (GdkDrawingContext *context)
* *
* Retrieves the window that created the drawing @context. * Retrieves the window that created the drawing @context.
* *
* Returns: (transfer none): a #GdkWindow * Returns: (transfer none): a #GdkSurface
*/ */
GdkWindow * GdkSurface *
gdk_drawing_context_get_window (GdkDrawingContext *context) gdk_drawing_context_get_window (GdkDrawingContext *context)
{ {
GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (context); GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (context);
@ -365,7 +365,7 @@ gdk_drawing_context_is_valid (GdkDrawingContext *context)
if (priv->window == NULL) if (priv->window == NULL)
return FALSE; return FALSE;
if (gdk_window_get_drawing_context (priv->window) != context) if (gdk_surface_get_drawing_context (priv->window) != context)
return FALSE; return FALSE;
return TRUE; return TRUE;

View File

@ -37,7 +37,7 @@ GDK_AVAILABLE_IN_ALL
GType gdk_drawing_context_get_type (void) G_GNUC_CONST; GType gdk_drawing_context_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_drawing_context_get_window (GdkDrawingContext *context); GdkSurface * gdk_drawing_context_get_window (GdkDrawingContext *context);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkDrawContext* gdk_drawing_context_get_paint_context (GdkDrawingContext *context); GdkDrawContext* gdk_drawing_context_get_paint_context (GdkDrawingContext *context);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL

View File

@ -372,7 +372,7 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
{ {
GList *tmp_list; GList *tmp_list;
GList *pending_motions = NULL; GList *pending_motions = NULL;
GdkWindow *pending_motion_window = NULL; GdkSurface *pending_motion_window = NULL;
GdkDevice *pending_motion_device = NULL; GdkDevice *pending_motion_device = NULL;
GdkEvent *last_motion = NULL; GdkEvent *last_motion = NULL;
@ -429,7 +429,7 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display)
pending_motions == display->queued_events && pending_motions == display->queued_events &&
pending_motions == display->queued_tail) pending_motions == display->queued_tail)
{ {
GdkFrameClock *clock = gdk_window_get_frame_clock (pending_motion_window); GdkFrameClock *clock = gdk_surface_get_frame_clock (pending_motion_window);
if (clock) /* might be NULL if window was destroyed */ if (clock) /* might be NULL if window was destroyed */
gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS); gdk_frame_clock_request_phase (clock, GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS);
} }
@ -602,7 +602,7 @@ copy_time_coord (const GdkTimeCoord *coord)
* @event: a #GdkEvent * @event: a #GdkEvent
* *
* Copies a #GdkEvent, copying or incrementing the reference count of the * Copies a #GdkEvent, copying or incrementing the reference count of the
* resources associated with it (e.g. #GdkWindows and strings). * resources associated with it (e.g. #GdkSurfaces and strings).
* *
* Returns: (transfer full): a copy of @event. Free with g_object_unref() * Returns: (transfer full): a copy of @event. Free with g_object_unref()
*/ */
@ -779,11 +779,11 @@ gdk_event_finalize (GObject *object)
* gdk_event_get_window: * gdk_event_get_window:
* @event: a #GdkEvent * @event: a #GdkEvent
* *
* Extracts the #GdkWindow associated with an event. * Extracts the #GdkSurface associated with an event.
* *
* Returns: (transfer none): The #GdkWindow associated with the event * Returns: (transfer none): The #GdkSurface associated with the event
*/ */
GdkWindow * GdkSurface *
gdk_event_get_window (const GdkEvent *event) gdk_event_get_window (const GdkEvent *event)
{ {
g_return_val_if_fail (event != NULL, NULL); g_return_val_if_fail (event != NULL, NULL);
@ -1626,7 +1626,7 @@ gdk_event_set_source_device (GdkEvent *event,
* triggered the event, falling back to the virtual (master) device * triggered the event, falling back to the virtual (master) device
* (as in gdk_event_get_device()) if the event wasnt caused by * (as in gdk_event_get_device()) if the event wasnt caused by
* interaction with a hardware device. This may happen for example * interaction with a hardware device. This may happen for example
* in synthesized crossing events after a #GdkWindow updates its * in synthesized crossing events after a #GdkSurface updates its
* geometry or a grab is acquired/released. * geometry or a grab is acquired/released.
* *
* If the event does not contain a device field, this function will * If the event does not contain a device field, this function will
@ -1673,13 +1673,13 @@ gdk_event_triggers_context_menu (const GdkEvent *event)
GdkDisplay *display; GdkDisplay *display;
GdkModifierType modifier; GdkModifierType modifier;
g_return_val_if_fail (GDK_IS_WINDOW (bevent->any.window), FALSE); g_return_val_if_fail (GDK_IS_SURFACE (bevent->any.window), FALSE);
if (bevent->button == GDK_BUTTON_SECONDARY && if (bevent->button == GDK_BUTTON_SECONDARY &&
! (bevent->state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK))) ! (bevent->state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK)))
return TRUE; return TRUE;
display = gdk_window_get_display (bevent->any.window); display = gdk_surface_get_display (bevent->any.window);
modifier = gdk_keymap_get_modifier_mask (gdk_display_get_keymap (display), modifier = gdk_keymap_get_modifier_mask (gdk_display_get_keymap (display),
GDK_MODIFIER_INTENT_CONTEXT_MENU); GDK_MODIFIER_INTENT_CONTEXT_MENU);
@ -1848,7 +1848,7 @@ gdk_event_get_display (const GdkEvent *event)
return event->any.display; return event->any.display;
if (event->any.window) if (event->any.window)
return gdk_window_get_display (event->any.window); return gdk_surface_get_display (event->any.window);
return NULL; return NULL;
} }
@ -2336,7 +2336,7 @@ gdk_event_get_touch_emulating_pointer (const GdkEvent *event,
**/ **/
gboolean gboolean
gdk_event_get_grab_window (const GdkEvent *event, gdk_event_get_grab_window (const GdkEvent *event,
GdkWindow **window) GdkSurface **window)
{ {
if (!event) if (!event)
return FALSE; return FALSE;

View File

@ -166,7 +166,7 @@ typedef void (*GdkEventFunc) (GdkEvent *event,
* @GDK_LEAVE_NOTIFY: the pointer has left the window. * @GDK_LEAVE_NOTIFY: the pointer has left the window.
* @GDK_FOCUS_CHANGE: the keyboard focus has entered or left the window. * @GDK_FOCUS_CHANGE: the keyboard focus has entered or left the window.
* @GDK_CONFIGURE: the size, position or stacking order of the window has changed. * @GDK_CONFIGURE: the size, position or stacking order of the window has changed.
* Note that GTK+ discards these events for %GDK_WINDOW_CHILD windows. * Note that GTK+ discards these events for %GDK_SURFACE_CHILD windows.
* @GDK_MAP: the window has been mapped. * @GDK_MAP: the window has been mapped.
* @GDK_UNMAP: the window has been unmapped. * @GDK_UNMAP: the window has been unmapped.
* @GDK_PROXIMITY_IN: an input device has moved into contact with a sensing * @GDK_PROXIMITY_IN: an input device has moved into contact with a sensing
@ -381,7 +381,7 @@ GDK_AVAILABLE_IN_ALL
void gdk_event_free (GdkEvent *event); void gdk_event_free (GdkEvent *event);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow *gdk_event_get_window (const GdkEvent *event); GdkSurface *gdk_event_get_window (const GdkEvent *event);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
guint32 gdk_event_get_time (const GdkEvent *event); guint32 gdk_event_get_time (const GdkEvent *event);
@ -546,7 +546,7 @@ gboolean gdk_event_get_touch_emulating_pointer (const GdkEvent *event,
gboolean *emulating); gboolean *emulating);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_event_get_grab_window (const GdkEvent *event, gboolean gdk_event_get_grab_window (const GdkEvent *event,
GdkWindow **window); GdkSurface **window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_event_get_focus_in (const GdkEvent *event, gboolean gdk_event_get_focus_in (const GdkEvent *event,
gboolean *focus_in); gboolean *focus_in);

View File

@ -55,7 +55,7 @@ struct _GdkEventAny
{ {
GObject parent_instance; GObject parent_instance;
GdkEventType type; GdkEventType type;
GdkWindow *window; GdkSurface *window;
guint16 flags; guint16 flags;
gint8 send_event; gint8 send_event;
GdkDevice *device; GdkDevice *device;
@ -329,7 +329,7 @@ struct _GdkEventKey
struct _GdkEventCrossing struct _GdkEventCrossing
{ {
GdkEventAny any; GdkEventAny any;
GdkWindow *subwindow; GdkSurface *subwindow;
guint32 time; guint32 time;
gdouble x; gdouble x;
gdouble y; gdouble y;
@ -427,7 +427,7 @@ struct _GdkEventGrabBroken {
GdkEventAny any; GdkEventAny any;
gboolean keyboard; gboolean keyboard;
gboolean implicit; gboolean implicit;
GdkWindow *grab_window; GdkSurface *grab_window;
}; };
/* /*

View File

@ -30,7 +30,7 @@ static cairo_user_data_key_t direct_key;
void void
gdk_cairo_surface_mark_as_direct (cairo_surface_t *surface, gdk_cairo_surface_mark_as_direct (cairo_surface_t *surface,
GdkWindow *window) GdkSurface *window)
{ {
cairo_surface_set_user_data (surface, &direct_key, cairo_surface_set_user_data (surface, &direct_key,
g_object_ref (window), g_object_unref); g_object_ref (window), g_object_unref);
@ -219,10 +219,10 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
{ {
GdkGLContextPaintData *paint_data = gdk_gl_context_get_paint_data (paint_context); GdkGLContextPaintData *paint_data = gdk_gl_context_get_paint_data (paint_context);
GdkGLContextProgram *program; GdkGLContextProgram *program;
GdkWindow *window = gdk_gl_context_get_window (paint_context); GdkSurface *window = gdk_gl_context_get_window (paint_context);
int window_scale = gdk_window_get_scale_factor (window); int window_scale = gdk_surface_get_scale_factor (window);
float w = gdk_window_get_width (window) * window_scale; float w = gdk_surface_get_width (window) * window_scale;
float h = gdk_window_get_height (window) * window_scale; float h = gdk_surface_get_height (window) * window_scale;
int i; int i;
float *vertex_buffer_data; float *vertex_buffer_data;
@ -327,7 +327,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context,
*/ */
void void
gdk_cairo_draw_from_gl (cairo_t *cr, gdk_cairo_draw_from_gl (cairo_t *cr,
GdkWindow *window, GdkSurface *window,
int source, int source,
int source_type, int source_type,
int buffer_scale, int buffer_scale,
@ -345,7 +345,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
GdkGLContextPaintData *paint_data; GdkGLContextPaintData *paint_data;
int major, minor, version; int major, minor, version;
paint_context = gdk_window_get_paint_gl_context (window, NULL); paint_context = gdk_surface_get_paint_gl_context (window, NULL);
if (paint_context == NULL) if (paint_context == NULL)
{ {
g_warning ("gdk_cairo_draw_gl_render_buffer failed - no paint context"); g_warning ("gdk_cairo_draw_gl_render_buffer failed - no paint context");
@ -458,7 +458,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
double device_x_offset, device_y_offset; double device_x_offset, device_y_offset;
cairo_rectangle_int_t rect, e; cairo_rectangle_int_t rect, e;
int n_rects, i; int n_rects, i;
GdkWindow *window; GdkSurface *window;
int unscaled_window_height; int unscaled_window_height;
unsigned int texture_id; unsigned int texture_id;
int window_scale; int window_scale;
@ -483,8 +483,8 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
use_texture_rectangle = gdk_gl_context_use_texture_rectangle (paint_context); use_texture_rectangle = gdk_gl_context_use_texture_rectangle (paint_context);
window = gdk_gl_context_get_window (paint_context); window = gdk_gl_context_get_window (paint_context);
window_scale = gdk_window_get_scale_factor (window); window_scale = gdk_surface_get_scale_factor (window);
gdk_window_get_unscaled_size (window, NULL, &unscaled_window_height); gdk_surface_get_unscaled_size (window, NULL, &unscaled_window_height);
sx = sy = 1; sx = sy = 1;
cairo_surface_get_device_scale (surface, &sx, &sy); cairo_surface_get_device_scale (surface, &sx, &sy);

View File

@ -26,12 +26,12 @@
* #GdkGLContext is an object representing the platform-specific * #GdkGLContext is an object representing the platform-specific
* OpenGL draw context. * OpenGL draw context.
* *
* #GdkGLContexts are created for a #GdkWindow using * #GdkGLContexts are created for a #GdkSurface using
* gdk_window_create_gl_context(), and the context will match the * gdk_surface_create_gl_context(), and the context will match the
* the characteristics of the window. * the characteristics of the window.
* *
* A #GdkGLContext is not tied to any particular normal framebuffer. * A #GdkGLContext is not tied to any particular normal framebuffer.
* For instance, it cannot draw to the #GdkWindow back buffer. The GDK * For instance, it cannot draw to the #GdkSurface back buffer. The GDK
* repaint system is in full control of the painting to that. Instead, * repaint system is in full control of the painting to that. Instead,
* you can create render buffers or textures and use gdk_cairo_draw_from_gl() * you can create render buffers or textures and use gdk_cairo_draw_from_gl()
* in the draw function of your widget to draw them. Then GDK will handle * in the draw function of your widget to draw them. Then GDK will handle
@ -46,14 +46,14 @@
* ## Creating a new OpenGL context ## * ## Creating a new OpenGL context ##
* *
* In order to create a new #GdkGLContext instance you need a * In order to create a new #GdkGLContext instance you need a
* #GdkWindow, which you typically get during the realize call * #GdkSurface, which you typically get during the realize call
* of a widget. * of a widget.
* *
* A #GdkGLContext is not realized until either gdk_gl_context_make_current(), * A #GdkGLContext is not realized until either gdk_gl_context_make_current(),
* or until it is realized using gdk_gl_context_realize(). It is possible to * or until it is realized using gdk_gl_context_realize(). It is possible to
* specify details of the GL context like the OpenGL version to be used, or * specify details of the GL context like the OpenGL version to be used, or
* whether the GL context should have extra state validation enabled after * whether the GL context should have extra state validation enabled after
* calling gdk_window_create_gl_context() by calling gdk_gl_context_realize(). * calling gdk_surface_create_gl_context() by calling gdk_gl_context_realize().
* If the realization fails you have the option to change the settings of the * If the realization fails you have the option to change the settings of the
* #GdkGLContext and try again. * #GdkGLContext and try again.
* *
@ -265,12 +265,12 @@ gdk_gl_context_real_realize (GdkGLContext *self,
static cairo_region_t * static cairo_region_t *
gdk_gl_context_real_get_damage (GdkGLContext *context) gdk_gl_context_real_get_damage (GdkGLContext *context)
{ {
GdkWindow *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); GdkSurface *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context));
return cairo_region_create_rectangle (&(GdkRectangle) { return cairo_region_create_rectangle (&(GdkRectangle) {
0, 0, 0, 0,
gdk_window_get_width (window), gdk_surface_get_width (window),
gdk_window_get_height (window) gdk_surface_get_height (window)
}); });
} }
@ -279,7 +279,7 @@ gdk_gl_context_real_begin_frame (GdkDrawContext *draw_context,
cairo_region_t *region) cairo_region_t *region)
{ {
GdkGLContext *context = GDK_GL_CONTEXT (draw_context); GdkGLContext *context = GDK_GL_CONTEXT (draw_context);
GdkWindow *window; GdkSurface *window;
GdkGLContext *shared; GdkGLContext *shared;
cairo_region_t *damage; cairo_region_t *damage;
int ww, wh; int ww, wh;
@ -296,8 +296,8 @@ gdk_gl_context_real_begin_frame (GdkDrawContext *draw_context,
cairo_region_destroy (damage); cairo_region_destroy (damage);
window = gdk_draw_context_get_window (draw_context); window = gdk_draw_context_get_window (draw_context);
ww = gdk_window_get_width (window) * gdk_window_get_scale_factor (window); ww = gdk_surface_get_width (window) * gdk_surface_get_scale_factor (window);
wh = gdk_window_get_height (window) * gdk_window_get_scale_factor (window); wh = gdk_surface_get_height (window) * gdk_surface_get_scale_factor (window);
gdk_gl_context_make_current (context); gdk_gl_context_make_current (context);
@ -889,11 +889,11 @@ gdk_gl_context_get_display (GdkGLContext *context)
* gdk_gl_context_get_window: * gdk_gl_context_get_window:
* @context: a #GdkGLContext * @context: a #GdkGLContext
* *
* Retrieves the #GdkWindow used by the @context. * Retrieves the #GdkSurface used by the @context.
* *
* Returns: (nullable) (transfer none): a #GdkWindow or %NULL * Returns: (nullable) (transfer none): a #GdkSurface or %NULL
*/ */
GdkWindow * GdkSurface *
gdk_gl_context_get_window (GdkGLContext *context) gdk_gl_context_get_window (GdkGLContext *context)
{ {
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL); g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL);

View File

@ -45,7 +45,7 @@ GType gdk_gl_context_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkDisplay * gdk_gl_context_get_display (GdkGLContext *context); GdkDisplay * gdk_gl_context_get_display (GdkGLContext *context);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_gl_context_get_window (GdkGLContext *context); GdkSurface * gdk_gl_context_get_window (GdkGLContext *context);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkGLContext * gdk_gl_context_get_shared_context (GdkGLContext *context); GdkGLContext * gdk_gl_context_get_shared_context (GdkGLContext *context);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL

View File

@ -91,7 +91,7 @@ gdk_gl_texture_download (GdkTexture *texture,
} }
else else
{ {
GdkWindow *window; GdkSurface *window;
window = gdk_gl_context_get_window (self->context); window = gdk_gl_context_get_window (self->context);
gdk_cairo_draw_from_gl (cr, window, self->id, GL_TEXTURE, 1, gdk_cairo_draw_from_gl (cr, window, self->id, GL_TEXTURE, 1,
@ -145,7 +145,7 @@ gdk_gl_texture_get_id (GdkGLTexture *self)
void void
gdk_gl_texture_release (GdkGLTexture *self) gdk_gl_texture_release (GdkGLTexture *self)
{ {
GdkWindow *window; GdkSurface *window;
GdkTexture *texture; GdkTexture *texture;
cairo_t *cr; cairo_t *cr;

View File

@ -42,7 +42,7 @@ G_BEGIN_DECLS
/* Debugging support */ /* Debugging support */
typedef struct _GdkWindowAttr GdkWindowAttr; typedef struct _GdkSurfaceAttr GdkSurfaceAttr;
typedef enum { typedef enum {
GDK_DEBUG_MISC = 1 << 0, GDK_DEBUG_MISC = 1 << 0,
@ -116,35 +116,35 @@ typedef enum
GDK_EVENT_FLUSHED = 1 << 2 GDK_EVENT_FLUSHED = 1 << 2
} GdkEventFlags; } GdkEventFlags;
typedef struct _GdkWindowPaint GdkWindowPaint; typedef struct _GdkSurfacePaint GdkSurfacePaint;
typedef enum typedef enum
{ {
GDK_INPUT_OUTPUT, GDK_INPUT_OUTPUT,
GDK_INPUT_ONLY GDK_INPUT_ONLY
} GdkWindowWindowClass; } GdkSurfaceSurfaceClass;
struct _GdkWindowAttr struct _GdkSurfaceAttr
{ {
gint x, y; gint x, y;
gint width; gint width;
gint height; gint height;
GdkWindowWindowClass wclass; GdkSurfaceSurfaceClass wclass;
GdkWindowType window_type; GdkSurfaceType window_type;
GdkWindowTypeHint type_hint; GdkSurfaceTypeHint type_hint;
}; };
struct _GdkWindow struct _GdkSurface
{ {
GObject parent_instance; GObject parent_instance;
GdkDisplay *display; GdkDisplay *display;
GdkWindowImpl *impl; /* window-system-specific delegate object */ GdkSurfaceImpl *impl; /* window-system-specific delegate object */
GdkWindow *parent; GdkSurface *parent;
GdkWindow *transient_for; GdkSurface *transient_for;
gpointer user_data; gpointer user_data;
@ -182,8 +182,8 @@ struct _GdkWindow
/* We store the old expose areas to support buffer-age optimizations */ /* We store the old expose areas to support buffer-age optimizations */
cairo_region_t *old_updated_area[2]; cairo_region_t *old_updated_area[2];
GdkWindowState old_state; GdkSurfaceState old_state;
GdkWindowState state; GdkSurfaceState state;
guint8 alpha; guint8 alpha;
guint8 fullscreen_mode; guint8 fullscreen_mode;
@ -209,10 +209,10 @@ struct _GdkWindow
guint geometry_dirty : 1; guint geometry_dirty : 1;
guint frame_clock_events_paused : 1; guint frame_clock_events_paused : 1;
/* The GdkWindow that has the impl, ref:ed if another window. /* The GdkSurface that has the impl, ref:ed if another window.
* This ref is required to keep the wrapper of the impl window alive * This ref is required to keep the wrapper of the impl window alive
* for as long as any GdkWindow references the impl. */ * for as long as any GdkSurface references the impl. */
GdkWindow *impl_window; GdkSurface *impl_window;
guint update_and_descendants_freeze_count; guint update_and_descendants_freeze_count;
@ -244,8 +244,8 @@ struct _GdkWindow
cairo_region_t *opaque_region; cairo_region_t *opaque_region;
}; };
#define GDK_WINDOW_TYPE(d) ((((GdkWindow *)(d)))->window_type) #define GDK_SURFACE_TYPE(d) ((((GdkSurface *)(d)))->window_type)
#define GDK_WINDOW_DESTROYED(d) (((GdkWindow *)(d))->destroyed) #define GDK_SURFACE_DESTROYED(d) (((GdkSurface *)(d))->destroyed)
extern gint _gdk_screen_number; extern gint _gdk_screen_number;
@ -280,8 +280,8 @@ void _gdk_windowing_event_data_copy (const GdkEvent *src,
GdkEvent *dst); GdkEvent *dst);
void _gdk_windowing_event_data_free (GdkEvent *event); void _gdk_windowing_event_data_free (GdkEvent *event);
void gdk_window_set_state (GdkWindow *window, void gdk_surface_set_state (GdkSurface *window,
GdkWindowState new_state); GdkSurfaceState new_state);
gboolean _gdk_cairo_surface_extents (cairo_surface_t *surface, gboolean _gdk_cairo_surface_extents (cairo_surface_t *surface,
GdkRectangle *extents); GdkRectangle *extents);
@ -303,7 +303,7 @@ void gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface,
const GdkPixbuf *pixbuf); const GdkPixbuf *pixbuf);
void gdk_cairo_surface_mark_as_direct (cairo_surface_t *surface, void gdk_cairo_surface_mark_as_direct (cairo_surface_t *surface,
GdkWindow *window); GdkSurface *window);
cairo_region_t *gdk_cairo_region_from_clip (cairo_t *cr); cairo_region_t *gdk_cairo_region_from_clip (cairo_t *cr);
void gdk_cairo_set_drawing_context (cairo_t *cr, void gdk_cairo_set_drawing_context (cairo_t *cr,
@ -314,27 +314,27 @@ void gdk_cairo_set_drawing_context (cairo_t *cr,
*************************************/ *************************************/
cairo_surface_t * cairo_surface_t *
_gdk_window_ref_cairo_surface (GdkWindow *window); _gdk_surface_ref_cairo_surface (GdkSurface *window);
GdkWindow* gdk_window_new (GdkDisplay *display, GdkSurface* gdk_surface_new (GdkDisplay *display,
GdkWindow *parent, GdkSurface *parent,
GdkWindowAttr *attributes); GdkSurfaceAttr *attributes);
void _gdk_window_destroy (GdkWindow *window, void _gdk_surface_destroy (GdkSurface *window,
gboolean foreign_destroy); gboolean foreign_destroy);
void _gdk_window_clear_update_area (GdkWindow *window); void _gdk_surface_clear_update_area (GdkSurface *window);
void _gdk_window_update_size (GdkWindow *window); void _gdk_surface_update_size (GdkSurface *window);
gboolean _gdk_window_update_viewable (GdkWindow *window); gboolean _gdk_surface_update_viewable (GdkSurface *window);
GdkGLContext * gdk_window_get_paint_gl_context (GdkWindow *window, GdkGLContext * gdk_surface_get_paint_gl_context (GdkSurface *window,
GError **error); GError **error);
void gdk_window_get_unscaled_size (GdkWindow *window, void gdk_surface_get_unscaled_size (GdkSurface *window,
int *unscaled_width, int *unscaled_width,
int *unscaled_height); int *unscaled_height);
GdkDrawingContext *gdk_window_get_drawing_context (GdkWindow *window); GdkDrawingContext *gdk_surface_get_drawing_context (GdkSurface *window);
cairo_region_t *gdk_window_get_current_paint_region (GdkWindow *window); cairo_region_t *gdk_surface_get_current_paint_region (GdkSurface *window);
void _gdk_window_process_updates_recurse (GdkWindow *window, void _gdk_surface_process_updates_recurse (GdkSurface *window,
cairo_region_t *expose_region); cairo_region_t *expose_region);
/***************************************** /*****************************************
@ -352,28 +352,28 @@ void _gdk_windowing_got_event (GdkDisplay *display,
GdkEvent *event, GdkEvent *event,
gulong serial); gulong serial);
#define GDK_WINDOW_IS_MAPPED(window) (((window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0) #define GDK_SURFACE_IS_MAPPED(window) (((window)->state & GDK_SURFACE_STATE_WITHDRAWN) == 0)
void _gdk_window_invalidate_for_expose (GdkWindow *window, void _gdk_surface_invalidate_for_expose (GdkSurface *window,
cairo_region_t *region); cairo_region_t *region);
GdkWindow * _gdk_window_find_child_at (GdkWindow *window, GdkSurface * _gdk_surface_find_child_at (GdkSurface *window,
double x, double y); double x, double y);
GdkWindow * _gdk_window_find_descendant_at (GdkWindow *toplevel, GdkSurface * _gdk_surface_find_descendant_at (GdkSurface *toplevel,
double x, double y, double x, double y,
double *found_x, double *found_x,
double *found_y); double *found_y);
GdkEvent * _gdk_make_event (GdkWindow *window, GdkEvent * _gdk_make_event (GdkSurface *window,
GdkEventType type, GdkEventType type,
GdkEvent *event_in_queue, GdkEvent *event_in_queue,
gboolean before_event); gboolean before_event);
gboolean _gdk_window_event_parent_of (GdkWindow *parent, gboolean _gdk_surface_event_parent_of (GdkSurface *parent,
GdkWindow *child); GdkSurface *child);
void _gdk_synthesize_crossing_events (GdkDisplay *display, void _gdk_synthesize_crossing_events (GdkDisplay *display,
GdkWindow *src, GdkSurface *src,
GdkWindow *dest, GdkSurface *dest,
GdkDevice *device, GdkDevice *device,
GdkDevice *source_device, GdkDevice *source_device,
GdkCrossingMode mode, GdkCrossingMode mode,
@ -386,16 +386,16 @@ void _gdk_synthesize_crossing_events (GdkDisplay *display,
gboolean non_linear); gboolean non_linear);
void _gdk_display_set_window_under_pointer (GdkDisplay *display, void _gdk_display_set_window_under_pointer (GdkDisplay *display,
GdkDevice *device, GdkDevice *device,
GdkWindow *window); GdkSurface *window);
gboolean _gdk_window_has_impl (GdkWindow *window); gboolean _gdk_surface_has_impl (GdkSurface *window);
GdkWindow * _gdk_window_get_impl_window (GdkWindow *window); GdkSurface * _gdk_surface_get_impl_window (GdkSurface *window);
void gdk_window_destroy_notify (GdkWindow *window); void gdk_surface_destroy_notify (GdkSurface *window);
void gdk_synthesize_window_state (GdkWindow *window, void gdk_synthesize_window_state (GdkSurface *window,
GdkWindowState unset_flags, GdkSurfaceState unset_flags,
GdkWindowState set_flags); GdkSurfaceState set_flags);
G_END_DECLS G_END_DECLS

View File

@ -411,7 +411,7 @@ gdk_monitor_get_model (GdkMonitor *monitor)
* *
* This can be used if you want to create pixel based data for a * This can be used if you want to create pixel based data for a
* particular monitor, but most of the time youre drawing to a window * particular monitor, but most of the time youre drawing to a window
* where it is better to use gdk_window_get_scale_factor() instead. * where it is better to use gdk_surface_get_scale_factor() instead.
* *
* Returns: the scale factor * Returns: the scale factor
*/ */

View File

@ -67,8 +67,8 @@
* // where we are drawing are [-RADIUS, RADIUS], [-RADIUS, RADIUS] * // where we are drawing are [-RADIUS, RADIUS], [-RADIUS, RADIUS]
* // We first center, then change the scale * // We first center, then change the scale
* *
* width = gdk_window_get_width (window); * width = gdk_surface_get_width (window);
* height = gdk_window_get_height (window); * height = gdk_surface_get_height (window);
* radius = MIN (width, height) / 2.; * radius = MIN (width, height) / 2.;
* *
* cairo_translate (cr, * cairo_translate (cr,

View File

@ -38,7 +38,7 @@
* and manipulate pixbufs, see the #GdkPixbuf API documentation. * and manipulate pixbufs, see the #GdkPixbuf API documentation.
* *
* The functions described here allow to obtain pixbufs from * The functions described here allow to obtain pixbufs from
* #GdkWindows and cairo surfaces. * #GdkSurfaces and cairo surfaces.
*/ */
static cairo_format_t static cairo_format_t

View File

@ -233,7 +233,7 @@ gdk_seat_get_capabilities (GdkSeat *seat)
/** /**
* gdk_seat_grab: * gdk_seat_grab:
* @seat: a #GdkSeat * @seat: a #GdkSeat
* @window: the #GdkWindow which will own the grab * @window: the #GdkSurface which will own the grab
* @capabilities: capabilities that will be grabbed * @capabilities: capabilities that will be grabbed
* @owner_events: if %FALSE then all device events are reported with respect to * @owner_events: if %FALSE then all device events are reported with respect to
* @window and are only reported if selected by @event_mask. If * @window and are only reported if selected by @event_mask. If
@ -267,7 +267,7 @@ gdk_seat_get_capabilities (GdkSeat *seat)
* events corresponding to the given capabilities. For example in GTK+ this * events corresponding to the given capabilities. For example in GTK+ this
* is used for Drag and Drop operations, popup menus and such. * is used for Drag and Drop operations, popup menus and such.
* *
* Note that if the event mask of a #GdkWindow has selected both button press * Note that if the event mask of a #GdkSurface has selected both button press
* and button release events, or touch begin and touch end, then a press event * and button release events, or touch begin and touch end, then a press event
* will cause an automatic grab until the button is released, equivalent to a * will cause an automatic grab until the button is released, equivalent to a
* grab on the window with @owner_events set to %TRUE. This is done because most * grab on the window with @owner_events set to %TRUE. This is done because most
@ -281,7 +281,7 @@ gdk_seat_get_capabilities (GdkSeat *seat)
**/ **/
GdkGrabStatus GdkGrabStatus
gdk_seat_grab (GdkSeat *seat, gdk_seat_grab (GdkSeat *seat,
GdkWindow *window, GdkSurface *window,
GdkSeatCapabilities capabilities, GdkSeatCapabilities capabilities,
gboolean owner_events, gboolean owner_events,
GdkCursor *cursor, GdkCursor *cursor,
@ -292,7 +292,7 @@ gdk_seat_grab (GdkSeat *seat,
GdkSeatClass *seat_class; GdkSeatClass *seat_class;
g_return_val_if_fail (GDK_IS_SEAT (seat), GDK_GRAB_FAILED); g_return_val_if_fail (GDK_IS_SEAT (seat), GDK_GRAB_FAILED);
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED); g_return_val_if_fail (GDK_IS_SURFACE (window), GDK_GRAB_FAILED);
capabilities &= GDK_SEAT_CAPABILITY_ALL; capabilities &= GDK_SEAT_CAPABILITY_ALL;
g_return_val_if_fail (capabilities != GDK_SEAT_CAPABILITY_NONE, GDK_GRAB_FAILED); g_return_val_if_fail (capabilities != GDK_SEAT_CAPABILITY_NONE, GDK_GRAB_FAILED);

View File

@ -64,7 +64,7 @@ typedef enum {
/** /**
* GdkSeatGrabPrepareFunc: * GdkSeatGrabPrepareFunc:
* @seat: the #GdkSeat being grabbed * @seat: the #GdkSeat being grabbed
* @window: the #GdkWindow being grabbed * @window: the #GdkSurface being grabbed
* @user_data: user data passed in gdk_seat_grab() * @user_data: user data passed in gdk_seat_grab()
* *
* Type of the callback used to set up @window so it can be * Type of the callback used to set up @window so it can be
@ -75,7 +75,7 @@ typedef enum {
* Since: 3.20 * Since: 3.20
*/ */
typedef void (* GdkSeatGrabPrepareFunc) (GdkSeat *seat, typedef void (* GdkSeatGrabPrepareFunc) (GdkSeat *seat,
GdkWindow *window, GdkSurface *window,
gpointer user_data); gpointer user_data);
struct _GdkSeat struct _GdkSeat
@ -88,7 +88,7 @@ GType gdk_seat_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkGrabStatus gdk_seat_grab (GdkSeat *seat, GdkGrabStatus gdk_seat_grab (GdkSeat *seat,
GdkWindow *window, GdkSurface *window,
GdkSeatCapabilities capabilities, GdkSeatCapabilities capabilities,
gboolean owner_events, gboolean owner_events,
GdkCursor *cursor, GdkCursor *cursor,

View File

@ -104,7 +104,7 @@ gdk_seat_default_get_capabilities (GdkSeat *seat)
static GdkGrabStatus static GdkGrabStatus
gdk_seat_default_grab (GdkSeat *seat, gdk_seat_default_grab (GdkSeat *seat,
GdkWindow *window, GdkSurface *window,
GdkSeatCapabilities capabilities, GdkSeatCapabilities capabilities,
gboolean owner_events, gboolean owner_events,
GdkCursor *cursor, GdkCursor *cursor,
@ -121,7 +121,7 @@ gdk_seat_default_grab (GdkSeat *seat,
if (prepare_func) if (prepare_func)
(prepare_func) (seat, window, prepare_func_data); (prepare_func) (seat, window, prepare_func_data);
if (!gdk_window_is_visible (window)) if (!gdk_surface_is_visible (window))
{ {
g_critical ("Window %p has not been made visible in GdkSeatGrabPrepareFunc", g_critical ("Window %p has not been made visible in GdkSeatGrabPrepareFunc",
window); window);
@ -163,7 +163,7 @@ gdk_seat_default_grab (GdkSeat *seat,
{ {
if (capabilities & ~GDK_SEAT_CAPABILITY_KEYBOARD) if (capabilities & ~GDK_SEAT_CAPABILITY_KEYBOARD)
gdk_device_ungrab (priv->master_pointer, evtime); gdk_device_ungrab (priv->master_pointer, evtime);
gdk_window_hide (window); gdk_surface_hide (window);
} }
} }

View File

@ -42,7 +42,7 @@ struct _GdkSeatClass
GdkSeatCapabilities (*get_capabilities) (GdkSeat *seat); GdkSeatCapabilities (*get_capabilities) (GdkSeat *seat);
GdkGrabStatus (* grab) (GdkSeat *seat, GdkGrabStatus (* grab) (GdkSeat *seat,
GdkWindow *window, GdkSurface *window,
GdkSeatCapabilities capabilities, GdkSeatCapabilities capabilities,
gboolean owner_events, gboolean owner_events,
GdkCursor *cursor, GdkCursor *cursor,

View File

@ -128,7 +128,7 @@ typedef struct _GdkDragContext GdkDragContext;
typedef struct _GdkClipboard GdkClipboard; typedef struct _GdkClipboard GdkClipboard;
typedef struct _GdkDisplayManager GdkDisplayManager; typedef struct _GdkDisplayManager GdkDisplayManager;
typedef struct _GdkDisplay GdkDisplay; typedef struct _GdkDisplay GdkDisplay;
typedef struct _GdkWindow GdkWindow; typedef struct _GdkSurface GdkSurface;
typedef struct _GdkKeymap GdkKeymap; typedef struct _GdkKeymap GdkKeymap;
typedef struct _GdkAppLaunchContext GdkAppLaunchContext; typedef struct _GdkAppLaunchContext GdkAppLaunchContext;
typedef struct _GdkSeat GdkSeat; typedef struct _GdkSeat GdkSeat;
@ -387,7 +387,7 @@ typedef enum
* *
* Since GTK 3.8, motion events are already compressed by default, independent * Since GTK 3.8, motion events are already compressed by default, independent
* of this mechanism. This compression can be disabled with * of this mechanism. This compression can be disabled with
* gdk_window_set_event_compression(). See the documentation of that function * gdk_surface_set_event_compression(). See the documentation of that function
* for details. * for details.
* *
* If %GDK_TOUCH_MASK is enabled, the window will receive touch events * If %GDK_TOUCH_MASK is enabled, the window will receive touch events
@ -461,27 +461,27 @@ typedef enum {
} GdkVulkanError; } GdkVulkanError;
/** /**
* GdkWindowTypeHint: * GdkSurfaceTypeHint:
* @GDK_WINDOW_TYPE_HINT_NORMAL: Normal toplevel window. * @GDK_SURFACE_TYPE_HINT_NORMAL: Normal toplevel window.
* @GDK_WINDOW_TYPE_HINT_DIALOG: Dialog window. * @GDK_SURFACE_TYPE_HINT_DIALOG: Dialog window.
* @GDK_WINDOW_TYPE_HINT_MENU: Window used to implement a menu; GTK+ uses * @GDK_SURFACE_TYPE_HINT_MENU: Window used to implement a menu; GTK+ uses
* this hint only for torn-off menus, see #GtkTearoffMenuItem. * this hint only for torn-off menus, see #GtkTearoffMenuItem.
* @GDK_WINDOW_TYPE_HINT_TOOLBAR: Window used to implement toolbars. * @GDK_SURFACE_TYPE_HINT_TOOLBAR: Window used to implement toolbars.
* @GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: Window used to display a splash * @GDK_SURFACE_TYPE_HINT_SPLASHSCREEN: Window used to display a splash
* screen during application startup. * screen during application startup.
* @GDK_WINDOW_TYPE_HINT_UTILITY: Utility windows which are not detached * @GDK_SURFACE_TYPE_HINT_UTILITY: Utility windows which are not detached
* toolbars or dialogs. * toolbars or dialogs.
* @GDK_WINDOW_TYPE_HINT_DOCK: Used for creating dock or panel windows. * @GDK_SURFACE_TYPE_HINT_DOCK: Used for creating dock or panel windows.
* @GDK_WINDOW_TYPE_HINT_DESKTOP: Used for creating the desktop background * @GDK_SURFACE_TYPE_HINT_DESKTOP: Used for creating the desktop background
* window. * window.
* @GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: A menu that belongs to a menubar. * @GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU: A menu that belongs to a menubar.
* @GDK_WINDOW_TYPE_HINT_POPUP_MENU: A menu that does not belong to a menubar, * @GDK_SURFACE_TYPE_HINT_POPUP_MENU: A menu that does not belong to a menubar,
* e.g. a context menu. * e.g. a context menu.
* @GDK_WINDOW_TYPE_HINT_TOOLTIP: A tooltip. * @GDK_SURFACE_TYPE_HINT_TOOLTIP: A tooltip.
* @GDK_WINDOW_TYPE_HINT_NOTIFICATION: A notification - typically a bubble * @GDK_SURFACE_TYPE_HINT_NOTIFICATION: A notification - typically a bubble
* that belongs to a status icon. * that belongs to a status icon.
* @GDK_WINDOW_TYPE_HINT_COMBO: A popup from a combo box. * @GDK_SURFACE_TYPE_HINT_COMBO: A popup from a combo box.
* @GDK_WINDOW_TYPE_HINT_DND: A window that is used to implement a DND cursor. * @GDK_SURFACE_TYPE_HINT_DND: A window that is used to implement a DND cursor.
* *
* These are hints for the window manager that indicate what type of function * These are hints for the window manager that indicate what type of function
* the window has. The window manager can use this when determining decoration * the window has. The window manager can use this when determining decoration
@ -492,21 +492,21 @@ typedef enum {
*/ */
typedef enum typedef enum
{ {
GDK_WINDOW_TYPE_HINT_NORMAL, GDK_SURFACE_TYPE_HINT_NORMAL,
GDK_WINDOW_TYPE_HINT_DIALOG, GDK_SURFACE_TYPE_HINT_DIALOG,
GDK_WINDOW_TYPE_HINT_MENU, /* Torn off menu */ GDK_SURFACE_TYPE_HINT_MENU, /* Torn off menu */
GDK_WINDOW_TYPE_HINT_TOOLBAR, GDK_SURFACE_TYPE_HINT_TOOLBAR,
GDK_WINDOW_TYPE_HINT_SPLASHSCREEN, GDK_SURFACE_TYPE_HINT_SPLASHSCREEN,
GDK_WINDOW_TYPE_HINT_UTILITY, GDK_SURFACE_TYPE_HINT_UTILITY,
GDK_WINDOW_TYPE_HINT_DOCK, GDK_SURFACE_TYPE_HINT_DOCK,
GDK_WINDOW_TYPE_HINT_DESKTOP, GDK_SURFACE_TYPE_HINT_DESKTOP,
GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU, /* A drop down menu (from a menubar) */ GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU, /* A drop down menu (from a menubar) */
GDK_WINDOW_TYPE_HINT_POPUP_MENU, /* A popup menu (from right-click) */ GDK_SURFACE_TYPE_HINT_POPUP_MENU, /* A popup menu (from right-click) */
GDK_WINDOW_TYPE_HINT_TOOLTIP, GDK_SURFACE_TYPE_HINT_TOOLTIP,
GDK_WINDOW_TYPE_HINT_NOTIFICATION, GDK_SURFACE_TYPE_HINT_NOTIFICATION,
GDK_WINDOW_TYPE_HINT_COMBO, GDK_SURFACE_TYPE_HINT_COMBO,
GDK_WINDOW_TYPE_HINT_DND GDK_SURFACE_TYPE_HINT_DND
} GdkWindowTypeHint; } GdkSurfaceTypeHint;
/** /**
* GdkAxisUse: * GdkAxisUse:

View File

@ -36,8 +36,8 @@
* #GdkVulkanContext is an object representing the platform-specific * #GdkVulkanContext is an object representing the platform-specific
* Vulkan draw context. * Vulkan draw context.
* *
* #GdkVulkanContexts are created for a #GdkWindow using * #GdkVulkanContexts are created for a #GdkSurface using
* gdk_window_create_vulkan_context(), and the context will match the * gdk_surface_create_vulkan_context(), and the context will match the
* the characteristics of the window. * the characteristics of the window.
* *
* Support for #GdkVulkanContext is platform-specific, context creation * Support for #GdkVulkanContext is platform-specific, context creation
@ -250,7 +250,7 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
GError **error) GError **error)
{ {
GdkVulkanContextPrivate *priv = gdk_vulkan_context_get_instance_private (context); GdkVulkanContextPrivate *priv = gdk_vulkan_context_get_instance_private (context);
GdkWindow *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); GdkSurface *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context));
VkSurfaceCapabilitiesKHR capabilities; VkSurfaceCapabilitiesKHR capabilities;
VkCompositeAlphaFlagBitsKHR composite_alpha; VkCompositeAlphaFlagBitsKHR composite_alpha;
VkSwapchainKHR new_swapchain; VkSwapchainKHR new_swapchain;
@ -258,8 +258,8 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
VkDevice device; VkDevice device;
guint i; guint i;
if (gdk_window_get_width (window) * gdk_window_get_scale_factor (window) == priv->swapchain_width && if (gdk_surface_get_width (window) * gdk_surface_get_scale_factor (window) == priv->swapchain_width &&
gdk_window_get_height (window) * gdk_window_get_scale_factor (window) == priv->swapchain_height) gdk_surface_get_height (window) * gdk_surface_get_scale_factor (window) == priv->swapchain_height)
return TRUE; return TRUE;
device = gdk_vulkan_context_get_device (context); device = gdk_vulkan_context_get_device (context);
@ -295,8 +295,8 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
*/ */
if (capabilities.currentExtent.width == -1 || capabilities.currentExtent.height == -1) if (capabilities.currentExtent.width == -1 || capabilities.currentExtent.height == -1)
{ {
capabilities.currentExtent.width = gdk_window_get_width (window) * gdk_window_get_scale_factor (window); capabilities.currentExtent.width = gdk_surface_get_width (window) * gdk_surface_get_scale_factor (window);
capabilities.currentExtent.height = gdk_window_get_height (window) * gdk_window_get_scale_factor (window); capabilities.currentExtent.height = gdk_surface_get_height (window) * gdk_surface_get_scale_factor (window);
} }
res = GDK_VK_CHECK (vkCreateSwapchainKHR, device, res = GDK_VK_CHECK (vkCreateSwapchainKHR, device,
@ -361,8 +361,8 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context,
{ {
priv->regions[i] = cairo_region_create_rectangle (&(cairo_rectangle_int_t) { priv->regions[i] = cairo_region_create_rectangle (&(cairo_rectangle_int_t) {
0, 0, 0, 0,
gdk_window_get_width (window), gdk_surface_get_width (window),
gdk_window_get_height (window), gdk_surface_get_height (window),
}); });
} }
} }
@ -705,8 +705,8 @@ gdk_vulkan_context_get_image (GdkVulkanContext *context,
* *
* Gets the index of the image that is currently being drawn. * Gets the index of the image that is currently being drawn.
* *
* This function can only be used between gdk_window_begin_draw_frame() and * This function can only be used between gdk_surface_begin_draw_frame() and
* gdk_window_end_draw_frame() calls for the toplevel window that the * gdk_surface_end_draw_frame() calls for the toplevel window that the
* @context is associated with. * @context is associated with.
* *
* Returns: the index of the images that is being drawn * Returns: the index of the images that is being drawn
@ -729,8 +729,8 @@ gdk_vulkan_context_get_draw_index (GdkVulkanContext *context)
* Gets the Vulkan semaphore that protects access to the image that is * Gets the Vulkan semaphore that protects access to the image that is
* currently being drawn. * currently being drawn.
* *
* This function can only be used between gdk_window_begin_draw_frame() and * This function can only be used between gdk_surface_begin_draw_frame() and
* gdk_window_end_draw_frame() calls for the toplevel window that the * gdk_surface_end_draw_frame() calls for the toplevel window that the
* @context is associated with. * @context is associated with.
* *
* Returns: (transfer none): the VkSemaphore * Returns: (transfer none): the VkSemaphore

File diff suppressed because it is too large Load Diff

View File

@ -22,8 +22,8 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/ */
#ifndef __GDK_WINDOW_H__ #ifndef __GDK_SURFACE_H__
#define __GDK_WINDOW_H__ #define __GDK_SURFACE_H__
#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdk.h> can be included directly." #error "Only <gdk/gdk.h> can be included directly."
@ -41,15 +41,15 @@ G_BEGIN_DECLS
typedef struct _GdkGeometry GdkGeometry; typedef struct _GdkGeometry GdkGeometry;
/** /**
* GdkWindowType: * GdkSurfaceType:
* @GDK_WINDOW_ROOT: root window; this window has no parent, covers the entire * @GDK_SURFACE_ROOT: root window; this window has no parent, covers the entire
* screen, and is created by the window system * screen, and is created by the window system
* @GDK_WINDOW_TOPLEVEL: toplevel window (used to implement #GtkWindow) * @GDK_SURFACE_TOPLEVEL: toplevel window (used to implement #GtkWindow)
* @GDK_WINDOW_CHILD: child window (used to implement e.g. #GtkEntry) * @GDK_SURFACE_CHILD: child window (used to implement e.g. #GtkEntry)
* @GDK_WINDOW_TEMP: override redirect temporary window (used to implement * @GDK_SURFACE_TEMP: override redirect temporary window (used to implement
* #GtkMenu) * #GtkMenu)
* @GDK_WINDOW_FOREIGN: foreign window (see gdk_window_foreign_new()) * @GDK_SURFACE_FOREIGN: foreign window (see gdk_surface_foreign_new())
* @GDK_WINDOW_SUBSURFACE: subsurface-based window; This window is visually * @GDK_SURFACE_SUBSURFACE: subsurface-based window; This window is visually
* tied to a toplevel, and is moved/stacked with it. Currently this window * tied to a toplevel, and is moved/stacked with it. Currently this window
* type is only implemented in Wayland. Since 3.14 * type is only implemented in Wayland. Since 3.14
* *
@ -57,18 +57,18 @@ typedef struct _GdkGeometry GdkGeometry;
*/ */
typedef enum typedef enum
{ {
GDK_WINDOW_ROOT, GDK_SURFACE_ROOT,
GDK_WINDOW_TOPLEVEL, GDK_SURFACE_TOPLEVEL,
GDK_WINDOW_CHILD, GDK_SURFACE_CHILD,
GDK_WINDOW_TEMP, GDK_SURFACE_TEMP,
GDK_WINDOW_FOREIGN, GDK_SURFACE_FOREIGN,
GDK_WINDOW_SUBSURFACE GDK_SURFACE_SUBSURFACE
} GdkWindowType; } GdkSurfaceType;
/* Size restriction enumeration. /* Size restriction enumeration.
*/ */
/** /**
* GdkWindowHints: * GdkSurfaceHints:
* @GDK_HINT_POS: indicates that the program has positioned the window * @GDK_HINT_POS: indicates that the program has positioned the window
* @GDK_HINT_MIN_SIZE: min size fields are set * @GDK_HINT_MIN_SIZE: min size fields are set
* @GDK_HINT_MAX_SIZE: max size fields are set * @GDK_HINT_MAX_SIZE: max size fields are set
@ -101,11 +101,11 @@ typedef enum
GDK_HINT_WIN_GRAVITY = 1 << 6, GDK_HINT_WIN_GRAVITY = 1 << 6,
GDK_HINT_USER_POS = 1 << 7, GDK_HINT_USER_POS = 1 << 7,
GDK_HINT_USER_SIZE = 1 << 8 GDK_HINT_USER_SIZE = 1 << 8
} GdkWindowHints; } GdkSurfaceHints;
/* The next two enumeration values current match the /* The next two enumeration values current match the
* Motif constants. If this is changed, the implementation * Motif constants. If this is changed, the implementation
* of gdk_window_set_decorations/gdk_window_set_functions * of gdk_surface_set_decorations/gdk_surface_set_functions
* will need to change as well. * will need to change as well.
*/ */
/** /**
@ -157,7 +157,7 @@ typedef enum
} GdkWMFunction; } GdkWMFunction;
/* Currently, these are the same values numerically as in the /* Currently, these are the same values numerically as in the
* X protocol. If you change that, gdkwindow-x11.c/gdk_window_set_geometry_hints() * X protocol. If you change that, gdkwindow-x11.c/gdk_surface_set_geometry_hints()
* will need fixing. * will need fixing.
*/ */
/** /**
@ -239,29 +239,29 @@ typedef enum
} GdkAnchorHints; } GdkAnchorHints;
/** /**
* GdkWindowEdge: * GdkSurfaceEdge:
* @GDK_WINDOW_EDGE_NORTH_WEST: the top left corner. * @GDK_SURFACE_EDGE_NORTH_WEST: the top left corner.
* @GDK_WINDOW_EDGE_NORTH: the top edge. * @GDK_SURFACE_EDGE_NORTH: the top edge.
* @GDK_WINDOW_EDGE_NORTH_EAST: the top right corner. * @GDK_SURFACE_EDGE_NORTH_EAST: the top right corner.
* @GDK_WINDOW_EDGE_WEST: the left edge. * @GDK_SURFACE_EDGE_WEST: the left edge.
* @GDK_WINDOW_EDGE_EAST: the right edge. * @GDK_SURFACE_EDGE_EAST: the right edge.
* @GDK_WINDOW_EDGE_SOUTH_WEST: the lower left corner. * @GDK_SURFACE_EDGE_SOUTH_WEST: the lower left corner.
* @GDK_WINDOW_EDGE_SOUTH: the lower edge. * @GDK_SURFACE_EDGE_SOUTH: the lower edge.
* @GDK_WINDOW_EDGE_SOUTH_EAST: the lower right corner. * @GDK_SURFACE_EDGE_SOUTH_EAST: the lower right corner.
* *
* Determines a window edge or corner. * Determines a window edge or corner.
*/ */
typedef enum typedef enum
{ {
GDK_WINDOW_EDGE_NORTH_WEST, GDK_SURFACE_EDGE_NORTH_WEST,
GDK_WINDOW_EDGE_NORTH, GDK_SURFACE_EDGE_NORTH,
GDK_WINDOW_EDGE_NORTH_EAST, GDK_SURFACE_EDGE_NORTH_EAST,
GDK_WINDOW_EDGE_WEST, GDK_SURFACE_EDGE_WEST,
GDK_WINDOW_EDGE_EAST, GDK_SURFACE_EDGE_EAST,
GDK_WINDOW_EDGE_SOUTH_WEST, GDK_SURFACE_EDGE_SOUTH_WEST,
GDK_WINDOW_EDGE_SOUTH, GDK_SURFACE_EDGE_SOUTH,
GDK_WINDOW_EDGE_SOUTH_EAST GDK_SURFACE_EDGE_SOUTH_EAST
} GdkWindowEdge; } GdkSurfaceEdge;
/** /**
* GdkFullscreenMode: * GdkFullscreenMode:
@ -302,9 +302,9 @@ typedef enum
* The #GdkGeometry struct gives the window manager information about * The #GdkGeometry struct gives the window manager information about
* a windows geometry constraints. Normally you would set these on * a windows geometry constraints. Normally you would set these on
* the GTK+ level using gtk_window_set_geometry_hints(). #GtkWindow * the GTK+ level using gtk_window_set_geometry_hints(). #GtkWindow
* then sets the hints on the #GdkWindow it creates. * then sets the hints on the #GdkSurface it creates.
* *
* gdk_window_set_geometry_hints() expects the hints to be fully valid already * gdk_surface_set_geometry_hints() expects the hints to be fully valid already
* and simply passes them to the window manager; in contrast, * and simply passes them to the window manager; in contrast,
* gtk_window_set_geometry_hints() performs some interpretation. For example, * gtk_window_set_geometry_hints() performs some interpretation. For example,
* #GtkWindow will apply the hints to the geometry widget instead of the * #GtkWindow will apply the hints to the geometry widget instead of the
@ -371,62 +371,62 @@ struct _GdkGeometry
}; };
/** /**
* GdkWindowState: * GdkSurfaceState:
* @GDK_WINDOW_STATE_WITHDRAWN: the window is not shown. * @GDK_SURFACE_STATE_WITHDRAWN: the window is not shown.
* @GDK_WINDOW_STATE_ICONIFIED: the window is minimized. * @GDK_SURFACE_STATE_ICONIFIED: the window is minimized.
* @GDK_WINDOW_STATE_MAXIMIZED: the window is maximized. * @GDK_SURFACE_STATE_MAXIMIZED: the window is maximized.
* @GDK_WINDOW_STATE_STICKY: the window is sticky. * @GDK_SURFACE_STATE_STICKY: the window is sticky.
* @GDK_WINDOW_STATE_FULLSCREEN: the window is maximized without * @GDK_SURFACE_STATE_FULLSCREEN: the window is maximized without
* decorations. * decorations.
* @GDK_WINDOW_STATE_ABOVE: the window is kept above other windows. * @GDK_SURFACE_STATE_ABOVE: the window is kept above other windows.
* @GDK_WINDOW_STATE_BELOW: the window is kept below other windows. * @GDK_SURFACE_STATE_BELOW: the window is kept below other windows.
* @GDK_WINDOW_STATE_FOCUSED: the window is presented as focused (with active decorations). * @GDK_SURFACE_STATE_FOCUSED: the window is presented as focused (with active decorations).
* @GDK_WINDOW_STATE_TILED: the window is in a tiled state, Since 3.10. Since 3.91.2, this * @GDK_SURFACE_STATE_TILED: the window is in a tiled state, Since 3.10. Since 3.91.2, this
* is deprecated in favor of per-edge information. * is deprecated in favor of per-edge information.
* @GDK_WINDOW_STATE_TOP_TILED: whether the top edge is tiled, Since 3.91.2 * @GDK_SURFACE_STATE_TOP_TILED: whether the top edge is tiled, Since 3.91.2
* @GDK_WINDOW_STATE_TOP_RESIZABLE: whether the top edge is resizable, Since 3.91.2 * @GDK_SURFACE_STATE_TOP_RESIZABLE: whether the top edge is resizable, Since 3.91.2
* @GDK_WINDOW_STATE_RIGHT_TILED: whether the right edge is tiled, Since 3.91.2 * @GDK_SURFACE_STATE_RIGHT_TILED: whether the right edge is tiled, Since 3.91.2
* @GDK_WINDOW_STATE_RIGHT_RESIZABLE: whether the right edge is resizable, Since 3.91.2 * @GDK_SURFACE_STATE_RIGHT_RESIZABLE: whether the right edge is resizable, Since 3.91.2
* @GDK_WINDOW_STATE_BOTTOM_TILED: whether the bottom edge is tiled, Since 3.91.2 * @GDK_SURFACE_STATE_BOTTOM_TILED: whether the bottom edge is tiled, Since 3.91.2
* @GDK_WINDOW_STATE_BOTTOM_RESIZABLE: whether the bottom edge is resizable, Since 3.91.2 * @GDK_SURFACE_STATE_BOTTOM_RESIZABLE: whether the bottom edge is resizable, Since 3.91.2
* @GDK_WINDOW_STATE_LEFT_TILED: whether the left edge is tiled, Since 3.91.2 * @GDK_SURFACE_STATE_LEFT_TILED: whether the left edge is tiled, Since 3.91.2
* @GDK_WINDOW_STATE_LEFT_RESIZABLE: whether the left edge is resizable, Since 3.91.2 * @GDK_SURFACE_STATE_LEFT_RESIZABLE: whether the left edge is resizable, Since 3.91.2
* *
* Specifies the state of a toplevel window. * Specifies the state of a toplevel window.
*/ */
typedef enum typedef enum
{ {
GDK_WINDOW_STATE_WITHDRAWN = 1 << 0, GDK_SURFACE_STATE_WITHDRAWN = 1 << 0,
GDK_WINDOW_STATE_ICONIFIED = 1 << 1, GDK_SURFACE_STATE_ICONIFIED = 1 << 1,
GDK_WINDOW_STATE_MAXIMIZED = 1 << 2, GDK_SURFACE_STATE_MAXIMIZED = 1 << 2,
GDK_WINDOW_STATE_STICKY = 1 << 3, GDK_SURFACE_STATE_STICKY = 1 << 3,
GDK_WINDOW_STATE_FULLSCREEN = 1 << 4, GDK_SURFACE_STATE_FULLSCREEN = 1 << 4,
GDK_WINDOW_STATE_ABOVE = 1 << 5, GDK_SURFACE_STATE_ABOVE = 1 << 5,
GDK_WINDOW_STATE_BELOW = 1 << 6, GDK_SURFACE_STATE_BELOW = 1 << 6,
GDK_WINDOW_STATE_FOCUSED = 1 << 7, GDK_SURFACE_STATE_FOCUSED = 1 << 7,
GDK_WINDOW_STATE_TILED = 1 << 8, GDK_SURFACE_STATE_TILED = 1 << 8,
GDK_WINDOW_STATE_TOP_TILED = 1 << 9, GDK_SURFACE_STATE_TOP_TILED = 1 << 9,
GDK_WINDOW_STATE_TOP_RESIZABLE = 1 << 10, GDK_SURFACE_STATE_TOP_RESIZABLE = 1 << 10,
GDK_WINDOW_STATE_RIGHT_TILED = 1 << 11, GDK_SURFACE_STATE_RIGHT_TILED = 1 << 11,
GDK_WINDOW_STATE_RIGHT_RESIZABLE = 1 << 12, GDK_SURFACE_STATE_RIGHT_RESIZABLE = 1 << 12,
GDK_WINDOW_STATE_BOTTOM_TILED = 1 << 13, GDK_SURFACE_STATE_BOTTOM_TILED = 1 << 13,
GDK_WINDOW_STATE_BOTTOM_RESIZABLE = 1 << 14, GDK_SURFACE_STATE_BOTTOM_RESIZABLE = 1 << 14,
GDK_WINDOW_STATE_LEFT_TILED = 1 << 15, GDK_SURFACE_STATE_LEFT_TILED = 1 << 15,
GDK_WINDOW_STATE_LEFT_RESIZABLE = 1 << 16 GDK_SURFACE_STATE_LEFT_RESIZABLE = 1 << 16
} GdkWindowState; } GdkSurfaceState;
typedef struct _GdkWindowClass GdkWindowClass; typedef struct _GdkSurfaceClass GdkSurfaceClass;
#define GDK_TYPE_WINDOW (gdk_window_get_type ()) #define GDK_TYPE_SURFACE (gdk_surface_get_type ())
#define GDK_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW, GdkWindow)) #define GDK_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE, GdkSurface))
#define GDK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowClass)) #define GDK_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE, GdkSurfaceClass))
#define GDK_IS_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW)) #define GDK_IS_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE))
#define GDK_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW)) #define GDK_IS_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE))
#define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowClass)) #define GDK_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE, GdkSurfaceClass))
struct _GdkWindowClass struct _GdkSurfaceClass
{ {
GObjectClass parent_class; GObjectClass parent_class;
@ -444,81 +444,81 @@ struct _GdkWindowClass
/* Windows /* Windows
*/ */
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GType gdk_window_get_type (void) G_GNUC_CONST; GType gdk_surface_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_window_new_toplevel (GdkDisplay *display, GdkSurface * gdk_surface_new_toplevel (GdkDisplay *display,
int width, int width,
int height); int height);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_window_new_popup (GdkDisplay *display, GdkSurface * gdk_surface_new_popup (GdkDisplay *display,
const GdkRectangle *position); const GdkRectangle *position);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_window_new_temp (GdkDisplay *display); GdkSurface * gdk_surface_new_temp (GdkDisplay *display);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_window_new_child (GdkWindow *parent, GdkSurface * gdk_surface_new_child (GdkSurface *parent,
const GdkRectangle *position); const GdkRectangle *position);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_destroy (GdkWindow *window); void gdk_surface_destroy (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindowType gdk_window_get_window_type (GdkWindow *window); GdkSurfaceType gdk_surface_get_window_type (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_window_is_destroyed (GdkWindow *window); gboolean gdk_surface_is_destroyed (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkDisplay * gdk_window_get_display (GdkWindow *window); GdkDisplay * gdk_surface_get_display (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_show (GdkWindow *window); void gdk_surface_show (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_hide (GdkWindow *window); void gdk_surface_hide (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_withdraw (GdkWindow *window); void gdk_surface_withdraw (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_show_unraised (GdkWindow *window); void gdk_surface_show_unraised (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_move (GdkWindow *window, void gdk_surface_move (GdkSurface *window,
gint x, gint x,
gint y); gint y);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_resize (GdkWindow *window, void gdk_surface_resize (GdkSurface *window,
gint width, gint width,
gint height); gint height);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_move_resize (GdkWindow *window, void gdk_surface_move_resize (GdkSurface *window,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint height); gint height);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_raise (GdkWindow *window); void gdk_surface_raise (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_lower (GdkWindow *window); void gdk_surface_lower (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_restack (GdkWindow *window, void gdk_surface_restack (GdkSurface *window,
GdkWindow *sibling, GdkSurface *sibling,
gboolean above); gboolean above);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_focus (GdkWindow *window, void gdk_surface_focus (GdkSurface *window,
guint32 timestamp); guint32 timestamp);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_user_data (GdkWindow *window, void gdk_surface_set_user_data (GdkSurface *window,
gpointer user_data); gpointer user_data);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_window_get_accept_focus (GdkWindow *window); gboolean gdk_surface_get_accept_focus (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_accept_focus (GdkWindow *window, void gdk_surface_set_accept_focus (GdkSurface *window,
gboolean accept_focus); gboolean accept_focus);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_window_get_focus_on_map (GdkWindow *window); gboolean gdk_surface_get_focus_on_map (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_focus_on_map (GdkWindow *window, void gdk_surface_set_focus_on_map (GdkSurface *window,
gboolean focus_on_map); gboolean focus_on_map);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_scroll (GdkWindow *window, void gdk_surface_scroll (GdkSurface *window,
gint dx, gint dx,
gint dy); gint dy);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_move_region (GdkWindow *window, void gdk_surface_move_region (GdkSurface *window,
const cairo_region_t *region, const cairo_region_t *region,
gint dx, gint dx,
gint dy); gint dy);
@ -528,7 +528,7 @@ void gdk_window_move_region (GdkWindow *window,
* - cool feature, needed for Drag and Drag for example. * - cool feature, needed for Drag and Drag for example.
*/ */
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_shape_combine_region (GdkWindow *window, void gdk_surface_shape_combine_region (GdkSurface *window,
const cairo_region_t *shape_region, const cairo_region_t *shape_region,
gint offset_x, gint offset_x,
gint offset_y); gint offset_y);
@ -541,7 +541,7 @@ void gdk_window_shape_combine_region (GdkWindow *window,
* - Raster * - Raster
*/ */
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_child_shapes (GdkWindow *window); void gdk_surface_set_child_shapes (GdkSurface *window);
/* /*
* This routine allows you to merge (ie ADD) child shapes to your * This routine allows you to merge (ie ADD) child shapes to your
@ -551,24 +551,24 @@ void gdk_window_set_child_shapes (GdkWindow *window);
* - Raster * - Raster
*/ */
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_merge_child_shapes (GdkWindow *window); void gdk_surface_merge_child_shapes (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_input_shape_combine_region (GdkWindow *window, void gdk_surface_input_shape_combine_region (GdkSurface *window,
const cairo_region_t *shape_region, const cairo_region_t *shape_region,
gint offset_x, gint offset_x,
gint offset_y); gint offset_y);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_child_input_shapes (GdkWindow *window); void gdk_surface_set_child_input_shapes (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_merge_child_input_shapes (GdkWindow *window); void gdk_surface_merge_child_input_shapes (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_pass_through (GdkWindow *window, void gdk_surface_set_pass_through (GdkSurface *window,
gboolean pass_through); gboolean pass_through);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_window_get_pass_through (GdkWindow *window); gboolean gdk_surface_get_pass_through (GdkSurface *window);
/* /*
* Check if a window has been shown, and whether all its * Check if a window has been shown, and whether all its
@ -577,273 +577,273 @@ gboolean gdk_window_get_pass_through (GdkWindow *window);
* viewable in the X sense. * viewable in the X sense.
*/ */
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_window_is_visible (GdkWindow *window); gboolean gdk_surface_is_visible (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_window_is_viewable (GdkWindow *window); gboolean gdk_surface_is_viewable (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_window_is_input_only (GdkWindow *window); gboolean gdk_surface_is_input_only (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_window_is_shaped (GdkWindow *window); gboolean gdk_surface_is_shaped (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindowState gdk_window_get_state (GdkWindow *window); GdkSurfaceState gdk_surface_get_state (GdkSurface *window);
/* GdkWindow */ /* GdkSurface */
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_window_has_native (GdkWindow *window); gboolean gdk_surface_has_native (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_type_hint (GdkWindow *window, void gdk_surface_set_type_hint (GdkSurface *window,
GdkWindowTypeHint hint); GdkSurfaceTypeHint hint);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow *window); GdkSurfaceTypeHint gdk_surface_get_type_hint (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_window_get_modal_hint (GdkWindow *window); gboolean gdk_surface_get_modal_hint (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_modal_hint (GdkWindow *window, void gdk_surface_set_modal_hint (GdkSurface *window,
gboolean modal); gboolean modal);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_skip_taskbar_hint (GdkWindow *window, void gdk_surface_set_skip_taskbar_hint (GdkSurface *window,
gboolean skips_taskbar); gboolean skips_taskbar);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_skip_pager_hint (GdkWindow *window, void gdk_surface_set_skip_pager_hint (GdkSurface *window,
gboolean skips_pager); gboolean skips_pager);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_urgency_hint (GdkWindow *window, void gdk_surface_set_urgency_hint (GdkSurface *window,
gboolean urgent); gboolean urgent);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_geometry_hints (GdkWindow *window, void gdk_surface_set_geometry_hints (GdkSurface *window,
const GdkGeometry *geometry, const GdkGeometry *geometry,
GdkWindowHints geom_mask); GdkSurfaceHints geom_mask);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
cairo_region_t *gdk_window_get_clip_region (GdkWindow *window); cairo_region_t *gdk_surface_get_clip_region (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
cairo_region_t *gdk_window_get_visible_region(GdkWindow *window); cairo_region_t *gdk_surface_get_visible_region(GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkDrawingContext *gdk_window_begin_draw_frame (GdkWindow *window, GdkDrawingContext *gdk_surface_begin_draw_frame (GdkSurface *window,
GdkDrawContext *context, GdkDrawContext *context,
const cairo_region_t *region); const cairo_region_t *region);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_end_draw_frame (GdkWindow *window, void gdk_surface_end_draw_frame (GdkSurface *window,
GdkDrawingContext *context); GdkDrawingContext *context);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_title (GdkWindow *window, void gdk_surface_set_title (GdkSurface *window,
const gchar *title); const gchar *title);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_role (GdkWindow *window, void gdk_surface_set_role (GdkSurface *window,
const gchar *role); const gchar *role);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_startup_id (GdkWindow *window, void gdk_surface_set_startup_id (GdkSurface *window,
const gchar *startup_id); const gchar *startup_id);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_transient_for (GdkWindow *window, void gdk_surface_set_transient_for (GdkSurface *window,
GdkWindow *parent); GdkSurface *parent);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_cursor (GdkWindow *window, void gdk_surface_set_cursor (GdkSurface *window,
GdkCursor *cursor); GdkCursor *cursor);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkCursor *gdk_window_get_cursor (GdkWindow *window); GdkCursor *gdk_surface_get_cursor (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_device_cursor (GdkWindow *window, void gdk_surface_set_device_cursor (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
GdkCursor *cursor); GdkCursor *cursor);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkCursor *gdk_window_get_device_cursor (GdkWindow *window, GdkCursor *gdk_surface_get_device_cursor (GdkSurface *window,
GdkDevice *device); GdkDevice *device);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_get_user_data (GdkWindow *window, void gdk_surface_get_user_data (GdkSurface *window,
gpointer *data); gpointer *data);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_get_geometry (GdkWindow *window, void gdk_surface_get_geometry (GdkSurface *window,
gint *x, gint *x,
gint *y, gint *y,
gint *width, gint *width,
gint *height); gint *height);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
int gdk_window_get_width (GdkWindow *window); int gdk_surface_get_width (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
int gdk_window_get_height (GdkWindow *window); int gdk_surface_get_height (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_get_position (GdkWindow *window, void gdk_surface_get_position (GdkSurface *window,
gint *x, gint *x,
gint *y); gint *y);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gint gdk_window_get_origin (GdkWindow *window, gint gdk_surface_get_origin (GdkSurface *window,
gint *x, gint *x,
gint *y); gint *y);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_get_root_coords (GdkWindow *window, void gdk_surface_get_root_coords (GdkSurface *window,
gint x, gint x,
gint y, gint y,
gint *root_x, gint *root_x,
gint *root_y); gint *root_y);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_coords_to_parent (GdkWindow *window, void gdk_surface_coords_to_parent (GdkSurface *window,
gdouble x, gdouble x,
gdouble y, gdouble y,
gdouble *parent_x, gdouble *parent_x,
gdouble *parent_y); gdouble *parent_y);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_coords_from_parent (GdkWindow *window, void gdk_surface_coords_from_parent (GdkSurface *window,
gdouble parent_x, gdouble parent_x,
gdouble parent_y, gdouble parent_y,
gdouble *x, gdouble *x,
gdouble *y); gdouble *y);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_get_root_origin (GdkWindow *window, void gdk_surface_get_root_origin (GdkSurface *window,
gint *x, gint *x,
gint *y); gint *y);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_get_frame_extents (GdkWindow *window, void gdk_surface_get_frame_extents (GdkSurface *window,
GdkRectangle *rect); GdkRectangle *rect);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gint gdk_window_get_scale_factor (GdkWindow *window); gint gdk_surface_get_scale_factor (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_window_get_device_position (GdkWindow *window, GdkSurface * gdk_surface_get_device_position (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
gint *x, gint *x,
gint *y, gint *y,
GdkModifierType *mask); GdkModifierType *mask);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_window_get_device_position_double (GdkWindow *window, GdkSurface * gdk_surface_get_device_position_double (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
gdouble *x, gdouble *x,
gdouble *y, gdouble *y,
GdkModifierType *mask); GdkModifierType *mask);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_window_get_parent (GdkWindow *window); GdkSurface * gdk_surface_get_parent (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_window_get_toplevel (GdkWindow *window); GdkSurface * gdk_surface_get_toplevel (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GList * gdk_window_get_children (GdkWindow *window); GList * gdk_surface_get_children (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GList * gdk_window_peek_children (GdkWindow *window); GList * gdk_surface_peek_children (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GList * gdk_window_get_children_with_user_data (GdkWindow *window, GList * gdk_surface_get_children_with_user_data (GdkSurface *window,
gpointer user_data); gpointer user_data);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkEventMask gdk_window_get_events (GdkWindow *window); GdkEventMask gdk_surface_get_events (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_events (GdkWindow *window, void gdk_surface_set_events (GdkSurface *window,
GdkEventMask event_mask); GdkEventMask event_mask);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_device_events (GdkWindow *window, void gdk_surface_set_device_events (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
GdkEventMask event_mask); GdkEventMask event_mask);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkEventMask gdk_window_get_device_events (GdkWindow *window, GdkEventMask gdk_surface_get_device_events (GdkSurface *window,
GdkDevice *device); GdkDevice *device);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_icon_list (GdkWindow *window, void gdk_surface_set_icon_list (GdkSurface *window,
GList *surfaces); GList *surfaces);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_icon_name (GdkWindow *window, void gdk_surface_set_icon_name (GdkSurface *window,
const gchar *name); const gchar *name);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_group (GdkWindow *window, void gdk_surface_set_group (GdkSurface *window,
GdkWindow *leader); GdkSurface *leader);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow* gdk_window_get_group (GdkWindow *window); GdkSurface* gdk_surface_get_group (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_decorations (GdkWindow *window, void gdk_surface_set_decorations (GdkSurface *window,
GdkWMDecoration decorations); GdkWMDecoration decorations);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_window_get_decorations (GdkWindow *window, gboolean gdk_surface_get_decorations (GdkSurface *window,
GdkWMDecoration *decorations); GdkWMDecoration *decorations);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_functions (GdkWindow *window, void gdk_surface_set_functions (GdkSurface *window,
GdkWMFunction functions); GdkWMFunction functions);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
cairo_surface_t * cairo_surface_t *
gdk_window_create_similar_surface (GdkWindow *window, gdk_surface_create_similar_surface (GdkSurface *window,
cairo_content_t content, cairo_content_t content,
int width, int width,
int height); int height);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
cairo_surface_t * cairo_surface_t *
gdk_window_create_similar_image_surface (GdkWindow *window, gdk_surface_create_similar_image_surface (GdkSurface *window,
cairo_format_t format, cairo_format_t format,
int width, int width,
int height, int height,
int scale); int scale);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_beep (GdkWindow *window); void gdk_surface_beep (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_iconify (GdkWindow *window); void gdk_surface_iconify (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_deiconify (GdkWindow *window); void gdk_surface_deiconify (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_stick (GdkWindow *window); void gdk_surface_stick (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_unstick (GdkWindow *window); void gdk_surface_unstick (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_maximize (GdkWindow *window); void gdk_surface_maximize (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_unmaximize (GdkWindow *window); void gdk_surface_unmaximize (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_fullscreen (GdkWindow *window); void gdk_surface_fullscreen (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_fullscreen_on_monitor (GdkWindow *window, void gdk_surface_fullscreen_on_monitor (GdkSurface *window,
GdkMonitor *monitor); GdkMonitor *monitor);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_fullscreen_mode (GdkWindow *window, void gdk_surface_set_fullscreen_mode (GdkSurface *window,
GdkFullscreenMode mode); GdkFullscreenMode mode);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkFullscreenMode GdkFullscreenMode
gdk_window_get_fullscreen_mode (GdkWindow *window); gdk_surface_get_fullscreen_mode (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_unfullscreen (GdkWindow *window); void gdk_surface_unfullscreen (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_keep_above (GdkWindow *window, void gdk_surface_set_keep_above (GdkSurface *window,
gboolean setting); gboolean setting);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_keep_below (GdkWindow *window, void gdk_surface_set_keep_below (GdkSurface *window,
gboolean setting); gboolean setting);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_opacity (GdkWindow *window, void gdk_surface_set_opacity (GdkSurface *window,
gdouble opacity); gdouble opacity);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_register_dnd (GdkWindow *window); void gdk_surface_register_dnd (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_begin_resize_drag (GdkWindow *window, void gdk_surface_begin_resize_drag (GdkSurface *window,
GdkWindowEdge edge, GdkSurfaceEdge edge,
gint button, gint button,
gint root_x, gint root_x,
gint root_y, gint root_y,
guint32 timestamp); guint32 timestamp);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_begin_resize_drag_for_device (GdkWindow *window, void gdk_surface_begin_resize_drag_for_device (GdkSurface *window,
GdkWindowEdge edge, GdkSurfaceEdge edge,
GdkDevice *device, GdkDevice *device,
gint button, gint button,
gint root_x, gint root_x,
gint root_y, gint root_y,
guint32 timestamp); guint32 timestamp);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_begin_move_drag (GdkWindow *window, void gdk_surface_begin_move_drag (GdkSurface *window,
gint button, gint button,
gint root_x, gint root_x,
gint root_y, gint root_y,
guint32 timestamp); guint32 timestamp);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_begin_move_drag_for_device (GdkWindow *window, void gdk_surface_begin_move_drag_for_device (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
gint button, gint button,
gint root_x, gint root_x,
@ -852,44 +852,44 @@ void gdk_window_begin_move_drag_for_device (GdkWindow *window,
/* Interface for dirty-region queueing */ /* Interface for dirty-region queueing */
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_invalidate_rect (GdkWindow *window, void gdk_surface_invalidate_rect (GdkSurface *window,
const GdkRectangle *rect, const GdkRectangle *rect,
gboolean invalidate_children); gboolean invalidate_children);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_invalidate_region (GdkWindow *window, void gdk_surface_invalidate_region (GdkSurface *window,
const cairo_region_t *region, const cairo_region_t *region,
gboolean invalidate_children); gboolean invalidate_children);
/** /**
* GdkWindowChildFunc: * GdkSurfaceChildFunc:
* @window: a #GdkWindow * @window: a #GdkSurface
* @user_data: user data * @user_data: user data
* *
* A function of this type is passed to gdk_window_invalidate_maybe_recurse(). * A function of this type is passed to gdk_surface_invalidate_maybe_recurse().
* It gets called for each child of the window to determine whether to * It gets called for each child of the window to determine whether to
* recursively invalidate it or now. * recursively invalidate it or now.
* *
* Returns: %TRUE to invalidate @window recursively * Returns: %TRUE to invalidate @window recursively
*/ */
typedef gboolean (*GdkWindowChildFunc) (GdkWindow *window, typedef gboolean (*GdkSurfaceChildFunc) (GdkSurface *window,
gpointer user_data); gpointer user_data);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_invalidate_maybe_recurse (GdkWindow *window, void gdk_surface_invalidate_maybe_recurse (GdkSurface *window,
const cairo_region_t *region, const cairo_region_t *region,
GdkWindowChildFunc child_func, GdkSurfaceChildFunc child_func,
gpointer user_data); gpointer user_data);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
cairo_region_t *gdk_window_get_update_area (GdkWindow *window); cairo_region_t *gdk_surface_get_update_area (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_freeze_updates (GdkWindow *window); void gdk_surface_freeze_updates (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_thaw_updates (GdkWindow *window); void gdk_surface_thaw_updates (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_constrain_size (GdkGeometry *geometry, void gdk_surface_constrain_size (GdkGeometry *geometry,
GdkWindowHints flags, GdkSurfaceHints flags,
gint width, gint width,
gint height, gint height,
gint *new_width, gint *new_width,
@ -897,37 +897,37 @@ void gdk_window_constrain_size (GdkGeometry *geometry,
/* Multidevice support */ /* Multidevice support */
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_support_multidevice (GdkWindow *window, void gdk_surface_set_support_multidevice (GdkSurface *window,
gboolean support_multidevice); gboolean support_multidevice);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_window_get_support_multidevice (GdkWindow *window); gboolean gdk_surface_get_support_multidevice (GdkSurface *window);
/* Frame clock */ /* Frame clock */
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkFrameClock* gdk_window_get_frame_clock (GdkWindow *window); GdkFrameClock* gdk_surface_get_frame_clock (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_opaque_region (GdkWindow *window, void gdk_surface_set_opaque_region (GdkSurface *window,
cairo_region_t *region); cairo_region_t *region);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_window_set_shadow_width (GdkWindow *window, void gdk_surface_set_shadow_width (GdkSurface *window,
gint left, gint left,
gint right, gint right,
gint top, gint top,
gint bottom); gint bottom);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_window_show_window_menu (GdkWindow *window, gboolean gdk_surface_show_window_menu (GdkSurface *window,
GdkEvent *event); GdkEvent *event);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkGLContext * gdk_window_create_gl_context (GdkWindow *window, GdkGLContext * gdk_surface_create_gl_context (GdkSurface *window,
GError **error); GError **error);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkVulkanContext * GdkVulkanContext *
gdk_window_create_vulkan_context(GdkWindow *window, gdk_surface_create_vulkan_context(GdkSurface *window,
GError **error); GError **error);
G_END_DECLS G_END_DECLS
#endif /* __GDK_WINDOW_H__ */ #endif /* __GDK_SURFACE_H__ */

View File

@ -29,10 +29,10 @@
#include "gdkinternals.h" #include "gdkinternals.h"
G_DEFINE_TYPE (GdkWindowImpl, gdk_window_impl, G_TYPE_OBJECT); G_DEFINE_TYPE (GdkSurfaceImpl, gdk_surface_impl, G_TYPE_OBJECT);
static gboolean static gboolean
gdk_window_impl_beep (GdkWindow *window) gdk_surface_impl_beep (GdkSurface *window)
{ {
/* FALSE means windows can't beep, so the display will be /* FALSE means windows can't beep, so the display will be
* made to beep instead. */ * made to beep instead. */
@ -40,15 +40,15 @@ gdk_window_impl_beep (GdkWindow *window)
} }
static GdkDisplay * static GdkDisplay *
get_display_for_window (GdkWindow *primary, get_display_for_window (GdkSurface *primary,
GdkWindow *secondary) GdkSurface *secondary)
{ {
GdkDisplay *display = gdk_window_get_display (primary); GdkDisplay *display = gdk_surface_get_display (primary);
if (display) if (display)
return display; return display;
display = gdk_window_get_display (secondary); display = gdk_surface_get_display (secondary);
if (display) if (display)
return display; return display;
@ -173,21 +173,21 @@ maybe_flip_position (gint bounds_pos,
return primary; return primary;
} }
static GdkWindow * static GdkSurface *
traverse_to_toplevel (GdkWindow *window, traverse_to_toplevel (GdkSurface *window,
gint x, gint x,
gint y, gint y,
gint *toplevel_x, gint *toplevel_x,
gint *toplevel_y) gint *toplevel_y)
{ {
GdkWindow *parent; GdkSurface *parent;
gdouble xf = x; gdouble xf = x;
gdouble yf = y; gdouble yf = y;
while ((parent = window->parent) != NULL && while ((parent = window->parent) != NULL &&
(gdk_window_get_window_type (parent) != GDK_WINDOW_ROOT)) (gdk_surface_get_window_type (parent) != GDK_SURFACE_ROOT))
{ {
gdk_window_coords_to_parent (window, xf, yf, &xf, &yf); gdk_surface_coords_to_parent (window, xf, yf, &xf, &yf);
window = parent; window = parent;
} }
@ -197,7 +197,7 @@ traverse_to_toplevel (GdkWindow *window,
} }
static void static void
gdk_window_impl_move_to_rect (GdkWindow *window, gdk_surface_impl_move_to_rect (GdkSurface *window,
const GdkRectangle *rect, const GdkRectangle *rect,
GdkGravity rect_anchor, GdkGravity rect_anchor,
GdkGravity window_anchor, GdkGravity window_anchor,
@ -205,7 +205,7 @@ gdk_window_impl_move_to_rect (GdkWindow *window,
gint rect_anchor_dx, gint rect_anchor_dx,
gint rect_anchor_dy) gint rect_anchor_dy)
{ {
GdkWindow *transient_for_toplevel; GdkSurface *transient_for_toplevel;
GdkDisplay *display; GdkDisplay *display;
GdkMonitor *monitor; GdkMonitor *monitor;
GdkRectangle bounds; GdkRectangle bounds;
@ -226,7 +226,7 @@ gdk_window_impl_move_to_rect (GdkWindow *window,
&root_rect.x, &root_rect.x,
&root_rect.y); &root_rect.y);
gdk_window_get_root_coords (transient_for_toplevel, gdk_surface_get_root_coords (transient_for_toplevel,
root_rect.x, root_rect.x,
root_rect.y, root_rect.y,
&root_rect.x, &root_rect.x,
@ -314,9 +314,9 @@ gdk_window_impl_move_to_rect (GdkWindow *window,
final_rect.height += window->shadow_top + window->shadow_bottom; final_rect.height += window->shadow_top + window->shadow_bottom;
if (final_rect.width != window->width || final_rect.height != window->height) if (final_rect.width != window->width || final_rect.height != window->height)
gdk_window_move_resize (window, final_rect.x, final_rect.y, final_rect.width, final_rect.height); gdk_surface_move_resize (window, final_rect.x, final_rect.y, final_rect.width, final_rect.height);
else else
gdk_window_move (window, final_rect.x, final_rect.y); gdk_surface_move (window, final_rect.x, final_rect.y);
g_signal_emit_by_name (window, g_signal_emit_by_name (window,
"moved-to-rect", "moved-to-rect",
@ -327,21 +327,21 @@ gdk_window_impl_move_to_rect (GdkWindow *window,
} }
static void static void
gdk_window_impl_process_updates_recurse (GdkWindow *window, gdk_surface_impl_process_updates_recurse (GdkSurface *window,
cairo_region_t *region) cairo_region_t *region)
{ {
_gdk_window_process_updates_recurse (window, region); _gdk_surface_process_updates_recurse (window, region);
} }
static void static void
gdk_window_impl_class_init (GdkWindowImplClass *impl_class) gdk_surface_impl_class_init (GdkSurfaceImplClass *impl_class)
{ {
impl_class->beep = gdk_window_impl_beep; impl_class->beep = gdk_surface_impl_beep;
impl_class->move_to_rect = gdk_window_impl_move_to_rect; impl_class->move_to_rect = gdk_surface_impl_move_to_rect;
impl_class->process_updates_recurse = gdk_window_impl_process_updates_recurse; impl_class->process_updates_recurse = gdk_surface_impl_process_updates_recurse;
} }
static void static void
gdk_window_impl_init (GdkWindowImpl *impl) gdk_surface_impl_init (GdkSurfaceImpl *impl)
{ {
} }

View File

@ -22,58 +22,58 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/ */
#ifndef __GDK_WINDOW_IMPL_H__ #ifndef __GDK_SURFACE_IMPL_H__
#define __GDK_WINDOW_IMPL_H__ #define __GDK_SURFACE_IMPL_H__
#include <gdk/gdkwindow.h> #include <gdk/gdkwindow.h>
#include <gdk/gdkproperty.h> #include <gdk/gdkproperty.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GDK_TYPE_WINDOW_IMPL (gdk_window_impl_get_type ()) #define GDK_TYPE_SURFACE_IMPL (gdk_surface_impl_get_type ())
#define GDK_WINDOW_IMPL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL, GdkWindowImpl)) #define GDK_SURFACE_IMPL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL, GdkSurfaceImpl))
#define GDK_WINDOW_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL, GdkWindowImplClass)) #define GDK_SURFACE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL, GdkSurfaceImplClass))
#define GDK_IS_WINDOW_IMPL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL)) #define GDK_IS_SURFACE_IMPL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL))
#define GDK_IS_WINDOW_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL)) #define GDK_IS_SURFACE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL))
#define GDK_WINDOW_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL, GdkWindowImplClass)) #define GDK_SURFACE_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL, GdkSurfaceImplClass))
typedef struct _GdkWindowImpl GdkWindowImpl; typedef struct _GdkSurfaceImpl GdkSurfaceImpl;
typedef struct _GdkWindowImplClass GdkWindowImplClass; typedef struct _GdkSurfaceImplClass GdkSurfaceImplClass;
struct _GdkWindowImpl struct _GdkSurfaceImpl
{ {
GObject parent; GObject parent;
}; };
struct _GdkWindowImplClass struct _GdkSurfaceImplClass
{ {
GObjectClass parent_class; GObjectClass parent_class;
cairo_surface_t * cairo_surface_t *
(* ref_cairo_surface) (GdkWindow *window); (* ref_cairo_surface) (GdkSurface *window);
cairo_surface_t * cairo_surface_t *
(* create_similar_image_surface) (GdkWindow * window, (* create_similar_image_surface) (GdkSurface * window,
cairo_format_t format, cairo_format_t format,
int width, int width,
int height); int height);
void (* show) (GdkWindow *window, void (* show) (GdkSurface *window,
gboolean already_mapped); gboolean already_mapped);
void (* hide) (GdkWindow *window); void (* hide) (GdkSurface *window);
void (* withdraw) (GdkWindow *window); void (* withdraw) (GdkSurface *window);
void (* raise) (GdkWindow *window); void (* raise) (GdkSurface *window);
void (* lower) (GdkWindow *window); void (* lower) (GdkSurface *window);
void (* restack_toplevel) (GdkWindow *window, void (* restack_toplevel) (GdkSurface *window,
GdkWindow *sibling, GdkSurface *sibling,
gboolean above); gboolean above);
void (* move_resize) (GdkWindow *window, void (* move_resize) (GdkSurface *window,
gboolean with_move, gboolean with_move,
gint x, gint x,
gint y, gint y,
gint width, gint width,
gint height); gint height);
void (* move_to_rect) (GdkWindow *window, void (* move_to_rect) (GdkSurface *window,
const GdkRectangle *rect, const GdkRectangle *rect,
GdkGravity rect_anchor, GdkGravity rect_anchor,
GdkGravity window_anchor, GdkGravity window_anchor,
@ -81,33 +81,33 @@ struct _GdkWindowImplClass
gint rect_anchor_dx, gint rect_anchor_dx,
gint rect_anchor_dy); gint rect_anchor_dy);
GdkEventMask (* get_events) (GdkWindow *window); GdkEventMask (* get_events) (GdkSurface *window);
void (* set_events) (GdkWindow *window, void (* set_events) (GdkSurface *window,
GdkEventMask event_mask); GdkEventMask event_mask);
void (* get_geometry) (GdkWindow *window, void (* get_geometry) (GdkSurface *window,
gint *x, gint *x,
gint *y, gint *y,
gint *width, gint *width,
gint *height); gint *height);
void (* get_root_coords) (GdkWindow *window, void (* get_root_coords) (GdkSurface *window,
gint x, gint x,
gint y, gint y,
gint *root_x, gint *root_x,
gint *root_y); gint *root_y);
gboolean (* get_device_state) (GdkWindow *window, gboolean (* get_device_state) (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
gdouble *x, gdouble *x,
gdouble *y, gdouble *y,
GdkModifierType *mask); GdkModifierType *mask);
gboolean (* begin_paint) (GdkWindow *window); gboolean (* begin_paint) (GdkSurface *window);
void (* end_paint) (GdkWindow *window); void (* end_paint) (GdkSurface *window);
void (* shape_combine_region) (GdkWindow *window, void (* shape_combine_region) (GdkSurface *window,
const cairo_region_t *shape_region, const cairo_region_t *shape_region,
gint offset_x, gint offset_x,
gint offset_y); gint offset_y);
void (* input_shape_combine_region) (GdkWindow *window, void (* input_shape_combine_region) (GdkSurface *window,
const cairo_region_t *shape_region, const cairo_region_t *shape_region,
gint offset_x, gint offset_x,
gint offset_y); gint offset_y);
@ -116,10 +116,10 @@ struct _GdkWindowImplClass
* layer a chance to save the region for later use in avoiding duplicate * layer a chance to save the region for later use in avoiding duplicate
* exposes. * exposes.
*/ */
void (* queue_antiexpose) (GdkWindow *window, void (* queue_antiexpose) (GdkSurface *window,
cairo_region_t *update_area); cairo_region_t *update_area);
/* Called to do the windowing system specific part of gdk_window_destroy(), /* Called to do the windowing system specific part of gdk_surface_destroy(),
* *
* window: The window being destroyed * window: The window being destroyed
* recursing: If TRUE, then this is being called because a parent * recursing: If TRUE, then this is being called because a parent
@ -132,125 +132,125 @@ struct _GdkWindowImplClass
* windowing system calls should be made. (This may never happen * windowing system calls should be made. (This may never happen
* for some windowing systems.) * for some windowing systems.)
*/ */
void (* destroy) (GdkWindow *window, void (* destroy) (GdkSurface *window,
gboolean recursing, gboolean recursing,
gboolean foreign_destroy); gboolean foreign_destroy);
/* optional */ /* optional */
gboolean (* beep) (GdkWindow *window); gboolean (* beep) (GdkSurface *window);
void (* focus) (GdkWindow *window, void (* focus) (GdkSurface *window,
guint32 timestamp); guint32 timestamp);
void (* set_type_hint) (GdkWindow *window, void (* set_type_hint) (GdkSurface *window,
GdkWindowTypeHint hint); GdkSurfaceTypeHint hint);
GdkWindowTypeHint (* get_type_hint) (GdkWindow *window); GdkSurfaceTypeHint (* get_type_hint) (GdkSurface *window);
void (* set_modal_hint) (GdkWindow *window, void (* set_modal_hint) (GdkSurface *window,
gboolean modal); gboolean modal);
void (* set_skip_taskbar_hint) (GdkWindow *window, void (* set_skip_taskbar_hint) (GdkSurface *window,
gboolean skips_taskbar); gboolean skips_taskbar);
void (* set_skip_pager_hint) (GdkWindow *window, void (* set_skip_pager_hint) (GdkSurface *window,
gboolean skips_pager); gboolean skips_pager);
void (* set_urgency_hint) (GdkWindow *window, void (* set_urgency_hint) (GdkSurface *window,
gboolean urgent); gboolean urgent);
void (* set_geometry_hints) (GdkWindow *window, void (* set_geometry_hints) (GdkSurface *window,
const GdkGeometry *geometry, const GdkGeometry *geometry,
GdkWindowHints geom_mask); GdkSurfaceHints geom_mask);
void (* set_title) (GdkWindow *window, void (* set_title) (GdkSurface *window,
const gchar *title); const gchar *title);
void (* set_role) (GdkWindow *window, void (* set_role) (GdkSurface *window,
const gchar *role); const gchar *role);
void (* set_startup_id) (GdkWindow *window, void (* set_startup_id) (GdkSurface *window,
const gchar *startup_id); const gchar *startup_id);
void (* set_transient_for) (GdkWindow *window, void (* set_transient_for) (GdkSurface *window,
GdkWindow *parent); GdkSurface *parent);
void (* get_frame_extents) (GdkWindow *window, void (* get_frame_extents) (GdkSurface *window,
GdkRectangle *rect); GdkRectangle *rect);
void (* set_accept_focus) (GdkWindow *window, void (* set_accept_focus) (GdkSurface *window,
gboolean accept_focus); gboolean accept_focus);
void (* set_focus_on_map) (GdkWindow *window, void (* set_focus_on_map) (GdkSurface *window,
gboolean focus_on_map); gboolean focus_on_map);
void (* set_icon_list) (GdkWindow *window, void (* set_icon_list) (GdkSurface *window,
GList *pixbufs); GList *pixbufs);
void (* set_icon_name) (GdkWindow *window, void (* set_icon_name) (GdkSurface *window,
const gchar *name); const gchar *name);
void (* iconify) (GdkWindow *window); void (* iconify) (GdkSurface *window);
void (* deiconify) (GdkWindow *window); void (* deiconify) (GdkSurface *window);
void (* stick) (GdkWindow *window); void (* stick) (GdkSurface *window);
void (* unstick) (GdkWindow *window); void (* unstick) (GdkSurface *window);
void (* maximize) (GdkWindow *window); void (* maximize) (GdkSurface *window);
void (* unmaximize) (GdkWindow *window); void (* unmaximize) (GdkSurface *window);
void (* fullscreen) (GdkWindow *window); void (* fullscreen) (GdkSurface *window);
void (* fullscreen_on_monitor) (GdkWindow *window, void (* fullscreen_on_monitor) (GdkSurface *window,
GdkMonitor *monitor); GdkMonitor *monitor);
void (* apply_fullscreen_mode) (GdkWindow *window); void (* apply_fullscreen_mode) (GdkSurface *window);
void (* unfullscreen) (GdkWindow *window); void (* unfullscreen) (GdkSurface *window);
void (* set_keep_above) (GdkWindow *window, void (* set_keep_above) (GdkSurface *window,
gboolean setting); gboolean setting);
void (* set_keep_below) (GdkWindow *window, void (* set_keep_below) (GdkSurface *window,
gboolean setting); gboolean setting);
GdkWindow * (* get_group) (GdkWindow *window); GdkSurface * (* get_group) (GdkSurface *window);
void (* set_group) (GdkWindow *window, void (* set_group) (GdkSurface *window,
GdkWindow *leader); GdkSurface *leader);
void (* set_decorations) (GdkWindow *window, void (* set_decorations) (GdkSurface *window,
GdkWMDecoration decorations); GdkWMDecoration decorations);
gboolean (* get_decorations) (GdkWindow *window, gboolean (* get_decorations) (GdkSurface *window,
GdkWMDecoration *decorations); GdkWMDecoration *decorations);
void (* set_functions) (GdkWindow *window, void (* set_functions) (GdkSurface *window,
GdkWMFunction functions); GdkWMFunction functions);
void (* begin_resize_drag) (GdkWindow *window, void (* begin_resize_drag) (GdkSurface *window,
GdkWindowEdge edge, GdkSurfaceEdge edge,
GdkDevice *device, GdkDevice *device,
gint button, gint button,
gint root_x, gint root_x,
gint root_y, gint root_y,
guint32 timestamp); guint32 timestamp);
void (* begin_move_drag) (GdkWindow *window, void (* begin_move_drag) (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
gint button, gint button,
gint root_x, gint root_x,
gint root_y, gint root_y,
guint32 timestamp); guint32 timestamp);
void (* enable_synchronized_configure) (GdkWindow *window); void (* enable_synchronized_configure) (GdkSurface *window);
void (* configure_finished) (GdkWindow *window); void (* configure_finished) (GdkSurface *window);
void (* set_opacity) (GdkWindow *window, void (* set_opacity) (GdkSurface *window,
gdouble opacity); gdouble opacity);
void (* destroy_notify) (GdkWindow *window); void (* destroy_notify) (GdkSurface *window);
void (* register_dnd) (GdkWindow *window); void (* register_dnd) (GdkSurface *window);
GdkDragContext * (*drag_begin) (GdkWindow *window, GdkDragContext * (*drag_begin) (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
GdkContentProvider*content, GdkContentProvider*content,
GdkDragAction actions, GdkDragAction actions,
gint dx, gint dx,
gint dy); gint dy);
void (*process_updates_recurse) (GdkWindow *window, void (*process_updates_recurse) (GdkSurface *window,
cairo_region_t *region); cairo_region_t *region);
gint (* get_scale_factor) (GdkWindow *window); gint (* get_scale_factor) (GdkSurface *window);
void (* get_unscaled_size) (GdkWindow *window, void (* get_unscaled_size) (GdkSurface *window,
int *unscaled_width, int *unscaled_width,
int *unscaled_height); int *unscaled_height);
void (* set_opaque_region) (GdkWindow *window, void (* set_opaque_region) (GdkSurface *window,
cairo_region_t *region); cairo_region_t *region);
void (* set_shadow_width) (GdkWindow *window, void (* set_shadow_width) (GdkSurface *window,
gint left, gint left,
gint right, gint right,
gint top, gint top,
gint bottom); gint bottom);
gboolean (* show_window_menu) (GdkWindow *window, gboolean (* show_window_menu) (GdkSurface *window,
GdkEvent *event); GdkEvent *event);
GdkGLContext *(*create_gl_context) (GdkWindow *window, GdkGLContext *(*create_gl_context) (GdkSurface *window,
gboolean attached, gboolean attached,
GdkGLContext *share, GdkGLContext *share,
GError **error); GError **error);
gboolean (* supports_edge_constraints)(GdkWindow *window); gboolean (* supports_edge_constraints)(GdkSurface *window);
}; };
/* Interface Functions */ /* Interface Functions */
GType gdk_window_impl_get_type (void) G_GNUC_CONST; GType gdk_surface_impl_get_type (void) G_GNUC_CONST;
G_END_DECLS G_END_DECLS
#endif /* __GDK_WINDOW_IMPL_H__ */ #endif /* __GDK_SURFACE_IMPL_H__ */

View File

@ -1,4 +1,4 @@
/* GdkQuartzWindow.m /* GdkQuartzSurface.m
* *
* Copyright (C) 2005-2007 Imendio AB * Copyright (C) 2005-2007 Imendio AB
* *
@ -34,7 +34,7 @@
-(BOOL)windowShouldClose:(id)sender -(BOOL)windowShouldClose:(id)sender
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
GdkEvent *event; GdkEvent *event;
event = gdk_event_new (GDK_DELETE); event = gdk_event_new (GDK_DELETE);
@ -49,47 +49,47 @@
-(void)windowWillMiniaturize:(NSNotification *)aNotification -(void)windowWillMiniaturize:(NSNotification *)aNotification
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
_gdk_quartz_window_detach_from_parent (window); _gdk_quartz_surface_detach_from_parent (window);
} }
-(void)windowDidMiniaturize:(NSNotification *)aNotification -(void)windowDidMiniaturize:(NSNotification *)aNotification
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
gdk_synthesize_window_state (window, 0, gdk_synthesize_window_state (window, 0,
GDK_WINDOW_STATE_ICONIFIED); GDK_SURFACE_STATE_ICONIFIED);
} }
-(void)windowDidDeminiaturize:(NSNotification *)aNotification -(void)windowDidDeminiaturize:(NSNotification *)aNotification
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
_gdk_quartz_window_attach_to_parent (window); _gdk_quartz_surface_attach_to_parent (window);
gdk_synthesize_window_state (window, GDK_WINDOW_STATE_ICONIFIED, 0); gdk_synthesize_window_state (window, GDK_SURFACE_STATE_ICONIFIED, 0);
} }
-(void)windowDidBecomeKey:(NSNotification *)aNotification -(void)windowDidBecomeKey:(NSNotification *)aNotification
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FOCUSED); gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_FOCUSED);
_gdk_quartz_events_update_focus_window (window, TRUE); _gdk_quartz_events_update_focus_window (window, TRUE);
} }
-(void)windowDidResignKey:(NSNotification *)aNotification -(void)windowDidResignKey:(NSNotification *)aNotification
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
_gdk_quartz_events_update_focus_window (window, FALSE); _gdk_quartz_events_update_focus_window (window, FALSE);
gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FOCUSED, 0); gdk_synthesize_window_state (window, GDK_SURFACE_STATE_FOCUSED, 0);
} }
-(void)windowDidBecomeMain:(NSNotification *)aNotification -(void)windowDidBecomeMain:(NSNotification *)aNotification
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
if (![self isVisible]) if (![self isVisible])
{ {
@ -101,15 +101,15 @@
return; return;
} }
_gdk_quartz_window_did_become_main (window); _gdk_quartz_surface_did_become_main (window);
} }
-(void)windowDidResignMain:(NSNotification *)aNotification -(void)windowDidResignMain:(NSNotification *)aNotification
{ {
GdkWindow *window; GdkSurface *window;
window = [[self contentView] gdkWindow]; window = [[self contentView] gdkWindow];
_gdk_quartz_window_did_resign_main (window); _gdk_quartz_surface_did_resign_main (window);
} }
/* Used in combination with NSLeftMouseUp in sendEvent to keep track /* Used in combination with NSLeftMouseUp in sendEvent to keep track
@ -154,8 +154,8 @@
-(void)checkSendEnterNotify -(void)checkSendEnterNotify
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
/* When a new window has been created, and the mouse /* When a new window has been created, and the mouse
* is in the window area, we will not receive an NSMouseEntered * is in the window area, we will not receive an NSMouseEntered
@ -186,21 +186,21 @@
-(void)windowDidMove:(NSNotification *)aNotification -(void)windowDidMove:(NSNotification *)aNotification
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
GdkEvent *event; GdkEvent *event;
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
gboolean maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED; gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED;
/* In case the window is changed when maximized remove the maximized state */ /* In case the window is changed when maximized remove the maximized state */
if (maximized && !inMaximizeTransition && !NSEqualRects (lastMaximizedFrame, [self frame])) if (maximized && !inMaximizeTransition && !NSEqualRects (lastMaximizedFrame, [self frame]))
{ {
gdk_synthesize_window_state (window, gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_MAXIMIZED, GDK_SURFACE_STATE_MAXIMIZED,
0); 0);
} }
_gdk_quartz_window_update_position (window); _gdk_quartz_surface_update_position (window);
/* Synthesize a configure event */ /* Synthesize a configure event */
event = gdk_event_new (GDK_CONFIGURE); event = gdk_event_new (GDK_CONFIGURE);
@ -218,16 +218,16 @@
-(void)windowDidResize:(NSNotification *)aNotification -(void)windowDidResize:(NSNotification *)aNotification
{ {
NSRect content_rect = [self contentRectForFrameRect:[self frame]]; NSRect content_rect = [self contentRectForFrameRect:[self frame]];
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
GdkEvent *event; GdkEvent *event;
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
gboolean maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED; gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED;
/* see same in windowDidMove */ /* see same in windowDidMove */
if (maximized && !inMaximizeTransition && !NSEqualRects (lastMaximizedFrame, [self frame])) if (maximized && !inMaximizeTransition && !NSEqualRects (lastMaximizedFrame, [self frame]))
{ {
gdk_synthesize_window_state (window, gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_MAXIMIZED, GDK_SURFACE_STATE_MAXIMIZED,
0); 0);
} }
@ -237,11 +237,11 @@
/* Certain resize operations (e.g. going fullscreen), also move the /* Certain resize operations (e.g. going fullscreen), also move the
* origin of the window. * origin of the window.
*/ */
_gdk_quartz_window_update_position (window); _gdk_quartz_surface_update_position (window);
[[self contentView] setFrame:NSMakeRect (0, 0, window->width, window->height)]; [[self contentView] setFrame:NSMakeRect (0, 0, window->width, window->height)];
_gdk_window_update_size (window); _gdk_surface_update_size (window);
/* Synthesize a configure event */ /* Synthesize a configure event */
event = gdk_event_new (GDK_CONFIGURE); event = gdk_event_new (GDK_CONFIGURE);
@ -273,27 +273,27 @@
-(BOOL)canBecomeMainWindow -(BOOL)canBecomeMainWindow
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
switch (impl->type_hint) switch (impl->type_hint)
{ {
case GDK_WINDOW_TYPE_HINT_NORMAL: case GDK_SURFACE_TYPE_HINT_NORMAL:
case GDK_WINDOW_TYPE_HINT_DIALOG: case GDK_SURFACE_TYPE_HINT_DIALOG:
return YES; return YES;
case GDK_WINDOW_TYPE_HINT_MENU: case GDK_SURFACE_TYPE_HINT_MENU:
case GDK_WINDOW_TYPE_HINT_TOOLBAR: case GDK_SURFACE_TYPE_HINT_TOOLBAR:
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN:
case GDK_WINDOW_TYPE_HINT_UTILITY: case GDK_SURFACE_TYPE_HINT_UTILITY:
case GDK_WINDOW_TYPE_HINT_DOCK: case GDK_SURFACE_TYPE_HINT_DOCK:
case GDK_WINDOW_TYPE_HINT_DESKTOP: case GDK_SURFACE_TYPE_HINT_DESKTOP:
case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: case GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU:
case GDK_WINDOW_TYPE_HINT_POPUP_MENU: case GDK_SURFACE_TYPE_HINT_POPUP_MENU:
case GDK_WINDOW_TYPE_HINT_TOOLTIP: case GDK_SURFACE_TYPE_HINT_TOOLTIP:
case GDK_WINDOW_TYPE_HINT_NOTIFICATION: case GDK_SURFACE_TYPE_HINT_NOTIFICATION:
case GDK_WINDOW_TYPE_HINT_COMBO: case GDK_SURFACE_TYPE_HINT_COMBO:
case GDK_WINDOW_TYPE_HINT_DND: case GDK_SURFACE_TYPE_HINT_DND:
return NO; return NO;
} }
@ -302,8 +302,8 @@
-(BOOL)canBecomeKeyWindow -(BOOL)canBecomeKeyWindow
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (!window->accept_focus) if (!window->accept_focus)
return NO; return NO;
@ -311,27 +311,27 @@
/* Popup windows should not be able to get focused in the window /* Popup windows should not be able to get focused in the window
* manager sense, it's only handled through grabs. * manager sense, it's only handled through grabs.
*/ */
if (window->window_type == GDK_WINDOW_TEMP) if (window->window_type == GDK_SURFACE_TEMP)
return NO; return NO;
switch (impl->type_hint) switch (impl->type_hint)
{ {
case GDK_WINDOW_TYPE_HINT_NORMAL: case GDK_SURFACE_TYPE_HINT_NORMAL:
case GDK_WINDOW_TYPE_HINT_DIALOG: case GDK_SURFACE_TYPE_HINT_DIALOG:
case GDK_WINDOW_TYPE_HINT_MENU: case GDK_SURFACE_TYPE_HINT_MENU:
case GDK_WINDOW_TYPE_HINT_TOOLBAR: case GDK_SURFACE_TYPE_HINT_TOOLBAR:
case GDK_WINDOW_TYPE_HINT_UTILITY: case GDK_SURFACE_TYPE_HINT_UTILITY:
case GDK_WINDOW_TYPE_HINT_DOCK: case GDK_SURFACE_TYPE_HINT_DOCK:
case GDK_WINDOW_TYPE_HINT_DESKTOP: case GDK_SURFACE_TYPE_HINT_DESKTOP:
case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: case GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU:
case GDK_WINDOW_TYPE_HINT_POPUP_MENU: case GDK_SURFACE_TYPE_HINT_POPUP_MENU:
case GDK_WINDOW_TYPE_HINT_COMBO: case GDK_SURFACE_TYPE_HINT_COMBO:
return YES; return YES;
case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN:
case GDK_WINDOW_TYPE_HINT_TOOLTIP: case GDK_SURFACE_TYPE_HINT_TOOLTIP:
case GDK_WINDOW_TYPE_HINT_NOTIFICATION: case GDK_SURFACE_TYPE_HINT_NOTIFICATION:
case GDK_WINDOW_TYPE_HINT_DND: case GDK_SURFACE_TYPE_HINT_DND:
return NO; return NO;
} }
@ -340,8 +340,8 @@
- (void)showAndMakeKey:(BOOL)makeKey - (void)showAndMakeKey:(BOOL)makeKey
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
inShowOrHide = YES; inShowOrHide = YES;
@ -357,8 +357,8 @@
- (void)hide - (void)hide
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
inShowOrHide = YES; inShowOrHide = YES;
[impl->toplevel orderOut:nil]; [impl->toplevel orderOut:nil];
@ -369,8 +369,8 @@
- (BOOL)trackManualMove - (BOOL)trackManualMove
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
NSPoint currentLocation; NSPoint currentLocation;
NSPoint newOrigin; NSPoint newOrigin;
NSRect screenFrame = [[NSScreen mainScreen] visibleFrame]; NSRect screenFrame = [[NSScreen mainScreen] visibleFrame];
@ -435,28 +435,28 @@
* height and position. * height and position.
*/ */
dw = dh = dx = dy = 0.0; dw = dh = dx = dy = 0.0;
if (resizeEdge == GDK_WINDOW_EDGE_EAST || if (resizeEdge == GDK_SURFACE_EDGE_EAST ||
resizeEdge == GDK_WINDOW_EDGE_NORTH_EAST || resizeEdge == GDK_SURFACE_EDGE_NORTH_EAST ||
resizeEdge == GDK_WINDOW_EDGE_SOUTH_EAST) resizeEdge == GDK_SURFACE_EDGE_SOUTH_EAST)
{ {
dw = -1.0; dw = -1.0;
} }
if (resizeEdge == GDK_WINDOW_EDGE_NORTH || if (resizeEdge == GDK_SURFACE_EDGE_NORTH ||
resizeEdge == GDK_WINDOW_EDGE_NORTH_WEST || resizeEdge == GDK_SURFACE_EDGE_NORTH_WEST ||
resizeEdge == GDK_WINDOW_EDGE_NORTH_EAST) resizeEdge == GDK_SURFACE_EDGE_NORTH_EAST)
{ {
dh = -1.0; dh = -1.0;
} }
if (resizeEdge == GDK_WINDOW_EDGE_SOUTH || if (resizeEdge == GDK_SURFACE_EDGE_SOUTH ||
resizeEdge == GDK_WINDOW_EDGE_SOUTH_WEST || resizeEdge == GDK_SURFACE_EDGE_SOUTH_WEST ||
resizeEdge == GDK_WINDOW_EDGE_SOUTH_EAST) resizeEdge == GDK_SURFACE_EDGE_SOUTH_EAST)
{ {
dh = 1.0; dh = 1.0;
dy = -1.0; dy = -1.0;
} }
if (resizeEdge == GDK_WINDOW_EDGE_WEST || if (resizeEdge == GDK_SURFACE_EDGE_WEST ||
resizeEdge == GDK_WINDOW_EDGE_NORTH_WEST || resizeEdge == GDK_SURFACE_EDGE_NORTH_WEST ||
resizeEdge == GDK_WINDOW_EDGE_SOUTH_WEST) resizeEdge == GDK_SURFACE_EDGE_SOUTH_WEST)
{ {
dw = 1.0; dw = 1.0;
dx = -1.0; dx = -1.0;
@ -503,7 +503,7 @@
return YES; return YES;
} }
-(void)beginManualResize:(GdkWindowEdge)edge -(void)beginManualResize:(GdkSurfaceEdge)edge
{ {
if (inMove || inManualMove || inManualResize) if (inMove || inManualMove || inManualResize)
return; return;
@ -579,7 +579,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{ {
GdkEvent *event; GdkEvent *event;
GdkWindow *window; GdkSurface *window;
if (current_context) if (current_context)
g_object_unref (current_context); g_object_unref (current_context);
@ -589,7 +589,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
window = [[self contentView] gdkWindow]; window = [[self contentView] gdkWindow];
current_context->display = gdk_window_get_display (window); current_context->display = gdk_surface_get_display (window);
gdk_drag_context_set_device (current_context, gdk_drag_context_set_device (current_context,
gdk_seat_get_pointer (gdk_display_get_default_seat (current_context->display))); gdk_seat_get_pointer (gdk_display_get_default_seat (current_context->display)));
@ -650,7 +650,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
int gx, gy; int gx, gy;
update_context_from_dragging_info (sender); update_context_from_dragging_info (sender);
_gdk_quartz_window_nspoint_to_gdk_xy (screen_point, &gx, &gy); _gdk_quartz_surface_nspoint_to_gdk_xy (screen_point, &gx, &gy);
event = gdk_event_new (GDK_DRAG_MOTION); event = gdk_event_new (GDK_DRAG_MOTION);
event->dnd.window = g_object_ref ([[self contentView] gdkWindow]); event->dnd.window = g_object_ref ([[self contentView] gdkWindow]);
@ -678,7 +678,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
int gy, gx; int gy, gx;
update_context_from_dragging_info (sender); update_context_from_dragging_info (sender);
_gdk_quartz_window_nspoint_to_gdk_xy (screen_point, &gx, &gy); _gdk_quartz_surface_nspoint_to_gdk_xy (screen_point, &gx, &gy);
event = gdk_event_new (GDK_DROP_START); event = gdk_event_new (GDK_DROP_START);
event->dnd.window = g_object_ref ([[self contentView] gdkWindow]); event->dnd.window = g_object_ref ([[self contentView] gdkWindow]);
@ -719,7 +719,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
event->dnd.send_event = FALSE; event->dnd.send_event = FALSE;
event->dnd.context = g_object_ref (_gdk_quartz_drag_source_context); event->dnd.context = g_object_ref (_gdk_quartz_drag_source_context);
display = gdk_window_get_display (event->dnd.window); display = gdk_surface_get_display (event->dnd.window);
if (display) if (display)
{ {
@ -729,17 +729,17 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
event->dnd.context->dest_window = NULL; event->dnd.context->dest_window = NULL;
windows = get_toplevels (); windows = get_toplevels ();
_gdk_quartz_window_nspoint_to_gdk_xy (aPoint, &gx, &gy); _gdk_quartz_surface_nspoint_to_gdk_xy (aPoint, &gx, &gy);
for (list = windows; list; list = list->next) for (list = windows; list; list = list->next)
{ {
GdkWindow* win = (GdkWindow*) list->data; GdkSurface* win = (GdkSurface*) list->data;
gint wx, wy; gint wx, wy;
gint ww, wh; gint ww, wh;
gdk_window_get_root_origin (win, &wx, &wy); gdk_surface_get_root_origin (win, &wx, &wy);
ww = gdk_window_get_width (win); ww = gdk_surface_get_width (win);
wh = gdk_window_get_height (win); wh = gdk_surface_get_height (win);
if (gx > wx && gy > wy && gx <= wx + ww && gy <= wy + wh) if (gx > wx && gy > wy && gx <= wx + ww && gy <= wy + wh)
event->dnd.context->dest_window = win; event->dnd.context->dest_window = win;
@ -772,7 +772,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
is_fullscreen = (([self styleMask] & NSFullScreenWindowMask) != 0); is_fullscreen = (([self styleMask] & NSFullScreenWindowMask) != 0);
if (was_fullscreen != is_fullscreen) if (was_fullscreen != is_fullscreen)
_gdk_quartz_window_update_fullscreen_state ([[self contentView] gdkWindow]); _gdk_quartz_surface_update_fullscreen_state ([[self contentView] gdkWindow]);
} }
#endif #endif
@ -780,8 +780,8 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
{ {
NSRect rect; NSRect rect;
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
/* Allow the window to move up "shadow_top" more than normally allowed /* Allow the window to move up "shadow_top" more than normally allowed
* by the default impl. This makes it possible to move windows with * by the default impl. This makes it possible to move windows with
@ -797,9 +797,9 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
defaultFrame:(NSRect)newFrame defaultFrame:(NSRect)newFrame
{ {
NSRect screenFrame = [[self screen] visibleFrame]; NSRect screenFrame = [[self screen] visibleFrame];
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
gboolean maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED; gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED;
if (!maximized) if (!maximized)
return screenFrame; return screenFrame;
@ -811,15 +811,15 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
toFrame:(NSRect)newFrame toFrame:(NSRect)newFrame
{ {
GdkWindow *window = [[self contentView] gdkWindow]; GdkSurface *window = [[self contentView] gdkWindow];
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
gboolean maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED; gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED;
if (maximized) if (maximized)
{ {
lastMaximizedFrame = newFrame; lastMaximizedFrame = newFrame;
gdk_synthesize_window_state (window, gdk_synthesize_window_state (window,
GDK_WINDOW_STATE_MAXIMIZED, GDK_SURFACE_STATE_MAXIMIZED,
0); 0);
} }
else else
@ -827,7 +827,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
lastUnmaximizedFrame = [nsWindow frame]; lastUnmaximizedFrame = [nsWindow frame];
gdk_synthesize_window_state (window, gdk_synthesize_window_state (window,
0, 0,
GDK_WINDOW_STATE_MAXIMIZED); GDK_SURFACE_STATE_MAXIMIZED);
} }
inMaximizeTransition = YES; inMaximizeTransition = YES;

View File

@ -33,7 +33,7 @@
NSPoint initialMoveLocation; NSPoint initialMoveLocation;
NSPoint initialResizeLocation; NSPoint initialResizeLocation;
NSRect initialResizeFrame; NSRect initialResizeFrame;
GdkWindowEdge resizeEdge; GdkSurfaceEdge resizeEdge;
NSRect lastUnmaximizedFrame; NSRect lastUnmaximizedFrame;
NSRect lastMaximizedFrame; NSRect lastMaximizedFrame;
@ -45,7 +45,7 @@
-(void)beginManualMove; -(void)beginManualMove;
-(BOOL)trackManualMove; -(BOOL)trackManualMove;
-(BOOL)isInManualResizeOrMove; -(BOOL)isInManualResizeOrMove;
-(void)beginManualResize:(GdkWindowEdge)edge; -(void)beginManualResize:(GdkSurfaceEdge)edge;
-(BOOL)trackManualResize; -(BOOL)trackManualResize;
-(void)showAndMakeKey:(BOOL)makeKey; -(void)showAndMakeKey:(BOOL)makeKey;
-(void)hide; -(void)hide;

View File

@ -76,10 +76,10 @@
gint ns_x, ns_y; gint ns_x, ns_y;
GdkRectangle *rect; GdkRectangle *rect;
rect = g_object_get_data (G_OBJECT (gdk_window), GIC_CURSOR_RECT); rect = g_object_get_data (G_OBJECT (gdk_surface), GIC_CURSOR_RECT);
if (rect) if (rect)
{ {
_gdk_quartz_window_gdk_xy_to_xy (rect->x, rect->y + rect->height, _gdk_quartz_surface_gdk_xy_to_xy (rect->x, rect->y + rect->height,
&ns_x, &ns_y); &ns_x, &ns_y);
return NSMakeRect (ns_x, ns_y, rect->width, rect->height); return NSMakeRect (ns_x, ns_y, rect->width, rect->height);
@ -126,7 +126,7 @@
gchar *prev_str; gchar *prev_str;
markedRange = selectedRange = NSMakeRange (NSNotFound, 0); markedRange = selectedRange = NSMakeRange (NSNotFound, 0);
g_object_set_data_full (G_OBJECT (gdk_window), TIC_MARKED_TEXT, NULL, g_free); g_object_set_data_full (G_OBJECT (gdk_surface), TIC_MARKED_TEXT, NULL, g_free);
} }
-(void)setMarkedText: (id)aString selectedRange: (NSRange)newSelection replacementRange: (NSRange)replacementRange -(void)setMarkedText: (id)aString selectedRange: (NSRange)newSelection replacementRange: (NSRange)replacementRange
@ -153,21 +153,21 @@
str = [aString UTF8String]; str = [aString UTF8String];
} }
g_object_set_data_full (G_OBJECT (gdk_window), TIC_MARKED_TEXT, g_strdup (str), g_free); g_object_set_data_full (G_OBJECT (gdk_surface), TIC_MARKED_TEXT, g_strdup (str), g_free);
g_object_set_data (G_OBJECT (gdk_window), TIC_SELECTED_POS, g_object_set_data (G_OBJECT (gdk_surface), TIC_SELECTED_POS,
GUINT_TO_POINTER (selectedRange.location)); GUINT_TO_POINTER (selectedRange.location));
g_object_set_data (G_OBJECT (gdk_window), TIC_SELECTED_LEN, g_object_set_data (G_OBJECT (gdk_surface), TIC_SELECTED_LEN,
GUINT_TO_POINTER (selectedRange.length)); GUINT_TO_POINTER (selectedRange.length));
GDK_NOTE (EVENTS, g_message ("setMarkedText: set %s (%p, nsview %p): %s", GDK_NOTE (EVENTS, g_message ("setMarkedText: set %s (%p, nsview %p): %s",
TIC_MARKED_TEXT, gdk_window, self, TIC_MARKED_TEXT, gdk_surface, self,
str ? str : "(empty)")); str ? str : "(empty)"));
/* handle text input changes by mouse events */ /* handle text input changes by mouse events */
if (!GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (gdk_window), if (!GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (gdk_surface),
TIC_IN_KEY_DOWN))) TIC_IN_KEY_DOWN)))
{ {
_gdk_quartz_synthesize_null_key_event(gdk_window); _gdk_quartz_synthesize_null_key_event(gdk_surface);
} }
} }
@ -209,326 +209,326 @@
str = [string UTF8String]; str = [string UTF8String];
} }
g_object_set_data_full (G_OBJECT (gdk_window), TIC_INSERT_TEXT, g_strdup (str), g_free); g_object_set_data_full (G_OBJECT (gdk_surface), TIC_INSERT_TEXT, g_strdup (str), g_free);
GDK_NOTE (EVENTS, g_message ("insertText: set %s (%p, nsview %p): %s", GDK_NOTE (EVENTS, g_message ("insertText: set %s (%p, nsview %p): %s",
TIC_INSERT_TEXT, gdk_window, self, TIC_INSERT_TEXT, gdk_surface, self,
str ? str : "(empty)")); str ? str : "(empty)"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_FILTERED)); GUINT_TO_POINTER (GIC_FILTER_FILTERED));
/* handle text input changes by mouse events */ /* handle text input changes by mouse events */
if (!GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (gdk_window), if (!GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (gdk_surface),
TIC_IN_KEY_DOWN))) TIC_IN_KEY_DOWN)))
{ {
_gdk_quartz_synthesize_null_key_event(gdk_window); _gdk_quartz_synthesize_null_key_event(gdk_surface);
} }
} }
-(void)deleteBackward: (id)sender -(void)deleteBackward: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("deleteBackward")); GDK_NOTE (EVENTS, g_message ("deleteBackward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)deleteForward: (id)sender -(void)deleteForward: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("deleteForward")); GDK_NOTE (EVENTS, g_message ("deleteForward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)deleteToBeginningOfLine: (id)sender -(void)deleteToBeginningOfLine: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("deleteToBeginningOfLine")); GDK_NOTE (EVENTS, g_message ("deleteToBeginningOfLine"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)deleteToEndOfLine: (id)sender -(void)deleteToEndOfLine: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("deleteToEndOfLine")); GDK_NOTE (EVENTS, g_message ("deleteToEndOfLine"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)deleteWordBackward: (id)sender -(void)deleteWordBackward: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("deleteWordBackward")); GDK_NOTE (EVENTS, g_message ("deleteWordBackward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)deleteWordForward: (id)sender -(void)deleteWordForward: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("deleteWordForward")); GDK_NOTE (EVENTS, g_message ("deleteWordForward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)insertBacktab: (id)sender -(void)insertBacktab: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("insertBacktab")); GDK_NOTE (EVENTS, g_message ("insertBacktab"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)insertNewline: (id)sender -(void)insertNewline: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("insertNewline")); GDK_NOTE (EVENTS, g_message ("insertNewline"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY, GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)insertTab: (id)sender -(void)insertTab: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("insertTab")); GDK_NOTE (EVENTS, g_message ("insertTab"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveBackward: (id)sender -(void)moveBackward: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveBackward")); GDK_NOTE (EVENTS, g_message ("moveBackward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveBackwardAndModifySelection: (id)sender -(void)moveBackwardAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveBackwardAndModifySelection")); GDK_NOTE (EVENTS, g_message ("moveBackwardAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveDown: (id)sender -(void)moveDown: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveDown")); GDK_NOTE (EVENTS, g_message ("moveDown"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveDownAndModifySelection: (id)sender -(void)moveDownAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveDownAndModifySelection")); GDK_NOTE (EVENTS, g_message ("moveDownAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveForward: (id)sender -(void)moveForward: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveForward")); GDK_NOTE (EVENTS, g_message ("moveForward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveForwardAndModifySelection: (id)sender -(void)moveForwardAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveForwardAndModifySelection")); GDK_NOTE (EVENTS, g_message ("moveForwardAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveLeft: (id)sender -(void)moveLeft: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveLeft")); GDK_NOTE (EVENTS, g_message ("moveLeft"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveLeftAndModifySelection: (id)sender -(void)moveLeftAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveLeftAndModifySelection")); GDK_NOTE (EVENTS, g_message ("moveLeftAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveRight: (id)sender -(void)moveRight: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveRight")); GDK_NOTE (EVENTS, g_message ("moveRight"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveRightAndModifySelection: (id)sender -(void)moveRightAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveRightAndModifySelection")); GDK_NOTE (EVENTS, g_message ("moveRightAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveToBeginningOfDocument: (id)sender -(void)moveToBeginningOfDocument: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfDocument")); GDK_NOTE (EVENTS, g_message ("moveToBeginningOfDocument"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveToBeginningOfDocumentAndModifySelection: (id)sender -(void)moveToBeginningOfDocumentAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfDocumentAndModifySelection")); GDK_NOTE (EVENTS, g_message ("moveToBeginningOfDocumentAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveToBeginningOfLine: (id)sender -(void)moveToBeginningOfLine: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfLine")); GDK_NOTE (EVENTS, g_message ("moveToBeginningOfLine"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveToBeginningOfLineAndModifySelection: (id)sender -(void)moveToBeginningOfLineAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfLineAndModifySelection")); GDK_NOTE (EVENTS, g_message ("moveToBeginningOfLineAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveToEndOfDocument: (id)sender -(void)moveToEndOfDocument: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveToEndOfDocument")); GDK_NOTE (EVENTS, g_message ("moveToEndOfDocument"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveToEndOfDocumentAndModifySelection: (id)sender -(void)moveToEndOfDocumentAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveToEndOfDocumentAndModifySelection")); GDK_NOTE (EVENTS, g_message ("moveToEndOfDocumentAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveToEndOfLine: (id)sender -(void)moveToEndOfLine: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveToEndOfLine")); GDK_NOTE (EVENTS, g_message ("moveToEndOfLine"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveToEndOfLineAndModifySelection: (id)sender -(void)moveToEndOfLineAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveToEndOfLineAndModifySelection")); GDK_NOTE (EVENTS, g_message ("moveToEndOfLineAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveUp: (id)sender -(void)moveUp: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveUp")); GDK_NOTE (EVENTS, g_message ("moveUp"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveUpAndModifySelection: (id)sender -(void)moveUpAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveUpAndModifySelection")); GDK_NOTE (EVENTS, g_message ("moveUpAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveWordBackward: (id)sender -(void)moveWordBackward: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveWordBackward")); GDK_NOTE (EVENTS, g_message ("moveWordBackward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveWordBackwardAndModifySelection: (id)sender -(void)moveWordBackwardAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveWordBackwardAndModifySelection")); GDK_NOTE (EVENTS, g_message ("moveWordBackwardAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveWordForward: (id)sender -(void)moveWordForward: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveWordForward")); GDK_NOTE (EVENTS, g_message ("moveWordForward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveWordForwardAndModifySelection: (id)sender -(void)moveWordForwardAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveWordForwardAndModifySelection")); GDK_NOTE (EVENTS, g_message ("moveWordForwardAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveWordLeft: (id)sender -(void)moveWordLeft: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveWordLeft")); GDK_NOTE (EVENTS, g_message ("moveWordLeft"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveWordLeftAndModifySelection: (id)sender -(void)moveWordLeftAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveWordLeftAndModifySelection")); GDK_NOTE (EVENTS, g_message ("moveWordLeftAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveWordRight: (id)sender -(void)moveWordRight: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveWordRight")); GDK_NOTE (EVENTS, g_message ("moveWordRight"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)moveWordRightAndModifySelection: (id)sender -(void)moveWordRightAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("moveWordRightAndModifySelection")); GDK_NOTE (EVENTS, g_message ("moveWordRightAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)pageDown: (id)sender -(void)pageDown: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("pageDown")); GDK_NOTE (EVENTS, g_message ("pageDown"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)pageDownAndModifySelection: (id)sender -(void)pageDownAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("pageDownAndModifySelection")); GDK_NOTE (EVENTS, g_message ("pageDownAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)pageUp: (id)sender -(void)pageUp: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("pageUp")); GDK_NOTE (EVENTS, g_message ("pageUp"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)pageUpAndModifySelection: (id)sender -(void)pageUpAndModifySelection: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("pageUpAndModifySelection")); GDK_NOTE (EVENTS, g_message ("pageUpAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)selectAll: (id)sender -(void)selectAll: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("selectAll")); GDK_NOTE (EVENTS, g_message ("selectAll"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)selectLine: (id)sender -(void)selectLine: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("selectLine")); GDK_NOTE (EVENTS, g_message ("selectLine"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
-(void)selectWord: (id)sender -(void)selectWord: (id)sender
{ {
GDK_NOTE (EVENTS, g_message ("selectWord")); GDK_NOTE (EVENTS, g_message ("selectWord"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, g_object_set_data (G_OBJECT (gdk_surface), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU)); GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
} }
@ -550,14 +550,14 @@
[super dealloc]; [super dealloc];
} }
-(void)setGdkWindow: (GdkWindow *)window -(void)setGdkSurface: (GdkSurface *)window
{ {
gdk_window = window; gdk_surface = window;
} }
-(GdkWindow *)gdkWindow -(GdkSurface *)gdkWindow
{ {
return gdk_window; return gdk_surface;
} }
-(NSTrackingRectTag)trackingRect -(NSTrackingRectTag)trackingRect
@ -572,7 +572,7 @@
-(BOOL)isOpaque -(BOOL)isOpaque
{ {
if (GDK_WINDOW_DESTROYED (gdk_window)) if (GDK_SURFACE_DESTROYED (gdk_surface))
return YES; return YES;
return NO; return NO;
@ -581,13 +581,13 @@
-(void)drawRect: (NSRect)rect -(void)drawRect: (NSRect)rect
{ {
GdkRectangle gdk_rect; GdkRectangle gdk_rect;
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (gdk_window->impl); GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (gdk_window->impl);
const NSRect *drawn_rects; const NSRect *drawn_rects;
NSInteger count; NSInteger count;
int i; int i;
cairo_region_t *region; cairo_region_t *region;
if (GDK_WINDOW_DESTROYED (gdk_window)) if (GDK_SURFACE_DESTROYED (gdk_surface))
return; return;
if (! (gdk_window->event_mask & GDK_EXPOSURE_MASK)) if (! (gdk_window->event_mask & GDK_EXPOSURE_MASK))
@ -596,7 +596,7 @@
if (NSEqualRects (rect, NSZeroRect)) if (NSEqualRects (rect, NSZeroRect))
return; return;
if (!GDK_WINDOW_IS_MAPPED (gdk_window)) if (!GDK_SURFACE_IS_MAPPED (gdk_surface))
{ {
/* If the window is not yet mapped, clip_region_with_children /* If the window is not yet mapped, clip_region_with_children
* will be empty causing the usual code below to draw nothing. * will be empty causing the usual code below to draw nothing.
@ -636,7 +636,7 @@
} }
impl->in_paint_rect_count++; impl->in_paint_rect_count++;
_gdk_window_process_updates_recurse (gdk_window, region); _gdk_surface_process_updates_recurse (gdk_surface, region);
impl->in_paint_rect_count--; impl->in_paint_rect_count--;
cairo_region_destroy (region); cairo_region_destroy (region);
@ -658,7 +658,7 @@
*/ */
-(void)updateTrackingRect -(void)updateTrackingRect
{ {
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (gdk_window->impl); GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (gdk_window->impl);
NSRect rect; NSRect rect;
if (!impl || !impl->toplevel) if (!impl || !impl->toplevel)

View File

@ -34,15 +34,15 @@
@interface GdkQuartzView : NSView <NSTextInputClient> @interface GdkQuartzView : NSView <NSTextInputClient>
{ {
GdkWindow *gdk_window; GdkSurface *gdk_surface;
NSTrackingRectTag trackingRect; NSTrackingRectTag trackingRect;
BOOL needsInvalidateShadow; BOOL needsInvalidateShadow;
NSRange markedRange; NSRange markedRange;
NSRange selectedRange; NSRange selectedRange;
} }
- (void)setGdkWindow: (GdkWindow *)window; - (void)setGdkSurface: (GdkSurface *)window;
- (GdkWindow *)gdkWindow; - (GdkSurface *)gdkWindow;
- (NSTrackingRectTag)trackingRect; - (NSTrackingRectTag)trackingRect;
- (void)setNeedsInvalidateShadow: (BOOL)invalidate; - (void)setNeedsInvalidateShadow: (BOOL)invalidate;

View File

@ -38,46 +38,46 @@ struct _GdkQuartzDeviceCoreClass
}; };
static gboolean gdk_quartz_device_core_get_history (GdkDevice *device, static gboolean gdk_quartz_device_core_get_history (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
guint32 start, guint32 start,
guint32 stop, guint32 stop,
GdkTimeCoord ***events, GdkTimeCoord ***events,
gint *n_events); gint *n_events);
static void gdk_quartz_device_core_get_state (GdkDevice *device, static void gdk_quartz_device_core_get_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gdouble *axes, gdouble *axes,
GdkModifierType *mask); GdkModifierType *mask);
static void gdk_quartz_device_core_set_window_cursor (GdkDevice *device, static void gdk_quartz_device_core_set_window_cursor (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkCursor *cursor); GdkCursor *cursor);
static void gdk_quartz_device_core_warp (GdkDevice *device, static void gdk_quartz_device_core_warp (GdkDevice *device,
gdouble x, gdouble x,
gdouble y); gdouble y);
static void gdk_quartz_device_core_query_state (GdkDevice *device, static void gdk_quartz_device_core_query_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkWindow **root_window, GdkSurface **root_window,
GdkWindow **child_window, GdkSurface **child_window,
gdouble *root_x, gdouble *root_x,
gdouble *root_y, gdouble *root_y,
gdouble *win_x, gdouble *win_x,
gdouble *win_y, gdouble *win_y,
GdkModifierType *mask); GdkModifierType *mask);
static GdkGrabStatus gdk_quartz_device_core_grab (GdkDevice *device, static GdkGrabStatus gdk_quartz_device_core_grab (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gboolean owner_events, gboolean owner_events,
GdkEventMask event_mask, GdkEventMask event_mask,
GdkWindow *confine_to, GdkSurface *confine_to,
GdkCursor *cursor, GdkCursor *cursor,
guint32 time_); guint32 time_);
static void gdk_quartz_device_core_ungrab (GdkDevice *device, static void gdk_quartz_device_core_ungrab (GdkDevice *device,
guint32 time_); guint32 time_);
static GdkWindow * gdk_quartz_device_core_window_at_position (GdkDevice *device, static GdkSurface * gdk_quartz_device_core_window_at_position (GdkDevice *device,
gdouble *win_x, gdouble *win_x,
gdouble *win_y, gdouble *win_y,
GdkModifierType *mask, GdkModifierType *mask,
gboolean get_toplevel); gboolean get_toplevel);
static void gdk_quartz_device_core_select_window_events (GdkDevice *device, static void gdk_quartz_device_core_select_window_events (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkEventMask event_mask); GdkEventMask event_mask);
@ -112,7 +112,7 @@ gdk_quartz_device_core_init (GdkQuartzDeviceCore *quartz_device_core)
static gboolean static gboolean
gdk_quartz_device_core_get_history (GdkDevice *device, gdk_quartz_device_core_get_history (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
guint32 start, guint32 start,
guint32 stop, guint32 stop,
GdkTimeCoord ***events, GdkTimeCoord ***events,
@ -123,13 +123,13 @@ gdk_quartz_device_core_get_history (GdkDevice *device,
static void static void
gdk_quartz_device_core_get_state (GdkDevice *device, gdk_quartz_device_core_get_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gdouble *axes, gdouble *axes,
GdkModifierType *mask) GdkModifierType *mask)
{ {
gdouble x_pos, y_pos; gdouble x_pos, y_pos;
gdk_window_get_device_position_double (window, device, &x_pos, &y_pos, mask); gdk_surface_get_device_position_double (window, device, &x_pos, &y_pos, mask);
if (axes) if (axes)
{ {
@ -139,12 +139,12 @@ gdk_quartz_device_core_get_state (GdkDevice *device,
} }
static void static void
translate_coords_to_child_coords (GdkWindow *parent, translate_coords_to_child_coords (GdkSurface *parent,
GdkWindow *child, GdkSurface *child,
gint *x, gint *x,
gint *y) gint *y)
{ {
GdkWindow *current = child; GdkSurface *current = child;
if (child == parent) if (child == parent)
return; return;
@ -153,23 +153,23 @@ translate_coords_to_child_coords (GdkWindow *parent,
{ {
gint tmp_x, tmp_y; gint tmp_x, tmp_y;
gdk_window_get_origin (current, &tmp_x, &tmp_y); gdk_surface_get_origin (current, &tmp_x, &tmp_y);
*x -= tmp_x; *x -= tmp_x;
*y -= tmp_y; *y -= tmp_y;
current = gdk_window_get_parent (current); current = gdk_surface_get_parent (current);
} }
} }
static void static void
gdk_quartz_device_core_set_window_cursor (GdkDevice *device, gdk_quartz_device_core_set_window_cursor (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkCursor *cursor) GdkCursor *cursor)
{ {
NSCursor *nscursor; NSCursor *nscursor;
if (GDK_WINDOW_DESTROYED (window)) if (GDK_SURFACE_DESTROYED (window))
return; return;
nscursor = _gdk_quartz_cursor_get_ns_cursor (cursor); nscursor = _gdk_quartz_cursor_get_ns_cursor (cursor);
@ -185,21 +185,21 @@ gdk_quartz_device_core_warp (GdkDevice *device,
CGDisplayMoveCursorToPoint (CGMainDisplayID (), CGPointMake (x, y)); CGDisplayMoveCursorToPoint (CGMainDisplayID (), CGPointMake (x, y));
} }
static GdkWindow * static GdkSurface *
gdk_quartz_device_core_query_state_helper (GdkWindow *window, gdk_quartz_device_core_query_state_helper (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
gdouble *x, gdouble *x,
gdouble *y, gdouble *y,
GdkModifierType *mask) GdkModifierType *mask)
{ {
GdkWindow *toplevel; GdkSurface *toplevel;
NSPoint point; NSPoint point;
gint x_tmp, y_tmp; gint x_tmp, y_tmp;
GdkWindow *found_window; GdkSurface *found_window;
g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), NULL); g_return_val_if_fail (window == NULL || GDK_IS_SURFACE (window), NULL);
if (GDK_WINDOW_DESTROYED (window)) if (GDK_SURFACE_DESTROYED (window))
{ {
*x = 0; *x = 0;
*y = 0; *y = 0;
@ -207,7 +207,7 @@ gdk_quartz_device_core_query_state_helper (GdkWindow *window,
return NULL; return NULL;
} }
toplevel = gdk_window_get_toplevel (window); toplevel = gdk_surface_get_toplevel (window);
if (mask) if (mask)
*mask = _gdk_quartz_events_get_current_keyboard_modifiers () | *mask = _gdk_quartz_events_get_current_keyboard_modifiers () |
@ -217,14 +217,14 @@ gdk_quartz_device_core_query_state_helper (GdkWindow *window,
if (window == _gdk_root) if (window == _gdk_root)
{ {
point = [NSEvent mouseLocation]; point = [NSEvent mouseLocation];
_gdk_quartz_window_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp); _gdk_quartz_surface_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp);
} }
else else
{ {
GdkWindowImplQuartz *impl; GdkSurfaceImplQuartz *impl;
NSWindow *nswindow; NSWindow *nswindow;
impl = GDK_WINDOW_IMPL_QUARTZ (toplevel->impl); impl = GDK_SURFACE_IMPL_QUARTZ (toplevel->impl);
nswindow = impl->toplevel; nswindow = impl->toplevel;
point = [nswindow mouseLocationOutsideOfEventStream]; point = [nswindow mouseLocationOutsideOfEventStream];
@ -235,7 +235,7 @@ gdk_quartz_device_core_query_state_helper (GdkWindow *window,
window = toplevel; window = toplevel;
} }
found_window = _gdk_quartz_window_find_child (window, x_tmp, y_tmp, found_window = _gdk_quartz_surface_find_child (window, x_tmp, y_tmp,
FALSE); FALSE);
if (found_window == _gdk_root) if (found_window == _gdk_root)
@ -255,15 +255,15 @@ gdk_quartz_device_core_query_state_helper (GdkWindow *window,
static void static void
gdk_quartz_device_core_query_state (GdkDevice *device, gdk_quartz_device_core_query_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkWindow **child_window, GdkSurface **child_window,
gdouble *root_x, gdouble *root_x,
gdouble *root_y, gdouble *root_y,
gdouble *win_x, gdouble *win_x,
gdouble *win_y, gdouble *win_y,
GdkModifierType *mask) GdkModifierType *mask)
{ {
GdkWindow *found_window; GdkSurface *found_window;
NSPoint point; NSPoint point;
gint x_tmp, y_tmp; gint x_tmp, y_tmp;
@ -281,7 +281,7 @@ gdk_quartz_device_core_query_state (GdkDevice *device,
*child_window = found_window; *child_window = found_window;
point = [NSEvent mouseLocation]; point = [NSEvent mouseLocation];
_gdk_quartz_window_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp); _gdk_quartz_surface_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp);
if (root_x) if (root_x)
*root_x = x_tmp; *root_x = x_tmp;
@ -292,10 +292,10 @@ gdk_quartz_device_core_query_state (GdkDevice *device,
static GdkGrabStatus static GdkGrabStatus
gdk_quartz_device_core_grab (GdkDevice *device, gdk_quartz_device_core_grab (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gboolean owner_events, gboolean owner_events,
GdkEventMask event_mask, GdkEventMask event_mask,
GdkWindow *confine_to, GdkSurface *confine_to,
GdkCursor *cursor, GdkCursor *cursor,
guint32 time_) guint32 time_)
{ {
@ -316,22 +316,22 @@ gdk_quartz_device_core_ungrab (GdkDevice *device,
_gdk_display_device_grab_update (_gdk_display, device, NULL, 0); _gdk_display_device_grab_update (_gdk_display, device, NULL, 0);
} }
static GdkWindow * static GdkSurface *
gdk_quartz_device_core_window_at_position (GdkDevice *device, gdk_quartz_device_core_window_at_position (GdkDevice *device,
gdouble *win_x, gdouble *win_x,
gdouble *win_y, gdouble *win_y,
GdkModifierType *mask, GdkModifierType *mask,
gboolean get_toplevel) gboolean get_toplevel)
{ {
GdkWindow *found_window; GdkSurface *found_window;
NSPoint point; NSPoint point;
gint x_tmp, y_tmp; gint x_tmp, y_tmp;
/* Get mouse coordinates, find window under the mouse pointer */ /* Get mouse coordinates, find window under the mouse pointer */
point = [NSEvent mouseLocation]; point = [NSEvent mouseLocation];
_gdk_quartz_window_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp); _gdk_quartz_surface_nspoint_to_gdk_xy (point, &x_tmp, &y_tmp);
found_window = _gdk_quartz_window_find_child (_gdk_root, x_tmp, y_tmp, get_toplevel); found_window = _gdk_quartz_surface_find_child (_gdk_root, x_tmp, y_tmp, get_toplevel);
if (found_window) if (found_window)
translate_coords_to_child_coords (_gdk_root, found_window, &x_tmp, &y_tmp); translate_coords_to_child_coords (_gdk_root, found_window, &x_tmp, &y_tmp);
@ -351,7 +351,7 @@ gdk_quartz_device_core_window_at_position (GdkDevice *device,
static void static void
gdk_quartz_device_core_select_window_events (GdkDevice *device, gdk_quartz_device_core_select_window_events (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkEventMask event_mask) GdkEventMask event_mask)
{ {
/* The mask is set in the common code. */ /* The mask is set in the common code. */

View File

@ -30,7 +30,7 @@
#include "gdkdisplay-quartz.h" #include "gdkdisplay-quartz.h"
static GdkWindow * static GdkSurface *
gdk_quartz_display_get_default_group (GdkDisplay *display) gdk_quartz_display_get_default_group (GdkDisplay *display)
{ {
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
@ -62,7 +62,7 @@ _gdk_quartz_display_open (const gchar *display_name)
_gdk_screen = g_object_new (gdk_quartz_screen_get_type (), NULL); _gdk_screen = g_object_new (gdk_quartz_screen_get_type (), NULL);
_gdk_quartz_window_init_windowing (_gdk_display); _gdk_quartz_surface_init_windowing (_gdk_display);
_gdk_quartz_events_init (); _gdk_quartz_events_init ();
@ -215,7 +215,7 @@ gdk_quartz_display_class_init (GdkQuartzDisplayClass *class)
object_class->finalize = gdk_quartz_display_finalize; object_class->finalize = gdk_quartz_display_finalize;
object_class->dispose = gdk_quartz_display_dispose; object_class->dispose = gdk_quartz_display_dispose;
display_class->window_type = GDK_TYPE_QUARTZ_WINDOW; display_class->window_type = GDK_TYPE_QUARTZ_SURFACE;
display_class->get_name = gdk_quartz_display_get_name; display_class->get_name = gdk_quartz_display_get_name;
display_class->beep = gdk_quartz_display_beep; display_class->beep = gdk_quartz_display_beep;

View File

@ -63,10 +63,10 @@ void _gdk_quartz_display_get_maximal_cursor_size (GdkDisplay *display,
void _gdk_quartz_display_before_process_all_updates (GdkDisplay *display); void _gdk_quartz_display_before_process_all_updates (GdkDisplay *display);
void _gdk_quartz_display_after_process_all_updates (GdkDisplay *display); void _gdk_quartz_display_after_process_all_updates (GdkDisplay *display);
void _gdk_quartz_display_create_window_impl (GdkDisplay *display, void _gdk_quartz_display_create_window_impl (GdkDisplay *display,
GdkWindow *window, GdkSurface *window,
GdkWindow *real_parent, GdkSurface *real_parent,
GdkEventMask event_mask, GdkEventMask event_mask,
GdkWindowAttr *attributes); GdkSurfaceAttr *attributes);
/* Display methods - keymap */ /* Display methods - keymap */
GdkKeymap * _gdk_quartz_display_get_keymap (GdkDisplay *display); GdkKeymap * _gdk_quartz_display_get_keymap (GdkDisplay *display);

View File

@ -34,7 +34,7 @@ gdk_quartz_drag_source_context_libgtk_only ()
} }
GdkDragContext * GdkDragContext *
_gdk_quartz_window_drag_begin (GdkWindow *window, _gdk_quartz_surface_drag_begin (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
GList *targets, GList *targets,
gint dx, gint dx,
@ -97,7 +97,7 @@ gdk_quartz_drag_context_drop_finish (GdkDragContext *context,
} }
void void
_gdk_quartz_window_register_dnd (GdkWindow *window) _gdk_quartz_surface_register_dnd (GdkSurface *window)
{ {
/* FIXME: Implement */ /* FIXME: Implement */
} }

View File

@ -39,16 +39,16 @@
#define GRIP_HEIGHT 15 #define GRIP_HEIGHT 15
#define GDK_LION_RESIZE 5 #define GDK_LION_RESIZE 5
#define WINDOW_IS_TOPLEVEL(window) (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD) #define WINDOW_IS_TOPLEVEL(window) (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD)
/* This is the window corresponding to the key window */ /* This is the window corresponding to the key window */
static GdkWindow *current_keyboard_window; static GdkSurface *current_keyboard_window;
static void append_event (GdkEvent *event, static void append_event (GdkEvent *event,
gboolean windowing); gboolean windowing);
static GdkWindow *find_toplevel_under_pointer (GdkDisplay *display, static GdkSurface *find_toplevel_under_pointer (GdkDisplay *display,
NSPoint screen_point, NSPoint screen_point,
gint *x, gint *x,
gint *y); gint *y);
@ -378,7 +378,7 @@ get_event_mask_from_ns_event (NSEvent *nsevent)
} }
static void static void
get_window_point_from_screen_point (GdkWindow *window, get_window_point_from_screen_point (GdkSurface *window,
NSPoint screen_point, NSPoint screen_point,
gint *x, gint *x,
gint *y) gint *y)
@ -386,7 +386,7 @@ get_window_point_from_screen_point (GdkWindow *window,
NSPoint point; NSPoint point;
NSWindow *nswindow; NSWindow *nswindow;
nswindow = ((GdkWindowImplQuartz *)window->impl)->toplevel; nswindow = ((GdkSurfaceImplQuartz *)window->impl)->toplevel;
point = [nswindow convertScreenToBase:screen_point]; point = [nswindow convertScreenToBase:screen_point];
@ -408,13 +408,13 @@ is_mouse_button_press_event (NSEventType type)
return FALSE; return FALSE;
} }
static GdkWindow * static GdkSurface *
get_toplevel_from_ns_event (NSEvent *nsevent, get_toplevel_from_ns_event (NSEvent *nsevent,
NSPoint *screen_point, NSPoint *screen_point,
gint *x, gint *x,
gint *y) gint *y)
{ {
GdkWindow *toplevel = NULL; GdkSurface *toplevel = NULL;
if ([nsevent window]) if ([nsevent window])
{ {
@ -488,7 +488,7 @@ get_toplevel_from_ns_event (NSEvent *nsevent,
} }
static GdkEvent * static GdkEvent *
create_focus_event (GdkWindow *window, create_focus_event (GdkSurface *window,
gboolean in) gboolean in)
{ {
GdkEvent *event; GdkEvent *event;
@ -507,7 +507,7 @@ create_focus_event (GdkWindow *window,
static void static void
generate_motion_event (GdkWindow *window) generate_motion_event (GdkSurface *window)
{ {
NSPoint screen_point; NSPoint screen_point;
GdkEvent *event; GdkEvent *event;
@ -520,7 +520,7 @@ generate_motion_event (GdkWindow *window)
screen_point = [NSEvent mouseLocation]; screen_point = [NSEvent mouseLocation];
_gdk_quartz_window_nspoint_to_gdk_xy (screen_point, &x_root, &y_root); _gdk_quartz_surface_nspoint_to_gdk_xy (screen_point, &x_root, &y_root);
get_window_point_from_screen_point (window, screen_point, &x, &y); get_window_point_from_screen_point (window, screen_point, &x, &y);
event->any.type = GDK_MOTION_NOTIFY; event->any.type = GDK_MOTION_NOTIFY;
@ -542,7 +542,7 @@ generate_motion_event (GdkWindow *window)
/* Note: Used to both set a new focus window and to unset the old one. */ /* Note: Used to both set a new focus window and to unset the old one. */
void void
_gdk_quartz_events_update_focus_window (GdkWindow *window, _gdk_quartz_events_update_focus_window (GdkSurface *window,
gboolean got_focus) gboolean got_focus)
{ {
GdkEvent *event; GdkEvent *event;
@ -586,9 +586,9 @@ _gdk_quartz_events_update_focus_window (GdkWindow *window,
} }
void void
_gdk_quartz_events_send_map_event (GdkWindow *window) _gdk_quartz_events_send_map_event (GdkSurface *window)
{ {
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (!impl->toplevel) if (!impl->toplevel)
return; return;
@ -604,14 +604,14 @@ _gdk_quartz_events_send_map_event (GdkWindow *window)
} }
} }
static GdkWindow * static GdkSurface *
find_toplevel_under_pointer (GdkDisplay *display, find_toplevel_under_pointer (GdkDisplay *display,
NSPoint screen_point, NSPoint screen_point,
gint *x, gint *x,
gint *y) gint *y)
{ {
GdkWindow *toplevel; GdkSurface *toplevel;
GdkPointerWindowInfo *info; GdkPointerSurfaceInfo *info;
info = _gdk_display_get_pointer_info (display, GDK_QUARTZ_DEVICE_MANAGER_CORE (_gdk_device_manager)->core_pointer); info = _gdk_display_get_pointer_info (display, GDK_QUARTZ_DEVICE_MANAGER_CORE (_gdk_device_manager)->core_pointer);
toplevel = info->toplevel_under_pointer; toplevel = info->toplevel_under_pointer;
@ -633,11 +633,11 @@ find_toplevel_under_pointer (GdkDisplay *display,
return toplevel; return toplevel;
} }
static GdkWindow * static GdkSurface *
find_toplevel_for_keyboard_event (NSEvent *nsevent) find_toplevel_for_keyboard_event (NSEvent *nsevent)
{ {
GList *devices = NULL, *l; GList *devices = NULL, *l;
GdkWindow *window; GdkSurface *window;
GdkDisplay *display; GdkDisplay *display;
GdkQuartzView *view; GdkQuartzView *view;
GdkSeat *seat; GdkSeat *seat;
@ -645,7 +645,7 @@ find_toplevel_for_keyboard_event (NSEvent *nsevent)
view = (GdkQuartzView *)[[nsevent window] contentView]; view = (GdkQuartzView *)[[nsevent window] contentView];
window = [view gdkWindow]; window = [view gdkWindow];
display = gdk_window_get_display (window); display = gdk_surface_get_display (window);
seat = gdk_display_get_default_seat (display); seat = gdk_display_get_default_seat (display);
@ -663,7 +663,7 @@ find_toplevel_for_keyboard_event (NSEvent *nsevent)
grab = _gdk_display_get_last_device_grab (display, device); grab = _gdk_display_get_last_device_grab (display, device);
if (grab && grab->window && !grab->owner_events) if (grab && grab->window && !grab->owner_events)
{ {
window = gdk_window_get_toplevel (grab->window); window = gdk_surface_get_toplevel (grab->window);
break; break;
} }
} }
@ -673,20 +673,20 @@ find_toplevel_for_keyboard_event (NSEvent *nsevent)
return window; return window;
} }
static GdkWindow * static GdkSurface *
find_toplevel_for_mouse_event (NSEvent *nsevent, find_toplevel_for_mouse_event (NSEvent *nsevent,
gint *x, gint *x,
gint *y) gint *y)
{ {
NSPoint screen_point; NSPoint screen_point;
NSEventType event_type; NSEventType event_type;
GdkWindow *toplevel; GdkSurface *toplevel;
GdkDisplay *display; GdkDisplay *display;
GdkDeviceGrabInfo *grab; GdkDeviceGrabInfo *grab;
toplevel = get_toplevel_from_ns_event (nsevent, &screen_point, x, y); toplevel = get_toplevel_from_ns_event (nsevent, &screen_point, x, y);
display = gdk_window_get_display (toplevel); display = gdk_surface_get_display (toplevel);
event_type = [nsevent type]; event_type = [nsevent type];
@ -717,7 +717,7 @@ find_toplevel_for_mouse_event (NSEvent *nsevent,
* reported with respect to the key window, which could be * reported with respect to the key window, which could be
* wrong. * wrong.
*/ */
GdkWindow *toplevel_under_pointer; GdkSurface *toplevel_under_pointer;
gint x_tmp, y_tmp; gint x_tmp, y_tmp;
toplevel_under_pointer = find_toplevel_under_pointer (display, toplevel_under_pointer = find_toplevel_under_pointer (display,
@ -735,9 +735,9 @@ find_toplevel_for_mouse_event (NSEvent *nsevent,
else else
{ {
/* Finally check the grab window. */ /* Finally check the grab window. */
GdkWindow *grab_toplevel; GdkSurface *grab_toplevel;
grab_toplevel = gdk_window_get_toplevel (grab->window); grab_toplevel = gdk_surface_get_toplevel (grab->window);
get_window_point_from_screen_point (grab_toplevel, screen_point, get_window_point_from_screen_point (grab_toplevel, screen_point,
x, y); x, y);
@ -749,7 +749,7 @@ find_toplevel_for_mouse_event (NSEvent *nsevent,
else else
{ {
/* The non-grabbed case. */ /* The non-grabbed case. */
GdkWindow *toplevel_under_pointer; GdkSurface *toplevel_under_pointer;
gint x_tmp, y_tmp; gint x_tmp, y_tmp;
/* Ignore all events but mouse moved that might be on the title /* Ignore all events but mouse moved that might be on the title
@ -770,11 +770,11 @@ find_toplevel_for_mouse_event (NSEvent *nsevent,
if (toplevel_under_pointer if (toplevel_under_pointer
&& WINDOW_IS_TOPLEVEL (toplevel_under_pointer)) && WINDOW_IS_TOPLEVEL (toplevel_under_pointer))
{ {
GdkWindowImplQuartz *toplevel_impl; GdkSurfaceImplQuartz *toplevel_impl;
toplevel = toplevel_under_pointer; toplevel = toplevel_under_pointer;
toplevel_impl = (GdkWindowImplQuartz *)toplevel->impl; toplevel_impl = (GdkSurfaceImplQuartz *)toplevel->impl;
*x = x_tmp; *x = x_tmp;
*y = y_tmp; *y = y_tmp;
@ -789,7 +789,7 @@ find_toplevel_for_mouse_event (NSEvent *nsevent,
/* This function finds the correct window to send an event to, taking /* This function finds the correct window to send an event to, taking
* into account grabs, event propagation, and event masks. * into account grabs, event propagation, and event masks.
*/ */
static GdkWindow * static GdkSurface *
find_window_for_ns_event (NSEvent *nsevent, find_window_for_ns_event (NSEvent *nsevent,
gint *x, gint *x,
gint *y, gint *y,
@ -797,7 +797,7 @@ find_window_for_ns_event (NSEvent *nsevent,
gint *y_root) gint *y_root)
{ {
GdkQuartzView *view; GdkQuartzView *view;
GdkWindow *toplevel; GdkSurface *toplevel;
NSPoint screen_point; NSPoint screen_point;
NSEventType event_type; NSEventType event_type;
@ -806,7 +806,7 @@ find_window_for_ns_event (NSEvent *nsevent,
toplevel = get_toplevel_from_ns_event (nsevent, &screen_point, x, y); toplevel = get_toplevel_from_ns_event (nsevent, &screen_point, x, y);
if (!toplevel) if (!toplevel)
return NULL; return NULL;
_gdk_quartz_window_nspoint_to_gdk_xy (screen_point, x_root, y_root); _gdk_quartz_surface_nspoint_to_gdk_xy (screen_point, x_root, y_root);
event_type = [nsevent type]; event_type = [nsevent type];
@ -851,7 +851,7 @@ find_window_for_ns_event (NSEvent *nsevent,
} }
static void static void
fill_crossing_event (GdkWindow *toplevel, fill_crossing_event (GdkSurface *toplevel,
GdkEvent *event, GdkEvent *event,
NSEvent *nsevent, NSEvent *nsevent,
gint x, gint x,
@ -899,7 +899,7 @@ fill_crossing_event (GdkWindow *toplevel,
*/ */
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER #ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER
static void static void
fill_pinch_event (GdkWindow *window, fill_pinch_event (GdkSurface *window,
GdkEvent *event, GdkEvent *event,
NSEvent *nsevent, NSEvent *nsevent,
gint x, gint x,
@ -996,7 +996,7 @@ fill_pinch_event (GdkWindow *window,
#endif /* OSX Version >= 10.8 */ #endif /* OSX Version >= 10.8 */
static void static void
fill_button_event (GdkWindow *window, fill_button_event (GdkSurface *window,
GdkEvent *event, GdkEvent *event,
NSEvent *nsevent, NSEvent *nsevent,
gint x, gint x,
@ -1047,7 +1047,7 @@ fill_button_event (GdkWindow *window,
} }
static void static void
fill_motion_event (GdkWindow *window, fill_motion_event (GdkSurface *window,
GdkEvent *event, GdkEvent *event,
NSEvent *nsevent, NSEvent *nsevent,
gint x, gint x,
@ -1073,7 +1073,7 @@ fill_motion_event (GdkWindow *window,
} }
static void static void
fill_scroll_event (GdkWindow *window, fill_scroll_event (GdkSurface *window,
GdkEvent *event, GdkEvent *event,
NSEvent *nsevent, NSEvent *nsevent,
gint x, gint x,
@ -1106,7 +1106,7 @@ fill_scroll_event (GdkWindow *window,
} }
static void static void
fill_key_event (GdkWindow *window, fill_key_event (GdkSurface *window,
GdkEvent *event, GdkEvent *event,
NSEvent *nsevent, NSEvent *nsevent,
GdkEventType type) GdkEventType type)
@ -1236,7 +1236,7 @@ fill_key_event (GdkWindow *window,
} }
static gboolean static gboolean
synthesize_crossing_event (GdkWindow *window, synthesize_crossing_event (GdkSurface *window,
GdkEvent *event, GdkEvent *event,
NSEvent *nsevent, NSEvent *nsevent,
gint x, gint x,
@ -1283,7 +1283,7 @@ synthesize_crossing_event (GdkWindow *window,
} }
void void
_gdk_quartz_synthesize_null_key_event (GdkWindow *window) _gdk_quartz_synthesize_null_key_event (GdkSurface *window)
{ {
GdkEvent *event; GdkEvent *event;
GdkQuartzDeviceManagerCore *device_manager; GdkQuartzDeviceManagerCore *device_manager;
@ -1344,15 +1344,15 @@ _gdk_quartz_events_get_current_mouse_modifiers (void)
/* Detect window resizing */ /* Detect window resizing */
static gboolean static gboolean
test_resize (NSEvent *event, GdkWindow *toplevel, gint x, gint y) test_resize (NSEvent *event, GdkSurface *toplevel, gint x, gint y)
{ {
GdkWindowImplQuartz *toplevel_impl; GdkSurfaceImplQuartz *toplevel_impl;
gboolean lion; gboolean lion;
/* Resizing from the resize indicator only begins if an NSLeftMouseButton /* Resizing from the resize indicator only begins if an NSLeftMouseButton
* event is received in the resizing area. * event is received in the resizing area.
*/ */
toplevel_impl = (GdkWindowImplQuartz *)toplevel->impl; toplevel_impl = (GdkSurfaceImplQuartz *)toplevel->impl;
if ([toplevel_impl->toplevel showsResizeIndicator]) if ([toplevel_impl->toplevel showsResizeIndicator])
if ([event type] == NSLeftMouseDown && if ([event type] == NSLeftMouseDown &&
[toplevel_impl->toplevel showsResizeIndicator]) [toplevel_impl->toplevel showsResizeIndicator])
@ -1388,7 +1388,7 @@ test_resize (NSEvent *event, GdkWindow *toplevel, gint x, gint y)
* do receive, for instance, a right mouse down event for a GDK window * do receive, for instance, a right mouse down event for a GDK window
* for x-coordinate range [-3, 0], but we do not want to forward this * for x-coordinate range [-3, 0], but we do not want to forward this
* into GDK. Forwarding such events into GDK will confuse the pointer * into GDK. Forwarding such events into GDK will confuse the pointer
* window finding code, because there are no GdkWindows present in * window finding code, because there are no GdkSurfaces present in
* the range [-3, 0]. * the range [-3, 0].
*/ */
lion = gdk_quartz_osx_version () >= GDK_OSX_LION; lion = gdk_quartz_osx_version () >= GDK_OSX_LION;
@ -1412,7 +1412,7 @@ gdk_event_translate (GdkEvent *event,
{ {
NSEventType event_type; NSEventType event_type;
NSWindow *nswindow; NSWindow *nswindow;
GdkWindow *window; GdkSurface *window;
int x, y; int x, y;
int x_root, y_root; int x_root, y_root;
gboolean return_val; gboolean return_val;
@ -1457,7 +1457,7 @@ gdk_event_translate (GdkEvent *event,
/* Ignore events for ones with no windows */ /* Ignore events for ones with no windows */
if (!nswindow) if (!nswindow)
{ {
GdkWindow *toplevel = NULL; GdkSurface *toplevel = NULL;
if (event_type == NSMouseMoved) if (event_type == NSMouseMoved)
{ {
@ -1505,7 +1505,7 @@ gdk_event_translate (GdkEvent *event,
return FALSE; return FALSE;
/* Apply any window filters. */ /* Apply any window filters. */
if (GDK_IS_WINDOW (window)) if (GDK_IS_SURFACE (window))
{ {
GdkFilterReturn result; GdkFilterReturn result;
@ -1534,7 +1534,7 @@ gdk_event_translate (GdkEvent *event,
event_type == NSOtherMouseDown || event_type == NSOtherMouseDown ||
event_type == NSLeftMouseDown)) event_type == NSLeftMouseDown))
{ {
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl);
if (![NSApp isActive]) if (![NSApp isActive])
{ {

View File

@ -27,7 +27,7 @@
#include "gdkintl.h" #include "gdkintl.h"
GdkGLContext * GdkGLContext *
gdk_quartz_window_create_gl_context (GdkWindow *window, gdk_quartz_surface_create_gl_context (GdkSurface *window,
gboolean attached, gboolean attached,
GdkGLContext *share, GdkGLContext *share,
GError **error) GError **error)

View File

@ -29,7 +29,7 @@
G_BEGIN_DECLS G_BEGIN_DECLS
GdkGLContext * gdk_quartz_window_create_gl_context (GdkWindow *window, GdkGLContext * gdk_quartz_surface_create_gl_context (GdkSurface *window,
gboolean attach, gboolean attach,
GdkGLContext *share, GdkGLContext *share,
GError **error); GError **error);

View File

@ -23,7 +23,7 @@
GdkDisplay *_gdk_display = NULL; GdkDisplay *_gdk_display = NULL;
GdkQuartzScreen *_gdk_screen = NULL; GdkQuartzScreen *_gdk_screen = NULL;
GdkWindow *_gdk_root = NULL; GdkSurface *_gdk_root = NULL;
GdkDeviceManager *_gdk_device_manager = NULL; GdkDeviceManager *_gdk_device_manager = NULL;
GdkOSXVersion GdkOSXVersion

View File

@ -36,15 +36,15 @@
extern GdkDisplay *_gdk_display; extern GdkDisplay *_gdk_display;
extern GdkQuartzScreen *_gdk_screen; extern GdkQuartzScreen *_gdk_screen;
extern GdkWindow *_gdk_root; extern GdkSurface *_gdk_root;
extern GdkDeviceManager *_gdk_device_manager; extern GdkDeviceManager *_gdk_device_manager;
extern GdkDragContext *_gdk_quartz_drag_source_context; extern GdkDragContext *_gdk_quartz_drag_source_context;
#define GDK_WINDOW_IS_QUARTZ(win) (GDK_IS_WINDOW_IMPL_QUARTZ (((GdkWindow *)win)->impl)) #define GDK_SURFACE_IS_QUARTZ(win) (GDK_IS_SURFACE_IMPL_QUARTZ (((GdkSurface *)win)->impl))
/* Initialization */ /* Initialization */
void _gdk_quartz_window_init_windowing (GdkDisplay *display); void _gdk_quartz_surface_init_windowing (GdkDisplay *display);
void _gdk_quartz_events_init (void); void _gdk_quartz_events_init (void);
void _gdk_quartz_event_loop_init (void); void _gdk_quartz_event_loop_init (void);
@ -56,9 +56,9 @@ typedef enum {
GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP
} GdkQuartzEventSubType; } GdkQuartzEventSubType;
void _gdk_quartz_events_update_focus_window (GdkWindow *new_window, void _gdk_quartz_events_update_focus_window (GdkSurface *new_window,
gboolean got_focus); gboolean got_focus);
void _gdk_quartz_events_send_map_event (GdkWindow *window); void _gdk_quartz_events_send_map_event (GdkSurface *window);
GdkModifierType _gdk_quartz_events_get_current_keyboard_modifiers (void); GdkModifierType _gdk_quartz_events_get_current_keyboard_modifiers (void);
GdkModifierType _gdk_quartz_events_get_current_mouse_modifiers (void); GdkModifierType _gdk_quartz_events_get_current_mouse_modifiers (void);
@ -73,11 +73,11 @@ void _gdk_quartz_event_loop_release_event (NSEvent *event);
/* Keys */ /* Keys */
GdkEventType _gdk_quartz_keys_event_type (NSEvent *event); GdkEventType _gdk_quartz_keys_event_type (NSEvent *event);
gboolean _gdk_quartz_keys_is_modifier (guint keycode); gboolean _gdk_quartz_keys_is_modifier (guint keycode);
void _gdk_quartz_synthesize_null_key_event (GdkWindow *window); void _gdk_quartz_synthesize_null_key_event (GdkSurface *window);
/* Drag and Drop */ /* Drag and Drop */
void _gdk_quartz_window_register_dnd (GdkWindow *window); void _gdk_quartz_surface_register_dnd (GdkSurface *window);
GdkDragContext * _gdk_quartz_window_drag_begin (GdkWindow *window, GdkDragContext * _gdk_quartz_surface_drag_begin (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
GList *targets, GList *targets,
gint x_root, gint x_root,
@ -98,35 +98,35 @@ gboolean _gdk_quartz_get_setting (const gchar *name,
/* Window */ /* Window */
gboolean _gdk_quartz_window_is_ancestor (GdkWindow *ancestor, gboolean _gdk_quartz_surface_is_ancestor (GdkSurface *ancestor,
GdkWindow *window); GdkSurface *window);
void _gdk_quartz_window_gdk_xy_to_xy (gint gdk_x, void _gdk_quartz_surface_gdk_xy_to_xy (gint gdk_x,
gint gdk_y, gint gdk_y,
gint *ns_x, gint *ns_x,
gint *ns_y); gint *ns_y);
void _gdk_quartz_window_xy_to_gdk_xy (gint ns_x, void _gdk_quartz_surface_xy_to_gdk_xy (gint ns_x,
gint ns_y, gint ns_y,
gint *gdk_x, gint *gdk_x,
gint *gdk_y); gint *gdk_y);
void _gdk_quartz_window_nspoint_to_gdk_xy (NSPoint point, void _gdk_quartz_surface_nspoint_to_gdk_xy (NSPoint point,
gint *x, gint *x,
gint *y); gint *y);
GdkWindow *_gdk_quartz_window_find_child (GdkWindow *window, GdkSurface *_gdk_quartz_surface_find_child (GdkSurface *window,
gint x, gint x,
gint y, gint y,
gboolean get_toplevel); gboolean get_toplevel);
void _gdk_quartz_window_attach_to_parent (GdkWindow *window); void _gdk_quartz_surface_attach_to_parent (GdkSurface *window);
void _gdk_quartz_window_detach_from_parent (GdkWindow *window); void _gdk_quartz_surface_detach_from_parent (GdkSurface *window);
void _gdk_quartz_window_did_become_main (GdkWindow *window); void _gdk_quartz_surface_did_become_main (GdkSurface *window);
void _gdk_quartz_window_did_resign_main (GdkWindow *window); void _gdk_quartz_surface_did_resign_main (GdkSurface *window);
void _gdk_quartz_window_debug_highlight (GdkWindow *window, void _gdk_quartz_surface_debug_highlight (GdkSurface *window,
gint number); gint number);
void _gdk_quartz_window_update_position (GdkWindow *window); void _gdk_quartz_surface_update_position (GdkSurface *window);
void _gdk_quartz_window_update_fullscreen_state (GdkWindow *window); void _gdk_quartz_surface_update_fullscreen_state (GdkSurface *window);
/* Window methods - property */ /* Window methods - property */
gboolean _gdk_quartz_window_get_property (GdkWindow *window, gboolean _gdk_quartz_surface_get_property (GdkSurface *window,
GdkAtom property, GdkAtom property,
GdkAtom type, GdkAtom type,
gulong offset, gulong offset,
@ -136,14 +136,14 @@ gboolean _gdk_quartz_window_get_property (GdkWindow *window,
gint *actual_format_type, gint *actual_format_type,
gint *actual_length, gint *actual_length,
guchar **data); guchar **data);
void _gdk_quartz_window_change_property (GdkWindow *window, void _gdk_quartz_surface_change_property (GdkSurface *window,
GdkAtom property, GdkAtom property,
GdkAtom type, GdkAtom type,
gint format, gint format,
GdkPropMode mode, GdkPropMode mode,
const guchar *data, const guchar *data,
gint nelements); gint nelements);
void _gdk_quartz_window_delete_property (GdkWindow *window, void _gdk_quartz_surface_delete_property (GdkSurface *window,
GdkAtom property); GdkAtom property);

View File

@ -17,8 +17,8 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef __GDK_QUARTZ_WINDOW_H__ #ifndef __GDK_QUARTZ_SURFACE_H__
#define __GDK_QUARTZ_WINDOW_H__ #define __GDK_QUARTZ_SURFACE_H__
#if !defined (__GDKQUARTZ_H_INSIDE__) && !defined (GDK_COMPILATION) #if !defined (__GDKQUARTZ_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdkquartz.h> can be included directly." #error "Only <gdk/gdkquartz.h> can be included directly."
@ -28,28 +28,28 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define GDK_TYPE_QUARTZ_WINDOW (gdk_quartz_window_get_type ()) #define GDK_TYPE_QUARTZ_SURFACE (gdk_quartz_surface_get_type ())
#define GDK_QUARTZ_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_QUARTZ_WINDOW, GdkQuartzWindow)) #define GDK_QUARTZ_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_QUARTZ_SURFACE, GdkQuartzSurface))
#define GDK_QUARTZ_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_QUARTZ_WINDOW, GdkQuartzWindowClass)) #define GDK_QUARTZ_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_QUARTZ_SURFACE, GdkQuartzSurfaceClass))
#define GDK_IS_QUARTZ_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_QUARTZ_WINDOW)) #define GDK_IS_QUARTZ_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_QUARTZ_SURFACE))
#define GDK_IS_QUARTZ_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_QUARTZ_WINDOW)) #define GDK_IS_QUARTZ_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_QUARTZ_SURFACE))
#define GDK_QUARTZ_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_QUARTZ_WINDOW, GdkQuartzWindowClass)) #define GDK_QUARTZ_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_QUARTZ_SURFACE, GdkQuartzSurfaceClass))
#ifdef GDK_COMPILATION #ifdef GDK_COMPILATION
typedef struct _GdkQuartzWindow GdkQuartzWindow; typedef struct _GdkQuartzSurface GdkQuartzSurface;
#else #else
typedef GdkWindow GdkQuartzWindow; typedef GdkSurface GdkQuartzSurface;
#endif #endif
typedef struct _GdkQuartzWindowClass GdkQuartzWindowClass; typedef struct _GdkQuartzSurfaceClass GdkQuartzSurfaceClass;
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GType gdk_quartz_window_get_type (void); GType gdk_quartz_surface_get_type (void);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
NSWindow *gdk_quartz_window_get_nswindow (GdkWindow *window); NSWindow *gdk_quartz_surface_get_nswindow (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
NSView *gdk_quartz_window_get_nsview (GdkWindow *window); NSView *gdk_quartz_surface_get_nsview (GdkSurface *window);
G_END_DECLS G_END_DECLS
#endif /* __GDK_QUARTZ_WINDOW_H__ */ #endif /* __GDK_QUARTZ_SURFACE_H__ */

View File

@ -53,8 +53,8 @@
* *
* A Cocoa coordinate is always relative to the origin of the monitor * A Cocoa coordinate is always relative to the origin of the monitor
* coordinate space. Such coordinates are mapped to their respective * coordinate space. Such coordinates are mapped to their respective
* position in the GdkScreen root window (_gdk_quartz_window_xy_to_gdk_xy) * position in the GdkScreen root window (_gdk_quartz_surface_xy_to_gdk_xy)
* and vice versa (_gdk_quartz_window_gdk_xy_to_xy). Both functions can * and vice versa (_gdk_quartz_surface_gdk_xy_to_xy). Both functions can
* be found in gdkwindow-quartz.c. Note that Cocoa coordinates can have * be found in gdkwindow-quartz.c. Note that Cocoa coordinates can have
* negative values (in case a monitor is located left or below of screen 0), * negative values (in case a monitor is located left or below of screen 0),
* but GDK coordinates can *not*! * but GDK coordinates can *not*!
@ -208,7 +208,7 @@ _gdk_quartz_screen_update_window_sizes (GdkQuartzScreen *screen)
windows = get_toplevels (); windows = get_toplevels ();
for (list = windows; list; list = list->next) for (list = windows; list; list = list->next)
_gdk_quartz_window_update_position (list->data); _gdk_quartz_surface_update_position (list->data);
} }
static void static void

File diff suppressed because it is too large Load Diff

View File

@ -16,8 +16,8 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef __GDK_WINDOW_QUARTZ_H__ #ifndef __GDK_SURFACE_QUARTZ_H__
#define __GDK_WINDOW_QUARTZ_H__ #define __GDK_SURFACE_QUARTZ_H__
#import <gdk/quartz/GdkQuartzView.h> #import <gdk/quartz/GdkQuartzView.h>
#import <gdk/quartz/GdkQuartzNSWindow.h> #import <gdk/quartz/GdkQuartzNSWindow.h>
@ -28,31 +28,31 @@ G_BEGIN_DECLS
/* Window implementation for Quartz /* Window implementation for Quartz
*/ */
typedef struct _GdkWindowImplQuartz GdkWindowImplQuartz; typedef struct _GdkSurfaceImplQuartz GdkSurfaceImplQuartz;
typedef struct _GdkWindowImplQuartzClass GdkWindowImplQuartzClass; typedef struct _GdkSurfaceImplQuartzClass GdkSurfaceImplQuartzClass;
#define GDK_TYPE_WINDOW_IMPL_QUARTZ (_gdk_window_impl_quartz_get_type ()) #define GDK_TYPE_SURFACE_IMPL_QUARTZ (_gdk_surface_impl_quartz_get_type ())
#define GDK_WINDOW_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_QUARTZ, GdkWindowImplQuartz)) #define GDK_SURFACE_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL_QUARTZ, GdkSurfaceImplQuartz))
#define GDK_WINDOW_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL_QUARTZ, GdkWindowImplQuartzClass)) #define GDK_SURFACE_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL_QUARTZ, GdkSurfaceImplQuartzClass))
#define GDK_IS_WINDOW_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_QUARTZ)) #define GDK_IS_SURFACE_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL_QUARTZ))
#define GDK_IS_WINDOW_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_QUARTZ)) #define GDK_IS_SURFACE_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL_QUARTZ))
#define GDK_WINDOW_IMPL_QUARTZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_QUARTZ, GdkWindowImplQuartzClass)) #define GDK_SURFACE_IMPL_QUARTZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL_QUARTZ, GdkSurfaceImplQuartzClass))
struct _GdkWindowImplQuartz struct _GdkSurfaceImplQuartz
{ {
GdkWindowImpl parent_instance; GdkSurfaceImpl parent_instance;
GdkWindow *wrapper; GdkSurface *wrapper;
NSWindow *toplevel; NSWindow *toplevel;
NSTrackingRectTag tracking_rect; NSTrackingRectTag tracking_rect;
GdkQuartzView *view; GdkQuartzView *view;
GdkWindowTypeHint type_hint; GdkSurfaceTypeHint type_hint;
gint in_paint_rect_count; gint in_paint_rect_count;
GdkWindow *transient_for; GdkSurface *transient_for;
/* Sorted by z-order */ /* Sorted by z-order */
GList *sorted_children; GList *sorted_children;
@ -66,21 +66,21 @@ struct _GdkWindowImplQuartz
gint shadow_max; gint shadow_max;
}; };
struct _GdkWindowImplQuartzClass struct _GdkSurfaceImplQuartzClass
{ {
GdkWindowImplClass parent_class; GdkSurfaceImplClass parent_class;
CGContextRef (* get_context) (GdkWindowImplQuartz *window, CGContextRef (* get_context) (GdkSurfaceImplQuartz *window,
gboolean antialias); gboolean antialias);
void (* release_context) (GdkWindowImplQuartz *window, void (* release_context) (GdkSurfaceImplQuartz *window,
CGContextRef cg_context); CGContextRef cg_context);
}; };
GType _gdk_window_impl_quartz_get_type (void); GType _gdk_surface_impl_quartz_get_type (void);
CGContextRef gdk_quartz_window_get_context (GdkWindowImplQuartz *window, CGContextRef gdk_quartz_surface_get_context (GdkSurfaceImplQuartz *window,
gboolean antialias); gboolean antialias);
void gdk_quartz_window_release_context (GdkWindowImplQuartz *window, void gdk_quartz_surface_release_context (GdkSurfaceImplQuartz *window,
CGContextRef context); CGContextRef context);
/* Root window implementation for Quartz /* Root window implementation for Quartz
@ -98,12 +98,12 @@ typedef struct _GdkRootWindowImplQuartzClass GdkRootWindowImplQuartzClass;
struct _GdkRootWindowImplQuartz struct _GdkRootWindowImplQuartz
{ {
GdkWindowImplQuartz parent_instance; GdkSurfaceImplQuartz parent_instance;
}; };
struct _GdkRootWindowImplQuartzClass struct _GdkRootWindowImplQuartzClass
{ {
GdkWindowImplQuartzClass parent_class; GdkSurfaceImplQuartzClass parent_class;
}; };
GType _gdk_root_window_impl_quartz_get_type (void); GType _gdk_root_window_impl_quartz_get_type (void);
@ -112,4 +112,4 @@ GList *get_toplevels (void);
G_END_DECLS G_END_DECLS
#endif /* __GDK_WINDOW_QUARTZ_H__ */ #endif /* __GDK_SURFACE_QUARTZ_H__ */

View File

@ -69,7 +69,7 @@ struct _GdkWaylandTouchData
uint32_t id; uint32_t id;
gdouble x; gdouble x;
gdouble y; gdouble y;
GdkWindow *window; GdkSurface *window;
uint32_t touch_down_serial; uint32_t touch_down_serial;
guint initial_touch : 1; guint initial_touch : 1;
}; };
@ -86,7 +86,7 @@ struct _GdkWaylandPointerFrameData
}; };
struct _GdkWaylandPointerData { struct _GdkWaylandPointerData {
GdkWindow *focus; GdkSurface *focus;
double surface_x, surface_y; double surface_x, surface_y;
@ -96,7 +96,7 @@ struct _GdkWaylandPointerData {
uint32_t enter_serial; uint32_t enter_serial;
uint32_t press_serial; uint32_t press_serial;
GdkWindow *grab_window; GdkSurface *grab_window;
uint32_t grab_time; uint32_t grab_time;
struct wl_surface *pointer_surface; struct wl_surface *pointer_surface;
@ -220,8 +220,8 @@ struct _GdkWaylandSeat
GdkWaylandPointerData touch_info; GdkWaylandPointerData touch_info;
GdkModifierType key_modifiers; GdkModifierType key_modifiers;
GdkWindow *keyboard_focus; GdkSurface *keyboard_focus;
GdkWindow *grab_window; GdkSurface *grab_window;
uint32_t grab_time; uint32_t grab_time;
gboolean have_server_repeat; gboolean have_server_repeat;
uint32_t server_repeat_rate; uint32_t server_repeat_rate;
@ -242,7 +242,7 @@ struct _GdkWaylandSeat
GdkDragContext *drop_context; GdkDragContext *drop_context;
/* Source/dest for non-local dnd */ /* Source/dest for non-local dnd */
GdkWindow *foreign_dnd_window; GdkSurface *foreign_dnd_window;
/* Some tracking on gesture events */ /* Some tracking on gesture events */
guint gesture_n_fingers; guint gesture_n_fingers;
@ -298,7 +298,7 @@ static void deliver_key_event (GdkWaylandSeat *seat,
static gboolean static gboolean
gdk_wayland_device_get_history (GdkDevice *device, gdk_wayland_device_get_history (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
guint32 start, guint32 start,
guint32 stop, guint32 stop,
GdkTimeCoord ***events, GdkTimeCoord ***events,
@ -309,13 +309,13 @@ gdk_wayland_device_get_history (GdkDevice *device,
static void static void
gdk_wayland_device_get_state (GdkDevice *device, gdk_wayland_device_get_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gdouble *axes, gdouble *axes,
GdkModifierType *mask) GdkModifierType *mask)
{ {
gdouble x, y; gdouble x, y;
gdk_window_get_device_position_double (window, device, &x, &y, mask); gdk_surface_get_device_position_double (window, device, &x, &y, mask);
if (axes) if (axes)
{ {
@ -470,7 +470,7 @@ gdk_wayland_device_update_window_cursor (GdkDevice *device)
static void static void
gdk_wayland_device_set_window_cursor (GdkDevice *device, gdk_wayland_device_set_window_cursor (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkCursor *cursor) GdkCursor *cursor)
{ {
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device)); GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device));
@ -528,7 +528,7 @@ get_coordinates (GdkDevice *device,
if (pointer->focus) if (pointer->focus)
{ {
gdk_window_get_root_coords (pointer->focus, gdk_surface_get_root_coords (pointer->focus,
pointer->surface_x, pointer->surface_x,
pointer->surface_y, pointer->surface_y,
&root_x, &root_y); &root_x, &root_y);
@ -562,8 +562,8 @@ device_get_modifiers (GdkDevice *device)
static void static void
gdk_wayland_device_query_state (GdkDevice *device, gdk_wayland_device_query_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkWindow **child_window, GdkSurface **child_window,
gdouble *root_x, gdouble *root_x,
gdouble *root_y, gdouble *root_y,
gdouble *win_x, gdouble *win_x,
@ -590,8 +590,8 @@ gdk_wayland_device_query_state (GdkDevice *device,
} }
static void static void
emulate_crossing (GdkWindow *window, emulate_crossing (GdkSurface *window,
GdkWindow *subwindow, GdkSurface *subwindow,
GdkDevice *device, GdkDevice *device,
GdkEventType type, GdkEventType type,
GdkCrossingMode mode, GdkCrossingMode mode,
@ -608,18 +608,18 @@ emulate_crossing (GdkWindow *window,
gdk_event_set_device (event, device); gdk_event_set_device (event, device);
gdk_event_set_source_device (event, device); gdk_event_set_source_device (event, device);
gdk_window_get_device_position_double (window, device, gdk_surface_get_device_position_double (window, device,
&event->crossing.x, &event->crossing.y, &event->crossing.x, &event->crossing.y,
&event->crossing.state); &event->crossing.state);
event->crossing.x_root = event->crossing.x; event->crossing.x_root = event->crossing.x;
event->crossing.y_root = event->crossing.y; event->crossing.y_root = event->crossing.y;
_gdk_wayland_display_deliver_event (gdk_window_get_display (window), event); _gdk_wayland_display_deliver_event (gdk_surface_get_display (window), event);
} }
static void static void
emulate_touch_crossing (GdkWindow *window, emulate_touch_crossing (GdkSurface *window,
GdkWindow *subwindow, GdkSurface *subwindow,
GdkDevice *device, GdkDevice *device,
GdkDevice *source, GdkDevice *source,
GdkWaylandTouchData *touch, GdkWaylandTouchData *touch,
@ -643,11 +643,11 @@ emulate_touch_crossing (GdkWindow *window,
event->crossing.x_root = event->crossing.x; event->crossing.x_root = event->crossing.x;
event->crossing.y_root = event->crossing.y; event->crossing.y_root = event->crossing.y;
_gdk_wayland_display_deliver_event (gdk_window_get_display (window), event); _gdk_wayland_display_deliver_event (gdk_surface_get_display (window), event);
} }
static void static void
emulate_focus (GdkWindow *window, emulate_focus (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
gboolean focus_in, gboolean focus_in,
guint32 time_) guint32 time_)
@ -660,13 +660,13 @@ emulate_focus (GdkWindow *window,
gdk_event_set_device (event, device); gdk_event_set_device (event, device);
gdk_event_set_source_device (event, device); gdk_event_set_source_device (event, device);
_gdk_wayland_display_deliver_event (gdk_window_get_display (window), event); _gdk_wayland_display_deliver_event (gdk_surface_get_display (window), event);
} }
static void static void
device_emit_grab_crossing (GdkDevice *device, device_emit_grab_crossing (GdkDevice *device,
GdkWindow *from, GdkSurface *from,
GdkWindow *to, GdkSurface *to,
GdkCrossingMode mode, GdkCrossingMode mode,
guint32 time_) guint32 time_)
{ {
@ -686,7 +686,7 @@ device_emit_grab_crossing (GdkDevice *device,
} }
} }
static GdkWindow * static GdkSurface *
gdk_wayland_device_get_focus (GdkDevice *device) gdk_wayland_device_get_focus (GdkDevice *device)
{ {
GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device)); GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device));
@ -707,19 +707,19 @@ gdk_wayland_device_get_focus (GdkDevice *device)
static GdkGrabStatus static GdkGrabStatus
gdk_wayland_device_grab (GdkDevice *device, gdk_wayland_device_grab (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gboolean owner_events, gboolean owner_events,
GdkEventMask event_mask, GdkEventMask event_mask,
GdkWindow *confine_to, GdkSurface *confine_to,
GdkCursor *cursor, GdkCursor *cursor,
guint32 time_) guint32 time_)
{ {
GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device)); GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device));
GdkWindow *prev_focus = gdk_wayland_device_get_focus (device); GdkSurface *prev_focus = gdk_wayland_device_get_focus (device);
GdkWaylandPointerData *pointer = GDK_WAYLAND_DEVICE (device)->pointer; GdkWaylandPointerData *pointer = GDK_WAYLAND_DEVICE (device)->pointer;
if (gdk_window_get_window_type (window) == GDK_WINDOW_TEMP && if (gdk_surface_get_window_type (window) == GDK_SURFACE_TEMP &&
gdk_window_is_visible (window)) gdk_surface_is_visible (window))
{ {
g_warning ("Window %p is already mapped at the time of grabbing. " g_warning ("Window %p is already mapped at the time of grabbing. "
"gdk_seat_grab() should be used to simultanously grab input " "gdk_seat_grab() should be used to simultanously grab input "
@ -733,7 +733,7 @@ gdk_wayland_device_grab (GdkDevice *device,
if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD) if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
{ {
/* Device is a keyboard */ /* Device is a keyboard */
gdk_wayland_window_inhibit_shortcuts (window, gdk_wayland_surface_inhibit_shortcuts (window,
gdk_device_get_seat (device)); gdk_device_get_seat (device));
return GDK_GRAB_SUCCESS; return GDK_GRAB_SUCCESS;
} }
@ -751,7 +751,7 @@ gdk_wayland_device_grab (GdkDevice *device,
pointer->grab_window = window; pointer->grab_window = window;
pointer->grab_time = time_; pointer->grab_time = time_;
_gdk_wayland_window_set_grab_seat (window, GDK_SEAT (wayland_seat)); _gdk_wayland_surface_set_grab_seat (window, GDK_SEAT (wayland_seat));
g_clear_object (&wayland_seat->cursor); g_clear_object (&wayland_seat->cursor);
@ -771,7 +771,7 @@ gdk_wayland_device_ungrab (GdkDevice *device,
GdkWaylandPointerData *pointer = GDK_WAYLAND_DEVICE (device)->pointer; GdkWaylandPointerData *pointer = GDK_WAYLAND_DEVICE (device)->pointer;
GdkDisplay *display; GdkDisplay *display;
GdkDeviceGrabInfo *grab; GdkDeviceGrabInfo *grab;
GdkWindow *focus, *prev_focus = NULL; GdkSurface *focus, *prev_focus = NULL;
display = gdk_device_get_display (device); display = gdk_device_get_display (device);
@ -792,7 +792,7 @@ gdk_wayland_device_ungrab (GdkDevice *device,
{ {
/* Device is a keyboard */ /* Device is a keyboard */
if (prev_focus) if (prev_focus)
gdk_wayland_window_restore_shortcuts (prev_focus, gdk_wayland_surface_restore_shortcuts (prev_focus,
gdk_device_get_seat (device)); gdk_device_get_seat (device));
} }
else else
@ -801,12 +801,12 @@ gdk_wayland_device_ungrab (GdkDevice *device,
gdk_wayland_device_update_window_cursor (device); gdk_wayland_device_update_window_cursor (device);
if (pointer->grab_window) if (pointer->grab_window)
_gdk_wayland_window_set_grab_seat (pointer->grab_window, _gdk_wayland_surface_set_grab_seat (pointer->grab_window,
NULL); NULL);
} }
} }
static GdkWindow * static GdkSurface *
gdk_wayland_device_window_at_position (GdkDevice *device, gdk_wayland_device_window_at_position (GdkDevice *device,
gdouble *win_x, gdouble *win_x,
gdouble *win_y, gdouble *win_y,
@ -832,7 +832,7 @@ gdk_wayland_device_window_at_position (GdkDevice *device,
static void static void
gdk_wayland_device_select_window_events (GdkDevice *device, gdk_wayland_device_select_window_events (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkEventMask event_mask) GdkEventMask event_mask)
{ {
} }
@ -1077,11 +1077,11 @@ data_device_enter (void *data,
struct wl_data_offer *offer) struct wl_data_offer *offer)
{ {
GdkWaylandSeat *seat = data; GdkWaylandSeat *seat = data;
GdkWindow *dest_window, *dnd_owner; GdkSurface *dest_window, *dnd_owner;
dest_window = wl_surface_get_user_data (surface); dest_window = wl_surface_get_user_data (surface);
if (!GDK_IS_WINDOW (dest_window)) if (!GDK_IS_SURFACE (dest_window))
return; return;
GDK_DISPLAY_NOTE (seat->display, EVENTS, GDK_DISPLAY_NOTE (seat->display, EVENTS,
@ -1357,7 +1357,7 @@ pointer_handle_enter (void *data,
if (!surface) if (!surface)
return; return;
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface))) if (!GDK_IS_SURFACE (wl_surface_get_user_data (surface)))
return; return;
_gdk_wayland_display_update_serial (display_wayland, serial); _gdk_wayland_display_update_serial (display_wayland, serial);
@ -1411,7 +1411,7 @@ pointer_handle_leave (void *data,
if (!surface) if (!surface)
return; return;
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface))) if (!GDK_IS_SURFACE (wl_surface_get_user_data (surface)))
return; return;
if (!seat->pointer_info.focus) if (!seat->pointer_info.focus)
@ -1771,7 +1771,7 @@ keyboard_handle_enter (void *data,
if (!surface) if (!surface)
return; return;
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface))) if (!GDK_IS_SURFACE (wl_surface_get_user_data (surface)))
return; return;
_gdk_wayland_display_update_serial (display, serial); _gdk_wayland_display_update_serial (display, serial);
@ -1809,7 +1809,7 @@ keyboard_handle_leave (void *data,
if (!seat->keyboard_focus) if (!seat->keyboard_focus)
return; return;
/* gdk_window_is_destroyed() might already return TRUE for /* gdk_surface_is_destroyed() might already return TRUE for
* seat->keyboard_focus here, which would happen if we destroyed the * seat->keyboard_focus here, which would happen if we destroyed the
* window before loosing keyboard focus. * window before loosing keyboard focus.
*/ */
@ -2227,7 +2227,7 @@ _create_touch_event (GdkWaylandSeat *seat,
event->touch.emulating_pointer = TRUE; event->touch.emulating_pointer = TRUE;
} }
gdk_window_get_root_coords (touch->window, gdk_surface_get_root_coords (touch->window,
touch->x, touch->y, touch->x, touch->y,
&x_root, &y_root); &x_root, &y_root);
@ -3370,12 +3370,12 @@ tablet_tool_handle_proximity_in (void *data,
GdkWaylandTabletData *tablet = zwp_tablet_v2_get_user_data (wp_tablet); GdkWaylandTabletData *tablet = zwp_tablet_v2_get_user_data (wp_tablet);
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat); GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
GdkWindow *window = wl_surface_get_user_data (surface); GdkSurface *window = wl_surface_get_user_data (surface);
GdkEvent *event; GdkEvent *event;
if (!surface) if (!surface)
return; return;
if (!GDK_IS_WINDOW (window)) if (!GDK_IS_SURFACE (window))
return; return;
tool->current_tablet = tablet; tool->current_tablet = tablet;
@ -4386,10 +4386,10 @@ static const struct wl_surface_listener pointer_surface_listener = {
pointer_surface_leave pointer_surface_leave
}; };
static GdkWindow * static GdkSurface *
create_foreign_dnd_window (GdkDisplay *display) create_foreign_dnd_window (GdkDisplay *display)
{ {
return gdk_window_new_popup (display, &(GdkRectangle) { 0, 0, 1, 1 }); return gdk_surface_new_popup (display, &(GdkRectangle) { 0, 0, 1, 1 });
} }
static void static void
@ -4425,7 +4425,7 @@ gdk_wayland_seat_finalize (GObject *object)
g_clear_object (&seat->clipboard); g_clear_object (&seat->clipboard);
g_clear_object (&seat->primary_clipboard); g_clear_object (&seat->primary_clipboard);
g_hash_table_destroy (seat->touches); g_hash_table_destroy (seat->touches);
gdk_window_destroy (seat->foreign_dnd_window); gdk_surface_destroy (seat->foreign_dnd_window);
zwp_tablet_seat_v2_destroy (seat->wp_tablet_seat); zwp_tablet_seat_v2_destroy (seat->wp_tablet_seat);
stop_key_repeat (seat); stop_key_repeat (seat);
@ -4450,11 +4450,11 @@ gdk_wayland_seat_get_capabilities (GdkSeat *seat)
static void static void
gdk_wayland_seat_set_grab_window (GdkWaylandSeat *seat, gdk_wayland_seat_set_grab_window (GdkWaylandSeat *seat,
GdkWindow *window) GdkSurface *window)
{ {
if (seat->grab_window) if (seat->grab_window)
{ {
_gdk_wayland_window_set_grab_seat (seat->grab_window, NULL); _gdk_wayland_surface_set_grab_seat (seat->grab_window, NULL);
g_object_remove_weak_pointer (G_OBJECT (seat->grab_window), g_object_remove_weak_pointer (G_OBJECT (seat->grab_window),
(gpointer *) &seat->grab_window); (gpointer *) &seat->grab_window);
seat->grab_window = NULL; seat->grab_window = NULL;
@ -4465,13 +4465,13 @@ gdk_wayland_seat_set_grab_window (GdkWaylandSeat *seat,
seat->grab_window = window; seat->grab_window = window;
g_object_add_weak_pointer (G_OBJECT (window), g_object_add_weak_pointer (G_OBJECT (window),
(gpointer *) &seat->grab_window); (gpointer *) &seat->grab_window);
_gdk_wayland_window_set_grab_seat (window, GDK_SEAT (seat)); _gdk_wayland_surface_set_grab_seat (window, GDK_SEAT (seat));
} }
} }
static GdkGrabStatus static GdkGrabStatus
gdk_wayland_seat_grab (GdkSeat *seat, gdk_wayland_seat_grab (GdkSeat *seat,
GdkWindow *window, GdkSurface *window,
GdkSeatCapabilities capabilities, GdkSeatCapabilities capabilities,
gboolean owner_events, gboolean owner_events,
GdkCursor *cursor, GdkCursor *cursor,
@ -4482,12 +4482,12 @@ gdk_wayland_seat_grab (GdkSeat *seat,
GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (seat); GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (seat);
guint32 evtime = event ? gdk_event_get_time (event) : GDK_CURRENT_TIME; guint32 evtime = event ? gdk_event_get_time (event) : GDK_CURRENT_TIME;
GdkDisplay *display = gdk_seat_get_display (seat); GdkDisplay *display = gdk_seat_get_display (seat);
GdkWindow *native; GdkSurface *native;
GList *l; GList *l;
native = gdk_window_get_toplevel (window); native = gdk_surface_get_toplevel (window);
if (native == NULL || GDK_WINDOW_DESTROYED (native)) if (native == NULL || GDK_SURFACE_DESTROYED (native))
return GDK_GRAB_NOT_VIEWABLE; return GDK_GRAB_NOT_VIEWABLE;
gdk_wayland_seat_set_grab_window (wayland_seat, native); gdk_wayland_seat_set_grab_window (wayland_seat, native);
@ -4496,7 +4496,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
if (prepare_func) if (prepare_func)
(prepare_func) (seat, window, prepare_func_data); (prepare_func) (seat, window, prepare_func_data);
if (!gdk_window_is_visible (window)) if (!gdk_surface_is_visible (window))
{ {
gdk_wayland_seat_set_grab_window (wayland_seat, NULL); gdk_wayland_seat_set_grab_window (wayland_seat, NULL);
g_critical ("Window %p has not been made visible in GdkSeatGrabPrepareFunc", g_critical ("Window %p has not been made visible in GdkSeatGrabPrepareFunc",
@ -4507,7 +4507,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
if (wayland_seat->master_pointer && if (wayland_seat->master_pointer &&
capabilities & GDK_SEAT_CAPABILITY_POINTER) capabilities & GDK_SEAT_CAPABILITY_POINTER)
{ {
GdkWindow *prev_focus = gdk_wayland_device_get_focus (wayland_seat->master_pointer); GdkSurface *prev_focus = gdk_wayland_device_get_focus (wayland_seat->master_pointer);
if (prev_focus != native) if (prev_focus != native)
device_emit_grab_crossing (wayland_seat->master_pointer, prev_focus, device_emit_grab_crossing (wayland_seat->master_pointer, prev_focus,
@ -4532,7 +4532,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
if (wayland_seat->touch_master && if (wayland_seat->touch_master &&
capabilities & GDK_SEAT_CAPABILITY_TOUCH) capabilities & GDK_SEAT_CAPABILITY_TOUCH)
{ {
GdkWindow *prev_focus = gdk_wayland_device_get_focus (wayland_seat->touch_master); GdkSurface *prev_focus = gdk_wayland_device_get_focus (wayland_seat->touch_master);
if (prev_focus != native) if (prev_focus != native)
device_emit_grab_crossing (wayland_seat->touch_master, prev_focus, device_emit_grab_crossing (wayland_seat->touch_master, prev_focus,
@ -4553,7 +4553,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
if (wayland_seat->master_keyboard && if (wayland_seat->master_keyboard &&
capabilities & GDK_SEAT_CAPABILITY_KEYBOARD) capabilities & GDK_SEAT_CAPABILITY_KEYBOARD)
{ {
GdkWindow *prev_focus = gdk_wayland_device_get_focus (wayland_seat->master_keyboard); GdkSurface *prev_focus = gdk_wayland_device_get_focus (wayland_seat->master_keyboard);
if (prev_focus != native) if (prev_focus != native)
device_emit_grab_crossing (wayland_seat->master_keyboard, prev_focus, device_emit_grab_crossing (wayland_seat->master_keyboard, prev_focus,
@ -4572,7 +4572,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
/* Inhibit shortcuts if the seat grab is for the keyboard only */ /* Inhibit shortcuts if the seat grab is for the keyboard only */
if (capabilities == GDK_SEAT_CAPABILITY_KEYBOARD) if (capabilities == GDK_SEAT_CAPABILITY_KEYBOARD)
gdk_wayland_window_inhibit_shortcuts (window, seat); gdk_wayland_surface_inhibit_shortcuts (window, seat);
} }
if (wayland_seat->tablets && if (wayland_seat->tablets &&
@ -4581,7 +4581,7 @@ gdk_wayland_seat_grab (GdkSeat *seat,
for (l = wayland_seat->tablets; l; l = l->next) for (l = wayland_seat->tablets; l; l = l->next)
{ {
GdkWaylandTabletData *tablet = l->data; GdkWaylandTabletData *tablet = l->data;
GdkWindow *prev_focus = gdk_wayland_device_get_focus (tablet->master); GdkSurface *prev_focus = gdk_wayland_device_get_focus (tablet->master);
if (prev_focus != native) if (prev_focus != native)
device_emit_grab_crossing (tablet->master, prev_focus, device_emit_grab_crossing (tablet->master, prev_focus,
@ -4619,7 +4619,7 @@ gdk_wayland_seat_ungrab (GdkSeat *seat)
if (wayland_seat->master_pointer) if (wayland_seat->master_pointer)
{ {
GdkWindow *focus, *prev_focus = NULL; GdkSurface *focus, *prev_focus = NULL;
grab = _gdk_display_get_last_device_grab (display, wayland_seat->master_pointer); grab = _gdk_display_get_last_device_grab (display, wayland_seat->master_pointer);
@ -4647,7 +4647,7 @@ gdk_wayland_seat_ungrab (GdkSeat *seat)
{ {
grab->serial_end = grab->serial_start; grab->serial_end = grab->serial_start;
if (grab->window) if (grab->window)
gdk_wayland_window_restore_shortcuts (grab->window, seat); gdk_wayland_surface_restore_shortcuts (grab->window, seat);
} }
} }

View File

@ -636,7 +636,7 @@ _gdk_wayland_display_open (const gchar *display_name)
static void static void
destroy_toplevel (gpointer data) destroy_toplevel (gpointer data)
{ {
_gdk_window_destroy (GDK_WINDOW (data), FALSE); _gdk_surface_destroy (GDK_SURFACE (data), FALSE);
} }
static void static void
@ -714,7 +714,7 @@ gdk_wayland_display_get_name (GdkDisplay *display)
void void
gdk_wayland_display_system_bell (GdkDisplay *display, gdk_wayland_display_system_bell (GdkDisplay *display,
GdkWindow *window) GdkSurface *window)
{ {
GdkWaylandDisplay *display_wayland; GdkWaylandDisplay *display_wayland;
struct gtk_surface1 *gtk_surface; struct gtk_surface1 *gtk_surface;
@ -728,7 +728,7 @@ gdk_wayland_display_system_bell (GdkDisplay *display,
return; return;
if (window) if (window)
gtk_surface = gdk_wayland_window_get_gtk_surface (window); gtk_surface = gdk_wayland_surface_get_gtk_surface (window);
else else
gtk_surface = NULL; gtk_surface = NULL;
@ -798,7 +798,7 @@ gdk_wayland_display_has_pending (GdkDisplay *display)
return FALSE; return FALSE;
} }
static GdkWindow * static GdkSurface *
gdk_wayland_display_get_default_group (GdkDisplay *display) gdk_wayland_display_get_default_group (GdkDisplay *display)
{ {
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
@ -917,15 +917,15 @@ gdk_wayland_display_get_monitor (GdkDisplay *display,
static GdkMonitor * static GdkMonitor *
gdk_wayland_display_get_monitor_at_window (GdkDisplay *display, gdk_wayland_display_get_monitor_at_window (GdkDisplay *display,
GdkWindow *window) GdkSurface *window)
{ {
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
struct wl_output *output; struct wl_output *output;
int i; int i;
g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL); g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), NULL);
output = gdk_wayland_window_get_wl_output (window); output = gdk_wayland_surface_get_wl_output (window);
if (output == NULL) if (output == NULL)
return NULL; return NULL;
@ -953,7 +953,7 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class)
object_class->dispose = gdk_wayland_display_dispose; object_class->dispose = gdk_wayland_display_dispose;
object_class->finalize = gdk_wayland_display_finalize; object_class->finalize = gdk_wayland_display_finalize;
display_class->window_type = gdk_wayland_window_get_type (); display_class->window_type = gdk_wayland_surface_get_type ();
#ifdef GDK_RENDERING_VULKAN #ifdef GDK_RENDERING_VULKAN
display_class->vk_context_type = GDK_TYPE_WAYLAND_VULKAN_CONTEXT; display_class->vk_context_type = GDK_TYPE_WAYLAND_VULKAN_CONTEXT;
@ -1848,7 +1848,7 @@ static void
update_scale (GdkDisplay *display) update_scale (GdkDisplay *display)
{ {
g_list_foreach (gdk_wayland_display_get_toplevel_windows (display), g_list_foreach (gdk_wayland_display_get_toplevel_windows (display),
(GFunc)gdk_wayland_window_update_scale, (GFunc)gdk_wayland_surface_update_scale,
NULL); NULL);
} }

View File

@ -47,7 +47,7 @@ typedef struct _GdkWaylandDragContextClass GdkWaylandDragContextClass;
struct _GdkWaylandDragContext struct _GdkWaylandDragContext
{ {
GdkDragContext context; GdkDragContext context;
GdkWindow *dnd_window; GdkSurface *dnd_window;
struct wl_surface *dnd_surface; struct wl_surface *dnd_surface;
struct wl_data_source *data_source; struct wl_data_source *data_source;
GdkDragAction selected_action; GdkDragAction selected_action;
@ -74,7 +74,7 @@ gdk_wayland_drag_context_finalize (GObject *object)
{ {
GdkWaylandDragContext *wayland_context = GDK_WAYLAND_DRAG_CONTEXT (object); GdkWaylandDragContext *wayland_context = GDK_WAYLAND_DRAG_CONTEXT (object);
GdkDragContext *context = GDK_DRAG_CONTEXT (object); GdkDragContext *context = GDK_DRAG_CONTEXT (object);
GdkWindow *dnd_window; GdkSurface *dnd_window;
contexts = g_list_remove (contexts, context); contexts = g_list_remove (contexts, context);
@ -91,7 +91,7 @@ gdk_wayland_drag_context_finalize (GObject *object)
G_OBJECT_CLASS (gdk_wayland_drag_context_parent_class)->finalize (object); G_OBJECT_CLASS (gdk_wayland_drag_context_parent_class)->finalize (object);
if (dnd_window) if (dnd_window)
gdk_window_destroy (dnd_window); gdk_surface_destroy (dnd_window);
} }
void void
@ -99,7 +99,7 @@ _gdk_wayland_drag_context_emit_event (GdkDragContext *context,
GdkEventType type, GdkEventType type,
guint32 time_) guint32 time_)
{ {
GdkWindow *window; GdkSurface *window;
GdkEvent *event; GdkEvent *event;
switch ((guint) type) switch ((guint) type)
@ -126,7 +126,7 @@ _gdk_wayland_drag_context_emit_event (GdkDragContext *context,
event->dnd.y_root = GDK_WAYLAND_DRAG_CONTEXT (context)->y; event->dnd.y_root = GDK_WAYLAND_DRAG_CONTEXT (context)->y;
gdk_event_set_device (event, gdk_drag_context_get_device (context)); gdk_event_set_device (event, gdk_drag_context_get_device (context));
gdk_display_put_event (gdk_window_get_display (window), event); gdk_display_put_event (gdk_surface_get_display (window), event);
g_object_unref (event); g_object_unref (event);
} }
@ -360,7 +360,7 @@ gdk_wayland_drag_context_init (GdkWaylandDragContext *context_wayland)
context->actions = GDK_ACTION_COPY | GDK_ACTION_MOVE; context->actions = GDK_ACTION_COPY | GDK_ACTION_MOVE;
} }
static GdkWindow * static GdkSurface *
gdk_wayland_drag_context_get_drag_window (GdkDragContext *context) gdk_wayland_drag_context_get_drag_window (GdkDragContext *context)
{ {
return GDK_WAYLAND_DRAG_CONTEXT (context)->dnd_window; return GDK_WAYLAND_DRAG_CONTEXT (context)->dnd_window;
@ -382,9 +382,9 @@ gdk_wayland_drag_context_set_hotspot (GdkDragContext *context,
if (prev_hot_x == hot_x && prev_hot_y == hot_y) if (prev_hot_x == hot_x && prev_hot_y == hot_y)
return; return;
_gdk_wayland_window_offset_next_wl_buffer (context_wayland->dnd_window, _gdk_wayland_surface_offset_next_wl_buffer (context_wayland->dnd_window,
-hot_x, -hot_y); -hot_x, -hot_y);
gdk_window_invalidate_rect (context_wayland->dnd_window, &damage_rect, FALSE); gdk_surface_invalidate_rect (context_wayland->dnd_window, &damage_rect, FALSE);
} }
static void static void
@ -429,7 +429,7 @@ gdk_wayland_drag_context_drop_done (GdkDragContext *context,
if (success) if (success)
{ {
if (context_wayland->dnd_window) if (context_wayland->dnd_window)
gdk_window_hide (context_wayland->dnd_window); gdk_surface_hide (context_wayland->dnd_window);
} }
} }
@ -461,24 +461,24 @@ gdk_wayland_drag_context_class_init (GdkWaylandDragContextClass *klass)
} }
void void
_gdk_wayland_window_register_dnd (GdkWindow *window) _gdk_wayland_surface_register_dnd (GdkSurface *window)
{ {
} }
static GdkWindow * static GdkSurface *
create_dnd_window (GdkDisplay *display) create_dnd_window (GdkDisplay *display)
{ {
GdkWindow *window; GdkSurface *window;
window = gdk_window_new_popup (display, &(GdkRectangle) { 0, 0, 100, 100 }); window = gdk_surface_new_popup (display, &(GdkRectangle) { 0, 0, 100, 100 });
gdk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DND); gdk_surface_set_type_hint (window, GDK_SURFACE_TYPE_HINT_DND);
return window; return window;
} }
GdkDragContext * GdkDragContext *
_gdk_wayland_window_drag_begin (GdkWindow *window, _gdk_wayland_surface_drag_begin (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
GdkContentProvider *content, GdkContentProvider *content,
GdkDragAction actions, GdkDragAction actions,
@ -503,8 +503,8 @@ _gdk_wayland_window_drag_begin (GdkWindow *window,
gdk_drag_context_set_device (context, device); gdk_drag_context_set_device (context, device);
context_wayland->dnd_window = create_dnd_window (gdk_window_get_display (window)); context_wayland->dnd_window = create_dnd_window (gdk_surface_get_display (window));
context_wayland->dnd_surface = gdk_wayland_window_get_wl_surface (context_wayland->dnd_window); context_wayland->dnd_surface = gdk_wayland_surface_get_wl_surface (context_wayland->dnd_window);
context_wayland->data_source = context_wayland->data_source =
gdk_wayland_selection_get_data_source (window); gdk_wayland_selection_get_data_source (window);
@ -523,7 +523,7 @@ _gdk_wayland_window_drag_begin (GdkWindow *window,
wl_data_device_start_drag (gdk_wayland_device_get_data_device (device), wl_data_device_start_drag (gdk_wayland_device_get_data_device (device),
context_wayland->data_source, context_wayland->data_source,
gdk_wayland_window_get_wl_surface (window), gdk_wayland_surface_get_wl_surface (window),
context_wayland->dnd_surface, context_wayland->dnd_surface,
_gdk_wayland_display_get_serial (display_wayland)); _gdk_wayland_display_get_serial (display_wayland));
@ -580,7 +580,7 @@ _gdk_wayland_drag_context_set_coords (GdkDragContext *context,
void void
_gdk_wayland_drag_context_set_source_window (GdkDragContext *context, _gdk_wayland_drag_context_set_source_window (GdkDragContext *context,
GdkWindow *window) GdkSurface *window)
{ {
if (context->source_window) if (context->source_window)
g_object_unref (context->source_window); g_object_unref (context->source_window);
@ -590,7 +590,7 @@ _gdk_wayland_drag_context_set_source_window (GdkDragContext *context,
void void
_gdk_wayland_drag_context_set_dest_window (GdkDragContext *context, _gdk_wayland_drag_context_set_dest_window (GdkDragContext *context,
GdkWindow *dest_window, GdkSurface *dest_window,
uint32_t serial) uint32_t serial)
{ {
if (context->dest_window) if (context->dest_window)
@ -618,7 +618,7 @@ gdk_wayland_drag_context_lookup_by_data_source (struct wl_data_source *source)
} }
GdkDragContext * GdkDragContext *
gdk_wayland_drag_context_lookup_by_source_window (GdkWindow *window) gdk_wayland_drag_context_lookup_by_source_window (GdkSurface *window)
{ {
GList *l; GList *l;

View File

@ -163,7 +163,7 @@ gdk_wayland_gl_context_get_damage (GdkGLContext *context)
GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
EGLSurface egl_surface; EGLSurface egl_surface;
GdkWindow *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); GdkSurface *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context));
int buffer_age = 0; int buffer_age = 0;
if (display_wayland->have_egl_buffer_age) if (display_wayland->have_egl_buffer_age)
@ -176,7 +176,7 @@ gdk_wayland_gl_context_get_damage (GdkGLContext *context)
shared = context; shared = context;
shared_wayland = GDK_WAYLAND_GL_CONTEXT (shared); shared_wayland = GDK_WAYLAND_GL_CONTEXT (shared);
egl_surface = gdk_wayland_window_get_egl_surface (window->impl_window, egl_surface = gdk_wayland_surface_get_egl_surface (window->impl_window,
shared_wayland->egl_config); shared_wayland->egl_config);
gdk_gl_context_make_current (shared); gdk_gl_context_make_current (shared);
eglQuerySurface (display_wayland->egl_display, egl_surface, eglQuerySurface (display_wayland->egl_display, egl_surface,
@ -208,8 +208,8 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
cairo_region_t *damage) cairo_region_t *damage)
{ {
GdkGLContext *context = GDK_GL_CONTEXT (draw_context); GdkGLContext *context = GDK_GL_CONTEXT (draw_context);
GdkWindow *window = gdk_gl_context_get_window (context); GdkSurface *window = gdk_gl_context_get_window (context);
GdkDisplay *display = gdk_window_get_display (window); GdkDisplay *display = gdk_surface_get_display (window);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkWaylandGLContext *context_wayland = GDK_WAYLAND_GL_CONTEXT (context); GdkWaylandGLContext *context_wayland = GDK_WAYLAND_GL_CONTEXT (context);
EGLSurface egl_surface; EGLSurface egl_surface;
@ -220,7 +220,7 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
gdk_gl_context_make_current (context); gdk_gl_context_make_current (context);
egl_surface = gdk_wayland_window_get_egl_surface (window->impl_window, egl_surface = gdk_wayland_surface_get_egl_surface (window->impl_window,
context_wayland->egl_config); context_wayland->egl_config);
if (display_wayland->have_egl_swap_buffers_with_damage && damage != NULL) if (display_wayland->have_egl_swap_buffers_with_damage && damage != NULL)
@ -228,7 +228,7 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
int i, j, n_rects = cairo_region_num_rectangles (damage); int i, j, n_rects = cairo_region_num_rectangles (damage);
EGLint *rects = g_new (EGLint, n_rects * 4); EGLint *rects = g_new (EGLint, n_rects * 4);
cairo_rectangle_int_t rect; cairo_rectangle_int_t rect;
int window_height = gdk_window_get_height (window); int window_height = gdk_surface_get_height (window);
for (i = 0, j = 0; i < n_rects; i++) for (i = 0, j = 0; i < n_rects; i++)
{ {
@ -244,7 +244,7 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context,
else else
eglSwapBuffers (display_wayland->egl_display, egl_surface); eglSwapBuffers (display_wayland->egl_display, egl_surface);
gdk_wayland_window_sync (window); gdk_wayland_surface_sync (window);
} }
static void static void
@ -360,11 +360,11 @@ gdk_wayland_display_init_gl (GdkDisplay *display)
#define MAX_EGL_ATTRS 30 #define MAX_EGL_ATTRS 30
static gboolean static gboolean
find_eglconfig_for_window (GdkWindow *window, find_eglconfig_for_window (GdkSurface *window,
EGLConfig *egl_config_out, EGLConfig *egl_config_out,
GError **error) GError **error)
{ {
GdkDisplay *display = gdk_window_get_display (window); GdkDisplay *display = gdk_surface_get_display (window);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
EGLint attrs[MAX_EGL_ATTRS]; EGLint attrs[MAX_EGL_ATTRS];
EGLint count; EGLint count;
@ -418,12 +418,12 @@ find_eglconfig_for_window (GdkWindow *window,
} }
GdkGLContext * GdkGLContext *
gdk_wayland_window_create_gl_context (GdkWindow *window, gdk_wayland_surface_create_gl_context (GdkSurface *window,
gboolean attached, gboolean attached,
GdkGLContext *share, GdkGLContext *share,
GError **error) GError **error)
{ {
GdkDisplay *display = gdk_window_get_display (window); GdkDisplay *display = gdk_surface_get_display (window);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkWaylandGLContext *context; GdkWaylandGLContext *context;
EGLConfig config; EGLConfig config;
@ -466,8 +466,8 @@ gdk_wayland_gl_context_dispose (GObject *gobject)
if (context_wayland->egl_context != NULL) if (context_wayland->egl_context != NULL)
{ {
GdkGLContext *context = GDK_GL_CONTEXT (gobject); GdkGLContext *context = GDK_GL_CONTEXT (gobject);
GdkWindow *window = gdk_gl_context_get_window (context); GdkSurface *window = gdk_gl_context_get_window (context);
GdkDisplay *display = gdk_window_get_display (window); GdkDisplay *display = gdk_surface_get_display (window);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
if (eglGetCurrentContext () == context_wayland->egl_context) if (eglGetCurrentContext () == context_wayland->egl_context)
@ -490,7 +490,7 @@ gdk_wayland_display_make_gl_context_current (GdkDisplay *display,
{ {
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkWaylandGLContext *context_wayland; GdkWaylandGLContext *context_wayland;
GdkWindow *window; GdkSurface *window;
EGLSurface egl_surface; EGLSurface egl_surface;
if (context == NULL) if (context == NULL)
@ -504,13 +504,13 @@ gdk_wayland_display_make_gl_context_current (GdkDisplay *display,
window = gdk_gl_context_get_window (context); window = gdk_gl_context_get_window (context);
if (context_wayland->is_attached || gdk_draw_context_is_drawing (GDK_DRAW_CONTEXT (context))) if (context_wayland->is_attached || gdk_draw_context_is_drawing (GDK_DRAW_CONTEXT (context)))
egl_surface = gdk_wayland_window_get_egl_surface (window->impl_window, context_wayland->egl_config); egl_surface = gdk_wayland_surface_get_egl_surface (window->impl_window, context_wayland->egl_config);
else else
{ {
if (display_wayland->have_egl_surfaceless_context) if (display_wayland->have_egl_surfaceless_context)
egl_surface = EGL_NO_SURFACE; egl_surface = EGL_NO_SURFACE;
else else
egl_surface = gdk_wayland_window_get_dummy_egl_surface (window->impl_window, egl_surface = gdk_wayland_surface_get_dummy_egl_surface (window->impl_window,
context_wayland->egl_config); context_wayland->egl_config);
} }

View File

@ -46,7 +46,7 @@ struct _GdkWaylandGLContextClass
}; };
gboolean gdk_wayland_display_init_gl (GdkDisplay *display); gboolean gdk_wayland_display_init_gl (GdkDisplay *display);
GdkGLContext * gdk_wayland_window_create_gl_context (GdkWindow *window, GdkGLContext * gdk_wayland_surface_create_gl_context (GdkSurface *window,
gboolean attach, gboolean attach,
GdkGLContext *share, GdkGLContext *share,
GError **error); GError **error);

View File

@ -43,7 +43,7 @@
#define WL_SURFACE_HAS_BUFFER_SCALE 3 #define WL_SURFACE_HAS_BUFFER_SCALE 3
#define WL_POINTER_HAS_FRAME 5 #define WL_POINTER_HAS_FRAME 5
#define GDK_WINDOW_IS_WAYLAND(win) (GDK_IS_WINDOW_IMPL_WAYLAND (((GdkWindow *)win)->impl)) #define GDK_SURFACE_IS_WAYLAND(win) (GDK_IS_SURFACE_IMPL_WAYLAND (((GdkSurface *)win)->impl))
GdkKeymap *_gdk_wayland_keymap_new (GdkDisplay *display); GdkKeymap *_gdk_wayland_keymap_new (GdkDisplay *display);
void _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap, void _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap,
@ -71,7 +71,7 @@ gboolean _gdk_wayland_display_supports_cursor_alpha (GdkDisplay *display);
gboolean _gdk_wayland_display_supports_cursor_color (GdkDisplay *display); gboolean _gdk_wayland_display_supports_cursor_color (GdkDisplay *display);
void gdk_wayland_display_system_bell (GdkDisplay *display, void gdk_wayland_display_system_bell (GdkDisplay *display,
GdkWindow *window); GdkSurface *window);
struct wl_buffer *_gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display, struct wl_buffer *_gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
GdkCursor *cursor, GdkCursor *cursor,
@ -88,24 +88,24 @@ guint _gdk_wayland_cursor_get_next_image_index (GdkWaylandDisplay *display,
guint current_image_index, guint current_image_index,
guint *next_image_delay); guint *next_image_delay);
void gdk_wayland_window_sync (GdkWindow *window); void gdk_wayland_surface_sync (GdkSurface *window);
void _gdk_wayland_window_register_dnd (GdkWindow *window); void _gdk_wayland_surface_register_dnd (GdkSurface *window);
GdkDragContext *_gdk_wayland_window_drag_begin (GdkWindow *window, GdkDragContext *_gdk_wayland_surface_drag_begin (GdkSurface *window,
GdkDevice *device, GdkDevice *device,
GdkContentProvider *content, GdkContentProvider *content,
GdkDragAction actions, GdkDragAction actions,
gint dx, gint dx,
gint dy); gint dy);
void _gdk_wayland_window_offset_next_wl_buffer (GdkWindow *window, void _gdk_wayland_surface_offset_next_wl_buffer (GdkSurface *window,
int x, int x,
int y); int y);
GdkDragContext * _gdk_wayland_drop_context_new (GdkDisplay *display, GdkDragContext * _gdk_wayland_drop_context_new (GdkDisplay *display,
struct wl_data_device *data_device); struct wl_data_device *data_device);
void _gdk_wayland_drag_context_set_source_window (GdkDragContext *context, void _gdk_wayland_drag_context_set_source_window (GdkDragContext *context,
GdkWindow *window); GdkSurface *window);
void _gdk_wayland_drag_context_set_dest_window (GdkDragContext *context, void _gdk_wayland_drag_context_set_dest_window (GdkDragContext *context,
GdkWindow *dest_window, GdkSurface *dest_window,
uint32_t serial); uint32_t serial);
void _gdk_wayland_drag_context_emit_event (GdkDragContext *context, void _gdk_wayland_drag_context_emit_event (GdkDragContext *context,
GdkEventType type, GdkEventType type,
@ -118,16 +118,16 @@ void gdk_wayland_drag_context_set_action (GdkDragContext *context,
GdkDragAction action); GdkDragAction action);
GdkDragContext * gdk_wayland_drag_context_lookup_by_data_source (struct wl_data_source *source); GdkDragContext * gdk_wayland_drag_context_lookup_by_data_source (struct wl_data_source *source);
GdkDragContext * gdk_wayland_drag_context_lookup_by_source_window (GdkWindow *window); GdkDragContext * gdk_wayland_drag_context_lookup_by_source_window (GdkSurface *window);
struct wl_data_source * gdk_wayland_drag_context_get_data_source (GdkDragContext *context); struct wl_data_source * gdk_wayland_drag_context_get_data_source (GdkDragContext *context);
void gdk_wayland_drop_context_update_targets (GdkDragContext *context); void gdk_wayland_drop_context_update_targets (GdkDragContext *context);
void _gdk_wayland_display_create_window_impl (GdkDisplay *display, void _gdk_wayland_display_create_window_impl (GdkDisplay *display,
GdkWindow *window, GdkSurface *window,
GdkWindow *real_parent, GdkSurface *real_parent,
GdkEventMask event_mask, GdkEventMask event_mask,
GdkWindowAttr *attributes); GdkSurfaceAttr *attributes);
gint _gdk_wayland_display_text_property_to_utf8_list (GdkDisplay *display, gint _gdk_wayland_display_text_property_to_utf8_list (GdkDisplay *display,
GdkAtom encoding, GdkAtom encoding,
@ -175,7 +175,7 @@ guint32 gdk_wayland_display_get_output_scale (GdkWaylandDisplay *display_wayland
struct wl_output *gdk_wayland_display_get_wl_output (GdkDisplay *display, struct wl_output *gdk_wayland_display_get_wl_output (GdkDisplay *display,
int monitor_num); int monitor_num);
void _gdk_wayland_window_set_grab_seat (GdkWindow *window, void _gdk_wayland_surface_set_grab_seat (GdkSurface *window,
GdkSeat *seat); GdkSeat *seat);
guint32 _gdk_wayland_display_get_serial (GdkWaylandDisplay *display_wayland); guint32 _gdk_wayland_display_get_serial (GdkWaylandDisplay *display_wayland);
@ -205,29 +205,29 @@ void gdk_wayland_selection_set_offer (GdkDisplay *display,
gpointer gdk_wayland_selection_get_offer (GdkDisplay *display); gpointer gdk_wayland_selection_get_offer (GdkDisplay *display);
GdkContentFormats *gdk_wayland_selection_get_targets (GdkDisplay *display); GdkContentFormats *gdk_wayland_selection_get_targets (GdkDisplay *display);
struct wl_data_source * gdk_wayland_selection_get_data_source (GdkWindow *owner); struct wl_data_source * gdk_wayland_selection_get_data_source (GdkSurface *owner);
void gdk_wayland_selection_unset_data_source (GdkDisplay *display); void gdk_wayland_selection_unset_data_source (GdkDisplay *display);
gboolean gdk_wayland_selection_set_current_offer_actions (GdkDisplay *display, gboolean gdk_wayland_selection_set_current_offer_actions (GdkDisplay *display,
uint32_t actions); uint32_t actions);
EGLSurface gdk_wayland_window_get_egl_surface (GdkWindow *window, EGLSurface gdk_wayland_surface_get_egl_surface (GdkSurface *window,
EGLConfig config); EGLConfig config);
EGLSurface gdk_wayland_window_get_dummy_egl_surface (GdkWindow *window, EGLSurface gdk_wayland_surface_get_dummy_egl_surface (GdkSurface *window,
EGLConfig config); EGLConfig config);
struct gtk_surface1 * gdk_wayland_window_get_gtk_surface (GdkWindow *window); struct gtk_surface1 * gdk_wayland_surface_get_gtk_surface (GdkSurface *window);
void gdk_wayland_seat_set_global_cursor (GdkSeat *seat, void gdk_wayland_seat_set_global_cursor (GdkSeat *seat,
GdkCursor *cursor); GdkCursor *cursor);
struct wl_output *gdk_wayland_window_get_wl_output (GdkWindow *window); struct wl_output *gdk_wayland_surface_get_wl_output (GdkSurface *window);
void gdk_wayland_window_inhibit_shortcuts (GdkWindow *window, void gdk_wayland_surface_inhibit_shortcuts (GdkSurface *window,
GdkSeat *gdk_seat); GdkSeat *gdk_seat);
void gdk_wayland_window_restore_shortcuts (GdkWindow *window, void gdk_wayland_surface_restore_shortcuts (GdkSurface *window,
GdkSeat *gdk_seat); GdkSeat *gdk_seat);
void gdk_wayland_window_update_scale (GdkWindow *window); void gdk_wayland_surface_update_scale (GdkSurface *window);
#endif /* __GDK_PRIVATE_WAYLAND_H__ */ #endif /* __GDK_PRIVATE_WAYLAND_H__ */

View File

@ -427,9 +427,9 @@ static const struct wl_data_source_listener data_source_listener = {
}; };
struct wl_data_source * struct wl_data_source *
gdk_wayland_selection_get_data_source (GdkWindow *owner) gdk_wayland_selection_get_data_source (GdkSurface *owner)
{ {
GdkDisplay *display = gdk_window_get_display (owner); GdkDisplay *display = gdk_surface_get_display (owner);
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display); GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
gpointer source = NULL; gpointer source = NULL;
GdkWaylandDisplay *display_wayland; GdkWaylandDisplay *display_wayland;
@ -437,7 +437,7 @@ gdk_wayland_selection_get_data_source (GdkWindow *owner)
if (wayland_selection->dnd_source) if (wayland_selection->dnd_source)
return wayland_selection->dnd_source; return wayland_selection->dnd_source;
display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (owner)); display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (owner));
source = wl_data_device_manager_create_data_source (display_wayland->data_device_manager); source = wl_data_device_manager_create_data_source (display_wayland->data_device_manager);
wl_data_source_add_listener (source, wl_data_source_add_listener (source,

View File

@ -37,7 +37,7 @@ static VkResult
gdk_wayland_vulkan_context_create_surface (GdkVulkanContext *context, gdk_wayland_vulkan_context_create_surface (GdkVulkanContext *context,
VkSurfaceKHR *surface) VkSurfaceKHR *surface)
{ {
GdkWindow *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); GdkSurface *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context));
GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
/* This is necessary so that Vulkan sees the Window. /* This is necessary so that Vulkan sees the Window.
@ -53,7 +53,7 @@ gdk_wayland_vulkan_context_create_surface (GdkVulkanContext *context,
NULL, NULL,
0, 0,
gdk_wayland_display_get_wl_display (display), gdk_wayland_display_get_wl_display (display),
gdk_wayland_window_get_wl_surface (window) gdk_wayland_surface_get_wl_surface (window)
}, },
NULL, NULL,
surface); surface);
@ -64,11 +64,11 @@ gdk_vulkan_context_wayland_end_frame (GdkDrawContext *context,
cairo_region_t *painted, cairo_region_t *painted,
cairo_region_t *damage) cairo_region_t *damage)
{ {
GdkWindow *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); GdkSurface *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context));
GDK_DRAW_CONTEXT_CLASS (gdk_wayland_vulkan_context_parent_class)->end_frame (context, painted, damage); GDK_DRAW_CONTEXT_CLASS (gdk_wayland_vulkan_context_parent_class)->end_frame (context, painted, damage);
gdk_wayland_window_sync (window); gdk_wayland_surface_sync (window);
} }
static void static void

View File

@ -15,8 +15,8 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef __GDK_WAYLAND_WINDOW_H__ #ifndef __GDK_WAYLAND_SURFACE_H__
#define __GDK_WAYLAND_WINDOW_H__ #define __GDK_WAYLAND_SURFACE_H__
#if !defined (__GDKWAYLAND_H_INSIDE__) && !defined (GDK_COMPILATION) #if !defined (__GDKWAYLAND_H_INSIDE__) && !defined (GDK_COMPILATION)
#error "Only <gdk/gdkwayland.h> can be included directly." #error "Only <gdk/gdkwayland.h> can be included directly."
@ -29,33 +29,33 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#ifdef GDK_COMPILATION #ifdef GDK_COMPILATION
typedef struct _GdkWaylandWindow GdkWaylandWindow; typedef struct _GdkWaylandSurface GdkWaylandSurface;
#else #else
typedef GdkWindow GdkWaylandWindow; typedef GdkSurface GdkWaylandSurface;
#endif #endif
typedef struct _GdkWaylandWindowClass GdkWaylandWindowClass; typedef struct _GdkWaylandSurfaceClass GdkWaylandSurfaceClass;
#define GDK_TYPE_WAYLAND_WINDOW (gdk_wayland_window_get_type()) #define GDK_TYPE_WAYLAND_SURFACE (gdk_wayland_surface_get_type())
#define GDK_WAYLAND_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_WINDOW, GdkWaylandWindow)) #define GDK_WAYLAND_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_SURFACE, GdkWaylandSurface))
#define GDK_WAYLAND_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_WINDOW, GdkWaylandWindowClass)) #define GDK_WAYLAND_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_SURFACE, GdkWaylandSurfaceClass))
#define GDK_IS_WAYLAND_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_WINDOW)) #define GDK_IS_WAYLAND_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_SURFACE))
#define GDK_IS_WAYLAND_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WAYLAND_WINDOW)) #define GDK_IS_WAYLAND_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WAYLAND_SURFACE))
#define GDK_WAYLAND_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_WINDOW, GdkWaylandWindowClass)) #define GDK_WAYLAND_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_SURFACE, GdkWaylandSurfaceClass))
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GType gdk_wayland_window_get_type (void); GType gdk_wayland_surface_get_type (void);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkWindow * gdk_wayland_window_new_subsurface (GdkDisplay *display, GdkSurface * gdk_wayland_surface_new_subsurface (GdkDisplay *display,
const GdkRectangle *position); const GdkRectangle *position);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
struct wl_surface *gdk_wayland_window_get_wl_surface (GdkWindow *window); struct wl_surface *gdk_wayland_surface_get_wl_surface (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_wayland_window_set_use_custom_surface (GdkWindow *window); void gdk_wayland_surface_set_use_custom_surface (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_wayland_window_set_dbus_properties_libgtk_only (GdkWindow *window, void gdk_wayland_surface_set_dbus_properties_libgtk_only (GdkSurface *window,
const char *application_id, const char *application_id,
const char *app_menu_path, const char *app_menu_path,
const char *menubar_path, const char *menubar_path,
@ -63,25 +63,25 @@ void gdk_wayland_window_set_dbus_properties_libgtk_only (Gdk
const char *application_object_path, const char *application_object_path,
const char *unique_bus_name); const char *unique_bus_name);
typedef void (*GdkWaylandWindowExported) (GdkWindow *window, typedef void (*GdkWaylandSurfaceExported) (GdkSurface *window,
const char *handle, const char *handle,
gpointer user_data); gpointer user_data);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_wayland_window_export_handle (GdkWindow *window, gboolean gdk_wayland_surface_export_handle (GdkSurface *window,
GdkWaylandWindowExported callback, GdkWaylandSurfaceExported callback,
gpointer user_data, gpointer user_data,
GDestroyNotify destroy_func); GDestroyNotify destroy_func);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gdk_wayland_window_unexport_handle (GdkWindow *window); void gdk_wayland_surface_unexport_handle (GdkSurface *window);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gdk_wayland_window_set_transient_for_exported (GdkWindow *window, gboolean gdk_wayland_surface_set_transient_for_exported (GdkSurface *window,
char *parent_handle_str); char *parent_handle_str);
void gdk_wayland_window_announce_csd (GdkWindow *window); void gdk_wayland_surface_announce_csd (GdkSurface *window);
G_END_DECLS G_END_DECLS
#endif /* __GDK_WAYLAND_WINDOW_H__ */ #endif /* __GDK_WAYLAND_SURFACE_H__ */

File diff suppressed because it is too large Load Diff

View File

@ -65,7 +65,7 @@ _gdk_device_virtual_set_active (GdkDevice *device,
static gboolean static gboolean
gdk_device_virtual_get_history (GdkDevice *device, gdk_device_virtual_get_history (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
guint32 start, guint32 start,
guint32 stop, guint32 stop,
GdkTimeCoord ***events, GdkTimeCoord ***events,
@ -77,7 +77,7 @@ gdk_device_virtual_get_history (GdkDevice *device,
static void static void
gdk_device_virtual_get_state (GdkDevice *device, gdk_device_virtual_get_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gdouble *axes, gdouble *axes,
GdkModifierType *mask) GdkModifierType *mask)
{ {
@ -90,12 +90,12 @@ gdk_device_virtual_get_state (GdkDevice *device,
static void static void
gdk_device_virtual_set_window_cursor (GdkDevice *device, gdk_device_virtual_set_window_cursor (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkCursor *cursor) GdkCursor *cursor)
{ {
if (cursor != NULL) if (cursor != NULL)
{ {
GdkDisplay *display = gdk_window_get_display (window); GdkDisplay *display = gdk_surface_get_display (window);
HCURSOR hcursor = NULL; HCURSOR hcursor = NULL;
if (display != NULL) if (display != NULL)
@ -116,8 +116,8 @@ gdk_device_virtual_warp (GdkDevice *device,
static void static void
gdk_device_virtual_query_state (GdkDevice *device, gdk_device_virtual_query_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkWindow **child_window, GdkSurface **child_window,
gdouble *root_x, gdouble *root_x,
gdouble *root_y, gdouble *root_y,
gdouble *win_x, gdouble *win_x,
@ -135,14 +135,14 @@ gdk_device_virtual_query_state (GdkDevice *device,
static GdkGrabStatus static GdkGrabStatus
gdk_device_virtual_grab (GdkDevice *device, gdk_device_virtual_grab (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gboolean owner_events, gboolean owner_events,
GdkEventMask event_mask, GdkEventMask event_mask,
GdkWindow *confine_to, GdkSurface *confine_to,
GdkCursor *cursor, GdkCursor *cursor,
guint32 time_) guint32 time_)
{ {
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD) if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
{ {
@ -160,7 +160,7 @@ gdk_device_virtual_grab (GdkDevice *device,
else else
SetCursor (LoadCursor (NULL, IDC_ARROW)); SetCursor (LoadCursor (NULL, IDC_ARROW));
SetCapture (GDK_WINDOW_HWND (window)); SetCapture (GDK_SURFACE_HWND (window));
} }
return GDK_GRAB_SUCCESS; return GDK_GRAB_SUCCESS;
@ -199,7 +199,7 @@ gdk_device_virtual_ungrab (GdkDevice *device,
static void static void
gdk_device_virtual_select_window_events (GdkDevice *device, gdk_device_virtual_select_window_events (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkEventMask event_mask) GdkEventMask event_mask)
{ {
} }
@ -216,7 +216,7 @@ gdk_device_virtual_class_init (GdkDeviceVirtualClass *klass)
device_class->query_state = gdk_device_virtual_query_state; device_class->query_state = gdk_device_virtual_query_state;
device_class->grab = gdk_device_virtual_grab; device_class->grab = gdk_device_virtual_grab;
device_class->ungrab = gdk_device_virtual_ungrab; device_class->ungrab = gdk_device_virtual_ungrab;
device_class->window_at_position = _gdk_device_win32_window_at_position; device_class->window_at_position = _gdk_device_win32_surface_at_position;
device_class->select_window_events = gdk_device_virtual_select_window_events; device_class->select_window_events = gdk_device_virtual_select_window_events;
} }

View File

@ -30,7 +30,7 @@ G_DEFINE_TYPE (GdkDeviceWin32, gdk_device_win32, GDK_TYPE_DEVICE)
static gboolean static gboolean
gdk_device_win32_get_history (GdkDevice *device, gdk_device_win32_get_history (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
guint32 start, guint32 start,
guint32 stop, guint32 stop,
GdkTimeCoord ***events, GdkTimeCoord ***events,
@ -41,13 +41,13 @@ gdk_device_win32_get_history (GdkDevice *device,
static void static void
gdk_device_win32_get_state (GdkDevice *device, gdk_device_win32_get_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gdouble *axes, gdouble *axes,
GdkModifierType *mask) GdkModifierType *mask)
{ {
gint x_int, y_int; gint x_int, y_int;
gdk_window_get_device_position (window, device, &x_int, &y_int, mask); gdk_surface_get_device_position (window, device, &x_int, &y_int, mask);
if (axes) if (axes)
{ {
@ -58,7 +58,7 @@ gdk_device_win32_get_state (GdkDevice *device,
static void static void
gdk_device_win32_set_window_cursor (GdkDevice *device, gdk_device_win32_set_window_cursor (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkCursor *cursor) GdkCursor *cursor)
{ {
} }
@ -98,8 +98,8 @@ get_current_mask (void)
static void static void
gdk_device_win32_query_state (GdkDevice *device, gdk_device_win32_query_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkWindow **child_window, GdkSurface **child_window,
gdouble *root_x, gdouble *root_x,
gdouble *root_y, gdouble *root_y,
gdouble *win_x, gdouble *win_x,
@ -112,8 +112,8 @@ gdk_device_win32_query_state (GdkDevice *device,
if (window) if (window)
{ {
scale = GDK_WINDOW_IMPL_WIN32 (window->impl)->window_scale; scale = GDK_SURFACE_IMPL_WIN32 (window->impl)->window_scale;
hwnd = GDK_WINDOW_HWND (window); hwnd = GDK_SURFACE_HWND (window);
} }
else else
{ {
@ -171,10 +171,10 @@ gdk_device_win32_query_state (GdkDevice *device,
static GdkGrabStatus static GdkGrabStatus
gdk_device_win32_grab (GdkDevice *device, gdk_device_win32_grab (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gboolean owner_events, gboolean owner_events,
GdkEventMask event_mask, GdkEventMask event_mask,
GdkWindow *confine_to, GdkSurface *confine_to,
GdkCursor *cursor, GdkCursor *cursor,
guint32 time_) guint32 time_)
{ {
@ -195,15 +195,15 @@ screen_to_client (HWND hwnd, POINT screen_pt, POINT *client_pt)
ScreenToClient (hwnd, client_pt); ScreenToClient (hwnd, client_pt);
} }
GdkWindow * GdkSurface *
_gdk_device_win32_window_at_position (GdkDevice *device, _gdk_device_win32_surface_at_position (GdkDevice *device,
gdouble *win_x, gdouble *win_x,
gdouble *win_y, gdouble *win_y,
GdkModifierType *mask, GdkModifierType *mask,
gboolean get_toplevel) gboolean get_toplevel)
{ {
GdkWindow *window = NULL; GdkSurface *window = NULL;
GdkWindowImplWin32 *impl = NULL; GdkSurfaceImplWin32 *impl = NULL;
POINT screen_pt, client_pt; POINT screen_pt, client_pt;
HWND hwnd, hwndc; HWND hwnd, hwndc;
RECT rect; RECT rect;
@ -223,7 +223,7 @@ _gdk_device_win32_window_at_position (GdkDevice *device,
window = gdk_win32_handle_table_lookup (hwnd); window = gdk_win32_handle_table_lookup (hwnd);
if (window != NULL && if (window != NULL &&
GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN) GDK_SURFACE_TYPE (window) != GDK_SURFACE_FOREIGN)
break; break;
screen_to_client (hwnd, screen_pt, &client_pt); screen_to_client (hwnd, screen_pt, &client_pt);
@ -268,7 +268,7 @@ _gdk_device_win32_window_at_position (GdkDevice *device,
if (window && (win_x || win_y)) if (window && (win_x || win_y))
{ {
impl = GDK_WINDOW_IMPL_WIN32 (window->impl); impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
if (win_x) if (win_x)
*win_x = client_pt.x / impl->window_scale; *win_x = client_pt.x / impl->window_scale;
@ -281,7 +281,7 @@ _gdk_device_win32_window_at_position (GdkDevice *device,
static void static void
gdk_device_win32_select_window_events (GdkDevice *device, gdk_device_win32_select_window_events (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkEventMask event_mask) GdkEventMask event_mask)
{ {
} }
@ -298,7 +298,7 @@ gdk_device_win32_class_init (GdkDeviceWin32Class *klass)
device_class->query_state = gdk_device_win32_query_state; device_class->query_state = gdk_device_win32_query_state;
device_class->grab = gdk_device_win32_grab; device_class->grab = gdk_device_win32_grab;
device_class->ungrab = gdk_device_win32_ungrab; device_class->ungrab = gdk_device_win32_ungrab;
device_class->window_at_position = _gdk_device_win32_window_at_position; device_class->window_at_position = _gdk_device_win32_surface_at_position;
device_class->select_window_events = gdk_device_win32_select_window_events; device_class->select_window_events = gdk_device_win32_select_window_events;
} }

View File

@ -44,7 +44,7 @@ struct _GdkDeviceWin32Class
GType gdk_device_win32_get_type (void) G_GNUC_CONST; GType gdk_device_win32_get_type (void) G_GNUC_CONST;
GdkWindow *_gdk_device_win32_window_at_position (GdkDevice *device, GdkSurface *_gdk_device_win32_surface_at_position (GdkDevice *device,
gdouble *win_x, gdouble *win_x,
gdouble *win_y, gdouble *win_y,
GdkModifierType *mask, GdkModifierType *mask,

View File

@ -30,7 +30,7 @@ G_DEFINE_TYPE (GdkDeviceWintab, gdk_device_wintab, GDK_TYPE_DEVICE)
static gboolean static gboolean
gdk_device_wintab_get_history (GdkDevice *device, gdk_device_wintab_get_history (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
guint32 start, guint32 start,
guint32 stop, guint32 stop,
GdkTimeCoord ***events, GdkTimeCoord ***events,
@ -67,7 +67,7 @@ get_current_mask (void)
static void static void
gdk_device_wintab_get_state (GdkDevice *device, gdk_device_wintab_get_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gdouble *axes, gdouble *axes,
GdkModifierType *mask) GdkModifierType *mask)
{ {
@ -94,7 +94,7 @@ gdk_device_wintab_get_state (GdkDevice *device,
static void static void
gdk_device_wintab_set_window_cursor (GdkDevice *device, gdk_device_wintab_set_window_cursor (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkCursor *cursor) GdkCursor *cursor)
{ {
} }
@ -108,8 +108,8 @@ gdk_device_wintab_warp (GdkDevice *device,
static void static void
gdk_device_wintab_query_state (GdkDevice *device, gdk_device_wintab_query_state (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkWindow **child_window, GdkSurface **child_window,
gdouble *root_x, gdouble *root_x,
gdouble *root_y, gdouble *root_y,
gdouble *win_x, gdouble *win_x,
@ -119,14 +119,14 @@ gdk_device_wintab_query_state (GdkDevice *device,
GdkDeviceWintab *device_wintab; GdkDeviceWintab *device_wintab;
POINT point; POINT point;
HWND hwnd, hwndc; HWND hwnd, hwndc;
GdkWindowImplWin32 *impl; GdkSurfaceImplWin32 *impl;
int scale; int scale;
device_wintab = GDK_DEVICE_WINTAB (device); device_wintab = GDK_DEVICE_WINTAB (device);
if (window) if (window)
{ {
scale = GDK_WINDOW_IMPL_WIN32 (window->impl)->window_scale; scale = GDK_SURFACE_IMPL_WIN32 (window->impl)->window_scale;
hwnd = GDK_WINDOW_HWND (window); hwnd = GDK_SURFACE_HWND (window);
} }
else else
{ {
@ -186,10 +186,10 @@ gdk_device_wintab_query_state (GdkDevice *device,
static GdkGrabStatus static GdkGrabStatus
gdk_device_wintab_grab (GdkDevice *device, gdk_device_wintab_grab (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
gboolean owner_events, gboolean owner_events,
GdkEventMask event_mask, GdkEventMask event_mask,
GdkWindow *confine_to, GdkSurface *confine_to,
GdkCursor *cursor, GdkCursor *cursor,
guint32 time_) guint32 time_)
{ {
@ -202,7 +202,7 @@ gdk_device_wintab_ungrab (GdkDevice *device,
{ {
} }
static GdkWindow * static GdkSurface *
gdk_device_wintab_window_at_position (GdkDevice *device, gdk_device_wintab_window_at_position (GdkDevice *device,
gdouble *win_x, gdouble *win_x,
gdouble *win_y, gdouble *win_y,
@ -214,30 +214,30 @@ gdk_device_wintab_window_at_position (GdkDevice *device,
static void static void
gdk_device_wintab_select_window_events (GdkDevice *device, gdk_device_wintab_select_window_events (GdkDevice *device,
GdkWindow *window, GdkSurface *window,
GdkEventMask event_mask) GdkEventMask event_mask)
{ {
} }
void void
_gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab, _gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab,
GdkWindow *window, GdkSurface *window,
gdouble *axes, gdouble *axes,
gdouble *x, gdouble *x,
gdouble *y) gdouble *y)
{ {
GdkDevice *device; GdkDevice *device;
GdkWindow *impl_window; GdkSurface *impl_window;
gint root_x, root_y; gint root_x, root_y;
gdouble temp_x, temp_y; gdouble temp_x, temp_y;
gint i; gint i;
GdkDisplay *display; GdkDisplay *display;
device = GDK_DEVICE (device_wintab); device = GDK_DEVICE (device_wintab);
impl_window = _gdk_window_get_impl_window (window); impl_window = _gdk_surface_get_impl_window (window);
temp_x = temp_y = 0; temp_x = temp_y = 0;
gdk_window_get_origin (impl_window, &root_x, &root_y); gdk_surface_get_origin (impl_window, &root_x, &root_y);
display = gdk_device_get_display (device); display = gdk_device_get_display (device);
@ -260,7 +260,7 @@ _gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab,
HMONITOR hmonitor; HMONITOR hmonitor;
MONITORINFO minfo = {sizeof (MONITORINFO),}; MONITORINFO minfo = {sizeof (MONITORINFO),};
hmonitor = MonitorFromWindow (GDK_WINDOW_HWND (window), hmonitor = MonitorFromWindow (GDK_SURFACE_HWND (window),
MONITOR_DEFAULTTONEAREST); MONITOR_DEFAULTTONEAREST);
GetMonitorInfo (hmonitor, &minfo); GetMonitorInfo (hmonitor, &minfo);

View File

@ -61,7 +61,7 @@ struct _GdkDeviceWintabClass
GType gdk_device_wintab_get_type (void) G_GNUC_CONST; GType gdk_device_wintab_get_type (void) G_GNUC_CONST;
void _gdk_device_wintab_translate_axes (GdkDeviceWintab *device, void _gdk_device_wintab_translate_axes (GdkDeviceWintab *device,
GdkWindow *window, GdkSurface *window,
gdouble *axes, gdouble *axes,
gdouble *x, gdouble *x,
gdouble *y); gdouble *y);

View File

@ -43,7 +43,7 @@
#define TWOPI (2 * G_PI) #define TWOPI (2 * G_PI)
static GList *wintab_contexts = NULL; static GList *wintab_contexts = NULL;
static GdkWindow *wintab_window = NULL; static GdkSurface *wintab_window = NULL;
extern gint _gdk_input_ignore_core; extern gint _gdk_input_ignore_core;
typedef UINT (WINAPI *t_WTInfoA) (UINT a, UINT b, LPVOID c); typedef UINT (WINAPI *t_WTInfoA) (UINT a, UINT b, LPVOID c);
@ -432,7 +432,7 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager)
ndevices, ncursors)); ndevices, ncursors));
#endif #endif
/* Create a dummy window to receive wintab events */ /* Create a dummy window to receive wintab events */
wintab_window = gdk_window_new_popup (display, &(GdkRectangle) { -100, -100, 2, 2 }); wintab_window = gdk_surface_new_popup (display, &(GdkRectangle) { -100, -100, 2, 2 });
g_object_ref (wintab_window); g_object_ref (wintab_window);
for (devix = 0; devix < ndevices; devix++) for (devix = 0; devix < ndevices; devix++)
@ -496,7 +496,7 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager)
print_lc(&lc))); print_lc(&lc)));
#endif #endif
hctx = g_new (HCTX, 1); hctx = g_new (HCTX, 1);
if ((*hctx = (*p_WTOpenA) (GDK_WINDOW_HWND (wintab_window), &lc, TRUE)) == NULL) if ((*hctx = (*p_WTOpenA) (GDK_SURFACE_HWND (wintab_window), &lc, TRUE)) == NULL)
{ {
g_warning ("gdk_input_wintab_init: WTOpen failed"); g_warning ("gdk_input_wintab_init: WTOpen failed");
return; return;
@ -831,7 +831,7 @@ decode_tilt (gint *axis_data,
/* /*
* Get the currently active keyboard modifiers (ignoring the mouse buttons) * Get the currently active keyboard modifiers (ignoring the mouse buttons)
* We could use gdk_window_get_pointer but that function does a lot of other * We could use gdk_surface_get_pointer but that function does a lot of other
* expensive things besides getting the modifiers. This code is somewhat based * expensive things besides getting the modifiers. This code is somewhat based
* on build_pointer_event_state from gdkevents-win32.c * on build_pointer_event_state from gdkevents-win32.c
*/ */
@ -878,7 +878,7 @@ gboolean
gdk_input_other_event (GdkDisplay *display, gdk_input_other_event (GdkDisplay *display,
GdkEvent *event, GdkEvent *event,
MSG *msg, MSG *msg,
GdkWindow *window) GdkSurface *window)
{ {
GdkDeviceManagerWin32 *device_manager; GdkDeviceManagerWin32 *device_manager;
GdkDeviceWintab *source_device = NULL; GdkDeviceWintab *source_device = NULL;
@ -886,7 +886,7 @@ gdk_input_other_event (GdkDisplay *display,
GdkEventMask masktest; GdkEventMask masktest;
guint key_state; guint key_state;
POINT pt; POINT pt;
GdkWindowImplWin32 *impl; GdkSurfaceImplWin32 *impl;
PACKET packet; PACKET packet;
gint root_x, root_y; gint root_x, root_y;
@ -912,7 +912,7 @@ gdk_input_other_event (GdkDisplay *display,
GDK_NOTE (EVENTS_OR_INPUT, GDK_NOTE (EVENTS_OR_INPUT,
g_print ("gdk_input_other_event: window=%p %+d%+d\n", g_print ("gdk_input_other_event: window=%p %+d%+d\n",
window ? GDK_WINDOW_HWND (window) : NULL, x, y)); window ? GDK_SURFACE_HWND (window) : NULL, x, y));
if (msg->message == WT_PACKET || msg->message == WT_CSRCHANGE) if (msg->message == WT_PACKET || msg->message == WT_CSRCHANGE)
{ {
@ -1060,28 +1060,28 @@ gdk_input_other_event (GdkDisplay *display,
/* Now we can check if the window wants the event, and /* Now we can check if the window wants the event, and
* propagate if necessary. * propagate if necessary.
*/ */
while ((gdk_window_get_device_events (window, GDK_DEVICE (source_device)) & masktest) == 0 && while ((gdk_surface_get_device_events (window, GDK_DEVICE (source_device)) & masktest) == 0 &&
(gdk_device_get_device_type (GDK_DEVICE (source_device)) == GDK_DEVICE_TYPE_SLAVE && (gdk_device_get_device_type (GDK_DEVICE (source_device)) == GDK_DEVICE_TYPE_SLAVE &&
(gdk_window_get_events (window) & masktest) == 0)) (gdk_surface_get_events (window) & masktest) == 0))
{ {
GDK_NOTE (EVENTS_OR_INPUT, g_print ("... not selected\n")); GDK_NOTE (EVENTS_OR_INPUT, g_print ("... not selected\n"));
if (window->parent == NULL) if (window->parent == NULL)
return FALSE; return FALSE;
impl = GDK_WINDOW_IMPL_WIN32 (window->impl); impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
pt.x = x * impl->window_scale; pt.x = x * impl->window_scale;
pt.y = y * impl->window_scale; pt.y = y * impl->window_scale;
ClientToScreen (GDK_WINDOW_HWND (window), &pt); ClientToScreen (GDK_SURFACE_HWND (window), &pt);
g_object_unref (window); g_object_unref (window);
window = window->parent; window = window->parent;
impl = GDK_WINDOW_IMPL_WIN32 (window->impl); impl = GDK_SURFACE_IMPL_WIN32 (window->impl);
g_object_ref (window); g_object_ref (window);
ScreenToClient (GDK_WINDOW_HWND (window), &pt); ScreenToClient (GDK_SURFACE_HWND (window), &pt);
x = pt.x / impl->window_scale; x = pt.x / impl->window_scale;
y = pt.y / impl->window_scale; y = pt.y / impl->window_scale;
GDK_NOTE (EVENTS_OR_INPUT, g_print ("... propagating to %p %+d%+d\n", GDK_NOTE (EVENTS_OR_INPUT, g_print ("... propagating to %p %+d%+d\n",
GDK_WINDOW_HWND (window), x, y)); GDK_SURFACE_HWND (window), x, y));
} }
event->any.window = window; event->any.window = window;
@ -1096,7 +1096,7 @@ gdk_input_other_event (GdkDisplay *display,
gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer)); gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer));
event->button.axes = g_new (gdouble, num_axes); event->button.axes = g_new (gdouble, num_axes);
gdk_window_get_origin (window, &root_x, &root_y); gdk_surface_get_origin (window, &root_x, &root_y);
_gdk_device_wintab_translate_axes (source_device, _gdk_device_wintab_translate_axes (source_device,
window, window,
@ -1128,7 +1128,7 @@ gdk_input_other_event (GdkDisplay *display,
gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer)); gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer));
event->motion.axes = g_new (gdouble, num_axes); event->motion.axes = g_new (gdouble, num_axes);
gdk_window_get_origin (window, &root_x, &root_y); gdk_surface_get_origin (window, &root_x, &root_y);
_gdk_device_wintab_translate_axes (source_device, _gdk_device_wintab_translate_axes (source_device,
window, window,

View File

@ -60,7 +60,7 @@ void _gdk_input_set_tablet_active (void);
gboolean gdk_input_other_event (GdkDisplay *display, gboolean gdk_input_other_event (GdkDisplay *display,
GdkEvent *event, GdkEvent *event,
MSG *msg, MSG *msg,
GdkWindow *window); GdkSurface *window);
G_END_DECLS G_END_DECLS

View File

@ -492,7 +492,7 @@ gdk_win32_display_get_name (GdkDisplay *display)
return display_name_cache; return display_name_cache;
} }
static GdkWindow * static GdkSurface *
gdk_win32_display_get_default_group (GdkDisplay *display) gdk_win32_display_get_default_group (GdkDisplay *display)
{ {
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
@ -1143,7 +1143,7 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
object_class->dispose = gdk_win32_display_dispose; object_class->dispose = gdk_win32_display_dispose;
object_class->finalize = gdk_win32_display_finalize; object_class->finalize = gdk_win32_display_finalize;
display_class->window_type = GDK_TYPE_WIN32_WINDOW; display_class->window_type = GDK_TYPE_WIN32_SURFACE;
display_class->get_name = gdk_win32_display_get_name; display_class->get_name = gdk_win32_display_get_name;
display_class->beep = gdk_win32_display_beep; display_class->beep = gdk_win32_display_beep;
@ -1184,5 +1184,5 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
display_class->get_last_seen_time = gdk_win32_display_get_last_seen_time; display_class->get_last_seen_time = gdk_win32_display_get_last_seen_time;
display_class->set_cursor_theme = gdk_win32_display_set_cursor_theme; display_class->set_cursor_theme = gdk_win32_display_set_cursor_theme;
_gdk_win32_windowing_init (); _gdk_win32_surfaceing_init ();
} }

Some files were not shown because too many files have changed in this diff Show More