diff options
227 files changed, 7959 insertions, 7959 deletions
diff --git a/demos/gtk-demo/application.c b/demos/gtk-demo/application.c index dec3ad2974..50fdf7e386 100644 --- a/demos/gtk-demo/application.c +++ b/demos/gtk-demo/application.c @@ -473,11 +473,11 @@ static void window_state_changed (GtkWidget *widget) { DemoApplicationWindow *window = (DemoApplicationWindow *)widget; - GdkWindowState new_state; + GdkSurfaceState new_state; - new_state = gdk_window_get_state (gtk_widget_get_window (widget)); - window->maximized = (new_state & GDK_WINDOW_STATE_MAXIMIZED) != 0; - window->fullscreen = (new_state & GDK_WINDOW_STATE_FULLSCREEN) != 0; + new_state = gdk_surface_get_state (gtk_widget_get_window (widget)); + window->maximized = (new_state & GDK_SURFACE_STATE_MAXIMIZED) != 0; + window->fullscreen = (new_state & GDK_SURFACE_STATE_FULLSCREEN) != 0; } static void diff --git a/demos/gtk-demo/changedisplay.c b/demos/gtk-demo/changedisplay.c index 28cb194229..d6a8533fc6 100644 --- a/demos/gtk-demo/changedisplay.c +++ b/demos/gtk-demo/changedisplay.c @@ -68,19 +68,19 @@ enum static GtkWidget * find_toplevel_at_pointer (GdkDisplay *display) { - GdkWindow *pointer_window; + GdkSurface *pointer_window; GtkWidget *widget = NULL; pointer_window = gdk_device_get_window_at_position (gtk_get_current_event_device (), 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. */ if (pointer_window) { gpointer widget_ptr; - gdk_window_get_user_data (pointer_window, &widget_ptr); + gdk_surface_get_user_data (pointer_window, &widget_ptr); widget = widget_ptr; } diff --git a/demos/gtk-demo/drawingarea.c b/demos/gtk-demo/drawingarea.c index 985345de8a..387754bc25 100644 --- a/demos/gtk-demo/drawingarea.c +++ b/demos/gtk-demo/drawingarea.c @@ -137,7 +137,7 @@ checkerboard_draw (GtkDrawingArea *da, /* 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 * 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. */ diff --git a/demos/gtk-demo/list_store.c b/demos/gtk-demo/list_store.c index 3055eb24c9..0662fd1979 100644 --- a/demos/gtk-demo/list_store.c +++ b/demos/gtk-demo/list_store.c @@ -37,7 +37,7 @@ enum static Bug data[] = { { 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" }, { TRUE, 52877, "Major", "GtkFileSelection needs a refresh method. " }, { FALSE, 56070, "Normal", "Can't click button after setting in sensitive" }, diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c index bf009ab46f..27669c2831 100644 --- a/demos/gtk-demo/main.c +++ b/demos/gtk-demo/main.c @@ -250,7 +250,7 @@ static gchar *types[] = "GtkTreeSelection ", "GdkDisplay ", "GdkScreen ", - "GdkWindow ", + "GdkSurface ", "GdkEventButton ", "GdkCursor ", "GtkTreeIter ", diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c index 64224d0136..f00f84ab3c 100644 --- a/demos/widget-factory/widget-factory.c +++ b/demos/widget-factory/widget-factory.c @@ -64,7 +64,7 @@ get_idle (gpointer data) GtkApplication *app = gtk_window_get_application (GTK_WINDOW (window)); 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)); return G_SOURCE_REMOVE; @@ -81,7 +81,7 @@ get_busy (GSimpleAction *action, g_application_mark_busy (G_APPLICATION (app)); 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_timeout_add (5000, get_idle, window); diff --git a/docs/developers.txt b/docs/developers.txt index 66e1d9309b..9e242e681c 100644 --- a/docs/developers.txt +++ b/docs/developers.txt @@ -26,13 +26,13 @@ Refer to the file widget_system.txt which covers widget flags and the 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 -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 -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 window field of the event structure to be != NULL, if it is going to perform any operations through Gdk calls on it. @@ -51,10 +51,10 @@ GDK_EXPOSE GtkWidget::expose_event Writing Gdk functions --------------------- -When writing Gdk functions that operate on GdkWindow structures in any -meaningful sense, that is casting to a GdkWindowPrivate structure for -access to fields other then GdkWindow.user_data, the programmer is -recommended to check for the GdkWindowPrivate.destroyed field to be == -FALSE, especially if the GdkWindowPrivate.xwindow field is used. +When writing Gdk functions that operate on GdkSurface structures in any +meaningful sense, that is casting to a GdkSurfacePrivate structure for +access to fields other then GdkSurface.user_data, the programmer is +recommended to check for the GdkSurfacePrivate.destroyed field to be == +FALSE, especially if the GdkSurfacePrivate.xwindow field is used. Silent abortion of the Gdk function is the correct behaviour if this condition isn't met. diff --git a/docs/dnd_internals.txt b/docs/dnd_internals.txt index fc5afcecc0..4e8929f87a 100644 --- a/docs/dnd_internals.txt +++ b/docs/dnd_internals.txt @@ -81,19 +81,19 @@ GdkAtom gdk_drag_get_selection (GdkDragContext *context); /* Source side */ -GdkDragContext * gdk_drag_begin (GdkWindow *window, +GdkDragContext * gdk_drag_begin (GdkSurface *window, GList *targets, GdkDragAction actions); gboolean gdk_drag_get_protocol (guint32 xid, GdkDragProtocol *protocol); void gdk_drag_find_window (GdkDragContext *context, - GdkWindow *drag_window, + GdkSurface *drag_window, gint x_root, gint y_root, - GdkWindow **dest_window, + GdkSurface **dest_window, GdkDragProtocol *protocol); gboolean gdk_drag_motion (GdkDragContext *context, - GdkWindow *dest_window, + GdkSurface *dest_window, GdkDragProtocol protocol, gint x_root, gint y_root, diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt index c63a170560..215350d448 100644 --- a/docs/reference/gdk/gdk4-sections.txt +++ b/docs/reference/gdk/gdk4-sections.txt @@ -47,12 +47,12 @@ gdk_scroll_direction_get_type gdk_setting_action_get_type gdk_status_get_type gdk_visibility_state_get_type -gdk_window_attributes_type_get_type -gdk_window_edge_get_type -gdk_window_hints_get_type -gdk_window_state_get_type -gdk_window_type_get_type -gdk_window_type_hint_get_type +gdk_surface_attributes_type_get_type +gdk_surface_edge_get_type +gdk_surface_hints_get_type +gdk_surface_state_get_type +gdk_surface_type_get_type +gdk_surface_type_hint_get_type gdk_wm_decoration_get_type gdk_wm_function_get_type GDK_AVAILABLE_IN_4_0 @@ -169,186 +169,186 @@ gdk_rgba_get_type <SECTION> <TITLE>Windows</TITLE> <FILE>windows</FILE> -GdkWindow -GdkWindowType -GdkWindowClass -GdkWindowHints +GdkSurface +GdkSurfaceType +GdkSurfaceClass +GdkSurfaceHints GdkGeometry GdkGravity GdkAnchorHints -GdkWindowEdge -GdkWindowTypeHint -GdkWindowState -gdk_window_new_toplevel -gdk_window_new_popup -gdk_window_new_temp -gdk_window_new_child -gdk_window_destroy -gdk_window_get_window_type -gdk_window_get_display -gdk_window_show -gdk_window_show_unraised -gdk_window_hide -gdk_window_is_destroyed -gdk_window_is_visible -gdk_window_is_viewable -gdk_window_is_input_only -gdk_window_is_shaped -gdk_window_get_state -gdk_window_withdraw -gdk_window_iconify -gdk_window_deiconify -gdk_window_stick -gdk_window_unstick -gdk_window_maximize -gdk_window_unmaximize -gdk_window_fullscreen -gdk_window_fullscreen_on_monitor -gdk_window_unfullscreen +GdkSurfaceEdge +GdkSurfaceTypeHint +GdkSurfaceState +gdk_surface_new_toplevel +gdk_surface_new_popup +gdk_surface_new_temp +gdk_surface_new_child +gdk_surface_destroy +gdk_surface_get_window_type +gdk_surface_get_display +gdk_surface_show +gdk_surface_show_unraised +gdk_surface_hide +gdk_surface_is_destroyed +gdk_surface_is_visible +gdk_surface_is_viewable +gdk_surface_is_input_only +gdk_surface_is_shaped +gdk_surface_get_state +gdk_surface_withdraw +gdk_surface_iconify +gdk_surface_deiconify +gdk_surface_stick +gdk_surface_unstick +gdk_surface_maximize +gdk_surface_unmaximize +gdk_surface_fullscreen +gdk_surface_fullscreen_on_monitor +gdk_surface_unfullscreen GdkFullscreenMode -gdk_window_get_fullscreen_mode -gdk_window_set_fullscreen_mode -gdk_window_set_keep_above -gdk_window_set_keep_below -gdk_window_set_opacity -gdk_window_set_pass_through -gdk_window_get_pass_through -gdk_window_move -gdk_window_resize -gdk_window_move_resize -gdk_window_scroll -gdk_window_move_region -gdk_window_has_native -gdk_window_raise -gdk_window_lower -gdk_window_restack -gdk_window_focus -gdk_window_register_dnd -gdk_window_begin_resize_drag -gdk_window_begin_resize_drag_for_device -gdk_window_begin_move_drag -gdk_window_begin_move_drag_for_device -gdk_window_show_window_menu -gdk_window_constrain_size -gdk_window_beep -gdk_window_get_scale_factor -gdk_window_set_opaque_region -gdk_window_create_gl_context -gdk_window_create_vulkan_context +gdk_surface_get_fullscreen_mode +gdk_surface_set_fullscreen_mode +gdk_surface_set_keep_above +gdk_surface_set_keep_below +gdk_surface_set_opacity +gdk_surface_set_pass_through +gdk_surface_get_pass_through +gdk_surface_move +gdk_surface_resize +gdk_surface_move_resize +gdk_surface_scroll +gdk_surface_move_region +gdk_surface_has_native +gdk_surface_raise +gdk_surface_lower +gdk_surface_restack +gdk_surface_focus +gdk_surface_register_dnd +gdk_surface_begin_resize_drag +gdk_surface_begin_resize_drag_for_device +gdk_surface_begin_move_drag +gdk_surface_begin_move_drag_for_device +gdk_surface_show_window_menu +gdk_surface_constrain_size +gdk_surface_beep +gdk_surface_get_scale_factor +gdk_surface_set_opaque_region +gdk_surface_create_gl_context +gdk_surface_create_vulkan_context <SUBSECTION> -gdk_window_get_clip_region -gdk_window_begin_draw_frame -gdk_window_end_draw_frame -gdk_window_get_visible_region +gdk_surface_get_clip_region +gdk_surface_begin_draw_frame +gdk_surface_end_draw_frame +gdk_surface_get_visible_region <SUBSECTION> -gdk_window_invalidate_rect -gdk_window_invalidate_region -GdkWindowChildFunc -gdk_window_invalidate_maybe_recurse -gdk_window_get_update_area -gdk_window_freeze_updates -gdk_window_thaw_updates -gdk_window_get_frame_clock +gdk_surface_invalidate_rect +gdk_surface_invalidate_region +GdkSurfaceChildFunc +gdk_surface_invalidate_maybe_recurse +gdk_surface_get_update_area +gdk_surface_freeze_updates +gdk_surface_thaw_updates +gdk_surface_get_frame_clock <SUBSECTION> -gdk_window_set_user_data -gdk_window_set_accept_focus -gdk_window_get_accept_focus -gdk_window_set_focus_on_map -gdk_window_get_focus_on_map -gdk_window_shape_combine_region -gdk_window_set_child_shapes -gdk_window_merge_child_shapes -gdk_window_input_shape_combine_region -gdk_window_set_child_input_shapes -gdk_window_merge_child_input_shapes -gdk_window_set_title +gdk_surface_set_user_data +gdk_surface_set_accept_focus +gdk_surface_get_accept_focus +gdk_surface_set_focus_on_map +gdk_surface_get_focus_on_map +gdk_surface_shape_combine_region +gdk_surface_set_child_shapes +gdk_surface_merge_child_shapes +gdk_surface_input_shape_combine_region +gdk_surface_set_child_input_shapes +gdk_surface_merge_child_input_shapes +gdk_surface_set_title GDK_PARENT_RELATIVE -gdk_window_set_cursor -gdk_window_get_cursor -gdk_window_get_user_data -gdk_window_get_geometry -gdk_window_set_geometry_hints -gdk_window_get_width -gdk_window_get_height -gdk_window_set_icon_list -gdk_window_set_modal_hint -gdk_window_get_modal_hint -gdk_window_set_type_hint -gdk_window_get_type_hint -gdk_window_set_shadow_width -gdk_window_set_skip_taskbar_hint -gdk_window_set_skip_pager_hint -gdk_window_set_urgency_hint -gdk_window_get_position -gdk_window_get_root_origin -gdk_window_get_frame_extents -gdk_window_get_origin -gdk_window_get_root_coords -gdk_window_get_device_position -gdk_window_get_device_position_double +gdk_surface_set_cursor +gdk_surface_get_cursor +gdk_surface_get_user_data +gdk_surface_get_geometry +gdk_surface_set_geometry_hints +gdk_surface_get_width +gdk_surface_get_height +gdk_surface_set_icon_list +gdk_surface_set_modal_hint +gdk_surface_get_modal_hint +gdk_surface_set_type_hint +gdk_surface_get_type_hint +gdk_surface_set_shadow_width +gdk_surface_set_skip_taskbar_hint +gdk_surface_set_skip_pager_hint +gdk_surface_set_urgency_hint +gdk_surface_get_position +gdk_surface_get_root_origin +gdk_surface_get_frame_extents +gdk_surface_get_origin +gdk_surface_get_root_coords +gdk_surface_get_device_position +gdk_surface_get_device_position_double GdkModifierType GdkModifierIntent -gdk_window_get_parent -gdk_window_get_toplevel -gdk_window_get_children -gdk_window_get_children_with_user_data -gdk_window_peek_children -gdk_window_get_events -gdk_window_set_events -gdk_window_set_icon_name -gdk_window_set_transient_for -gdk_window_set_role -gdk_window_set_startup_id -gdk_window_set_group -gdk_window_get_group -gdk_window_set_decorations -gdk_window_get_decorations +gdk_surface_get_parent +gdk_surface_get_toplevel +gdk_surface_get_children +gdk_surface_get_children_with_user_data +gdk_surface_peek_children +gdk_surface_get_events +gdk_surface_set_events +gdk_surface_set_icon_name +gdk_surface_set_transient_for +gdk_surface_set_role +gdk_surface_set_startup_id +gdk_surface_set_group +gdk_surface_get_group +gdk_surface_set_decorations +gdk_surface_get_decorations GdkWMDecoration -gdk_window_set_functions +gdk_surface_set_functions GdkWMFunction <SUBSECTION> -gdk_window_get_support_multidevice -gdk_window_set_support_multidevice -gdk_window_get_device_cursor -gdk_window_set_device_cursor -gdk_window_get_device_events -gdk_window_set_device_events +gdk_surface_get_support_multidevice +gdk_surface_set_support_multidevice +gdk_surface_get_device_cursor +gdk_surface_set_device_cursor +gdk_surface_get_device_events +gdk_surface_set_device_events <SUBSECTION> -gdk_window_coords_from_parent -gdk_window_coords_to_parent +gdk_surface_coords_from_parent +gdk_surface_coords_to_parent <SUBSECTION Standard> -GDK_WINDOW -GDK_WINDOW_GET_CLASS -GDK_TYPE_WINDOW -GDK_IS_WINDOW -GDK_WINDOW_CLASS -GDK_IS_WINDOW_CLASS +GDK_SURFACE +GDK_SURFACE_GET_CLASS +GDK_TYPE_SURFACE +GDK_IS_SURFACE +GDK_SURFACE_CLASS +GDK_IS_SURFACE_CLASS GDK_TYPE_FILTER_RETURN GDK_TYPE_GRAVITY GDK_TYPE_MODIFIER_TYPE -GDK_TYPE_WINDOW_ATTRIBUTES_TYPE -GDK_TYPE_WINDOW_EDGE -GDK_TYPE_WINDOW_HINTS -GDK_TYPE_WINDOW_TYPE -GDK_TYPE_WINDOW_TYPE_HINT +GDK_TYPE_SURFACE_ATTRIBUTES_TYPE +GDK_TYPE_SURFACE_EDGE +GDK_TYPE_SURFACE_HINTS +GDK_TYPE_SURFACE_TYPE +GDK_TYPE_SURFACE_TYPE_HINT GDK_TYPE_WM_DECORATION GDK_TYPE_WM_FUNCTION -GDK_TYPE_WINDOW_STATE +GDK_TYPE_SURFACE_STATE <SUBSECTION Private> -gdk_window_get_type -gdk_window_window_class_get_type -GdkWindowClass -GdkWindowImpl -GdkWindowImplClass -GdkWindowRedirect -gdk_window_impl_get_type +gdk_surface_get_type +gdk_surface_window_class_get_type +GdkSurfaceClass +GdkSurfaceImpl +GdkSurfaceImplClass +GdkSurfaceRedirect +gdk_surface_impl_get_type gdk_fullscreen_mode_get_type </SECTION> @@ -417,8 +417,8 @@ gdk_pango_layout_line_get_clip_region <SECTION> <TITLE>Cairo Interaction</TITLE> <FILE>cairo_interaction</FILE> -gdk_window_create_similar_surface -gdk_window_create_similar_image_surface +gdk_surface_create_similar_surface +gdk_surface_create_similar_image_surface gdk_cairo_get_clip_rectangle gdk_cairo_get_drawing_context gdk_cairo_set_source_rgba @@ -828,7 +828,7 @@ gdk_drag_context_get_type <INCLUDE>gdk/gdkx.h</INCLUDE> <TITLE>X Window System Interaction</TITLE> <FILE>x_interaction</FILE> -GDK_WINDOW_XID +GDK_SURFACE_XID GDK_DISPLAY_XDISPLAY GDK_POINTER_TO_XID GDK_XID_TO_POINTER @@ -864,16 +864,16 @@ gdk_x11_screen_lookup_visual gdk_x11_screen_supports_net_wm_hint gdk_x11_screen_get_number_of_desktops gdk_x11_screen_get_current_desktop -gdk_x11_window_foreign_new_for_display -gdk_x11_window_lookup_for_display -gdk_x11_window_get_xid -gdk_x11_window_set_theme_variant -gdk_x11_window_set_user_time -gdk_x11_window_move_to_current_desktop -gdk_x11_window_move_to_desktop -gdk_x11_window_get_desktop -gdk_x11_window_set_utf8_property -gdk_x11_window_set_frame_sync_enabled +gdk_x11_surface_foreign_new_for_display +gdk_x11_surface_lookup_for_display +gdk_x11_surface_get_xid +gdk_x11_surface_set_theme_variant +gdk_x11_surface_set_user_time +gdk_x11_surface_move_to_current_desktop +gdk_x11_surface_move_to_desktop +gdk_x11_surface_get_desktop +gdk_x11_surface_set_utf8_property +gdk_x11_surface_set_frame_sync_enabled gdk_x11_keymap_get_group_for_state gdk_x11_keymap_key_is_modifier gdk_x11_visual_get_xvisual @@ -966,12 +966,12 @@ GDK_X11_VISUAL_CLASS GDK_IS_X11_VISUAL GDK_IS_X11_VISUAL_CLASS GDK_X11_VISUAL_GET_CLASS -GDK_TYPE_X11_WINDOW -GDK_X11_WINDOW -GDK_X11_WINDOW_CLASS -GDK_IS_X11_WINDOW -GDK_IS_X11_WINDOW_CLASS -GDK_X11_WINDOW_GET_CLASS +GDK_TYPE_X11_SURFACE +GDK_X11_SURFACE +GDK_X11_SURFACE_CLASS +GDK_IS_X11_SURFACE +GDK_IS_X11_SURFACE_CLASS +GDK_X11_SURFACE_GET_CLASS <SUBSECTION Private> gdk_x11_app_launch_context_get_type @@ -988,8 +988,8 @@ gdk_x11_drag_context_get_type gdk_x11_keymap_get_type gdk_x11_screen_get_type gdk_x11_visual_get_type -gdk_x11_window_get_type -gdk_window_impl_x11_get_type +gdk_x11_surface_get_type +gdk_surface_impl_x11_get_type </SECTION> <SECTION> @@ -1003,13 +1003,13 @@ gdk_wayland_device_get_wl_seat gdk_wayland_display_get_wl_compositor gdk_wayland_display_get_wl_display gdk_wayland_display_query_registry -gdk_wayland_window_new_subsurface -gdk_wayland_window_get_wl_surface -gdk_wayland_window_set_use_custom_surface -GdkWaylandWindowExported -gdk_wayland_window_export_handle -gdk_wayland_window_unexport_handle -gdk_wayland_window_set_transient_for_exported +gdk_wayland_surface_new_subsurface +gdk_wayland_surface_get_wl_surface +gdk_wayland_surface_set_use_custom_surface +GdkWaylandSurfaceExported +gdk_wayland_surface_export_handle +gdk_wayland_surface_unexport_handle +gdk_wayland_surface_set_transient_for_exported <SUBSECTION Standard> GDK_TYPE_WAYLAND_DEVICE @@ -1030,18 +1030,18 @@ GDK_WAYLAND_DISPLAY_MANAGER_CLASS GDK_WAYLAND_DISPLAY_MANAGER_GET_CLASS GDK_IS_WAYLAND_DISPLAY_MANAGER GDK_IS_WAYLAND_DISPLAY_MANAGER_CLASS -GDK_TYPE_WAYLAND_WINDOW -GDK_WAYLAND_WINDOW -GDK_WAYLAND_WINDOW_CLASS -GDK_WAYLAND_WINDOW_GET_CLASS -GDK_IS_WAYLAND_WINDOW -GDK_IS_WAYLAND_WINDOW_CLASS +GDK_TYPE_WAYLAND_SURFACE +GDK_WAYLAND_SURFACE +GDK_WAYLAND_SURFACE_CLASS +GDK_WAYLAND_SURFACE_GET_CLASS +GDK_IS_WAYLAND_SURFACE +GDK_IS_WAYLAND_SURFACE_CLASS <SUBSECTION Private> gdk_wayland_device_get_type gdk_wayland_display_get_type gdk_wayland_display_manager_get_type -gdk_wayland_window_get_type +gdk_wayland_surface_get_type </SECTION> diff --git a/docs/reference/gdk/gdk4.types b/docs/reference/gdk/gdk4.types index 4367e448ba..1aba9be875 100644 --- a/docs/reference/gdk/gdk4.types +++ b/docs/reference/gdk/gdk4.types @@ -11,7 +11,7 @@ gdk_gl_context_get_type gdk_keymap_get_type gdk_monitor_get_type gdk_seat_get_type -gdk_window_get_type +gdk_surface_get_type gdk_content_serializer_get_type gdk_content_deserializer_get_type gdk_clipboard_get_type diff --git a/docs/reference/gtk/drawing-model.xml b/docs/reference/gtk/drawing-model.xml index a608e75a09..c19fffc2b6 100644 --- a/docs/reference/gtk/drawing-model.xml +++ b/docs/reference/gtk/drawing-model.xml @@ -90,7 +90,7 @@ <link linkend="GdkEvent"><structname>GdkEvent</structname></link> structures and sends them on to the GTK layer. In turn, the GTK layer 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. </para> @@ -207,17 +207,17 @@ <para> 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 set on it. </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 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 - fact, transparent GdkWindows used to be impossible.) + fact, transparent GdkSurfaces used to be impossible.) </para> <para> @@ -263,10 +263,10 @@ <para> Two basic functions in GDK form the core of the double-buffering 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 - linkend="gdk_window_end_paint"><function>gdk_window_end_paint()</function></link>. - The first function tells a <classname>GdkWindow</classname> to + linkend="gdk_surface_end_paint"><function>gdk_surface_end_paint()</function></link>. + The first function tells a <classname>GdkSurface</classname> to create a temporary off-screen buffer for drawing. All subsequent drawing operations to this window get automatically redirected to that buffer. The second function actually paints @@ -278,16 +278,16 @@ <para> It would be inconvenient for all widgets to call - <function>gdk_window_begin_paint_region()</function> and - <function>gdk_window_end_paint()</function> at the beginning + <function>gdk_surface_begin_paint_region()</function> and + <function>gdk_surface_end_paint()</function> at the beginning and end of their draw handlers. </para> <para> 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 - 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 most widgets, as they do not need to worry about creating their own temporary drawing buffers or about calling those @@ -335,8 +335,8 @@ my_widget_init (MyWidget *widget) <para> Even if you turn off double buffering on a widget, you can still call - <function>gdk_window_begin_paint_region()</function> and - <function>gdk_window_end_paint()</function> by hand to use + <function>gdk_surface_begin_paint_region()</function> and + <function>gdk_surface_end_paint()</function> by hand to use temporary drawing buffers. </para> </refsect2> diff --git a/docs/reference/gtk/glossary.xml b/docs/reference/gtk/glossary.xml index 7c7488424e..b6ae350581 100644 --- a/docs/reference/gtk/glossary.xml +++ b/docs/reference/gtk/glossary.xml @@ -137,7 +137,7 @@ <para> This is the step in a <glossterm 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 widget is mapped, it must turn on its %GTK_MAPPED <link linkend="GtkWidgetFlags">flag</link>. @@ -146,7 +146,7 @@ <para> Note that due to the asynchronous nature of the X window 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 linkend="event">event</glossterm> to be received. You can do this with the <link @@ -193,7 +193,7 @@ <glossterm>no-window widget</glossterm> <glossdef> <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 linkend="parent">parent's</glossterm>. This can be tested with the gtk_widget_get_has_window() function. @@ -218,20 +218,20 @@ <para> This is the step in a <glossterm 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> - 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 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>. </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>. 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> diff --git a/docs/reference/gtk/input-handling.xml b/docs/reference/gtk/input-handling.xml index f8e653a1f4..dec479626e 100644 --- a/docs/reference/gtk/input-handling.xml +++ b/docs/reference/gtk/input-handling.xml @@ -91,7 +91,7 @@ <title>Event propagation</title> <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 for details of what it does: compression of enter/leave events, identification of the widget receiving the event, pushing the event onto a @@ -101,11 +101,11 @@ <para> 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 devices, the event is propagated to that #GtkWidget. Otherwise, it is 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> @@ -113,7 +113,7 @@ specific input device (gtk_device_grab_add()), is sent events in preference to a global grab (gtk_grab_add()). Input grabs only have effect within the #GtkWindowGroup containing the #GtkWidget which registered the - event’s #GdkWindow. If this #GtkWidget is a child of the grab widget, the + event’s #GdkSurface. If this #GtkWidget is a child of the grab widget, the event is propagated to the child — this is the basis for propagating events within modal dialogs. </para> @@ -186,15 +186,15 @@ 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 on a widget is added to the corresponding (basic or per-device) event mask - for the widget’s #GdkWindow, and all child #GdkWindows. + for the widget’s #GdkSurface, and all child #GdkSurfaces. </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 GDK receives from it. On receiving an event, it is filtered against the - #GdkWindow’s mask for the input device, if set. Otherwise, it is filtered - against the #GdkWindow’s basic event mask. + #GdkSurface’s mask for the input device, if set. Otherwise, it is filtered + against the #GdkSurface’s basic event mask. </para> <para> diff --git a/docs/reference/gtk/migrating-3to4.xml b/docs/reference/gtk/migrating-3to4.xml index a162b5e5f0..4d27d27cbe 100644 --- a/docs/reference/gtk/migrating-3to4.xml +++ b/docs/reference/gtk/migrating-3to4.xml @@ -79,13 +79,13 @@ <title>Review your window creation flags</title> <para> 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. </para> <para> GTK+ 4 also removes the GDK_WA_VISUAL flag, and always uses 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. </para> <para> @@ -194,7 +194,7 @@ <title>Stop using the root window</title> <para> 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 gdk_x11_display_get_xrootwindow() to get its XID. </para> @@ -217,12 +217,12 @@ </section> <section> - <title>Adapt to GdkWindow API changes</title> + <title>Adapt to GdkSurface API changes</title> <para> - The gdk_window_new() function has been replaced by a number of more - specialized constructors: gdk_window_new_toplevel(), gdk_window_new_popup(), - gdk_window_new_temp(), gdk_window_new_child(), gdk_window_new_input(), - gdk_wayland_window_new_subsurface(). Use the appropriate ones to create + The gdk_surface_new() function has been replaced by a number of more + specialized constructors: gdk_surface_new_toplevel(), gdk_surface_new_popup(), + gdk_surface_new_temp(), gdk_surface_new_child(), gdk_surface_new_input(), + gdk_wayland_surface_new_subsurface(). Use the appropriate ones to create your windows. </para> <para> @@ -230,7 +230,7 @@ complicating the code and could not be supported across backends. </para> <para> - gdk_window_reparent() is no longer available. + gdk_surface_reparent() is no longer available. </para> </section> @@ -244,7 +244,7 @@ </section> <section> - <title>Stop using gdk_window_set_event_compression</title> + <title>Stop using gdk_surface_set_event_compression</title> <para> Event compression is now always enabled. If you need to see the uncoalesced motion history, use gdk_event_get_motion_history(). @@ -367,7 +367,7 @@ </section> <section> - <title>Stop using APIs to query GdkWindows</title> + <title>Stop using APIs to query GdkSurfaces</title> <para> A number of APIs for querying special-purpose windows have been removed, since these windows are no longer publically available: diff --git a/docs/reference/gtk/question_index.sgml b/docs/reference/gtk/question_index.sgml index 4f1bf02e2d..28a470dd1c 100644 --- a/docs/reference/gtk/question_index.sgml +++ b/docs/reference/gtk/question_index.sgml @@ -391,14 +391,14 @@ This comes up when using bitfields; in C you can write the following code: <informalexample> <programlisting> - gdk_window_set_events (gdk_window, + gdk_surface_set_events (gdk_surface, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); </programlisting> </informalexample> while in C++ you must write: <informalexample> <programlisting> - gdk_window_set_events (gdk_window, + gdk_surface_set_events (gdk_surface, (GdkEventMask) GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); </programlisting> </informalexample> diff --git a/docs/tools/shooter.c b/docs/tools/shooter.c index d61eb394c8..4e8e02f863 100644 --- a/docs/tools/shooter.c +++ b/docs/tools/shooter.c @@ -211,20 +211,20 @@ static GList *toplevels; static guint shot_id; static gboolean -window_is_csd (GdkWindow *window) +window_is_csd (GdkSurface *window) { gboolean set; GdkWMDecoration decorations = 0; /* FIXME: is this accurate? */ - set = gdk_window_get_decorations (window, &decorations); + set = gdk_surface_get_decorations (window, &decorations); return (set && (decorations == 0)); } static gboolean shoot_one (WidgetInfo *info) { - GdkWindow *window; + GdkSurface *window; XID id; GdkPixbuf *screenshot = NULL; DecorationType decor = DECOR_FRAME; @@ -236,7 +236,7 @@ shoot_one (WidgetInfo *info) } 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)) decor = (info->include_decorations) ? DECOR_NONE : DECOR_WINDOW_FRAME; screenshot = take_window_shot (id, decor); diff --git a/docs/widget_system.txt b/docs/widget_system.txt index 9463f10db9..04f80834e3 100644 --- a/docs/widget_system.txt +++ b/docs/widget_system.txt @@ -62,23 +62,23 @@ GtkWidget, public flags: GTK_TOPLEVEL: Widgets without a real parent, as there are GtkWindows and 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: This flag is indicative for a widget that does not provide - its own GdkWindow. Visible action (e.g. drawing) is performed - on the parent's GdkWindow. + its own GdkSurface. Visible action (e.g. drawing) is performed + on the parent's GdkSurface. GTK_REALIZED: Set by gtk_widget_realize, unset by gtk_widget_unrealize. Relies on ((widget->parent && widget->parent->window) || GTK_WIDGET_TOPLEVEL (widget)); - Means: widget has an associated GdkWindow (XWindow). + Means: widget has an associated GdkSurface (XWindow). GTK_MAPPED: Set by gtk_widget_map, unset by gtk_widget_unmap. 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: Set by gtk_widget_show. @@ -382,7 +382,7 @@ The Map signal -------------- 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 VISIBLE, CHILD_VISIBLE and !MAPPED. (A widget will only 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: - 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 3) Do any other functions related to taking the widget offscreen (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: - gdk_window_set_user_data (window, NULL); - gdk_window_destroy (window); + gdk_surface_set_user_data (window, NULL); + gdk_surface_destroy (window); 2) Call the parent's unrealize handler diff --git a/examples/drawing.c b/examples/drawing.c index 1eebb34ca4..37089abf82 100644 --- a/examples/drawing.c +++ b/examples/drawing.c @@ -32,7 +32,7 @@ size_allocate_cb (GtkWidget *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, gtk_widget_get_width (widget), gtk_widget_get_height (widget)); diff --git a/gdk/broadway/gdkbroadwaywindow.h b/gdk/broadway/gdkbroadwaywindow.h index 914ec278e6..12ce448c51 100644 --- a/gdk/broadway/gdkbroadwaywindow.h +++ b/gdk/broadway/gdkbroadwaywindow.h @@ -22,33 +22,33 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#ifndef __GDK_BROADWAY_WINDOW_H__ -#define __GDK_BROADWAY_WINDOW_H__ +#ifndef __GDK_BROADWAY_SURFACE_H__ +#define __GDK_BROADWAY_SURFACE_H__ #include <gdk/gdk.h> G_BEGIN_DECLS -#define GDK_TYPE_BROADWAY_WINDOW (gdk_broadway_window_get_type ()) -#define GDK_BROADWAY_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_WINDOW, GdkBroadwayWindow)) -#define GDK_BROADWAY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_WINDOW, GdkBroadwayWindowClass)) -#define GDK_IS_BROADWAY_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_WINDOW)) -#define GDK_IS_BROADWAY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_WINDOW)) -#define GDK_BROADWAY_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_WINDOW, GdkBroadwayWindowClass)) +#define GDK_TYPE_BROADWAY_SURFACE (gdk_broadway_surface_get_type ()) +#define GDK_BROADWAY_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_BROADWAY_SURFACE, GdkBroadwaySurface)) +#define GDK_BROADWAY_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_BROADWAY_SURFACE, GdkBroadwaySurfaceClass)) +#define GDK_IS_BROADWAY_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_BROADWAY_SURFACE)) +#define GDK_IS_BROADWAY_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_BROADWAY_SURFACE)) +#define GDK_BROADWAY_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_BROADWAY_SURFACE, GdkBroadwaySurfaceClass)) #ifdef GDK_COMPILATION -typedef struct _GdkBroadwayWindow GdkBroadwayWindow; +typedef struct _GdkBroadwaySurface GdkBroadwaySurface; #else -typedef GdkWindow GdkBroadwayWindow; +typedef GdkSurface GdkBroadwaySurface; #endif -typedef struct _GdkBroadwayWindowClass GdkBroadwayWindowClass; +typedef struct _GdkBroadwaySurfaceClass GdkBroadwaySurfaceClass; GDK_AVAILABLE_IN_ALL -GType gdk_broadway_window_get_type (void); +GType gdk_broadway_surface_get_type (void); 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 -#endif /* __GDK_BROADWAY_WINDOW_H__ */ +#endif /* __GDK_BROADWAY_SURFACE_H__ */ diff --git a/gdk/broadway/gdkdevice-broadway.c b/gdk/broadway/gdkdevice-broadway.c index 3a50d6ed75..fda10591ac 100644 --- a/gdk/broadway/gdkdevice-broadway.c +++ b/gdk/broadway/gdkdevice-broadway.c @@ -24,45 +24,45 @@ #include "gdkprivate-broadway.h" static gboolean gdk_broadway_device_get_history (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, guint32 start, guint32 stop, GdkTimeCoord ***events, gint *n_events); static void gdk_broadway_device_get_state (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, GdkModifierType *mask); static void gdk_broadway_device_set_window_cursor (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkCursor *cursor); static void gdk_broadway_device_warp (GdkDevice *device, gdouble x, gdouble y); static void gdk_broadway_device_query_state (GdkDevice *device, - GdkWindow *window, - GdkWindow **child_window, + GdkSurface *window, + GdkSurface **child_window, gdouble *root_x, gdouble *root_y, gdouble *win_x, gdouble *win_y, GdkModifierType *mask); static GdkGrabStatus gdk_broadway_device_grab (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gboolean owner_events, GdkEventMask event_mask, - GdkWindow *confine_to, + GdkSurface *confine_to, GdkCursor *cursor, guint32 time_); static void gdk_broadway_device_ungrab (GdkDevice *device, 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_y, GdkModifierType *mask, gboolean get_toplevel); static void gdk_broadway_device_select_window_events (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkEventMask event_mask); @@ -97,7 +97,7 @@ gdk_broadway_device_init (GdkBroadwayDevice *device_core) static gboolean gdk_broadway_device_get_history (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, guint32 start, guint32 stop, GdkTimeCoord ***events, @@ -108,13 +108,13 @@ gdk_broadway_device_get_history (GdkDevice *device, static void gdk_broadway_device_get_state (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, GdkModifierType *mask) { 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) { @@ -125,7 +125,7 @@ gdk_broadway_device_get_state (GdkDevice *device, static void gdk_broadway_device_set_window_cursor (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkCursor *cursor) { } @@ -139,8 +139,8 @@ gdk_broadway_device_warp (GdkDevice *device, static void gdk_broadway_device_query_state (GdkDevice *device, - GdkWindow *window, - GdkWindow **child_window, + GdkSurface *window, + GdkSurface **child_window, gdouble *root_x, gdouble *root_y, gdouble *win_x, @@ -177,7 +177,7 @@ gdk_broadway_device_query_state (GdkDevice *device, *mask = mask32; 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)); if (window == NULL) @@ -190,10 +190,10 @@ gdk_broadway_device_query_state (GdkDevice *device, } void -_gdk_broadway_window_grab_check_unmap (GdkWindow *window, +_gdk_broadway_surface_grab_check_unmap (GdkSurface *window, gulong serial) { - GdkDisplay *display = gdk_window_get_display (window); + GdkDisplay *display = gdk_surface_get_display (window); GdkSeat *seat; GList *devices, *d; @@ -212,9 +212,9 @@ _gdk_broadway_window_grab_check_unmap (GdkWindow *window, 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; GdkDeviceGrabInfo *grab; GList *devices, *d; @@ -244,10 +244,10 @@ _gdk_broadway_window_grab_check_destroy (GdkWindow *window) static GdkGrabStatus gdk_broadway_device_grab (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gboolean owner_events, GdkEventMask event_mask, - GdkWindow *confine_to, + GdkSurface *confine_to, GdkCursor *cursor, guint32 time_) { @@ -266,7 +266,7 @@ gdk_broadway_device_grab (GdkDevice *device, { /* Device is a pointer */ 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, event_mask, time_); @@ -311,14 +311,14 @@ gdk_broadway_device_ungrab (GdkDevice *device, } } -static GdkWindow * +static GdkSurface * gdk_broadway_device_window_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, gboolean get_toplevel) { - GdkWindow *window; + GdkSurface *window; 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 gdk_broadway_device_select_window_events (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkEventMask event_mask) { } diff --git a/gdk/broadway/gdkdisplay-broadway.c b/gdk/broadway/gdkdisplay-broadway.c index 1f5abd1c27..61860f5011 100644 --- a/gdk/broadway/gdkdisplay-broadway.c +++ b/gdk/broadway/gdkdisplay-broadway.c @@ -181,10 +181,10 @@ _gdk_broadway_display_size_changed (GdkDisplay *display, toplevels = broadway_display->toplevels; for (l = toplevels; l != NULL; l = l->next) { - GdkWindowImplBroadway *toplevel_impl = l->data; + GdkSurfaceImplBroadway *toplevel_impl = l->data; 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; } -static GdkWindow * +static GdkSurface * gdk_broadway_display_get_default_group (GdkDisplay *display) { 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->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->beep = gdk_broadway_display_beep; diff --git a/gdk/broadway/gdkdnd-broadway.c b/gdk/broadway/gdkdnd-broadway.c index cbbd63af38..91023fa8f2 100644 --- a/gdk/broadway/gdkdnd-broadway.c +++ b/gdk/broadway/gdkdnd-broadway.c @@ -84,7 +84,7 @@ gdk_broadway_drag_context_finalize (GObject *object) /* Drag Contexts */ GdkDragContext * -_gdk_broadway_window_drag_begin (GdkWindow *window, +_gdk_broadway_surface_drag_begin (GdkSurface *window, GdkDevice *device, GdkContentProvider *content, GdkDragAction actions, @@ -94,10 +94,10 @@ _gdk_broadway_window_drag_begin (GdkWindow *window, GdkDragContext *new_context; 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, - "display", gdk_window_get_display (window), + "display", gdk_surface_get_display (window), "content", content, NULL); @@ -145,7 +145,7 @@ gdk_broadway_drag_context_drop_finish (GdkDragContext *context, } void -_gdk_broadway_window_register_dnd (GdkWindow *window) +_gdk_broadway_surface_register_dnd (GdkSurface *window) { } diff --git a/gdk/broadway/gdkeventsource.c b/gdk/broadway/gdkeventsource.c index f0d2e16cd6..00c40b7aac 100644 --- a/gdk/broadway/gdkeventsource.c +++ b/gdk/broadway/gdkeventsource.c @@ -88,7 +88,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message) GdkDisplay *display; GdkBroadwayDisplay *display_broadway; GdkSeat *seat; - GdkWindow *window; + GdkSurface *window; GdkEvent *event = NULL; GList *node; GSList *list, *d; diff --git a/gdk/broadway/gdkprivate-broadway.h b/gdk/broadway/gdkprivate-broadway.h index 161d03367d..abbdaadce9 100644 --- a/gdk/broadway/gdkprivate-broadway.h +++ b/gdk/broadway/gdkprivate-broadway.h @@ -42,30 +42,30 @@ void _gdk_broadway_resync_windows (void); guint32 gdk_broadway_display_ensure_texture (GdkDisplay *display, GdkTexture *texture); -void gdk_broadway_window_set_nodes (GdkWindow *window, +void gdk_broadway_surface_set_nodes (GdkSurface *window, GArray *nodes, GPtrArray *node_textures); -void _gdk_broadway_window_register_dnd (GdkWindow *window); -GdkDragContext * _gdk_broadway_window_drag_begin (GdkWindow *window, +void _gdk_broadway_surface_register_dnd (GdkSurface *window); +GdkDragContext * _gdk_broadway_surface_drag_begin (GdkSurface *window, GdkDevice *device, GdkContentProvider *content, GdkDragAction actions, gint dx, gint dy); -void _gdk_broadway_window_translate (GdkWindow *window, +void _gdk_broadway_surface_translate (GdkSurface *window, cairo_region_t *area, gint dx, gint dy); gboolean _gdk_broadway_moveresize_handle_event (GdkDisplay *display, BroadwayInputMsg *msg); gboolean _gdk_broadway_moveresize_configure_done (GdkDisplay *display, - GdkWindow *window); -void _gdk_broadway_roundtrip_notify (GdkWindow *window, + GdkSurface *window); +void _gdk_broadway_roundtrip_notify (GdkSurface *window, guint32 tag, gboolean local_reply); -void _gdk_broadway_window_grab_check_destroy (GdkWindow *window); -void _gdk_broadway_window_grab_check_unmap (GdkWindow *window, +void _gdk_broadway_surface_grab_check_destroy (GdkSurface *window); +void _gdk_broadway_surface_grab_check_unmap (GdkSurface *window, gulong serial); void _gdk_keymap_keys_changed (GdkDisplay *display); @@ -100,10 +100,10 @@ void _gdk_broadway_display_get_maximal_cursor_size (GdkDisplay *display, guint *width, guint *height); void _gdk_broadway_display_create_window_impl (GdkDisplay *display, - GdkWindow *window, - GdkWindow *real_parent, + GdkSurface *window, + GdkSurface *real_parent, GdkEventMask event_mask, - GdkWindowAttr *attributes); + GdkSurfaceAttr *attributes); gint _gdk_broadway_display_text_property_to_utf8_list (GdkDisplay *display, GdkAtom encoding, gint format, @@ -120,11 +120,11 @@ BroadwayInputMsg * _gdk_broadway_display_block_for_input (GdkDisplay *display, gboolean remove); /* 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_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__ */ diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c index ebbd03e658..9b7dbcf60f 100644 --- a/gdk/broadway/gdkwindow-broadway.c +++ b/gdk/broadway/gdkwindow-broadway.c @@ -44,34 +44,34 @@ #include <string.h> /* Forward declarations */ -static void gdk_window_impl_broadway_finalize (GObject *object); +static void gdk_surface_impl_broadway_finalize (GObject *object); #define WINDOW_IS_TOPLEVEL(window) \ - (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD) + (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD) -struct _GdkBroadwayWindow { - GdkWindow parent; +struct _GdkBroadwaySurface { + GdkSurface parent; }; -struct _GdkBroadwayWindowClass { - GdkWindowClass parent_class; +struct _GdkBroadwaySurfaceClass { + GdkSurfaceClass parent_class; }; -G_DEFINE_TYPE (GdkBroadwayWindow, gdk_broadway_window, GDK_TYPE_WINDOW) +G_DEFINE_TYPE (GdkBroadwaySurface, gdk_broadway_surface, GDK_TYPE_SURFACE) static void -gdk_broadway_window_class_init (GdkBroadwayWindowClass *broadway_window_class) +gdk_broadway_surface_class_init (GdkBroadwaySurfaceClass *broadway_surface_class) { } static void -gdk_broadway_window_init (GdkBroadwayWindow *broadway_window) +gdk_broadway_surface_init (GdkBroadwaySurface *broadway_surface) { } -G_DEFINE_TYPE (GdkWindowImplBroadway, - gdk_window_impl_broadway, - GDK_TYPE_WINDOW_IMPL) +G_DEFINE_TYPE (GdkSurfaceImplBroadway, + gdk_surface_impl_broadway, + GDK_TYPE_SURFACE_IMPL) static GdkDisplay * find_broadway_display (void) @@ -111,7 +111,7 @@ flush_idle (gpointer data) is frozen during e.g. window resizes so the paint will not happen and the window resize request is never flushed. */ static void -queue_flush (GdkWindow *window) +queue_flush (GdkSurface *window) { if (flush_id == 0) { @@ -121,27 +121,27 @@ queue_flush (GdkWindow *window) } static void -gdk_window_impl_broadway_init (GdkWindowImplBroadway *impl) +gdk_surface_impl_broadway_init (GdkSurfaceImplBroadway *impl) { impl->toplevel_window_type = -1; } static void -gdk_window_impl_broadway_finalize (GObject *object) +gdk_surface_impl_broadway_finalize (GObject *object) { - GdkWindow *wrapper; - GdkWindowImplBroadway *impl; + GdkSurface *wrapper; + GdkSurfaceImplBroadway *impl; GdkBroadwayDisplay *broadway_display; - g_return_if_fail (GDK_IS_WINDOW_IMPL_BROADWAY (object)); + g_return_if_fail (GDK_IS_SURFACE_IMPL_BROADWAY (object)); - impl = GDK_WINDOW_IMPL_BROADWAY (object); + impl = GDK_SURFACE_IMPL_BROADWAY (object); wrapper = impl->wrapper; - _gdk_broadway_window_grab_check_destroy (wrapper); + _gdk_broadway_surface_grab_check_destroy (wrapper); - broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (impl->wrapper)); + broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (impl->wrapper)); g_hash_table_remove (broadway_display->id_ht, GINT_TO_POINTER(impl->id)); @@ -150,7 +150,7 @@ gdk_window_impl_broadway_finalize (GObject *object) broadway_display->toplevels = g_list_remove (broadway_display->toplevels, impl); - G_OBJECT_CLASS (gdk_window_impl_broadway_parent_class)->finalize (object); + G_OBJECT_CLASS (gdk_surface_impl_broadway_parent_class)->finalize (object); } static gboolean @@ -162,11 +162,11 @@ thaw_clock_cb (GdkFrameClock *clock) } void -_gdk_broadway_roundtrip_notify (GdkWindow *window, +_gdk_broadway_roundtrip_notify (GdkSurface *window, guint32 tag, gboolean local_reply) { - GdkFrameClock *clock = gdk_window_get_frame_clock (window); + GdkFrameClock *clock = gdk_surface_get_frame_clock (window); /* If there is no remove web client, rate limit update to once a second */ if (local_reply) @@ -177,13 +177,13 @@ _gdk_broadway_roundtrip_notify (GdkWindow *window, static void on_frame_clock_after_paint (GdkFrameClock *clock, - GdkWindow *window) + GdkSurface *window) { - GdkDisplay *display = gdk_window_get_display (window); - GdkWindowImplBroadway *impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + GdkDisplay *display = gdk_surface_get_display (window); + GdkSurfaceImplBroadway *impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); GdkBroadwayDisplay *broadway_display; - _gdk_frame_clock_freeze (gdk_window_get_frame_clock (window)); + _gdk_frame_clock_freeze (gdk_surface_get_frame_clock (window)); broadway_display = GDK_BROADWAY_DISPLAY (display); @@ -193,11 +193,11 @@ on_frame_clock_after_paint (GdkFrameClock *clock, } static void -connect_frame_clock (GdkWindow *window) +connect_frame_clock (GdkSurface *window) { if (WINDOW_IS_TOPLEVEL (window)) { - GdkFrameClock *frame_clock = gdk_window_get_frame_clock (window); + GdkFrameClock *frame_clock = gdk_surface_get_frame_clock (window); g_signal_connect (frame_clock, "after-paint", G_CALLBACK (on_frame_clock_after_paint), window); @@ -206,29 +206,29 @@ connect_frame_clock (GdkWindow *window) void _gdk_broadway_display_create_window_impl (GdkDisplay *display, - GdkWindow *window, - GdkWindow *real_parent, + GdkSurface *window, + GdkSurface *real_parent, GdkEventMask event_mask, - GdkWindowAttr *attributes) + GdkSurfaceAttr *attributes) { - GdkWindowImplBroadway *impl; + GdkSurfaceImplBroadway *impl; GdkBroadwayDisplay *broadway_display; broadway_display = GDK_BROADWAY_DISPLAY (display); - impl = g_object_new (GDK_TYPE_WINDOW_IMPL_BROADWAY, NULL); - window->impl = (GdkWindowImpl *)impl; + impl = g_object_new (GDK_TYPE_SURFACE_IMPL_BROADWAY, NULL); + window->impl = (GdkSurfaceImpl *)impl; impl->id = _gdk_broadway_server_new_surface (broadway_display->server, window->x, window->y, window->width, window->height, - window->window_type == GDK_WINDOW_TEMP); + window->window_type == GDK_SURFACE_TEMP); g_hash_table_insert (broadway_display->id_ht, GINT_TO_POINTER(impl->id), window); impl->wrapper = window; - g_assert (window->window_type == GDK_WINDOW_TOPLEVEL || - window->window_type == GDK_WINDOW_TEMP); + g_assert (window->window_type == GDK_SURFACE_TOPLEVEL || + window->window_type == GDK_SURFACE_TEMP); g_assert (window->parent == NULL); broadway_display->toplevels = g_list_prepend (broadway_display->toplevels, impl); @@ -237,37 +237,37 @@ _gdk_broadway_display_create_window_impl (GdkDisplay *display, } static cairo_surface_t * -gdk_window_broadway_ref_cairo_surface (GdkWindow *window) +gdk_surface_broadway_ref_cairo_surface (GdkSurface *window) { - GdkWindowImplBroadway *impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + GdkSurfaceImplBroadway *impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); - if (GDK_IS_WINDOW_IMPL_BROADWAY (window) && - GDK_WINDOW_DESTROYED (impl->wrapper)) + if (GDK_IS_SURFACE_IMPL_BROADWAY (window) && + GDK_SURFACE_DESTROYED (impl->wrapper)) return NULL; return cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1); } static void -_gdk_broadway_window_destroy (GdkWindow *window, +_gdk_broadway_surface_destroy (GdkSurface *window, gboolean recursing, gboolean foreign_destroy) { - GdkWindowImplBroadway *impl; + GdkSurfaceImplBroadway *impl; GdkBroadwayDisplay *broadway_display; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); if (impl->node_data) g_array_unref (impl->node_data); if (impl->node_data_textures) g_ptr_array_unref (impl->node_data_textures); - _gdk_broadway_window_grab_check_destroy (window); + _gdk_broadway_surface_grab_check_destroy (window); - broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window)); + broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (window)); g_hash_table_remove (broadway_display->id_ht, GINT_TO_POINTER (impl->id)); _gdk_broadway_server_destroy_surface (broadway_display->server, impl->id); @@ -275,18 +275,18 @@ _gdk_broadway_window_destroy (GdkWindow *window, } void -gdk_broadway_window_set_nodes (GdkWindow *window, +gdk_broadway_surface_set_nodes (GdkSurface *window, GArray *nodes, GPtrArray *node_textures) { - GdkWindowImplBroadway *impl; + GdkSurfaceImplBroadway *impl; GdkBroadwayDisplay *broadway_display; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); - broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window)); + broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (window)); if (nodes) g_array_ref (nodes); @@ -306,82 +306,82 @@ gdk_broadway_window_set_nodes (GdkWindow *window, /* This function is called when the XWindow is really gone. */ static void -gdk_broadway_window_destroy_notify (GdkWindow *window) +gdk_broadway_surface_destroy_notify (GdkSurface *window) { - if (!GDK_WINDOW_DESTROYED (window)) - _gdk_window_destroy (window, TRUE); + if (!GDK_SURFACE_DESTROYED (window)) + _gdk_surface_destroy (window, TRUE); g_object_unref (window); } static void -gdk_window_broadway_show (GdkWindow *window, gboolean already_mapped) +gdk_surface_broadway_show (GdkSurface *window, gboolean already_mapped) { - GdkWindowImplBroadway *impl; + GdkSurfaceImplBroadway *impl; GdkBroadwayDisplay *broadway_display; - impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); impl->visible = TRUE; if (window->event_mask & GDK_STRUCTURE_MASK) - _gdk_make_event (GDK_WINDOW (window), GDK_MAP, NULL, FALSE); + _gdk_make_event (GDK_SURFACE (window), GDK_MAP, NULL, FALSE); if (window->parent && window->parent->event_mask & GDK_SUBSTRUCTURE_MASK) - _gdk_make_event (GDK_WINDOW (window), GDK_MAP, NULL, FALSE); + _gdk_make_event (GDK_SURFACE (window), GDK_MAP, NULL, FALSE); - broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window)); + broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (window)); if (_gdk_broadway_server_surface_show (broadway_display->server, impl->id)) queue_flush (window); } static void -gdk_window_broadway_hide (GdkWindow *window) +gdk_surface_broadway_hide (GdkSurface *window) { - GdkWindowImplBroadway *impl; + GdkSurfaceImplBroadway *impl; GdkBroadwayDisplay *broadway_display; - impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); impl->visible = FALSE; if (window->event_mask & GDK_STRUCTURE_MASK) - _gdk_make_event (GDK_WINDOW (window), GDK_UNMAP, NULL, FALSE); + _gdk_make_event (GDK_SURFACE (window), GDK_UNMAP, NULL, FALSE); if (window->parent && window->parent->event_mask & GDK_SUBSTRUCTURE_MASK) - _gdk_make_event (GDK_WINDOW (window), GDK_UNMAP, NULL, FALSE); + _gdk_make_event (GDK_SURFACE (window), GDK_UNMAP, NULL, FALSE); - broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window)); + broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (window)); - _gdk_broadway_window_grab_check_unmap (window, + _gdk_broadway_surface_grab_check_unmap (window, _gdk_broadway_server_get_next_serial (broadway_display->server)); if (_gdk_broadway_server_surface_hide (broadway_display->server, impl->id)) queue_flush (window); - _gdk_window_clear_update_area (window); + _gdk_surface_clear_update_area (window); } static void -gdk_window_broadway_withdraw (GdkWindow *window) +gdk_surface_broadway_withdraw (GdkSurface *window) { - gdk_window_broadway_hide (window); + gdk_surface_broadway_hide (window); } static void -gdk_window_broadway_move_resize (GdkWindow *window, +gdk_surface_broadway_move_resize (GdkSurface *window, gboolean with_move, gint x, gint y, gint width, gint height) { - GdkWindowImplBroadway *impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + GdkSurfaceImplBroadway *impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); GdkBroadwayDisplay *broadway_display; gboolean size_changed; size_changed = FALSE; - broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window)); + broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (window)); if (width > 0 || height > 0) { @@ -416,141 +416,141 @@ gdk_window_broadway_move_resize (GdkWindow *window, } static void -gdk_window_broadway_raise (GdkWindow *window) +gdk_surface_broadway_raise (GdkSurface *window) { } static void -gdk_window_broadway_restack_toplevel (GdkWindow *window, - GdkWindow *sibling, +gdk_surface_broadway_restack_toplevel (GdkSurface *window, + GdkSurface *sibling, gboolean above) { } static void -gdk_window_broadway_lower (GdkWindow *window) +gdk_surface_broadway_lower (GdkSurface *window) { } static void -gdk_broadway_window_focus (GdkWindow *window, +gdk_broadway_surface_focus (GdkSurface *window, guint32 timestamp) { - GdkWindowImplBroadway *impl; + GdkSurfaceImplBroadway *impl; GdkBroadwayDisplay *broadway_display; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !window->accept_focus) return; - impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); - broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window)); + impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); + broadway_display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (window)); _gdk_broadway_server_surface_focus (broadway_display->server, impl->id); } static void -gdk_broadway_window_set_type_hint (GdkWindow *window, - GdkWindowTypeHint hint) +gdk_broadway_surface_set_type_hint (GdkSurface *window, + GdkSurfaceTypeHint hint) { } -static GdkWindowTypeHint -gdk_broadway_window_get_type_hint (GdkWindow *window) +static GdkSurfaceTypeHint +gdk_broadway_surface_get_type_hint (GdkSurface *window) { - return GDK_WINDOW_TYPE_HINT_NORMAL; + return GDK_SURFACE_TYPE_HINT_NORMAL; } static void -gdk_broadway_window_set_modal_hint (GdkWindow *window, +gdk_broadway_surface_set_modal_hint (GdkSurface *window, gboolean modal) { } static void -gdk_broadway_window_set_skip_taskbar_hint (GdkWindow *window, +gdk_broadway_surface_set_skip_taskbar_hint (GdkSurface *window, gboolean skips_taskbar) { } static void -gdk_broadway_window_set_skip_pager_hint (GdkWindow *window, +gdk_broadway_surface_set_skip_pager_hint (GdkSurface *window, gboolean skips_pager) { } static void -gdk_broadway_window_set_urgency_hint (GdkWindow *window, +gdk_broadway_surface_set_urgency_hint (GdkSurface *window, gboolean urgent) { } static void -gdk_broadway_window_set_geometry_hints (GdkWindow *window, +gdk_broadway_surface_set_geometry_hints (GdkSurface *window, const GdkGeometry *geometry, - GdkWindowHints geom_mask) + GdkSurfaceHints geom_mask) { - GdkWindowImplBroadway *impl; + GdkSurfaceImplBroadway *impl; - impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); impl->geometry_hints = *geometry; impl->geometry_hints_mask = geom_mask; } static void -gdk_broadway_window_set_title (GdkWindow *window, +gdk_broadway_surface_set_title (GdkSurface *window, const gchar *title) { } static void -gdk_broadway_window_set_role (GdkWindow *window, +gdk_broadway_surface_set_role (GdkSurface *window, const gchar *role) { } static void -gdk_broadway_window_set_startup_id (GdkWindow *window, +gdk_broadway_surface_set_startup_id (GdkSurface *window, const gchar *startup_id) { } static void -gdk_broadway_window_set_transient_for (GdkWindow *window, - GdkWindow *parent) +gdk_broadway_surface_set_transient_for (GdkSurface *window, + GdkSurface *parent) { GdkBroadwayDisplay *display; - GdkWindowImplBroadway *impl; + GdkSurfaceImplBroadway *impl; int parent_id; - impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); parent_id = 0; if (parent) - parent_id = GDK_WINDOW_IMPL_BROADWAY (parent->impl)->id; + parent_id = GDK_SURFACE_IMPL_BROADWAY (parent->impl)->id; impl->transient_for = parent_id; - display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (impl->wrapper)); + display = GDK_BROADWAY_DISPLAY (gdk_surface_get_display (impl->wrapper)); _gdk_broadway_server_surface_set_transient_for (display->server, impl->id, impl->transient_for); } static void -gdk_window_broadway_get_geometry (GdkWindow *window, +gdk_surface_broadway_get_geometry (GdkSurface *window, gint *x, gint *y, gint *width, gint *height) { - GdkWindowImplBroadway *impl; + GdkSurfaceImplBroadway *impl; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); /* TODO: These should really roundtrip to the client to get the current data */ @@ -566,15 +566,15 @@ gdk_window_broadway_get_geometry (GdkWindow *window, } static void -gdk_window_broadway_get_root_coords (GdkWindow *window, +gdk_surface_broadway_get_root_coords (GdkSurface *window, gint x, gint y, gint *root_x, gint *root_y) { - GdkWindowImplBroadway *impl; + GdkSurfaceImplBroadway *impl; - impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); if (root_x) *root_x = x + impl->wrapper->x; @@ -583,7 +583,7 @@ gdk_window_broadway_get_root_coords (GdkWindow *window, } static void -gdk_broadway_window_get_frame_extents (GdkWindow *window, +gdk_broadway_surface_get_frame_extents (GdkSurface *window, GdkRectangle *rect) { g_return_if_fail (rect != NULL); @@ -597,17 +597,17 @@ gdk_broadway_window_get_frame_extents (GdkWindow *window, } static gboolean -gdk_window_broadway_get_device_state (GdkWindow *window, +gdk_surface_broadway_get_device_state (GdkSurface *window, GdkDevice *device, gdouble *x, gdouble *y, GdkModifierType *mask) { - GdkWindow *child; + GdkSurface *child; - g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (window == NULL || GDK_IS_SURFACE (window), FALSE); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return FALSE; GDK_DEVICE_GET_CLASS (device)->query_state (device, window, @@ -618,25 +618,25 @@ gdk_window_broadway_get_device_state (GdkWindow *window, } static GdkEventMask -gdk_window_broadway_get_events (GdkWindow *window) +gdk_surface_broadway_get_events (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return 0; return 0; } static void -gdk_window_broadway_set_events (GdkWindow *window, +gdk_surface_broadway_set_events (GdkSurface *window, GdkEventMask event_mask) { - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { } } static void -gdk_window_broadway_shape_combine_region (GdkWindow *window, +gdk_surface_broadway_shape_combine_region (GdkSurface *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y) @@ -644,7 +644,7 @@ gdk_window_broadway_shape_combine_region (GdkWindow *window, } static void -gdk_window_broadway_input_shape_combine_region (GdkWindow *window, +gdk_surface_broadway_input_shape_combine_region (GdkSurface *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y) @@ -652,7 +652,7 @@ gdk_window_broadway_input_shape_combine_region (GdkWindow *window, } static void -gdk_broadway_window_set_accept_focus (GdkWindow *window, +gdk_broadway_surface_set_accept_focus (GdkSurface *window, gboolean accept_focus) { accept_focus = accept_focus != FALSE; @@ -664,7 +664,7 @@ gdk_broadway_window_set_accept_focus (GdkWindow *window, } static void -gdk_broadway_window_set_focus_on_map (GdkWindow *window, +gdk_broadway_surface_set_focus_on_map (GdkSurface *window, gboolean focus_on_map) { focus_on_map = focus_on_map != FALSE; @@ -677,16 +677,16 @@ gdk_broadway_window_set_focus_on_map (GdkWindow *window, static void -gdk_broadway_window_set_icon_list (GdkWindow *window, +gdk_broadway_surface_set_icon_list (GdkSurface *window, GList *surfaces) { } static void -gdk_broadway_window_set_icon_name (GdkWindow *window, +gdk_broadway_surface_set_icon_name (GdkSurface *window, const gchar *name) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; @@ -695,93 +695,93 @@ gdk_broadway_window_set_icon_name (GdkWindow *window, } static void -gdk_broadway_window_iconify (GdkWindow *window) +gdk_broadway_surface_iconify (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; } static void -gdk_broadway_window_deiconify (GdkWindow *window) +gdk_broadway_surface_deiconify (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; } static void -gdk_broadway_window_stick (GdkWindow *window) +gdk_broadway_surface_stick (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; } static void -gdk_broadway_window_unstick (GdkWindow *window) +gdk_broadway_surface_unstick (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; } static void -gdk_broadway_window_maximize (GdkWindow *window) +gdk_broadway_surface_maximize (GdkSurface *window) { - GdkWindowImplBroadway *impl; + GdkSurfaceImplBroadway *impl; GdkDisplay *display; GdkMonitor *monitor; GdkRectangle geom; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); if (impl->maximized) return; impl->maximized = TRUE; - gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_MAXIMIZED); + gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_MAXIMIZED); impl->pre_maximize_x = window->x; impl->pre_maximize_y = window->y; impl->pre_maximize_width = window->width; impl->pre_maximize_height = window->height; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); monitor = gdk_display_get_primary_monitor (display); gdk_monitor_get_geometry (monitor, &geom); - gdk_window_move_resize (window, + gdk_surface_move_resize (window, geom.x, geom.y, geom.width, geom.height); } static void -gdk_broadway_window_unmaximize (GdkWindow *window) +gdk_broadway_surface_unmaximize (GdkSurface *window) { - GdkWindowImplBroadway *impl; + GdkSurfaceImplBroadway *impl; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); if (!impl->maximized) return; impl->maximized = FALSE; - gdk_synthesize_window_state (window, GDK_WINDOW_STATE_MAXIMIZED, 0); + gdk_synthesize_window_state (window, GDK_SURFACE_STATE_MAXIMIZED, 0); - gdk_window_move_resize (window, + gdk_surface_move_resize (window, impl->pre_maximize_x, impl->pre_maximize_y, impl->pre_maximize_width, @@ -789,50 +789,50 @@ gdk_broadway_window_unmaximize (GdkWindow *window) } static void -gdk_broadway_window_fullscreen (GdkWindow *window) +gdk_broadway_surface_fullscreen (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; } static void -gdk_broadway_window_unfullscreen (GdkWindow *window) +gdk_broadway_surface_unfullscreen (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; } static void -gdk_broadway_window_set_keep_above (GdkWindow *window, +gdk_broadway_surface_set_keep_above (GdkSurface *window, gboolean setting) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; } static void -gdk_broadway_window_set_keep_below (GdkWindow *window, gboolean setting) +gdk_broadway_surface_set_keep_below (GdkSurface *window, gboolean setting) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; } -static GdkWindow * -gdk_broadway_window_get_group (GdkWindow *window) +static GdkSurface * +gdk_broadway_surface_get_group (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return NULL; @@ -840,28 +840,28 @@ gdk_broadway_window_get_group (GdkWindow *window) } static void -gdk_broadway_window_set_group (GdkWindow *window, - GdkWindow *leader) +gdk_broadway_surface_set_group (GdkSurface *window, + GdkSurface *leader) { } static void -gdk_broadway_window_set_decorations (GdkWindow *window, +gdk_broadway_surface_set_decorations (GdkSurface *window, GdkWMDecoration decorations) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; } static gboolean -gdk_broadway_window_get_decorations (GdkWindow *window, +gdk_broadway_surface_get_decorations (GdkSurface *window, GdkWMDecoration *decorations) { gboolean result = FALSE; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return FALSE; @@ -869,21 +869,21 @@ gdk_broadway_window_get_decorations (GdkWindow *window, } static void -gdk_broadway_window_set_functions (GdkWindow *window, +gdk_broadway_surface_set_functions (GdkSurface *window, GdkWMFunction functions) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; } static void -gdk_broadway_window_end_paint (GdkWindow *window) +gdk_broadway_surface_end_paint (GdkSurface *window) { - GdkWindowImplBroadway *impl; - impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + GdkSurfaceImplBroadway *impl; + impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); impl->dirty = TRUE; } @@ -893,10 +893,10 @@ struct _MoveResizeData { GdkDisplay *display; - GdkWindow *moveresize_window; - GdkWindow *moveresize_emulation_window; + GdkSurface *moveresize_window; + GdkSurface *moveresize_emulation_window; gboolean is_resize; - GdkWindowEdge resize_edge; + GdkSurfaceEdge resize_edge; gint moveresize_button; gint moveresize_x; gint moveresize_y; @@ -905,7 +905,7 @@ struct _MoveResizeData gint moveresize_orig_width; gint moveresize_orig_height; long moveresize_process_time; - GdkWindowHints moveresize_geom_mask; + GdkSurfaceHints moveresize_geom_mask; GdkGeometry moveresize_geometry; BroadwayInputMsg *moveresize_pending_event; }; @@ -954,37 +954,37 @@ update_pos (MoveResizeData *mv_resize, switch (mv_resize->resize_edge) { - case GDK_WINDOW_EDGE_NORTH_WEST: + case GDK_SURFACE_EDGE_NORTH_WEST: x += dx; y += dy; w -= dx; h -= dy; break; - case GDK_WINDOW_EDGE_NORTH: + case GDK_SURFACE_EDGE_NORTH: y += dy; h -= dy; break; - case GDK_WINDOW_EDGE_NORTH_EAST: + case GDK_SURFACE_EDGE_NORTH_EAST: y += dy; h -= dy; w += dx; break; - case GDK_WINDOW_EDGE_SOUTH_WEST: + case GDK_SURFACE_EDGE_SOUTH_WEST: h += dy; x += dx; w -= dx; break; - case GDK_WINDOW_EDGE_SOUTH_EAST: + case GDK_SURFACE_EDGE_SOUTH_EAST: w += dx; h += dy; break; - case GDK_WINDOW_EDGE_SOUTH: + case GDK_SURFACE_EDGE_SOUTH: h += dy; break; - case GDK_WINDOW_EDGE_EAST: + case GDK_SURFACE_EDGE_EAST: w += dx; break; - case GDK_WINDOW_EDGE_WEST: + case GDK_SURFACE_EDGE_WEST: x += dx; w -= dx; break; @@ -999,12 +999,12 @@ update_pos (MoveResizeData *mv_resize, if (mv_resize->moveresize_geom_mask) { - gdk_window_constrain_size (&mv_resize->moveresize_geometry, + gdk_surface_constrain_size (&mv_resize->moveresize_geometry, mv_resize->moveresize_geom_mask, w, h, &w, &h); } - gdk_window_move_resize (mv_resize->moveresize_window, x, y, w, h); + gdk_surface_move_resize (mv_resize->moveresize_window, x, y, w, h); } else { @@ -1013,14 +1013,14 @@ update_pos (MoveResizeData *mv_resize, x = mv_resize->moveresize_orig_x + dx; y = mv_resize->moveresize_orig_y + dy; - gdk_window_move (mv_resize->moveresize_window, x, y); + gdk_surface_move (mv_resize->moveresize_window, x, y); } } static void finish_drag (MoveResizeData *mv_resize) { - gdk_window_destroy (mv_resize->moveresize_emulation_window); + gdk_surface_destroy (mv_resize->moveresize_emulation_window); mv_resize->moveresize_emulation_window = NULL; g_object_unref (mv_resize->moveresize_window); mv_resize->moveresize_window = NULL; @@ -1125,7 +1125,7 @@ _gdk_broadway_moveresize_handle_event (GdkDisplay *display, gboolean _gdk_broadway_moveresize_configure_done (GdkDisplay *display, - GdkWindow *window) + GdkSurface *window) { BroadwayInputMsg *tmp_event; MoveResizeData *mv_resize = get_move_resize_data (display, FALSE); @@ -1154,9 +1154,9 @@ create_moveresize_window (MoveResizeData *mv_resize, g_assert (mv_resize->moveresize_emulation_window == NULL); - mv_resize->moveresize_emulation_window = gdk_window_new_temp (mv_resize->display); + mv_resize->moveresize_emulation_window = gdk_surface_new_temp (mv_resize->display); - gdk_window_show (mv_resize->moveresize_emulation_window); + gdk_surface_show (mv_resize->moveresize_emulation_window); seat = gdk_display_get_default_seat (mv_resize->display); pointer = gdk_seat_get_pointer (seat); @@ -1192,14 +1192,14 @@ calculate_unmoving_origin (MoveResizeData *mv_resize) if (mv_resize->moveresize_geom_mask & GDK_HINT_WIN_GRAVITY && mv_resize->moveresize_geometry.win_gravity == GDK_GRAVITY_STATIC) { - gdk_window_get_origin (mv_resize->moveresize_window, + gdk_surface_get_origin (mv_resize->moveresize_window, &mv_resize->moveresize_orig_x, &mv_resize->moveresize_orig_y); } else { - gdk_window_get_frame_extents (mv_resize->moveresize_window, &rect); - gdk_window_get_geometry (mv_resize->moveresize_window, + gdk_surface_get_frame_extents (mv_resize->moveresize_window, &rect); + gdk_surface_get_geometry (mv_resize->moveresize_window, NULL, NULL, &width, &height); switch (mv_resize->moveresize_geometry.win_gravity) @@ -1250,8 +1250,8 @@ calculate_unmoving_origin (MoveResizeData *mv_resize) } static void -gdk_broadway_window_begin_resize_drag (GdkWindow *window, - GdkWindowEdge edge, +gdk_broadway_surface_begin_resize_drag (GdkSurface *window, + GdkSurfaceEdge edge, GdkDevice *device, gint button, gint root_x, @@ -1259,18 +1259,18 @@ gdk_broadway_window_begin_resize_drag (GdkWindow *window, guint32 timestamp) { MoveResizeData *mv_resize; - GdkWindowImplBroadway *impl; + GdkSurfaceImplBroadway *impl; - impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; if (impl->maximized) return; - mv_resize = get_move_resize_data (gdk_window_get_display (window), TRUE); + mv_resize = get_move_resize_data (gdk_surface_get_display (window), TRUE); mv_resize->is_resize = TRUE; mv_resize->moveresize_button = button; @@ -1279,8 +1279,8 @@ gdk_broadway_window_begin_resize_drag (GdkWindow *window, mv_resize->moveresize_y = root_y; mv_resize->moveresize_window = g_object_ref (window); - mv_resize->moveresize_orig_width = gdk_window_get_width (window); - mv_resize->moveresize_orig_height = gdk_window_get_height (window); + mv_resize->moveresize_orig_width = gdk_surface_get_width (window); + mv_resize->moveresize_orig_height = gdk_surface_get_height (window); mv_resize->moveresize_geom_mask = impl->geometry_hints_mask; mv_resize->moveresize_geometry = impl->geometry_hints; @@ -1291,7 +1291,7 @@ gdk_broadway_window_begin_resize_drag (GdkWindow *window, } static void -gdk_broadway_window_begin_move_drag (GdkWindow *window, +gdk_broadway_surface_begin_move_drag (GdkSurface *window, GdkDevice *device, gint button, gint root_x, @@ -1299,18 +1299,18 @@ gdk_broadway_window_begin_move_drag (GdkWindow *window, guint32 timestamp) { MoveResizeData *mv_resize; - GdkWindowImplBroadway *impl; + GdkSurfaceImplBroadway *impl; - impl = GDK_WINDOW_IMPL_BROADWAY (window->impl); + impl = GDK_SURFACE_IMPL_BROADWAY (window->impl); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; if (impl->maximized) return; - mv_resize = get_move_resize_data (gdk_window_get_display (window), TRUE); + mv_resize = get_move_resize_data (gdk_surface_get_display (window), TRUE); mv_resize->is_resize = FALSE; mv_resize->moveresize_button = button; @@ -1318,8 +1318,8 @@ gdk_broadway_window_begin_move_drag (GdkWindow *window, mv_resize->moveresize_y = root_y; mv_resize->moveresize_window = g_object_ref (window); - mv_resize->moveresize_orig_width = gdk_window_get_width (window); - mv_resize->moveresize_orig_height = gdk_window_get_height (window); + mv_resize->moveresize_orig_width = gdk_surface_get_width (window); + mv_resize->moveresize_orig_height = gdk_surface_get_height (window); mv_resize->moveresize_geom_mask = impl->geometry_hints_mask; mv_resize->moveresize_geometry = impl->geometry_hints; @@ -1330,18 +1330,18 @@ gdk_broadway_window_begin_move_drag (GdkWindow *window, } static gboolean -gdk_broadway_window_beep (GdkWindow *window) +gdk_broadway_surface_beep (GdkSurface *window) { return FALSE; } static void -gdk_broadway_window_set_opacity (GdkWindow *window, +gdk_broadway_surface_set_opacity (GdkSurface *window, gdouble opacity) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; @@ -1352,77 +1352,77 @@ gdk_broadway_window_set_opacity (GdkWindow *window, } guint32 -gdk_broadway_get_last_seen_time (GdkWindow *window) +gdk_broadway_get_last_seen_time (GdkSurface *window) { GdkDisplay *display; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); return _gdk_broadway_server_get_last_seen_time (GDK_BROADWAY_DISPLAY (display)->server); } static void -gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass) +gdk_surface_impl_broadway_class_init (GdkSurfaceImplBroadwayClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass); - - object_class->finalize = gdk_window_impl_broadway_finalize; - - impl_class->ref_cairo_surface = gdk_window_broadway_ref_cairo_surface; - impl_class->show = gdk_window_broadway_show; - impl_class->hide = gdk_window_broadway_hide; - impl_class->withdraw = gdk_window_broadway_withdraw; - impl_class->set_events = gdk_window_broadway_set_events; - impl_class->get_events = gdk_window_broadway_get_events; - impl_class->raise = gdk_window_broadway_raise; - impl_class->lower = gdk_window_broadway_lower; - impl_class->restack_toplevel = gdk_window_broadway_restack_toplevel; - impl_class->move_resize = gdk_window_broadway_move_resize; - impl_class->get_geometry = gdk_window_broadway_get_geometry; - impl_class->get_root_coords = gdk_window_broadway_get_root_coords; - impl_class->get_device_state = gdk_window_broadway_get_device_state; - impl_class->shape_combine_region = gdk_window_broadway_shape_combine_region; - impl_class->input_shape_combine_region = gdk_window_broadway_input_shape_combine_region; - impl_class->destroy = _gdk_broadway_window_destroy; - impl_class->end_paint = gdk_broadway_window_end_paint; - impl_class->beep = gdk_broadway_window_beep; - - impl_class->focus = gdk_broadway_window_focus; - impl_class->set_type_hint = gdk_broadway_window_set_type_hint; - impl_class->get_type_hint = gdk_broadway_window_get_type_hint; - impl_class->set_modal_hint = gdk_broadway_window_set_modal_hint; - impl_class->set_skip_taskbar_hint = gdk_broadway_window_set_skip_taskbar_hint; - impl_class->set_skip_pager_hint = gdk_broadway_window_set_skip_pager_hint; - impl_class->set_urgency_hint = gdk_broadway_window_set_urgency_hint; - impl_class->set_geometry_hints = gdk_broadway_window_set_geometry_hints; - impl_class->set_title = gdk_broadway_window_set_title; - impl_class->set_role = gdk_broadway_window_set_role; - impl_class->set_startup_id = gdk_broadway_window_set_startup_id; - impl_class->set_transient_for = gdk_broadway_window_set_transient_for; - impl_class->get_frame_extents = gdk_broadway_window_get_frame_extents; - impl_class->set_accept_focus = gdk_broadway_window_set_accept_focus; - impl_class->set_focus_on_map = gdk_broadway_window_set_focus_on_map; - impl_class->set_icon_list = gdk_broadway_window_set_icon_list; - impl_class->set_icon_name = gdk_broadway_window_set_icon_name; - impl_class->iconify = gdk_broadway_window_iconify; - impl_class->deiconify = gdk_broadway_window_deiconify; - impl_class->stick = gdk_broadway_window_stick; - impl_class->unstick = gdk_broadway_window_unstick; - impl_class->maximize = gdk_broadway_window_maximize; - impl_class->unmaximize = gdk_broadway_window_unmaximize; - impl_class->fullscreen = gdk_broadway_window_fullscreen; - impl_class->unfullscreen = gdk_broadway_window_unfullscreen; - impl_class->set_keep_above = gdk_broadway_window_set_keep_above; - impl_class->set_keep_below = gdk_broadway_window_set_keep_below; - impl_class->get_group = gdk_broadway_window_get_group; - impl_class->set_group = gdk_broadway_window_set_group; - impl_class->set_decorations = gdk_broadway_window_set_decorations; - impl_class->get_decorations = gdk_broadway_window_get_decorations; - impl_class->set_functions = gdk_broadway_window_set_functions; - impl_class->begin_resize_drag = gdk_broadway_window_begin_resize_drag; - impl_class->begin_move_drag = gdk_broadway_window_begin_move_drag; - impl_class->set_opacity = gdk_broadway_window_set_opacity; - impl_class->destroy_notify = gdk_broadway_window_destroy_notify; - impl_class->register_dnd = _gdk_broadway_window_register_dnd; - impl_class->drag_begin = _gdk_broadway_window_drag_begin; + GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_CLASS (klass); + + object_class->finalize = gdk_surface_impl_broadway_finalize; + + impl_class->ref_cairo_surface = gdk_surface_broadway_ref_cairo_surface; + impl_class->show = gdk_surface_broadway_show; + impl_class->hide = gdk_surface_broadway_hide; + impl_class->withdraw = gdk_surface_broadway_withdraw; + impl_class->set_events = gdk_surface_broadway_set_events; + impl_class->get_events = gdk_surface_broadway_get_events; + impl_class->raise = gdk_surface_broadway_raise; + impl_class->lower = gdk_surface_broadway_lower; + impl_class->restack_toplevel = gdk_surface_broadway_restack_toplevel; + impl_class->move_resize = gdk_surface_broadway_move_resize; + impl_class->get_geometry = gdk_surface_broadway_get_geometry; + impl_class->get_root_coords = gdk_surface_broadway_get_root_coords; + impl_class->get_device_state = gdk_surface_broadway_get_device_state; + impl_class->shape_combine_region = gdk_surface_broadway_shape_combine_region; + impl_class->input_shape_combine_region = gdk_surface_broadway_input_shape_combine_region; + impl_class->destroy = _gdk_broadway_surface_destroy; + impl_class->end_paint = gdk_broadway_surface_end_paint; + impl_class->beep = gdk_broadway_surface_beep; + + impl_class->focus = gdk_broadway_surface_focus; + impl_class->set_type_hint = gdk_broadway_surface_set_type_hint; + impl_class->get_type_hint = gdk_broadway_surface_get_type_hint; + impl_class->set_modal_hint = gdk_broadway_surface_set_modal_hint; + impl_class->set_skip_taskbar_hint = gdk_broadway_surface_set_skip_taskbar_hint; + impl_class->set_skip_pager_hint = gdk_broadway_surface_set_skip_pager_hint; + impl_class->set_urgency_hint = gdk_broadway_surface_set_urgency_hint; + impl_class->set_geometry_hints = gdk_broadway_surface_set_geometry_hints; + impl_class->set_title = gdk_broadway_surface_set_title; + impl_class->set_role = gdk_broadway_surface_set_role; + impl_class->set_startup_id = gdk_broadway_surface_set_startup_id; + impl_class->set_transient_for = gdk_broadway_surface_set_transient_for; + impl_class->get_frame_extents = gdk_broadway_surface_get_frame_extents; + impl_class->set_accept_focus = gdk_broadway_surface_set_accept_focus; + impl_class->set_focus_on_map = gdk_broadway_surface_set_focus_on_map; + impl_class->set_icon_list = gdk_broadway_surface_set_icon_list; + impl_class->set_icon_name = gdk_broadway_surface_set_icon_name; + impl_class->iconify = gdk_broadway_surface_iconify; + impl_class->deiconify = gdk_broadway_surface_deiconify; + impl_class->stick = gdk_broadway_surface_stick; + impl_class->unstick = gdk_broadway_surface_unstick; + impl_class->maximize = gdk_broadway_surface_maximize; + impl_class->unmaximize = gdk_broadway_surface_unmaximize; + impl_class->fullscreen = gdk_broadway_surface_fullscreen; + impl_class->unfullscreen = gdk_broadway_surface_unfullscreen; + impl_class->set_keep_above = gdk_broadway_surface_set_keep_above; + impl_class->set_keep_below = gdk_broadway_surface_set_keep_below; + impl_class->get_group = gdk_broadway_surface_get_group; + impl_class->set_group = gdk_broadway_surface_set_group; + impl_class->set_decorations = gdk_broadway_surface_set_decorations; + impl_class->get_decorations = gdk_broadway_surface_get_decorations; + impl_class->set_functions = gdk_broadway_surface_set_functions; + impl_class->begin_resize_drag = gdk_broadway_surface_begin_resize_drag; + impl_class->begin_move_drag = gdk_broadway_surface_begin_move_drag; + impl_class->set_opacity = gdk_broadway_surface_set_opacity; + impl_class->destroy_notify = gdk_broadway_surface_destroy_notify; + impl_class->register_dnd = _gdk_broadway_surface_register_dnd; + impl_class->drag_begin = _gdk_broadway_surface_drag_begin; } diff --git a/gdk/broadway/gdkwindow-broadway.h b/gdk/broadway/gdkwindow-broadway.h index bce4a7ddaa..d6239319d2 100644 --- a/gdk/broadway/gdkwindow-broadway.h +++ b/gdk/broadway/gdkwindow-broadway.h @@ -22,31 +22,31 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#ifndef __GDK_WINDOW_BROADWAY_H__ -#define __GDK_WINDOW_BROADWAY_H__ +#ifndef __GDK_SURFACE_BROADWAY_H__ +#define __GDK_SURFACE_BROADWAY_H__ #include <gdk/gdkwindowimpl.h> G_BEGIN_DECLS -typedef struct _GdkWindowImplBroadway GdkWindowImplBroadway; -typedef struct _GdkWindowImplBroadwayClass GdkWindowImplBroadwayClass; +typedef struct _GdkSurfaceImplBroadway GdkSurfaceImplBroadway; +typedef struct _GdkSurfaceImplBroadwayClass GdkSurfaceImplBroadwayClass; /* Window implementation for Broadway */ -#define GDK_TYPE_WINDOW_IMPL_BROADWAY (gdk_window_impl_broadway_get_type ()) -#define GDK_WINDOW_IMPL_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_BROADWAY, GdkWindowImplBroadway)) -#define GDK_WINDOW_IMPL_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL_BROADWAY, GdkWindowImplBroadwayClass)) -#define GDK_IS_WINDOW_IMPL_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_BROADWAY)) -#define GDK_IS_WINDOW_IMPL_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_BROADWAY)) -#define GDK_WINDOW_IMPL_BROADWAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_BROADWAY, GdkWindowImplBroadwayClass)) +#define GDK_TYPE_SURFACE_IMPL_BROADWAY (gdk_surface_impl_broadway_get_type ()) +#define GDK_SURFACE_IMPL_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL_BROADWAY, GdkSurfaceImplBroadway)) +#define GDK_SURFACE_IMPL_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL_BROADWAY, GdkSurfaceImplBroadwayClass)) +#define GDK_IS_SURFACE_IMPL_BROADWAY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL_BROADWAY)) +#define GDK_IS_SURFACE_IMPL_BROADWAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL_BROADWAY)) +#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; @@ -66,19 +66,19 @@ struct _GdkWindowImplBroadway gboolean last_synced; GdkGeometry geometry_hints; - GdkWindowHints geometry_hints_mask; + GdkSurfaceHints geometry_hints_mask; GArray *node_data; 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 -#endif /* __GDK_WINDOW_BROADWAY_H__ */ +#endif /* __GDK_SURFACE_BROADWAY_H__ */ diff --git a/gdk/gdk-autocleanup.h b/gdk/gdk-autocleanup.h index 28a1f55211..b47e1c48c4 100644 --- a/gdk/gdk-autocleanup.h +++ b/gdk/gdk-autocleanup.h @@ -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(GdkSeat, 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(GdkEvent, gdk_event_free) diff --git a/gdk/gdk-private.h b/gdk/gdk-private.h index 7c4cd30d27..58a027129e 100644 --- a/gdk/gdk-private.h +++ b/gdk/gdk-private.h @@ -10,17 +10,17 @@ GdkDisplay * gdk_display_open_default (void); gboolean gdk_device_grab_info (GdkDisplay *display, GdkDevice *device, - GdkWindow **grab_window, + GdkSurface **grab_window, gboolean *owner_events); void gdk_pre_parse (void); -void gdk_window_freeze_toplevel_updates (GdkWindow *window); -void gdk_window_thaw_toplevel_updates (GdkWindow *window); +void gdk_surface_freeze_toplevel_updates (GdkSurface *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, GdkGravity rect_anchor, GdkGravity window_anchor, diff --git a/gdk/gdkcairo.c b/gdk/gdkcairo.c index a53b01be9a..4f9148972f 100644 --- a/gdk/gdkcairo.c +++ b/gdk/gdkcairo.c @@ -33,9 +33,9 @@ * 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 - * 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, - * #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 * gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf, int scale, - GdkWindow *for_window) + GdkSurface *for_window) { cairo_format_t format; cairo_surface_t *surface; g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), 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) format = CAIRO_FORMAT_RGB24; @@ -266,7 +266,7 @@ gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf, format = CAIRO_FORMAT_ARGB32; surface = - gdk_window_create_similar_image_surface (for_window, + gdk_surface_create_similar_image_surface (for_window, format, gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf), diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h index 9417b0fd69..dddd91a3ff 100644 --- a/gdk/gdkcairo.h +++ b/gdk/gdkcairo.h @@ -58,10 +58,10 @@ cairo_region_t * GDK_AVAILABLE_IN_ALL cairo_surface_t * gdk_cairo_surface_create_from_pixbuf (const GdkPixbuf *pixbuf, int scale, - GdkWindow *for_window); + GdkSurface *for_window); GDK_AVAILABLE_IN_ALL void gdk_cairo_draw_from_gl (cairo_t *cr, - GdkWindow *window, + GdkSurface *window, int source, int source_type, int buffer_scale, diff --git a/gdk/gdkcursor.c b/gdk/gdkcursor.c index 2fb1f51838..1964d4fd59 100644 --- a/gdk/gdkcursor.c +++ b/gdk/gdkcursor.c @@ -48,7 +48,7 @@ * * Cursors by themselves are not very interesting, they must be * 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 * as gtk_widget_set_cursor() instead. * @@ -69,7 +69,7 @@ * gdk_display_get_maximal_cursor_size() for the limitations that might apply. * * 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 * have fallback cursors again, so it is possible to provide a chain of * progressively easier to support cursors. If none of the provided cursors diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c index 30b7a5ed2e..df6992b67f 100644 --- a/gdk/gdkdevice.c +++ b/gdk/gdkdevice.c @@ -502,7 +502,7 @@ gdk_device_get_property (GObject *object, /** * gdk_device_get_state: (skip) * @device: a #GdkDevice. - * @window: a #GdkWindow. + * @window: a #GdkSurface. * @axes: (nullable) (array): an array of doubles to store the values of * the axes of @device in, or %NULL. * @mask: (optional) (out): location to store the modifiers, or %NULL. @@ -514,13 +514,13 @@ gdk_device_get_property (GObject *object, */ void gdk_device_get_state (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, GdkModifierType *mask) { 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_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 || 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, * 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. **/ -GdkWindow * +GdkSurface * gdk_device_get_window_at_position_double (GdkDevice *device, gdouble *win_x, gdouble *win_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_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 may contain client side children */ if (window) - window = _gdk_window_find_descendant_at (window, + window = _gdk_surface_find_descendant_at (window, 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, * 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. **/ -GdkWindow * +GdkSurface * gdk_device_get_window_at_position (GdkDevice *device, gint *win_x, gint *win_y) { gdouble tmp_x, tmp_y; - GdkWindow *window; + GdkSurface *window; window = 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 * 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 * system. * @@ -707,7 +707,7 @@ gdk_device_get_window_at_position (GdkDevice *device, **/ gboolean gdk_device_get_history (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, guint32 start, guint32 stop, 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_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) *n_events = 0; @@ -723,7 +723,7 @@ gdk_device_get_history (GdkDevice *device, if (events) *events = NULL; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return FALSE; 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 * gdk_seat_get_pointer() but only in code that isn’t triggered by a * #GdkEvent and there aren’t 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. * @owner_events: if %FALSE then all device events are reported with respect to * @window and are only reported if selected by @event_mask. If @@ -1357,7 +1357,7 @@ get_native_grab_event_mask (GdkEventMask grab_mask) **/ GdkGrabStatus gdk_device_grab (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkGrabOwnership grab_ownership, gboolean owner_events, GdkEventMask event_mask, @@ -1365,15 +1365,15 @@ gdk_device_grab (GdkDevice *device, guint32 time_) { 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_WINDOW (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_IS_SURFACE (window), 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; res = GDK_DEVICE_GET_CLASS (device)->grab (device, @@ -1389,7 +1389,7 @@ gdk_device_grab (GdkDevice *device, GdkDisplay *display; gulong serial; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); serial = _gdk_display_get_next_serial (display); _gdk_display_add_device_grab (display, @@ -1567,7 +1567,7 @@ find_axis_info (GArray *array, gboolean _gdk_device_translate_window_coord (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, guint index_, gdouble value, gdouble *axis_value) @@ -1608,8 +1608,8 @@ _gdk_device_translate_window_coord (GdkDevice *device, x_min = axis_info_x->min_value; y_min = axis_info_y->min_value; - window_width = gdk_window_get_width (window); - window_height = gdk_window_get_height (window); + window_width = gdk_surface_get_width (window); + window_height = gdk_surface_get_height (window); x_resolution = axis_info_x->resolution; y_resolution = axis_info_y->resolution; @@ -1665,7 +1665,7 @@ _gdk_device_translate_window_coord (GdkDevice *device, gboolean _gdk_device_translate_screen_coord (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble window_root_x, gdouble window_root_y, gdouble screen_width, @@ -1746,8 +1746,8 @@ _gdk_device_translate_axis (GdkDevice *device, void _gdk_device_query_state (GdkDevice *device, - GdkWindow *window, - GdkWindow **child_window, + GdkSurface *window, + GdkSurface **child_window, gdouble *root_x, gdouble *root_y, gdouble *win_x, @@ -1764,7 +1764,7 @@ _gdk_device_query_state (GdkDevice *device, mask); } -GdkWindow * +GdkSurface * _gdk_device_window_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, @@ -1790,11 +1790,11 @@ _gdk_device_window_at_position (GdkDevice *device, * * Returns: (transfer none) (allow-none): the last window the device */ -GdkWindow * +GdkSurface * gdk_device_get_last_event_window (GdkDevice *device) { GdkDisplay *display; - GdkPointerWindowInfo *info; + GdkPointerSurfaceInfo *info; g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL); diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h index bddaa71824..67f7de0712 100644 --- a/gdk/gdkdevice.h +++ b/gdk/gdkdevice.h @@ -163,7 +163,7 @@ void gdk_device_set_axis_use (GdkDevice *device, GDK_AVAILABLE_IN_ALL void gdk_device_get_state (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, GdkModifierType *mask); GDK_AVAILABLE_IN_ALL @@ -171,7 +171,7 @@ void gdk_device_get_position (GdkDevice *device, gint *x, gint *y); GDK_AVAILABLE_IN_ALL -GdkWindow * +GdkSurface * gdk_device_get_window_at_position (GdkDevice *device, gint *win_x, @@ -181,14 +181,14 @@ void gdk_device_get_position_double (GdkDevice *device, gdouble *x, gdouble *y); GDK_AVAILABLE_IN_ALL -GdkWindow * +GdkSurface * gdk_device_get_window_at_position_double (GdkDevice *device, gdouble *win_x, gdouble *win_y); GDK_AVAILABLE_IN_ALL gboolean gdk_device_get_history (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, guint32 start, guint32 stop, GdkTimeCoord ***events, @@ -225,7 +225,7 @@ GdkDeviceType gdk_device_get_device_type (GdkDevice *device); GDK_DEPRECATED_FOR(gdk_seat_grab) GdkGrabStatus gdk_device_grab (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkGrabOwnership grab_ownership, gboolean owner_events, GdkEventMask event_mask, @@ -242,7 +242,7 @@ void gdk_device_warp (GdkDevice *device, gint y); 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 const gchar *gdk_device_get_vendor_id (GdkDevice *device); diff --git a/gdk/gdkdeviceprivate.h b/gdk/gdkdeviceprivate.h index 1f6392f9dd..130a77b97b 100644 --- a/gdk/gdkdeviceprivate.h +++ b/gdk/gdkdeviceprivate.h @@ -71,49 +71,49 @@ struct _GdkDeviceClass GObjectClass parent_class; gboolean (* get_history) (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, guint32 start, guint32 stop, GdkTimeCoord ***events, gint *n_events); void (* get_state) (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, GdkModifierType *mask); void (* set_window_cursor) (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkCursor *cursor); void (* warp) (GdkDevice *device, gdouble x, gdouble y); void (* query_state) (GdkDevice *device, - GdkWindow *window, - GdkWindow **child_window, + GdkSurface *window, + GdkSurface **child_window, gdouble *root_x, gdouble *root_y, gdouble *win_x, gdouble *win_y, GdkModifierType *mask); GdkGrabStatus (* grab) (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gboolean owner_events, GdkEventMask event_mask, - GdkWindow *confine_to, + GdkSurface *confine_to, GdkCursor *cursor, guint32 time_); void (*ungrab) (GdkDevice *device, guint32 time_); - GdkWindow * (* window_at_position) (GdkDevice *device, + GdkSurface * (* window_at_position) (GdkDevice *device, double *win_x, double *win_y, GdkModifierType *mask, gboolean get_toplevel); void (* select_window_events) (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkEventMask event_mask); }; @@ -139,13 +139,13 @@ void _gdk_device_set_keys (GdkDevice *device, guint num_keys); gboolean _gdk_device_translate_window_coord (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, guint index, gdouble value, gdouble *axis_value); gboolean _gdk_device_translate_screen_coord (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble window_root_x, gdouble window_root_y, gdouble screen_width, @@ -167,14 +167,14 @@ void _gdk_device_add_slave (GdkDevice *device, void _gdk_device_remove_slave (GdkDevice *device, GdkDevice *slave); void _gdk_device_query_state (GdkDevice *device, - GdkWindow *window, - GdkWindow **child_window, + GdkSurface *window, + GdkSurface **child_window, gdouble *root_x, gdouble *root_y, gdouble *win_x, gdouble *win_y, GdkModifierType *mask); -GdkWindow * _gdk_device_window_at_position (GdkDevice *device, +GdkSurface * _gdk_device_window_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c index aa846da453..cfcffcec6a 100644 --- a/gdk/gdkdisplay.c +++ b/gdk/gdkdisplay.c @@ -171,7 +171,7 @@ gdk_display_class_init (GdkDisplayClass *class) object_class->get_property = gdk_display_get_property; 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->make_default = gdk_display_real_make_default; @@ -326,10 +326,10 @@ gdk_display_class_init (GdkDisplayClass *class) } static void -free_pointer_info (GdkPointerWindowInfo *info) +free_pointer_info (GdkPointerSurfaceInfo *info) { g_clear_object (&info->window_under_pointer); - g_slice_free (GdkPointerWindowInfo, info); + g_slice_free (GdkPointerSurfaceInfo, info); } static void @@ -516,14 +516,14 @@ gdk_display_put_event (GdkDisplay *display, static void generate_grab_broken_event (GdkDisplay *display, - GdkWindow *window, + GdkSurface *window, GdkDevice *device, gboolean implicit, - GdkWindow *grab_window) + GdkSurface *grab_window) { g_return_if_fail (window != NULL); - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { GdkEvent *event; @@ -559,8 +559,8 @@ _gdk_display_get_last_device_grab (GdkDisplay *display, GdkDeviceGrabInfo * _gdk_display_add_device_grab (GdkDisplay *display, GdkDevice *device, - GdkWindow *window, - GdkWindow *native_window, + GdkSurface *window, + GdkSurface *native_window, GdkGrabOwnership grab_ownership, gboolean owner_events, GdkEventMask event_mask, @@ -619,23 +619,23 @@ _gdk_display_add_device_grab (GdkDisplay *display, return info; } -static GdkWindow * +static GdkSurface * get_current_toplevel (GdkDisplay *display, GdkDevice *device, int *x_out, int *y_out, GdkModifierType *state_out) { - GdkWindow *pointer_window; + GdkSurface *pointer_window; gdouble x, y; GdkModifierType state; pointer_window = _gdk_device_window_at_position (device, &x, &y, &state, TRUE); if (pointer_window != NULL && - (GDK_WINDOW_DESTROYED (pointer_window) || - GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_ROOT || - GDK_WINDOW_TYPE (pointer_window) == GDK_WINDOW_FOREIGN)) + (GDK_SURFACE_DESTROYED (pointer_window) || + GDK_SURFACE_TYPE (pointer_window) == GDK_SURFACE_ROOT || + GDK_SURFACE_TYPE (pointer_window) == GDK_SURFACE_FOREIGN)) pointer_window = NULL; *x_out = round (x); @@ -654,8 +654,8 @@ switch_to_pointer_grab (GdkDisplay *display, guint32 time, gulong serial) { - GdkWindow *new_toplevel; - GdkPointerWindowInfo *info; + GdkSurface *new_toplevel; + GdkPointerSurfaceInfo *info; GList *old_grabs; GdkModifierType state; int x = 0, y = 0; @@ -768,7 +768,7 @@ _gdk_display_device_grab_update (GdkDisplay *display, if ((next_grab == NULL && current_grab->implicit_ungrab) || (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, current_grab->implicit, next_grab? next_grab->window : NULL); @@ -837,7 +837,7 @@ gboolean _gdk_display_end_device_grab (GdkDisplay *display, GdkDevice *device, gulong serial, - GdkWindow *if_child, + GdkSurface *if_child, gboolean implicit) { GdkDeviceGrabInfo *grab; @@ -851,7 +851,7 @@ _gdk_display_end_device_grab (GdkDisplay *display, grab = l->data; if (grab && (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->implicit_ungrab = implicit; @@ -916,11 +916,11 @@ _gdk_display_check_grab_ownership (GdkDisplay *display, return TRUE; } -GdkPointerWindowInfo * +GdkPointerSurfaceInfo * _gdk_display_get_pointer_info (GdkDisplay *display, GdkDevice *device) { - GdkPointerWindowInfo *info; + GdkPointerSurfaceInfo *info; if (device && gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD) device = gdk_device_get_associated_device (device); @@ -932,7 +932,7 @@ _gdk_display_get_pointer_info (GdkDisplay *display, if (G_UNLIKELY (!info)) { - info = g_slice_new0 (GdkPointerWindowInfo); + info = g_slice_new0 (GdkPointerSurfaceInfo); 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)) { - GdkPointerWindowInfo *info = value; + GdkPointerSurfaceInfo *info = value; GdkDevice *device = key; (func) (display, device, info, user_data); @@ -975,7 +975,7 @@ _gdk_display_pointer_info_foreach (GdkDisplay *display, gboolean gdk_device_grab_info (GdkDisplay *display, GdkDevice *device, - GdkWindow **grab_window, + GdkSurface **grab_window, gboolean *owner_events) { GdkDeviceGrabInfo *info; @@ -1105,12 +1105,12 @@ gdk_display_flush (GdkDisplay *display) * * Returns the default group leader window for all toplevel windows * 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 * for @display **/ -GdkWindow * +GdkSurface * gdk_display_get_default_group (GdkDisplay *display) { 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: * @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. * * Returns: %TRUE if shaped windows are supported @@ -1179,7 +1179,7 @@ gdk_display_supports_shapes (GdkDisplay *display) * gdk_display_supports_input_shapes: * @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. * * Returns: %TRUE if windows with modified input shape are supported @@ -1315,10 +1315,10 @@ _gdk_display_event_data_free (GdkDisplay *display, void _gdk_display_create_window_impl (GdkDisplay *display, - GdkWindow *window, - GdkWindow *real_parent, + GdkSurface *window, + GdkSurface *real_parent, GdkEventMask event_mask, - GdkWindowAttr *attributes) + GdkSurfaceAttr *attributes) { GDK_DISPLAY_GET_CLASS (display)->create_window_impl (display, window, @@ -1327,7 +1327,7 @@ _gdk_display_create_window_impl (GdkDisplay *display, attributes); } -GdkWindow * +GdkSurface * _gdk_display_create_window (GdkDisplay *display) { 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. * * 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. * @@ -1675,7 +1675,7 @@ gdk_display_get_monitor_at_point (GdkDisplay *display, /** * gdk_display_get_monitor_at_window: * @display: a #GdkDisplay - * @window: a #GdkWindow + * @window: a #GdkSurface * * Gets the monitor in which the largest area of @window * resides, or a monitor close to @window if it is outside @@ -1685,7 +1685,7 @@ gdk_display_get_monitor_at_point (GdkDisplay *display, */ GdkMonitor * gdk_display_get_monitor_at_window (GdkDisplay *display, - GdkWindow *window) + GdkSurface *window) { GdkRectangle win; int n_monitors, i; @@ -1704,8 +1704,8 @@ gdk_display_get_monitor_at_window (GdkDisplay *display, return best; } - gdk_window_get_geometry (window, &win.x, &win.y, &win.width, &win.height); - gdk_window_get_origin (window, &win.x, &win.y); + gdk_surface_get_geometry (window, &win.x, &win.y, &win.width, &win.height); + gdk_surface_get_origin (window, &win.x, &win.y); n_monitors = gdk_display_get_n_monitors (display); for (i = 0; i < n_monitors; i++) diff --git a/gdk/gdkdisplay.h b/gdk/gdkdisplay.h index 9e46649795..5d7d62158f 100644 --- a/gdk/gdkdisplay.h +++ b/gdk/gdkdisplay.h @@ -80,7 +80,7 @@ GDK_AVAILABLE_IN_ALL GdkDisplay *gdk_display_get_default (void); GDK_AVAILABLE_IN_ALL -GdkWindow *gdk_display_get_default_group (GdkDisplay *display); +GdkSurface *gdk_display_get_default_group (GdkDisplay *display); GDK_AVAILABLE_IN_ALL GdkClipboard * gdk_display_get_clipboard (GdkDisplay *display); @@ -117,7 +117,7 @@ GdkMonitor * gdk_display_get_monitor_at_point (GdkDisplay *display, int y); GDK_AVAILABLE_IN_ALL GdkMonitor * gdk_display_get_monitor_at_window (GdkDisplay *display, - GdkWindow *window); + GdkSurface *window); GDK_AVAILABLE_IN_ALL GdkKeymap * gdk_display_get_keymap (GdkDisplay *display); diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h index ddb1c14f72..dc206b9070 100644 --- a/gdk/gdkdisplayprivate.h +++ b/gdk/gdkdisplayprivate.h @@ -40,8 +40,8 @@ typedef struct _GdkDisplayClass GdkDisplayClass; /* Tracks information about the device grab on this display */ typedef struct { - GdkWindow *window; - GdkWindow *native_window; + GdkSurface *window; + GdkSurface *native_window; gulong serial_start; gulong serial_end; /* exclusive, i.e. not active on serial_end */ guint event_mask; @@ -63,12 +63,12 @@ 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; guint32 state; guint32 button; GdkDevice *last_slave; -} GdkPointerWindowInfo; +} GdkPointerSurfaceInfo; struct _GdkDisplay { @@ -86,7 +86,7 @@ struct _GdkDisplay GdkClipboard *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 */ guint double_click_time; /* Maximum time between clicks in msecs */ @@ -125,7 +125,7 @@ struct _GdkDisplayClass gboolean (*has_pending) (GdkDisplay *display); void (*queue_events) (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_input_shapes) (GdkDisplay *display); @@ -141,10 +141,10 @@ struct _GdkDisplayClass void (*event_data_free) (GdkDisplay *display, GdkEvent *event); void (*create_window_impl) (GdkDisplay *display, - GdkWindow *window, - GdkWindow *real_parent, + GdkSurface *window, + GdkSurface *real_parent, GdkEventMask event_mask, - GdkWindowAttr *attributes); + GdkSurfaceAttr *attributes); GdkKeymap * (*get_keymap) (GdkDisplay *display); @@ -167,7 +167,7 @@ struct _GdkDisplayClass int index); GdkMonitor * (*get_primary_monitor) (GdkDisplay *display); GdkMonitor * (*get_monitor_at_window) (GdkDisplay *display, - GdkWindow *window); + GdkSurface *window); gboolean (*get_setting) (GdkDisplay *display, const char *name, GValue *value); @@ -185,7 +185,7 @@ struct _GdkDisplayClass typedef void (* GdkDisplayPointerInfoForeach) (GdkDisplay *display, GdkDevice *device, - GdkPointerWindowInfo *device_info, + GdkPointerSurfaceInfo *device_info, gpointer user_data); void _gdk_display_update_last_event (GdkDisplay *display, @@ -198,8 +198,8 @@ GdkDeviceGrabInfo * _gdk_display_get_last_device_grab (GdkDisplay *display, GdkDevice *device); GdkDeviceGrabInfo * _gdk_display_add_device_grab (GdkDisplay *display, GdkDevice *device, - GdkWindow *window, - GdkWindow *native_window, + GdkSurface *window, + GdkSurface *native_window, GdkGrabOwnership grab_ownership, gboolean owner_events, GdkEventMask event_mask, @@ -212,12 +212,12 @@ GdkDeviceGrabInfo * _gdk_display_has_device_grab (GdkDisplay *display gboolean _gdk_display_end_device_grab (GdkDisplay *display, GdkDevice *device, gulong serial, - GdkWindow *if_child, + GdkSurface *if_child, gboolean implicit); gboolean _gdk_display_check_grab_ownership (GdkDisplay *display, GdkDevice *device, gulong serial); -GdkPointerWindowInfo * _gdk_display_get_pointer_info (GdkDisplay *display, +GdkPointerSurfaceInfo * _gdk_display_get_pointer_info (GdkDisplay *display, GdkDevice *device); void _gdk_display_pointer_info_foreach (GdkDisplay *display, GdkDisplayPointerInfoForeach func, @@ -231,11 +231,11 @@ void _gdk_display_event_data_copy (GdkDisplay *display void _gdk_display_event_data_free (GdkDisplay *display, GdkEvent *event); void _gdk_display_create_window_impl (GdkDisplay *display, - GdkWindow *window, - GdkWindow *real_parent, + GdkSurface *window, + GdkSurface *real_parent, GdkEventMask event_mask, - GdkWindowAttr *attributes); -GdkWindow * _gdk_display_create_window (GdkDisplay *display); + GdkSurfaceAttr *attributes); +GdkSurface * _gdk_display_create_window (GdkDisplay *display); gboolean gdk_display_make_gl_context_current (GdkDisplay *display, GdkGLContext *context); diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c index a8aecbbb2e..f3197e6d75 100644 --- a/gdk/gdkdnd.c +++ b/gdk/gdkdnd.c @@ -174,11 +174,11 @@ gdk_drag_context_get_selected_action (GdkDragContext *context) * gdk_drag_context_get_source_window: * @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) { 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: (transfer none): a #GdkWindow + * Returns: (transfer none): a #GdkSurface **/ -GdkWindow * +GdkSurface * gdk_drag_context_get_dest_window (GdkDragContext *context) { 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 */ -GdkWindow * +GdkSurface * gdk_drag_context_get_drag_window (GdkDragContext *context) { g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL); diff --git a/gdk/gdkdnd.h b/gdk/gdkdnd.h index 16442a5bb2..bef1693bac 100644 --- a/gdk/gdkdnd.h +++ b/gdk/gdkdnd.h @@ -98,9 +98,9 @@ GDK_AVAILABLE_IN_ALL GdkDragAction gdk_drag_context_get_selected_action (GdkDragContext *context); 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 -GdkWindow *gdk_drag_context_get_dest_window (GdkDragContext *context); +GdkSurface *gdk_drag_context_get_dest_window (GdkDragContext *context); /* Destination side */ GDK_AVAILABLE_IN_ALL @@ -132,7 +132,7 @@ GInputStream * gdk_drop_read_finish (GdkDragContext * /* Source side */ GDK_AVAILABLE_IN_ALL -GdkDragContext * gdk_drag_begin (GdkWindow *window, +GdkDragContext * gdk_drag_begin (GdkSurface *window, GdkDevice *device, GdkContentProvider *content, GdkDragAction actions, @@ -147,7 +147,7 @@ void gdk_drag_drop_done (GdkDragContext *context, gboolean success); 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 void gdk_drag_context_set_hotspot (GdkDragContext *context, diff --git a/gdk/gdkdndprivate.h b/gdk/gdkdndprivate.h index d4fb2b7feb..3d3c292501 100644 --- a/gdk/gdkdndprivate.h +++ b/gdk/gdkdndprivate.h @@ -57,7 +57,7 @@ struct _GdkDragContextClass { GAsyncResult *result, GError **error); gboolean (*drop_status) (GdkDragContext *context); - GdkWindow* (*get_drag_window) (GdkDragContext *context); + GdkSurface* (*get_drag_window) (GdkDragContext *context); void (*set_hotspot) (GdkDragContext *context, gint hot_x, gint hot_y); @@ -87,9 +87,9 @@ struct _GdkDragContext { GdkDisplay *display; gboolean is_source; - GdkWindow *source_window; - GdkWindow *dest_window; - GdkWindow *drag_window; + GdkSurface *source_window; + GdkSurface *dest_window; + GdkSurface *drag_window; GdkContentProvider *content; GdkContentFormats *formats; diff --git a/gdk/gdkdrawcontext.c b/gdk/gdkdrawcontext.c index 2566d01ca6..2c8ebe164b 100644 --- a/gdk/gdkdrawcontext.c +++ b/gdk/gdkdrawcontext.c @@ -49,7 +49,7 @@ typedef struct _GdkDrawContextPrivate GdkDrawContextPrivate; struct _GdkDrawContextPrivate { - GdkWindow *window; + GdkSurface *window; guint is_drawing : 1; }; @@ -148,13 +148,13 @@ gdk_draw_context_class_init (GdkDrawContextClass *klass) /** * GdkDrawContext:window: * - * The #GdkWindow the gl context is bound to. + * The #GdkSurface the gl context is bound to. */ pspecs[PROP_WINDOW] = g_param_spec_object ("window", P_("Window"), P_("The GDK window bound to the context"), - GDK_TYPE_WINDOW, + GDK_TYPE_SURFACE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | 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); - 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: * @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) { GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (context); diff --git a/gdk/gdkdrawcontext.h b/gdk/gdkdrawcontext.h index 8c9c982926..e27d175a0b 100644 --- a/gdk/gdkdrawcontext.h +++ b/gdk/gdkdrawcontext.h @@ -40,7 +40,7 @@ GType gdk_draw_context_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_ALL GdkDisplay * gdk_draw_context_get_display (GdkDrawContext *context); GDK_AVAILABLE_IN_ALL -GdkWindow * gdk_draw_context_get_window (GdkDrawContext *context); +GdkSurface * gdk_draw_context_get_window (GdkDrawContext *context); G_END_DECLS diff --git a/gdk/gdkdrawingcontext.c b/gdk/gdkdrawingcontext.c index 3c408a5f59..eecf58a23a 100644 --- a/gdk/gdkdrawingcontext.c +++ b/gdk/gdkdrawingcontext.c @@ -21,13 +21,13 @@ * @Short_description: Drawing context for GDK windows * * #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. * - * A #GdkDrawingContext can only be created by calling gdk_window_begin_draw_frame() - * and will be valid until a call to gdk_window_end_draw_frame(). + * A #GdkDrawingContext can only be created by calling gdk_surface_begin_draw_frame() + * and will be valid until a call to gdk_surface_end_draw_frame(). * * #GdkDrawingContext is available since GDK 3.22 */ @@ -56,7 +56,7 @@ typedef struct _GdkDrawingContextPrivate GdkDrawingContextPrivate; struct _GdkDrawingContextPrivate { - GdkWindow *window; + GdkSurface *window; GdkDrawContext *paint_context; 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 " "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)); return; } @@ -173,11 +173,11 @@ gdk_drawing_context_class_init (GdkDrawingContextClass *klass) /** * GdkDrawingContext:window: * - * The #GdkWindow that created the drawing context. + * The #GdkSurface that created the drawing context. */ obj_property[PROP_WINDOW] = g_param_spec_object ("window", "Window", "The window that created the context", - GDK_TYPE_WINDOW, + GDK_TYPE_SURFACE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); @@ -242,7 +242,7 @@ gdk_cairo_get_drawing_context (cairo_t *cr) * gdk_drawing_context_get_cairo_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 * created without a #GdkDrawContext for this function to work. If * 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 * #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 - * 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 * 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); 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) return NULL; @@ -273,12 +273,12 @@ gdk_drawing_context_get_cairo_context (GdkDrawingContext *context) cairo_region_t *region; 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); 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); gdk_cairo_region (priv->cr, region); cairo_clip (priv->cr); @@ -296,9 +296,9 @@ gdk_drawing_context_get_cairo_context (GdkDrawingContext *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) { GdkDrawingContextPrivate *priv = gdk_drawing_context_get_instance_private (context); @@ -365,7 +365,7 @@ gdk_drawing_context_is_valid (GdkDrawingContext *context) if (priv->window == NULL) return FALSE; - if (gdk_window_get_drawing_context (priv->window) != context) + if (gdk_surface_get_drawing_context (priv->window) != context) return FALSE; return TRUE; diff --git a/gdk/gdkdrawingcontext.h b/gdk/gdkdrawingcontext.h index 4a6728136b..f010f11bb0 100644 --- a/gdk/gdkdrawingcontext.h +++ b/gdk/gdkdrawingcontext.h @@ -37,7 +37,7 @@ GDK_AVAILABLE_IN_ALL GType gdk_drawing_context_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_ALL -GdkWindow * gdk_drawing_context_get_window (GdkDrawingContext *context); +GdkSurface * gdk_drawing_context_get_window (GdkDrawingContext *context); GDK_AVAILABLE_IN_ALL GdkDrawContext* gdk_drawing_context_get_paint_context (GdkDrawingContext *context); GDK_AVAILABLE_IN_ALL diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index 7f1b84a0e2..70c992b2f5 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -372,7 +372,7 @@ _gdk_event_queue_handle_motion_compression (GdkDisplay *display) { GList *tmp_list; GList *pending_motions = NULL; - GdkWindow *pending_motion_window = NULL; + GdkSurface *pending_motion_window = NULL; GdkDevice *pending_motion_device = 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_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 */ 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 * * Copies a #GdkEvent, copying or incrementing the reference count of the - * resources associated with it (e.g. #GdkWindow’s and strings). + * resources associated with it (e.g. #GdkSurface’s and strings). * * 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: * @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) { 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 * (as in gdk_event_get_device()) if the event wasn’t caused by * 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. * * 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; 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 && ! (bevent->state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK))) 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), GDK_MODIFIER_INTENT_CONTEXT_MENU); @@ -1848,7 +1848,7 @@ gdk_event_get_display (const GdkEvent *event) return event->any.display; if (event->any.window) - return gdk_window_get_display (event->any.window); + return gdk_surface_get_display (event->any.window); return NULL; } @@ -2336,7 +2336,7 @@ gdk_event_get_touch_emulating_pointer (const GdkEvent *event, **/ gboolean gdk_event_get_grab_window (const GdkEvent *event, - GdkWindow **window) + GdkSurface **window) { if (!event) return FALSE; diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h index 6203f9f368..f312fb20c0 100644 --- a/gdk/gdkevents.h +++ b/gdk/gdkevents.h @@ -166,7 +166,7 @@ typedef void (*GdkEventFunc) (GdkEvent *event, * @GDK_LEAVE_NOTIFY: the pointer has 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. - * 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_UNMAP: the window has been unmapped. * @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); GDK_AVAILABLE_IN_ALL -GdkWindow *gdk_event_get_window (const GdkEvent *event); +GdkSurface *gdk_event_get_window (const GdkEvent *event); GDK_AVAILABLE_IN_ALL guint32 gdk_event_get_time (const GdkEvent *event); @@ -546,7 +546,7 @@ gboolean gdk_event_get_touch_emulating_pointer (const GdkEvent *event, gboolean *emulating); GDK_AVAILABLE_IN_ALL gboolean gdk_event_get_grab_window (const GdkEvent *event, - GdkWindow **window); + GdkSurface **window); GDK_AVAILABLE_IN_ALL gboolean gdk_event_get_focus_in (const GdkEvent *event, gboolean *focus_in); diff --git a/gdk/gdkeventsprivate.h b/gdk/gdkeventsprivate.h index 1daffc27b9..ce86bd9891 100644 --- a/gdk/gdkeventsprivate.h +++ b/gdk/gdkeventsprivate.h @@ -55,7 +55,7 @@ struct _GdkEventAny { GObject parent_instance; GdkEventType type; - GdkWindow *window; + GdkSurface *window; guint16 flags; gint8 send_event; GdkDevice *device; @@ -329,7 +329,7 @@ struct _GdkEventKey struct _GdkEventCrossing { GdkEventAny any; - GdkWindow *subwindow; + GdkSurface *subwindow; guint32 time; gdouble x; gdouble y; @@ -427,7 +427,7 @@ struct _GdkEventGrabBroken { GdkEventAny any; gboolean keyboard; gboolean implicit; - GdkWindow *grab_window; + GdkSurface *grab_window; }; /* diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c index 5e9b9cc9a7..df304e2ff3 100644 --- a/gdk/gdkgl.c +++ b/gdk/gdkgl.c @@ -30,7 +30,7 @@ static cairo_user_data_key_t direct_key; void gdk_cairo_surface_mark_as_direct (cairo_surface_t *surface, - GdkWindow *window) + GdkSurface *window) { cairo_surface_set_user_data (surface, &direct_key, 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); GdkGLContextProgram *program; - GdkWindow *window = gdk_gl_context_get_window (paint_context); - int window_scale = gdk_window_get_scale_factor (window); - float w = gdk_window_get_width (window) * window_scale; - float h = gdk_window_get_height (window) * window_scale; + GdkSurface *window = gdk_gl_context_get_window (paint_context); + int window_scale = gdk_surface_get_scale_factor (window); + float w = gdk_surface_get_width (window) * window_scale; + float h = gdk_surface_get_height (window) * window_scale; int i; float *vertex_buffer_data; @@ -327,7 +327,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context, */ void gdk_cairo_draw_from_gl (cairo_t *cr, - GdkWindow *window, + GdkSurface *window, int source, int source_type, int buffer_scale, @@ -345,7 +345,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr, GdkGLContextPaintData *paint_data; 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) { 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; cairo_rectangle_int_t rect, e; int n_rects, i; - GdkWindow *window; + GdkSurface *window; int unscaled_window_height; unsigned int texture_id; 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); window = gdk_gl_context_get_window (paint_context); - window_scale = gdk_window_get_scale_factor (window); - gdk_window_get_unscaled_size (window, NULL, &unscaled_window_height); + window_scale = gdk_surface_get_scale_factor (window); + gdk_surface_get_unscaled_size (window, NULL, &unscaled_window_height); sx = sy = 1; cairo_surface_get_device_scale (surface, &sx, &sy); diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index f82a240842..c4dcab9b7e 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -26,12 +26,12 @@ * #GdkGLContext is an object representing the platform-specific * OpenGL draw context. * - * #GdkGLContexts are created for a #GdkWindow using - * gdk_window_create_gl_context(), and the context will match the + * #GdkGLContexts are created for a #GdkSurface using + * gdk_surface_create_gl_context(), and the context will match the * the characteristics of the window. * * 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, * 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 @@ -46,14 +46,14 @@ * ## Creating a new OpenGL context ## * * 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. * * 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 * 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 - * 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 * #GdkGLContext and try again. * @@ -265,12 +265,12 @@ gdk_gl_context_real_realize (GdkGLContext *self, static cairo_region_t * 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) { 0, 0, - gdk_window_get_width (window), - gdk_window_get_height (window) + gdk_surface_get_width (window), + gdk_surface_get_height (window) }); } @@ -279,7 +279,7 @@ gdk_gl_context_real_begin_frame (GdkDrawContext *draw_context, cairo_region_t *region) { GdkGLContext *context = GDK_GL_CONTEXT (draw_context); - GdkWindow *window; + GdkSurface *window; GdkGLContext *shared; cairo_region_t *damage; int ww, wh; @@ -296,8 +296,8 @@ gdk_gl_context_real_begin_frame (GdkDrawContext *draw_context, cairo_region_destroy (damage); window = gdk_draw_context_get_window (draw_context); - ww = gdk_window_get_width (window) * gdk_window_get_scale_factor (window); - wh = gdk_window_get_height (window) * gdk_window_get_scale_factor (window); + ww = gdk_surface_get_width (window) * gdk_surface_get_scale_factor (window); + wh = gdk_surface_get_height (window) * gdk_surface_get_scale_factor (window); gdk_gl_context_make_current (context); @@ -889,11 +889,11 @@ gdk_gl_context_get_display (GdkGLContext *context) * gdk_gl_context_get_window: * @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) { g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), NULL); diff --git a/gdk/gdkglcontext.h b/gdk/gdkglcontext.h index f338a75cfb..ae17936aa5 100644 --- a/gdk/gdkglcontext.h +++ b/gdk/gdkglcontext.h @@ -45,7 +45,7 @@ GType gdk_gl_context_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_ALL GdkDisplay * gdk_gl_context_get_display (GdkGLContext *context); GDK_AVAILABLE_IN_ALL -GdkWindow * gdk_gl_context_get_window (GdkGLContext *context); +GdkSurface * gdk_gl_context_get_window (GdkGLContext *context); GDK_AVAILABLE_IN_ALL GdkGLContext * gdk_gl_context_get_shared_context (GdkGLContext *context); GDK_AVAILABLE_IN_ALL diff --git a/gdk/gdkgltexture.c b/gdk/gdkgltexture.c index 8d97c316a6..490402f1ed 100644 --- a/gdk/gdkgltexture.c +++ b/gdk/gdkgltexture.c @@ -91,7 +91,7 @@ gdk_gl_texture_download (GdkTexture *texture, } else { - GdkWindow *window; + GdkSurface *window; window = gdk_gl_context_get_window (self->context); gdk_cairo_draw_from_gl (cr, window, self->id, GL_TEXTURE, 1, @@ -145,7 +145,7 @@ gdk_gl_texture_get_id (GdkGLTexture *self) void gdk_gl_texture_release (GdkGLTexture *self) { - GdkWindow *window; + GdkSurface *window; GdkTexture *texture; cairo_t *cr; diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index 2438cf77cc..97c54b01e2 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -42,7 +42,7 @@ G_BEGIN_DECLS /* Debugging support */ -typedef struct _GdkWindowAttr GdkWindowAttr; +typedef struct _GdkSurfaceAttr GdkSurfaceAttr; typedef enum { GDK_DEBUG_MISC = 1 << 0, @@ -116,35 +116,35 @@ typedef enum GDK_EVENT_FLUSHED = 1 << 2 } GdkEventFlags; -typedef struct _GdkWindowPaint GdkWindowPaint; +typedef struct _GdkSurfacePaint GdkSurfacePaint; typedef enum { GDK_INPUT_OUTPUT, GDK_INPUT_ONLY -} GdkWindowWindowClass; +} GdkSurfaceSurfaceClass; -struct _GdkWindowAttr +struct _GdkSurfaceAttr { gint x, y; gint width; gint height; - GdkWindowWindowClass wclass; - GdkWindowType window_type; - GdkWindowTypeHint type_hint; + GdkSurfaceSurfaceClass wclass; + GdkSurfaceType window_type; + GdkSurfaceTypeHint type_hint; }; -struct _GdkWindow +struct _GdkSurface { GObject parent_instance; GdkDisplay *display; - GdkWindowImpl *impl; /* window-system-specific delegate object */ + GdkSurfaceImpl *impl; /* window-system-specific delegate object */ - GdkWindow *parent; - GdkWindow *transient_for; + GdkSurface *parent; + GdkSurface *transient_for; gpointer user_data; @@ -182,8 +182,8 @@ struct _GdkWindow /* We store the old expose areas to support buffer-age optimizations */ cairo_region_t *old_updated_area[2]; - GdkWindowState old_state; - GdkWindowState state; + GdkSurfaceState old_state; + GdkSurfaceState state; guint8 alpha; guint8 fullscreen_mode; @@ -209,10 +209,10 @@ struct _GdkWindow guint geometry_dirty : 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 - * for as long as any GdkWindow references the impl. */ - GdkWindow *impl_window; + * for as long as any GdkSurface references the impl. */ + GdkSurface *impl_window; guint update_and_descendants_freeze_count; @@ -244,8 +244,8 @@ struct _GdkWindow cairo_region_t *opaque_region; }; -#define GDK_WINDOW_TYPE(d) ((((GdkWindow *)(d)))->window_type) -#define GDK_WINDOW_DESTROYED(d) (((GdkWindow *)(d))->destroyed) +#define GDK_SURFACE_TYPE(d) ((((GdkSurface *)(d)))->window_type) +#define GDK_SURFACE_DESTROYED(d) (((GdkSurface *)(d))->destroyed) extern gint _gdk_screen_number; @@ -280,8 +280,8 @@ void _gdk_windowing_event_data_copy (const GdkEvent *src, GdkEvent *dst); void _gdk_windowing_event_data_free (GdkEvent *event); -void gdk_window_set_state (GdkWindow *window, - GdkWindowState new_state); +void gdk_surface_set_state (GdkSurface *window, + GdkSurfaceState new_state); gboolean _gdk_cairo_surface_extents (cairo_surface_t *surface, GdkRectangle *extents); @@ -303,7 +303,7 @@ void gdk_cairo_surface_paint_pixbuf (cairo_surface_t *surface, const GdkPixbuf *pixbuf); 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); 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 * - _gdk_window_ref_cairo_surface (GdkWindow *window); + _gdk_surface_ref_cairo_surface (GdkSurface *window); -GdkWindow* gdk_window_new (GdkDisplay *display, - GdkWindow *parent, - GdkWindowAttr *attributes); -void _gdk_window_destroy (GdkWindow *window, +GdkSurface* gdk_surface_new (GdkDisplay *display, + GdkSurface *parent, + GdkSurfaceAttr *attributes); +void _gdk_surface_destroy (GdkSurface *window, gboolean foreign_destroy); -void _gdk_window_clear_update_area (GdkWindow *window); -void _gdk_window_update_size (GdkWindow *window); -gboolean _gdk_window_update_viewable (GdkWindow *window); -GdkGLContext * gdk_window_get_paint_gl_context (GdkWindow *window, +void _gdk_surface_clear_update_area (GdkSurface *window); +void _gdk_surface_update_size (GdkSurface *window); +gboolean _gdk_surface_update_viewable (GdkSurface *window); +GdkGLContext * gdk_surface_get_paint_gl_context (GdkSurface *window, GError **error); -void gdk_window_get_unscaled_size (GdkWindow *window, +void gdk_surface_get_unscaled_size (GdkSurface *window, int *unscaled_width, 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); /***************************************** @@ -352,28 +352,28 @@ void _gdk_windowing_got_event (GdkDisplay *display, GdkEvent *event, 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); -GdkWindow * _gdk_window_find_child_at (GdkWindow *window, +GdkSurface * _gdk_surface_find_child_at (GdkSurface *window, 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 *found_x, double *found_y); -GdkEvent * _gdk_make_event (GdkWindow *window, +GdkEvent * _gdk_make_event (GdkSurface *window, GdkEventType type, GdkEvent *event_in_queue, gboolean before_event); -gboolean _gdk_window_event_parent_of (GdkWindow *parent, - GdkWindow *child); +gboolean _gdk_surface_event_parent_of (GdkSurface *parent, + GdkSurface *child); void _gdk_synthesize_crossing_events (GdkDisplay *display, - GdkWindow *src, - GdkWindow *dest, + GdkSurface *src, + GdkSurface *dest, GdkDevice *device, GdkDevice *source_device, GdkCrossingMode mode, @@ -386,16 +386,16 @@ void _gdk_synthesize_crossing_events (GdkDisplay *display, gboolean non_linear); void _gdk_display_set_window_under_pointer (GdkDisplay *display, GdkDevice *device, - GdkWindow *window); + GdkSurface *window); -gboolean _gdk_window_has_impl (GdkWindow *window); -GdkWindow * _gdk_window_get_impl_window (GdkWindow *window); +gboolean _gdk_surface_has_impl (GdkSurface *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, - GdkWindowState unset_flags, - GdkWindowState set_flags); +void gdk_synthesize_window_state (GdkSurface *window, + GdkSurfaceState unset_flags, + GdkSurfaceState set_flags); G_END_DECLS diff --git a/gdk/gdkmonitor.c b/gdk/gdkmonitor.c index b1502e93eb..eb77650288 100644 --- a/gdk/gdkmonitor.c +++ b/gdk/gdkmonitor.c @@ -411,7 +411,7 @@ gdk_monitor_get_model (GdkMonitor *monitor) * * This can be used if you want to create pixel based data for a * particular monitor, but most of the time you’re 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 */ diff --git a/gdk/gdkpango.c b/gdk/gdkpango.c index 5c02d7371a..419eb322f8 100644 --- a/gdk/gdkpango.c +++ b/gdk/gdkpango.c @@ -67,8 +67,8 @@ * // where we are drawing are [-RADIUS, RADIUS], [-RADIUS, RADIUS] * // We first center, then change the scale * - * width = gdk_window_get_width (window); - * height = gdk_window_get_height (window); + * width = gdk_surface_get_width (window); + * height = gdk_surface_get_height (window); * radius = MIN (width, height) / 2.; * * cairo_translate (cr, diff --git a/gdk/gdkpixbuf-drawable.c b/gdk/gdkpixbuf-drawable.c index 9aff8a2f69..c8a2c20376 100644 --- a/gdk/gdkpixbuf-drawable.c +++ b/gdk/gdkpixbuf-drawable.c @@ -38,7 +38,7 @@ * and manipulate pixbufs, see the #GdkPixbuf API documentation. * * The functions described here allow to obtain pixbufs from - * #GdkWindows and cairo surfaces. + * #GdkSurfaces and cairo surfaces. */ static cairo_format_t diff --git a/gdk/gdkseat.c b/gdk/gdkseat.c index e193187c12..04dd593c04 100644 --- a/gdk/gdkseat.c +++ b/gdk/gdkseat.c @@ -233,7 +233,7 @@ gdk_seat_get_capabilities (GdkSeat *seat) /** * gdk_seat_grab: * @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 * @owner_events: if %FALSE then all device events are reported with respect to * @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 * 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 * 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 @@ -281,7 +281,7 @@ gdk_seat_get_capabilities (GdkSeat *seat) **/ GdkGrabStatus gdk_seat_grab (GdkSeat *seat, - GdkWindow *window, + GdkSurface *window, GdkSeatCapabilities capabilities, gboolean owner_events, GdkCursor *cursor, @@ -292,7 +292,7 @@ gdk_seat_grab (GdkSeat *seat, GdkSeatClass *seat_class; 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; g_return_val_if_fail (capabilities != GDK_SEAT_CAPABILITY_NONE, GDK_GRAB_FAILED); diff --git a/gdk/gdkseat.h b/gdk/gdkseat.h index 3556323d29..f5e6a0336e 100644 --- a/gdk/gdkseat.h +++ b/gdk/gdkseat.h @@ -64,7 +64,7 @@ typedef enum { /** * GdkSeatGrabPrepareFunc: * @seat: the #GdkSeat being grabbed - * @window: the #GdkWindow being grabbed + * @window: the #GdkSurface being grabbed * @user_data: user data passed in gdk_seat_grab() * * Type of the callback used to set up @window so it can be @@ -75,7 +75,7 @@ typedef enum { * Since: 3.20 */ typedef void (* GdkSeatGrabPrepareFunc) (GdkSeat *seat, - GdkWindow *window, + GdkSurface *window, gpointer user_data); struct _GdkSeat @@ -88,7 +88,7 @@ GType gdk_seat_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_ALL GdkGrabStatus gdk_seat_grab (GdkSeat *seat, - GdkWindow *window, + GdkSurface *window, GdkSeatCapabilities capabilities, gboolean owner_events, GdkCursor *cursor, diff --git a/gdk/gdkseatdefault.c b/gdk/gdkseatdefault.c index 382cc042ba..7531c89a5d 100644 --- a/gdk/gdkseatdefault.c +++ b/gdk/gdkseatdefault.c @@ -104,7 +104,7 @@ gdk_seat_default_get_capabilities (GdkSeat *seat) static GdkGrabStatus gdk_seat_default_grab (GdkSeat *seat, - GdkWindow *window, + GdkSurface *window, GdkSeatCapabilities capabilities, gboolean owner_events, GdkCursor *cursor, @@ -121,7 +121,7 @@ gdk_seat_default_grab (GdkSeat *seat, if (prepare_func) (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", window); @@ -163,7 +163,7 @@ gdk_seat_default_grab (GdkSeat *seat, { if (capabilities & ~GDK_SEAT_CAPABILITY_KEYBOARD) gdk_device_ungrab (priv->master_pointer, evtime); - gdk_window_hide (window); + gdk_surface_hide (window); } } diff --git a/gdk/gdkseatprivate.h b/gdk/gdkseatprivate.h index 22cdd08189..ca3af76914 100644 --- a/gdk/gdkseatprivate.h +++ b/gdk/gdkseatprivate.h @@ -42,7 +42,7 @@ struct _GdkSeatClass GdkSeatCapabilities (*get_capabilities) (GdkSeat *seat); GdkGrabStatus (* grab) (GdkSeat *seat, - GdkWindow *window, + GdkSurface *window, GdkSeatCapabilities capabilities, gboolean owner_events, GdkCursor *cursor, diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h index 2622d05619..aeb38edb79 100644 --- a/gdk/gdktypes.h +++ b/gdk/gdktypes.h @@ -128,7 +128,7 @@ typedef struct _GdkDragContext GdkDragContext; typedef struct _GdkClipboard GdkClipboard; typedef struct _GdkDisplayManager GdkDisplayManager; typedef struct _GdkDisplay GdkDisplay; -typedef struct _GdkWindow GdkWindow; +typedef struct _GdkSurface GdkSurface; typedef struct _GdkKeymap GdkKeymap; typedef struct _GdkAppLaunchContext GdkAppLaunchContext; typedef struct _GdkSeat GdkSeat; @@ -387,7 +387,7 @@ typedef enum * * Since GTK 3.8, motion events are already compressed by default, independent * 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. * * If %GDK_TOUCH_MASK is enabled, the window will receive touch events @@ -461,27 +461,27 @@ typedef enum { } GdkVulkanError; /** - * GdkWindowTypeHint: - * @GDK_WINDOW_TYPE_HINT_NORMAL: Normal toplevel window. - * @GDK_WINDOW_TYPE_HINT_DIALOG: Dialog window. - * @GDK_WINDOW_TYPE_HINT_MENU: Window used to implement a menu; GTK+ uses + * GdkSurfaceTypeHint: + * @GDK_SURFACE_TYPE_HINT_NORMAL: Normal toplevel window. + * @GDK_SURFACE_TYPE_HINT_DIALOG: Dialog window. + * @GDK_SURFACE_TYPE_HINT_MENU: Window used to implement a menu; GTK+ uses * this hint only for torn-off menus, see #GtkTearoffMenuItem. - * @GDK_WINDOW_TYPE_HINT_TOOLBAR: Window used to implement toolbars. - * @GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: Window used to display a splash + * @GDK_SURFACE_TYPE_HINT_TOOLBAR: Window used to implement toolbars. + * @GDK_SURFACE_TYPE_HINT_SPLASHSCREEN: Window used to display a splash * 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. - * @GDK_WINDOW_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_DOCK: Used for creating dock or panel windows. + * @GDK_SURFACE_TYPE_HINT_DESKTOP: Used for creating the desktop background * window. - * @GDK_WINDOW_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_DROPDOWN_MENU: A menu that belongs to a menubar. + * @GDK_SURFACE_TYPE_HINT_POPUP_MENU: A menu that does not belong to a menubar, * e.g. a context menu. - * @GDK_WINDOW_TYPE_HINT_TOOLTIP: A tooltip. - * @GDK_WINDOW_TYPE_HINT_NOTIFICATION: A notification - typically a “bubble” + * @GDK_SURFACE_TYPE_HINT_TOOLTIP: A tooltip. + * @GDK_SURFACE_TYPE_HINT_NOTIFICATION: A notification - typically a “bubble” * that belongs to a status icon. - * @GDK_WINDOW_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_COMBO: A popup from a combo box. + * @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 * the window has. The window manager can use this when determining decoration @@ -492,21 +492,21 @@ typedef enum { */ typedef enum { - GDK_WINDOW_TYPE_HINT_NORMAL, - GDK_WINDOW_TYPE_HINT_DIALOG, - GDK_WINDOW_TYPE_HINT_MENU, /* Torn off menu */ - GDK_WINDOW_TYPE_HINT_TOOLBAR, - GDK_WINDOW_TYPE_HINT_SPLASHSCREEN, - GDK_WINDOW_TYPE_HINT_UTILITY, - GDK_WINDOW_TYPE_HINT_DOCK, - GDK_WINDOW_TYPE_HINT_DESKTOP, - GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU, /* A drop down menu (from a menubar) */ - GDK_WINDOW_TYPE_HINT_POPUP_MENU, /* A popup menu (from right-click) */ - GDK_WINDOW_TYPE_HINT_TOOLTIP, - GDK_WINDOW_TYPE_HINT_NOTIFICATION, - GDK_WINDOW_TYPE_HINT_COMBO, - GDK_WINDOW_TYPE_HINT_DND -} GdkWindowTypeHint; + GDK_SURFACE_TYPE_HINT_NORMAL, + GDK_SURFACE_TYPE_HINT_DIALOG, + GDK_SURFACE_TYPE_HINT_MENU, /* Torn off menu */ + GDK_SURFACE_TYPE_HINT_TOOLBAR, + GDK_SURFACE_TYPE_HINT_SPLASHSCREEN, + GDK_SURFACE_TYPE_HINT_UTILITY, + GDK_SURFACE_TYPE_HINT_DOCK, + GDK_SURFACE_TYPE_HINT_DESKTOP, + GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU, /* A drop down menu (from a menubar) */ + GDK_SURFACE_TYPE_HINT_POPUP_MENU, /* A popup menu (from right-click) */ + GDK_SURFACE_TYPE_HINT_TOOLTIP, + GDK_SURFACE_TYPE_HINT_NOTIFICATION, + GDK_SURFACE_TYPE_HINT_COMBO, + GDK_SURFACE_TYPE_HINT_DND +} GdkSurfaceTypeHint; /** * GdkAxisUse: diff --git a/gdk/gdkvulkancontext.c b/gdk/gdkvulkancontext.c index 3cd70dd868..6daf7c346c 100644 --- a/gdk/gdkvulkancontext.c +++ b/gdk/gdkvulkancontext.c @@ -36,8 +36,8 @@ * #GdkVulkanContext is an object representing the platform-specific * Vulkan draw context. * - * #GdkVulkanContexts are created for a #GdkWindow using - * gdk_window_create_vulkan_context(), and the context will match the + * #GdkVulkanContexts are created for a #GdkSurface using + * gdk_surface_create_vulkan_context(), and the context will match the * the characteristics of the window. * * Support for #GdkVulkanContext is platform-specific, context creation @@ -250,7 +250,7 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context, GError **error) { 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; VkCompositeAlphaFlagBitsKHR composite_alpha; VkSwapchainKHR new_swapchain; @@ -258,8 +258,8 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext *context, VkDevice device; guint i; - if (gdk_window_get_width (window) * gdk_window_get_scale_factor (window) == priv->swapchain_width && - gdk_window_get_height (window) * gdk_window_get_scale_factor (window) == priv->swapchain_height) + if (gdk_surface_get_width (window) * gdk_surface_get_scale_factor (window) == priv->swapchain_width && + gdk_surface_get_height (window) * gdk_surface_get_scale_factor (window) == priv->swapchain_height) return TRUE; 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) { - capabilities.currentExtent.width = gdk_window_get_width (window) * gdk_window_get_scale_factor (window); - capabilities.currentExtent.height = gdk_window_get_height (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_surface_get_height (window) * gdk_surface_get_scale_factor (window); } 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) { 0, 0, - gdk_window_get_width (window), - gdk_window_get_height (window), + gdk_surface_get_width (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. * - * This function can only be used between gdk_window_begin_draw_frame() and - * gdk_window_end_draw_frame() calls for the toplevel window that the + * This function can only be used between gdk_surface_begin_draw_frame() and + * gdk_surface_end_draw_frame() calls for the toplevel window that the * @context is associated with. * * 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 * currently being drawn. * - * This function can only be used between gdk_window_begin_draw_frame() and - * gdk_window_end_draw_frame() calls for the toplevel window that the + * This function can only be used between gdk_surface_begin_draw_frame() and + * gdk_surface_end_draw_frame() calls for the toplevel window that the * @context is associated with. * * Returns: (transfer none): the VkSemaphore diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 2be8f8d109..3eea4914ba 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -60,37 +60,37 @@ * @Short_description: Onscreen display areas in the target window system * @Title: Windows * - * A #GdkWindow is a (usually) rectangular region on the screen. + * A #GdkSurface is a (usually) rectangular region on the screen. * It’s a low-level object, used to implement high-level objects such as * #GtkWidget and #GtkWindow on the GTK+ level. A #GtkWindow is a toplevel * window, the thing a user might think of as a “window” with a titlebar - * and so on; a #GtkWindow may contain many sub-GdkWindows. + * and so on; a #GtkWindow may contain many sub-GdkSurfaces. */ /** - * GdkWindow: + * GdkSurface: * - * The GdkWindow struct contains only private fields and + * The GdkSurface struct contains only private fields and * should not be accessed directly. */ -/* Historically a GdkWindow always matches a platform native window, +/* Historically a GdkSurface always matches a platform native window, * be it a toplevel window or a child window. In this setup the - * GdkWindow (and other GdkDrawables) were platform independent classes, + * GdkSurface (and other GdkDrawables) were platform independent classes, * and the actual platform specific implementation was in a delegate * object available as “impl” in the window object. * * With the addition of client side windows this changes a bit. The - * application-visible GdkWindow object behaves as it did before, but + * application-visible GdkSurface object behaves as it did before, but * such windows now don't a corresponding native window. Instead subwindows * windows are “client side”, i.e. emulated by the gdk code such * that clipping, drawing, moving, events etc work as expected. * - * GdkWindows have a pointer to the “impl window” they are in, i.e. - * the topmost GdkWindow which have the same “impl” value. This is stored + * GdkSurfaces have a pointer to the “impl window” they are in, i.e. + * the topmost GdkSurface which have the same “impl” value. This is stored * in impl_window, which is different from the window itself only for client * side windows. - * All GdkWindows (native or not) track the position of the window in the parent + * All GdkSurfaces (native or not) track the position of the window in the parent * (x, y), the size of the window (width, height), the position of the window * with respect to the impl window (abs_x, abs_y). We also track the clip * region of the window wrt parent windows, in window-relative coordinates (clip_region). @@ -111,42 +111,42 @@ enum { /* Global info */ -static void gdk_window_finalize (GObject *object); +static void gdk_surface_finalize (GObject *object); -static void gdk_window_set_property (GObject *object, +static void gdk_surface_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void gdk_window_get_property (GObject *object, +static void gdk_surface_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); -static void gdk_window_clear_backing_region (GdkWindow *window); +static void gdk_surface_clear_backing_region (GdkSurface *window); -static void recompute_visible_regions (GdkWindow *private, +static void recompute_visible_regions (GdkSurface *private, gboolean recalculate_children); -static void gdk_window_invalidate_in_parent (GdkWindow *private); +static void gdk_surface_invalidate_in_parent (GdkSurface *private); static void update_cursor (GdkDisplay *display, GdkDevice *device); -static void impl_window_add_update_area (GdkWindow *impl_window, +static void impl_window_add_update_area (GdkSurface *impl_window, cairo_region_t *region); -static void gdk_window_invalidate_region_full (GdkWindow *window, +static void gdk_surface_invalidate_region_full (GdkSurface *window, const cairo_region_t *region, gboolean invalidate_children); -static void gdk_window_invalidate_rect_full (GdkWindow *window, +static void gdk_surface_invalidate_rect_full (GdkSurface *window, const GdkRectangle *rect, gboolean invalidate_children); -static cairo_surface_t *gdk_window_ref_impl_surface (GdkWindow *window); +static cairo_surface_t *gdk_surface_ref_impl_surface (GdkSurface *window); -static void gdk_window_set_frame_clock (GdkWindow *window, +static void gdk_surface_set_frame_clock (GdkSurface *window, GdkFrameClock *clock); static guint signals[LAST_SIGNAL] = { 0 }; static GParamSpec *properties[LAST_PROP] = { NULL, }; -G_DEFINE_ABSTRACT_TYPE (GdkWindow, gdk_window, G_TYPE_OBJECT) +G_DEFINE_ABSTRACT_TYPE (GdkSurface, gdk_surface, G_TYPE_OBJECT) #ifdef DEBUG_WINDOW_PRINTING char * @@ -223,13 +223,13 @@ list_insert_link_before (GList *list, } static void -gdk_window_init (GdkWindow *window) +gdk_surface_init (GdkSurface *window) { /* 0-initialization is good for all other fields. */ - window->window_type = GDK_WINDOW_CHILD; + window->window_type = GDK_SURFACE_CHILD; - window->state = GDK_WINDOW_STATE_WITHDRAWN; + window->state = GDK_SURFACE_STATE_WITHDRAWN; window->fullscreen_mode = GDK_FULLSCREEN_ON_CURRENT_MONITOR; window->width = 1; window->height = 1; @@ -241,21 +241,21 @@ gdk_window_init (GdkWindow *window) } static void -gdk_window_class_init (GdkWindowClass *klass) +gdk_surface_class_init (GdkSurfaceClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - object_class->finalize = gdk_window_finalize; - object_class->set_property = gdk_window_set_property; - object_class->get_property = gdk_window_get_property; + object_class->finalize = gdk_surface_finalize; + object_class->set_property = gdk_surface_set_property; + object_class->get_property = gdk_surface_get_property; /* Properties */ /** - * GdkWindow:cursor: + * GdkSurface:cursor: * - * The mouse pointer for a #GdkWindow. See gdk_window_set_cursor() and - * gdk_window_get_cursor() for details. + * The mouse pointer for a #GdkSurface. See gdk_surface_set_cursor() and + * gdk_surface_get_cursor() for details. */ properties[PROP_CURSOR] = g_param_spec_object ("cursor", @@ -265,9 +265,9 @@ gdk_window_class_init (GdkWindowClass *klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); /** - * GdkWindow:display: + * GdkSurface:display: * - * The #GdkDisplay connection of the window. See gdk_window_get_display() + * The #GdkDisplay connection of the window. See gdk_surface_get_display() * for details. */ properties[PROP_DISPLAY] = @@ -281,14 +281,14 @@ gdk_window_class_init (GdkWindowClass *klass) g_param_spec_flags ("state", P_("State"), P_("State"), - GDK_TYPE_WINDOW_STATE, GDK_WINDOW_STATE_WITHDRAWN, + GDK_TYPE_SURFACE_STATE, GDK_SURFACE_STATE_WITHDRAWN, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_properties (object_class, LAST_PROP, properties); /** - * GdkWindow::moved-to-rect: - * @window: the #GdkWindow that moved + * GdkSurface::moved-to-rect: + * @window: the #GdkSurface that moved * @flipped_rect: (nullable): the position of @window after any possible * flipping or %NULL if the backend can't obtain it * @final_rect: (nullable): the final position of @window or %NULL if the @@ -328,7 +328,7 @@ gdk_window_class_init (GdkWindowClass *klass) static void seat_removed_cb (GdkDisplay *display, GdkSeat *seat, - GdkWindow *window) + GdkSurface *window) { GdkDevice *device = gdk_seat_get_pointer (seat); @@ -340,25 +340,25 @@ seat_removed_cb (GdkDisplay *display, } static void -gdk_window_finalize (GObject *object) +gdk_surface_finalize (GObject *object) { - GdkWindow *window = GDK_WINDOW (object); + GdkSurface *window = GDK_SURFACE (object); - g_signal_handlers_disconnect_by_func (gdk_window_get_display (window), + g_signal_handlers_disconnect_by_func (gdk_surface_get_display (window), seat_removed_cb, window); - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { - if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN) + if (GDK_SURFACE_TYPE (window) != GDK_SURFACE_FOREIGN) { g_warning ("losing last reference to undestroyed window"); - _gdk_window_destroy (window, FALSE); + _gdk_surface_destroy (window, FALSE); } else /* We use TRUE here, to keep us from actually calling * XDestroyWindow() on the window */ - _gdk_window_destroy (window, TRUE); + _gdk_surface_destroy (window, TRUE); } if (window->impl) @@ -396,21 +396,21 @@ gdk_window_finalize (GObject *object) if (window->opaque_region) cairo_region_destroy (window->opaque_region); - G_OBJECT_CLASS (gdk_window_parent_class)->finalize (object); + G_OBJECT_CLASS (gdk_surface_parent_class)->finalize (object); } static void -gdk_window_set_property (GObject *object, +gdk_surface_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - GdkWindow *window = GDK_WINDOW (object); + GdkSurface *window = GDK_SURFACE (object); switch (prop_id) { case PROP_CURSOR: - gdk_window_set_cursor (window, g_value_get_object (value)); + gdk_surface_set_cursor (window, g_value_get_object (value)); break; case PROP_DISPLAY: @@ -425,17 +425,17 @@ gdk_window_set_property (GObject *object, } static void -gdk_window_get_property (GObject *object, +gdk_surface_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - GdkWindow *window = GDK_WINDOW (object); + GdkSurface *window = GDK_SURFACE (object); switch (prop_id) { case PROP_CURSOR: - g_value_set_object (value, gdk_window_get_cursor (window)); + g_value_set_object (value, gdk_surface_get_cursor (window)); break; case PROP_DISPLAY: @@ -453,62 +453,62 @@ gdk_window_get_property (GObject *object, } static gboolean -gdk_window_is_subsurface (GdkWindow *window) +gdk_surface_is_subsurface (GdkSurface *window) { - return window->window_type == GDK_WINDOW_SUBSURFACE; + return window->window_type == GDK_SURFACE_SUBSURFACE; } -static GdkWindow * -gdk_window_get_impl_window (GdkWindow *window) +static GdkSurface * +gdk_surface_get_impl_window (GdkSurface *window) { return window->impl_window; } -GdkWindow * -_gdk_window_get_impl_window (GdkWindow *window) +GdkSurface * +_gdk_surface_get_impl_window (GdkSurface *window) { - return gdk_window_get_impl_window (window); + return gdk_surface_get_impl_window (window); } static gboolean -gdk_window_has_impl (GdkWindow *window) +gdk_surface_has_impl (GdkSurface *window) { return window->impl_window == window; } static gboolean -gdk_window_is_toplevel (GdkWindow *window) +gdk_surface_is_toplevel (GdkSurface *window) { return window->parent == NULL || - window->parent->window_type == GDK_WINDOW_ROOT; + window->parent->window_type == GDK_SURFACE_ROOT; } gboolean -_gdk_window_has_impl (GdkWindow *window) +_gdk_surface_has_impl (GdkSurface *window) { - return gdk_window_has_impl (window); + return gdk_surface_has_impl (window); } static gboolean -gdk_window_has_no_impl (GdkWindow *window) +gdk_surface_has_no_impl (GdkSurface *window) { return window->impl_window != window; } static void -remove_sibling_overlapped_area (GdkWindow *window, +remove_sibling_overlapped_area (GdkSurface *window, cairo_region_t *region) { - GdkWindow *parent; - GdkWindow *sibling; + GdkSurface *parent; + GdkSurface *sibling; cairo_region_t *child_region; GdkRectangle r; GList *l; parent = window->parent; - if (gdk_window_is_toplevel (window)) + if (gdk_surface_is_toplevel (window)) return; /* Convert from from window coords to parent coords */ @@ -521,7 +521,7 @@ remove_sibling_overlapped_area (GdkWindow *window, if (sibling == window) break; - if (!GDK_WINDOW_IS_MAPPED (sibling) || sibling->input_only) + if (!GDK_SURFACE_IS_MAPPED (sibling) || sibling->input_only) continue; r.x = sibling->x; @@ -550,11 +550,11 @@ remove_sibling_overlapped_area (GdkWindow *window, } static void -remove_child_area (GdkWindow *window, +remove_child_area (GdkSurface *window, gboolean for_input, cairo_region_t *region) { - GdkWindow *child; + GdkSurface *child; cairo_region_t *child_region; GdkRectangle r; GList *l; @@ -568,7 +568,7 @@ remove_child_area (GdkWindow *window, if (cairo_region_is_empty (region)) break; - if (!GDK_WINDOW_IS_MAPPED (child) || child->input_only) + if (!GDK_SURFACE_IS_MAPPED (child) || child->input_only) continue; r.x = child->x; @@ -602,29 +602,29 @@ remove_child_area (GdkWindow *window, } static gboolean -should_apply_clip_as_shape (GdkWindow *window) +should_apply_clip_as_shape (GdkSurface *window) { return - gdk_window_has_impl (window) && + gdk_surface_has_impl (window) && /* Not for non-shaped toplevels */ (window->shape != NULL || window->applied_shape) && /* or for foreign windows */ - window->window_type != GDK_WINDOW_FOREIGN && + window->window_type != GDK_SURFACE_FOREIGN && /* or for the root window */ - window->window_type != GDK_WINDOW_ROOT; + window->window_type != GDK_SURFACE_ROOT; } static void -apply_shape (GdkWindow *window, +apply_shape (GdkSurface *window, cairo_region_t *region) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; /* We trash whether we applied a shape so that we can avoid unsetting it many times, which could happen in e.g. apply_clip_as_shape as windows get resized */ - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); if (region) impl_class->shape_combine_region (window, region, 0, 0); @@ -653,7 +653,7 @@ region_rect_equal (const cairo_region_t *region, } static void -apply_clip_as_shape (GdkWindow *window) +apply_clip_as_shape (GdkSurface *window) { GdkRectangle r; cairo_region_t *region; @@ -678,13 +678,13 @@ apply_clip_as_shape (GdkWindow *window) } static void -recompute_visible_regions_internal (GdkWindow *private, +recompute_visible_regions_internal (GdkSurface *private, gboolean recalculate_clip, gboolean recalculate_children) { GdkRectangle r; GList *l; - GdkWindow *child; + GdkSurface *child; cairo_region_t *new_clip; gboolean clip_region_changed; gboolean abs_pos_changed; @@ -694,10 +694,10 @@ recompute_visible_regions_internal (GdkWindow *private, old_abs_y = private->abs_y; /* Update absolute position */ - if ((gdk_window_has_impl (private) && - private->window_type != GDK_WINDOW_SUBSURFACE) || - (gdk_window_is_toplevel (private) && - private->window_type == GDK_WINDOW_SUBSURFACE)) + if ((gdk_surface_has_impl (private) && + private->window_type != GDK_SURFACE_SUBSURFACE) || + (gdk_surface_is_toplevel (private) && + private->window_type == GDK_SURFACE_SUBSURFACE)) { /* Native windows and toplevel subsurfaces start here */ private->abs_x = 0; @@ -729,7 +729,7 @@ recompute_visible_regions_internal (GdkWindow *private, r.height = private->height; new_clip = cairo_region_create_rectangle (&r); - if (!gdk_window_is_toplevel (private)) + if (!gdk_surface_is_toplevel (private)) cairo_region_intersect (new_clip, private->parent->clip_region); /* Convert from parent coords to window coords */ @@ -752,7 +752,7 @@ recompute_visible_regions_internal (GdkWindow *private, /* Update all children, recursively (except for root, where children are not exact). */ if ((abs_pos_changed || clip_region_changed || recalculate_children) && - private->window_type != GDK_WINDOW_ROOT) + private->window_type != GDK_SURFACE_ROOT) { for (l = private->children; l; l = l->next) { @@ -784,12 +784,12 @@ recompute_visible_regions_internal (GdkWindow *private, * recompute_visible_regions), pass in TRUE for recalculate_children on the parent */ static void -recompute_visible_regions (GdkWindow *private, +recompute_visible_regions (GdkSurface *private, gboolean recalculate_children) { - GdkWindow *toplevel; + GdkSurface *toplevel; - toplevel = gdk_window_get_toplevel (private); + toplevel = gdk_surface_get_toplevel (private); toplevel->geometry_dirty = TRUE; recompute_visible_regions_internal (private, @@ -798,7 +798,7 @@ recompute_visible_regions (GdkWindow *private, } static void -gdk_window_clear_old_updated_area (GdkWindow *window) +gdk_surface_clear_old_updated_area (GdkSurface *window) { int i; @@ -813,7 +813,7 @@ gdk_window_clear_old_updated_area (GdkWindow *window) } static void -gdk_window_append_old_updated_area (GdkWindow *window, +gdk_surface_append_old_updated_area (GdkSurface *window, cairo_region_t *region) { if (window->old_updated_area[1]) @@ -823,14 +823,14 @@ gdk_window_append_old_updated_area (GdkWindow *window, } void -_gdk_window_update_size (GdkWindow *window) +_gdk_surface_update_size (GdkSurface *window) { - gdk_window_clear_old_updated_area (window); + gdk_surface_clear_old_updated_area (window); recompute_visible_regions (window, FALSE); } static GdkEventMask -get_native_device_event_mask (GdkWindow *private, +get_native_device_event_mask (GdkSurface *private, GdkDevice *device) { GdkEventMask event_mask; @@ -840,8 +840,8 @@ get_native_device_event_mask (GdkWindow *private, else event_mask = private->event_mask; - if (private->window_type == GDK_WINDOW_ROOT || - private->window_type == GDK_WINDOW_FOREIGN) + if (private->window_type == GDK_SURFACE_ROOT || + private->window_type == GDK_SURFACE_FOREIGN) return event_mask; else { @@ -864,25 +864,25 @@ get_native_device_event_mask (GdkWindow *private, } static GdkEventMask -get_native_event_mask (GdkWindow *private) +get_native_event_mask (GdkSurface *private) { return get_native_device_event_mask (private, NULL); } -GdkWindow* -gdk_window_new (GdkDisplay *display, - GdkWindow *parent, - GdkWindowAttr *attributes) +GdkSurface* +gdk_surface_new (GdkDisplay *display, + GdkSurface *parent, + GdkSurfaceAttr *attributes) { - GdkWindow *window; + GdkSurface *window; gboolean native; GdkEventMask event_mask; g_return_val_if_fail (attributes != NULL, NULL); - if (parent != NULL && GDK_WINDOW_DESTROYED (parent)) + if (parent != NULL && GDK_SURFACE_DESTROYED (parent)) { - g_warning ("gdk_window_new(): parent is destroyed"); + g_warning ("gdk_surface_new(): parent is destroyed"); return NULL; } @@ -906,9 +906,9 @@ gdk_window_new (GdkDisplay *display, * before */ if (parent == NULL) - window->window_type = GDK_WINDOW_TEMP; + window->window_type = GDK_SURFACE_TEMP; else - window->window_type = GDK_WINDOW_CHILD; + window->window_type = GDK_SURFACE_CHILD; } else window->window_type = attributes->window_type; @@ -916,13 +916,13 @@ gdk_window_new (GdkDisplay *display, /* Sanity checks */ switch (window->window_type) { - case GDK_WINDOW_TOPLEVEL: - case GDK_WINDOW_TEMP: - if (parent != NULL && GDK_WINDOW_TYPE (parent) != GDK_WINDOW_ROOT) + case GDK_SURFACE_TOPLEVEL: + case GDK_SURFACE_TEMP: + if (parent != NULL && GDK_SURFACE_TYPE (parent) != GDK_SURFACE_ROOT) g_warning (G_STRLOC "Toplevel windows must be created as children of\n" - "a window of type GDK_WINDOW_ROOT"); + "a window of type GDK_SURFACE_ROOT"); break; - case GDK_WINDOW_SUBSURFACE: + case GDK_SURFACE_SUBSURFACE: #ifdef GDK_WINDOWING_WAYLAND if (!GDK_IS_WAYLAND_DISPLAY (display)) { @@ -931,12 +931,12 @@ gdk_window_new (GdkDisplay *display, } #endif break; - case GDK_WINDOW_CHILD: - if (GDK_WINDOW_TYPE (parent) == GDK_WINDOW_ROOT || - GDK_WINDOW_TYPE (parent) == GDK_WINDOW_FOREIGN) + case GDK_SURFACE_CHILD: + if (GDK_SURFACE_TYPE (parent) == GDK_SURFACE_ROOT || + GDK_SURFACE_TYPE (parent) == GDK_SURFACE_FOREIGN) { g_warning (G_STRLOC "Child windows must not be created as children of\n" - "a window of type GDK_WINDOW_ROOT or GDK_WINDOW_FOREIGN"); + "a window of type GDK_SURFACE_ROOT or GDK_SURFACE_FOREIGN"); return NULL; } break; @@ -963,14 +963,14 @@ gdk_window_new (GdkDisplay *display, else { GdkFrameClock *frame_clock = g_object_new (GDK_TYPE_FRAME_CLOCK_IDLE, NULL); - gdk_window_set_frame_clock (window, frame_clock); + gdk_surface_set_frame_clock (window, frame_clock); g_object_unref (frame_clock); native = TRUE; /* Always use native windows for toplevels */ } #ifdef GDK_WINDOWING_WAYLAND - if (window->window_type == GDK_WINDOW_SUBSURFACE) + if (window->window_type == GDK_SURFACE_SUBSURFACE) native = TRUE; /* Always use native windows for subsurfaces as well */ #endif @@ -996,7 +996,7 @@ gdk_window_new (GdkDisplay *display, } /** - * gdk_window_new_toplevel: (constructor) + * gdk_surface_new_toplevel: (constructor) * @display: the display to create the window on * @width: width of new window * @height: height of new window @@ -1004,14 +1004,14 @@ gdk_window_new (GdkDisplay *display, * Creates a new toplevel window. The window will be managed by the window * manager. * - * Returns: (transfer full): the new #GdkWindow + * Returns: (transfer full): the new #GdkSurface **/ -GdkWindow * -gdk_window_new_toplevel (GdkDisplay *display, +GdkSurface * +gdk_surface_new_toplevel (GdkDisplay *display, gint width, gint height) { - GdkWindowAttr attr; + GdkSurfaceAttr attr; g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); @@ -1020,26 +1020,26 @@ gdk_window_new_toplevel (GdkDisplay *display, attr.y = 0; attr.width = width; attr.height = height; - attr.window_type = GDK_WINDOW_TOPLEVEL; + attr.window_type = GDK_SURFACE_TOPLEVEL; - return gdk_window_new (display, NULL, &attr); + return gdk_surface_new (display, NULL, &attr); } /** - * gdk_window_new_popup: (constructor) + * gdk_surface_new_popup: (constructor) * @display: the display to create the window on * @position: position of the window on screen * * Creates a new toplevel popup window. The window will bypass window * management. * - * Returns: (transfer full): the new #GdkWindow + * Returns: (transfer full): the new #GdkSurface **/ -GdkWindow * -gdk_window_new_popup (GdkDisplay *display, +GdkSurface * +gdk_surface_new_popup (GdkDisplay *display, const GdkRectangle *position) { - GdkWindowAttr attr; + GdkSurfaceAttr attr; g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); g_return_val_if_fail (position != NULL, NULL); @@ -1049,13 +1049,13 @@ gdk_window_new_popup (GdkDisplay *display, attr.y = position->y; attr.width = position->width; attr.height = position->height; - attr.window_type = GDK_WINDOW_TEMP; + attr.window_type = GDK_SURFACE_TEMP; - return gdk_window_new (display, NULL, &attr); + return gdk_surface_new (display, NULL, &attr); } /** - * gdk_window_new_temp: (constructor) + * gdk_surface_new_temp: (constructor) * @display: the display to create the window on * * Creates a new toplevel temporary window. The window will be @@ -1063,12 +1063,12 @@ gdk_window_new_popup (GdkDisplay *display, * * You most likely do not want to use this function. * - * Returns: (transfer full): the new #GdkWindow + * Returns: (transfer full): the new #GdkSurface **/ -GdkWindow * -gdk_window_new_temp (GdkDisplay *display) +GdkSurface * +gdk_surface_new_temp (GdkDisplay *display) { - GdkWindowAttr attr; + GdkSurfaceAttr attr; g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); @@ -1077,45 +1077,45 @@ gdk_window_new_temp (GdkDisplay *display) attr.y = -100; attr.width = 10; attr.height = 10; - attr.window_type = GDK_WINDOW_TEMP; + attr.window_type = GDK_SURFACE_TEMP; - return gdk_window_new (display, NULL, &attr); + return gdk_surface_new (display, NULL, &attr); } /** - * gdk_window_new_child: (constructor) + * gdk_surface_new_child: (constructor) * @parent: the parent window * @position: placement of the window inside @parent * * Creates a new client-side child window. * - * Returns: (transfer full): the new #GdkWindow + * Returns: (transfer full): the new #GdkSurface **/ -GdkWindow * -gdk_window_new_child (GdkWindow *parent, +GdkSurface * +gdk_surface_new_child (GdkSurface *parent, const GdkRectangle *position) { - GdkWindowAttr attr; + GdkSurfaceAttr attr; - g_return_val_if_fail (GDK_IS_WINDOW (parent), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (parent), NULL); attr.wclass = GDK_INPUT_OUTPUT; attr.x = position->x; attr.y = position->y; attr.width = position->width; attr.height = position->height; - attr.window_type = GDK_WINDOW_CHILD; + attr.window_type = GDK_SURFACE_CHILD; - return gdk_window_new (gdk_window_get_display (parent), parent, &attr); + return gdk_surface_new (gdk_surface_get_display (parent), parent, &attr); } static void update_pointer_info_foreach (GdkDisplay *display, GdkDevice *device, - GdkPointerWindowInfo *pointer_info, + GdkPointerSurfaceInfo *pointer_info, gpointer user_data) { - GdkWindow *window = user_data; + GdkSurface *window = user_data; if (pointer_info->window_under_pointer == window) { @@ -1125,7 +1125,7 @@ update_pointer_info_foreach (GdkDisplay *display, } static void -window_remove_from_pointer_info (GdkWindow *window, +window_remove_from_pointer_info (GdkSurface *window, GdkDisplay *display) { _gdk_display_pointer_info_foreach (display, @@ -1134,7 +1134,7 @@ window_remove_from_pointer_info (GdkWindow *window, } static void -gdk_window_free_current_paint (GdkWindow *window) +gdk_surface_free_current_paint (GdkSurface *window) { cairo_surface_destroy (window->current_paint.surface); window->current_paint.surface = NULL; @@ -1146,8 +1146,8 @@ gdk_window_free_current_paint (GdkWindow *window) } /** - * _gdk_window_destroy_hierarchy: - * @window: a #GdkWindow + * _gdk_surface_destroy_hierarchy: + * @window: a #GdkSurface * @recursing: If %TRUE, then this is being called because a parent * was destroyed. * @recursing_native: If %TRUE, then this is being called because a native parent @@ -1160,26 +1160,26 @@ gdk_window_free_current_paint (GdkWindow *window) * windowing system calls should be made. (This may never happen * for some windowing systems.) * - * Internal function to destroy a window. Like gdk_window_destroy(), - * but does not drop the reference count created by gdk_window_new(). + * Internal function to destroy a window. Like gdk_surface_destroy(), + * but does not drop the reference count created by gdk_surface_new(). **/ static void -_gdk_window_destroy_hierarchy (GdkWindow *window, +_gdk_surface_destroy_hierarchy (GdkSurface *window, gboolean recursing, gboolean recursing_native, gboolean foreign_destroy) { - GdkWindowImplClass *impl_class; - GdkWindow *temp_window; + GdkSurfaceImplClass *impl_class; + GdkSurface *temp_window; GdkDisplay *display; GList *tmp; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); switch (window->window_type) { @@ -1187,19 +1187,19 @@ _gdk_window_destroy_hierarchy (GdkWindow *window, g_assert_not_reached (); break; - case GDK_WINDOW_ROOT: + case GDK_SURFACE_ROOT: if (!gdk_display_is_closed (display)) { g_error ("attempted to destroy root window"); break; } /* else fall thru */ - case GDK_WINDOW_TOPLEVEL: - case GDK_WINDOW_CHILD: - case GDK_WINDOW_TEMP: - case GDK_WINDOW_FOREIGN: - case GDK_WINDOW_SUBSURFACE: - if (window->window_type == GDK_WINDOW_FOREIGN && !foreign_destroy) + case GDK_SURFACE_TOPLEVEL: + case GDK_SURFACE_CHILD: + case GDK_SURFACE_TEMP: + case GDK_SURFACE_FOREIGN: + case GDK_SURFACE_SUBSURFACE: + if (window->window_type == GDK_SURFACE_FOREIGN && !foreign_destroy) { } else @@ -1210,10 +1210,10 @@ _gdk_window_destroy_hierarchy (GdkWindow *window, window->parent->children = g_list_remove_link (window->parent->children, &window->children_list_node); if (!recursing && - GDK_WINDOW_IS_MAPPED (window)) + GDK_SURFACE_IS_MAPPED (window)) { recompute_visible_regions (window, FALSE); - gdk_window_invalidate_in_parent (window); + gdk_surface_invalidate_in_parent (window); } } @@ -1228,12 +1228,12 @@ _gdk_window_destroy_hierarchy (GdkWindow *window, if (window->frame_clock) { g_object_run_dispose (G_OBJECT (window->frame_clock)); - gdk_window_set_frame_clock (window, NULL); + gdk_surface_set_frame_clock (window, NULL); } - gdk_window_free_current_paint (window); + gdk_surface_free_current_paint (window); - if (window->window_type == GDK_WINDOW_FOREIGN) + if (window->window_type == GDK_SURFACE_FOREIGN) g_assert (window->children == NULL); else { @@ -1247,26 +1247,26 @@ _gdk_window_destroy_hierarchy (GdkWindow *window, tmp = tmp->next; if (temp_window) - _gdk_window_destroy_hierarchy (temp_window, + _gdk_surface_destroy_hierarchy (temp_window, TRUE, - recursing_native || gdk_window_has_impl (window), + recursing_native || gdk_surface_has_impl (window), foreign_destroy); } } - _gdk_window_clear_update_area (window); + _gdk_surface_clear_update_area (window); - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); - if (gdk_window_has_impl (window)) + if (gdk_surface_has_impl (window)) impl_class->destroy (window, recursing_native, foreign_destroy); else { /* hide to make sure we repaint and break grabs */ - gdk_window_hide (window); + gdk_surface_hide (window); } - window->state |= GDK_WINDOW_STATE_WITHDRAWN; + window->state |= GDK_SURFACE_STATE_WITHDRAWN; window->parent = NULL; window->destroyed = TRUE; @@ -1285,26 +1285,26 @@ _gdk_window_destroy_hierarchy (GdkWindow *window, } /** - * _gdk_window_destroy: - * @window: a #GdkWindow + * _gdk_surface_destroy: + * @window: a #GdkSurface * @foreign_destroy: If %TRUE, the window or a parent was destroyed by some * external agency. The window has already been destroyed and no * windowing system calls should be made. (This may never happen * for some windowing systems.) * - * Internal function to destroy a window. Like gdk_window_destroy(), - * but does not drop the reference count created by gdk_window_new(). + * Internal function to destroy a window. Like gdk_surface_destroy(), + * but does not drop the reference count created by gdk_surface_new(). **/ void -_gdk_window_destroy (GdkWindow *window, +_gdk_surface_destroy (GdkSurface *window, gboolean foreign_destroy) { - _gdk_window_destroy_hierarchy (window, FALSE, FALSE, foreign_destroy); + _gdk_surface_destroy_hierarchy (window, FALSE, FALSE, foreign_destroy); } /** - * gdk_window_destroy: - * @window: a #GdkWindow + * gdk_surface_destroy: + * @window: a #GdkSurface * * Destroys the window system resources associated with @window and decrements @window's * reference count. The window system resources for all children of @window are also @@ -1315,121 +1315,121 @@ _gdk_window_destroy (GdkWindow *window, * **/ void -gdk_window_destroy (GdkWindow *window) +gdk_surface_destroy (GdkSurface *window) { - _gdk_window_destroy_hierarchy (window, FALSE, FALSE, FALSE); + _gdk_surface_destroy_hierarchy (window, FALSE, FALSE, FALSE); g_object_unref (window); } /** - * gdk_window_set_user_data: - * @window: a #GdkWindow + * gdk_surface_set_user_data: + * @window: a #GdkSurface * @user_data: (allow-none) (type GObject.Object): user data * * For most purposes this function is deprecated in favor of * g_object_set_data(). However, for historical reasons GTK+ stores - * the #GtkWidget that owns a #GdkWindow as user data on the - * #GdkWindow. So, custom widget implementations should use - * this function for that. If GTK+ receives an event for a #GdkWindow, + * the #GtkWidget that owns a #GdkSurface as user data on the + * #GdkSurface. So, custom widget implementations should use + * this function for that. If GTK+ receives an event for a #GdkSurface, * and the user data for the window is non-%NULL, GTK+ will assume the * user data is a #GtkWidget, and forward the event to that widget. * **/ void -gdk_window_set_user_data (GdkWindow *window, +gdk_surface_set_user_data (GdkSurface *window, gpointer user_data) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); window->user_data = user_data; } /** - * gdk_window_get_user_data: - * @window: a #GdkWindow + * gdk_surface_get_user_data: + * @window: a #GdkSurface * @data: (out): return location for user data * * Retrieves the user data for @window, which is normally the widget - * that @window belongs to. See gdk_window_set_user_data(). + * that @window belongs to. See gdk_surface_set_user_data(). * **/ void -gdk_window_get_user_data (GdkWindow *window, +gdk_surface_get_user_data (GdkSurface *window, gpointer *data) { *data = window->user_data; } /** - * gdk_window_get_window_type: - * @window: a #GdkWindow + * gdk_surface_get_window_type: + * @window: a #GdkSurface * - * Gets the type of the window. See #GdkWindowType. + * Gets the type of the window. See #GdkSurfaceType. * * Returns: type of window **/ -GdkWindowType -gdk_window_get_window_type (GdkWindow *window) +GdkSurfaceType +gdk_surface_get_window_type (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), (GdkWindowType) -1); + g_return_val_if_fail (GDK_IS_SURFACE (window), (GdkSurfaceType) -1); - return GDK_WINDOW_TYPE (window); + return GDK_SURFACE_TYPE (window); } /** - * gdk_window_get_display: - * @window: a #GdkWindow + * gdk_surface_get_display: + * @window: a #GdkSurface * - * Gets the #GdkDisplay associated with a #GdkWindow. + * Gets the #GdkDisplay associated with a #GdkSurface. * * Returns: (transfer none): the #GdkDisplay associated with @window **/ GdkDisplay * -gdk_window_get_display (GdkWindow *window) +gdk_surface_get_display (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); return window->display; } /** - * gdk_window_is_destroyed: - * @window: a #GdkWindow + * gdk_surface_is_destroyed: + * @window: a #GdkSurface * * Check to see if a window is destroyed.. * * Returns: %TRUE if the window is destroyed **/ gboolean -gdk_window_is_destroyed (GdkWindow *window) +gdk_surface_is_destroyed (GdkSurface *window) { - return GDK_WINDOW_DESTROYED (window); + return GDK_SURFACE_DESTROYED (window); } /** - * gdk_window_has_native: - * @window: a #GdkWindow + * gdk_surface_has_native: + * @window: a #GdkSurface * * Checks whether the window has a native window or not. * * Returns: %TRUE if the @window has a native window, %FALSE otherwise. */ gboolean -gdk_window_has_native (GdkWindow *window) +gdk_surface_has_native (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); return window->parent == NULL || window->parent->impl != window->impl; } /** - * gdk_window_get_position: - * @window: a #GdkWindow + * gdk_surface_get_position: + * @window: a #GdkSurface * @x: (out) (allow-none): X coordinate of window * @y: (out) (allow-none): Y coordinate of window * * Obtains the position of the window as reported in the * most-recently-processed #GdkEventConfigure. Contrast with - * gdk_window_get_geometry() which queries the X server for the + * gdk_surface_get_geometry() which queries the X server for the * current window position, regardless of which events have been * received or processed. * @@ -1437,11 +1437,11 @@ gdk_window_has_native (GdkWindow *window) * **/ void -gdk_window_get_position (GdkWindow *window, +gdk_surface_get_position (GdkSurface *window, gint *x, gint *y) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); if (x) *x = window->x; @@ -1450,11 +1450,11 @@ gdk_window_get_position (GdkWindow *window, } /** - * gdk_window_get_parent: - * @window: a #GdkWindow + * gdk_surface_get_parent: + * @window: a #GdkSurface * * Obtains the parent of @window, as known to GDK. Does not query the - * X server; thus this returns the parent as passed to gdk_window_new(), + * X server; thus this returns the parent as passed to gdk_surface_new(), * not the actual parent. This should never matter unless you’re using * Xlib calls mixed with GDK calls on the X11 platform. It may also * matter for toplevel windows, because the window manager may choose @@ -1462,38 +1462,38 @@ gdk_window_get_position (GdkWindow *window, * * Returns: (transfer none): parent of @window **/ -GdkWindow* -gdk_window_get_parent (GdkWindow *window) +GdkSurface* +gdk_surface_get_parent (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); - if (gdk_window_is_subsurface (window)) + if (gdk_surface_is_subsurface (window)) return window->transient_for; else return window->parent; } /** - * gdk_window_get_toplevel: - * @window: a #GdkWindow + * gdk_surface_get_toplevel: + * @window: a #GdkSurface * * Gets the toplevel window that’s an ancestor of @window. * - * Any window type but %GDK_WINDOW_CHILD is considered a - * toplevel window, as is a %GDK_WINDOW_CHILD window that + * Any window type but %GDK_SURFACE_CHILD is considered a + * toplevel window, as is a %GDK_SURFACE_CHILD window that * has a root window as parent. * * Returns: (transfer none): the toplevel window containing @window **/ -GdkWindow * -gdk_window_get_toplevel (GdkWindow *window) +GdkSurface * +gdk_surface_get_toplevel (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); - while (window->window_type == GDK_WINDOW_CHILD || - window->window_type == GDK_WINDOW_SUBSURFACE) + while (window->window_type == GDK_SURFACE_CHILD || + window->window_type == GDK_SURFACE_SUBSURFACE) { - if (gdk_window_is_toplevel (window)) + if (gdk_surface_is_toplevel (window)) break; window = window->parent; } @@ -1502,8 +1502,8 @@ gdk_window_get_toplevel (GdkWindow *window) } /** - * gdk_window_get_children: - * @window: a #GdkWindow + * gdk_surface_get_children: + * @window: a #GdkSurface * * Gets the list of children of @window known to GDK. * This function only returns children created via GDK, @@ -1513,36 +1513,36 @@ gdk_window_get_toplevel (GdkWindow *window) * The returned list must be freed, but the elements in the * list need not be. * - * Returns: (transfer container) (element-type GdkWindow): + * Returns: (transfer container) (element-type GdkSurface): * list of child windows inside @window **/ GList* -gdk_window_get_children (GdkWindow *window) +gdk_surface_get_children (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return NULL; return g_list_copy (window->children); } /** - * gdk_window_peek_children: - * @window: a #GdkWindow + * gdk_surface_peek_children: + * @window: a #GdkSurface * - * Like gdk_window_get_children(), but does not copy the list of + * Like gdk_surface_get_children(), but does not copy the list of * children, so the list does not need to be freed. * - * Returns: (transfer none) (element-type GdkWindow): + * Returns: (transfer none) (element-type GdkSurface): * a reference to the list of child windows in @window **/ GList * -gdk_window_peek_children (GdkWindow *window) +gdk_surface_peek_children (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return NULL; return window->children; @@ -1550,8 +1550,8 @@ gdk_window_peek_children (GdkWindow *window) /** - * gdk_window_get_children_with_user_data: - * @window: a #GdkWindow + * gdk_surface_get_children_with_user_data: + * @window: a #GdkSurface * @user_data: user data to look for * * Gets the list of children of @window known to GDK with a @@ -1563,19 +1563,19 @@ gdk_window_peek_children (GdkWindow *window) * The list is returned in (relative) stacking order, i.e. the * lowest window is first. * - * Returns: (transfer container) (element-type GdkWindow): + * Returns: (transfer container) (element-type GdkSurface): * list of child windows inside @window **/ GList * -gdk_window_get_children_with_user_data (GdkWindow *window, +gdk_surface_get_children_with_user_data (GdkSurface *window, gpointer user_data) { - GdkWindow *child; + GdkSurface *child; GList *res, *l; - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return NULL; res = NULL; @@ -1592,25 +1592,25 @@ gdk_window_get_children_with_user_data (GdkWindow *window, /** - * gdk_window_is_visible: - * @window: a #GdkWindow + * gdk_surface_is_visible: + * @window: a #GdkSurface * - * Checks whether the window has been mapped (with gdk_window_show() or - * gdk_window_show_unraised()). + * Checks whether the window has been mapped (with gdk_surface_show() or + * gdk_surface_show_unraised()). * * Returns: %TRUE if the window is mapped **/ gboolean -gdk_window_is_visible (GdkWindow *window) +gdk_surface_is_visible (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); - return GDK_WINDOW_IS_MAPPED (window); + return GDK_SURFACE_IS_MAPPED (window); } /** - * gdk_window_is_viewable: - * @window: a #GdkWindow + * gdk_surface_is_viewable: + * @window: a #GdkSurface * * Check if the window and all ancestors of the window are * mapped. (This is not necessarily "viewable" in the X sense, since @@ -1620,9 +1620,9 @@ gdk_window_is_visible (GdkWindow *window) * Returns: %TRUE if the window is viewable **/ gboolean -gdk_window_is_viewable (GdkWindow *window) +gdk_surface_is_viewable (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); if (window->destroyed) return FALSE; @@ -1631,31 +1631,31 @@ gdk_window_is_viewable (GdkWindow *window) } /** - * gdk_window_get_state: - * @window: a #GdkWindow + * gdk_surface_get_state: + * @window: a #GdkSurface * * Gets the bitwise OR of the currently active window state flags, - * from the #GdkWindowState enumeration. + * from the #GdkSurfaceState enumeration. * * Returns: window state bitfield **/ -GdkWindowState -gdk_window_get_state (GdkWindow *window) +GdkSurfaceState +gdk_surface_get_state (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); return window->state; } static cairo_content_t -gdk_window_get_content (GdkWindow *window) +gdk_surface_get_content (GdkSurface *window) { cairo_surface_t *surface; cairo_content_t content; - g_return_val_if_fail (GDK_IS_WINDOW (window), 0); + g_return_val_if_fail (GDK_IS_SURFACE (window), 0); - surface = gdk_window_ref_impl_surface (window); + surface = gdk_surface_ref_impl_surface (window); content = cairo_surface_get_content (surface); cairo_surface_destroy (surface); @@ -1663,13 +1663,13 @@ gdk_window_get_content (GdkWindow *window) } static cairo_surface_t * -gdk_window_ref_impl_surface (GdkWindow *window) +gdk_surface_ref_impl_surface (GdkSurface *window) { - return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->ref_cairo_surface (gdk_window_get_impl_window (window)); + return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->ref_cairo_surface (gdk_surface_get_impl_window (window)); } GdkGLContext * -gdk_window_get_paint_gl_context (GdkWindow *window, +gdk_surface_get_paint_gl_context (GdkSurface *window, GError **error) { GError *internal_error = NULL; @@ -1684,7 +1684,7 @@ gdk_window_get_paint_gl_context (GdkWindow *window, if (window->impl_window->gl_paint_context == NULL) { - GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); if (impl_class->create_gl_context == NULL) { @@ -1719,12 +1719,12 @@ gdk_window_get_paint_gl_context (GdkWindow *window, } /** - * gdk_window_create_gl_context: - * @window: a #GdkWindow + * gdk_surface_create_gl_context: + * @window: a #GdkSurface * @error: return location for an error * * Creates a new #GdkGLContext matching the - * framebuffer format to the visual of the #GdkWindow. The context + * framebuffer format to the visual of the #GdkSurface. The context * is disconnected from any particular window or surface. * * If the creation of the #GdkGLContext failed, @error will be set. @@ -1736,27 +1736,27 @@ gdk_window_get_paint_gl_context (GdkWindow *window, * %NULL on error **/ GdkGLContext * -gdk_window_create_gl_context (GdkWindow *window, +gdk_surface_create_gl_context (GdkSurface *window, GError **error) { GdkGLContext *paint_context; - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); - paint_context = gdk_window_get_paint_gl_context (window, error); + paint_context = gdk_surface_get_paint_gl_context (window, error); if (paint_context == NULL) return NULL; - return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window, + return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window, FALSE, paint_context, error); } /** - * gdk_window_create_vulkan_context: - * @window: a #GdkWindow + * gdk_surface_create_vulkan_context: + * @window: a #GdkSurface * @error: return location for an error * * Creates a new #GdkVulkanContext for rendering on @window. @@ -1767,12 +1767,12 @@ gdk_window_create_gl_context (GdkWindow *window, * %NULL on error **/ GdkVulkanContext * -gdk_window_create_vulkan_context (GdkWindow *window, +gdk_surface_create_vulkan_context (GdkSurface *window, GError **error) { GdkDisplay *display; - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); if (GDK_DISPLAY_DEBUG_CHECK (window->display, VULKAN_DISABLE)) @@ -1782,7 +1782,7 @@ gdk_window_create_vulkan_context (GdkWindow *window, return NULL; } - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); if (GDK_DISPLAY_GET_CLASS (display)->vk_extension_name == NULL) { @@ -1799,11 +1799,11 @@ gdk_window_create_vulkan_context (GdkWindow *window, } static void -gdk_window_begin_paint_internal (GdkWindow *window, +gdk_surface_begin_paint_internal (GdkSurface *window, const cairo_region_t *region) { GdkRectangle clip_box; - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; double sx, sy; gboolean needs_surface; cairo_content_t surface_content; @@ -1815,7 +1815,7 @@ gdk_window_begin_paint_internal (GdkWindow *window, return; } - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); needs_surface = TRUE; if (impl_class->begin_paint) @@ -1825,11 +1825,11 @@ gdk_window_begin_paint_internal (GdkWindow *window, cairo_region_intersect (window->current_paint.region, window->clip_region); cairo_region_get_extents (window->current_paint.region, &clip_box); - surface_content = gdk_window_get_content (window); + surface_content = gdk_surface_get_content (window); if (needs_surface) { - window->current_paint.surface = gdk_window_create_similar_surface (window, + window->current_paint.surface = gdk_surface_create_similar_surface (window, surface_content, MAX (clip_box.width, 1), MAX (clip_box.height, 1)); @@ -1842,27 +1842,27 @@ gdk_window_begin_paint_internal (GdkWindow *window, } else { - window->current_paint.surface = gdk_window_ref_impl_surface (window); + window->current_paint.surface = gdk_surface_ref_impl_surface (window); window->current_paint.surface_needs_composite = FALSE; } if (!cairo_region_is_empty (window->current_paint.region)) - gdk_window_clear_backing_region (window); + gdk_surface_clear_backing_region (window); } static void -gdk_window_end_paint_internal (GdkWindow *window) +gdk_surface_end_paint_internal (GdkSurface *window) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; cairo_t *cr; if (window->current_paint.surface == NULL) { - g_warning (G_STRLOC": no preceding call to gdk_window_begin_draw_frame(), see documentation"); + g_warning (G_STRLOC": no preceding call to gdk_surface_begin_draw_frame(), see documentation"); return; } - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); if (impl_class->end_paint) impl_class->end_paint (window); @@ -1871,7 +1871,7 @@ gdk_window_end_paint_internal (GdkWindow *window) { cairo_surface_t *surface; - surface = gdk_window_ref_impl_surface (window); + surface = gdk_surface_ref_impl_surface (window); cr = cairo_create (surface); cairo_set_source_surface (cr, window->current_paint.surface, 0, 0); @@ -1887,41 +1887,41 @@ gdk_window_end_paint_internal (GdkWindow *window) cairo_surface_destroy (surface); } - gdk_window_free_current_paint (window); + gdk_surface_free_current_paint (window); } /** - * gdk_window_begin_draw_frame: - * @window: a #GdkWindow + * gdk_surface_begin_draw_frame: + * @window: a #GdkSurface * @context: (allow-none): the context used to draw the frame * @region: a Cairo region * * Indicates that you are beginning the process of redrawing @region * on @window, and provides you with a #GdkDrawingContext. * - * If @window is a top level #GdkWindow, backed by a native window + * If @window is a top level #GdkSurface, backed by a native window * implementation, a backing store (offscreen buffer) large enough to * contain @region will be created. The backing store will be initialized * with the background color or background surface for @window. Then, all * drawing operations performed on @window will be diverted to the - * backing store. When you call gdk_window_end_frame(), the contents of + * backing store. When you call gdk_surface_end_frame(), the contents of * the backing store will be copied to @window, making it visible * on screen. Only the part of @window contained in @region will be * modified; that is, drawing operations are clipped to @region. * * The net result of all this is to remove flicker, because the user * sees the finished product appear all at once when you call - * gdk_window_end_draw_frame(). If you draw to @window directly without - * calling gdk_window_begin_draw_frame(), the user may see flicker + * gdk_surface_end_draw_frame(). If you draw to @window directly without + * calling gdk_surface_begin_draw_frame(), the user may see flicker * as individual drawing operations are performed in sequence. * * When using GTK+, the widget system automatically places calls to - * gdk_window_begin_draw_frame() and gdk_window_end_draw_frame() around + * gdk_surface_begin_draw_frame() and gdk_surface_end_draw_frame() around * emissions of the `GtkWidget::draw` signal. That is, if you’re * drawing the contents of the widget yourself, you can assume that the * widget has a cleared background, is already set as the clip region, * and already has a backing store. Therefore in most cases, application - * code in GTK does not need to call gdk_window_begin_draw_frame() + * code in GTK does not need to call gdk_surface_begin_draw_frame() * explicitly. * * Returns: (transfer none): a #GdkDrawingContext context that should be @@ -1929,16 +1929,16 @@ gdk_window_end_paint_internal (GdkWindow *window) * by GDK. */ GdkDrawingContext * -gdk_window_begin_draw_frame (GdkWindow *window, +gdk_surface_begin_draw_frame (GdkSurface *window, GdkDrawContext *draw_context, const cairo_region_t *region) { GdkDrawingContext *context; cairo_region_t *real_region; - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); - g_return_val_if_fail (gdk_window_has_native (window), NULL); - g_return_val_if_fail (gdk_window_is_toplevel (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); + g_return_val_if_fail (gdk_surface_has_native (window), NULL); + g_return_val_if_fail (gdk_surface_is_toplevel (window), NULL); g_return_val_if_fail (region != NULL, NULL); if (draw_context != NULL) { @@ -1946,14 +1946,14 @@ gdk_window_begin_draw_frame (GdkWindow *window, g_return_val_if_fail (gdk_draw_context_get_window (draw_context) == window, NULL); } - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return NULL; if (window->drawing_context != NULL) { g_critical ("The window %p already has a drawing context. You cannot " - "call gdk_window_begin_draw_frame() without calling " - "gdk_window_end_draw_frame() first.", window); + "call gdk_surface_begin_draw_frame() without calling " + "gdk_surface_end_draw_frame() first.", window); return NULL; } @@ -1962,7 +1962,7 @@ gdk_window_begin_draw_frame (GdkWindow *window, if (draw_context) gdk_draw_context_begin_frame (draw_context, real_region); else - gdk_window_begin_paint_internal (window, real_region); + gdk_surface_begin_paint_internal (window, real_region); context = g_object_new (GDK_TYPE_DRAWING_CONTEXT, "window", window, @@ -1979,35 +1979,35 @@ gdk_window_begin_draw_frame (GdkWindow *window, } /** - * gdk_window_end_draw_frame: - * @window: a #GdkWindow - * @context: the #GdkDrawingContext created by gdk_window_begin_draw_frame() + * gdk_surface_end_draw_frame: + * @window: a #GdkSurface + * @context: the #GdkDrawingContext created by gdk_surface_begin_draw_frame() * * Indicates that the drawing of the contents of @window started with - * gdk_window_begin_frame() has been completed. + * gdk_surface_begin_frame() has been completed. * * This function will take care of destroying the #GdkDrawingContext. * * It is an error to call this function without a matching - * gdk_window_begin_frame() first. + * gdk_surface_begin_frame() first. */ void -gdk_window_end_draw_frame (GdkWindow *window, +gdk_surface_end_draw_frame (GdkSurface *window, GdkDrawingContext *context) { GdkDrawContext *paint_context; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); g_return_if_fail (GDK_IS_DRAWING_CONTEXT (context)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (window->drawing_context == NULL) { g_critical ("The window %p has no drawing context. You must call " - "gdk_window_begin_draw_frame() before calling " - "gdk_window_end_draw_frame().", window); + "gdk_surface_begin_draw_frame() before calling " + "gdk_surface_end_draw_frame().", window); return; } g_return_if_fail (window->drawing_context == context); @@ -2025,7 +2025,7 @@ gdk_window_end_draw_frame (GdkWindow *window, } else { - gdk_window_end_paint_internal (window); + gdk_surface_end_paint_internal (window); } window->drawing_context = NULL; @@ -2034,15 +2034,15 @@ gdk_window_end_draw_frame (GdkWindow *window, } /*< private > - * gdk_window_get_current_paint_region: - * @window: a #GdkWindow + * gdk_surface_get_current_paint_region: + * @window: a #GdkSurface * * Retrieves a copy of the current paint region. * * Returns: (transfer full): a Cairo region */ cairo_region_t * -gdk_window_get_current_paint_region (GdkWindow *window) +gdk_surface_get_current_paint_region (GdkSurface *window) { cairo_region_t *region; @@ -2060,28 +2060,28 @@ gdk_window_get_current_paint_region (GdkWindow *window) } /*< private > - * gdk_window_get_drawing_context: - * @window: a #GdkWindow + * gdk_surface_get_drawing_context: + * @window: a #GdkSurface * * Retrieves the #GdkDrawingContext associated to @window by - * gdk_window_begin_draw_frame(). + * gdk_surface_begin_draw_frame(). * * Returns: (transfer none) (nullable): a #GdkDrawingContext, if any is set */ GdkDrawingContext * -gdk_window_get_drawing_context (GdkWindow *window) +gdk_surface_get_drawing_context (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return NULL; return window->drawing_context; } /** - * gdk_window_get_clip_region: - * @window: a #GdkWindow + * gdk_surface_get_clip_region: + * @window: a #GdkSurface * * Computes the region of a window that potentially can be written * to by drawing primitives. This region may not take into account @@ -2093,11 +2093,11 @@ gdk_window_get_drawing_context (GdkWindow *window) * when you are done. **/ cairo_region_t* -gdk_window_get_clip_region (GdkWindow *window) +gdk_surface_get_clip_region (GdkSurface *window) { cairo_region_t *result; - g_return_val_if_fail (GDK_WINDOW (window), NULL); + g_return_val_if_fail (GDK_SURFACE (window), NULL); result = cairo_region_copy (window->clip_region); @@ -2108,8 +2108,8 @@ gdk_window_get_clip_region (GdkWindow *window) } /** - * gdk_window_get_visible_region: - * @window: a #GdkWindow + * gdk_surface_get_visible_region: + * @window: a #GdkSurface * * Computes the region of the @window that is potentially visible. * This does not necessarily take into account if the window is @@ -2120,19 +2120,19 @@ gdk_window_get_clip_region (GdkWindow *window) * when you are done. **/ cairo_region_t * -gdk_window_get_visible_region (GdkWindow *window) +gdk_surface_get_visible_region (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); return cairo_region_copy (window->clip_region); } static void -gdk_window_clear_backing_region (GdkWindow *window) +gdk_surface_clear_backing_region (GdkSurface *window) { cairo_t *cr; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; cr = cairo_create (window->current_paint.surface); @@ -2148,27 +2148,27 @@ gdk_window_clear_backing_region (GdkWindow *window) * or the actual impl surface of the window. This should not be used * from very many places: be careful! */ static cairo_surface_t * -ref_window_surface (GdkWindow *window) +ref_window_surface (GdkSurface *window) { if (window->impl_window->current_paint.surface) return cairo_surface_reference (window->impl_window->current_paint.surface); else - return gdk_window_ref_impl_surface (window); + return gdk_surface_ref_impl_surface (window); } /* This is used in places like gdk_cairo_set_source_window and * other places to take "screenshots" of windows. Thus, we allow * it to be used outside of a begin_paint / end_paint. */ cairo_surface_t * -_gdk_window_ref_cairo_surface (GdkWindow *window) +_gdk_surface_ref_cairo_surface (GdkSurface *window) { cairo_surface_t *surface; - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); surface = ref_window_surface (window); - if (gdk_window_has_impl (window)) + if (gdk_surface_has_impl (window)) { return surface; } @@ -2190,12 +2190,12 @@ _gdk_window_ref_cairo_surface (GdkWindow *window) static GSList *update_windows = NULL; static inline gboolean -gdk_window_is_ancestor (GdkWindow *window, - GdkWindow *ancestor) +gdk_surface_is_ancestor (GdkSurface *window, + GdkSurface *ancestor) { while (window) { - GdkWindow *parent = window->parent; + GdkSurface *parent = window->parent; if (parent == ancestor) return TRUE; @@ -2207,7 +2207,7 @@ gdk_window_is_ancestor (GdkWindow *window, } static void -gdk_window_add_update_window (GdkWindow *window) +gdk_surface_add_update_window (GdkSurface *window) { GSList *tmp; GSList *prev = NULL; @@ -2224,24 +2224,24 @@ gdk_window_add_update_window (GdkWindow *window) for (tmp = update_windows; tmp; tmp = tmp->next) { - GdkWindow *parent = window->parent; + GdkSurface *parent = window->parent; /* check if tmp is an ancestor of "window"; if it is, set a * flag indicating that all following windows are either * children of "window" or from a differen hierarchy */ - if (!has_ancestor_in_list && gdk_window_is_ancestor (window, tmp->data)) + if (!has_ancestor_in_list && gdk_surface_is_ancestor (window, tmp->data)) has_ancestor_in_list = TRUE; /* insert in reverse stacking order when adding around siblings, * so processing updates properly paints over lower stacked windows */ - if (parent == GDK_WINDOW (tmp->data)->parent) + if (parent == GDK_SURFACE (tmp->data)->parent) { if (parent != NULL) { gint index = g_list_index (parent->children, window); - for (; tmp && parent == GDK_WINDOW (tmp->data)->parent; tmp = tmp->next) + for (; tmp && parent == GDK_SURFACE (tmp->data)->parent; tmp = tmp->next) { gint sibling_index = g_list_index (parent->children, tmp->data); if (index > sibling_index) @@ -2261,7 +2261,7 @@ gdk_window_add_update_window (GdkWindow *window) /* if "window" has an ancestor in the list and tmp is one of * "window's" children, insert "window" before tmp */ - if (has_ancestor_in_list && gdk_window_is_ancestor (tmp->data, window)) + if (has_ancestor_in_list && gdk_surface_is_ancestor (tmp->data, window)) { tmp = g_slist_prepend (tmp, g_object_ref (window)); @@ -2292,7 +2292,7 @@ gdk_window_add_update_window (GdkWindow *window) } static void -gdk_window_remove_update_window (GdkWindow *window) +gdk_surface_remove_update_window (GdkSurface *window) { GSList *link; @@ -2305,36 +2305,36 @@ gdk_window_remove_update_window (GdkWindow *window) } static gboolean -gdk_window_is_toplevel_frozen (GdkWindow *window) +gdk_surface_is_toplevel_frozen (GdkSurface *window) { - GdkWindow *toplevel; + GdkSurface *toplevel; - toplevel = gdk_window_get_toplevel (window); + toplevel = gdk_surface_get_toplevel (window); return toplevel->update_and_descendants_freeze_count > 0; } static void -gdk_window_schedule_update (GdkWindow *window) +gdk_surface_schedule_update (GdkSurface *window) { GdkFrameClock *frame_clock; if (window && (window->update_freeze_count || - gdk_window_is_toplevel_frozen (window))) + gdk_surface_is_toplevel_frozen (window))) return; /* If there's no frame clock (a foreign window), then the invalid - * region will just stick around unless gdk_window_process_updates() + * region will just stick around unless gdk_surface_process_updates() * is called. */ - frame_clock = gdk_window_get_frame_clock (window); + frame_clock = gdk_surface_get_frame_clock (window); if (frame_clock) - gdk_frame_clock_request_phase (gdk_window_get_frame_clock (window), + gdk_frame_clock_request_phase (gdk_surface_get_frame_clock (window), GDK_FRAME_CLOCK_PHASE_PAINT); } void -_gdk_window_process_updates_recurse (GdkWindow *window, +_gdk_surface_process_updates_recurse (GdkSurface *window, cairo_region_t *expose_region) { cairo_region_t *clipped_expose_region; @@ -2368,7 +2368,7 @@ _gdk_window_process_updates_recurse (GdkWindow *window, static void -gdk_window_update_native_shapes (GdkWindow *window) +gdk_surface_update_native_shapes (GdkSurface *window) { if (should_apply_clip_as_shape (window)) apply_clip_as_shape (window); @@ -2378,15 +2378,15 @@ gdk_window_update_native_shapes (GdkWindow *window) * expose events for the window and all non-native descendants. */ static void -gdk_window_process_updates_internal (GdkWindow *window) +gdk_surface_process_updates_internal (GdkSurface *window) { - GdkWindowImplClass *impl_class; - GdkWindow *toplevel; + GdkSurfaceImplClass *impl_class; + GdkSurface *toplevel; - toplevel = gdk_window_get_toplevel (window); + toplevel = gdk_surface_get_toplevel (window); if (toplevel->geometry_dirty) { - gdk_window_update_native_shapes (toplevel); + gdk_surface_update_native_shapes (toplevel); toplevel->geometry_dirty = FALSE; } @@ -2406,13 +2406,13 @@ gdk_window_process_updates_internal (GdkWindow *window) window->active_update_area = window->update_area; window->update_area = NULL; - if (gdk_window_is_viewable (window)) + if (gdk_surface_is_viewable (window)) { cairo_region_t *expose_region; expose_region = cairo_region_copy (window->active_update_area); - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); /* Clip to part visible in impl window */ cairo_region_intersect (expose_region, window->clip_region); @@ -2422,7 +2422,7 @@ gdk_window_process_updates_internal (GdkWindow *window) impl_class->process_updates_recurse (window, expose_region); - gdk_window_append_old_updated_area (window, window->active_update_area); + gdk_surface_append_old_updated_area (window, window->active_update_area); cairo_region_destroy (expose_region); } @@ -2437,47 +2437,47 @@ gdk_window_process_updates_internal (GdkWindow *window) } static void -gdk_window_paint_on_clock (GdkFrameClock *clock, +gdk_surface_paint_on_clock (GdkFrameClock *clock, void *data) { - GdkWindow *window; + GdkSurface *window; - window = GDK_WINDOW (data); + window = GDK_SURFACE (data); - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); g_return_if_fail (window->impl_window == window); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; g_object_ref (window); if (window->update_area && !window->update_freeze_count && - !gdk_window_is_toplevel_frozen (window) && + !gdk_surface_is_toplevel_frozen (window) && /* Don't recurse into process_updates_internal, we'll * do the update later when idle instead. */ !window->in_update) { - gdk_window_process_updates_internal (window); - gdk_window_remove_update_window (window); + gdk_surface_process_updates_internal (window); + gdk_surface_remove_update_window (window); } g_object_unref (window); } static void -gdk_window_invalidate_rect_full (GdkWindow *window, +gdk_surface_invalidate_rect_full (GdkSurface *window, const GdkRectangle *rect, gboolean invalidate_children) { GdkRectangle window_rect; cairo_region_t *region; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (window->input_only || !window->viewable) @@ -2493,61 +2493,61 @@ gdk_window_invalidate_rect_full (GdkWindow *window, } region = cairo_region_create_rectangle (rect); - gdk_window_invalidate_region_full (window, region, invalidate_children); + gdk_surface_invalidate_region_full (window, region, invalidate_children); cairo_region_destroy (region); } /** - * gdk_window_invalidate_rect: - * @window: a #GdkWindow + * gdk_surface_invalidate_rect: + * @window: a #GdkSurface * @rect: (allow-none): rectangle to invalidate or %NULL to invalidate the whole * window * @invalidate_children: whether to also invalidate child windows * - * A convenience wrapper around gdk_window_invalidate_region() which + * A convenience wrapper around gdk_surface_invalidate_region() which * invalidates a rectangular region. See - * gdk_window_invalidate_region() for details. + * gdk_surface_invalidate_region() for details. **/ void -gdk_window_invalidate_rect (GdkWindow *window, +gdk_surface_invalidate_rect (GdkSurface *window, const GdkRectangle *rect, gboolean invalidate_children) { - gdk_window_invalidate_rect_full (window, rect, invalidate_children); + gdk_surface_invalidate_rect_full (window, rect, invalidate_children); } static void -impl_window_add_update_area (GdkWindow *impl_window, +impl_window_add_update_area (GdkSurface *impl_window, cairo_region_t *region) { if (impl_window->update_area) cairo_region_union (impl_window->update_area, region); else { - gdk_window_add_update_window (impl_window); + gdk_surface_add_update_window (impl_window); impl_window->update_area = cairo_region_copy (region); - gdk_window_schedule_update (impl_window); + gdk_surface_schedule_update (impl_window); } } static void -gdk_window_invalidate_maybe_recurse_full (GdkWindow *window, +gdk_surface_invalidate_maybe_recurse_full (GdkSurface *window, const cairo_region_t *region, - GdkWindowChildFunc child_func, + GdkSurfaceChildFunc child_func, gpointer user_data) { cairo_region_t *visible_region; cairo_rectangle_int_t r; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (window->input_only || !window->viewable || cairo_region_is_empty (region) || - window->window_type == GDK_WINDOW_ROOT) + window->window_type == GDK_SURFACE_ROOT) return; r.x = 0; @@ -2562,7 +2562,7 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window, r.height = window->height; cairo_region_intersect_rectangle (visible_region, &r); - if (gdk_window_has_impl (window)) + if (gdk_surface_has_impl (window)) { impl_window_add_update_area (window, visible_region); break; @@ -2579,8 +2579,8 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window, } /** - * gdk_window_invalidate_maybe_recurse: - * @window: a #GdkWindow + * gdk_surface_invalidate_maybe_recurse: + * @window: a #GdkSurface * @region: a #cairo_region_t * @child_func: (scope call) (allow-none): function to use to decide if to * recurse to a child, %NULL means never recurse. @@ -2599,36 +2599,36 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow *window, * invalidated. **/ void -gdk_window_invalidate_maybe_recurse (GdkWindow *window, +gdk_surface_invalidate_maybe_recurse (GdkSurface *window, const cairo_region_t *region, - GdkWindowChildFunc child_func, + GdkSurfaceChildFunc child_func, gpointer user_data) { - gdk_window_invalidate_maybe_recurse_full (window, region, + gdk_surface_invalidate_maybe_recurse_full (window, region, child_func, user_data); } static gboolean -true_predicate (GdkWindow *window, +true_predicate (GdkSurface *window, gpointer user_data) { return TRUE; } static void -gdk_window_invalidate_region_full (GdkWindow *window, +gdk_surface_invalidate_region_full (GdkSurface *window, const cairo_region_t *region, gboolean invalidate_children) { - gdk_window_invalidate_maybe_recurse_full (window, region, + gdk_surface_invalidate_maybe_recurse_full (window, region, invalidate_children ? - true_predicate : (gboolean (*) (GdkWindow *, gpointer))NULL, + true_predicate : (gboolean (*) (GdkSurface *, gpointer))NULL, NULL); } /** - * gdk_window_invalidate_region: - * @window: a #GdkWindow + * gdk_surface_invalidate_region: + * @window: a #GdkSurface * @region: a #cairo_region_t * @invalidate_children: %TRUE to also invalidate child windows * @@ -2642,23 +2642,23 @@ gdk_window_invalidate_region_full (GdkWindow *window, * The @invalidate_children parameter controls whether the region of * each child window that intersects @region will also be invalidated. * If %FALSE, then the update area for child windows will remain - * unaffected. See gdk_window_invalidate_maybe_recurse if you need + * unaffected. See gdk_surface_invalidate_maybe_recurse if you need * fine grained control over which children are invalidated. **/ void -gdk_window_invalidate_region (GdkWindow *window, +gdk_surface_invalidate_region (GdkSurface *window, const cairo_region_t *region, gboolean invalidate_children) { - gdk_window_invalidate_maybe_recurse (window, region, + gdk_surface_invalidate_maybe_recurse (window, region, invalidate_children ? - true_predicate : (gboolean (*) (GdkWindow *, gpointer))NULL, + true_predicate : (gboolean (*) (GdkSurface *, gpointer))NULL, NULL); } /** - * _gdk_window_invalidate_for_expose: - * @window: a #GdkWindow + * _gdk_surface_invalidate_for_expose: + * @window: a #GdkSurface * @region: a #cairo_region_t * * Adds @region to the update area for @window. @@ -2672,37 +2672,37 @@ gdk_window_invalidate_region (GdkWindow *window, * any non-native child windows. **/ void -_gdk_window_invalidate_for_expose (GdkWindow *window, +_gdk_surface_invalidate_for_expose (GdkSurface *window, cairo_region_t *region) { - gdk_window_invalidate_maybe_recurse_full (window, region, - (gboolean (*) (GdkWindow *, gpointer))gdk_window_has_no_impl, + gdk_surface_invalidate_maybe_recurse_full (window, region, + (gboolean (*) (GdkSurface *, gpointer))gdk_surface_has_no_impl, NULL); } /** - * gdk_window_get_update_area: - * @window: a #GdkWindow + * gdk_surface_get_update_area: + * @window: a #GdkSurface * * Transfers ownership of the update area from @window to the caller * of the function. That is, after calling this function, @window will * no longer have an invalid/dirty region; the update area is removed * from @window and handed to you. If a window has no update area, - * gdk_window_get_update_area() returns %NULL. You are responsible for + * gdk_surface_get_update_area() returns %NULL. You are responsible for * calling cairo_region_destroy() on the returned region if it’s non-%NULL. * * Returns: the update area for @window **/ cairo_region_t * -gdk_window_get_update_area (GdkWindow *window) +gdk_surface_get_update_area (GdkSurface *window) { - GdkWindow *impl_window; + GdkSurface *impl_window; cairo_region_t *tmp_region, *to_remove; - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); - impl_window = gdk_window_get_impl_window (window); + impl_window = gdk_surface_get_impl_window (window); if (impl_window->update_area) { @@ -2739,7 +2739,7 @@ gdk_window_get_update_area (GdkWindow *window) cairo_region_destroy (impl_window->update_area); impl_window->update_area = NULL; - gdk_window_remove_update_window ((GdkWindow *)impl_window); + gdk_surface_remove_update_window ((GdkSurface *)impl_window); } return tmp_region; @@ -2750,20 +2750,20 @@ gdk_window_get_update_area (GdkWindow *window) } /** - * _gdk_window_clear_update_area: - * @window: a #GdkWindow. + * _gdk_surface_clear_update_area: + * @window: a #GdkSurface. * * Internal function to clear the update area for a window. This * is called when the window is hidden or destroyed. **/ void -_gdk_window_clear_update_area (GdkWindow *window) +_gdk_surface_clear_update_area (GdkSurface *window) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); if (window->update_area) { - gdk_window_remove_update_window (window); + gdk_surface_remove_update_window (window); cairo_region_destroy (window->update_area); window->update_area = NULL; @@ -2771,72 +2771,72 @@ _gdk_window_clear_update_area (GdkWindow *window) } /** - * gdk_window_freeze_updates: - * @window: a #GdkWindow + * gdk_surface_freeze_updates: + * @window: a #GdkSurface * * Temporarily freezes a window such that it won’t receive expose * events. The window will begin receiving expose events again when - * gdk_window_thaw_updates() is called. If gdk_window_freeze_updates() - * has been called more than once, gdk_window_thaw_updates() must be called + * gdk_surface_thaw_updates() is called. If gdk_surface_freeze_updates() + * has been called more than once, gdk_surface_thaw_updates() must be called * an equal number of times to begin processing exposes. **/ void -gdk_window_freeze_updates (GdkWindow *window) +gdk_surface_freeze_updates (GdkSurface *window) { - GdkWindow *impl_window; + GdkSurface *impl_window; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - impl_window = gdk_window_get_impl_window (window); + impl_window = gdk_surface_get_impl_window (window); impl_window->update_freeze_count++; } /** - * gdk_window_thaw_updates: - * @window: a #GdkWindow + * gdk_surface_thaw_updates: + * @window: a #GdkSurface * - * Thaws a window frozen with gdk_window_freeze_updates(). + * Thaws a window frozen with gdk_surface_freeze_updates(). **/ void -gdk_window_thaw_updates (GdkWindow *window) +gdk_surface_thaw_updates (GdkSurface *window) { - GdkWindow *impl_window; + GdkSurface *impl_window; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - impl_window = gdk_window_get_impl_window (window); + impl_window = gdk_surface_get_impl_window (window); g_return_if_fail (impl_window->update_freeze_count > 0); if (--impl_window->update_freeze_count == 0) - gdk_window_schedule_update (GDK_WINDOW (impl_window)); + gdk_surface_schedule_update (GDK_SURFACE (impl_window)); } void -gdk_window_freeze_toplevel_updates (GdkWindow *window) +gdk_surface_freeze_toplevel_updates (GdkSurface *window) { - g_return_if_fail (GDK_IS_WINDOW (window)); - g_return_if_fail (window->window_type != GDK_WINDOW_CHILD); + g_return_if_fail (GDK_IS_SURFACE (window)); + g_return_if_fail (window->window_type != GDK_SURFACE_CHILD); window->update_and_descendants_freeze_count++; - _gdk_frame_clock_freeze (gdk_window_get_frame_clock (window)); + _gdk_frame_clock_freeze (gdk_surface_get_frame_clock (window)); } void -gdk_window_thaw_toplevel_updates (GdkWindow *window) +gdk_surface_thaw_toplevel_updates (GdkSurface *window) { - g_return_if_fail (GDK_IS_WINDOW (window)); - g_return_if_fail (window->window_type != GDK_WINDOW_CHILD); + g_return_if_fail (GDK_IS_SURFACE (window)); + g_return_if_fail (window->window_type != GDK_SURFACE_CHILD); g_return_if_fail (window->update_and_descendants_freeze_count > 0); window->update_and_descendants_freeze_count--; - _gdk_frame_clock_thaw (gdk_window_get_frame_clock (window)); + _gdk_frame_clock_thaw (gdk_surface_get_frame_clock (window)); - gdk_window_schedule_update (window); + gdk_surface_schedule_update (window); } /** - * gdk_window_constrain_size: + * gdk_surface_constrain_size: * @geometry: a #GdkGeometry structure * @flags: a mask indicating what portions of @geometry are set * @width: desired width of window @@ -2848,8 +2848,8 @@ gdk_window_thaw_toplevel_updates (GdkWindow *window) * set of geometry hints (such as minimum and maximum size). */ void -gdk_window_constrain_size (GdkGeometry *geometry, - GdkWindowHints flags, +gdk_surface_constrain_size (GdkGeometry *geometry, + GdkSurfaceHints flags, gint width, gint height, gint *new_width, @@ -2965,8 +2965,8 @@ gdk_window_constrain_size (GdkGeometry *geometry, } /** - * gdk_window_get_device_position_double: - * @window: a #GdkWindow. + * gdk_surface_get_device_position_double: + * @window: a #GdkSurface. * @device: pointer #GdkDevice to query to. * @x: (out) (allow-none): return location for the X coordinate of @device, or %NULL. * @y: (out) (allow-none): return location for the Y coordinate of @device, or %NULL. @@ -2980,8 +2980,8 @@ gdk_window_constrain_size (GdkGeometry *geometry, * (as with gdk_device_get_window_at_position()), or %NULL if the * window is not known to GDK. **/ -GdkWindow * -gdk_window_get_device_position_double (GdkWindow *window, +GdkSurface * +gdk_surface_get_device_position_double (GdkSurface *window, GdkDevice *device, double *x, double *y, @@ -2991,13 +2991,13 @@ gdk_window_get_device_position_double (GdkWindow *window, GdkModifierType tmp_mask; gboolean normal_child; - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), 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); tmp_x = tmp_y = 0; tmp_mask = 0; - normal_child = GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_device_state (window, + normal_child = GDK_SURFACE_IMPL_GET_CLASS (window->impl)->get_device_state (window, device, &tmp_x, &tmp_y, &tmp_mask); @@ -3013,13 +3013,13 @@ gdk_window_get_device_position_double (GdkWindow *window, *mask = tmp_mask; if (normal_child) - return _gdk_window_find_child_at (window, tmp_x, tmp_y); + return _gdk_surface_find_child_at (window, tmp_x, tmp_y); return NULL; } /** - * gdk_window_get_device_position: - * @window: a #GdkWindow. + * gdk_surface_get_device_position: + * @window: a #GdkSurface. * @device: pointer #GdkDevice to query to. * @x: (out) (allow-none): return location for the X coordinate of @device, or %NULL. * @y: (out) (allow-none): return location for the Y coordinate of @device, or %NULL. @@ -3029,14 +3029,14 @@ gdk_window_get_device_position_double (GdkWindow *window, * The position is given in coordinates relative to the upper left * corner of @window. * - * Use gdk_window_get_device_position_double() if you need subpixel precision. + * Use gdk_surface_get_device_position_double() if you need subpixel precision. * * Returns: (nullable) (transfer none): The window underneath @device * (as with gdk_device_get_window_at_position()), or %NULL if the * window is not known to GDK. **/ -GdkWindow * -gdk_window_get_device_position (GdkWindow *window, +GdkSurface * +gdk_surface_get_device_position (GdkSurface *window, GdkDevice *device, gint *x, gint *y, @@ -3044,7 +3044,7 @@ gdk_window_get_device_position (GdkWindow *window, { gdouble tmp_x, tmp_y; - window = gdk_window_get_device_position_double (window, device, + window = gdk_surface_get_device_position_double (window, device, &tmp_x, &tmp_y, mask); if (x) *x = round (tmp_x); @@ -3055,10 +3055,10 @@ gdk_window_get_device_position (GdkWindow *window, } static gboolean -gdk_window_raise_internal (GdkWindow *window) +gdk_surface_raise_internal (GdkSurface *window) { - GdkWindow *parent = window->parent; - GdkWindowImplClass *impl_class; + GdkSurface *parent = window->parent; + GdkSurfaceImplClass *impl_class; gboolean did_raise = FALSE; if (parent && parent->children->data != window) @@ -3068,10 +3068,10 @@ gdk_window_raise_internal (GdkWindow *window) did_raise = TRUE; } - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); /* Just do native raise for toplevels */ - if (gdk_window_has_impl (window)) + if (gdk_surface_has_impl (window)) impl_class->raise (window); return did_raise; @@ -3079,10 +3079,10 @@ gdk_window_raise_internal (GdkWindow *window) /* Returns TRUE If the native window was mapped or unmapped */ static gboolean -set_viewable (GdkWindow *w, +set_viewable (GdkSurface *w, gboolean val) { - GdkWindow *child; + GdkSurface *child; GList *l; if (w->viewable == val) @@ -3097,7 +3097,7 @@ set_viewable (GdkWindow *w, { child = l->data; - if (GDK_WINDOW_IS_MAPPED (child)) + if (GDK_SURFACE_IS_MAPPED (child)) set_viewable (child, val); } @@ -3106,16 +3106,16 @@ set_viewable (GdkWindow *w, /* Returns TRUE If the native window was mapped or unmapped */ gboolean -_gdk_window_update_viewable (GdkWindow *window) +_gdk_surface_update_viewable (GdkSurface *window) { gboolean viewable; - if (window->window_type == GDK_WINDOW_FOREIGN || - window->window_type == GDK_WINDOW_ROOT) + if (window->window_type == GDK_SURFACE_FOREIGN || + window->window_type == GDK_SURFACE_ROOT) viewable = TRUE; - else if (gdk_window_is_toplevel (window) || + else if (gdk_surface_is_toplevel (window) || window->parent->viewable) - viewable = GDK_WINDOW_IS_MAPPED (window); + viewable = GDK_SURFACE_IS_MAPPED (window); else viewable = FALSE; @@ -3123,31 +3123,31 @@ _gdk_window_update_viewable (GdkWindow *window) } static void -gdk_window_show_internal (GdkWindow *window, gboolean raise) +gdk_surface_show_internal (GdkSurface *window, gboolean raise) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; gboolean was_mapped, was_viewable; gboolean did_show, did_raise = FALSE; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); if (window->destroyed) return; - was_mapped = GDK_WINDOW_IS_MAPPED (window); + was_mapped = GDK_SURFACE_IS_MAPPED (window); was_viewable = window->viewable; if (raise) { /* Keep children in (reverse) stacking order */ - did_raise = gdk_window_raise_internal (window); + did_raise = gdk_surface_raise_internal (window); } - if (gdk_window_has_impl (window)) + if (gdk_surface_has_impl (window)) { if (!was_mapped) gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_WITHDRAWN, + GDK_SURFACE_STATE_WITHDRAWN, 0); } else @@ -3156,20 +3156,20 @@ gdk_window_show_internal (GdkWindow *window, gboolean raise) g_object_notify_by_pspec (G_OBJECT (window), properties[PROP_STATE]); } - did_show = _gdk_window_update_viewable (window); + did_show = _gdk_surface_update_viewable (window); /* If it was already viewable the backend show op won't be called, call it again to ensure things happen right if the mapped tracking was not right for e.g. a foreign window. Dunno if this is strictly needed but its what happened pre-csw. - Also show if not done by gdk_window_update_viewable. */ - if (gdk_window_has_impl (window) && (was_viewable || !did_show)) + Also show if not done by gdk_surface_update_viewable. */ + if (gdk_surface_has_impl (window) && (was_viewable || !did_show)) { - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); impl_class->show (window, !did_show ? was_mapped : TRUE); } - if (!was_mapped && !gdk_window_has_impl (window)) + if (!was_mapped && !gdk_surface_has_impl (window)) { if (window->event_mask & GDK_STRUCTURE_MASK) _gdk_make_event (window, GDK_MAP, NULL, FALSE); @@ -3182,17 +3182,17 @@ gdk_window_show_internal (GdkWindow *window, gboolean raise) { recompute_visible_regions (window, FALSE); - if (gdk_window_is_viewable (window)) - gdk_window_invalidate_rect_full (window, NULL, TRUE); + if (gdk_surface_is_viewable (window)) + gdk_surface_invalidate_rect_full (window, NULL, TRUE); } } /** - * gdk_window_show_unraised: - * @window: a #GdkWindow + * gdk_surface_show_unraised: + * @window: a #GdkSurface * - * Shows a #GdkWindow onscreen, but does not modify its stacking - * order. In contrast, gdk_window_show() will raise the window + * Shows a #GdkSurface onscreen, but does not modify its stacking + * order. In contrast, gdk_surface_show() will raise the window * to the top of the window stack. * * On the X11 platform, in Xlib terms, this function calls @@ -3200,48 +3200,48 @@ gdk_window_show_internal (GdkWindow *window, gboolean raise) * that you can’t really use XMapWindow() directly on a GDK window). */ void -gdk_window_show_unraised (GdkWindow *window) +gdk_surface_show_unraised (GdkSurface *window) { - gdk_window_show_internal (window, FALSE); + gdk_surface_show_internal (window, FALSE); } /** - * gdk_window_raise: - * @window: a #GdkWindow + * gdk_surface_raise: + * @window: a #GdkSurface * * Raises @window to the top of the Z-order (stacking order), so that * other windows with the same parent window appear below @window. * This is true whether or not the windows are visible. * * If @window is a toplevel, the window manager may choose to deny the - * request to move the window in the Z-order, gdk_window_raise() only + * request to move the window in the Z-order, gdk_surface_raise() only * requests the restack, does not guarantee it. */ void -gdk_window_raise (GdkWindow *window) +gdk_surface_raise (GdkSurface *window) { gboolean did_raise; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); if (window->destroyed) return; /* Keep children in (reverse) stacking order */ - did_raise = gdk_window_raise_internal (window); + did_raise = gdk_surface_raise_internal (window); if (did_raise && - !gdk_window_is_toplevel (window) && - gdk_window_is_viewable (window) && + !gdk_surface_is_toplevel (window) && + gdk_surface_is_viewable (window) && !window->input_only) - gdk_window_invalidate_region_full (window, window->clip_region, TRUE); + gdk_surface_invalidate_region_full (window, window->clip_region, TRUE); } static void -gdk_window_lower_internal (GdkWindow *window) +gdk_surface_lower_internal (GdkSurface *window) { - GdkWindow *parent = window->parent; - GdkWindowImplClass *impl_class; + GdkSurface *parent = window->parent; + GdkSurfaceImplClass *impl_class; if (parent) { @@ -3249,19 +3249,19 @@ gdk_window_lower_internal (GdkWindow *window) parent->children = g_list_concat (parent->children, &window->children_list_node); } - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); /* Just do native lower for toplevels */ - if (gdk_window_has_impl (window)) + if (gdk_surface_has_impl (window)) impl_class->lower (window); } static void -gdk_window_invalidate_in_parent (GdkWindow *private) +gdk_surface_invalidate_in_parent (GdkSurface *private) { GdkRectangle r, child; - if (gdk_window_is_toplevel (private)) + if (gdk_surface_is_toplevel (private)) return; /* get the visible rectangle of the parent */ @@ -3275,43 +3275,43 @@ gdk_window_invalidate_in_parent (GdkWindow *private) child.height = private->height; gdk_rectangle_intersect (&r, &child, &r); - gdk_window_invalidate_rect_full (private->parent, &r, TRUE); + gdk_surface_invalidate_rect_full (private->parent, &r, TRUE); } /** - * gdk_window_lower: - * @window: a #GdkWindow + * gdk_surface_lower: + * @window: a #GdkSurface * * Lowers @window to the bottom of the Z-order (stacking order), so that * other windows with the same parent window appear above @window. * This is true whether or not the other windows are visible. * * If @window is a toplevel, the window manager may choose to deny the - * request to move the window in the Z-order, gdk_window_lower() only + * request to move the window in the Z-order, gdk_surface_lower() only * requests the restack, does not guarantee it. * - * Note that gdk_window_show() raises the window again, so don’t call this - * function before gdk_window_show(). (Try gdk_window_show_unraised().) + * Note that gdk_surface_show() raises the window again, so don’t call this + * function before gdk_surface_show(). (Try gdk_surface_show_unraised().) */ void -gdk_window_lower (GdkWindow *window) +gdk_surface_lower (GdkSurface *window) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); if (window->destroyed) return; /* Keep children in (reverse) stacking order */ - gdk_window_lower_internal (window); + gdk_surface_lower_internal (window); - gdk_window_invalidate_in_parent (window); + gdk_surface_invalidate_in_parent (window); } /** - * gdk_window_restack: - * @window: a #GdkWindow - * @sibling: (allow-none): a #GdkWindow that is a sibling of @window, or %NULL + * gdk_surface_restack: + * @window: a #GdkSurface + * @sibling: (allow-none): a #GdkSurface that is a sibling of @window, or %NULL * @above: a boolean * * Changes the position of @window in the Z-order (stacking order), so that @@ -3322,20 +3322,20 @@ gdk_window_lower (GdkWindow *window) * lowers the window. * * If @window is a toplevel, the window manager may choose to deny the - * request to move the window in the Z-order, gdk_window_restack() only + * request to move the window in the Z-order, gdk_surface_restack() only * requests the restack, does not guarantee it. */ void -gdk_window_restack (GdkWindow *window, - GdkWindow *sibling, +gdk_surface_restack (GdkSurface *window, + GdkSurface *sibling, gboolean above) { - GdkWindowImplClass *impl_class; - GdkWindow *parent; + GdkSurfaceImplClass *impl_class; + GdkSurface *parent; GList *sibling_link; - g_return_if_fail (GDK_IS_WINDOW (window)); - g_return_if_fail (sibling == NULL || GDK_IS_WINDOW (sibling)); + g_return_if_fail (GDK_IS_SURFACE (window)); + g_return_if_fail (sibling == NULL || GDK_IS_SURFACE (sibling)); if (window->destroyed) return; @@ -3343,16 +3343,16 @@ gdk_window_restack (GdkWindow *window, if (sibling == NULL) { if (above) - gdk_window_raise (window); + gdk_surface_raise (window); else - gdk_window_lower (window); + gdk_surface_lower (window); return; } - if (gdk_window_is_toplevel (window)) + if (gdk_surface_is_toplevel (window)) { - g_return_if_fail (gdk_window_is_toplevel (sibling)); - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + g_return_if_fail (gdk_surface_is_toplevel (sibling)); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); impl_class->restack_toplevel (window, sibling, above); return; } @@ -3376,33 +3376,33 @@ gdk_window_restack (GdkWindow *window, &window->children_list_node); } - gdk_window_invalidate_in_parent (window); + gdk_surface_invalidate_in_parent (window); } /** - * gdk_window_show: - * @window: a #GdkWindow + * gdk_surface_show: + * @window: a #GdkSurface * - * Like gdk_window_show_unraised(), but also raises the window to the + * Like gdk_surface_show_unraised(), but also raises the window to the * top of the window stack (moves the window to the front of the * Z-order). * * This function maps a window so it’s visible onscreen. Its opposite - * is gdk_window_hide(). + * is gdk_surface_hide(). * * When implementing a #GtkWidget, you should call this function on the widget's - * #GdkWindow as part of the “map” method. + * #GdkSurface as part of the “map” method. */ void -gdk_window_show (GdkWindow *window) +gdk_surface_show (GdkSurface *window) { - gdk_window_show_internal (window, TRUE); + gdk_surface_show_internal (window, TRUE); } /** - * gdk_window_hide: - * @window: a #GdkWindow + * gdk_surface_hide: + * @window: a #GdkSurface * * For toplevel windows, withdraws them, so they will no longer be * known to the window manager; for all windows, unmaps them, so @@ -3410,29 +3410,29 @@ gdk_window_show (GdkWindow *window) * part of gtk_widget_hide(). */ void -gdk_window_hide (GdkWindow *window) +gdk_surface_hide (GdkSurface *window) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; gboolean was_mapped, did_hide; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); if (window->destroyed) return; - was_mapped = GDK_WINDOW_IS_MAPPED (window); + was_mapped = GDK_SURFACE_IS_MAPPED (window); - if (gdk_window_has_impl (window)) + if (gdk_surface_has_impl (window)) { - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) gdk_synthesize_window_state (window, 0, - GDK_WINDOW_STATE_WITHDRAWN); + GDK_SURFACE_STATE_WITHDRAWN); } else if (was_mapped) { - window->state = GDK_WINDOW_STATE_WITHDRAWN; + window->state = GDK_SURFACE_STATE_WITHDRAWN; g_object_notify_by_pspec (G_OBJECT (window), properties[PROP_STATE]); } @@ -3443,7 +3443,7 @@ gdk_window_hide (GdkWindow *window) GList *devices, *d; /* May need to break grabs on children */ - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); seat = gdk_display_get_default_seat (display); devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL); @@ -3469,19 +3469,19 @@ G_GNUC_END_IGNORE_DEPRECATIONS g_list_free (devices); } - did_hide = _gdk_window_update_viewable (window); + did_hide = _gdk_surface_update_viewable (window); /* Hide foreign window as those are not handled by update_viewable. */ - if (gdk_window_has_impl (window) && (!did_hide)) + if (gdk_surface_has_impl (window) && (!did_hide)) { - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); impl_class->hide (window); } - gdk_window_clear_old_updated_area (window); + gdk_surface_clear_old_updated_area (window); recompute_visible_regions (window, FALSE); - if (was_mapped && !gdk_window_has_impl (window)) + if (was_mapped && !gdk_surface_has_impl (window)) { if (window->event_mask & GDK_STRUCTURE_MASK) _gdk_make_event (window, GDK_UNMAP, NULL, FALSE); @@ -3492,34 +3492,34 @@ G_GNUC_END_IGNORE_DEPRECATIONS /* Invalidate the rect */ if (was_mapped) - gdk_window_invalidate_in_parent (window); + gdk_surface_invalidate_in_parent (window); } /** - * gdk_window_withdraw: - * @window: a toplevel #GdkWindow + * gdk_surface_withdraw: + * @window: a toplevel #GdkSurface * * Withdraws a window (unmaps it and asks the window manager to forget about it). - * This function is not really useful as gdk_window_hide() automatically + * This function is not really useful as gdk_surface_hide() automatically * withdraws toplevel windows before hiding them. **/ void -gdk_window_withdraw (GdkWindow *window) +gdk_surface_withdraw (GdkSurface *window) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; gboolean was_mapped; GdkGLContext *current_context; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); if (window->destroyed) return; - was_mapped = GDK_WINDOW_IS_MAPPED (window); + was_mapped = GDK_SURFACE_IS_MAPPED (window); - if (gdk_window_has_impl (window)) + if (gdk_surface_has_impl (window)) { - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); impl_class->withdraw (window); if (was_mapped) @@ -3536,13 +3536,13 @@ gdk_window_withdraw (GdkWindow *window) gdk_gl_context_clear_current (); recompute_visible_regions (window, FALSE); - gdk_window_clear_old_updated_area (window); + gdk_surface_clear_old_updated_area (window); } } /** - * gdk_window_set_events: - * @window: a #GdkWindow + * gdk_surface_set_events: + * @window: a #GdkSurface * @event_mask: event mask for @window * * The event mask for a window determines which events will be reported @@ -3554,21 +3554,21 @@ gdk_window_withdraw (GdkWindow *window) * See the [input handling overview][event-masks] for details. **/ void -gdk_window_set_events (GdkWindow *window, +gdk_surface_set_events (GdkSurface *window, GdkEventMask event_mask) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); if (window->destroyed) return; window->event_mask = event_mask; - if (gdk_window_has_impl (window)) + if (gdk_surface_has_impl (window)) { - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); impl_class->set_events (window, get_native_event_mask (window)); } @@ -3576,18 +3576,18 @@ gdk_window_set_events (GdkWindow *window, } /** - * gdk_window_get_events: - * @window: a #GdkWindow + * gdk_surface_get_events: + * @window: a #GdkSurface * * Gets the event mask for @window for all master input devices. See - * gdk_window_set_events(). + * gdk_surface_set_events(). * * Returns: event mask for @window **/ GdkEventMask -gdk_window_get_events (GdkWindow *window) +gdk_surface_get_events (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), 0); + g_return_val_if_fail (GDK_IS_SURFACE (window), 0); if (window->destroyed) return 0; @@ -3596,8 +3596,8 @@ gdk_window_get_events (GdkWindow *window) } /** - * gdk_window_set_device_events: - * @window: a #GdkWindow + * gdk_surface_set_device_events: + * @window: a #GdkSurface * @device: #GdkDevice to enable events for. * @event_mask: event mask for @window * @@ -3610,17 +3610,17 @@ gdk_window_get_events (GdkWindow *window) * See the [input handling overview][event-masks] for details. **/ void -gdk_window_set_device_events (GdkWindow *window, +gdk_surface_set_device_events (GdkSurface *window, GdkDevice *device, GdkEventMask event_mask) { GdkEventMask device_mask; - GdkWindow *native; + GdkSurface *native; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); g_return_if_fail (GDK_IS_DEVICE (device)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (G_UNLIKELY (!window->device_events)) @@ -3637,15 +3637,15 @@ gdk_window_set_device_events (GdkWindow *window, g_hash_table_insert (window->device_events, device, GINT_TO_POINTER (event_mask)); - native = gdk_window_get_toplevel (window); + native = gdk_surface_get_toplevel (window); device_mask = get_native_device_event_mask (window, device); GDK_DEVICE_GET_CLASS (device)->select_window_events (device, native, device_mask); } /** - * gdk_window_get_device_events: - * @window: a #GdkWindow. + * gdk_surface_get_device_events: + * @window: a #GdkSurface. * @device: a #GdkDevice. * * Returns the event mask for @window corresponding to an specific device. @@ -3653,15 +3653,15 @@ gdk_window_set_device_events (GdkWindow *window, * Returns: device event mask for @window **/ GdkEventMask -gdk_window_get_device_events (GdkWindow *window, +gdk_surface_get_device_events (GdkSurface *window, GdkDevice *device) { GdkEventMask mask; - g_return_val_if_fail (GDK_IS_WINDOW (window), 0); + g_return_val_if_fail (GDK_IS_SURFACE (window), 0); g_return_val_if_fail (GDK_IS_DEVICE (device), 0); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return 0; if (!window->device_events) @@ -3675,7 +3675,7 @@ gdk_window_get_device_events (GdkWindow *window, } static void -gdk_window_move_resize_toplevel (GdkWindow *window, +gdk_surface_move_resize_toplevel (GdkSurface *window, gboolean with_move, gint x, gint y, @@ -3683,7 +3683,7 @@ gdk_window_move_resize_toplevel (GdkWindow *window, gint height) { cairo_region_t *old_region, *new_region; - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; gboolean expose; gboolean is_resize; @@ -3692,14 +3692,14 @@ gdk_window_move_resize_toplevel (GdkWindow *window, is_resize = (width != -1) || (height != -1); - if (gdk_window_is_viewable (window) && + if (gdk_surface_is_viewable (window) && !window->input_only) { expose = TRUE; old_region = cairo_region_copy (window->clip_region); } - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); impl_class->move_resize (window, with_move, x, y, width, height); /* Avoid recomputing for pure toplevel moves, for performance reasons */ @@ -3714,7 +3714,7 @@ gdk_window_move_resize_toplevel (GdkWindow *window, * X will expose it, but lets do that without the roundtrip */ cairo_region_subtract (new_region, old_region); - gdk_window_invalidate_region_full (window, new_region, TRUE); + gdk_surface_invalidate_region_full (window, new_region, TRUE); cairo_region_destroy (old_region); cairo_region_destroy (new_region); @@ -3723,7 +3723,7 @@ gdk_window_move_resize_toplevel (GdkWindow *window, static void -gdk_window_move_resize_internal (GdkWindow *window, +gdk_surface_move_resize_internal (GdkSurface *window, gboolean with_move, gint x, gint y, @@ -3733,14 +3733,14 @@ gdk_window_move_resize_internal (GdkWindow *window, cairo_region_t *old_region, *new_region; gboolean expose; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); if (window->destroyed) return; - if (gdk_window_is_toplevel (window)) + if (gdk_surface_is_toplevel (window)) { - gdk_window_move_resize_toplevel (window, with_move, x, y, width, height); + gdk_surface_move_resize_toplevel (window, with_move, x, y, width, height); return; } @@ -3762,7 +3762,7 @@ gdk_window_move_resize_internal (GdkWindow *window, expose = FALSE; old_region = NULL; - if (gdk_window_is_viewable (window) && + if (gdk_surface_is_viewable (window) && !window->input_only) { GdkRectangle r; @@ -3804,7 +3804,7 @@ gdk_window_move_resize_internal (GdkWindow *window, cairo_region_union (new_region, old_region); - gdk_window_invalidate_region_full (window->parent, new_region, TRUE); + gdk_surface_invalidate_region_full (window->parent, new_region, TRUE); cairo_region_destroy (old_region); cairo_region_destroy (new_region); @@ -3814,8 +3814,8 @@ gdk_window_move_resize_internal (GdkWindow *window, /** - * gdk_window_move: - * @window: a #GdkWindow + * gdk_surface_move: + * @window: a #GdkSurface * @x: X coordinate relative to window’s parent * @y: Y coordinate relative to window’s parent * @@ -3825,20 +3825,20 @@ gdk_window_move_resize_internal (GdkWindow *window, * anyway, instead of using GDK functions. For child windows, * the move will reliably succeed. * - * If you’re also planning to resize the window, use gdk_window_move_resize() + * If you’re also planning to resize the window, use gdk_surface_move_resize() * to both move and resize simultaneously, for a nicer visual effect. **/ void -gdk_window_move (GdkWindow *window, +gdk_surface_move (GdkSurface *window, gint x, gint y) { - gdk_window_move_resize_internal (window, TRUE, x, y, -1, -1); + gdk_surface_move_resize_internal (window, TRUE, x, y, -1, -1); } /** - * gdk_window_resize: - * @window: a #GdkWindow + * gdk_surface_resize: + * @window: a #GdkSurface * @width: new width of the window * @height: new height of the window * @@ -3848,44 +3848,44 @@ gdk_window_move (GdkWindow *window, * * Windows may not be resized below 1x1. * - * If you’re also planning to move the window, use gdk_window_move_resize() + * If you’re also planning to move the window, use gdk_surface_move_resize() * to both move and resize simultaneously, for a nicer visual effect. **/ void -gdk_window_resize (GdkWindow *window, +gdk_surface_resize (GdkSurface *window, gint width, gint height) { - gdk_window_move_resize_internal (window, FALSE, 0, 0, width, height); + gdk_surface_move_resize_internal (window, FALSE, 0, 0, width, height); } /** - * gdk_window_move_resize: - * @window: a #GdkWindow + * gdk_surface_move_resize: + * @window: a #GdkSurface * @x: new X position relative to window’s parent * @y: new Y position relative to window’s parent * @width: new width * @height: new height * - * Equivalent to calling gdk_window_move() and gdk_window_resize(), + * Equivalent to calling gdk_surface_move() and gdk_surface_resize(), * except that both operations are performed at once, avoiding strange * visual effects. (i.e. the user may be able to see the window first - * move, then resize, if you don’t use gdk_window_move_resize().) + * move, then resize, if you don’t use gdk_surface_move_resize().) **/ void -gdk_window_move_resize (GdkWindow *window, +gdk_surface_move_resize (GdkSurface *window, gint x, gint y, gint width, gint height) { - gdk_window_move_resize_internal (window, TRUE, x, y, width, height); + gdk_surface_move_resize_internal (window, TRUE, x, y, width, height); } /** - * gdk_window_move_to_rect: - * @window: the #GdkWindow to move + * gdk_surface_move_to_rect: + * @window: the #GdkSurface to move * @rect: (not nullable): the destination #GdkRectangle to align @window with * @rect_anchor: the point on @rect to align with @window's anchor point * @window_anchor: the point on @window to align with @rect's anchor point @@ -3907,13 +3907,13 @@ gdk_window_move_resize (GdkWindow *window, * %GDK_GRAVITY_NORTH_WEST with %GDK_GRAVITY_NORTH_EAST and vice versa if * @window extends beyond the left or right edges of the monitor. * - * Connect to the #GdkWindow::moved-to-rect signal to find out how it was + * Connect to the #GdkSurface::moved-to-rect signal to find out how it was * actually positioned. * * Stability: Private */ void -gdk_window_move_to_rect (GdkWindow *window, +gdk_surface_move_to_rect (GdkSurface *window, const GdkRectangle *rect, GdkGravity rect_anchor, GdkGravity window_anchor, @@ -3921,13 +3921,13 @@ gdk_window_move_to_rect (GdkWindow *window, gint rect_anchor_dx, gint rect_anchor_dy) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); g_return_if_fail (window->transient_for); g_return_if_fail (rect); - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); impl_class->move_to_rect (window, rect, rect_anchor, @@ -3938,8 +3938,8 @@ gdk_window_move_to_rect (GdkWindow *window, } /** - * gdk_window_scroll: - * @window: a #GdkWindow + * gdk_surface_scroll: + * @window: a #GdkSurface * @dx: Amount to scroll in the X direction * @dy: Amount to scroll in the Y direction * @@ -3956,13 +3956,13 @@ gdk_window_move_to_rect (GdkWindow *window, * artifacts and unnecessary invalidations. **/ void -gdk_window_scroll (GdkWindow *window, +gdk_surface_scroll (GdkSurface *window, gint dx, gint dy) { GList *tmp_list; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); if (dx == 0 && dy == 0) return; @@ -3975,7 +3975,7 @@ gdk_window_scroll (GdkWindow *window, tmp_list = window->children; while (tmp_list) { - GdkWindow *child = GDK_WINDOW (tmp_list->data); + GdkSurface *child = GDK_SURFACE (tmp_list->data); /* Just update the positions, the bits will move with the copy */ child->x += dx; @@ -3986,12 +3986,12 @@ gdk_window_scroll (GdkWindow *window, recompute_visible_regions (window, TRUE); - gdk_window_invalidate_rect_full (window, NULL, TRUE); + gdk_surface_invalidate_rect_full (window, NULL, TRUE); } /** - * gdk_window_move_region: - * @window: a #GdkWindow + * gdk_surface_move_region: + * @window: a #GdkSurface * @region: The #cairo_region_t to move * @dx: Amount to move in the X direction * @dy: Amount to move in the Y direction @@ -4003,14 +4003,14 @@ gdk_window_scroll (GdkWindow *window, * Child windows are not moved. */ void -gdk_window_move_region (GdkWindow *window, +gdk_surface_move_region (GdkSurface *window, const cairo_region_t *region, gint dx, gint dy) { cairo_region_t *expose_area; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); g_return_if_fail (region != NULL); if (dx == 0 && dy == 0) @@ -4023,82 +4023,82 @@ gdk_window_move_region (GdkWindow *window, cairo_region_translate (expose_area, dx, dy); cairo_region_union (expose_area, region); - gdk_window_invalidate_region_full (window, expose_area, FALSE); + gdk_surface_invalidate_region_full (window, expose_area, FALSE); cairo_region_destroy (expose_area); } static void -gdk_window_set_cursor_internal (GdkWindow *window, +gdk_surface_set_cursor_internal (GdkSurface *window, GdkDevice *device, GdkCursor *cursor) { - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - g_assert (gdk_window_get_display (window) == gdk_device_get_display (device)); + g_assert (gdk_surface_get_display (window) == gdk_device_get_display (device)); - if (window->window_type == GDK_WINDOW_ROOT || - window->window_type == GDK_WINDOW_FOREIGN) + if (window->window_type == GDK_SURFACE_ROOT || + window->window_type == GDK_SURFACE_FOREIGN) GDK_DEVICE_GET_CLASS (device)->set_window_cursor (device, window, cursor); else { - GdkPointerWindowInfo *pointer_info; + GdkPointerSurfaceInfo *pointer_info; GdkDisplay *display; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); pointer_info = _gdk_display_get_pointer_info (display, device); - if (_gdk_window_event_parent_of (window, pointer_info->window_under_pointer)) + if (_gdk_surface_event_parent_of (window, pointer_info->window_under_pointer)) update_cursor (display, device); } } /** - * gdk_window_get_cursor: - * @window: a #GdkWindow + * gdk_surface_get_cursor: + * @window: a #GdkSurface * * Retrieves a #GdkCursor pointer for the cursor currently set on the - * specified #GdkWindow, or %NULL. If the return value is %NULL then + * specified #GdkSurface, or %NULL. If the return value is %NULL then * there is no custom cursor set on the specified window, and it is * using the cursor for its parent window. * * Returns: (nullable) (transfer none): a #GdkCursor, or %NULL. The - * returned object is owned by the #GdkWindow and should not be - * unreferenced directly. Use gdk_window_set_cursor() to unset the + * returned object is owned by the #GdkSurface and should not be + * unreferenced directly. Use gdk_surface_set_cursor() to unset the * cursor of the window */ GdkCursor * -gdk_window_get_cursor (GdkWindow *window) +gdk_surface_get_cursor (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); return window->cursor; } /** - * gdk_window_set_cursor: - * @window: a #GdkWindow + * gdk_surface_set_cursor: + * @window: a #GdkSurface * @cursor: (allow-none): a cursor * - * Sets the default mouse pointer for a #GdkWindow. + * Sets the default mouse pointer for a #GdkSurface. * * Note that @cursor must be for the same display as @window. * * Use gdk_cursor_new_for_display() or gdk_cursor_new_from_texture() to * create the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR. - * Passing %NULL for the @cursor argument to gdk_window_set_cursor() means + * Passing %NULL for the @cursor argument to gdk_surface_set_cursor() means * that @window will use the cursor of its parent window. Most windows * should use this default. */ void -gdk_window_set_cursor (GdkWindow *window, +gdk_surface_set_cursor (GdkSurface *window, GdkCursor *cursor) { GdkDisplay *display; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); if (window->cursor) { @@ -4106,7 +4106,7 @@ gdk_window_set_cursor (GdkWindow *window, window->cursor = NULL; } - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { GdkDevice *device; GList *seats, *s; @@ -4121,13 +4121,13 @@ gdk_window_set_cursor (GdkWindow *window, GList *devices, *d; device = gdk_seat_get_pointer (s->data); - gdk_window_set_cursor_internal (window, device, window->cursor); + gdk_surface_set_cursor_internal (window, device, window->cursor); devices = gdk_seat_get_slaves (s->data, GDK_SEAT_CAPABILITY_TABLET_STYLUS); for (d = devices; d; d = d->next) { device = gdk_device_get_associated_device (d->data); - gdk_window_set_cursor_internal (window, device, window->cursor); + gdk_surface_set_cursor_internal (window, device, window->cursor); } g_list_free (devices); } @@ -4138,25 +4138,25 @@ gdk_window_set_cursor (GdkWindow *window, } /** - * gdk_window_get_device_cursor: - * @window: a #GdkWindow. + * gdk_surface_get_device_cursor: + * @window: a #GdkSurface. * @device: a master, pointer #GdkDevice. * * Retrieves a #GdkCursor pointer for the @device currently set on the - * specified #GdkWindow, or %NULL. If the return value is %NULL then + * specified #GdkSurface, or %NULL. If the return value is %NULL then * there is no custom cursor set on the specified window, and it is * using the cursor for its parent window. * * Returns: (nullable) (transfer none): a #GdkCursor, or %NULL. The - * returned object is owned by the #GdkWindow and should not be - * unreferenced directly. Use gdk_window_set_cursor() to unset the + * returned object is owned by the #GdkSurface and should not be + * unreferenced directly. Use gdk_surface_set_cursor() to unset the * cursor of the window **/ GdkCursor * -gdk_window_get_device_cursor (GdkWindow *window, +gdk_surface_get_device_cursor (GdkSurface *window, GdkDevice *device) { - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), 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_device_type (device) == GDK_DEVICE_TYPE_MASTER, NULL); @@ -4165,24 +4165,24 @@ gdk_window_get_device_cursor (GdkWindow *window, } /** - * gdk_window_set_device_cursor: - * @window: a #GdkWindow + * gdk_surface_set_device_cursor: + * @window: a #GdkSurface * @device: a master, pointer #GdkDevice * @cursor: a #GdkCursor * * Sets a specific #GdkCursor for a given device when it gets inside @window. * Use gdk_cursor_new_for_display() or gdk_cursor_new_from_texture() to create * the cursor. To make the cursor invisible, use %GDK_BLANK_CURSOR. Passing - * %NULL for the @cursor argument to gdk_window_set_cursor() means that + * %NULL for the @cursor argument to gdk_surface_set_cursor() means that * @window will use the cursor of its parent window. Most windows should * use this default. **/ void -gdk_window_set_device_cursor (GdkWindow *window, +gdk_surface_set_device_cursor (GdkSurface *window, GdkDevice *device, GdkCursor *cursor) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); 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_device_type (device) == GDK_DEVICE_TYPE_MASTER); @@ -4192,12 +4192,12 @@ gdk_window_set_device_cursor (GdkWindow *window, else g_hash_table_replace (window->device_cursor, device, g_object_ref (cursor)); - gdk_window_set_cursor_internal (window, device, cursor); + gdk_surface_set_cursor_internal (window, device, cursor); } /** - * gdk_window_get_geometry: - * @window: a #GdkWindow + * gdk_surface_get_geometry: + * @window: a #GdkSurface * @x: (out) (allow-none): return location for X coordinate of window (relative to its parent) * @y: (out) (allow-none): return location for Y coordinate of window (relative to its parent) * @width: (out) (allow-none): return location for width of window @@ -4214,39 +4214,39 @@ gdk_window_set_device_cursor (GdkWindow *window, * On the X11 platform, the geometry is obtained from the X server, * so reflects the latest position of @window; this may be out-of-sync * with the position of @window delivered in the most-recently-processed - * #GdkEventConfigure. gdk_window_get_position() in contrast gets the + * #GdkEventConfigure. gdk_surface_get_position() in contrast gets the * position from the most recent configure event. * * Note: If @window is not a toplevel, it is much better - * to call gdk_window_get_position(), gdk_window_get_width() and - * gdk_window_get_height() instead, because it avoids the roundtrip to + * to call gdk_surface_get_position(), gdk_surface_get_width() and + * gdk_surface_get_height() instead, because it avoids the roundtrip to * the X server and because these functions support the full 32-bit - * coordinate space, whereas gdk_window_get_geometry() is restricted to + * coordinate space, whereas gdk_surface_get_geometry() is restricted to * the 16-bit coordinates of X11. */ void -gdk_window_get_geometry (GdkWindow *window, +gdk_surface_get_geometry (GdkSurface *window, gint *x, gint *y, gint *width, gint *height) { - GdkWindow *parent; - GdkWindowImplClass *impl_class; + GdkSurface *parent; + GdkSurfaceImplClass *impl_class; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { - if (gdk_window_has_impl (window)) + if (gdk_surface_has_impl (window)) { - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); impl_class->get_geometry (window, x, y, width, height); /* This reports the position wrt to the native parent, we need to convert it to be relative to the client side parent */ parent = window->parent; - if (parent && !gdk_window_has_impl (parent)) + if (parent && !gdk_surface_has_impl (parent)) { if (x) *x -= parent->abs_x; @@ -4269,8 +4269,8 @@ gdk_window_get_geometry (GdkWindow *window, } /** - * gdk_window_get_width: - * @window: a #GdkWindow + * gdk_surface_get_width: + * @window: a #GdkSurface * * Returns the width of the given @window. * @@ -4281,16 +4281,16 @@ gdk_window_get_geometry (GdkWindow *window, * Returns: The width of @window */ int -gdk_window_get_width (GdkWindow *window) +gdk_surface_get_width (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), 0); + g_return_val_if_fail (GDK_IS_SURFACE (window), 0); return window->width; } /** - * gdk_window_get_height: - * @window: a #GdkWindow + * gdk_surface_get_height: + * @window: a #GdkSurface * * Returns the height of the given @window. * @@ -4301,36 +4301,36 @@ gdk_window_get_width (GdkWindow *window) * Returns: The height of @window */ int -gdk_window_get_height (GdkWindow *window) +gdk_surface_get_height (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), 0); + g_return_val_if_fail (GDK_IS_SURFACE (window), 0); return window->height; } /** - * gdk_window_get_origin: - * @window: a #GdkWindow + * gdk_surface_get_origin: + * @window: a #GdkSurface * @x: (out) (allow-none): return location for X coordinate * @y: (out) (allow-none): return location for Y coordinate * * Obtains the position of a window in root window coordinates. - * (Compare with gdk_window_get_position() and - * gdk_window_get_geometry() which return the position of a window + * (Compare with gdk_surface_get_position() and + * gdk_surface_get_geometry() which return the position of a window * relative to its parent window.) * * Returns: not meaningful, ignore */ gint -gdk_window_get_origin (GdkWindow *window, +gdk_surface_get_origin (GdkSurface *window, gint *x, gint *y) { gint dummy_x, dummy_y; - g_return_val_if_fail (GDK_IS_WINDOW (window), 0); + g_return_val_if_fail (GDK_IS_SURFACE (window), 0); - gdk_window_get_root_coords (window, + gdk_surface_get_root_coords (window, 0, 0, x ? x : &dummy_x, y ? y : &dummy_y); @@ -4339,8 +4339,8 @@ gdk_window_get_origin (GdkWindow *window, } /** - * gdk_window_get_root_coords: - * @window: a #GdkWindow + * gdk_surface_get_root_coords: + * @window: a #GdkSurface * @x: X coordinate in window * @y: Y coordinate in window * @root_x: (out): return location for X coordinate @@ -4348,28 +4348,28 @@ gdk_window_get_origin (GdkWindow *window, * * Obtains the position of a window position in root * window coordinates. This is similar to - * gdk_window_get_origin() but allows you to pass + * gdk_surface_get_origin() but allows you to pass * in any position in the window, not just the origin. */ void -gdk_window_get_root_coords (GdkWindow *window, +gdk_surface_get_root_coords (GdkSurface *window, gint x, gint y, gint *root_x, gint *root_y) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) { *root_x = 0; *root_y = 0; return; } - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); impl_class->get_root_coords (window->impl_window, x + window->abs_x, y + window->abs_y, @@ -4377,7 +4377,7 @@ gdk_window_get_root_coords (GdkWindow *window, } /** - * gdk_window_coords_to_parent: + * gdk_surface_coords_to_parent: * @window: a child window * @x: X coordinate in child’s coordinate system * @y: Y coordinate in child’s coordinate system @@ -4388,18 +4388,18 @@ gdk_window_get_root_coords (GdkWindow *window, * * Transforms window coordinates from a child window to its parent * window. Calling this function is equivalent to adding the return - * values of gdk_window_get_position() to the child coordinates. + * values of gdk_surface_get_position() to the child coordinates. * - * See also: gdk_window_coords_from_parent() + * See also: gdk_surface_coords_from_parent() **/ void -gdk_window_coords_to_parent (GdkWindow *window, +gdk_surface_coords_to_parent (GdkSurface *window, gdouble x, gdouble y, gdouble *parent_x, gdouble *parent_y) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); if (parent_x) *parent_x = x + window->x; @@ -4409,7 +4409,7 @@ gdk_window_coords_to_parent (GdkWindow *window, } /** - * gdk_window_coords_from_parent: + * gdk_surface_coords_from_parent: * @window: a child window * @parent_x: X coordinate in parent’s coordinate system * @parent_y: Y coordinate in parent’s coordinate system @@ -4420,18 +4420,18 @@ gdk_window_coords_to_parent (GdkWindow *window, * window. * * Calling this function is equivalent to subtracting the return - * values of gdk_window_get_position() from the parent coordinates. + * values of gdk_surface_get_position() from the parent coordinates. * - * See also: gdk_window_coords_to_parent() + * See also: gdk_surface_coords_to_parent() **/ void -gdk_window_coords_from_parent (GdkWindow *window, +gdk_surface_coords_from_parent (GdkSurface *window, gdouble parent_x, gdouble parent_y, gdouble *x, gdouble *y) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); if (x) *x = parent_x - window->x; @@ -4441,8 +4441,8 @@ gdk_window_coords_from_parent (GdkWindow *window, } /** - * gdk_window_shape_combine_region: - * @window: a #GdkWindow + * gdk_surface_shape_combine_region: + * @window: a #GdkSurface * @shape_region: (allow-none): region of window to be non-transparent * @offset_x: X position of @shape_region in @window coordinates * @offset_y: Y position of @shape_region in @window coordinates @@ -4463,16 +4463,16 @@ gdk_window_coords_from_parent (GdkWindow *window, * This function works on both toplevel and child windows. */ void -gdk_window_shape_combine_region (GdkWindow *window, +gdk_surface_shape_combine_region (GdkSurface *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y) { cairo_region_t *old_region, *new_region, *diff; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (!window->shape && shape_region == NULL) @@ -4484,7 +4484,7 @@ gdk_window_shape_combine_region (GdkWindow *window, cairo_region_destroy (window->shape); old_region = NULL; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) old_region = cairo_region_copy (window->clip_region); if (shape_region) @@ -4505,11 +4505,11 @@ gdk_window_shape_combine_region (GdkWindow *window, diff = cairo_region_copy (new_region); cairo_region_subtract (diff, old_region); - gdk_window_invalidate_region_full (window, diff, TRUE); + gdk_surface_invalidate_region_full (window, diff, TRUE); cairo_region_destroy (diff); - if (!gdk_window_is_toplevel (window)) + if (!gdk_surface_is_toplevel (window)) { /* New area in the non-root parent window, needs invalidation */ diff = cairo_region_copy (old_region); @@ -4518,7 +4518,7 @@ gdk_window_shape_combine_region (GdkWindow *window, /* Adjust region to parent window coords */ cairo_region_translate (diff, window->x, window->y); - gdk_window_invalidate_region_full (window->parent, diff, TRUE); + gdk_surface_invalidate_region_full (window->parent, diff, TRUE); cairo_region_destroy (diff); } @@ -4529,7 +4529,7 @@ gdk_window_shape_combine_region (GdkWindow *window, } static void -do_child_shapes (GdkWindow *window, +do_child_shapes (GdkSurface *window, gboolean merge) { GdkRectangle r; @@ -4548,57 +4548,57 @@ do_child_shapes (GdkWindow *window, cairo_region_xor_rectangle (region, &r); - gdk_window_shape_combine_region (window, region, 0, 0); + gdk_surface_shape_combine_region (window, region, 0, 0); cairo_region_destroy (region); } /** - * gdk_window_set_child_shapes: - * @window: a #GdkWindow + * gdk_surface_set_child_shapes: + * @window: a #GdkSurface * * Sets the shape mask of @window to the union of shape masks * for all children of @window, ignoring the shape mask of @window - * itself. Contrast with gdk_window_merge_child_shapes() which includes + * itself. Contrast with gdk_surface_merge_child_shapes() which includes * the shape mask of @window in the masks to be merged. **/ void -gdk_window_set_child_shapes (GdkWindow *window) +gdk_surface_set_child_shapes (GdkSurface *window) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); do_child_shapes (window, FALSE); } /** - * gdk_window_merge_child_shapes: - * @window: a #GdkWindow + * gdk_surface_merge_child_shapes: + * @window: a #GdkSurface * * Merges the shape masks for any child windows into the * shape mask for @window. i.e. the union of all masks * for @window and its children will become the new mask - * for @window. See gdk_window_shape_combine_region(). + * for @window. See gdk_surface_shape_combine_region(). * - * This function is distinct from gdk_window_set_child_shapes() + * This function is distinct from gdk_surface_set_child_shapes() * because it includes @window’s shape mask in the set of shapes to * be merged. */ void -gdk_window_merge_child_shapes (GdkWindow *window) +gdk_surface_merge_child_shapes (GdkSurface *window) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); do_child_shapes (window, TRUE); } /** - * gdk_window_input_shape_combine_region: - * @window: a #GdkWindow + * gdk_surface_input_shape_combine_region: + * @window: a #GdkSurface * @shape_region: region of window to be non-transparent * @offset_x: X position of @shape_region in @window coordinates * @offset_y: Y position of @shape_region in @window coordinates * - * Like gdk_window_shape_combine_region(), but the shape applies + * Like gdk_surface_shape_combine_region(), but the shape applies * only to event handling. Mouse events which happen while * the pointer position corresponds to an unset bit in the * mask will be passed on the window below @window. @@ -4616,16 +4616,16 @@ gdk_window_merge_child_shapes (GdkWindow *window) * function does nothing. */ void -gdk_window_input_shape_combine_region (GdkWindow *window, +gdk_surface_input_shape_combine_region (GdkSurface *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (window->input_shape) @@ -4639,15 +4639,15 @@ gdk_window_input_shape_combine_region (GdkWindow *window, else window->input_shape = NULL; - if (gdk_window_has_impl (window)) + if (gdk_surface_has_impl (window)) { - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); impl_class->input_shape_combine_region (window, window->input_shape, 0, 0); } } static void -do_child_input_shapes (GdkWindow *window, +do_child_input_shapes (GdkSurface *window, gboolean merge) { GdkRectangle r; @@ -4668,30 +4668,30 @@ do_child_input_shapes (GdkWindow *window, cairo_region_xor_rectangle (region, &r); - gdk_window_input_shape_combine_region (window, region, 0, 0); + gdk_surface_input_shape_combine_region (window, region, 0, 0); } /** - * gdk_window_set_child_input_shapes: - * @window: a #GdkWindow + * gdk_surface_set_child_input_shapes: + * @window: a #GdkSurface * * Sets the input shape mask of @window to the union of input shape masks * for all children of @window, ignoring the input shape mask of @window - * itself. Contrast with gdk_window_merge_child_input_shapes() which includes + * itself. Contrast with gdk_surface_merge_child_input_shapes() which includes * the input shape mask of @window in the masks to be merged. **/ void -gdk_window_set_child_input_shapes (GdkWindow *window) +gdk_surface_set_child_input_shapes (GdkSurface *window) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); do_child_input_shapes (window, FALSE); } /** - * gdk_window_set_pass_through: - * @window: a #GdkWindow + * gdk_surface_set_pass_through: + * @window: a #GdkSurface * @pass_through: a boolean * * Sets whether input to the window is passed through to the window @@ -4714,56 +4714,56 @@ gdk_window_set_child_input_shapes (GdkWindow *window) * enter/leave events on its way to the destination window. **/ void -gdk_window_set_pass_through (GdkWindow *window, +gdk_surface_set_pass_through (GdkSurface *window, gboolean pass_through) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); window->pass_through = !!pass_through; } /** - * gdk_window_get_pass_through: - * @window: a #GdkWindow + * gdk_surface_get_pass_through: + * @window: a #GdkSurface * * Returns whether input to the window is passed through to the window * below. * - * See gdk_window_set_pass_through() for details + * See gdk_surface_set_pass_through() for details **/ gboolean -gdk_window_get_pass_through (GdkWindow *window) +gdk_surface_get_pass_through (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); return window->pass_through; } /** - * gdk_window_merge_child_input_shapes: - * @window: a #GdkWindow + * gdk_surface_merge_child_input_shapes: + * @window: a #GdkSurface * * Merges the input shape masks for any child windows into the * input shape mask for @window. i.e. the union of all input masks * for @window and its children will become the new input mask - * for @window. See gdk_window_input_shape_combine_region(). + * for @window. See gdk_surface_input_shape_combine_region(). * - * This function is distinct from gdk_window_set_child_input_shapes() + * This function is distinct from gdk_surface_set_child_input_shapes() * because it includes @window’s input shape mask in the set of * shapes to be merged. **/ void -gdk_window_merge_child_input_shapes (GdkWindow *window) +gdk_surface_merge_child_input_shapes (GdkSurface *window) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); do_child_input_shapes (window, TRUE); } /** - * gdk_window_get_modal_hint: - * @window: A toplevel #GdkWindow. + * gdk_surface_get_modal_hint: + * @window: A toplevel #GdkSurface. * * Determines whether or not the window manager is hinted that @window * has modal behaviour. @@ -4771,16 +4771,16 @@ gdk_window_merge_child_input_shapes (GdkWindow *window) * Returns: whether or not the window has the modal hint set. */ gboolean -gdk_window_get_modal_hint (GdkWindow *window) +gdk_surface_get_modal_hint (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); return window->modal_hint; } /** - * gdk_window_get_accept_focus: - * @window: a toplevel #GdkWindow. + * gdk_surface_get_accept_focus: + * @window: a toplevel #GdkSurface. * * Determines whether or not the desktop environment shuld be hinted that * the window does not want to receive input focus. @@ -4788,16 +4788,16 @@ gdk_window_get_modal_hint (GdkWindow *window) * Returns: whether or not the window should receive input focus. */ gboolean -gdk_window_get_accept_focus (GdkWindow *window) +gdk_surface_get_accept_focus (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); return window->accept_focus; } /** - * gdk_window_get_focus_on_map: - * @window: a toplevel #GdkWindow. + * gdk_surface_get_focus_on_map: + * @window: a toplevel #GdkSurface. * * Determines whether or not the desktop environment should be hinted that the * window does not want to receive input focus when it is mapped. @@ -4806,41 +4806,41 @@ gdk_window_get_accept_focus (GdkWindow *window) * it is mapped. */ gboolean -gdk_window_get_focus_on_map (GdkWindow *window) +gdk_surface_get_focus_on_map (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); return window->focus_on_map; } /** - * gdk_window_is_input_only: - * @window: a toplevel #GdkWindow + * gdk_surface_is_input_only: + * @window: a toplevel #GdkSurface * * Determines whether or not the window is an input only window. * * Returns: %TRUE if @window is input only */ gboolean -gdk_window_is_input_only (GdkWindow *window) +gdk_surface_is_input_only (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); return window->input_only; } /** - * gdk_window_is_shaped: - * @window: a toplevel #GdkWindow + * gdk_surface_is_shaped: + * @window: a toplevel #GdkSurface * * Determines whether or not the window is shaped. * * Returns: %TRUE if @window is shaped */ gboolean -gdk_window_is_shaped (GdkWindow *window) +gdk_surface_is_shaped (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); return window->shaped; } @@ -4848,23 +4848,23 @@ gdk_window_is_shaped (GdkWindow *window) /* Gets the toplevel for a window as used for events, i.e. including offscreen parents going up to the native toplevel */ -static GdkWindow * -get_event_toplevel (GdkWindow *window) +static GdkSurface * +get_event_toplevel (GdkSurface *window) { - GdkWindow *parent; + GdkSurface *parent; while ((parent = window->parent) != NULL && - (parent->window_type != GDK_WINDOW_ROOT)) + (parent->window_type != GDK_SURFACE_ROOT)) window = parent; return window; } gboolean -_gdk_window_event_parent_of (GdkWindow *parent, - GdkWindow *child) +_gdk_surface_event_parent_of (GdkSurface *parent, + GdkSurface *child) { - GdkWindow *w; + GdkSurface *w; w = child; while (w != NULL) @@ -4882,9 +4882,9 @@ static void update_cursor (GdkDisplay *display, GdkDevice *device) { - GdkWindow *cursor_window, *parent, *toplevel; - GdkWindow *pointer_window; - GdkPointerWindowInfo *pointer_info; + GdkSurface *cursor_window, *parent, *toplevel; + GdkSurface *pointer_window; + GdkPointerSurfaceInfo *pointer_info; GdkDeviceGrabInfo *grab; GdkCursor *cursor; @@ -4897,7 +4897,7 @@ update_cursor (GdkDisplay *display, if (/* have grab */ grab != NULL && /* the pointer is not in a descendant of the grab window */ - !_gdk_window_event_parent_of (grab->window, pointer_window)) + !_gdk_surface_event_parent_of (grab->window, pointer_window)) { /* use the cursor from the grab window */ cursor_window = grab->window; @@ -4913,7 +4913,7 @@ update_cursor (GdkDisplay *display, while (cursor_window->cursor == NULL && !g_hash_table_contains (cursor_window->device_cursor, device) && (parent = cursor_window->parent) != NULL && - parent->window_type != GDK_WINDOW_ROOT) + parent->window_type != GDK_SURFACE_ROOT) cursor_window = parent; cursor = g_hash_table_lookup (cursor_window->device_cursor, device); @@ -4928,7 +4928,7 @@ update_cursor (GdkDisplay *display, } static gboolean -point_in_window (GdkWindow *window, +point_in_window (GdkSurface *window, gdouble x, gdouble y) { @@ -4946,14 +4946,14 @@ point_in_window (GdkWindow *window, /* Same as point_in_window, except it also takes pass_through and its interaction with child windows into account */ static gboolean -point_in_input_window (GdkWindow *window, +point_in_input_window (GdkSurface *window, gdouble x, gdouble y, - GdkWindow **input_window, + GdkSurface **input_window, gdouble *input_window_x, gdouble *input_window_y) { - GdkWindow *sub; + GdkSurface *sub; double child_x, child_y; GList *l; @@ -4978,17 +4978,17 @@ point_in_input_window (GdkWindow *window, { sub = l->data; - if (!GDK_WINDOW_IS_MAPPED (sub)) + if (!GDK_SURFACE_IS_MAPPED (sub)) continue; - gdk_window_coords_from_parent ((GdkWindow *)sub, + gdk_surface_coords_from_parent ((GdkSurface *)sub, x, y, &child_x, &child_y); if (point_in_input_window (sub, child_x, child_y, input_window, input_window_x, input_window_y)) { if (input_window) - gdk_window_coords_to_parent (sub, + gdk_surface_coords_to_parent (sub, *input_window_x, *input_window_y, input_window_x, @@ -5000,12 +5000,12 @@ point_in_input_window (GdkWindow *window, return FALSE; } -GdkWindow * -_gdk_window_find_child_at (GdkWindow *window, +GdkSurface * +_gdk_surface_find_child_at (GdkSurface *window, double x, double y) { - GdkWindow *sub; + GdkSurface *sub; double child_x, child_y; GList *l; @@ -5016,29 +5016,29 @@ _gdk_window_find_child_at (GdkWindow *window, { sub = l->data; - if (!GDK_WINDOW_IS_MAPPED (sub)) + if (!GDK_SURFACE_IS_MAPPED (sub)) continue; - gdk_window_coords_from_parent ((GdkWindow *)sub, + gdk_surface_coords_from_parent ((GdkSurface *)sub, x, y, &child_x, &child_y); if (point_in_input_window (sub, child_x, child_y, NULL, NULL, NULL)) - return (GdkWindow *)sub; + return (GdkSurface *)sub; } } return NULL; } -GdkWindow * -_gdk_window_find_descendant_at (GdkWindow *window, +GdkSurface * +_gdk_surface_find_descendant_at (GdkSurface *window, gdouble x, gdouble y, gdouble *found_x, gdouble *found_y) { - GdkWindow *sub, *input_window; + GdkSurface *sub, *input_window; gdouble child_x, child_y; GList *l; gboolean found; @@ -5053,10 +5053,10 @@ _gdk_window_find_descendant_at (GdkWindow *window, { sub = l->data; - if (!GDK_WINDOW_IS_MAPPED (sub)) + if (!GDK_SURFACE_IS_MAPPED (sub)) continue; - gdk_window_coords_from_parent ((GdkWindow *)sub, + gdk_surface_coords_from_parent ((GdkSurface *)sub, x, y, &child_x, &child_y); if (point_in_input_window (sub, child_x, child_y, @@ -5087,30 +5087,30 @@ _gdk_window_find_descendant_at (GdkWindow *window, } /** - * gdk_window_beep: - * @window: a toplevel #GdkWindow + * gdk_surface_beep: + * @window: a toplevel #GdkSurface * * Emits a short beep associated to @window in the appropriate * display, if supported. Otherwise, emits a short beep on * the display just as gdk_display_beep(). **/ void -gdk_window_beep (GdkWindow *window) +gdk_surface_beep (GdkSurface *window) { GdkDisplay *display; - GdkWindow *toplevel; + GdkSurface *toplevel; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; toplevel = get_event_toplevel (window); - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); if (toplevel) { - if (GDK_WINDOW_IMPL_GET_CLASS (toplevel->impl)->beep (toplevel)) + if (GDK_SURFACE_IMPL_GET_CLASS (toplevel->impl)->beep (toplevel)) return; } @@ -5119,8 +5119,8 @@ gdk_window_beep (GdkWindow *window) } /** - * gdk_window_set_support_multidevice: - * @window: a #GdkWindow. + * gdk_surface_set_support_multidevice: + * @window: a #GdkSurface. * @support_multidevice: %TRUE to enable multidevice support in @window. * * This function will enable multidevice features in @window. @@ -5129,12 +5129,12 @@ gdk_window_beep (GdkWindow *window) * per device enter/leave events, device grabs and grab ownerships. **/ void -gdk_window_set_support_multidevice (GdkWindow *window, +gdk_surface_set_support_multidevice (GdkSurface *window, gboolean support_multidevice) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (window->support_multidevice == support_multidevice) @@ -5146,8 +5146,8 @@ gdk_window_set_support_multidevice (GdkWindow *window, } /** - * gdk_window_get_support_multidevice: - * @window: a #GdkWindow. + * gdk_surface_get_support_multidevice: + * @window: a #GdkSurface. * * Returns %TRUE if the window is aware of the existence of multiple * devices. @@ -5155,11 +5155,11 @@ gdk_window_set_support_multidevice (GdkWindow *window, * Returns: %TRUE if the window handles multidevice features. **/ gboolean -gdk_window_get_support_multidevice (GdkWindow *window) +gdk_surface_get_support_multidevice (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return FALSE; return window->support_multidevice; @@ -5168,7 +5168,7 @@ gdk_window_get_support_multidevice (GdkWindow *window) /* send motion events if the right buttons are down */ GdkEvent * -_gdk_make_event (GdkWindow *window, +_gdk_make_event (GdkSurface *window, GdkEventType type, GdkEvent *event_in_queue, gboolean before_event) @@ -5262,12 +5262,12 @@ _gdk_make_event (GdkWindow *window, if (event_in_queue) { if (before_event) - _gdk_event_queue_insert_before (gdk_window_get_display (window), event_in_queue, event); + _gdk_event_queue_insert_before (gdk_surface_get_display (window), event_in_queue, event); else - _gdk_event_queue_insert_after (gdk_window_get_display (window), event_in_queue, event); + _gdk_event_queue_insert_after (gdk_surface_get_display (window), event_in_queue, event); } else - _gdk_event_queue_append (gdk_window_get_display (window), event); + _gdk_event_queue_append (gdk_surface_get_display (window), event); return event; } @@ -5275,9 +5275,9 @@ _gdk_make_event (GdkWindow *window, void _gdk_display_set_window_under_pointer (GdkDisplay *display, GdkDevice *device, - GdkWindow *window) + GdkSurface *window) { - GdkPointerWindowInfo *device_info; + GdkPointerSurfaceInfo *device_info; device_info = _gdk_display_get_pointer_info (display, device); @@ -5305,7 +5305,7 @@ _gdk_display_set_window_under_pointer (GdkDisplay *display, #endif static void -gdk_window_print (GdkWindow *window, +gdk_surface_print (GdkSurface *window, int indent) { char *s; @@ -5325,14 +5325,14 @@ gdk_window_print (GdkWindow *window, window->width, window->height ); - if (gdk_window_has_impl (window)) + if (gdk_surface_has_impl (window)) { #ifdef GDK_WINDOWING_X11 - g_print (" impl(0x%lx)", gdk_x11_window_get_xid (window)); + g_print (" impl(0x%lx)", gdk_x11_surface_get_xid (window)); #endif } - if (window->window_type != GDK_WINDOW_CHILD) + if (window->window_type != GDK_SURFACE_CHILD) g_print (" %s", window_types[window->window_type]); if (window->input_only) @@ -5341,7 +5341,7 @@ gdk_window_print (GdkWindow *window, if (window->shaped) g_print (" shaped"); - if (!gdk_window_is_visible ((GdkWindow *)window)) + if (!gdk_surface_is_visible ((GdkSurface *)window)) g_print (" hidden"); g_print (" abs[%d,%d]", @@ -5359,7 +5359,7 @@ gdk_window_print (GdkWindow *window, static void -gdk_window_print_tree (GdkWindow *window, +gdk_surface_print_tree (GdkSurface *window, int indent, gboolean include_input_only) { @@ -5368,10 +5368,10 @@ gdk_window_print_tree (GdkWindow *window, if (window->input_only && !include_input_only) return; - gdk_window_print (window, indent); + gdk_surface_print (window, indent); for (l = window->children; l != NULL; l = l->next) - gdk_window_print_tree (l->data, indent + 4, include_input_only); + gdk_surface_print_tree (l->data, indent + 4, include_input_only); } #endif /* DEBUG_WINDOW_PRINTING */ @@ -5382,10 +5382,10 @@ _gdk_windowing_got_event (GdkDisplay *display, GdkEvent *event, gulong serial) { - GdkWindow *event_window; + GdkSurface *event_window; gboolean unlink_event = FALSE; GdkDeviceGrabInfo *button_release_grab; - GdkPointerWindowInfo *pointer_info = NULL; + GdkPointerSurfaceInfo *pointer_info = NULL; GdkDevice *device, *source_device; _gdk_display_update_last_event (display, event); @@ -5429,11 +5429,11 @@ _gdk_windowing_got_event (GdkDisplay *display, (event->key.keyval == 0xa7 || event->key.keyval == 0xbd)) { - gdk_window_print_tree (event_window, 0, event->key.keyval == 0xbd); + gdk_surface_print_tree (event_window, 0, event->key.keyval == 0xbd); } #endif - if (event_window->window_type == GDK_WINDOW_ROOT) + if (event_window->window_type == GDK_SURFACE_ROOT) goto out; if (event->any.type == GDK_ENTER_NOTIFY) @@ -5480,7 +5480,7 @@ _gdk_windowing_got_event (GdkDisplay *display, } /** - * gdk_window_create_similar_surface: + * gdk_surface_create_similar_surface: * @window: window to make new surface similar to * @content: the content for the new surface * @width: width of the new surface @@ -5505,7 +5505,7 @@ _gdk_windowing_got_event (GdkDisplay *display, * or any other error occurs. **/ cairo_surface_t * -gdk_window_create_similar_surface (GdkWindow * window, +gdk_surface_create_similar_surface (GdkSurface * window, cairo_content_t content, int width, int height) @@ -5513,9 +5513,9 @@ gdk_window_create_similar_surface (GdkWindow * window, cairo_surface_t *window_surface, *surface; double sx, sy; - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); - window_surface = gdk_window_ref_impl_surface (window); + window_surface = gdk_surface_ref_impl_surface (window); sx = sy = 1; cairo_surface_get_device_scale (window_surface, &sx, &sy); @@ -5540,7 +5540,7 @@ gdk_window_create_similar_surface (GdkWindow * window, /** - * gdk_window_create_similar_image_surface: + * gdk_surface_create_similar_image_surface: * @window: (nullable): window to make new surface similar to, or * %NULL if none * @format: (type int): the format for the new surface @@ -5561,13 +5561,13 @@ gdk_window_create_similar_surface (GdkWindow * window, * use: * * |[<!-- language="C" --> - * int scale = gdk_window_get_scale_factor (window); - * int width = gdk_window_get_width (window) * scale; - * int height = gdk_window_get_height (window) * scale; + * int scale = gdk_surface_get_scale_factor (window); + * int width = gdk_surface_get_width (window) * scale; + * int height = gdk_surface_get_height (window) * scale; * * // format is set elsewhere * cairo_surface_t *surface = - * gdk_window_create_similar_image_surface (window, + * gdk_surface_create_similar_image_surface (window, * format, * width, height, * scale); @@ -5586,7 +5586,7 @@ gdk_window_create_similar_surface (GdkWindow * window, * or any other error occurs. **/ cairo_surface_t * -gdk_window_create_similar_image_surface (GdkWindow * window, +gdk_surface_create_similar_image_surface (GdkSurface * window, cairo_format_t format, int width, int height, @@ -5594,22 +5594,22 @@ gdk_window_create_similar_image_surface (GdkWindow * window, { cairo_surface_t *surface; - 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 (window == NULL) { surface = cairo_image_surface_create (format, width, height); } - else if (GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_similar_image_surface) + else if (GDK_SURFACE_IMPL_GET_CLASS (window->impl)->create_similar_image_surface) { surface = - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_similar_image_surface (window, format, width, height); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->create_similar_image_surface (window, format, width, height); } else { cairo_surface_t *window_surface; - window_surface = gdk_window_ref_impl_surface (window); + window_surface = gdk_surface_ref_impl_surface (window); surface = cairo_surface_create_similar_image (window_surface, format, @@ -5619,7 +5619,7 @@ gdk_window_create_similar_image_surface (GdkWindow * window, } if (scale == 0) - scale = gdk_window_get_scale_factor (window); + scale = gdk_surface_get_scale_factor (window); cairo_surface_set_device_scale (surface, scale, scale); @@ -5628,8 +5628,8 @@ gdk_window_create_similar_image_surface (GdkWindow * window, /** - * gdk_window_focus: - * @window: a #GdkWindow + * gdk_surface_focus: + * @window: a #GdkSurface * @timestamp: timestamp of the event triggering the window focus * * Sets keyboard focus to @window. In most cases, gtk_window_present() @@ -5637,15 +5637,15 @@ gdk_window_create_similar_image_surface (GdkWindow * window, * **/ void -gdk_window_focus (GdkWindow *window, +gdk_surface_focus (GdkSurface *window, guint32 timestamp) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->focus (window, timestamp); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->focus (window, timestamp); } /** - * gdk_window_set_type_hint: - * @window: A toplevel #GdkWindow + * gdk_surface_set_type_hint: + * @window: A toplevel #GdkSurface * @hint: A hint of the function this window will have * * The application can use this call to provide a hint to the window @@ -5656,29 +5656,29 @@ gdk_window_focus (GdkWindow *window, * The hint must be set before the window is mapped. **/ void -gdk_window_set_type_hint (GdkWindow *window, - GdkWindowTypeHint hint) +gdk_surface_set_type_hint (GdkSurface *window, + GdkSurfaceTypeHint hint) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_type_hint (window, hint); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_type_hint (window, hint); } /** - * gdk_window_get_type_hint: - * @window: A toplevel #GdkWindow + * gdk_surface_get_type_hint: + * @window: A toplevel #GdkSurface * * This function returns the type hint set for a window. * * Returns: The type hint set for @window **/ -GdkWindowTypeHint -gdk_window_get_type_hint (GdkWindow *window) +GdkSurfaceTypeHint +gdk_surface_get_type_hint (GdkSurface *window) { - return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_type_hint (window); + return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->get_type_hint (window); } /** - * gdk_window_set_modal_hint: - * @window: A toplevel #GdkWindow + * gdk_surface_set_modal_hint: + * @window: A toplevel #GdkSurface * @modal: %TRUE if the window is modal, %FALSE otherwise. * * The application can use this hint to tell the window manager @@ -5687,73 +5687,73 @@ gdk_window_get_type_hint (GdkWindow *window) * way. * * You should only use this on windows for which you have - * previously called gdk_window_set_transient_for() + * previously called gdk_surface_set_transient_for() **/ void -gdk_window_set_modal_hint (GdkWindow *window, +gdk_surface_set_modal_hint (GdkSurface *window, gboolean modal) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_modal_hint (window, modal); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_modal_hint (window, modal); } /** - * gdk_window_set_skip_taskbar_hint: - * @window: a toplevel #GdkWindow + * gdk_surface_set_skip_taskbar_hint: + * @window: a toplevel #GdkSurface * @skips_taskbar: %TRUE to skip the taskbar * * Toggles whether a window should appear in a task list or window * list. If a window’s semantic type as specified with - * gdk_window_set_type_hint() already fully describes the window, this + * gdk_surface_set_type_hint() already fully describes the window, this * function should not be called in addition, * instead you should allow the window to be treated according to * standard policy for its semantic type. **/ void -gdk_window_set_skip_taskbar_hint (GdkWindow *window, +gdk_surface_set_skip_taskbar_hint (GdkSurface *window, gboolean skips_taskbar) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_skip_taskbar_hint (window, skips_taskbar); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_skip_taskbar_hint (window, skips_taskbar); } /** - * gdk_window_set_skip_pager_hint: - * @window: a toplevel #GdkWindow + * gdk_surface_set_skip_pager_hint: + * @window: a toplevel #GdkSurface * @skips_pager: %TRUE to skip the pager * * Toggles whether a window should appear in a pager (workspace * switcher, or other desktop utility program that displays a small * thumbnail representation of the windows on the desktop). If a - * window’s semantic type as specified with gdk_window_set_type_hint() + * window’s semantic type as specified with gdk_surface_set_type_hint() * already fully describes the window, this function should * not be called in addition, instead you should * allow the window to be treated according to standard policy for * its semantic type. **/ void -gdk_window_set_skip_pager_hint (GdkWindow *window, +gdk_surface_set_skip_pager_hint (GdkSurface *window, gboolean skips_pager) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_skip_pager_hint (window, skips_pager); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_skip_pager_hint (window, skips_pager); } /** - * gdk_window_set_urgency_hint: - * @window: a toplevel #GdkWindow + * gdk_surface_set_urgency_hint: + * @window: a toplevel #GdkSurface * @urgent: %TRUE if the window is urgent * * Toggles whether a window needs the user's * urgent attention. **/ void -gdk_window_set_urgency_hint (GdkWindow *window, +gdk_surface_set_urgency_hint (GdkSurface *window, gboolean urgent) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_urgency_hint (window, urgent); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_urgency_hint (window, urgent); } /** - * gdk_window_set_geometry_hints: - * @window: a toplevel #GdkWindow + * gdk_surface_set_geometry_hints: + * @window: a toplevel #GdkSurface * @geometry: geometry hints * @geom_mask: bitmask indicating fields of @geometry to pay attention to * @@ -5766,50 +5766,50 @@ gdk_window_set_urgency_hint (GdkWindow *window, * this is to constrain user resizing, but the windowing system * will typically (but is not required to) also constrain the * current size of the window to the provided values and - * constrain programatic resizing via gdk_window_resize() or - * gdk_window_move_resize(). + * constrain programatic resizing via gdk_surface_resize() or + * gdk_surface_move_resize(). * * Note that on X11, this effect has no effect on windows - * of type %GDK_WINDOW_TEMP since these windows are not resizable + * of type %GDK_SURFACE_TEMP since these windows are not resizable * by the user. * * Since you can’t count on the windowing system doing the * constraints for programmatic resizes, you should generally - * call gdk_window_constrain_size() yourself to determine + * call gdk_surface_constrain_size() yourself to determine * appropriate sizes. * **/ void -gdk_window_set_geometry_hints (GdkWindow *window, +gdk_surface_set_geometry_hints (GdkSurface *window, const GdkGeometry *geometry, - GdkWindowHints geom_mask) + GdkSurfaceHints geom_mask) { g_return_if_fail (geometry != NULL || geom_mask == 0); - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_geometry_hints (window, geometry, geom_mask); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_geometry_hints (window, geometry, geom_mask); } /** - * gdk_window_set_title: - * @window: a toplevel #GdkWindow + * gdk_surface_set_title: + * @window: a toplevel #GdkSurface * @title: title of @window * * Sets the title of a toplevel window, to be displayed in the titlebar. * If you haven’t explicitly set the icon name for the window - * (using gdk_window_set_icon_name()), the icon name will be set to + * (using gdk_surface_set_icon_name()), the icon name will be set to * @title as well. @title must be in UTF-8 encoding (as with all * user-readable strings in GDK/GTK+). @title may not be %NULL. **/ void -gdk_window_set_title (GdkWindow *window, +gdk_surface_set_title (GdkSurface *window, const gchar *title) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_title (window, title); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_title (window, title); } /** - * gdk_window_set_role: - * @window: a toplevel #GdkWindow + * gdk_surface_set_role: + * @window: a toplevel #GdkSurface * @role: a string indicating its role * * When using GTK+, typically you should use gtk_window_set_role() instead @@ -5827,31 +5827,31 @@ gdk_window_set_title (GdkWindow *window, * **/ void -gdk_window_set_role (GdkWindow *window, +gdk_surface_set_role (GdkSurface *window, const gchar *role) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_role (window, role); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_role (window, role); } /** - * gdk_window_set_startup_id: - * @window: a toplevel #GdkWindow + * gdk_surface_set_startup_id: + * @window: a toplevel #GdkSurface * @startup_id: a string with startup-notification identifier * * When using GTK+, typically you should use gtk_window_set_startup_id() * instead of this low-level function. **/ void -gdk_window_set_startup_id (GdkWindow *window, +gdk_surface_set_startup_id (GdkSurface *window, const gchar *startup_id) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_startup_id (window, startup_id); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_startup_id (window, startup_id); } /** - * gdk_window_set_transient_for: - * @window: a toplevel #GdkWindow - * @parent: another toplevel #GdkWindow + * gdk_surface_set_transient_for: + * @window: a toplevel #GdkSurface + * @parent: another toplevel #GdkSurface * * Indicates to the window manager that @window is a transient dialog * associated with the application window @parent. This allows the @@ -5862,17 +5862,17 @@ gdk_window_set_startup_id (GdkWindow *window, * #GtkDialog. **/ void -gdk_window_set_transient_for (GdkWindow *window, - GdkWindow *parent) +gdk_surface_set_transient_for (GdkSurface *window, + GdkSurface *parent) { window->transient_for = parent; - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_transient_for (window, parent); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_transient_for (window, parent); } /** - * gdk_window_get_root_origin: - * @window: a toplevel #GdkWindow + * gdk_surface_get_root_origin: + * @window: a toplevel #GdkSurface * @x: (out): return location for X position of window frame * @y: (out): return location for Y position of window frame * @@ -5881,13 +5881,13 @@ gdk_window_set_transient_for (GdkWindow *window, * **/ void -gdk_window_get_root_origin (GdkWindow *window, +gdk_surface_get_root_origin (GdkSurface *window, gint *x, gint *y) { GdkRectangle rect; - gdk_window_get_frame_extents (window, &rect); + gdk_surface_get_frame_extents (window, &rect); if (x) *x = rect.x; @@ -5897,26 +5897,26 @@ gdk_window_get_root_origin (GdkWindow *window, } /** - * gdk_window_get_frame_extents: - * @window: a toplevel #GdkWindow + * gdk_surface_get_frame_extents: + * @window: a toplevel #GdkSurface * @rect: (out): rectangle to fill with bounding box of the window frame * * Obtains the bounding box of the window, including window manager * titlebar/borders if any. The frame position is given in root window * coordinates. To get the position of the window itself (rather than - * the frame) in root window coordinates, use gdk_window_get_origin(). + * the frame) in root window coordinates, use gdk_surface_get_origin(). * **/ void -gdk_window_get_frame_extents (GdkWindow *window, +gdk_surface_get_frame_extents (GdkSurface *window, GdkRectangle *rect) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_frame_extents (window, rect); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->get_frame_extents (window, rect); } /** - * gdk_window_set_accept_focus: - * @window: a toplevel #GdkWindow + * gdk_surface_set_accept_focus: + * @window: a toplevel #GdkSurface * @accept_focus: %TRUE if the window should receive input focus * * Setting @accept_focus to %FALSE hints the desktop environment that the @@ -5926,15 +5926,15 @@ gdk_window_get_frame_extents (GdkWindow *window, * hint. ICCCM-compliant window manager usually respect it. **/ void -gdk_window_set_accept_focus (GdkWindow *window, +gdk_surface_set_accept_focus (GdkSurface *window, gboolean accept_focus) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_accept_focus (window, accept_focus); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_accept_focus (window, accept_focus); } /** - * gdk_window_set_focus_on_map: - * @window: a toplevel #GdkWindow + * gdk_surface_set_focus_on_map: + * @window: a toplevel #GdkSurface * @focus_on_map: %TRUE if the window should receive input focus when mapped * * Setting @focus_on_map to %FALSE hints the desktop environment that the @@ -5947,15 +5947,15 @@ gdk_window_set_accept_focus (GdkWindow *window, * manager extension specification should respect it. **/ void -gdk_window_set_focus_on_map (GdkWindow *window, +gdk_surface_set_focus_on_map (GdkSurface *window, gboolean focus_on_map) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_focus_on_map (window, focus_on_map); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_focus_on_map (window, focus_on_map); } /** - * gdk_window_set_icon_list: - * @window: The #GdkWindow toplevel window to set the icon of. + * gdk_surface_set_icon_list: + * @window: The #GdkSurface toplevel window to set the icon of. * @surfaces: (transfer none) (element-type GdkTexture): * A list of image surfaces, of different sizes. * @@ -5970,15 +5970,15 @@ gdk_window_set_focus_on_map (GdkWindow *window, * Note that some platforms don't support window icons. */ void -gdk_window_set_icon_list (GdkWindow *window, +gdk_surface_set_icon_list (GdkSurface *window, GList *textures) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_icon_list (window, textures); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_icon_list (window, textures); } /** - * gdk_window_set_icon_name: - * @window: a toplevel #GdkWindow + * gdk_surface_set_icon_name: + * @window: a toplevel #GdkSurface * @name: (allow-none): name of window while iconified (minimized) * * Windows may have a name used while minimized, distinct from the @@ -5986,24 +5986,24 @@ gdk_window_set_icon_list (GdkWindow *window, * idea from a user interface standpoint. But you can set such a name * with this function, if you like. * - * After calling this with a non-%NULL @name, calls to gdk_window_set_title() + * After calling this with a non-%NULL @name, calls to gdk_surface_set_title() * will not update the icon title. * * Using %NULL for @name unsets the icon title; further calls to - * gdk_window_set_title() will again update the icon title as well. + * gdk_surface_set_title() will again update the icon title as well. * * Note that some platforms don't support window icons. **/ void -gdk_window_set_icon_name (GdkWindow *window, +gdk_surface_set_icon_name (GdkSurface *window, const gchar *name) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_icon_name (window, name); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_icon_name (window, name); } /** - * gdk_window_iconify: - * @window: a toplevel #GdkWindow + * gdk_surface_iconify: + * @window: a toplevel #GdkSurface * * Asks to iconify (minimize) @window. The window manager may choose * to ignore the request, but normally will honor it. Using @@ -6013,31 +6013,31 @@ gdk_window_set_icon_name (GdkWindow *window, * **/ void -gdk_window_iconify (GdkWindow *window) +gdk_surface_iconify (GdkSurface *window) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->iconify (window); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->iconify (window); } /** - * gdk_window_deiconify: - * @window: a toplevel #GdkWindow + * gdk_surface_deiconify: + * @window: a toplevel #GdkSurface * * Attempt to deiconify (unminimize) @window. On X11 the window manager may * choose to ignore the request to deiconify. When using GTK+, - * use gtk_window_deiconify() instead of the #GdkWindow variant. Or better yet, + * use gtk_window_deiconify() instead of the #GdkSurface variant. Or better yet, * you probably want to use gtk_window_present(), which raises the window, focuses it, * unminimizes it, and puts it on the current desktop. * **/ void -gdk_window_deiconify (GdkWindow *window) +gdk_surface_deiconify (GdkSurface *window) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->deiconify (window); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->deiconify (window); } /** - * gdk_window_stick: - * @window: a toplevel #GdkWindow + * gdk_surface_stick: + * @window: a toplevel #GdkSurface * * “Pins” a window such that it’s on all workspaces and does not scroll * with viewports, for window managers that have scrollable viewports. @@ -6051,28 +6051,28 @@ gdk_window_deiconify (GdkWindow *window) * **/ void -gdk_window_stick (GdkWindow *window) +gdk_surface_stick (GdkSurface *window) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->stick (window); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->stick (window); } /** - * gdk_window_unstick: - * @window: a toplevel #GdkWindow + * gdk_surface_unstick: + * @window: a toplevel #GdkSurface * - * Reverse operation for gdk_window_stick(); see gdk_window_stick(), + * Reverse operation for gdk_surface_stick(); see gdk_surface_stick(), * and gtk_window_unstick(). * **/ void -gdk_window_unstick (GdkWindow *window) +gdk_surface_unstick (GdkSurface *window) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->unstick (window); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->unstick (window); } /** - * gdk_window_maximize: - * @window: a toplevel #GdkWindow + * gdk_surface_maximize: + * @window: a toplevel #GdkSurface * * Maximizes the window. If the window was already maximized, then * this function does nothing. @@ -6088,14 +6088,14 @@ gdk_window_unstick (GdkWindow *window) * **/ void -gdk_window_maximize (GdkWindow *window) +gdk_surface_maximize (GdkSurface *window) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->maximize (window); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->maximize (window); } /** - * gdk_window_unmaximize: - * @window: a toplevel #GdkWindow + * gdk_surface_unmaximize: + * @window: a toplevel #GdkSurface * * Unmaximizes the window. If the window wasn’t maximized, then this * function does nothing. @@ -6111,14 +6111,14 @@ gdk_window_maximize (GdkWindow *window) * **/ void -gdk_window_unmaximize (GdkWindow *window) +gdk_surface_unmaximize (GdkSurface *window) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->unmaximize (window); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->unmaximize (window); } /** - * gdk_window_fullscreen: - * @window: a toplevel #GdkWindow + * gdk_surface_fullscreen: + * @window: a toplevel #GdkSurface * * Moves the window into fullscreen mode. This means the * window covers the entire screen and is above any panels @@ -6135,14 +6135,14 @@ gdk_window_unmaximize (GdkWindow *window) * it to happen. **/ void -gdk_window_fullscreen (GdkWindow *window) +gdk_surface_fullscreen (GdkSurface *window) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->fullscreen (window); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->fullscreen (window); } /** - * gdk_window_fullscreen_on_monitor: - * @window: a toplevel #GdkWindow + * gdk_surface_fullscreen_on_monitor: + * @window: a toplevel #GdkSurface * @monitor: Which monitor to display fullscreen on. * * Moves the window into fullscreen mode on the given monitor. This means @@ -6151,23 +6151,23 @@ gdk_window_fullscreen (GdkWindow *window) * If the window was already fullscreen, then this function does nothing. **/ void -gdk_window_fullscreen_on_monitor (GdkWindow *window, +gdk_surface_fullscreen_on_monitor (GdkSurface *window, GdkMonitor *monitor) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); g_return_if_fail (GDK_IS_MONITOR (monitor)); - g_return_if_fail (gdk_monitor_get_display (monitor) == gdk_window_get_display (window)); + g_return_if_fail (gdk_monitor_get_display (monitor) == gdk_surface_get_display (window)); g_return_if_fail (gdk_monitor_is_valid (monitor)); - if (GDK_WINDOW_IMPL_GET_CLASS (window->impl)->fullscreen_on_monitor != NULL) - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->fullscreen_on_monitor (window, monitor); + if (GDK_SURFACE_IMPL_GET_CLASS (window->impl)->fullscreen_on_monitor != NULL) + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->fullscreen_on_monitor (window, monitor); else - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->fullscreen (window); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->fullscreen (window); } /** - * gdk_window_set_fullscreen_mode: - * @window: a toplevel #GdkWindow + * gdk_surface_set_fullscreen_mode: + * @window: a toplevel #GdkSurface * @mode: fullscreen mode * * Specifies whether the @window should span over all monitors (in a multi-head @@ -6189,42 +6189,42 @@ gdk_window_fullscreen_on_monitor (GdkWindow *window, * is specified. **/ void -gdk_window_set_fullscreen_mode (GdkWindow *window, +gdk_surface_set_fullscreen_mode (GdkSurface *window, GdkFullscreenMode mode) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); if (window->fullscreen_mode != mode) { window->fullscreen_mode = mode; - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); if (impl_class->apply_fullscreen_mode != NULL) impl_class->apply_fullscreen_mode (window); } } /** - * gdk_window_get_fullscreen_mode: - * @window: a toplevel #GdkWindow + * gdk_surface_get_fullscreen_mode: + * @window: a toplevel #GdkSurface * * Obtains the #GdkFullscreenMode of the @window. * * Returns: The #GdkFullscreenMode applied to the window when fullscreen. **/ GdkFullscreenMode -gdk_window_get_fullscreen_mode (GdkWindow *window) +gdk_surface_get_fullscreen_mode (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_FULLSCREEN_ON_CURRENT_MONITOR); + g_return_val_if_fail (GDK_IS_SURFACE (window), GDK_FULLSCREEN_ON_CURRENT_MONITOR); return window->fullscreen_mode; } /** - * gdk_window_unfullscreen: - * @window: a toplevel #GdkWindow + * gdk_surface_unfullscreen: + * @window: a toplevel #GdkSurface * * Moves the window out of fullscreen mode. If the window was not * fullscreen, does nothing. @@ -6238,14 +6238,14 @@ gdk_window_get_fullscreen_mode (GdkWindow *window) * it to happen. **/ void -gdk_window_unfullscreen (GdkWindow *window) +gdk_surface_unfullscreen (GdkSurface *window) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->unfullscreen (window); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->unfullscreen (window); } /** - * gdk_window_set_keep_above: - * @window: a toplevel #GdkWindow + * gdk_surface_set_keep_above: + * @window: a toplevel #GdkSurface * @setting: whether to keep @window above other windows * * Set if @window must be kept above other windows. If the @@ -6259,15 +6259,15 @@ gdk_window_unfullscreen (GdkWindow *window) * and GDK makes a best effort to get it to happen. **/ void -gdk_window_set_keep_above (GdkWindow *window, +gdk_surface_set_keep_above (GdkSurface *window, gboolean setting) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_keep_above (window, setting); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_keep_above (window, setting); } /** - * gdk_window_set_keep_below: - * @window: a toplevel #GdkWindow + * gdk_surface_set_keep_below: + * @window: a toplevel #GdkSurface * @setting: whether to keep @window below other windows * * Set if @window must be kept below other windows. If the @@ -6281,28 +6281,28 @@ gdk_window_set_keep_above (GdkWindow *window, * and GDK makes a best effort to get it to happen. **/ void -gdk_window_set_keep_below (GdkWindow *window, gboolean setting) +gdk_surface_set_keep_below (GdkSurface *window, gboolean setting) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_keep_below (window, setting); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_keep_below (window, setting); } /** - * gdk_window_get_group: - * @window: a toplevel #GdkWindow + * gdk_surface_get_group: + * @window: a toplevel #GdkSurface * - * Returns the group leader window for @window. See gdk_window_set_group(). + * Returns the group leader window for @window. See gdk_surface_set_group(). * * Returns: (transfer none): the group leader window for @window **/ -GdkWindow * -gdk_window_get_group (GdkWindow *window) +GdkSurface * +gdk_surface_get_group (GdkSurface *window) { - return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_group (window); + return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->get_group (window); } /** - * gdk_window_set_group: - * @window: a toplevel #GdkWindow + * gdk_surface_set_group: + * @window: a toplevel #GdkSurface * @leader: (allow-none): group leader window, or %NULL to restore the default group leader window * * Sets the group leader window for @window. By default, @@ -6317,18 +6317,18 @@ gdk_window_get_group (GdkWindow *window) * if your application pretends to be multiple applications. **/ void -gdk_window_set_group (GdkWindow *window, - GdkWindow *leader) +gdk_surface_set_group (GdkSurface *window, + GdkSurface *leader) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_group (window, leader); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_group (window, leader); } /** - * gdk_window_set_decorations: - * @window: a toplevel #GdkWindow + * gdk_surface_set_decorations: + * @window: a toplevel #GdkSurface * @decorations: decoration hint mask * - * “Decorations” are the features the window manager adds to a toplevel #GdkWindow. + * “Decorations” are the features the window manager adds to a toplevel #GdkSurface. * This function sets the traditional Motif window manager hints that tell the * window manager which decorations you would like your window to have. * Usually you should use gtk_window_set_decorated() on a #GtkWindow instead of @@ -6345,32 +6345,32 @@ gdk_window_set_group (GdkWindow *window, * **/ void -gdk_window_set_decorations (GdkWindow *window, +gdk_surface_set_decorations (GdkSurface *window, GdkWMDecoration decorations) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_decorations (window, decorations); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_decorations (window, decorations); } /** - * gdk_window_get_decorations: - * @window: The toplevel #GdkWindow to get the decorations from + * gdk_surface_get_decorations: + * @window: The toplevel #GdkSurface to get the decorations from * @decorations: (out): The window decorations will be written here * - * Returns the decorations set on the GdkWindow with - * gdk_window_set_decorations(). + * Returns the decorations set on the GdkSurface with + * gdk_surface_set_decorations(). * * Returns: %TRUE if the window has decorations set, %FALSE otherwise. **/ gboolean -gdk_window_get_decorations(GdkWindow *window, +gdk_surface_get_decorations(GdkSurface *window, GdkWMDecoration *decorations) { - return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->get_decorations (window, decorations); + return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->get_decorations (window, decorations); } /** - * gdk_window_set_functions: - * @window: a toplevel #GdkWindow + * gdk_surface_set_functions: + * @window: a toplevel #GdkSurface * @functions: bitmask of operations to allow on @window * * Sets hints about the window management functions to make available @@ -6389,15 +6389,15 @@ gdk_window_get_decorations(GdkWindow *window, * **/ void -gdk_window_set_functions (GdkWindow *window, +gdk_surface_set_functions (GdkSurface *window, GdkWMFunction functions) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_functions (window, functions); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_functions (window, functions); } /** - * gdk_window_begin_resize_drag_for_device: - * @window: a toplevel #GdkWindow + * gdk_surface_begin_resize_drag_for_device: + * @window: a toplevel #GdkSurface * @edge: the edge or corner from which the drag is started * @device: the device used for the operation * @button: the button being used to drag, or 0 for a keyboard-initiated drag @@ -6413,20 +6413,20 @@ gdk_window_set_functions (GdkWindow *window, * but has a fallback implementation for other window managers. */ void -gdk_window_begin_resize_drag_for_device (GdkWindow *window, - GdkWindowEdge edge, +gdk_surface_begin_resize_drag_for_device (GdkSurface *window, + GdkSurfaceEdge edge, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->begin_resize_drag (window, edge, device, button, root_x, root_y, timestamp); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->begin_resize_drag (window, edge, device, button, root_x, root_y, timestamp); } /** - * gdk_window_begin_resize_drag: - * @window: a toplevel #GdkWindow + * gdk_surface_begin_resize_drag: + * @window: a toplevel #GdkSurface * @edge: the edge or corner from which the drag is started * @button: the button being used to drag, or 0 for a keyboard-initiated drag * @root_x: root window X coordinate of mouse click that began the drag @@ -6436,12 +6436,12 @@ gdk_window_begin_resize_drag_for_device (GdkWindow *window, * Begins a window resize operation (for a toplevel window). * * This function assumes that the drag is controlled by the - * client pointer device, use gdk_window_begin_resize_drag_for_device() + * client pointer device, use gdk_surface_begin_resize_drag_for_device() * to begin a drag with a different device. */ void -gdk_window_begin_resize_drag (GdkWindow *window, - GdkWindowEdge edge, +gdk_surface_begin_resize_drag (GdkSurface *window, + GdkSurfaceEdge edge, gint button, gint root_x, gint root_y, @@ -6450,15 +6450,15 @@ gdk_window_begin_resize_drag (GdkWindow *window, GdkDisplay *display; GdkDevice *device; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); device = gdk_seat_get_pointer (gdk_display_get_default_seat (display)); - gdk_window_begin_resize_drag_for_device (window, edge, + gdk_surface_begin_resize_drag_for_device (window, edge, device, button, root_x, root_y, timestamp); } /** - * gdk_window_begin_move_drag_for_device: - * @window: a toplevel #GdkWindow + * gdk_surface_begin_move_drag_for_device: + * @window: a toplevel #GdkSurface * @device: the device used for the operation * @button: the button being used to drag, or 0 for a keyboard-initiated drag * @root_x: root window X coordinate of mouse click that began the drag @@ -6472,20 +6472,20 @@ gdk_window_begin_resize_drag (GdkWindow *window, * but has a fallback implementation for other window managers. */ void -gdk_window_begin_move_drag_for_device (GdkWindow *window, +gdk_surface_begin_move_drag_for_device (GdkSurface *window, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->begin_move_drag (window, + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->begin_move_drag (window, device, button, root_x, root_y, timestamp); } /** - * gdk_window_begin_move_drag: - * @window: a toplevel #GdkWindow + * gdk_surface_begin_move_drag: + * @window: a toplevel #GdkSurface * @button: the button being used to drag, or 0 for a keyboard-initiated drag * @root_x: root window X coordinate of mouse click that began the drag * @root_y: root window Y coordinate of mouse click that began the drag @@ -6494,11 +6494,11 @@ gdk_window_begin_move_drag_for_device (GdkWindow *window, * Begins a window move operation (for a toplevel window). * * This function assumes that the drag is controlled by the - * client pointer device, use gdk_window_begin_move_drag_for_device() + * client pointer device, use gdk_surface_begin_move_drag_for_device() * to begin a drag with a different device. */ void -gdk_window_begin_move_drag (GdkWindow *window, +gdk_surface_begin_move_drag (GdkSurface *window, gint button, gint root_x, gint root_y, @@ -6507,14 +6507,14 @@ gdk_window_begin_move_drag (GdkWindow *window, GdkDisplay *display; GdkDevice *device; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); device = gdk_seat_get_pointer (gdk_display_get_default_seat (display)); - gdk_window_begin_move_drag_for_device (window, device, button, root_x, root_y, timestamp); + gdk_surface_begin_move_drag_for_device (window, device, button, root_x, root_y, timestamp); } /** - * gdk_window_set_opacity: - * @window: a top-level or non-native #GdkWindow + * gdk_surface_set_opacity: + * @window: a top-level or non-native #GdkSurface * @opacity: opacity * * Set @window to render as partially transparent, @@ -6525,7 +6525,7 @@ gdk_window_begin_move_drag (GdkWindow *window, * that may not always be there. For instance, On X11, this works only on * X screens with a compositing manager running. On Wayland, there is no * per-window opacity value that the compositor would apply. Instead, use - * `gdk_window_set_opaque_region (window, NULL)` to tell the compositor + * `gdk_surface_set_opaque_region (window, NULL)` to tell the compositor * that the entire window is (potentially) non-opaque, and draw your content * with alpha, or use gtk_widget_set_opacity() to set an overall opacity * for your widgets. @@ -6533,7 +6533,7 @@ gdk_window_begin_move_drag (GdkWindow *window, * Support for non-toplevel windows was added in 3.8. */ void -gdk_window_set_opacity (GdkWindow *window, +gdk_surface_set_opacity (GdkSurface *window, gdouble opacity) { if (opacity < 0) @@ -6546,33 +6546,33 @@ gdk_window_set_opacity (GdkWindow *window, if (window->destroyed) return; - if (gdk_window_has_impl (window)) - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_opacity (window, opacity); + if (gdk_surface_has_impl (window)) + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->set_opacity (window, opacity); else { recompute_visible_regions (window, FALSE); - gdk_window_invalidate_rect_full (window, NULL, TRUE); + gdk_surface_invalidate_rect_full (window, NULL, TRUE); } } /* This function is called when the XWindow is really gone. */ void -gdk_window_destroy_notify (GdkWindow *window) +gdk_surface_destroy_notify (GdkSurface *window) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->destroy_notify (window); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->destroy_notify (window); } /** - * gdk_window_register_dnd: - * @window: a #GdkWindow. + * gdk_surface_register_dnd: + * @window: a #GdkSurface. * * Registers a window as a potential drop destination. */ void -gdk_window_register_dnd (GdkWindow *window) +gdk_surface_register_dnd (GdkSurface *window) { - GDK_WINDOW_IMPL_GET_CLASS (window->impl)->register_dnd (window); + GDK_SURFACE_IMPL_GET_CLASS (window->impl)->register_dnd (window); } /** @@ -6592,31 +6592,31 @@ gdk_window_register_dnd (GdkWindow *window) * %NULL on error. */ GdkDragContext * -gdk_drag_begin (GdkWindow *window, +gdk_drag_begin (GdkSurface *window, GdkDevice *device, GdkContentProvider *content, GdkDragAction actions, gint dx, gint dy) { - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); - g_return_val_if_fail (gdk_window_get_display (window) == gdk_device_get_display (device), NULL); + g_return_val_if_fail (gdk_surface_get_display (window) == gdk_device_get_display (device), NULL); g_return_val_if_fail (GDK_IS_CONTENT_PROVIDER (content), NULL); - return GDK_WINDOW_IMPL_GET_CLASS (window->impl)->drag_begin (window, device, content, actions, dx, dy); + return GDK_SURFACE_IMPL_GET_CLASS (window->impl)->drag_begin (window, device, content, actions, dx, dy); } static void -gdk_window_flush_events (GdkFrameClock *clock, +gdk_surface_flush_events (GdkFrameClock *clock, void *data) { - GdkWindow *window; + GdkSurface *window; GdkDisplay *display; - window = GDK_WINDOW (data); + window = GDK_SURFACE (data); - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); _gdk_event_queue_flush (display); _gdk_display_pause_events (display); @@ -6626,27 +6626,27 @@ gdk_window_flush_events (GdkFrameClock *clock, } static void -gdk_window_resume_events (GdkFrameClock *clock, +gdk_surface_resume_events (GdkFrameClock *clock, void *data) { - GdkWindow *window; + GdkSurface *window; GdkDisplay *display; - window = GDK_WINDOW (data); + window = GDK_SURFACE (data); - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); _gdk_display_unpause_events (display); window->frame_clock_events_paused = FALSE; } static void -gdk_window_set_frame_clock (GdkWindow *window, +gdk_surface_set_frame_clock (GdkSurface *window, GdkFrameClock *clock) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); g_return_if_fail (clock == NULL || GDK_IS_FRAME_CLOCK (clock)); - g_return_if_fail (clock == NULL || gdk_window_is_toplevel (window)); + g_return_if_fail (clock == NULL || gdk_surface_is_toplevel (window)); if (clock == window->frame_clock) return; @@ -6656,31 +6656,31 @@ gdk_window_set_frame_clock (GdkWindow *window, g_object_ref (clock); g_signal_connect (G_OBJECT (clock), "flush-events", - G_CALLBACK (gdk_window_flush_events), + G_CALLBACK (gdk_surface_flush_events), window); g_signal_connect (G_OBJECT (clock), "paint", - G_CALLBACK (gdk_window_paint_on_clock), + G_CALLBACK (gdk_surface_paint_on_clock), window); g_signal_connect (G_OBJECT (clock), "resume-events", - G_CALLBACK (gdk_window_resume_events), + G_CALLBACK (gdk_surface_resume_events), window); } if (window->frame_clock) { if (window->frame_clock_events_paused) - gdk_window_resume_events (window->frame_clock, G_OBJECT (window)); + gdk_surface_resume_events (window->frame_clock, G_OBJECT (window)); g_signal_handlers_disconnect_by_func (G_OBJECT (window->frame_clock), - G_CALLBACK (gdk_window_flush_events), + G_CALLBACK (gdk_surface_flush_events), window); g_signal_handlers_disconnect_by_func (G_OBJECT (window->frame_clock), - G_CALLBACK (gdk_window_paint_on_clock), + G_CALLBACK (gdk_surface_paint_on_clock), window); g_signal_handlers_disconnect_by_func (G_OBJECT (window->frame_clock), - G_CALLBACK (gdk_window_resume_events), + G_CALLBACK (gdk_surface_resume_events), window); g_object_unref (window->frame_clock); } @@ -6689,7 +6689,7 @@ gdk_window_set_frame_clock (GdkWindow *window, } /** - * gdk_window_get_frame_clock: + * gdk_surface_get_frame_clock: * @window: window to get frame clock for * * Gets the frame clock for the window. The frame clock for a window @@ -6699,19 +6699,19 @@ gdk_window_set_frame_clock (GdkWindow *window, * Returns: (transfer none): the frame clock */ GdkFrameClock* -gdk_window_get_frame_clock (GdkWindow *window) +gdk_surface_get_frame_clock (GdkSurface *window) { - GdkWindow *toplevel; + GdkSurface *toplevel; - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); - toplevel = gdk_window_get_toplevel (window); + toplevel = gdk_surface_get_toplevel (window); return toplevel->frame_clock; } /** - * gdk_window_get_scale_factor: + * gdk_surface_get_scale_factor: * @window: window to get scale factor for * * Returns the internal scale factor that maps from window coordiantes @@ -6730,16 +6730,16 @@ gdk_window_get_frame_clock (GdkWindow *window) * Returns: the scale factor */ gint -gdk_window_get_scale_factor (GdkWindow *window) +gdk_surface_get_scale_factor (GdkSurface *window) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; - g_return_val_if_fail (GDK_IS_WINDOW (window), 1); + g_return_val_if_fail (GDK_IS_SURFACE (window), 1); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return 1; - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); if (impl_class->get_scale_factor) return impl_class->get_scale_factor (window); @@ -6751,18 +6751,18 @@ gdk_window_get_scale_factor (GdkWindow *window) in window scale coordinates. We need this to properly handle GL coordinates which are y-flipped in the real coordinates. */ void -gdk_window_get_unscaled_size (GdkWindow *window, +gdk_surface_get_unscaled_size (GdkSurface *window, int *unscaled_width, int *unscaled_height) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; gint scale; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); if (window->impl_window == window) { - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); if (impl_class->get_unscaled_size) { @@ -6771,7 +6771,7 @@ gdk_window_get_unscaled_size (GdkWindow *window, } } - scale = gdk_window_get_scale_factor (window); + scale = gdk_surface_get_scale_factor (window); if (unscaled_width) *unscaled_width = window->width * scale; @@ -6782,8 +6782,8 @@ gdk_window_get_unscaled_size (GdkWindow *window, /** - * gdk_window_set_opaque_region: - * @window: a top-level or non-native #GdkWindow + * gdk_surface_set_opaque_region: + * @window: a top-level or non-native #GdkSurface * @region: (allow-none): a region, or %NULL * * For optimisation purposes, compositing window managers may @@ -6801,13 +6801,13 @@ gdk_window_get_unscaled_size (GdkWindow *window, * property in your #GtkWidget::style-updated handler. */ void -gdk_window_set_opaque_region (GdkWindow *window, +gdk_surface_set_opaque_region (GdkSurface *window, cairo_region_t *region) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; - g_return_if_fail (GDK_IS_WINDOW (window)); - g_return_if_fail (!GDK_WINDOW_DESTROYED (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); + g_return_if_fail (!GDK_SURFACE_DESTROYED (window)); if (cairo_region_equal (window->opaque_region, region)) return; @@ -6817,15 +6817,15 @@ gdk_window_set_opaque_region (GdkWindow *window, if (region != NULL) window->opaque_region = cairo_region_reference (region); - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); if (impl_class->set_opaque_region) impl_class->set_opaque_region (window, region); } /** - * gdk_window_set_shadow_width: - * @window: a #GdkWindow + * gdk_surface_set_shadow_width: + * @window: a #GdkSurface * @left: The left extent * @right: The right extent * @top: The top extent @@ -6842,16 +6842,16 @@ gdk_window_set_opaque_region (GdkWindow *window, * to create toplevel windows. */ void -gdk_window_set_shadow_width (GdkWindow *window, +gdk_surface_set_shadow_width (GdkSurface *window, gint left, gint right, gint top, gint bottom) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; - g_return_if_fail (GDK_IS_WINDOW (window)); - g_return_if_fail (!GDK_WINDOW_DESTROYED (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); + g_return_if_fail (!GDK_SURFACE_DESTROYED (window)); g_return_if_fail (left >= 0 && right >= 0 && top >= 0 && bottom >= 0); window->shadow_top = top; @@ -6859,15 +6859,15 @@ gdk_window_set_shadow_width (GdkWindow *window, window->shadow_right = right; window->shadow_bottom = bottom; - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); if (impl_class->set_shadow_width) impl_class->set_shadow_width (window, left, right, top, bottom); } /** - * gdk_window_show_window_menu: - * @window: a #GdkWindow + * gdk_surface_show_window_menu: + * @window: a #GdkSurface * @event: a #GdkEvent to show the menu for * * Asks the windowing system to show the window menu. The window menu @@ -6879,15 +6879,15 @@ gdk_window_set_shadow_width (GdkWindow *window, * Returns: %TRUE if the window menu was shown and %FALSE otherwise. */ gboolean -gdk_window_show_window_menu (GdkWindow *window, +gdk_surface_show_window_menu (GdkSurface *window, GdkEvent *event) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); - g_return_val_if_fail (!GDK_WINDOW_DESTROYED (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); + g_return_val_if_fail (!GDK_SURFACE_DESTROYED (window), FALSE); - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); if (impl_class->show_window_menu) return impl_class->show_window_menu (window, event); @@ -6896,14 +6896,14 @@ gdk_window_show_window_menu (GdkWindow *window, } gboolean -gdk_window_supports_edge_constraints (GdkWindow *window) +gdk_surface_supports_edge_constraints (GdkSurface *window) { - GdkWindowImplClass *impl_class; + GdkSurfaceImplClass *impl_class; - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); - g_return_val_if_fail (!GDK_WINDOW_DESTROYED (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); + g_return_val_if_fail (!GDK_SURFACE_DESTROYED (window), FALSE); - impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl); + impl_class = GDK_SURFACE_IMPL_GET_CLASS (window->impl); if (impl_class->supports_edge_constraints) return impl_class->supports_edge_constraints (window); @@ -6912,46 +6912,46 @@ gdk_window_supports_edge_constraints (GdkWindow *window) } void -gdk_window_set_state (GdkWindow *window, - GdkWindowState new_state) +gdk_surface_set_state (GdkSurface *window, + GdkSurfaceState new_state) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); if (new_state == window->state) return; /* No actual work to do, nothing changed. */ - /* Actually update the field in GdkWindow, this is sort of an odd + /* Actually update the field in GdkSurface, this is sort of an odd * place to do it, but seems like the safest since it ensures we expose no * inconsistent state to the user. */ window->state = new_state; - _gdk_window_update_viewable (window); + _gdk_surface_update_viewable (window); /* We only really send the event to toplevels, since * all the window states don't apply to non-toplevels. - * Non-toplevels do use the GDK_WINDOW_STATE_WITHDRAWN flag + * Non-toplevels do use the GDK_SURFACE_STATE_WITHDRAWN flag * internally so we needed to update window->state. */ switch (window->window_type) { - case GDK_WINDOW_TOPLEVEL: - case GDK_WINDOW_TEMP: /* ? */ + case GDK_SURFACE_TOPLEVEL: + case GDK_SURFACE_TEMP: /* ? */ g_object_notify (G_OBJECT (window), "state"); break; - case GDK_WINDOW_FOREIGN: - case GDK_WINDOW_ROOT: - case GDK_WINDOW_CHILD: + case GDK_SURFACE_FOREIGN: + case GDK_SURFACE_ROOT: + case GDK_SURFACE_CHILD: default: break; } } void -gdk_synthesize_window_state (GdkWindow *window, - GdkWindowState unset_flags, - GdkWindowState set_flags) +gdk_synthesize_window_state (GdkSurface *window, + GdkSurfaceState unset_flags, + GdkSurfaceState set_flags) { - gdk_window_set_state (window, (window->state | set_flags) & ~unset_flags); + gdk_surface_set_state (window, (window->state | set_flags) & ~unset_flags); } diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h index 281033dd75..ea5ca92858 100644 --- a/gdk/gdkwindow.h +++ b/gdk/gdkwindow.h @@ -22,8 +22,8 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#ifndef __GDK_WINDOW_H__ -#define __GDK_WINDOW_H__ +#ifndef __GDK_SURFACE_H__ +#define __GDK_SURFACE_H__ #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only <gdk/gdk.h> can be included directly." @@ -41,15 +41,15 @@ G_BEGIN_DECLS typedef struct _GdkGeometry GdkGeometry; /** - * GdkWindowType: - * @GDK_WINDOW_ROOT: root window; this window has no parent, covers the entire + * GdkSurfaceType: + * @GDK_SURFACE_ROOT: root window; this window has no parent, covers the entire * screen, and is created by the window system - * @GDK_WINDOW_TOPLEVEL: toplevel window (used to implement #GtkWindow) - * @GDK_WINDOW_CHILD: child window (used to implement e.g. #GtkEntry) - * @GDK_WINDOW_TEMP: override redirect temporary window (used to implement + * @GDK_SURFACE_TOPLEVEL: toplevel window (used to implement #GtkWindow) + * @GDK_SURFACE_CHILD: child window (used to implement e.g. #GtkEntry) + * @GDK_SURFACE_TEMP: override redirect temporary window (used to implement * #GtkMenu) - * @GDK_WINDOW_FOREIGN: foreign window (see gdk_window_foreign_new()) - * @GDK_WINDOW_SUBSURFACE: subsurface-based window; This window is visually + * @GDK_SURFACE_FOREIGN: foreign window (see gdk_surface_foreign_new()) + * @GDK_SURFACE_SUBSURFACE: subsurface-based window; This window is visually * tied to a toplevel, and is moved/stacked with it. Currently this window * type is only implemented in Wayland. Since 3.14 * @@ -57,18 +57,18 @@ typedef struct _GdkGeometry GdkGeometry; */ typedef enum { - GDK_WINDOW_ROOT, - GDK_WINDOW_TOPLEVEL, - GDK_WINDOW_CHILD, - GDK_WINDOW_TEMP, - GDK_WINDOW_FOREIGN, - GDK_WINDOW_SUBSURFACE -} GdkWindowType; + GDK_SURFACE_ROOT, + GDK_SURFACE_TOPLEVEL, + GDK_SURFACE_CHILD, + GDK_SURFACE_TEMP, + GDK_SURFACE_FOREIGN, + GDK_SURFACE_SUBSURFACE +} GdkSurfaceType; /* Size restriction enumeration. */ /** - * GdkWindowHints: + * GdkSurfaceHints: * @GDK_HINT_POS: indicates that the program has positioned the window * @GDK_HINT_MIN_SIZE: min 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_USER_POS = 1 << 7, GDK_HINT_USER_SIZE = 1 << 8 -} GdkWindowHints; +} GdkSurfaceHints; /* The next two enumeration values current match the * 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. */ /** @@ -157,7 +157,7 @@ typedef enum } GdkWMFunction; /* 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. */ /** @@ -239,29 +239,29 @@ typedef enum } GdkAnchorHints; /** - * GdkWindowEdge: - * @GDK_WINDOW_EDGE_NORTH_WEST: the top left corner. - * @GDK_WINDOW_EDGE_NORTH: the top edge. - * @GDK_WINDOW_EDGE_NORTH_EAST: the top right corner. - * @GDK_WINDOW_EDGE_WEST: the left edge. - * @GDK_WINDOW_EDGE_EAST: the right edge. - * @GDK_WINDOW_EDGE_SOUTH_WEST: the lower left corner. - * @GDK_WINDOW_EDGE_SOUTH: the lower edge. - * @GDK_WINDOW_EDGE_SOUTH_EAST: the lower right corner. + * GdkSurfaceEdge: + * @GDK_SURFACE_EDGE_NORTH_WEST: the top left corner. + * @GDK_SURFACE_EDGE_NORTH: the top edge. + * @GDK_SURFACE_EDGE_NORTH_EAST: the top right corner. + * @GDK_SURFACE_EDGE_WEST: the left edge. + * @GDK_SURFACE_EDGE_EAST: the right edge. + * @GDK_SURFACE_EDGE_SOUTH_WEST: the lower left corner. + * @GDK_SURFACE_EDGE_SOUTH: the lower edge. + * @GDK_SURFACE_EDGE_SOUTH_EAST: the lower right corner. * * Determines a window edge or corner. */ typedef enum { - GDK_WINDOW_EDGE_NORTH_WEST, - GDK_WINDOW_EDGE_NORTH, - GDK_WINDOW_EDGE_NORTH_EAST, - GDK_WINDOW_EDGE_WEST, - GDK_WINDOW_EDGE_EAST, - GDK_WINDOW_EDGE_SOUTH_WEST, - GDK_WINDOW_EDGE_SOUTH, - GDK_WINDOW_EDGE_SOUTH_EAST -} GdkWindowEdge; + GDK_SURFACE_EDGE_NORTH_WEST, + GDK_SURFACE_EDGE_NORTH, + GDK_SURFACE_EDGE_NORTH_EAST, + GDK_SURFACE_EDGE_WEST, + GDK_SURFACE_EDGE_EAST, + GDK_SURFACE_EDGE_SOUTH_WEST, + GDK_SURFACE_EDGE_SOUTH, + GDK_SURFACE_EDGE_SOUTH_EAST +} GdkSurfaceEdge; /** * GdkFullscreenMode: @@ -302,9 +302,9 @@ typedef enum * The #GdkGeometry struct gives the window manager information about * a window’s geometry constraints. Normally you would set these on * 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, * gtk_window_set_geometry_hints() performs some interpretation. For example, * #GtkWindow will apply the hints to the geometry widget instead of the @@ -371,62 +371,62 @@ struct _GdkGeometry }; /** - * GdkWindowState: - * @GDK_WINDOW_STATE_WITHDRAWN: the window is not shown. - * @GDK_WINDOW_STATE_ICONIFIED: the window is minimized. - * @GDK_WINDOW_STATE_MAXIMIZED: the window is maximized. - * @GDK_WINDOW_STATE_STICKY: the window is sticky. - * @GDK_WINDOW_STATE_FULLSCREEN: the window is maximized without + * GdkSurfaceState: + * @GDK_SURFACE_STATE_WITHDRAWN: the window is not shown. + * @GDK_SURFACE_STATE_ICONIFIED: the window is minimized. + * @GDK_SURFACE_STATE_MAXIMIZED: the window is maximized. + * @GDK_SURFACE_STATE_STICKY: the window is sticky. + * @GDK_SURFACE_STATE_FULLSCREEN: the window is maximized without * decorations. - * @GDK_WINDOW_STATE_ABOVE: the window is kept above other windows. - * @GDK_WINDOW_STATE_BELOW: the window is kept below other windows. - * @GDK_WINDOW_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_ABOVE: the window is kept above other windows. + * @GDK_SURFACE_STATE_BELOW: the window is kept below other windows. + * @GDK_SURFACE_STATE_FOCUSED: the window is presented as focused (with active decorations). + * @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. - * @GDK_WINDOW_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_WINDOW_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_WINDOW_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_WINDOW_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_TOP_TILED: whether the top edge is tiled, Since 3.91.2 + * @GDK_SURFACE_STATE_TOP_RESIZABLE: whether the top edge is resizable, Since 3.91.2 + * @GDK_SURFACE_STATE_RIGHT_TILED: whether the right edge is tiled, Since 3.91.2 + * @GDK_SURFACE_STATE_RIGHT_RESIZABLE: whether the right edge is resizable, Since 3.91.2 + * @GDK_SURFACE_STATE_BOTTOM_TILED: whether the bottom edge is tiled, Since 3.91.2 + * @GDK_SURFACE_STATE_BOTTOM_RESIZABLE: whether the bottom edge is resizable, Since 3.91.2 + * @GDK_SURFACE_STATE_LEFT_TILED: whether the left edge is tiled, 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. */ typedef enum { - GDK_WINDOW_STATE_WITHDRAWN = 1 << 0, - GDK_WINDOW_STATE_ICONIFIED = 1 << 1, - GDK_WINDOW_STATE_MAXIMIZED = 1 << 2, - GDK_WINDOW_STATE_STICKY = 1 << 3, - GDK_WINDOW_STATE_FULLSCREEN = 1 << 4, - GDK_WINDOW_STATE_ABOVE = 1 << 5, - GDK_WINDOW_STATE_BELOW = 1 << 6, - GDK_WINDOW_STATE_FOCUSED = 1 << 7, - GDK_WINDOW_STATE_TILED = 1 << 8, - GDK_WINDOW_STATE_TOP_TILED = 1 << 9, - GDK_WINDOW_STATE_TOP_RESIZABLE = 1 << 10, - GDK_WINDOW_STATE_RIGHT_TILED = 1 << 11, - GDK_WINDOW_STATE_RIGHT_RESIZABLE = 1 << 12, - GDK_WINDOW_STATE_BOTTOM_TILED = 1 << 13, - GDK_WINDOW_STATE_BOTTOM_RESIZABLE = 1 << 14, - GDK_WINDOW_STATE_LEFT_TILED = 1 << 15, - GDK_WINDOW_STATE_LEFT_RESIZABLE = 1 << 16 -} GdkWindowState; - - -typedef struct _GdkWindowClass GdkWindowClass; - -#define GDK_TYPE_WINDOW (gdk_window_get_type ()) -#define GDK_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW, GdkWindow)) -#define GDK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowClass)) -#define GDK_IS_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW)) -#define GDK_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW)) -#define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowClass)) - - -struct _GdkWindowClass + GDK_SURFACE_STATE_WITHDRAWN = 1 << 0, + GDK_SURFACE_STATE_ICONIFIED = 1 << 1, + GDK_SURFACE_STATE_MAXIMIZED = 1 << 2, + GDK_SURFACE_STATE_STICKY = 1 << 3, + GDK_SURFACE_STATE_FULLSCREEN = 1 << 4, + GDK_SURFACE_STATE_ABOVE = 1 << 5, + GDK_SURFACE_STATE_BELOW = 1 << 6, + GDK_SURFACE_STATE_FOCUSED = 1 << 7, + GDK_SURFACE_STATE_TILED = 1 << 8, + GDK_SURFACE_STATE_TOP_TILED = 1 << 9, + GDK_SURFACE_STATE_TOP_RESIZABLE = 1 << 10, + GDK_SURFACE_STATE_RIGHT_TILED = 1 << 11, + GDK_SURFACE_STATE_RIGHT_RESIZABLE = 1 << 12, + GDK_SURFACE_STATE_BOTTOM_TILED = 1 << 13, + GDK_SURFACE_STATE_BOTTOM_RESIZABLE = 1 << 14, + GDK_SURFACE_STATE_LEFT_TILED = 1 << 15, + GDK_SURFACE_STATE_LEFT_RESIZABLE = 1 << 16 +} GdkSurfaceState; + + +typedef struct _GdkSurfaceClass GdkSurfaceClass; + +#define GDK_TYPE_SURFACE (gdk_surface_get_type ()) +#define GDK_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE, GdkSurface)) +#define GDK_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE, GdkSurfaceClass)) +#define GDK_IS_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE)) +#define GDK_IS_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE)) +#define GDK_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE, GdkSurfaceClass)) + + +struct _GdkSurfaceClass { GObjectClass parent_class; @@ -444,81 +444,81 @@ struct _GdkWindowClass /* Windows */ 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 -GdkWindow * gdk_window_new_toplevel (GdkDisplay *display, +GdkSurface * gdk_surface_new_toplevel (GdkDisplay *display, int width, int height); GDK_AVAILABLE_IN_ALL -GdkWindow * gdk_window_new_popup (GdkDisplay *display, +GdkSurface * gdk_surface_new_popup (GdkDisplay *display, const GdkRectangle *position); GDK_AVAILABLE_IN_ALL -GdkWindow * gdk_window_new_temp (GdkDisplay *display); +GdkSurface * gdk_surface_new_temp (GdkDisplay *display); GDK_AVAILABLE_IN_ALL -GdkWindow * gdk_window_new_child (GdkWindow *parent, +GdkSurface * gdk_surface_new_child (GdkSurface *parent, const GdkRectangle *position); GDK_AVAILABLE_IN_ALL -void gdk_window_destroy (GdkWindow *window); +void gdk_surface_destroy (GdkSurface *window); GDK_AVAILABLE_IN_ALL -GdkWindowType gdk_window_get_window_type (GdkWindow *window); +GdkSurfaceType gdk_surface_get_window_type (GdkSurface *window); GDK_AVAILABLE_IN_ALL -gboolean gdk_window_is_destroyed (GdkWindow *window); +gboolean gdk_surface_is_destroyed (GdkSurface *window); GDK_AVAILABLE_IN_ALL -GdkDisplay * gdk_window_get_display (GdkWindow *window); +GdkDisplay * gdk_surface_get_display (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_show (GdkWindow *window); +void gdk_surface_show (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_hide (GdkWindow *window); +void gdk_surface_hide (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_withdraw (GdkWindow *window); +void gdk_surface_withdraw (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_show_unraised (GdkWindow *window); +void gdk_surface_show_unraised (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_move (GdkWindow *window, +void gdk_surface_move (GdkSurface *window, gint x, gint y); GDK_AVAILABLE_IN_ALL -void gdk_window_resize (GdkWindow *window, +void gdk_surface_resize (GdkSurface *window, gint width, gint height); GDK_AVAILABLE_IN_ALL -void gdk_window_move_resize (GdkWindow *window, +void gdk_surface_move_resize (GdkSurface *window, gint x, gint y, gint width, gint height); GDK_AVAILABLE_IN_ALL -void gdk_window_raise (GdkWindow *window); +void gdk_surface_raise (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_lower (GdkWindow *window); +void gdk_surface_lower (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_restack (GdkWindow *window, - GdkWindow *sibling, +void gdk_surface_restack (GdkSurface *window, + GdkSurface *sibling, gboolean above); GDK_AVAILABLE_IN_ALL -void gdk_window_focus (GdkWindow *window, +void gdk_surface_focus (GdkSurface *window, guint32 timestamp); GDK_AVAILABLE_IN_ALL -void gdk_window_set_user_data (GdkWindow *window, +void gdk_surface_set_user_data (GdkSurface *window, gpointer user_data); GDK_AVAILABLE_IN_ALL -gboolean gdk_window_get_accept_focus (GdkWindow *window); +gboolean gdk_surface_get_accept_focus (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_set_accept_focus (GdkWindow *window, +void gdk_surface_set_accept_focus (GdkSurface *window, gboolean accept_focus); 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 -void gdk_window_set_focus_on_map (GdkWindow *window, +void gdk_surface_set_focus_on_map (GdkSurface *window, gboolean focus_on_map); GDK_AVAILABLE_IN_ALL -void gdk_window_scroll (GdkWindow *window, +void gdk_surface_scroll (GdkSurface *window, gint dx, gint dy); GDK_AVAILABLE_IN_ALL -void gdk_window_move_region (GdkWindow *window, +void gdk_surface_move_region (GdkSurface *window, const cairo_region_t *region, gint dx, gint dy); @@ -528,7 +528,7 @@ void gdk_window_move_region (GdkWindow *window, * - cool feature, needed for Drag and Drag for example. */ 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, gint offset_x, gint offset_y); @@ -541,7 +541,7 @@ void gdk_window_shape_combine_region (GdkWindow *window, * - Raster */ 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 @@ -551,24 +551,24 @@ void gdk_window_set_child_shapes (GdkWindow *window); * - Raster */ GDK_AVAILABLE_IN_ALL -void gdk_window_merge_child_shapes (GdkWindow *window); +void gdk_surface_merge_child_shapes (GdkSurface *window); 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, gint offset_x, gint offset_y); 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 -void gdk_window_merge_child_input_shapes (GdkWindow *window); +void gdk_surface_merge_child_input_shapes (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_set_pass_through (GdkWindow *window, +void gdk_surface_set_pass_through (GdkSurface *window, gboolean pass_through); 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 @@ -577,273 +577,273 @@ gboolean gdk_window_get_pass_through (GdkWindow *window); * viewable in the X sense. */ GDK_AVAILABLE_IN_ALL -gboolean gdk_window_is_visible (GdkWindow *window); +gboolean gdk_surface_is_visible (GdkSurface *window); GDK_AVAILABLE_IN_ALL -gboolean gdk_window_is_viewable (GdkWindow *window); +gboolean gdk_surface_is_viewable (GdkSurface *window); GDK_AVAILABLE_IN_ALL -gboolean gdk_window_is_input_only (GdkWindow *window); +gboolean gdk_surface_is_input_only (GdkSurface *window); GDK_AVAILABLE_IN_ALL -gboolean gdk_window_is_shaped (GdkWindow *window); +gboolean gdk_surface_is_shaped (GdkSurface *window); GDK_AVAILABLE_IN_ALL -GdkWindowState gdk_window_get_state (GdkWindow *window); +GdkSurfaceState gdk_surface_get_state (GdkSurface *window); -/* GdkWindow */ +/* GdkSurface */ GDK_AVAILABLE_IN_ALL -gboolean gdk_window_has_native (GdkWindow *window); +gboolean gdk_surface_has_native (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_set_type_hint (GdkWindow *window, - GdkWindowTypeHint hint); +void gdk_surface_set_type_hint (GdkSurface *window, + GdkSurfaceTypeHint hint); GDK_AVAILABLE_IN_ALL -GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow *window); +GdkSurfaceTypeHint gdk_surface_get_type_hint (GdkSurface *window); GDK_AVAILABLE_IN_ALL -gboolean gdk_window_get_modal_hint (GdkWindow *window); +gboolean gdk_surface_get_modal_hint (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_set_modal_hint (GdkWindow *window, +void gdk_surface_set_modal_hint (GdkSurface *window, gboolean modal); 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); 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); GDK_AVAILABLE_IN_ALL -void gdk_window_set_urgency_hint (GdkWindow *window, +void gdk_surface_set_urgency_hint (GdkSurface *window, gboolean urgent); GDK_AVAILABLE_IN_ALL -void gdk_window_set_geometry_hints (GdkWindow *window, +void gdk_surface_set_geometry_hints (GdkSurface *window, const GdkGeometry *geometry, - GdkWindowHints geom_mask); + GdkSurfaceHints geom_mask); 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 -cairo_region_t *gdk_window_get_visible_region(GdkWindow *window); +cairo_region_t *gdk_surface_get_visible_region(GdkSurface *window); GDK_AVAILABLE_IN_ALL -GdkDrawingContext *gdk_window_begin_draw_frame (GdkWindow *window, +GdkDrawingContext *gdk_surface_begin_draw_frame (GdkSurface *window, GdkDrawContext *context, const cairo_region_t *region); GDK_AVAILABLE_IN_ALL -void gdk_window_end_draw_frame (GdkWindow *window, +void gdk_surface_end_draw_frame (GdkSurface *window, GdkDrawingContext *context); GDK_AVAILABLE_IN_ALL -void gdk_window_set_title (GdkWindow *window, +void gdk_surface_set_title (GdkSurface *window, const gchar *title); GDK_AVAILABLE_IN_ALL -void gdk_window_set_role (GdkWindow *window, +void gdk_surface_set_role (GdkSurface *window, const gchar *role); GDK_AVAILABLE_IN_ALL -void gdk_window_set_startup_id (GdkWindow *window, +void gdk_surface_set_startup_id (GdkSurface *window, const gchar *startup_id); GDK_AVAILABLE_IN_ALL -void gdk_window_set_transient_for (GdkWindow *window, - GdkWindow *parent); +void gdk_surface_set_transient_for (GdkSurface *window, + GdkSurface *parent); GDK_AVAILABLE_IN_ALL -void gdk_window_set_cursor (GdkWindow *window, +void gdk_surface_set_cursor (GdkSurface *window, GdkCursor *cursor); GDK_AVAILABLE_IN_ALL -GdkCursor *gdk_window_get_cursor (GdkWindow *window); +GdkCursor *gdk_surface_get_cursor (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_set_device_cursor (GdkWindow *window, +void gdk_surface_set_device_cursor (GdkSurface *window, GdkDevice *device, GdkCursor *cursor); GDK_AVAILABLE_IN_ALL -GdkCursor *gdk_window_get_device_cursor (GdkWindow *window, +GdkCursor *gdk_surface_get_device_cursor (GdkSurface *window, GdkDevice *device); GDK_AVAILABLE_IN_ALL -void gdk_window_get_user_data (GdkWindow *window, +void gdk_surface_get_user_data (GdkSurface *window, gpointer *data); GDK_AVAILABLE_IN_ALL -void gdk_window_get_geometry (GdkWindow *window, +void gdk_surface_get_geometry (GdkSurface *window, gint *x, gint *y, gint *width, gint *height); GDK_AVAILABLE_IN_ALL -int gdk_window_get_width (GdkWindow *window); +int gdk_surface_get_width (GdkSurface *window); GDK_AVAILABLE_IN_ALL -int gdk_window_get_height (GdkWindow *window); +int gdk_surface_get_height (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_get_position (GdkWindow *window, +void gdk_surface_get_position (GdkSurface *window, gint *x, gint *y); GDK_AVAILABLE_IN_ALL -gint gdk_window_get_origin (GdkWindow *window, +gint gdk_surface_get_origin (GdkSurface *window, gint *x, gint *y); GDK_AVAILABLE_IN_ALL -void gdk_window_get_root_coords (GdkWindow *window, +void gdk_surface_get_root_coords (GdkSurface *window, gint x, gint y, gint *root_x, gint *root_y); GDK_AVAILABLE_IN_ALL -void gdk_window_coords_to_parent (GdkWindow *window, +void gdk_surface_coords_to_parent (GdkSurface *window, gdouble x, gdouble y, gdouble *parent_x, gdouble *parent_y); 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_y, gdouble *x, gdouble *y); GDK_AVAILABLE_IN_ALL -void gdk_window_get_root_origin (GdkWindow *window, +void gdk_surface_get_root_origin (GdkSurface *window, gint *x, gint *y); GDK_AVAILABLE_IN_ALL -void gdk_window_get_frame_extents (GdkWindow *window, +void gdk_surface_get_frame_extents (GdkSurface *window, GdkRectangle *rect); GDK_AVAILABLE_IN_ALL -gint gdk_window_get_scale_factor (GdkWindow *window); +gint gdk_surface_get_scale_factor (GdkSurface *window); GDK_AVAILABLE_IN_ALL -GdkWindow * gdk_window_get_device_position (GdkWindow *window, +GdkSurface * gdk_surface_get_device_position (GdkSurface *window, GdkDevice *device, gint *x, gint *y, GdkModifierType *mask); GDK_AVAILABLE_IN_ALL -GdkWindow * gdk_window_get_device_position_double (GdkWindow *window, +GdkSurface * gdk_surface_get_device_position_double (GdkSurface *window, GdkDevice *device, gdouble *x, gdouble *y, GdkModifierType *mask); GDK_AVAILABLE_IN_ALL -GdkWindow * gdk_window_get_parent (GdkWindow *window); +GdkSurface * gdk_surface_get_parent (GdkSurface *window); GDK_AVAILABLE_IN_ALL -GdkWindow * gdk_window_get_toplevel (GdkWindow *window); +GdkSurface * gdk_surface_get_toplevel (GdkSurface *window); GDK_AVAILABLE_IN_ALL -GList * gdk_window_get_children (GdkWindow *window); +GList * gdk_surface_get_children (GdkSurface *window); GDK_AVAILABLE_IN_ALL -GList * gdk_window_peek_children (GdkWindow *window); +GList * gdk_surface_peek_children (GdkSurface *window); 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); GDK_AVAILABLE_IN_ALL -GdkEventMask gdk_window_get_events (GdkWindow *window); +GdkEventMask gdk_surface_get_events (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_set_events (GdkWindow *window, +void gdk_surface_set_events (GdkSurface *window, GdkEventMask event_mask); GDK_AVAILABLE_IN_ALL -void gdk_window_set_device_events (GdkWindow *window, +void gdk_surface_set_device_events (GdkSurface *window, GdkDevice *device, GdkEventMask event_mask); GDK_AVAILABLE_IN_ALL -GdkEventMask gdk_window_get_device_events (GdkWindow *window, +GdkEventMask gdk_surface_get_device_events (GdkSurface *window, GdkDevice *device); GDK_AVAILABLE_IN_ALL -void gdk_window_set_icon_list (GdkWindow *window, +void gdk_surface_set_icon_list (GdkSurface *window, GList *surfaces); GDK_AVAILABLE_IN_ALL -void gdk_window_set_icon_name (GdkWindow *window, +void gdk_surface_set_icon_name (GdkSurface *window, const gchar *name); GDK_AVAILABLE_IN_ALL -void gdk_window_set_group (GdkWindow *window, - GdkWindow *leader); +void gdk_surface_set_group (GdkSurface *window, + GdkSurface *leader); GDK_AVAILABLE_IN_ALL -GdkWindow* gdk_window_get_group (GdkWindow *window); +GdkSurface* gdk_surface_get_group (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_set_decorations (GdkWindow *window, +void gdk_surface_set_decorations (GdkSurface *window, GdkWMDecoration decorations); GDK_AVAILABLE_IN_ALL -gboolean gdk_window_get_decorations (GdkWindow *window, +gboolean gdk_surface_get_decorations (GdkSurface *window, GdkWMDecoration *decorations); GDK_AVAILABLE_IN_ALL -void gdk_window_set_functions (GdkWindow *window, +void gdk_surface_set_functions (GdkSurface *window, GdkWMFunction functions); GDK_AVAILABLE_IN_ALL cairo_surface_t * - gdk_window_create_similar_surface (GdkWindow *window, + gdk_surface_create_similar_surface (GdkSurface *window, cairo_content_t content, int width, int height); GDK_AVAILABLE_IN_ALL cairo_surface_t * - gdk_window_create_similar_image_surface (GdkWindow *window, + gdk_surface_create_similar_image_surface (GdkSurface *window, cairo_format_t format, int width, int height, int scale); GDK_AVAILABLE_IN_ALL -void gdk_window_beep (GdkWindow *window); +void gdk_surface_beep (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_iconify (GdkWindow *window); +void gdk_surface_iconify (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_deiconify (GdkWindow *window); +void gdk_surface_deiconify (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_stick (GdkWindow *window); +void gdk_surface_stick (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_unstick (GdkWindow *window); +void gdk_surface_unstick (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_maximize (GdkWindow *window); +void gdk_surface_maximize (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_unmaximize (GdkWindow *window); +void gdk_surface_unmaximize (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_fullscreen (GdkWindow *window); +void gdk_surface_fullscreen (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_fullscreen_on_monitor (GdkWindow *window, +void gdk_surface_fullscreen_on_monitor (GdkSurface *window, GdkMonitor *monitor); GDK_AVAILABLE_IN_ALL -void gdk_window_set_fullscreen_mode (GdkWindow *window, +void gdk_surface_set_fullscreen_mode (GdkSurface *window, GdkFullscreenMode mode); GDK_AVAILABLE_IN_ALL GdkFullscreenMode - gdk_window_get_fullscreen_mode (GdkWindow *window); + gdk_surface_get_fullscreen_mode (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_unfullscreen (GdkWindow *window); +void gdk_surface_unfullscreen (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_set_keep_above (GdkWindow *window, +void gdk_surface_set_keep_above (GdkSurface *window, gboolean setting); GDK_AVAILABLE_IN_ALL -void gdk_window_set_keep_below (GdkWindow *window, +void gdk_surface_set_keep_below (GdkSurface *window, gboolean setting); GDK_AVAILABLE_IN_ALL -void gdk_window_set_opacity (GdkWindow *window, +void gdk_surface_set_opacity (GdkSurface *window, gdouble opacity); GDK_AVAILABLE_IN_ALL -void gdk_window_register_dnd (GdkWindow *window); +void gdk_surface_register_dnd (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_begin_resize_drag (GdkWindow *window, - GdkWindowEdge edge, +void gdk_surface_begin_resize_drag (GdkSurface *window, + GdkSurfaceEdge edge, gint button, gint root_x, gint root_y, guint32 timestamp); GDK_AVAILABLE_IN_ALL -void gdk_window_begin_resize_drag_for_device (GdkWindow *window, - GdkWindowEdge edge, +void gdk_surface_begin_resize_drag_for_device (GdkSurface *window, + GdkSurfaceEdge edge, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp); GDK_AVAILABLE_IN_ALL -void gdk_window_begin_move_drag (GdkWindow *window, +void gdk_surface_begin_move_drag (GdkSurface *window, gint button, gint root_x, gint root_y, guint32 timestamp); 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, gint button, gint root_x, @@ -852,44 +852,44 @@ void gdk_window_begin_move_drag_for_device (GdkWindow *window, /* Interface for dirty-region queueing */ GDK_AVAILABLE_IN_ALL -void gdk_window_invalidate_rect (GdkWindow *window, +void gdk_surface_invalidate_rect (GdkSurface *window, const GdkRectangle *rect, gboolean invalidate_children); GDK_AVAILABLE_IN_ALL -void gdk_window_invalidate_region (GdkWindow *window, +void gdk_surface_invalidate_region (GdkSurface *window, const cairo_region_t *region, gboolean invalidate_children); /** - * GdkWindowChildFunc: - * @window: a #GdkWindow + * GdkSurfaceChildFunc: + * @window: a #GdkSurface * @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 * recursively invalidate it or now. * * Returns: %TRUE to invalidate @window recursively */ -typedef gboolean (*GdkWindowChildFunc) (GdkWindow *window, +typedef gboolean (*GdkSurfaceChildFunc) (GdkSurface *window, gpointer user_data); 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, - GdkWindowChildFunc child_func, + GdkSurfaceChildFunc child_func, gpointer user_data); 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 -void gdk_window_freeze_updates (GdkWindow *window); +void gdk_surface_freeze_updates (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_thaw_updates (GdkWindow *window); +void gdk_surface_thaw_updates (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_constrain_size (GdkGeometry *geometry, - GdkWindowHints flags, +void gdk_surface_constrain_size (GdkGeometry *geometry, + GdkSurfaceHints flags, gint width, gint height, gint *new_width, @@ -897,37 +897,37 @@ void gdk_window_constrain_size (GdkGeometry *geometry, /* Multidevice support */ GDK_AVAILABLE_IN_ALL -void gdk_window_set_support_multidevice (GdkWindow *window, +void gdk_surface_set_support_multidevice (GdkSurface *window, gboolean support_multidevice); GDK_AVAILABLE_IN_ALL -gboolean gdk_window_get_support_multidevice (GdkWindow *window); +gboolean gdk_surface_get_support_multidevice (GdkSurface *window); /* Frame clock */ GDK_AVAILABLE_IN_ALL -GdkFrameClock* gdk_window_get_frame_clock (GdkWindow *window); +GdkFrameClock* gdk_surface_get_frame_clock (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_window_set_opaque_region (GdkWindow *window, +void gdk_surface_set_opaque_region (GdkSurface *window, cairo_region_t *region); GDK_AVAILABLE_IN_ALL -void gdk_window_set_shadow_width (GdkWindow *window, +void gdk_surface_set_shadow_width (GdkSurface *window, gint left, gint right, gint top, gint bottom); GDK_AVAILABLE_IN_ALL -gboolean gdk_window_show_window_menu (GdkWindow *window, +gboolean gdk_surface_show_window_menu (GdkSurface *window, GdkEvent *event); GDK_AVAILABLE_IN_ALL -GdkGLContext * gdk_window_create_gl_context (GdkWindow *window, +GdkGLContext * gdk_surface_create_gl_context (GdkSurface *window, GError **error); GDK_AVAILABLE_IN_ALL GdkVulkanContext * - gdk_window_create_vulkan_context(GdkWindow *window, + gdk_surface_create_vulkan_context(GdkSurface *window, GError **error); G_END_DECLS -#endif /* __GDK_WINDOW_H__ */ +#endif /* __GDK_SURFACE_H__ */ diff --git a/gdk/gdkwindowimpl.c b/gdk/gdkwindowimpl.c index af445e3bd6..d182a40cfc 100644 --- a/gdk/gdkwindowimpl.c +++ b/gdk/gdkwindowimpl.c @@ -29,10 +29,10 @@ #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 -gdk_window_impl_beep (GdkWindow *window) +gdk_surface_impl_beep (GdkSurface *window) { /* FALSE means windows can't beep, so the display will be * made to beep instead. */ @@ -40,15 +40,15 @@ gdk_window_impl_beep (GdkWindow *window) } static GdkDisplay * -get_display_for_window (GdkWindow *primary, - GdkWindow *secondary) +get_display_for_window (GdkSurface *primary, + GdkSurface *secondary) { - GdkDisplay *display = gdk_window_get_display (primary); + GdkDisplay *display = gdk_surface_get_display (primary); if (display) return display; - display = gdk_window_get_display (secondary); + display = gdk_surface_get_display (secondary); if (display) return display; @@ -173,21 +173,21 @@ maybe_flip_position (gint bounds_pos, return primary; } -static GdkWindow * -traverse_to_toplevel (GdkWindow *window, +static GdkSurface * +traverse_to_toplevel (GdkSurface *window, gint x, gint y, gint *toplevel_x, gint *toplevel_y) { - GdkWindow *parent; + GdkSurface *parent; gdouble xf = x; gdouble yf = y; 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; } @@ -197,7 +197,7 @@ traverse_to_toplevel (GdkWindow *window, } static void -gdk_window_impl_move_to_rect (GdkWindow *window, +gdk_surface_impl_move_to_rect (GdkSurface *window, const GdkRectangle *rect, GdkGravity rect_anchor, GdkGravity window_anchor, @@ -205,7 +205,7 @@ gdk_window_impl_move_to_rect (GdkWindow *window, gint rect_anchor_dx, gint rect_anchor_dy) { - GdkWindow *transient_for_toplevel; + GdkSurface *transient_for_toplevel; GdkDisplay *display; GdkMonitor *monitor; GdkRectangle bounds; @@ -226,7 +226,7 @@ gdk_window_impl_move_to_rect (GdkWindow *window, &root_rect.x, &root_rect.y); - gdk_window_get_root_coords (transient_for_toplevel, + gdk_surface_get_root_coords (transient_for_toplevel, root_rect.x, root_rect.y, &root_rect.x, @@ -314,9 +314,9 @@ gdk_window_impl_move_to_rect (GdkWindow *window, final_rect.height += window->shadow_top + window->shadow_bottom; 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 - 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, "moved-to-rect", @@ -327,21 +327,21 @@ gdk_window_impl_move_to_rect (GdkWindow *window, } static void -gdk_window_impl_process_updates_recurse (GdkWindow *window, +gdk_surface_impl_process_updates_recurse (GdkSurface *window, cairo_region_t *region) { - _gdk_window_process_updates_recurse (window, region); + _gdk_surface_process_updates_recurse (window, region); } 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->move_to_rect = gdk_window_impl_move_to_rect; - impl_class->process_updates_recurse = gdk_window_impl_process_updates_recurse; + impl_class->beep = gdk_surface_impl_beep; + impl_class->move_to_rect = gdk_surface_impl_move_to_rect; + impl_class->process_updates_recurse = gdk_surface_impl_process_updates_recurse; } static void -gdk_window_impl_init (GdkWindowImpl *impl) +gdk_surface_impl_init (GdkSurfaceImpl *impl) { } diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h index 2185b6aedc..076feff090 100644 --- a/gdk/gdkwindowimpl.h +++ b/gdk/gdkwindowimpl.h @@ -22,58 +22,58 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#ifndef __GDK_WINDOW_IMPL_H__ -#define __GDK_WINDOW_IMPL_H__ +#ifndef __GDK_SURFACE_IMPL_H__ +#define __GDK_SURFACE_IMPL_H__ #include <gdk/gdkwindow.h> #include <gdk/gdkproperty.h> G_BEGIN_DECLS -#define GDK_TYPE_WINDOW_IMPL (gdk_window_impl_get_type ()) -#define GDK_WINDOW_IMPL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL, GdkWindowImpl)) -#define GDK_WINDOW_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL, GdkWindowImplClass)) -#define GDK_IS_WINDOW_IMPL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL)) -#define GDK_IS_WINDOW_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL)) -#define GDK_WINDOW_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL, GdkWindowImplClass)) +#define GDK_TYPE_SURFACE_IMPL (gdk_surface_impl_get_type ()) +#define GDK_SURFACE_IMPL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL, GdkSurfaceImpl)) +#define GDK_SURFACE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL, GdkSurfaceImplClass)) +#define GDK_IS_SURFACE_IMPL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL)) +#define GDK_IS_SURFACE_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL)) +#define GDK_SURFACE_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL, GdkSurfaceImplClass)) -typedef struct _GdkWindowImpl GdkWindowImpl; -typedef struct _GdkWindowImplClass GdkWindowImplClass; +typedef struct _GdkSurfaceImpl GdkSurfaceImpl; +typedef struct _GdkSurfaceImplClass GdkSurfaceImplClass; -struct _GdkWindowImpl +struct _GdkSurfaceImpl { GObject parent; }; -struct _GdkWindowImplClass +struct _GdkSurfaceImplClass { GObjectClass parent_class; cairo_surface_t * - (* ref_cairo_surface) (GdkWindow *window); + (* ref_cairo_surface) (GdkSurface *window); cairo_surface_t * - (* create_similar_image_surface) (GdkWindow * window, + (* create_similar_image_surface) (GdkSurface * window, cairo_format_t format, int width, int height); - void (* show) (GdkWindow *window, + void (* show) (GdkSurface *window, gboolean already_mapped); - void (* hide) (GdkWindow *window); - void (* withdraw) (GdkWindow *window); - void (* raise) (GdkWindow *window); - void (* lower) (GdkWindow *window); - void (* restack_toplevel) (GdkWindow *window, - GdkWindow *sibling, + void (* hide) (GdkSurface *window); + void (* withdraw) (GdkSurface *window); + void (* raise) (GdkSurface *window); + void (* lower) (GdkSurface *window); + void (* restack_toplevel) (GdkSurface *window, + GdkSurface *sibling, gboolean above); - void (* move_resize) (GdkWindow *window, + void (* move_resize) (GdkSurface *window, gboolean with_move, gint x, gint y, gint width, gint height); - void (* move_to_rect) (GdkWindow *window, + void (* move_to_rect) (GdkSurface *window, const GdkRectangle *rect, GdkGravity rect_anchor, GdkGravity window_anchor, @@ -81,33 +81,33 @@ struct _GdkWindowImplClass gint rect_anchor_dx, gint rect_anchor_dy); - GdkEventMask (* get_events) (GdkWindow *window); - void (* set_events) (GdkWindow *window, + GdkEventMask (* get_events) (GdkSurface *window); + void (* set_events) (GdkSurface *window, GdkEventMask event_mask); - void (* get_geometry) (GdkWindow *window, + void (* get_geometry) (GdkSurface *window, gint *x, gint *y, gint *width, gint *height); - void (* get_root_coords) (GdkWindow *window, + void (* get_root_coords) (GdkSurface *window, gint x, gint y, gint *root_x, gint *root_y); - gboolean (* get_device_state) (GdkWindow *window, + gboolean (* get_device_state) (GdkSurface *window, GdkDevice *device, gdouble *x, gdouble *y, GdkModifierType *mask); - gboolean (* begin_paint) (GdkWindow *window); - void (* end_paint) (GdkWindow *window); + gboolean (* begin_paint) (GdkSurface *window); + void (* end_paint) (GdkSurface *window); - void (* shape_combine_region) (GdkWindow *window, + void (* shape_combine_region) (GdkSurface *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y); - void (* input_shape_combine_region) (GdkWindow *window, + void (* input_shape_combine_region) (GdkSurface *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y); @@ -116,10 +116,10 @@ struct _GdkWindowImplClass * layer a chance to save the region for later use in avoiding duplicate * exposes. */ - void (* queue_antiexpose) (GdkWindow *window, + void (* queue_antiexpose) (GdkSurface *window, 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 * 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 * for some windowing systems.) */ - void (* destroy) (GdkWindow *window, + void (* destroy) (GdkSurface *window, gboolean recursing, gboolean foreign_destroy); /* optional */ - gboolean (* beep) (GdkWindow *window); + gboolean (* beep) (GdkSurface *window); - void (* focus) (GdkWindow *window, + void (* focus) (GdkSurface *window, guint32 timestamp); - void (* set_type_hint) (GdkWindow *window, - GdkWindowTypeHint hint); - GdkWindowTypeHint (* get_type_hint) (GdkWindow *window); - void (* set_modal_hint) (GdkWindow *window, + void (* set_type_hint) (GdkSurface *window, + GdkSurfaceTypeHint hint); + GdkSurfaceTypeHint (* get_type_hint) (GdkSurface *window); + void (* set_modal_hint) (GdkSurface *window, gboolean modal); - void (* set_skip_taskbar_hint) (GdkWindow *window, + void (* set_skip_taskbar_hint) (GdkSurface *window, gboolean skips_taskbar); - void (* set_skip_pager_hint) (GdkWindow *window, + void (* set_skip_pager_hint) (GdkSurface *window, gboolean skips_pager); - void (* set_urgency_hint) (GdkWindow *window, + void (* set_urgency_hint) (GdkSurface *window, gboolean urgent); - void (* set_geometry_hints) (GdkWindow *window, + void (* set_geometry_hints) (GdkSurface *window, const GdkGeometry *geometry, - GdkWindowHints geom_mask); - void (* set_title) (GdkWindow *window, + GdkSurfaceHints geom_mask); + void (* set_title) (GdkSurface *window, const gchar *title); - void (* set_role) (GdkWindow *window, + void (* set_role) (GdkSurface *window, const gchar *role); - void (* set_startup_id) (GdkWindow *window, + void (* set_startup_id) (GdkSurface *window, const gchar *startup_id); - void (* set_transient_for) (GdkWindow *window, - GdkWindow *parent); - void (* get_frame_extents) (GdkWindow *window, + void (* set_transient_for) (GdkSurface *window, + GdkSurface *parent); + void (* get_frame_extents) (GdkSurface *window, GdkRectangle *rect); - void (* set_accept_focus) (GdkWindow *window, + void (* set_accept_focus) (GdkSurface *window, gboolean accept_focus); - void (* set_focus_on_map) (GdkWindow *window, + void (* set_focus_on_map) (GdkSurface *window, gboolean focus_on_map); - void (* set_icon_list) (GdkWindow *window, + void (* set_icon_list) (GdkSurface *window, GList *pixbufs); - void (* set_icon_name) (GdkWindow *window, + void (* set_icon_name) (GdkSurface *window, const gchar *name); - void (* iconify) (GdkWindow *window); - void (* deiconify) (GdkWindow *window); - void (* stick) (GdkWindow *window); - void (* unstick) (GdkWindow *window); - void (* maximize) (GdkWindow *window); - void (* unmaximize) (GdkWindow *window); - void (* fullscreen) (GdkWindow *window); - void (* fullscreen_on_monitor) (GdkWindow *window, + void (* iconify) (GdkSurface *window); + void (* deiconify) (GdkSurface *window); + void (* stick) (GdkSurface *window); + void (* unstick) (GdkSurface *window); + void (* maximize) (GdkSurface *window); + void (* unmaximize) (GdkSurface *window); + void (* fullscreen) (GdkSurface *window); + void (* fullscreen_on_monitor) (GdkSurface *window, GdkMonitor *monitor); - void (* apply_fullscreen_mode) (GdkWindow *window); - void (* unfullscreen) (GdkWindow *window); - void (* set_keep_above) (GdkWindow *window, + void (* apply_fullscreen_mode) (GdkSurface *window); + void (* unfullscreen) (GdkSurface *window); + void (* set_keep_above) (GdkSurface *window, gboolean setting); - void (* set_keep_below) (GdkWindow *window, + void (* set_keep_below) (GdkSurface *window, gboolean setting); - GdkWindow * (* get_group) (GdkWindow *window); - void (* set_group) (GdkWindow *window, - GdkWindow *leader); - void (* set_decorations) (GdkWindow *window, + GdkSurface * (* get_group) (GdkSurface *window); + void (* set_group) (GdkSurface *window, + GdkSurface *leader); + void (* set_decorations) (GdkSurface *window, GdkWMDecoration decorations); - gboolean (* get_decorations) (GdkWindow *window, + gboolean (* get_decorations) (GdkSurface *window, GdkWMDecoration *decorations); - void (* set_functions) (GdkWindow *window, + void (* set_functions) (GdkSurface *window, GdkWMFunction functions); - void (* begin_resize_drag) (GdkWindow *window, - GdkWindowEdge edge, + void (* begin_resize_drag) (GdkSurface *window, + GdkSurfaceEdge edge, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp); - void (* begin_move_drag) (GdkWindow *window, + void (* begin_move_drag) (GdkSurface *window, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp); - void (* enable_synchronized_configure) (GdkWindow *window); - void (* configure_finished) (GdkWindow *window); - void (* set_opacity) (GdkWindow *window, + void (* enable_synchronized_configure) (GdkSurface *window); + void (* configure_finished) (GdkSurface *window); + void (* set_opacity) (GdkSurface *window, gdouble opacity); - void (* destroy_notify) (GdkWindow *window); - void (* register_dnd) (GdkWindow *window); - GdkDragContext * (*drag_begin) (GdkWindow *window, + void (* destroy_notify) (GdkSurface *window); + void (* register_dnd) (GdkSurface *window); + GdkDragContext * (*drag_begin) (GdkSurface *window, GdkDevice *device, GdkContentProvider*content, GdkDragAction actions, gint dx, gint dy); - void (*process_updates_recurse) (GdkWindow *window, + void (*process_updates_recurse) (GdkSurface *window, cairo_region_t *region); - gint (* get_scale_factor) (GdkWindow *window); - void (* get_unscaled_size) (GdkWindow *window, + gint (* get_scale_factor) (GdkSurface *window); + void (* get_unscaled_size) (GdkSurface *window, int *unscaled_width, int *unscaled_height); - void (* set_opaque_region) (GdkWindow *window, + void (* set_opaque_region) (GdkSurface *window, cairo_region_t *region); - void (* set_shadow_width) (GdkWindow *window, + void (* set_shadow_width) (GdkSurface *window, gint left, gint right, gint top, gint bottom); - gboolean (* show_window_menu) (GdkWindow *window, + gboolean (* show_window_menu) (GdkSurface *window, GdkEvent *event); - GdkGLContext *(*create_gl_context) (GdkWindow *window, + GdkGLContext *(*create_gl_context) (GdkSurface *window, gboolean attached, GdkGLContext *share, GError **error); - gboolean (* supports_edge_constraints)(GdkWindow *window); + gboolean (* supports_edge_constraints)(GdkSurface *window); }; /* 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 -#endif /* __GDK_WINDOW_IMPL_H__ */ +#endif /* __GDK_SURFACE_IMPL_H__ */ diff --git a/gdk/quartz/GdkQuartzNSWindow.c b/gdk/quartz/GdkQuartzNSWindow.c index c5296b12ea..bdb86011ab 100644 --- a/gdk/quartz/GdkQuartzNSWindow.c +++ b/gdk/quartz/GdkQuartzNSWindow.c @@ -1,4 +1,4 @@ -/* GdkQuartzWindow.m +/* GdkQuartzSurface.m * * Copyright (C) 2005-2007 Imendio AB * @@ -34,7 +34,7 @@ -(BOOL)windowShouldClose:(id)sender { - GdkWindow *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkWindow]; GdkEvent *event; event = gdk_event_new (GDK_DELETE); @@ -49,47 +49,47 @@ -(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 { - GdkWindow *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkWindow]; gdk_synthesize_window_state (window, 0, - GDK_WINDOW_STATE_ICONIFIED); + GDK_SURFACE_STATE_ICONIFIED); } -(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 { - 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); } -(void)windowDidResignKey:(NSNotification *)aNotification { - GdkWindow *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkWindow]; _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 { - GdkWindow *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkWindow]; if (![self isVisible]) { @@ -101,15 +101,15 @@ return; } - _gdk_quartz_window_did_become_main (window); + _gdk_quartz_surface_did_become_main (window); } -(void)windowDidResignMain:(NSNotification *)aNotification { - GdkWindow *window; + GdkSurface *window; 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 @@ -154,8 +154,8 @@ -(void)checkSendEnterNotify { - GdkWindow *window = [[self contentView] gdkWindow]; - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); /* When a new window has been created, and the mouse * is in the window area, we will not receive an NSMouseEntered @@ -186,21 +186,21 @@ -(void)windowDidMove:(NSNotification *)aNotification { - GdkWindow *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkWindow]; GdkEvent *event; - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); - gboolean maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED; + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); + gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED; /* In case the window is changed when maximized remove the maximized state */ if (maximized && !inMaximizeTransition && !NSEqualRects (lastMaximizedFrame, [self frame])) { gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_MAXIMIZED, + GDK_SURFACE_STATE_MAXIMIZED, 0); } - _gdk_quartz_window_update_position (window); + _gdk_quartz_surface_update_position (window); /* Synthesize a configure event */ event = gdk_event_new (GDK_CONFIGURE); @@ -218,16 +218,16 @@ -(void)windowDidResize:(NSNotification *)aNotification { NSRect content_rect = [self contentRectForFrameRect:[self frame]]; - GdkWindow *window = [[self contentView] gdkWindow]; + GdkSurface *window = [[self contentView] gdkWindow]; GdkEvent *event; - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); - gboolean maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED; + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); + gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED; /* see same in windowDidMove */ if (maximized && !inMaximizeTransition && !NSEqualRects (lastMaximizedFrame, [self frame])) { gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_MAXIMIZED, + GDK_SURFACE_STATE_MAXIMIZED, 0); } @@ -237,11 +237,11 @@ /* Certain resize operations (e.g. going fullscreen), also move the * 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)]; - _gdk_window_update_size (window); + _gdk_surface_update_size (window); /* Synthesize a configure event */ event = gdk_event_new (GDK_CONFIGURE); @@ -273,27 +273,27 @@ -(BOOL)canBecomeMainWindow { - GdkWindow *window = [[self contentView] gdkWindow]; - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); switch (impl->type_hint) { - case GDK_WINDOW_TYPE_HINT_NORMAL: - case GDK_WINDOW_TYPE_HINT_DIALOG: + case GDK_SURFACE_TYPE_HINT_NORMAL: + case GDK_SURFACE_TYPE_HINT_DIALOG: return YES; - case GDK_WINDOW_TYPE_HINT_MENU: - case GDK_WINDOW_TYPE_HINT_TOOLBAR: - case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: - case GDK_WINDOW_TYPE_HINT_UTILITY: - case GDK_WINDOW_TYPE_HINT_DOCK: - case GDK_WINDOW_TYPE_HINT_DESKTOP: - case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: - case GDK_WINDOW_TYPE_HINT_POPUP_MENU: - case GDK_WINDOW_TYPE_HINT_TOOLTIP: - case GDK_WINDOW_TYPE_HINT_NOTIFICATION: - case GDK_WINDOW_TYPE_HINT_COMBO: - case GDK_WINDOW_TYPE_HINT_DND: + case GDK_SURFACE_TYPE_HINT_MENU: + case GDK_SURFACE_TYPE_HINT_TOOLBAR: + case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN: + case GDK_SURFACE_TYPE_HINT_UTILITY: + case GDK_SURFACE_TYPE_HINT_DOCK: + case GDK_SURFACE_TYPE_HINT_DESKTOP: + case GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU: + case GDK_SURFACE_TYPE_HINT_POPUP_MENU: + case GDK_SURFACE_TYPE_HINT_TOOLTIP: + case GDK_SURFACE_TYPE_HINT_NOTIFICATION: + case GDK_SURFACE_TYPE_HINT_COMBO: + case GDK_SURFACE_TYPE_HINT_DND: return NO; } @@ -302,8 +302,8 @@ -(BOOL)canBecomeKeyWindow { - GdkWindow *window = [[self contentView] gdkWindow]; - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (!window->accept_focus) return NO; @@ -311,27 +311,27 @@ /* Popup windows should not be able to get focused in the window * manager sense, it's only handled through grabs. */ - if (window->window_type == GDK_WINDOW_TEMP) + if (window->window_type == GDK_SURFACE_TEMP) return NO; switch (impl->type_hint) { - case GDK_WINDOW_TYPE_HINT_NORMAL: - case GDK_WINDOW_TYPE_HINT_DIALOG: - case GDK_WINDOW_TYPE_HINT_MENU: - case GDK_WINDOW_TYPE_HINT_TOOLBAR: - case GDK_WINDOW_TYPE_HINT_UTILITY: - case GDK_WINDOW_TYPE_HINT_DOCK: - case GDK_WINDOW_TYPE_HINT_DESKTOP: - case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: - case GDK_WINDOW_TYPE_HINT_POPUP_MENU: - case GDK_WINDOW_TYPE_HINT_COMBO: + case GDK_SURFACE_TYPE_HINT_NORMAL: + case GDK_SURFACE_TYPE_HINT_DIALOG: + case GDK_SURFACE_TYPE_HINT_MENU: + case GDK_SURFACE_TYPE_HINT_TOOLBAR: + case GDK_SURFACE_TYPE_HINT_UTILITY: + case GDK_SURFACE_TYPE_HINT_DOCK: + case GDK_SURFACE_TYPE_HINT_DESKTOP: + case GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU: + case GDK_SURFACE_TYPE_HINT_POPUP_MENU: + case GDK_SURFACE_TYPE_HINT_COMBO: return YES; - case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: - case GDK_WINDOW_TYPE_HINT_TOOLTIP: - case GDK_WINDOW_TYPE_HINT_NOTIFICATION: - case GDK_WINDOW_TYPE_HINT_DND: + case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN: + case GDK_SURFACE_TYPE_HINT_TOOLTIP: + case GDK_SURFACE_TYPE_HINT_NOTIFICATION: + case GDK_SURFACE_TYPE_HINT_DND: return NO; } @@ -340,8 +340,8 @@ - (void)showAndMakeKey:(BOOL)makeKey { - GdkWindow *window = [[self contentView] gdkWindow]; - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); inShowOrHide = YES; @@ -357,8 +357,8 @@ - (void)hide { - GdkWindow *window = [[self contentView] gdkWindow]; - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); inShowOrHide = YES; [impl->toplevel orderOut:nil]; @@ -369,8 +369,8 @@ - (BOOL)trackManualMove { - GdkWindow *window = [[self contentView] gdkWindow]; - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); NSPoint currentLocation; NSPoint newOrigin; NSRect screenFrame = [[NSScreen mainScreen] visibleFrame]; @@ -435,28 +435,28 @@ * height and position. */ dw = dh = dx = dy = 0.0; - if (resizeEdge == GDK_WINDOW_EDGE_EAST || - resizeEdge == GDK_WINDOW_EDGE_NORTH_EAST || - resizeEdge == GDK_WINDOW_EDGE_SOUTH_EAST) + if (resizeEdge == GDK_SURFACE_EDGE_EAST || + resizeEdge == GDK_SURFACE_EDGE_NORTH_EAST || + resizeEdge == GDK_SURFACE_EDGE_SOUTH_EAST) { dw = -1.0; } - if (resizeEdge == GDK_WINDOW_EDGE_NORTH || - resizeEdge == GDK_WINDOW_EDGE_NORTH_WEST || - resizeEdge == GDK_WINDOW_EDGE_NORTH_EAST) + if (resizeEdge == GDK_SURFACE_EDGE_NORTH || + resizeEdge == GDK_SURFACE_EDGE_NORTH_WEST || + resizeEdge == GDK_SURFACE_EDGE_NORTH_EAST) { dh = -1.0; } - if (resizeEdge == GDK_WINDOW_EDGE_SOUTH || - resizeEdge == GDK_WINDOW_EDGE_SOUTH_WEST || - resizeEdge == GDK_WINDOW_EDGE_SOUTH_EAST) + if (resizeEdge == GDK_SURFACE_EDGE_SOUTH || + resizeEdge == GDK_SURFACE_EDGE_SOUTH_WEST || + resizeEdge == GDK_SURFACE_EDGE_SOUTH_EAST) { dh = 1.0; dy = -1.0; } - if (resizeEdge == GDK_WINDOW_EDGE_WEST || - resizeEdge == GDK_WINDOW_EDGE_NORTH_WEST || - resizeEdge == GDK_WINDOW_EDGE_SOUTH_WEST) + if (resizeEdge == GDK_SURFACE_EDGE_WEST || + resizeEdge == GDK_SURFACE_EDGE_NORTH_WEST || + resizeEdge == GDK_SURFACE_EDGE_SOUTH_WEST) { dw = 1.0; dx = -1.0; @@ -503,7 +503,7 @@ return YES; } --(void)beginManualResize:(GdkWindowEdge)edge +-(void)beginManualResize:(GdkSurfaceEdge)edge { if (inMove || inManualMove || inManualResize) return; @@ -579,7 +579,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender { GdkEvent *event; - GdkWindow *window; + GdkSurface *window; if (current_context) g_object_unref (current_context); @@ -589,7 +589,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) 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_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; 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->dnd.window = g_object_ref ([[self contentView] gdkWindow]); @@ -678,7 +678,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) int gy, gx; 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->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.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) { @@ -729,17 +729,17 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) event->dnd.context->dest_window = NULL; 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) { - GdkWindow* win = (GdkWindow*) list->data; + GdkSurface* win = (GdkSurface*) list->data; gint wx, wy; gint ww, wh; - gdk_window_get_root_origin (win, &wx, &wy); - ww = gdk_window_get_width (win); - wh = gdk_window_get_height (win); + gdk_surface_get_root_origin (win, &wx, &wy); + ww = gdk_surface_get_width (win); + wh = gdk_surface_get_height (win); if (gx > wx && gy > wy && gx <= wx + ww && gy <= wy + wh) event->dnd.context->dest_window = win; @@ -772,7 +772,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) is_fullscreen = (([self styleMask] & NSFullScreenWindowMask) != 0); if (was_fullscreen != is_fullscreen) - _gdk_quartz_window_update_fullscreen_state ([[self contentView] gdkWindow]); + _gdk_quartz_surface_update_fullscreen_state ([[self contentView] gdkWindow]); } #endif @@ -780,8 +780,8 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen { NSRect rect; - GdkWindow *window = [[self contentView] gdkWindow]; - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); /* Allow the window to move up "shadow_top" more than normally allowed * 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 { NSRect screenFrame = [[self screen] visibleFrame]; - GdkWindow *window = [[self contentView] gdkWindow]; - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); - gboolean maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED; + GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); + gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED; if (!maximized) return screenFrame; @@ -811,15 +811,15 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) toFrame:(NSRect)newFrame { - GdkWindow *window = [[self contentView] gdkWindow]; - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); - gboolean maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED; + GdkSurface *window = [[self contentView] gdkWindow]; + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); + gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED; if (maximized) { lastMaximizedFrame = newFrame; gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_MAXIMIZED, + GDK_SURFACE_STATE_MAXIMIZED, 0); } else @@ -827,7 +827,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender) lastUnmaximizedFrame = [nsWindow frame]; gdk_synthesize_window_state (window, 0, - GDK_WINDOW_STATE_MAXIMIZED); + GDK_SURFACE_STATE_MAXIMIZED); } inMaximizeTransition = YES; diff --git a/gdk/quartz/GdkQuartzNSWindow.h b/gdk/quartz/GdkQuartzNSWindow.h index b8edf43e69..2bf8b65d03 100644 --- a/gdk/quartz/GdkQuartzNSWindow.h +++ b/gdk/quartz/GdkQuartzNSWindow.h @@ -33,7 +33,7 @@ NSPoint initialMoveLocation; NSPoint initialResizeLocation; NSRect initialResizeFrame; - GdkWindowEdge resizeEdge; + GdkSurfaceEdge resizeEdge; NSRect lastUnmaximizedFrame; NSRect lastMaximizedFrame; @@ -45,7 +45,7 @@ -(void)beginManualMove; -(BOOL)trackManualMove; -(BOOL)isInManualResizeOrMove; --(void)beginManualResize:(GdkWindowEdge)edge; +-(void)beginManualResize:(GdkSurfaceEdge)edge; -(BOOL)trackManualResize; -(void)showAndMakeKey:(BOOL)makeKey; -(void)hide; diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c index 6a20cd06d7..fc2f13458e 100644 --- a/gdk/quartz/GdkQuartzView.c +++ b/gdk/quartz/GdkQuartzView.c @@ -76,10 +76,10 @@ gint ns_x, ns_y; 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) { - _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); return NSMakeRect (ns_x, ns_y, rect->width, rect->height); @@ -126,7 +126,7 @@ gchar *prev_str; 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 @@ -153,21 +153,21 @@ str = [aString UTF8String]; } - g_object_set_data_full (G_OBJECT (gdk_window), TIC_MARKED_TEXT, g_strdup (str), g_free); - g_object_set_data (G_OBJECT (gdk_window), TIC_SELECTED_POS, + g_object_set_data_full (G_OBJECT (gdk_surface), TIC_MARKED_TEXT, g_strdup (str), g_free); + g_object_set_data (G_OBJECT (gdk_surface), TIC_SELECTED_POS, 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)); 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)")); /* 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))) { - _gdk_quartz_synthesize_null_key_event(gdk_window); + _gdk_quartz_synthesize_null_key_event(gdk_surface); } } @@ -209,326 +209,326 @@ 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", - TIC_INSERT_TEXT, gdk_window, self, + TIC_INSERT_TEXT, gdk_surface, self, 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)); /* 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))) { - _gdk_quartz_synthesize_null_key_event(gdk_window); + _gdk_quartz_synthesize_null_key_event(gdk_surface); } } -(void)deleteBackward: (id)sender { 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)); } -(void)deleteForward: (id)sender { 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)); } -(void)deleteToBeginningOfLine: (id)sender { 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)); } -(void)deleteToEndOfLine: (id)sender { 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)); } -(void)deleteWordBackward: (id)sender { 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)); } -(void)deleteWordForward: (id)sender { 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)); } -(void)insertBacktab: (id)sender { 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)); } -(void)insertNewline: (id)sender { 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 { 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)); } -(void)moveBackward: (id)sender { 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)); } -(void)moveBackwardAndModifySelection: (id)sender { 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)); } -(void)moveDown: (id)sender { 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)); } -(void)moveDownAndModifySelection: (id)sender { 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)); } -(void)moveForward: (id)sender { 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)); } -(void)moveForwardAndModifySelection: (id)sender { 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)); } -(void)moveLeft: (id)sender { 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)); } -(void)moveLeftAndModifySelection: (id)sender { 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)); } -(void)moveRight: (id)sender { 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)); } -(void)moveRightAndModifySelection: (id)sender { 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)); } -(void)moveToBeginningOfDocument: (id)sender { 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)); } -(void)moveToBeginningOfDocumentAndModifySelection: (id)sender { 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)); } -(void)moveToBeginningOfLine: (id)sender { 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)); } -(void)moveToBeginningOfLineAndModifySelection: (id)sender { 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)); } -(void)moveToEndOfDocument: (id)sender { 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)); } -(void)moveToEndOfDocumentAndModifySelection: (id)sender { 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)); } -(void)moveToEndOfLine: (id)sender { 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)); } -(void)moveToEndOfLineAndModifySelection: (id)sender { 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)); } -(void)moveUp: (id)sender { 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)); } -(void)moveUpAndModifySelection: (id)sender { 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)); } -(void)moveWordBackward: (id)sender { 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)); } -(void)moveWordBackwardAndModifySelection: (id)sender { 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)); } -(void)moveWordForward: (id)sender { 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)); } -(void)moveWordForwardAndModifySelection: (id)sender { 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)); } -(void)moveWordLeft: (id)sender { 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)); } -(void)moveWordLeftAndModifySelection: (id)sender { 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)); } -(void)moveWordRight: (id)sender { 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)); } -(void)moveWordRightAndModifySelection: (id)sender { 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)); } -(void)pageDown: (id)sender { 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)); } -(void)pageDownAndModifySelection: (id)sender { 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)); } -(void)pageUp: (id)sender { 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)); } -(void)pageUpAndModifySelection: (id)sender { 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)); } -(void)selectAll: (id)sender { 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)); } -(void)selectLine: (id)sender { 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)); } -(void)selectWord: (id)sender { 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)); } @@ -550,14 +550,14 @@ [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 @@ -572,7 +572,7 @@ -(BOOL)isOpaque { - if (GDK_WINDOW_DESTROYED (gdk_window)) + if (GDK_SURFACE_DESTROYED (gdk_surface)) return YES; return NO; @@ -581,13 +581,13 @@ -(void)drawRect: (NSRect)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; NSInteger count; int i; cairo_region_t *region; - if (GDK_WINDOW_DESTROYED (gdk_window)) + if (GDK_SURFACE_DESTROYED (gdk_surface)) return; if (! (gdk_window->event_mask & GDK_EXPOSURE_MASK)) @@ -596,7 +596,7 @@ if (NSEqualRects (rect, NSZeroRect)) 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 * will be empty causing the usual code below to draw nothing. @@ -636,7 +636,7 @@ } 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--; cairo_region_destroy (region); @@ -658,7 +658,7 @@ */ -(void)updateTrackingRect { - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (gdk_window->impl); + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (gdk_window->impl); NSRect rect; if (!impl || !impl->toplevel) diff --git a/gdk/quartz/GdkQuartzView.h b/gdk/quartz/GdkQuartzView.h index 732c677ee5..01045dc613 100644 --- a/gdk/quartz/GdkQuartzView.h +++ b/gdk/quartz/GdkQuartzView.h @@ -34,15 +34,15 @@ @interface GdkQuartzView : NSView <NSTextInputClient> { - GdkWindow *gdk_window; + GdkSurface *gdk_surface; NSTrackingRectTag trackingRect; BOOL needsInvalidateShadow; NSRange markedRange; NSRange selectedRange; } -- (void)setGdkWindow: (GdkWindow *)window; -- (GdkWindow *)gdkWindow; +- (void)setGdkSurface: (GdkSurface *)window; +- (GdkSurface *)gdkWindow; - (NSTrackingRectTag)trackingRect; - (void)setNeedsInvalidateShadow: (BOOL)invalidate; diff --git a/gdk/quartz/gdkdevice-core-quartz.c b/gdk/quartz/gdkdevice-core-quartz.c index e31ad6de86..9a2e270e08 100644 --- a/gdk/quartz/gdkdevice-core-quartz.c +++ b/gdk/quartz/gdkdevice-core-quartz.c @@ -38,46 +38,46 @@ struct _GdkQuartzDeviceCoreClass }; static gboolean gdk_quartz_device_core_get_history (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, guint32 start, guint32 stop, GdkTimeCoord ***events, gint *n_events); static void gdk_quartz_device_core_get_state (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, GdkModifierType *mask); static void gdk_quartz_device_core_set_window_cursor (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkCursor *cursor); static void gdk_quartz_device_core_warp (GdkDevice *device, gdouble x, gdouble y); static void gdk_quartz_device_core_query_state (GdkDevice *device, - GdkWindow *window, - GdkWindow **root_window, - GdkWindow **child_window, + GdkSurface *window, + GdkSurface **root_window, + GdkSurface **child_window, gdouble *root_x, gdouble *root_y, gdouble *win_x, gdouble *win_y, GdkModifierType *mask); static GdkGrabStatus gdk_quartz_device_core_grab (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gboolean owner_events, GdkEventMask event_mask, - GdkWindow *confine_to, + GdkSurface *confine_to, GdkCursor *cursor, guint32 time_); static void gdk_quartz_device_core_ungrab (GdkDevice *device, 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_y, GdkModifierType *mask, gboolean get_toplevel); static void gdk_quartz_device_core_select_window_events (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkEventMask event_mask); @@ -112,7 +112,7 @@ gdk_quartz_device_core_init (GdkQuartzDeviceCore *quartz_device_core) static gboolean gdk_quartz_device_core_get_history (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, guint32 start, guint32 stop, GdkTimeCoord ***events, @@ -123,13 +123,13 @@ gdk_quartz_device_core_get_history (GdkDevice *device, static void gdk_quartz_device_core_get_state (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, GdkModifierType *mask) { 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) { @@ -139,12 +139,12 @@ gdk_quartz_device_core_get_state (GdkDevice *device, } static void -translate_coords_to_child_coords (GdkWindow *parent, - GdkWindow *child, +translate_coords_to_child_coords (GdkSurface *parent, + GdkSurface *child, gint *x, gint *y) { - GdkWindow *current = child; + GdkSurface *current = child; if (child == parent) return; @@ -153,23 +153,23 @@ translate_coords_to_child_coords (GdkWindow *parent, { 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; *y -= tmp_y; - current = gdk_window_get_parent (current); + current = gdk_surface_get_parent (current); } } static void gdk_quartz_device_core_set_window_cursor (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkCursor *cursor) { NSCursor *nscursor; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; nscursor = _gdk_quartz_cursor_get_ns_cursor (cursor); @@ -185,21 +185,21 @@ gdk_quartz_device_core_warp (GdkDevice *device, CGDisplayMoveCursorToPoint (CGMainDisplayID (), CGPointMake (x, y)); } -static GdkWindow * -gdk_quartz_device_core_query_state_helper (GdkWindow *window, +static GdkSurface * +gdk_quartz_device_core_query_state_helper (GdkSurface *window, GdkDevice *device, gdouble *x, gdouble *y, GdkModifierType *mask) { - GdkWindow *toplevel; + GdkSurface *toplevel; NSPoint point; 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; *y = 0; @@ -207,7 +207,7 @@ gdk_quartz_device_core_query_state_helper (GdkWindow *window, return NULL; } - toplevel = gdk_window_get_toplevel (window); + toplevel = gdk_surface_get_toplevel (window); if (mask) *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) { 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 { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; NSWindow *nswindow; - impl = GDK_WINDOW_IMPL_QUARTZ (toplevel->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (toplevel->impl); nswindow = impl->toplevel; point = [nswindow mouseLocationOutsideOfEventStream]; @@ -235,7 +235,7 @@ gdk_quartz_device_core_query_state_helper (GdkWindow *window, 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); if (found_window == _gdk_root) @@ -255,15 +255,15 @@ gdk_quartz_device_core_query_state_helper (GdkWindow *window, static void gdk_quartz_device_core_query_state (GdkDevice *device, - GdkWindow *window, - GdkWindow **child_window, + GdkSurface *window, + GdkSurface **child_window, gdouble *root_x, gdouble *root_y, gdouble *win_x, gdouble *win_y, GdkModifierType *mask) { - GdkWindow *found_window; + GdkSurface *found_window; NSPoint point; gint x_tmp, y_tmp; @@ -281,7 +281,7 @@ gdk_quartz_device_core_query_state (GdkDevice *device, *child_window = found_window; 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) *root_x = x_tmp; @@ -292,10 +292,10 @@ gdk_quartz_device_core_query_state (GdkDevice *device, static GdkGrabStatus gdk_quartz_device_core_grab (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gboolean owner_events, GdkEventMask event_mask, - GdkWindow *confine_to, + GdkSurface *confine_to, GdkCursor *cursor, guint32 time_) { @@ -316,22 +316,22 @@ gdk_quartz_device_core_ungrab (GdkDevice *device, _gdk_display_device_grab_update (_gdk_display, device, NULL, 0); } -static GdkWindow * +static GdkSurface * gdk_quartz_device_core_window_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, gboolean get_toplevel) { - GdkWindow *found_window; + GdkSurface *found_window; NSPoint point; gint x_tmp, y_tmp; /* Get mouse coordinates, find window under the mouse pointer */ 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) 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 gdk_quartz_device_core_select_window_events (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkEventMask event_mask) { /* The mask is set in the common code. */ diff --git a/gdk/quartz/gdkdisplay-quartz.c b/gdk/quartz/gdkdisplay-quartz.c index 2f96ab20cd..781437d1c0 100644 --- a/gdk/quartz/gdkdisplay-quartz.c +++ b/gdk/quartz/gdkdisplay-quartz.c @@ -30,7 +30,7 @@ #include "gdkdisplay-quartz.h" -static GdkWindow * +static GdkSurface * gdk_quartz_display_get_default_group (GdkDisplay *display) { 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_quartz_window_init_windowing (_gdk_display); + _gdk_quartz_surface_init_windowing (_gdk_display); _gdk_quartz_events_init (); @@ -215,7 +215,7 @@ gdk_quartz_display_class_init (GdkQuartzDisplayClass *class) object_class->finalize = gdk_quartz_display_finalize; 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->beep = gdk_quartz_display_beep; diff --git a/gdk/quartz/gdkdisplay-quartz.h b/gdk/quartz/gdkdisplay-quartz.h index 6f2ed37152..10d249e5a3 100644 --- a/gdk/quartz/gdkdisplay-quartz.h +++ b/gdk/quartz/gdkdisplay-quartz.h @@ -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_after_process_all_updates (GdkDisplay *display); void _gdk_quartz_display_create_window_impl (GdkDisplay *display, - GdkWindow *window, - GdkWindow *real_parent, + GdkSurface *window, + GdkSurface *real_parent, GdkEventMask event_mask, - GdkWindowAttr *attributes); + GdkSurfaceAttr *attributes); /* Display methods - keymap */ GdkKeymap * _gdk_quartz_display_get_keymap (GdkDisplay *display); diff --git a/gdk/quartz/gdkdnd-quartz.c b/gdk/quartz/gdkdnd-quartz.c index d1ebe5fa04..66b8d35c84 100644 --- a/gdk/quartz/gdkdnd-quartz.c +++ b/gdk/quartz/gdkdnd-quartz.c @@ -34,7 +34,7 @@ gdk_quartz_drag_source_context_libgtk_only () } GdkDragContext * -_gdk_quartz_window_drag_begin (GdkWindow *window, +_gdk_quartz_surface_drag_begin (GdkSurface *window, GdkDevice *device, GList *targets, gint dx, @@ -97,7 +97,7 @@ gdk_quartz_drag_context_drop_finish (GdkDragContext *context, } void -_gdk_quartz_window_register_dnd (GdkWindow *window) +_gdk_quartz_surface_register_dnd (GdkSurface *window) { /* FIXME: Implement */ } diff --git a/gdk/quartz/gdkevents-quartz.c b/gdk/quartz/gdkevents-quartz.c index 4544bc11ea..d1f520b9cc 100644 --- a/gdk/quartz/gdkevents-quartz.c +++ b/gdk/quartz/gdkevents-quartz.c @@ -39,16 +39,16 @@ #define GRIP_HEIGHT 15 #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 */ -static GdkWindow *current_keyboard_window; +static GdkSurface *current_keyboard_window; static void append_event (GdkEvent *event, gboolean windowing); -static GdkWindow *find_toplevel_under_pointer (GdkDisplay *display, +static GdkSurface *find_toplevel_under_pointer (GdkDisplay *display, NSPoint screen_point, gint *x, gint *y); @@ -378,7 +378,7 @@ get_event_mask_from_ns_event (NSEvent *nsevent) } static void -get_window_point_from_screen_point (GdkWindow *window, +get_window_point_from_screen_point (GdkSurface *window, NSPoint screen_point, gint *x, gint *y) @@ -386,7 +386,7 @@ get_window_point_from_screen_point (GdkWindow *window, NSPoint point; NSWindow *nswindow; - nswindow = ((GdkWindowImplQuartz *)window->impl)->toplevel; + nswindow = ((GdkSurfaceImplQuartz *)window->impl)->toplevel; point = [nswindow convertScreenToBase:screen_point]; @@ -408,13 +408,13 @@ is_mouse_button_press_event (NSEventType type) return FALSE; } -static GdkWindow * +static GdkSurface * get_toplevel_from_ns_event (NSEvent *nsevent, NSPoint *screen_point, gint *x, gint *y) { - GdkWindow *toplevel = NULL; + GdkSurface *toplevel = NULL; if ([nsevent window]) { @@ -488,7 +488,7 @@ get_toplevel_from_ns_event (NSEvent *nsevent, } static GdkEvent * -create_focus_event (GdkWindow *window, +create_focus_event (GdkSurface *window, gboolean in) { GdkEvent *event; @@ -507,7 +507,7 @@ create_focus_event (GdkWindow *window, static void -generate_motion_event (GdkWindow *window) +generate_motion_event (GdkSurface *window) { NSPoint screen_point; GdkEvent *event; @@ -520,7 +520,7 @@ generate_motion_event (GdkWindow *window) 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); 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. */ void -_gdk_quartz_events_update_focus_window (GdkWindow *window, +_gdk_quartz_events_update_focus_window (GdkSurface *window, gboolean got_focus) { GdkEvent *event; @@ -586,9 +586,9 @@ _gdk_quartz_events_update_focus_window (GdkWindow *window, } 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) return; @@ -604,14 +604,14 @@ _gdk_quartz_events_send_map_event (GdkWindow *window) } } -static GdkWindow * +static GdkSurface * find_toplevel_under_pointer (GdkDisplay *display, NSPoint screen_point, gint *x, gint *y) { - GdkWindow *toplevel; - GdkPointerWindowInfo *info; + GdkSurface *toplevel; + GdkPointerSurfaceInfo *info; info = _gdk_display_get_pointer_info (display, GDK_QUARTZ_DEVICE_MANAGER_CORE (_gdk_device_manager)->core_pointer); toplevel = info->toplevel_under_pointer; @@ -633,11 +633,11 @@ find_toplevel_under_pointer (GdkDisplay *display, return toplevel; } -static GdkWindow * +static GdkSurface * find_toplevel_for_keyboard_event (NSEvent *nsevent) { GList *devices = NULL, *l; - GdkWindow *window; + GdkSurface *window; GdkDisplay *display; GdkQuartzView *view; GdkSeat *seat; @@ -645,7 +645,7 @@ find_toplevel_for_keyboard_event (NSEvent *nsevent) view = (GdkQuartzView *)[[nsevent window] contentView]; window = [view gdkWindow]; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); 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); if (grab && grab->window && !grab->owner_events) { - window = gdk_window_get_toplevel (grab->window); + window = gdk_surface_get_toplevel (grab->window); break; } } @@ -673,20 +673,20 @@ find_toplevel_for_keyboard_event (NSEvent *nsevent) return window; } -static GdkWindow * +static GdkSurface * find_toplevel_for_mouse_event (NSEvent *nsevent, gint *x, gint *y) { NSPoint screen_point; NSEventType event_type; - GdkWindow *toplevel; + GdkSurface *toplevel; GdkDisplay *display; GdkDeviceGrabInfo *grab; 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]; @@ -717,7 +717,7 @@ find_toplevel_for_mouse_event (NSEvent *nsevent, * reported with respect to the key window, which could be * wrong. */ - GdkWindow *toplevel_under_pointer; + GdkSurface *toplevel_under_pointer; gint x_tmp, y_tmp; toplevel_under_pointer = find_toplevel_under_pointer (display, @@ -735,9 +735,9 @@ find_toplevel_for_mouse_event (NSEvent *nsevent, else { /* 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, x, y); @@ -749,7 +749,7 @@ find_toplevel_for_mouse_event (NSEvent *nsevent, else { /* The non-grabbed case. */ - GdkWindow *toplevel_under_pointer; + GdkSurface *toplevel_under_pointer; gint x_tmp, y_tmp; /* 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 && WINDOW_IS_TOPLEVEL (toplevel_under_pointer)) { - GdkWindowImplQuartz *toplevel_impl; + GdkSurfaceImplQuartz *toplevel_impl; toplevel = toplevel_under_pointer; - toplevel_impl = (GdkWindowImplQuartz *)toplevel->impl; + toplevel_impl = (GdkSurfaceImplQuartz *)toplevel->impl; *x = x_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 * into account grabs, event propagation, and event masks. */ -static GdkWindow * +static GdkSurface * find_window_for_ns_event (NSEvent *nsevent, gint *x, gint *y, @@ -797,7 +797,7 @@ find_window_for_ns_event (NSEvent *nsevent, gint *y_root) { GdkQuartzView *view; - GdkWindow *toplevel; + GdkSurface *toplevel; NSPoint screen_point; 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); if (!toplevel) 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]; @@ -851,7 +851,7 @@ find_window_for_ns_event (NSEvent *nsevent, } static void -fill_crossing_event (GdkWindow *toplevel, +fill_crossing_event (GdkSurface *toplevel, GdkEvent *event, NSEvent *nsevent, gint x, @@ -899,7 +899,7 @@ fill_crossing_event (GdkWindow *toplevel, */ #ifdef AVAILABLE_MAC_OS_X_VERSION_10_8_AND_LATER static void -fill_pinch_event (GdkWindow *window, +fill_pinch_event (GdkSurface *window, GdkEvent *event, NSEvent *nsevent, gint x, @@ -996,7 +996,7 @@ fill_pinch_event (GdkWindow *window, #endif /* OSX Version >= 10.8 */ static void -fill_button_event (GdkWindow *window, +fill_button_event (GdkSurface *window, GdkEvent *event, NSEvent *nsevent, gint x, @@ -1047,7 +1047,7 @@ fill_button_event (GdkWindow *window, } static void -fill_motion_event (GdkWindow *window, +fill_motion_event (GdkSurface *window, GdkEvent *event, NSEvent *nsevent, gint x, @@ -1073,7 +1073,7 @@ fill_motion_event (GdkWindow *window, } static void -fill_scroll_event (GdkWindow *window, +fill_scroll_event (GdkSurface *window, GdkEvent *event, NSEvent *nsevent, gint x, @@ -1106,7 +1106,7 @@ fill_scroll_event (GdkWindow *window, } static void -fill_key_event (GdkWindow *window, +fill_key_event (GdkSurface *window, GdkEvent *event, NSEvent *nsevent, GdkEventType type) @@ -1236,7 +1236,7 @@ fill_key_event (GdkWindow *window, } static gboolean -synthesize_crossing_event (GdkWindow *window, +synthesize_crossing_event (GdkSurface *window, GdkEvent *event, NSEvent *nsevent, gint x, @@ -1283,7 +1283,7 @@ synthesize_crossing_event (GdkWindow *window, } void -_gdk_quartz_synthesize_null_key_event (GdkWindow *window) +_gdk_quartz_synthesize_null_key_event (GdkSurface *window) { GdkEvent *event; GdkQuartzDeviceManagerCore *device_manager; @@ -1344,15 +1344,15 @@ _gdk_quartz_events_get_current_mouse_modifiers (void) /* Detect window resizing */ 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; /* Resizing from the resize indicator only begins if an NSLeftMouseButton * event is received in the resizing area. */ - toplevel_impl = (GdkWindowImplQuartz *)toplevel->impl; + toplevel_impl = (GdkSurfaceImplQuartz *)toplevel->impl; if ([toplevel_impl->toplevel showsResizeIndicator]) if ([event type] == NSLeftMouseDown && [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 * 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 - * window finding code, because there are no GdkWindows present in + * window finding code, because there are no GdkSurfaces present in * the range [-3, 0]. */ lion = gdk_quartz_osx_version () >= GDK_OSX_LION; @@ -1412,7 +1412,7 @@ gdk_event_translate (GdkEvent *event, { NSEventType event_type; NSWindow *nswindow; - GdkWindow *window; + GdkSurface *window; int x, y; int x_root, y_root; gboolean return_val; @@ -1457,7 +1457,7 @@ gdk_event_translate (GdkEvent *event, /* Ignore events for ones with no windows */ if (!nswindow) { - GdkWindow *toplevel = NULL; + GdkSurface *toplevel = NULL; if (event_type == NSMouseMoved) { @@ -1505,7 +1505,7 @@ gdk_event_translate (GdkEvent *event, return FALSE; /* Apply any window filters. */ - if (GDK_IS_WINDOW (window)) + if (GDK_IS_SURFACE (window)) { GdkFilterReturn result; @@ -1534,7 +1534,7 @@ gdk_event_translate (GdkEvent *event, event_type == NSOtherMouseDown || event_type == NSLeftMouseDown)) { - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (![NSApp isActive]) { diff --git a/gdk/quartz/gdkglcontext-quartz.c b/gdk/quartz/gdkglcontext-quartz.c index a6cc3b6a35..cc2e02d54c 100644 --- a/gdk/quartz/gdkglcontext-quartz.c +++ b/gdk/quartz/gdkglcontext-quartz.c @@ -27,7 +27,7 @@ #include "gdkintl.h" GdkGLContext * -gdk_quartz_window_create_gl_context (GdkWindow *window, +gdk_quartz_surface_create_gl_context (GdkSurface *window, gboolean attached, GdkGLContext *share, GError **error) diff --git a/gdk/quartz/gdkglcontext-quartz.h b/gdk/quartz/gdkglcontext-quartz.h index ffd56b3dd9..86946a1df8 100644 --- a/gdk/quartz/gdkglcontext-quartz.h +++ b/gdk/quartz/gdkglcontext-quartz.h @@ -29,7 +29,7 @@ G_BEGIN_DECLS -GdkGLContext * gdk_quartz_window_create_gl_context (GdkWindow *window, +GdkGLContext * gdk_quartz_surface_create_gl_context (GdkSurface *window, gboolean attach, GdkGLContext *share, GError **error); diff --git a/gdk/quartz/gdkglobals-quartz.c b/gdk/quartz/gdkglobals-quartz.c index 6b8c59f757..a1cfc2f3e4 100644 --- a/gdk/quartz/gdkglobals-quartz.c +++ b/gdk/quartz/gdkglobals-quartz.c @@ -23,7 +23,7 @@ GdkDisplay *_gdk_display = NULL; GdkQuartzScreen *_gdk_screen = NULL; -GdkWindow *_gdk_root = NULL; +GdkSurface *_gdk_root = NULL; GdkDeviceManager *_gdk_device_manager = NULL; GdkOSXVersion diff --git a/gdk/quartz/gdkprivate-quartz.h b/gdk/quartz/gdkprivate-quartz.h index 99d24431a3..48f5950d4c 100644 --- a/gdk/quartz/gdkprivate-quartz.h +++ b/gdk/quartz/gdkprivate-quartz.h @@ -36,15 +36,15 @@ extern GdkDisplay *_gdk_display; extern GdkQuartzScreen *_gdk_screen; -extern GdkWindow *_gdk_root; +extern GdkSurface *_gdk_root; extern GdkDeviceManager *_gdk_device_manager; 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 */ -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_event_loop_init (void); @@ -56,9 +56,9 @@ typedef enum { GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP } GdkQuartzEventSubType; -void _gdk_quartz_events_update_focus_window (GdkWindow *new_window, +void _gdk_quartz_events_update_focus_window (GdkSurface *new_window, 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_mouse_modifiers (void); @@ -73,11 +73,11 @@ void _gdk_quartz_event_loop_release_event (NSEvent *event); /* Keys */ GdkEventType _gdk_quartz_keys_event_type (NSEvent *event); 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 */ -void _gdk_quartz_window_register_dnd (GdkWindow *window); -GdkDragContext * _gdk_quartz_window_drag_begin (GdkWindow *window, +void _gdk_quartz_surface_register_dnd (GdkSurface *window); +GdkDragContext * _gdk_quartz_surface_drag_begin (GdkSurface *window, GdkDevice *device, GList *targets, gint x_root, @@ -98,35 +98,35 @@ gboolean _gdk_quartz_get_setting (const gchar *name, /* Window */ -gboolean _gdk_quartz_window_is_ancestor (GdkWindow *ancestor, - GdkWindow *window); -void _gdk_quartz_window_gdk_xy_to_xy (gint gdk_x, +gboolean _gdk_quartz_surface_is_ancestor (GdkSurface *ancestor, + GdkSurface *window); +void _gdk_quartz_surface_gdk_xy_to_xy (gint gdk_x, gint gdk_y, gint *ns_x, 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 *gdk_x, 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 *y); -GdkWindow *_gdk_quartz_window_find_child (GdkWindow *window, +GdkSurface *_gdk_quartz_surface_find_child (GdkSurface *window, gint x, gint y, gboolean get_toplevel); -void _gdk_quartz_window_attach_to_parent (GdkWindow *window); -void _gdk_quartz_window_detach_from_parent (GdkWindow *window); -void _gdk_quartz_window_did_become_main (GdkWindow *window); -void _gdk_quartz_window_did_resign_main (GdkWindow *window); -void _gdk_quartz_window_debug_highlight (GdkWindow *window, +void _gdk_quartz_surface_attach_to_parent (GdkSurface *window); +void _gdk_quartz_surface_detach_from_parent (GdkSurface *window); +void _gdk_quartz_surface_did_become_main (GdkSurface *window); +void _gdk_quartz_surface_did_resign_main (GdkSurface *window); +void _gdk_quartz_surface_debug_highlight (GdkSurface *window, gint number); -void _gdk_quartz_window_update_position (GdkWindow *window); -void _gdk_quartz_window_update_fullscreen_state (GdkWindow *window); +void _gdk_quartz_surface_update_position (GdkSurface *window); +void _gdk_quartz_surface_update_fullscreen_state (GdkSurface *window); /* Window methods - property */ -gboolean _gdk_quartz_window_get_property (GdkWindow *window, +gboolean _gdk_quartz_surface_get_property (GdkSurface *window, GdkAtom property, GdkAtom type, gulong offset, @@ -136,14 +136,14 @@ gboolean _gdk_quartz_window_get_property (GdkWindow *window, gint *actual_format_type, gint *actual_length, guchar **data); -void _gdk_quartz_window_change_property (GdkWindow *window, +void _gdk_quartz_surface_change_property (GdkSurface *window, GdkAtom property, GdkAtom type, gint format, GdkPropMode mode, const guchar *data, gint nelements); -void _gdk_quartz_window_delete_property (GdkWindow *window, +void _gdk_quartz_surface_delete_property (GdkSurface *window, GdkAtom property); diff --git a/gdk/quartz/gdkquartzwindow.h b/gdk/quartz/gdkquartzwindow.h index a88eb16e9b..56ff424b76 100644 --- a/gdk/quartz/gdkquartzwindow.h +++ b/gdk/quartz/gdkquartzwindow.h @@ -17,8 +17,8 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef __GDK_QUARTZ_WINDOW_H__ -#define __GDK_QUARTZ_WINDOW_H__ +#ifndef __GDK_QUARTZ_SURFACE_H__ +#define __GDK_QUARTZ_SURFACE_H__ #if !defined (__GDKQUARTZ_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only <gdk/gdkquartz.h> can be included directly." @@ -28,28 +28,28 @@ G_BEGIN_DECLS -#define GDK_TYPE_QUARTZ_WINDOW (gdk_quartz_window_get_type ()) -#define GDK_QUARTZ_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_QUARTZ_WINDOW, GdkQuartzWindow)) -#define GDK_QUARTZ_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_QUARTZ_WINDOW, GdkQuartzWindowClass)) -#define GDK_IS_QUARTZ_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_QUARTZ_WINDOW)) -#define GDK_IS_QUARTZ_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_QUARTZ_WINDOW)) -#define GDK_QUARTZ_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_QUARTZ_WINDOW, GdkQuartzWindowClass)) +#define GDK_TYPE_QUARTZ_SURFACE (gdk_quartz_surface_get_type ()) +#define GDK_QUARTZ_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_QUARTZ_SURFACE, GdkQuartzSurface)) +#define GDK_QUARTZ_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_QUARTZ_SURFACE, GdkQuartzSurfaceClass)) +#define GDK_IS_QUARTZ_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_QUARTZ_SURFACE)) +#define GDK_IS_QUARTZ_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_QUARTZ_SURFACE)) +#define GDK_QUARTZ_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_QUARTZ_SURFACE, GdkQuartzSurfaceClass)) #ifdef GDK_COMPILATION -typedef struct _GdkQuartzWindow GdkQuartzWindow; +typedef struct _GdkQuartzSurface GdkQuartzSurface; #else -typedef GdkWindow GdkQuartzWindow; +typedef GdkSurface GdkQuartzSurface; #endif -typedef struct _GdkQuartzWindowClass GdkQuartzWindowClass; +typedef struct _GdkQuartzSurfaceClass GdkQuartzSurfaceClass; GDK_AVAILABLE_IN_ALL -GType gdk_quartz_window_get_type (void); +GType gdk_quartz_surface_get_type (void); GDK_AVAILABLE_IN_ALL -NSWindow *gdk_quartz_window_get_nswindow (GdkWindow *window); +NSWindow *gdk_quartz_surface_get_nswindow (GdkSurface *window); GDK_AVAILABLE_IN_ALL -NSView *gdk_quartz_window_get_nsview (GdkWindow *window); +NSView *gdk_quartz_surface_get_nsview (GdkSurface *window); G_END_DECLS -#endif /* __GDK_QUARTZ_WINDOW_H__ */ +#endif /* __GDK_QUARTZ_SURFACE_H__ */ diff --git a/gdk/quartz/gdkscreen-quartz.c b/gdk/quartz/gdkscreen-quartz.c index 6f53f36a2b..e9d2d6b094 100644 --- a/gdk/quartz/gdkscreen-quartz.c +++ b/gdk/quartz/gdkscreen-quartz.c @@ -53,8 +53,8 @@ * * A Cocoa coordinate is always relative to the origin of the monitor * coordinate space. Such coordinates are mapped to their respective - * position in the GdkScreen root window (_gdk_quartz_window_xy_to_gdk_xy) - * and vice versa (_gdk_quartz_window_gdk_xy_to_xy). Both functions can + * position in the GdkScreen root window (_gdk_quartz_surface_xy_to_gdk_xy) + * 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 * negative values (in case a monitor is located left or below of screen 0), * but GDK coordinates can *not*! @@ -208,7 +208,7 @@ _gdk_quartz_screen_update_window_sizes (GdkQuartzScreen *screen) windows = get_toplevels (); for (list = windows; list; list = list->next) - _gdk_quartz_window_update_position (list->data); + _gdk_quartz_surface_update_position (list->data); } static void diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c index d105612199..170950a7da 100644 --- a/gdk/quartz/gdkwindow-quartz.c +++ b/gdk/quartz/gdkwindow-quartz.c @@ -43,7 +43,7 @@ static gboolean in_process_all_updates = FALSE; static GSList *main_window_stack; -void _gdk_quartz_window_flush (GdkWindowImplQuartz *window_impl); +void _gdk_quartz_surface_flush (GdkSurfaceImplQuartz *window_impl); typedef struct { @@ -54,7 +54,7 @@ typedef struct #ifndef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER -static FullscreenSavedGeometry *get_fullscreen_geometry (GdkWindow *window); +static FullscreenSavedGeometry *get_fullscreen_geometry (GdkSurface *window); #endif #define FULLSCREEN_DATA "fullscreen-data" @@ -62,65 +62,65 @@ static FullscreenSavedGeometry *get_fullscreen_geometry (GdkWindow *window); static void update_toplevel_order (void); static void clear_toplevel_order (void); -#define WINDOW_IS_TOPLEVEL(window) (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD) +#define WINDOW_IS_TOPLEVEL(window) (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD) /* - * GdkQuartzWindow + * GdkQuartzSurface */ -struct _GdkQuartzWindow +struct _GdkQuartzSurface { - GdkWindow parent; + GdkSurface parent; }; -struct _GdkQuartzWindowClass +struct _GdkQuartzSurfaceClass { - GdkWindowClass parent_class; + GdkSurfaceClass parent_class; }; -G_DEFINE_TYPE (GdkQuartzWindow, gdk_quartz_window, GDK_TYPE_WINDOW); +G_DEFINE_TYPE (GdkQuartzSurface, gdk_quartz_surface, GDK_TYPE_SURFACE); static void -gdk_quartz_window_class_init (GdkQuartzWindowClass *quartz_window_class) +gdk_quartz_surface_class_init (GdkQuartzSurfaceClass *quartz_surface_class) { } static void -gdk_quartz_window_init (GdkQuartzWindow *quartz_window) +gdk_quartz_surface_init (GdkQuartzSurface *quartz_surface) { } /* - * GdkQuartzWindowImpl + * GdkQuartzSurfaceImpl */ NSView * -gdk_quartz_window_get_nsview (GdkWindow *window) +gdk_quartz_surface_get_nsview (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return NULL; - return ((GdkWindowImplQuartz *)window->impl)->view; + return ((GdkSurfaceImplQuartz *)window->impl)->view; } NSWindow * -gdk_quartz_window_get_nswindow (GdkWindow *window) +gdk_quartz_surface_get_nswindow (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return NULL; - return ((GdkWindowImplQuartz *)window->impl)->toplevel; + return ((GdkSurfaceImplQuartz *)window->impl)->toplevel; } static CGContextRef -gdk_window_impl_quartz_get_context (GdkWindowImplQuartz *window_impl, +gdk_surface_impl_quartz_get_context (GdkSurfaceImplQuartz *window_impl, gboolean antialias) { CGContextRef cg_context; CGSize scale; - if (GDK_WINDOW_DESTROYED (window_impl->wrapper)) + if (GDK_SURFACE_DESTROYED (window_impl->wrapper)) return NULL; /* Lock focus when not called as part of a drawRect call. This @@ -149,25 +149,25 @@ gdk_window_impl_quartz_get_context (GdkWindowImplQuartz *window_impl, } static void -gdk_window_impl_quartz_release_context (GdkWindowImplQuartz *window_impl, +gdk_surface_impl_quartz_release_context (GdkSurfaceImplQuartz *window_impl, CGContextRef cg_context) { CGContextRestoreGState (cg_context); CGContextSetAllowsAntialiasing (cg_context, TRUE); - /* See comment in gdk_quartz_window_get_context(). */ + /* See comment in gdk_quartz_surface_get_context(). */ if (window_impl->in_paint_rect_count == 0) { - _gdk_quartz_window_flush (window_impl); + _gdk_quartz_surface_flush (window_impl); [window_impl->view unlockFocus]; } } static void -check_grab_destroy (GdkWindow *window) +check_grab_destroy (GdkSurface *window) { GList *devices = NULL, *l; - GdkDisplay *display = gdk_window_get_display (window); + GdkDisplay *display = gdk_surface_get_display (window); GdkSeat *seat; seat = gdk_display_get_default_seat (display); @@ -192,11 +192,11 @@ check_grab_destroy (GdkWindow *window) } static void -gdk_window_impl_quartz_finalize (GObject *object) +gdk_surface_impl_quartz_finalize (GObject *object) { - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (object); + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (object); - check_grab_destroy (GDK_WINDOW_IMPL_QUARTZ (object)->wrapper); + check_grab_destroy (GDK_SURFACE_IMPL_QUARTZ (object)->wrapper); if (impl->transient_for) g_object_unref (impl->transient_for); @@ -216,7 +216,7 @@ gdk_window_impl_quartz_finalize (GObject *object) * done externally. */ void -_gdk_quartz_window_flush (GdkWindowImplQuartz *window_impl) +_gdk_quartz_surface_flush (GdkSurfaceImplQuartz *window_impl) { static struct timeval prev_tv; static gint intervals[4]; @@ -248,7 +248,7 @@ _gdk_quartz_window_flush (GdkWindowImplQuartz *window_impl) static cairo_user_data_key_t gdk_quartz_cairo_key; typedef struct { - GdkWindowImplQuartz *window_impl; + GdkSurfaceImplQuartz *window_impl; CGContextRef cg_context; } GdkQuartzCairoSurfaceData; @@ -259,14 +259,14 @@ gdk_quartz_cairo_surface_destroy (void *data) surface_data->window_impl->cairo_surface = NULL; - gdk_quartz_window_release_context (surface_data->window_impl, + gdk_quartz_surface_release_context (surface_data->window_impl, surface_data->cg_context); g_free (surface_data); } static cairo_surface_t * -gdk_quartz_create_cairo_surface (GdkWindowImplQuartz *impl, +gdk_quartz_create_cairo_surface (GdkSurfaceImplQuartz *impl, int width, int height) { @@ -274,7 +274,7 @@ gdk_quartz_create_cairo_surface (GdkWindowImplQuartz *impl, GdkQuartzCairoSurfaceData *surface_data; cairo_surface_t *surface; - cg_context = gdk_quartz_window_get_context (impl, TRUE); + cg_context = gdk_quartz_surface_get_context (impl, TRUE); if (!cg_context) return NULL; @@ -294,21 +294,21 @@ gdk_quartz_create_cairo_surface (GdkWindowImplQuartz *impl, } static cairo_surface_t * -gdk_quartz_ref_cairo_surface (GdkWindow *window) +gdk_quartz_ref_cairo_surface (GdkSurface *window) { - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return NULL; if (!impl->cairo_surface) { - gint scale = gdk_window_get_scale_factor (impl->wrapper); + gint scale = gdk_surface_get_scale_factor (impl->wrapper); impl->cairo_surface = gdk_quartz_create_cairo_surface (impl, - gdk_window_get_width (impl->wrapper) * scale, - gdk_window_get_height (impl->wrapper) * scale); + gdk_surface_get_width (impl->wrapper) * scale, + gdk_surface_get_height (impl->wrapper) * scale); cairo_surface_set_device_scale (impl->cairo_surface, scale, scale); } @@ -319,25 +319,25 @@ gdk_quartz_ref_cairo_surface (GdkWindow *window) } static void -gdk_window_impl_quartz_init (GdkWindowImplQuartz *impl) +gdk_surface_impl_quartz_init (GdkSurfaceImplQuartz *impl) { - impl->type_hint = GDK_WINDOW_TYPE_HINT_NORMAL; + impl->type_hint = GDK_SURFACE_TYPE_HINT_NORMAL; } static gboolean -gdk_window_impl_quartz_begin_paint (GdkWindow *window) +gdk_surface_impl_quartz_begin_paint (GdkSurface *window) { return FALSE; } static void -gdk_quartz_window_set_needs_display_in_region (GdkWindow *window, +gdk_quartz_surface_set_needs_display_in_region (GdkSurface *window, cairo_region_t *region) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; int i, n_rects; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (!impl->needs_display_region) impl->needs_display_region = cairo_region_create (); @@ -355,7 +355,7 @@ gdk_quartz_window_set_needs_display_in_region (GdkWindow *window, } void -_gdk_quartz_window_process_updates_recurse (GdkWindow *window, +_gdk_quartz_surface_process_updates_recurse (GdkSurface *window, cairo_region_t *region) { /* Make sure to only flush each toplevel at most once if we're called @@ -363,15 +363,15 @@ _gdk_quartz_window_process_updates_recurse (GdkWindow *window, */ if (in_process_all_updates) { - GdkWindow *toplevel; + GdkSurface *toplevel; - toplevel = gdk_window_get_toplevel (window); + toplevel = gdk_surface_get_toplevel (window); if (toplevel && WINDOW_IS_TOPLEVEL (toplevel)) { - GdkWindowImplQuartz *toplevel_impl; + GdkSurfaceImplQuartz *toplevel_impl; NSWindow *nswindow; - toplevel_impl = (GdkWindowImplQuartz *)toplevel->impl; + toplevel_impl = (GdkSurfaceImplQuartz *)toplevel->impl; nswindow = toplevel_impl->toplevel; /* In theory, we could skip the flush disabling, since we only @@ -387,9 +387,9 @@ _gdk_quartz_window_process_updates_recurse (GdkWindow *window, } if (WINDOW_IS_TOPLEVEL (window)) - gdk_quartz_window_set_needs_display_in_region (window, region); + gdk_quartz_surface_set_needs_display_in_region (window, region); else - _gdk_window_process_updates_recurse (window, region); + _gdk_surface_process_updates_recurse (window, region); /* NOTE: I'm not sure if we should displayIfNeeded here. It slows down a * lot (since it triggers the beam syncing) and things seem to work @@ -410,10 +410,10 @@ get_default_title (void) } static void -get_ancestor_coordinates_from_child (GdkWindow *child_window, +get_ancestor_coordinates_from_child (GdkSurface *child_window, gint child_x, gint child_y, - GdkWindow *ancestor_window, + GdkSurface *ancestor_window, gint *ancestor_x, gint *ancestor_y) { @@ -430,11 +430,11 @@ get_ancestor_coordinates_from_child (GdkWindow *child_window, } void -_gdk_quartz_window_debug_highlight (GdkWindow *window, gint number) +_gdk_quartz_surface_debug_highlight (GdkSurface *window, gint number) { gint x, y; gint gx, gy; - GdkWindow *toplevel; + GdkSurface *toplevel; gint tx, ty; static NSWindow *debug_window[10]; static NSRect old_rect[10]; @@ -455,14 +455,14 @@ _gdk_quartz_window_debug_highlight (GdkWindow *window, gint number) return; } - toplevel = gdk_window_get_toplevel (window); + toplevel = gdk_surface_get_toplevel (window); get_ancestor_coordinates_from_child (window, 0, 0, toplevel, &x, &y); - gdk_window_get_origin (toplevel, &tx, &ty); + gdk_surface_get_origin (toplevel, &tx, &ty); x += tx; y += ty; - _gdk_quartz_window_gdk_xy_to_xy (x, y + window->height, + _gdk_quartz_surface_gdk_xy_to_xy (x, y + window->height, &gx, &gy); rect = NSMakeRect (gx, gy, window->width, window->height); @@ -516,21 +516,21 @@ _gdk_quartz_window_debug_highlight (GdkWindow *window, gint number) } gboolean -_gdk_quartz_window_is_ancestor (GdkWindow *ancestor, - GdkWindow *window) +_gdk_quartz_surface_is_ancestor (GdkSurface *ancestor, + GdkSurface *window) { if (ancestor == NULL || window == NULL) return FALSE; - return (gdk_window_get_parent (window) == ancestor || - _gdk_quartz_window_is_ancestor (ancestor, - gdk_window_get_parent (window))); + return (gdk_surface_get_parent (window) == ancestor || + _gdk_quartz_surface_is_ancestor (ancestor, + gdk_surface_get_parent (window))); } /* See notes on top of gdkscreen-quartz.c */ void -_gdk_quartz_window_gdk_xy_to_xy (gint gdk_x, +_gdk_quartz_surface_gdk_xy_to_xy (gint gdk_x, gint gdk_y, gint *ns_x, gint *ns_y) @@ -545,7 +545,7 @@ _gdk_quartz_window_gdk_xy_to_xy (gint gdk_x, } void -_gdk_quartz_window_xy_to_gdk_xy (gint ns_x, +_gdk_quartz_surface_xy_to_gdk_xy (gint ns_x, gint ns_y, gint *gdk_x, gint *gdk_y) @@ -560,37 +560,37 @@ _gdk_quartz_window_xy_to_gdk_xy (gint ns_x, } void -_gdk_quartz_window_nspoint_to_gdk_xy (NSPoint point, +_gdk_quartz_surface_nspoint_to_gdk_xy (NSPoint point, gint *x, gint *y) { - _gdk_quartz_window_xy_to_gdk_xy (point.x, point.y, + _gdk_quartz_surface_xy_to_gdk_xy (point.x, point.y, x, y); } -static GdkWindow * -find_child_window_helper (GdkWindow *window, +static GdkSurface * +find_child_window_helper (GdkSurface *window, gint x, gint y, gint x_offset, gint y_offset, gboolean get_toplevel) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; GList *l; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (window == _gdk_root) update_toplevel_order (); for (l = impl->sorted_children; l; l = l->next) { - GdkWindow *child = l->data; - GdkWindowImplQuartz *child_impl = GDK_WINDOW_IMPL_QUARTZ (child->impl); + GdkSurface *child = l->data; + GdkSurfaceImplQuartz *child_impl = GDK_SURFACE_IMPL_QUARTZ (child->impl); int temp_x, temp_y; - if (!GDK_WINDOW_IS_MAPPED (child)) + if (!GDK_SURFACE_IS_MAPPED (child)) continue; temp_x = x_offset + child->x; @@ -623,7 +623,7 @@ find_child_window_helper (GdkWindow *window, /* The root means "unknown" i.e. a window not managed by * GDK. */ - return (GdkWindow *)_gdk_root; + return (GdkSurface *)_gdk_root; } } @@ -642,12 +642,12 @@ find_child_window_helper (GdkWindow *window, return window; } -/* Given a GdkWindow and coordinates relative to it, returns the +/* Given a GdkSurface and coordinates relative to it, returns the * innermost subwindow that contains the point. If the coordinates are * outside the passed in window, NULL is returned. */ -GdkWindow * -_gdk_quartz_window_find_child (GdkWindow *window, +GdkSurface * +_gdk_quartz_surface_find_child (GdkSurface *window, gint x, gint y, gboolean get_toplevel) @@ -660,20 +660,20 @@ _gdk_quartz_window_find_child (GdkWindow *window, void -_gdk_quartz_window_did_become_main (GdkWindow *window) +_gdk_quartz_surface_did_become_main (GdkSurface *window) { main_window_stack = g_slist_remove (main_window_stack, window); - if (window->window_type != GDK_WINDOW_TEMP) + if (window->window_type != GDK_SURFACE_TEMP) main_window_stack = g_slist_prepend (main_window_stack, window); clear_toplevel_order (); } void -_gdk_quartz_window_did_resign_main (GdkWindow *window) +_gdk_quartz_surface_did_resign_main (GdkSurface *window) { - GdkWindow *new_window = NULL; + GdkSurface *new_window = NULL; if (main_window_stack) new_window = main_window_stack->data; @@ -688,10 +688,10 @@ _gdk_quartz_window_did_resign_main (GdkWindow *window) if (new_window && new_window != window && - GDK_WINDOW_IS_MAPPED (new_window) && + GDK_SURFACE_IS_MAPPED (new_window) && WINDOW_IS_TOPLEVEL (new_window)) { - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (new_window->impl); + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (new_window->impl); [impl->toplevel makeKeyAndOrderFront:impl->toplevel]; } @@ -729,30 +729,30 @@ get_nsscreen_for_point (gint x, gint y) void _gdk_quartz_display_create_window_impl (GdkDisplay *display, - GdkWindow *window, - GdkWindow *real_parent, + GdkSurface *window, + GdkSurface *real_parent, GdkEventMask event_mask, - GdkWindowAttr *attributes) + GdkSurfaceAttr *attributes) { - GdkWindowImplQuartz *impl; - GdkWindowImplQuartz *parent_impl; + GdkSurfaceImplQuartz *impl; + GdkSurfaceImplQuartz *parent_impl; GDK_QUARTZ_ALLOC_POOL; - impl = g_object_new (GDK_TYPE_WINDOW_IMPL_QUARTZ, NULL); - window->impl = GDK_WINDOW_IMPL (impl); + impl = g_object_new (GDK_TYPE_SURFACE_IMPL_QUARTZ, NULL); + window->impl = GDK_SURFACE_IMPL (impl); impl->wrapper = window; - parent_impl = GDK_WINDOW_IMPL_QUARTZ (window->parent->impl); + parent_impl = GDK_SURFACE_IMPL_QUARTZ (window->parent->impl); switch (window->window_type) { - case GDK_WINDOW_TOPLEVEL: - case GDK_WINDOW_TEMP: - if (GDK_WINDOW_TYPE (window->parent) != GDK_WINDOW_ROOT) + case GDK_SURFACE_TOPLEVEL: + case GDK_SURFACE_TEMP: + if (GDK_SURFACE_TYPE (window->parent) != GDK_SURFACE_ROOT) { /* The common code warns for this case */ - parent_impl = GDK_WINDOW_IMPL_QUARTZ (_gdk_root->impl); + parent_impl = GDK_SURFACE_IMPL_QUARTZ (_gdk_root->impl); } } @@ -766,8 +766,8 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display, switch (window->window_type) { - case GDK_WINDOW_TOPLEVEL: - case GDK_WINDOW_TEMP: + case GDK_SURFACE_TOPLEVEL: + case GDK_SURFACE_TEMP: { NSScreen *screen; NSRect screen_rect; @@ -780,7 +780,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display, * to find the screen the window will be on and correct the * content_rect coordinates to be relative to that screen. */ - _gdk_quartz_window_gdk_xy_to_xy (window->x, window->y, &nx, &ny); + _gdk_quartz_surface_gdk_xy_to_xy (window->x, window->y, &nx, &ny); screen = get_nsscreen_for_point (nx, ny); screen_rect = [screen frame]; @@ -791,7 +791,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display, window->width, window->height); - if (window->window_type == GDK_WINDOW_TEMP) + if (window->window_type == GDK_SURFACE_TEMP) { style_mask = NSBorderlessWindowMask; } @@ -809,7 +809,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display, defer:NO screen:screen]; - gdk_window_set_title (window, get_default_title ()); + gdk_surface_set_title (window, get_default_title ()); [impl->toplevel setOpaque:NO]; [impl->toplevel setBackgroundColor:[NSColor clearColor]]; @@ -818,15 +818,15 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display, content_rect.origin.y = 0; impl->view = [[GdkQuartzView alloc] initWithFrame:content_rect]; - [impl->view setGdkWindow:window]; + [impl->view setGdkSurface:window]; [impl->toplevel setContentView:impl->view]; [impl->view release]; } break; - case GDK_WINDOW_CHILD: + case GDK_SURFACE_CHILD: { - GdkWindowImplQuartz *parent_impl = GDK_WINDOW_IMPL_QUARTZ (window->parent->impl); + GdkSurfaceImplQuartz *parent_impl = GDK_SURFACE_IMPL_QUARTZ (window->parent->impl); if (!window->input_only) { @@ -837,9 +837,9 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display, impl->view = [[GdkQuartzView alloc] initWithFrame:frame_rect]; - [impl->view setGdkWindow:window]; + [impl->view setGdkSurface:window]; - /* GdkWindows should be hidden by default */ + /* GdkSurfaces should be hidden by default */ [impl->view setHidden:YES]; [parent_impl->view addSubview:impl->view]; [impl->view release]; @@ -855,18 +855,18 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display, } void -_gdk_quartz_window_update_position (GdkWindow *window) +_gdk_quartz_surface_update_position (GdkSurface *window) { NSRect frame_rect; NSRect content_rect; - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); GDK_QUARTZ_ALLOC_POOL; frame_rect = [impl->toplevel frame]; content_rect = [impl->toplevel contentRectForFrameRect:frame_rect]; - _gdk_quartz_window_xy_to_gdk_xy (content_rect.origin.x, + _gdk_quartz_surface_xy_to_gdk_xy (content_rect.origin.x, content_rect.origin.y + content_rect.size.height, &window->x, &window->y); @@ -875,9 +875,9 @@ _gdk_quartz_window_update_position (GdkWindow *window) } void -_gdk_quartz_window_init_windowing (GdkDisplay *display) +_gdk_quartz_surface_init_windowing (GdkDisplay *display) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; g_assert (_gdk_root == NULL); @@ -886,26 +886,26 @@ _gdk_quartz_window_init_windowing (GdkDisplay *display) _gdk_root->impl = g_object_new (_gdk_root_window_impl_quartz_get_type (), NULL); _gdk_root->impl_window = _gdk_root; - impl = GDK_WINDOW_IMPL_QUARTZ (_gdk_root->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (_gdk_root->impl); _gdk_quartz_screen_update_window_sizes (screen); - _gdk_root->state = 0; /* We don't want GDK_WINDOW_STATE_WITHDRAWN here */ - _gdk_root->window_type = GDK_WINDOW_ROOT; + _gdk_root->state = 0; /* We don't want GDK_SURFACE_STATE_WITHDRAWN here */ + _gdk_root->window_type = GDK_SURFACE_ROOT; _gdk_root->viewable = TRUE; impl->wrapper = _gdk_root; } static void -gdk_quartz_window_destroy (GdkWindow *window, +gdk_quartz_surface_destroy (GdkSurface *window, gboolean recursing, gboolean foreign_destroy) { - GdkWindowImplQuartz *impl; - GdkWindow *parent; + GdkSurfaceImplQuartz *impl; + GdkSurface *parent; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); main_window_stack = g_slist_remove (main_window_stack, window); @@ -915,7 +915,7 @@ gdk_quartz_window_destroy (GdkWindow *window, parent = window->parent; if (parent) { - GdkWindowImplQuartz *parent_impl = GDK_WINDOW_IMPL_QUARTZ (parent->impl); + GdkSurfaceImplQuartz *parent_impl = GDK_SURFACE_IMPL_QUARTZ (parent->impl); parent_impl->sorted_children = g_list_remove (parent_impl->sorted_children, window); } @@ -945,14 +945,14 @@ gdk_quartz_window_destroy (GdkWindow *window, * note that already_mapped is not used yet, see the x11 backend. */ static void -gdk_window_quartz_show (GdkWindow *window, gboolean already_mapped) +gdk_surface_quartz_show (GdkSurface *window, gboolean already_mapped) { - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); gboolean focus_on_map; GDK_QUARTZ_ALLOC_POOL; - if (!GDK_WINDOW_IS_MAPPED (window)) + if (!GDK_SURFACE_IS_MAPPED (window)) focus_on_map = window->focus_on_map; else focus_on_map = TRUE; @@ -962,7 +962,7 @@ gdk_window_quartz_show (GdkWindow *window, gboolean already_mapped) gboolean make_key; make_key = (window->accept_focus && focus_on_map && - window->window_type != GDK_WINDOW_TEMP); + window->window_type != GDK_SURFACE_TEMP); [(GdkQuartzNSWindow*)impl->toplevel showAndMakeKey:make_key]; clear_toplevel_order (); @@ -976,16 +976,16 @@ gdk_window_quartz_show (GdkWindow *window, gboolean already_mapped) [impl->view setNeedsDisplay:YES]; - gdk_synthesize_window_state (window, GDK_WINDOW_STATE_WITHDRAWN, 0); + gdk_synthesize_window_state (window, GDK_SURFACE_STATE_WITHDRAWN, 0); - if (window->state & GDK_WINDOW_STATE_MAXIMIZED) - gdk_window_maximize (window); + if (window->state & GDK_SURFACE_STATE_MAXIMIZED) + gdk_surface_maximize (window); - if (window->state & GDK_WINDOW_STATE_ICONIFIED) - gdk_window_iconify (window); + if (window->state & GDK_SURFACE_STATE_ICONIFIED) + gdk_surface_iconify (window); - if (impl->transient_for && !GDK_WINDOW_DESTROYED (impl->transient_for)) - _gdk_quartz_window_attach_to_parent (window); + if (impl->transient_for && !GDK_SURFACE_DESTROYED (impl->transient_for)) + _gdk_quartz_surface_attach_to_parent (window); GDK_QUARTZ_RELEASE_POOL; } @@ -994,21 +994,21 @@ gdk_window_quartz_show (GdkWindow *window, gboolean already_mapped) * transient. */ void -_gdk_quartz_window_detach_from_parent (GdkWindow *window) +_gdk_quartz_surface_detach_from_parent (GdkSurface *window) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); g_return_if_fail (impl->toplevel != NULL); - if (impl->transient_for && !GDK_WINDOW_DESTROYED (impl->transient_for)) + if (impl->transient_for && !GDK_SURFACE_DESTROYED (impl->transient_for)) { - GdkWindowImplQuartz *parent_impl; + GdkSurfaceImplQuartz *parent_impl; - parent_impl = GDK_WINDOW_IMPL_QUARTZ (impl->transient_for->impl); + parent_impl = GDK_SURFACE_IMPL_QUARTZ (impl->transient_for->impl); [parent_impl->toplevel removeChildWindow:impl->toplevel]; clear_toplevel_order (); } @@ -1016,30 +1016,30 @@ _gdk_quartz_window_detach_from_parent (GdkWindow *window) /* Re-sets the parent window, if the window is a transient. */ void -_gdk_quartz_window_attach_to_parent (GdkWindow *window) +_gdk_quartz_surface_attach_to_parent (GdkSurface *window) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); g_return_if_fail (impl->toplevel != NULL); - if (impl->transient_for && !GDK_WINDOW_DESTROYED (impl->transient_for)) + if (impl->transient_for && !GDK_SURFACE_DESTROYED (impl->transient_for)) { - GdkWindowImplQuartz *parent_impl; + GdkSurfaceImplQuartz *parent_impl; - parent_impl = GDK_WINDOW_IMPL_QUARTZ (impl->transient_for->impl); + parent_impl = GDK_SURFACE_IMPL_QUARTZ (impl->transient_for->impl); [parent_impl->toplevel addChildWindow:impl->toplevel ordered:NSWindowAbove]; clear_toplevel_order (); } } void -gdk_window_quartz_hide (GdkWindow *window) +gdk_surface_quartz_hide (GdkSurface *window) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; /* Make sure we're not stuck in fullscreen mode. */ #ifndef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER @@ -1047,19 +1047,19 @@ gdk_window_quartz_hide (GdkWindow *window) SetSystemUIMode (kUIModeNormal, 0); #endif - _gdk_window_clear_update_area (window); + _gdk_surface_clear_update_area (window); - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (WINDOW_IS_TOPLEVEL (window)) { /* Update main window. */ main_window_stack = g_slist_remove (main_window_stack, window); if ([NSApp mainWindow] == impl->toplevel) - _gdk_quartz_window_did_resign_main (window); + _gdk_quartz_surface_did_resign_main (window); if (impl->transient_for) - _gdk_quartz_window_detach_from_parent (window); + _gdk_quartz_surface_detach_from_parent (window); [(GdkQuartzNSWindow*)impl->toplevel hide]; } @@ -1070,19 +1070,19 @@ gdk_window_quartz_hide (GdkWindow *window) } void -gdk_window_quartz_withdraw (GdkWindow *window) +gdk_surface_quartz_withdraw (GdkSurface *window) { - gdk_window_hide (window); + gdk_surface_hide (window); } static void -move_resize_window_internal (GdkWindow *window, +move_resize_window_internal (GdkSurface *window, gint x, gint y, gint width, gint height) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; GdkRectangle old_visible; GdkRectangle new_visible; GdkRectangle scroll_rect; @@ -1090,10 +1090,10 @@ move_resize_window_internal (GdkWindow *window, cairo_region_t *expose_region; NSSize delta; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if ((x == -1 || (x == window->x)) && (y == -1 || (y == window->y)) && @@ -1149,7 +1149,7 @@ move_resize_window_internal (GdkWindow *window, NSRect frame_rect; gint gx, gy; - _gdk_quartz_window_gdk_xy_to_xy (window->x, window->y + window->height, + _gdk_quartz_surface_gdk_xy_to_xy (window->x, window->y + window->height, &gx, &gy); content_rect = NSMakeRect (gx, gy, window->width, window->height); @@ -1198,7 +1198,7 @@ move_resize_window_internal (GdkWindow *window, [impl->view setFrame:nsrect]; - gdk_quartz_window_set_needs_display_in_region (window, expose_region); + gdk_quartz_surface_set_needs_display_in_region (window, expose_region); } else { @@ -1215,26 +1215,26 @@ move_resize_window_internal (GdkWindow *window, } static inline void -window_quartz_move (GdkWindow *window, +window_quartz_move (GdkSurface *window, gint x, gint y) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (window->state & GDK_WINDOW_STATE_FULLSCREEN) + if (window->state & GDK_SURFACE_STATE_FULLSCREEN) return; move_resize_window_internal (window, x, y, -1, -1); } static inline void -window_quartz_resize (GdkWindow *window, +window_quartz_resize (GdkSurface *window, gint width, gint height) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (window->state & GDK_WINDOW_STATE_FULLSCREEN) + if (window->state & GDK_SURFACE_STATE_FULLSCREEN) return; if (width < 1) @@ -1246,7 +1246,7 @@ window_quartz_resize (GdkWindow *window, } static inline void -window_quartz_move_resize (GdkWindow *window, +window_quartz_move_resize (GdkSurface *window, gint x, gint y, gint width, @@ -1261,7 +1261,7 @@ window_quartz_move_resize (GdkWindow *window, } static void -gdk_window_quartz_move_resize (GdkWindow *window, +gdk_surface_quartz_move_resize (GdkSurface *window, gboolean with_move, gint x, gint y, @@ -1286,12 +1286,12 @@ gdk_window_quartz_move_resize (GdkWindow *window, static void update_toplevel_order (void) { - GdkWindowImplQuartz *root_impl; + GdkSurfaceImplQuartz *root_impl; NSEnumerator *enumerator; id nswindow; GList *toplevels = NULL; - root_impl = GDK_WINDOW_IMPL_QUARTZ (_gdk_root->impl); + root_impl = GDK_SURFACE_IMPL_QUARTZ (_gdk_root->impl); if (root_impl->sorted_children) return; @@ -1301,7 +1301,7 @@ update_toplevel_order (void) enumerator = [[NSApp orderedWindows] objectEnumerator]; while ((nswindow = [enumerator nextObject])) { - GdkWindow *window; + GdkSurface *window; if (![[nswindow contentView] isKindOfClass:[GdkQuartzView class]]) continue; @@ -1318,38 +1318,38 @@ update_toplevel_order (void) static void clear_toplevel_order (void) { - GdkWindowImplQuartz *root_impl; + GdkSurfaceImplQuartz *root_impl; - root_impl = GDK_WINDOW_IMPL_QUARTZ (_gdk_root->impl); + root_impl = GDK_SURFACE_IMPL_QUARTZ (_gdk_root->impl); g_list_free (root_impl->sorted_children); root_impl->sorted_children = NULL; } static void -gdk_window_quartz_raise (GdkWindow *window) +gdk_surface_quartz_raise (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (WINDOW_IS_TOPLEVEL (window)) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); [impl->toplevel orderFront:impl->toplevel]; clear_toplevel_order (); } else { - GdkWindow *parent = window->parent; + GdkSurface *parent = window->parent; if (parent) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - impl = (GdkWindowImplQuartz *)parent->impl; + impl = (GdkSurfaceImplQuartz *)parent->impl; impl->sorted_children = g_list_remove (impl->sorted_children, window); impl->sorted_children = g_list_prepend (impl->sorted_children, window); @@ -1358,29 +1358,29 @@ gdk_window_quartz_raise (GdkWindow *window) } static void -gdk_window_quartz_lower (GdkWindow *window) +gdk_surface_quartz_lower (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (WINDOW_IS_TOPLEVEL (window)) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); [impl->toplevel orderBack:impl->toplevel]; clear_toplevel_order (); } else { - GdkWindow *parent = window->parent; + GdkSurface *parent = window->parent; if (parent) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - impl = (GdkWindowImplQuartz *)parent->impl; + impl = (GdkSurfaceImplQuartz *)parent->impl; impl->sorted_children = g_list_remove (impl->sorted_children, window); impl->sorted_children = g_list_append (impl->sorted_children, window); @@ -1389,17 +1389,17 @@ gdk_window_quartz_lower (GdkWindow *window) } static void -gdk_window_quartz_restack_toplevel (GdkWindow *window, - GdkWindow *sibling, +gdk_surface_quartz_restack_toplevel (GdkSurface *window, + GdkSurface *sibling, gboolean above) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; gint sibling_num; - impl = GDK_WINDOW_IMPL_QUARTZ (sibling->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (sibling->impl); sibling_num = [impl->toplevel windowNumber]; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (above) [impl->toplevel orderWindow:NSWindowAbove relativeTo:sibling_num]; @@ -1408,19 +1408,19 @@ gdk_window_quartz_restack_toplevel (GdkWindow *window, } static void -gdk_window_quartz_get_geometry (GdkWindow *window, +gdk_surface_quartz_get_geometry (GdkSurface *window, gint *x, gint *y, gint *width, gint *height) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; NSRect ns_rect; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (window == _gdk_root) { if (x) @@ -1447,7 +1447,7 @@ gdk_window_quartz_get_geometry (GdkWindow *window, */ if ([impl->toplevel styleMask] == NSBorderlessWindowMask) { - _gdk_quartz_window_xy_to_gdk_xy (ns_rect.origin.x, + _gdk_quartz_surface_xy_to_gdk_xy (ns_rect.origin.x, ns_rect.origin.y + ns_rect.size.height, x, y); } @@ -1480,18 +1480,18 @@ gdk_window_quartz_get_geometry (GdkWindow *window, } static void -gdk_window_quartz_get_root_coords (GdkWindow *window, +gdk_surface_quartz_get_root_coords (GdkSurface *window, gint x, gint y, gint *root_x, gint *root_y) { int tmp_x = 0, tmp_y = 0; - GdkWindow *toplevel; + GdkSurface *toplevel; NSRect content_rect; - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) { if (root_x) *root_x = 0; @@ -1511,12 +1511,12 @@ gdk_window_quartz_get_root_coords (GdkWindow *window, return; } - toplevel = gdk_window_get_toplevel (window); - impl = GDK_WINDOW_IMPL_QUARTZ (toplevel->impl); + toplevel = gdk_surface_get_toplevel (window); + impl = GDK_SURFACE_IMPL_QUARTZ (toplevel->impl); content_rect = [impl->toplevel contentRectForFrameRect:[impl->toplevel frame]]; - _gdk_quartz_window_xy_to_gdk_xy (content_rect.origin.x, + _gdk_quartz_surface_xy_to_gdk_xy (content_rect.origin.x, content_rect.origin.y + content_rect.size.height, &tmp_x, &tmp_y); @@ -1525,7 +1525,7 @@ gdk_window_quartz_get_root_coords (GdkWindow *window, while (window != toplevel) { - if (_gdk_window_has_impl ((GdkWindow *)window)) + if (_gdk_surface_has_impl ((GdkSurface *)window)) { tmp_x += window->x; tmp_y += window->y; @@ -1541,8 +1541,8 @@ gdk_window_quartz_get_root_coords (GdkWindow *window, } /* Returns coordinates relative to the passed in window. */ -static GdkWindow * -gdk_window_quartz_get_device_state_helper (GdkWindow *window, +static GdkSurface * +gdk_surface_quartz_get_device_state_helper (GdkSurface *window, GdkDevice *device, gdouble *x, gdouble *y, @@ -1550,12 +1550,12 @@ gdk_window_quartz_get_device_state_helper (GdkWindow *window, { NSPoint point; gint x_tmp, y_tmp; - GdkWindow *toplevel; - GdkWindow *found_window; + GdkSurface *toplevel; + 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; *y = 0; @@ -1563,7 +1563,7 @@ gdk_window_quartz_get_device_state_helper (GdkWindow *window, return NULL; } - toplevel = gdk_window_get_toplevel (window); + toplevel = gdk_surface_get_toplevel (window); *mask = _gdk_quartz_events_get_current_keyboard_modifiers () | _gdk_quartz_events_get_current_mouse_modifiers (); @@ -1572,14 +1572,14 @@ gdk_window_quartz_get_device_state_helper (GdkWindow *window, if (window == _gdk_root) { 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 { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; NSWindow *nswindow; - impl = GDK_WINDOW_IMPL_QUARTZ (toplevel->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (toplevel->impl); nswindow = impl->toplevel; point = [nswindow mouseLocationOutsideOfEventStream]; @@ -1587,10 +1587,10 @@ gdk_window_quartz_get_device_state_helper (GdkWindow *window, x_tmp = point.x; y_tmp = toplevel->height - point.y; - window = (GdkWindow *)toplevel; + window = (GdkSurface *)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); /* We never return the root window. */ @@ -1604,38 +1604,38 @@ gdk_window_quartz_get_device_state_helper (GdkWindow *window, } static gboolean -gdk_window_quartz_get_device_state (GdkWindow *window, +gdk_surface_quartz_get_device_state (GdkSurface *window, GdkDevice *device, gdouble *x, gdouble *y, GdkModifierType *mask) { - return gdk_window_quartz_get_device_state_helper (window, + return gdk_surface_quartz_get_device_state_helper (window, device, x, y, mask) != NULL; } static GdkEventMask -gdk_window_quartz_get_events (GdkWindow *window) +gdk_surface_quartz_get_events (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return 0; else return window->event_mask; } static void -gdk_window_quartz_set_events (GdkWindow *window, +gdk_surface_quartz_set_events (GdkSurface *window, GdkEventMask event_mask) { /* The mask is set in the common code. */ } static void -gdk_quartz_window_set_urgency_hint (GdkWindow *window, +gdk_quartz_surface_set_urgency_hint (GdkSurface *window, gboolean urgent) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; @@ -1643,19 +1643,19 @@ gdk_quartz_window_set_urgency_hint (GdkWindow *window, } static void -gdk_quartz_window_set_geometry_hints (GdkWindow *window, +gdk_quartz_surface_set_geometry_hints (GdkSurface *window, const GdkGeometry *geometry, - GdkWindowHints geom_mask) + GdkSurfaceHints geom_mask) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; g_return_if_fail (geometry != NULL); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (!impl->toplevel) return; @@ -1731,18 +1731,18 @@ gdk_quartz_window_set_geometry_hints (GdkWindow *window, } static void -gdk_quartz_window_set_title (GdkWindow *window, +gdk_quartz_surface_set_title (GdkSurface *window, const gchar *title) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; g_return_if_fail (title != NULL); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (impl->toplevel) { @@ -1753,10 +1753,10 @@ gdk_quartz_window_set_title (GdkWindow *window, } static void -gdk_quartz_window_set_role (GdkWindow *window, +gdk_quartz_surface_set_role (GdkSurface *window, const gchar *role) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || WINDOW_IS_TOPLEVEL (window)) return; @@ -1764,24 +1764,24 @@ gdk_quartz_window_set_role (GdkWindow *window, } static void -gdk_quartz_window_set_startup_id (GdkWindow *window, +gdk_quartz_surface_set_startup_id (GdkSurface *window, const gchar *startup_id) { /* FIXME: Implement? */ } static void -gdk_quartz_window_set_transient_for (GdkWindow *window, - GdkWindow *parent) +gdk_quartz_surface_set_transient_for (GdkSurface *window, + GdkSurface *parent) { - GdkWindowImplQuartz *window_impl; - GdkWindowImplQuartz *parent_impl; + GdkSurfaceImplQuartz *window_impl; + GdkSurfaceImplQuartz *parent_impl; - if (GDK_WINDOW_DESTROYED (window) || GDK_WINDOW_DESTROYED (parent) || + if (GDK_SURFACE_DESTROYED (window) || GDK_SURFACE_DESTROYED (parent) || !WINDOW_IS_TOPLEVEL (window)) return; - window_impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + window_impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (!window_impl->toplevel) return; @@ -1789,13 +1789,13 @@ gdk_quartz_window_set_transient_for (GdkWindow *window, if (window_impl->transient_for) { - _gdk_quartz_window_detach_from_parent (window); + _gdk_quartz_surface_detach_from_parent (window); g_object_unref (window_impl->transient_for); window_impl->transient_for = NULL; } - parent_impl = GDK_WINDOW_IMPL_QUARTZ (parent->impl); + parent_impl = GDK_SURFACE_IMPL_QUARTZ (parent->impl); if (parent_impl->toplevel) { /* We save the parent because it needs to be unset/reset when @@ -1807,7 +1807,7 @@ gdk_quartz_window_set_transient_for (GdkWindow *window, * the parent window will be brought to the top just because the * tooltip is, which is not what we want. */ - if (gdk_window_get_type_hint (window) != GDK_WINDOW_TYPE_HINT_TOOLTIP) + if (gdk_surface_get_type_hint (window) != GDK_SURFACE_TYPE_HINT_TOOLTIP) { window_impl->transient_for = g_object_ref (parent); @@ -1815,8 +1815,8 @@ gdk_quartz_window_set_transient_for (GdkWindow *window, * be shown unconditionally here. If it is not shown, the * window will be added in show() instead. */ - if (!(window->state & GDK_WINDOW_STATE_WITHDRAWN)) - _gdk_quartz_window_attach_to_parent (window); + if (!(window->state & GDK_SURFACE_STATE_WITHDRAWN)) + _gdk_quartz_surface_attach_to_parent (window); } } @@ -1824,7 +1824,7 @@ gdk_quartz_window_set_transient_for (GdkWindow *window, } static void -gdk_window_quartz_shape_combine_region (GdkWindow *window, +gdk_surface_quartz_shape_combine_region (GdkSurface *window, const cairo_region_t *shape, gint x, gint y) @@ -1833,7 +1833,7 @@ gdk_window_quartz_shape_combine_region (GdkWindow *window, } static void -gdk_window_quartz_input_shape_combine_region (GdkWindow *window, +gdk_surface_quartz_input_shape_combine_region (GdkSurface *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y) @@ -1842,39 +1842,39 @@ gdk_window_quartz_input_shape_combine_region (GdkWindow *window, } static void -gdk_quartz_window_set_accept_focus (GdkWindow *window, +gdk_quartz_surface_set_accept_focus (GdkSurface *window, gboolean accept_focus) { window->accept_focus = accept_focus != FALSE; } static void -gdk_quartz_window_set_focus_on_map (GdkWindow *window, +gdk_quartz_surface_set_focus_on_map (GdkSurface *window, gboolean focus_on_map) { window->focus_on_map = focus_on_map != FALSE; } static void -gdk_quartz_window_set_icon_name (GdkWindow *window, +gdk_quartz_surface_set_icon_name (GdkSurface *window, const gchar *name) { /* FIXME: Implement */ } static void -gdk_quartz_window_focus (GdkWindow *window, +gdk_quartz_surface_focus (GdkSurface *window, guint32 timestamp) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - if (window->accept_focus && window->window_type != GDK_WINDOW_TEMP) + if (window->accept_focus && window->window_type != GDK_SURFACE_TEMP) { GDK_QUARTZ_ALLOC_POOL; [impl->toplevel makeKeyAndOrderFront:impl->toplevel]; @@ -1884,37 +1884,37 @@ gdk_quartz_window_focus (GdkWindow *window, } static gint -window_type_hint_to_level (GdkWindowTypeHint hint) +window_type_hint_to_level (GdkSurfaceTypeHint hint) { /* the order in this switch statement corresponds to the actual * stacking order: the first group is top, the last group is bottom */ switch (hint) { - case GDK_WINDOW_TYPE_HINT_POPUP_MENU: - case GDK_WINDOW_TYPE_HINT_COMBO: - case GDK_WINDOW_TYPE_HINT_DND: - case GDK_WINDOW_TYPE_HINT_TOOLTIP: + case GDK_SURFACE_TYPE_HINT_POPUP_MENU: + case GDK_SURFACE_TYPE_HINT_COMBO: + case GDK_SURFACE_TYPE_HINT_DND: + case GDK_SURFACE_TYPE_HINT_TOOLTIP: return NSPopUpMenuWindowLevel; - case GDK_WINDOW_TYPE_HINT_NOTIFICATION: - case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: + case GDK_SURFACE_TYPE_HINT_NOTIFICATION: + case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN: return NSStatusWindowLevel; - case GDK_WINDOW_TYPE_HINT_MENU: /* Torn-off menu */ - case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: /* Menu from menubar */ + case GDK_SURFACE_TYPE_HINT_MENU: /* Torn-off menu */ + case GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU: /* Menu from menubar */ return NSTornOffMenuWindowLevel; - case GDK_WINDOW_TYPE_HINT_DOCK: + case GDK_SURFACE_TYPE_HINT_DOCK: return NSFloatingWindowLevel; /* NSDockWindowLevel is deprecated, and not replaced */ - case GDK_WINDOW_TYPE_HINT_UTILITY: - case GDK_WINDOW_TYPE_HINT_DIALOG: /* Dialog window */ - case GDK_WINDOW_TYPE_HINT_NORMAL: /* Normal toplevel window */ - case GDK_WINDOW_TYPE_HINT_TOOLBAR: /* Window used to implement toolbars */ + case GDK_SURFACE_TYPE_HINT_UTILITY: + case GDK_SURFACE_TYPE_HINT_DIALOG: /* Dialog window */ + case GDK_SURFACE_TYPE_HINT_NORMAL: /* Normal toplevel window */ + case GDK_SURFACE_TYPE_HINT_TOOLBAR: /* Window used to implement toolbars */ return NSNormalWindowLevel; - case GDK_WINDOW_TYPE_HINT_DESKTOP: + case GDK_SURFACE_TYPE_HINT_DESKTOP: return kCGDesktopWindowLevelKey; /* doesn't map to any real Cocoa model */ default: @@ -1925,26 +1925,26 @@ window_type_hint_to_level (GdkWindowTypeHint hint) } static gboolean -window_type_hint_to_shadow (GdkWindowTypeHint hint) +window_type_hint_to_shadow (GdkSurfaceTypeHint hint) { switch (hint) { - case GDK_WINDOW_TYPE_HINT_NORMAL: /* Normal toplevel window */ - case GDK_WINDOW_TYPE_HINT_DIALOG: /* Dialog window */ - case GDK_WINDOW_TYPE_HINT_DOCK: - case GDK_WINDOW_TYPE_HINT_UTILITY: - case GDK_WINDOW_TYPE_HINT_MENU: /* Torn-off menu */ - case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: /* Menu from menubar */ - case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: - case GDK_WINDOW_TYPE_HINT_POPUP_MENU: - case GDK_WINDOW_TYPE_HINT_COMBO: - case GDK_WINDOW_TYPE_HINT_NOTIFICATION: - case GDK_WINDOW_TYPE_HINT_TOOLTIP: + case GDK_SURFACE_TYPE_HINT_NORMAL: /* Normal toplevel window */ + case GDK_SURFACE_TYPE_HINT_DIALOG: /* Dialog window */ + case GDK_SURFACE_TYPE_HINT_DOCK: + case GDK_SURFACE_TYPE_HINT_UTILITY: + case GDK_SURFACE_TYPE_HINT_MENU: /* Torn-off menu */ + case GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU: /* Menu from menubar */ + case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN: + case GDK_SURFACE_TYPE_HINT_POPUP_MENU: + case GDK_SURFACE_TYPE_HINT_COMBO: + case GDK_SURFACE_TYPE_HINT_NOTIFICATION: + case GDK_SURFACE_TYPE_HINT_TOOLTIP: return TRUE; - case GDK_WINDOW_TYPE_HINT_TOOLBAR: /* Window used to implement toolbars */ - case GDK_WINDOW_TYPE_HINT_DESKTOP: /* N/A */ - case GDK_WINDOW_TYPE_HINT_DND: + case GDK_SURFACE_TYPE_HINT_TOOLBAR: /* Window used to implement toolbars */ + case GDK_SURFACE_TYPE_HINT_DESKTOP: /* N/A */ + case GDK_SURFACE_TYPE_HINT_DND: break; default: @@ -1955,15 +1955,15 @@ window_type_hint_to_shadow (GdkWindowTypeHint hint) } static gboolean -window_type_hint_to_hides_on_deactivate (GdkWindowTypeHint hint) +window_type_hint_to_hides_on_deactivate (GdkSurfaceTypeHint hint) { switch (hint) { - case GDK_WINDOW_TYPE_HINT_UTILITY: - case GDK_WINDOW_TYPE_HINT_MENU: /* Torn-off menu */ - case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: - case GDK_WINDOW_TYPE_HINT_NOTIFICATION: - case GDK_WINDOW_TYPE_HINT_TOOLTIP: + case GDK_SURFACE_TYPE_HINT_UTILITY: + case GDK_SURFACE_TYPE_HINT_MENU: /* Torn-off menu */ + case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN: + case GDK_SURFACE_TYPE_HINT_NOTIFICATION: + case GDK_SURFACE_TYPE_HINT_TOOLTIP: return TRUE; default: @@ -1974,7 +1974,7 @@ window_type_hint_to_hides_on_deactivate (GdkWindowTypeHint hint) } static void -_gdk_quartz_window_update_has_shadow (GdkWindowImplQuartz *impl) +_gdk_quartz_surface_update_has_shadow (GdkSurfaceImplQuartz *impl) { gboolean has_shadow; @@ -1987,43 +1987,43 @@ _gdk_quartz_window_update_has_shadow (GdkWindowImplQuartz *impl) } static void -gdk_quartz_window_set_type_hint (GdkWindow *window, - GdkWindowTypeHint hint) +gdk_quartz_surface_set_type_hint (GdkSurface *window, + GdkSurfaceTypeHint hint) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); impl->type_hint = hint; /* Match the documentation, only do something if we're not mapped yet. */ - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) return; - _gdk_quartz_window_update_has_shadow (impl); + _gdk_quartz_surface_update_has_shadow (impl); [impl->toplevel setLevel: window_type_hint_to_level (hint)]; [impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (hint)]; } -static GdkWindowTypeHint -gdk_quartz_window_get_type_hint (GdkWindow *window) +static GdkSurfaceTypeHint +gdk_quartz_surface_get_type_hint (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) - return GDK_WINDOW_TYPE_HINT_NORMAL; + return GDK_SURFACE_TYPE_HINT_NORMAL; - return GDK_WINDOW_IMPL_QUARTZ (window->impl)->type_hint; + return GDK_SURFACE_IMPL_QUARTZ (window->impl)->type_hint; } static void -gdk_quartz_window_set_modal_hint (GdkWindow *window, +gdk_quartz_surface_set_modal_hint (GdkSurface *window, gboolean modal) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; @@ -2031,10 +2031,10 @@ gdk_quartz_window_set_modal_hint (GdkWindow *window, } static void -gdk_quartz_window_set_skip_taskbar_hint (GdkWindow *window, +gdk_quartz_surface_set_skip_taskbar_hint (GdkSurface *window, gboolean skips_taskbar) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; @@ -2042,10 +2042,10 @@ gdk_quartz_window_set_skip_taskbar_hint (GdkWindow *window, } static void -gdk_quartz_window_set_skip_pager_hint (GdkWindow *window, +gdk_quartz_surface_set_skip_pager_hint (GdkSurface *window, gboolean skips_pager) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; @@ -2053,26 +2053,26 @@ gdk_quartz_window_set_skip_pager_hint (GdkWindow *window, } static void -gdk_quartz_window_begin_resize_drag (GdkWindow *window, - GdkWindowEdge edge, +gdk_quartz_surface_begin_resize_drag (GdkSurface *window, + GdkSurfaceEdge edge, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (!impl->toplevel) { - g_warning ("Can't call gdk_window_begin_resize_drag on non-toplevel window"); + g_warning ("Can't call gdk_surface_begin_resize_drag on non-toplevel window"); return; } @@ -2080,24 +2080,24 @@ gdk_quartz_window_begin_resize_drag (GdkWindow *window, } static void -gdk_quartz_window_begin_move_drag (GdkWindow *window, +gdk_quartz_surface_begin_move_drag (GdkSurface *window, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (!impl->toplevel) { - g_warning ("Can't call gdk_window_begin_move_drag on non-toplevel window"); + g_warning ("Can't call gdk_surface_begin_move_drag on non-toplevel window"); return; } @@ -2105,18 +2105,18 @@ gdk_quartz_window_begin_move_drag (GdkWindow *window, } static void -gdk_quartz_window_set_icon_list (GdkWindow *window, +gdk_quartz_surface_set_icon_list (GdkSurface *window, GList *surfaces) { /* FIXME: Implement */ } static void -gdk_quartz_window_get_frame_extents (GdkWindow *window, +gdk_quartz_surface_get_frame_extents (GdkSurface *window, GdkRectangle *rect) { - GdkWindow *toplevel; - GdkWindowImplQuartz *impl; + GdkSurface *toplevel; + GdkSurfaceImplQuartz *impl; NSRect ns_rect; g_return_if_fail (rect != NULL); @@ -2127,12 +2127,12 @@ gdk_quartz_window_get_frame_extents (GdkWindow *window, rect->width = 1; rect->height = 1; - toplevel = gdk_window_get_toplevel (window); - impl = GDK_WINDOW_IMPL_QUARTZ (toplevel->impl); + toplevel = gdk_surface_get_toplevel (window); + impl = GDK_SURFACE_IMPL_QUARTZ (toplevel->impl); ns_rect = [impl->toplevel frame]; - _gdk_quartz_window_xy_to_gdk_xy (ns_rect.origin.x, + _gdk_quartz_surface_xy_to_gdk_xy (ns_rect.origin.x, ns_rect.origin.y + ns_rect.size.height, &rect->x, &rect->y); @@ -2149,21 +2149,21 @@ gdk_quartz_window_get_frame_extents (GdkWindow *window, @end static void -gdk_quartz_window_set_decorations (GdkWindow *window, +gdk_quartz_surface_set_decorations (GdkSurface *window, GdkWMDecoration decorations) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; NSUInteger old_mask, new_mask; NSView *old_view; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); - if (decorations == 0 || GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP || - impl->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN ) + if (decorations == 0 || GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP || + impl->type_hint == GDK_SURFACE_TYPE_HINT_SPLASHSCREEN ) { new_mask = NSBorderlessWindowMask; } @@ -2232,7 +2232,7 @@ gdk_quartz_window_set_decorations (GdkWindow *window, NSScreen *screen = [impl->toplevel screen]; /* Make sure the old window is closed, recall that releasedWhenClosed - * is set on GdkQuartzWindows. + * is set on GdkQuartzSurfaces. */ [impl->toplevel close]; @@ -2241,7 +2241,7 @@ gdk_quartz_window_set_decorations (GdkWindow *window, backing:NSBackingStoreBuffered defer:NO screen:screen]; - _gdk_quartz_window_update_has_shadow (impl); + _gdk_quartz_surface_update_has_shadow (impl); [impl->toplevel setLevel: window_type_hint_to_level (impl->type_hint)]; if (title) @@ -2272,16 +2272,16 @@ gdk_quartz_window_set_decorations (GdkWindow *window, } static gboolean -gdk_quartz_window_get_decorations (GdkWindow *window, +gdk_quartz_surface_get_decorations (GdkSurface *window, GdkWMDecoration *decorations) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return FALSE; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (decorations) { @@ -2301,15 +2301,15 @@ gdk_quartz_window_get_decorations (GdkWindow *window, } static void -gdk_quartz_window_set_functions (GdkWindow *window, +gdk_quartz_surface_set_functions (GdkSurface *window, GdkWMFunction functions) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; gboolean min, max, close; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (functions & GDK_FUNC_ALL) { @@ -2348,35 +2348,35 @@ gdk_quartz_window_set_functions (GdkWindow *window, } static void -gdk_quartz_window_stick (GdkWindow *window) +gdk_quartz_surface_stick (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; } static void -gdk_quartz_window_unstick (GdkWindow *window) +gdk_quartz_surface_unstick (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; } static void -gdk_quartz_window_maximize (GdkWindow *window) +gdk_quartz_surface_maximize (GdkSurface *window) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; gboolean maximized; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); - maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED; + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); + maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { GDK_QUARTZ_ALLOC_POOL; @@ -2388,19 +2388,19 @@ gdk_quartz_window_maximize (GdkWindow *window) } static void -gdk_quartz_window_unmaximize (GdkWindow *window) +gdk_quartz_surface_unmaximize (GdkSurface *window) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; gboolean maximized; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); - maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED; + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); + maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { GDK_QUARTZ_ALLOC_POOL; @@ -2412,17 +2412,17 @@ gdk_quartz_window_unmaximize (GdkWindow *window) } static void -gdk_quartz_window_iconify (GdkWindow *window) +gdk_quartz_surface_iconify (GdkSurface *window) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { GDK_QUARTZ_ALLOC_POOL; @@ -2435,22 +2435,22 @@ gdk_quartz_window_iconify (GdkWindow *window) { gdk_synthesize_window_state (window, 0, - GDK_WINDOW_STATE_ICONIFIED); + GDK_SURFACE_STATE_ICONIFIED); } } static void -gdk_quartz_window_deiconify (GdkWindow *window) +gdk_quartz_surface_deiconify (GdkSurface *window) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { GDK_QUARTZ_ALLOC_POOL; @@ -2462,7 +2462,7 @@ gdk_quartz_window_deiconify (GdkWindow *window) else { gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_ICONIFIED, + GDK_SURFACE_STATE_ICONIFIED, 0); } } @@ -2470,77 +2470,77 @@ gdk_quartz_window_deiconify (GdkWindow *window) #ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER static gboolean -window_is_fullscreen (GdkWindow *window) +window_is_fullscreen (GdkSurface *window) { - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); return ([impl->toplevel styleMask] & NSFullScreenWindowMask) != 0; } static void -gdk_quartz_window_fullscreen (GdkWindow *window) +gdk_quartz_surface_fullscreen (GdkSurface *window) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (!window_is_fullscreen (window)) [impl->toplevel toggleFullScreen:nil]; } static void -gdk_quartz_window_unfullscreen (GdkWindow *window) +gdk_quartz_surface_unfullscreen (GdkSurface *window) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (window_is_fullscreen (window)) [impl->toplevel toggleFullScreen:nil]; } void -_gdk_quartz_window_update_fullscreen_state (GdkWindow *window) +_gdk_quartz_surface_update_fullscreen_state (GdkSurface *window) { gboolean is_fullscreen; gboolean was_fullscreen; is_fullscreen = window_is_fullscreen (window); - was_fullscreen = (gdk_window_get_state (window) & GDK_WINDOW_STATE_FULLSCREEN) != 0; + was_fullscreen = (gdk_surface_get_state (window) & GDK_SURFACE_STATE_FULLSCREEN) != 0; if (is_fullscreen != was_fullscreen) { if (is_fullscreen) - gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN); + gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); else - gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0); + gdk_synthesize_window_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0); } } #else static FullscreenSavedGeometry * -get_fullscreen_geometry (GdkWindow *window) +get_fullscreen_geometry (GdkSurface *window) { return g_object_get_data (G_OBJECT (window), FULLSCREEN_DATA); } static void -gdk_quartz_window_fullscreen (GdkWindow *window) +gdk_quartz_surface_fullscreen (GdkSurface *window) { FullscreenSavedGeometry *geometry; - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); NSRect frame; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; @@ -2554,14 +2554,14 @@ gdk_quartz_window_fullscreen (GdkWindow *window) geometry->width = window->width; geometry->height = window->height; - if (!gdk_window_get_decorations (window, &geometry->decor)) + if (!gdk_surface_get_decorations (window, &geometry->decor)) geometry->decor = GDK_DECOR_ALL; g_object_set_data_full (G_OBJECT (window), FULLSCREEN_DATA, geometry, g_free); - gdk_window_set_decorations (window, 0); + gdk_surface_set_decorations (window, 0); frame = [[impl->toplevel screen] frame]; move_resize_window_internal (window, @@ -2575,16 +2575,16 @@ gdk_quartz_window_fullscreen (GdkWindow *window) SetSystemUIMode (kUIModeAllHidden, kUIOptionAutoShowMenuBar); - gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN); + gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); } static void -gdk_quartz_window_unfullscreen (GdkWindow *window) +gdk_quartz_surface_unfullscreen (GdkSurface *window) { - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); FullscreenSavedGeometry *geometry; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; @@ -2599,63 +2599,63 @@ gdk_quartz_window_unfullscreen (GdkWindow *window) geometry->width, geometry->height); - gdk_window_set_decorations (window, geometry->decor); + gdk_surface_set_decorations (window, geometry->decor); g_object_set_data (G_OBJECT (window), FULLSCREEN_DATA, NULL); [impl->toplevel makeKeyAndOrderFront:impl->toplevel]; clear_toplevel_order (); - gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0); + gdk_synthesize_window_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0); } } #endif static void -gdk_quartz_window_set_keep_above (GdkWindow *window, +gdk_quartz_surface_set_keep_above (GdkSurface *window, gboolean setting) { - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); gint level; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - level = window_type_hint_to_level (gdk_window_get_type_hint (window)); + level = window_type_hint_to_level (gdk_surface_get_type_hint (window)); /* Adjust normal window level by one if necessary. */ [impl->toplevel setLevel: level + (setting ? 1 : 0)]; } static void -gdk_quartz_window_set_keep_below (GdkWindow *window, +gdk_quartz_surface_set_keep_below (GdkSurface *window, gboolean setting) { - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); gint level; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - level = window_type_hint_to_level (gdk_window_get_type_hint (window)); + level = window_type_hint_to_level (gdk_surface_get_type_hint (window)); /* Adjust normal window level by one if necessary. */ [impl->toplevel setLevel: level - (setting ? 1 : 0)]; } -static GdkWindow * -gdk_quartz_window_get_group (GdkWindow *window) +static GdkSurface * +gdk_quartz_surface_get_group (GdkSurface *window) { - g_return_val_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD, NULL); + g_return_val_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD, NULL); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return NULL; @@ -2665,28 +2665,28 @@ gdk_quartz_window_get_group (GdkWindow *window) } static void -gdk_quartz_window_set_group (GdkWindow *window, - GdkWindow *leader) +gdk_quartz_surface_set_group (GdkSurface *window, + GdkSurface *leader) { /* FIXME: Implement */ } static void -gdk_quartz_window_destroy_notify (GdkWindow *window) +gdk_quartz_surface_destroy_notify (GdkSurface *window) { check_grab_destroy (window); } static void -gdk_quartz_window_set_opacity (GdkWindow *window, +gdk_quartz_surface_set_opacity (GdkSurface *window, gdouble opacity) { - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); g_return_if_fail (WINDOW_IS_TOPLEVEL (window)); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; @@ -2699,24 +2699,24 @@ gdk_quartz_window_set_opacity (GdkWindow *window, } static void -gdk_quartz_window_set_shadow_width (GdkWindow *window, +gdk_quartz_surface_set_shadow_width (GdkSurface *window, gint left, gint right, gint top, gint bottom) { - GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + GdkSurfaceImplQuartz *impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); g_return_if_fail (WINDOW_IS_TOPLEVEL (window)); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; impl->shadow_top = top; impl->shadow_max = MAX (MAX (left, right), MAX (top, bottom)); - _gdk_quartz_window_update_has_shadow (impl); + _gdk_quartz_surface_update_has_shadow (impl); } /* Protocol to build cleanly for OSX < 10.7 */ @@ -2725,14 +2725,14 @@ gdk_quartz_window_set_shadow_width (GdkWindow *window, @end static gint -gdk_quartz_window_get_scale_factor (GdkWindow *window) +gdk_quartz_surface_get_scale_factor (GdkSurface *window) { - GdkWindowImplQuartz *impl; + GdkSurfaceImplQuartz *impl; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return 1; - impl = GDK_WINDOW_IMPL_QUARTZ (window->impl); + impl = GDK_SURFACE_IMPL_QUARTZ (window->impl); if (impl->toplevel != NULL && gdk_quartz_osx_version() >= GDK_OSX_LION) return [(id <ScaleFactor>) impl->toplevel backingScaleFactor]; @@ -2741,85 +2741,85 @@ gdk_quartz_window_get_scale_factor (GdkWindow *window) } static void -gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass) +gdk_surface_impl_quartz_class_init (GdkSurfaceImplQuartzClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass); - GdkWindowImplQuartzClass *impl_quartz_class = GDK_WINDOW_IMPL_QUARTZ_CLASS (klass); + GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_CLASS (klass); + GdkSurfaceImplQuartzClass *impl_quartz_class = GDK_SURFACE_IMPL_QUARTZ_CLASS (klass); parent_class = g_type_class_peek_parent (klass); - object_class->finalize = gdk_window_impl_quartz_finalize; + object_class->finalize = gdk_surface_impl_quartz_finalize; impl_class->ref_cairo_surface = gdk_quartz_ref_cairo_surface; - impl_class->show = gdk_window_quartz_show; - impl_class->hide = gdk_window_quartz_hide; - impl_class->withdraw = gdk_window_quartz_withdraw; - impl_class->set_events = gdk_window_quartz_set_events; - impl_class->get_events = gdk_window_quartz_get_events; - impl_class->raise = gdk_window_quartz_raise; - impl_class->lower = gdk_window_quartz_lower; - impl_class->restack_toplevel = gdk_window_quartz_restack_toplevel; - impl_class->move_resize = gdk_window_quartz_move_resize; - impl_class->get_geometry = gdk_window_quartz_get_geometry; - impl_class->get_root_coords = gdk_window_quartz_get_root_coords; - impl_class->get_device_state = gdk_window_quartz_get_device_state; - impl_class->shape_combine_region = gdk_window_quartz_shape_combine_region; - impl_class->input_shape_combine_region = gdk_window_quartz_input_shape_combine_region; - impl_class->destroy = gdk_quartz_window_destroy; - impl_class->begin_paint = gdk_window_impl_quartz_begin_paint; - impl_class->get_scale_factor = gdk_quartz_window_get_scale_factor; - - impl_class->focus = gdk_quartz_window_focus; - impl_class->set_type_hint = gdk_quartz_window_set_type_hint; - impl_class->get_type_hint = gdk_quartz_window_get_type_hint; - impl_class->set_modal_hint = gdk_quartz_window_set_modal_hint; - impl_class->set_skip_taskbar_hint = gdk_quartz_window_set_skip_taskbar_hint; - impl_class->set_skip_pager_hint = gdk_quartz_window_set_skip_pager_hint; - impl_class->set_urgency_hint = gdk_quartz_window_set_urgency_hint; - impl_class->set_geometry_hints = gdk_quartz_window_set_geometry_hints; - impl_class->set_title = gdk_quartz_window_set_title; - impl_class->set_role = gdk_quartz_window_set_role; - impl_class->set_startup_id = gdk_quartz_window_set_startup_id; - impl_class->set_transient_for = gdk_quartz_window_set_transient_for; - impl_class->get_frame_extents = gdk_quartz_window_get_frame_extents; - impl_class->set_accept_focus = gdk_quartz_window_set_accept_focus; - impl_class->set_focus_on_map = gdk_quartz_window_set_focus_on_map; - impl_class->set_icon_list = gdk_quartz_window_set_icon_list; - impl_class->set_icon_name = gdk_quartz_window_set_icon_name; - impl_class->iconify = gdk_quartz_window_iconify; - impl_class->deiconify = gdk_quartz_window_deiconify; - impl_class->stick = gdk_quartz_window_stick; - impl_class->unstick = gdk_quartz_window_unstick; - impl_class->maximize = gdk_quartz_window_maximize; - impl_class->unmaximize = gdk_quartz_window_unmaximize; - impl_class->fullscreen = gdk_quartz_window_fullscreen; - impl_class->unfullscreen = gdk_quartz_window_unfullscreen; - impl_class->set_keep_above = gdk_quartz_window_set_keep_above; - impl_class->set_keep_below = gdk_quartz_window_set_keep_below; - impl_class->get_group = gdk_quartz_window_get_group; - impl_class->set_group = gdk_quartz_window_set_group; - impl_class->set_decorations = gdk_quartz_window_set_decorations; - impl_class->get_decorations = gdk_quartz_window_get_decorations; - impl_class->set_functions = gdk_quartz_window_set_functions; - impl_class->set_functions = gdk_quartz_window_set_functions; - impl_class->begin_resize_drag = gdk_quartz_window_begin_resize_drag; - impl_class->begin_move_drag = gdk_quartz_window_begin_move_drag; - impl_class->set_opacity = gdk_quartz_window_set_opacity; - impl_class->set_shadow_width = gdk_quartz_window_set_shadow_width; - impl_class->destroy_notify = gdk_quartz_window_destroy_notify; - impl_class->register_dnd = _gdk_quartz_window_register_dnd; - impl_class->drag_begin = _gdk_quartz_window_drag_begin; - impl_class->process_updates_recurse = _gdk_quartz_window_process_updates_recurse; - - impl_class->create_gl_context = gdk_quartz_window_create_gl_context; - - impl_quartz_class->get_context = gdk_window_impl_quartz_get_context; - impl_quartz_class->release_context = gdk_window_impl_quartz_release_context; + impl_class->show = gdk_surface_quartz_show; + impl_class->hide = gdk_surface_quartz_hide; + impl_class->withdraw = gdk_surface_quartz_withdraw; + impl_class->set_events = gdk_surface_quartz_set_events; + impl_class->get_events = gdk_surface_quartz_get_events; + impl_class->raise = gdk_surface_quartz_raise; + impl_class->lower = gdk_surface_quartz_lower; + impl_class->restack_toplevel = gdk_surface_quartz_restack_toplevel; + impl_class->move_resize = gdk_surface_quartz_move_resize; + impl_class->get_geometry = gdk_surface_quartz_get_geometry; + impl_class->get_root_coords = gdk_surface_quartz_get_root_coords; + impl_class->get_device_state = gdk_surface_quartz_get_device_state; + impl_class->shape_combine_region = gdk_surface_quartz_shape_combine_region; + impl_class->input_shape_combine_region = gdk_surface_quartz_input_shape_combine_region; + impl_class->destroy = gdk_quartz_surface_destroy; + impl_class->begin_paint = gdk_surface_impl_quartz_begin_paint; + impl_class->get_scale_factor = gdk_quartz_surface_get_scale_factor; + + impl_class->focus = gdk_quartz_surface_focus; + impl_class->set_type_hint = gdk_quartz_surface_set_type_hint; + impl_class->get_type_hint = gdk_quartz_surface_get_type_hint; + impl_class->set_modal_hint = gdk_quartz_surface_set_modal_hint; + impl_class->set_skip_taskbar_hint = gdk_quartz_surface_set_skip_taskbar_hint; + impl_class->set_skip_pager_hint = gdk_quartz_surface_set_skip_pager_hint; + impl_class->set_urgency_hint = gdk_quartz_surface_set_urgency_hint; + impl_class->set_geometry_hints = gdk_quartz_surface_set_geometry_hints; + impl_class->set_title = gdk_quartz_surface_set_title; + impl_class->set_role = gdk_quartz_surface_set_role; + impl_class->set_startup_id = gdk_quartz_surface_set_startup_id; + impl_class->set_transient_for = gdk_quartz_surface_set_transient_for; + impl_class->get_frame_extents = gdk_quartz_surface_get_frame_extents; + impl_class->set_accept_focus = gdk_quartz_surface_set_accept_focus; + impl_class->set_focus_on_map = gdk_quartz_surface_set_focus_on_map; + impl_class->set_icon_list = gdk_quartz_surface_set_icon_list; + impl_class->set_icon_name = gdk_quartz_surface_set_icon_name; + impl_class->iconify = gdk_quartz_surface_iconify; + impl_class->deiconify = gdk_quartz_surface_deiconify; + impl_class->stick = gdk_quartz_surface_stick; + impl_class->unstick = gdk_quartz_surface_unstick; + impl_class->maximize = gdk_quartz_surface_maximize; + impl_class->unmaximize = gdk_quartz_surface_unmaximize; + impl_class->fullscreen = gdk_quartz_surface_fullscreen; + impl_class->unfullscreen = gdk_quartz_surface_unfullscreen; + impl_class->set_keep_above = gdk_quartz_surface_set_keep_above; + impl_class->set_keep_below = gdk_quartz_surface_set_keep_below; + impl_class->get_group = gdk_quartz_surface_get_group; + impl_class->set_group = gdk_quartz_surface_set_group; + impl_class->set_decorations = gdk_quartz_surface_set_decorations; + impl_class->get_decorations = gdk_quartz_surface_get_decorations; + impl_class->set_functions = gdk_quartz_surface_set_functions; + impl_class->set_functions = gdk_quartz_surface_set_functions; + impl_class->begin_resize_drag = gdk_quartz_surface_begin_resize_drag; + impl_class->begin_move_drag = gdk_quartz_surface_begin_move_drag; + impl_class->set_opacity = gdk_quartz_surface_set_opacity; + impl_class->set_shadow_width = gdk_quartz_surface_set_shadow_width; + impl_class->destroy_notify = gdk_quartz_surface_destroy_notify; + impl_class->register_dnd = _gdk_quartz_surface_register_dnd; + impl_class->drag_begin = _gdk_quartz_surface_drag_begin; + impl_class->process_updates_recurse = _gdk_quartz_surface_process_updates_recurse; + + impl_class->create_gl_context = gdk_quartz_surface_create_gl_context; + + impl_quartz_class->get_context = gdk_surface_impl_quartz_get_context; + impl_quartz_class->release_context = gdk_surface_impl_quartz_release_context; } GType -_gdk_window_impl_quartz_get_type (void) +_gdk_surface_impl_quartz_get_type (void) { static GType object_type = 0; @@ -2827,19 +2827,19 @@ _gdk_window_impl_quartz_get_type (void) { const GTypeInfo object_info = { - sizeof (GdkWindowImplQuartzClass), + sizeof (GdkSurfaceImplQuartzClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, - (GClassInitFunc) gdk_window_impl_quartz_class_init, + (GClassInitFunc) gdk_surface_impl_quartz_class_init, NULL, /* class_finalize */ NULL, /* class_data */ - sizeof (GdkWindowImplQuartz), + sizeof (GdkSurfaceImplQuartz), 0, /* n_preallocs */ - (GInstanceInitFunc) gdk_window_impl_quartz_init, + (GInstanceInitFunc) gdk_surface_impl_quartz_init, }; - object_type = g_type_register_static (GDK_TYPE_WINDOW_IMPL, - "GdkWindowImplQuartz", + object_type = g_type_register_static (GDK_TYPE_SURFACE_IMPL, + "GdkSurfaceImplQuartz", &object_info, 0); } @@ -2847,44 +2847,44 @@ _gdk_window_impl_quartz_get_type (void) } CGContextRef -gdk_quartz_window_get_context (GdkWindowImplQuartz *window, +gdk_quartz_surface_get_context (GdkSurfaceImplQuartz *window, gboolean antialias) { - if (!GDK_WINDOW_IMPL_QUARTZ_GET_CLASS (window)->get_context) + if (!GDK_SURFACE_IMPL_QUARTZ_GET_CLASS (window)->get_context) { - g_warning ("%s doesn't implement GdkWindowImplQuartzClass::get_context()", + g_warning ("%s doesn't implement GdkSurfaceImplQuartzClass::get_context()", G_OBJECT_TYPE_NAME (window)); return NULL; } - return GDK_WINDOW_IMPL_QUARTZ_GET_CLASS (window)->get_context (window, antialias); + return GDK_SURFACE_IMPL_QUARTZ_GET_CLASS (window)->get_context (window, antialias); } void -gdk_quartz_window_release_context (GdkWindowImplQuartz *window, +gdk_quartz_surface_release_context (GdkSurfaceImplQuartz *window, CGContextRef cg_context) { - if (!GDK_WINDOW_IMPL_QUARTZ_GET_CLASS (window)->release_context) + if (!GDK_SURFACE_IMPL_QUARTZ_GET_CLASS (window)->release_context) { - g_warning ("%s doesn't implement GdkWindowImplQuartzClass::release_context()", + g_warning ("%s doesn't implement GdkSurfaceImplQuartzClass::release_context()", G_OBJECT_TYPE_NAME (window)); return; } - GDK_WINDOW_IMPL_QUARTZ_GET_CLASS (window)->release_context (window, cg_context); + GDK_SURFACE_IMPL_QUARTZ_GET_CLASS (window)->release_context (window, cg_context); } static CGContextRef -gdk_root_window_impl_quartz_get_context (GdkWindowImplQuartz *window, +gdk_root_window_impl_quartz_get_context (GdkSurfaceImplQuartz *window, gboolean antialias) { CGColorSpaceRef colorspace; CGContextRef cg_context; - GdkWindowImplQuartz *window_impl = GDK_WINDOW_IMPL_QUARTZ (window); + GdkSurfaceImplQuartz *window_impl = GDK_SURFACE_IMPL_QUARTZ (window); - if (GDK_WINDOW_DESTROYED (window_impl->wrapper)) + if (GDK_SURFACE_DESTROYED (window_impl->wrapper)) return NULL; /* We do not have the notion of a root window on OS X. We fake this @@ -2900,7 +2900,7 @@ gdk_root_window_impl_quartz_get_context (GdkWindowImplQuartz *window, } static void -gdk_root_window_impl_quartz_release_context (GdkWindowImplQuartz *window, +gdk_root_window_impl_quartz_release_context (GdkSurfaceImplQuartz *window, CGContextRef cg_context) { CGContextRelease (cg_context); @@ -2909,7 +2909,7 @@ gdk_root_window_impl_quartz_release_context (GdkWindowImplQuartz *window, static void gdk_root_window_impl_quartz_class_init (GdkRootWindowImplQuartzClass *klass) { - GdkWindowImplQuartzClass *window_quartz_class = GDK_WINDOW_IMPL_QUARTZ_CLASS (klass); + GdkSurfaceImplQuartzClass *window_quartz_class = GDK_SURFACE_IMPL_QUARTZ_CLASS (klass); root_window_parent_class = g_type_class_peek_parent (klass); @@ -2942,7 +2942,7 @@ _gdk_root_window_impl_quartz_get_type (void) (GInstanceInitFunc) gdk_root_window_impl_quartz_init, }; - object_type = g_type_register_static (GDK_TYPE_WINDOW_IMPL_QUARTZ, + object_type = g_type_register_static (GDK_TYPE_SURFACE_IMPL_QUARTZ, "GdkRootWindowQuartz", &object_info, 0); } @@ -2954,5 +2954,5 @@ GList * get_toplevels (void) { update_toplevel_order (); - return GDK_WINDOW_IMPL_QUARTZ (_gdk_root->impl)->sorted_children; + return GDK_SURFACE_IMPL_QUARTZ (_gdk_root->impl)->sorted_children; } diff --git a/gdk/quartz/gdkwindow-quartz.h b/gdk/quartz/gdkwindow-quartz.h index 963e436ad8..cbadd75153 100644 --- a/gdk/quartz/gdkwindow-quartz.h +++ b/gdk/quartz/gdkwindow-quartz.h @@ -16,8 +16,8 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef __GDK_WINDOW_QUARTZ_H__ -#define __GDK_WINDOW_QUARTZ_H__ +#ifndef __GDK_SURFACE_QUARTZ_H__ +#define __GDK_SURFACE_QUARTZ_H__ #import <gdk/quartz/GdkQuartzView.h> #import <gdk/quartz/GdkQuartzNSWindow.h> @@ -28,31 +28,31 @@ G_BEGIN_DECLS /* Window implementation for Quartz */ -typedef struct _GdkWindowImplQuartz GdkWindowImplQuartz; -typedef struct _GdkWindowImplQuartzClass GdkWindowImplQuartzClass; +typedef struct _GdkSurfaceImplQuartz GdkSurfaceImplQuartz; +typedef struct _GdkSurfaceImplQuartzClass GdkSurfaceImplQuartzClass; -#define GDK_TYPE_WINDOW_IMPL_QUARTZ (_gdk_window_impl_quartz_get_type ()) -#define GDK_WINDOW_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_QUARTZ, GdkWindowImplQuartz)) -#define GDK_WINDOW_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL_QUARTZ, GdkWindowImplQuartzClass)) -#define GDK_IS_WINDOW_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_QUARTZ)) -#define GDK_IS_WINDOW_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_QUARTZ)) -#define GDK_WINDOW_IMPL_QUARTZ_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_QUARTZ, GdkWindowImplQuartzClass)) +#define GDK_TYPE_SURFACE_IMPL_QUARTZ (_gdk_surface_impl_quartz_get_type ()) +#define GDK_SURFACE_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL_QUARTZ, GdkSurfaceImplQuartz)) +#define GDK_SURFACE_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL_QUARTZ, GdkSurfaceImplQuartzClass)) +#define GDK_IS_SURFACE_IMPL_QUARTZ(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL_QUARTZ)) +#define GDK_IS_SURFACE_IMPL_QUARTZ_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL_QUARTZ)) +#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; NSTrackingRectTag tracking_rect; GdkQuartzView *view; - GdkWindowTypeHint type_hint; + GdkSurfaceTypeHint type_hint; gint in_paint_rect_count; - GdkWindow *transient_for; + GdkSurface *transient_for; /* Sorted by z-order */ GList *sorted_children; @@ -66,21 +66,21 @@ struct _GdkWindowImplQuartz 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); - void (* release_context) (GdkWindowImplQuartz *window, + void (* release_context) (GdkSurfaceImplQuartz *window, 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); -void gdk_quartz_window_release_context (GdkWindowImplQuartz *window, +void gdk_quartz_surface_release_context (GdkSurfaceImplQuartz *window, CGContextRef context); /* Root window implementation for Quartz @@ -98,12 +98,12 @@ typedef struct _GdkRootWindowImplQuartzClass GdkRootWindowImplQuartzClass; struct _GdkRootWindowImplQuartz { - GdkWindowImplQuartz parent_instance; + GdkSurfaceImplQuartz parent_instance; }; struct _GdkRootWindowImplQuartzClass { - GdkWindowImplQuartzClass parent_class; + GdkSurfaceImplQuartzClass parent_class; }; GType _gdk_root_window_impl_quartz_get_type (void); @@ -112,4 +112,4 @@ GList *get_toplevels (void); G_END_DECLS -#endif /* __GDK_WINDOW_QUARTZ_H__ */ +#endif /* __GDK_SURFACE_QUARTZ_H__ */ diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index 23bfa77b91..7e9de9b08b 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -69,7 +69,7 @@ struct _GdkWaylandTouchData uint32_t id; gdouble x; gdouble y; - GdkWindow *window; + GdkSurface *window; uint32_t touch_down_serial; guint initial_touch : 1; }; @@ -86,7 +86,7 @@ struct _GdkWaylandPointerFrameData }; struct _GdkWaylandPointerData { - GdkWindow *focus; + GdkSurface *focus; double surface_x, surface_y; @@ -96,7 +96,7 @@ struct _GdkWaylandPointerData { uint32_t enter_serial; uint32_t press_serial; - GdkWindow *grab_window; + GdkSurface *grab_window; uint32_t grab_time; struct wl_surface *pointer_surface; @@ -220,8 +220,8 @@ struct _GdkWaylandSeat GdkWaylandPointerData touch_info; GdkModifierType key_modifiers; - GdkWindow *keyboard_focus; - GdkWindow *grab_window; + GdkSurface *keyboard_focus; + GdkSurface *grab_window; uint32_t grab_time; gboolean have_server_repeat; uint32_t server_repeat_rate; @@ -242,7 +242,7 @@ struct _GdkWaylandSeat GdkDragContext *drop_context; /* Source/dest for non-local dnd */ - GdkWindow *foreign_dnd_window; + GdkSurface *foreign_dnd_window; /* Some tracking on gesture events */ guint gesture_n_fingers; @@ -298,7 +298,7 @@ static void deliver_key_event (GdkWaylandSeat *seat, static gboolean gdk_wayland_device_get_history (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, guint32 start, guint32 stop, GdkTimeCoord ***events, @@ -309,13 +309,13 @@ gdk_wayland_device_get_history (GdkDevice *device, static void gdk_wayland_device_get_state (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, GdkModifierType *mask) { 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) { @@ -470,7 +470,7 @@ gdk_wayland_device_update_window_cursor (GdkDevice *device) static void gdk_wayland_device_set_window_cursor (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkCursor *cursor) { GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (gdk_device_get_seat (device)); @@ -528,7 +528,7 @@ get_coordinates (GdkDevice *device, if (pointer->focus) { - gdk_window_get_root_coords (pointer->focus, + gdk_surface_get_root_coords (pointer->focus, pointer->surface_x, pointer->surface_y, &root_x, &root_y); @@ -562,8 +562,8 @@ device_get_modifiers (GdkDevice *device) static void gdk_wayland_device_query_state (GdkDevice *device, - GdkWindow *window, - GdkWindow **child_window, + GdkSurface *window, + GdkSurface **child_window, gdouble *root_x, gdouble *root_y, gdouble *win_x, @@ -590,8 +590,8 @@ gdk_wayland_device_query_state (GdkDevice *device, } static void -emulate_crossing (GdkWindow *window, - GdkWindow *subwindow, +emulate_crossing (GdkSurface *window, + GdkSurface *subwindow, GdkDevice *device, GdkEventType type, GdkCrossingMode mode, @@ -608,18 +608,18 @@ emulate_crossing (GdkWindow *window, gdk_event_set_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.state); event->crossing.x_root = event->crossing.x; 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 -emulate_touch_crossing (GdkWindow *window, - GdkWindow *subwindow, +emulate_touch_crossing (GdkSurface *window, + GdkSurface *subwindow, GdkDevice *device, GdkDevice *source, GdkWaylandTouchData *touch, @@ -643,11 +643,11 @@ emulate_touch_crossing (GdkWindow *window, event->crossing.x_root = event->crossing.x; 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 -emulate_focus (GdkWindow *window, +emulate_focus (GdkSurface *window, GdkDevice *device, gboolean focus_in, guint32 time_) @@ -660,13 +660,13 @@ emulate_focus (GdkWindow *window, gdk_event_set_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 device_emit_grab_crossing (GdkDevice *device, - GdkWindow *from, - GdkWindow *to, + GdkSurface *from, + GdkSurface *to, GdkCrossingMode mode, guint32 time_) { @@ -686,7 +686,7 @@ device_emit_grab_crossing (GdkDevice *device, } } -static GdkWindow * +static GdkSurface * gdk_wayland_device_get_focus (GdkDevice *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 gdk_wayland_device_grab (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gboolean owner_events, GdkEventMask event_mask, - GdkWindow *confine_to, + GdkSurface *confine_to, GdkCursor *cursor, guint32 time_) { 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; - if (gdk_window_get_window_type (window) == GDK_WINDOW_TEMP && - gdk_window_is_visible (window)) + if (gdk_surface_get_window_type (window) == GDK_SURFACE_TEMP && + gdk_surface_is_visible (window)) { g_warning ("Window %p is already mapped at the time of grabbing. " "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) { /* Device is a keyboard */ - gdk_wayland_window_inhibit_shortcuts (window, + gdk_wayland_surface_inhibit_shortcuts (window, gdk_device_get_seat (device)); return GDK_GRAB_SUCCESS; } @@ -751,7 +751,7 @@ gdk_wayland_device_grab (GdkDevice *device, pointer->grab_window = window; 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); @@ -771,7 +771,7 @@ gdk_wayland_device_ungrab (GdkDevice *device, GdkWaylandPointerData *pointer = GDK_WAYLAND_DEVICE (device)->pointer; GdkDisplay *display; GdkDeviceGrabInfo *grab; - GdkWindow *focus, *prev_focus = NULL; + GdkSurface *focus, *prev_focus = NULL; display = gdk_device_get_display (device); @@ -792,7 +792,7 @@ gdk_wayland_device_ungrab (GdkDevice *device, { /* Device is a keyboard */ if (prev_focus) - gdk_wayland_window_restore_shortcuts (prev_focus, + gdk_wayland_surface_restore_shortcuts (prev_focus, gdk_device_get_seat (device)); } else @@ -801,12 +801,12 @@ gdk_wayland_device_ungrab (GdkDevice *device, gdk_wayland_device_update_window_cursor (device); if (pointer->grab_window) - _gdk_wayland_window_set_grab_seat (pointer->grab_window, + _gdk_wayland_surface_set_grab_seat (pointer->grab_window, NULL); } } -static GdkWindow * +static GdkSurface * gdk_wayland_device_window_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, @@ -832,7 +832,7 @@ gdk_wayland_device_window_at_position (GdkDevice *device, static void gdk_wayland_device_select_window_events (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkEventMask event_mask) { } @@ -1077,11 +1077,11 @@ data_device_enter (void *data, struct wl_data_offer *offer) { GdkWaylandSeat *seat = data; - GdkWindow *dest_window, *dnd_owner; + GdkSurface *dest_window, *dnd_owner; dest_window = wl_surface_get_user_data (surface); - if (!GDK_IS_WINDOW (dest_window)) + if (!GDK_IS_SURFACE (dest_window)) return; GDK_DISPLAY_NOTE (seat->display, EVENTS, @@ -1357,7 +1357,7 @@ pointer_handle_enter (void *data, if (!surface) return; - if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface))) + if (!GDK_IS_SURFACE (wl_surface_get_user_data (surface))) return; _gdk_wayland_display_update_serial (display_wayland, serial); @@ -1411,7 +1411,7 @@ pointer_handle_leave (void *data, if (!surface) return; - if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface))) + if (!GDK_IS_SURFACE (wl_surface_get_user_data (surface))) return; if (!seat->pointer_info.focus) @@ -1771,7 +1771,7 @@ keyboard_handle_enter (void *data, if (!surface) return; - if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface))) + if (!GDK_IS_SURFACE (wl_surface_get_user_data (surface))) return; _gdk_wayland_display_update_serial (display, serial); @@ -1809,7 +1809,7 @@ keyboard_handle_leave (void *data, if (!seat->keyboard_focus) 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 * window before loosing keyboard focus. */ @@ -2227,7 +2227,7 @@ _create_touch_event (GdkWaylandSeat *seat, event->touch.emulating_pointer = TRUE; } - gdk_window_get_root_coords (touch->window, + gdk_surface_get_root_coords (touch->window, touch->x, touch->y, &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); GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat); 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; if (!surface) return; - if (!GDK_IS_WINDOW (window)) + if (!GDK_IS_SURFACE (window)) return; tool->current_tablet = tablet; @@ -4386,10 +4386,10 @@ static const struct wl_surface_listener pointer_surface_listener = { pointer_surface_leave }; -static GdkWindow * +static GdkSurface * 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 @@ -4425,7 +4425,7 @@ gdk_wayland_seat_finalize (GObject *object) g_clear_object (&seat->clipboard); g_clear_object (&seat->primary_clipboard); 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); stop_key_repeat (seat); @@ -4450,11 +4450,11 @@ gdk_wayland_seat_get_capabilities (GdkSeat *seat) static void gdk_wayland_seat_set_grab_window (GdkWaylandSeat *seat, - GdkWindow *window) + GdkSurface *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), (gpointer *) &seat->grab_window); seat->grab_window = NULL; @@ -4465,13 +4465,13 @@ gdk_wayland_seat_set_grab_window (GdkWaylandSeat *seat, seat->grab_window = window; g_object_add_weak_pointer (G_OBJECT (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 gdk_wayland_seat_grab (GdkSeat *seat, - GdkWindow *window, + GdkSurface *window, GdkSeatCapabilities capabilities, gboolean owner_events, GdkCursor *cursor, @@ -4482,12 +4482,12 @@ gdk_wayland_seat_grab (GdkSeat *seat, GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (seat); guint32 evtime = event ? gdk_event_get_time (event) : GDK_CURRENT_TIME; GdkDisplay *display = gdk_seat_get_display (seat); - GdkWindow *native; + GdkSurface *native; 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; gdk_wayland_seat_set_grab_window (wayland_seat, native); @@ -4496,7 +4496,7 @@ gdk_wayland_seat_grab (GdkSeat *seat, if (prepare_func) (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); 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 && 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) 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 && 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) 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 && 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) 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 */ if (capabilities == GDK_SEAT_CAPABILITY_KEYBOARD) - gdk_wayland_window_inhibit_shortcuts (window, seat); + gdk_wayland_surface_inhibit_shortcuts (window, seat); } if (wayland_seat->tablets && @@ -4581,7 +4581,7 @@ gdk_wayland_seat_grab (GdkSeat *seat, for (l = wayland_seat->tablets; l; l = l->next) { 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) device_emit_grab_crossing (tablet->master, prev_focus, @@ -4619,7 +4619,7 @@ gdk_wayland_seat_ungrab (GdkSeat *seat) 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); @@ -4647,7 +4647,7 @@ gdk_wayland_seat_ungrab (GdkSeat *seat) { grab->serial_end = grab->serial_start; if (grab->window) - gdk_wayland_window_restore_shortcuts (grab->window, seat); + gdk_wayland_surface_restore_shortcuts (grab->window, seat); } } diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c index 645f1352d8..36167d6304 100644 --- a/gdk/wayland/gdkdisplay-wayland.c +++ b/gdk/wayland/gdkdisplay-wayland.c @@ -636,7 +636,7 @@ _gdk_wayland_display_open (const gchar *display_name) static void destroy_toplevel (gpointer data) { - _gdk_window_destroy (GDK_WINDOW (data), FALSE); + _gdk_surface_destroy (GDK_SURFACE (data), FALSE); } static void @@ -714,7 +714,7 @@ gdk_wayland_display_get_name (GdkDisplay *display) void gdk_wayland_display_system_bell (GdkDisplay *display, - GdkWindow *window) + GdkSurface *window) { GdkWaylandDisplay *display_wayland; struct gtk_surface1 *gtk_surface; @@ -728,7 +728,7 @@ gdk_wayland_display_system_bell (GdkDisplay *display, return; if (window) - gtk_surface = gdk_wayland_window_get_gtk_surface (window); + gtk_surface = gdk_wayland_surface_get_gtk_surface (window); else gtk_surface = NULL; @@ -798,7 +798,7 @@ gdk_wayland_display_has_pending (GdkDisplay *display) return FALSE; } -static GdkWindow * +static GdkSurface * gdk_wayland_display_get_default_group (GdkDisplay *display) { g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); @@ -917,15 +917,15 @@ gdk_wayland_display_get_monitor (GdkDisplay *display, static GdkMonitor * gdk_wayland_display_get_monitor_at_window (GdkDisplay *display, - GdkWindow *window) + GdkSurface *window) { GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); struct wl_output *output; 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) return NULL; @@ -953,7 +953,7 @@ gdk_wayland_display_class_init (GdkWaylandDisplayClass *class) object_class->dispose = gdk_wayland_display_dispose; 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 display_class->vk_context_type = GDK_TYPE_WAYLAND_VULKAN_CONTEXT; @@ -1848,7 +1848,7 @@ static void update_scale (GdkDisplay *display) { g_list_foreach (gdk_wayland_display_get_toplevel_windows (display), - (GFunc)gdk_wayland_window_update_scale, + (GFunc)gdk_wayland_surface_update_scale, NULL); } diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c index da90cbe467..a466f0f920 100644 --- a/gdk/wayland/gdkdnd-wayland.c +++ b/gdk/wayland/gdkdnd-wayland.c @@ -47,7 +47,7 @@ typedef struct _GdkWaylandDragContextClass GdkWaylandDragContextClass; struct _GdkWaylandDragContext { GdkDragContext context; - GdkWindow *dnd_window; + GdkSurface *dnd_window; struct wl_surface *dnd_surface; struct wl_data_source *data_source; GdkDragAction selected_action; @@ -74,7 +74,7 @@ gdk_wayland_drag_context_finalize (GObject *object) { GdkWaylandDragContext *wayland_context = GDK_WAYLAND_DRAG_CONTEXT (object); GdkDragContext *context = GDK_DRAG_CONTEXT (object); - GdkWindow *dnd_window; + GdkSurface *dnd_window; 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); if (dnd_window) - gdk_window_destroy (dnd_window); + gdk_surface_destroy (dnd_window); } void @@ -99,7 +99,7 @@ _gdk_wayland_drag_context_emit_event (GdkDragContext *context, GdkEventType type, guint32 time_) { - GdkWindow *window; + GdkSurface *window; GdkEvent *event; 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; 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); } @@ -360,7 +360,7 @@ gdk_wayland_drag_context_init (GdkWaylandDragContext *context_wayland) context->actions = GDK_ACTION_COPY | GDK_ACTION_MOVE; } -static GdkWindow * +static GdkSurface * gdk_wayland_drag_context_get_drag_window (GdkDragContext *context) { 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) 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); - gdk_window_invalidate_rect (context_wayland->dnd_window, &damage_rect, FALSE); + gdk_surface_invalidate_rect (context_wayland->dnd_window, &damage_rect, FALSE); } static void @@ -429,7 +429,7 @@ gdk_wayland_drag_context_drop_done (GdkDragContext *context, if (success) { 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 -_gdk_wayland_window_register_dnd (GdkWindow *window) +_gdk_wayland_surface_register_dnd (GdkSurface *window) { } -static GdkWindow * +static GdkSurface * 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; } GdkDragContext * -_gdk_wayland_window_drag_begin (GdkWindow *window, +_gdk_wayland_surface_drag_begin (GdkSurface *window, GdkDevice *device, GdkContentProvider *content, GdkDragAction actions, @@ -503,8 +503,8 @@ _gdk_wayland_window_drag_begin (GdkWindow *window, gdk_drag_context_set_device (context, device); - context_wayland->dnd_window = create_dnd_window (gdk_window_get_display (window)); - context_wayland->dnd_surface = gdk_wayland_window_get_wl_surface (context_wayland->dnd_window); + context_wayland->dnd_window = create_dnd_window (gdk_surface_get_display (window)); + context_wayland->dnd_surface = gdk_wayland_surface_get_wl_surface (context_wayland->dnd_window); context_wayland->data_source = 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), context_wayland->data_source, - gdk_wayland_window_get_wl_surface (window), + gdk_wayland_surface_get_wl_surface (window), context_wayland->dnd_surface, _gdk_wayland_display_get_serial (display_wayland)); @@ -580,7 +580,7 @@ _gdk_wayland_drag_context_set_coords (GdkDragContext *context, void _gdk_wayland_drag_context_set_source_window (GdkDragContext *context, - GdkWindow *window) + GdkSurface *window) { if (context->source_window) g_object_unref (context->source_window); @@ -590,7 +590,7 @@ _gdk_wayland_drag_context_set_source_window (GdkDragContext *context, void _gdk_wayland_drag_context_set_dest_window (GdkDragContext *context, - GdkWindow *dest_window, + GdkSurface *dest_window, uint32_t serial) { if (context->dest_window) @@ -618,7 +618,7 @@ gdk_wayland_drag_context_lookup_by_data_source (struct wl_data_source *source) } GdkDragContext * -gdk_wayland_drag_context_lookup_by_source_window (GdkWindow *window) +gdk_wayland_drag_context_lookup_by_source_window (GdkSurface *window) { GList *l; diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c index 14cece96c6..6df899156a 100644 --- a/gdk/wayland/gdkglcontext-wayland.c +++ b/gdk/wayland/gdkglcontext-wayland.c @@ -163,7 +163,7 @@ gdk_wayland_gl_context_get_damage (GdkGLContext *context) GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); 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; if (display_wayland->have_egl_buffer_age) @@ -176,7 +176,7 @@ gdk_wayland_gl_context_get_damage (GdkGLContext *context) shared = context; 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); gdk_gl_context_make_current (shared); eglQuerySurface (display_wayland->egl_display, egl_surface, @@ -208,8 +208,8 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context, cairo_region_t *damage) { GdkGLContext *context = GDK_GL_CONTEXT (draw_context); - GdkWindow *window = gdk_gl_context_get_window (context); - GdkDisplay *display = gdk_window_get_display (window); + GdkSurface *window = gdk_gl_context_get_window (context); + GdkDisplay *display = gdk_surface_get_display (window); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); GdkWaylandGLContext *context_wayland = GDK_WAYLAND_GL_CONTEXT (context); EGLSurface egl_surface; @@ -220,7 +220,7 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_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); 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); EGLint *rects = g_new (EGLint, n_rects * 4); 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++) { @@ -244,7 +244,7 @@ gdk_wayland_gl_context_end_frame (GdkDrawContext *draw_context, else eglSwapBuffers (display_wayland->egl_display, egl_surface); - gdk_wayland_window_sync (window); + gdk_wayland_surface_sync (window); } static void @@ -360,11 +360,11 @@ gdk_wayland_display_init_gl (GdkDisplay *display) #define MAX_EGL_ATTRS 30 static gboolean -find_eglconfig_for_window (GdkWindow *window, +find_eglconfig_for_window (GdkSurface *window, EGLConfig *egl_config_out, GError **error) { - GdkDisplay *display = gdk_window_get_display (window); + GdkDisplay *display = gdk_surface_get_display (window); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); EGLint attrs[MAX_EGL_ATTRS]; EGLint count; @@ -418,12 +418,12 @@ find_eglconfig_for_window (GdkWindow *window, } GdkGLContext * -gdk_wayland_window_create_gl_context (GdkWindow *window, +gdk_wayland_surface_create_gl_context (GdkSurface *window, gboolean attached, GdkGLContext *share, GError **error) { - GdkDisplay *display = gdk_window_get_display (window); + GdkDisplay *display = gdk_surface_get_display (window); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); GdkWaylandGLContext *context; EGLConfig config; @@ -466,8 +466,8 @@ gdk_wayland_gl_context_dispose (GObject *gobject) if (context_wayland->egl_context != NULL) { GdkGLContext *context = GDK_GL_CONTEXT (gobject); - GdkWindow *window = gdk_gl_context_get_window (context); - GdkDisplay *display = gdk_window_get_display (window); + GdkSurface *window = gdk_gl_context_get_window (context); + GdkDisplay *display = gdk_surface_get_display (window); GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); 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); GdkWaylandGLContext *context_wayland; - GdkWindow *window; + GdkSurface *window; EGLSurface egl_surface; if (context == NULL) @@ -504,13 +504,13 @@ gdk_wayland_display_make_gl_context_current (GdkDisplay *display, window = gdk_gl_context_get_window (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 { if (display_wayland->have_egl_surfaceless_context) egl_surface = EGL_NO_SURFACE; 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); } diff --git a/gdk/wayland/gdkglcontext-wayland.h b/gdk/wayland/gdkglcontext-wayland.h index 819818b557..3b98c3b7cf 100644 --- a/gdk/wayland/gdkglcontext-wayland.h +++ b/gdk/wayland/gdkglcontext-wayland.h @@ -46,7 +46,7 @@ struct _GdkWaylandGLContextClass }; 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, GdkGLContext *share, GError **error); diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h index 6d3fe4c778..9be6db1e6a 100644 --- a/gdk/wayland/gdkprivate-wayland.h +++ b/gdk/wayland/gdkprivate-wayland.h @@ -43,7 +43,7 @@ #define WL_SURFACE_HAS_BUFFER_SCALE 3 #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); 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); void gdk_wayland_display_system_bell (GdkDisplay *display, - GdkWindow *window); + GdkSurface *window); struct wl_buffer *_gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display, GdkCursor *cursor, @@ -88,24 +88,24 @@ guint _gdk_wayland_cursor_get_next_image_index (GdkWaylandDisplay *display, guint current_image_index, 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); -GdkDragContext *_gdk_wayland_window_drag_begin (GdkWindow *window, +void _gdk_wayland_surface_register_dnd (GdkSurface *window); +GdkDragContext *_gdk_wayland_surface_drag_begin (GdkSurface *window, GdkDevice *device, GdkContentProvider *content, GdkDragAction actions, gint dx, 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 y); GdkDragContext * _gdk_wayland_drop_context_new (GdkDisplay *display, struct wl_data_device *data_device); void _gdk_wayland_drag_context_set_source_window (GdkDragContext *context, - GdkWindow *window); + GdkSurface *window); void _gdk_wayland_drag_context_set_dest_window (GdkDragContext *context, - GdkWindow *dest_window, + GdkSurface *dest_window, uint32_t serial); void _gdk_wayland_drag_context_emit_event (GdkDragContext *context, GdkEventType type, @@ -118,16 +118,16 @@ void gdk_wayland_drag_context_set_action (GdkDragContext *context, GdkDragAction action); 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); void gdk_wayland_drop_context_update_targets (GdkDragContext *context); void _gdk_wayland_display_create_window_impl (GdkDisplay *display, - GdkWindow *window, - GdkWindow *real_parent, + GdkSurface *window, + GdkSurface *real_parent, GdkEventMask event_mask, - GdkWindowAttr *attributes); + GdkSurfaceAttr *attributes); gint _gdk_wayland_display_text_property_to_utf8_list (GdkDisplay *display, 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, int monitor_num); -void _gdk_wayland_window_set_grab_seat (GdkWindow *window, +void _gdk_wayland_surface_set_grab_seat (GdkSurface *window, GdkSeat *seat); 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); 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); gboolean gdk_wayland_selection_set_current_offer_actions (GdkDisplay *display, uint32_t actions); -EGLSurface gdk_wayland_window_get_egl_surface (GdkWindow *window, +EGLSurface gdk_wayland_surface_get_egl_surface (GdkSurface *window, EGLConfig config); -EGLSurface gdk_wayland_window_get_dummy_egl_surface (GdkWindow *window, +EGLSurface gdk_wayland_surface_get_dummy_egl_surface (GdkSurface *window, 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, 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); -void gdk_wayland_window_restore_shortcuts (GdkWindow *window, +void gdk_wayland_surface_restore_shortcuts (GdkSurface *window, GdkSeat *gdk_seat); -void gdk_wayland_window_update_scale (GdkWindow *window); +void gdk_wayland_surface_update_scale (GdkSurface *window); #endif /* __GDK_PRIVATE_WAYLAND_H__ */ diff --git a/gdk/wayland/gdkselection-wayland.c b/gdk/wayland/gdkselection-wayland.c index 9f7826e1da..70f1490f7d 100644 --- a/gdk/wayland/gdkselection-wayland.c +++ b/gdk/wayland/gdkselection-wayland.c @@ -427,9 +427,9 @@ static const struct wl_data_source_listener data_source_listener = { }; 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); gpointer source = NULL; GdkWaylandDisplay *display_wayland; @@ -437,7 +437,7 @@ gdk_wayland_selection_get_data_source (GdkWindow *owner) if (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); wl_data_source_add_listener (source, diff --git a/gdk/wayland/gdkvulkancontext-wayland.c b/gdk/wayland/gdkvulkancontext-wayland.c index 7aa1d1e260..cdac207635 100644 --- a/gdk/wayland/gdkvulkancontext-wayland.c +++ b/gdk/wayland/gdkvulkancontext-wayland.c @@ -37,7 +37,7 @@ static VkResult gdk_wayland_vulkan_context_create_surface (GdkVulkanContext *context, 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)); /* This is necessary so that Vulkan sees the Window. @@ -53,7 +53,7 @@ gdk_wayland_vulkan_context_create_surface (GdkVulkanContext *context, NULL, 0, gdk_wayland_display_get_wl_display (display), - gdk_wayland_window_get_wl_surface (window) + gdk_wayland_surface_get_wl_surface (window) }, NULL, surface); @@ -64,11 +64,11 @@ gdk_vulkan_context_wayland_end_frame (GdkDrawContext *context, cairo_region_t *painted, 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_wayland_window_sync (window); + gdk_wayland_surface_sync (window); } static void diff --git a/gdk/wayland/gdkwaylandwindow.h b/gdk/wayland/gdkwaylandwindow.h index 1d6f5c04f7..b9747b6ca8 100644 --- a/gdk/wayland/gdkwaylandwindow.h +++ b/gdk/wayland/gdkwaylandwindow.h @@ -15,8 +15,8 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef __GDK_WAYLAND_WINDOW_H__ -#define __GDK_WAYLAND_WINDOW_H__ +#ifndef __GDK_WAYLAND_SURFACE_H__ +#define __GDK_WAYLAND_SURFACE_H__ #if !defined (__GDKWAYLAND_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only <gdk/gdkwayland.h> can be included directly." @@ -29,33 +29,33 @@ G_BEGIN_DECLS #ifdef GDK_COMPILATION -typedef struct _GdkWaylandWindow GdkWaylandWindow; +typedef struct _GdkWaylandSurface GdkWaylandSurface; #else -typedef GdkWindow GdkWaylandWindow; +typedef GdkSurface GdkWaylandSurface; #endif -typedef struct _GdkWaylandWindowClass GdkWaylandWindowClass; +typedef struct _GdkWaylandSurfaceClass GdkWaylandSurfaceClass; -#define GDK_TYPE_WAYLAND_WINDOW (gdk_wayland_window_get_type()) -#define GDK_WAYLAND_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_WINDOW, GdkWaylandWindow)) -#define GDK_WAYLAND_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_WINDOW, GdkWaylandWindowClass)) -#define GDK_IS_WAYLAND_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_WINDOW)) -#define GDK_IS_WAYLAND_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WAYLAND_WINDOW)) -#define GDK_WAYLAND_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_WINDOW, GdkWaylandWindowClass)) +#define GDK_TYPE_WAYLAND_SURFACE (gdk_wayland_surface_get_type()) +#define GDK_WAYLAND_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_SURFACE, GdkWaylandSurface)) +#define GDK_WAYLAND_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WAYLAND_SURFACE, GdkWaylandSurfaceClass)) +#define GDK_IS_WAYLAND_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_SURFACE)) +#define GDK_IS_WAYLAND_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WAYLAND_SURFACE)) +#define GDK_WAYLAND_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WAYLAND_SURFACE, GdkWaylandSurfaceClass)) GDK_AVAILABLE_IN_ALL -GType gdk_wayland_window_get_type (void); +GType gdk_wayland_surface_get_type (void); GDK_AVAILABLE_IN_ALL -GdkWindow * gdk_wayland_window_new_subsurface (GdkDisplay *display, +GdkSurface * gdk_wayland_surface_new_subsurface (GdkDisplay *display, const GdkRectangle *position); 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 -void gdk_wayland_window_set_use_custom_surface (GdkWindow *window); +void gdk_wayland_surface_set_use_custom_surface (GdkSurface *window); 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 *app_menu_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 *unique_bus_name); -typedef void (*GdkWaylandWindowExported) (GdkWindow *window, +typedef void (*GdkWaylandSurfaceExported) (GdkSurface *window, const char *handle, gpointer user_data); GDK_AVAILABLE_IN_ALL -gboolean gdk_wayland_window_export_handle (GdkWindow *window, - GdkWaylandWindowExported callback, +gboolean gdk_wayland_surface_export_handle (GdkSurface *window, + GdkWaylandSurfaceExported callback, gpointer user_data, GDestroyNotify destroy_func); GDK_AVAILABLE_IN_ALL -void gdk_wayland_window_unexport_handle (GdkWindow *window); +void gdk_wayland_surface_unexport_handle (GdkSurface *window); 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); -void gdk_wayland_window_announce_csd (GdkWindow *window); +void gdk_wayland_surface_announce_csd (GdkSurface *window); G_END_DECLS -#endif /* __GDK_WAYLAND_WINDOW_H__ */ +#endif /* __GDK_WAYLAND_SURFACE_H__ */ diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 7a863776aa..ead400fe6d 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -49,44 +49,44 @@ enum { static guint signals[LAST_SIGNAL]; #define WINDOW_IS_TOPLEVEL(window) \ - (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD) + (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD) #define MAX_WL_BUFFER_SIZE (4083) /* 4096 minus header, string argument length and NUL byte */ -typedef struct _GdkWaylandWindow GdkWaylandWindow; -typedef struct _GdkWaylandWindowClass GdkWaylandWindowClass; +typedef struct _GdkWaylandSurface GdkWaylandSurface; +typedef struct _GdkWaylandSurfaceClass GdkWaylandSurfaceClass; -struct _GdkWaylandWindow +struct _GdkWaylandSurface { - GdkWindow parent; + GdkSurface parent; }; -struct _GdkWaylandWindowClass +struct _GdkWaylandSurfaceClass { - GdkWindowClass parent_class; + GdkSurfaceClass parent_class; }; -G_DEFINE_TYPE (GdkWaylandWindow, gdk_wayland_window, GDK_TYPE_WINDOW) +G_DEFINE_TYPE (GdkWaylandSurface, gdk_wayland_surface, GDK_TYPE_SURFACE) static void -gdk_wayland_window_class_init (GdkWaylandWindowClass *wayland_window_class) +gdk_wayland_surface_class_init (GdkWaylandSurfaceClass *wayland_surface_class) { } static void -gdk_wayland_window_init (GdkWaylandWindow *wayland_window) +gdk_wayland_surface_init (GdkWaylandSurface *wayland_surface) { } -#define GDK_TYPE_WINDOW_IMPL_WAYLAND (_gdk_window_impl_wayland_get_type ()) -#define GDK_WINDOW_IMPL_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_WAYLAND, GdkWindowImplWayland)) -#define GDK_WINDOW_IMPL_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL_WAYLAND, GdkWindowImplWaylandClass)) -#define GDK_IS_WINDOW_IMPL_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_WAYLAND)) -#define GDK_IS_WINDOW_IMPL_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_WAYLAND)) -#define GDK_WINDOW_IMPL_WAYLAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_WAYLAND, GdkWindowImplWaylandClass)) +#define GDK_TYPE_SURFACE_IMPL_WAYLAND (_gdk_surface_impl_wayland_get_type ()) +#define GDK_SURFACE_IMPL_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL_WAYLAND, GdkSurfaceImplWayland)) +#define GDK_SURFACE_IMPL_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL_WAYLAND, GdkSurfaceImplWaylandClass)) +#define GDK_IS_SURFACE_IMPL_WAYLAND(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL_WAYLAND)) +#define GDK_IS_SURFACE_IMPL_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL_WAYLAND)) +#define GDK_SURFACE_IMPL_WAYLAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL_WAYLAND, GdkSurfaceImplWaylandClass)) -typedef struct _GdkWindowImplWayland GdkWindowImplWayland; -typedef struct _GdkWindowImplWaylandClass GdkWindowImplWaylandClass; +typedef struct _GdkSurfaceImplWayland GdkSurfaceImplWayland; +typedef struct _GdkSurfaceImplWaylandClass GdkSurfaceImplWaylandClass; typedef enum _PositionMethod { @@ -95,11 +95,11 @@ typedef enum _PositionMethod POSITION_METHOD_MOVE_TO_RECT } PositionMethod; -struct _GdkWindowImplWayland +struct _GdkSurfaceImplWayland { - GdkWindowImpl parent_instance; + GdkSurfaceImpl parent_instance; - GdkWindow *wrapper; + GdkSurface *wrapper; struct { /* The wl_outputs that this window currently touches */ @@ -126,9 +126,9 @@ struct _GdkWindowImplWayland unsigned int pending_buffer_attached : 1; unsigned int pending_commit : 1; unsigned int awaiting_frame : 1; - GdkWindowTypeHint hint; - GdkWindow *transient_for; - GdkWindow *popup_parent; + GdkSurfaceTypeHint hint; + GdkSurface *transient_for; + GdkSurface *popup_parent; PositionMethod position_method; cairo_surface_t *staging_cairo_surface; @@ -152,7 +152,7 @@ struct _GdkWindowImplWayland } application; GdkGeometry geometry_hints; - GdkWindowHints geometry_mask; + GdkSurfaceHints geometry_mask; GdkSeat *grab_input_seat; @@ -192,11 +192,11 @@ struct _GdkWindowImplWayland struct { int width; int height; - GdkWindowState state; + GdkSurfaceState state; } pending; struct { - GdkWaylandWindowExported callback; + GdkWaylandSurfaceExported callback; gpointer user_data; GDestroyNotify destroy_func; } exported; @@ -205,28 +205,28 @@ struct _GdkWindowImplWayland GHashTable *shortcuts_inhibitors; }; -struct _GdkWindowImplWaylandClass +struct _GdkSurfaceImplWaylandClass { - GdkWindowImplClass parent_class; + GdkSurfaceImplClass parent_class; }; -static void gdk_wayland_window_maybe_configure (GdkWindow *window, +static void gdk_wayland_surface_maybe_configure (GdkSurface *window, int width, int height, int scale); -static void maybe_set_gtk_surface_dbus_properties (GdkWindow *window); -static void maybe_set_gtk_surface_modal (GdkWindow *window); +static void maybe_set_gtk_surface_dbus_properties (GdkSurface *window); +static void maybe_set_gtk_surface_modal (GdkSurface *window); -static void gdk_window_request_transient_parent_commit (GdkWindow *window); +static void gdk_surface_request_transient_parent_commit (GdkSurface *window); -static void gdk_wayland_window_sync_margin (GdkWindow *window); -static void gdk_wayland_window_sync_input_region (GdkWindow *window); -static void gdk_wayland_window_sync_opaque_region (GdkWindow *window); +static void gdk_wayland_surface_sync_margin (GdkSurface *window); +static void gdk_wayland_surface_sync_input_region (GdkSurface *window); +static void gdk_wayland_surface_sync_opaque_region (GdkSurface *window); -static void unset_transient_for_exported (GdkWindow *window); +static void unset_transient_for_exported (GdkSurface *window); -static void calculate_moved_to_rect_result (GdkWindow *window, +static void calculate_moved_to_rect_result (GdkSurface *window, int x, int y, int width, @@ -236,14 +236,14 @@ static void calculate_moved_to_rect_result (GdkWindow *window, gboolean *flipped_x, gboolean *flipped_y); -static gboolean gdk_wayland_window_is_exported (GdkWindow *window); +static gboolean gdk_wayland_surface_is_exported (GdkSurface *window); -GType _gdk_window_impl_wayland_get_type (void); +GType _gdk_surface_impl_wayland_get_type (void); -G_DEFINE_TYPE (GdkWindowImplWayland, _gdk_window_impl_wayland, GDK_TYPE_WINDOW_IMPL) +G_DEFINE_TYPE (GdkSurfaceImplWayland, _gdk_surface_impl_wayland, GDK_TYPE_SURFACE_IMPL) static void -_gdk_window_impl_wayland_init (GdkWindowImplWayland *impl) +_gdk_surface_impl_wayland_init (GdkSurfaceImplWayland *impl) { impl->scale = 1; impl->initial_fullscreen_output = NULL; @@ -252,10 +252,10 @@ _gdk_window_impl_wayland_init (GdkWindowImplWayland *impl) } static void -_gdk_wayland_screen_add_orphan_dialog (GdkWindow *window) +_gdk_wayland_screen_add_orphan_dialog (GdkSurface *window) { GdkWaylandDisplay *display_wayland = - GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); + GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); if (!g_list_find (display_wayland->orphan_dialogs, window)) display_wayland->orphan_dialogs = @@ -263,9 +263,9 @@ _gdk_wayland_screen_add_orphan_dialog (GdkWindow *window) } static void -drop_cairo_surfaces (GdkWindow *window) +drop_cairo_surfaces (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); g_clear_pointer (&impl->staging_cairo_surface, cairo_surface_destroy); g_clear_pointer (&impl->backfill_cairo_surface, cairo_surface_destroy); @@ -277,11 +277,11 @@ drop_cairo_surfaces (GdkWindow *window) } static void -_gdk_wayland_window_save_size (GdkWindow *window) +_gdk_wayland_surface_save_size (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - if (window->state & (GDK_WINDOW_STATE_FULLSCREEN | GDK_WINDOW_STATE_MAXIMIZED)) + if (window->state & (GDK_SURFACE_STATE_FULLSCREEN | GDK_SURFACE_STATE_MAXIMIZED)) return; impl->saved_width = window->width - impl->margin_left - impl->margin_right; @@ -289,11 +289,11 @@ _gdk_wayland_window_save_size (GdkWindow *window) } static void -_gdk_wayland_window_clear_saved_size (GdkWindow *window) +_gdk_wayland_surface_clear_saved_size (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - if (window->state & (GDK_WINDOW_STATE_FULLSCREEN | GDK_WINDOW_STATE_MAXIMIZED)) + if (window->state & (GDK_SURFACE_STATE_FULLSCREEN | GDK_SURFACE_STATE_MAXIMIZED)) return; impl->saved_width = -1; @@ -301,19 +301,19 @@ _gdk_wayland_window_clear_saved_size (GdkWindow *window) } /* - * gdk_wayland_window_update_size: + * gdk_wayland_surface_update_size: * @drawable: a #GdkDrawableImplWayland. * * Updates the state of the drawable (in particular the drawable's * cairo surface) when its size has changed. */ static void -gdk_wayland_window_update_size (GdkWindow *window, +gdk_wayland_surface_update_size (GdkSurface *window, int32_t width, int32_t height, int scale) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); GdkRectangle area; cairo_region_t *region; @@ -339,7 +339,7 @@ gdk_wayland_window_update_size (GdkWindow *window, area.height = window->height; region = cairo_region_create_rectangle (&area); - _gdk_window_invalidate_for_expose (window, region); + _gdk_surface_invalidate_for_expose (window, region); cairo_region_destroy (region); } @@ -402,9 +402,9 @@ fill_presentation_time_from_frame_time (GdkFrameTimings *timings, } static void -read_back_cairo_surface (GdkWindow *window) +read_back_cairo_surface (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); cairo_t *cr; cairo_region_t *paint_region = NULL; @@ -437,18 +437,18 @@ frame_callback (void *data, struct wl_callback *callback, uint32_t time) { - GdkWindow *window = data; - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurface *window = data; + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); GdkWaylandDisplay *display_wayland = - GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); - GdkFrameClock *clock = gdk_window_get_frame_clock (window); + GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); + GdkFrameClock *clock = gdk_surface_get_frame_clock (window); GdkFrameTimings *timings; GDK_DISPLAY_NOTE (GDK_DISPLAY (display_wayland), EVENTS, g_message ("frame %p", window)); wl_callback_destroy (callback); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (!impl->awaiting_frame) @@ -491,7 +491,7 @@ static const struct wl_callback_listener frame_listener = { static void on_frame_clock_before_paint (GdkFrameClock *clock, - GdkWindow *window) + GdkSurface *window) { GdkFrameTimings *timings = gdk_frame_clock_get_current_timings (clock); gint64 presentation_time; @@ -524,9 +524,9 @@ on_frame_clock_before_paint (GdkFrameClock *clock, static void on_frame_clock_after_paint (GdkFrameClock *clock, - GdkWindow *window) + GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); struct wl_callback *callback; if (!impl->pending_commit) @@ -567,10 +567,10 @@ on_frame_clock_after_paint (GdkFrameClock *clock, } void -gdk_wayland_window_update_scale (GdkWindow *window) +gdk_wayland_surface_update_scale (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); + GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); guint32 scale; GSList *l; GList *children, *c; @@ -589,33 +589,33 @@ gdk_wayland_window_update_scale (GdkWindow *window) } /* Notify app that scale changed */ - gdk_wayland_window_maybe_configure (window, window->width, window->height, scale); + gdk_wayland_surface_maybe_configure (window, window->width, window->height, scale); - children = gdk_window_get_children (window); + children = gdk_surface_get_children (window); for (c = children; c; c = c->next) { - GdkWindow *child = c->data; - gdk_wayland_window_update_scale (child); + GdkSurface *child = c->data; + gdk_wayland_surface_update_scale (child); } g_list_free (children); } -static void gdk_wayland_window_create_surface (GdkWindow *window); +static void gdk_wayland_surface_create_surface (GdkSurface *window); void _gdk_wayland_display_create_window_impl (GdkDisplay *display, - GdkWindow *window, - GdkWindow *real_parent, + GdkSurface *window, + GdkSurface *real_parent, GdkEventMask event_mask, - GdkWindowAttr *attributes) + GdkSurfaceAttr *attributes) { GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display); - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; GdkFrameClock *frame_clock; - impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WAYLAND, NULL); - window->impl = GDK_WINDOW_IMPL (impl); - impl->wrapper = GDK_WINDOW (window); + impl = g_object_new (GDK_TYPE_SURFACE_IMPL_WAYLAND, NULL); + window->impl = GDK_SURFACE_IMPL (impl); + impl->wrapper = GDK_SURFACE (window); impl->shortcuts_inhibitors = g_hash_table_new (NULL, NULL); if (window->width > 65535) @@ -638,14 +638,14 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display, impl->title = NULL; - switch (GDK_WINDOW_TYPE (window)) + switch (GDK_SURFACE_TYPE (window)) { - case GDK_WINDOW_TOPLEVEL: - case GDK_WINDOW_TEMP: - gdk_window_set_title (window, get_default_title ()); + case GDK_SURFACE_TOPLEVEL: + case GDK_SURFACE_TEMP: + gdk_surface_set_title (window, get_default_title ()); break; - case GDK_WINDOW_CHILD: + case GDK_SURFACE_CHILD: default: break; } @@ -653,20 +653,20 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display, if (real_parent == NULL) display_wayland->toplevels = g_list_prepend (display_wayland->toplevels, window); - gdk_wayland_window_create_surface (window); + gdk_wayland_surface_create_surface (window); - frame_clock = gdk_window_get_frame_clock (window); + frame_clock = gdk_surface_get_frame_clock (window); g_signal_connect (frame_clock, "before-paint", G_CALLBACK (on_frame_clock_before_paint), window); g_signal_connect (frame_clock, "after-paint", G_CALLBACK (on_frame_clock_after_paint), window); } static void -gdk_wayland_window_attach_image (GdkWindow *window) +gdk_wayland_surface_attach_image (GdkSurface *window) { GdkWaylandDisplay *display; - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; g_assert (_gdk_wayland_is_shm_surface (impl->staging_cairo_surface)); @@ -680,7 +680,7 @@ gdk_wayland_window_attach_image (GdkWindow *window) impl->pending_buffer_offset_y = 0; /* Only set the buffer scale if supported by the compositor */ - display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); + display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); if (display->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE) wl_surface_set_buffer_scale (impl->display_server.wl_surface, impl->scale); @@ -688,16 +688,16 @@ gdk_wayland_window_attach_image (GdkWindow *window) impl->pending_commit = TRUE; } -static const cairo_user_data_key_t gdk_wayland_window_cairo_key; +static const cairo_user_data_key_t gdk_wayland_surface_cairo_key; static void buffer_release_callback (void *_data, struct wl_buffer *wl_buffer) { cairo_surface_t *cairo_surface = _data; - GdkWindowImplWayland *impl = cairo_surface_get_user_data (cairo_surface, &gdk_wayland_window_cairo_key); + GdkSurfaceImplWayland *impl = cairo_surface_get_user_data (cairo_surface, &gdk_wayland_surface_cairo_key); - g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (impl)); + g_return_if_fail (GDK_IS_SURFACE_IMPL_WAYLAND (impl)); /* The released buffer isn't the latest committed one, we have no further * use for it, so clean it up. @@ -752,9 +752,9 @@ static const struct wl_buffer_listener buffer_listener = { }; static void -gdk_wayland_window_ensure_cairo_surface (GdkWindow *window) +gdk_wayland_surface_ensure_cairo_surface (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); /* If we are drawing using OpenGL then we only need a logical 1x1 surface. */ if (impl->display_server.egl_window) @@ -774,7 +774,7 @@ gdk_wayland_window_ensure_cairo_surface (GdkWindow *window) } else if (!impl->staging_cairo_surface) { - GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (impl->wrapper)); + GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (impl->wrapper)); struct wl_buffer *buffer; impl->staging_cairo_surface = _gdk_wayland_display_create_shm_surface (display_wayland, @@ -782,7 +782,7 @@ gdk_wayland_window_ensure_cairo_surface (GdkWindow *window) impl->wrapper->height, impl->scale); cairo_surface_set_user_data (impl->staging_cairo_surface, - &gdk_wayland_window_cairo_key, + &gdk_wayland_surface_cairo_key, g_object_ref (impl), (cairo_destroy_func_t) g_object_unref); @@ -799,14 +799,14 @@ gdk_wayland_window_ensure_cairo_surface (GdkWindow *window) * impl->staging_cairo_surface gets nullified. */ static cairo_surface_t * -gdk_wayland_window_ref_cairo_surface (GdkWindow *window) +gdk_wayland_surface_ref_cairo_surface (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - if (GDK_WINDOW_DESTROYED (impl->wrapper)) + if (GDK_SURFACE_DESTROYED (impl->wrapper)) return NULL; - gdk_wayland_window_ensure_cairo_surface (window); + gdk_wayland_surface_ensure_cairo_surface (window); cairo_surface_reference (impl->staging_cairo_surface); @@ -814,7 +814,7 @@ gdk_wayland_window_ref_cairo_surface (GdkWindow *window) } static cairo_surface_t * -gdk_wayland_window_create_similar_image_surface (GdkWindow * window, +gdk_wayland_surface_create_similar_image_surface (GdkSurface * window, cairo_format_t format, int width, int height) @@ -823,17 +823,17 @@ gdk_wayland_window_create_similar_image_surface (GdkWindow * window, } static gboolean -gdk_window_impl_wayland_begin_paint (GdkWindow *window) +gdk_surface_impl_wayland_begin_paint (GdkSurface *window) { - gdk_wayland_window_ensure_cairo_surface (window); + gdk_wayland_surface_ensure_cairo_surface (window); return FALSE; } static void -gdk_window_impl_wayland_end_paint (GdkWindow *window) +gdk_surface_impl_wayland_end_paint (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); cairo_rectangle_int_t rect; int i, n; @@ -841,7 +841,7 @@ gdk_window_impl_wayland_end_paint (GdkWindow *window) _gdk_wayland_is_shm_surface (impl->staging_cairo_surface) && !cairo_region_is_empty (window->current_paint.region)) { - gdk_wayland_window_attach_image (window); + gdk_wayland_surface_attach_image (window); /* If there's a committed buffer pending, then track which * updates are staged until the next frame, so we can back @@ -871,38 +871,38 @@ gdk_window_impl_wayland_end_paint (GdkWindow *window) impl->pending_commit = TRUE; } - gdk_wayland_window_sync (window); + gdk_wayland_surface_sync (window); } void -gdk_wayland_window_sync (GdkWindow *window) +gdk_wayland_surface_sync (GdkSurface *window) { - gdk_wayland_window_sync_margin (window); - gdk_wayland_window_sync_opaque_region (window); - gdk_wayland_window_sync_input_region (window); + gdk_wayland_surface_sync_margin (window); + gdk_wayland_surface_sync_opaque_region (window); + gdk_wayland_surface_sync_input_region (window); } static gboolean -gdk_window_impl_wayland_beep (GdkWindow *window) +gdk_surface_impl_wayland_beep (GdkSurface *window) { - gdk_wayland_display_system_bell (gdk_window_get_display (window), + gdk_wayland_display_system_bell (gdk_surface_get_display (window), window); return TRUE; } static void -gdk_window_impl_wayland_finalize (GObject *object) +gdk_surface_impl_wayland_finalize (GObject *object) { - GdkWindow *window = GDK_WINDOW (object); - GdkWindowImplWayland *impl; + GdkSurface *window = GDK_SURFACE (object); + GdkSurfaceImplWayland *impl; - g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (object)); + g_return_if_fail (GDK_IS_SURFACE_IMPL_WAYLAND (object)); - impl = GDK_WINDOW_IMPL_WAYLAND (object); + impl = GDK_SURFACE_IMPL_WAYLAND (object); - if (gdk_wayland_window_is_exported (window)) - gdk_wayland_window_unexport_handle (window); + if (gdk_wayland_surface_is_exported (window)) + gdk_wayland_surface_unexport_handle (window); g_free (impl->title); @@ -919,11 +919,11 @@ gdk_window_impl_wayland_finalize (GObject *object) g_hash_table_destroy (impl->shortcuts_inhibitors); - G_OBJECT_CLASS (_gdk_window_impl_wayland_parent_class)->finalize (object); + G_OBJECT_CLASS (_gdk_surface_impl_wayland_parent_class)->finalize (object); } static void -gdk_wayland_window_configure (GdkWindow *window, +gdk_wayland_surface_configure (GdkSurface *window, int width, int height, int scale) @@ -937,20 +937,20 @@ gdk_wayland_window_configure (GdkWindow *window, event->configure.width = width; event->configure.height = height; - gdk_wayland_window_update_size (window, width, height, scale); - _gdk_window_update_size (window); + gdk_wayland_surface_update_size (window, width, height, scale); + _gdk_surface_update_size (window); - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); _gdk_wayland_display_deliver_event (display, event); } static void -gdk_wayland_window_maybe_configure (GdkWindow *window, +gdk_wayland_surface_maybe_configure (GdkSurface *window, int width, int height, int scale) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); gboolean is_xdg_popup; gboolean is_visible; @@ -966,35 +966,35 @@ gdk_wayland_window_maybe_configure (GdkWindow *window, */ is_xdg_popup = (impl->display_server.xdg_popup != NULL); - is_visible = gdk_window_is_visible (window); + is_visible = gdk_surface_is_visible (window); if (is_xdg_popup && is_visible && !impl->initial_configure_received) - gdk_window_hide (window); + gdk_surface_hide (window); - gdk_wayland_window_configure (window, width, height, scale); + gdk_wayland_surface_configure (window, width, height, scale); if (is_xdg_popup && is_visible && !impl->initial_configure_received) - gdk_window_show (window); + gdk_surface_show (window); } static void -gdk_wayland_window_sync_parent (GdkWindow *window, - GdkWindow *parent) +gdk_wayland_surface_sync_parent (GdkSurface *window, + GdkSurface *parent) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - GdkWindowImplWayland *impl_parent = NULL; + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl_parent = NULL; struct zxdg_toplevel_v6 *parent_toplevel; g_assert (parent == NULL || - gdk_window_get_display (window) == gdk_window_get_display (parent)); + gdk_surface_get_display (window) == gdk_surface_get_display (parent)); if (!impl->display_server.xdg_toplevel) return; if (impl->transient_for) - impl_parent = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl); + impl_parent = GDK_SURFACE_IMPL_WAYLAND (impl->transient_for->impl); else if (parent) - impl_parent = GDK_WINDOW_IMPL_WAYLAND (parent->impl); + impl_parent = GDK_SURFACE_IMPL_WAYLAND (parent->impl); if (impl_parent) { @@ -1012,9 +1012,9 @@ gdk_wayland_window_sync_parent (GdkWindow *window, } static void -gdk_wayland_window_sync_parent_of_imported (GdkWindow *window) +gdk_wayland_surface_sync_parent_of_imported (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (!impl->display_server.wl_surface) return; @@ -1030,10 +1030,10 @@ gdk_wayland_window_sync_parent_of_imported (GdkWindow *window) } static void -gdk_wayland_window_update_dialogs (GdkWindow *window) +gdk_wayland_surface_update_dialogs (GdkSurface *window) { GdkWaylandDisplay *display_wayland = - GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); + GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); GList *l; if (!display_wayland->orphan_dialogs) @@ -1041,29 +1041,29 @@ gdk_wayland_window_update_dialogs (GdkWindow *window) for (l = display_wayland->orphan_dialogs; l; l = l->next) { - GdkWindow *w = l->data; - GdkWindowImplWayland *impl; + GdkSurface *w = l->data; + GdkSurfaceImplWayland *impl; - if (!GDK_IS_WINDOW_IMPL_WAYLAND(w->impl)) + if (!GDK_IS_SURFACE_IMPL_WAYLAND(w->impl)) continue; - impl = GDK_WINDOW_IMPL_WAYLAND (w->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (w->impl); if (w == window) continue; - if (impl->hint != GDK_WINDOW_TYPE_HINT_DIALOG) + if (impl->hint != GDK_SURFACE_TYPE_HINT_DIALOG) continue; if (impl->transient_for) continue; /* Update the parent relationship only for dialogs without transients */ - gdk_wayland_window_sync_parent (w, window); + gdk_wayland_surface_sync_parent (w, window); } } static void -gdk_wayland_window_sync_title (GdkWindow *window) +gdk_wayland_surface_sync_title (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (!impl->display_server.xdg_toplevel) return; @@ -1075,10 +1075,10 @@ gdk_wayland_window_sync_title (GdkWindow *window) } static void -gdk_wayland_window_get_window_geometry (GdkWindow *window, +gdk_wayland_surface_get_window_geometry (GdkSurface *window, GdkRectangle *geometry) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); *geometry = (GdkRectangle) { .x = impl->margin_left, @@ -1089,16 +1089,16 @@ gdk_wayland_window_get_window_geometry (GdkWindow *window, } static void -gdk_wayland_window_sync_margin (GdkWindow *window) +gdk_wayland_surface_sync_margin (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); GdkRectangle geometry; if (!impl->display_server.xdg_surface) return; - gdk_wayland_window_get_window_geometry (window, &geometry); - gdk_window_set_geometry_hints (window, + gdk_wayland_surface_get_window_geometry (window, &geometry); + gdk_surface_set_geometry_hints (window, &impl->geometry_hints, impl->geometry_mask); zxdg_surface_v6_set_window_geometry (impl->display_server.xdg_surface, @@ -1131,9 +1131,9 @@ wl_region_from_cairo_region (GdkWaylandDisplay *display, } static void -gdk_wayland_window_sync_opaque_region (GdkWindow *window) +gdk_wayland_surface_sync_opaque_region (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); struct wl_region *wl_region = NULL; if (!impl->display_server.wl_surface) @@ -1143,7 +1143,7 @@ gdk_wayland_window_sync_opaque_region (GdkWindow *window) return; if (impl->opaque_region != NULL) - wl_region = wl_region_from_cairo_region (GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)), + wl_region = wl_region_from_cairo_region (GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)), impl->opaque_region); wl_surface_set_opaque_region (impl->display_server.wl_surface, wl_region); @@ -1155,9 +1155,9 @@ gdk_wayland_window_sync_opaque_region (GdkWindow *window) } static void -gdk_wayland_window_sync_input_region (GdkWindow *window) +gdk_wayland_surface_sync_input_region (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); struct wl_region *wl_region = NULL; if (!impl->display_server.wl_surface) @@ -1167,7 +1167,7 @@ gdk_wayland_window_sync_input_region (GdkWindow *window) return; if (impl->input_region != NULL) - wl_region = wl_region_from_cairo_region (GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)), + wl_region = wl_region_from_cairo_region (GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)), impl->input_region); wl_surface_set_input_region (impl->display_server.wl_surface, wl_region); @@ -1179,9 +1179,9 @@ gdk_wayland_window_sync_input_region (GdkWindow *window) } static void -gdk_wayland_set_input_region_if_empty (GdkWindow *window) +gdk_wayland_set_input_region_if_empty (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); GdkWaylandDisplay *display; struct wl_region *empty; @@ -1194,7 +1194,7 @@ gdk_wayland_set_input_region_if_empty (GdkWindow *window) if (!cairo_region_is_empty (impl->input_region)) return; - display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); + display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); empty = wl_compositor_create_region (display->compositor); wl_surface_set_input_region (impl->display_server.wl_surface, empty); @@ -1208,15 +1208,15 @@ surface_enter (void *data, struct wl_surface *wl_surface, struct wl_output *output) { - GdkWindow *window = GDK_WINDOW (data); - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurface *window = GDK_SURFACE (data); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - GDK_DISPLAY_NOTE (gdk_window_get_display (window), EVENTS, + GDK_DISPLAY_NOTE (gdk_surface_get_display (window), EVENTS, g_message ("surface enter, window %p output %p", window, output)); impl->display_server.outputs = g_slist_prepend (impl->display_server.outputs, output); - gdk_wayland_window_update_scale (window); + gdk_wayland_surface_update_scale (window); } static void @@ -1224,16 +1224,16 @@ surface_leave (void *data, struct wl_surface *wl_surface, struct wl_output *output) { - GdkWindow *window = GDK_WINDOW (data); - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurface *window = GDK_SURFACE (data); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - GDK_DISPLAY_NOTE (gdk_window_get_display (window), EVENTS, + GDK_DISPLAY_NOTE (gdk_surface_get_display (window), EVENTS, g_message ("surface leave, window %p output %p", window, output)); impl->display_server.outputs = g_slist_remove (impl->display_server.outputs, output); if (impl->display_server.outputs) - gdk_wayland_window_update_scale (window); + gdk_wayland_surface_update_scale (window); } static const struct wl_surface_listener surface_listener = { @@ -1242,10 +1242,10 @@ static const struct wl_surface_listener surface_listener = { }; static void -on_parent_surface_committed (GdkWindowImplWayland *parent_impl, - GdkWindow *window) +on_parent_surface_committed (GdkSurfaceImplWayland *parent_impl, + GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); g_signal_handler_disconnect (parent_impl, impl->parent_surface_committed_handler); @@ -1258,12 +1258,12 @@ on_parent_surface_committed (GdkWindowImplWayland *parent_impl, } static void -gdk_wayland_window_create_subsurface (GdkWindow *window) +gdk_wayland_surface_create_subsurface (GdkSurface *window) { - GdkWindowImplWayland *impl, *parent_impl = NULL; + GdkSurfaceImplWayland *impl, *parent_impl = NULL; GdkWaylandDisplay *display_wayland; - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (!impl->display_server.wl_surface) return; /* Bail out, surface and subsurface will be created later when shown */ @@ -1272,11 +1272,11 @@ gdk_wayland_window_create_subsurface (GdkWindow *window) return; if (impl->transient_for) - parent_impl = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl); + parent_impl = GDK_SURFACE_IMPL_WAYLAND (impl->transient_for->impl); if (parent_impl && parent_impl->display_server.wl_surface) { - display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); + display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); impl->display_server.wl_subsurface = wl_subcompositor_get_subsurface (display_wayland->subcompositor, impl->display_server.wl_surface, parent_impl->display_server.wl_surface); @@ -1292,15 +1292,15 @@ gdk_wayland_window_create_subsurface (GdkWindow *window) g_signal_connect_object (parent_impl, "committed", G_CALLBACK (on_parent_surface_committed), window, 0); - gdk_window_request_transient_parent_commit (window); + gdk_surface_request_transient_parent_commit (window); } } static void -gdk_wayland_window_create_surface (GdkWindow *window) +gdk_wayland_surface_create_surface (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); + GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); impl->display_server.wl_surface = wl_compositor_create_surface (display_wayland->compositor); wl_surface_add_listener (impl->display_server.wl_surface, &surface_listener, window); @@ -1311,9 +1311,9 @@ xdg_surface_configure (void *data, struct zxdg_surface_v6 *xdg_surface, uint32_t serial) { - GdkWindow *window = GDK_WINDOW (data); - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - GdkWindowState new_state; + GdkSurface *window = GDK_SURFACE (data); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); + GdkSurfaceState new_state; int width = impl->pending.width; int height = impl->pending.height; gboolean fixed_size; @@ -1321,7 +1321,7 @@ xdg_surface_configure (void *data, if (!impl->initial_configure_received) { - gdk_window_thaw_updates (window); + gdk_surface_thaw_updates (window); impl->initial_configure_received = TRUE; } @@ -1335,7 +1335,7 @@ xdg_surface_configure (void *data, impl->pending.state = 0; fixed_size = - new_state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN | GDK_WINDOW_STATE_TILED); + new_state & (GDK_SURFACE_STATE_MAXIMIZED | GDK_SURFACE_STATE_FULLSCREEN | GDK_SURFACE_STATE_TILED); saved_size = (width == 0 && height == 0); /* According to xdg_shell, an xdg_surface.configure with size 0x0 @@ -1354,7 +1354,7 @@ xdg_surface_configure (void *data, if (width > 0 && height > 0) { - GdkWindowHints geometry_mask = impl->geometry_mask; + GdkSurfaceHints geometry_mask = impl->geometry_mask; /* Ignore size increments for maximized/fullscreen windows */ if (fixed_size) @@ -1362,7 +1362,7 @@ xdg_surface_configure (void *data, if (!saved_size) { /* Do not reapply contrains if we are restoring original size */ - gdk_window_constrain_size (&impl->geometry_hints, + gdk_surface_constrain_size (&impl->geometry_hints, geometry_mask, width + impl->margin_left + impl->margin_right, height + impl->margin_top + impl->margin_bottom, @@ -1370,25 +1370,25 @@ xdg_surface_configure (void *data, &height); /* Save size for next time we get 0x0 */ - _gdk_wayland_window_save_size (window); + _gdk_wayland_surface_save_size (window); } - gdk_wayland_window_configure (window, width, height, impl->scale); + gdk_wayland_surface_configure (window, width, height, impl->scale); } - GDK_DISPLAY_NOTE (gdk_window_get_display (window), EVENTS, + GDK_DISPLAY_NOTE (gdk_surface_get_display (window), EVENTS, g_message ("configure, window %p %dx%d,%s%s%s%s", window, width, height, - (new_state & GDK_WINDOW_STATE_FULLSCREEN) ? " fullscreen" : "", - (new_state & GDK_WINDOW_STATE_MAXIMIZED) ? " maximized" : "", - (new_state & GDK_WINDOW_STATE_FOCUSED) ? " focused" : "", - (new_state & GDK_WINDOW_STATE_TILED) ? " tiled" : "")); + (new_state & GDK_SURFACE_STATE_FULLSCREEN) ? " fullscreen" : "", + (new_state & GDK_SURFACE_STATE_MAXIMIZED) ? " maximized" : "", + (new_state & GDK_SURFACE_STATE_FOCUSED) ? " focused" : "", + (new_state & GDK_SURFACE_STATE_TILED) ? " tiled" : "")); - gdk_window_set_state (window, new_state); + gdk_surface_set_state (window, new_state); zxdg_surface_v6_ack_configure (xdg_surface, serial); - if (impl->hint != GDK_WINDOW_TYPE_HINT_DIALOG && - new_state & GDK_WINDOW_STATE_FOCUSED) - gdk_wayland_window_update_dialogs (window); + if (impl->hint != GDK_SURFACE_TYPE_HINT_DIALOG && + new_state & GDK_SURFACE_STATE_FOCUSED) + gdk_wayland_surface_update_dialogs (window); } static const struct zxdg_surface_v6_listener xdg_surface_listener = { @@ -1402,8 +1402,8 @@ xdg_toplevel_configure (void *data, int32_t height, struct wl_array *states) { - GdkWindow *window = GDK_WINDOW (data); - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurface *window = GDK_SURFACE (data); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); uint32_t *p; wl_array_for_each (p, states) @@ -1412,13 +1412,13 @@ xdg_toplevel_configure (void *data, switch (state) { case ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN: - impl->pending.state |= GDK_WINDOW_STATE_FULLSCREEN; + impl->pending.state |= GDK_SURFACE_STATE_FULLSCREEN; break; case ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED: - impl->pending.state |= GDK_WINDOW_STATE_MAXIMIZED; + impl->pending.state |= GDK_SURFACE_STATE_MAXIMIZED; break; case ZXDG_TOPLEVEL_V6_STATE_ACTIVATED: - impl->pending.state |= GDK_WINDOW_STATE_FOCUSED; + impl->pending.state |= GDK_SURFACE_STATE_FOCUSED; break; case ZXDG_TOPLEVEL_V6_STATE_RESIZING: break; @@ -1436,11 +1436,11 @@ static void xdg_toplevel_close (void *data, struct zxdg_toplevel_v6 *xdg_toplevel) { - GdkWindow *window = GDK_WINDOW (data); + GdkSurface *window = GDK_SURFACE (data); GdkDisplay *display; GdkEvent *event; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); GDK_DISPLAY_NOTE (display, EVENTS, g_message ("close %p", window)); @@ -1457,10 +1457,10 @@ static const struct zxdg_toplevel_v6_listener xdg_toplevel_listener = { }; static void -gdk_wayland_window_create_xdg_toplevel (GdkWindow *window) +gdk_wayland_surface_create_xdg_toplevel (GdkSurface *window) { - GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); const gchar *app_id; impl->display_server.xdg_surface = @@ -1469,7 +1469,7 @@ gdk_wayland_window_create_xdg_toplevel (GdkWindow *window) zxdg_surface_v6_add_listener (impl->display_server.xdg_surface, &xdg_surface_listener, window); - gdk_window_freeze_updates (window); + gdk_surface_freeze_updates (window); impl->display_server.xdg_toplevel = zxdg_surface_v6_get_toplevel (impl->display_server.xdg_surface); @@ -1477,13 +1477,13 @@ gdk_wayland_window_create_xdg_toplevel (GdkWindow *window) &xdg_toplevel_listener, window); - gdk_wayland_window_sync_parent (window, NULL); - gdk_wayland_window_sync_parent_of_imported (window); - gdk_wayland_window_sync_title (window); + gdk_wayland_surface_sync_parent (window, NULL); + gdk_wayland_surface_sync_parent_of_imported (window); + gdk_wayland_surface_sync_title (window); - if (window->state & GDK_WINDOW_STATE_MAXIMIZED) + if (window->state & GDK_SURFACE_STATE_MAXIMIZED) zxdg_toplevel_v6_set_maximized (impl->display_server.xdg_toplevel); - if (window->state & GDK_WINDOW_STATE_FULLSCREEN) + if (window->state & GDK_SURFACE_STATE_FULLSCREEN) zxdg_toplevel_v6_set_fullscreen (impl->display_server.xdg_toplevel, impl->initial_fullscreen_output); @@ -1499,7 +1499,7 @@ gdk_wayland_window_create_xdg_toplevel (GdkWindow *window) maybe_set_gtk_surface_dbus_properties (window); maybe_set_gtk_surface_modal (window); - if (impl->hint == GDK_WINDOW_TYPE_HINT_DIALOG) + if (impl->hint == GDK_SURFACE_TYPE_HINT_DIALOG) _gdk_wayland_screen_add_orphan_dialog (window); wl_surface_commit (impl->display_server.wl_surface); @@ -1513,8 +1513,8 @@ xdg_popup_configure (void *data, int32_t width, int32_t height) { - GdkWindow *window = GDK_WINDOW (data); - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurface *window = GDK_SURFACE (data); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); GdkRectangle flipped_rect; GdkRectangle final_rect; gboolean flipped_x; @@ -1543,11 +1543,11 @@ static void xdg_popup_done (void *data, struct zxdg_popup_v6 *xdg_popup) { - GdkWindow *window = GDK_WINDOW (data); + GdkSurface *window = GDK_SURFACE (data); - GDK_DISPLAY_NOTE (gdk_window_get_display (window), EVENTS, g_message ("done %p", window)); + GDK_DISPLAY_NOTE (gdk_surface_get_display (window), EVENTS, g_message ("done %p", window)); - gdk_window_hide (window); + gdk_surface_hide (window); } static const struct zxdg_popup_v6_listener xdg_popup_listener = { @@ -1628,10 +1628,10 @@ window_anchor_to_gravity (GdkGravity rect_anchor) } void -gdk_wayland_window_announce_csd (GdkWindow *window) +gdk_wayland_surface_announce_csd (GdkSurface *window) { - GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (!display_wayland->server_decoration_manager) return; impl->display_server.server_decoration = @@ -1642,21 +1642,21 @@ gdk_wayland_window_announce_csd (GdkWindow *window) ORG_KDE_KWIN_SERVER_DECORATION_MANAGER_MODE_CLIENT); } -static GdkWindow * -get_real_parent_and_translate (GdkWindow *window, +static GdkSurface * +get_real_parent_and_translate (GdkSurface *window, gint *x, gint *y) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - GdkWindow *parent = impl->transient_for; + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); + GdkSurface *parent = impl->transient_for; while (parent) { - GdkWindowImplWayland *parent_impl = - GDK_WINDOW_IMPL_WAYLAND (parent->impl); - GdkWindow *effective_parent = gdk_window_get_parent (parent); + GdkSurfaceImplWayland *parent_impl = + GDK_SURFACE_IMPL_WAYLAND (parent->impl); + GdkSurface *effective_parent = gdk_surface_get_parent (parent); - if ((gdk_window_has_native (parent) && + if ((gdk_surface_has_native (parent) && !parent_impl->display_server.wl_subsurface) || !effective_parent) break; @@ -1664,7 +1664,7 @@ get_real_parent_and_translate (GdkWindow *window, *x += parent->x; *y += parent->y; - if (gdk_window_has_native (parent) && + if (gdk_surface_has_native (parent) && parent_impl->display_server.wl_subsurface) parent = parent->transient_for; else @@ -1675,11 +1675,11 @@ get_real_parent_and_translate (GdkWindow *window, } static void -translate_to_real_parent_window_geometry (GdkWindow *window, +translate_to_real_parent_window_geometry (GdkSurface *window, gint *x, gint *y) { - GdkWindow *parent; + GdkSurface *parent; parent = get_real_parent_and_translate (window, x, y); @@ -1687,12 +1687,12 @@ translate_to_real_parent_window_geometry (GdkWindow *window, *y -= parent->shadow_top; } -static GdkWindow * -translate_from_real_parent_window_geometry (GdkWindow *window, +static GdkSurface * +translate_from_real_parent_window_geometry (GdkSurface *window, gint *x, gint *y) { - GdkWindow *parent; + GdkSurface *parent; gint dx = 0; gint dy = 0; @@ -1705,17 +1705,17 @@ translate_from_real_parent_window_geometry (GdkWindow *window, } static void -calculate_popup_rect (GdkWindow *window, +calculate_popup_rect (GdkSurface *window, GdkGravity rect_anchor, GdkGravity window_anchor, GdkRectangle *out_rect) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); GdkRectangle geometry; GdkRectangle anchor_rect; int x = 0, y = 0; - gdk_wayland_window_get_window_geometry (window, &geometry); + gdk_wayland_surface_get_window_geometry (window, &geometry); anchor_rect = (GdkRectangle) { .x = (impl->pending_move_to_rect.rect.x + @@ -1873,7 +1873,7 @@ flip_anchor_vertically (GdkGravity anchor) } static void -calculate_moved_to_rect_result (GdkWindow *window, +calculate_moved_to_rect_result (GdkSurface *window, int x, int y, int width, @@ -1883,8 +1883,8 @@ calculate_moved_to_rect_result (GdkWindow *window, gboolean *flipped_x, gboolean *flipped_y) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - GdkWindow *parent; + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); + GdkSurface *parent; gint window_x, window_y; gint window_width, window_height; GdkRectangle best_rect; @@ -1902,7 +1902,7 @@ calculate_moved_to_rect_result (GdkWindow *window, window_width = width + window->shadow_left + window->shadow_right; window_height = height + window->shadow_top + window->shadow_bottom; - gdk_window_move_resize (window, + gdk_surface_move_resize (window, window_x, window_y, window_width, window_height); @@ -1957,11 +1957,11 @@ calculate_moved_to_rect_result (GdkWindow *window, } static struct zxdg_positioner_v6 * -create_dynamic_positioner (GdkWindow *window) +create_dynamic_positioner (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); GdkWaylandDisplay *display = - GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); + GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); struct zxdg_positioner_v6 *positioner; GdkRectangle geometry; enum zxdg_positioner_v6_anchor anchor; @@ -1972,7 +1972,7 @@ create_dynamic_positioner (GdkWindow *window) positioner = zxdg_shell_v6_create_positioner (display->xdg_shell); - gdk_wayland_window_get_window_geometry (window, &geometry); + gdk_wayland_surface_get_window_geometry (window, &geometry); zxdg_positioner_v6_set_size (positioner, geometry.width, geometry.height); real_anchor_rect_x = impl->pending_move_to_rect.rect.x; @@ -2019,11 +2019,11 @@ create_dynamic_positioner (GdkWindow *window) } static struct zxdg_positioner_v6 * -create_simple_positioner (GdkWindow *window, - GdkWindow *parent) +create_simple_positioner (GdkSurface *window, + GdkSurface *parent) { GdkWaylandDisplay *display = - GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); + GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); struct zxdg_positioner_v6 *positioner; GdkRectangle geometry; GdkRectangle parent_geometry; @@ -2031,13 +2031,13 @@ create_simple_positioner (GdkWindow *window, positioner = zxdg_shell_v6_create_positioner (display->xdg_shell); - gdk_wayland_window_get_window_geometry (window, &geometry); + gdk_wayland_surface_get_window_geometry (window, &geometry); zxdg_positioner_v6_set_size (positioner, geometry.width, geometry.height); parent_x = parent->x; parent_y = parent->y; - gdk_wayland_window_get_window_geometry (parent, &parent_geometry); + gdk_wayland_surface_get_window_geometry (parent, &parent_geometry); parent_x += parent_geometry.x; parent_y += parent_geometry.y; @@ -2056,13 +2056,13 @@ create_simple_positioner (GdkWindow *window, } static void -gdk_wayland_window_create_xdg_popup (GdkWindow *window, - GdkWindow *parent, +gdk_wayland_surface_create_xdg_popup (GdkSurface *window, + GdkSurface *parent, struct wl_seat *seat) { - GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - GdkWindowImplWayland *parent_impl = GDK_WINDOW_IMPL_WAYLAND (parent->impl); + GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *parent_impl = GDK_SURFACE_IMPL_WAYLAND (parent->impl); struct zxdg_positioner_v6 *positioner; GdkSeat *gdk_seat; guint32 serial; @@ -2098,7 +2098,7 @@ gdk_wayland_window_create_xdg_popup (GdkWindow *window, zxdg_surface_v6_add_listener (impl->display_server.xdg_surface, &xdg_surface_listener, window); - gdk_window_freeze_updates (window); + gdk_surface_freeze_updates (window); if (impl->position_method == POSITION_METHOD_MOVE_TO_RECT) positioner = create_dynamic_positioner (window); @@ -2129,11 +2129,11 @@ gdk_wayland_window_create_xdg_popup (GdkWindow *window, } static struct wl_seat * -find_grab_input_seat (GdkWindow *window, GdkWindow *transient_for) +find_grab_input_seat (GdkSurface *window, GdkSurface *transient_for) { - GdkWindow *attached_grab_window; - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - GdkWindowImplWayland *tmp_impl; + GdkSurface *attached_grab_window; + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *tmp_impl; /* Use the device that was used for the grab as the device for * the popup window setup - so this relies on GTK+ taking the @@ -2151,14 +2151,14 @@ find_grab_input_seat (GdkWindow *window, GdkWindow *transient_for) attached_grab_window = g_object_get_data (G_OBJECT (window), "gdk-attached-grab-window"); if (attached_grab_window) { - tmp_impl = GDK_WINDOW_IMPL_WAYLAND (attached_grab_window->impl); + tmp_impl = GDK_SURFACE_IMPL_WAYLAND (attached_grab_window->impl); if (tmp_impl->grab_input_seat) return gdk_wayland_seat_get_wl_seat (tmp_impl->grab_input_seat); } while (transient_for) { - tmp_impl = GDK_WINDOW_IMPL_WAYLAND (transient_for->impl); + tmp_impl = GDK_SURFACE_IMPL_WAYLAND (transient_for->impl); if (tmp_impl->grab_input_seat) return gdk_wayland_seat_get_wl_seat (tmp_impl->grab_input_seat); @@ -2170,27 +2170,27 @@ find_grab_input_seat (GdkWindow *window, GdkWindow *transient_for) } static gboolean -should_be_mapped (GdkWindow *window) +should_be_mapped (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); /* Don't map crazy temp that GTK+ uses for internal X11 shenanigans. */ - if (window->window_type == GDK_WINDOW_TEMP && window->x < 0 && window->y < 0) + if (window->window_type == GDK_SURFACE_TEMP && window->x < 0 && window->y < 0) return FALSE; - if (impl->hint == GDK_WINDOW_TYPE_HINT_DND) + if (impl->hint == GDK_SURFACE_TYPE_HINT_DND) return FALSE; return TRUE; } static gboolean -should_map_as_popup (GdkWindow *window) +should_map_as_popup (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); /* Ideally, popup would be temp windows with a parent and grab */ - if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP) + if (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP) { /* If a temp window has a parent and a grab, we can use a popup */ if (impl->transient_for) @@ -2207,9 +2207,9 @@ should_map_as_popup (GdkWindow *window) /* Yet we need to keep the window type hint tests for compatibility */ switch ((guint) impl->hint) { - case GDK_WINDOW_TYPE_HINT_POPUP_MENU: - case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: - case GDK_WINDOW_TYPE_HINT_COMBO: + case GDK_SURFACE_TYPE_HINT_POPUP_MENU: + case GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU: + case GDK_SURFACE_TYPE_HINT_COMBO: return TRUE; default: @@ -2220,14 +2220,14 @@ should_map_as_popup (GdkWindow *window) } static gboolean -should_map_as_subsurface (GdkWindow *window) +should_map_as_subsurface (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_SUBSURFACE) + if (GDK_SURFACE_TYPE (window) == GDK_SURFACE_SUBSURFACE) return TRUE; - if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_TEMP) + if (GDK_SURFACE_TYPE (window) != GDK_SURFACE_TEMP) return FALSE; /* if we want a popup, we do not want a subsurface */ @@ -2236,9 +2236,9 @@ should_map_as_subsurface (GdkWindow *window) if (impl->transient_for) { - GdkWindowImplWayland *impl_parent; + GdkSurfaceImplWayland *impl_parent; - impl_parent = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl); + impl_parent = GDK_SURFACE_IMPL_WAYLAND (impl->transient_for->impl); /* subsurface require that the parent is mapped */ if (impl_parent->mapped) return TRUE; @@ -2255,12 +2255,12 @@ should_map_as_subsurface (GdkWindow *window) * or xdg_popup. If the window is not, traverse up the transiency parents until * we find one. */ -static GdkWindow * -get_popup_parent (GdkWindow *window) +static GdkSurface * +get_popup_parent (GdkSurface *window) { while (window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (impl->display_server.xdg_popup || impl->display_server.xdg_toplevel) return window; @@ -2272,10 +2272,10 @@ get_popup_parent (GdkWindow *window) } static void -gdk_wayland_window_map (GdkWindow *window) +gdk_wayland_surface_map (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - GdkWindow *transient_for = NULL; + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); + GdkSurface *transient_for = NULL; if (!should_be_mapped (window)) return; @@ -2286,7 +2286,7 @@ gdk_wayland_window_map (GdkWindow *window) if (should_map_as_subsurface (window)) { if (impl->transient_for) - gdk_wayland_window_create_subsurface (window); + gdk_wayland_surface_create_subsurface (window); else g_warning ("Couldn't map window %p as susburface yet because it doesn't have a parent", window); @@ -2301,7 +2301,7 @@ gdk_wayland_window_map (GdkWindow *window) * surface they should be positioned with by finding the surface beneath * the device that created the grab for the popup window. */ - if (!impl->transient_for && impl->hint == GDK_WINDOW_TYPE_HINT_POPUP_MENU) + if (!impl->transient_for && impl->hint == GDK_SURFACE_TYPE_HINT_POPUP_MENU) { GdkDevice *grab_device = NULL; @@ -2313,13 +2313,13 @@ gdk_wayland_window_map (GdkWindow *window) */ if (!impl->grab_input_seat) { - GdkWindow *attached_grab_window = + GdkSurface *attached_grab_window = g_object_get_data (G_OBJECT (window), "gdk-attached-grab-window"); if (attached_grab_window) { - GdkWindowImplWayland *attached_impl = - GDK_WINDOW_IMPL_WAYLAND (attached_grab_window->impl); + GdkSurfaceImplWayland *attached_impl = + GDK_SURFACE_IMPL_WAYLAND (attached_grab_window->impl); grab_device = gdk_seat_get_pointer (attached_impl->grab_input_seat); transient_for = gdk_device_get_window_at_position (grab_device, @@ -2334,18 +2334,18 @@ gdk_wayland_window_map (GdkWindow *window) } if (transient_for) - transient_for = get_popup_parent (gdk_window_get_toplevel (transient_for)); + transient_for = get_popup_parent (gdk_surface_get_toplevel (transient_for)); /* If the position was not explicitly set, start the popup at the * position of the device that holds the grab. */ if (impl->position_method == POSITION_METHOD_NONE && grab_device) - gdk_window_get_device_position (transient_for, grab_device, + gdk_surface_get_device_position (transient_for, grab_device, &window->x, &window->y, NULL); } else { - transient_for = gdk_window_get_toplevel (impl->transient_for); + transient_for = gdk_surface_get_toplevel (impl->transient_for); transient_for = get_popup_parent (transient_for); } @@ -2363,51 +2363,51 @@ gdk_wayland_window_map (GdkWindow *window) if (!create_fallback) { - gdk_wayland_window_create_xdg_popup (window, + gdk_wayland_surface_create_xdg_popup (window, transient_for, grab_input_seat); } else { - gdk_wayland_window_create_xdg_toplevel (window); + gdk_wayland_surface_create_xdg_toplevel (window); } } else { - gdk_wayland_window_create_xdg_toplevel (window); + gdk_wayland_surface_create_xdg_toplevel (window); } impl->mapped = TRUE; } static void -gdk_wayland_window_show (GdkWindow *window, +gdk_wayland_surface_show (GdkSurface *window, gboolean already_mapped) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (!impl->display_server.wl_surface) - gdk_wayland_window_create_surface (window); + gdk_wayland_surface_create_surface (window); - gdk_wayland_window_map (window); + gdk_wayland_surface_map (window); _gdk_make_event (window, GDK_MAP, NULL, FALSE); if (impl->staging_cairo_surface && _gdk_wayland_is_shm_surface (impl->staging_cairo_surface)) - gdk_wayland_window_attach_image (window); + gdk_wayland_surface_attach_image (window); } static void -unmap_subsurface (GdkWindow *window) +unmap_subsurface (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - GdkWindowImplWayland *parent_impl; + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *parent_impl; g_return_if_fail (impl->display_server.wl_subsurface); g_return_if_fail (impl->transient_for); - parent_impl = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl); + parent_impl = GDK_SURFACE_IMPL_WAYLAND (impl->transient_for->impl); wl_subsurface_destroy (impl->display_server.wl_subsurface); if (impl->parent_surface_committed_handler) { @@ -2419,21 +2419,21 @@ unmap_subsurface (GdkWindow *window) } static void -unmap_popups_for_window (GdkWindow *window) +unmap_popups_for_window (GdkSurface *window) { GdkWaylandDisplay *display_wayland; GList *l; - display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); + display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); for (l = display_wayland->current_popups; l; l = l->next) { - GdkWindow *popup = l->data; - GdkWindowImplWayland *popup_impl = GDK_WINDOW_IMPL_WAYLAND (popup->impl); + GdkSurface *popup = l->data; + GdkSurfaceImplWayland *popup_impl = GDK_SURFACE_IMPL_WAYLAND (popup->impl); if (popup_impl->popup_parent == window) { g_warning ("Tried to unmap the parent of a popup"); - gdk_window_hide (popup); + gdk_surface_hide (popup); return; } @@ -2441,10 +2441,10 @@ unmap_popups_for_window (GdkWindow *window) } static void -gdk_wayland_window_hide_surface (GdkWindow *window) +gdk_wayland_surface_hide_surface (GdkSurface *window) { - GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); unmap_popups_for_window (window); @@ -2491,7 +2491,7 @@ gdk_wayland_window_hide_surface (GdkWindow *window) zxdg_surface_v6_destroy (impl->display_server.xdg_surface); impl->display_server.xdg_surface = NULL; if (!impl->initial_configure_received) - gdk_window_thaw_updates (window); + gdk_surface_thaw_updates (window); else impl->initial_configure_received = FALSE; } @@ -2504,7 +2504,7 @@ gdk_wayland_window_hide_surface (GdkWindow *window) GdkFrameClock *frame_clock; impl->awaiting_frame = FALSE; - frame_clock = gdk_window_get_frame_clock (window); + frame_clock = gdk_surface_get_frame_clock (window); if (frame_clock) _gdk_frame_clock_thaw (frame_clock); } @@ -2522,89 +2522,89 @@ gdk_wayland_window_hide_surface (GdkWindow *window) g_slist_free (impl->display_server.outputs); impl->display_server.outputs = NULL; - if (impl->hint == GDK_WINDOW_TYPE_HINT_DIALOG && !impl->transient_for) + if (impl->hint == GDK_SURFACE_TYPE_HINT_DIALOG && !impl->transient_for) display_wayland->orphan_dialogs = g_list_remove (display_wayland->orphan_dialogs, window); } unset_transient_for_exported (window); - _gdk_wayland_window_clear_saved_size (window); + _gdk_wayland_surface_clear_saved_size (window); impl->pending_commit = FALSE; impl->mapped = FALSE; } static void -gdk_wayland_window_hide (GdkWindow *window) +gdk_wayland_surface_hide (GdkSurface *window) { - gdk_wayland_window_hide_surface (window); - _gdk_window_clear_update_area (window); + gdk_wayland_surface_hide_surface (window); + _gdk_surface_clear_update_area (window); } static void -gdk_window_wayland_withdraw (GdkWindow *window) +gdk_surface_wayland_withdraw (GdkSurface *window) { if (!window->destroyed) { - if (GDK_WINDOW_IS_MAPPED (window)) - gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_WITHDRAWN); + if (GDK_SURFACE_IS_MAPPED (window)) + gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_WITHDRAWN); - g_assert (!GDK_WINDOW_IS_MAPPED (window)); + g_assert (!GDK_SURFACE_IS_MAPPED (window)); - gdk_wayland_window_hide_surface (window); + gdk_wayland_surface_hide_surface (window); } } static void -gdk_window_wayland_set_events (GdkWindow *window, +gdk_surface_wayland_set_events (GdkSurface *window, GdkEventMask event_mask) { - GDK_WINDOW (window)->event_mask = event_mask; + GDK_SURFACE (window)->event_mask = event_mask; } static GdkEventMask -gdk_window_wayland_get_events (GdkWindow *window) +gdk_surface_wayland_get_events (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return 0; else - return GDK_WINDOW (window)->event_mask; + return GDK_SURFACE (window)->event_mask; } static void -gdk_window_wayland_raise (GdkWindow *window) +gdk_surface_wayland_raise (GdkSurface *window) { } static void -gdk_window_wayland_lower (GdkWindow *window) +gdk_surface_wayland_lower (GdkSurface *window) { } static void -gdk_window_wayland_restack_toplevel (GdkWindow *window, - GdkWindow *sibling, +gdk_surface_wayland_restack_toplevel (GdkSurface *window, + GdkSurface *sibling, gboolean above) { } static void -gdk_window_request_transient_parent_commit (GdkWindow *window) +gdk_surface_request_transient_parent_commit (GdkSurface *window) { - GdkWindowImplWayland *window_impl, *impl; + GdkSurfaceImplWayland *window_impl, *impl; GdkFrameClock *frame_clock; - window_impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + window_impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (!window_impl->transient_for) return; - impl = GDK_WINDOW_IMPL_WAYLAND (window_impl->transient_for->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window_impl->transient_for->impl); if (!impl->display_server.wl_surface || impl->pending_commit) return; - frame_clock = gdk_window_get_frame_clock (window_impl->transient_for); + frame_clock = gdk_surface_get_frame_clock (window_impl->transient_for); if (!frame_clock) return; @@ -2615,19 +2615,19 @@ gdk_window_request_transient_parent_commit (GdkWindow *window) } static void -gdk_window_wayland_move_resize (GdkWindow *window, +gdk_surface_wayland_move_resize (GdkSurface *window, gboolean with_move, gint x, gint y, gint width, gint height) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (with_move) { /* Each toplevel has in its own "root" coordinate system */ - if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_TOPLEVEL) + if (GDK_SURFACE_TYPE (window) != GDK_SURFACE_TOPLEVEL) { window->x = x; window->y = y; @@ -2638,7 +2638,7 @@ gdk_window_wayland_move_resize (GdkWindow *window, wl_subsurface_set_position (impl->display_server.wl_subsurface, window->x + window->abs_x, window->y + window->abs_y); - gdk_window_request_transient_parent_commit (window); + gdk_surface_request_transient_parent_commit (window); } } } @@ -2647,12 +2647,12 @@ gdk_window_wayland_move_resize (GdkWindow *window, * just move the window - don't update its size */ if (width > 0 && height > 0) - gdk_wayland_window_maybe_configure (window, width, height, impl->scale); + gdk_wayland_surface_maybe_configure (window, width, height, impl->scale); } /* Avoid zero width/height as this is a protocol error */ static void -sanitize_anchor_rect (GdkWindow *window, +sanitize_anchor_rect (GdkSurface *window, GdkRectangle *rect) { gint original_width = rect->width; @@ -2665,7 +2665,7 @@ sanitize_anchor_rect (GdkWindow *window, } static void -gdk_window_wayland_move_to_rect (GdkWindow *window, +gdk_surface_wayland_move_to_rect (GdkSurface *window, const GdkRectangle *rect, GdkGravity rect_anchor, GdkGravity window_anchor, @@ -2673,7 +2673,7 @@ gdk_window_wayland_move_to_rect (GdkWindow *window, gint rect_anchor_dx, gint rect_anchor_dy) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); impl->pending_move_to_rect.rect = *rect; sanitize_anchor_rect (window, &impl->pending_move_to_rect.rect); @@ -2688,13 +2688,13 @@ gdk_window_wayland_move_to_rect (GdkWindow *window, } static void -gdk_window_wayland_get_geometry (GdkWindow *window, +gdk_surface_wayland_get_geometry (GdkSurface *window, gint *x, gint *y, gint *width, gint *height) { - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { if (x) *x = window->x; @@ -2708,7 +2708,7 @@ gdk_window_wayland_get_geometry (GdkWindow *window, } static void -gdk_window_wayland_get_root_coords (GdkWindow *window, +gdk_surface_wayland_get_root_coords (GdkSurface *window, gint x, gint y, gint *root_x, @@ -2744,7 +2744,7 @@ gdk_window_wayland_get_root_coords (GdkWindow *window, } static gboolean -gdk_window_wayland_get_device_state (GdkWindow *window, +gdk_surface_wayland_get_device_state (GdkSurface *window, GdkDevice *device, gdouble *x, gdouble *y, @@ -2752,13 +2752,13 @@ gdk_window_wayland_get_device_state (GdkWindow *window, { gboolean return_val; - g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (window == NULL || GDK_IS_SURFACE (window), FALSE); return_val = TRUE; - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { - GdkWindow *child; + GdkSurface *child; GDK_DEVICE_GET_CLASS (device)->query_state (device, window, &child, @@ -2771,7 +2771,7 @@ gdk_window_wayland_get_device_state (GdkWindow *window, } static void -gdk_window_wayland_shape_combine_region (GdkWindow *window, +gdk_surface_wayland_shape_combine_region (GdkSurface *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y) @@ -2779,14 +2779,14 @@ gdk_window_wayland_shape_combine_region (GdkWindow *window, } static void -gdk_window_wayland_input_shape_combine_region (GdkWindow *window, +gdk_surface_wayland_input_shape_combine_region (GdkSurface *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; g_clear_pointer (&impl->input_region, cairo_region_destroy); @@ -2801,32 +2801,32 @@ gdk_window_wayland_input_shape_combine_region (GdkWindow *window, } static void -gdk_wayland_window_destroy (GdkWindow *window, +gdk_wayland_surface_destroy (GdkSurface *window, gboolean recursing, gboolean foreign_destroy) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); /* Wayland windows can't be externally destroyed; we may possibly * eventually want to use this path at display close-down */ g_return_if_fail (!foreign_destroy); - gdk_wayland_window_hide_surface (window); + gdk_wayland_surface_hide_surface (window); drop_cairo_surfaces (window); if (window->parent == NULL) { - GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); + GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); display->toplevels = g_list_remove (display->toplevels, window); } } static void -gdk_wayland_window_focus (GdkWindow *window, +gdk_wayland_surface_focus (GdkSurface *window, guint32 timestamp) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (!impl->display_server.gtk_surface) return; @@ -2842,28 +2842,28 @@ gdk_wayland_window_focus (GdkWindow *window, } static void -gdk_wayland_window_set_type_hint (GdkWindow *window, - GdkWindowTypeHint hint) +gdk_wayland_surface_set_type_hint (GdkSurface *window, + GdkSurfaceTypeHint hint) { - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; impl->hint = hint; } -static GdkWindowTypeHint -gdk_wayland_window_get_type_hint (GdkWindow *window) +static GdkSurfaceTypeHint +gdk_wayland_surface_get_type_hint (GdkSurface *window) { - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; - if (GDK_WINDOW_DESTROYED (window)) - return GDK_WINDOW_TYPE_HINT_NORMAL; + if (GDK_SURFACE_DESTROYED (window)) + return GDK_SURFACE_TYPE_HINT_NORMAL; - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); return impl->hint; } @@ -2873,9 +2873,9 @@ gtk_surface_configure (void *data, struct gtk_surface1 *gtk_surface, struct wl_array *states) { - GdkWindow *window = GDK_WINDOW (data); - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - GdkWindowState new_state = 0; + GdkSurface *window = GDK_SURFACE (data); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); + GdkSurfaceState new_state = 0; uint32_t *p; wl_array_for_each (p, states) @@ -2885,21 +2885,21 @@ gtk_surface_configure (void *data, switch (state) { case GTK_SURFACE1_STATE_TILED: - new_state |= GDK_WINDOW_STATE_TILED; + new_state |= GDK_SURFACE_STATE_TILED; break; /* Since v2 */ case GTK_SURFACE1_STATE_TILED_TOP: - new_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_TOP_TILED); + new_state |= (GDK_SURFACE_STATE_TILED | GDK_SURFACE_STATE_TOP_TILED); break; case GTK_SURFACE1_STATE_TILED_RIGHT: - new_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_RIGHT_TILED); + new_state |= (GDK_SURFACE_STATE_TILED | GDK_SURFACE_STATE_RIGHT_TILED); break; case GTK_SURFACE1_STATE_TILED_BOTTOM: - new_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_BOTTOM_TILED); + new_state |= (GDK_SURFACE_STATE_TILED | GDK_SURFACE_STATE_BOTTOM_TILED); break; case GTK_SURFACE1_STATE_TILED_LEFT: - new_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_LEFT_TILED); + new_state |= (GDK_SURFACE_STATE_TILED | GDK_SURFACE_STATE_LEFT_TILED); break; default: /* Unknown state */ @@ -2915,9 +2915,9 @@ gtk_surface_configure_edges (void *data, struct gtk_surface1 *gtk_surface, struct wl_array *edge_constraints) { - GdkWindow *window = GDK_WINDOW (data); - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - GdkWindowState new_state = 0; + GdkSurface *window = GDK_SURFACE (data); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); + GdkSurfaceState new_state = 0; uint32_t *p; wl_array_for_each (p, edge_constraints) @@ -2927,16 +2927,16 @@ gtk_surface_configure_edges (void *data, switch (constraint) { case GTK_SURFACE1_EDGE_CONSTRAINT_RESIZABLE_TOP: - new_state |= GDK_WINDOW_STATE_TOP_RESIZABLE; + new_state |= GDK_SURFACE_STATE_TOP_RESIZABLE; break; case GTK_SURFACE1_EDGE_CONSTRAINT_RESIZABLE_RIGHT: - new_state |= GDK_WINDOW_STATE_RIGHT_RESIZABLE; + new_state |= GDK_SURFACE_STATE_RIGHT_RESIZABLE; break; case GTK_SURFACE1_EDGE_CONSTRAINT_RESIZABLE_BOTTOM: - new_state |= GDK_WINDOW_STATE_BOTTOM_RESIZABLE; + new_state |= GDK_SURFACE_STATE_BOTTOM_RESIZABLE; break; case GTK_SURFACE1_EDGE_CONSTRAINT_RESIZABLE_LEFT: - new_state |= GDK_WINDOW_STATE_LEFT_RESIZABLE; + new_state |= GDK_SURFACE_STATE_LEFT_RESIZABLE; break; default: /* Unknown state */ @@ -2953,11 +2953,11 @@ static const struct gtk_surface1_listener gtk_surface_listener = { }; static void -gdk_wayland_window_init_gtk_surface (GdkWindow *window) +gdk_wayland_surface_init_gtk_surface (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); GdkWaylandDisplay *display = - GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); + GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); if (impl->display_server.gtk_surface != NULL) return; @@ -2969,7 +2969,7 @@ gdk_wayland_window_init_gtk_surface (GdkWindow *window) impl->display_server.gtk_surface = gtk_shell1_get_gtk_surface (display->gtk_shell, impl->display_server.wl_surface); - gdk_window_set_geometry_hints (window, + gdk_surface_set_geometry_hints (window, &impl->geometry_hints, impl->geometry_mask); gtk_surface1_add_listener (impl->display_server.gtk_surface, @@ -2978,11 +2978,11 @@ gdk_wayland_window_init_gtk_surface (GdkWindow *window) } static void -maybe_set_gtk_surface_modal (GdkWindow *window) +maybe_set_gtk_surface_modal (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - gdk_wayland_window_init_gtk_surface (window); + gdk_wayland_surface_init_gtk_surface (window); if (impl->display_server.gtk_surface == NULL) return; @@ -2994,7 +2994,7 @@ maybe_set_gtk_surface_modal (GdkWindow *window) } static void -gdk_wayland_window_set_modal_hint (GdkWindow *window, +gdk_wayland_surface_set_modal_hint (GdkSurface *window, gboolean modal) { window->modal_hint = modal; @@ -3002,36 +3002,36 @@ gdk_wayland_window_set_modal_hint (GdkWindow *window, } static void -gdk_wayland_window_set_skip_taskbar_hint (GdkWindow *window, +gdk_wayland_surface_set_skip_taskbar_hint (GdkSurface *window, gboolean skips_taskbar) { } static void -gdk_wayland_window_set_skip_pager_hint (GdkWindow *window, +gdk_wayland_surface_set_skip_pager_hint (GdkSurface *window, gboolean skips_pager) { } static void -gdk_wayland_window_set_urgency_hint (GdkWindow *window, +gdk_wayland_surface_set_urgency_hint (GdkSurface *window, gboolean urgent) { } static void -gdk_wayland_window_set_geometry_hints (GdkWindow *window, +gdk_wayland_surface_set_geometry_hints (GdkSurface *window, const GdkGeometry *geometry, - GdkWindowHints geom_mask) + GdkSurfaceHints geom_mask) { - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; int width, height; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); impl->geometry_hints = *geometry; impl->geometry_mask = geom_mask; @@ -3067,19 +3067,19 @@ gdk_wayland_window_set_geometry_hints (GdkWindow *window, } static void -gdk_wayland_window_set_title (GdkWindow *window, +gdk_wayland_surface_set_title (GdkSurface *window, const gchar *title) { - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; const char *end; gsize title_length; g_return_if_fail (title != NULL); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (g_strcmp0 (impl->title, title) == 0) return; @@ -3096,36 +3096,36 @@ gdk_wayland_window_set_title (GdkWindow *window, else { impl->title = g_utf8_make_valid (title, title_length); - g_warning ("Invalid utf8 passed to gdk_window_set_title: '%s'", title); + g_warning ("Invalid utf8 passed to gdk_surface_set_title: '%s'", title); } - gdk_wayland_window_sync_title (window); + gdk_wayland_surface_sync_title (window); } static void -gdk_wayland_window_set_role (GdkWindow *window, +gdk_wayland_surface_set_role (GdkSurface *window, const gchar *role) { } static void -gdk_wayland_window_set_startup_id (GdkWindow *window, +gdk_wayland_surface_set_startup_id (GdkSurface *window, const gchar *startup_id) { } static gboolean -check_transient_for_loop (GdkWindow *window, - GdkWindow *parent) +check_transient_for_loop (GdkSurface *window, + GdkSurface *parent) { while (parent) { - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; - if (!GDK_IS_WINDOW_IMPL_WAYLAND(parent->impl)) + if (!GDK_IS_SURFACE_IMPL_WAYLAND(parent->impl)) return FALSE; - impl = GDK_WINDOW_IMPL_WAYLAND (parent->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (parent->impl); if (impl->transient_for == window) return TRUE; parent = impl->transient_for; @@ -3134,16 +3134,16 @@ check_transient_for_loop (GdkWindow *window, } static void -gdk_wayland_window_set_transient_for (GdkWindow *window, - GdkWindow *parent) +gdk_wayland_surface_set_transient_for (GdkSurface *window, + GdkSurface *parent) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); GdkWaylandDisplay *display_wayland = - GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); - GdkWindow *previous_parent; + GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); + GdkSurface *previous_parent; g_assert (parent == NULL || - gdk_window_get_display (window) == gdk_window_get_display (parent)); + gdk_surface_get_display (window) == gdk_surface_get_display (parent)); if (check_transient_for_loop (window, parent)) { @@ -3159,7 +3159,7 @@ gdk_wayland_window_set_transient_for (GdkWindow *window, previous_parent = impl->transient_for; impl->transient_for = parent; - if (impl->hint == GDK_WINDOW_TYPE_HINT_DIALOG) + if (impl->hint == GDK_SURFACE_TYPE_HINT_DIALOG) { if (!parent) _gdk_wayland_screen_add_orphan_dialog (window); @@ -3167,14 +3167,14 @@ gdk_wayland_window_set_transient_for (GdkWindow *window, display_wayland->orphan_dialogs = g_list_remove (display_wayland->orphan_dialogs, window); } - gdk_wayland_window_sync_parent (window, NULL); + gdk_wayland_surface_sync_parent (window, NULL); if (should_map_as_subsurface (window) && - parent && gdk_window_is_visible (window)) - gdk_wayland_window_create_subsurface (window); + parent && gdk_surface_is_visible (window)) + gdk_wayland_surface_create_subsurface (window); } static void -gdk_wayland_window_get_frame_extents (GdkWindow *window, +gdk_wayland_surface_get_frame_extents (GdkSurface *window, GdkRectangle *rect) { *rect = (GdkRectangle) { @@ -3186,37 +3186,37 @@ gdk_wayland_window_get_frame_extents (GdkWindow *window, } static void -gdk_wayland_window_set_accept_focus (GdkWindow *window, +gdk_wayland_surface_set_accept_focus (GdkSurface *window, gboolean accept_focus) { } static void -gdk_wayland_window_set_focus_on_map (GdkWindow *window, +gdk_wayland_surface_set_focus_on_map (GdkSurface *window, gboolean focus_on_map) { } static void -gdk_wayland_window_set_icon_list (GdkWindow *window, +gdk_wayland_surface_set_icon_list (GdkSurface *window, GList *surfaces) { } static void -gdk_wayland_window_set_icon_name (GdkWindow *window, +gdk_wayland_surface_set_icon_name (GdkSurface *window, const gchar *name) { - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; } static void -gdk_wayland_window_iconify (GdkWindow *window) +gdk_wayland_surface_iconify (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; @@ -3227,103 +3227,103 @@ gdk_wayland_window_iconify (GdkWindow *window) } static void -gdk_wayland_window_deiconify (GdkWindow *window) +gdk_wayland_surface_deiconify (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - if (GDK_WINDOW_IS_MAPPED (window)) - gdk_window_show (window); + if (GDK_SURFACE_IS_MAPPED (window)) + gdk_surface_show (window); else /* Flip our client side flag, the real work happens on map. */ - gdk_synthesize_window_state (window, GDK_WINDOW_STATE_ICONIFIED, 0); + gdk_synthesize_window_state (window, GDK_SURFACE_STATE_ICONIFIED, 0); } static void -gdk_wayland_window_stick (GdkWindow *window) +gdk_wayland_surface_stick (GdkSurface *window) { } static void -gdk_wayland_window_unstick (GdkWindow *window) +gdk_wayland_surface_unstick (GdkSurface *window) { } static void -gdk_wayland_window_maximize (GdkWindow *window) +gdk_wayland_surface_maximize (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - _gdk_wayland_window_save_size (window); + _gdk_wayland_surface_save_size (window); if (impl->display_server.xdg_toplevel) zxdg_toplevel_v6_set_maximized (impl->display_server.xdg_toplevel); else - gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_MAXIMIZED); + gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_MAXIMIZED); } static void -gdk_wayland_window_unmaximize (GdkWindow *window) +gdk_wayland_surface_unmaximize (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (impl->display_server.xdg_toplevel) zxdg_toplevel_v6_unset_maximized (impl->display_server.xdg_toplevel); else - gdk_synthesize_window_state (window, GDK_WINDOW_STATE_MAXIMIZED, 0); + gdk_synthesize_window_state (window, GDK_SURFACE_STATE_MAXIMIZED, 0); } static void -gdk_wayland_window_fullscreen_on_monitor (GdkWindow *window, +gdk_wayland_surface_fullscreen_on_monitor (GdkSurface *window, GdkMonitor *monitor) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); struct wl_output *output = ((GdkWaylandMonitor *)monitor)->output; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - _gdk_wayland_window_save_size (window); + _gdk_wayland_surface_save_size (window); if (impl->display_server.xdg_toplevel) { zxdg_toplevel_v6_set_fullscreen (impl->display_server.xdg_toplevel, output); } else { - gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN); + gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); impl->initial_fullscreen_output = output; } } static void -gdk_wayland_window_fullscreen (GdkWindow *window) +gdk_wayland_surface_fullscreen (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; impl->initial_fullscreen_output = NULL; - _gdk_wayland_window_save_size (window); + _gdk_wayland_surface_save_size (window); if (impl->display_server.xdg_toplevel) zxdg_toplevel_v6_set_fullscreen (impl->display_server.xdg_toplevel, NULL); else - gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN); + gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); } static void -gdk_wayland_window_unfullscreen (GdkWindow *window) +gdk_wayland_surface_unfullscreen (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; impl->initial_fullscreen_output = NULL; @@ -3331,107 +3331,107 @@ gdk_wayland_window_unfullscreen (GdkWindow *window) if (impl->display_server.xdg_toplevel) zxdg_toplevel_v6_unset_fullscreen (impl->display_server.xdg_toplevel); else - gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0); + gdk_synthesize_window_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0); } static void -gdk_wayland_window_set_keep_above (GdkWindow *window, gboolean setting) +gdk_wayland_surface_set_keep_above (GdkSurface *window, gboolean setting) { } static void -gdk_wayland_window_set_keep_below (GdkWindow *window, gboolean setting) +gdk_wayland_surface_set_keep_below (GdkSurface *window, gboolean setting) { } -static GdkWindow * -gdk_wayland_window_get_group (GdkWindow *window) +static GdkSurface * +gdk_wayland_surface_get_group (GdkSurface *window) { return NULL; } static void -gdk_wayland_window_set_group (GdkWindow *window, - GdkWindow *leader) +gdk_wayland_surface_set_group (GdkSurface *window, + GdkSurface *leader) { } static void -gdk_wayland_window_set_decorations (GdkWindow *window, +gdk_wayland_surface_set_decorations (GdkSurface *window, GdkWMDecoration decorations) { } static gboolean -gdk_wayland_window_get_decorations (GdkWindow *window, +gdk_wayland_surface_get_decorations (GdkSurface *window, GdkWMDecoration *decorations) { return FALSE; } static void -gdk_wayland_window_set_functions (GdkWindow *window, +gdk_wayland_surface_set_functions (GdkSurface *window, GdkWMFunction functions) { } static void -gdk_wayland_window_begin_resize_drag (GdkWindow *window, - GdkWindowEdge edge, +gdk_wayland_surface_begin_resize_drag (GdkSurface *window, + GdkSurfaceEdge edge, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp) { - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; GdkEventSequence *sequence; uint32_t resize_edges, serial; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; switch (edge) { - case GDK_WINDOW_EDGE_NORTH_WEST: + case GDK_SURFACE_EDGE_NORTH_WEST: resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_LEFT; break; - case GDK_WINDOW_EDGE_NORTH: + case GDK_SURFACE_EDGE_NORTH: resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP; break; - case GDK_WINDOW_EDGE_NORTH_EAST: + case GDK_SURFACE_EDGE_NORTH_EAST: resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_RIGHT; break; - case GDK_WINDOW_EDGE_WEST: + case GDK_SURFACE_EDGE_WEST: resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_LEFT; break; - case GDK_WINDOW_EDGE_EAST: + case GDK_SURFACE_EDGE_EAST: resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_RIGHT; break; - case GDK_WINDOW_EDGE_SOUTH_WEST: + case GDK_SURFACE_EDGE_SOUTH_WEST: resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_LEFT; break; - case GDK_WINDOW_EDGE_SOUTH: + case GDK_SURFACE_EDGE_SOUTH: resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM; break; - case GDK_WINDOW_EDGE_SOUTH_EAST: + case GDK_SURFACE_EDGE_SOUTH_EAST: resize_edges = ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_RIGHT; break; default: - g_warning ("gdk_window_begin_resize_drag: bad resize edge %d!", edge); + g_warning ("gdk_surface_begin_resize_drag: bad resize edge %d!", edge); return; } - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (!impl->display_server.xdg_toplevel) return; @@ -3453,22 +3453,22 @@ gdk_wayland_window_begin_resize_drag (GdkWindow *window, } static void -gdk_wayland_window_begin_move_drag (GdkWindow *window, +gdk_wayland_surface_begin_move_drag (GdkSurface *window, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp) { - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; GdkEventSequence *sequence; uint32_t serial; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (!impl->display_server.xdg_toplevel) return; @@ -3488,41 +3488,41 @@ gdk_wayland_window_begin_move_drag (GdkWindow *window, } static void -gdk_wayland_window_set_opacity (GdkWindow *window, +gdk_wayland_surface_set_opacity (GdkSurface *window, gdouble opacity) { } static void -gdk_wayland_window_destroy_notify (GdkWindow *window) +gdk_wayland_surface_destroy_notify (GdkSurface *window) { - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { - g_warning ("GdkWindow %p unexpectedly destroyed", window); - _gdk_window_destroy (window, TRUE); + g_warning ("GdkSurface %p unexpectedly destroyed", window); + _gdk_surface_destroy (window, TRUE); } g_object_unref (window); } static gint -gdk_wayland_window_get_scale_factor (GdkWindow *window) +gdk_wayland_surface_get_scale_factor (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return 1; return impl->scale; } static void -gdk_wayland_window_set_opaque_region (GdkWindow *window, +gdk_wayland_surface_set_opaque_region (GdkSurface *window, cairo_region_t *region) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; g_clear_pointer (&impl->opaque_region, cairo_region_destroy); @@ -3531,16 +3531,16 @@ gdk_wayland_window_set_opaque_region (GdkWindow *window, } static void -gdk_wayland_window_set_shadow_width (GdkWindow *window, +gdk_wayland_surface_set_shadow_width (GdkSurface *window, int left, int right, int top, int bottom) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); gint new_width, new_height; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; /* Reconfigure window to keep the same window geometry */ @@ -3548,7 +3548,7 @@ gdk_wayland_window_set_shadow_width (GdkWindow *window, (impl->margin_left + impl->margin_right) + (left + right); new_height = window->height - (impl->margin_top + impl->margin_bottom) + (top + bottom); - gdk_wayland_window_maybe_configure (window, new_width, new_height, impl->scale); + gdk_wayland_surface_maybe_configure (window, new_width, new_height, impl->scale); impl->margin_left = left; impl->margin_right = right; @@ -3557,10 +3557,10 @@ gdk_wayland_window_set_shadow_width (GdkWindow *window, } static gboolean -gdk_wayland_window_show_window_menu (GdkWindow *window, +gdk_wayland_surface_show_window_menu (GdkSurface *window, GdkEvent *event) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); struct wl_seat *seat; GdkWaylandDevice *device; double x, y; @@ -3591,9 +3591,9 @@ gdk_wayland_window_show_window_menu (GdkWindow *window, } static gboolean -gdk_wayland_window_supports_edge_constraints (GdkWindow *window) +gdk_wayland_surface_supports_edge_constraints (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); struct gtk_surface1 *gtk_surface = impl->display_server.gtk_surface; if (!gtk_surface) @@ -3603,80 +3603,80 @@ gdk_wayland_window_supports_edge_constraints (GdkWindow *window) } static void -_gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass) +_gdk_surface_impl_wayland_class_init (GdkSurfaceImplWaylandClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass); - - object_class->finalize = gdk_window_impl_wayland_finalize; - - impl_class->ref_cairo_surface = gdk_wayland_window_ref_cairo_surface; - impl_class->create_similar_image_surface = gdk_wayland_window_create_similar_image_surface; - impl_class->show = gdk_wayland_window_show; - impl_class->hide = gdk_wayland_window_hide; - impl_class->withdraw = gdk_window_wayland_withdraw; - impl_class->set_events = gdk_window_wayland_set_events; - impl_class->get_events = gdk_window_wayland_get_events; - impl_class->raise = gdk_window_wayland_raise; - impl_class->lower = gdk_window_wayland_lower; - impl_class->restack_toplevel = gdk_window_wayland_restack_toplevel; - impl_class->move_resize = gdk_window_wayland_move_resize; - impl_class->move_to_rect = gdk_window_wayland_move_to_rect; - impl_class->get_geometry = gdk_window_wayland_get_geometry; - impl_class->get_root_coords = gdk_window_wayland_get_root_coords; - impl_class->get_device_state = gdk_window_wayland_get_device_state; - impl_class->shape_combine_region = gdk_window_wayland_shape_combine_region; - impl_class->input_shape_combine_region = gdk_window_wayland_input_shape_combine_region; - impl_class->destroy = gdk_wayland_window_destroy; - impl_class->begin_paint = gdk_window_impl_wayland_begin_paint; - impl_class->end_paint = gdk_window_impl_wayland_end_paint; - impl_class->beep = gdk_window_impl_wayland_beep; - - impl_class->focus = gdk_wayland_window_focus; - impl_class->set_type_hint = gdk_wayland_window_set_type_hint; - impl_class->get_type_hint = gdk_wayland_window_get_type_hint; - impl_class->set_modal_hint = gdk_wayland_window_set_modal_hint; - impl_class->set_skip_taskbar_hint = gdk_wayland_window_set_skip_taskbar_hint; - impl_class->set_skip_pager_hint = gdk_wayland_window_set_skip_pager_hint; - impl_class->set_urgency_hint = gdk_wayland_window_set_urgency_hint; - impl_class->set_geometry_hints = gdk_wayland_window_set_geometry_hints; - impl_class->set_title = gdk_wayland_window_set_title; - impl_class->set_role = gdk_wayland_window_set_role; - impl_class->set_startup_id = gdk_wayland_window_set_startup_id; - impl_class->set_transient_for = gdk_wayland_window_set_transient_for; - impl_class->get_frame_extents = gdk_wayland_window_get_frame_extents; - impl_class->set_accept_focus = gdk_wayland_window_set_accept_focus; - impl_class->set_focus_on_map = gdk_wayland_window_set_focus_on_map; - impl_class->set_icon_list = gdk_wayland_window_set_icon_list; - impl_class->set_icon_name = gdk_wayland_window_set_icon_name; - impl_class->iconify = gdk_wayland_window_iconify; - impl_class->deiconify = gdk_wayland_window_deiconify; - impl_class->stick = gdk_wayland_window_stick; - impl_class->unstick = gdk_wayland_window_unstick; - impl_class->maximize = gdk_wayland_window_maximize; - impl_class->unmaximize = gdk_wayland_window_unmaximize; - impl_class->fullscreen = gdk_wayland_window_fullscreen; - impl_class->fullscreen_on_monitor = gdk_wayland_window_fullscreen_on_monitor; - impl_class->unfullscreen = gdk_wayland_window_unfullscreen; - impl_class->set_keep_above = gdk_wayland_window_set_keep_above; - impl_class->set_keep_below = gdk_wayland_window_set_keep_below; - impl_class->get_group = gdk_wayland_window_get_group; - impl_class->set_group = gdk_wayland_window_set_group; - impl_class->set_decorations = gdk_wayland_window_set_decorations; - impl_class->get_decorations = gdk_wayland_window_get_decorations; - impl_class->set_functions = gdk_wayland_window_set_functions; - impl_class->begin_resize_drag = gdk_wayland_window_begin_resize_drag; - impl_class->begin_move_drag = gdk_wayland_window_begin_move_drag; - impl_class->set_opacity = gdk_wayland_window_set_opacity; - impl_class->destroy_notify = gdk_wayland_window_destroy_notify; - impl_class->register_dnd = _gdk_wayland_window_register_dnd; - impl_class->drag_begin = _gdk_wayland_window_drag_begin; - impl_class->get_scale_factor = gdk_wayland_window_get_scale_factor; - impl_class->set_opaque_region = gdk_wayland_window_set_opaque_region; - impl_class->set_shadow_width = gdk_wayland_window_set_shadow_width; - impl_class->show_window_menu = gdk_wayland_window_show_window_menu; - impl_class->create_gl_context = gdk_wayland_window_create_gl_context; - impl_class->supports_edge_constraints = gdk_wayland_window_supports_edge_constraints; + GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_CLASS (klass); + + object_class->finalize = gdk_surface_impl_wayland_finalize; + + impl_class->ref_cairo_surface = gdk_wayland_surface_ref_cairo_surface; + impl_class->create_similar_image_surface = gdk_wayland_surface_create_similar_image_surface; + impl_class->show = gdk_wayland_surface_show; + impl_class->hide = gdk_wayland_surface_hide; + impl_class->withdraw = gdk_surface_wayland_withdraw; + impl_class->set_events = gdk_surface_wayland_set_events; + impl_class->get_events = gdk_surface_wayland_get_events; + impl_class->raise = gdk_surface_wayland_raise; + impl_class->lower = gdk_surface_wayland_lower; + impl_class->restack_toplevel = gdk_surface_wayland_restack_toplevel; + impl_class->move_resize = gdk_surface_wayland_move_resize; + impl_class->move_to_rect = gdk_surface_wayland_move_to_rect; + impl_class->get_geometry = gdk_surface_wayland_get_geometry; + impl_class->get_root_coords = gdk_surface_wayland_get_root_coords; + impl_class->get_device_state = gdk_surface_wayland_get_device_state; + impl_class->shape_combine_region = gdk_surface_wayland_shape_combine_region; + impl_class->input_shape_combine_region = gdk_surface_wayland_input_shape_combine_region; + impl_class->destroy = gdk_wayland_surface_destroy; + impl_class->begin_paint = gdk_surface_impl_wayland_begin_paint; + impl_class->end_paint = gdk_surface_impl_wayland_end_paint; + impl_class->beep = gdk_surface_impl_wayland_beep; + + impl_class->focus = gdk_wayland_surface_focus; + impl_class->set_type_hint = gdk_wayland_surface_set_type_hint; + impl_class->get_type_hint = gdk_wayland_surface_get_type_hint; + impl_class->set_modal_hint = gdk_wayland_surface_set_modal_hint; + impl_class->set_skip_taskbar_hint = gdk_wayland_surface_set_skip_taskbar_hint; + impl_class->set_skip_pager_hint = gdk_wayland_surface_set_skip_pager_hint; + impl_class->set_urgency_hint = gdk_wayland_surface_set_urgency_hint; + impl_class->set_geometry_hints = gdk_wayland_surface_set_geometry_hints; + impl_class->set_title = gdk_wayland_surface_set_title; + impl_class->set_role = gdk_wayland_surface_set_role; + impl_class->set_startup_id = gdk_wayland_surface_set_startup_id; + impl_class->set_transient_for = gdk_wayland_surface_set_transient_for; + impl_class->get_frame_extents = gdk_wayland_surface_get_frame_extents; + impl_class->set_accept_focus = gdk_wayland_surface_set_accept_focus; + impl_class->set_focus_on_map = gdk_wayland_surface_set_focus_on_map; + impl_class->set_icon_list = gdk_wayland_surface_set_icon_list; + impl_class->set_icon_name = gdk_wayland_surface_set_icon_name; + impl_class->iconify = gdk_wayland_surface_iconify; + impl_class->deiconify = gdk_wayland_surface_deiconify; + impl_class->stick = gdk_wayland_surface_stick; + impl_class->unstick = gdk_wayland_surface_unstick; + impl_class->maximize = gdk_wayland_surface_maximize; + impl_class->unmaximize = gdk_wayland_surface_unmaximize; + impl_class->fullscreen = gdk_wayland_surface_fullscreen; + impl_class->fullscreen_on_monitor = gdk_wayland_surface_fullscreen_on_monitor; + impl_class->unfullscreen = gdk_wayland_surface_unfullscreen; + impl_class->set_keep_above = gdk_wayland_surface_set_keep_above; + impl_class->set_keep_below = gdk_wayland_surface_set_keep_below; + impl_class->get_group = gdk_wayland_surface_get_group; + impl_class->set_group = gdk_wayland_surface_set_group; + impl_class->set_decorations = gdk_wayland_surface_set_decorations; + impl_class->get_decorations = gdk_wayland_surface_get_decorations; + impl_class->set_functions = gdk_wayland_surface_set_functions; + impl_class->begin_resize_drag = gdk_wayland_surface_begin_resize_drag; + impl_class->begin_move_drag = gdk_wayland_surface_begin_move_drag; + impl_class->set_opacity = gdk_wayland_surface_set_opacity; + impl_class->destroy_notify = gdk_wayland_surface_destroy_notify; + impl_class->register_dnd = _gdk_wayland_surface_register_dnd; + impl_class->drag_begin = _gdk_wayland_surface_drag_begin; + impl_class->get_scale_factor = gdk_wayland_surface_get_scale_factor; + impl_class->set_opaque_region = gdk_wayland_surface_set_opaque_region; + impl_class->set_shadow_width = gdk_wayland_surface_set_shadow_width; + impl_class->show_window_menu = gdk_wayland_surface_show_window_menu; + impl_class->create_gl_context = gdk_wayland_surface_create_gl_context; + impl_class->supports_edge_constraints = gdk_wayland_surface_supports_edge_constraints; signals[COMMITTED] = g_signal_new (g_intern_static_string ("committed"), G_TYPE_FROM_CLASS (object_class), @@ -3687,31 +3687,31 @@ _gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass) } void -_gdk_wayland_window_set_grab_seat (GdkWindow *window, +_gdk_wayland_surface_set_grab_seat (GdkSurface *window, GdkSeat *seat) { - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; g_return_if_fail (window != NULL); - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); impl->grab_input_seat = seat; } /** - * gdk_wayland_window_new_subsurface: (constructor) + * gdk_wayland_surface_new_subsurface: (constructor) * @display: the display to create the window on * @position: position relative to the transient window * * Creates a new subsurface window. * - * Returns: (transfer full): the new #GdkWindow + * Returns: (transfer full): the new #GdkSurface **/ -GdkWindow * -gdk_wayland_window_new_subsurface (GdkDisplay *display, +GdkSurface * +gdk_wayland_surface_new_subsurface (GdkDisplay *display, const GdkRectangle *position) { - GdkWindowAttr attr; + GdkSurfaceAttr attr; g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); g_return_val_if_fail (position != NULL, NULL); @@ -3721,35 +3721,35 @@ gdk_wayland_window_new_subsurface (GdkDisplay *display, attr.y = position->y; attr.width = position->width; attr.height = position->height; - attr.window_type = GDK_WINDOW_SUBSURFACE; + attr.window_type = GDK_SURFACE_SUBSURFACE; - return gdk_window_new (display, NULL, &attr); + return gdk_surface_new (display, NULL, &attr); } /** - * gdk_wayland_window_get_wl_surface: - * @window: (type GdkWaylandWindow): a #GdkWindow + * gdk_wayland_surface_get_wl_surface: + * @window: (type GdkWaylandSurface): a #GdkSurface * - * Returns the Wayland surface of a #GdkWindow. + * Returns the Wayland surface of a #GdkSurface. * * Returns: (transfer none): a Wayland wl_surface */ struct wl_surface * -gdk_wayland_window_get_wl_surface (GdkWindow *window) +gdk_wayland_surface_get_wl_surface (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), NULL); - return GDK_WINDOW_IMPL_WAYLAND (window->impl)->display_server.wl_surface; + return GDK_SURFACE_IMPL_WAYLAND (window->impl)->display_server.wl_surface; } struct wl_output * -gdk_wayland_window_get_wl_output (GdkWindow *window) +gdk_wayland_surface_get_wl_output (GdkSurface *window) { - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; - g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), NULL); - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); /* We pick the head of the list as this is the last entered output */ if (impl->display_server.outputs) return (struct wl_output *) impl->display_server.outputs->data; @@ -3758,9 +3758,9 @@ gdk_wayland_window_get_wl_output (GdkWindow *window) } static struct wl_egl_window * -gdk_wayland_window_get_wl_egl_window (GdkWindow *window) +gdk_wayland_surface_get_wl_egl_window (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (impl->display_server.egl_window == NULL) { @@ -3775,20 +3775,20 @@ gdk_wayland_window_get_wl_egl_window (GdkWindow *window) } EGLSurface -gdk_wayland_window_get_egl_surface (GdkWindow *window, +gdk_wayland_surface_get_egl_surface (GdkSurface *window, EGLConfig config) { - GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); - GdkWindowImplWayland *impl; + GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); + GdkSurfaceImplWayland *impl; struct wl_egl_window *egl_window; - g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), NULL); - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (impl->egl_surface == NULL) { - egl_window = gdk_wayland_window_get_wl_egl_window (window); + egl_window = gdk_wayland_surface_get_wl_egl_window (window); impl->egl_surface = eglCreateWindowSurface (display->egl_display, config, egl_window, NULL); @@ -3798,15 +3798,15 @@ gdk_wayland_window_get_egl_surface (GdkWindow *window, } EGLSurface -gdk_wayland_window_get_dummy_egl_surface (GdkWindow *window, +gdk_wayland_surface_get_dummy_egl_surface (GdkSurface *window, EGLConfig config) { - GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); - GdkWindowImplWayland *impl; + GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); + GdkSurfaceImplWayland *impl; - g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), NULL); - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (impl->dummy_egl_surface == NULL) { @@ -3821,18 +3821,18 @@ gdk_wayland_window_get_dummy_egl_surface (GdkWindow *window, } struct gtk_surface1 * -gdk_wayland_window_get_gtk_surface (GdkWindow *window) +gdk_wayland_surface_get_gtk_surface (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), NULL); - return GDK_WINDOW_IMPL_WAYLAND (window->impl)->display_server.gtk_surface; + return GDK_SURFACE_IMPL_WAYLAND (window->impl)->display_server.gtk_surface; } /** - * gdk_wayland_window_set_use_custom_surface: - * @window: (type GdkWaylandWindow): a #GdkWindow + * gdk_wayland_surface_set_use_custom_surface: + * @window: (type GdkWaylandSurface): a #GdkSurface * - * Marks a #GdkWindow as a custom Wayland surface. The application is + * Marks a #GdkSurface as a custom Wayland surface. The application is * expected to register the surface as some type of surface using * some Wayland interface. * @@ -3844,21 +3844,21 @@ gdk_wayland_window_get_gtk_surface (GdkWindow *window) * compositor will expose a private interface to the special client * that lets the client identify the wl_surface as a panel or such. * - * This function should be called before a #GdkWindow is shown. This is + * This function should be called before a #GdkSurface is shown. This is * best done by connecting to the #GtkWidget::realize signal: * * |[<!-- language="C" --> * static void * widget_realize_cb (GtkWidget *widget) * { - * GdkWindow *window; + * GdkSurface *window; * struct wl_surface *surface; * struct input_panel_surface *ip_surface; * * window = gtk_widget_get_window (widget); - * gdk_wayland_window_set_custom_surface (window); + * gdk_wayland_surface_set_custom_surface (window); * - * surface = gdk_wayland_window_get_wl_surface (window); + * surface = gdk_wayland_surface_get_wl_surface (window); * ip_surface = input_panel_get_input_panel_surface (input_panel, surface); * input_panel_surface_set_panel (ip_surface); * } @@ -3871,24 +3871,24 @@ gdk_wayland_window_get_gtk_surface (GdkWindow *window) * ]| */ void -gdk_wayland_window_set_use_custom_surface (GdkWindow *window) +gdk_wayland_surface_set_use_custom_surface (GdkSurface *window) { - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; - g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window)); + g_return_if_fail (GDK_IS_WAYLAND_SURFACE (window)); - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (!impl->display_server.wl_surface) - gdk_wayland_window_create_surface (window); + gdk_wayland_surface_create_surface (window); impl->use_custom_surface = TRUE; } static void -maybe_set_gtk_surface_dbus_properties (GdkWindow *window) +maybe_set_gtk_surface_dbus_properties (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); if (impl->application.was_set) return; @@ -3901,7 +3901,7 @@ maybe_set_gtk_surface_dbus_properties (GdkWindow *window) impl->application.unique_bus_name == NULL) return; - gdk_wayland_window_init_gtk_surface (window); + gdk_wayland_surface_init_gtk_surface (window); if (impl->display_server.gtk_surface == NULL) return; @@ -3916,7 +3916,7 @@ maybe_set_gtk_surface_dbus_properties (GdkWindow *window) } void -gdk_wayland_window_set_dbus_properties_libgtk_only (GdkWindow *window, +gdk_wayland_surface_set_dbus_properties_libgtk_only (GdkSurface *window, const char *application_id, const char *app_menu_path, const char *menubar_path, @@ -3924,11 +3924,11 @@ gdk_wayland_window_set_dbus_properties_libgtk_only (GdkWindow *window, const char *application_object_path, const char *unique_bus_name) { - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; - g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window)); + g_return_if_fail (GDK_IS_WAYLAND_SURFACE (window)); - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); impl->application.application_id = g_strdup (application_id); impl->application.app_menu_path = g_strdup (app_menu_path); @@ -3942,15 +3942,15 @@ gdk_wayland_window_set_dbus_properties_libgtk_only (GdkWindow *window, } void -_gdk_wayland_window_offset_next_wl_buffer (GdkWindow *window, +_gdk_wayland_surface_offset_next_wl_buffer (GdkSurface *window, int x, int y) { - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; - g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window)); + g_return_if_fail (GDK_IS_WAYLAND_SURFACE (window)); - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); impl->pending_buffer_offset_x = x; impl->pending_buffer_offset_y = y; @@ -3961,8 +3961,8 @@ xdg_exported_handle (void *data, struct zxdg_exported_v1 *zxdg_exported_v1, const char *handle) { - GdkWindow *window = data; - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurface *window = data; + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); impl->exported.callback (window, handle, impl->exported.user_data); g_clear_pointer (&impl->exported.user_data, @@ -3974,10 +3974,10 @@ static const struct zxdg_exported_v1_listener xdg_exported_listener = { }; /** - * GdkWaylandWindowExported: - * @window: the #GdkWindow that is exported + * GdkWaylandSurfaceExported: + * @window: the #GdkSurface that is exported * @handle: the handle - * @user_data: user data that was passed to gdk_wayland_window_export_handle() + * @user_data: user data that was passed to gdk_wayland_surface_export_handle() * * Callback that gets called when the handle for a window has been * obtained from the Wayland compositor. The handle can be passed @@ -3986,16 +3986,16 @@ static const struct zxdg_exported_v1_listener xdg_exported_listener = { */ static gboolean -gdk_wayland_window_is_exported (GdkWindow *window) +gdk_wayland_surface_is_exported (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); return !!impl->display_server.xdg_exported; } /** - * gdk_wayland_window_export_handle: - * @window: the #GdkWindow to obtain a handle for + * gdk_wayland_surface_export_handle: + * @window: the #GdkSurface to obtain a handle for * @callback: callback to call with the handle * @user_data: user data for @callback * @destroy_func: destroy notify for @user_data @@ -4007,12 +4007,12 @@ gdk_wayland_window_is_exported (GdkWindow *window) * It is an error to call this function on a window that is already * exported. * - * When the handle is no longer needed, gdk_wayland_window_unexport_handle() + * When the handle is no longer needed, gdk_wayland_surface_unexport_handle() * should be called to clean up resources. * * The main purpose for obtaining a handle is to mark a surface * from another window as transient for this one, see - * gdk_wayland_window_set_transient_for_exported(). + * gdk_wayland_surface_set_transient_for_exported(). * * Note that this API depends on an unstable Wayland protocol, * and thus may require changes in the future. @@ -4021,20 +4021,20 @@ gdk_wayland_window_is_exported (GdkWindow *window) * an error occurred. */ gboolean -gdk_wayland_window_export_handle (GdkWindow *window, - GdkWaylandWindowExported callback, +gdk_wayland_surface_export_handle (GdkSurface *window, + GdkWaylandSurfaceExported callback, gpointer user_data, GDestroyNotify destroy_func) { - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; GdkWaylandDisplay *display_wayland; - GdkDisplay *display = gdk_window_get_display (window); + GdkDisplay *display = gdk_surface_get_display (window); struct zxdg_exported_v1 *xdg_exported; - g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), FALSE); + g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), FALSE); g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), FALSE); - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); display_wayland = GDK_WAYLAND_DISPLAY (display); g_return_val_if_fail (!impl->display_server.xdg_exported, FALSE); @@ -4058,11 +4058,11 @@ gdk_wayland_window_export_handle (GdkWindow *window, } /** - * gdk_wayland_window_unexport_handle: - * @window: the #GdkWindow to unexport + * gdk_wayland_surface_unexport_handle: + * @window: the #GdkSurface to unexport * * Destroys the handle that was obtained with - * gdk_wayland_window_export_handle(). + * gdk_wayland_surface_export_handle(). * * It is an error to call this function on a window that * does not have a handle. @@ -4071,13 +4071,13 @@ gdk_wayland_window_export_handle (GdkWindow *window, * and thus may require changes in the future. */ void -gdk_wayland_window_unexport_handle (GdkWindow *window) +gdk_wayland_surface_unexport_handle (GdkSurface *window) { - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; - g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window)); + g_return_if_fail (GDK_IS_WAYLAND_SURFACE (window)); - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); g_return_if_fail (impl->display_server.xdg_exported); @@ -4088,9 +4088,9 @@ gdk_wayland_window_unexport_handle (GdkWindow *window) } static void -unset_transient_for_exported (GdkWindow *window) +unset_transient_for_exported (GdkSurface *window) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); g_clear_pointer (&impl->imported_transient_for, zxdg_imported_v1_destroy); } @@ -4099,7 +4099,7 @@ static void xdg_imported_destroyed (void *data, struct zxdg_imported_v1 *zxdg_imported_v1) { - GdkWindow *window = data; + GdkSurface *window = data; unset_transient_for_exported (window); } @@ -4109,13 +4109,13 @@ static const struct zxdg_imported_v1_listener xdg_imported_listener = { }; /** - * gdk_wayland_window_set_transient_for_exported: - * @window: the #GdkWindow to make as transient + * gdk_wayland_surface_set_transient_for_exported: + * @window: the #GdkSurface to make as transient * @parent_handle_str: an exported handle for a surface * * Marks @window as transient for the surface to which the given * @parent_handle_str refers. Typically, the handle will originate - * from a gdk_wayland_window_export_handle() call in another process. + * from a gdk_wayland_surface_export_handle() call in another process. * * Note that this API depends on an unstable Wayland protocol, * and thus may require changes in the future. @@ -4124,19 +4124,19 @@ static const struct zxdg_imported_v1_listener xdg_imported_listener = { * %FALSE if an error occurred. */ gboolean -gdk_wayland_window_set_transient_for_exported (GdkWindow *window, +gdk_wayland_surface_set_transient_for_exported (GdkSurface *window, char *parent_handle_str) { - GdkWindowImplWayland *impl; + GdkSurfaceImplWayland *impl; GdkWaylandDisplay *display_wayland; - GdkDisplay *display = gdk_window_get_display (window); + GdkDisplay *display = gdk_surface_get_display (window); - g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), FALSE); + g_return_val_if_fail (GDK_IS_WAYLAND_SURFACE (window), FALSE); g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), FALSE); g_return_val_if_fail (!should_map_as_subsurface (window) && !should_map_as_popup (window), FALSE); - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); display_wayland = GDK_WAYLAND_DISPLAY (display); if (!display_wayland->xdg_importer) @@ -4145,7 +4145,7 @@ gdk_wayland_window_set_transient_for_exported (GdkWindow *window, return FALSE; } - gdk_window_set_transient_for (window, NULL); + gdk_surface_set_transient_for (window, NULL); impl->imported_transient_for = zxdg_importer_v1_import (display_wayland->xdg_importer, parent_handle_str); @@ -4153,24 +4153,24 @@ gdk_wayland_window_set_transient_for_exported (GdkWindow *window, &xdg_imported_listener, window); - gdk_wayland_window_sync_parent_of_imported (window); + gdk_wayland_surface_sync_parent_of_imported (window); return TRUE; } static struct zwp_keyboard_shortcuts_inhibitor_v1 * -gdk_wayland_window_get_inhibitor (GdkWindowImplWayland *impl, +gdk_wayland_surface_get_inhibitor (GdkSurfaceImplWayland *impl, struct wl_seat *seat) { return g_hash_table_lookup (impl->shortcuts_inhibitors, seat); } void -gdk_wayland_window_inhibit_shortcuts (GdkWindow *window, +gdk_wayland_surface_inhibit_shortcuts (GdkSurface *window, GdkSeat *gdk_seat) { - GdkWindowImplWayland *impl= GDK_WINDOW_IMPL_WAYLAND (window->impl); - GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); + GdkSurfaceImplWayland *impl= GDK_SURFACE_IMPL_WAYLAND (window->impl); + GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (window)); struct wl_surface *surface = impl->display_server.wl_surface; struct wl_seat *seat = gdk_wayland_seat_get_wl_seat (gdk_seat); struct zwp_keyboard_shortcuts_inhibitor_v1 *inhibitor; @@ -4178,7 +4178,7 @@ gdk_wayland_window_inhibit_shortcuts (GdkWindow *window, if (display->keyboard_shortcuts_inhibit == NULL) return; - if (gdk_wayland_window_get_inhibitor (impl, seat)) + if (gdk_wayland_surface_get_inhibitor (impl, seat)) return; /* Already inhibitted */ inhibitor = @@ -4189,14 +4189,14 @@ gdk_wayland_window_inhibit_shortcuts (GdkWindow *window, } void -gdk_wayland_window_restore_shortcuts (GdkWindow *window, +gdk_wayland_surface_restore_shortcuts (GdkSurface *window, GdkSeat *gdk_seat) { - GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + GdkSurfaceImplWayland *impl = GDK_SURFACE_IMPL_WAYLAND (window->impl); struct wl_seat *seat = gdk_wayland_seat_get_wl_seat (gdk_seat); struct zwp_keyboard_shortcuts_inhibitor_v1 *inhibitor; - inhibitor = gdk_wayland_window_get_inhibitor (impl, seat); + inhibitor = gdk_wayland_surface_get_inhibitor (impl, seat); if (inhibitor == NULL) return; /* Not inhibitted */ diff --git a/gdk/win32/gdkdevice-virtual.c b/gdk/win32/gdkdevice-virtual.c index fb52a68446..f5658e137b 100644 --- a/gdk/win32/gdkdevice-virtual.c +++ b/gdk/win32/gdkdevice-virtual.c @@ -65,7 +65,7 @@ _gdk_device_virtual_set_active (GdkDevice *device, static gboolean gdk_device_virtual_get_history (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, guint32 start, guint32 stop, GdkTimeCoord ***events, @@ -77,7 +77,7 @@ gdk_device_virtual_get_history (GdkDevice *device, static void gdk_device_virtual_get_state (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, GdkModifierType *mask) { @@ -90,12 +90,12 @@ gdk_device_virtual_get_state (GdkDevice *device, static void gdk_device_virtual_set_window_cursor (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkCursor *cursor) { if (cursor != NULL) { - GdkDisplay *display = gdk_window_get_display (window); + GdkDisplay *display = gdk_surface_get_display (window); HCURSOR hcursor = NULL; if (display != NULL) @@ -116,8 +116,8 @@ gdk_device_virtual_warp (GdkDevice *device, static void gdk_device_virtual_query_state (GdkDevice *device, - GdkWindow *window, - GdkWindow **child_window, + GdkSurface *window, + GdkSurface **child_window, gdouble *root_x, gdouble *root_y, gdouble *win_x, @@ -135,14 +135,14 @@ gdk_device_virtual_query_state (GdkDevice *device, static GdkGrabStatus gdk_device_virtual_grab (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gboolean owner_events, GdkEventMask event_mask, - GdkWindow *confine_to, + GdkSurface *confine_to, GdkCursor *cursor, 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) { @@ -160,7 +160,7 @@ gdk_device_virtual_grab (GdkDevice *device, else SetCursor (LoadCursor (NULL, IDC_ARROW)); - SetCapture (GDK_WINDOW_HWND (window)); + SetCapture (GDK_SURFACE_HWND (window)); } return GDK_GRAB_SUCCESS; @@ -199,7 +199,7 @@ gdk_device_virtual_ungrab (GdkDevice *device, static void gdk_device_virtual_select_window_events (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, 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->grab = gdk_device_virtual_grab; 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; } diff --git a/gdk/win32/gdkdevice-win32.c b/gdk/win32/gdkdevice-win32.c index 110d73d4ce..580506a971 100644 --- a/gdk/win32/gdkdevice-win32.c +++ b/gdk/win32/gdkdevice-win32.c @@ -30,7 +30,7 @@ G_DEFINE_TYPE (GdkDeviceWin32, gdk_device_win32, GDK_TYPE_DEVICE) static gboolean gdk_device_win32_get_history (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, guint32 start, guint32 stop, GdkTimeCoord ***events, @@ -41,13 +41,13 @@ gdk_device_win32_get_history (GdkDevice *device, static void gdk_device_win32_get_state (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, GdkModifierType *mask) { 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) { @@ -58,7 +58,7 @@ gdk_device_win32_get_state (GdkDevice *device, static void gdk_device_win32_set_window_cursor (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkCursor *cursor) { } @@ -98,8 +98,8 @@ get_current_mask (void) static void gdk_device_win32_query_state (GdkDevice *device, - GdkWindow *window, - GdkWindow **child_window, + GdkSurface *window, + GdkSurface **child_window, gdouble *root_x, gdouble *root_y, gdouble *win_x, @@ -112,8 +112,8 @@ gdk_device_win32_query_state (GdkDevice *device, if (window) { - scale = GDK_WINDOW_IMPL_WIN32 (window->impl)->window_scale; - hwnd = GDK_WINDOW_HWND (window); + scale = GDK_SURFACE_IMPL_WIN32 (window->impl)->window_scale; + hwnd = GDK_SURFACE_HWND (window); } else { @@ -171,10 +171,10 @@ gdk_device_win32_query_state (GdkDevice *device, static GdkGrabStatus gdk_device_win32_grab (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gboolean owner_events, GdkEventMask event_mask, - GdkWindow *confine_to, + GdkSurface *confine_to, GdkCursor *cursor, guint32 time_) { @@ -195,15 +195,15 @@ screen_to_client (HWND hwnd, POINT screen_pt, POINT *client_pt) ScreenToClient (hwnd, client_pt); } -GdkWindow * -_gdk_device_win32_window_at_position (GdkDevice *device, +GdkSurface * +_gdk_device_win32_surface_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, gboolean get_toplevel) { - GdkWindow *window = NULL; - GdkWindowImplWin32 *impl = NULL; + GdkSurface *window = NULL; + GdkSurfaceImplWin32 *impl = NULL; POINT screen_pt, client_pt; HWND hwnd, hwndc; RECT rect; @@ -223,7 +223,7 @@ _gdk_device_win32_window_at_position (GdkDevice *device, window = gdk_win32_handle_table_lookup (hwnd); if (window != NULL && - GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN) + GDK_SURFACE_TYPE (window) != GDK_SURFACE_FOREIGN) break; 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)) { - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (win_x) *win_x = client_pt.x / impl->window_scale; @@ -281,7 +281,7 @@ _gdk_device_win32_window_at_position (GdkDevice *device, static void gdk_device_win32_select_window_events (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, 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->grab = gdk_device_win32_grab; 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; } diff --git a/gdk/win32/gdkdevice-win32.h b/gdk/win32/gdkdevice-win32.h index b1dd80db9f..ff2c94ce5b 100644 --- a/gdk/win32/gdkdevice-win32.h +++ b/gdk/win32/gdkdevice-win32.h @@ -44,7 +44,7 @@ struct _GdkDeviceWin32Class 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_y, GdkModifierType *mask, diff --git a/gdk/win32/gdkdevice-wintab.c b/gdk/win32/gdkdevice-wintab.c index 0de1ecb879..a8a41785c7 100644 --- a/gdk/win32/gdkdevice-wintab.c +++ b/gdk/win32/gdkdevice-wintab.c @@ -30,7 +30,7 @@ G_DEFINE_TYPE (GdkDeviceWintab, gdk_device_wintab, GDK_TYPE_DEVICE) static gboolean gdk_device_wintab_get_history (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, guint32 start, guint32 stop, GdkTimeCoord ***events, @@ -67,7 +67,7 @@ get_current_mask (void) static void gdk_device_wintab_get_state (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, GdkModifierType *mask) { @@ -94,7 +94,7 @@ gdk_device_wintab_get_state (GdkDevice *device, static void gdk_device_wintab_set_window_cursor (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkCursor *cursor) { } @@ -108,8 +108,8 @@ gdk_device_wintab_warp (GdkDevice *device, static void gdk_device_wintab_query_state (GdkDevice *device, - GdkWindow *window, - GdkWindow **child_window, + GdkSurface *window, + GdkSurface **child_window, gdouble *root_x, gdouble *root_y, gdouble *win_x, @@ -119,14 +119,14 @@ gdk_device_wintab_query_state (GdkDevice *device, GdkDeviceWintab *device_wintab; POINT point; HWND hwnd, hwndc; - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; int scale; device_wintab = GDK_DEVICE_WINTAB (device); if (window) { - scale = GDK_WINDOW_IMPL_WIN32 (window->impl)->window_scale; - hwnd = GDK_WINDOW_HWND (window); + scale = GDK_SURFACE_IMPL_WIN32 (window->impl)->window_scale; + hwnd = GDK_SURFACE_HWND (window); } else { @@ -186,10 +186,10 @@ gdk_device_wintab_query_state (GdkDevice *device, static GdkGrabStatus gdk_device_wintab_grab (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gboolean owner_events, GdkEventMask event_mask, - GdkWindow *confine_to, + GdkSurface *confine_to, GdkCursor *cursor, guint32 time_) { @@ -202,7 +202,7 @@ gdk_device_wintab_ungrab (GdkDevice *device, { } -static GdkWindow * +static GdkSurface * gdk_device_wintab_window_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, @@ -214,30 +214,30 @@ gdk_device_wintab_window_at_position (GdkDevice *device, static void gdk_device_wintab_select_window_events (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkEventMask event_mask) { } void _gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab, - GdkWindow *window, + GdkSurface *window, gdouble *axes, gdouble *x, gdouble *y) { GdkDevice *device; - GdkWindow *impl_window; + GdkSurface *impl_window; gint root_x, root_y; gdouble temp_x, temp_y; gint i; GdkDisplay *display; 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; - 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); @@ -260,7 +260,7 @@ _gdk_device_wintab_translate_axes (GdkDeviceWintab *device_wintab, HMONITOR hmonitor; MONITORINFO minfo = {sizeof (MONITORINFO),}; - hmonitor = MonitorFromWindow (GDK_WINDOW_HWND (window), + hmonitor = MonitorFromWindow (GDK_SURFACE_HWND (window), MONITOR_DEFAULTTONEAREST); GetMonitorInfo (hmonitor, &minfo); diff --git a/gdk/win32/gdkdevice-wintab.h b/gdk/win32/gdkdevice-wintab.h index bba08ff125..f706dd91df 100644 --- a/gdk/win32/gdkdevice-wintab.h +++ b/gdk/win32/gdkdevice-wintab.h @@ -61,7 +61,7 @@ struct _GdkDeviceWintabClass GType gdk_device_wintab_get_type (void) G_GNUC_CONST; void _gdk_device_wintab_translate_axes (GdkDeviceWintab *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, gdouble *x, gdouble *y); diff --git a/gdk/win32/gdkdevicemanager-win32.c b/gdk/win32/gdkdevicemanager-win32.c index 28507fba38..ae32d410f9 100644 --- a/gdk/win32/gdkdevicemanager-win32.c +++ b/gdk/win32/gdkdevicemanager-win32.c @@ -43,7 +43,7 @@ #define TWOPI (2 * G_PI) static GList *wintab_contexts = NULL; -static GdkWindow *wintab_window = NULL; +static GdkSurface *wintab_window = NULL; extern gint _gdk_input_ignore_core; typedef UINT (WINAPI *t_WTInfoA) (UINT a, UINT b, LPVOID c); @@ -432,7 +432,7 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager) ndevices, ncursors)); #endif /* 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); for (devix = 0; devix < ndevices; devix++) @@ -496,7 +496,7 @@ wintab_init_check (GdkDeviceManagerWin32 *device_manager) print_lc(&lc))); #endif 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"); return; @@ -831,7 +831,7 @@ decode_tilt (gint *axis_data, /* * 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 * on build_pointer_event_state from gdkevents-win32.c */ @@ -878,7 +878,7 @@ gboolean gdk_input_other_event (GdkDisplay *display, GdkEvent *event, MSG *msg, - GdkWindow *window) + GdkSurface *window) { GdkDeviceManagerWin32 *device_manager; GdkDeviceWintab *source_device = NULL; @@ -886,7 +886,7 @@ gdk_input_other_event (GdkDisplay *display, GdkEventMask masktest; guint key_state; POINT pt; - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; PACKET packet; gint root_x, root_y; @@ -912,7 +912,7 @@ gdk_input_other_event (GdkDisplay *display, GDK_NOTE (EVENTS_OR_INPUT, 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) { @@ -1060,28 +1060,28 @@ gdk_input_other_event (GdkDisplay *display, /* Now we can check if the window wants the event, and * 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_window_get_events (window) & masktest) == 0)) + (gdk_surface_get_events (window) & masktest) == 0)) { GDK_NOTE (EVENTS_OR_INPUT, g_print ("... not selected\n")); if (window->parent == NULL) return FALSE; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); pt.x = x * 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); window = window->parent; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); g_object_ref (window); - ScreenToClient (GDK_WINDOW_HWND (window), &pt); + ScreenToClient (GDK_SURFACE_HWND (window), &pt); x = pt.x / impl->window_scale; y = pt.y / impl->window_scale; 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; @@ -1096,7 +1096,7 @@ gdk_input_other_event (GdkDisplay *display, gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer)); 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, window, @@ -1128,7 +1128,7 @@ gdk_input_other_event (GdkDisplay *display, gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer)); 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, window, diff --git a/gdk/win32/gdkdevicemanager-win32.h b/gdk/win32/gdkdevicemanager-win32.h index 8f71335ba8..fc8ead5a10 100644 --- a/gdk/win32/gdkdevicemanager-win32.h +++ b/gdk/win32/gdkdevicemanager-win32.h @@ -60,7 +60,7 @@ void _gdk_input_set_tablet_active (void); gboolean gdk_input_other_event (GdkDisplay *display, GdkEvent *event, MSG *msg, - GdkWindow *window); + GdkSurface *window); G_END_DECLS diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c index 5bc2cb6ec1..47891e6a0f 100644 --- a/gdk/win32/gdkdisplay-win32.c +++ b/gdk/win32/gdkdisplay-win32.c @@ -492,7 +492,7 @@ gdk_win32_display_get_name (GdkDisplay *display) return display_name_cache; } -static GdkWindow * +static GdkSurface * gdk_win32_display_get_default_group (GdkDisplay *display) { 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->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->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->set_cursor_theme = gdk_win32_display_set_cursor_theme; - _gdk_win32_windowing_init (); + _gdk_win32_surfaceing_init (); } diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c index 1d844a8185..e52b3afc25 100644 --- a/gdk/win32/gdkdnd-win32.c +++ b/gdk/win32/gdkdnd-win32.c @@ -179,10 +179,10 @@ move_drag_window (GdkDragContext *context, { GdkWin32DragContext *context_win32 = GDK_WIN32_DRAG_CONTEXT (context); - gdk_window_move (context_win32->drag_window, + gdk_surface_move (context_win32->drag_window, x_root - context_win32->hot_x, y_root - context_win32->hot_y); - gdk_window_raise (context_win32->drag_window); + gdk_surface_raise (context_win32->drag_window); } static void @@ -204,7 +204,7 @@ gdk_win32_drag_context_finalize (GObject *object) { GdkDragContext *context; GdkWin32DragContext *context_win32; - GdkWindow *drag_window; + GdkSurface *drag_window; GDK_NOTE (DND, g_print ("gdk_drag_context_finalize %p\n", object)); @@ -229,7 +229,7 @@ gdk_win32_drag_context_finalize (GObject *object) G_OBJECT_CLASS (gdk_win32_drag_context_parent_class)->finalize (object); if (drag_window) - gdk_window_destroy (drag_window); + gdk_surface_destroy (drag_window); } /* Drag Contexts */ @@ -237,8 +237,8 @@ gdk_win32_drag_context_finalize (GObject *object) static GdkDragContext * gdk_drag_context_new (GdkDisplay *display, gboolean is_source, - GdkWindow *source_window, - GdkWindow *dest_window, + GdkSurface *source_window, + GdkSurface *dest_window, GdkDragAction actions, GdkDevice *device, GdkDragProtocol protocol) @@ -272,8 +272,8 @@ gdk_drag_context_new (GdkDisplay *display, static GdkDragContext * gdk_drag_context_find (gboolean is_source, - GdkWindow *source, - GdkWindow *dest) + GdkSurface *source, + GdkSurface *dest) { GList *tmp_list = contexts; GdkDragContext *context; @@ -312,7 +312,7 @@ typedef struct { GdkDragContext *context; gint ref_count; - GdkWindow *dest_window; + GdkSurface *dest_window; } target_drag_context; @@ -588,7 +588,7 @@ idroptarget_dragenter (LPDROPTARGET This, g_clear_object (&ctx->context); - context = gdk_drag_context_new (gdk_window_get_display (ctx->dest_window), + context = gdk_drag_context_new (gdk_surface_get_display (ctx->dest_window), FALSE, /* OLE2 DnD does not allow us to get the source window, * but we *can* find it if it's ours. This is needed to @@ -800,7 +800,7 @@ send_change_events (GdkDragContext *context, POINT pt; POINT pt_client; gboolean changed = FALSE; - HWND hwnd = GDK_WINDOW_HWND (context->source_window); + HWND hwnd = GDK_SURFACE_HWND (context->source_window); LPARAM lparam; WPARAM wparam; gint pt_x; @@ -1440,7 +1440,7 @@ static IEnumFORMATETCVtbl ief_vtbl = { static target_drag_context * -target_context_new (GdkWindow *window) +target_context_new (GdkSurface *window) { target_drag_context *result; @@ -1459,7 +1459,7 @@ target_context_new (GdkWindow *window) static source_drag_context * source_context_new (GdkDragContext *context, - GdkWindow *window, + GdkSurface *window, GdkContentFormats *formats) { GdkWin32DragContext *context_win32; @@ -1669,7 +1669,7 @@ gdk_dropfiles_filter (GdkXEvent *xev, { GDK_NOTE (DND, g_print ("WM_DROPFILES: %p\n", msg->hwnd)); - context = gdk_drag_context_new (gdk_window_get_display (event->any.window), + context = gdk_drag_context_new (gdk_surface_get_display (event->any.window), FALSE, NULL, event->any.window, @@ -1866,7 +1866,7 @@ local_send_enter (GdkDragContext *context, current_dest_drag = NULL; } - new_context = gdk_drag_context_new (gdk_window_get_display (context->source_window), + new_context = gdk_drag_context_new (gdk_surface_get_display (context->source_window), FALSE, context->source_window, context->dest_window, @@ -1875,8 +1875,8 @@ local_send_enter (GdkDragContext *context, GDK_DRAG_PROTO_LOCAL); new_context->formats = gdk_content_formats_ref (context->formats); - gdk_window_set_events (new_context->source_window, - gdk_window_get_events (new_context->source_window) | + gdk_surface_set_events (new_context->source_window, + gdk_surface_get_events (new_context->source_window) | GDK_PROPERTY_CHANGE_MASK); tmp_event = gdk_event_new (GDK_DRAG_ENTER); @@ -1995,20 +1995,20 @@ gdk_drag_do_leave (GdkDragContext *context, } } -static GdkWindow * +static GdkSurface * create_drag_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; } GdkDragContext * -_gdk_win32_window_drag_begin (GdkWindow *window, +_gdk_win32_surface_drag_begin (GdkSurface *window, GdkDevice *device, GdkContentFormats *formats, GdkDragAction actions, @@ -2026,7 +2026,7 @@ _gdk_win32_window_drag_begin (GdkWindow *window, if (use_ole2_dnd) g_assert (pending_src_context == NULL); - context = gdk_drag_context_new (gdk_window_get_display (window), + context = gdk_drag_context_new (gdk_surface_get_display (window), TRUE, window, NULL, @@ -2064,7 +2064,7 @@ _gdk_win32_window_drag_begin (GdkWindow *window, if (kbd_state[VK_RBUTTON] & 0x80) context_win32->last_key_state |= MK_RBUTTON; - context_win32->drag_window = create_drag_window (gdk_window_get_display (window)); + context_win32->drag_window = create_drag_window (gdk_surface_get_display (window)); if (!drag_context_grab (context)) { @@ -2200,25 +2200,25 @@ find_window_enum_proc (HWND hwnd, return TRUE; } -static GdkWindow * +static GdkSurface * gdk_win32_drag_context_find_window (GdkDragContext *context, - GdkWindow *drag_window, + GdkSurface *drag_window, gint x_root, gint y_root, GdkDragProtocol *protocol) { GdkWin32DragContext *context_win32 = GDK_WIN32_DRAG_CONTEXT (context); - GdkWindow *dest_window, *dw; + GdkSurface *dest_window, *dw; find_window_enum_arg a; a.x = x_root * context_win32->scale - _gdk_offset_x; a.y = y_root * context_win32->scale - _gdk_offset_y; - a.ignore = drag_window ? GDK_WINDOW_HWND (drag_window) : NULL; + a.ignore = drag_window ? GDK_SURFACE_HWND (drag_window) : NULL; a.result = NULL; GDK_NOTE (DND, g_print ("gdk_drag_find_window_real: %p %+d%+d\n", - (drag_window ? GDK_WINDOW_HWND (drag_window) : NULL), + (drag_window ? GDK_SURFACE_HWND (drag_window) : NULL), a.x, a.y)); EnumWindows (find_window_enum_proc, (LPARAM) &a); @@ -2230,11 +2230,11 @@ gdk_win32_drag_context_find_window (GdkDragContext *context, dw = gdk_win32_handle_table_lookup (a.result); if (dw) { - dest_window = gdk_window_get_toplevel (dw); + dest_window = gdk_surface_get_toplevel (dw); g_object_ref (dest_window); } else - dest_window = gdk_win32_window_foreign_new_for_display (context->display, a.result); + dest_window = gdk_win32_surface_foreign_new_for_display (context->display, a.result); if (use_ole2_dnd) *protocol = GDK_DRAG_PROTO_OLE2; @@ -2246,10 +2246,10 @@ gdk_win32_drag_context_find_window (GdkDragContext *context, GDK_NOTE (DND, g_print ("gdk_drag_find_window: %p %+d%+d: %p: %p %s\n", - (drag_window ? GDK_WINDOW_HWND (drag_window) : NULL), + (drag_window ? GDK_SURFACE_HWND (drag_window) : NULL), x_root, y_root, a.result, - (dest_window ? GDK_WINDOW_HWND (dest_window) : NULL), + (dest_window ? GDK_SURFACE_HWND (dest_window) : NULL), _gdk_win32_drag_protocol_to_string (*protocol))); return dest_window; @@ -2257,7 +2257,7 @@ gdk_win32_drag_context_find_window (GdkDragContext *context, static gboolean gdk_win32_drag_context_drag_motion (GdkDragContext *context, - GdkWindow *dest_window, + GdkSurface *dest_window, GdkDragProtocol protocol, gint x_root, gint y_root, @@ -2575,7 +2575,7 @@ gdk_destroy_filter (GdkXEvent *xev, #endif void -_gdk_win32_window_register_dnd (GdkWindow *window) +_gdk_win32_surface_register_dnd (GdkSurface *window) { target_drag_context *ctx; HRESULT hr; @@ -2587,7 +2587,7 @@ _gdk_win32_window_register_dnd (GdkWindow *window) else g_object_set_data (G_OBJECT (window), "gdk-dnd-registered", GINT_TO_POINTER (TRUE)); - GDK_NOTE (DND, g_print ("gdk_window_register_dnd: %p\n", GDK_WINDOW_HWND (window))); + GDK_NOTE (DND, g_print ("gdk_surface_register_dnd: %p\n", GDK_SURFACE_HWND (window))); if (!use_ole2_dnd) { @@ -2596,13 +2596,13 @@ _gdk_win32_window_register_dnd (GdkWindow *window) * whether the window (widget) in question actually accepts files * (in gtk, data of type text/uri-list) or not. */ - gdk_window_add_filter (window, gdk_dropfiles_filter, NULL); - DragAcceptFiles (GDK_WINDOW_HWND (window), TRUE); + gdk_surface_add_filter (window, gdk_dropfiles_filter, NULL); + DragAcceptFiles (GDK_SURFACE_HWND (window), TRUE); } else { /* Return if window is already setup for DND. */ - if (g_hash_table_lookup (target_ctx_for_window, GDK_WINDOW_HWND (window)) != NULL) + if (g_hash_table_lookup (target_ctx_for_window, GDK_SURFACE_HWND (window)) != NULL) return; ctx = target_context_new (window); @@ -2612,7 +2612,7 @@ _gdk_win32_window_register_dnd (GdkWindow *window) OTHER_API_FAILED ("CoLockObjectExternal"); else { - hr = RegisterDragDrop (GDK_WINDOW_HWND (window), &ctx->idt); + hr = RegisterDragDrop (GDK_SURFACE_HWND (window), &ctx->idt); if (hr == DRAGDROP_E_ALREADYREGISTERED) { g_print ("DRAGDROP_E_ALREADYREGISTERED\n"); @@ -2623,7 +2623,7 @@ _gdk_win32_window_register_dnd (GdkWindow *window) else { g_object_ref (window); - g_hash_table_insert (target_ctx_for_window, GDK_WINDOW_HWND (window), ctx); + g_hash_table_insert (target_ctx_for_window, GDK_SURFACE_HWND (window), ctx); } } } @@ -2721,11 +2721,11 @@ gdk_drag_anim_timeout (gpointer data) t = ease_out_cubic (f); - gdk_window_show (context->drag_window); - gdk_window_move (context->drag_window, + gdk_surface_show (context->drag_window); + gdk_surface_move (context->drag_window, context->last_x + (context->start_x - context->last_x) * t - context->hot_x, context->last_y + (context->start_y - context->last_y) * t - context->hot_y); - gdk_window_set_opacity (context->drag_window, 1.0 - f); + gdk_surface_set_opacity (context->drag_window, 1.0 - f); return G_SOURCE_CONTINUE; } @@ -2760,15 +2760,15 @@ gdk_win32_drag_context_drop_done (GdkDragContext *context, if (success) { - gdk_window_hide (win32_context->drag_window); + gdk_surface_hide (win32_context->drag_window); return; } - win_surface = _gdk_window_ref_cairo_surface (win32_context->drag_window); - surface = gdk_window_create_similar_surface (win32_context->drag_window, + win_surface = _gdk_surface_ref_cairo_surface (win32_context->drag_window); + surface = gdk_surface_create_similar_surface (win32_context->drag_window, cairo_surface_get_content (win_surface), - gdk_window_get_width (win32_context->drag_window), - gdk_window_get_height (win32_context->drag_window)); + gdk_surface_get_width (win32_context->drag_window), + gdk_surface_get_height (win32_context->drag_window)); cr = cairo_create (surface); cairo_set_source_surface (cr, win_surface, 0, 0); cairo_paint (cr); @@ -2778,7 +2778,7 @@ gdk_win32_drag_context_drop_done (GdkDragContext *context, /* pattern = cairo_pattern_create_for_surface (surface); - gdk_window_set_background_pattern (win32_context->drag_window, pattern); + gdk_surface_set_background_pattern (win32_context->drag_window, pattern); cairo_pattern_destroy (pattern); */ @@ -2786,7 +2786,7 @@ gdk_win32_drag_context_drop_done (GdkDragContext *context, anim = g_slice_new0 (GdkDragAnim); g_set_object (&anim->context, win32_context); - anim->frame_clock = gdk_window_get_frame_clock (win32_context->drag_window); + anim->frame_clock = gdk_surface_get_frame_clock (win32_context->drag_window); anim->start_time = gdk_frame_clock_get_frame_time (anim->frame_clock); id = g_timeout_add_full (G_PRIORITY_DEFAULT, 17, @@ -2948,7 +2948,7 @@ gdk_drag_update (GdkDragContext *context, { GdkWin32DragContext *win32_context = GDK_WIN32_DRAG_CONTEXT (context); GdkDragAction action, possible_actions; - GdkWindow *dest_window; + GdkSurface *dest_window; GdkDragProtocol protocol; gdk_drag_get_current_actions (mods, GDK_BUTTON_PRIMARY, win32_context->actions, @@ -2985,7 +2985,7 @@ gdk_dnd_handle_key_event (GdkDragContext *context, { GdkWin32DragContext *win32_context = GDK_WIN32_DRAG_CONTEXT (context); GdkModifierType state; - GdkWindow *root_window; + GdkSurface *root_window; GdkDevice *pointer; gint dx, dy; @@ -3198,7 +3198,7 @@ gdk_win32_drag_context_action_changed (GdkDragContext *context, gdk_drag_context_set_cursor (context, cursor); } -static GdkWindow * +static GdkSurface * gdk_win32_drag_context_get_drag_window (GdkDragContext *context) { return GDK_WIN32_DRAG_CONTEXT (context)->drag_window; diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index 83102adc97..02da731c4e 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -125,8 +125,8 @@ static GSourceFuncs event_funcs = { NULL }; -static GdkWindow *mouse_window = NULL; -static GdkWindow *mouse_window_ignored_leave = NULL; +static GdkSurface *mouse_window = NULL; +static GdkSurface *mouse_window_ignored_leave = NULL; static gint current_x, current_y; static gint current_root_x, current_root_y; static UINT client_message; @@ -186,7 +186,7 @@ _gdk_win32_get_next_tick (gulong suggested_tick) static void generate_focus_event (GdkDeviceManagerWin32 *device_manager, - GdkWindow *window, + GdkSurface *window, gboolean in) { GdkDevice *device; @@ -208,9 +208,9 @@ generate_focus_event (GdkDeviceManagerWin32 *device_manager, static void generate_grab_broken_event (GdkDeviceManagerWin32 *device_manager, - GdkWindow *window, + GdkSurface *window, gboolean keyboard, - GdkWindow *grab_window) + GdkSurface *grab_window) { GdkEvent *event = gdk_event_new (GDK_GRAB_BROKEN); GdkDevice *device; @@ -277,7 +277,7 @@ inner_window_procedure (HWND hwnd, } LRESULT CALLBACK -_gdk_win32_window_procedure (HWND hwnd, +_gdk_win32_surface_procedure (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) @@ -301,14 +301,14 @@ _gdk_win32_window_procedure (HWND hwnd, static LRESULT low_level_keystroke_handler (WPARAM message, KBDLLHOOKSTRUCT *kbdhook, - GdkWindow *window) + GdkSurface *window) { - GdkWindow *toplevel = gdk_window_get_toplevel (window); + GdkSurface *toplevel = gdk_surface_get_toplevel (window); static DWORD last_keydown = 0; if (message == WM_KEYDOWN && - !GDK_WINDOW_DESTROYED (toplevel) && - _gdk_win32_window_lacks_wm_decorations (toplevel) && /* For CSD only */ + !GDK_SURFACE_DESTROYED (toplevel) && + _gdk_win32_surface_lacks_wm_decorations (toplevel) && /* For CSD only */ last_keydown != kbdhook->vkCode && ((GetKeyState (VK_LWIN) & 0x8000) || (GetKeyState (VK_RWIN) & 0x8000))) @@ -317,7 +317,7 @@ low_level_keystroke_handler (WPARAM message, gboolean lshiftdown = GetKeyState (VK_LSHIFT) & 0x8000; gboolean rshiftdown = GetKeyState (VK_RSHIFT) & 0x8000; gboolean oneshiftdown = (lshiftdown || rshiftdown) && !(lshiftdown && rshiftdown); - gboolean maximized = gdk_window_get_state (toplevel) & GDK_WINDOW_STATE_MAXIMIZED; + gboolean maximized = gdk_surface_get_state (toplevel) & GDK_SURFACE_STATE_MAXIMIZED; switch (kbdhook->vkCode) { @@ -349,7 +349,7 @@ low_level_keystroke_handler (WPARAM message, combo = GDK_WIN32_AEROSNAP_COMBO_NOTHING; if (combo != GDK_WIN32_AEROSNAP_COMBO_NOTHING) - PostMessage (GDK_WINDOW_HWND (toplevel), aerosnap_message, (WPARAM) combo, 0); + PostMessage (GDK_SURFACE_HWND (toplevel), aerosnap_message, (WPARAM) combo, 0); } if (message == WM_KEYDOWN) @@ -367,7 +367,7 @@ low_level_keyboard_proc (int code, { KBDLLHOOKSTRUCT *kbdhook; HWND kbd_focus_owner; - GdkWindow *gdk_kbd_focus_owner; + GdkSurface *gdk_kbd_focus_owner; LRESULT chain; do @@ -578,14 +578,14 @@ event_mask_string (GdkEventMask mask) #endif -static GdkWindow * -find_window_for_mouse_event (GdkWindow* reported_window, +static GdkSurface * +find_window_for_mouse_event (GdkSurface* reported_window, MSG* msg) { POINT pt; GdkDisplay *display; GdkDeviceManagerWin32 *device_manager; - GdkWindow *event_window; + GdkSurface *event_window; HWND hwnd; RECT rect; GdkDeviceGrabInfo *grab; @@ -619,7 +619,7 @@ find_window_for_mouse_event (GdkWindow* reported_window, } /* need to also adjust the coordinates to the new window */ - ScreenToClient (GDK_WINDOW_HWND (event_window), &pt); + ScreenToClient (GDK_SURFACE_HWND (event_window), &pt); /* ATTENTION: need to update client coords */ msg->lParam = MAKELPARAM (pt.x, pt.y); @@ -797,14 +797,14 @@ _gdk_win32_print_event (const GdkEvent *event) CASE (GDK_DROP_START); CASE (GDK_DROP_FINISHED); CASE (GDK_SCROLL); - CASE (GDK_WINDOW_STATE); + CASE (GDK_SURFACE_STATE); CASE (GDK_GRAB_BROKEN); #undef CASE default: g_assert_not_reached (); } g_print (" %p @ %ums ", - event->any.window ? GDK_WINDOW_HWND (event->any.window) : NULL, + event->any.window ? GDK_SURFACE_HWND (event->any.window) : NULL, gdk_event_get_time (event)); switch (event->any.type) @@ -846,7 +846,7 @@ _gdk_win32_print_event (const GdkEvent *event) case GDK_ENTER_NOTIFY: case GDK_LEAVE_NOTIFY: g_print ("%p (%.4g,%.4g) (%.4g,%.4g) %s %s%s", - event->crossing.subwindow == NULL ? NULL : GDK_WINDOW_HWND (event->crossing.subwindow), + event->crossing.subwindow == NULL ? NULL : GDK_SURFACE_HWND (event->crossing.subwindow), event->crossing.x, event->crossing.y, event->crossing.x_root, event->crossing.y_root, (event->crossing.mode == GDK_CROSSING_NORMAL ? "NORMAL" : @@ -891,8 +891,8 @@ _gdk_win32_print_event (const GdkEvent *event) event->dnd.context, _gdk_win32_drag_protocol_to_string (event->dnd.context->protocol), event->dnd.context->is_source ? "SOURCE" : "DEST", - event->dnd.context->source_window == NULL ? NULL : GDK_WINDOW_HWND (event->dnd.context->source_window), - event->dnd.context->dest_window == NULL ? NULL : GDK_WINDOW_HWND (event->dnd.context->dest_window)); + event->dnd.context->source_window == NULL ? NULL : GDK_SURFACE_HWND (event->dnd.context->source_window), + event->dnd.context->dest_window == NULL ? NULL : GDK_SURFACE_HWND (event->dnd.context->dest_window)); break; case GDK_SCROLL: g_print ("(%.4g,%.4g) (%.4g,%.4g) %s ", @@ -905,15 +905,15 @@ _gdk_win32_print_event (const GdkEvent *event) "???"))))); print_event_state (event->scroll.state); break; - case GDK_WINDOW_STATE: + case GDK_SURFACE_STATE: g_print ("%s: %s", - _gdk_win32_window_state_to_string (event->window_state.changed_mask), - _gdk_win32_window_state_to_string (event->window_state.new_window_state)); + _gdk_win32_surface_state_to_string (event->window_state.changed_mask), + _gdk_win32_surface_state_to_string (event->window_state.new_window_state)); case GDK_GRAB_BROKEN: g_print ("%s %s %p", (event->grab_broken.keyboard ? "KEYBOARD" : "POINTER"), (event->grab_broken.implicit ? "IMPLICIT" : "EXPLICIT"), - (event->grab_broken.grab_window ? GDK_WINDOW_HWND (event->grab_broken.grab_window) : 0)); + (event->grab_broken.grab_window ? GDK_SURFACE_HWND (event->grab_broken.grab_window) : 0)); default: /* Nothing */ break; @@ -1047,7 +1047,7 @@ fill_key_event_string (GdkEvent *event) } static GdkFilterReturn -apply_event_filters (GdkWindow *window, +apply_event_filters (GdkSurface *window, MSG *msg, GList **filters) { @@ -1131,11 +1131,11 @@ apply_event_filters (GdkWindow *window, * from. */ static void -show_window_recurse (GdkWindow *window, gboolean hide_window) +show_window_recurse (GdkSurface *window, gboolean hide_window) { - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); GSList *children = impl->transient_children; - GdkWindow *child = NULL; + GdkSurface *child = NULL; if (!impl->changing_state) { @@ -1152,13 +1152,13 @@ show_window_recurse (GdkWindow *window, gboolean hide_window) } } - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { if (!hide_window) { - if (gdk_window_get_state (window) & GDK_WINDOW_STATE_ICONIFIED) + if (gdk_surface_get_state (window) & GDK_SURFACE_STATE_ICONIFIED) { - if (gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED) + if (gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED) { GtkShowWindow (window, SW_SHOWMAXIMIZED); } @@ -1179,10 +1179,10 @@ show_window_recurse (GdkWindow *window, gboolean hide_window) } static void -do_show_window (GdkWindow *window, gboolean hide_window) +do_show_window (GdkSurface *window, gboolean hide_window) { - GdkWindow *tmp_window = NULL; - GdkWindowImplWin32 *tmp_impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurface *tmp_window = NULL; + GdkSurfaceImplWin32 *tmp_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (!tmp_impl->changing_state) { @@ -1190,7 +1190,7 @@ do_show_window (GdkWindow *window, gboolean hide_window) while (tmp_impl->transient_owner != NULL) { tmp_window = tmp_impl->transient_owner; - tmp_impl = GDK_WINDOW_IMPL_WIN32 (tmp_window->impl); + tmp_impl = GDK_SURFACE_IMPL_WIN32 (tmp_window->impl); } /* If we couldn't find one, use the window provided. */ @@ -1209,11 +1209,11 @@ do_show_window (GdkWindow *window, gboolean hide_window) static void send_crossing_event (GdkDisplay *display, - GdkWindow *window, + GdkSurface *window, GdkEventType type, GdkCrossingMode mode, GdkNotifyType notify_type, - GdkWindow *subwindow, + GdkSurface *subwindow, POINT *screen_pt, GdkModifierType mask, guint32 time_) @@ -1222,7 +1222,7 @@ send_crossing_event (GdkDisplay *display, GdkDeviceGrabInfo *grab; GdkDeviceManagerWin32 *device_manager; POINT pt; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); device_manager = _gdk_device_manager; @@ -1233,12 +1233,12 @@ send_crossing_event (GdkDisplay *display, mode != GDK_CROSSING_UNGRAB) { /* !owner_event => only report events wrt grab window, ignore rest */ - if ((GdkWindow *)window != grab->native_window) + if ((GdkSurface *)window != grab->native_window) return; } pt = *screen_pt; - ScreenToClient (GDK_WINDOW_HWND (window), &pt); + ScreenToClient (GDK_SURFACE_HWND (window), &pt); event = gdk_event_new (type); event->crossing.window = window; @@ -1261,19 +1261,19 @@ send_crossing_event (GdkDisplay *display, _gdk_win32_append_event (event); } -static GdkWindow * -get_native_parent (GdkWindow *window) +static GdkSurface * +get_native_parent (GdkSurface *window) { if (window->parent != NULL) return window->parent->impl_window; return NULL; } -static GdkWindow * -find_common_ancestor (GdkWindow *win1, - GdkWindow *win2) +static GdkSurface * +find_common_ancestor (GdkSurface *win1, + GdkSurface *win2) { - GdkWindow *tmp; + GdkSurface *tmp; GList *path1 = NULL, *path2 = NULL; GList *list1, *list2; @@ -1296,7 +1296,7 @@ find_common_ancestor (GdkWindow *win1, tmp = NULL; while (list1 && list2 && (list1->data == list2->data)) { - tmp = (GdkWindow *)list1->data; + tmp = (GdkSurface *)list1->data; list1 = list1->next; list2 = list2->next; } @@ -1308,19 +1308,19 @@ find_common_ancestor (GdkWindow *win1, void synthesize_crossing_events (GdkDisplay *display, - GdkWindow *src, - GdkWindow *dest, + GdkSurface *src, + GdkSurface *dest, GdkCrossingMode mode, POINT *screen_pt, GdkModifierType mask, guint32 time_, gboolean non_linear) { - GdkWindow *c; - GdkWindow *win, *last, *next; + GdkSurface *c; + GdkSurface *win, *last, *next; GList *path, *list; - GdkWindow *a; - GdkWindow *b; + GdkSurface *a; + GdkSurface *b; GdkNotifyType notify_type; a = src; @@ -1364,7 +1364,7 @@ synthesize_crossing_events (GdkDisplay *display, win, GDK_LEAVE_NOTIFY, mode, notify_type, - (GdkWindow *)last, + (GdkSurface *)last, screen_pt, mask, time_); @@ -1395,10 +1395,10 @@ synthesize_crossing_events (GdkDisplay *display, list = path; while (list) { - win = (GdkWindow *)list->data; + win = (GdkSurface *)list->data; list = list->next; if (list) - next = (GdkWindow *)list->data; + next = (GdkSurface *)list->data; else next = b; @@ -1436,9 +1436,9 @@ synthesize_crossing_events (GdkDisplay *display, * because an extended input device is active */ static gboolean -propagate (GdkWindow **window, +propagate (GdkSurface **window, MSG *msg, - GdkWindow *grab_window, + GdkSurface *grab_window, gboolean grab_owner_events, gint grab_mask, gboolean (*doesnt_want_it) (gint mask, @@ -1469,7 +1469,7 @@ propagate (GdkWindow **window, if ((*doesnt_want_it) ((*window)->event_mask, msg)) { /* Owner doesn't want it, propagate to parent. */ - GdkWindow *parent = gdk_window_get_parent (*window); + GdkSurface *parent = gdk_surface_get_parent (*window); if (parent == NULL) { /* No parent; check if grabbed */ @@ -1531,24 +1531,24 @@ doesnt_want_char (gint mask, * TRUE otherwise. */ gboolean -_gdk_win32_get_window_rect (GdkWindow *window, +_gdk_win32_get_window_rect (GdkSurface *window, RECT *rect) { - GdkWindowImplWin32 *window_impl; + GdkSurfaceImplWin32 *window_impl; RECT client_rect; POINT point; HWND hwnd; - window_impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + window_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - hwnd = GDK_WINDOW_HWND (window); + hwnd = GDK_SURFACE_HWND (window); GetClientRect (hwnd, &client_rect); point.x = client_rect.left; /* always 0 */ point.y = client_rect.top; /* top level windows need screen coords */ - if (gdk_window_get_parent (window) == NULL) + if (gdk_surface_get_parent (window) == NULL) { ClientToScreen (hwnd, &point); point.x += _gdk_offset_x * window_impl->window_scale; @@ -1564,10 +1564,10 @@ _gdk_win32_get_window_rect (GdkWindow *window, } void -_gdk_win32_do_emit_configure_event (GdkWindow *window, +_gdk_win32_do_emit_configure_event (GdkSurface *window, RECT rect) { - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); impl->unscaled_width = rect.right - rect.left; impl->unscaled_height = rect.bottom - rect.top; @@ -1576,7 +1576,7 @@ _gdk_win32_do_emit_configure_event (GdkWindow *window, window->x = rect.left / impl->window_scale; window->y = rect.top / impl->window_scale; - _gdk_window_update_size (window); + _gdk_surface_update_size (window); if (window->event_mask & GDK_STRUCTURE_MASK) { @@ -1595,7 +1595,7 @@ _gdk_win32_do_emit_configure_event (GdkWindow *window, } void -_gdk_win32_emit_configure_event (GdkWindow *window) +_gdk_win32_emit_configure_event (GdkSurface *window) { RECT rect; @@ -1662,13 +1662,13 @@ adjust_drag (LONG *drag, static void handle_wm_paint (MSG *msg, - GdkWindow *window) + GdkSurface *window) { HRGN hrgn = CreateRectRgn (0, 0, 0, 0); HDC hdc; PAINTSTRUCT paintstruct; cairo_region_t *update_region; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (GetUpdateRgn (msg->hwnd, hrgn, FALSE) == ERROR) { @@ -1696,7 +1696,7 @@ handle_wm_paint (MSG *msg, update_region = _gdk_win32_hrgn_to_region (hrgn, impl->window_scale); if (!cairo_region_is_empty (update_region)) - _gdk_window_invalidate_for_expose (window, update_region); + _gdk_surface_invalidate_for_expose (window, update_region); cairo_region_destroy (update_region); DeleteObject (hrgn); @@ -1767,13 +1767,13 @@ sync_timer_proc (HWND hwnd, static gboolean handle_nchittest (HWND hwnd, - GdkWindow *window, + GdkSurface *window, gint16 screen_x, gint16 screen_y, gint *ret_valp) { RECT rect; - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; if (window == NULL || window->input_shape == NULL) return FALSE; @@ -1781,13 +1781,13 @@ handle_nchittest (HWND hwnd, /* If the window has decorations, DefWindowProc() will take * care of NCHITTEST. */ - if (!_gdk_win32_window_lacks_wm_decorations (window)) + if (!_gdk_win32_surface_lacks_wm_decorations (window)) return FALSE; if (!GetWindowRect (hwnd, &rect)) return FALSE; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); rect.left = screen_x - rect.left; rect.top = screen_y - rect.top; @@ -1805,11 +1805,11 @@ handle_nchittest (HWND hwnd, } static void -handle_dpi_changed (GdkWindow *window, +handle_dpi_changed (GdkSurface *window, MSG *msg) { - HWND hwnd = GDK_WINDOW_HWND (window); - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + HWND hwnd = GDK_SURFACE_HWND (window); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); GdkDisplay *display = gdk_display_get_default (); GdkWin32Display *win32_display = GDK_WIN32_DISPLAY (display); GdkDevice *device = gdk_seat_get_pointer (gdk_display_get_default_seat (display)); @@ -1831,7 +1831,7 @@ handle_dpi_changed (GdkWindow *window, return; if (!IsIconic (msg->hwnd) && - !GDK_WINDOW_DESTROYED (window)) + !GDK_SURFACE_DESTROYED (window)) { GdkMonitor *monitor; @@ -1856,20 +1856,20 @@ handle_dpi_changed (GdkWindow *window, _gdk_win32_adjust_client_rect (window, rect); if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE) - gdk_window_move_resize (window, window->x, window->y, window->width, window->height); + gdk_surface_move_resize (window, window->x, window->y, window->width, window->height); else - gdk_window_resize (window, window->width, window->height); + gdk_surface_resize (window, window->width, window->height); } static void generate_button_event (GdkEventType type, gint button, - GdkWindow *window, + GdkSurface *window, MSG *msg) { GdkEvent *event = gdk_event_new (type); GdkDeviceManagerWin32 *device_manager; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (_gdk_input_ignore_core > 0) return; @@ -1899,15 +1899,15 @@ generate_button_event (GdkEventType type, * or not ontop. */ static gboolean -should_window_be_always_on_top (GdkWindow *window) +should_window_be_always_on_top (GdkSurface *window) { DWORD exstyle; - if ((GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP) || - (window->state & GDK_WINDOW_STATE_ABOVE)) + if ((GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP) || + (window->state & GDK_SURFACE_STATE_ABOVE)) return TRUE; - exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE); + exstyle = GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE); if (exstyle & WS_EX_TOPMOST) return TRUE; @@ -1920,7 +1920,7 @@ ensure_stacking_on_unminimize (MSG *msg) { HWND rover; HWND lowest_transient = NULL; - GdkWindow *msg_window; + GdkSurface *msg_window; gboolean window_ontop = FALSE; msg_window = gdk_win32_handle_table_lookup (msg->hwnd); @@ -1932,8 +1932,8 @@ ensure_stacking_on_unminimize (MSG *msg) rover; rover = GetNextWindow (rover, GW_HWNDNEXT)) { - GdkWindow *rover_gdkw = gdk_win32_handle_table_lookup (rover); - GdkWindowImplWin32 *rover_impl; + GdkSurface *rover_gdkw = gdk_win32_handle_table_lookup (rover); + GdkSurfaceImplWin32 *rover_impl; gboolean rover_ontop; /* Checking window group not implemented yet */ @@ -1941,11 +1941,11 @@ ensure_stacking_on_unminimize (MSG *msg) continue; rover_ontop = should_window_be_always_on_top (rover_gdkw); - rover_impl = GDK_WINDOW_IMPL_WIN32 (rover_gdkw->impl); + rover_impl = GDK_SURFACE_IMPL_WIN32 (rover_gdkw->impl); - if (GDK_WINDOW_IS_MAPPED (rover_gdkw) && - (rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY || - rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG || + if (GDK_SURFACE_IS_MAPPED (rover_gdkw) && + (rover_impl->type_hint == GDK_SURFACE_TYPE_HINT_UTILITY || + rover_impl->type_hint == GDK_SURFACE_TYPE_HINT_DIALOG || rover_impl->transient_owner != NULL) && ((window_ontop && rover_ontop) || (!window_ontop && !rover_ontop))) { @@ -1965,17 +1965,17 @@ ensure_stacking_on_unminimize (MSG *msg) static gboolean ensure_stacking_on_window_pos_changing (MSG *msg, - GdkWindow *window) + GdkSurface *window) { - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); WINDOWPOS *windowpos = (WINDOWPOS *) msg->lParam; HWND rover; gboolean restacking; gboolean window_ontop; if (GetActiveWindow () != msg->hwnd || - impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY || - impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG || + impl->type_hint == GDK_SURFACE_TYPE_HINT_UTILITY || + impl->type_hint == GDK_SURFACE_TYPE_HINT_DIALOG || impl->transient_owner != NULL) return FALSE; @@ -1993,8 +1993,8 @@ ensure_stacking_on_window_pos_changing (MSG *msg, rover; rover = GetNextWindow (rover, GW_HWNDNEXT)) { - GdkWindow *rover_gdkw = gdk_win32_handle_table_lookup (rover); - GdkWindowImplWin32 *rover_impl; + GdkSurface *rover_gdkw = gdk_win32_handle_table_lookup (rover); + GdkSurfaceImplWin32 *rover_impl; gboolean rover_ontop; /* Checking window group not implemented yet */ @@ -2003,11 +2003,11 @@ ensure_stacking_on_window_pos_changing (MSG *msg, continue; rover_ontop = should_window_be_always_on_top (rover_gdkw); - rover_impl = GDK_WINDOW_IMPL_WIN32 (rover_gdkw->impl); + rover_impl = GDK_SURFACE_IMPL_WIN32 (rover_gdkw->impl); - if (GDK_WINDOW_IS_MAPPED (rover_gdkw) && - (rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY || - rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG || + if (GDK_SURFACE_IS_MAPPED (rover_gdkw) && + (rover_impl->type_hint == GDK_SURFACE_TYPE_HINT_UTILITY || + rover_impl->type_hint == GDK_SURFACE_TYPE_HINT_DIALOG || rover_impl->transient_owner != NULL) && ((window_ontop && rover_ontop) || (!window_ontop && !rover_ontop))) { @@ -2029,14 +2029,14 @@ ensure_stacking_on_window_pos_changing (MSG *msg, static void ensure_stacking_on_activate_app (MSG *msg, - GdkWindow *window) + GdkSurface *window) { - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); HWND rover; gboolean window_ontop; - if (impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY || - impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG || + if (impl->type_hint == GDK_SURFACE_TYPE_HINT_UTILITY || + impl->type_hint == GDK_SURFACE_TYPE_HINT_DIALOG || impl->transient_owner != NULL) { SetWindowPos (msg->hwnd, HWND_TOP, 0, 0, 0, 0, @@ -2061,8 +2061,8 @@ ensure_stacking_on_activate_app (MSG *msg, rover; rover = GetNextWindow (rover, GW_HWNDPREV)) { - GdkWindow *rover_gdkw = gdk_win32_handle_table_lookup (rover); - GdkWindowImplWin32 *rover_impl; + GdkSurface *rover_gdkw = gdk_win32_handle_table_lookup (rover); + GdkSurfaceImplWin32 *rover_impl; gboolean rover_ontop; /* Checking window group not implemented yet */ @@ -2070,11 +2070,11 @@ ensure_stacking_on_activate_app (MSG *msg, continue; rover_ontop = should_window_be_always_on_top (rover_gdkw); - rover_impl = GDK_WINDOW_IMPL_WIN32 (rover_gdkw->impl); + rover_impl = GDK_SURFACE_IMPL_WIN32 (rover_gdkw->impl); - if (GDK_WINDOW_IS_MAPPED (rover_gdkw) && - (rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY || - rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG || + if (GDK_SURFACE_IS_MAPPED (rover_gdkw) && + (rover_impl->type_hint == GDK_SURFACE_TYPE_HINT_UTILITY || + rover_impl->type_hint == GDK_SURFACE_TYPE_HINT_DIALOG || rover_impl->transient_owner != NULL) && ((window_ontop && rover_ontop) || (!window_ontop && !rover_ontop))) { @@ -2089,14 +2089,14 @@ ensure_stacking_on_activate_app (MSG *msg, } static gboolean -handle_wm_sysmenu (GdkWindow *window, MSG *msg, gint *ret_valp) +handle_wm_sysmenu (GdkSurface *window, MSG *msg, gint *ret_valp) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; LONG_PTR style, tmp_style; gboolean maximized, minimized; LONG_PTR additional_styles; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); style = GetWindowLongPtr (msg->hwnd, GWL_STYLE); @@ -2136,7 +2136,7 @@ handle_wm_sysmenu (GdkWindow *window, MSG *msg, gint *ret_valp) * changing hints or properties. * * If doing this for non-CSD windows is not desired, - * do a _gdk_win32_window_lacks_wm_decorations() check and return FALSE + * do a _gdk_win32_surface_lacks_wm_decorations() check and return FALSE * if it doesn't pass. * * If doing this for CSD windows with disabled decorations is not desired, @@ -2166,16 +2166,16 @@ handle_wm_sysmenu (GdkWindow *window, MSG *msg, gint *ret_valp) } gboolean -_gdk_win32_window_fill_min_max_info (GdkWindow *window, +_gdk_win32_surface_fill_min_max_info (GdkSurface *window, MINMAXINFO *mmi) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; RECT rect; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return FALSE; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (impl->hint_flags & GDK_HINT_MIN_SIZE) { @@ -2229,7 +2229,7 @@ _gdk_win32_window_fill_min_max_info (GdkWindow *window, HMONITOR nearest_monitor; MONITORINFO nearest_info; - nearest_monitor = MonitorFromWindow (GDK_WINDOW_HWND (window), MONITOR_DEFAULTTONEAREST); + nearest_monitor = MonitorFromWindow (GDK_SURFACE_HWND (window), MONITOR_DEFAULTTONEAREST); nearest_info.cbSize = sizeof (nearest_info); if (GetMonitorInfoA (nearest_monitor, &nearest_info)) @@ -2254,7 +2254,7 @@ _gdk_win32_window_fill_min_max_info (GdkWindow *window, mmi->ptMaxPosition.x = 0; mmi->ptMaxPosition.y = 0; - if (_gdk_win32_window_lacks_wm_decorations (window)) + if (_gdk_win32_surface_lacks_wm_decorations (window)) { mmi->ptMaxPosition.x += (nearest_info.rcWork.left - nearest_info.rcMonitor.left); mmi->ptMaxPosition.y += (nearest_info.rcWork.top - nearest_info.rcMonitor.top); @@ -2297,17 +2297,17 @@ gdk_event_translate (MSG *msg, gint ccount; GdkDisplay *display; - GdkWindow *window = NULL; - GdkWindowImplWin32 *impl; + GdkSurface *window = NULL; + GdkSurfaceImplWin32 *impl; GdkWin32Display *win32_display; - GdkWindow *new_window; + GdkSurface *new_window; GdkDeviceManagerWin32 *device_manager_win32; GdkDeviceGrabInfo *keyboard_grab = NULL; GdkDeviceGrabInfo *pointer_grab = NULL; - GdkWindow *grab_window = NULL; + GdkSurface *grab_window = NULL; gint button; GdkAtom target; @@ -2348,12 +2348,12 @@ gdk_event_translate (MSG *msg, } else if (msg->message == WM_CREATE) { - window = (UNALIGNED GdkWindow*) (((LPCREATESTRUCTW) msg->lParam)->lpCreateParams); - GDK_WINDOW_HWND (window) = msg->hwnd; + window = (UNALIGNED GdkSurface*) (((LPCREATESTRUCTW) msg->lParam)->lpCreateParams); + GDK_SURFACE_HWND (window) = msg->hwnd; } else { - GDK_NOTE (EVENTS, g_print (" (no GdkWindow)")); + GDK_NOTE (EVENTS, g_print (" (no GdkSurface)")); } return FALSE; } @@ -2374,7 +2374,7 @@ gdk_event_translate (MSG *msg, */ #define return GOTO_DONE_INSTEAD - if (!GDK_WINDOW_DESTROYED (window) && window->filters) + if (!GDK_SURFACE_DESTROYED (window) && window->filters) { /* Apply per-window filters */ @@ -2424,7 +2424,7 @@ gdk_event_translate (MSG *msg, } if (msg->message == aerosnap_message) - _gdk_win32_window_handle_aerosnap (gdk_window_get_toplevel (window), + _gdk_win32_surface_handle_aerosnap (gdk_surface_get_toplevel (window), (GdkWin32AeroSnapCombo) msg->wParam); switch (msg->message) @@ -2501,10 +2501,10 @@ gdk_event_translate (MSG *msg, doesnt_want_key)) break; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) break; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); API_CALL (GetKeyboardState, (key_state)); @@ -2703,7 +2703,7 @@ gdk_event_translate (MSG *msg, doesnt_want_char)) break; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) break; himc = ImmGetContext (msg->hwnd); @@ -2771,12 +2771,12 @@ gdk_event_translate (MSG *msg, g_set_object (&window, find_window_for_mouse_event (window, msg)); /* TODO_CSW?: there used to some synthesize and propagate */ - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) break; if (pointer_grab == NULL) { - SetCapture (GDK_WINDOW_HWND (window)); + SetCapture (GDK_SURFACE_HWND (window)); } generate_button_event (GDK_BUTTON_PRESS, button, @@ -2817,7 +2817,7 @@ gdk_event_translate (MSG *msg, /* We keep the implicit grab until no buttons at all are held down */ if ((state & GDK_ANY_BUTTON_MASK & ~(GDK_BUTTON1_MASK << (button - 1))) == 0) { - GdkWindow *native_window = pointer_grab->native_window; + GdkSurface *native_window = pointer_grab->native_window; ReleaseCapture (); @@ -2848,12 +2848,12 @@ gdk_event_translate (MSG *msg, generate_button_event (GDK_BUTTON_RELEASE, button, window, msg); - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); /* End a drag op when the same button that started it is released */ if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE && impl->drag_move_resize_context.button == button) - gdk_win32_window_end_move_resize_drag (window); + gdk_win32_surface_end_move_resize_drag (window); return_val = TRUE; break; @@ -2892,8 +2892,8 @@ gdk_event_translate (MSG *msg, if (mouse_window != new_window) { GDK_NOTE (EVENTS, g_print (" mouse_sinwod %p -> %p", - mouse_window ? GDK_WINDOW_HWND (mouse_window) : NULL, - new_window ? GDK_WINDOW_HWND (new_window) : NULL)); + mouse_window ? GDK_SURFACE_HWND (mouse_window) : NULL, + new_window ? GDK_SURFACE_HWND (new_window) : NULL)); synthesize_crossing_events (display, mouse_window, new_window, GDK_CROSSING_NORMAL, @@ -2904,7 +2904,7 @@ gdk_event_translate (MSG *msg, g_set_object (&mouse_window, new_window); mouse_window_ignored_leave = NULL; if (new_window != NULL) - track_mouse_event (TME_LEAVE, GDK_WINDOW_HWND (new_window)); + track_mouse_event (TME_LEAVE, GDK_SURFACE_HWND (new_window)); } else if (new_window != NULL && new_window == mouse_window_ignored_leave) @@ -2913,11 +2913,11 @@ gdk_event_translate (MSG *msg, input again we need to re-arm the mouse tracking, as that was cancelled by the mouseleave. */ mouse_window_ignored_leave = NULL; - track_mouse_event (TME_LEAVE, GDK_WINDOW_HWND (new_window)); + track_mouse_event (TME_LEAVE, GDK_SURFACE_HWND (new_window)); } g_set_object (&window, find_window_for_mouse_event (window, msg)); - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); /* If we haven't moved, don't create any GDK event. Windows * sends WM_MOUSEMOVE messages after a new window is shows under @@ -2933,7 +2933,7 @@ gdk_event_translate (MSG *msg, if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE) { - gdk_win32_window_do_move_resize_drag (window, current_root_x, current_root_y); + gdk_win32_surface_do_move_resize_drag (window, current_root_x, current_root_y); } else if (_gdk_input_ignore_core == 0) { @@ -3052,7 +3052,7 @@ gdk_event_translate (MSG *msg, g_set_object (&window, new_window); } - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); ScreenToClient (msg->hwnd, &point); event = gdk_event_new (GDK_SCROLL); @@ -3119,14 +3119,14 @@ gdk_event_translate (MSG *msg, case WM_MOUSEACTIVATE: { - if (gdk_window_get_window_type (window) == GDK_WINDOW_TEMP + if (gdk_surface_get_window_type (window) == GDK_SURFACE_TEMP || !window->accept_focus) { *ret_valp = MA_NOACTIVATE; return_val = TRUE; } - if (_gdk_modal_blocked (gdk_window_get_toplevel (window))) + if (_gdk_modal_blocked (gdk_surface_get_toplevel (window))) { *ret_valp = MA_NOACTIVATEANDEAT; return_val = TRUE; @@ -3137,7 +3137,7 @@ gdk_event_translate (MSG *msg, case WM_KILLFOCUS: if (keyboard_grab != NULL && - !GDK_WINDOW_DESTROYED (keyboard_grab->window) && + !GDK_SURFACE_DESTROYED (keyboard_grab->window) && (_modal_operation_in_progress & GDK_WIN32_MODAL_OP_DND) == 0) { generate_grab_broken_event (_gdk_device_manager, keyboard_grab->window, TRUE, NULL); @@ -3152,7 +3152,7 @@ gdk_event_translate (MSG *msg, if (!(window->event_mask & GDK_FOCUS_CHANGE_MASK)) break; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) break; generate_focus_event (_gdk_device_manager, window, (msg->message == WM_SETFOCUS)); @@ -3162,7 +3162,7 @@ gdk_event_translate (MSG *msg, case WM_ERASEBKGND: GDK_NOTE (EVENTS, g_print (" %p", (HANDLE) msg->wParam)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) break; return_val = TRUE; @@ -3170,7 +3170,7 @@ gdk_event_translate (MSG *msg, break; case WM_SYNCPAINT: - sync_timer = SetTimer (GDK_WINDOW_HWND (window), + sync_timer = SetTimer (GDK_SURFACE_HWND (window), 1, 200, sync_timer_proc); break; @@ -3191,7 +3191,7 @@ gdk_event_translate (MSG *msg, if (grab_window != NULL) { - win32_display = GDK_WIN32_DISPLAY (gdk_window_get_display (grab_window)); + win32_display = GDK_WIN32_DISPLAY (gdk_surface_get_display (grab_window)); if (win32_display->grab_cursor != NULL) cursor = win32_display->grab_cursor; @@ -3213,19 +3213,19 @@ gdk_event_translate (MSG *msg, break; case WM_INITMENU: - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (impl->have_temp_styles) { LONG_PTR window_style; - window_style = GetWindowLongPtr (GDK_WINDOW_HWND (window), + window_style = GetWindowLongPtr (GDK_SURFACE_HWND (window), GWL_STYLE); /* Handling WM_SYSMENU added extra styles to this window, * remove them now. */ window_style &= ~impl->temp_styles; - SetWindowLongPtr (GDK_WINDOW_HWND (window), + SetWindowLongPtr (GDK_SURFACE_HWND (window), GWL_STYLE, window_style); } @@ -3240,7 +3240,7 @@ gdk_event_translate (MSG *msg, do_show_window (window, msg->wParam == SC_MINIMIZE ? TRUE : FALSE); break; case SC_MAXIMIZE: - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); impl->maximizing = TRUE; break; } @@ -3298,16 +3298,16 @@ gdk_event_translate (MSG *msg, _gdk_win32_end_modal_call (GDK_WIN32_MODAL_OP_SIZEMOVE_MASK); } - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE) - gdk_win32_window_end_move_resize_drag (window); + gdk_win32_surface_end_move_resize_drag (window); break; case WM_WINDOWPOSCHANGING: GDK_NOTE (EVENTS, (windowpos = (WINDOWPOS *) msg->lParam, g_print (" %s %s %dx%d@%+d%+d now below %p", - _gdk_win32_window_pos_bits_to_string (windowpos->flags), + _gdk_win32_surface_pos_bits_to_string (windowpos->flags), (windowpos->hwndInsertAfter == HWND_BOTTOM ? "BOTTOM" : (windowpos->hwndInsertAfter == HWND_NOTOPMOST ? "NOTOPMOST" : (windowpos->hwndInsertAfter == HWND_TOP ? "TOP" : @@ -3317,17 +3317,17 @@ gdk_event_translate (MSG *msg, windowpos->cx, windowpos->cy, windowpos->x, windowpos->y, GetNextWindow (msg->hwnd, GW_HWNDPREV)))); - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { return_val = ensure_stacking_on_window_pos_changing (msg, window); - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (impl->maximizing) { MINMAXINFO our_mmi; - if (_gdk_win32_window_fill_min_max_info (window, &our_mmi)) + if (_gdk_win32_surface_fill_min_max_info (window, &our_mmi)) { windowpos = (WINDOWPOS *) msg->lParam; windowpos->cx = our_mmi.ptMaxSize.x; @@ -3343,7 +3343,7 @@ gdk_event_translate (MSG *msg, case WM_WINDOWPOSCHANGED: windowpos = (WINDOWPOS *) msg->lParam; GDK_NOTE (EVENTS, g_print (" %s %s %dx%d@%+d%+d", - _gdk_win32_window_pos_bits_to_string (windowpos->flags), + _gdk_win32_surface_pos_bits_to_string (windowpos->flags), (windowpos->hwndInsertAfter == HWND_BOTTOM ? "BOTTOM" : (windowpos->hwndInsertAfter == HWND_NOTOPMOST ? "NOTOPMOST" : (windowpos->hwndInsertAfter == HWND_TOP ? "TOP" : @@ -3365,7 +3365,7 @@ gdk_event_translate (MSG *msg, /* Send MAP events */ if ((windowpos->flags & SWP_SHOWWINDOW) && - !GDK_WINDOW_DESTROYED (window)) + !GDK_SURFACE_DESTROYED (window)) { event = gdk_event_new (GDK_MAP); event->any.window = window; @@ -3375,7 +3375,7 @@ gdk_event_translate (MSG *msg, /* Update window state */ if (windowpos->flags & (SWP_STATECHANGED | SWP_SHOWWINDOW | SWP_HIDEWINDOW)) { - GdkWindowState set_bits, unset_bits, old_state, new_state; + GdkSurfaceState set_bits, unset_bits, old_state, new_state; old_state = window->state; @@ -3383,19 +3383,19 @@ gdk_event_translate (MSG *msg, unset_bits = 0; if (IsWindowVisible (msg->hwnd)) - unset_bits |= GDK_WINDOW_STATE_WITHDRAWN; + unset_bits |= GDK_SURFACE_STATE_WITHDRAWN; else - set_bits |= GDK_WINDOW_STATE_WITHDRAWN; + set_bits |= GDK_SURFACE_STATE_WITHDRAWN; if (IsIconic (msg->hwnd)) - set_bits |= GDK_WINDOW_STATE_ICONIFIED; + set_bits |= GDK_SURFACE_STATE_ICONIFIED; else - unset_bits |= GDK_WINDOW_STATE_ICONIFIED; + unset_bits |= GDK_SURFACE_STATE_ICONIFIED; if (IsZoomed (msg->hwnd)) - set_bits |= GDK_WINDOW_STATE_MAXIMIZED; + set_bits |= GDK_SURFACE_STATE_MAXIMIZED; else - unset_bits |= GDK_WINDOW_STATE_MAXIMIZED; + unset_bits |= GDK_SURFACE_STATE_MAXIMIZED; gdk_synthesize_window_state (window, unset_bits, set_bits); @@ -3405,15 +3405,15 @@ gdk_event_translate (MSG *msg, * change the iconified state in all transient related windows, * as windows doesn't give icons for transient childrens. */ - if ((old_state & GDK_WINDOW_STATE_ICONIFIED) != - (new_state & GDK_WINDOW_STATE_ICONIFIED)) - do_show_window (window, (new_state & GDK_WINDOW_STATE_ICONIFIED)); + if ((old_state & GDK_SURFACE_STATE_ICONIFIED) != + (new_state & GDK_SURFACE_STATE_ICONIFIED)) + do_show_window (window, (new_state & GDK_SURFACE_STATE_ICONIFIED)); /* When un-minimizing, make sure we're stacked under any transient-type windows. */ - if (!(old_state & GDK_WINDOW_STATE_ICONIFIED) && - (new_state & GDK_WINDOW_STATE_ICONIFIED)) + if (!(old_state & GDK_SURFACE_STATE_ICONIFIED) && + (new_state & GDK_SURFACE_STATE_ICONIFIED)) ensure_stacking_on_unminimize (msg); } @@ -3423,12 +3423,12 @@ gdk_event_translate (MSG *msg, (windowpos->flags & SWP_SHOWWINDOW)) { if (!IsIconic (msg->hwnd) && - !GDK_WINDOW_DESTROYED (window)) + !GDK_SURFACE_DESTROYED (window)) _gdk_win32_emit_configure_event (window); } if ((windowpos->flags & SWP_HIDEWINDOW) && - !GDK_WINDOW_DESTROYED (window)) + !GDK_SURFACE_DESTROYED (window)) { /* Send UNMAP events */ event = gdk_event_new (GDK_UNMAP); @@ -3436,11 +3436,11 @@ gdk_event_translate (MSG *msg, _gdk_win32_append_event (event); /* Make transient parent the forground window when window unmaps */ - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (impl->transient_owner && - GetForegroundWindow () == GDK_WINDOW_HWND (window)) - SetForegroundWindow (GDK_WINDOW_HWND (impl->transient_owner)); + GetForegroundWindow () == GDK_SURFACE_HWND (window)) + SetForegroundWindow (GDK_SURFACE_HWND (impl->transient_owner)); } if (!(windowpos->flags & SWP_NOCLIENTSIZE)) @@ -3459,7 +3459,7 @@ gdk_event_translate (MSG *msg, break; case WM_SIZING: - GetWindowRect (GDK_WINDOW_HWND (window), &rect); + GetWindowRect (GDK_SURFACE_HWND (window), &rect); drag = (RECT *) msg->lParam; GDK_NOTE (EVENTS, g_print (" %s curr:%s drag:%s", (msg->wParam == WMSZ_BOTTOM ? "BOTTOM" : @@ -3475,7 +3475,7 @@ gdk_event_translate (MSG *msg, _gdk_win32_rect_to_string (&rect), _gdk_win32_rect_to_string (drag))); - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); orig_drag = *drag; if (impl->hint_flags & GDK_HINT_RESIZE_INC) { @@ -3489,12 +3489,12 @@ gdk_event_translate (MSG *msg, _gdk_win32_adjust_client_rect (window, &rect); point.x = rect.left; point.y = rect.top; - ClientToScreen (GDK_WINDOW_HWND (window), &point); + ClientToScreen (GDK_SURFACE_HWND (window), &point); rect.left = point.x; rect.top = point.y; point.x = rect.right; point.y = rect.bottom; - ClientToScreen (GDK_WINDOW_HWND (window), &point); + ClientToScreen (GDK_SURFACE_HWND (window), &point); rect.right = point.x; rect.bottom = point.y; @@ -3577,7 +3577,7 @@ gdk_event_translate (MSG *msg, gdouble drag_aspect; int drag_width, drag_height, new_width, new_height; - GetClientRect (GDK_WINDOW_HWND (window), &rect); + GetClientRect (GDK_SURFACE_HWND (window), &rect); decorated_rect = rect; _gdk_win32_adjust_client_rect (window, &decorated_rect); @@ -3684,7 +3684,7 @@ gdk_event_translate (MSG *msg, mmi->ptMaxPosition.x, mmi->ptMaxPosition.y, mmi->ptMaxSize.x, mmi->ptMaxSize.y)); - if (_gdk_win32_window_fill_min_max_info (window, mmi)) + if (_gdk_win32_surface_fill_min_max_info (window, mmi)) { /* Don't call DefWindowProcW() */ GDK_NOTE (EVENTS, @@ -3701,7 +3701,7 @@ gdk_event_translate (MSG *msg, break; case WM_CLOSE: - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) break; event = gdk_event_new (GDK_DELETE); @@ -3709,11 +3709,11 @@ gdk_event_translate (MSG *msg, _gdk_win32_append_event (event); - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - if (impl->transient_owner && GetForegroundWindow() == GDK_WINDOW_HWND (window)) + if (impl->transient_owner && GetForegroundWindow() == GDK_SURFACE_HWND (window)) { - SetForegroundWindow (GDK_WINDOW_HWND (impl->transient_owner)); + SetForegroundWindow (GDK_SURFACE_HWND (impl->transient_owner)); } return_val = TRUE; @@ -3734,9 +3734,9 @@ gdk_event_translate (MSG *msg, } if ((window != NULL) && (msg->hwnd != GetDesktopWindow ())) - gdk_window_destroy_notify (window); + gdk_surface_destroy_notify (window); - if (window == NULL || GDK_WINDOW_DESTROYED (window)) + if (window == NULL || GDK_SURFACE_DESTROYED (window)) break; event = gdk_event_new (GDK_DESTROY); @@ -3749,7 +3749,7 @@ gdk_event_translate (MSG *msg, case WM_DWMCOMPOSITIONCHANGED: gdk_win32_display_check_composited (GDK_WIN32_DISPLAY (display)); - _gdk_win32_window_enable_transparency (window); + _gdk_win32_surface_enable_transparency (window); break; case WM_DESTROYCLIPBOARD: @@ -3877,17 +3877,17 @@ gdk_event_translate (MSG *msg, */ if (_gdk_modal_blocked (window) && LOWORD (msg->wParam) == WA_ACTIVE) { - GdkWindow *modal_current = _gdk_modal_current (); - SetActiveWindow (GDK_WINDOW_HWND (modal_current)); + GdkSurface *modal_current = _gdk_modal_current (); + SetActiveWindow (GDK_SURFACE_HWND (modal_current)); *ret_valp = 0; return_val = TRUE; break; } if (LOWORD (msg->wParam) == WA_INACTIVE) - gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FOCUSED, 0); + gdk_synthesize_window_state (window, GDK_SURFACE_STATE_FOCUSED, 0); else - gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FOCUSED); + gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_FOCUSED); /* Bring any tablet contexts to the top of the overlap order when * one of our windows is activated. @@ -3902,7 +3902,7 @@ gdk_event_translate (MSG *msg, GDK_NOTE (EVENTS, g_print (" %s thread: %" G_GINT64_FORMAT, msg->wParam ? "YES" : "NO", (gint64) msg->lParam)); - if (msg->wParam && GDK_WINDOW_IS_MAPPED (window)) + if (msg->wParam && GDK_SURFACE_IS_MAPPED (window)) ensure_stacking_on_activate_app (msg, window); break; case WM_NCHITTEST: diff --git a/gdk/win32/gdkgeometry-win32.c b/gdk/win32/gdkgeometry-win32.c index d748523bac..5e1c24d45f 100644 --- a/gdk/win32/gdkgeometry-win32.c +++ b/gdk/win32/gdkgeometry-win32.c @@ -25,8 +25,8 @@ * Bits are always scrolled correctly by ScrollWindowEx(), but * some big children may hit the coordinate boundary (i.e. * win32_x/win32_y < -16383) after scrolling. They needed to be moved - * back to the real position determined by gdk_window_compute_position(). - * This is handled in gdk_window_postmove(). + * back to the real position determined by gdk_surface_compute_position(). + * This is handled in gdk_surface_postmove(). * * The X11 version by Owen Taylor <otaylor@redhat.com> * Copyright Red Hat, Inc. 2000 @@ -44,43 +44,43 @@ #define SIZE_LIMIT 32767 -typedef struct _GdkWindowParentPos GdkWindowParentPos; +typedef struct _GdkSurfaceParentPos GdkSurfaceParentPos; static void -tmp_unset_bg (GdkWindow *window) +tmp_unset_bg (GdkSurface *window) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); impl->no_bg = TRUE; } static void -tmp_reset_bg (GdkWindow *window) +tmp_reset_bg (GdkSurface *window) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); impl->no_bg = FALSE; } void -_gdk_window_move_resize_child (GdkWindow *window, +_gdk_surface_move_resize_child (GdkSurface *window, gint x, gint y, gint width, gint height) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; g_return_if_fail (window != NULL); - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); - GDK_NOTE (MISC, g_print ("_gdk_window_move_resize_child: %s@%+d%+d %dx%d@%+d%+d\n", - _gdk_win32_window_description (window), + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); + GDK_NOTE (MISC, g_print ("_gdk_surface_move_resize_child: %s@%+d%+d %dx%d@%+d%+d\n", + _gdk_win32_surface_description (window), window->x, window->y, width, height, x, y)); if (width * impl->window_scale > 65535 || height * impl->window_scale > 65535) @@ -100,39 +100,39 @@ _gdk_window_move_resize_child (GdkWindow *window, impl->unscaled_width = width * impl->window_scale; impl->unscaled_height = height * impl->window_scale; - _gdk_win32_window_tmp_unset_parent_bg (window); - _gdk_win32_window_tmp_unset_bg (window, TRUE); + _gdk_win32_surface_tmp_unset_parent_bg (window); + _gdk_win32_surface_tmp_unset_bg (window, TRUE); GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,%d,%d," "NOACTIVATE|NOZORDER)\n", - GDK_WINDOW_HWND (window), + GDK_SURFACE_HWND (window), (window->x + window->parent->abs_x) * impl->window_scale, (window->y + window->parent->abs_y) * impl->window_scale, impl->unscaled_width, impl->unscaled_height)); - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), NULL, + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), NULL, (window->x + window->parent->abs_x) * impl->window_scale, (window->y + window->parent->abs_y) * impl->window_scale, impl->unscaled_width, impl->unscaled_height, SWP_NOACTIVATE | SWP_NOZORDER)); - _gdk_win32_window_tmp_reset_bg (window, TRUE); + _gdk_win32_surface_tmp_reset_bg (window, TRUE); } void -_gdk_win32_window_tmp_unset_bg (GdkWindow *window, +_gdk_win32_surface_tmp_unset_bg (GdkSurface *window, gboolean recurse) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (window->input_only || window->destroyed || !GDK_WINDOW_IS_MAPPED (window)) + if (window->input_only || window->destroyed || !GDK_SURFACE_IS_MAPPED (window)) return; - if (_gdk_window_has_impl (window) && - GDK_WINDOW_IS_WIN32 (window) && - window->window_type != GDK_WINDOW_FOREIGN) + if (_gdk_surface_has_impl (window) && + GDK_SURFACE_IS_WIN32 (window) && + window->window_type != GDK_SURFACE_FOREIGN) tmp_unset_bg (window); if (recurse) @@ -140,32 +140,32 @@ _gdk_win32_window_tmp_unset_bg (GdkWindow *window, GList *l; for (l = window->children; l != NULL; l = l->next) - _gdk_win32_window_tmp_unset_bg (l->data, TRUE); + _gdk_win32_surface_tmp_unset_bg (l->data, TRUE); } } void -_gdk_win32_window_tmp_unset_parent_bg (GdkWindow *window) +_gdk_win32_surface_tmp_unset_parent_bg (GdkSurface *window) { if (window->parent == NULL) return; - window = _gdk_window_get_impl_window (window->parent); - _gdk_win32_window_tmp_unset_bg (window, FALSE); + window = _gdk_surface_get_impl_window (window->parent); + _gdk_win32_surface_tmp_unset_bg (window, FALSE); } void -_gdk_win32_window_tmp_reset_bg (GdkWindow *window, +_gdk_win32_surface_tmp_reset_bg (GdkSurface *window, gboolean recurse) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (window->input_only || window->destroyed || !GDK_WINDOW_IS_MAPPED (window)) + if (window->input_only || window->destroyed || !GDK_SURFACE_IS_MAPPED (window)) return; - if (_gdk_window_has_impl (window) && - GDK_WINDOW_IS_WIN32 (window) && - window->window_type != GDK_WINDOW_FOREIGN) + if (_gdk_surface_has_impl (window) && + GDK_SURFACE_IS_WIN32 (window) && + window->window_type != GDK_SURFACE_FOREIGN) { tmp_reset_bg (window); } @@ -175,6 +175,6 @@ _gdk_win32_window_tmp_reset_bg (GdkWindow *window, GList *l; for (l = window->children; l != NULL; l = l->next) - _gdk_win32_window_tmp_reset_bg (l->data, TRUE); + _gdk_win32_surface_tmp_reset_bg (l->data, TRUE); } } diff --git a/gdk/win32/gdkglcontext-win32.c b/gdk/win32/gdkglcontext-win32.c index c8fad5ce1e..d406080968 100644 --- a/gdk/win32/gdkglcontext-win32.c +++ b/gdk/win32/gdkglcontext-win32.c @@ -49,7 +49,7 @@ _gdk_win32_gl_context_dispose (GObject *gobject) GdkGLContext *context = GDK_GL_CONTEXT (gobject); GdkWin32GLContext *context_win32 = GDK_WIN32_GL_CONTEXT (gobject); GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (gdk_gl_context_get_display (context)); - GdkWindow *window = gdk_gl_context_get_window (context); + GdkSurface *window = gdk_gl_context_get_window (context); if (context_win32->hglrc != NULL) { @@ -66,7 +66,7 @@ _gdk_win32_gl_context_dispose (GObject *gobject) if (window != NULL && window->impl != NULL) { - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (impl->suppress_layered > 0) impl->suppress_layered--; @@ -75,18 +75,18 @@ _gdk_win32_gl_context_dispose (GObject *gobject) * trigger update_style_bits() to enable layered windows again */ if (impl->suppress_layered == 0) - _gdk_win32_window_update_style_bits (window); + _gdk_win32_surface_update_style_bits (window); } G_OBJECT_CLASS (gdk_win32_gl_context_parent_class)->dispose (gobject); } static void -gdk_gl_blit_region (GdkWindow *window, cairo_region_t *region) +gdk_gl_blit_region (GdkSurface *window, cairo_region_t *region) { int n_rects, i; - int scale = gdk_window_get_scale_factor (window); - int wh = gdk_window_get_height (window); + int scale = gdk_surface_get_scale_factor (window); + int wh = gdk_surface_get_height (window); cairo_rectangle_int_t rect; n_rects = cairo_region_num_rectangles (region); @@ -107,7 +107,7 @@ gdk_win32_gl_context_end_frame (GdkDrawContext *draw_context, { GdkGLContext *context = GDK_GL_CONTEXT (draw_context); GdkWin32GLContext *context_win32 = GDK_WIN32_GL_CONTEXT (context); - GdkWindow *window = gdk_gl_context_get_window (context); + GdkSurface *window = gdk_gl_context_get_window (context); GdkWin32Display *display = (GDK_WIN32_DISPLAY (gdk_gl_context_get_display (context))); gboolean can_wait = display->hasWglOMLSyncControl; cairo_rectangle_int_t whole_window; @@ -138,7 +138,7 @@ gdk_win32_gl_context_end_frame (GdkDrawContext *draw_context, } } - whole_window = (GdkRectangle) { 0, 0, gdk_window_get_width (window), gdk_window_get_height (window) }; + whole_window = (GdkRectangle) { 0, 0, gdk_surface_get_width (window), gdk_surface_get_height (window) }; if (cairo_region_contains_rectangle (painted, &whole_window) == CAIRO_REGION_OVERLAP_IN) { SwapBuffers (context_win32->gl_hdc); @@ -166,7 +166,7 @@ gdk_win32_gl_context_begin_frame (GdkDrawContext *draw_context, cairo_region_t *update_area) { GdkGLContext *context = GDK_GL_CONTEXT (draw_context); - GdkWindow *window; + GdkSurface *window; GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_parent_class)->begin_frame (draw_context, update_area); if (gdk_gl_context_get_shared_context (context)) @@ -180,8 +180,8 @@ gdk_win32_gl_context_begin_frame (GdkDrawContext *draw_context, window = gdk_gl_context_get_window (context); cairo_region_union_rectangle (update_area, &(GdkRectangle) { 0, 0, - gdk_window_get_width (window), - gdk_window_get_height (window) }); + gdk_surface_get_width (window), + gdk_surface_get_height (window) }); } typedef struct @@ -647,9 +647,9 @@ gdk_win32_gl_context_realize (GdkGLContext *context, gint glver_major = 0; gint glver_minor = 0; - GdkWindow *window = gdk_gl_context_get_window (context); - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); - GdkWin32Display *win32_display = GDK_WIN32_DISPLAY (gdk_window_get_display (window)); + GdkSurface *window = gdk_gl_context_get_window (context); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); + GdkWin32Display *win32_display = GDK_WIN32_DISPLAY (gdk_surface_get_display (window)); if (!_set_pixformat_for_hdc (context_win32->gl_hdc, &pixel_format, @@ -723,7 +723,7 @@ gdk_win32_gl_context_realize (GdkGLContext *context, * disable layered windows by triggering update_style_bits() */ if (impl->suppress_layered == 1) - _gdk_win32_window_update_style_bits (window); + _gdk_win32_surface_update_style_bits (window); /* Ensure that any other context is created with a legacy bit set */ gdk_gl_context_set_is_legacy (context, legacy_bit); @@ -752,13 +752,13 @@ gdk_win32_gl_context_init (GdkWin32GLContext *self) } GdkGLContext * -_gdk_win32_window_create_gl_context (GdkWindow *window, +_gdk_win32_surface_create_gl_context (GdkSurface *window, gboolean attached, GdkGLContext *share, GError **error) { - GdkDisplay *display = gdk_window_get_display (window); - GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (gdk_window_get_display (window)); + GdkDisplay *display = gdk_surface_get_display (window); + GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (gdk_surface_get_display (window)); GdkWin32GLContext *context = NULL; /* Acquire and store up the Windows-specific HWND and HDC */ @@ -773,7 +773,7 @@ _gdk_win32_window_create_gl_context (GdkWindow *window, return NULL; } - hwnd = GDK_WINDOW_HWND (window); + hwnd = GDK_SURFACE_HWND (window); hdc = GetDC (hwnd); display_win32->gl_hwnd = hwnd; @@ -795,7 +795,7 @@ _gdk_win32_display_make_gl_context_current (GdkDisplay *display, { GdkWin32GLContext *context_win32; GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (display); - GdkWindow *window; + GdkSurface *window; gboolean do_frame_sync = FALSE; @@ -822,7 +822,7 @@ _gdk_win32_display_make_gl_context_current (GdkDisplay *display, * the swap when drawing on the offscreen, rendering to the screen * happens later anyway, and its up to the compositor to sync that * to the vblank. */ - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); do_frame_sync = ! gdk_display_is_composited (display); if (do_frame_sync != context_win32->do_frame_sync) diff --git a/gdk/win32/gdkglcontext-win32.h b/gdk/win32/gdkglcontext-win32.h index 88bc970a95..77b656592a 100644 --- a/gdk/win32/gdkglcontext-win32.h +++ b/gdk/win32/gdkglcontext-win32.h @@ -51,7 +51,7 @@ struct _GdkWin32GLContextClass }; GdkGLContext * -_gdk_win32_window_create_gl_context (GdkWindow *window, +_gdk_win32_surface_create_gl_context (GdkSurface *window, gboolean attached, GdkGLContext *share, GError **error); diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c index 078b0dc0dd..49d30a3096 100644 --- a/gdk/win32/gdkmain-win32.c +++ b/gdk/win32/gdkmain-win32.c @@ -67,7 +67,7 @@ const GOptionEntry _gdk_windowing_args[] = { }; void -_gdk_win32_windowing_init (void) +_gdk_win32_surfaceing_init (void) { gchar buf[10]; @@ -283,7 +283,7 @@ _gdk_win32_drag_protocol_to_string (GdkDragProtocol protocol) } gchar * -_gdk_win32_window_state_to_string (GdkWindowState state) +_gdk_win32_surface_state_to_string (GdkSurfaceState state) { gchar buf[100]; gchar *bufp = buf; @@ -292,11 +292,11 @@ _gdk_win32_window_state_to_string (GdkWindowState state) buf[0] = '\0'; #define BIT(x) \ - if (state & GDK_WINDOW_STATE_ ## x) \ + if (state & GDK_SURFACE_STATE_ ## x) \ (bufp += sprintf (bufp, "%s" #x, s), s = "|") /* For clarity, also show the complement of WITHDRAWN, i.e. "MAPPED" */ - if (!(state & GDK_WINDOW_STATE_WITHDRAWN)) + if (!(state & GDK_SURFACE_STATE_WITHDRAWN)) (bufp += sprintf (bufp, "MAPPED"), s = "|"); BIT (WITHDRAWN); @@ -309,7 +309,7 @@ _gdk_win32_window_state_to_string (GdkWindowState state) } gchar * -_gdk_win32_window_style_to_string (LONG style) +_gdk_win32_surface_style_to_string (LONG style) { gchar buf[1000]; gchar *bufp = buf; @@ -351,7 +351,7 @@ _gdk_win32_window_style_to_string (LONG style) } gchar * -_gdk_win32_window_exstyle_to_string (LONG style) +_gdk_win32_surface_exstyle_to_string (LONG style) { gchar buf[1000]; gchar *bufp = buf; @@ -397,7 +397,7 @@ _gdk_win32_window_exstyle_to_string (LONG style) } gchar * -_gdk_win32_window_pos_bits_to_string (UINT flags) +_gdk_win32_surface_pos_bits_to_string (UINT flags) { gchar buf[1000]; gchar *bufp = buf; @@ -914,15 +914,15 @@ _gdk_win32_cairo_region_to_string (const cairo_region_t *rgn) } gchar * -_gdk_win32_window_description (GdkWindow *d) +_gdk_win32_surface_description (GdkSurface *d) { - g_return_val_if_fail (GDK_IS_WINDOW (d), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (d), NULL); return static_printf ("%s:%p:%dx%d", G_OBJECT_TYPE_NAME (d), - GDK_WINDOW_HWND (d), - gdk_window_get_width (GDK_WINDOW (d)), - gdk_window_get_height (GDK_WINDOW (d))); + GDK_SURFACE_HWND (d), + gdk_surface_get_width (GDK_SURFACE (d)), + gdk_surface_get_height (GDK_SURFACE (d))); } #endif /* G_ENABLE_DEBUG */ diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h index d74a720461..8249a60b65 100644 --- a/gdk/win32/gdkprivate-win32.h +++ b/gdk/win32/gdkprivate-win32.h @@ -123,9 +123,9 @@ #define GDK_DEBUG_EVENTS_OR_INPUT (GDK_DEBUG_EVENTS|GDK_DEBUG_INPUT) #define GDK_DEBUG_MISC_OR_EVENTS (GDK_DEBUG_MISC|GDK_DEBUG_EVENTS) -GdkWin32Screen *GDK_WINDOW_SCREEN(GObject *win); +GdkWin32Screen *GDK_SURFACE_SCREEN(GObject *win); -#define GDK_WINDOW_IS_WIN32(win) (GDK_IS_WINDOW_IMPL_WIN32 (win->impl)) +#define GDK_SURFACE_IS_WIN32(win) (GDK_IS_SURFACE_IMPL_WIN32 (win->impl)) typedef struct _GdkWin32SingleFont GdkWin32SingleFont; @@ -154,21 +154,21 @@ GType _gdk_gc_win32_get_type (void); gulong _gdk_win32_get_next_tick (gulong suggested_tick); -void _gdk_window_init_position (GdkWindow *window); -void _gdk_window_move_resize_child (GdkWindow *window, +void _gdk_surface_init_position (GdkSurface *window); +void _gdk_surface_move_resize_child (GdkSurface *window, gint x, gint y, gint width, gint height); -gboolean _gdk_win32_window_enable_transparency (GdkWindow *window); +gboolean _gdk_win32_surface_enable_transparency (GdkSurface *window); -/* GdkWindowImpl methods */ -void _gdk_win32_window_scroll (GdkWindow *window, +/* GdkSurfaceImpl methods */ +void _gdk_win32_surface_scroll (GdkSurface *window, gint dx, gint dy); -void _gdk_win32_window_move_region (GdkWindow *window, +void _gdk_win32_surface_move_region (GdkSurface *window, const cairo_region_t *region, gint dx, gint dy); @@ -188,17 +188,17 @@ HRGN _gdk_win32_cairo_region_to_hrgn (const cairo_region_t *region, cairo_region_t *_gdk_win32_hrgn_to_region (HRGN hrgn, guint scale); -void _gdk_win32_adjust_client_rect (GdkWindow *window, +void _gdk_win32_adjust_client_rect (GdkSurface *window, RECT *RECT); -void _gdk_selection_property_delete (GdkWindow *); +void _gdk_selection_property_delete (GdkSurface *); void _gdk_dropfiles_store (gchar *data); -void _gdk_push_modal_window (GdkWindow *window); -void _gdk_remove_modal_window (GdkWindow *window); -GdkWindow *_gdk_modal_current (void); -gboolean _gdk_modal_blocked (GdkWindow *window); +void _gdk_push_modal_window (GdkSurface *window); +void _gdk_remove_modal_window (GdkSurface *window); +GdkSurface *_gdk_modal_current (void); +gboolean _gdk_modal_blocked (GdkSurface *window); #ifdef G_ENABLE_DEBUG void _gdk_win32_print_paletteentries (const PALETTEENTRY *pep, @@ -208,12 +208,12 @@ void _gdk_win32_print_hpalette (HPALETTE hpal); void _gdk_win32_print_dc (HDC hdc); gchar *_gdk_win32_drag_protocol_to_string (GdkDragProtocol protocol); -gchar *_gdk_win32_window_state_to_string (GdkWindowState state); -gchar *_gdk_win32_window_style_to_string (LONG style); -gchar *_gdk_win32_window_exstyle_to_string (LONG style); -gchar *_gdk_win32_window_pos_bits_to_string (UINT flags); +gchar *_gdk_win32_surface_state_to_string (GdkSurfaceState state); +gchar *_gdk_win32_surface_style_to_string (LONG style); +gchar *_gdk_win32_surface_exstyle_to_string (LONG style); +gchar *_gdk_win32_surface_pos_bits_to_string (UINT flags); gchar *_gdk_win32_drag_action_to_string (GdkDragAction actions); -gchar *_gdk_win32_window_description (GdkWindow *d); +gchar *_gdk_win32_surface_description (GdkSurface *d); gchar *_gdk_win32_rop2_to_string (int rop2); gchar *_gdk_win32_lbstyle_to_string (UINT brush_style); @@ -254,7 +254,7 @@ void _gdk_other_api_failed (const gchar *where, #define GDI_CALL(api, arglist) (api arglist ? 1 : (WIN32_GDI_FAILED (#api), 0)) #define API_CALL(api, arglist) (api arglist ? 1 : (WIN32_API_FAILED (#api), 0)) -extern LRESULT CALLBACK _gdk_win32_window_procedure (HWND, UINT, WPARAM, LPARAM); +extern LRESULT CALLBACK _gdk_win32_surface_procedure (HWND, UINT, WPARAM, LPARAM); extern GdkDisplay *_gdk_display; @@ -375,23 +375,23 @@ gboolean _gdk_win32_display_has_pending (GdkDisplay *display); void _gdk_win32_display_queue_events (GdkDisplay *display); gboolean _gdk_win32_selection_owner_set_for_display (GdkDisplay *display, - GdkWindow *owner, + GdkSurface *owner, GdkAtom selection, guint32 time, gboolean send_event); void _gdk_win32_display_send_selection_notify (GdkDisplay *display, - GdkWindow *requestor, + GdkSurface *requestor, GdkAtom selection, GdkAtom target, GdkAtom property, guint32 time); gint _gdk_win32_display_get_selection_property (GdkDisplay *display, - GdkWindow *requestor, + GdkSurface *requestor, guchar **data, GdkAtom *ret_type, gint *ret_format); void _gdk_win32_display_convert_selection (GdkDisplay *display, - GdkWindow *requestor, + GdkSurface *requestor, GdkAtom selection, GdkAtom target, guint32 time); @@ -413,14 +413,14 @@ void _gdk_win32_keymap_set_active_layout (GdkWin32Keymap *keymap, GdkKeymap *_gdk_win32_display_get_keymap (GdkDisplay *display); void _gdk_win32_display_create_window_impl (GdkDisplay *display, - GdkWindow *window, - GdkWindow *real_parent, + GdkSurface *window, + GdkSurface *real_parent, GdkEventMask event_mask, - GdkWindowAttr *attributes); + GdkSurfaceAttr *attributes); -/* stray GdkWindowImplWin32 members */ -void _gdk_win32_window_register_dnd (GdkWindow *window); -GdkDragContext *_gdk_win32_window_drag_begin (GdkWindow *window, +/* stray GdkSurfaceImplWin32 members */ +void _gdk_win32_surface_register_dnd (GdkSurface *window); +GdkDragContext *_gdk_win32_surface_drag_begin (GdkSurface *window, GdkDevice *device, GdkContentFormats *formats, GdkDragAction actions, @@ -430,8 +430,8 @@ GdkDragContext *_gdk_win32_window_drag_begin (GdkWindow *window, /* Stray GdkWin32Screen members */ gboolean _gdk_win32_get_setting (const gchar *name, GValue *value); void _gdk_win32_screen_on_displaychange_event (GdkWin32Screen *screen); -GdkWindow *gdk_win32_screen_get_root_window (GdkWin32Screen *screen); -GdkWindow *gdk_win32_display_get_root_window (GdkDisplay *display); +GdkSurface *gdk_win32_screen_get_root_window (GdkWin32Screen *screen); +GdkSurface *gdk_win32_display_get_root_window (GdkDisplay *display); /* Distributed display manager implementation */ GdkDisplay *_gdk_win32_display_open (const gchar *display_name); @@ -441,32 +441,32 @@ GdkAtom _gdk_win32_display_manager_atom_intern (GdkDisplayManager *manager, gchar *_gdk_win32_display_manager_get_atom_name (GdkDisplayManager *manager, GdkAtom atom); void _gdk_win32_append_event (GdkEvent *event); -void _gdk_win32_emit_configure_event (GdkWindow *window); +void _gdk_win32_emit_configure_event (GdkSurface *window); guint32 _gdk_win32_keymap_get_decimal_mark (GdkWin32Keymap *keymap); -void _gdk_win32_window_handle_aerosnap (GdkWindow *window, +void _gdk_win32_surface_handle_aerosnap (GdkSurface *window, GdkWin32AeroSnapCombo combo); -gboolean _gdk_win32_get_window_rect (GdkWindow *window, +gboolean _gdk_win32_get_window_rect (GdkSurface *window, RECT *rect); -void _gdk_win32_do_emit_configure_event (GdkWindow *window, +void _gdk_win32_do_emit_configure_event (GdkSurface *window, RECT rect); -void gdk_win32_window_do_move_resize_drag (GdkWindow *window, +void gdk_win32_surface_do_move_resize_drag (GdkSurface *window, gint x, gint y); -void gdk_win32_window_end_move_resize_drag (GdkWindow *window); -gboolean _gdk_win32_window_fill_min_max_info (GdkWindow *window, +void gdk_win32_surface_end_move_resize_drag (GdkSurface *window); +gboolean _gdk_win32_surface_fill_min_max_info (GdkSurface *window, MINMAXINFO *mmi); -gboolean _gdk_win32_window_lacks_wm_decorations (GdkWindow *window); +gboolean _gdk_win32_surface_lacks_wm_decorations (GdkSurface *window); -BOOL WINAPI GtkShowWindow (GdkWindow *window, +BOOL WINAPI GtkShowWindow (GdkSurface *window, int cmd_show); /* Initialization */ -void _gdk_win32_windowing_init (void); +void _gdk_win32_surfaceing_init (void); void _gdk_dnd_init (void); void _gdk_events_init (GdkDisplay *display); diff --git a/gdk/win32/gdkscreen-win32.c b/gdk/win32/gdkscreen-win32.c index 9e8b21b665..14cf749f8a 100644 --- a/gdk/win32/gdkscreen-win32.c +++ b/gdk/win32/gdkscreen-win32.c @@ -51,7 +51,7 @@ init_root_window_size (GdkWin32Screen *screen) GdkDisplay *display = _gdk_display; int monitor_count; GdkMonitor *monitor; - GdkWindowImplWin32 *root_impl; + GdkSurfaceImplWin32 *root_impl; monitor_count = gdk_display_get_n_monitors (display); monitor = gdk_display_get_monitor (display, 0); diff --git a/gdk/win32/gdkselection-win32.c b/gdk/win32/gdkselection-win32.c index d3b0948b73..3750eca629 100644 --- a/gdk/win32/gdkselection-win32.c +++ b/gdk/win32/gdkselection-win32.c @@ -76,7 +76,7 @@ S:_gtk_selection_request() event handler, which calls S:gtk_selection_invoke_handler() to get the data, and then calls -S:gdk_property_change() (_gdk_x11_window_change_property()) +S:gdk_property_change() (_gdk_x11_surface_change_property()) to submit the data, by setting the property given by the message sender (GDK_SELECTION) on the requestor window (our client clipboard window). @@ -194,7 +194,7 @@ S:_gtk_selection_request() event handler, which calls S:gtk_selection_invoke_handler() to get the data, and then calls -S:gdk_property_change() (_gdk_win32_window_change_property()) +S:gdk_property_change() (_gdk_win32_surface_change_property()) to submit the data, by first transmuting it to the format actually requested by the sender of WM_RENDERFORMAT, and then by returning thedata back up the stack, to the WM_RENDERFORMAT handler, which then calls @@ -253,7 +253,7 @@ DND: GDK-Win32: S:idataobject_getdata() sends a GDK_SELECTION_REQUEST event, which results in a call to -S:_gdk_win32_window_change_property() +S:_gdk_win32_surface_change_property() which passes clipboard data back via the selection singleton. GDK-Win32 uses delayed rendering for all formats, even text. @@ -304,7 +304,7 @@ enum _GdkWin32ClipboardQueueAction struct _GdkWin32ClipboardQueueInfo { GdkDisplay *display; - GdkWindow *requestor; + GdkSurface *requestor; GdkAtom selection; GdkAtom target; guint32 time; @@ -747,7 +747,7 @@ _gdk_utf8_to_string_target_internal (const gchar *str, } static void -selection_property_store (GdkWindow *owner, +selection_property_store (GdkSurface *owner, GdkAtom type, gint format, guchar *data, @@ -756,13 +756,13 @@ selection_property_store (GdkWindow *owner, GdkSelProp *prop; GdkWin32Selection *win32_sel = _gdk_win32_selection_get (); - prop = g_hash_table_lookup (win32_sel->sel_prop_table, GDK_WINDOW_HWND (owner)); + prop = g_hash_table_lookup (win32_sel->sel_prop_table, GDK_SURFACE_HWND (owner)); if (prop != NULL) { g_free (prop->data); g_free (prop); - g_hash_table_remove (win32_sel->sel_prop_table, GDK_WINDOW_HWND (owner)); + g_hash_table_remove (win32_sel->sel_prop_table, GDK_SURFACE_HWND (owner)); } prop = g_new (GdkSelProp, 1); @@ -772,7 +772,7 @@ selection_property_store (GdkWindow *owner, prop->bitness = format; prop->target = type; - g_hash_table_insert (win32_sel->sel_prop_table, GDK_WINDOW_HWND (owner), prop); + g_hash_table_insert (win32_sel->sel_prop_table, GDK_SURFACE_HWND (owner), prop); } void @@ -802,7 +802,7 @@ _gdk_dropfiles_store (gchar *data) } static void -generate_selection_notify (GdkWindow *requestor, +generate_selection_notify (GdkSurface *requestor, GdkAtom selection, GdkAtom target, GdkAtom property, @@ -860,7 +860,7 @@ _gdk_win32_clear_clipboard_queue () static void send_targets_request (guint time) { - GdkWindow *owner; + GdkSurface *owner; GdkEvent tmp_event; GdkWin32Selection *win32_sel = _gdk_win32_selection_get (); @@ -875,9 +875,9 @@ send_targets_request (guint time) if (win32_sel->clipboard_opened_for == INVALID_HANDLE_VALUE) { - if (OpenClipboard (GDK_WINDOW_HWND (owner))) + if (OpenClipboard (GDK_SURFACE_HWND (owner))) { - win32_sel->clipboard_opened_for = GDK_WINDOW_HWND (owner); + win32_sel->clipboard_opened_for = GDK_SURFACE_HWND (owner); GDK_NOTE (DND, g_print ("Opened clipboard for 0x%p @ %s:%d\n", win32_sel->clipboard_opened_for, __FILE__, __LINE__)); } } @@ -1687,7 +1687,7 @@ transmute_selection_target (GdkAtom from_target, } static GdkAtom -convert_clipboard_selection_to_targets_target (GdkWindow *requestor) +convert_clipboard_selection_to_targets_target (GdkSurface *requestor) { gint fmt; int i; @@ -1732,7 +1732,7 @@ convert_clipboard_selection_to_targets_target (GdkWindow *requestor) } static GdkAtom -convert_clipboard_selection_to_target (GdkWindow *requestor, +convert_clipboard_selection_to_target (GdkSurface *requestor, GdkAtom target) { UINT format; @@ -1814,7 +1814,7 @@ convert_clipboard_selection_to_target (GdkWindow *requestor, static GdkAtom convert_selection_with_opened_clipboard (GdkDisplay *display, - GdkWindow *requestor, + GdkSurface *requestor, GdkAtom target, guint32 time) { @@ -1860,7 +1860,7 @@ open_clipboard_timeout (gpointer data) info = (GdkWin32ClipboardQueueInfo *) tmp_list->data; next = g_list_next (tmp_list); - if (GDK_WINDOW_DESTROYED (info->requestor) || + if (GDK_SURFACE_DESTROYED (info->requestor) || info->idle_time >= CLIPBOARD_IDLE_ABORT_TIME) { clipboard_queue = g_list_remove_link (clipboard_queue, tmp_list); @@ -1913,12 +1913,12 @@ open_clipboard_timeout (gpointer data) if (win32_sel->clipboard_opened_for == INVALID_HANDLE_VALUE) { - if (!OpenClipboard (GDK_WINDOW_HWND (info->requestor))) + if (!OpenClipboard (GDK_SURFACE_HWND (info->requestor))) { info->idle_time += 1; continue; } - win32_sel->clipboard_opened_for = GDK_WINDOW_HWND (info->requestor); + win32_sel->clipboard_opened_for = GDK_SURFACE_HWND (info->requestor); GDK_NOTE (DND, g_print ("Opened clipboard for 0x%p @ %s:%d\n", win32_sel->clipboard_opened_for, __FILE__, __LINE__)); } @@ -1967,7 +1967,7 @@ open_clipboard_timeout (gpointer data) static void queue_open_clipboard (GdkWin32ClipboardQueueAction action, GdkDisplay *display, - GdkWindow *requestor, + GdkSurface *requestor, GdkAtom target, guint32 time) { @@ -2011,7 +2011,7 @@ queue_open_clipboard (GdkWin32ClipboardQueueAction action, gboolean _gdk_win32_display_set_selection_owner (GdkDisplay *display, - GdkWindow *owner, + GdkSurface *owner, GdkAtom selection, guint32 time, gboolean send_event) @@ -2025,14 +2025,14 @@ _gdk_win32_display_set_selection_owner (GdkDisplay *display, const char *sel_name = (const char *)selection; g_print ("gdk_selection_owner_set_for_display: %p %s\n", - (owner ? GDK_WINDOW_HWND (owner) : NULL), + (owner ? GDK_SURFACE_HWND (owner) : NULL), sel_name); }); if (selection != GDK_SELECTION_CLIPBOARD) { if (owner != NULL) - g_hash_table_insert (win32_sel->sel_owner_table, selection, GDK_WINDOW_HWND (owner)); + g_hash_table_insert (win32_sel->sel_owner_table, selection, GDK_SURFACE_HWND (owner)); else g_hash_table_remove (win32_sel->sel_owner_table, selection); @@ -2042,10 +2042,10 @@ _gdk_win32_display_set_selection_owner (GdkDisplay *display, /* Rest of this function handles the CLIPBOARD selection */ if (owner != NULL) { - if (GDK_WINDOW_DESTROYED (owner)) + if (GDK_SURFACE_DESTROYED (owner)) return FALSE; - hwnd = GDK_WINDOW_HWND (owner); + hwnd = GDK_SURFACE_HWND (owner); } else hwnd = NULL; @@ -2102,11 +2102,11 @@ _gdk_win32_display_set_selection_owner (GdkDisplay *display, return TRUE; } -GdkWindow* +GdkSurface* _gdk_win32_display_get_selection_owner (GdkDisplay *display, GdkAtom selection) { - GdkWindow *window; + GdkSurface *window; HWND selection_owner; GdkWin32Selection *win32_sel = _gdk_win32_selection_get (); @@ -2118,7 +2118,7 @@ _gdk_win32_display_get_selection_owner (GdkDisplay *display, selection_owner = g_hash_table_lookup (win32_sel->sel_owner_table, selection); if (selection_owner) - window = gdk_win32_window_lookup_for_display (display, + window = gdk_win32_surface_lookup_for_display (display, selection_owner); else window = NULL; @@ -2128,7 +2128,7 @@ _gdk_win32_display_get_selection_owner (GdkDisplay *display, g_print ("gdk_selection_owner_get: %s = %p\n", sel_name, - (window ? GDK_WINDOW_HWND (window) : NULL)); + (window ? GDK_SURFACE_HWND (window) : NULL)); }); return window; @@ -2136,7 +2136,7 @@ _gdk_win32_display_get_selection_owner (GdkDisplay *display, static GdkAtom convert_dnd_selection_to_target (GdkAtom target, - GdkWindow *requestor) + GdkSurface *requestor) { GdkWin32Selection *win32_sel = _gdk_win32_selection_get (); UINT format; @@ -2243,7 +2243,7 @@ convert_dnd_selection_to_target (GdkAtom target, void _gdk_win32_display_convert_selection (GdkDisplay *display, - GdkWindow *requestor, + GdkSurface *requestor, GdkAtom selection, GdkAtom target, guint32 time) @@ -2254,7 +2254,7 @@ _gdk_win32_display_convert_selection (GdkDisplay *display, g_return_if_fail (selection != NULL); g_return_if_fail (requestor != NULL); - if (GDK_WINDOW_DESTROYED (requestor)) + if (GDK_SURFACE_DESTROYED (requestor)) return; GDK_NOTE (DND, { @@ -2262,18 +2262,18 @@ _gdk_win32_display_convert_selection (GdkDisplay *display, const char *tgt_name = (const char *)target; g_print ("gdk_selection_convert: %p %s %s\n", - GDK_WINDOW_HWND (requestor), + GDK_SURFACE_HWND (requestor), sel_name, tgt_name); }); if (selection == GDK_SELECTION_CLIPBOARD) { if (win32_sel->clipboard_opened_for != INVALID_HANDLE_VALUE || - OpenClipboard (GDK_WINDOW_HWND (requestor))) + OpenClipboard (GDK_SURFACE_HWND (requestor))) { if (win32_sel->clipboard_opened_for == INVALID_HANDLE_VALUE) { - win32_sel->clipboard_opened_for = GDK_WINDOW_HWND (requestor); + win32_sel->clipboard_opened_for = GDK_SURFACE_HWND (requestor); GDK_NOTE (DND, g_print ("Opened clipboard for 0x%p @ %s:%d\n", win32_sel->clipboard_opened_for, __FILE__, __LINE__)); } @@ -2317,7 +2317,7 @@ _gdk_win32_display_convert_selection (GdkDisplay *display, void _gdk_win32_selection_property_change (GdkWin32Selection *win32_sel, - GdkWindow *window, + GdkSurface *window, GdkAtom property, GdkAtom type, gint format, @@ -2331,9 +2331,9 @@ _gdk_win32_selection_property_change (GdkWin32Selection *win32_sel, win32_sel->property_change_target_atom = 0; if (win32_sel->clipboard_opened_for == INVALID_HANDLE_VALUE && - OpenClipboard (GDK_WINDOW_HWND (window))) + OpenClipboard (GDK_SURFACE_HWND (window))) { - win32_sel->clipboard_opened_for = GDK_WINDOW_HWND (window); + win32_sel->clipboard_opened_for = GDK_SURFACE_HWND (window); GDK_NOTE (DND, g_print ("Opened clipboard for 0x%p @ %s:%d\n", win32_sel->clipboard_opened_for, __FILE__, __LINE__)); } @@ -2435,7 +2435,7 @@ _gdk_win32_selection_property_change (GdkWin32Selection *win32_sel, gint _gdk_win32_display_get_selection_property (GdkDisplay *display, - GdkWindow *requestor, + GdkSurface *requestor, guchar **data, GdkAtom *ret_type, gint *ret_format) @@ -2444,15 +2444,15 @@ _gdk_win32_display_get_selection_property (GdkDisplay *display, GdkSelProp *prop; g_return_val_if_fail (requestor != NULL, 0); - g_return_val_if_fail (GDK_IS_WINDOW (requestor), 0); + g_return_val_if_fail (GDK_IS_SURFACE (requestor), 0); - if (GDK_WINDOW_DESTROYED (requestor)) + if (GDK_SURFACE_DESTROYED (requestor)) return 0; GDK_NOTE (DND, g_print ("gdk_selection_property_get: %p", - GDK_WINDOW_HWND (requestor))); + GDK_SURFACE_HWND (requestor))); - prop = g_hash_table_lookup (win32_sel->sel_prop_table, GDK_WINDOW_HWND (requestor)); + prop = g_hash_table_lookup (win32_sel->sel_prop_table, GDK_SURFACE_HWND (requestor)); if (prop == NULL) { @@ -2484,25 +2484,25 @@ _gdk_win32_display_get_selection_property (GdkDisplay *display, } void -_gdk_selection_property_delete (GdkWindow *window) +_gdk_selection_property_delete (GdkSurface *window) { GDK_NOTE (DND, g_print ("_gdk_selection_property_delete: %p (no-op)\n", - GDK_WINDOW_HWND (window))); + GDK_SURFACE_HWND (window))); #if 0 - prop = g_hash_table_lookup (sel_prop_table, GDK_WINDOW_HWND (window)); + prop = g_hash_table_lookup (sel_prop_table, GDK_SURFACE_HWND (window)); if (prop != NULL) { g_free (prop->data); g_free (prop); - g_hash_table_remove (sel_prop_table, GDK_WINDOW_HWND (window)); + g_hash_table_remove (sel_prop_table, GDK_SURFACE_HWND (window)); } #endif } void _gdk_win32_display_send_selection_notify (GdkDisplay *display, - GdkWindow *requestor, + GdkSurface *requestor, GdkAtom selection, GdkAtom target, GdkAtom property, @@ -2794,7 +2794,7 @@ _gdk_win32_add_target_to_selformats (GdkAtom target, * delayed rendering (that is, all formats, as we use delayed rendering * for everything). This function only registers the formats, but does * not announce them as supported. That is handled as a special case - * in gdk_window_property_change(). + * in gdk_surface_property_change(). * * Implementation detail: * This function will be called repeatedly, every time the PRIMARY selection changes. @@ -2806,7 +2806,7 @@ _gdk_win32_add_target_to_selformats (GdkAtom target, */ void gdk_win32_display_add_selection_targets (GdkDisplay *display, - GdkWindow *owner, + GdkSurface *owner, GdkAtom selection, GdkAtom *targets, guint ntargets) @@ -2818,7 +2818,7 @@ gdk_win32_display_add_selection_targets (GdkDisplay *display, const char *sel_name = (const char *)selection; g_print ("gdk_win32_selection_add_targets: %p: %s: ", - owner ? GDK_WINDOW_HWND (owner) : NULL, + owner ? GDK_SURFACE_HWND (owner) : NULL, sel_name); for (i = 0; i < ntargets; i++) diff --git a/gdk/win32/gdkselection-win32.h b/gdk/win32/gdkselection-win32.h index a71655460c..bbd3a7cd85 100644 --- a/gdk/win32/gdkselection-win32.h +++ b/gdk/win32/gdkselection-win32.h @@ -219,7 +219,7 @@ void _gdk_win32_add_format_to_targets (UINT gint _gdk_win32_add_target_to_selformats (GdkAtom target, GArray *array); void _gdk_win32_selection_property_change (GdkWin32Selection *win32_sel, - GdkWindow *window, + GdkSurface *window, GdkAtom property, GdkAtom type, gint format, diff --git a/gdk/win32/gdkvulkancontext-win32.c b/gdk/win32/gdkvulkancontext-win32.c index edf735dd16..269f701031 100644 --- a/gdk/win32/gdkvulkancontext-win32.c +++ b/gdk/win32/gdkvulkancontext-win32.c @@ -38,7 +38,7 @@ static VkResult gdk_win32_vulkan_context_create_surface (GdkVulkanContext *context, 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)); VkWin32SurfaceCreateInfoKHR info; @@ -46,7 +46,7 @@ gdk_win32_vulkan_context_create_surface (GdkVulkanContext *context, info.pNext = NULL; info.flags = 0; info.hinstance = _gdk_dll_hinstance; - info.hwnd = GDK_WINDOW_HWND (window); + info.hwnd = GDK_SURFACE_HWND (window); /* This is necessary so that Vulkan sees the Window. * Usually, vkCreateWin32SurfaceKHR() will not cause a problem to happen as diff --git a/gdk/win32/gdkwin32dnd-private.h b/gdk/win32/gdkwin32dnd-private.h index 769662e5ae..161f59a228 100644 --- a/gdk/win32/gdkwin32dnd-private.h +++ b/gdk/win32/gdkwin32dnd-private.h @@ -29,8 +29,8 @@ G_BEGIN_DECLS struct _GdkWin32DragContext { GdkDragContext context; - GdkWindow *ipc_window; - GdkWindow *drag_window; + GdkSurface *ipc_window; + GdkSurface *drag_window; GdkCursor *cursor; GdkSeat *grab_seat; GdkDragAction actions; diff --git a/gdk/win32/gdkwin32misc.h b/gdk/win32/gdkwin32misc.h index 1bc11f5164..75c5fc7ca1 100644 --- a/gdk/win32/gdkwin32misc.h +++ b/gdk/win32/gdkwin32misc.h @@ -44,10 +44,10 @@ G_BEGIN_DECLS #include "gdkprivate-win32.h" -#define GDK_WINDOW_HWND(win) (GDK_WINDOW_IMPL_WIN32(win->impl)->handle) +#define GDK_SURFACE_HWND(win) (GDK_SURFACE_IMPL_WIN32(win->impl)->handle) #else /* definition for exported 'internals' go here */ -#define GDK_WINDOW_HWND(d) (gdk_win32_window_get_handle (d)) +#define GDK_SURFACE_HWND(d) (gdk_win32_surface_get_handle (d)) #endif /* INSIDE_GDK_WIN32 */ @@ -68,24 +68,24 @@ G_BEGIN_DECLS #define XBUTTON2 2 #endif -/* Return true if the GdkWindow is a win32 implemented window */ +/* Return true if the GdkSurface is a win32 implemented window */ GDK_AVAILABLE_IN_ALL -gboolean gdk_win32_window_is_win32 (GdkWindow *window); +gboolean gdk_win32_surface_is_win32 (GdkSurface *window); GDK_AVAILABLE_IN_ALL -HWND gdk_win32_window_get_impl_hwnd (GdkWindow *window); +HWND gdk_win32_surface_get_impl_hwnd (GdkSurface *window); /* Return the Gdk* for a particular HANDLE */ GDK_AVAILABLE_IN_ALL gpointer gdk_win32_handle_table_lookup (HWND handle); /* Translate from window to Windows handle */ GDK_AVAILABLE_IN_ALL -HGDIOBJ gdk_win32_window_get_handle (GdkWindow *window); +HGDIOBJ gdk_win32_surface_get_handle (GdkSurface *window); GDK_AVAILABLE_IN_ALL -GdkWindow * gdk_win32_window_foreign_new_for_display (GdkDisplay *display, +GdkSurface * gdk_win32_surface_foreign_new_for_display (GdkDisplay *display, HWND anid); GDK_AVAILABLE_IN_ALL -GdkWindow * gdk_win32_window_lookup_for_display (GdkDisplay *display, +GdkSurface * gdk_win32_surface_lookup_for_display (GdkDisplay *display, HWND anid); #if defined (INSIDE_GDK_WIN32) || defined (GDK_COMPILATION) || defined (GTK_COMPILATION) diff --git a/gdk/win32/gdkwin32window.h b/gdk/win32/gdkwin32window.h index 999ea8d2b2..9dda179353 100644 --- a/gdk/win32/gdkwin32window.h +++ b/gdk/win32/gdkwin32window.h @@ -22,8 +22,8 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#ifndef __GDK_WIN32_WINDOW_H__ -#define __GDK_WIN32_WINDOW_H__ +#ifndef __GDK_WIN32_SURFACE_H__ +#define __GDK_WIN32_SURFACE_H__ #if !defined (__GDKWIN32_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only <gdk/gdkwin32.h> can be included directly." @@ -33,23 +33,23 @@ G_BEGIN_DECLS -#define GDK_TYPE_WIN32_WINDOW (gdk_win32_window_get_type ()) -#define GDK_WIN32_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WIN32_WINDOW, GdkWin32Window)) -#define GDK_WIN32_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WIN32_WINDOW, GdkWin32WindowClass)) -#define GDK_IS_WIN32_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WIN32_WINDOW)) -#define GDK_IS_WIN32_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WIN32_WINDOW)) -#define GDK_WIN32_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WIN32_WINDOW, GdkWin32WindowClass)) +#define GDK_TYPE_WIN32_SURFACE (gdk_win32_surface_get_type ()) +#define GDK_WIN32_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WIN32_SURFACE, GdkWin32Surface)) +#define GDK_WIN32_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WIN32_SURFACE, GdkWin32SurfaceClass)) +#define GDK_IS_WIN32_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WIN32_SURFACE)) +#define GDK_IS_WIN32_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WIN32_SURFACE)) +#define GDK_WIN32_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WIN32_SURFACE, GdkWin32SurfaceClass)) #ifdef GDK_COMPILATION -typedef struct _GdkWin32Window GdkWin32Window; +typedef struct _GdkWin32Surface GdkWin32Surface; #else -typedef GdkWindow GdkWin32Window; +typedef GdkSurface GdkWin32Surface; #endif -typedef struct _GdkWin32WindowClass GdkWin32WindowClass; +typedef struct _GdkWin32SurfaceClass GdkWin32SurfaceClass; GDK_AVAILABLE_IN_ALL -GType gdk_win32_window_get_type (void); +GType gdk_win32_surface_get_type (void); G_END_DECLS -#endif /* __GDK_X11_WINDOW_H__ */ +#endif /* __GDK_X11_SURFACE_H__ */ diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index 12b8aa623c..7d51af76fc 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -46,9 +46,9 @@ #include <math.h> #include "fallback-c89.c" -static void gdk_window_impl_win32_init (GdkWindowImplWin32 *window); -static void gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass); -static void gdk_window_impl_win32_finalize (GObject *object); +static void gdk_surface_impl_win32_init (GdkSurfaceImplWin32 *window); +static void gdk_surface_impl_win32_class_init (GdkSurfaceImplWin32Class *klass); +static void gdk_surface_impl_win32_finalize (GObject *object); static gpointer parent_class = NULL; static GSList *modal_window_stack = NULL; @@ -126,39 +126,39 @@ typedef struct _AeroSnapEdgeRegion AeroSnapEdgeRegion; */ #define AEROSNAP_INDICATOR_ANIMATION_TICK (16) -static gboolean _gdk_window_get_functions (GdkWindow *window, +static gboolean _gdk_surface_get_functions (GdkSurface *window, GdkWMFunction *functions); -static HDC _gdk_win32_impl_acquire_dc (GdkWindowImplWin32 *impl); -static void _gdk_win32_impl_release_dc (GdkWindowImplWin32 *impl); +static HDC _gdk_win32_impl_acquire_dc (GdkSurfaceImplWin32 *impl); +static void _gdk_win32_impl_release_dc (GdkSurfaceImplWin32 *impl); #define WINDOW_IS_TOPLEVEL(window) \ - (GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN) + (GDK_SURFACE_TYPE (window) != GDK_SURFACE_FOREIGN) -struct _GdkWin32Window { - GdkWindow parent; +struct _GdkWin32Surface { + GdkSurface parent; }; -struct _GdkWin32WindowClass { - GdkWindowClass parent_class; +struct _GdkWin32SurfaceClass { + GdkSurfaceClass parent_class; }; -G_DEFINE_TYPE (GdkWin32Window, gdk_win32_window, GDK_TYPE_WINDOW) +G_DEFINE_TYPE (GdkWin32Surface, gdk_win32_surface, GDK_TYPE_SURFACE) static void -gdk_win32_window_class_init (GdkWin32WindowClass *window_class) +gdk_win32_surface_class_init (GdkWin32SurfaceClass *window_class) { } static void -gdk_win32_window_init (GdkWin32Window *window) +gdk_win32_surface_init (GdkWin32Surface *window) { } -G_DEFINE_TYPE (GdkWindowImplWin32, gdk_window_impl_win32, GDK_TYPE_WINDOW_IMPL) +G_DEFINE_TYPE (GdkSurfaceImplWin32, gdk_surface_impl_win32, GDK_TYPE_SURFACE_IMPL) GType -_gdk_window_impl_win32_get_type (void) +_gdk_surface_impl_win32_get_type (void) { static GType object_type = 0; @@ -166,19 +166,19 @@ _gdk_window_impl_win32_get_type (void) { const GTypeInfo object_info = { - sizeof (GdkWindowImplWin32Class), + sizeof (GdkSurfaceImplWin32Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, - (GClassInitFunc) gdk_window_impl_win32_class_init, + (GClassInitFunc) gdk_surface_impl_win32_class_init, NULL, /* class_finalize */ NULL, /* class_data */ - sizeof (GdkWindowImplWin32), + sizeof (GdkSurfaceImplWin32), 0, /* n_preallocs */ - (GInstanceInitFunc) gdk_window_impl_win32_init, + (GInstanceInitFunc) gdk_surface_impl_win32_init, }; - object_type = g_type_register_static (GDK_TYPE_WINDOW_IMPL, - "GdkWindowImplWin32", + object_type = g_type_register_static (GDK_TYPE_SURFACE_IMPL, + "GdkSurfaceImplWin32", &object_info, 0); } @@ -186,7 +186,7 @@ _gdk_window_impl_win32_get_type (void) } static void -gdk_window_impl_win32_init (GdkWindowImplWin32 *impl) +gdk_surface_impl_win32_init (GdkSurfaceImplWin32 *impl) { GdkDisplay *display = gdk_display_get_default (); @@ -194,7 +194,7 @@ gdk_window_impl_win32_init (GdkWindowImplWin32 *impl) impl->hicon_big = NULL; impl->hicon_small = NULL; impl->hint_flags = 0; - impl->type_hint = GDK_WINDOW_TYPE_HINT_NORMAL; + impl->type_hint = GDK_SURFACE_TYPE_HINT_NORMAL; impl->transient_owner = NULL; impl->transient_children = NULL; impl->num_transients = 0; @@ -203,18 +203,18 @@ gdk_window_impl_win32_init (GdkWindowImplWin32 *impl) } static void -gdk_window_impl_win32_finalize (GObject *object) +gdk_surface_impl_win32_finalize (GObject *object) { - GdkWindow *wrapper; - GdkWindowImplWin32 *window_impl; + GdkSurface *wrapper; + GdkSurfaceImplWin32 *window_impl; - g_return_if_fail (GDK_IS_WINDOW_IMPL_WIN32 (object)); + g_return_if_fail (GDK_IS_SURFACE_IMPL_WIN32 (object)); - window_impl = GDK_WINDOW_IMPL_WIN32 (object); + window_impl = GDK_SURFACE_IMPL_WIN32 (object); wrapper = window_impl->wrapper; - if (!GDK_WINDOW_DESTROYED (wrapper)) + if (!GDK_SURFACE_DESTROYED (wrapper)) { gdk_win32_handle_table_remove (window_impl->handle); } @@ -255,15 +255,15 @@ gdk_window_impl_win32_finalize (GObject *object) } static void -gdk_win32_get_window_client_area_rect (GdkWindow *window, +gdk_win32_get_window_client_area_rect (GdkSurface *window, gint scale, RECT *rect) { gint x, y, width, height; - gdk_window_get_position (window, &x, &y); - width = gdk_window_get_width (window); - height = gdk_window_get_height (window); + gdk_surface_get_position (window, &x, &y); + width = gdk_surface_get_width (window); + height = gdk_surface_get_height (window); rect->left = x * scale; rect->top = y * scale; rect->right = rect->left + width * scale; @@ -271,11 +271,11 @@ gdk_win32_get_window_client_area_rect (GdkWindow *window, } static void -gdk_win32_window_get_queued_window_rect (GdkWindow *window, +gdk_win32_surface_get_queued_window_rect (GdkSurface *window, RECT *return_window_rect) { RECT window_rect; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); gdk_win32_get_window_client_area_rect (window, impl->window_scale, &window_rect); @@ -292,15 +292,15 @@ gdk_win32_window_get_queued_window_rect (GdkWindow *window, } static void -gdk_win32_window_apply_queued_move_resize (GdkWindow *window, +gdk_win32_surface_apply_queued_move_resize (GdkSurface *window, RECT window_rect) { - if (!IsIconic (GDK_WINDOW_HWND (window))) + if (!IsIconic (GDK_SURFACE_HWND (window))) { - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); GDK_NOTE (EVENTS, g_print ("Setting window position ... ")); - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED, window_rect.left, window_rect.top, window_rect.right - window_rect.left, @@ -317,15 +317,15 @@ gdk_win32_window_apply_queued_move_resize (GdkWindow *window, } static gboolean -gdk_win32_window_begin_paint (GdkWindow *window) +gdk_win32_surface_begin_paint (GdkSurface *window) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; RECT window_rect; - if (window == NULL || GDK_WINDOW_DESTROYED (window)) + if (window == NULL || GDK_SURFACE_DESTROYED (window)) return TRUE; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); /* Layered windows are moved *after* repaint. * We supply our own surface, return FALSE to make GDK use it. @@ -360,23 +360,23 @@ gdk_win32_window_begin_paint (GdkWindow *window) /* Get the position/size of the window that GDK wants, * apply it. */ - gdk_win32_window_get_queued_window_rect (window, &window_rect); - gdk_win32_window_apply_queued_move_resize (window, window_rect); + gdk_win32_surface_get_queued_window_rect (window, &window_rect); + gdk_win32_surface_apply_queued_move_resize (window, window_rect); return TRUE; } static void -gdk_win32_window_end_paint (GdkWindow *window) +gdk_win32_surface_end_paint (GdkSurface *window) { - /* FIXME: Possibly make gdk_win32_window_end_paint() a + /* FIXME: Possibly make gdk_win32_surface_end_paint() a * no-op stub, like what is done in Wayland, as * the items here rely on layered window usage, * when we transition to full GL drawing, as * layered windows do not support enough GL * for our needs here */ - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; RECT window_rect; HDC hdc; POINT window_position; @@ -385,10 +385,10 @@ gdk_win32_window_end_paint (GdkWindow *window) BLENDFUNCTION blender; cairo_t *cr; - if (window == NULL || GDK_WINDOW_DESTROYED (window)) + if (window == NULL || GDK_SURFACE_DESTROYED (window)) return; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); /* GL windows are moved *before* repaint */ /*if (window->current_paint.use_gl) @@ -404,11 +404,11 @@ gdk_win32_window_end_paint (GdkWindow *window) impl->drag_move_resize_context.native_move_resize_pending = FALSE; /* Get the position/size of the window that GDK wants. */ - gdk_win32_window_get_queued_window_rect (window, &window_rect); + gdk_win32_surface_get_queued_window_rect (window, &window_rect); if (!impl->layered) { - gdk_win32_window_apply_queued_move_resize (window, window_rect); + gdk_win32_surface_apply_queued_move_resize (window, window_rect); return; } @@ -445,53 +445,53 @@ gdk_win32_window_end_paint (GdkWindow *window) hdc = cairo_win32_surface_get_dc (impl->cache_surface); /* Don't use UpdateLayeredWindow on minimized windows */ - if (IsIconic (GDK_WINDOW_HWND (window))) + if (IsIconic (GDK_SURFACE_HWND (window))) { - gdk_win32_window_apply_queued_move_resize (window, window_rect); + gdk_win32_surface_apply_queued_move_resize (window, window_rect); return; } /* Move, resize and redraw layered window in one call */ - API_CALL (UpdateLayeredWindow, (GDK_WINDOW_HWND (window), NULL, + API_CALL (UpdateLayeredWindow, (GDK_SURFACE_HWND (window), NULL, &window_position, &window_size, hdc, &source_point, 0, &blender, ULW_ALPHA)); } void -_gdk_win32_adjust_client_rect (GdkWindow *window, +_gdk_win32_adjust_client_rect (GdkSurface *window, RECT *rect) { LONG style, exstyle; - style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE); - exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE); + style = GetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE); + exstyle = GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE); API_CALL (AdjustWindowRectEx, (rect, style, FALSE, exstyle)); } gboolean -_gdk_win32_window_enable_transparency (GdkWindow *window) +_gdk_win32_surface_enable_transparency (GdkSurface *window) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; DWM_BLURBEHIND blur_behind; HRGN empty_region; HRESULT call_result; HWND parent, thiswindow; - if (window == NULL || GDK_WINDOW_HWND (window) == NULL) + if (window == NULL || GDK_SURFACE_HWND (window) == NULL) return FALSE; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); /* layered windows don't need blurbehind for transparency */ if (impl->layered) return TRUE; - if (!gdk_display_is_composited (gdk_window_get_display (window))) + if (!gdk_display_is_composited (gdk_surface_get_display (window))) return FALSE; - thiswindow = GDK_WINDOW_HWND (window); + thiswindow = GDK_SURFACE_HWND (window); /* Blurbehind only works on toplevel windows */ parent = GetAncestor (thiswindow, GA_PARENT); @@ -533,12 +533,12 @@ get_default_title (void) /* RegisterGdkClass * is a wrapper function for RegisterWindowClassEx. * It creates at least one unique class for every - * GdkWindowType. If support for single window-specific icons + * GdkSurfaceType. If support for single window-specific icons * is ever needed (e.g Dialog specific), every such window should * get its own class */ static ATOM -RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint) +RegisterGdkClass (GdkSurfaceType wtype, GdkSurfaceTypeHint wtype_hint) { static ATOM klassTOPLEVEL = 0; static ATOM klassCHILD = 0; @@ -553,7 +553,7 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint) wcl.style = 0; /* DON'T set CS_<H,V>REDRAW. It causes total redraw * on WM_SIZE and WM_MOVE. Flicker, Performance! */ - wcl.lpfnWndProc = _gdk_win32_window_procedure; + wcl.lpfnWndProc = _gdk_win32_surface_procedure; wcl.cbClsExtra = 0; wcl.cbWndExtra = 0; wcl.hInstance = _gdk_app_hmodule; @@ -610,7 +610,7 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint) switch (wtype) { - case GDK_WINDOW_TOPLEVEL: + case GDK_SURFACE_TOPLEVEL: /* MSDN: CS_OWNDC is needed for OpenGL contexts */ wcl.style |= CS_OWNDC; if (0 == klassTOPLEVEL) @@ -623,10 +623,10 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint) klass = klassTOPLEVEL; break; - case GDK_WINDOW_TEMP: - if ((wtype_hint == GDK_WINDOW_TYPE_HINT_MENU) || - (wtype_hint == GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU) || - (wtype_hint == GDK_WINDOW_TYPE_HINT_POPUP_MENU)) + case GDK_SURFACE_TEMP: + if ((wtype_hint == GDK_SURFACE_TYPE_HINT_MENU) || + (wtype_hint == GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU) || + (wtype_hint == GDK_SURFACE_TYPE_HINT_POPUP_MENU)) { if (klassTEMPSHADOW == 0) { @@ -654,7 +654,7 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint) } break; - case GDK_WINDOW_CHILD: + case GDK_SURFACE_CHILD: default: g_assert_not_reached (); break; @@ -686,17 +686,17 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint) */ void _gdk_win32_display_create_window_impl (GdkDisplay *display, - GdkWindow *window, - GdkWindow *real_parent, + GdkSurface *window, + GdkSurface *real_parent, GdkEventMask event_mask, - GdkWindowAttr *attributes) + GdkSurfaceAttr *attributes) { HWND hwndNew; HANDLE hparent; ATOM klass = 0; DWORD dwStyle = 0, dwExStyle; RECT rect; - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; GdkWin32Display *display_win32; const gchar *title; wchar_t *wtitle; @@ -707,15 +707,15 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, g_return_if_fail (display == _gdk_display); GDK_NOTE (MISC, - g_print ("_gdk_window_impl_new: %s %s\n", (window->window_type == GDK_WINDOW_TOPLEVEL ? "TOPLEVEL" : - (window->window_type == GDK_WINDOW_TEMP ? "TEMP" : "???")), + g_print ("_gdk_surface_impl_new: %s %s\n", (window->window_type == GDK_SURFACE_TOPLEVEL ? "TOPLEVEL" : + (window->window_type == GDK_SURFACE_TEMP ? "TEMP" : "???")), (attributes->wclass == GDK_INPUT_OUTPUT ? "" : "input-only"))); - hparent = (real_parent != NULL) ? GDK_WINDOW_HWND (real_parent) : NULL; + hparent = (real_parent != NULL) ? GDK_SURFACE_HWND (real_parent) : NULL; - impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WIN32, NULL); - impl->wrapper = GDK_WINDOW (window); - window->impl = GDK_WINDOW_IMPL (impl); + impl = g_object_new (GDK_TYPE_SURFACE_IMPL_WIN32, NULL); + impl->wrapper = GDK_SURFACE (window); + window->impl = GDK_SURFACE_IMPL (impl); impl->layered = FALSE; impl->layered_opacity = 1.0; @@ -741,21 +741,21 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, switch (window->window_type) { - case GDK_WINDOW_TOPLEVEL: + case GDK_SURFACE_TOPLEVEL: if (window->parent) { /* The common code warns for this case. */ hparent = GetDesktopWindow (); } /* Children of foreign windows aren't toplevel windows */ - if (real_parent != NULL && GDK_WINDOW_TYPE (real_parent) == GDK_WINDOW_FOREIGN) + if (real_parent != NULL && GDK_SURFACE_TYPE (real_parent) == GDK_SURFACE_FOREIGN) { dwStyle = WS_CHILDWINDOW | WS_CLIPCHILDREN; } else { /* MSDN: We need WS_CLIPCHILDREN and WS_CLIPSIBLINGS for GL Context Creation */ - if (window->window_type == GDK_WINDOW_TOPLEVEL) + if (window->window_type == GDK_SURFACE_TOPLEVEL) dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; else dwStyle = WS_OVERLAPPED | WS_MINIMIZEBOX | WS_SYSMENU | WS_CAPTION | WS_THICKFRAME | WS_CLIPCHILDREN; @@ -765,7 +765,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, } break; - case GDK_WINDOW_TEMP: + case GDK_SURFACE_TEMP: /* A temp window is not necessarily a top level window */ dwStyle = real_parent == NULL ? WS_POPUP : WS_CHILDWINDOW; dwStyle |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS; @@ -775,7 +775,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, break; - case GDK_WINDOW_CHILD: + case GDK_SURFACE_CHILD: default: g_assert_not_reached (); } @@ -790,7 +790,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, real_x = (window->x - offset_x) * impl->window_scale; real_y = (window->y - offset_y) * impl->window_scale; - if (window->window_type == GDK_WINDOW_TOPLEVEL) + if (window->window_type == GDK_SURFACE_TOPLEVEL) { /* We initially place it at default so that we can get the default window positioning if we want */ @@ -812,7 +812,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, impl->native_event_mask = GDK_STRUCTURE_MASK | event_mask; - if (impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY) + if (impl->type_hint == GDK_SURFACE_TYPE_HINT_UTILITY) dwExStyle |= WS_EX_TOOLWINDOW; /* WS_EX_TRANSPARENT means "try draw this window last, and ignore input". @@ -820,7 +820,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, * input, because that will make it a potential drop target, and if it's * under the mouse cursor, this will kill any DND. */ - if (impl->type_hint == GDK_WINDOW_TYPE_HINT_DND) + if (impl->type_hint == GDK_SURFACE_TYPE_HINT_DND) dwExStyle |= WS_EX_TRANSPARENT; klass = RegisterGdkClass (window->window_type, impl->type_hint); @@ -838,10 +838,10 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, NULL, _gdk_app_hmodule, window); - if (GDK_WINDOW_HWND (window) != hwndNew) + if (GDK_SURFACE_HWND (window) != hwndNew) { - g_warning ("gdk_window_new: gdk_event_translate::WM_CREATE (%p, %p) HWND mismatch.", - GDK_WINDOW_HWND (window), + g_warning ("gdk_surface_new: gdk_event_translate::WM_CREATE (%p, %p) HWND mismatch.", + GDK_SURFACE_HWND (window), hwndNew); /* HB: IHMO due to a race condition the handle was increased by @@ -850,9 +850,9 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, * To reproduce: compile with MSVC 5, DEBUG=1 */ # if 0 - gdk_win32_handle_table_remove (GDK_WINDOW_HWND (window)); - GDK_WINDOW_HWND (window) = hwndNew; - gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window); + gdk_win32_handle_table_remove (GDK_SURFACE_HWND (window)); + GDK_SURFACE_HWND (window) = hwndNew; + gdk_win32_handle_table_insert (&GDK_SURFACE_HWND (window), window); # else /* the old behaviour, but with warning */ impl->handle = hwndNew; @@ -860,21 +860,21 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, } - GetWindowRect (GDK_WINDOW_HWND (window), &rect); + GetWindowRect (GDK_SURFACE_HWND (window), &rect); impl->initial_x = rect.left; impl->initial_y = rect.top; /* Now we know the initial position, move to actually specified position */ if (real_x != x || real_y != y) { - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED, real_x, real_y, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER)); } g_object_ref (window); - gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window); + gdk_win32_handle_table_insert (&GDK_SURFACE_HWND (window), window); GDK_NOTE (MISC, g_print ("... \"%s\" %dx%d@%+d%+d %p = %p\n", title, @@ -882,10 +882,10 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, window->x - offset_x, window->y - offset_y, hparent, - GDK_WINDOW_HWND (window))); + GDK_SURFACE_HWND (window))); /* Add window handle to title */ - GDK_NOTE (MISC_OR_EVENTS, gdk_window_set_title (window, title)); + GDK_NOTE (MISC_OR_EVENTS, gdk_surface_set_title (window, title)); g_free (wtitle); @@ -896,30 +896,30 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display, return; } -// if (!from_set_skip_taskbar_hint && window->window_type == GDK_WINDOW_TEMP) -// gdk_window_set_skip_taskbar_hint (window, TRUE); +// if (!from_set_skip_taskbar_hint && window->window_type == GDK_SURFACE_TEMP) +// gdk_surface_set_skip_taskbar_hint (window, TRUE); - _gdk_win32_window_enable_transparency (window); + _gdk_win32_surface_enable_transparency (window); } -GdkWindow * -gdk_win32_window_foreign_new_for_display (GdkDisplay *display, +GdkSurface * +gdk_win32_surface_foreign_new_for_display (GdkDisplay *display, HWND anid) { - GdkWindow *window; - GdkWindowImplWin32 *impl; + GdkSurface *window; + GdkSurfaceImplWin32 *impl; HANDLE parent; RECT rect; POINT point; - if ((window = gdk_win32_window_lookup_for_display (display, anid)) != NULL) + if ((window = gdk_win32_surface_lookup_for_display (display, anid)) != NULL) return g_object_ref (window); window = _gdk_display_create_window (display); - window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WIN32, NULL); + window->impl = g_object_new (GDK_TYPE_SURFACE_IMPL_WIN32, NULL); window->impl_window = window; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); impl->wrapper = window; parent = GetParent (anid); @@ -938,45 +938,45 @@ gdk_win32_window_foreign_new_for_display (GdkDisplay *display, impl->unscaled_height = rect.bottom - rect.top; window->width = (impl->unscaled_width + impl->window_scale - 1) / impl->window_scale; window->height = (impl->unscaled_height + impl->window_scale - 1) / impl->window_scale; - window->window_type = GDK_WINDOW_FOREIGN; + window->window_type = GDK_SURFACE_FOREIGN; window->destroyed = FALSE; window->event_mask = GDK_ALL_EVENTS_MASK; /* XXX */ if (IsWindowVisible ((HWND) anid)) - window->state &= (~GDK_WINDOW_STATE_WITHDRAWN); + window->state &= (~GDK_SURFACE_STATE_WITHDRAWN); else - window->state |= GDK_WINDOW_STATE_WITHDRAWN; + window->state |= GDK_SURFACE_STATE_WITHDRAWN; if (GetWindowLong ((HWND)anid, GWL_EXSTYLE) & WS_EX_TOPMOST) - window->state |= GDK_WINDOW_STATE_ABOVE; + window->state |= GDK_SURFACE_STATE_ABOVE; else - window->state &= (~GDK_WINDOW_STATE_ABOVE); - window->state &= (~GDK_WINDOW_STATE_BELOW); + window->state &= (~GDK_SURFACE_STATE_ABOVE); + window->state &= (~GDK_SURFACE_STATE_BELOW); window->viewable = TRUE; - GDK_WINDOW_HWND (window) = anid; + GDK_SURFACE_HWND (window) = anid; g_object_ref (window); - gdk_win32_handle_table_insert (&GDK_WINDOW_HWND (window), window); + gdk_win32_handle_table_insert (&GDK_SURFACE_HWND (window), window); - GDK_NOTE (MISC, g_print ("gdk_win32_window_foreign_new_for_display: %p: %s@%+d%+d\n", + GDK_NOTE (MISC, g_print ("gdk_win32_surface_foreign_new_for_display: %p: %s@%+d%+d\n", (HWND) anid, - _gdk_win32_window_description (window), + _gdk_win32_surface_description (window), window->x, window->y)); return window; } static void -gdk_win32_window_destroy (GdkWindow *window, +gdk_win32_surface_destroy (GdkSurface *window, gboolean recursing, gboolean foreign_destroy) { - GdkWindowImplWin32 *window_impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *window_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); GSList *tmp; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - GDK_NOTE (MISC, g_print ("gdk_win32_window_destroy: %p\n", - GDK_WINDOW_HWND (window))); + GDK_NOTE (MISC, g_print ("gdk_win32_surface_destroy: %p\n", + GDK_SURFACE_HWND (window))); /* Remove ourself from the modal stack */ _gdk_remove_modal_window (window); @@ -985,8 +985,8 @@ gdk_win32_window_destroy (GdkWindow *window, tmp = window_impl->transient_children; while (tmp != NULL) { - GdkWindow *child = tmp->data; - GdkWindowImplWin32 *child_impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW (child)->impl); + GdkSurface *child = tmp->data; + GdkSurfaceImplWin32 *child_impl = GDK_SURFACE_IMPL_WIN32 (GDK_SURFACE (child)->impl); child_impl->transient_owner = NULL; tmp = tmp->next; @@ -997,48 +997,48 @@ gdk_win32_window_destroy (GdkWindow *window, /* Remove ourself from our transient owner */ if (window_impl->transient_owner != NULL) { - gdk_window_set_transient_for (window, NULL); + gdk_surface_set_transient_for (window, NULL); } if (!recursing && !foreign_destroy) { window->destroyed = TRUE; - DestroyWindow (GDK_WINDOW_HWND (window)); + DestroyWindow (GDK_SURFACE_HWND (window)); } } /* This function is called when the window really gone. */ static void -gdk_win32_window_destroy_notify (GdkWindow *window) +gdk_win32_surface_destroy_notify (GdkSurface *window) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); GDK_NOTE (EVENTS, - g_print ("gdk_window_destroy_notify: %p%s\n", - GDK_WINDOW_HWND (window), - (GDK_WINDOW_DESTROYED (window) ? " (destroyed)" : ""))); + g_print ("gdk_surface_destroy_notify: %p%s\n", + GDK_SURFACE_HWND (window), + (GDK_SURFACE_DESTROYED (window) ? " (destroyed)" : ""))); - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { - if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN) + if (GDK_SURFACE_TYPE (window) != GDK_SURFACE_FOREIGN) g_warning ("window %p unexpectedly destroyed", - GDK_WINDOW_HWND (window)); + GDK_SURFACE_HWND (window)); - _gdk_window_destroy (window, TRUE); + _gdk_surface_destroy (window, TRUE); } - gdk_win32_handle_table_remove (GDK_WINDOW_HWND (window)); + gdk_win32_handle_table_remove (GDK_SURFACE_HWND (window)); g_object_unref (window); } static void -get_outer_rect (GdkWindow *window, +get_outer_rect (GdkSurface *window, gint width, gint height, RECT *rect) { - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); rect->left = rect->top = 0; rect->right = width * impl->window_scale; @@ -1048,12 +1048,12 @@ get_outer_rect (GdkWindow *window, } static void -adjust_for_gravity_hints (GdkWindow *window, +adjust_for_gravity_hints (GdkSurface *window, RECT *outer_rect, gint *x, gint *y) { - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (impl->hint_flags & GDK_HINT_WIN_GRAVITY) { @@ -1117,11 +1117,11 @@ adjust_for_gravity_hints (GdkWindow *window, } static void -show_window_internal (GdkWindow *window, +show_window_internal (GdkSurface *window, gboolean already_mapped, gboolean deiconify) { - GdkWindowImplWin32 *window_impl; + GdkSurfaceImplWin32 *window_impl; gboolean focus_on_map = FALSE; DWORD exstyle; @@ -1129,8 +1129,8 @@ show_window_internal (GdkWindow *window, return; GDK_NOTE (MISC, g_print ("show_window_internal: %p: %s%s\n", - GDK_WINDOW_HWND (window), - _gdk_win32_window_state_to_string (window->state), + GDK_SURFACE_HWND (window), + _gdk_win32_surface_state_to_string (window->state), (deiconify ? " deiconify" : ""))); /* If asked to show (not deiconify) an withdrawn and iconified @@ -1138,27 +1138,27 @@ show_window_internal (GdkWindow *window, */ if (!deiconify && !already_mapped && - (window->state & GDK_WINDOW_STATE_ICONIFIED)) + (window->state & GDK_SURFACE_STATE_ICONIFIED)) { GtkShowWindow (window, SW_SHOWMINNOACTIVE); return; } /* If asked to just show an iconified window, do nothing. */ - if (!deiconify && (window->state & GDK_WINDOW_STATE_ICONIFIED)) + if (!deiconify && (window->state & GDK_SURFACE_STATE_ICONIFIED)) return; /* If asked to deiconify an already noniconified window, do * nothing. (Especially, don't cause the window to rise and * activate. There are different calls for that.) */ - if (deiconify && !(window->state & GDK_WINDOW_STATE_ICONIFIED)) + if (deiconify && !(window->state & GDK_SURFACE_STATE_ICONIFIED)) return; /* If asked to show (but not raise) a window that is already * visible, do nothing. */ - if (!deiconify && !already_mapped && IsWindowVisible (GDK_WINDOW_HWND (window))) + if (!deiconify && !already_mapped && IsWindowVisible (GDK_SURFACE_HWND (window))) return; /* Other cases */ @@ -1166,7 +1166,7 @@ show_window_internal (GdkWindow *window, if (!already_mapped) focus_on_map = window->focus_on_map; - exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE); + exstyle = GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE); /* Use SetWindowPos to show transparent windows so automatic redraws * in other windows can be suppressed. @@ -1175,10 +1175,10 @@ show_window_internal (GdkWindow *window, { UINT flags = SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER; - if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP || !focus_on_map) + if (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP || !focus_on_map) flags |= SWP_NOACTIVATE; - SetWindowPos (GDK_WINDOW_HWND (window), + SetWindowPos (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED, 0, 0, 0, 0, flags); return; @@ -1193,9 +1193,9 @@ show_window_internal (GdkWindow *window, * + Certain window types and hints have more elaborate positioning * schemes. */ - window_impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + window_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (!already_mapped && - GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL && + GDK_SURFACE_TYPE (window) == GDK_SURFACE_TOPLEVEL && (window_impl->hint_flags & (GDK_HINT_POS | GDK_HINT_USER_POS)) == 0) { gboolean center = FALSE; @@ -1205,12 +1205,12 @@ show_window_internal (GdkWindow *window, x = window_impl->initial_x; y = window_impl->initial_y; - if (window_impl->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN) + if (window_impl->type_hint == GDK_SURFACE_TYPE_HINT_SPLASHSCREEN) { HMONITOR monitor; MONITORINFO mi; - monitor = MonitorFromWindow (GDK_WINDOW_HWND (window), MONITOR_DEFAULTTONEAREST); + monitor = MonitorFromWindow (GDK_SURFACE_HWND (window), MONITOR_DEFAULTTONEAREST); mi.cbSize = sizeof (mi); if (monitor && GetMonitorInfo (monitor, &mi)) center_on_rect = mi.rcMonitor; @@ -1224,16 +1224,16 @@ show_window_internal (GdkWindow *window, center = TRUE; } else if (window_impl->transient_owner != NULL && - GDK_WINDOW_IS_MAPPED (window_impl->transient_owner)) + GDK_SURFACE_IS_MAPPED (window_impl->transient_owner)) { - GdkWindow *owner = window_impl->transient_owner; + GdkSurface *owner = window_impl->transient_owner; /* Center on transient parent */ center_on_rect.left = (owner->x - _gdk_offset_x) * window_impl->window_scale; center_on_rect.top = (owner->y - _gdk_offset_y) * window_impl->window_scale; center_on_rect.right = center_on_rect.left + owner->width * window_impl->window_scale; center_on_rect.bottom = center_on_rect.top + owner->height * window_impl->window_scale; - _gdk_win32_adjust_client_rect (GDK_WINDOW (owner), ¢er_on_rect); + _gdk_win32_adjust_client_rect (GDK_SURFACE (owner), ¢er_on_rect); center = TRUE; } @@ -1249,14 +1249,14 @@ show_window_internal (GdkWindow *window, y = center_on_rect.top + ((center_on_rect.bottom - center_on_rect.top) - (window_rect.bottom - window_rect.top)) / 2; } - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED, x, y, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER)); } if (!already_mapped && - GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL) + GDK_SURFACE_TYPE (window) == GDK_SURFACE_TOPLEVEL) { /* Ensure new windows are fully onscreen */ RECT window_rect; @@ -1264,9 +1264,9 @@ show_window_internal (GdkWindow *window, MONITORINFO mi; int x, y; - GetWindowRect (GDK_WINDOW_HWND (window), &window_rect); + GetWindowRect (GDK_SURFACE_HWND (window), &window_rect); - monitor = MonitorFromWindow (GDK_WINDOW_HWND (window), MONITOR_DEFAULTTONEAREST); + monitor = MonitorFromWindow (GDK_SURFACE_HWND (window), MONITOR_DEFAULTTONEAREST); mi.cbSize = sizeof (mi); if (monitor && GetMonitorInfo (monitor, &mi)) { @@ -1298,7 +1298,7 @@ show_window_internal (GdkWindow *window, } if (x != window_rect.left || y != window_rect.top) - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED, window_rect.left, window_rect.top, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER)); @@ -1306,29 +1306,29 @@ show_window_internal (GdkWindow *window, } - if (window->state & GDK_WINDOW_STATE_FULLSCREEN) + if (window->state & GDK_SURFACE_STATE_FULLSCREEN) { - gdk_window_fullscreen (window); + gdk_surface_fullscreen (window); } - else if (window->state & GDK_WINDOW_STATE_MAXIMIZED) + else if (window->state & GDK_SURFACE_STATE_MAXIMIZED) { GtkShowWindow (window, SW_MAXIMIZE); } - else if (window->state & GDK_WINDOW_STATE_ICONIFIED) + else if (window->state & GDK_SURFACE_STATE_ICONIFIED) { if (focus_on_map) GtkShowWindow (window, SW_RESTORE); else GtkShowWindow (window, SW_SHOWNOACTIVATE); } - else if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP || !focus_on_map) + else if (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP || !focus_on_map) { - if (!IsWindowVisible (GDK_WINDOW_HWND (window))) + if (!IsWindowVisible (GDK_SURFACE_HWND (window))) GtkShowWindow (window, SW_SHOWNOACTIVATE); else GtkShowWindow (window, SW_SHOWNA); } - else if (!IsWindowVisible (GDK_WINDOW_HWND (window))) + else if (!IsWindowVisible (GDK_SURFACE_HWND (window))) { GtkShowWindow (window, SW_SHOWNORMAL); } @@ -1338,52 +1338,52 @@ show_window_internal (GdkWindow *window, } /* Sync STATE_ABOVE to TOPMOST */ - if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_TEMP && - (((window->state & GDK_WINDOW_STATE_ABOVE) && + if (GDK_SURFACE_TYPE (window) != GDK_SURFACE_TEMP && + (((window->state & GDK_SURFACE_STATE_ABOVE) && !(exstyle & WS_EX_TOPMOST)) || - (!(window->state & GDK_WINDOW_STATE_ABOVE) && + (!(window->state & GDK_SURFACE_STATE_ABOVE) && (exstyle & WS_EX_TOPMOST)))) { - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), - (window->state & GDK_WINDOW_STATE_ABOVE)?HWND_TOPMOST:HWND_NOTOPMOST, + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), + (window->state & GDK_SURFACE_STATE_ABOVE)?HWND_TOPMOST:HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE)); } } static void -gdk_win32_window_show (GdkWindow *window, +gdk_win32_surface_show (GdkSurface *window, gboolean already_mapped) { show_window_internal (window, FALSE, FALSE); } static void -gdk_win32_window_hide (GdkWindow *window) +gdk_win32_surface_hide (GdkSurface *window) { if (window->destroyed) return; - GDK_NOTE (MISC, g_print ("gdk_win32_window_hide: %p: %s\n", - GDK_WINDOW_HWND (window), - _gdk_win32_window_state_to_string (window->state))); + GDK_NOTE (MISC, g_print ("gdk_win32_surface_hide: %p: %s\n", + GDK_SURFACE_HWND (window), + _gdk_win32_surface_state_to_string (window->state))); - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) gdk_synthesize_window_state (window, 0, - GDK_WINDOW_STATE_WITHDRAWN); + GDK_SURFACE_STATE_WITHDRAWN); - _gdk_window_clear_update_area (window); + _gdk_surface_clear_update_area (window); - if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL) - ShowOwnedPopups (GDK_WINDOW_HWND (window), FALSE); + if (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TOPLEVEL) + ShowOwnedPopups (GDK_SURFACE_HWND (window), FALSE); /* Use SetWindowPos to hide transparent windows so automatic redraws * in other windows can be suppressed. */ - if (GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE) & WS_EX_TRANSPARENT) + if (GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE) & WS_EX_TRANSPARENT) { - SetWindowPos (GDK_WINDOW_HWND (window), SWP_NOZORDER_SPECIFIED, + SetWindowPos (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOREDRAW | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE); } @@ -1394,45 +1394,45 @@ gdk_win32_window_hide (GdkWindow *window) } static void -gdk_win32_window_withdraw (GdkWindow *window) +gdk_win32_surface_withdraw (GdkSurface *window) { if (window->destroyed) return; - GDK_NOTE (MISC, g_print ("gdk_win32_window_withdraw: %p: %s\n", - GDK_WINDOW_HWND (window), - _gdk_win32_window_state_to_string (window->state))); + GDK_NOTE (MISC, g_print ("gdk_win32_surface_withdraw: %p: %s\n", + GDK_SURFACE_HWND (window), + _gdk_win32_surface_state_to_string (window->state))); - gdk_window_hide (window); /* ??? */ + gdk_surface_hide (window); /* ??? */ } static void -gdk_win32_window_move (GdkWindow *window, +gdk_win32_surface_move (GdkSurface *window, gint x, gint y) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - GDK_NOTE (MISC, g_print ("gdk_win32_window_move: %p: %+d%+d\n", - GDK_WINDOW_HWND (window), x, y)); + GDK_NOTE (MISC, g_print ("gdk_win32_surface_move: %p: %+d%+d\n", + GDK_SURFACE_HWND (window), x, y)); - if (window->state & GDK_WINDOW_STATE_FULLSCREEN) + if (window->state & GDK_SURFACE_STATE_FULLSCREEN) return; - /* Don't check GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD. + /* Don't check GDK_SURFACE_TYPE (window) == GDK_SURFACE_CHILD. * Foreign windows (another app's windows) might be children of our * windows! Especially in the case of gtkplug/socket. */ - if (GetAncestor (GDK_WINDOW_HWND (window), GA_PARENT) != GetDesktopWindow ()) + if (GetAncestor (GDK_SURFACE_HWND (window), GA_PARENT) != GetDesktopWindow ()) { - _gdk_window_move_resize_child (window, x, y, window->width, window->height); + _gdk_surface_move_resize_child (window, x, y, window->width, window->height); } else { RECT outer_rect; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); get_outer_rect (window, window->width, window->height, &outer_rect); @@ -1440,11 +1440,11 @@ gdk_win32_window_move (GdkWindow *window, GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,0,0," "NOACTIVATE|NOSIZE|NOZORDER)\n", - GDK_WINDOW_HWND (window), + GDK_SURFACE_HWND (window), (x - _gdk_offset_x) * impl->window_scale, (y - _gdk_offset_y) * impl->window_scale)); - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED, (x - _gdk_offset_x) * impl->window_scale, (y - _gdk_offset_y) * impl->window_scale, @@ -1454,12 +1454,12 @@ gdk_win32_window_move (GdkWindow *window, } static void -gdk_win32_window_resize (GdkWindow *window, +gdk_win32_surface_resize (GdkSurface *window, gint width, gint height) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (width < 1) @@ -1467,30 +1467,30 @@ gdk_win32_window_resize (GdkWindow *window, if (height < 1) height = 1; - GDK_NOTE (MISC, g_print ("gdk_win32_window_resize: %p: %dx%d\n", - GDK_WINDOW_HWND (window), width, height)); + GDK_NOTE (MISC, g_print ("gdk_win32_surface_resize: %p: %dx%d\n", + GDK_SURFACE_HWND (window), width, height)); - if (window->state & GDK_WINDOW_STATE_FULLSCREEN) + if (window->state & GDK_SURFACE_STATE_FULLSCREEN) return; - if (GetAncestor (GDK_WINDOW_HWND (window), GA_PARENT) != GetDesktopWindow ()) + if (GetAncestor (GDK_SURFACE_HWND (window), GA_PARENT) != GetDesktopWindow ()) { - _gdk_window_move_resize_child (window, window->x, window->y, width, height); + _gdk_surface_move_resize_child (window, window->x, window->y, width, height); } else { RECT outer_rect; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); get_outer_rect (window, width, height, &outer_rect); GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,0,0,%ld,%ld," "NOACTIVATE|NOMOVE|NOZORDER)\n", - GDK_WINDOW_HWND (window), + GDK_SURFACE_HWND (window), outer_rect.right - outer_rect.left, outer_rect.bottom - outer_rect.top)); - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED, 0, 0, outer_rect.right - outer_rect.left, @@ -1501,15 +1501,15 @@ gdk_win32_window_resize (GdkWindow *window, } static void -gdk_win32_window_move_resize_internal (GdkWindow *window, +gdk_win32_surface_move_resize_internal (GdkSurface *window, gint x, gint y, gint width, gint height) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (width < 1) @@ -1517,21 +1517,21 @@ gdk_win32_window_move_resize_internal (GdkWindow *window, if (height < 1) height = 1; - if (window->state & GDK_WINDOW_STATE_FULLSCREEN) + if (window->state & GDK_SURFACE_STATE_FULLSCREEN) return; - GDK_NOTE (MISC, g_print ("gdk_win32_window_move_resize: %p: %dx%d@%+d%+d\n", - GDK_WINDOW_HWND (window), + GDK_NOTE (MISC, g_print ("gdk_win32_surface_move_resize: %p: %dx%d@%+d%+d\n", + GDK_SURFACE_HWND (window), width, height, x, y)); - if (GetAncestor (GDK_WINDOW_HWND (window), GA_PARENT) != GetDesktopWindow ()) + if (GetAncestor (GDK_SURFACE_HWND (window), GA_PARENT) != GetDesktopWindow ()) { - _gdk_window_move_resize_child (window, x, y, width, height); + _gdk_surface_move_resize_child (window, x, y, width, height); } else { RECT outer_rect; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); get_outer_rect (window, width, height, &outer_rect); @@ -1539,13 +1539,13 @@ gdk_win32_window_move_resize_internal (GdkWindow *window, GDK_NOTE (MISC, g_print ("... SetWindowPos(%p,NULL,%d,%d,%ld,%ld," "NOACTIVATE|NOZORDER)\n", - GDK_WINDOW_HWND (window), + GDK_SURFACE_HWND (window), (x - _gdk_offset_x) * impl->window_scale, (y - _gdk_offset_y) * impl->window_scale, outer_rect.right - outer_rect.left, outer_rect.bottom - outer_rect.top)); - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED, (x - _gdk_offset_x) * impl->window_scale, (y - _gdk_offset_y) * impl->window_scale, @@ -1556,36 +1556,36 @@ gdk_win32_window_move_resize_internal (GdkWindow *window, } static void -gdk_win32_window_move_resize (GdkWindow *window, +gdk_win32_surface_move_resize (GdkSurface *window, gboolean with_move, gint x, gint y, gint width, gint height) { - GdkWindowImplWin32 *window_impl; + GdkSurfaceImplWin32 *window_impl; - window_impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + window_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); window_impl->inhibit_configure = TRUE; /* We ignore changes to the window being moved or resized by the user, as we don't want to fight the user */ - if (GDK_WINDOW_HWND (window) == _modal_move_resize_window) + if (GDK_SURFACE_HWND (window) == _modal_move_resize_window) goto out; if (with_move && (width < 0 && height < 0)) { - gdk_win32_window_move (window, x, y); + gdk_win32_surface_move (window, x, y); } else { if (with_move) { - gdk_win32_window_move_resize_internal (window, x, y, width, height); + gdk_win32_surface_move_resize_internal (window, x, y, width, height); } else { - gdk_win32_window_resize (window, width, height); + gdk_win32_surface_resize (window, width, height); } } @@ -1597,15 +1597,15 @@ gdk_win32_window_move_resize (GdkWindow *window, } static void -gdk_win32_window_raise (GdkWindow *window) +gdk_win32_surface_raise (GdkSurface *window) { - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { - GDK_NOTE (MISC, g_print ("gdk_win32_window_raise: %p\n", - GDK_WINDOW_HWND (window))); + GDK_NOTE (MISC, g_print ("gdk_win32_surface_raise: %p\n", + GDK_SURFACE_HWND (window))); - if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP) - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOPMOST, + if (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP) + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE)); else if (window->accept_focus) @@ -1613,42 +1613,42 @@ gdk_win32_window_raise (GdkWindow *window) * fail when for example dragging a window belonging to a different * application at the time of a gtk_window_present() call due to focus * stealing prevention. */ - SetForegroundWindow (GDK_WINDOW_HWND (window)); + SetForegroundWindow (GDK_SURFACE_HWND (window)); else - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOP, + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE)); } } static void -gdk_win32_window_lower (GdkWindow *window) +gdk_win32_surface_lower (GdkSurface *window) { - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { - GDK_NOTE (MISC, g_print ("gdk_win32_window_lower: %p\n" + GDK_NOTE (MISC, g_print ("gdk_win32_surface_lower: %p\n" "... SetWindowPos(%p,HWND_BOTTOM,0,0,0,0," "NOACTIVATE|NOMOVE|NOSIZE)\n", - GDK_WINDOW_HWND (window), - GDK_WINDOW_HWND (window))); + GDK_SURFACE_HWND (window), + GDK_SURFACE_HWND (window))); - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_BOTTOM, + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE)); } } static void -gdk_win32_window_set_urgency_hint (GdkWindow *window, +gdk_win32_surface_set_urgency_hint (GdkSurface *window, gboolean urgent) { FLASHWINFO flashwinfo; typedef BOOL (WINAPI *PFN_FlashWindowEx) (FLASHWINFO*); PFN_FlashWindowEx flashWindowEx = NULL; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; flashWindowEx = (PFN_FlashWindowEx) GetProcAddress (GetModuleHandle ("user32.dll"), "FlashWindowEx"); @@ -1656,7 +1656,7 @@ gdk_win32_window_set_urgency_hint (GdkWindow *window, if (flashWindowEx) { flashwinfo.cbSize = sizeof (flashwinfo); - flashwinfo.hwnd = GDK_WINDOW_HWND (window); + flashwinfo.hwnd = GDK_SURFACE_HWND (window); if (urgent) flashwinfo.dwFlags = FLASHW_ALL | FLASHW_TIMER; else @@ -1668,22 +1668,22 @@ gdk_win32_window_set_urgency_hint (GdkWindow *window, } else { - FlashWindow (GDK_WINDOW_HWND (window), urgent); + FlashWindow (GDK_SURFACE_HWND (window), urgent); } } static gboolean -get_effective_window_decorations (GdkWindow *window, +get_effective_window_decorations (GdkSurface *window, GdkWMDecoration *decoration) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - impl = (GdkWindowImplWin32 *)window->impl; + impl = (GdkSurfaceImplWin32 *)window->impl; - if (gdk_window_get_decorations (window, decoration)) + if (gdk_surface_get_decorations (window, decoration)) return TRUE; - if (window->window_type != GDK_WINDOW_TOPLEVEL) + if (window->window_type != GDK_SURFACE_TOPLEVEL) { return FALSE; } @@ -1695,13 +1695,13 @@ get_effective_window_decorations (GdkWindow *window, { *decoration = GDK_DECOR_ALL | GDK_DECOR_RESIZEH | GDK_DECOR_MAXIMIZE; - if (impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG || - impl->type_hint == GDK_WINDOW_TYPE_HINT_MENU || - impl->type_hint == GDK_WINDOW_TYPE_HINT_TOOLBAR) + if (impl->type_hint == GDK_SURFACE_TYPE_HINT_DIALOG || + impl->type_hint == GDK_SURFACE_TYPE_HINT_MENU || + impl->type_hint == GDK_SURFACE_TYPE_HINT_TOOLBAR) { *decoration |= GDK_DECOR_MINIMIZE; } - else if (impl->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN) + else if (impl->type_hint == GDK_SURFACE_TYPE_HINT_SPLASHSCREEN) { *decoration |= GDK_DECOR_MENU | GDK_DECOR_MINIMIZE; } @@ -1711,9 +1711,9 @@ get_effective_window_decorations (GdkWindow *window, else if (impl->hint_flags & GDK_HINT_MAX_SIZE) { *decoration = GDK_DECOR_ALL | GDK_DECOR_MAXIMIZE; - if (impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG || - impl->type_hint == GDK_WINDOW_TYPE_HINT_MENU || - impl->type_hint == GDK_WINDOW_TYPE_HINT_TOOLBAR) + if (impl->type_hint == GDK_SURFACE_TYPE_HINT_DIALOG || + impl->type_hint == GDK_SURFACE_TYPE_HINT_MENU || + impl->type_hint == GDK_SURFACE_TYPE_HINT_TOOLBAR) { *decoration |= GDK_DECOR_MINIMIZE; } @@ -1724,35 +1724,35 @@ get_effective_window_decorations (GdkWindow *window, { switch (impl->type_hint) { - case GDK_WINDOW_TYPE_HINT_DIALOG: + case GDK_SURFACE_TYPE_HINT_DIALOG: *decoration = (GDK_DECOR_ALL | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE); return TRUE; - case GDK_WINDOW_TYPE_HINT_MENU: + case GDK_SURFACE_TYPE_HINT_MENU: *decoration = (GDK_DECOR_ALL | GDK_DECOR_RESIZEH | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE); return TRUE; - case GDK_WINDOW_TYPE_HINT_TOOLBAR: - case GDK_WINDOW_TYPE_HINT_UTILITY: - gdk_window_set_skip_taskbar_hint (window, TRUE); - gdk_window_set_skip_pager_hint (window, TRUE); + case GDK_SURFACE_TYPE_HINT_TOOLBAR: + case GDK_SURFACE_TYPE_HINT_UTILITY: + gdk_surface_set_skip_taskbar_hint (window, TRUE); + gdk_surface_set_skip_pager_hint (window, TRUE); *decoration = (GDK_DECOR_ALL | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE); return TRUE; - case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: + case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN: *decoration = (GDK_DECOR_ALL | GDK_DECOR_RESIZEH | GDK_DECOR_MENU | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE); return TRUE; - case GDK_WINDOW_TYPE_HINT_DOCK: + case GDK_SURFACE_TYPE_HINT_DOCK: return FALSE; - case GDK_WINDOW_TYPE_HINT_DESKTOP: + case GDK_SURFACE_TYPE_HINT_DESKTOP: return FALSE; default: /* Fall thru */ - case GDK_WINDOW_TYPE_HINT_NORMAL: + case GDK_SURFACE_TYPE_HINT_NORMAL: *decoration = GDK_DECOR_ALL; return TRUE; } @@ -1762,22 +1762,22 @@ get_effective_window_decorations (GdkWindow *window, } static void -gdk_win32_window_set_geometry_hints (GdkWindow *window, +gdk_win32_surface_set_geometry_hints (GdkSurface *window, const GdkGeometry *geometry, - GdkWindowHints geom_mask) + GdkSurfaceHints geom_mask) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; FullscreenInfo *fi; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - GDK_NOTE (MISC, g_print ("gdk_window_set_geometry_hints: %p\n", - GDK_WINDOW_HWND (window))); + GDK_NOTE (MISC, g_print ("gdk_surface_set_geometry_hints: %p\n", + GDK_SURFACE_HWND (window))); - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); fi = g_object_get_data (G_OBJECT (window), "fullscreen-info"); if (fi) @@ -1826,70 +1826,70 @@ gdk_win32_window_set_geometry_hints (GdkWindow *window, GDK_NOTE (MISC, g_print ("... GRAVITY: %d\n", geometry->win_gravity)); } - _gdk_win32_window_update_style_bits (window); + _gdk_win32_surface_update_style_bits (window); } static void -gdk_win32_window_set_title (GdkWindow *window, +gdk_win32_surface_set_title (GdkSurface *window, const gchar *title) { wchar_t *wtitle; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); g_return_if_fail (title != NULL); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; /* Empty window titles not allowed, so set it to just a period. */ if (!title[0]) title = "."; - GDK_NOTE (MISC, g_print ("gdk_window_set_title: %p: %s\n", - GDK_WINDOW_HWND (window), title)); + GDK_NOTE (MISC, g_print ("gdk_surface_set_title: %p: %s\n", + GDK_SURFACE_HWND (window), title)); - GDK_NOTE (MISC_OR_EVENTS, title = g_strdup_printf ("%p %s", GDK_WINDOW_HWND (window), title)); + GDK_NOTE (MISC_OR_EVENTS, title = g_strdup_printf ("%p %s", GDK_SURFACE_HWND (window), title)); wtitle = g_utf8_to_utf16 (title, -1, NULL, NULL, NULL); - API_CALL (SetWindowTextW, (GDK_WINDOW_HWND (window), wtitle)); + API_CALL (SetWindowTextW, (GDK_SURFACE_HWND (window), wtitle)); g_free (wtitle); GDK_NOTE (MISC_OR_EVENTS, g_free ((char *) title)); } static void -gdk_win32_window_set_role (GdkWindow *window, +gdk_win32_surface_set_role (GdkSurface *window, const gchar *role) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - GDK_NOTE (MISC, g_print ("gdk_window_set_role: %p: %s\n", - GDK_WINDOW_HWND (window), + GDK_NOTE (MISC, g_print ("gdk_surface_set_role: %p: %s\n", + GDK_SURFACE_HWND (window), (role ? role : "NULL"))); /* XXX */ } static void -gdk_win32_window_set_transient_for (GdkWindow *window, - GdkWindow *parent) +gdk_win32_surface_set_transient_for (GdkSurface *window, + GdkSurface *parent) { HWND window_id, parent_id; LONG_PTR old_ptr; DWORD w32_error; - GdkWindowImplWin32 *window_impl = GDK_WINDOW_IMPL_WIN32 (window->impl); - GdkWindowImplWin32 *parent_impl = NULL; + GdkSurfaceImplWin32 *window_impl = GDK_SURFACE_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *parent_impl = NULL; GSList *item; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - window_id = GDK_WINDOW_HWND (window); - parent_id = parent != NULL ? GDK_WINDOW_HWND (parent) : NULL; + window_id = GDK_SURFACE_HWND (window); + parent_id = parent != NULL ? GDK_SURFACE_HWND (parent) : NULL; - GDK_NOTE (MISC, g_print ("gdk_window_set_transient_for: %p: %p\n", window_id, parent_id)); + GDK_NOTE (MISC, g_print ("gdk_surface_set_transient_for: %p: %p\n", window_id, parent_id)); - if (GDK_WINDOW_DESTROYED (window) || (parent && GDK_WINDOW_DESTROYED (parent))) + if (GDK_SURFACE_DESTROYED (window) || (parent && GDK_SURFACE_DESTROYED (parent))) { - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) GDK_NOTE (MISC, g_print ("... destroyed!\n")); else GDK_NOTE (MISC, g_print ("... owner destroyed!\n")); @@ -1899,7 +1899,7 @@ gdk_win32_window_set_transient_for (GdkWindow *window, if (parent == NULL) { - GdkWindowImplWin32 *trans_impl = GDK_WINDOW_IMPL_WIN32 (window_impl->transient_owner->impl); + GdkSurfaceImplWin32 *trans_impl = GDK_SURFACE_IMPL_WIN32 (window_impl->transient_owner->impl); if (trans_impl->transient_children != NULL) { item = g_slist_find (trans_impl->transient_children, window); @@ -1919,7 +1919,7 @@ gdk_win32_window_set_transient_for (GdkWindow *window, } else { - parent_impl = GDK_WINDOW_IMPL_WIN32 (parent->impl); + parent_impl = GDK_SURFACE_IMPL_WIN32 (parent->impl); parent_impl->transient_children = g_slist_append (parent_impl->transient_children, window); g_object_ref (G_OBJECT (window)); @@ -1954,14 +1954,14 @@ gdk_win32_window_set_transient_for (GdkWindow *window, } void -_gdk_push_modal_window (GdkWindow *window) +_gdk_push_modal_window (GdkSurface *window) { modal_window_stack = g_slist_prepend (modal_window_stack, window); } void -_gdk_remove_modal_window (GdkWindow *window) +_gdk_remove_modal_window (GdkSurface *window) { GSList *tmp; @@ -1982,35 +1982,35 @@ _gdk_remove_modal_window (GdkWindow *window) } gboolean -_gdk_modal_blocked (GdkWindow *window) +_gdk_modal_blocked (GdkSurface *window) { GSList *l; gboolean found_any = FALSE; for (l = modal_window_stack; l != NULL; l = l->next) { - GdkWindow *modal = l->data; + GdkSurface *modal = l->data; if (modal == window) return FALSE; - if (GDK_WINDOW_IS_MAPPED (modal)) + if (GDK_SURFACE_IS_MAPPED (modal)) found_any = TRUE; } return found_any; } -GdkWindow * +GdkSurface * _gdk_modal_current (void) { GSList *l; for (l = modal_window_stack; l != NULL; l = l->next) { - GdkWindow *modal = l->data; + GdkSurface *modal = l->data; - if (GDK_WINDOW_IS_MAPPED (modal)) + if (GDK_SURFACE_IS_MAPPED (modal)) return modal; } @@ -2018,7 +2018,7 @@ _gdk_modal_current (void) } static void -gdk_win32_window_get_geometry (GdkWindow *window, +gdk_win32_surface_get_geometry (GdkSurface *window, gint *x, gint *y, gint *width, @@ -2027,31 +2027,31 @@ gdk_win32_window_get_geometry (GdkWindow *window, GdkDisplay *display; gboolean window_is_root; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { RECT rect; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - API_CALL (GetClientRect, (GDK_WINDOW_HWND (window), &rect)); + API_CALL (GetClientRect, (GDK_SURFACE_HWND (window), &rect)); POINT pt; - GdkWindow *parent = gdk_window_get_parent (window); + GdkSurface *parent = gdk_surface_get_parent (window); pt.x = rect.left; pt.y = rect.top; - ClientToScreen (GDK_WINDOW_HWND (window), &pt); + ClientToScreen (GDK_SURFACE_HWND (window), &pt); if (parent) - ScreenToClient (GDK_WINDOW_HWND (parent), &pt); + ScreenToClient (GDK_SURFACE_HWND (parent), &pt); rect.left = pt.x; rect.top = pt.y; pt.x = rect.right; pt.y = rect.bottom; - ClientToScreen (GDK_WINDOW_HWND (window), &pt); + ClientToScreen (GDK_SURFACE_HWND (window), &pt); if (parent) - ScreenToClient (GDK_WINDOW_HWND (parent), &pt); + ScreenToClient (GDK_SURFACE_HWND (parent), &pt); rect.right = pt.x; rect.bottom = pt.y; @@ -2072,8 +2072,8 @@ gdk_win32_window_get_geometry (GdkWindow *window, if (height) *height = (rect.bottom - rect.top) / impl->window_scale; - GDK_NOTE (MISC, g_print ("gdk_win32_window_get_geometry: %p: %ldx%ld@%+ld%\n", - GDK_WINDOW_HWND (window), + GDK_NOTE (MISC, g_print ("gdk_win32_surface_get_geometry: %p: %ldx%ld@%+ld%\n", + GDK_SURFACE_HWND (window), (rect.right - rect.left) / impl->window_scale, (rect.bottom - rect.top) / impl->window_scale, rect.left, rect.top)); @@ -2081,7 +2081,7 @@ gdk_win32_window_get_geometry (GdkWindow *window, } static void -gdk_win32_window_get_root_coords (GdkWindow *window, +gdk_win32_surface_get_root_coords (GdkSurface *window, gint x, gint y, gint *root_x, @@ -2090,11 +2090,11 @@ gdk_win32_window_get_root_coords (GdkWindow *window, gint tx; gint ty; POINT pt; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); pt.x = x * impl->window_scale; pt.y = y * impl->window_scale; - ClientToScreen (GDK_WINDOW_HWND (window), &pt); + ClientToScreen (GDK_SURFACE_HWND (window), &pt); tx = pt.x; ty = pt.y; @@ -2103,8 +2103,8 @@ gdk_win32_window_get_root_coords (GdkWindow *window, if (root_y) *root_y = (ty + _gdk_offset_y) / impl->window_scale; - GDK_NOTE (MISC, g_print ("gdk_win32_window_get_root_coords: %p: %+d%+d %+d%+d\n", - GDK_WINDOW_HWND (window), + GDK_NOTE (MISC, g_print ("gdk_win32_surface_get_root_coords: %p: %+d%+d %+d%+d\n", + GDK_SURFACE_HWND (window), x * impl->window_scale, y * impl->window_scale, (tx + _gdk_offset_x) / impl->window_scale, @@ -2112,22 +2112,22 @@ gdk_win32_window_get_root_coords (GdkWindow *window, } static void -gdk_win32_window_restack_toplevel (GdkWindow *window, - GdkWindow *sibling, +gdk_win32_surface_restack_toplevel (GdkSurface *window, + GdkSurface *sibling, gboolean above) { // ### TODO } static void -gdk_win32_window_get_frame_extents (GdkWindow *window, +gdk_win32_surface_get_frame_extents (GdkSurface *window, GdkRectangle *rect) { HWND hwnd; RECT r; - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); g_return_if_fail (rect != NULL); rect->x = 0; @@ -2135,17 +2135,17 @@ gdk_win32_window_get_frame_extents (GdkWindow *window, rect->width = 1; rect->height = 1; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - /* FIXME: window is documented to be a toplevel GdkWindow, so is it really + /* FIXME: window is documented to be a toplevel GdkSurface, so is it really * necessary to walk its parent chain? */ while (window->parent && window->parent->parent) window = window->parent; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); - hwnd = GDK_WINDOW_HWND (window); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); + hwnd = GDK_SURFACE_HWND (window); API_CALL (GetWindowRect, (hwnd, &r)); /* Initialize to real, unscaled size */ @@ -2162,23 +2162,23 @@ gdk_win32_window_get_frame_extents (GdkWindow *window, rect->x = r.left / impl->window_scale + _gdk_offset_x; rect->y = r.top / impl->window_scale + _gdk_offset_y; - GDK_NOTE (MISC, g_print ("gdk_window_get_frame_extents: %p: %ldx%ld@%+ld%+ld\n", - GDK_WINDOW_HWND (window), + GDK_NOTE (MISC, g_print ("gdk_surface_get_frame_extents: %p: %ldx%ld@%+ld%+ld\n", + GDK_SURFACE_HWND (window), rect->width, rect->height, rect->x, rect->y)); } static gboolean -gdk_window_win32_get_device_state (GdkWindow *window, +gdk_surface_win32_get_device_state (GdkSurface *window, GdkDevice *device, gdouble *x, gdouble *y, GdkModifierType *mask) { - GdkWindow *child; + GdkSurface *child; - g_return_val_if_fail (window == NULL || GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (window == NULL || GDK_IS_SURFACE (window), FALSE); GDK_DEVICE_GET_CLASS (device)->query_state (device, window, &child, @@ -2201,27 +2201,27 @@ gdk_display_warp_device (GdkDisplay *display, } static GdkEventMask -gdk_win32_window_get_events (GdkWindow *window) +gdk_win32_surface_get_events (GdkSurface *window) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return 0; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); return impl->native_event_mask; } static void -gdk_win32_window_set_events (GdkWindow *window, +gdk_win32_surface_set_events (GdkSurface *window, GdkEventMask event_mask) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - /* gdk_window_new() always sets the GDK_STRUCTURE_MASK, so better + /* gdk_surface_new() always sets the GDK_STRUCTURE_MASK, so better * set it here, too. Not that I know or remember why it is * necessary, will have to test some day. */ @@ -2229,14 +2229,14 @@ gdk_win32_window_set_events (GdkWindow *window, } static void -do_shape_combine_region (GdkWindow *window, +do_shape_combine_region (GdkSurface *window, HRGN hrgn, gint x, gint y) { RECT rect; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - GetClientRect (GDK_WINDOW_HWND (window), &rect); + GetClientRect (GDK_SURFACE_HWND (window), &rect); _gdk_win32_adjust_client_rect (window, &rect); @@ -2244,21 +2244,21 @@ do_shape_combine_region (GdkWindow *window, OffsetRgn (hrgn, x, y); /* If this is a top-level window, add the title bar to the region */ - if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL) + if (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TOPLEVEL) { HRGN tmp = CreateRectRgn (0, 0, rect.right - rect.left, -rect.top); CombineRgn (hrgn, hrgn, tmp, RGN_OR); DeleteObject (tmp); } - SetWindowRgn (GDK_WINDOW_HWND (window), hrgn, TRUE); + SetWindowRgn (GDK_SURFACE_HWND (window), hrgn, TRUE); } static void -gdk_win32_window_set_accept_focus (GdkWindow *window, +gdk_win32_surface_set_accept_focus (GdkSurface *window, gboolean accept_focus) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); accept_focus = accept_focus != FALSE; @@ -2267,10 +2267,10 @@ gdk_win32_window_set_accept_focus (GdkWindow *window, } static void -gdk_win32_window_set_focus_on_map (GdkWindow *window, +gdk_win32_surface_set_focus_on_map (GdkSurface *window, gboolean focus_on_map) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); focus_on_map = focus_on_map != FALSE; @@ -2279,7 +2279,7 @@ gdk_win32_window_set_focus_on_map (GdkWindow *window, } static void -gdk_win32_window_set_icon_list (GdkWindow *window, +gdk_win32_surface_set_icon_list (GdkSurface *window, GList *textures) { GdkTexture *big_texture, *small_texture; @@ -2288,14 +2288,14 @@ gdk_win32_window_set_icon_list (GdkWindow *window, gint w, h; gint dw, dh, diff; HICON small_hicon, big_hicon; - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window) || textures == NULL) + if (GDK_SURFACE_DESTROYED (window) || textures == NULL) return; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); /* ideal sizes for small and large icons */ big_w = GetSystemMetrics (SM_CXICON); @@ -2343,9 +2343,9 @@ gdk_win32_window_set_icon_list (GdkWindow *window, g_object_unref (small_texture); /* Set the icons */ - SendMessageW (GDK_WINDOW_HWND (window), WM_SETICON, ICON_BIG, + SendMessageW (GDK_SURFACE_HWND (window), WM_SETICON, ICON_BIG, (LPARAM)big_hicon); - SendMessageW (GDK_WINDOW_HWND (window), WM_SETICON, ICON_SMALL, + SendMessageW (GDK_SURFACE_HWND (window), WM_SETICON, ICON_SMALL, (LPARAM)small_hicon); /* Store the icons, destroying any previous icons */ @@ -2358,7 +2358,7 @@ gdk_win32_window_set_icon_list (GdkWindow *window, } static void -gdk_win32_window_set_icon_name (GdkWindow *window, +gdk_win32_surface_set_icon_name (GdkSurface *window, const gchar *name) { /* In case I manage to confuse this again (or somebody else does): @@ -2368,9 +2368,9 @@ gdk_win32_window_set_icon_name (GdkWindow *window, * naming stuff. */ - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; #if 0 @@ -2382,34 +2382,34 @@ gdk_win32_window_set_icon_name (GdkWindow *window, * chars or system codepage, and use either the W or A version of * SetWindowText(), depending on Windows version. */ - API_CALL (SetWindowText, (GDK_WINDOW_HWND (window), name)); + API_CALL (SetWindowText, (GDK_SURFACE_HWND (window), name)); #endif } -static GdkWindow * -gdk_win32_window_get_group (GdkWindow *window) +static GdkSurface * +gdk_win32_surface_get_group (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return NULL; - g_warning ("gdk_window_get_group not yet implemented"); + g_warning ("gdk_surface_get_group not yet implemented"); return NULL; } static void -gdk_win32_window_set_group (GdkWindow *window, - GdkWindow *leader) +gdk_win32_surface_set_group (GdkSurface *window, + GdkSurface *leader) { - g_return_if_fail (GDK_IS_WINDOW (window)); - g_return_if_fail (leader == NULL || GDK_IS_WINDOW (leader)); + g_return_if_fail (GDK_IS_SURFACE (window)); + g_return_if_fail (leader == NULL || GDK_IS_SURFACE (leader)); - if (GDK_WINDOW_DESTROYED (window) || GDK_WINDOW_DESTROYED (leader)) + if (GDK_SURFACE_DESTROYED (window) || GDK_SURFACE_DESTROYED (leader)) return; - g_warning ("gdk_window_set_group not implemented"); + g_warning ("gdk_surface_set_group not implemented"); } static void @@ -2431,7 +2431,7 @@ update_single_bit (LONG *style, /* * Returns TRUE if window has no decorations. * Usually it means CSD windows, because GTK - * calls gdk_window_set_decorations (window, 0); + * calls gdk_surface_set_decorations (window, 0); * This is used to decide whether a toplevel should * be made layered, thus it * only returns TRUE for toplevels (until GTK minimal @@ -2439,22 +2439,22 @@ update_single_bit (LONG *style, * because only toplevels can be layered). */ gboolean -_gdk_win32_window_lacks_wm_decorations (GdkWindow *window) +_gdk_win32_surface_lacks_wm_decorations (GdkSurface *window) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; LONG style; gboolean has_any_decorations; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return FALSE; /* only toplevels can be layered */ if (!WINDOW_IS_TOPLEVEL (window)) return FALSE; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - /* This is because GTK calls gdk_window_set_decorations (window, 0), + /* This is because GTK calls gdk_surface_set_decorations (window, 0), * even though GdkWMDecoration docs indicate that 0 does NOT mean * "no decorations". */ @@ -2462,21 +2462,21 @@ _gdk_win32_window_lacks_wm_decorations (GdkWindow *window) *impl->decorations == 0) return TRUE; - if (GDK_WINDOW_HWND (window) == 0) + if (GDK_SURFACE_HWND (window) == 0) return FALSE; - style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE); + style = GetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE); if (style == 0) { DWORD w32_error = GetLastError (); GDK_NOTE (MISC, g_print ("Failed to get style of window %p (handle %p): %lu\n", - window, GDK_WINDOW_HWND (window), w32_error)); + window, GDK_SURFACE_HWND (window), w32_error)); return FALSE; } - /* Keep this in sync with _gdk_win32_window_update_style_bits() */ + /* Keep this in sync with _gdk_win32_surface_update_style_bits() */ /* We don't check what get_effective_window_decorations() * has to say, because it gives suggestions based on * various hints, while we want *actual* decorations, @@ -2489,15 +2489,15 @@ _gdk_win32_window_lacks_wm_decorations (GdkWindow *window) has_any_decorations = TRUE; else GDK_NOTE (MISC, g_print ("Window %p (handle %p): has no decorations (style %lx)\n", - window, GDK_WINDOW_HWND (window), style)); + window, GDK_SURFACE_HWND (window), style)); return !has_any_decorations; } void -_gdk_win32_window_update_style_bits (GdkWindow *window) +_gdk_win32_surface_update_style_bits (GdkSurface *window) { - GdkWindowImplWin32 *impl = (GdkWindowImplWin32 *)window->impl; + GdkSurfaceImplWin32 *impl = (GdkSurfaceImplWin32 *)window->impl; GdkWMDecoration decorations; LONG old_style, new_style, old_exstyle, new_exstyle; gboolean all; @@ -2507,13 +2507,13 @@ _gdk_win32_window_update_style_bits (GdkWindow *window) HWND insert_after; UINT flags; - if (window->state & GDK_WINDOW_STATE_FULLSCREEN) + if (window->state & GDK_SURFACE_STATE_FULLSCREEN) return; - old_style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE); - old_exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE); + old_style = GetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE); + old_exstyle = GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE); - GetClientRect (GDK_WINDOW_HWND (window), &before); + GetClientRect (GDK_SURFACE_HWND (window), &before); after = before; AdjustWindowRectEx (&before, old_style, FALSE, old_exstyle); @@ -2525,12 +2525,12 @@ _gdk_win32_window_update_style_bits (GdkWindow *window) new_style = old_style; new_exstyle = old_exstyle; - if (window->window_type == GDK_WINDOW_TEMP) + if (window->window_type == GDK_SURFACE_TEMP) { new_exstyle |= WS_EX_TOOLWINDOW; will_be_topmost = TRUE; } - else if (impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY) + else if (impl->type_hint == GDK_SURFACE_TYPE_HINT_UTILITY) { new_exstyle |= WS_EX_TOOLWINDOW; } @@ -2549,7 +2549,7 @@ _gdk_win32_window_update_style_bits (GdkWindow *window) */ if (impl->suppress_layered == 0) { - if (_gdk_win32_window_lacks_wm_decorations (window)) + if (_gdk_win32_surface_lacks_wm_decorations (window)) impl->layered = g_strcmp0 (g_getenv ("GDK_WIN32_LAYERED"), "0") != 0; } else @@ -2563,7 +2563,7 @@ _gdk_win32_window_update_style_bits (GdkWindow *window) if (get_effective_window_decorations (window, &decorations)) { all = (decorations & GDK_DECOR_ALL); - /* Keep this in sync with the test in _gdk_win32_window_lacks_wm_decorations() */ + /* Keep this in sync with the test in _gdk_win32_surface_lacks_wm_decorations() */ update_single_bit (&new_style, all, decorations & GDK_DECOR_BORDER, WS_BORDER); update_single_bit (&new_style, all, decorations & GDK_DECOR_RESIZEH, WS_THICKFRAME); update_single_bit (&new_style, all, decorations & GDK_DECOR_TITLE, WS_CAPTION); @@ -2574,34 +2574,34 @@ _gdk_win32_window_update_style_bits (GdkWindow *window) if (old_style == new_style && old_exstyle == new_exstyle ) { - GDK_NOTE (MISC, g_print ("_gdk_win32_window_update_style_bits: %p: no change\n", - GDK_WINDOW_HWND (window))); + GDK_NOTE (MISC, g_print ("_gdk_win32_surface_update_style_bits: %p: no change\n", + GDK_SURFACE_HWND (window))); return; } if (old_style != new_style) { - GDK_NOTE (MISC, g_print ("_gdk_win32_window_update_style_bits: %p: STYLE: %s => %s\n", - GDK_WINDOW_HWND (window), - _gdk_win32_window_style_to_string (old_style), - _gdk_win32_window_style_to_string (new_style))); + GDK_NOTE (MISC, g_print ("_gdk_win32_surface_update_style_bits: %p: STYLE: %s => %s\n", + GDK_SURFACE_HWND (window), + _gdk_win32_surface_style_to_string (old_style), + _gdk_win32_surface_style_to_string (new_style))); - SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, new_style); + SetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE, new_style); } if (old_exstyle != new_exstyle) { - GDK_NOTE (MISC, g_print ("_gdk_win32_window_update_style_bits: %p: EXSTYLE: %s => %s\n", - GDK_WINDOW_HWND (window), - _gdk_win32_window_exstyle_to_string (old_exstyle), - _gdk_win32_window_exstyle_to_string (new_exstyle))); + GDK_NOTE (MISC, g_print ("_gdk_win32_surface_update_style_bits: %p: EXSTYLE: %s => %s\n", + GDK_SURFACE_HWND (window), + _gdk_win32_surface_exstyle_to_string (old_exstyle), + _gdk_win32_surface_exstyle_to_string (new_exstyle))); - SetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE, new_exstyle); + SetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE, new_exstyle); } AdjustWindowRectEx (&after, new_style, FALSE, new_exstyle); - GetWindowRect (GDK_WINDOW_HWND (window), &rect); + GetWindowRect (GDK_SURFACE_HWND (window), &rect); rect.left += after.left - before.left; rect.top += after.top - before.top; rect.right += after.right - before.right; @@ -2623,7 +2623,7 @@ _gdk_win32_window_update_style_bits (GdkWindow *window) insert_after = SWP_NOZORDER_SPECIFIED; } - SetWindowPos (GDK_WINDOW_HWND (window), insert_after, + SetWindowPos (GDK_SURFACE_HWND (window), insert_after, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, flags); @@ -2646,14 +2646,14 @@ update_single_system_menu_entry (HMENU hmenu, } static void -update_system_menu (GdkWindow *window) +update_system_menu (GdkSurface *window) { GdkWMFunction functions; BOOL all; - if (_gdk_window_get_functions (window, &functions)) + if (_gdk_surface_get_functions (window, &functions)) { - HMENU hmenu = GetSystemMenu (GDK_WINDOW_HWND (window), FALSE); + HMENU hmenu = GetSystemMenu (GDK_SURFACE_HWND (window), FALSE); all = (functions & GDK_FUNC_ALL); update_single_system_menu_entry (hmenu, all, functions & GDK_FUNC_RESIZE, SC_SIZE); @@ -2665,17 +2665,17 @@ update_system_menu (GdkWindow *window) } static void -gdk_win32_window_set_decorations (GdkWindow *window, +gdk_win32_surface_set_decorations (GdkSurface *window, GdkWMDecoration decorations) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - GDK_NOTE (MISC, g_print ("gdk_window_set_decorations: %p: %s %s%s%s%s%s%s\n", - GDK_WINDOW_HWND (window), + GDK_NOTE (MISC, g_print ("gdk_surface_set_decorations: %p: %s %s%s%s%s%s%s\n", + GDK_SURFACE_HWND (window), (decorations & GDK_DECOR_ALL ? "clearing" : "setting"), (decorations & GDK_DECOR_BORDER ? "BORDER " : ""), (decorations & GDK_DECOR_RESIZEH ? "RESIZEH " : ""), @@ -2689,18 +2689,18 @@ gdk_win32_window_set_decorations (GdkWindow *window, *impl->decorations = decorations; - _gdk_win32_window_update_style_bits (window); + _gdk_win32_surface_update_style_bits (window); } static gboolean -gdk_win32_window_get_decorations (GdkWindow *window, +gdk_win32_surface_get_decorations (GdkSurface *window, GdkWMDecoration *decorations) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (impl->decorations == NULL) return FALSE; @@ -2722,15 +2722,15 @@ get_functions_quark () } static void -gdk_win32_window_set_functions (GdkWindow *window, +gdk_win32_surface_set_functions (GdkSurface *window, GdkWMFunction functions) { GdkWMFunction* functions_copy; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - GDK_NOTE (MISC, g_print ("gdk_window_set_functions: %p: %s %s%s%s%s%s\n", - GDK_WINDOW_HWND (window), + GDK_NOTE (MISC, g_print ("gdk_surface_set_functions: %p: %s %s%s%s%s%s\n", + GDK_SURFACE_HWND (window), (functions & GDK_FUNC_ALL ? "clearing" : "setting"), (functions & GDK_FUNC_RESIZE ? "RESIZE " : ""), (functions & GDK_FUNC_MOVE ? "MOVE " : ""), @@ -2746,7 +2746,7 @@ gdk_win32_window_set_functions (GdkWindow *window, } gboolean -_gdk_window_get_functions (GdkWindow *window, +_gdk_surface_get_functions (GdkSurface *window, GdkWMFunction *functions) { GdkWMFunction* functions_set; @@ -2782,7 +2782,7 @@ calculate_aerosnap_regions (GdkW32DragMoveResizeContext *context) { GdkDisplay *display; gint n_monitors, monitor_idx, other_monitor_idx; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (context->window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (context->window->impl); #if defined(MORE_AEROSNAP_DEBUGGING) gint i; #endif @@ -2938,11 +2938,11 @@ calculate_aerosnap_regions (GdkW32DragMoveResizeContext *context) } static void -discard_snapinfo (GdkWindow *window) +discard_snapinfo (GdkSurface *window) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); impl->snap_state = GDK_WIN32_AEROSNAP_STATE_UNDETERMINED; @@ -2954,13 +2954,13 @@ discard_snapinfo (GdkWindow *window) } static void -unsnap (GdkWindow *window, +unsnap (GdkSurface *window, GdkMonitor *monitor) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; GdkRectangle rect; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); impl->snap_state = GDK_WIN32_AEROSNAP_STATE_UNDETERMINED; @@ -3023,7 +3023,7 @@ unsnap (GdkWindow *window, GDK_NOTE (MISC, g_print ("Unsnapped window size %d x %d @ %d : %d\n", rect.width, rect.height, rect.x, rect.y)); - gdk_window_move_resize (window, rect.x, rect.y, + gdk_surface_move_resize (window, rect.x, rect.y, rect.width, rect.height); g_clear_pointer (&impl->snap_stash, g_free); @@ -3031,8 +3031,8 @@ unsnap (GdkWindow *window, } static void -stash_window (GdkWindow *window, - GdkWindowImplWin32 *impl) +stash_window (GdkSurface *window, + GdkSurfaceImplWin32 *impl) { gint x, y; gint width, wwidth; @@ -3044,7 +3044,7 @@ stash_window (GdkWindow *window, placement.length = sizeof(WINDOWPLACEMENT); /* Use W32 API to get unmaximized window size, which GDK doesn't remember */ - if (!GetWindowPlacement (GDK_WINDOW_HWND (window), &placement)) + if (!GetWindowPlacement (GDK_SURFACE_HWND (window), &placement)) return; /* MSDN is very vague, but in practice rcNormalPosition is the same as GetWindowRect(), @@ -3052,7 +3052,7 @@ stash_window (GdkWindow *window, * We need to get monitor info and apply workarea vs monitorarea diff to turn * these into screen coordinates proper. */ - hmonitor = MonitorFromWindow (GDK_WINDOW_HWND (window), MONITOR_DEFAULTTONEAREST); + hmonitor = MonitorFromWindow (GDK_SURFACE_HWND (window), MONITOR_DEFAULTTONEAREST); hmonitor_info.cbSize = sizeof (hmonitor_info); if (!GetMonitorInfoA (hmonitor, &hmonitor_info)) @@ -3104,22 +3104,22 @@ stash_window (GdkWindow *window, } static void -snap_up (GdkWindow *window) +snap_up (GdkSurface *window) { SHORT maxysize; gint x, y; gint width, height; - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); impl->snap_state = GDK_WIN32_AEROSNAP_STATE_FULLUP; stash_window (window, impl); maxysize = GetSystemMetrics (SM_CYVIRTUALSCREEN) / impl->window_scale; - gdk_window_get_position (window, &x, &y); - width = gdk_window_get_width (window); + gdk_surface_get_position (window, &x, &y); + width = gdk_surface_get_width (window); y = 0; height = maxysize; @@ -3129,18 +3129,18 @@ snap_up (GdkWindow *window) width += impl->margins_x; height += impl->margins_y; - gdk_window_move_resize (window, x, y, width, height); + gdk_surface_move_resize (window, x, y, width, height); } static void -snap_left (GdkWindow *window, +snap_left (GdkSurface *window, GdkMonitor *monitor, GdkMonitor *snap_monitor) { GdkRectangle rect; - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); impl->snap_state = GDK_WIN32_AEROSNAP_STATE_HALFLEFT; @@ -3155,18 +3155,18 @@ snap_left (GdkWindow *window, rect.width = rect.width + impl->margins_x; rect.height = rect.height + impl->margins_y; - gdk_window_move_resize (window, rect.x, rect.y, rect.width, rect.height); + gdk_surface_move_resize (window, rect.x, rect.y, rect.width, rect.height); } static void -snap_right (GdkWindow *window, +snap_right (GdkSurface *window, GdkMonitor *monitor, GdkMonitor *snap_monitor) { GdkRectangle rect; - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); impl->snap_state = GDK_WIN32_AEROSNAP_STATE_HALFRIGHT; @@ -3182,24 +3182,24 @@ snap_right (GdkWindow *window, rect.width = rect.width + impl->margins_x; rect.height = rect.height + impl->margins_y; - gdk_window_move_resize (window, rect.x, rect.y, rect.width, rect.height); + gdk_surface_move_resize (window, rect.x, rect.y, rect.width, rect.height); } void -_gdk_win32_window_handle_aerosnap (GdkWindow *window, +_gdk_win32_surface_handle_aerosnap (GdkSurface *window, GdkWin32AeroSnapCombo combo) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; GdkDisplay *display; gint n_monitors; - GdkWindowState window_state = gdk_window_get_state (window); - gboolean minimized = window_state & GDK_WINDOW_STATE_ICONIFIED; - gboolean maximized = window_state & GDK_WINDOW_STATE_MAXIMIZED; + GdkSurfaceState window_state = gdk_surface_get_state (window); + gboolean minimized = window_state & GDK_SURFACE_STATE_ICONIFIED; + gboolean maximized = window_state & GDK_SURFACE_STATE_MAXIMIZED; gboolean halfsnapped; GdkMonitor *monitor; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); - display = gdk_window_get_display (window); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); + display = gdk_surface_get_display (window); n_monitors = gdk_display_get_n_monitors (display); monitor = gdk_display_get_monitor_at_window (display, window); @@ -3219,24 +3219,24 @@ _gdk_win32_window_handle_aerosnap (GdkWindow *window, if (!maximized) { unsnap (window, monitor); - gdk_window_maximize (window); + gdk_surface_maximize (window); } break; case GDK_WIN32_AEROSNAP_COMBO_DOWN: case GDK_WIN32_AEROSNAP_COMBO_SHIFTDOWN: if (maximized) { - gdk_window_unmaximize (window); + gdk_surface_unmaximize (window); unsnap (window, monitor); } else if (halfsnapped) unsnap (window, monitor); else if (!minimized) - gdk_window_iconify (window); + gdk_surface_iconify (window); break; case GDK_WIN32_AEROSNAP_COMBO_LEFT: if (maximized) - gdk_window_unmaximize (window); + gdk_surface_unmaximize (window); if (impl->snap_state == GDK_WIN32_AEROSNAP_STATE_UNDETERMINED || impl->snap_state == GDK_WIN32_AEROSNAP_STATE_FULLUP) @@ -3258,7 +3258,7 @@ _gdk_win32_window_handle_aerosnap (GdkWindow *window, break; case GDK_WIN32_AEROSNAP_COMBO_RIGHT: if (maximized) - gdk_window_unmaximize (window); + gdk_surface_unmaximize (window); if (impl->snap_state == GDK_WIN32_AEROSNAP_STATE_UNDETERMINED || impl->snap_state == GDK_WIN32_AEROSNAP_STATE_FULLUP) @@ -3307,13 +3307,13 @@ _gdk_win32_window_handle_aerosnap (GdkWindow *window, } static void -apply_snap (GdkWindow *window, +apply_snap (GdkSurface *window, GdkWin32AeroSnapState snap) { GdkMonitor *monitor; GdkDisplay *display; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); monitor = gdk_display_get_monitor_at_window (display, window); switch (snap) @@ -3322,7 +3322,7 @@ apply_snap (GdkWindow *window, break; case GDK_WIN32_AEROSNAP_STATE_MAXIMIZE: unsnap (window, monitor); - gdk_window_maximize (window); + gdk_surface_maximize (window); break; case GDK_WIN32_AEROSNAP_STATE_HALFLEFT: unsnap (window, monitor); @@ -3340,7 +3340,7 @@ apply_snap (GdkWindow *window, /* Registers a dumb window class. This window * has DefWindowProc() for a window procedure and - * does not do anything that GdkWindow-bound HWNDs do. + * does not do anything that GdkSurface-bound HWNDs do. */ static ATOM RegisterGdkDumbClass () @@ -3532,7 +3532,7 @@ draw_indicator (GdkW32DragMoveResizeContext *context, gdouble line_width; gdouble corner_radius; gint64 animation_duration; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (context->window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (context->window->impl); line_width = AEROSNAP_INDICATOR_LINE_WIDTH * impl->window_scale; corner_radius = AEROSNAP_INDICATOR_CORNER_RADIUS; @@ -3569,32 +3569,32 @@ draw_indicator (GdkW32DragMoveResizeContext *context, { switch (context->edge) { - case GDK_WINDOW_EDGE_NORTH_WEST: + case GDK_SURFACE_EDGE_NORTH_WEST: current_rect.x = context->indicator_target.x + (context->indicator_target.width - current_rect.width); current_rect.y = context->indicator_target.y + (context->indicator_target.height - current_rect.height); break; - case GDK_WINDOW_EDGE_NORTH: + case GDK_SURFACE_EDGE_NORTH: current_rect.y = context->indicator_target.y + (context->indicator_target.height - current_rect.height); break; - case GDK_WINDOW_EDGE_WEST: + case GDK_SURFACE_EDGE_WEST: current_rect.x = context->indicator_target.x + (context->indicator_target.width - current_rect.width); break; - case GDK_WINDOW_EDGE_SOUTH_WEST: + case GDK_SURFACE_EDGE_SOUTH_WEST: current_rect.x = context->indicator_target.x + (context->indicator_target.width - current_rect.width); current_rect.y = context->indicator_target.y; break; - case GDK_WINDOW_EDGE_NORTH_EAST: + case GDK_SURFACE_EDGE_NORTH_EAST: current_rect.x = context->indicator_target.x; current_rect.y = context->indicator_target.y + (context->indicator_target.height - current_rect.height); break; - case GDK_WINDOW_EDGE_SOUTH_EAST: + case GDK_SURFACE_EDGE_SOUTH_EAST: current_rect.x = context->indicator_target.x; current_rect.y = context->indicator_target.y; break; - case GDK_WINDOW_EDGE_SOUTH: + case GDK_SURFACE_EDGE_SOUTH: current_rect.y = context->indicator_target.y; break; - case GDK_WINDOW_EDGE_EAST: + case GDK_SURFACE_EDGE_EAST: current_rect.x = context->indicator_target.x; break; } @@ -3633,18 +3633,18 @@ redraw_indicator (gpointer user_data) POINT source_point = { 0, 0 }; gboolean last_draw; gdouble indicator_opacity; - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; gboolean do_source_remove = FALSE; indicator_opacity = AEROSNAP_INDICATOR_OPACITY; - if (GDK_WINDOW_DESTROYED (context->window) || + if (GDK_SURFACE_DESTROYED (context->window) || !ensure_snap_indicator_exists (context)) { do_source_remove = TRUE; } - impl = GDK_WINDOW_IMPL_WIN32 (context->window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (context->window->impl); if (!ensure_snap_indicator_surface (context, context->indicator_window_rect.width, @@ -3675,7 +3675,7 @@ redraw_indicator (gpointer user_data) hdc = cairo_win32_surface_get_dc (context->indicator_surface); API_CALL (SetWindowPos, (context->shape_indicator, - GDK_WINDOW_HWND (context->window), + GDK_SURFACE_HWND (context->window), 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_SHOWWINDOW | SWP_NOACTIVATE)); @@ -3740,7 +3740,7 @@ start_indicator_drawing (GdkW32DragMoveResizeContext *context, GDK_NOTE (MISC, g_print ("Start drawing snap indicator %d x %d @ %d : %d -> %d x %d @ %d : %d\n", from.width * scale, from.height * scale, from.x, from.y, to.width * scale, to.height * scale, to.x, to.y)); - if (GDK_WINDOW_DESTROYED (context->window)) + if (GDK_SURFACE_DESTROYED (context->window)) return; if (!ensure_snap_indicator_exists (context)) @@ -3777,27 +3777,27 @@ start_indicator_drawing (GdkW32DragMoveResizeContext *context, } static void -update_fullup_indicator (GdkWindow *window, +update_fullup_indicator (GdkSurface *window, GdkW32DragMoveResizeContext *context) { SHORT maxysize; GdkRectangle from, to; GdkRectangle to_adjusted, from_adjusted, from_or_to; - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; GDK_NOTE (MISC, g_print ("Update fullup indicator\n")); - if (GDK_WINDOW_DESTROYED (context->window)) + if (GDK_SURFACE_DESTROYED (context->window)) return; if (context->shape_indicator == NULL) return; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); maxysize = GetSystemMetrics (SM_CYVIRTUALSCREEN); - gdk_window_get_position (window, &to.x, &to.y); - to.width = gdk_window_get_width (window); - to.height = gdk_window_get_height (window); + gdk_surface_get_position (window, &to.x, &to.y); + to.width = gdk_surface_get_width (window); + to.height = gdk_surface_get_height (window); to.y = 0; to.height = maxysize; @@ -3834,7 +3834,7 @@ update_fullup_indicator (GdkWindow *window, } static void -start_indicator (GdkWindow *window, +start_indicator (GdkSurface *window, GdkW32DragMoveResizeContext *context, gint x, gint y, @@ -3845,16 +3845,16 @@ start_indicator (GdkWindow *window, SHORT maxysize; GdkRectangle start_size, end_size; GdkDisplay *display; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); monitor = gdk_display_get_monitor_at_point (display, x, y); gdk_monitor_get_workarea (monitor, &workarea); maxysize = GetSystemMetrics (SM_CYVIRTUALSCREEN) / impl->window_scale; - gdk_window_get_position (window, &start_size.x, &start_size.y); - start_size.width = gdk_window_get_width (window); - start_size.height = gdk_window_get_height (window); + gdk_surface_get_position (window, &start_size.x, &start_size.y); + start_size.width = gdk_surface_get_width (window); + start_size.height = gdk_surface_get_height (window); end_size = start_size; @@ -3890,7 +3890,7 @@ start_indicator (GdkWindow *window, } static void -stop_indicator (GdkWindow *window, +stop_indicator (GdkSurface *window, GdkW32DragMoveResizeContext *context) { GDK_NOTE (MISC, g_print ("Stop drawing snap indicator\n")); @@ -3927,7 +3927,7 @@ point_in_aerosnap_region (gint x, } static void -handle_aerosnap_move_resize (GdkWindow *window, +handle_aerosnap_move_resize (GdkSurface *window, GdkW32DragMoveResizeContext *context, gint x, gint y) @@ -3939,20 +3939,20 @@ handle_aerosnap_move_resize (GdkWindow *window, gint halfright = 0; gint fullup = 0; gboolean fullup_edge = FALSE; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (context->op == GDK_WIN32_DRAGOP_RESIZE) switch (context->edge) { - case GDK_WINDOW_EDGE_NORTH_WEST: - case GDK_WINDOW_EDGE_NORTH_EAST: - case GDK_WINDOW_EDGE_WEST: - case GDK_WINDOW_EDGE_EAST: - case GDK_WINDOW_EDGE_SOUTH_WEST: - case GDK_WINDOW_EDGE_SOUTH_EAST: + case GDK_SURFACE_EDGE_NORTH_WEST: + case GDK_SURFACE_EDGE_NORTH_EAST: + case GDK_SURFACE_EDGE_WEST: + case GDK_SURFACE_EDGE_EAST: + case GDK_SURFACE_EDGE_SOUTH_WEST: + case GDK_SURFACE_EDGE_SOUTH_EAST: break; - case GDK_WINDOW_EDGE_SOUTH: - case GDK_WINDOW_EDGE_NORTH: + case GDK_SURFACE_EDGE_SOUTH: + case GDK_SURFACE_EDGE_NORTH: fullup_edge = TRUE; break; } @@ -4101,7 +4101,7 @@ handle_aerosnap_move_resize (GdkWindow *window, static const gchar * get_cursor_name_from_op (GdkW32WindowDragOp op, - GdkWindowEdge edge) + GdkSurfaceEdge edge) { switch (op) { @@ -4110,21 +4110,21 @@ get_cursor_name_from_op (GdkW32WindowDragOp op, case GDK_WIN32_DRAGOP_RESIZE: switch (edge) { - case GDK_WINDOW_EDGE_NORTH_WEST: + case GDK_SURFACE_EDGE_NORTH_WEST: return "nw-resize"; - case GDK_WINDOW_EDGE_NORTH: + case GDK_SURFACE_EDGE_NORTH: return "n-resize"; - case GDK_WINDOW_EDGE_NORTH_EAST: + case GDK_SURFACE_EDGE_NORTH_EAST: return "ne-resize"; - case GDK_WINDOW_EDGE_WEST: + case GDK_SURFACE_EDGE_WEST: return "w-resize"; - case GDK_WINDOW_EDGE_EAST: + case GDK_SURFACE_EDGE_EAST: return "e-resize"; - case GDK_WINDOW_EDGE_SOUTH_WEST: + case GDK_SURFACE_EDGE_SOUTH_WEST: return "sw-resize"; - case GDK_WINDOW_EDGE_SOUTH: + case GDK_SURFACE_EDGE_SOUTH: return "s-resize"; - case GDK_WINDOW_EDGE_SOUTH_EAST: + case GDK_SURFACE_EDGE_SOUTH_EAST: return "se-resize"; } /* default: warn about unhandled enum values, @@ -4143,7 +4143,7 @@ get_cursor_name_from_op (GdkW32WindowDragOp op, } static gboolean -point_in_window (GdkWindow *window, +point_in_window (GdkSurface *window, gdouble x, gdouble y) { @@ -4155,8 +4155,8 @@ point_in_window (GdkWindow *window, cairo_region_contains_point (window->input_shape, x, y)); } -static GdkWindow * -child_window_at_coordinates (GdkWindow *window, +static GdkSurface * +child_window_at_coordinates (GdkSurface *window, gint root_x, gint root_y) { @@ -4164,14 +4164,14 @@ child_window_at_coordinates (GdkWindow *window, GList *l; GList *children; - children = gdk_window_peek_children (window); - gdk_window_get_root_origin (window, &x, &y); + children = gdk_surface_peek_children (window); + gdk_surface_get_root_origin (window, &x, &y); x = root_x - x; y = root_y - y; for (l = children; l; l = g_list_next (l)) { - GdkWindow *child = GDK_WINDOW (l->data); + GdkSurface *child = GDK_SURFACE (l->data); if (point_in_window (child, x, y)) return child; @@ -4181,10 +4181,10 @@ child_window_at_coordinates (GdkWindow *window, } static void -setup_drag_move_resize_context (GdkWindow *window, +setup_drag_move_resize_context (GdkSurface *window, GdkW32DragMoveResizeContext *context, GdkW32WindowDragOp op, - GdkWindowEdge edge, + GdkSurfaceEdge edge, GdkDevice *device, gint button, gint root_x, @@ -4193,10 +4193,10 @@ setup_drag_move_resize_context (GdkWindow *window, { RECT rect; const gchar *cursor_name; - GdkWindow *pointer_window; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurface *pointer_window; + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); GdkDisplay *display = gdk_device_get_display (device); - gboolean maximized = gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED; + gboolean maximized = gdk_surface_get_state (window) & GDK_SURFACE_STATE_MAXIMIZED; /* Before we drag, we need to undo any maximization or snapping. * AeroSnap behaviour: @@ -4257,9 +4257,9 @@ setup_drag_move_resize_context (GdkWindow *window, gboolean left_half; GdkDisplay *display; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); monitor = gdk_display_get_monitor_at_window (display, window); - gdk_window_get_geometry (window, &wx, &wy, &wwidth, &wheight); + gdk_surface_get_geometry (window, &wx, &wy, &wwidth, &wheight); swx = wx; swy = wy; @@ -4315,7 +4315,7 @@ setup_drag_move_resize_context (GdkWindow *window, gint shadow_unmax_width, shadow_unmax_height; placement.length = sizeof (placement); - API_CALL (GetWindowPlacement, (GDK_WINDOW_HWND (window), &placement)); + API_CALL (GetWindowPlacement, (GDK_SURFACE_HWND (window), &placement)); GDK_NOTE (MISC, g_print ("W32 WM unmaximized window placement is %ld x %ld @ %ld : %ld\n", placement.rcNormalPosition.right - placement.rcNormalPosition.left, @@ -4367,7 +4367,7 @@ setup_drag_move_resize_context (GdkWindow *window, placement.rcNormalPosition.left + _gdk_offset_x * impl->window_scale, placement.rcNormalPosition.top + _gdk_offset_y * impl->window_scale)); - API_CALL (SetWindowPlacement, (GDK_WINDOW_HWND (window), &placement)); + API_CALL (SetWindowPlacement, (GDK_SURFACE_HWND (window), &placement)); } else if (!pointer_outside_of_window && impl->snap_stash_int) { @@ -4402,13 +4402,13 @@ setup_drag_move_resize_context (GdkWindow *window, GDK_NOTE (MISC, g_print ("Unsnapped window to %d : %d\n", new_pos.x, new_pos.y)); discard_snapinfo (window); - gdk_window_move_resize (window, new_pos.x, new_pos.y, + gdk_surface_move_resize (window, new_pos.x, new_pos.y, new_pos.width, new_pos.height); } if (maximized) - gdk_window_unmaximize (window); + gdk_surface_unmaximize (window); else unsnap (window, monitor); @@ -4436,7 +4436,7 @@ setup_drag_move_resize_context (GdkWindow *window, pointer_window = child_window_at_coordinates (window, root_x, root_y); /* Note: This triggers a WM_CAPTURECHANGED, which will trigger - * gdk_win32_window_end_move_resize_drag(), which will end + * gdk_win32_surface_end_move_resize_drag(), which will end * our op before it even begins, but only if context->op is not NONE. * This is why we first do the grab, *then* set the op. */ @@ -4469,16 +4469,16 @@ setup_drag_move_resize_context (GdkWindow *window, g_print ("begin drag moveresize: window %p, toplevel %p, " "op %u, edge %d, device %p, " "button %d, coord %d:%d, time %u\n", - pointer_window, gdk_window_get_toplevel (window), + pointer_window, gdk_surface_get_toplevel (window), context->op, context->edge, context->device, context->button, context->start_root_x, context->start_root_y, context->timestamp)); } void -gdk_win32_window_end_move_resize_drag (GdkWindow *window) +gdk_win32_surface_end_move_resize_drag (GdkSurface *window) { - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); GdkW32DragMoveResizeContext *context = &impl->drag_move_resize_context; context->op = GDK_WIN32_DRAGOP_NONE; @@ -4519,7 +4519,7 @@ gdk_win32_window_end_move_resize_drag (GdkWindow *window) g_print ("end drag moveresize: window %p, toplevel %p," "op %u, edge %d, device %p, " "button %d, coord %d:%d, time %u\n", - window, gdk_window_get_toplevel (window), + window, gdk_surface_get_toplevel (window), context->op, context->edge, context->device, context->button, context->start_root_x, context->start_root_y, context->timestamp)); @@ -4531,14 +4531,14 @@ gdk_win32_window_end_move_resize_drag (GdkWindow *window) } static void -gdk_win32_get_window_size_and_position_from_client_rect (GdkWindow *window, +gdk_win32_get_window_size_and_position_from_client_rect (GdkSurface *window, RECT *window_rect, SIZE *window_size, POINT *window_position) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); /* Turn client area into window area */ _gdk_win32_adjust_client_rect (window, window_rect); @@ -4556,7 +4556,7 @@ gdk_win32_get_window_size_and_position_from_client_rect (GdkWindow *window, } static void -gdk_win32_update_layered_window_from_cache (GdkWindow *window, +gdk_win32_update_layered_window_from_cache (GdkSurface *window, RECT *client_rect) { POINT window_position; @@ -4566,9 +4566,9 @@ gdk_win32_update_layered_window_from_cache (GdkWindow *window, SIZE *window_size_ptr; POINT source_point = { 0, 0 }; POINT *source_point_ptr; - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); gdk_win32_get_window_size_and_position_from_client_rect (window, client_rect, @@ -4588,7 +4588,7 @@ gdk_win32_update_layered_window_from_cache (GdkWindow *window, * source_point. window_size is here to avoid the function * inexplicably failing with error 317. */ - if (gdk_display_is_composited (gdk_window_get_display (window))) + if (gdk_display_is_composited (gdk_surface_get_display (window))) { hdc = NULL; window_size_ptr = NULL; @@ -4601,14 +4601,14 @@ gdk_win32_update_layered_window_from_cache (GdkWindow *window, source_point_ptr = &source_point; } - API_CALL (UpdateLayeredWindow, (GDK_WINDOW_HWND (window), NULL, + API_CALL (UpdateLayeredWindow, (GDK_SURFACE_HWND (window), NULL, &window_position, window_size_ptr, hdc, source_point_ptr, 0, &blender, ULW_ALPHA)); } void -gdk_win32_window_do_move_resize_drag (GdkWindow *window, +gdk_win32_surface_do_move_resize_drag (GdkSurface *window, gint x, gint y) { @@ -4616,12 +4616,12 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window, RECT new_rect; gint diffy, diffx; MINMAXINFO mmi; - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; GdkW32DragMoveResizeContext *context; gint width; gint height; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); context = &impl->drag_move_resize_context; if (!_gdk_win32_get_window_rect (window, &rect)) @@ -4637,38 +4637,38 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window, switch (context->edge) { - case GDK_WINDOW_EDGE_NORTH_WEST: + case GDK_SURFACE_EDGE_NORTH_WEST: new_rect.left += diffx; new_rect.top += diffy; break; - case GDK_WINDOW_EDGE_NORTH: + case GDK_SURFACE_EDGE_NORTH: new_rect.top += diffy; break; - case GDK_WINDOW_EDGE_NORTH_EAST: + case GDK_SURFACE_EDGE_NORTH_EAST: new_rect.right += diffx; new_rect.top += diffy; break; - case GDK_WINDOW_EDGE_WEST: + case GDK_SURFACE_EDGE_WEST: new_rect.left += diffx; break; - case GDK_WINDOW_EDGE_EAST: + case GDK_SURFACE_EDGE_EAST: new_rect.right += diffx; break; - case GDK_WINDOW_EDGE_SOUTH_WEST: + case GDK_SURFACE_EDGE_SOUTH_WEST: new_rect.left += diffx; new_rect.bottom += diffy; break; - case GDK_WINDOW_EDGE_SOUTH: + case GDK_SURFACE_EDGE_SOUTH: new_rect.bottom += diffy; break; - case GDK_WINDOW_EDGE_SOUTH_EAST: + case GDK_SURFACE_EDGE_SOUTH_EAST: default: new_rect.right += diffx; new_rect.bottom += diffy; @@ -4681,7 +4681,7 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window, */ memset (&mmi, 0, sizeof (mmi)); - if (!_gdk_win32_window_fill_min_max_info (window, &mmi)) + if (!_gdk_win32_surface_fill_min_max_info (window, &mmi)) break; width = new_rect.right - new_rect.left; @@ -4691,15 +4691,15 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window, { switch (context->edge) { - case GDK_WINDOW_EDGE_NORTH_WEST: - case GDK_WINDOW_EDGE_WEST: - case GDK_WINDOW_EDGE_SOUTH_WEST: + case GDK_SURFACE_EDGE_NORTH_WEST: + case GDK_SURFACE_EDGE_WEST: + case GDK_SURFACE_EDGE_SOUTH_WEST: new_rect.left = new_rect.right - mmi.ptMaxTrackSize.x; break; - case GDK_WINDOW_EDGE_NORTH_EAST: - case GDK_WINDOW_EDGE_EAST: - case GDK_WINDOW_EDGE_SOUTH_EAST: + case GDK_SURFACE_EDGE_NORTH_EAST: + case GDK_SURFACE_EDGE_EAST: + case GDK_SURFACE_EDGE_SOUTH_EAST: default: new_rect.right = new_rect.left + mmi.ptMaxTrackSize.x; break; @@ -4709,15 +4709,15 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window, { switch (context->edge) { - case GDK_WINDOW_EDGE_NORTH_WEST: - case GDK_WINDOW_EDGE_WEST: - case GDK_WINDOW_EDGE_SOUTH_WEST: + case GDK_SURFACE_EDGE_NORTH_WEST: + case GDK_SURFACE_EDGE_WEST: + case GDK_SURFACE_EDGE_SOUTH_WEST: new_rect.left = new_rect.right - mmi.ptMinTrackSize.x; break; - case GDK_WINDOW_EDGE_NORTH_EAST: - case GDK_WINDOW_EDGE_EAST: - case GDK_WINDOW_EDGE_SOUTH_EAST: + case GDK_SURFACE_EDGE_NORTH_EAST: + case GDK_SURFACE_EDGE_EAST: + case GDK_SURFACE_EDGE_SOUTH_EAST: default: new_rect.right = new_rect.left + mmi.ptMinTrackSize.x; break; @@ -4728,14 +4728,14 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window, { switch (context->edge) { - case GDK_WINDOW_EDGE_NORTH_WEST: - case GDK_WINDOW_EDGE_NORTH: - case GDK_WINDOW_EDGE_NORTH_EAST: + case GDK_SURFACE_EDGE_NORTH_WEST: + case GDK_SURFACE_EDGE_NORTH: + case GDK_SURFACE_EDGE_NORTH_EAST: new_rect.top = new_rect.bottom - mmi.ptMaxTrackSize.y; - case GDK_WINDOW_EDGE_SOUTH_WEST: - case GDK_WINDOW_EDGE_SOUTH: - case GDK_WINDOW_EDGE_SOUTH_EAST: + case GDK_SURFACE_EDGE_SOUTH_WEST: + case GDK_SURFACE_EDGE_SOUTH: + case GDK_SURFACE_EDGE_SOUTH_EAST: default: new_rect.bottom = new_rect.top + mmi.ptMaxTrackSize.y; break; @@ -4745,14 +4745,14 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window, { switch (context->edge) { - case GDK_WINDOW_EDGE_NORTH_WEST: - case GDK_WINDOW_EDGE_NORTH: - case GDK_WINDOW_EDGE_NORTH_EAST: + case GDK_SURFACE_EDGE_NORTH_WEST: + case GDK_SURFACE_EDGE_NORTH: + case GDK_SURFACE_EDGE_NORTH_EAST: new_rect.top = new_rect.bottom - mmi.ptMinTrackSize.y; - case GDK_WINDOW_EDGE_SOUTH_WEST: - case GDK_WINDOW_EDGE_SOUTH: - case GDK_WINDOW_EDGE_SOUTH_EAST: + case GDK_SURFACE_EDGE_SOUTH_WEST: + case GDK_SURFACE_EDGE_SOUTH: + case GDK_SURFACE_EDGE_SOUTH_EAST: default: new_rect.bottom = new_rect.top + mmi.ptMinTrackSize.y; break; @@ -4801,7 +4801,7 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window, &window_size, &window_position); - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED, window_position.x, window_position.y, 0, 0, @@ -4815,20 +4815,20 @@ gdk_win32_window_do_move_resize_drag (GdkWindow *window, } static void -gdk_win32_window_begin_resize_drag (GdkWindow *window, - GdkWindowEdge edge, +gdk_win32_surface_begin_resize_drag (GdkSurface *window, + GdkSurfaceEdge edge, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window) || - IsIconic (GDK_WINDOW_HWND (window))) + if (GDK_SURFACE_DESTROYED (window) || + IsIconic (GDK_SURFACE_HWND (window))) return; /* Tell Windows to start interactively resizing the window by pretending that @@ -4841,10 +4841,10 @@ gdk_win32_window_begin_resize_drag (GdkWindow *window, if (button != 1) return; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE) - gdk_win32_window_end_move_resize_drag (window); + gdk_win32_surface_end_move_resize_drag (window); setup_drag_move_resize_context (window, &impl->drag_move_resize_context, GDK_WIN32_DRAGOP_RESIZE, edge, device, @@ -4852,19 +4852,19 @@ gdk_win32_window_begin_resize_drag (GdkWindow *window, } static void -gdk_win32_window_begin_move_drag (GdkWindow *window, +gdk_win32_surface_begin_move_drag (GdkSurface *window, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window) || - IsIconic (GDK_WINDOW_HWND (window))) + if (GDK_SURFACE_DESTROYED (window) || + IsIconic (GDK_SURFACE_HWND (window))) return; /* Tell Windows to start interactively moving the window by pretending that @@ -4876,13 +4876,13 @@ gdk_win32_window_begin_move_drag (GdkWindow *window, if (button != 1) return; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE) - gdk_win32_window_end_move_resize_drag (window); + gdk_win32_surface_end_move_resize_drag (window); setup_drag_move_resize_context (window, &impl->drag_move_resize_context, - GDK_WIN32_DRAGOP_MOVE, GDK_WINDOW_EDGE_NORTH_WEST, + GDK_WIN32_DRAGOP_MOVE, GDK_SURFACE_EDGE_NORTH_WEST, device, button, root_x, root_y, timestamp); } @@ -4891,140 +4891,140 @@ gdk_win32_window_begin_move_drag (GdkWindow *window, * Setting window states */ static void -gdk_win32_window_iconify (GdkWindow *window) +gdk_win32_surface_iconify (GdkSurface *window) { HWND old_active_window; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - GDK_NOTE (MISC, g_print ("gdk_window_iconify: %p: %s\n", - GDK_WINDOW_HWND (window), - _gdk_win32_window_state_to_string (window->state))); + GDK_NOTE (MISC, g_print ("gdk_surface_iconify: %p: %s\n", + GDK_SURFACE_HWND (window), + _gdk_win32_surface_state_to_string (window->state))); - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { old_active_window = GetActiveWindow (); GtkShowWindow (window, SW_MINIMIZE); - if (old_active_window != GDK_WINDOW_HWND (window)) + if (old_active_window != GDK_SURFACE_HWND (window)) SetActiveWindow (old_active_window); } else { gdk_synthesize_window_state (window, 0, - GDK_WINDOW_STATE_ICONIFIED); + GDK_SURFACE_STATE_ICONIFIED); } } static void -gdk_win32_window_deiconify (GdkWindow *window) +gdk_win32_surface_deiconify (GdkSurface *window) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - GDK_NOTE (MISC, g_print ("gdk_window_deiconify: %p: %s\n", - GDK_WINDOW_HWND (window), - _gdk_win32_window_state_to_string (window->state))); + GDK_NOTE (MISC, g_print ("gdk_surface_deiconify: %p: %s\n", + GDK_SURFACE_HWND (window), + _gdk_win32_surface_state_to_string (window->state))); - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { - show_window_internal (window, GDK_WINDOW_IS_MAPPED (window), TRUE); + show_window_internal (window, GDK_SURFACE_IS_MAPPED (window), TRUE); } else { gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_ICONIFIED, + GDK_SURFACE_STATE_ICONIFIED, 0); } } static void -gdk_win32_window_stick (GdkWindow *window) +gdk_win32_surface_stick (GdkSurface *window) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; /* FIXME: Do something? */ } static void -gdk_win32_window_unstick (GdkWindow *window) +gdk_win32_surface_unstick (GdkSurface *window) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; /* FIXME: Do something? */ } static void -gdk_win32_window_maximize (GdkWindow *window) +gdk_win32_surface_maximize (GdkSurface *window) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - GDK_NOTE (MISC, g_print ("gdk_window_maximize: %p: %s\n", - GDK_WINDOW_HWND (window), - _gdk_win32_window_state_to_string (window->state))); + GDK_NOTE (MISC, g_print ("gdk_surface_maximize: %p: %s\n", + GDK_SURFACE_HWND (window), + _gdk_win32_surface_state_to_string (window->state))); - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) GtkShowWindow (window, SW_MAXIMIZE); else gdk_synthesize_window_state (window, 0, - GDK_WINDOW_STATE_MAXIMIZED); + GDK_SURFACE_STATE_MAXIMIZED); } static void -gdk_win32_window_unmaximize (GdkWindow *window) +gdk_win32_surface_unmaximize (GdkSurface *window) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - GDK_NOTE (MISC, g_print ("gdk_window_unmaximize: %p: %s\n", - GDK_WINDOW_HWND (window), - _gdk_win32_window_state_to_string (window->state))); + GDK_NOTE (MISC, g_print ("gdk_surface_unmaximize: %p: %s\n", + GDK_SURFACE_HWND (window), + _gdk_win32_surface_state_to_string (window->state))); - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) GtkShowWindow (window, SW_RESTORE); else gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_MAXIMIZED, + GDK_SURFACE_STATE_MAXIMIZED, 0); } static void -gdk_win32_window_fullscreen (GdkWindow *window) +gdk_win32_surface_fullscreen (GdkSurface *window) { gint x, y, width, height; FullscreenInfo *fi; HMONITOR monitor; MONITORINFO mi; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); fi = g_new (FullscreenInfo, 1); - if (!GetWindowRect (GDK_WINDOW_HWND (window), &(fi->r))) + if (!GetWindowRect (GDK_SURFACE_HWND (window), &(fi->r))) g_free (fi); else { - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - monitor = MonitorFromWindow (GDK_WINDOW_HWND (window), MONITOR_DEFAULTTONEAREST); + monitor = MonitorFromWindow (GDK_SURFACE_HWND (window), MONITOR_DEFAULTTONEAREST); mi.cbSize = sizeof (mi); if (monitor && GetMonitorInfo (monitor, &mi)) { @@ -5044,135 +5044,135 @@ gdk_win32_window_fullscreen (GdkWindow *window) fi->hint_flags = impl->hint_flags; impl->hint_flags &= ~GDK_HINT_MAX_SIZE; g_object_set_data (G_OBJECT (window), "fullscreen-info", fi); - fi->style = GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE); + fi->style = GetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE); /* Send state change before configure event */ - gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN); + gdk_synthesize_window_state (window, 0, GDK_SURFACE_STATE_FULLSCREEN); - SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, + SetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE, (fi->style & ~WS_OVERLAPPEDWINDOW) | WS_POPUP); - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOP, + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), HWND_TOP, x, y, width, height, SWP_NOCOPYBITS | SWP_SHOWWINDOW)); } } static void -gdk_win32_window_unfullscreen (GdkWindow *window) +gdk_win32_surface_unfullscreen (GdkSurface *window) { FullscreenInfo *fi; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); fi = g_object_get_data (G_OBJECT (window), "fullscreen-info"); if (fi) { - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0); + gdk_synthesize_window_state (window, GDK_SURFACE_STATE_FULLSCREEN, 0); impl->hint_flags = fi->hint_flags; - SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, fi->style); - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_NOTOPMOST, + SetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE, fi->style); + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), HWND_NOTOPMOST, fi->r.left, fi->r.top, fi->r.right - fi->r.left, fi->r.bottom - fi->r.top, SWP_NOCOPYBITS | SWP_SHOWWINDOW)); g_object_set_data (G_OBJECT (window), "fullscreen-info", NULL); g_free (fi); - _gdk_win32_window_update_style_bits (window); + _gdk_win32_surface_update_style_bits (window); } } static void -gdk_win32_window_set_keep_above (GdkWindow *window, +gdk_win32_surface_set_keep_above (GdkSurface *window, gboolean setting) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - GDK_NOTE (MISC, g_print ("gdk_window_set_keep_above: %p: %s\n", - GDK_WINDOW_HWND (window), + GDK_NOTE (MISC, g_print ("gdk_surface_set_keep_above: %p: %s\n", + GDK_SURFACE_HWND (window), setting ? "YES" : "NO")); - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), setting ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE)); } gdk_synthesize_window_state (window, - setting ? GDK_WINDOW_STATE_BELOW : GDK_WINDOW_STATE_ABOVE, - setting ? GDK_WINDOW_STATE_ABOVE : 0); + setting ? GDK_SURFACE_STATE_BELOW : GDK_SURFACE_STATE_ABOVE, + setting ? GDK_SURFACE_STATE_ABOVE : 0); } static void -gdk_win32_window_set_keep_below (GdkWindow *window, +gdk_win32_surface_set_keep_below (GdkSurface *window, gboolean setting) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - GDK_NOTE (MISC, g_print ("gdk_window_set_keep_below: %p: %s\n", - GDK_WINDOW_HWND (window), + GDK_NOTE (MISC, g_print ("gdk_surface_set_keep_below: %p: %s\n", + GDK_SURFACE_HWND (window), setting ? "YES" : "NO")); - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), setting ? HWND_BOTTOM : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE)); } gdk_synthesize_window_state (window, - setting ? GDK_WINDOW_STATE_ABOVE : GDK_WINDOW_STATE_BELOW, - setting ? GDK_WINDOW_STATE_BELOW : 0); + setting ? GDK_SURFACE_STATE_ABOVE : GDK_SURFACE_STATE_BELOW, + setting ? GDK_SURFACE_STATE_BELOW : 0); } static void -gdk_win32_window_focus (GdkWindow *window, +gdk_win32_surface_focus (GdkSurface *window, guint32 timestamp) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - GDK_NOTE (MISC, g_print ("gdk_window_focus: %p: %s\n", - GDK_WINDOW_HWND (window), - _gdk_win32_window_state_to_string (window->state))); + GDK_NOTE (MISC, g_print ("gdk_surface_focus: %p: %s\n", + GDK_SURFACE_HWND (window), + _gdk_win32_surface_state_to_string (window->state))); - if (window->state & GDK_WINDOW_STATE_MAXIMIZED) + if (window->state & GDK_SURFACE_STATE_MAXIMIZED) GtkShowWindow (window, SW_SHOWMAXIMIZED); - else if (window->state & GDK_WINDOW_STATE_ICONIFIED) + else if (window->state & GDK_SURFACE_STATE_ICONIFIED) GtkShowWindow (window, SW_RESTORE); - else if (!IsWindowVisible (GDK_WINDOW_HWND (window))) + else if (!IsWindowVisible (GDK_SURFACE_HWND (window))) GtkShowWindow (window, SW_SHOWNORMAL); else GtkShowWindow (window, SW_SHOW); - SetFocus (GDK_WINDOW_HWND (window)); + SetFocus (GDK_SURFACE_HWND (window)); } static void -gdk_win32_window_set_modal_hint (GdkWindow *window, +gdk_win32_surface_set_modal_hint (GdkSurface *window, gboolean modal) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - GDK_NOTE (MISC, g_print ("gdk_window_set_modal_hint: %p: %s\n", - GDK_WINDOW_HWND (window), + GDK_NOTE (MISC, g_print ("gdk_surface_set_modal_hint: %p: %s\n", + GDK_SURFACE_HWND (window), modal ? "YES" : "NO")); if (modal == window->modal_hint) @@ -5182,8 +5182,8 @@ gdk_win32_window_set_modal_hint (GdkWindow *window, #if 0 /* Not sure about this one.. -- Cody */ - if (GDK_WINDOW_IS_MAPPED (window)) - API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), + if (GDK_SURFACE_IS_MAPPED (window)) + API_CALL (SetWindowPos, (GDK_SURFACE_HWND (window), modal ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE)); @@ -5192,7 +5192,7 @@ gdk_win32_window_set_modal_hint (GdkWindow *window, if (modal) { _gdk_push_modal_window (window); - gdk_window_raise (window); + gdk_surface_raise (window); } else { @@ -5203,16 +5203,16 @@ gdk_win32_window_set_modal_hint (GdkWindow *window, } static void -gdk_win32_window_set_skip_taskbar_hint (GdkWindow *window, +gdk_win32_surface_set_skip_taskbar_hint (GdkSurface *window, gboolean skips_taskbar) { - static GdkWindow *owner = NULL; - //GdkWindowAttr wa; + static GdkSurface *owner = NULL; + //GdkSurfaceAttr wa; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - GDK_NOTE (MISC, g_print ("gdk_window_set_skip_taskbar_hint: %p: %s, doing nothing\n", - GDK_WINDOW_HWND (window), + GDK_NOTE (MISC, g_print ("gdk_surface_set_skip_taskbar_hint: %p: %s, doing nothing\n", + GDK_SURFACE_HWND (window), skips_taskbar ? "YES" : "NO")); // ### TODO: Need to figure out what to do here. @@ -5223,21 +5223,21 @@ gdk_win32_window_set_skip_taskbar_hint (GdkWindow *window, #if 0 if (owner == NULL) { - wa.window_type = GDK_WINDOW_TEMP; + wa.window_type = GDK_SURFACE_TEMP; wa.wclass = GDK_INPUT_OUTPUT; wa.width = wa.height = 1; wa.event_mask = 0; - owner = gdk_window_new_internal (NULL, &wa, 0, TRUE); + owner = gdk_surface_new_internal (NULL, &wa, 0, TRUE); } #endif - SetWindowLongPtr (GDK_WINDOW_HWND (window), GWLP_HWNDPARENT, (LONG_PTR) GDK_WINDOW_HWND (owner)); + SetWindowLongPtr (GDK_SURFACE_HWND (window), GWLP_HWNDPARENT, (LONG_PTR) GDK_SURFACE_HWND (owner)); #if 0 /* Should we also turn off the minimize and maximize buttons? */ - SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, - GetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE) & ~(WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_SYSMENU)); + SetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE, + GetWindowLong (GDK_SURFACE_HWND (window), GWL_STYLE) & ~(WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_SYSMENU)); - SetWindowPos (GDK_WINDOW_HWND (window), SWP_NOZORDER_SPECIFIED, + SetWindowPos (GDK_SURFACE_HWND (window), SWP_NOZORDER_SPECIFIED, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOREPOSITION | SWP_NOSIZE | SWP_NOZORDER); @@ -5245,54 +5245,54 @@ gdk_win32_window_set_skip_taskbar_hint (GdkWindow *window, } else { - SetWindowLongPtr (GDK_WINDOW_HWND (window), GWLP_HWNDPARENT, 0); + SetWindowLongPtr (GDK_SURFACE_HWND (window), GWLP_HWNDPARENT, 0); } } static void -gdk_win32_window_set_skip_pager_hint (GdkWindow *window, +gdk_win32_surface_set_skip_pager_hint (GdkSurface *window, gboolean skips_pager) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - GDK_NOTE (MISC, g_print ("gdk_window_set_skip_pager_hint: %p: %s, doing nothing\n", - GDK_WINDOW_HWND (window), + GDK_NOTE (MISC, g_print ("gdk_surface_set_skip_pager_hint: %p: %s, doing nothing\n", + GDK_SURFACE_HWND (window), skips_pager ? "YES" : "NO")); } static void -gdk_win32_window_set_type_hint (GdkWindow *window, - GdkWindowTypeHint hint) +gdk_win32_surface_set_type_hint (GdkSurface *window, + GdkSurfaceTypeHint hint) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; GDK_NOTE (MISC, G_STMT_START{ static GEnumClass *class = NULL; if (!class) - class = g_type_class_ref (GDK_TYPE_WINDOW_TYPE_HINT); - g_print ("gdk_window_set_type_hint: %p: %s\n", - GDK_WINDOW_HWND (window), + class = g_type_class_ref (GDK_TYPE_SURFACE_TYPE_HINT); + g_print ("gdk_surface_set_type_hint: %p: %s\n", + GDK_SURFACE_HWND (window), g_enum_get_value (class, hint)->value_name); }G_STMT_END); - ((GdkWindowImplWin32 *)window->impl)->type_hint = hint; + ((GdkSurfaceImplWin32 *)window->impl)->type_hint = hint; - _gdk_win32_window_update_style_bits (window); + _gdk_win32_surface_update_style_bits (window); } -static GdkWindowTypeHint -gdk_win32_window_get_type_hint (GdkWindow *window) +static GdkSurfaceTypeHint +gdk_win32_surface_get_type_hint (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_WINDOW_TYPE_HINT_NORMAL); + g_return_val_if_fail (GDK_IS_SURFACE (window), GDK_SURFACE_TYPE_HINT_NORMAL); - if (GDK_WINDOW_DESTROYED (window)) - return GDK_WINDOW_TYPE_HINT_NORMAL; + if (GDK_SURFACE_DESTROYED (window)) + return GDK_SURFACE_TYPE_HINT_NORMAL; - return GDK_WINDOW_IMPL_WIN32 (window->impl)->type_hint; + return GDK_SURFACE_IMPL_WIN32 (window->impl)->type_hint; } static HRGN @@ -5345,58 +5345,58 @@ cairo_region_to_hrgn (const cairo_region_t *region, } static void -gdk_win32_window_shape_combine_region (GdkWindow *window, +gdk_win32_surface_shape_combine_region (GdkSurface *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y) { - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (!shape_region) { - GDK_NOTE (MISC, g_print ("gdk_win32_window_shape_combine_region: %p: none\n", - GDK_WINDOW_HWND (window))); - SetWindowRgn (GDK_WINDOW_HWND (window), NULL, TRUE); + GDK_NOTE (MISC, g_print ("gdk_win32_surface_shape_combine_region: %p: none\n", + GDK_SURFACE_HWND (window))); + SetWindowRgn (GDK_SURFACE_HWND (window), NULL, TRUE); } else { HRGN hrgn; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); hrgn = cairo_region_to_hrgn (shape_region, 0, 0, impl->window_scale); - GDK_NOTE (MISC, g_print ("gdk_win32_window_shape_combine_region: %p: %p\n", - GDK_WINDOW_HWND (window), + GDK_NOTE (MISC, g_print ("gdk_win32_surface_shape_combine_region: %p: %p\n", + GDK_SURFACE_HWND (window), hrgn)); do_shape_combine_region (window, hrgn, offset_x, offset_y); } } -GdkWindow * -gdk_win32_window_lookup_for_display (GdkDisplay *display, +GdkSurface * +gdk_win32_surface_lookup_for_display (GdkDisplay *display, HWND anid) { g_return_val_if_fail (display == gdk_display_get_default (), NULL); - return (GdkWindow*) gdk_win32_handle_table_lookup (anid); + return (GdkSurface*) gdk_win32_handle_table_lookup (anid); } static void -gdk_win32_window_set_opacity (GdkWindow *window, +gdk_win32_surface_set_opacity (GdkSurface *window, gdouble opacity) { LONG exstyle; typedef BOOL (WINAPI *PFN_SetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD); PFN_SetLayeredWindowAttributes setLayeredWindowAttributes = NULL; - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (!WINDOW_IS_TOPLEVEL (window) || GDK_WINDOW_DESTROYED (window)) + if (!WINDOW_IS_TOPLEVEL (window) || GDK_SURFACE_DESTROYED (window)) return; if (opacity < 0) @@ -5404,7 +5404,7 @@ gdk_win32_window_set_opacity (GdkWindow *window, else if (opacity > 1) opacity = 1; - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (impl->layered) { @@ -5421,10 +5421,10 @@ gdk_win32_window_set_opacity (GdkWindow *window, return; } - exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE); + exstyle = GetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE); if (!(exstyle & WS_EX_LAYERED)) - SetWindowLong (GDK_WINDOW_HWND (window), + SetWindowLong (GDK_SURFACE_HWND (window), GWL_EXSTYLE, exstyle | WS_EX_LAYERED); @@ -5433,7 +5433,7 @@ gdk_win32_window_set_opacity (GdkWindow *window, if (setLayeredWindowAttributes) { - API_CALL (setLayeredWindowAttributes, (GDK_WINDOW_HWND (window), + API_CALL (setLayeredWindowAttributes, (GDK_SURFACE_HWND (window), 0, opacity * 0xff, LWA_ALPHA)); @@ -5441,18 +5441,18 @@ gdk_win32_window_set_opacity (GdkWindow *window, } gboolean -gdk_win32_window_is_win32 (GdkWindow *window) +gdk_win32_surface_is_win32 (GdkSurface *window) { - return GDK_WINDOW_IS_WIN32 (window); + return GDK_SURFACE_IS_WIN32 (window); } static gboolean -gdk_win32_window_show_window_menu (GdkWindow *window, +gdk_win32_surface_show_window_menu (GdkSurface *window, GdkEvent *event) { double event_x, event_y; gint x, y; - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); switch (event->type) { @@ -5469,7 +5469,7 @@ gdk_win32_window_show_window_menu (GdkWindow *window, x = event_x - _gdk_offset_x; y = event_y - _gdk_offset_y; - SendMessage (GDK_WINDOW_HWND (window), + SendMessage (GDK_SURFACE_HWND (window), WM_SYSMENU, 0, MAKELPARAM (x * impl->window_scale, y * impl->window_scale)); @@ -5479,7 +5479,7 @@ gdk_win32_window_show_window_menu (GdkWindow *window, /** * _gdk_win32_acquire_dc - * @impl: a Win32 #GdkWindowImplWin32 implementation + * @impl: a Win32 #GdkSurfaceImplWin32 implementation * * Gets a DC with the given drawable selected into it. * @@ -5489,10 +5489,10 @@ gdk_win32_window_show_window_menu (GdkWindow *window, * release the DC when you are done using it. **/ static HDC -_gdk_win32_impl_acquire_dc (GdkWindowImplWin32 *impl) +_gdk_win32_impl_acquire_dc (GdkSurfaceImplWin32 *impl) { - if (GDK_IS_WINDOW_IMPL_WIN32 (impl) && - GDK_WINDOW_DESTROYED (impl->wrapper)) + if (GDK_IS_SURFACE_IMPL_WIN32 (impl) && + GDK_SURFACE_DESTROYED (impl->wrapper)) return NULL; /* We don't call this function for layered windows, but @@ -5521,13 +5521,13 @@ _gdk_win32_impl_acquire_dc (GdkWindowImplWin32 *impl) /** * _gdk_win32_impl_release_dc - * @impl: a Win32 #GdkWindowImplWin32 implementation + * @impl: a Win32 #GdkSurfaceImplWin32 implementation * * Releases the reference count for the DC * from _gdk_win32_impl_acquire_dc() **/ static void -_gdk_win32_impl_release_dc (GdkWindowImplWin32 *impl) +_gdk_win32_impl_release_dc (GdkSurfaceImplWin32 *impl) { if (impl->layered) return; @@ -5552,25 +5552,25 @@ _gdk_win32_impl_release_dc (GdkWindowImplWin32 *impl) } HWND -gdk_win32_window_get_impl_hwnd (GdkWindow *window) +gdk_win32_surface_get_impl_hwnd (GdkSurface *window) { - if (GDK_WINDOW_IS_WIN32 (window)) - return GDK_WINDOW_HWND (window); + if (GDK_SURFACE_IS_WIN32 (window)) + return GDK_SURFACE_HWND (window); return NULL; } static void gdk_win32_cairo_surface_destroy (void *data) { - GdkWindowImplWin32 *impl = data; + GdkSurfaceImplWin32 *impl = data; _gdk_win32_impl_release_dc (impl); impl->cairo_surface = NULL; } static cairo_surface_t * -gdk_win32_ref_cairo_surface_layered (GdkWindow *window, - GdkWindowImplWin32 *impl) +gdk_win32_ref_cairo_surface_layered (GdkSurface *window, + GdkSurfaceImplWin32 *impl) { gint width, height; RECT window_rect; @@ -5646,12 +5646,12 @@ gdk_win32_ref_cairo_surface_layered (GdkWindow *window, } static cairo_surface_t * -gdk_win32_ref_cairo_surface (GdkWindow *window) +gdk_win32_ref_cairo_surface (GdkSurface *window) { - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - if (GDK_IS_WINDOW_IMPL_WIN32 (impl) && - GDK_WINDOW_DESTROYED (impl->wrapper)) + if (GDK_IS_SURFACE_IMPL_WIN32 (impl) && + GDK_SURFACE_DESTROYED (impl->wrapper)) return NULL; if (impl->layered) @@ -5678,7 +5678,7 @@ gdk_win32_ref_cairo_surface (GdkWindow *window) } BOOL WINAPI -GtkShowWindow (GdkWindow *window, +GtkShowWindow (GdkSurface *window, int cmd_show) { cairo_t *cr; @@ -5690,8 +5690,8 @@ GtkShowWindow (GdkWindow *window, POINT source_point; BLENDFUNCTION blender; - HWND hwnd = GDK_WINDOW_HWND (window); - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + HWND hwnd = GDK_SURFACE_HWND (window); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); switch (cmd_show) { @@ -5763,18 +5763,18 @@ GtkShowWindow (GdkWindow *window, } static void -gdk_win32_window_set_shadow_width (GdkWindow *window, +gdk_win32_surface_set_shadow_width (GdkSurface *window, gint left, gint right, gint top, gint bottom) { - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - GDK_NOTE (MISC, g_print ("gdk_win32_window_set_shadow_width: window %p, " + GDK_NOTE (MISC, g_print ("gdk_win32_surface_set_shadow_width: window %p, " "left %d, top %d, right %d, bottom %d\n", window, left, top, right, bottom)); @@ -5793,22 +5793,22 @@ gdk_win32_window_set_shadow_width (GdkWindow *window, gint -_gdk_win32_window_get_scale_factor (GdkWindow *window) +_gdk_win32_surface_get_scale_factor (GdkSurface *window) { GdkDisplay *display; - GdkWindowImplWin32 *impl; + GdkSurfaceImplWin32 *impl; GdkWin32Display *win32_display; UINT dpix, dpiy; gboolean is_scale_acquired; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return 1; g_return_val_if_fail (window != NULL, 1); - display = gdk_window_get_display (window); - impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + display = gdk_surface_get_display (window); + impl = GDK_SURFACE_IMPL_WIN32 (window->impl); win32_display = GDK_WIN32_DISPLAY (display); @@ -5819,7 +5819,7 @@ _gdk_win32_window_get_scale_factor (GdkWindow *window) else impl->window_scale = _gdk_win32_display_get_monitor_scale_factor (win32_display, NULL, - GDK_WINDOW_HWND (window), + GDK_SURFACE_HWND (window), NULL); return impl->window_scale; @@ -5843,11 +5843,11 @@ _gdk_win32_window_get_scale_factor (GdkWindow *window) } void -_gdk_win32_window_get_unscaled_size (GdkWindow *window, +_gdk_win32_surface_get_unscaled_size (GdkSurface *window, gint *unscaled_width, gint *unscaled_height) { - GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl); + GdkSurfaceImplWin32 *impl = GDK_SURFACE_IMPL_WIN32 (window->impl); if (unscaled_width) *unscaled_width = impl->unscaled_width; @@ -5856,7 +5856,7 @@ _gdk_win32_window_get_unscaled_size (GdkWindow *window, } static void -gdk_win32_input_shape_combine_region (GdkWindow *window, +gdk_win32_input_shape_combine_region (GdkSurface *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y) @@ -5867,93 +5867,93 @@ gdk_win32_input_shape_combine_region (GdkWindow *window, } static void -gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass) +gdk_surface_impl_win32_class_init (GdkSurfaceImplWin32Class *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass); + GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_CLASS (klass); parent_class = g_type_class_peek_parent (klass); - object_class->finalize = gdk_window_impl_win32_finalize; + object_class->finalize = gdk_surface_impl_win32_finalize; impl_class->ref_cairo_surface = gdk_win32_ref_cairo_surface; - impl_class->show = gdk_win32_window_show; - impl_class->hide = gdk_win32_window_hide; - impl_class->withdraw = gdk_win32_window_withdraw; - impl_class->set_events = gdk_win32_window_set_events; - impl_class->get_events = gdk_win32_window_get_events; - impl_class->raise = gdk_win32_window_raise; - impl_class->lower = gdk_win32_window_lower; - impl_class->restack_toplevel = gdk_win32_window_restack_toplevel; - impl_class->move_resize = gdk_win32_window_move_resize; - impl_class->get_geometry = gdk_win32_window_get_geometry; - impl_class->get_device_state = gdk_window_win32_get_device_state; - impl_class->get_root_coords = gdk_win32_window_get_root_coords; - - impl_class->shape_combine_region = gdk_win32_window_shape_combine_region; + impl_class->show = gdk_win32_surface_show; + impl_class->hide = gdk_win32_surface_hide; + impl_class->withdraw = gdk_win32_surface_withdraw; + impl_class->set_events = gdk_win32_surface_set_events; + impl_class->get_events = gdk_win32_surface_get_events; + impl_class->raise = gdk_win32_surface_raise; + impl_class->lower = gdk_win32_surface_lower; + impl_class->restack_toplevel = gdk_win32_surface_restack_toplevel; + impl_class->move_resize = gdk_win32_surface_move_resize; + impl_class->get_geometry = gdk_win32_surface_get_geometry; + impl_class->get_device_state = gdk_surface_win32_get_device_state; + impl_class->get_root_coords = gdk_win32_surface_get_root_coords; + + impl_class->shape_combine_region = gdk_win32_surface_shape_combine_region; impl_class->input_shape_combine_region = gdk_win32_input_shape_combine_region; - impl_class->destroy = gdk_win32_window_destroy; - impl_class->begin_paint = gdk_win32_window_begin_paint; - impl_class->end_paint = gdk_win32_window_end_paint; - - //impl_class->beep = gdk_x11_window_beep; - - - impl_class->show_window_menu = gdk_win32_window_show_window_menu; - impl_class->focus = gdk_win32_window_focus; - impl_class->set_type_hint = gdk_win32_window_set_type_hint; - impl_class->get_type_hint = gdk_win32_window_get_type_hint; - impl_class->set_modal_hint = gdk_win32_window_set_modal_hint; - impl_class->set_skip_taskbar_hint = gdk_win32_window_set_skip_taskbar_hint; - impl_class->set_skip_pager_hint = gdk_win32_window_set_skip_pager_hint; - impl_class->set_urgency_hint = gdk_win32_window_set_urgency_hint; - impl_class->set_geometry_hints = gdk_win32_window_set_geometry_hints; - impl_class->set_title = gdk_win32_window_set_title; - impl_class->set_role = gdk_win32_window_set_role; - //impl_class->set_startup_id = gdk_x11_window_set_startup_id; - impl_class->set_transient_for = gdk_win32_window_set_transient_for; - impl_class->get_frame_extents = gdk_win32_window_get_frame_extents; - impl_class->set_accept_focus = gdk_win32_window_set_accept_focus; - impl_class->set_focus_on_map = gdk_win32_window_set_focus_on_map; - impl_class->set_icon_list = gdk_win32_window_set_icon_list; - impl_class->set_icon_name = gdk_win32_window_set_icon_name; - impl_class->iconify = gdk_win32_window_iconify; - impl_class->deiconify = gdk_win32_window_deiconify; - impl_class->stick = gdk_win32_window_stick; - impl_class->unstick = gdk_win32_window_unstick; - impl_class->maximize = gdk_win32_window_maximize; - impl_class->unmaximize = gdk_win32_window_unmaximize; - impl_class->fullscreen = gdk_win32_window_fullscreen; - impl_class->unfullscreen = gdk_win32_window_unfullscreen; - impl_class->set_keep_above = gdk_win32_window_set_keep_above; - impl_class->set_keep_below = gdk_win32_window_set_keep_below; - impl_class->get_group = gdk_win32_window_get_group; - impl_class->set_group = gdk_win32_window_set_group; - impl_class->set_decorations = gdk_win32_window_set_decorations; - impl_class->get_decorations = gdk_win32_window_get_decorations; - impl_class->set_functions = gdk_win32_window_set_functions; - - impl_class->set_shadow_width = gdk_win32_window_set_shadow_width; - impl_class->begin_resize_drag = gdk_win32_window_begin_resize_drag; - impl_class->begin_move_drag = gdk_win32_window_begin_move_drag; - impl_class->set_opacity = gdk_win32_window_set_opacity; - impl_class->destroy_notify = gdk_win32_window_destroy_notify; - impl_class->register_dnd = _gdk_win32_window_register_dnd; - impl_class->drag_begin = _gdk_win32_window_drag_begin; - impl_class->create_gl_context = _gdk_win32_window_create_gl_context; - impl_class->get_scale_factor = _gdk_win32_window_get_scale_factor; - impl_class->get_unscaled_size = _gdk_win32_window_get_unscaled_size; + impl_class->destroy = gdk_win32_surface_destroy; + impl_class->begin_paint = gdk_win32_surface_begin_paint; + impl_class->end_paint = gdk_win32_surface_end_paint; + + //impl_class->beep = gdk_x11_surface_beep; + + + impl_class->show_window_menu = gdk_win32_surface_show_window_menu; + impl_class->focus = gdk_win32_surface_focus; + impl_class->set_type_hint = gdk_win32_surface_set_type_hint; + impl_class->get_type_hint = gdk_win32_surface_get_type_hint; + impl_class->set_modal_hint = gdk_win32_surface_set_modal_hint; + impl_class->set_skip_taskbar_hint = gdk_win32_surface_set_skip_taskbar_hint; + impl_class->set_skip_pager_hint = gdk_win32_surface_set_skip_pager_hint; + impl_class->set_urgency_hint = gdk_win32_surface_set_urgency_hint; + impl_class->set_geometry_hints = gdk_win32_surface_set_geometry_hints; + impl_class->set_title = gdk_win32_surface_set_title; + impl_class->set_role = gdk_win32_surface_set_role; + //impl_class->set_startup_id = gdk_x11_surface_set_startup_id; + impl_class->set_transient_for = gdk_win32_surface_set_transient_for; + impl_class->get_frame_extents = gdk_win32_surface_get_frame_extents; + impl_class->set_accept_focus = gdk_win32_surface_set_accept_focus; + impl_class->set_focus_on_map = gdk_win32_surface_set_focus_on_map; + impl_class->set_icon_list = gdk_win32_surface_set_icon_list; + impl_class->set_icon_name = gdk_win32_surface_set_icon_name; + impl_class->iconify = gdk_win32_surface_iconify; + impl_class->deiconify = gdk_win32_surface_deiconify; + impl_class->stick = gdk_win32_surface_stick; + impl_class->unstick = gdk_win32_surface_unstick; + impl_class->maximize = gdk_win32_surface_maximize; + impl_class->unmaximize = gdk_win32_surface_unmaximize; + impl_class->fullscreen = gdk_win32_surface_fullscreen; + impl_class->unfullscreen = gdk_win32_surface_unfullscreen; + impl_class->set_keep_above = gdk_win32_surface_set_keep_above; + impl_class->set_keep_below = gdk_win32_surface_set_keep_below; + impl_class->get_group = gdk_win32_surface_get_group; + impl_class->set_group = gdk_win32_surface_set_group; + impl_class->set_decorations = gdk_win32_surface_set_decorations; + impl_class->get_decorations = gdk_win32_surface_get_decorations; + impl_class->set_functions = gdk_win32_surface_set_functions; + + impl_class->set_shadow_width = gdk_win32_surface_set_shadow_width; + impl_class->begin_resize_drag = gdk_win32_surface_begin_resize_drag; + impl_class->begin_move_drag = gdk_win32_surface_begin_move_drag; + impl_class->set_opacity = gdk_win32_surface_set_opacity; + impl_class->destroy_notify = gdk_win32_surface_destroy_notify; + impl_class->register_dnd = _gdk_win32_surface_register_dnd; + impl_class->drag_begin = _gdk_win32_surface_drag_begin; + impl_class->create_gl_context = _gdk_win32_surface_create_gl_context; + impl_class->get_scale_factor = _gdk_win32_surface_get_scale_factor; + impl_class->get_unscaled_size = _gdk_win32_surface_get_unscaled_size; } HGDIOBJ -gdk_win32_window_get_handle (GdkWindow *window) +gdk_win32_surface_get_handle (GdkSurface *window) { - if (!GDK_WINDOW_IS_WIN32 (window)) + if (!GDK_SURFACE_IS_WIN32 (window)) { g_warning (G_STRLOC " window is not a native Win32 window"); return NULL; } - return GDK_WINDOW_HWND (window); + return GDK_SURFACE_HWND (window); } diff --git a/gdk/win32/gdkwindow-win32.h b/gdk/win32/gdkwindow-win32.h index 101b23f827..4856287611 100644 --- a/gdk/win32/gdkwindow-win32.h +++ b/gdk/win32/gdkwindow-win32.h @@ -22,8 +22,8 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#ifndef __GDK_WINDOW_WIN32_H__ -#define __GDK_WINDOW_WIN32_H__ +#ifndef __GDK_SURFACE_WIN32_H__ +#define __GDK_SURFACE_WIN32_H__ #include "gdk/win32/gdkprivate-win32.h" #include "gdk/gdkwindowimpl.h" @@ -36,15 +36,15 @@ G_BEGIN_DECLS /* Window implementation for Win32 */ -typedef struct _GdkWindowImplWin32 GdkWindowImplWin32; -typedef struct _GdkWindowImplWin32Class GdkWindowImplWin32Class; +typedef struct _GdkSurfaceImplWin32 GdkSurfaceImplWin32; +typedef struct _GdkSurfaceImplWin32Class GdkSurfaceImplWin32Class; -#define GDK_TYPE_WINDOW_IMPL_WIN32 (_gdk_window_impl_win32_get_type ()) -#define GDK_WINDOW_IMPL_WIN32(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_WIN32, GdkWindowImplWin32)) -#define GDK_WINDOW_IMPL_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL_WIN32, GdkWindowImplWin32Class)) -#define GDK_IS_WINDOW_IMPL_WIN32(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_WIN32)) -#define GDK_IS_WINDOW_IMPL_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_WIN32)) -#define GDK_WINDOW_IMPL_WIN32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_WIN32, GdkWindowImplWin32Class)) +#define GDK_TYPE_SURFACE_IMPL_WIN32 (_gdk_surface_impl_win32_get_type ()) +#define GDK_SURFACE_IMPL_WIN32(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL_WIN32, GdkSurfaceImplWin32)) +#define GDK_SURFACE_IMPL_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL_WIN32, GdkSurfaceImplWin32Class)) +#define GDK_IS_SURFACE_IMPL_WIN32(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL_WIN32)) +#define GDK_IS_SURFACE_IMPL_WIN32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL_WIN32)) +#define GDK_SURFACE_IMPL_WIN32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL_WIN32, GdkSurfaceImplWin32Class)) enum _GdkWin32AeroSnapCombo { @@ -107,13 +107,13 @@ typedef enum _GdkWin32MonitorDpiType struct _GdkW32DragMoveResizeContext { /* The window that is being moved/resized */ - GdkWindow *window; + GdkSurface *window; /* The kind of drag-operation going on. */ GdkW32WindowDragOp op; /* The edge that was grabbed for resizing. Not used for moving. */ - GdkWindowEdge edge; + GdkSurfaceEdge edge; /* The device used to initiate the op. * We grab it at the beginning and ungrab it at the end. @@ -223,11 +223,11 @@ struct _GdkW32DragMoveResizeContext typedef struct _GdkW32DragMoveResizeContext GdkW32DragMoveResizeContext; -struct _GdkWindowImplWin32 +struct _GdkSurfaceImplWin32 { - GdkWindowImpl parent_instance; + GdkSurfaceImpl parent_instance; - GdkWindow *wrapper; + GdkSurface *wrapper; HANDLE handle; gint8 toplevel_window_type; @@ -249,9 +249,9 @@ struct _GdkWindowImplWin32 GdkEventMask native_event_mask; - GdkWindowTypeHint type_hint; + GdkSurfaceTypeHint type_hint; - GdkWindow *transient_owner; + GdkSurface *transient_owner; GSList *transient_children; gint num_transients; gboolean changing_state; @@ -286,7 +286,7 @@ struct _GdkWindowImplWin32 guint have_temp_styles : 1; /* If TRUE, the window is in the process of being maximized. - * This is set by WM_SYSCOMMAND and by gdk_win32_window_maximize (), + * This is set by WM_SYSCOMMAND and by gdk_win32_surface_maximize (), * and is unset when WM_WINDOWPOSCHANGING is handled. */ guint maximizing : 1; @@ -334,7 +334,7 @@ struct _GdkWindowImplWin32 /* Also remember the same position, but in absolute form. */ GdkRectangle *snap_stash_int; - /* Decorations set by gdk_window_set_decorations() or NULL if unset */ + /* Decorations set by gdk_surface_set_decorations() or NULL if unset */ GdkWMDecoration* decorations; /* No. of windows to force layered windows off */ @@ -352,25 +352,25 @@ struct _GdkWindowImplWin32 gint unscaled_height; }; -struct _GdkWindowImplWin32Class +struct _GdkSurfaceImplWin32Class { - GdkWindowImplClass parent_class; + GdkSurfaceImplClass parent_class; }; -GType _gdk_window_impl_win32_get_type (void); +GType _gdk_surface_impl_win32_get_type (void); -void _gdk_win32_window_tmp_unset_bg (GdkWindow *window, +void _gdk_win32_surface_tmp_unset_bg (GdkSurface *window, gboolean recurse); -void _gdk_win32_window_tmp_reset_bg (GdkWindow *window, +void _gdk_win32_surface_tmp_reset_bg (GdkSurface *window, gboolean recurse); -void _gdk_win32_window_tmp_unset_parent_bg (GdkWindow *window); -void _gdk_win32_window_tmp_reset_parent_bg (GdkWindow *window); +void _gdk_win32_surface_tmp_unset_parent_bg (GdkSurface *window); +void _gdk_win32_surface_tmp_reset_parent_bg (GdkSurface *window); -void _gdk_win32_window_update_style_bits (GdkWindow *window); +void _gdk_win32_surface_update_style_bits (GdkSurface *window); -gint _gdk_win32_window_get_scale_factor (GdkWindow *window); +gint _gdk_win32_surface_get_scale_factor (GdkSurface *window); G_END_DECLS -#endif /* __GDK_WINDOW_WIN32_H__ */ +#endif /* __GDK_SURFACE_WIN32_H__ */ diff --git a/gdk/x11/gdkdevice-core-x11.c b/gdk/x11/gdkdevice-core-x11.c index 8cd0408661..6bbdda6693 100644 --- a/gdk/x11/gdkdevice-core-x11.c +++ b/gdk/x11/gdkdevice-core-x11.c @@ -40,45 +40,45 @@ struct _GdkX11DeviceCoreClass }; static gboolean gdk_x11_device_core_get_history (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, guint32 start, guint32 stop, GdkTimeCoord ***events, gint *n_events); static void gdk_x11_device_core_get_state (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, GdkModifierType *mask); static void gdk_x11_device_core_set_window_cursor (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkCursor *cursor); static void gdk_x11_device_core_warp (GdkDevice *device, gdouble x, gdouble y); static void gdk_x11_device_core_query_state (GdkDevice *device, - GdkWindow *window, - GdkWindow **child_window, + GdkSurface *window, + GdkSurface **child_window, gdouble *root_x, gdouble *root_y, gdouble *win_x, gdouble *win_y, GdkModifierType *mask); static GdkGrabStatus gdk_x11_device_core_grab (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gboolean owner_events, GdkEventMask event_mask, - GdkWindow *confine_to, + GdkSurface *confine_to, GdkCursor *cursor, guint32 time_); static void gdk_x11_device_core_ungrab (GdkDevice *device, guint32 time_); -static GdkWindow * gdk_x11_device_core_window_at_position (GdkDevice *device, +static GdkSurface * gdk_x11_device_core_window_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, gboolean get_toplevel); static void gdk_x11_device_core_select_window_events (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkEventMask event_mask); G_DEFINE_TYPE (GdkX11DeviceCore, gdk_x11_device_core, GDK_TYPE_DEVICE) @@ -111,7 +111,7 @@ gdk_x11_device_core_init (GdkX11DeviceCore *device_core) } static gboolean -impl_coord_in_window (GdkWindow *window, +impl_coord_in_window (GdkSurface *window, int impl_x, int impl_y) { @@ -128,7 +128,7 @@ impl_coord_in_window (GdkWindow *window, static gboolean gdk_x11_device_core_get_history (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, guint32 start, guint32 stop, GdkTimeCoord ***events, @@ -136,15 +136,15 @@ gdk_x11_device_core_get_history (GdkDevice *device, { XTimeCoord *xcoords; GdkTimeCoord **coords; - GdkWindow *impl_window; - GdkWindowImplX11 *impl; + GdkSurface *impl_window; + GdkSurfaceImplX11 *impl; int tmp_n_events; int i, j; - impl_window = _gdk_window_get_impl_window (window); - impl = GDK_WINDOW_IMPL_X11 (impl_window->impl); - xcoords = XGetMotionEvents (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (impl_window), + impl_window = _gdk_surface_get_impl_window (window); + impl = GDK_SURFACE_IMPL_X11 (impl_window->impl); + xcoords = XGetMotionEvents (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (impl_window), start, stop, &tmp_n_events); if (!xcoords) return FALSE; @@ -194,13 +194,13 @@ gdk_x11_device_core_get_history (GdkDevice *device, static void gdk_x11_device_core_get_state (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, GdkModifierType *mask) { 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) { @@ -211,7 +211,7 @@ gdk_x11_device_core_get_state (GdkDevice *device, static void gdk_x11_device_core_set_window_cursor (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkCursor *cursor) { GdkDisplay *display = gdk_device_get_display (device); @@ -223,7 +223,7 @@ gdk_x11_device_core_set_window_cursor (GdkDevice *device, xcursor = gdk_x11_display_get_xcursor (display, cursor); XDefineCursor (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), xcursor); } @@ -249,8 +249,8 @@ gdk_x11_device_core_warp (GdkDevice *device, static void gdk_x11_device_core_query_state (GdkDevice *device, - GdkWindow *window, - GdkWindow **child_window, + GdkSurface *window, + GdkSurface **child_window, gdouble *root_x, gdouble *root_y, gdouble *win_x, @@ -274,12 +274,12 @@ gdk_x11_device_core_query_state (GdkDevice *device, } else { - xwindow = GDK_WINDOW_XID (window); - scale = GDK_WINDOW_IMPL_X11 (window->impl)->window_scale; + xwindow = GDK_SURFACE_XID (window); + scale = GDK_SURFACE_IMPL_X11 (window->impl)->window_scale; } if (!GDK_X11_DISPLAY (display)->trusted_client || - !XQueryPointer (GDK_WINDOW_XDISPLAY (window), + !XQueryPointer (GDK_SURFACE_XDISPLAY (window), xwindow, &xroot_window, &xchild_window, @@ -307,7 +307,7 @@ gdk_x11_device_core_query_state (GdkDevice *device, } if (child_window) - *child_window = gdk_x11_window_lookup_for_display (display, xchild_window); + *child_window = gdk_x11_surface_lookup_for_display (display, xchild_window); if (root_x) *root_x = (double)xroot_x / scale; @@ -327,10 +327,10 @@ gdk_x11_device_core_query_state (GdkDevice *device, static GdkGrabStatus gdk_x11_device_core_grab (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gboolean owner_events, GdkEventMask event_mask, - GdkWindow *confine_to, + GdkSurface *confine_to, GdkCursor *cursor, guint32 time_) { @@ -340,15 +340,15 @@ gdk_x11_device_core_grab (GdkDevice *device, display = gdk_device_get_display (device); - xwindow = GDK_WINDOW_XID (window); + xwindow = GDK_SURFACE_XID (window); if (confine_to) - confine_to = _gdk_window_get_impl_window (confine_to); + confine_to = _gdk_surface_get_impl_window (confine_to); - if (!confine_to || GDK_WINDOW_DESTROYED (confine_to)) + if (!confine_to || GDK_SURFACE_DESTROYED (confine_to)) xconfine_to = None; else - xconfine_to = GDK_WINDOW_XID (confine_to); + xconfine_to = GDK_SURFACE_XID (confine_to); #ifdef G_ENABLE_DEBUG if (GDK_DISPLAY_DEBUG_CHECK (display, NOGRABS)) @@ -424,17 +424,17 @@ gdk_x11_device_core_ungrab (GdkDevice *device, _gdk_x11_display_update_grab_info_ungrab (display, device, time_, serial); } -static GdkWindow * +static GdkSurface * gdk_x11_device_core_window_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, gboolean get_toplevel) { - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; GdkDisplay *display; Display *xdisplay; - GdkWindow *window; + GdkSurface *window; GdkX11Screen *screen; Window xwindow, root, child, last; int xroot_x, xroot_y, xwin_x, xwin_y; @@ -480,9 +480,9 @@ gdk_x11_device_core_window_at_position (GdkDevice *device, toplevels = gdk_x11_display_get_toplevel_windows (display); for (list = toplevels; list != NULL; list = list->next) { - window = GDK_WINDOW (list->data); - impl = GDK_WINDOW_IMPL_X11 (window->impl); - xwindow = GDK_WINDOW_XID (window); + window = GDK_SURFACE (list->data); + impl = GDK_SURFACE_IMPL_X11 (window->impl); + xwindow = GDK_SURFACE_XID (window); gdk_x11_display_error_trap_push (display); XQueryPointer (xdisplay, xwindow, &root, &child, @@ -496,7 +496,7 @@ gdk_x11_device_core_window_at_position (GdkDevice *device, pointer_window = child; break; } - gdk_window_get_geometry (window, NULL, NULL, &width, &height); + gdk_surface_get_geometry (window, NULL, NULL, &width, &height); if (winx >= 0 && winy >= 0 && winx < width * impl->window_scale && winy < height * impl->window_scale) { /* A childless toplevel, or below another window? */ @@ -537,8 +537,8 @@ gdk_x11_device_core_window_at_position (GdkDevice *device, break; if (get_toplevel && last != root && - (window = gdk_x11_window_lookup_for_display (display, last)) != NULL && - window->window_type != GDK_WINDOW_FOREIGN) + (window = gdk_x11_surface_lookup_for_display (display, last)) != NULL && + window->window_type != GDK_SURFACE_FOREIGN) { xwindow = last; break; @@ -547,10 +547,10 @@ gdk_x11_device_core_window_at_position (GdkDevice *device, gdk_x11_display_ungrab (display); - window = gdk_x11_window_lookup_for_display (display, last); + window = gdk_x11_surface_lookup_for_display (display, last); impl = NULL; if (window) - impl = GDK_WINDOW_IMPL_X11 (window->impl); + impl = GDK_SURFACE_IMPL_X11 (window->impl); if (win_x) *win_x = (window) ? (double)xwin_x / impl->window_scale : -1; @@ -566,14 +566,14 @@ gdk_x11_device_core_window_at_position (GdkDevice *device, static void gdk_x11_device_core_select_window_events (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkEventMask event_mask) { GdkEventMask filter_mask, window_mask; guint xmask = 0; gint i; - window_mask = gdk_window_get_events (window); + window_mask = gdk_surface_get_events (window); filter_mask = GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON1_MOTION_MASK @@ -605,10 +605,10 @@ gdk_x11_device_core_select_window_events (GdkDevice *device, xmask |= _gdk_x11_event_mask_table[i]; } - if (GDK_WINDOW_XID (window) != GDK_WINDOW_XROOTWIN (window)) + if (GDK_SURFACE_XID (window) != GDK_SURFACE_XROOTWIN (window)) xmask |= StructureNotifyMask | PropertyChangeMask; - XSelectInput (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + XSelectInput (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), xmask); } diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c index 98d3ce38a5..a73a036023 100644 --- a/gdk/x11/gdkdevice-xi2.c +++ b/gdk/x11/gdkdevice-xi2.c @@ -71,18 +71,18 @@ static void gdk_x11_device_xi2_set_property (GObject *object, GParamSpec *pspec); static void gdk_x11_device_xi2_get_state (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, GdkModifierType *mask); static void gdk_x11_device_xi2_set_window_cursor (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkCursor *cursor); static void gdk_x11_device_xi2_warp (GdkDevice *device, gdouble x, gdouble y); static void gdk_x11_device_xi2_query_state (GdkDevice *device, - GdkWindow *window, - GdkWindow **child_window, + GdkSurface *window, + GdkSurface **child_window, gdouble *root_x, gdouble *root_y, gdouble *win_x, @@ -90,22 +90,22 @@ static void gdk_x11_device_xi2_query_state (GdkDevice *device, GdkModifierType *mask); static GdkGrabStatus gdk_x11_device_xi2_grab (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gboolean owner_events, GdkEventMask event_mask, - GdkWindow *confine_to, + GdkSurface *confine_to, GdkCursor *cursor, guint32 time_); static void gdk_x11_device_xi2_ungrab (GdkDevice *device, guint32 time_); -static GdkWindow * gdk_x11_device_xi2_window_at_position (GdkDevice *device, +static GdkSurface * gdk_x11_device_xi2_window_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, gboolean get_toplevel); static void gdk_x11_device_xi2_select_window_events (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkEventMask event_mask); @@ -200,7 +200,7 @@ gdk_x11_device_xi2_set_property (GObject *object, static void gdk_x11_device_xi2_get_state (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gdouble *axes, GdkModifierType *mask) { @@ -245,7 +245,7 @@ gdk_x11_device_xi2_get_state (GdkDevice *device, gint root_x, root_y; /* FIXME: Maybe root coords chaching should happen here */ - gdk_window_get_origin (window, &root_x, &root_y); + gdk_surface_get_origin (window, &root_x, &root_y); _gdk_device_translate_screen_coord (device, window, root_x, root_y, WidthOfScreen (xscreen), @@ -276,7 +276,7 @@ gdk_x11_device_xi2_get_state (GdkDevice *device, static void gdk_x11_device_xi2_set_window_cursor (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkCursor *cursor) { GdkX11DeviceXI2 *device_xi2 = GDK_X11_DEVICE_XI2 (device); @@ -286,14 +286,14 @@ gdk_x11_device_xi2_set_window_cursor (GdkDevice *device, return; if (cursor) - XIDefineCursor (GDK_WINDOW_XDISPLAY (window), + XIDefineCursor (GDK_SURFACE_XDISPLAY (window), device_xi2->device_id, - GDK_WINDOW_XID (window), - gdk_x11_display_get_xcursor (GDK_WINDOW_DISPLAY (window), cursor)); + GDK_SURFACE_XID (window), + gdk_x11_display_get_xcursor (GDK_SURFACE_DISPLAY (window), cursor)); else - XIUndefineCursor (GDK_WINDOW_XDISPLAY (window), + XIUndefineCursor (GDK_SURFACE_XDISPLAY (window), device_xi2->device_id, - GDK_WINDOW_XID (window)); + GDK_SURFACE_XID (window)); } static void @@ -316,8 +316,8 @@ gdk_x11_device_xi2_warp (GdkDevice *device, static void gdk_x11_device_xi2_query_state (GdkDevice *device, - GdkWindow *window, - GdkWindow **child_window, + GdkSurface *window, + GdkSurface **child_window, gdouble *root_x, gdouble *root_y, gdouble *win_x, @@ -343,8 +343,8 @@ gdk_x11_device_xi2_query_state (GdkDevice *device, } else { - xwindow = GDK_WINDOW_XID (window); - scale = GDK_WINDOW_IMPL_X11 (window->impl)->window_scale; + xwindow = GDK_SURFACE_XID (window); + scale = GDK_SURFACE_IMPL_X11 (window->impl)->window_scale; } if (gdk_device_get_device_type (device) == GDK_DEVICE_TYPE_SLAVE) @@ -393,7 +393,7 @@ gdk_x11_device_xi2_query_state (GdkDevice *device, } if (child_window) - *child_window = gdk_x11_window_lookup_for_display (display, xchild_window); + *child_window = gdk_x11_surface_lookup_for_display (display, xchild_window); if (root_x) *root_x = xroot_x / scale; @@ -415,10 +415,10 @@ gdk_x11_device_xi2_query_state (GdkDevice *device, static GdkGrabStatus gdk_x11_device_xi2_grab (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, gboolean owner_events, GdkEventMask event_mask, - GdkWindow *confine_to, + GdkSurface *confine_to, GdkCursor *cursor, guint32 time_) { @@ -435,7 +435,7 @@ gdk_x11_device_xi2_grab (GdkDevice *device, /* FIXME: confine_to is actually unused */ - xwindow = GDK_WINDOW_XID (window); + xwindow = GDK_SURFACE_XID (window); if (!cursor) xcursor = None; @@ -486,19 +486,19 @@ gdk_x11_device_xi2_ungrab (GdkDevice *device, _gdk_x11_display_update_grab_info_ungrab (display, device, time_, serial); } -static GdkWindow * +static GdkSurface * gdk_x11_device_xi2_window_at_position (GdkDevice *device, gdouble *win_x, gdouble *win_y, GdkModifierType *mask, gboolean get_toplevel) { - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; GdkX11DeviceXI2 *device_xi2 = GDK_X11_DEVICE_XI2 (device); GdkDisplay *display; GdkX11Screen *screen; Display *xdisplay; - GdkWindow *window; + GdkSurface *window; Window xwindow, root, child, last = None; gdouble xroot_x, xroot_y, xwin_x, xwin_y; XIButtonState button_state = { 0 }; @@ -550,8 +550,8 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device, toplevels = gdk_x11_display_get_toplevel_windows (display); for (list = toplevels; list != NULL; list = list->next) { - window = GDK_WINDOW (list->data); - xwindow = GDK_WINDOW_XID (window); + window = GDK_SURFACE (list->data); + xwindow = GDK_SURFACE_XID (window); /* Free previous button mask, if any */ g_free (button_state.mask); @@ -573,7 +573,7 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device, pointer_window = child; break; } - gdk_window_get_geometry (window, NULL, NULL, &width, &height); + gdk_surface_get_geometry (window, NULL, NULL, &width, &height); if (xwin_x >= 0 && xwin_y >= 0 && xwin_x < width && xwin_y < height) { /* A childless toplevel, or below another window? */ @@ -628,8 +628,8 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device, break; if (get_toplevel && last != root && - (window = gdk_x11_window_lookup_for_display (display, last)) != NULL && - GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN) + (window = gdk_x11_surface_lookup_for_display (display, last)) != NULL && + GDK_SURFACE_TYPE (window) != GDK_SURFACE_FOREIGN) { xwindow = last; break; @@ -640,10 +640,10 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device, if (gdk_x11_display_error_trap_pop (display) == 0) { - window = gdk_x11_window_lookup_for_display (display, last); + window = gdk_x11_surface_lookup_for_display (display, last); impl = NULL; if (window) - impl = GDK_WINDOW_IMPL_X11 (window->impl); + impl = GDK_SURFACE_IMPL_X11 (window->impl); if (mask) *mask = _gdk_x11_device_xi2_translate_state (&mod_state, &button_state, &group_state); @@ -670,7 +670,7 @@ gdk_x11_device_xi2_window_at_position (GdkDevice *device, static void gdk_x11_device_xi2_select_window_events (GdkDevice *device, - GdkWindow *window, + GdkSurface *window, GdkEventMask event_mask) { GdkX11DeviceXI2 *device_xi2 = GDK_X11_DEVICE_XI2 (device); @@ -686,8 +686,8 @@ gdk_x11_device_xi2_select_window_events (GdkDevice *device, event_mask, &evmask.mask_len); - XISelectEvents (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + XISelectEvents (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), &evmask, 1); g_free (evmask.mask); diff --git a/gdk/x11/gdkdevicemanager-core-x11.c b/gdk/x11/gdkdevicemanager-core-x11.c index 5606d8949d..f5c4a35701 100644 --- a/gdk/x11/gdkdevicemanager-core-x11.c +++ b/gdk/x11/gdkdevicemanager-core-x11.c @@ -261,19 +261,19 @@ static const char notify_details[][23] = { #endif static void -set_user_time (GdkWindow *window, +set_user_time (GdkSurface *window, GdkEvent *event) { g_return_if_fail (event != NULL); - window = gdk_window_get_toplevel (event->any.window); - g_return_if_fail (GDK_IS_WINDOW (window)); + window = gdk_surface_get_toplevel (event->any.window); + g_return_if_fail (GDK_IS_SURFACE (window)); /* If an event doesn't have a valid timestamp, we shouldn't use it * to update the latest user interaction time. */ if (gdk_event_get_time (event) != GDK_CURRENT_TIME) - gdk_x11_window_set_user_time (gdk_window_get_toplevel (window), + gdk_x11_surface_set_user_time (gdk_surface_get_toplevel (window), gdk_event_get_time (event)); } @@ -316,10 +316,10 @@ translate_notify_type (int detail) } static gboolean -is_parent_of (GdkWindow *parent, - GdkWindow *child) +is_parent_of (GdkSurface *parent, + GdkSurface *child) { - GdkWindow *w; + GdkSurface *w; w = child; while (w != NULL) @@ -327,21 +327,21 @@ is_parent_of (GdkWindow *parent, if (w == parent) return TRUE; - w = gdk_window_get_parent (w); + w = gdk_surface_get_parent (w); } return FALSE; } -static GdkWindow * +static GdkSurface * get_event_window (GdkEventTranslator *translator, const XEvent *xevent) { GdkDisplay *display; - GdkWindow *window; + GdkSurface *window; display = GDK_X11_DEVICE_MANAGER_CORE (translator)->display; - window = gdk_x11_window_lookup_for_display (display, xevent->xany.window); + window = gdk_x11_surface_lookup_for_display (display, xevent->xany.window); /* Apply keyboard grabs to non-native windows */ if (xevent->type == KeyPress || xevent->type == KeyRelease) @@ -371,9 +371,9 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator, GdkEvent *event, const XEvent *xevent) { - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; GdkX11DeviceManagerCore *device_manager; - GdkWindow *window; + GdkSurface *window; gboolean return_val; int scale; GdkX11Display *display_x11 = GDK_X11_DISPLAY (display); @@ -385,18 +385,18 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator, scale = 1; if (window) { - if (GDK_WINDOW_DESTROYED (window) || !GDK_IS_WINDOW (window)) + if (GDK_SURFACE_DESTROYED (window) || !GDK_IS_SURFACE (window)) return FALSE; g_object_ref (window); - impl = GDK_WINDOW_IMPL_X11 (window->impl); + impl = GDK_SURFACE_IMPL_X11 (window->impl); scale = impl->window_scale; } event->any.window = window; event->any.send_event = xevent->xany.send_event ? TRUE : FALSE; - if (window && GDK_WINDOW_DESTROYED (window)) + if (window && GDK_SURFACE_DESTROYED (window)) { if (xevent->type != DestroyNotify) { @@ -622,10 +622,10 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator, gdk_event_set_device (event, device_manager->core_pointer); /* If the subwindow field of the XEvent is non-NULL, then - * lookup the corresponding GdkWindow. + * lookup the corresponding GdkSurface. */ if (xevent->xcrossing.subwindow != None) - event->crossing.subwindow = gdk_x11_window_lookup_for_display (display, xevent->xcrossing.subwindow); + event->crossing.subwindow = gdk_x11_surface_lookup_for_display (display, xevent->xcrossing.subwindow); else event->crossing.subwindow = NULL; @@ -662,10 +662,10 @@ gdk_x11_device_manager_core_translate_event (GdkEventTranslator *translator, gdk_event_set_device (event, device_manager->core_pointer); /* If the subwindow field of the XEvent is non-NULL, then - * lookup the corresponding GdkWindow. + * lookup the corresponding GdkSurface. */ if (xevent->xcrossing.subwindow != None) - event->crossing.subwindow = gdk_x11_window_lookup_for_display (display, xevent->xcrossing.subwindow); + event->crossing.subwindow = gdk_x11_surface_lookup_for_display (display, xevent->xcrossing.subwindow); else event->crossing.subwindow = NULL; @@ -792,7 +792,7 @@ _gdk_x11_event_translate_keyboard_string (GdkEventKey *event) * window (not a ancestor or child) got or lost the focus */ void -_gdk_device_manager_core_handle_focus (GdkWindow *window, +_gdk_device_manager_core_handle_focus (GdkSurface *window, Window original, GdkDevice *device, GdkDevice *source_device, @@ -804,17 +804,17 @@ _gdk_device_manager_core_handle_focus (GdkWindow *window, GdkX11Screen *x11_screen; gboolean had_focus; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); g_return_if_fail (GDK_IS_DEVICE (device)); g_return_if_fail (source_device == NULL || GDK_IS_DEVICE (source_device)); - GDK_DISPLAY_NOTE (gdk_window_get_display (window), EVENTS, + GDK_DISPLAY_NOTE (gdk_surface_get_display (window), EVENTS, g_message ("focus out:\t\twindow: %ld, detail: %s, mode: %s", - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), notify_details[detail], notify_modes[mode])); - toplevel = _gdk_x11_window_get_toplevel (window); + toplevel = _gdk_x11_surface_get_toplevel (window); if (!toplevel) return; @@ -823,7 +823,7 @@ _gdk_device_manager_core_handle_focus (GdkWindow *window, return; had_focus = HAS_FOCUS (toplevel); - x11_screen = GDK_X11_SCREEN (GDK_WINDOW_SCREEN (window)); + x11_screen = GDK_X11_SCREEN (GDK_SURFACE_SCREEN (window)); switch (detail) { @@ -896,7 +896,7 @@ _gdk_device_manager_core_handle_focus (GdkWindow *window, if (source_device) gdk_event_set_source_device (event, source_device); - gdk_display_put_event (gdk_window_get_display (window), event); + gdk_display_put_event (gdk_surface_get_display (window), event); g_object_unref (event); } } diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c index 2c12bdd203..19c4002537 100644 --- a/gdk/x11/gdkdevicemanager-xi2.c +++ b/gdk/x11/gdkdevicemanager-xi2.c @@ -85,7 +85,7 @@ static GdkEventMask gdk_x11_device_manager_xi2_get_handled_events (GdkEventTra static void gdk_x11_device_manager_xi2_select_window_events (GdkEventTranslator *translator, Window window, GdkEventMask event_mask); -static GdkWindow * gdk_x11_device_manager_xi2_get_window (GdkEventTranslator *translator, +static GdkSurface * gdk_x11_device_manager_xi2_get_window (GdkEventTranslator *translator, const XEvent *xevent); enum { @@ -1061,11 +1061,11 @@ translate_notify_type (gint detail) static void set_user_time (GdkEvent *event) { - GdkWindow *window; + GdkSurface *window; guint32 time; - window = gdk_window_get_toplevel (event->any.window); - g_return_if_fail (GDK_IS_WINDOW (window)); + window = gdk_surface_get_toplevel (event->any.window); + g_return_if_fail (GDK_IS_SURFACE (window)); time = gdk_event_get_time (event); @@ -1073,14 +1073,14 @@ set_user_time (GdkEvent *event) * to update the latest user interaction time. */ if (time != GDK_CURRENT_TIME) - gdk_x11_window_set_user_time (window, time); + gdk_x11_surface_set_user_time (window, time); } static gdouble * translate_axes (GdkDevice *device, gdouble x, gdouble y, - GdkWindow *window, + GdkSurface *window, XIValuatorState *valuators) { guint n_axes, i; @@ -1132,10 +1132,10 @@ translate_axes (GdkDevice *device, } static gboolean -is_parent_of (GdkWindow *parent, - GdkWindow *child) +is_parent_of (GdkSurface *parent, + GdkSurface *child) { - GdkWindow *w; + GdkSurface *w; w = child; while (w != NULL) @@ -1143,7 +1143,7 @@ is_parent_of (GdkWindow *parent, if (w == parent) return TRUE; - w = gdk_window_get_parent (w); + w = gdk_surface_get_parent (w); } return FALSE; @@ -1152,10 +1152,10 @@ is_parent_of (GdkWindow *parent, static gboolean get_event_window (GdkEventTranslator *translator, XIEvent *ev, - GdkWindow **window_p) + GdkSurface **window_p) { GdkDisplay *display; - GdkWindow *window = NULL; + GdkSurface *window = NULL; gboolean should_have_window = TRUE; display = GDK_X11_DEVICE_MANAGER_CORE (translator)->display; @@ -1175,7 +1175,7 @@ get_event_window (GdkEventTranslator *translator, { XIDeviceEvent *xev = (XIDeviceEvent *) ev; - window = gdk_x11_window_lookup_for_display (display, xev->event); + window = gdk_x11_surface_lookup_for_display (display, xev->event); /* Apply keyboard grabs to non-native windows */ if (ev->evtype == XI_KeyPress || ev->evtype == XI_KeyRelease) @@ -1207,7 +1207,7 @@ get_event_window (GdkEventTranslator *translator, { XIEnterEvent *xev = (XIEnterEvent *) ev; - window = gdk_x11_window_lookup_for_display (display, xev->event); + window = gdk_x11_surface_lookup_for_display (display, xev->event); } break; default: @@ -1349,8 +1349,8 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator, const XGenericEventCookie *cookie; GdkDevice *device, *source_device; gboolean return_val = TRUE; - GdkWindow *window; - GdkWindowImplX11 *impl; + GdkSurface *window; + GdkSurfaceImplX11 *impl; int scale; XIEvent *ev; @@ -1370,13 +1370,13 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator, if (!get_event_window (translator, ev, &window)) return FALSE; - if (window && GDK_WINDOW_DESTROYED (window)) + if (window && GDK_SURFACE_DESTROYED (window)) return FALSE; scale = 1; if (window) { - impl = GDK_WINDOW_IMPL_X11 (window->impl); + impl = GDK_SURFACE_IMPL_X11 (window->impl); scale = impl->window_scale; } @@ -1805,7 +1805,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator, event->crossing.focus = xev->focus; event->any.window = window; - event->crossing.subwindow = gdk_x11_window_lookup_for_display (display, xev->child); + event->crossing.subwindow = gdk_x11_surface_lookup_for_display (display, xev->child); device = g_hash_table_lookup (device_manager->id_table, GINT_TO_POINTER (xev->deviceid)); @@ -1817,7 +1817,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator, if (ev->evtype == XI_Enter && xev->detail != XINotifyInferior && xev->mode != XINotifyPassiveUngrab && - gdk_window_get_window_type (window) == GDK_WINDOW_TOPLEVEL) + gdk_surface_get_window_type (window) == GDK_SURFACE_TOPLEVEL) { if (gdk_device_get_device_type (source_device) != GDK_DEVICE_TYPE_MASTER) _gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (source_device)); @@ -1926,13 +1926,13 @@ gdk_x11_device_manager_xi2_select_window_events (GdkEventTranslator *translator, g_free (event_mask.mask); } -static GdkWindow * +static GdkSurface * gdk_x11_device_manager_xi2_get_window (GdkEventTranslator *translator, const XEvent *xevent) { GdkX11DeviceManagerXI2 *device_manager; XIEvent *ev; - GdkWindow *window = NULL; + GdkSurface *window = NULL; device_manager = (GdkX11DeviceManagerXI2 *) translator; diff --git a/gdk/x11/gdkdevicemanagerprivate-core.h b/gdk/x11/gdkdevicemanagerprivate-core.h index 55aa45c748..47ea27dfd1 100644 --- a/gdk/x11/gdkdevicemanagerprivate-core.h +++ b/gdk/x11/gdkdevicemanagerprivate-core.h @@ -37,7 +37,7 @@ struct _GdkX11DeviceManagerCoreClass GObjectClass parent_class; }; -void _gdk_device_manager_core_handle_focus (GdkWindow *window, +void _gdk_device_manager_core_handle_focus (GdkSurface *window, Window original, GdkDevice *device, GdkDevice *source_device, diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 28a5344c24..0a2bfbff53 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -199,19 +199,19 @@ gdk_x11_display_event_translator_init (GdkEventTranslatorIface *iface) iface->translate_event = gdk_x11_display_translate_event; } -#define ANY_EDGE_TILED (GDK_WINDOW_STATE_LEFT_TILED | \ - GDK_WINDOW_STATE_RIGHT_TILED | \ - GDK_WINDOW_STATE_TOP_TILED | \ - GDK_WINDOW_STATE_BOTTOM_TILED) +#define ANY_EDGE_TILED (GDK_SURFACE_STATE_LEFT_TILED | \ + GDK_SURFACE_STATE_RIGHT_TILED | \ + GDK_SURFACE_STATE_TOP_TILED | \ + GDK_SURFACE_STATE_BOTTOM_TILED) static void -do_edge_constraint_state_check (GdkWindow *window, - GdkWindowState old_state, - GdkWindowState *set, - GdkWindowState *unset) +do_edge_constraint_state_check (GdkSurface *window, + GdkSurfaceState old_state, + GdkSurfaceState *set, + GdkSurfaceState *unset) { - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); - GdkWindowState local_set, local_unset; + GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window); + GdkSurfaceState local_set, local_unset; guint edge_constraints; local_set = *set; @@ -220,130 +220,130 @@ do_edge_constraint_state_check (GdkWindow *window, /* If the WM doesn't support _GTK_EDGE_CONSTRAINTS, rely on the fallback * implementation. If it supports _GTK_EDGE_CONSTRAINTS, arrange for - * GDK_WINDOW_STATE_TILED to be set if any edge is tiled, and cleared + * GDK_SURFACE_STATE_TILED to be set if any edge is tiled, and cleared * if no edge is tiled. */ - if (!gdk_window_supports_edge_constraints (window)) + if (!gdk_surface_supports_edge_constraints (window)) { /* FIXME: we rely on implementation details of mutter here: * mutter only tiles horizontally, and sets maxvert when it does * and if it tiles, it always affects all edges */ - if (old_state & GDK_WINDOW_STATE_TILED) + if (old_state & GDK_SURFACE_STATE_TILED) { if (!toplevel->have_maxvert) - local_unset |= GDK_WINDOW_STATE_TILED; + local_unset |= GDK_SURFACE_STATE_TILED; } else { if (toplevel->have_maxvert && !toplevel->have_maxhorz) - local_set |= GDK_WINDOW_STATE_TILED; + local_set |= GDK_SURFACE_STATE_TILED; } } else { - if (old_state & GDK_WINDOW_STATE_TILED) + if (old_state & GDK_SURFACE_STATE_TILED) { if (!(edge_constraints & ANY_EDGE_TILED)) - local_unset |= GDK_WINDOW_STATE_TILED; + local_unset |= GDK_SURFACE_STATE_TILED; } else { if (edge_constraints & ANY_EDGE_TILED) - local_set |= GDK_WINDOW_STATE_TILED; + local_set |= GDK_SURFACE_STATE_TILED; } } /* Top edge */ - if (old_state & GDK_WINDOW_STATE_TOP_TILED) + if (old_state & GDK_SURFACE_STATE_TOP_TILED) { - if ((edge_constraints & GDK_WINDOW_STATE_TOP_TILED) == 0) - local_unset |= GDK_WINDOW_STATE_TOP_TILED; + if ((edge_constraints & GDK_SURFACE_STATE_TOP_TILED) == 0) + local_unset |= GDK_SURFACE_STATE_TOP_TILED; } else { - if (edge_constraints & GDK_WINDOW_STATE_TOP_TILED) - local_set |= GDK_WINDOW_STATE_TOP_TILED; + if (edge_constraints & GDK_SURFACE_STATE_TOP_TILED) + local_set |= GDK_SURFACE_STATE_TOP_TILED; } - if (old_state & GDK_WINDOW_STATE_TOP_RESIZABLE) + if (old_state & GDK_SURFACE_STATE_TOP_RESIZABLE) { - if ((edge_constraints & GDK_WINDOW_STATE_TOP_RESIZABLE) == 0) - local_unset |= GDK_WINDOW_STATE_TOP_RESIZABLE; + if ((edge_constraints & GDK_SURFACE_STATE_TOP_RESIZABLE) == 0) + local_unset |= GDK_SURFACE_STATE_TOP_RESIZABLE; } else { - if (edge_constraints & GDK_WINDOW_STATE_TOP_RESIZABLE) - local_set |= GDK_WINDOW_STATE_TOP_RESIZABLE; + if (edge_constraints & GDK_SURFACE_STATE_TOP_RESIZABLE) + local_set |= GDK_SURFACE_STATE_TOP_RESIZABLE; } /* Right edge */ - if (old_state & GDK_WINDOW_STATE_RIGHT_TILED) + if (old_state & GDK_SURFACE_STATE_RIGHT_TILED) { - if ((edge_constraints & GDK_WINDOW_STATE_RIGHT_TILED) == 0) - local_unset |= GDK_WINDOW_STATE_RIGHT_TILED; + if ((edge_constraints & GDK_SURFACE_STATE_RIGHT_TILED) == 0) + local_unset |= GDK_SURFACE_STATE_RIGHT_TILED; } else { - if (edge_constraints & GDK_WINDOW_STATE_RIGHT_TILED) - local_set |= GDK_WINDOW_STATE_RIGHT_TILED; + if (edge_constraints & GDK_SURFACE_STATE_RIGHT_TILED) + local_set |= GDK_SURFACE_STATE_RIGHT_TILED; } - if (old_state & GDK_WINDOW_STATE_RIGHT_RESIZABLE) + if (old_state & GDK_SURFACE_STATE_RIGHT_RESIZABLE) { - if ((edge_constraints & GDK_WINDOW_STATE_RIGHT_RESIZABLE) == 0) - local_unset |= GDK_WINDOW_STATE_RIGHT_RESIZABLE; + if ((edge_constraints & GDK_SURFACE_STATE_RIGHT_RESIZABLE) == 0) + local_unset |= GDK_SURFACE_STATE_RIGHT_RESIZABLE; } else { - if (edge_constraints & GDK_WINDOW_STATE_RIGHT_RESIZABLE) - local_set |= GDK_WINDOW_STATE_RIGHT_RESIZABLE; + if (edge_constraints & GDK_SURFACE_STATE_RIGHT_RESIZABLE) + local_set |= GDK_SURFACE_STATE_RIGHT_RESIZABLE; } /* Bottom edge */ - if (old_state & GDK_WINDOW_STATE_BOTTOM_TILED) + if (old_state & GDK_SURFACE_STATE_BOTTOM_TILED) { - if ((edge_constraints & GDK_WINDOW_STATE_BOTTOM_TILED) == 0) - local_unset |= GDK_WINDOW_STATE_BOTTOM_TILED; + if ((edge_constraints & GDK_SURFACE_STATE_BOTTOM_TILED) == 0) + local_unset |= GDK_SURFACE_STATE_BOTTOM_TILED; } else { - if (edge_constraints & GDK_WINDOW_STATE_BOTTOM_TILED) - local_set |= GDK_WINDOW_STATE_BOTTOM_TILED; + if (edge_constraints & GDK_SURFACE_STATE_BOTTOM_TILED) + local_set |= GDK_SURFACE_STATE_BOTTOM_TILED; } - if (old_state & GDK_WINDOW_STATE_BOTTOM_RESIZABLE) + if (old_state & GDK_SURFACE_STATE_BOTTOM_RESIZABLE) { - if ((edge_constraints & GDK_WINDOW_STATE_BOTTOM_RESIZABLE) == 0) - local_unset |= GDK_WINDOW_STATE_BOTTOM_RESIZABLE; + if ((edge_constraints & GDK_SURFACE_STATE_BOTTOM_RESIZABLE) == 0) + local_unset |= GDK_SURFACE_STATE_BOTTOM_RESIZABLE; } else { - if (edge_constraints & GDK_WINDOW_STATE_BOTTOM_RESIZABLE) - local_set |= GDK_WINDOW_STATE_BOTTOM_RESIZABLE; + if (edge_constraints & GDK_SURFACE_STATE_BOTTOM_RESIZABLE) + local_set |= GDK_SURFACE_STATE_BOTTOM_RESIZABLE; } /* Left edge */ - if (old_state & GDK_WINDOW_STATE_LEFT_TILED) + if (old_state & GDK_SURFACE_STATE_LEFT_TILED) { - if ((edge_constraints & GDK_WINDOW_STATE_LEFT_TILED) == 0) - local_unset |= GDK_WINDOW_STATE_LEFT_TILED; + if ((edge_constraints & GDK_SURFACE_STATE_LEFT_TILED) == 0) + local_unset |= GDK_SURFACE_STATE_LEFT_TILED; } else { - if (edge_constraints & GDK_WINDOW_STATE_LEFT_TILED) - local_set |= GDK_WINDOW_STATE_LEFT_TILED; + if (edge_constraints & GDK_SURFACE_STATE_LEFT_TILED) + local_set |= GDK_SURFACE_STATE_LEFT_TILED; } - if (old_state & GDK_WINDOW_STATE_LEFT_RESIZABLE) + if (old_state & GDK_SURFACE_STATE_LEFT_RESIZABLE) { - if ((edge_constraints & GDK_WINDOW_STATE_LEFT_RESIZABLE) == 0) - local_unset |= GDK_WINDOW_STATE_LEFT_RESIZABLE; + if ((edge_constraints & GDK_SURFACE_STATE_LEFT_RESIZABLE) == 0) + local_unset |= GDK_SURFACE_STATE_LEFT_RESIZABLE; } else { - if (edge_constraints & GDK_WINDOW_STATE_LEFT_RESIZABLE) - local_set |= GDK_WINDOW_STATE_LEFT_RESIZABLE; + if (edge_constraints & GDK_SURFACE_STATE_LEFT_RESIZABLE) + local_set |= GDK_SURFACE_STATE_LEFT_RESIZABLE; } *set = local_set; @@ -351,78 +351,78 @@ do_edge_constraint_state_check (GdkWindow *window, } static void -do_net_wm_state_changes (GdkWindow *window) +do_net_wm_state_changes (GdkSurface *window) { - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); - GdkWindowState old_state, set, unset; + GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window); + GdkSurfaceState old_state, set, unset; - if (GDK_WINDOW_DESTROYED (window) || - gdk_window_get_window_type (window) != GDK_WINDOW_TOPLEVEL) + if (GDK_SURFACE_DESTROYED (window) || + gdk_surface_get_window_type (window) != GDK_SURFACE_TOPLEVEL) return; - old_state = gdk_window_get_state (window); + old_state = gdk_surface_get_state (window); set = unset = 0; /* For found_sticky to remain TRUE, we have to also be on desktop * 0xFFFFFFFF */ - if (old_state & GDK_WINDOW_STATE_STICKY) + if (old_state & GDK_SURFACE_STATE_STICKY) { if (!(toplevel->have_sticky && toplevel->on_all_desktops)) - unset |= GDK_WINDOW_STATE_STICKY; + unset |= GDK_SURFACE_STATE_STICKY; } else { if (toplevel->have_sticky && toplevel->on_all_desktops) - set |= GDK_WINDOW_STATE_STICKY; + set |= GDK_SURFACE_STATE_STICKY; } - if (old_state & GDK_WINDOW_STATE_FULLSCREEN) + if (old_state & GDK_SURFACE_STATE_FULLSCREEN) { if (!toplevel->have_fullscreen) - unset |= GDK_WINDOW_STATE_FULLSCREEN; + unset |= GDK_SURFACE_STATE_FULLSCREEN; } else { if (toplevel->have_fullscreen) - set |= GDK_WINDOW_STATE_FULLSCREEN; + set |= GDK_SURFACE_STATE_FULLSCREEN; } /* Our "maximized" means both vertical and horizontal; if only one, * we don't expose that via GDK */ - if (old_state & GDK_WINDOW_STATE_MAXIMIZED) + if (old_state & GDK_SURFACE_STATE_MAXIMIZED) { if (!(toplevel->have_maxvert && toplevel->have_maxhorz)) - unset |= GDK_WINDOW_STATE_MAXIMIZED; + unset |= GDK_SURFACE_STATE_MAXIMIZED; } else { if (toplevel->have_maxvert && toplevel->have_maxhorz) - set |= GDK_WINDOW_STATE_MAXIMIZED; + set |= GDK_SURFACE_STATE_MAXIMIZED; } - if (old_state & GDK_WINDOW_STATE_FOCUSED) + if (old_state & GDK_SURFACE_STATE_FOCUSED) { if (!toplevel->have_focused) - unset |= GDK_WINDOW_STATE_FOCUSED; + unset |= GDK_SURFACE_STATE_FOCUSED; } else { if (toplevel->have_focused) - set |= GDK_WINDOW_STATE_FOCUSED; + set |= GDK_SURFACE_STATE_FOCUSED; } - if (old_state & GDK_WINDOW_STATE_ICONIFIED) + if (old_state & GDK_SURFACE_STATE_ICONIFIED) { if (!toplevel->have_hidden) - unset |= GDK_WINDOW_STATE_ICONIFIED; + unset |= GDK_SURFACE_STATE_ICONIFIED; } else { if (toplevel->have_hidden) - set |= GDK_WINDOW_STATE_ICONIFIED; + set |= GDK_SURFACE_STATE_ICONIFIED; } /* Update edge constraints and tiling */ @@ -432,10 +432,10 @@ do_net_wm_state_changes (GdkWindow *window) } static void -gdk_check_wm_desktop_changed (GdkWindow *window) +gdk_check_wm_desktop_changed (GdkSurface *window) { - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); - GdkDisplay *display = GDK_WINDOW_DISPLAY (window); + GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window); + GdkDisplay *display = GDK_SURFACE_DISPLAY (window); Atom type; gint format; @@ -447,7 +447,7 @@ gdk_check_wm_desktop_changed (GdkWindow *window) type = None; gdk_x11_display_error_trap_push (display); XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"), 0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems, @@ -467,11 +467,11 @@ gdk_check_wm_desktop_changed (GdkWindow *window) } static void -gdk_check_wm_state_changed (GdkWindow *window) +gdk_check_wm_state_changed (GdkSurface *window) { - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); - GdkDisplay *display = GDK_WINDOW_DISPLAY (window); - GdkX11Screen *screen = GDK_WINDOW_SCREEN (window); + GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window); + GdkDisplay *display = GDK_SURFACE_DISPLAY (window); + GdkX11Screen *screen = GDK_SURFACE_SCREEN (window); Atom type; gint format; @@ -492,7 +492,7 @@ gdk_check_wm_state_changed (GdkWindow *window) type = None; gdk_x11_display_error_trap_push (display); - XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), + XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"), 0, G_MAXLONG, False, XA_ATOM, &type, &format, &nitems, &bytes_after, &data); @@ -545,10 +545,10 @@ gdk_check_wm_state_changed (GdkWindow *window) } static void -gdk_check_edge_constraints_changed (GdkWindow *window) +gdk_check_edge_constraints_changed (GdkSurface *window) { - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); - GdkDisplay *display = GDK_WINDOW_DISPLAY (window); + GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window); + GdkDisplay *display = GDK_SURFACE_DISPLAY (window); Atom type; gint format; @@ -560,7 +560,7 @@ gdk_check_edge_constraints_changed (GdkWindow *window) type = None; gdk_x11_display_error_trap_push (display); XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_GTK_EDGE_CONSTRAINTS"), 0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems, @@ -635,15 +635,15 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, const XEvent *xevent) { Window xwindow; - GdkWindow *window; + GdkSurface *window; gboolean is_substructure; - GdkWindowImplX11 *window_impl = NULL; + GdkSurfaceImplX11 *window_impl = NULL; GdkX11Screen *x11_screen = NULL; GdkToplevelX11 *toplevel = NULL; GdkX11Display *display_x11 = GDK_X11_DISPLAY (display); gboolean return_val; - /* Find the GdkWindow that this event relates to. If that's + /* Find the GdkSurface that this event relates to. If that's * not the same as the window that the event was sent to, * we are getting an event from SubstructureNotifyMask. * We ignore such events for internal operation, but we @@ -656,18 +656,18 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, xwindow = get_event_xwindow (xevent); is_substructure = xwindow != xevent->xany.window; - window = gdk_x11_window_lookup_for_display (display, xwindow); + window = gdk_x11_surface_lookup_for_display (display, xwindow); if (window) { /* We may receive events such as NoExpose/GraphicsExpose * and ShmCompletion for pixmaps */ - if (!GDK_IS_WINDOW (window)) + if (!GDK_IS_SURFACE (window)) return FALSE; - x11_screen = GDK_WINDOW_SCREEN (window); - toplevel = _gdk_x11_window_get_toplevel (window); - window_impl = GDK_WINDOW_IMPL_X11 (window->impl); + x11_screen = GDK_SURFACE_SCREEN (window); + toplevel = _gdk_x11_surface_get_toplevel (window); + window_impl = GDK_SURFACE_IMPL_X11 (window->impl); g_object_ref (window); } @@ -675,7 +675,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, event->any.window = window; event->any.send_event = xevent->xany.send_event ? TRUE : FALSE; - if (window && GDK_WINDOW_DESTROYED (window)) + if (window && GDK_SURFACE_DESTROYED (window)) { if (xevent->type != DestroyNotify) { @@ -748,7 +748,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, y2 = (xevent->xexpose.y + xevent->xexpose.height + window_impl->window_scale -1) / window_impl->window_scale; expose_rect.height = y2 - expose_rect.y; - _gdk_x11_window_process_expose (window, xevent->xexpose.serial, &expose_rect); + _gdk_x11_surface_process_expose (window, xevent->xexpose.serial, &expose_rect); return_val = FALSE; } @@ -778,7 +778,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, y2 = (xevent->xgraphicsexpose.y + xevent->xgraphicsexpose.height + window_impl->window_scale -1) / window_impl->window_scale; expose_rect.height = y2 - expose_rect.y; - _gdk_x11_window_process_expose (window, xevent->xgraphicsexpose.serial, &expose_rect); + _gdk_x11_surface_process_expose (window, xevent->xgraphicsexpose.serial, &expose_rect); return_val = FALSE; } break; @@ -832,10 +832,10 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, event->any.type = GDK_DESTROY; event->any.window = window; - return_val = window && !GDK_WINDOW_DESTROYED (window); + return_val = window && !GDK_SURFACE_DESTROYED (window); - if (window && GDK_WINDOW_XID (window) != x11_screen->xroot_window) - gdk_window_destroy_notify (window); + if (window && GDK_SURFACE_XID (window) != x11_screen->xroot_window) + gdk_surface_destroy_notify (window); } else return_val = FALSE; @@ -865,23 +865,23 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, * means we hid the window ourselves, so we will have already flipped * the iconified bit off. */ - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) gdk_synthesize_window_state (window, 0, - GDK_WINDOW_STATE_ICONIFIED); + GDK_SURFACE_STATE_ICONIFIED); } if (window_impl->toplevel && window_impl->toplevel->frame_pending) { window_impl->toplevel->frame_pending = FALSE; - _gdk_frame_clock_thaw (gdk_window_get_frame_clock (event->any.window)); + _gdk_frame_clock_thaw (gdk_surface_get_frame_clock (event->any.window)); } if (toplevel) - gdk_window_freeze_toplevel_updates (window); + gdk_surface_freeze_toplevel_updates (window); - _gdk_x11_window_grab_check_unmap (window, xevent->xany.serial); + _gdk_x11_surface_grab_check_unmap (window, xevent->xany.serial); } break; @@ -897,13 +897,13 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, if (window && !is_substructure) { /* Unset iconified if it was set */ - if (window->state & GDK_WINDOW_STATE_ICONIFIED) + if (window->state & GDK_SURFACE_STATE_ICONIFIED) gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_ICONIFIED, + GDK_SURFACE_STATE_ICONIFIED, 0); if (toplevel) - gdk_window_thaw_toplevel_updates (window); + gdk_surface_thaw_toplevel_updates (window); } break; @@ -934,7 +934,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, xevent->xconfigure.override_redirect, !window ? " (discarding)" - : window->window_type == GDK_WINDOW_CHILD + : window->window_type == GDK_SURFACE_CHILD ? " (discarding child)" : xevent->xconfigure.event != xevent->xconfigure.window ? " (discarding substructure)" @@ -955,7 +955,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, if (!window || xevent->xconfigure.event != xevent->xconfigure.window || - GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD) + GDK_SURFACE_TYPE (window) == GDK_SURFACE_CHILD) return_val = FALSE; else { @@ -966,15 +966,15 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, if (!xevent->xconfigure.send_event && !xevent->xconfigure.override_redirect && - !GDK_WINDOW_DESTROYED (window)) + !GDK_SURFACE_DESTROYED (window)) { gint tx = 0; gint ty = 0; Window child_window = 0; gdk_x11_display_error_trap_push (display); - if (XTranslateCoordinates (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + if (XTranslateCoordinates (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), x11_screen->xroot_window, 0, 0, &tx, &ty, @@ -1003,8 +1003,8 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, window->width = event->configure.width; window->height = event->configure.height; - _gdk_window_update_size (window); - _gdk_x11_window_update_size (window_impl); + _gdk_surface_update_size (window); + _gdk_x11_surface_update_size (window_impl); } if (window->resize_count >= 1) @@ -1172,7 +1172,7 @@ server_time_to_monotonic_time (GdkX11Display *display_x11, (!display_x11->server_time_is_monotonic_time && server_time > display_x11->server_time_query_time + 10*1000*1000)) /* 10 seconds */ { - gint64 current_server_time = gdk_x11_get_server_time (display_x11->leader_gdk_window); + gint64 current_server_time = gdk_x11_get_server_time (display_x11->leader_gdk_surface); gint64 current_server_time_usec = (gint64)current_server_time * 1000; gint64 current_monotonic_time = g_get_monotonic_time (); display_x11->server_time_query_time = current_monotonic_time; @@ -1201,24 +1201,24 @@ _gdk_wm_protocols_filter (const XEvent *xevent, GdkEvent *event, gpointer data) { - GdkWindow *win = event->any.window; + GdkSurface *win = event->any.window; GdkDisplay *display; Atom atom; - if (!GDK_IS_X11_WINDOW (win) || GDK_WINDOW_DESTROYED (win)) + if (!GDK_IS_X11_SURFACE (win) || GDK_SURFACE_DESTROYED (win)) return GDK_FILTER_CONTINUE; if (xevent->type != ClientMessage) return GDK_FILTER_CONTINUE; - display = GDK_WINDOW_DISPLAY (win); + display = GDK_SURFACE_DISPLAY (win); /* This isn't actually WM_PROTOCOLS because that wouldn't leave enough space * in the message for everything that gets stuffed in */ if (xevent->xclient.message_type == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_FRAME_DRAWN")) { - GdkWindowImplX11 *window_impl; - window_impl = GDK_WINDOW_IMPL_X11 (win->impl); + GdkSurfaceImplX11 *window_impl; + window_impl = GDK_SURFACE_IMPL_X11 (win->impl); if (window_impl->toplevel) { guint32 d0 = xevent->xclient.data.l[0]; @@ -1230,7 +1230,7 @@ _gdk_wm_protocols_filter (const XEvent *xevent, gint64 frame_drawn_time = server_time_to_monotonic_time (GDK_X11_DISPLAY (display), ((guint64)d3 << 32) | d2); gint64 refresh_interval, presentation_time; - GdkFrameClock *clock = gdk_window_get_frame_clock (win); + GdkFrameClock *clock = gdk_surface_get_frame_clock (win); GdkFrameTimings *timings = find_frame_timings (clock, serial); if (timings) @@ -1255,8 +1255,8 @@ _gdk_wm_protocols_filter (const XEvent *xevent, if (xevent->xclient.message_type == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_FRAME_TIMINGS")) { - GdkWindowImplX11 *window_impl; - window_impl = GDK_WINDOW_IMPL_X11 (win->impl); + GdkSurfaceImplX11 *window_impl; + window_impl = GDK_SURFACE_IMPL_X11 (win->impl); if (window_impl->toplevel) { guint32 d0 = xevent->xclient.data.l[0]; @@ -1266,7 +1266,7 @@ _gdk_wm_protocols_filter (const XEvent *xevent, guint64 serial = ((guint64)d1 << 32) | d0; - GdkFrameClock *clock = gdk_window_get_frame_clock (win); + GdkFrameClock *clock = gdk_surface_get_frame_clock (win); GdkFrameTimings *timings = find_frame_timings (clock, serial); if (timings) @@ -1310,13 +1310,13 @@ _gdk_wm_protocols_filter (const XEvent *xevent, event->any.type = GDK_DELETE; - gdk_x11_window_set_user_time (win, xevent->xclient.data.l[1]); + gdk_x11_surface_set_user_time (win, xevent->xclient.data.l[1]); return GDK_FILTER_TRANSLATE; } else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "WM_TAKE_FOCUS")) { - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (win); + GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (win); /* There is no way of knowing reliably whether we are viewable; * so trap errors asynchronously around the XSetInputFocus call @@ -1338,8 +1338,8 @@ _gdk_wm_protocols_filter (const XEvent *xevent, { XClientMessageEvent xclient = xevent->xclient; - xclient.window = GDK_WINDOW_XROOTWIN (win); - XSendEvent (GDK_WINDOW_XDISPLAY (win), + xclient.window = GDK_SURFACE_XROOTWIN (win); + XSendEvent (GDK_SURFACE_XDISPLAY (win), xclient.window, False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xclient); @@ -1349,7 +1349,7 @@ _gdk_wm_protocols_filter (const XEvent *xevent, else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_SYNC_REQUEST") && GDK_X11_DISPLAY (display)->use_sync) { - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (win); + GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (win); if (toplevel) { #ifdef HAVE_XSYNC @@ -1493,10 +1493,10 @@ gdk_x11_display_open (const gchar *display_name) gdk_event_init (display); - display_x11->leader_gdk_window = gdk_window_new_temp (display); - (_gdk_x11_window_get_toplevel (display_x11->leader_gdk_window))->is_leader = TRUE; + display_x11->leader_gdk_surface = gdk_surface_new_temp (display); + (_gdk_x11_surface_get_toplevel (display_x11->leader_gdk_surface))->is_leader = TRUE; - display_x11->leader_window = GDK_WINDOW_XID (display_x11->leader_gdk_window); + display_x11->leader_window = GDK_SURFACE_XID (display_x11->leader_gdk_surface); display_x11->leader_window_title_set = FALSE; @@ -1811,7 +1811,7 @@ device_grab_update_callback (GdkDisplay *display, gpointer data, gulong serial) { - GdkPointerWindowInfo *pointer_info; + GdkPointerSurfaceInfo *pointer_info; GdkDevice *device = data; pointer_info = _gdk_display_get_pointer_info (display, device); @@ -1884,12 +1884,12 @@ gdk_x11_display_has_pending (GdkDisplay *display) return XPending (GDK_DISPLAY_XDISPLAY (display)); } -static GdkWindow * +static GdkSurface * gdk_x11_display_get_default_group (GdkDisplay *display) { g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); - return GDK_X11_DISPLAY (display)->leader_gdk_window; + return GDK_X11_DISPLAY (display)->leader_gdk_surface; } /** @@ -1982,7 +1982,7 @@ gdk_x11_display_finalize (GObject *object) /* List of event window extraction functions */ g_slist_free_full (display_x11->event_types, g_free); - /* input GdkWindow list */ + /* input GdkSurface list */ g_list_free_full (display_x11->input_windows, g_free); /* Free all GdkX11Screens */ @@ -2378,7 +2378,7 @@ gdk_x11_display_request_selection_notification (GdkDisplay *display, * Returns the timestamp of the last user interaction on * @display. The timestamp is taken from events caused * by user interaction such as key presses or pointer - * movements. See gdk_x11_window_set_user_time(). + * movements. See gdk_x11_surface_set_user_time(). * * Returns: the timestamp of the last user interaction */ @@ -3006,7 +3006,7 @@ gdk_x11_display_get_toplevel_windows (GdkDisplay *display) static guint32 gdk_x11_display_get_last_seen_time (GdkDisplay *display) { - return gdk_x11_get_server_time (GDK_X11_DISPLAY (display)->leader_gdk_window); + return gdk_x11_get_server_time (GDK_X11_DISPLAY (display)->leader_gdk_surface); } static gboolean @@ -3034,7 +3034,7 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class) object_class->dispose = gdk_x11_display_dispose; object_class->finalize = gdk_x11_display_finalize; - display_class->window_type = GDK_TYPE_X11_WINDOW; + display_class->window_type = GDK_TYPE_X11_SURFACE; #ifdef GDK_RENDERING_VULKAN display_class->vk_context_type = GDK_TYPE_X11_VULKAN_CONTEXT; display_class->vk_extension_name = VK_KHR_XLIB_SURFACE_EXTENSION_NAME; @@ -3105,5 +3105,5 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class) _gdk_marshal_BOOLEAN__POINTER, G_TYPE_BOOLEAN, 1, G_TYPE_POINTER); - _gdk_x11_windowing_init (); + _gdk_x11_surfaceing_init (); } diff --git a/gdk/x11/gdkdisplay-x11.h b/gdk/x11/gdkdisplay-x11.h index ff000857e9..ed08da2ff1 100644 --- a/gdk/x11/gdkdisplay-x11.h +++ b/gdk/x11/gdkdisplay-x11.h @@ -96,7 +96,7 @@ struct _GdkX11Display /* Session Management leader window see ICCCM */ char *program_class; Window leader_window; - GdkWindow *leader_gdk_window; + GdkSurface *leader_gdk_surface; gboolean leader_window_title_set; /* List of functions to go from extension event => X window */ @@ -111,7 +111,7 @@ struct _GdkX11Display /* streams reading selections */ GSList *streams; - /* input GdkWindow list */ + /* input GdkSurface list */ GList *input_windows; /* GdkCursor => XCursor */ diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c index 10b25dad51..eff6658986 100644 --- a/gdk/x11/gdkdnd-x11.c +++ b/gdk/x11/gdkdnd-x11.c @@ -84,7 +84,7 @@ typedef struct { cairo_region_t *shape; } GdkCacheChild; -struct _GdkWindowCache { +struct _GdkSurfaceCache { GList *children; GHashTable *child_hash; guint old_event_mask; @@ -109,11 +109,11 @@ struct _GdkX11DragContext GdkDragAction xdnd_actions; /* What is currently set in XdndActionList */ guint version; /* Xdnd protocol version */ - GdkWindowCache *cache; + GdkSurfaceCache *cache; - GdkWindow *drag_window; + GdkSurface *drag_window; - GdkWindow *ipc_window; + GdkSurface *ipc_window; GdkCursor *cursor; GdkSeat *grab_seat; GdkDragAction actions; @@ -167,8 +167,8 @@ static GrabKey grab_keys[] = { /* Forward declarations */ -static GdkWindowCache *gdk_window_cache_ref (GdkWindowCache *cache); -static void gdk_window_cache_unref (GdkWindowCache *cache); +static GdkSurfaceCache *gdk_surface_cache_ref (GdkSurfaceCache *cache); +static void gdk_surface_cache_unref (GdkSurfaceCache *cache); static GdkFilterReturn xdnd_enter_filter (const XEvent *xevent, GdkEvent *event, @@ -190,7 +190,7 @@ static GdkFilterReturn xdnd_drop_filter (const XEvent *xevent, gpointer data); static void xdnd_manage_source_filter (GdkDragContext *context, - GdkWindow *window, + GdkSurface *window, gboolean add_filter); gboolean gdk_x11_drag_context_handle_event (GdkDragContext *context, @@ -223,13 +223,13 @@ gdk_x11_drag_context_init (GdkX11DragContext *context) } static void gdk_x11_drag_context_finalize (GObject *object); -static GdkWindow * gdk_x11_drag_context_find_window (GdkDragContext *context, - GdkWindow *drag_window, +static GdkSurface * gdk_x11_drag_context_find_window (GdkDragContext *context, + GdkSurface *drag_window, gint x_root, gint y_root, GdkDragProtocol *protocol); static gboolean gdk_x11_drag_context_drag_motion (GdkDragContext *context, - GdkWindow *dest_window, + GdkSurface *dest_window, GdkDragProtocol protocol, gint x_root, gint y_root, @@ -250,7 +250,7 @@ static void gdk_x11_drag_context_drop_finish (GdkDragContext *context, gboolean success, guint32 time_); static gboolean gdk_x11_drag_context_drop_status (GdkDragContext *context); -static GdkWindow * gdk_x11_drag_context_get_drag_window (GdkDragContext *context); +static GdkSurface * gdk_x11_drag_context_get_drag_window (GdkDragContext *context); static void gdk_x11_drag_context_set_hotspot (GdkDragContext *context, gint hot_x, gint hot_y); @@ -423,7 +423,7 @@ gdk_x11_drag_context_finalize (GObject *object) { GdkDragContext *context = GDK_DRAG_CONTEXT (object); GdkX11DragContext *x11_context = GDK_X11_DRAG_CONTEXT (object); - GdkWindow *drag_window, *ipc_window; + GdkSurface *drag_window, *ipc_window; if (context->source_window) { @@ -432,7 +432,7 @@ gdk_x11_drag_context_finalize (GObject *object) } if (x11_context->cache) - gdk_window_cache_unref (x11_context->cache); + gdk_surface_cache_unref (x11_context->cache); contexts = g_list_remove (contexts, context); @@ -442,9 +442,9 @@ gdk_x11_drag_context_finalize (GObject *object) G_OBJECT_CLASS (gdk_x11_drag_context_parent_class)->finalize (object); if (drag_window) - gdk_window_destroy (drag_window); + gdk_surface_destroy (drag_window); if (ipc_window) - gdk_window_destroy (ipc_window); + gdk_surface_destroy (ipc_window); } /* Drag Contexts */ @@ -465,19 +465,19 @@ gdk_drag_context_find (GdkDisplay *display, context = (GdkDragContext *)tmp_list->data; context_x11 = (GdkX11DragContext *)context; - if ((context->source_window && gdk_window_get_display (context->source_window) != display) || - (context->dest_window && gdk_window_get_display (context->dest_window) != display)) + if ((context->source_window && gdk_surface_get_display (context->source_window) != display) || + (context->dest_window && gdk_surface_get_display (context->dest_window) != display)) continue; context_dest_xid = context->dest_window ? (context_x11->drop_xid ? context_x11->drop_xid - : GDK_WINDOW_XID (context->dest_window)) + : GDK_SURFACE_XID (context->dest_window)) : None; if ((!context->is_source == !is_source) && ((source_xid == None) || (context->source_window && - (GDK_WINDOW_XID (context->source_window) == source_xid))) && + (GDK_SURFACE_XID (context->source_window) == source_xid))) && ((dest_xid == None) || (context_dest_xid == dest_xid))) return context; } @@ -521,7 +521,7 @@ free_cache_child (GdkCacheChild *child, } static void -gdk_window_cache_add (GdkWindowCache *cache, +gdk_surface_cache_add (GdkSurfaceCache *cache, guint32 xid, gint x, gint y, @@ -547,11 +547,11 @@ gdk_window_cache_add (GdkWindowCache *cache, } GdkFilterReturn -gdk_window_cache_shape_filter (const XEvent *xevent, +gdk_surface_cache_shape_filter (const XEvent *xevent, GdkEvent *event, gpointer data) { - GdkWindowCache *cache = data; + GdkSurfaceCache *cache = data; GdkX11Display *display = GDK_X11_DISPLAY (cache->display); @@ -581,11 +581,11 @@ gdk_window_cache_shape_filter (const XEvent *xevent, } GdkFilterReturn -gdk_window_cache_filter (const XEvent *xevent, +gdk_surface_cache_filter (const XEvent *xevent, GdkEvent *event, gpointer data) { - GdkWindowCache *cache = data; + GdkSurfaceCache *cache = data; switch (xevent->type) { @@ -639,7 +639,7 @@ gdk_window_cache_filter (const XEvent *xevent, if (!g_hash_table_lookup (cache->child_hash, GUINT_TO_POINTER (xcwe->window))) - gdk_window_cache_add (cache, xcwe->window, + gdk_surface_cache_add (cache, xcwe->window, xcwe->x, xcwe->y, xcwe->width, xcwe->height, FALSE); break; @@ -700,8 +700,8 @@ gdk_window_cache_filter (const XEvent *xevent, return GDK_FILTER_REMOVE; } -static GdkWindowCache * -gdk_window_cache_new (GdkDisplay *display) +static GdkSurfaceCache * +gdk_surface_cache_new (GdkDisplay *display) { XWindowAttributes xwa; GdkX11Screen *screen = GDK_X11_DISPLAY (display)->screen; @@ -713,7 +713,7 @@ gdk_window_cache_new (GdkDisplay *display) Window cow; #endif - GdkWindowCache *result = g_new (GdkWindowCache, 1); + GdkSurfaceCache *result = g_new (GdkSurfaceCache, 1); result->children = NULL; result->child_hash = g_hash_table_new (g_direct_hash, NULL); @@ -726,21 +726,21 @@ gdk_window_cache_new (GdkDisplay *display) if (G_UNLIKELY (!GDK_X11_DISPLAY (display)->trusted_client)) { GList *toplevel_windows, *list; - GdkWindow *window; - GdkWindowImplX11 *impl; + GdkSurface *window; + GdkSurfaceImplX11 *impl; gint x, y, width, height; toplevel_windows = gdk_x11_display_get_toplevel_windows (display); for (list = toplevel_windows; list; list = list->next) { - window = GDK_WINDOW (list->data); - impl = GDK_WINDOW_IMPL_X11 (window->impl); - gdk_window_get_geometry (window, &x, &y, &width, &height); - gdk_window_cache_add (result, GDK_WINDOW_XID (window), + window = GDK_SURFACE (list->data); + impl = GDK_SURFACE_IMPL_X11 (window->impl); + gdk_surface_get_geometry (window, &x, &y, &width, &height); + gdk_surface_cache_add (result, GDK_SURFACE_XID (window), x * impl->window_scale, y * impl->window_scale, width * impl->window_scale, height * impl->window_scale, - gdk_window_is_visible (window)); + gdk_surface_is_visible (window)); } return result; } @@ -755,7 +755,7 @@ gdk_window_cache_new (GdkDisplay *display) for (i = 0; i < nchildren ; i++) { - gdk_window_cache_add (result, children[i].window, + gdk_surface_cache_add (result, children[i].window, children[i].x, children[i].y, children[i].width, children[i].height, children[i].is_mapped); } @@ -773,7 +773,7 @@ gdk_window_cache_new (GdkDisplay *display) if (gdk_display_is_composited (display)) { cow = XCompositeGetOverlayWindow (xdisplay, xroot_window); - gdk_window_cache_add (result, cow, 0, 0, + gdk_surface_cache_add (result, cow, 0, 0, WidthOfScreen (GDK_X11_SCREEN (screen)->xscreen) * GDK_X11_SCREEN (screen)->window_scale, HeightOfScreen (GDK_X11_SCREEN (screen)->xscreen) * GDK_X11_SCREEN (screen)->window_scale, TRUE); @@ -785,7 +785,7 @@ gdk_window_cache_new (GdkDisplay *display) } static void -gdk_window_cache_destroy (GdkWindowCache *cache) +gdk_surface_cache_destroy (GdkSurfaceCache *cache) { XSelectInput (GDK_DISPLAY_XDISPLAY (cache->display), GDK_DISPLAY_XROOTWIN (cache->display), @@ -801,8 +801,8 @@ gdk_window_cache_destroy (GdkWindowCache *cache) g_free (cache); } -static GdkWindowCache * -gdk_window_cache_ref (GdkWindowCache *cache) +static GdkSurfaceCache * +gdk_surface_cache_ref (GdkSurfaceCache *cache) { cache->ref_count += 1; @@ -810,7 +810,7 @@ gdk_window_cache_ref (GdkWindowCache *cache) } static void -gdk_window_cache_unref (GdkWindowCache *cache) +gdk_surface_cache_unref (GdkSurfaceCache *cache) { g_assert (cache->ref_count > 0); @@ -819,24 +819,24 @@ gdk_window_cache_unref (GdkWindowCache *cache) if (cache->ref_count == 0) { window_caches = g_slist_remove (window_caches, cache); - gdk_window_cache_destroy (cache); + gdk_surface_cache_destroy (cache); } } -GdkWindowCache * -gdk_window_cache_get (GdkDisplay *display) +GdkSurfaceCache * +gdk_surface_cache_get (GdkDisplay *display) { GSList *list; - GdkWindowCache *cache; + GdkSurfaceCache *cache; for (list = window_caches; list; list = list->next) { cache = list->data; if (cache->display == display) - return gdk_window_cache_ref (cache); + return gdk_surface_cache_ref (cache); } - cache = gdk_window_cache_new (display); + cache = gdk_surface_cache_new (display); window_caches = g_slist_prepend (window_caches, cache); @@ -944,7 +944,7 @@ get_client_window_at_coords_recurse (GdkDisplay *display, } static Window -get_client_window_at_coords (GdkWindowCache *cache, +get_client_window_at_coords (GdkSurfaceCache *cache, Window ignore, gint x_root, gint y_root) @@ -1070,10 +1070,10 @@ xdnd_status_filter (const XEvent *xevent, GdkDragContext *context; if (!event->any.window || - gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN) + gdk_surface_get_window_type (event->any.window) == GDK_SURFACE_FOREIGN) return GDK_FILTER_CONTINUE; /* Not for us */ - display = gdk_window_get_display (event->any.window); + display = gdk_surface_get_display (event->any.window); context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_window); GDK_DISPLAY_NOTE (display, DND, @@ -1116,10 +1116,10 @@ xdnd_finished_filter (const XEvent *xevent, GdkX11DragContext *context_x11; if (!event->any.window || - gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN) + gdk_surface_get_window_type (event->any.window) == GDK_SURFACE_FOREIGN) return GDK_FILTER_CONTINUE; /* Not for us */ - display = gdk_window_get_display (event->any.window); + display = gdk_surface_get_display (event->any.window); context = gdk_drag_context_find (display, TRUE, xevent->xclient.window, dest_window); GDK_DISPLAY_NOTE (display, DND, @@ -1157,7 +1157,7 @@ xdnd_set_targets (GdkX11DragContext *context_x11) atomlist[i] = gdk_x11_get_xatom_by_name_for_display (display, atoms[i]); XChangeProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (context_x11->ipc_window), + GDK_SURFACE_XID (context_x11->ipc_window), gdk_x11_get_xatom_by_name_for_display (display, "XdndTypeList"), XA_ATOM, 32, PropModeReplace, (guchar *)atomlist, n_atoms); @@ -1203,7 +1203,7 @@ xdnd_set_actions (GdkX11DragContext *context_x11) } XChangeProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (context_x11->ipc_window), + GDK_SURFACE_XID (context_x11->ipc_window), gdk_x11_get_xatom_by_name_for_display (display, "XdndActionList"), XA_ATOM, 32, PropModeReplace, (guchar *)atomlist, n_atoms); @@ -1229,7 +1229,7 @@ send_client_message_async_cb (Window window, */ if (!success && context->dest_window && - window == GDK_WINDOW_XID (context->dest_window)) + window == GDK_SURFACE_XID (context->dest_window)) { GdkX11DragContext *context_x11 = data; @@ -1265,7 +1265,7 @@ send_client_message_async (GdkDragContext *context, static gboolean xdnd_send_xevent (GdkX11DragContext *context_x11, - GdkWindow *window, + GdkSurface *window, gboolean propagate, XEvent *event_send) { @@ -1277,7 +1277,7 @@ xdnd_send_xevent (GdkX11DragContext *context_x11, g_assert (event_send->xany.type == ClientMessage); /* We short-circuit messages to ourselves */ - if (gdk_window_get_window_type (window) != GDK_WINDOW_FOREIGN) + if (gdk_surface_get_window_type (window) != GDK_SURFACE_FOREIGN) { gint i; @@ -1301,7 +1301,7 @@ xdnd_send_xevent (GdkX11DragContext *context_x11, } } - xwindow = GDK_WINDOW_XID (window); + xwindow = GDK_SURFACE_XID (window); if (_gdk_x11_display_is_root_window (display, xwindow)) event_mask = ButtonPressMask; @@ -1328,8 +1328,8 @@ xdnd_send_enter (GdkX11DragContext *context_x11) xev.xclient.format = 32; xev.xclient.window = context_x11->drop_xid ? context_x11->drop_xid - : GDK_WINDOW_XID (context->dest_window); - xev.xclient.data.l[0] = GDK_WINDOW_XID (context_x11->ipc_window); + : GDK_SURFACE_XID (context->dest_window); + xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_window); xev.xclient.data.l[1] = (context_x11->version << 24); /* version */ xev.xclient.data.l[2] = 0; xev.xclient.data.l[3] = 0; @@ -1337,7 +1337,7 @@ xdnd_send_enter (GdkX11DragContext *context_x11) GDK_DISPLAY_NOTE (display, DND, g_message ("Sending enter source window %#lx XDND protocol version %d\n", - GDK_WINDOW_XID (context_x11->ipc_window), context_x11->version)); + GDK_SURFACE_XID (context_x11->ipc_window), context_x11->version)); atoms = gdk_content_formats_get_mime_types (context->formats, &n_atoms); if (n_atoms > 3) @@ -1358,7 +1358,7 @@ xdnd_send_enter (GdkX11DragContext *context_x11) { GDK_DISPLAY_NOTE (display, DND, g_message ("Send event to %lx failed", - GDK_WINDOW_XID (context->dest_window))); + GDK_SURFACE_XID (context->dest_window))); g_object_unref (context->dest_window); context->dest_window = NULL; } @@ -1376,8 +1376,8 @@ xdnd_send_leave (GdkX11DragContext *context_x11) xev.xclient.format = 32; xev.xclient.window = context_x11->drop_xid ? context_x11->drop_xid - : GDK_WINDOW_XID (context->dest_window); - xev.xclient.data.l[0] = GDK_WINDOW_XID (context_x11->ipc_window); + : GDK_SURFACE_XID (context->dest_window); + xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_window); xev.xclient.data.l[1] = 0; xev.xclient.data.l[2] = 0; xev.xclient.data.l[3] = 0; @@ -1387,7 +1387,7 @@ xdnd_send_leave (GdkX11DragContext *context_x11) { GDK_DISPLAY_NOTE (display, DND, g_message ("Send event to %lx failed", - GDK_WINDOW_XID (context->dest_window))); + GDK_SURFACE_XID (context->dest_window))); g_object_unref (context->dest_window); context->dest_window = NULL; } @@ -1406,8 +1406,8 @@ xdnd_send_drop (GdkX11DragContext *context_x11, xev.xclient.format = 32; xev.xclient.window = context_x11->drop_xid ? context_x11->drop_xid - : GDK_WINDOW_XID (context->dest_window); - xev.xclient.data.l[0] = GDK_WINDOW_XID (context_x11->ipc_window); + : GDK_SURFACE_XID (context->dest_window); + xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_window); xev.xclient.data.l[1] = 0; xev.xclient.data.l[2] = time; xev.xclient.data.l[3] = 0; @@ -1417,7 +1417,7 @@ xdnd_send_drop (GdkX11DragContext *context_x11, { GDK_DISPLAY_NOTE (display, DND, g_message ("Send event to %lx failed", - GDK_WINDOW_XID (context->dest_window))); + GDK_SURFACE_XID (context->dest_window))); g_object_unref (context->dest_window); context->dest_window = NULL; } @@ -1439,8 +1439,8 @@ xdnd_send_motion (GdkX11DragContext *context_x11, xev.xclient.format = 32; xev.xclient.window = context_x11->drop_xid ? context_x11->drop_xid - : GDK_WINDOW_XID (context->dest_window); - xev.xclient.data.l[0] = GDK_WINDOW_XID (context_x11->ipc_window); + : GDK_SURFACE_XID (context->dest_window); + xev.xclient.data.l[0] = GDK_SURFACE_XID (context_x11->ipc_window); xev.xclient.data.l[1] = 0; xev.xclient.data.l[2] = (x_root << 16) | y_root; xev.xclient.data.l[3] = time; @@ -1450,7 +1450,7 @@ xdnd_send_motion (GdkX11DragContext *context_x11, { GDK_DISPLAY_NOTE (display, DND, g_message ("Send event to %lx failed", - GDK_WINDOW_XID (context->dest_window))); + GDK_SURFACE_XID (context->dest_window))); g_object_unref (context->dest_window); context->dest_window = NULL; } @@ -1546,13 +1546,13 @@ xdnd_read_actions (GdkX11DragContext *context_x11) context_x11->xdnd_have_actions = FALSE; - if (gdk_window_get_window_type (context->source_window) == GDK_WINDOW_FOREIGN) + if (gdk_surface_get_window_type (context->source_window) == GDK_SURFACE_FOREIGN) { /* Get the XdndActionList, if set */ gdk_x11_display_error_trap_push (display); if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (context->source_window), + GDK_SURFACE_XID (context->source_window), gdk_x11_get_xatom_by_name_for_display (display, "XdndActionList"), 0, 65536, False, XA_ATOM, &type, &format, &nitems, @@ -1600,8 +1600,8 @@ xdnd_read_actions (GdkX11DragContext *context_x11) GdkDragContext *source_context; source_context = gdk_drag_context_find (display, TRUE, - GDK_WINDOW_XID (context->source_window), - GDK_WINDOW_XID (context->dest_window)); + GDK_SURFACE_XID (context->source_window), + GDK_SURFACE_XID (context->dest_window)); if (source_context) { @@ -1644,11 +1644,11 @@ xdnd_source_window_filter (const XEvent *xevent, static void xdnd_manage_source_filter (GdkDragContext *context, - GdkWindow *window, + GdkSurface *window, gboolean add_filter) { - if (!GDK_WINDOW_DESTROYED (window) && - gdk_window_get_window_type (window) == GDK_WINDOW_FOREIGN) + if (!GDK_SURFACE_DESTROYED (window) && + gdk_surface_get_window_type (window) == GDK_SURFACE_FOREIGN) { GdkDisplay *display = gdk_drag_context_get_display (context); @@ -1656,8 +1656,8 @@ xdnd_manage_source_filter (GdkDragContext *context, if (add_filter) { - gdk_window_set_events (window, - gdk_window_get_events (window) | + gdk_surface_set_events (window, + gdk_surface_get_events (window) | GDK_PROPERTY_CHANGE_MASK); g_object_set_data (G_OBJECT (window), "xdnd-source-context", context); } @@ -1747,14 +1747,14 @@ xdnd_enter_filter (const XEvent *xevent, gint version; if (!event->any.window || - gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN) + gdk_surface_get_window_type (event->any.window) == GDK_SURFACE_FOREIGN) return GDK_FILTER_CONTINUE; /* Not for us */ source_window = xevent->xclient.data.l[0]; get_types = ((xevent->xclient.data.l[1] & 1) != 0); version = (xevent->xclient.data.l[1] & 0xff000000) >> 24; - display = GDK_WINDOW_DISPLAY (event->any.window); + display = GDK_SURFACE_DISPLAY (event->any.window); display_x11 = GDK_X11_DISPLAY (display); xdnd_precache_atoms (display); @@ -1788,7 +1788,7 @@ xdnd_enter_filter (const XEvent *xevent, seat = gdk_display_get_default_seat (display); gdk_drag_context_set_device (context, gdk_seat_get_pointer (seat)); - context->source_window = gdk_x11_window_foreign_new_for_display (display, source_window); + context->source_window = gdk_x11_surface_foreign_new_for_display (display, source_window); if (!context->source_window) { g_object_unref (context); @@ -1801,7 +1801,7 @@ xdnd_enter_filter (const XEvent *xevent, if (get_types) { gdk_x11_display_error_trap_push (display); - XGetWindowProperty (GDK_WINDOW_XDISPLAY (event->any.window), + XGetWindowProperty (GDK_SURFACE_XDISPLAY (event->any.window), source_window, gdk_x11_get_xatom_by_name_for_display (display, "XdndTypeList"), 0, 65536, @@ -1864,10 +1864,10 @@ xdnd_leave_filter (const XEvent *xevent, GdkX11Display *display_x11; if (!event->any.window || - gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN) + gdk_surface_get_window_type (event->any.window) == GDK_SURFACE_FOREIGN) return GDK_FILTER_CONTINUE; /* Not for us */ - display = GDK_WINDOW_DISPLAY (event->any.window); + display = GDK_SURFACE_DISPLAY (event->any.window); display_x11 = GDK_X11_DISPLAY (display); GDK_DISPLAY_NOTE (display, DND, @@ -1878,7 +1878,7 @@ xdnd_leave_filter (const XEvent *xevent, if ((display_x11->current_dest_drag != NULL) && (GDK_X11_DRAG_CONTEXT (display_x11->current_dest_drag)->protocol == GDK_DRAG_PROTO_XDND) && - (GDK_WINDOW_XID (display_x11->current_dest_drag->source_window) == source_window)) + (GDK_SURFACE_XID (display_x11->current_dest_drag->source_window) == source_window)) { event->any.type = GDK_DRAG_LEAVE; /* Pass ownership of context to the event */ @@ -1898,7 +1898,7 @@ xdnd_position_filter (const XEvent *xevent, GdkEvent *event, gpointer data) { - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; guint32 source_window = xevent->xclient.data.l[0]; gint16 x_root = xevent->xclient.data.l[2] >> 16; gint16 y_root = xevent->xclient.data.l[2] & 0xffff; @@ -1910,10 +1910,10 @@ xdnd_position_filter (const XEvent *xevent, GdkX11DragContext *context_x11; if (!event->any.window || - gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN) + gdk_surface_get_window_type (event->any.window) == GDK_SURFACE_FOREIGN) return GDK_FILTER_CONTINUE; /* Not for us */ - display = GDK_WINDOW_DISPLAY (event->any.window); + display = GDK_SURFACE_DISPLAY (event->any.window); display_x11 = GDK_X11_DISPLAY (display); GDK_DISPLAY_NOTE (display, DND, @@ -1926,9 +1926,9 @@ xdnd_position_filter (const XEvent *xevent, if ((context != NULL) && (GDK_X11_DRAG_CONTEXT (context)->protocol == GDK_DRAG_PROTO_XDND) && - (GDK_WINDOW_XID (context->source_window) == source_window)) + (GDK_SURFACE_XID (context->source_window) == source_window)) { - impl = GDK_WINDOW_IMPL_X11 (event->any.window->impl); + impl = GDK_SURFACE_IMPL_X11 (event->any.window->impl); context_x11 = GDK_X11_DRAG_CONTEXT (context); @@ -1969,10 +1969,10 @@ xdnd_drop_filter (const XEvent *xevent, GdkX11DragContext *context_x11; if (!event->any.window || - gdk_window_get_window_type (event->any.window) == GDK_WINDOW_FOREIGN) + gdk_surface_get_window_type (event->any.window) == GDK_SURFACE_FOREIGN) return GDK_FILTER_CONTINUE; /* Not for us */ - display = GDK_WINDOW_DISPLAY (event->any.window); + display = GDK_SURFACE_DISPLAY (event->any.window); display_x11 = GDK_X11_DISPLAY (display); GDK_DISPLAY_NOTE (display, DND, @@ -1985,7 +1985,7 @@ xdnd_drop_filter (const XEvent *xevent, if ((context != NULL) && (GDK_X11_DRAG_CONTEXT (context)->protocol == GDK_DRAG_PROTO_XDND) && - (GDK_WINDOW_XID (context->source_window) == source_window)) + (GDK_SURFACE_XID (context->source_window) == source_window)) { context_x11 = GDK_X11_DRAG_CONTEXT (context); event->any.type = GDK_DROP_START; @@ -1998,7 +1998,7 @@ xdnd_drop_filter (const XEvent *xevent, event->dnd.x_root = context_x11->last_x; event->dnd.y_root = context_x11->last_y; - gdk_x11_window_set_user_time (event->any.window, time); + gdk_x11_surface_set_user_time (event->any.window, time); return GDK_FILTER_TRANSLATE; } @@ -2014,13 +2014,13 @@ _gdk_x11_dnd_filter (const XEvent *xevent, GdkDisplay *display; int i; - if (!GDK_IS_X11_WINDOW (event->any.window)) + if (!GDK_IS_X11_SURFACE (event->any.window)) return GDK_FILTER_CONTINUE; if (xevent->type != ClientMessage) return GDK_FILTER_CONTINUE; - display = GDK_WINDOW_DISPLAY (event->any.window); + display = GDK_SURFACE_DISPLAY (event->any.window); for (i = 0; i < G_N_ELEMENTS (xdnd_filters); i++) { @@ -2059,14 +2059,14 @@ gdk_drag_do_leave (GdkX11DragContext *context_x11, } } -static GdkWindow * +static GdkSurface * create_drag_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; } @@ -2078,14 +2078,14 @@ _gdk_x11_display_get_drag_protocol (GdkDisplay *display, guint *version) { - GdkWindow *window; + GdkSurface *window; Window retval; base_precache_atoms (display); /* Check for a local drag */ - window = gdk_x11_window_lookup_for_display (display, xid); - if (window && gdk_window_get_window_type (window) != GDK_WINDOW_FOREIGN) + window = gdk_x11_surface_lookup_for_display (display, xid); + if (window && gdk_surface_get_window_type (window) != GDK_SURFACE_FOREIGN) { if (g_object_get_data (G_OBJECT (window), "gdk-dnd-registered") != NULL) { @@ -2130,37 +2130,37 @@ _gdk_x11_display_get_drag_protocol (GdkDisplay *display, return 0; /* a.k.a. None */ } -static GdkWindowCache * +static GdkSurfaceCache * drag_context_find_window_cache (GdkX11DragContext *context_x11, GdkDisplay *display) { if (!context_x11->cache) - context_x11->cache = gdk_window_cache_get (display); + context_x11->cache = gdk_surface_cache_get (display); return context_x11->cache; } -static GdkWindow * +static GdkSurface * gdk_x11_drag_context_find_window (GdkDragContext *context, - GdkWindow *drag_window, + GdkSurface *drag_window, gint x_root, gint y_root, GdkDragProtocol *protocol) { GdkX11Screen *screen_x11 = GDK_X11_SCREEN(GDK_X11_DISPLAY (context->display)->screen); GdkX11DragContext *context_x11 = GDK_X11_DRAG_CONTEXT (context); - GdkWindowCache *window_cache; + GdkSurfaceCache *window_cache; GdkDisplay *display; Window dest; - GdkWindow *dest_window; + GdkSurface *dest_window; display = gdk_drag_context_get_display (context); window_cache = drag_context_find_window_cache (context_x11, display); dest = get_client_window_at_coords (window_cache, - drag_window && GDK_WINDOW_IS_X11 (drag_window) ? - GDK_WINDOW_XID (drag_window) : None, + drag_window && GDK_SURFACE_IS_X11 (drag_window) ? + GDK_SURFACE_XID (drag_window) : None, x_root * screen_x11->window_scale, y_root * screen_x11->window_scale); @@ -2183,7 +2183,7 @@ gdk_x11_drag_context_find_window (GdkDragContext *context, &context_x11->version); if (recipient != None) - dest_window = gdk_x11_window_foreign_new_for_display (display, recipient); + dest_window = gdk_x11_surface_foreign_new_for_display (display, recipient); else dest_window = NULL; } @@ -2205,15 +2205,15 @@ move_drag_window (GdkDragContext *context, { GdkX11DragContext *context_x11 = GDK_X11_DRAG_CONTEXT (context); - gdk_window_move (context_x11->drag_window, + gdk_surface_move (context_x11->drag_window, x_root - context_x11->hot_x, y_root - context_x11->hot_y); - gdk_window_raise (context_x11->drag_window); + gdk_surface_raise (context_x11->drag_window); } static gboolean gdk_x11_drag_context_drag_motion (GdkDragContext *context, - GdkWindow *dest_window, + GdkSurface *dest_window, GdkDragProtocol protocol, gint x_root, gint y_root, @@ -2222,7 +2222,7 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context, guint32 time) { GdkX11DragContext *context_x11 = GDK_X11_DRAG_CONTEXT (context); - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; if (context_x11->drag_window) move_drag_window (context, x_root, y_root); @@ -2245,10 +2245,10 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context, */ if (dest_window) { - GdkDisplay *display = GDK_WINDOW_DISPLAY (dest_window); + GdkDisplay *display = GDK_SURFACE_DISPLAY (dest_window); xdnd_check_dest (display, - GDK_WINDOW_XID (dest_window), + GDK_SURFACE_XID (dest_window), &context_x11->version); } } @@ -2260,16 +2260,16 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context, { if (dest_window) { - if (gdk_window_get_window_type (dest_window) == GDK_WINDOW_FOREIGN) + if (gdk_surface_get_window_type (dest_window) == GDK_SURFACE_FOREIGN) xdnd_set_actions (context_x11); else if (context->dest_window == dest_window) { - GdkDisplay *display = GDK_WINDOW_DISPLAY (dest_window); + GdkDisplay *display = GDK_SURFACE_DISPLAY (dest_window); GdkDragContext *dest_context; dest_context = gdk_drag_context_find (display, FALSE, - GDK_WINDOW_XID (context->source_window), - GDK_WINDOW_XID (dest_window)); + GDK_SURFACE_XID (context->source_window), + GDK_SURFACE_XID (dest_window)); if (dest_context) { @@ -2339,7 +2339,7 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context, if (context->dest_window) { - impl = GDK_WINDOW_IMPL_X11 (context->dest_window->impl); + impl = GDK_SURFACE_IMPL_X11 (context->dest_window->impl); if (context_x11->drag_status == GDK_DRAG_STATUS_DRAG) { @@ -2435,9 +2435,9 @@ gdk_x11_drag_context_drag_status (GdkDragContext *context, xev.xclient.type = ClientMessage; xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "XdndStatus"); xev.xclient.format = 32; - xev.xclient.window = GDK_WINDOW_XID (context->source_window); + xev.xclient.window = GDK_SURFACE_XID (context->source_window); - xev.xclient.data.l[0] = GDK_WINDOW_XID (context->dest_window); + xev.xclient.data.l[0] = GDK_SURFACE_XID (context->dest_window); xev.xclient.data.l[1] = (action != 0) ? (2 | 1) : 0; xev.xclient.data.l[2] = 0; xev.xclient.data.l[3] = 0; @@ -2446,7 +2446,7 @@ gdk_x11_drag_context_drag_status (GdkDragContext *context, { GDK_DISPLAY_NOTE (display, DND, g_message ("Send event to %lx failed", - GDK_WINDOW_XID (context->source_window))); + GDK_SURFACE_XID (context->source_window))); } } @@ -2476,7 +2476,7 @@ gdk_x11_drag_context_drop_finish (GdkDragContext *context, gdk_x11_get_xatom_by_name_for_display (display, "XdndSelection"), gdk_x11_get_xatom_by_name_for_display (display, "DELETE"), gdk_x11_get_xatom_by_name_for_display (display, "GDK_SELECTION"), - GDK_WINDOW_XID (context->source_window), + GDK_SURFACE_XID (context->source_window), time); /* XXX: Do we need to wait for a reply here before sending the next message? */ } @@ -2484,9 +2484,9 @@ gdk_x11_drag_context_drop_finish (GdkDragContext *context, xev.xclient.type = ClientMessage; xev.xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "XdndFinished"); xev.xclient.format = 32; - xev.xclient.window = GDK_WINDOW_XID (context->source_window); + xev.xclient.window = GDK_SURFACE_XID (context->source_window); - xev.xclient.data.l[0] = GDK_WINDOW_XID (context->dest_window); + xev.xclient.data.l[0] = GDK_SURFACE_XID (context->dest_window); if (success) { xev.xclient.data.l[1] = 1; @@ -2505,16 +2505,16 @@ gdk_x11_drag_context_drop_finish (GdkDragContext *context, { GDK_DISPLAY_NOTE (display, DND, g_message ("Send event to %lx failed", - GDK_WINDOW_XID (context->source_window))); + GDK_SURFACE_XID (context->source_window))); } } } void -_gdk_x11_window_register_dnd (GdkWindow *window) +_gdk_x11_surface_register_dnd (GdkSurface *window) { static const gulong xdnd_version = 5; - GdkDisplay *display = gdk_window_get_display (window); + GdkDisplay *display = gdk_surface_get_display (window); g_return_if_fail (window != NULL); @@ -2529,7 +2529,7 @@ _gdk_x11_window_register_dnd (GdkWindow *window) /* The property needs to be of type XA_ATOM, not XA_INTEGER. Blech */ XChangeProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "XdndAware"), XA_ATOM, 32, PropModeReplace, (guchar *)&xdnd_version, 1); @@ -2541,7 +2541,7 @@ gdk_x11_drag_context_drop_status (GdkDragContext *context) return ! GDK_X11_DRAG_CONTEXT (context)->drop_failed; } -static GdkWindow * +static GdkSurface * gdk_x11_drag_context_get_drag_window (GdkDragContext *context) { return GDK_X11_DRAG_CONTEXT (context)->drag_window; @@ -2603,7 +2603,7 @@ gdk_x11_drag_context_xevent (GdkDisplay *display, Window xwindow; Atom xselection; - xwindow = GDK_WINDOW_XID (x11_context->ipc_window); + xwindow = GDK_SURFACE_XID (x11_context->ipc_window); xselection = gdk_x11_get_xatom_by_name_for_display (display, "XdndSelection"); if (xevent->xany.window != xwindow) @@ -2713,11 +2713,11 @@ gdk_drag_anim_timeout (gpointer data) t = ease_out_cubic (f); - gdk_window_show (context->drag_window); - gdk_window_move (context->drag_window, + gdk_surface_show (context->drag_window); + gdk_surface_move (context->drag_window, context->last_x + (context->start_x - context->last_x) * t, context->last_y + (context->start_y - context->last_y) * t); - gdk_window_set_opacity (context->drag_window, 1.0 - f); + gdk_surface_set_opacity (context->drag_window, 1.0 - f); return G_SOURCE_CONTINUE; } @@ -2734,7 +2734,7 @@ gdk_x11_drag_context_release_selection (GdkDragContext *context) display = gdk_drag_context_get_display (context); xdisplay = GDK_DISPLAY_XDISPLAY (display); xselection = gdk_x11_get_xatom_by_name_for_display (display, "XdndSelection"); - xwindow = GDK_WINDOW_XID (x11_context->ipc_window); + xwindow = GDK_SURFACE_XID (x11_context->ipc_window); if (XGetSelectionOwner (xdisplay, xselection) == xwindow) XSetSelectionOwner (xdisplay, xselection, None, CurrentTime); @@ -2758,15 +2758,15 @@ gdk_x11_drag_context_drop_done (GdkDragContext *context, context); if (success) { - gdk_window_hide (x11_context->drag_window); + gdk_surface_hide (x11_context->drag_window); return; } - win_surface = _gdk_window_ref_cairo_surface (x11_context->drag_window); - surface = gdk_window_create_similar_surface (x11_context->drag_window, + win_surface = _gdk_surface_ref_cairo_surface (x11_context->drag_window); + surface = gdk_surface_create_similar_surface (x11_context->drag_window, cairo_surface_get_content (win_surface), - gdk_window_get_width (x11_context->drag_window), - gdk_window_get_height (x11_context->drag_window)); + gdk_surface_get_width (x11_context->drag_window), + gdk_surface_get_height (x11_context->drag_window)); cr = cairo_create (surface); cairo_set_source_surface (cr, win_surface, 0, 0); cairo_paint (cr); @@ -2776,7 +2776,7 @@ gdk_x11_drag_context_drop_done (GdkDragContext *context, /* pattern = cairo_pattern_create_for_surface (surface); - gdk_window_set_background_pattern (x11_context->drag_window, pattern); + gdk_surface_set_background_pattern (x11_context->drag_window, pattern); cairo_pattern_destroy (pattern); */ @@ -2784,7 +2784,7 @@ gdk_x11_drag_context_drop_done (GdkDragContext *context, anim = g_slice_new0 (GdkDragAnim); anim->context = g_object_ref (x11_context); - anim->frame_clock = gdk_window_get_frame_clock (x11_context->drag_window); + anim->frame_clock = gdk_surface_get_frame_clock (x11_context->drag_window); anim->start_time = gdk_frame_clock_get_frame_time (anim->frame_clock); id = g_timeout_add_full (G_PRIORITY_DEFAULT, 17, @@ -2939,7 +2939,7 @@ drag_context_ungrab (GdkDragContext *context) } GdkDragContext * -_gdk_x11_window_drag_begin (GdkWindow *window, +_gdk_x11_surface_drag_begin (GdkSurface *window, GdkDevice *device, GdkContentProvider *content, GdkDragAction actions, @@ -2952,7 +2952,7 @@ _gdk_x11_window_drag_begin (GdkWindow *window, int x_root, y_root; Atom xselection; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); context = (GdkDragContext *) g_object_new (GDK_TYPE_X11_DRAG_CONTEXT, "display", display, @@ -2978,10 +2978,10 @@ _gdk_x11_window_drag_begin (GdkWindow *window, x11_context->protocol = GDK_DRAG_PROTO_XDND; x11_context->actions = actions; - x11_context->ipc_window = gdk_window_new_popup (display, &(GdkRectangle) { -99, -99, 1, 1 }); - if (gdk_window_get_group (window)) - gdk_window_set_group (x11_context->ipc_window, window); - gdk_window_show (x11_context->ipc_window); + x11_context->ipc_window = gdk_surface_new_popup (display, &(GdkRectangle) { -99, -99, 1, 1 }); + if (gdk_surface_get_group (window)) + gdk_surface_set_group (x11_context->ipc_window, window); + gdk_surface_show (x11_context->ipc_window); context->source_window = x11_context->ipc_window; g_object_ref (context->source_window); @@ -3000,9 +3000,9 @@ _gdk_x11_window_drag_begin (GdkWindow *window, xselection = gdk_x11_get_xatom_by_name_for_display (display, "XdndSelection"); XSetSelectionOwner (GDK_DISPLAY_XDISPLAY (display), xselection, - GDK_WINDOW_XID (x11_context->ipc_window), + GDK_SURFACE_XID (x11_context->ipc_window), x11_context->timestamp); - if (XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display), xselection) != GDK_WINDOW_XID (x11_context->ipc_window)) + if (XGetSelectionOwner (GDK_DISPLAY_XDISPLAY (display), xselection) != GDK_SURFACE_XID (x11_context->ipc_window)) { GDK_DISPLAY_NOTE (display, DND, g_printerr ("failed XSetSelectionOwner() on \"XdndSelection\", aborting DND\n")); g_object_unref (context); @@ -3118,7 +3118,7 @@ gdk_drag_update (GdkDragContext *context, { GdkX11DragContext *x11_context = GDK_X11_DRAG_CONTEXT (context); GdkDragAction action, possible_actions; - GdkWindow *dest_window; + GdkSurface *dest_window; GdkDragProtocol protocol; gdk_drag_get_current_actions (mods, GDK_BUTTON_PRIMARY, x11_context->actions, diff --git a/gdk/x11/gdkeventsource.c b/gdk/x11/gdkeventsource.c index 45b5df94ad..2a26669c1a 100644 --- a/gdk/x11/gdkeventsource.c +++ b/gdk/x11/gdkeventsource.c @@ -55,13 +55,13 @@ static GSourceFuncs event_funcs = { gdk_event_source_finalize }; -static GdkWindow * +static GdkSurface * gdk_event_source_get_filter_window (GdkEventSource *event_source, const XEvent *xevent, GdkEventTranslator **event_translator) { GList *list = event_source->translators; - GdkWindow *window; + GdkSurface *window; *event_translator = NULL; @@ -80,10 +80,10 @@ gdk_event_source_get_filter_window (GdkEventSource *event_source, } } - window = gdk_x11_window_lookup_for_display (event_source->display, + window = gdk_x11_surface_lookup_for_display (event_source->display, xevent->xany.window); - if (window && !GDK_IS_WINDOW (window)) + if (window && !GDK_IS_SURFACE (window)) window = NULL; return window; @@ -96,8 +96,8 @@ handle_focus_change (GdkEventCrossing *event) GdkX11Screen *x11_screen; gboolean focus_in, had_focus; - toplevel = _gdk_x11_window_get_toplevel (event->any.window); - x11_screen = GDK_X11_SCREEN (GDK_WINDOW_SCREEN (event->any.window)); + toplevel = _gdk_x11_surface_get_toplevel (event->any.window); + x11_screen = GDK_X11_SCREEN (GDK_SURFACE_SCREEN (event->any.window)); focus_in = (event->any.type == GDK_ENTER_NOTIFY); if (x11_screen->wmspec_check_window) @@ -124,7 +124,7 @@ handle_focus_change (GdkEventCrossing *event) focus_event->focus_change.in = focus_in; gdk_event_set_device (focus_event, gdk_event_get_device ((GdkEvent *) event)); - gdk_display_put_event (gdk_window_get_display (event->any.window), focus_event); + gdk_display_put_event (gdk_surface_get_display (event->any.window), focus_event); g_object_unref (focus_event); } } @@ -232,7 +232,7 @@ gdk_event_source_translate_event (GdkX11Display *x11_display, GdkFilterReturn result = GDK_FILTER_CONTINUE; GdkDisplay *display = GDK_DISPLAY (x11_display); GdkEventTranslator *event_translator; - GdkWindow *filter_window; + GdkSurface *filter_window; Display *dpy; GdkX11Screen *x11_screen; gpointer cache; @@ -254,15 +254,15 @@ gdk_event_source_translate_event (GdkX11Display *x11_display, xevent->xany.window == x11_screen->xsettings_manager_window) result = gdk_xsettings_manager_window_filter (xevent, event, x11_screen); - cache = gdk_window_cache_get (display); + cache = gdk_surface_cache_get (display); if (cache) { if (result == GDK_FILTER_CONTINUE) - result = gdk_window_cache_shape_filter (xevent, event, cache); + result = gdk_surface_cache_shape_filter (xevent, event, cache); if (result == GDK_FILTER_CONTINUE && xevent->xany.window == XRootWindow (dpy, 0)) - result = gdk_window_cache_filter (xevent, event, cache); + result = gdk_surface_cache_filter (xevent, event, cache); } if (result == GDK_FILTER_CONTINUE) diff --git a/gdk/x11/gdkeventtranslator.c b/gdk/x11/gdkeventtranslator.c index 7bb4c6668e..96c2ed9957 100644 --- a/gdk/x11/gdkeventtranslator.c +++ b/gdk/x11/gdkeventtranslator.c @@ -86,7 +86,7 @@ _gdk_x11_event_translator_select_window_events (GdkEventTranslator *translator, iface->select_window_events (translator, window, event_mask); } -GdkWindow * +GdkSurface * _gdk_x11_event_translator_get_window (GdkEventTranslator *translator, GdkDisplay *display, const XEvent *xevent) diff --git a/gdk/x11/gdkeventtranslator.h b/gdk/x11/gdkeventtranslator.h index 1bd9d78d5f..7d7d0b7a9f 100644 --- a/gdk/x11/gdkeventtranslator.h +++ b/gdk/x11/gdkeventtranslator.h @@ -47,7 +47,7 @@ struct _GdkEventTranslatorIface void (* select_window_events) (GdkEventTranslator *translator, Window window, GdkEventMask event_mask); - GdkWindow * (* get_window) (GdkEventTranslator *translator, + GdkSurface * (* get_window) (GdkEventTranslator *translator, const XEvent *xevent); }; @@ -60,7 +60,7 @@ GdkEventMask _gdk_x11_event_translator_get_handled_events (GdkEventTranslator void _gdk_x11_event_translator_select_window_events (GdkEventTranslator *translator, Window window, GdkEventMask event_mask); -GdkWindow * _gdk_x11_event_translator_get_window (GdkEventTranslator *translator, +GdkSurface * _gdk_x11_event_translator_get_window (GdkEventTranslator *translator, GdkDisplay *display, const XEvent *xevent); diff --git a/gdk/x11/gdkgeometry-x11.c b/gdk/x11/gdkgeometry-x11.c index 6d299fe475..208704c360 100644 --- a/gdk/x11/gdkgeometry-x11.c +++ b/gdk/x11/gdkgeometry-x11.c @@ -25,12 +25,12 @@ #include "gdkwindow-x11.h" -typedef struct _GdkWindowQueueItem GdkWindowQueueItem; -typedef struct _GdkWindowParentPos GdkWindowParentPos; +typedef struct _GdkSurfaceQueueItem GdkSurfaceQueueItem; +typedef struct _GdkSurfaceParentPos GdkSurfaceParentPos; -struct _GdkWindowQueueItem +struct _GdkSurfaceQueueItem { - GdkWindow *window; + GdkSurface *window; gulong serial; cairo_region_t *antiexpose_area; }; @@ -76,7 +76,7 @@ queue_delete_link (GQueue *queue, } static void -queue_item_free (GdkWindowQueueItem *item) +queue_item_free (GdkSurfaceQueueItem *item) { if (item->window) { @@ -102,10 +102,10 @@ _gdk_x11_display_free_translate_queue (GdkDisplay *display) } static void -gdk_window_queue (GdkWindow *window, - GdkWindowQueueItem *new_item) +gdk_surface_queue (GdkSurface *window, + GdkSurfaceQueueItem *new_item) { - GdkX11Display *display_x11 = GDK_X11_DISPLAY (GDK_WINDOW_DISPLAY (window)); + GdkX11Display *display_x11 = GDK_X11_DISPLAY (GDK_SURFACE_DISPLAY (window)); if (!display_x11->translate_queue) display_x11->translate_queue = g_queue_new (); @@ -116,12 +116,12 @@ gdk_window_queue (GdkWindow *window, */ if (display_x11->translate_queue->length >= 64) { - gulong serial = find_current_serial (GDK_WINDOW_XDISPLAY (window)); + gulong serial = find_current_serial (GDK_SURFACE_XDISPLAY (window)); GList *tmp_list = display_x11->translate_queue->head; while (tmp_list) { - GdkWindowQueueItem *item = tmp_list->data; + GdkSurfaceQueueItem *item = tmp_list->data; GList *next = tmp_list->next; /* an overflow-safe (item->serial < serial) */ @@ -147,7 +147,7 @@ gdk_window_queue (GdkWindow *window, while (tmp_list) { - GdkWindowQueueItem *item = tmp_list->data; + GdkSurfaceQueueItem *item = tmp_list->data; GList *next = tmp_list->next; queue_delete_link (display_x11->translate_queue, tmp_list); @@ -158,7 +158,7 @@ gdk_window_queue (GdkWindow *window, } new_item->window = window; - new_item->serial = NextRequest (GDK_WINDOW_XDISPLAY (window)); + new_item->serial = NextRequest (GDK_SURFACE_XDISPLAY (window)); g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&(new_item->window)); @@ -167,22 +167,22 @@ gdk_window_queue (GdkWindow *window, } void -_gdk_x11_window_queue_antiexpose (GdkWindow *window, +_gdk_x11_surface_queue_antiexpose (GdkSurface *window, cairo_region_t *area) { - GdkWindowQueueItem *item = g_new (GdkWindowQueueItem, 1); + GdkSurfaceQueueItem *item = g_new (GdkSurfaceQueueItem, 1); item->antiexpose_area = cairo_region_reference (area); - gdk_window_queue (window, item); + gdk_surface_queue (window, item); } void -_gdk_x11_window_process_expose (GdkWindow *window, +_gdk_x11_surface_process_expose (GdkSurface *window, gulong serial, GdkRectangle *area) { cairo_region_t *invalidate_region = cairo_region_create_rectangle (area); - GdkX11Display *display_x11 = GDK_X11_DISPLAY (GDK_WINDOW_DISPLAY (window)); + GdkX11Display *display_x11 = GDK_X11_DISPLAY (GDK_SURFACE_DISPLAY (window)); if (display_x11->translate_queue) { @@ -190,7 +190,7 @@ _gdk_x11_window_process_expose (GdkWindow *window, while (tmp_list) { - GdkWindowQueueItem *item = tmp_list->data; + GdkSurfaceQueueItem *item = tmp_list->data; GList *next = tmp_list->next; /* an overflow-safe (serial < item->serial) */ @@ -209,7 +209,7 @@ _gdk_x11_window_process_expose (GdkWindow *window, } if (!cairo_region_is_empty (invalidate_region)) - _gdk_window_invalidate_for_expose (window, invalidate_region); + _gdk_surface_invalidate_for_expose (window, invalidate_region); cairo_region_destroy (invalidate_region); } diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c index fdd9571b92..682df01b39 100644 --- a/gdk/x11/gdkglcontext-x11.c +++ b/gdk/x11/gdkglcontext-x11.c @@ -79,13 +79,13 @@ drawable_info_free (gpointer data_) } static DrawableInfo * -get_glx_drawable_info (GdkWindow *window) +get_glx_drawable_info (GdkSurface *window) { return g_object_get_data (G_OBJECT (window), "-gdk-x11-window-glx-info"); } static void -set_glx_drawable_info (GdkWindow *window, +set_glx_drawable_info (GdkSurface *window, DrawableInfo *info) { g_object_set_data_full (G_OBJECT (window), "-gdk-x11-window-glx-info", @@ -125,7 +125,7 @@ gdk_x11_gl_context_end_frame (GdkDrawContext *draw_context, { GdkGLContext *context = GDK_GL_CONTEXT (draw_context); GdkX11GLContext *context_x11 = GDK_X11_GL_CONTEXT (context); - GdkWindow *window = gdk_gl_context_get_window (context); + GdkSurface *window = gdk_gl_context_get_window (context); GdkDisplay *display = gdk_gl_context_get_display (context); Display *dpy = gdk_x11_display_get_xdisplay (display); GdkX11Display *display_x11 = GDK_X11_DISPLAY (display); @@ -146,7 +146,7 @@ gdk_x11_gl_context_end_frame (GdkDrawContext *draw_context, GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Flushing GLX buffers for drawable %lu (window: %lu), frame sync: %s", (unsigned long) drawable, - (unsigned long) gdk_x11_window_get_xid (window), + (unsigned long) gdk_x11_surface_get_xid (window), context_x11->do_frame_sync ? "yes" : "no")); /* if we are going to wait for the vertical refresh manually @@ -194,7 +194,7 @@ gdk_x11_gl_context_get_damage (GdkGLContext *context) GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); GdkX11Display *display_x11 = GDK_X11_DISPLAY (display); Display *dpy = gdk_x11_display_get_xdisplay (display); - GdkWindow *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); + GdkSurface *window = gdk_draw_context_get_window (GDK_DRAW_CONTEXT (context)); unsigned int buffer_age = 0; if (display_x11->has_glx_buffer_age) @@ -370,7 +370,7 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context, double device_x_offset, device_y_offset; cairo_rectangle_int_t rect; int n_rects, i; - GdkWindow *window; + GdkSurface *window; int unscaled_window_height; int window_scale; unsigned int texture_id; @@ -401,8 +401,8 @@ gdk_x11_gl_context_texture_from_surface (GdkGLContext *paint_context, GDK_DISPLAY_NOTE (GDK_DISPLAY (display_x11), OPENGL, g_message ("Using GLX_EXT_texture_from_pixmap to draw surface")); window = gdk_gl_context_get_window (paint_context)->impl_window; - window_scale = gdk_window_get_scale_factor (window); - gdk_window_get_unscaled_size (window, NULL, &unscaled_window_height); + window_scale = gdk_surface_get_scale_factor (window); + gdk_surface_get_unscaled_size (window, NULL, &unscaled_window_height); sx = sy = 1; cairo_surface_get_device_scale (surface, &sx, &sy); @@ -566,12 +566,12 @@ gdk_x11_gl_context_realize (GdkGLContext *context, Display *dpy; DrawableInfo *info; GdkGLContext *share; - GdkWindow *window; + GdkSurface *window; gboolean debug_bit, compat_bit, legacy_bit, es_bit; int major, minor, flags; window = gdk_gl_context_get_window (context); - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); dpy = gdk_x11_display_get_xdisplay (display); context_x11 = GDK_X11_GL_CONTEXT (context); display_x11 = GDK_X11_DISPLAY (display); @@ -698,7 +698,7 @@ gdk_x11_gl_context_realize (GdkGLContext *context, if (GDK_X11_DISPLAY (display)->glx_version >= 13) { info->glx_drawable = glXCreateWindow (dpy, context_x11->glx_config, - gdk_x11_window_get_xid (window->impl_window), + gdk_x11_surface_get_xid (window->impl_window), NULL); info->dummy_glx = glXCreateWindow (dpy, context_x11->glx_config, info->dummy_xwin, NULL); } @@ -722,7 +722,7 @@ gdk_x11_gl_context_realize (GdkGLContext *context, XFree (xvisinfo); - context_x11->attached_drawable = info->glx_drawable ? info->glx_drawable : gdk_x11_window_get_xid (window->impl_window); + context_x11->attached_drawable = info->glx_drawable ? info->glx_drawable : gdk_x11_surface_get_xid (window->impl_window); context_x11->unattached_drawable = info->dummy_glx ? info->dummy_glx : info->dummy_xwin; context_x11->is_direct = glXIsDirect (dpy, context_x11->glx_context); @@ -1193,7 +1193,7 @@ _gdk_x11_screen_update_visuals_for_gl (GdkX11Screen *x11_screen) } GdkGLContext * -gdk_x11_window_create_gl_context (GdkWindow *window, +gdk_x11_surface_create_gl_context (GdkSurface *window, gboolean attached, GdkGLContext *share, GError **error) @@ -1202,9 +1202,9 @@ gdk_x11_window_create_gl_context (GdkWindow *window, GdkX11GLContext *context; GLXFBConfig config; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); - if (!gdk_x11_screen_init_gl (GDK_WINDOW_SCREEN (window))) + if (!gdk_x11_screen_init_gl (GDK_SURFACE_SCREEN (window))) { g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE, diff --git a/gdk/x11/gdkglcontext-x11.h b/gdk/x11/gdkglcontext-x11.h index f5af2115df..61dbadef1f 100644 --- a/gdk/x11/gdkglcontext-x11.h +++ b/gdk/x11/gdkglcontext-x11.h @@ -55,7 +55,7 @@ struct _GdkX11GLContextClass }; gboolean gdk_x11_screen_init_gl (GdkX11Screen *screen); -GdkGLContext * gdk_x11_window_create_gl_context (GdkWindow *window, +GdkGLContext * gdk_x11_surface_create_gl_context (GdkSurface *window, gboolean attached, GdkGLContext *share, GError **error); diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c index 72edfe1c09..c14c04e09d 100644 --- a/gdk/x11/gdkmain-x11.c +++ b/gdk/x11/gdkmain-x11.c @@ -102,7 +102,7 @@ static int gdk_x_error (Display *display, static int gdk_x_io_error (Display *display); void -_gdk_x11_windowing_init (void) +_gdk_x11_surfaceing_init (void) { XSetErrorHandler (gdk_x_error); XSetIOErrorHandler (gdk_x_io_error); @@ -130,8 +130,8 @@ _gdk_x11_convert_grab_status (gint status) } /* - * _gdk_x11_window_grab_check_unmap: - * @window: a #GdkWindow + * _gdk_x11_surface_grab_check_unmap: + * @window: a #GdkSurface * @serial: serial from Unmap event (or from NextRequest(display) * if the unmap is being done by this client.) * @@ -140,10 +140,10 @@ _gdk_x11_convert_grab_status (gint status) * the pointer we keep to it. **/ void -_gdk_x11_window_grab_check_unmap (GdkWindow *window, +_gdk_x11_surface_grab_check_unmap (GdkSurface *window, gulong serial) { - GdkDisplay *display = gdk_window_get_display (window); + GdkDisplay *display = gdk_surface_get_display (window); GdkSeat *seat; GList *devices, *d; @@ -161,16 +161,16 @@ _gdk_x11_window_grab_check_unmap (GdkWindow *window, } /* - * _gdk_x11_window_grab_check_destroy: - * @window: a #GdkWindow + * _gdk_x11_surface_grab_check_destroy: + * @window: a #GdkSurface * * Checks to see if window is the current grab window, and if * so, clear the current grab window. **/ void -_gdk_x11_window_grab_check_destroy (GdkWindow *window) +_gdk_x11_surface_grab_check_destroy (GdkSurface *window) { - GdkDisplay *display = gdk_window_get_display (window); + GdkDisplay *display = gdk_surface_get_display (window); GdkSeat *seat; GdkDeviceGrabInfo *grab; GList *devices, *d; diff --git a/gdk/x11/gdkmonitor-x11.c b/gdk/x11/gdkmonitor-x11.c index a10d41da6f..8a282b95cf 100644 --- a/gdk/x11/gdkmonitor-x11.c +++ b/gdk/x11/gdkmonitor-x11.c @@ -34,7 +34,7 @@ static gboolean gdk_monitor_has_fullscreen_window (GdkMonitor *monitor) { GList *toplevels, *l; - GdkWindow *window; + GdkSurface *window; gboolean has_fullscreen; toplevels = gdk_x11_display_get_toplevel_windows (monitor->display); @@ -44,10 +44,10 @@ gdk_monitor_has_fullscreen_window (GdkMonitor *monitor) { window = l->data; - if ((gdk_window_get_state (window) & GDK_WINDOW_STATE_FULLSCREEN) == 0) + if ((gdk_surface_get_state (window) & GDK_SURFACE_STATE_FULLSCREEN) == 0) continue; - if (gdk_window_get_fullscreen_mode (window) == GDK_FULLSCREEN_ON_ALL_MONITORS || + if (gdk_surface_get_fullscreen_mode (window) == GDK_FULLSCREEN_ON_ALL_MONITORS || gdk_display_get_monitor_at_window (monitor->display, window) == monitor) { has_fullscreen = TRUE; diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h index bcd6b265b3..90d6ecaafe 100644 --- a/gdk/x11/gdkprivate-x11.h +++ b/gdk/x11/gdkprivate-x11.h @@ -68,7 +68,7 @@ Colormap gdk_x11_display_get_window_colormap (GdkX11Display *displa void _gdk_x11_display_add_window (GdkDisplay *display, XID *xid, - GdkWindow *window); + GdkSurface *window); void _gdk_x11_display_remove_window (GdkDisplay *display, XID xid); @@ -79,13 +79,13 @@ gint _gdk_x11_display_send_xevent (GdkDisplay *display, XEvent *event_send); /* Routines from gdkgeometry-x11.c */ -void _gdk_x11_window_process_expose (GdkWindow *window, +void _gdk_x11_surface_process_expose (GdkSurface *window, gulong serial, GdkRectangle *area); -void _gdk_x11_window_queue_antiexpose (GdkWindow *window, +void _gdk_x11_surface_queue_antiexpose (GdkSurface *window, cairo_region_t *area); -void _gdk_x11_window_translate (GdkWindow *window, +void _gdk_x11_surface_translate (GdkSurface *window, cairo_region_t *area, gint dx, gint dy); @@ -106,7 +106,7 @@ void _gdk_x11_region_get_xrectangles (const cairo_region_t *region, gboolean _gdk_x11_moveresize_handle_event (const XEvent *event); gboolean _gdk_x11_moveresize_configure_done (GdkDisplay *display, - GdkWindow *window); + GdkSurface *window); void _gdk_x11_keymap_state_changed (GdkDisplay *display, const XEvent *event); @@ -114,11 +114,11 @@ void _gdk_x11_keymap_keys_changed (GdkDisplay *display); void _gdk_x11_keymap_add_virt_mods (GdkKeymap *keymap, GdkModifierType *modifiers); -void _gdk_x11_windowing_init (void); +void _gdk_x11_surfaceing_init (void); -void _gdk_x11_window_grab_check_unmap (GdkWindow *window, +void _gdk_x11_surface_grab_check_unmap (GdkSurface *window, gulong serial); -void _gdk_x11_window_grab_check_destroy (GdkWindow *window); +void _gdk_x11_surface_grab_check_destroy (GdkSurface *window); gboolean _gdk_x11_display_is_root_window (GdkDisplay *display, Window xroot_window); @@ -197,10 +197,10 @@ void _gdk_x11_display_get_maximal_cursor_size (GdkDisplay *display, guint *width, guint *height); void _gdk_x11_display_create_window_impl (GdkDisplay *display, - GdkWindow *window, - GdkWindow *real_parent, + GdkSurface *window, + GdkSurface *real_parent, GdkEventMask event_mask, - GdkWindowAttr *attributes); + GdkSurfaceAttr *attributes); GList * gdk_x11_display_get_toplevel_windows (GdkDisplay *display); void _gdk_x11_precache_atoms (GdkDisplay *display, @@ -221,25 +221,25 @@ xdnd_source_window_filter (const XEvent *xevent, GdkEvent *event, gpointer data); -typedef struct _GdkWindowCache GdkWindowCache; +typedef struct _GdkSurfaceCache GdkSurfaceCache; -GdkWindowCache * -gdk_window_cache_get (GdkDisplay *display); +GdkSurfaceCache * +gdk_surface_cache_get (GdkDisplay *display); GdkFilterReturn -gdk_window_cache_filter (const XEvent *xevent, +gdk_surface_cache_filter (const XEvent *xevent, GdkEvent *event, gpointer data); GdkFilterReturn -gdk_window_cache_shape_filter (const XEvent *xevent, +gdk_surface_cache_shape_filter (const XEvent *xevent, GdkEvent *event, gpointer data); void _gdk_x11_cursor_display_finalize (GdkDisplay *display); -void _gdk_x11_window_register_dnd (GdkWindow *window); +void _gdk_x11_surface_register_dnd (GdkSurface *window); -GdkDragContext * _gdk_x11_window_drag_begin (GdkWindow *window, +GdkDragContext * _gdk_x11_surface_drag_begin (GdkSurface *window, GdkDevice *device, GdkContentProvider *content, GdkDragAction actions, @@ -258,20 +258,20 @@ extern const gint _gdk_x11_event_mask_table_size; #define GDK_SCREEN_DISPLAY(screen) (GDK_X11_SCREEN (screen)->display) #define GDK_SCREEN_XROOTWIN(screen) (GDK_X11_SCREEN (screen)->xroot_window) #define GDK_DISPLAY_XROOTWIN(display) (GDK_SCREEN_XROOTWIN (GDK_X11_DISPLAY (display)->screen)) -#define GDK_WINDOW_SCREEN(win) (GDK_X11_DISPLAY (gdk_window_get_display (win))->screen) -#define GDK_WINDOW_DISPLAY(win) (gdk_window_get_display (win)) -#define GDK_WINDOW_XROOTWIN(win) (GDK_X11_SCREEN (GDK_WINDOW_SCREEN (win))->xroot_window) -#define GDK_WINDOW_IS_X11(win) (GDK_IS_WINDOW_IMPL_X11 ((win)->impl)) +#define GDK_SURFACE_SCREEN(win) (GDK_X11_DISPLAY (gdk_surface_get_display (win))->screen) +#define GDK_SURFACE_DISPLAY(win) (gdk_surface_get_display (win)) +#define GDK_SURFACE_XROOTWIN(win) (GDK_X11_SCREEN (GDK_SURFACE_SCREEN (win))->xroot_window) +#define GDK_SURFACE_IS_X11(win) (GDK_IS_SURFACE_IMPL_X11 ((win)->impl)) /* override some macros from gdkx.h with direct-access variants */ #undef GDK_DISPLAY_XDISPLAY -#undef GDK_WINDOW_XDISPLAY -#undef GDK_WINDOW_XID +#undef GDK_SURFACE_XDISPLAY +#undef GDK_SURFACE_XID #undef GDK_SCREEN_XDISPLAY #define GDK_DISPLAY_XDISPLAY(display) (GDK_X11_DISPLAY(display)->xdisplay) -#define GDK_WINDOW_XDISPLAY(win) (GDK_X11_SCREEN (GDK_WINDOW_SCREEN (win))->xdisplay) -#define GDK_WINDOW_XID(win) (GDK_WINDOW_IMPL_X11(GDK_WINDOW (win)->impl)->xid) +#define GDK_SURFACE_XDISPLAY(win) (GDK_X11_SCREEN (GDK_SURFACE_SCREEN (win))->xdisplay) +#define GDK_SURFACE_XID(win) (GDK_SURFACE_IMPL_X11(GDK_SURFACE (win)->impl)->xid) #define GDK_SCREEN_XDISPLAY(screen) (GDK_X11_SCREEN (screen)->xdisplay) #endif /* __GDK_PRIVATE_X11_H__ */ diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c index 2ca0ac7886..bcabeb32de 100644 --- a/gdk/x11/gdkscreen-x11.c +++ b/gdk/x11/gdkscreen-x11.c @@ -805,9 +805,9 @@ _gdk_x11_screen_set_window_scale (GdkX11Screen *x11_screen, for (l = toplevels; l != NULL; l = l->next) { - GdkWindow *window = l->data; + GdkSurface *window = l->data; - _gdk_x11_window_set_window_scale (window, scale); + _gdk_x11_surface_set_window_scale (window, scale); } for (i = 0; i < x11_display->monitors->len; i++) diff --git a/gdk/x11/gdkvulkancontext-x11.c b/gdk/x11/gdkvulkancontext-x11.c index 608a2e22d7..0e88ec6d63 100644 --- a/gdk/x11/gdkvulkancontext-x11.c +++ b/gdk/x11/gdkvulkancontext-x11.c @@ -36,7 +36,7 @@ static VkResult gdk_x11_vulkan_context_create_surface (GdkVulkanContext *context, 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)); /* This is necessary so that Vulkan sees the Window. @@ -52,7 +52,7 @@ gdk_x11_vulkan_context_create_surface (GdkVulkanContext *context, NULL, 0, gdk_x11_display_get_xdisplay (display), - gdk_x11_window_get_xid (window) + gdk_x11_surface_get_xid (window) }, NULL, surface); diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 3fcaae3591..c78c5c1840 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -101,23 +101,23 @@ const int _gdk_x11_event_mask_table[21] = const gint _gdk_x11_event_mask_table_size = G_N_ELEMENTS (_gdk_x11_event_mask_table); /* Forward declarations */ -static void gdk_x11_window_apply_fullscreen_mode (GdkWindow *window); -static gboolean gdk_window_icon_name_set (GdkWindow *window); +static void gdk_x11_surface_apply_fullscreen_mode (GdkSurface *window); +static gboolean gdk_surface_icon_name_set (GdkSurface *window); static void set_wm_name (GdkDisplay *display, Window xwindow, const gchar *name); -static void move_to_current_desktop (GdkWindow *window); +static void move_to_current_desktop (GdkSurface *window); -static void gdk_window_impl_x11_finalize (GObject *object); +static void gdk_surface_impl_x11_finalize (GObject *object); #define WINDOW_IS_TOPLEVEL_OR_FOREIGN(window) \ - (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL || \ - GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP || \ - GDK_WINDOW_TYPE (window) == GDK_WINDOW_FOREIGN) + (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TOPLEVEL || \ + GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP || \ + GDK_SURFACE_TYPE (window) == GDK_SURFACE_FOREIGN) #define WINDOW_IS_TOPLEVEL(window) \ - (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TOPLEVEL || \ - GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP) + (GDK_SURFACE_TYPE (window) == GDK_SURFACE_TOPLEVEL || \ + GDK_SURFACE_TYPE (window) == GDK_SURFACE_TEMP) /* Return whether time1 is considered later than time2 as far as xserver * time is concerned. Accounts for wraparound. @@ -127,47 +127,47 @@ static void gdk_window_impl_x11_finalize (GObject *object); (( time1 < time2 ) && ( time2 - time1 > ((guint32)-1)/2 )) \ ) -struct _GdkX11Window { - GdkWindow parent; +struct _GdkX11Surface { + GdkSurface parent; }; -struct _GdkX11WindowClass { - GdkWindowClass parent_class; +struct _GdkX11SurfaceClass { + GdkSurfaceClass parent_class; }; -G_DEFINE_TYPE (GdkX11Window, gdk_x11_window, GDK_TYPE_WINDOW) +G_DEFINE_TYPE (GdkX11Surface, gdk_x11_surface, GDK_TYPE_SURFACE) static void -gdk_x11_window_class_init (GdkX11WindowClass *x11_window_class) +gdk_x11_surface_class_init (GdkX11SurfaceClass *x11_surface_class) { } static void -gdk_x11_window_init (GdkX11Window *x11_window) +gdk_x11_surface_init (GdkX11Surface *x11_surface) { } -G_DEFINE_TYPE (GdkWindowImplX11, gdk_window_impl_x11, GDK_TYPE_WINDOW_IMPL) +G_DEFINE_TYPE (GdkSurfaceImplX11, gdk_surface_impl_x11, GDK_TYPE_SURFACE_IMPL) static void -gdk_window_impl_x11_init (GdkWindowImplX11 *impl) +gdk_surface_impl_x11_init (GdkSurfaceImplX11 *impl) { impl->window_scale = 1; impl->frame_sync_enabled = TRUE; } GdkToplevelX11 * -_gdk_x11_window_get_toplevel (GdkWindow *window) +_gdk_x11_surface_get_toplevel (GdkSurface *window) { - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); if (!WINDOW_IS_TOPLEVEL (window)) return NULL; - impl = GDK_WINDOW_IMPL_X11 (window->impl); + impl = GDK_SURFACE_IMPL_X11 (window->impl); if (!impl->toplevel) { @@ -179,14 +179,14 @@ _gdk_x11_window_get_toplevel (GdkWindow *window) } /** - * _gdk_x11_window_update_size: - * @impl: a #GdkWindowImplX11. + * _gdk_x11_surface_update_size: + * @impl: a #GdkSurfaceImplX11. * * Updates the state of the window (in particular the drawable's * cairo surface) when its size has changed. **/ void -_gdk_x11_window_update_size (GdkWindowImplX11 *impl) +_gdk_x11_surface_update_size (GdkSurfaceImplX11 *impl) { if (impl->cairo_surface) { @@ -196,11 +196,11 @@ _gdk_x11_window_update_size (GdkWindowImplX11 *impl) } static void -gdk_x11_window_get_unscaled_size (GdkWindow *window, +gdk_x11_surface_get_unscaled_size (GdkSurface *window, int *unscaled_width, int *unscaled_height) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); if (unscaled_width) *unscaled_width = impl->unscaled_width; @@ -210,9 +210,9 @@ gdk_x11_window_get_unscaled_size (GdkWindow *window, } static gboolean -gdk_x11_window_supports_edge_constraints (GdkWindow *window) +gdk_x11_surface_supports_edge_constraints (GdkSurface *window) { - return gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window), + return gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window), g_intern_static_string ("_GTK_EDGE_CONSTRAINTS")); } @@ -230,21 +230,21 @@ set_sync_counter(Display *display, } static void -window_pre_damage (GdkWindow *window) +window_pre_damage (GdkSurface *window) { - GdkWindow *toplevel_window = gdk_window_get_toplevel (window); - GdkWindowImplX11 *impl; + GdkSurface *toplevel_window = gdk_surface_get_toplevel (window); + GdkSurfaceImplX11 *impl; if (!toplevel_window || !WINDOW_IS_TOPLEVEL (toplevel_window)) return; - impl = GDK_WINDOW_IMPL_X11 (toplevel_window->impl); + impl = GDK_SURFACE_IMPL_X11 (toplevel_window->impl); if (impl->toplevel->in_frame && impl->toplevel->current_counter_value % 2 == 0) { impl->toplevel->current_counter_value += 1; - set_sync_counter (GDK_WINDOW_XDISPLAY (impl->wrapper), + set_sync_counter (GDK_SURFACE_XDISPLAY (impl->wrapper), impl->toplevel->extended_update_counter, impl->toplevel->current_counter_value); } @@ -253,8 +253,8 @@ window_pre_damage (GdkWindow *window) static void on_surface_changed (void *data) { - GdkWindow *window = data; - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurface *window = data; + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); if (impl->tracking_damage) window_pre_damage (window); @@ -270,9 +270,9 @@ on_surface_changed (void *data) */ static void -hook_surface_changed (GdkWindow *window) +hook_surface_changed (GdkSurface *window) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); if (impl->cairo_surface) { @@ -287,9 +287,9 @@ hook_surface_changed (GdkWindow *window) } static void -unhook_surface_changed (GdkWindow *window) +unhook_surface_changed (GdkSurface *window) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); if (impl->cairo_surface) { @@ -302,9 +302,9 @@ unhook_surface_changed (GdkWindow *window) } static void -gdk_x11_window_predict_presentation_time (GdkWindow *window) +gdk_x11_surface_predict_presentation_time (GdkSurface *window) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); GdkFrameClock *clock; GdkFrameTimings *timings; gint64 presentation_time; @@ -313,7 +313,7 @@ gdk_x11_window_predict_presentation_time (GdkWindow *window) if (!WINDOW_IS_TOPLEVEL (window)) return; - clock = gdk_window_get_frame_clock (window); + clock = gdk_surface_get_frame_clock (window); timings = gdk_frame_clock_get_current_timings (clock); @@ -348,14 +348,14 @@ gdk_x11_window_predict_presentation_time (GdkWindow *window) } static void -gdk_x11_window_begin_frame (GdkWindow *window, +gdk_x11_surface_begin_frame (GdkSurface *window, gboolean force_frame) { - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - impl = GDK_WINDOW_IMPL_X11 (window->impl); + impl = GDK_SURFACE_IMPL_X11 (window->impl); if (!WINDOW_IS_TOPLEVEL (window) || impl->toplevel->extended_update_counter == None) @@ -388,32 +388,32 @@ gdk_x11_window_begin_frame (GdkWindow *window, } static void -gdk_x11_window_end_frame (GdkWindow *window) +gdk_x11_surface_end_frame (GdkSurface *window) { GdkFrameClock *clock; GdkFrameTimings *timings; - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - impl = GDK_WINDOW_IMPL_X11 (window->impl); + impl = GDK_SURFACE_IMPL_X11 (window->impl); if (!WINDOW_IS_TOPLEVEL (window) || impl->toplevel->extended_update_counter == None || !impl->toplevel->in_frame) return; - clock = gdk_window_get_frame_clock (window); + clock = gdk_surface_get_frame_clock (window); timings = gdk_frame_clock_get_current_timings (clock); impl->toplevel->in_frame = FALSE; if (impl->toplevel->current_counter_value % 2 == 1) { - if (GDK_DISPLAY_DEBUG_CHECK (gdk_window_get_display (window), FRAMES)) + if (GDK_DISPLAY_DEBUG_CHECK (gdk_surface_get_display (window), FRAMES)) { - XImage *image = XGetImage (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + XImage *image = XGetImage (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), 0, 0, 1, 1, (1 << 24) - 1, ZPixmap); @@ -429,16 +429,16 @@ gdk_x11_window_end_frame (GdkWindow *window) else impl->toplevel->current_counter_value += 1; - set_sync_counter(GDK_WINDOW_XDISPLAY (impl->wrapper), + set_sync_counter(GDK_SURFACE_XDISPLAY (impl->wrapper), impl->toplevel->extended_update_counter, impl->toplevel->current_counter_value); if (impl->frame_sync_enabled && - gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window), + gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window), g_intern_static_string ("_NET_WM_FRAME_DRAWN"))) { impl->toplevel->frame_pending = TRUE; - _gdk_frame_clock_freeze (gdk_window_get_frame_clock (window)); + _gdk_frame_clock_freeze (gdk_surface_get_frame_clock (window)); timings->cookie = impl->toplevel->current_counter_value; } } @@ -448,7 +448,7 @@ gdk_x11_window_end_frame (GdkWindow *window) if (impl->toplevel->configure_counter_value != 0 && !impl->toplevel->configure_counter_value_is_extended) { - set_sync_counter (GDK_WINDOW_XDISPLAY (window), + set_sync_counter (GDK_SURFACE_XDISPLAY (window), impl->toplevel->update_counter, impl->toplevel->configure_counter_value); @@ -464,32 +464,32 @@ gdk_x11_window_end_frame (GdkWindow *window) *****************************************************/ static cairo_surface_t * -gdk_x11_create_cairo_surface (GdkWindowImplX11 *impl, +gdk_x11_create_cairo_surface (GdkSurfaceImplX11 *impl, int width, int height) { Visual *visual; - visual = gdk_x11_display_get_window_visual (GDK_X11_DISPLAY (gdk_window_get_display (impl->wrapper))); - return cairo_xlib_surface_create (GDK_WINDOW_XDISPLAY (impl->wrapper), - GDK_WINDOW_IMPL_X11 (impl)->xid, + visual = gdk_x11_display_get_window_visual (GDK_X11_DISPLAY (gdk_surface_get_display (impl->wrapper))); + return cairo_xlib_surface_create (GDK_SURFACE_XDISPLAY (impl->wrapper), + GDK_SURFACE_IMPL_X11 (impl)->xid, visual, width, height); } static cairo_surface_t * -gdk_x11_ref_cairo_surface (GdkWindow *window) +gdk_x11_ref_cairo_surface (GdkSurface *window) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return NULL; if (!impl->cairo_surface) { impl->cairo_surface = gdk_x11_create_cairo_surface (impl, - gdk_window_get_width (window) * impl->window_scale, - gdk_window_get_height (window) * impl->window_scale); + gdk_surface_get_width (window) * impl->window_scale, + gdk_surface_get_height (window) * impl->window_scale); cairo_surface_set_device_scale (impl->cairo_surface, impl->window_scale, impl->window_scale); if (WINDOW_IS_TOPLEVEL (window) && impl->toplevel->in_frame) @@ -502,25 +502,25 @@ gdk_x11_ref_cairo_surface (GdkWindow *window) } static void -gdk_window_impl_x11_finalize (GObject *object) +gdk_surface_impl_x11_finalize (GObject *object) { - GdkWindow *wrapper; - GdkWindowImplX11 *impl; + GdkSurface *wrapper; + GdkSurfaceImplX11 *impl; - g_return_if_fail (GDK_IS_WINDOW_IMPL_X11 (object)); + g_return_if_fail (GDK_IS_SURFACE_IMPL_X11 (object)); - impl = GDK_WINDOW_IMPL_X11 (object); + impl = GDK_SURFACE_IMPL_X11 (object); wrapper = impl->wrapper; if (WINDOW_IS_TOPLEVEL (wrapper) && impl->toplevel->in_frame) unhook_surface_changed (wrapper); - _gdk_x11_window_grab_check_destroy (wrapper); + _gdk_x11_surface_grab_check_destroy (wrapper); - if (!GDK_WINDOW_DESTROYED (wrapper)) + if (!GDK_SURFACE_DESTROYED (wrapper)) { - GdkDisplay *display = GDK_WINDOW_DISPLAY (wrapper); + GdkDisplay *display = GDK_SURFACE_DISPLAY (wrapper); _gdk_x11_display_remove_window (display, impl->xid); if (impl->toplevel && impl->toplevel->focus_window) @@ -532,7 +532,7 @@ gdk_window_impl_x11_finalize (GObject *object) if (impl->cursor) g_object_unref (impl->cursor); - G_OBJECT_CLASS (gdk_window_impl_x11_parent_class)->finalize (object); + G_OBJECT_CLASS (gdk_surface_impl_x11_parent_class)->finalize (object); } typedef struct { @@ -597,7 +597,7 @@ _gdk_x11_display_create_bitmap_surface (GdkDisplay *display, /* Create a surface backed with a pixmap without alpha on the same screen as window */ static cairo_surface_t * -gdk_x11_window_create_pixmap_surface (GdkWindow *window, +gdk_x11_surface_create_pixmap_surface (GdkSurface *window, int width, int height) { @@ -606,11 +606,11 @@ gdk_x11_window_create_pixmap_surface (GdkWindow *window, cairo_surface_t *surface; Pixmap pixmap; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); dpy = GDK_DISPLAY_XDISPLAY (display); pixmap = XCreatePixmap (dpy, - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), width, height, DefaultDepth (dpy, DefaultScreen (dpy))); surface = cairo_xlib_surface_create (dpy, @@ -623,9 +623,9 @@ gdk_x11_window_create_pixmap_surface (GdkWindow *window, } static void -set_wm_protocols (GdkWindow *window) +set_wm_protocols (GdkSurface *window) { - GdkDisplay *display = gdk_window_get_display (window); + GdkDisplay *display = gdk_surface_get_display (window); Atom protocols[4]; int n = 0; @@ -638,7 +638,7 @@ set_wm_protocols (GdkWindow *window) protocols[n++] = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_SYNC_REQUEST"); #endif - XSetWMProtocols (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), protocols, n); + XSetWMProtocols (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window), protocols, n); } static const gchar * @@ -704,13 +704,13 @@ create_focus_window (GdkDisplay *display, } static void -ensure_sync_counter (GdkWindow *window) +ensure_sync_counter (GdkSurface *window) { #ifdef HAVE_XSYNC - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { - GdkDisplay *display = GDK_WINDOW_DISPLAY (window); - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); + GdkDisplay *display = GDK_SURFACE_DISPLAY (window); + GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window); if (toplevel && toplevel->update_counter == None && @@ -731,7 +731,7 @@ ensure_sync_counter (GdkWindow *window) counters[0] = toplevel->update_counter; counters[1] = toplevel->extended_update_counter; - XChangeProperty (xdisplay, GDK_WINDOW_XID (window), + XChangeProperty (xdisplay, GDK_SURFACE_XID (window), atom, XA_CARDINAL, 32, PropModeReplace, (guchar *)counters, 2); @@ -743,14 +743,14 @@ ensure_sync_counter (GdkWindow *window) } static void -setup_toplevel_window (GdkWindow *window, +setup_toplevel_window (GdkSurface *window, GdkX11Screen *x11_screen) { - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); - GdkDisplay *display = gdk_window_get_display (window); - Display *xdisplay = GDK_WINDOW_XDISPLAY (window); - XID xid = GDK_WINDOW_XID (window); + GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); + GdkDisplay *display = gdk_surface_get_display (window); + Display *xdisplay = GDK_SURFACE_XDISPLAY (window); + XID xid = GDK_SURFACE_XID (window); XSizeHints size_hints; long pid; Window leader_window; @@ -805,41 +805,41 @@ setup_toplevel_window (GdkWindow *window, (guchar *) &toplevel->focus_window, 1); if (!window->focus_on_map) - gdk_x11_window_set_user_time (window, 0); + gdk_x11_surface_set_user_time (window, 0); else if (GDK_X11_DISPLAY (x11_screen->display)->user_time != 0) - gdk_x11_window_set_user_time (window, GDK_X11_DISPLAY (x11_screen->display)->user_time); + gdk_x11_surface_set_user_time (window, GDK_X11_DISPLAY (x11_screen->display)->user_time); ensure_sync_counter (window); /* Start off in a frozen state - we'll finish this when we first paint */ - gdk_x11_window_begin_frame (window, TRUE); + gdk_x11_surface_begin_frame (window, TRUE); } static void on_frame_clock_before_paint (GdkFrameClock *clock, - GdkWindow *window) + GdkSurface *window) { - gdk_x11_window_predict_presentation_time (window); - gdk_x11_window_begin_frame (window, FALSE); + gdk_x11_surface_predict_presentation_time (window); + gdk_x11_surface_begin_frame (window, FALSE); } static void on_frame_clock_after_paint (GdkFrameClock *clock, - GdkWindow *window) + GdkSurface *window) { - gdk_x11_window_end_frame (window); + gdk_x11_surface_end_frame (window); } static void -connect_frame_clock (GdkWindow *window) +connect_frame_clock (GdkSurface *window) { - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; - impl = GDK_WINDOW_IMPL_X11 (window->impl); + impl = GDK_SURFACE_IMPL_X11 (window->impl); if (WINDOW_IS_TOPLEVEL (window) && !impl->frame_clock_connected) { - GdkFrameClock *frame_clock = gdk_window_get_frame_clock (window); + GdkFrameClock *frame_clock = gdk_surface_get_frame_clock (window); g_signal_connect (frame_clock, "before-paint", G_CALLBACK (on_frame_clock_before_paint), window); @@ -852,12 +852,12 @@ connect_frame_clock (GdkWindow *window) void _gdk_x11_display_create_window_impl (GdkDisplay *display, - GdkWindow *window, - GdkWindow *real_parent, + GdkSurface *window, + GdkSurface *real_parent, GdkEventMask event_mask, - GdkWindowAttr *attributes) + GdkSurfaceAttr *attributes) { - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; GdkX11Screen *x11_screen; GdkX11Display *display_x11; @@ -878,13 +878,13 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display, display_x11 = GDK_X11_DISPLAY (display); x11_screen = GDK_X11_SCREEN (display_x11->screen); if (real_parent) - xparent = GDK_WINDOW_XID (real_parent); + xparent = GDK_SURFACE_XID (real_parent); else xparent = GDK_SCREEN_XROOTWIN (x11_screen); - impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL); - window->impl = GDK_WINDOW_IMPL (impl); - impl->wrapper = GDK_WINDOW (window); + impl = g_object_new (GDK_TYPE_SURFACE_IMPL_X11, NULL); + window->impl = GDK_SURFACE_IMPL (impl); + impl->wrapper = GDK_SURFACE (window); impl->window_scale = x11_screen->window_scale; xdisplay = x11_screen->xdisplay; @@ -898,8 +898,8 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display, /* Sanity checks */ switch (window->window_type) { - case GDK_WINDOW_TOPLEVEL: - case GDK_WINDOW_TEMP: + case GDK_SURFACE_TOPLEVEL: + case GDK_SURFACE_TEMP: if (window->parent) { /* The common code warns for this case */ @@ -907,7 +907,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display, } break; - case GDK_WINDOW_CHILD: + case GDK_SURFACE_CHILD: default: g_assert_not_reached (); break; @@ -928,7 +928,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display, xattributes.colormap = gdk_x11_display_get_window_colormap (display_x11); xattributes_mask |= CWColormap; - if (window->window_type == GDK_WINDOW_TEMP) + if (window->window_type == GDK_SURFACE_TEMP) { xattributes.save_under = True; xattributes.override_redirect = True; @@ -944,7 +944,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display, { class = InputOnly; - if (window->window_type == GDK_WINDOW_TEMP) + if (window->window_type == GDK_SURFACE_TEMP) { xattributes.override_redirect = True; xattributes_mask |= CWOverrideRedirect; @@ -990,11 +990,11 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display, g_object_ref (window); _gdk_x11_display_add_window (x11_screen->display, &impl->xid, window); - switch (GDK_WINDOW_TYPE (window)) + switch (GDK_SURFACE_TYPE (window)) { - case GDK_WINDOW_TOPLEVEL: - case GDK_WINDOW_TEMP: - gdk_window_set_title (window, get_default_title ()); + case GDK_SURFACE_TOPLEVEL: + case GDK_SURFACE_TEMP: + gdk_surface_set_title (window, get_default_title ()); class_hint = XAllocClassHint (); class_hint->res_name = (char *) g_get_prgname (); @@ -1005,18 +1005,18 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display, setup_toplevel_window (window, x11_screen); break; - case GDK_WINDOW_CHILD: + case GDK_SURFACE_CHILD: default: break; } gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source, - GDK_WINDOW_XID (window), event_mask, + GDK_SURFACE_XID (window), event_mask, StructureNotifyMask | PropertyChangeMask); connect_frame_clock (window); - gdk_window_freeze_toplevel_updates (window); + gdk_surface_freeze_toplevel_updates (window); } static GdkEventMask @@ -1035,29 +1035,29 @@ x_event_mask_to_gdk_event_mask (long mask) } /** - * gdk_x11_window_foreign_new_for_display: + * gdk_x11_surface_foreign_new_for_display: * @display: (type GdkX11Display): the #GdkDisplay where the window handle comes from. * @window: an Xlib Window * - * Wraps a native window in a #GdkWindow. The function will try to - * look up the window using gdk_x11_window_lookup_for_display() first. + * Wraps a native window in a #GdkSurface. The function will try to + * look up the window using gdk_x11_surface_lookup_for_display() first. * If it does not find it there, it will create a new window. * * This may fail if the window has been destroyed. If the window * was already known to GDK, a new reference to the existing - * #GdkWindow is returned. + * #GdkSurface is returned. * - * Returns: (transfer full): a #GdkWindow wrapper for the native + * Returns: (transfer full): a #GdkSurface wrapper for the native * window, or %NULL if the window has been destroyed. The wrapper * will be newly created, if one doesn’t exist already. */ -GdkWindow * -gdk_x11_window_foreign_new_for_display (GdkDisplay *display, +GdkSurface * +gdk_x11_surface_foreign_new_for_display (GdkDisplay *display, Window window) { GdkX11Screen *screen; - GdkWindow *win; - GdkWindowImplX11 *impl; + GdkSurface *win; + GdkSurfaceImplX11 *impl; GdkX11Display *display_x11; XWindowAttributes attrs; Window root, parent; @@ -1069,7 +1069,7 @@ gdk_x11_window_foreign_new_for_display (GdkDisplay *display, display_x11 = GDK_X11_DISPLAY (display); - if ((win = gdk_x11_window_lookup_for_display (display, window)) != NULL) + if ((win = gdk_x11_surface_lookup_for_display (display, window)) != NULL) return g_object_ref (win); gdk_x11_display_error_trap_push (display); @@ -1093,10 +1093,10 @@ gdk_x11_window_foreign_new_for_display (GdkDisplay *display, return NULL; win = _gdk_display_create_window (display); - win->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL); + win->impl = g_object_new (GDK_TYPE_SURFACE_IMPL_X11, NULL); win->impl_window = win; - impl = GDK_WINDOW_IMPL_X11 (win->impl); + impl = GDK_SURFACE_IMPL_X11 (win->impl); impl->wrapper = win; impl->window_scale = GDK_X11_SCREEN (screen)->window_scale; @@ -1111,22 +1111,22 @@ gdk_x11_window_foreign_new_for_display (GdkDisplay *display, impl->unscaled_height = attrs.height; win->width = attrs.width / impl->window_scale; win->height = attrs.height / impl->window_scale; - win->window_type = GDK_WINDOW_FOREIGN; + win->window_type = GDK_SURFACE_FOREIGN; win->destroyed = FALSE; win->event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask); if (attrs.map_state == IsUnmapped) - win->state = GDK_WINDOW_STATE_WITHDRAWN; + win->state = GDK_SURFACE_STATE_WITHDRAWN; else win->state = 0; win->viewable = TRUE; g_object_ref (win); - _gdk_x11_display_add_window (display, &GDK_WINDOW_XID (win), win); + _gdk_x11_display_add_window (display, &GDK_SURFACE_XID (win), win); /* Update the clip region, etc */ - _gdk_window_update_size (win); + _gdk_surface_update_size (win); return win; } @@ -1166,18 +1166,18 @@ gdk_toplevel_x11_free_contents (GdkDisplay *display, } static void -gdk_x11_window_destroy (GdkWindow *window, +gdk_x11_surface_destroy (GdkSurface *window, gboolean recursing, gboolean foreign_destroy) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); GdkToplevelX11 *toplevel; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - toplevel = _gdk_x11_window_get_toplevel (window); + toplevel = _gdk_x11_surface_get_toplevel (window); if (toplevel) - gdk_toplevel_x11_free_contents (GDK_WINDOW_DISPLAY (window), toplevel); + gdk_toplevel_x11_free_contents (GDK_SURFACE_DISPLAY (window), toplevel); unhook_surface_changed (window); @@ -1189,53 +1189,53 @@ gdk_x11_window_destroy (GdkWindow *window, } if (!recursing && !foreign_destroy) - XDestroyWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window)); + XDestroyWindow (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window)); } /* This function is called when the XWindow is really gone. */ static void -gdk_x11_window_destroy_notify (GdkWindow *window) +gdk_x11_surface_destroy_notify (GdkSurface *window) { - GdkWindowImplX11 *window_impl; + GdkSurfaceImplX11 *window_impl; - window_impl = GDK_WINDOW_IMPL_X11 ((window)->impl); + window_impl = GDK_SURFACE_IMPL_X11 ((window)->impl); - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { - if (GDK_WINDOW_TYPE(window) != GDK_WINDOW_FOREIGN) - g_warning ("GdkWindow %#lx unexpectedly destroyed", GDK_WINDOW_XID (window)); + if (GDK_SURFACE_TYPE(window) != GDK_SURFACE_FOREIGN) + g_warning ("GdkSurface %#lx unexpectedly destroyed", GDK_SURFACE_XID (window)); - _gdk_window_destroy (window, TRUE); + _gdk_surface_destroy (window, TRUE); } - _gdk_x11_display_remove_window (GDK_WINDOW_DISPLAY (window), GDK_WINDOW_XID (window)); + _gdk_x11_display_remove_window (GDK_SURFACE_DISPLAY (window), GDK_SURFACE_XID (window)); if (window_impl->toplevel && window_impl->toplevel->focus_window) - _gdk_x11_display_remove_window (GDK_WINDOW_DISPLAY (window), window_impl->toplevel->focus_window); + _gdk_x11_display_remove_window (GDK_SURFACE_DISPLAY (window), window_impl->toplevel->focus_window); - _gdk_x11_window_grab_check_destroy (window); + _gdk_x11_surface_grab_check_destroy (window); g_object_unref (window); } static void -update_wm_hints (GdkWindow *window, +update_wm_hints (GdkSurface *window, gboolean force) { - GdkToplevelX11 *toplevel = _gdk_x11_window_get_toplevel (window); - GdkDisplay *display = GDK_WINDOW_DISPLAY (window); + GdkToplevelX11 *toplevel = _gdk_x11_surface_get_toplevel (window); + GdkDisplay *display = GDK_SURFACE_DISPLAY (window); XWMHints wm_hints; if (!force && !toplevel->is_leader && - window->state & GDK_WINDOW_STATE_WITHDRAWN) + window->state & GDK_SURFACE_STATE_WITHDRAWN) return; wm_hints.flags = StateHint | InputHint; wm_hints.input = window->accept_focus ? True : False; wm_hints.initial_state = NormalState; - if (window->state & GDK_WINDOW_STATE_ICONIFIED) + if (window->state & GDK_SURFACE_STATE_ICONIFIED) { wm_hints.flags |= StateHint; wm_hints.initial_state = IconicState; @@ -1254,10 +1254,10 @@ update_wm_hints (GdkWindow *window, } wm_hints.flags |= WindowGroupHint; - if (toplevel->group_leader && !GDK_WINDOW_DESTROYED (toplevel->group_leader)) + if (toplevel->group_leader && !GDK_SURFACE_DESTROYED (toplevel->group_leader)) { wm_hints.flags |= WindowGroupHint; - wm_hints.window_group = GDK_WINDOW_XID (toplevel->group_leader); + wm_hints.window_group = GDK_SURFACE_XID (toplevel->group_leader); } else wm_hints.window_group = GDK_X11_DISPLAY (display)->leader_window; @@ -1265,22 +1265,22 @@ update_wm_hints (GdkWindow *window, if (toplevel->urgency_hint) wm_hints.flags |= XUrgencyHint; - XSetWMHints (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + XSetWMHints (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), &wm_hints); } static void -set_initial_hints (GdkWindow *window) +set_initial_hints (GdkSurface *window) { - GdkDisplay *display = GDK_WINDOW_DISPLAY (window); + GdkDisplay *display = GDK_SURFACE_DISPLAY (window); Display *xdisplay = GDK_DISPLAY_XDISPLAY (display); - Window xwindow = GDK_WINDOW_XID (window); + Window xwindow = GDK_SURFACE_XID (window); GdkToplevelX11 *toplevel; Atom atoms[9]; gint i; - toplevel = _gdk_x11_window_get_toplevel (window); + toplevel = _gdk_x11_surface_get_toplevel (window); if (!toplevel) return; @@ -1294,7 +1294,7 @@ set_initial_hints (GdkWindow *window) i = 0; - if (window->state & GDK_WINDOW_STATE_MAXIMIZED) + if (window->state & GDK_SURFACE_STATE_MAXIMIZED) { atoms[i] = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_MAXIMIZED_VERT"); @@ -1305,21 +1305,21 @@ set_initial_hints (GdkWindow *window) toplevel->have_maxhorz = toplevel->have_maxvert = TRUE; } - if (window->state & GDK_WINDOW_STATE_ABOVE) + if (window->state & GDK_SURFACE_STATE_ABOVE) { atoms[i] = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_ABOVE"); ++i; } - if (window->state & GDK_WINDOW_STATE_BELOW) + if (window->state & GDK_SURFACE_STATE_BELOW) { atoms[i] = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_BELOW"); ++i; } - if (window->state & GDK_WINDOW_STATE_STICKY) + if (window->state & GDK_SURFACE_STATE_STICKY) { atoms[i] = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_STICKY"); @@ -1327,7 +1327,7 @@ set_initial_hints (GdkWindow *window) toplevel->have_sticky = TRUE; } - if (window->state & GDK_WINDOW_STATE_FULLSCREEN) + if (window->state & GDK_SURFACE_STATE_FULLSCREEN) { atoms[i] = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_FULLSCREEN"); @@ -1356,7 +1356,7 @@ set_initial_hints (GdkWindow *window) ++i; } - if (window->state & GDK_WINDOW_STATE_ICONIFIED) + if (window->state & GDK_SURFACE_STATE_ICONIFIED) { atoms[i] = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_HIDDEN"); @@ -1379,7 +1379,7 @@ set_initial_hints (GdkWindow *window) gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE")); } - if (window->state & GDK_WINDOW_STATE_STICKY) + if (window->state & GDK_SURFACE_STATE_STICKY) { atoms[0] = 0xFFFFFFFF; XChangeProperty (xdisplay, @@ -1400,27 +1400,27 @@ set_initial_hints (GdkWindow *window) } static void -gdk_window_x11_show (GdkWindow *window, gboolean already_mapped) +gdk_surface_x11_show (GdkSurface *window, gboolean already_mapped) { GdkDisplay *display; GdkX11Display *display_x11; GdkToplevelX11 *toplevel; - Display *xdisplay = GDK_WINDOW_XDISPLAY (window); - Window xwindow = GDK_WINDOW_XID (window); + Display *xdisplay = GDK_SURFACE_XDISPLAY (window); + Window xwindow = GDK_SURFACE_XID (window); if (!already_mapped) set_initial_hints (window); if (WINDOW_IS_TOPLEVEL (window)) { - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); display_x11 = GDK_X11_DISPLAY (display); - toplevel = _gdk_x11_window_get_toplevel (window); + toplevel = _gdk_x11_surface_get_toplevel (window); if (toplevel->user_time != 0 && display_x11->user_time != 0 && XSERVER_TIME_IS_LATER (display_x11->user_time, toplevel->user_time)) - gdk_x11_window_set_user_time (window, display_x11->user_time); + gdk_x11_surface_set_user_time (window, display_x11->user_time); } XMapWindow (xdisplay, xwindow); @@ -1430,65 +1430,65 @@ gdk_window_x11_show (GdkWindow *window, gboolean already_mapped) * consistent with pre-fullscreen mode implementation. */ if (window->fullscreen_mode != GDK_FULLSCREEN_ON_CURRENT_MONITOR) - gdk_x11_window_apply_fullscreen_mode (window); + gdk_x11_surface_apply_fullscreen_mode (window); } static void -gdk_window_x11_hide (GdkWindow *window) +gdk_surface_x11_hide (GdkSurface *window) { /* We'll get the unmap notify eventually, and handle it then, * but checking here makes things more consistent if we are * just doing stuff ourself. */ - _gdk_x11_window_grab_check_unmap (window, - NextRequest (GDK_WINDOW_XDISPLAY (window))); + _gdk_x11_surface_grab_check_unmap (window, + NextRequest (GDK_SURFACE_XDISPLAY (window))); /* You can't simply unmap toplevel windows. */ switch (window->window_type) { - case GDK_WINDOW_TOPLEVEL: - case GDK_WINDOW_TEMP: /* ? */ - gdk_window_withdraw (window); + case GDK_SURFACE_TOPLEVEL: + case GDK_SURFACE_TEMP: /* ? */ + gdk_surface_withdraw (window); return; - case GDK_WINDOW_FOREIGN: - case GDK_WINDOW_CHILD: + case GDK_SURFACE_FOREIGN: + case GDK_SURFACE_CHILD: default: break; } - _gdk_window_clear_update_area (window); + _gdk_surface_clear_update_area (window); - XUnmapWindow (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window)); + XUnmapWindow (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window)); } static void -gdk_window_x11_withdraw (GdkWindow *window) +gdk_surface_x11_withdraw (GdkSurface *window) { if (!window->destroyed) { - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) gdk_synthesize_window_state (window, 0, - GDK_WINDOW_STATE_WITHDRAWN); + GDK_SURFACE_STATE_WITHDRAWN); - g_assert (!GDK_WINDOW_IS_MAPPED (window)); + g_assert (!GDK_SURFACE_IS_MAPPED (window)); - XWithdrawWindow (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), 0); + XWithdrawWindow (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), 0); } } static inline void -window_x11_move (GdkWindow *window, +window_x11_move (GdkSurface *window, gint x, gint y) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); - XMoveWindow (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + XMoveWindow (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), x * impl->window_scale, y * impl->window_scale); if (impl->override_redirect) @@ -1499,11 +1499,11 @@ window_x11_move (GdkWindow *window, } static inline void -window_x11_resize (GdkWindow *window, +window_x11_resize (GdkSurface *window, gint width, gint height) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); if (width < 1) width = 1; @@ -1513,8 +1513,8 @@ window_x11_resize (GdkWindow *window, window_pre_damage (window); - XResizeWindow (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + XResizeWindow (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), width * impl->window_scale, height * impl->window_scale); if (impl->override_redirect) @@ -1523,7 +1523,7 @@ window_x11_resize (GdkWindow *window, impl->unscaled_height = height * impl->window_scale; window->width = width; window->height = height; - _gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl)); + _gdk_x11_surface_update_size (GDK_SURFACE_IMPL_X11 (window->impl)); } else { @@ -1533,13 +1533,13 @@ window_x11_resize (GdkWindow *window, } static inline void -window_x11_move_resize (GdkWindow *window, +window_x11_move_resize (GdkSurface *window, gint x, gint y, gint width, gint height) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); if (width < 1) width = 1; @@ -1549,8 +1549,8 @@ window_x11_move_resize (GdkWindow *window, window_pre_damage (window); - XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + XMoveResizeWindow (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), x * impl->window_scale, y * impl->window_scale, width * impl->window_scale, height * impl->window_scale); @@ -1564,7 +1564,7 @@ window_x11_move_resize (GdkWindow *window, window->width = width; window->height = height; - _gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl)); + _gdk_x11_surface_update_size (GDK_SURFACE_IMPL_X11 (window->impl)); } else { @@ -1574,7 +1574,7 @@ window_x11_move_resize (GdkWindow *window, } static void -gdk_window_x11_move_resize (GdkWindow *window, +gdk_surface_x11_move_resize (GdkSurface *window, gboolean with_move, gint x, gint y, @@ -1593,35 +1593,35 @@ gdk_window_x11_move_resize (GdkWindow *window, } void -_gdk_x11_window_set_window_scale (GdkWindow *window, +_gdk_x11_surface_set_window_scale (GdkSurface *window, int scale) { - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; GdkToplevelX11 *toplevel; - GdkWindowHints geom_mask; + GdkSurfaceHints geom_mask; - impl = GDK_WINDOW_IMPL_X11 (window->impl); + impl = GDK_SURFACE_IMPL_X11 (window->impl); impl->window_scale = scale; if (impl->cairo_surface) cairo_surface_set_device_scale (impl->cairo_surface, impl->window_scale, impl->window_scale); - _gdk_window_update_size (window); + _gdk_surface_update_size (window); - toplevel = _gdk_x11_window_get_toplevel (window); - if (toplevel && window->window_type != GDK_WINDOW_FOREIGN) + toplevel = _gdk_x11_surface_get_toplevel (window); + if (toplevel && window->window_type != GDK_SURFACE_FOREIGN) { /* These are affected by window scale: */ geom_mask = toplevel->last_geometry_hints_mask & (GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE | GDK_HINT_BASE_SIZE | GDK_HINT_RESIZE_INC); if (geom_mask) - gdk_window_set_geometry_hints (window, + gdk_surface_set_geometry_hints (window, &toplevel->last_geometry_hints, geom_mask); } - if (window->window_type == GDK_WINDOW_FOREIGN) - XMoveWindow (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + if (window->window_type == GDK_SURFACE_FOREIGN) + XMoveWindow (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), window->x * impl->window_scale, window->y * impl->window_scale); else @@ -1632,45 +1632,45 @@ _gdk_x11_window_set_window_scale (GdkWindow *window, impl->unscaled_height = window->height * impl->window_scale; } - XResizeWindow (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + XResizeWindow (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), window->width * impl->window_scale, window->height * impl->window_scale); } - gdk_window_invalidate_rect (window, NULL, TRUE); + gdk_surface_invalidate_rect (window, NULL, TRUE); } static void -gdk_window_x11_raise (GdkWindow *window) +gdk_surface_x11_raise (GdkSurface *window) { - XRaiseWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window)); + XRaiseWindow (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window)); } static void -gdk_window_x11_restack_toplevel (GdkWindow *window, - GdkWindow *sibling, +gdk_surface_x11_restack_toplevel (GdkSurface *window, + GdkSurface *sibling, gboolean above) { XWindowChanges changes; - changes.sibling = GDK_WINDOW_XID (sibling); + changes.sibling = GDK_SURFACE_XID (sibling); changes.stack_mode = above ? Above : Below; - XReconfigureWMWindow (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), - gdk_x11_screen_get_screen_number (GDK_WINDOW_SCREEN (window)), + XReconfigureWMWindow (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), + gdk_x11_screen_get_screen_number (GDK_SURFACE_SCREEN (window)), CWStackMode | CWSibling, &changes); } static void -gdk_window_x11_lower (GdkWindow *window) +gdk_surface_x11_lower (GdkSurface *window) { - XLowerWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window)); + XLowerWindow (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window)); } /** - * gdk_x11_window_move_to_current_desktop: - * @window: (type GdkX11Window): a #GdkWindow + * gdk_x11_surface_move_to_current_desktop: + * @window: (type GdkX11Surface): a #GdkSurface * * Moves the window to the correct workspace when running under a * window manager that supports multiple workspaces, as described @@ -1678,14 +1678,14 @@ gdk_window_x11_lower (GdkWindow *window) * Will not do anything if the window is already on all workspaces. */ void -gdk_x11_window_move_to_current_desktop (GdkWindow *window) +gdk_x11_surface_move_to_current_desktop (GdkSurface *window) { GdkToplevelX11 *toplevel; - g_return_if_fail (GDK_IS_WINDOW (window)); - g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD); + g_return_if_fail (GDK_IS_SURFACE (window)); + g_return_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD); - toplevel = _gdk_x11_window_get_toplevel (window); + toplevel = _gdk_x11_surface_get_toplevel (window); if (toplevel->on_all_desktops) return; @@ -1694,19 +1694,19 @@ gdk_x11_window_move_to_current_desktop (GdkWindow *window) } static void -move_to_current_desktop (GdkWindow *window) +move_to_current_desktop (GdkSurface *window) { guint32 desktop; - desktop = gdk_x11_screen_get_current_desktop (GDK_WINDOW_SCREEN (window)); - gdk_x11_window_move_to_desktop (window, desktop); + desktop = gdk_x11_screen_get_current_desktop (GDK_SURFACE_SCREEN (window)); + gdk_x11_surface_move_to_desktop (window, desktop); } static guint32 -get_netwm_cardinal_property (GdkWindow *window, +get_netwm_cardinal_property (GdkSurface *window, const gchar *name) { - GdkX11Screen *x11_screen = GDK_WINDOW_SCREEN (window); + GdkX11Screen *x11_screen = GDK_SURFACE_SCREEN (window); GdkAtom atom; guint32 prop = 0; Atom type; @@ -1721,8 +1721,8 @@ get_netwm_cardinal_property (GdkWindow *window, return 0; XGetWindowProperty (x11_screen->xdisplay, - GDK_WINDOW_XID (window), - gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_DISPLAY (window), name), + GDK_SURFACE_XID (window), + gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (window), name), 0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems, &bytes_after, &data); @@ -1736,24 +1736,24 @@ get_netwm_cardinal_property (GdkWindow *window, } /** - * gdk_x11_window_get_desktop: - * @window: (type GdkX11Window): a #GdkWindow + * gdk_x11_surface_get_desktop: + * @window: (type GdkX11Surface): a #GdkSurface * * Gets the number of the workspace @window is on. * * Returns: the current workspace of @window */ guint32 -gdk_x11_window_get_desktop (GdkWindow *window) +gdk_x11_surface_get_desktop (GdkSurface *window) { - g_return_val_if_fail (GDK_IS_WINDOW (window), 0); + g_return_val_if_fail (GDK_IS_SURFACE (window), 0); return get_netwm_cardinal_property (window, "_NET_WM_DESKTOP"); } /** - * gdk_x11_window_move_to_desktop: - * @window: (type GdkX11Window): a #GdkWindow + * gdk_x11_surface_move_to_desktop: + * @window: (type GdkX11Surface): a #GdkSurface * @desktop: the number of the workspace to move the window to * * Moves the window to the given workspace when running unde a @@ -1761,24 +1761,24 @@ gdk_x11_window_get_desktop (GdkWindow *window) * in the [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec) specification. */ void -gdk_x11_window_move_to_desktop (GdkWindow *window, +gdk_x11_surface_move_to_desktop (GdkSurface *window, guint32 desktop) { GdkAtom atom; XClientMessageEvent xclient; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); atom = g_intern_static_string ("_NET_WM_DESKTOP"); - if (!gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window), atom)) + if (!gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window), atom)) return; memset (&xclient, 0, sizeof (xclient)); xclient.type = ClientMessage; xclient.serial = 0; xclient.send_event = True; - xclient.window = GDK_WINDOW_XID (window); - xclient.message_type = gdk_x11_atom_to_xatom_for_display (GDK_WINDOW_DISPLAY (window), atom); + xclient.window = GDK_SURFACE_XID (window); + xclient.message_type = gdk_x11_atom_to_xatom_for_display (GDK_SURFACE_DISPLAY (window), atom); xclient.format = 32; xclient.data.l[0] = desktop; @@ -1787,35 +1787,35 @@ gdk_x11_window_move_to_desktop (GdkWindow *window, xclient.data.l[3] = 0; xclient.data.l[4] = 0; - XSendEvent (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XROOTWIN (window), + XSendEvent (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XROOTWIN (window), False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xclient); } static void -gdk_x11_window_focus (GdkWindow *window, +gdk_x11_surface_focus (GdkSurface *window, guint32 timestamp) { GdkDisplay *display; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - display = GDK_WINDOW_DISPLAY (window); + display = GDK_SURFACE_DISPLAY (window); - if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window), + if (gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window), g_intern_static_string ("_NET_ACTIVE_WINDOW"))) { XClientMessageEvent xclient; memset (&xclient, 0, sizeof (xclient)); xclient.type = ClientMessage; - xclient.window = GDK_WINDOW_XID (window); + xclient.window = GDK_SURFACE_XID (window); xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_NET_ACTIVE_WINDOW"); xclient.format = 32; @@ -1825,20 +1825,20 @@ gdk_x11_window_focus (GdkWindow *window, xclient.data.l[3] = 0; xclient.data.l[4] = 0; - XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XROOTWIN (window), False, + XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XROOTWIN (window), False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xclient); } else { - XRaiseWindow (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window)); + XRaiseWindow (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window)); /* There is no way of knowing reliably whether we are viewable; * so trap errors asynchronously around the XSetInputFocus call */ gdk_x11_display_error_trap_push (display); XSetInputFocus (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), RevertToParent, timestamp); gdk_x11_display_error_trap_pop_ignored (display); @@ -1846,95 +1846,95 @@ gdk_x11_window_focus (GdkWindow *window, } static void -gdk_x11_window_set_type_hint (GdkWindow *window, - GdkWindowTypeHint hint) +gdk_x11_surface_set_type_hint (GdkSurface *window, + GdkSurfaceTypeHint hint) { GdkDisplay *display; Atom atom; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); switch (hint) { - case GDK_WINDOW_TYPE_HINT_DIALOG: + case GDK_SURFACE_TYPE_HINT_DIALOG: atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DIALOG"); break; - case GDK_WINDOW_TYPE_HINT_MENU: + case GDK_SURFACE_TYPE_HINT_MENU: atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_MENU"); break; - case GDK_WINDOW_TYPE_HINT_TOOLBAR: + case GDK_SURFACE_TYPE_HINT_TOOLBAR: atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_TOOLBAR"); break; - case GDK_WINDOW_TYPE_HINT_UTILITY: + case GDK_SURFACE_TYPE_HINT_UTILITY: atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_UTILITY"); break; - case GDK_WINDOW_TYPE_HINT_SPLASHSCREEN: + case GDK_SURFACE_TYPE_HINT_SPLASHSCREEN: atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_SPLASH"); break; - case GDK_WINDOW_TYPE_HINT_DOCK: + case GDK_SURFACE_TYPE_HINT_DOCK: atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DOCK"); break; - case GDK_WINDOW_TYPE_HINT_DESKTOP: + case GDK_SURFACE_TYPE_HINT_DESKTOP: atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DESKTOP"); break; - case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU: + case GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU: atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU"); break; - case GDK_WINDOW_TYPE_HINT_POPUP_MENU: + case GDK_SURFACE_TYPE_HINT_POPUP_MENU: atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_POPUP_MENU"); break; - case GDK_WINDOW_TYPE_HINT_TOOLTIP: + case GDK_SURFACE_TYPE_HINT_TOOLTIP: atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_TOOLTIP"); break; - case GDK_WINDOW_TYPE_HINT_NOTIFICATION: + case GDK_SURFACE_TYPE_HINT_NOTIFICATION: atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_NOTIFICATION"); break; - case GDK_WINDOW_TYPE_HINT_COMBO: + case GDK_SURFACE_TYPE_HINT_COMBO: atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_COMBO"); break; - case GDK_WINDOW_TYPE_HINT_DND: + case GDK_SURFACE_TYPE_HINT_DND: atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DND"); break; default: - g_warning ("Unknown hint %d passed to gdk_window_set_type_hint", hint); + g_warning ("Unknown hint %d passed to gdk_surface_set_type_hint", hint); /* Fall thru */ - case GDK_WINDOW_TYPE_HINT_NORMAL: + case GDK_SURFACE_TYPE_HINT_NORMAL: atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_NORMAL"); break; } - XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), + XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE"), XA_ATOM, 32, PropModeReplace, (guchar *)&atom, 1); } -static GdkWindowTypeHint -gdk_x11_window_get_type_hint (GdkWindow *window) +static GdkSurfaceTypeHint +gdk_x11_surface_get_type_hint (GdkSurface *window) { GdkDisplay *display; - GdkWindowTypeHint type; + GdkSurfaceTypeHint type; Atom type_return; gint format_return; gulong nitems_return; gulong bytes_after_return; guchar *data = NULL; - g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_WINDOW_TYPE_HINT_NORMAL); + g_return_val_if_fail (GDK_IS_SURFACE (window), GDK_SURFACE_TYPE_HINT_NORMAL); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) - return GDK_WINDOW_TYPE_HINT_NORMAL; + return GDK_SURFACE_TYPE_HINT_NORMAL; - type = GDK_WINDOW_TYPE_HINT_NORMAL; + type = GDK_SURFACE_TYPE_HINT_NORMAL; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); - if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), + if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE"), 0, G_MAXLONG, False, XA_ATOM, &type_return, &format_return, &nitems_return, &bytes_after_return, @@ -1946,31 +1946,31 @@ gdk_x11_window_get_type_hint (GdkWindow *window) Atom atom = *(Atom*)data; if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DIALOG")) - type = GDK_WINDOW_TYPE_HINT_DIALOG; + type = GDK_SURFACE_TYPE_HINT_DIALOG; else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_MENU")) - type = GDK_WINDOW_TYPE_HINT_MENU; + type = GDK_SURFACE_TYPE_HINT_MENU; else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_TOOLBAR")) - type = GDK_WINDOW_TYPE_HINT_TOOLBAR; + type = GDK_SURFACE_TYPE_HINT_TOOLBAR; else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_UTILITY")) - type = GDK_WINDOW_TYPE_HINT_UTILITY; + type = GDK_SURFACE_TYPE_HINT_UTILITY; else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_SPLASH")) - type = GDK_WINDOW_TYPE_HINT_SPLASHSCREEN; + type = GDK_SURFACE_TYPE_HINT_SPLASHSCREEN; else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DOCK")) - type = GDK_WINDOW_TYPE_HINT_DOCK; + type = GDK_SURFACE_TYPE_HINT_DOCK; else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DESKTOP")) - type = GDK_WINDOW_TYPE_HINT_DESKTOP; + type = GDK_SURFACE_TYPE_HINT_DESKTOP; else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU")) - type = GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU; + type = GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU; else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_POPUP_MENU")) - type = GDK_WINDOW_TYPE_HINT_POPUP_MENU; + type = GDK_SURFACE_TYPE_HINT_POPUP_MENU; else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_TOOLTIP")) - type = GDK_WINDOW_TYPE_HINT_TOOLTIP; + type = GDK_SURFACE_TYPE_HINT_TOOLTIP; else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_NOTIFICATION")) - type = GDK_WINDOW_TYPE_HINT_NOTIFICATION; + type = GDK_SURFACE_TYPE_HINT_NOTIFICATION; else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_COMBO")) - type = GDK_WINDOW_TYPE_HINT_COMBO; + type = GDK_SURFACE_TYPE_HINT_COMBO; else if (atom == gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_TYPE_DND")) - type = GDK_WINDOW_TYPE_HINT_DND; + type = GDK_SURFACE_TYPE_HINT_DND; } if (type_return != None && data != NULL) @@ -1982,11 +1982,11 @@ gdk_x11_window_get_type_hint (GdkWindow *window) static void gdk_wmspec_change_state (gboolean add, - GdkWindow *window, + GdkSurface *window, GdkAtom state1, GdkAtom state2) { - GdkDisplay *display = GDK_WINDOW_DISPLAY (window); + GdkDisplay *display = GDK_SURFACE_DISPLAY (window); XClientMessageEvent xclient; #define _NET_WM_STATE_REMOVE 0 /* remove/unset property */ @@ -1995,7 +1995,7 @@ gdk_wmspec_change_state (gboolean add, memset (&xclient, 0, sizeof (xclient)); xclient.type = ClientMessage; - xclient.window = GDK_WINDOW_XID (window); + xclient.window = GDK_SURFACE_XID (window); xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE"); xclient.format = 32; xclient.data.l[0] = add ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE; @@ -2004,101 +2004,101 @@ gdk_wmspec_change_state (gboolean add, xclient.data.l[3] = 1; /* source indication */ xclient.data.l[4] = 0; - XSendEvent (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XROOTWIN (window), False, + XSendEvent (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XROOTWIN (window), False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xclient); } static void -gdk_x11_window_set_modal_hint (GdkWindow *window, +gdk_x11_surface_set_modal_hint (GdkSurface *window, gboolean modal) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; window->modal_hint = modal; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) gdk_wmspec_change_state (modal, window, g_intern_static_string ("_NET_WM_STATE_MODAL"), NULL); } static void -gdk_x11_window_set_skip_taskbar_hint (GdkWindow *window, +gdk_x11_surface_set_skip_taskbar_hint (GdkSurface *window, gboolean skips_taskbar) { GdkToplevelX11 *toplevel; - g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD); + g_return_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - toplevel = _gdk_x11_window_get_toplevel (window); + toplevel = _gdk_x11_surface_get_toplevel (window); toplevel->skip_taskbar_hint = skips_taskbar; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) gdk_wmspec_change_state (skips_taskbar, window, g_intern_static_string ("_NET_WM_STATE_SKIP_TASKBAR"), NULL); } static void -gdk_x11_window_set_skip_pager_hint (GdkWindow *window, +gdk_x11_surface_set_skip_pager_hint (GdkSurface *window, gboolean skips_pager) { GdkToplevelX11 *toplevel; - g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD); + g_return_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - toplevel = _gdk_x11_window_get_toplevel (window); + toplevel = _gdk_x11_surface_get_toplevel (window); toplevel->skip_pager_hint = skips_pager; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) gdk_wmspec_change_state (skips_pager, window, g_intern_static_string ("_NET_WM_STATE_SKIP_PAGER"), NULL); } static void -gdk_x11_window_set_urgency_hint (GdkWindow *window, +gdk_x11_surface_set_urgency_hint (GdkSurface *window, gboolean urgent) { GdkToplevelX11 *toplevel; - g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD); + g_return_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - toplevel = _gdk_x11_window_get_toplevel (window); + toplevel = _gdk_x11_surface_get_toplevel (window); toplevel->urgency_hint = urgent; update_wm_hints (window, FALSE); } static void -gdk_x11_window_set_geometry_hints (GdkWindow *window, +gdk_x11_surface_set_geometry_hints (GdkSurface *window, const GdkGeometry *geometry, - GdkWindowHints geom_mask) + GdkSurfaceHints geom_mask) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); XSizeHints size_hints; GdkToplevelX11 *toplevel; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - toplevel = _gdk_x11_window_get_toplevel (window); + toplevel = _gdk_x11_surface_get_toplevel (window); if (toplevel) { if (geometry) @@ -2197,38 +2197,38 @@ gdk_x11_window_set_geometry_hints (GdkWindow *window, /* FIXME: Would it be better to delete this property if * geom_mask == 0? It would save space on the server */ - XSetWMNormalHints (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + XSetWMNormalHints (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), &size_hints); } static void -gdk_window_get_geometry_hints (GdkWindow *window, +gdk_surface_get_geometry_hints (GdkSurface *window, GdkGeometry *geometry, - GdkWindowHints *geom_mask) + GdkSurfaceHints *geom_mask) { - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; XSizeHints *size_hints; glong junk_supplied_mask = 0; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); g_return_if_fail (geometry != NULL); g_return_if_fail (geom_mask != NULL); *geom_mask = 0; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - impl = GDK_WINDOW_IMPL_X11 (window->impl); + impl = GDK_SURFACE_IMPL_X11 (window->impl); size_hints = XAllocSizeHints (); if (!size_hints) return; - if (!XGetWMNormalHints (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + if (!XGetWMNormalHints (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), size_hints, &junk_supplied_mask)) size_hints->flags = 0; @@ -2357,7 +2357,7 @@ set_wm_name (GdkDisplay *display, } static void -gdk_x11_window_set_title (GdkWindow *window, +gdk_x11_surface_set_title (GdkSurface *window, const gchar *title) { GdkDisplay *display; @@ -2366,17 +2366,17 @@ gdk_x11_window_set_title (GdkWindow *window, g_return_if_fail (title != NULL); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); xdisplay = GDK_DISPLAY_XDISPLAY (display); - xwindow = GDK_WINDOW_XID (window); + xwindow = GDK_SURFACE_XID (window); set_wm_name (display, xwindow, title); - if (!gdk_window_icon_name_set (window)) + if (!gdk_surface_icon_name_set (window)) { XChangeProperty (xdisplay, xwindow, gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON_NAME"), @@ -2390,89 +2390,89 @@ gdk_x11_window_set_title (GdkWindow *window, } static void -gdk_x11_window_set_role (GdkWindow *window, +gdk_x11_surface_set_role (GdkSurface *window, const gchar *role) { GdkDisplay *display; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; if (role) - XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), + XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "WM_WINDOW_ROLE"), XA_STRING, 8, PropModeReplace, (guchar *)role, strlen (role)); else - XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), + XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "WM_WINDOW_ROLE")); } static void -gdk_x11_window_set_startup_id (GdkWindow *window, +gdk_x11_surface_set_startup_id (GdkSurface *window, const gchar *startup_id) { GdkDisplay *display; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; if (startup_id) - XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), + XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_NET_STARTUP_ID"), gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8, PropModeReplace, (unsigned char *)startup_id, strlen (startup_id)); else - XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), + XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_NET_STARTUP_ID")); } static void -gdk_x11_window_set_transient_for (GdkWindow *window, - GdkWindow *parent) +gdk_x11_surface_set_transient_for (GdkSurface *window, + GdkSurface *parent) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; /* XSetTransientForHint() doesn't allow unsetting, so do it manually */ - if (parent && !GDK_WINDOW_DESTROYED (parent)) - XSetTransientForHint (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), - GDK_WINDOW_XID (parent)); + if (parent && !GDK_SURFACE_DESTROYED (parent)) + XSetTransientForHint (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), + GDK_SURFACE_XID (parent)); else - XDeleteProperty (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), - gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_DISPLAY (window), "WM_TRANSIENT_FOR")); + XDeleteProperty (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), + gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (window), "WM_TRANSIENT_FOR")); } GdkCursor * -_gdk_x11_window_get_cursor (GdkWindow *window) +_gdk_x11_surface_get_cursor (GdkSurface *window) { - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); - impl = GDK_WINDOW_IMPL_X11 (window->impl); + impl = GDK_SURFACE_IMPL_X11 (window->impl); return impl->cursor; } static void -gdk_window_x11_get_geometry (GdkWindow *window, +gdk_surface_x11_get_geometry (GdkSurface *window, gint *x, gint *y, gint *width, gint *height) { - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; Window root; gint tx; gint ty; @@ -2481,12 +2481,12 @@ gdk_window_x11_get_geometry (GdkWindow *window, guint tborder_width; guint tdepth; - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { - impl = GDK_WINDOW_IMPL_X11 (window->impl); + impl = GDK_SURFACE_IMPL_X11 (window->impl); - XGetGeometry (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + XGetGeometry (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), &root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth); if (x) @@ -2501,20 +2501,20 @@ gdk_window_x11_get_geometry (GdkWindow *window, } static void -gdk_window_x11_get_root_coords (GdkWindow *window, +gdk_surface_x11_get_root_coords (GdkSurface *window, gint x, gint y, gint *root_x, gint *root_y) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); Window child; gint tx; gint ty; - XTranslateCoordinates (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), - GDK_WINDOW_XROOTWIN (window), + XTranslateCoordinates (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), + GDK_SURFACE_XROOTWIN (window), x * impl->window_scale, y * impl->window_scale, &tx, &ty, &child); @@ -2525,11 +2525,11 @@ gdk_window_x11_get_root_coords (GdkWindow *window, } static void -gdk_x11_window_get_frame_extents (GdkWindow *window, +gdk_x11_surface_get_frame_extents (GdkSurface *window, GdkRectangle *rect) { GdkDisplay *display; - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; Window xwindow; Window xparent; Window root; @@ -2558,7 +2558,7 @@ gdk_x11_window_get_frame_extents (GdkWindow *window, while (window->parent && (window->parent)->parent) window = window->parent; - impl = GDK_WINDOW_IMPL_X11 (window->impl); + impl = GDK_SURFACE_IMPL_X11 (window->impl); /* Refine our fallback answer a bit using local information */ rect->x = window->x * impl->window_scale; @@ -2566,20 +2566,20 @@ gdk_x11_window_get_frame_extents (GdkWindow *window, rect->width = window->width * impl->window_scale; rect->height = window->height * impl->window_scale; - if (GDK_WINDOW_DESTROYED (window) || impl->override_redirect) + if (GDK_SURFACE_DESTROYED (window) || impl->override_redirect) return; nvroots = 0; vroots = NULL; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); gdk_x11_display_error_trap_push (display); - xwindow = GDK_WINDOW_XID (window); + xwindow = GDK_SURFACE_XID (window); /* first try: use _NET_FRAME_EXTENTS */ - if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window), + if (gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window), g_intern_static_string ("_NET_FRAME_EXTENTS")) && XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), xwindow, gdk_x11_get_xatom_by_name_for_display (display, @@ -2626,9 +2626,9 @@ gdk_x11_window_get_frame_extents (GdkWindow *window, tree to get our window's parent which hopefully is the window frame */ /* use NETWM_VIRTUAL_ROOTS if available */ - root = GDK_WINDOW_XROOTWIN (window); + root = GDK_SURFACE_XROOTWIN (window); - if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window), + if (gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window), g_intern_static_string ("_NET_VIRTUAL_ROOTS")) && XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), root, gdk_x11_get_xatom_by_name_for_display (display, @@ -2645,7 +2645,7 @@ gdk_x11_window_get_frame_extents (GdkWindow *window, } } - xparent = GDK_WINDOW_XID (window); + xparent = GDK_SURFACE_XID (window); do { @@ -2696,15 +2696,15 @@ gdk_x11_window_get_frame_extents (GdkWindow *window, } static gboolean -gdk_window_x11_get_device_state (GdkWindow *window, +gdk_surface_x11_get_device_state (GdkSurface *window, GdkDevice *device, gdouble *x, gdouble *y, GdkModifierType *mask) { - GdkWindow *child; + GdkSurface *child; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return FALSE; /*HIDPI: handle coords here?*/ @@ -2716,18 +2716,18 @@ gdk_window_x11_get_device_state (GdkWindow *window, } static GdkEventMask -gdk_window_x11_get_events (GdkWindow *window) +gdk_surface_x11_get_events (GdkSurface *window) { XWindowAttributes attrs; GdkEventMask event_mask; GdkEventMask filtered; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return 0; else { - XGetWindowAttributes (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + XGetWindowAttributes (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), &attrs); event_mask = x_event_mask_to_gdk_event_mask (attrs.your_event_mask); /* if property change was filtered out before, keep it filtered out */ @@ -2738,46 +2738,46 @@ gdk_window_x11_get_events (GdkWindow *window) } } static void -gdk_window_x11_set_events (GdkWindow *window, +gdk_surface_x11_set_events (GdkSurface *window, GdkEventMask event_mask) { long xevent_mask = 0; - if (!GDK_WINDOW_DESTROYED (window)) + if (!GDK_SURFACE_DESTROYED (window)) { GdkX11Display *display_x11; - if (GDK_WINDOW_XID (window) != GDK_WINDOW_XROOTWIN (window)) + if (GDK_SURFACE_XID (window) != GDK_SURFACE_XROOTWIN (window)) xevent_mask = StructureNotifyMask | PropertyChangeMask; - display_x11 = GDK_X11_DISPLAY (gdk_window_get_display (window)); + display_x11 = GDK_X11_DISPLAY (gdk_surface_get_display (window)); gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source, - GDK_WINDOW_XID (window), event_mask, + GDK_SURFACE_XID (window), event_mask, xevent_mask); } } static inline void -do_shape_combine_region (GdkWindow *window, +do_shape_combine_region (GdkSurface *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y, gint shape) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (shape_region == NULL) { /* Use NULL mask to unset the shape */ if (shape == ShapeBounding - ? gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window)) - : gdk_display_supports_input_shapes (GDK_WINDOW_DISPLAY (window))) + ? gdk_display_supports_shapes (GDK_SURFACE_DISPLAY (window)) + : gdk_display_supports_input_shapes (GDK_SURFACE_DISPLAY (window))) { - XShapeCombineMask (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + XShapeCombineMask (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), shape, 0, 0, None, @@ -2787,8 +2787,8 @@ do_shape_combine_region (GdkWindow *window, } if (shape == ShapeBounding - ? gdk_display_supports_shapes (GDK_WINDOW_DISPLAY (window)) - : gdk_display_supports_input_shapes (GDK_WINDOW_DISPLAY (window))) + ? gdk_display_supports_shapes (GDK_SURFACE_DISPLAY (window)) + : gdk_display_supports_input_shapes (GDK_SURFACE_DISPLAY (window))) { gint n_rects = 0; XRectangle *xrects = NULL; @@ -2797,8 +2797,8 @@ do_shape_combine_region (GdkWindow *window, 0, 0, impl->window_scale, &xrects, &n_rects); - XShapeCombineRectangles (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + XShapeCombineRectangles (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), shape, offset_x * impl->window_scale, offset_y * impl->window_scale, @@ -2811,7 +2811,7 @@ do_shape_combine_region (GdkWindow *window, } static void -gdk_window_x11_shape_combine_region (GdkWindow *window, +gdk_surface_x11_shape_combine_region (GdkSurface *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y) @@ -2820,7 +2820,7 @@ gdk_window_x11_shape_combine_region (GdkWindow *window, } static void -gdk_window_x11_input_shape_combine_region (GdkWindow *window, +gdk_surface_x11_input_shape_combine_region (GdkSurface *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y) @@ -2831,7 +2831,7 @@ gdk_window_x11_input_shape_combine_region (GdkWindow *window, } static void -gdk_x11_window_set_accept_focus (GdkWindow *window, +gdk_x11_surface_set_accept_focus (GdkSurface *window, gboolean accept_focus) { accept_focus = accept_focus != FALSE; @@ -2840,14 +2840,14 @@ gdk_x11_window_set_accept_focus (GdkWindow *window, { window->accept_focus = accept_focus; - if (!GDK_WINDOW_DESTROYED (window) && + if (!GDK_SURFACE_DESTROYED (window) && WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) update_wm_hints (window, FALSE); } } static void -gdk_x11_window_set_focus_on_map (GdkWindow *window, +gdk_x11_surface_set_focus_on_map (GdkSurface *window, gboolean focus_on_map) { focus_on_map = focus_on_map != FALSE; @@ -2856,16 +2856,16 @@ gdk_x11_window_set_focus_on_map (GdkWindow *window, { window->focus_on_map = focus_on_map; - if ((!GDK_WINDOW_DESTROYED (window)) && + if ((!GDK_SURFACE_DESTROYED (window)) && (!window->focus_on_map) && WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) - gdk_x11_window_set_user_time (window, 0); + gdk_x11_surface_set_user_time (window, 0); } } /** - * gdk_x11_window_set_user_time: - * @window: (type GdkX11Window): A toplevel #GdkWindow + * gdk_x11_surface_set_user_time: + * @window: (type GdkX11Surface): A toplevel #GdkSurface * @timestamp: An XServer timestamp to which the property should be set * * The application can use this call to update the _NET_WM_USER_TIME @@ -2882,7 +2882,7 @@ gdk_x11_window_set_focus_on_map (GdkWindow *window, * events bypassing GDK. **/ void -gdk_x11_window_set_user_time (GdkWindow *window, +gdk_x11_surface_set_user_time (GdkSurface *window, guint32 timestamp) { GdkDisplay *display; @@ -2891,26 +2891,26 @@ gdk_x11_window_set_user_time (GdkWindow *window, glong timestamp_long = (glong)timestamp; Window xid; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); display_x11 = GDK_X11_DISPLAY (display); - toplevel = _gdk_x11_window_get_toplevel (window); + toplevel = _gdk_x11_surface_get_toplevel (window); if (!toplevel) { - g_warning ("gdk_window_set_user_time called on non-toplevel\n"); + g_warning ("gdk_surface_set_user_time called on non-toplevel\n"); return; } if (toplevel->focus_window != None && - gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window), + gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window), g_intern_static_string ("_NET_WM_USER_TIME_WINDOW"))) xid = toplevel->focus_window; else - xid = GDK_WINDOW_XID (window); + xid = GDK_SURFACE_XID (window); XChangeProperty (GDK_DISPLAY_XDISPLAY (display), xid, gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_USER_TIME"), @@ -2927,8 +2927,8 @@ gdk_x11_window_set_user_time (GdkWindow *window, } /** - * gdk_x11_window_set_utf8_property: - * @window: (type GdkX11Window): a #GdkWindow + * gdk_x11_surface_set_utf8_property: + * @window: (type GdkX11Surface): a #GdkSurface * @name: Property name, will be interned as an X atom * @value: (allow-none): Property value, or %NULL to delete * @@ -2937,7 +2937,7 @@ gdk_x11_window_set_user_time (GdkWindow *window, * not a toplevel window, it is ignored. */ void -gdk_x11_window_set_utf8_property (GdkWindow *window, +gdk_x11_surface_set_utf8_property (GdkSurface *window, const gchar *name, const gchar *value) { @@ -2946,12 +2946,12 @@ gdk_x11_window_set_utf8_property (GdkWindow *window, if (!WINDOW_IS_TOPLEVEL (window)) return; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); if (value != NULL) { XChangeProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, name), gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8, PropModeReplace, (guchar *)value, strlen (value)); @@ -2959,19 +2959,19 @@ gdk_x11_window_set_utf8_property (GdkWindow *window, else { XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, name)); } } static void -gdk_x11_window_set_shadow_width (GdkWindow *window, +gdk_x11_surface_set_shadow_width (GdkSurface *window, int left, int right, int top, int bottom) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); Atom frame_extents; gulong data[4] = { left * impl->window_scale, @@ -2980,18 +2980,18 @@ gdk_x11_window_set_shadow_width (GdkWindow *window, bottom * impl->window_scale }; - frame_extents = gdk_x11_get_xatom_by_name_for_display (gdk_window_get_display (window), + frame_extents = gdk_x11_get_xatom_by_name_for_display (gdk_surface_get_display (window), "_GTK_FRAME_EXTENTS"); - XChangeProperty (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), + XChangeProperty (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), frame_extents, XA_CARDINAL, 32, PropModeReplace, (guchar *) &data, 4); } /** - * gdk_x11_window_set_theme_variant: - * @window: (type GdkX11Window): a #GdkWindow + * gdk_x11_surface_set_theme_variant: + * @window: (type GdkX11Surface): a #GdkSurface * @variant: the theme variant to export * * GTK+ applications can request a dark theme variant. In order to @@ -3005,10 +3005,10 @@ gdk_x11_window_set_shadow_width (GdkWindow *window, * to create toplevel windows. */ void -gdk_x11_window_set_theme_variant (GdkWindow *window, +gdk_x11_surface_set_theme_variant (GdkSurface *window, const char *variant) { - gdk_x11_window_set_utf8_property (window, "_GTK_THEME_VARIANT", + gdk_x11_surface_set_utf8_property (window, "_GTK_THEME_VARIANT", variant ? variant : ""); } @@ -3019,7 +3019,7 @@ gdk_x11_window_set_theme_variant (GdkWindow *window, : XExtendedMaxRequestSize (GDK_DISPLAY_XDISPLAY (display)) - 100) static void -gdk_window_update_icon (GdkWindow *window, +gdk_surface_update_icon (GdkSurface *window, GList *icon_list) { GdkToplevelX11 *toplevel; @@ -3027,7 +3027,7 @@ gdk_window_update_icon (GdkWindow *window, GList *tmp_list; int best_size; - toplevel = _gdk_x11_window_get_toplevel (window); + toplevel = _gdk_x11_surface_get_toplevel (window); if (toplevel->icon_pixmap != NULL) { @@ -3083,7 +3083,7 @@ gdk_window_update_icon (GdkWindow *window, cairo_surface_t *surface; cairo_t *cr; - toplevel->icon_pixmap = gdk_x11_window_create_pixmap_surface (window, width, height); + toplevel->icon_pixmap = gdk_x11_surface_create_pixmap_surface (window, width, height); surface = gdk_texture_download_surface (best_icon); @@ -3104,7 +3104,7 @@ gdk_window_update_icon (GdkWindow *window, if (cairo_surface_get_content (surface) == CAIRO_CONTENT_COLOR_ALPHA) { - GdkDisplay *display = gdk_window_get_display (window); + GdkDisplay *display = gdk_surface_get_display (window); toplevel->icon_mask = _gdk_x11_display_create_bitmap_surface (display, width, height); @@ -3122,7 +3122,7 @@ gdk_window_update_icon (GdkWindow *window, } static void -gdk_x11_window_set_icon_list (GdkWindow *window, +gdk_x11_surface_set_icon_list (GdkSurface *window, GList *textures) { gulong *data; @@ -3134,11 +3134,11 @@ gdk_x11_window_set_icon_list (GdkWindow *window, GdkDisplay *display; gint i, n; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); size = 0; n = 0; @@ -3185,7 +3185,7 @@ gdk_x11_window_set_icon_list (GdkWindow *window, if (size > 0) { XChangeProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON"), XA_CARDINAL, 32, PropModeReplace, @@ -3194,33 +3194,33 @@ gdk_x11_window_set_icon_list (GdkWindow *window, else { XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON")); } g_free (data); - gdk_window_update_icon (window, textures); + gdk_surface_update_icon (window, textures); } static gboolean -gdk_window_icon_name_set (GdkWindow *window) +gdk_surface_icon_name_set (GdkSurface *window) { return GPOINTER_TO_UINT (g_object_get_qdata (G_OBJECT (window), g_quark_from_static_string ("gdk-icon-name-set"))); } static void -gdk_x11_window_set_icon_name (GdkWindow *window, +gdk_x11_surface_set_icon_name (GdkSurface *window, const gchar *name) { GdkDisplay *display; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); g_object_set_qdata (G_OBJECT (window), g_quark_from_static_string ("gdk-icon-name-set"), GUINT_TO_POINTER (name != NULL)); @@ -3228,45 +3228,45 @@ gdk_x11_window_set_icon_name (GdkWindow *window, if (name != NULL) { XChangeProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON_NAME"), gdk_x11_get_xatom_by_name_for_display (display, "UTF8_STRING"), 8, PropModeReplace, (guchar *)name, strlen (name)); - set_text_property (display, GDK_WINDOW_XID (window), + set_text_property (display, GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "WM_ICON_NAME"), name); } else { XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_ICON_NAME")); XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "WM_ICON_NAME")); } } static void -gdk_x11_window_iconify (GdkWindow *window) +gdk_x11_surface_iconify (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { - XIconifyWindow (GDK_WINDOW_XDISPLAY (window), - GDK_WINDOW_XID (window), - gdk_x11_screen_get_screen_number (GDK_WINDOW_SCREEN (window))); + XIconifyWindow (GDK_SURFACE_XDISPLAY (window), + GDK_SURFACE_XID (window), + gdk_x11_screen_get_screen_number (GDK_SURFACE_SCREEN (window))); } else { /* Flip our client side flag, the real work happens on map. */ gdk_synthesize_window_state (window, 0, - GDK_WINDOW_STATE_ICONIFIED); + GDK_SURFACE_STATE_ICONIFIED); gdk_wmspec_change_state (TRUE, window, g_intern_static_string ("_NET_WM_STATE_HIDDEN"), NULL); @@ -3274,15 +3274,15 @@ gdk_x11_window_iconify (GdkWindow *window) } static void -gdk_x11_window_deiconify (GdkWindow *window) +gdk_x11_surface_deiconify (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { - gdk_window_show (window); + gdk_surface_show (window); gdk_wmspec_change_state (FALSE, window, g_intern_static_string ("_NET_WM_STATE_HIDDEN"), NULL); @@ -3291,7 +3291,7 @@ gdk_x11_window_deiconify (GdkWindow *window) { /* Flip our client side flag, the real work happens on map. */ gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_ICONIFIED, + GDK_SURFACE_STATE_ICONIFIED, 0); gdk_wmspec_change_state (FALSE, window, g_intern_static_string ("_NET_WM_STATE_HIDDEN"), @@ -3300,13 +3300,13 @@ gdk_x11_window_deiconify (GdkWindow *window) } static void -gdk_x11_window_stick (GdkWindow *window) +gdk_x11_surface_stick (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { /* "stick" means stick to all desktops _and_ do not scroll with the * viewport. i.e. glue to the monitor glass in all cases. @@ -3322,9 +3322,9 @@ gdk_x11_window_stick (GdkWindow *window) /* Request desktop 0xFFFFFFFF */ memset (&xclient, 0, sizeof (xclient)); xclient.type = ClientMessage; - xclient.window = GDK_WINDOW_XID (window); - xclient.display = GDK_WINDOW_XDISPLAY (window); - xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_DISPLAY (window), + xclient.window = GDK_SURFACE_XID (window); + xclient.display = GDK_SURFACE_XDISPLAY (window); + xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (window), "_NET_WM_DESKTOP"); xclient.format = 32; @@ -3334,7 +3334,7 @@ gdk_x11_window_stick (GdkWindow *window) xclient.data.l[3] = 0; xclient.data.l[4] = 0; - XSendEvent (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XROOTWIN (window), False, + XSendEvent (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XROOTWIN (window), False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xclient); } @@ -3343,18 +3343,18 @@ gdk_x11_window_stick (GdkWindow *window) /* Flip our client side flag, the real work happens on map. */ gdk_synthesize_window_state (window, 0, - GDK_WINDOW_STATE_STICKY); + GDK_SURFACE_STATE_STICKY); } } static void -gdk_x11_window_unstick (GdkWindow *window) +gdk_x11_surface_unstick (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { /* Request unstick from viewport */ gdk_wmspec_change_state (FALSE, window, @@ -3367,50 +3367,50 @@ gdk_x11_window_unstick (GdkWindow *window) { /* Flip our client side flag, the real work happens on map. */ gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_STICKY, + GDK_SURFACE_STATE_STICKY, 0); } } static void -gdk_x11_window_maximize (GdkWindow *window) +gdk_x11_surface_maximize (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) gdk_wmspec_change_state (TRUE, window, g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_VERT"), g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_HORZ")); else gdk_synthesize_window_state (window, 0, - GDK_WINDOW_STATE_MAXIMIZED); + GDK_SURFACE_STATE_MAXIMIZED); } static void -gdk_x11_window_unmaximize (GdkWindow *window) +gdk_x11_surface_unmaximize (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) gdk_wmspec_change_state (FALSE, window, g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_VERT"), g_intern_static_string ("_NET_WM_STATE_MAXIMIZED_HORZ")); else gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_MAXIMIZED, + GDK_SURFACE_STATE_MAXIMIZED, 0); } static void -gdk_x11_window_apply_fullscreen_mode (GdkWindow *window) +gdk_x11_surface_apply_fullscreen_mode (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; @@ -3420,7 +3420,7 @@ gdk_x11_window_apply_fullscreen_mode (GdkWindow *window) * mapped. */ - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { XClientMessageEvent xclient; gint monitors[4]; @@ -3428,8 +3428,8 @@ gdk_x11_window_apply_fullscreen_mode (GdkWindow *window) memset (&xclient, 0, sizeof (xclient)); xclient.type = ClientMessage; - xclient.window = GDK_WINDOW_XID (window); - xclient.display = GDK_WINDOW_XDISPLAY (window); + xclient.window = GDK_SURFACE_XID (window); + xclient.display = GDK_SURFACE_XDISPLAY (window); xclient.format = 32; switch (window->fullscreen_mode) @@ -3463,7 +3463,7 @@ gdk_x11_window_apply_fullscreen_mode (GdkWindow *window) case GDK_FULLSCREEN_ON_ALL_MONITORS: - _gdk_x11_screen_get_edge_monitors (GDK_WINDOW_SCREEN (window), + _gdk_x11_screen_get_edge_monitors (GDK_SURFACE_SCREEN (window), &monitors[0], &monitors[1], &monitors[2], @@ -3477,36 +3477,36 @@ gdk_x11_window_apply_fullscreen_mode (GdkWindow *window) */ if (xclient.data.l[i] < 0) { - g_warning ("gdk_x11_window_apply_fullscreen_mode: Invalid XINERAMA monitor index"); + g_warning ("gdk_x11_surface_apply_fullscreen_mode: Invalid XINERAMA monitor index"); return; } } break; default: - g_warning ("gdk_x11_window_apply_fullscreen_mode: Unhandled fullscreen mode %d", + g_warning ("gdk_x11_surface_apply_fullscreen_mode: Unhandled fullscreen mode %d", window->fullscreen_mode); return; } /* Send fullscreen monitors client message */ xclient.data.l[4] = 1; /* source indication */ - xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_DISPLAY (window), + xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (window), "_NET_WM_FULLSCREEN_MONITORS"); - XSendEvent (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XROOTWIN (window), False, + XSendEvent (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XROOTWIN (window), False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xclient); } } static void -gdk_x11_window_fullscreen (GdkWindow *window) +gdk_x11_surface_fullscreen (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { gdk_wmspec_change_state (TRUE, window, g_intern_static_string ("_NET_WM_STATE_FULLSCREEN"), @@ -3515,60 +3515,60 @@ gdk_x11_window_fullscreen (GdkWindow *window) * monitors in GDK_FULLSCREEN_ON_ALL_MONITORS mode. */ if (window->fullscreen_mode == GDK_FULLSCREEN_ON_ALL_MONITORS) - gdk_x11_window_apply_fullscreen_mode (window); + gdk_x11_surface_apply_fullscreen_mode (window); } else gdk_synthesize_window_state (window, 0, - GDK_WINDOW_STATE_FULLSCREEN); + GDK_SURFACE_STATE_FULLSCREEN); } static void -gdk_x11_window_fullscreen_on_monitor (GdkWindow *window, +gdk_x11_surface_fullscreen_on_monitor (GdkSurface *window, GdkMonitor *monitor) { GdkRectangle geom; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; gdk_monitor_get_geometry (monitor, &geom); - gdk_window_move (window, geom.x, geom.y); + gdk_surface_move (window, geom.x, geom.y); - gdk_window_set_fullscreen_mode (window, GDK_FULLSCREEN_ON_CURRENT_MONITOR); - gdk_x11_window_fullscreen (window); + gdk_surface_set_fullscreen_mode (window, GDK_FULLSCREEN_ON_CURRENT_MONITOR); + gdk_x11_surface_fullscreen (window); } static void -gdk_x11_window_unfullscreen (GdkWindow *window) +gdk_x11_surface_unfullscreen (GdkSurface *window) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) gdk_wmspec_change_state (FALSE, window, g_intern_static_string ("_NET_WM_STATE_FULLSCREEN"), NULL); else gdk_synthesize_window_state (window, - GDK_WINDOW_STATE_FULLSCREEN, + GDK_SURFACE_STATE_FULLSCREEN, 0); } static void -gdk_x11_window_set_keep_above (GdkWindow *window, +gdk_x11_surface_set_keep_above (GdkSurface *window, gboolean setting) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { if (setting) gdk_wmspec_change_state (FALSE, window, @@ -3580,20 +3580,20 @@ gdk_x11_window_set_keep_above (GdkWindow *window, } else gdk_synthesize_window_state (window, - setting ? GDK_WINDOW_STATE_BELOW : GDK_WINDOW_STATE_ABOVE, - setting ? GDK_WINDOW_STATE_ABOVE : 0); + setting ? GDK_SURFACE_STATE_BELOW : GDK_SURFACE_STATE_ABOVE, + setting ? GDK_SURFACE_STATE_ABOVE : 0); } static void -gdk_x11_window_set_keep_below (GdkWindow *window, gboolean setting) +gdk_x11_surface_set_keep_below (GdkSurface *window, gboolean setting) { - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; - if (GDK_WINDOW_IS_MAPPED (window)) + if (GDK_SURFACE_IS_MAPPED (window)) { if (setting) gdk_wmspec_change_state (FALSE, window, @@ -3605,57 +3605,57 @@ gdk_x11_window_set_keep_below (GdkWindow *window, gboolean setting) } else gdk_synthesize_window_state (window, - setting ? GDK_WINDOW_STATE_ABOVE : GDK_WINDOW_STATE_BELOW, - setting ? GDK_WINDOW_STATE_BELOW : 0); + setting ? GDK_SURFACE_STATE_ABOVE : GDK_SURFACE_STATE_BELOW, + setting ? GDK_SURFACE_STATE_BELOW : 0); } -static GdkWindow * -gdk_x11_window_get_group (GdkWindow *window) +static GdkSurface * +gdk_x11_surface_get_group (GdkSurface *window) { GdkToplevelX11 *toplevel; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return NULL; - toplevel = _gdk_x11_window_get_toplevel (window); + toplevel = _gdk_x11_surface_get_toplevel (window); return toplevel->group_leader; } static void -gdk_x11_window_set_group (GdkWindow *window, - GdkWindow *leader) +gdk_x11_surface_set_group (GdkSurface *window, + GdkSurface *leader) { GdkToplevelX11 *toplevel; - g_return_if_fail (GDK_IS_WINDOW (window)); - g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD); - g_return_if_fail (leader == NULL || GDK_IS_WINDOW (leader)); + g_return_if_fail (GDK_IS_SURFACE (window)); + g_return_if_fail (GDK_SURFACE_TYPE (window) != GDK_SURFACE_CHILD); + g_return_if_fail (leader == NULL || GDK_IS_SURFACE (leader)); - if (GDK_WINDOW_DESTROYED (window) || - (leader != NULL && GDK_WINDOW_DESTROYED (leader)) || + if (GDK_SURFACE_DESTROYED (window) || + (leader != NULL && GDK_SURFACE_DESTROYED (leader)) || !WINDOW_IS_TOPLEVEL (window)) return; - toplevel = _gdk_x11_window_get_toplevel (window); + toplevel = _gdk_x11_surface_get_toplevel (window); if (leader == NULL) - leader = gdk_display_get_default_group (gdk_window_get_display (window)); + leader = gdk_display_get_default_group (gdk_surface_get_display (window)); if (toplevel->group_leader != leader) { if (toplevel->group_leader) g_object_unref (toplevel->group_leader); toplevel->group_leader = g_object_ref (leader); - (_gdk_x11_window_get_toplevel (leader))->is_leader = TRUE; + (_gdk_x11_surface_get_toplevel (leader))->is_leader = TRUE; } update_wm_hints (window, FALSE); } static MotifWmHints * -gdk_window_get_mwm_hints (GdkWindow *window) +gdk_surface_get_mwm_hints (GdkSurface *window) { GdkDisplay *display; Atom hints_atom = None; @@ -3665,14 +3665,14 @@ gdk_window_get_mwm_hints (GdkWindow *window) gulong nitems; gulong bytes_after; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return NULL; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); hints_atom = gdk_x11_get_xatom_by_name_for_display (display, _XA_MOTIF_WM_HINTS); - XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), + XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XID (window), hints_atom, 0, sizeof (MotifWmHints)/sizeof (long), False, AnyPropertyType, &type, &format, &nitems, &bytes_after, &data); @@ -3684,7 +3684,7 @@ gdk_window_get_mwm_hints (GdkWindow *window) } static void -gdk_window_set_mwm_hints (GdkWindow *window, +gdk_surface_set_mwm_hints (GdkSurface *window, MotifWmHints *new_hints) { GdkDisplay *display; @@ -3696,14 +3696,14 @@ gdk_window_set_mwm_hints (GdkWindow *window, gulong nitems; gulong bytes_after; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); hints_atom = gdk_x11_get_xatom_by_name_for_display (display, _XA_MOTIF_WM_HINTS); - XGetWindowProperty (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window), + XGetWindowProperty (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window), hints_atom, 0, sizeof (MotifWmHints)/sizeof (long), False, AnyPropertyType, &type, &format, &nitems, &bytes_after, &data); @@ -3726,7 +3726,7 @@ gdk_window_set_mwm_hints (GdkWindow *window, } } - XChangeProperty (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window), + XChangeProperty (GDK_SURFACE_XDISPLAY (window), GDK_SURFACE_XID (window), hints_atom, hints_atom, 32, PropModeReplace, (guchar *)hints, sizeof (MotifWmHints)/sizeof (long)); @@ -3735,12 +3735,12 @@ gdk_window_set_mwm_hints (GdkWindow *window, } static void -gdk_x11_window_set_decorations (GdkWindow *window, +gdk_x11_surface_set_decorations (GdkSurface *window, GdkWMDecoration decorations) { MotifWmHints hints; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; @@ -3749,21 +3749,21 @@ gdk_x11_window_set_decorations (GdkWindow *window, hints.flags = MWM_HINTS_DECORATIONS; hints.decorations = decorations; - gdk_window_set_mwm_hints (window, &hints); + gdk_surface_set_mwm_hints (window, &hints); } static gboolean -gdk_x11_window_get_decorations(GdkWindow *window, +gdk_x11_surface_get_decorations(GdkSurface *window, GdkWMDecoration *decorations) { MotifWmHints *hints; gboolean result = FALSE; - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return FALSE; - hints = gdk_window_get_mwm_hints (window); + hints = gdk_surface_get_mwm_hints (window); if (hints) { @@ -3781,14 +3781,14 @@ gdk_x11_window_get_decorations(GdkWindow *window, } static void -gdk_x11_window_set_functions (GdkWindow *window, +gdk_x11_surface_set_functions (GdkSurface *window, GdkWMFunction functions) { MotifWmHints hints; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; @@ -3797,7 +3797,7 @@ gdk_x11_window_set_functions (GdkWindow *window, hints.flags = MWM_HINTS_FUNCTIONS; hints.functions = functions; - gdk_window_set_mwm_hints (window, &hints); + gdk_surface_set_mwm_hints (window, &hints); } cairo_region_t * @@ -3871,18 +3871,18 @@ _gdk_x11_xwindow_get_shape (Display *xdisplay, static void wmspec_send_message (GdkDisplay *display, - GdkWindow *window, + GdkSurface *window, gint root_x, gint root_y, gint action, gint button) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); XClientMessageEvent xclient; memset (&xclient, 0, sizeof (xclient)); xclient.type = ClientMessage; - xclient.window = GDK_WINDOW_XID (window); + xclient.window = GDK_SURFACE_XID (window); xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_MOVERESIZE"); xclient.format = 32; @@ -3892,7 +3892,7 @@ wmspec_send_message (GdkDisplay *display, xclient.data.l[3] = button; xclient.data.l[4] = 1; /* source indication */ - XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XROOTWIN (window), False, + XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XROOTWIN (window), False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xclient); } @@ -3902,17 +3902,17 @@ handle_wmspec_button_release (GdkDisplay *display, const XEvent *xevent) { GdkX11Display *display_x11 = GDK_X11_DISPLAY (display); - GdkWindow *window; + GdkSurface *window; #if defined (HAVE_XGENERICEVENTS) && defined (XINPUT_2) XIEvent *xiev = (XIEvent *) xevent->xcookie.data; XIDeviceEvent *xidev = (XIDeviceEvent *) xiev; if (xevent->xany.type == GenericEvent) - window = gdk_x11_window_lookup_for_display (display, xidev->event); + window = gdk_x11_surface_lookup_for_display (display, xidev->event); else #endif - window = gdk_x11_window_lookup_for_display (display, xevent->xany.window); + window = gdk_x11_surface_lookup_for_display (display, xevent->xany.window); if (display_x11->wm_moveresize_button != 0 && window != NULL) { @@ -3933,7 +3933,7 @@ handle_wmspec_button_release (GdkDisplay *display, } static void -wmspec_moveresize (GdkWindow *window, +wmspec_moveresize (GdkSurface *window, gint direction, GdkDevice *device, gint button, @@ -3941,7 +3941,7 @@ wmspec_moveresize (GdkWindow *window, gint root_y, guint32 timestamp) { - GdkDisplay *display = GDK_WINDOW_DISPLAY (window); + GdkDisplay *display = GDK_SURFACE_DISPLAY (window); if (button != 0) gdk_seat_ungrab (gdk_device_get_seat (device)); /* Release passive grab */ @@ -3951,8 +3951,8 @@ wmspec_moveresize (GdkWindow *window, } static void -wmspec_resize_drag (GdkWindow *window, - GdkWindowEdge edge, +wmspec_resize_drag (GdkSurface *window, + GdkSurfaceEdge edge, GdkDevice *device, gint button, gint root_x, @@ -3969,40 +3969,40 @@ wmspec_resize_drag (GdkWindow *window, /* Let the compiler turn a switch into a table, instead * of doing the table manually, this way is easier to verify. */ - case GDK_WINDOW_EDGE_NORTH_WEST: + case GDK_SURFACE_EDGE_NORTH_WEST: direction = _NET_WM_MOVERESIZE_SIZE_TOPLEFT; break; - case GDK_WINDOW_EDGE_NORTH: + case GDK_SURFACE_EDGE_NORTH: direction = _NET_WM_MOVERESIZE_SIZE_TOP; break; - case GDK_WINDOW_EDGE_NORTH_EAST: + case GDK_SURFACE_EDGE_NORTH_EAST: direction = _NET_WM_MOVERESIZE_SIZE_TOPRIGHT; break; - case GDK_WINDOW_EDGE_WEST: + case GDK_SURFACE_EDGE_WEST: direction = _NET_WM_MOVERESIZE_SIZE_LEFT; break; - case GDK_WINDOW_EDGE_EAST: + case GDK_SURFACE_EDGE_EAST: direction = _NET_WM_MOVERESIZE_SIZE_RIGHT; break; - case GDK_WINDOW_EDGE_SOUTH_WEST: + case GDK_SURFACE_EDGE_SOUTH_WEST: direction = _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT; break; - case GDK_WINDOW_EDGE_SOUTH: + case GDK_SURFACE_EDGE_SOUTH: direction = _NET_WM_MOVERESIZE_SIZE_BOTTOM; break; - case GDK_WINDOW_EDGE_SOUTH_EAST: + case GDK_SURFACE_EDGE_SOUTH_EAST: direction = _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT; break; default: - g_warning ("gdk_window_begin_resize_drag: bad resize edge %d!", + g_warning ("gdk_surface_begin_resize_drag: bad resize edge %d!", edge); return; } @@ -4016,10 +4016,10 @@ struct _MoveResizeData { GdkDisplay *display; - GdkWindow *moveresize_window; - GdkWindow *moveresize_emulation_window; + GdkSurface *moveresize_window; + GdkSurface *moveresize_emulation_window; gboolean is_resize; - GdkWindowEdge resize_edge; + GdkSurfaceEdge resize_edge; GdkDevice *device; gint moveresize_button; gint moveresize_x; @@ -4028,7 +4028,7 @@ struct _MoveResizeData gint moveresize_orig_y; gint moveresize_orig_width; gint moveresize_orig_height; - GdkWindowHints moveresize_geom_mask; + GdkSurfaceHints moveresize_geom_mask; GdkGeometry moveresize_geometry; Time moveresize_process_time; XEvent *moveresize_pending_event; @@ -4062,21 +4062,21 @@ check_maximize (MoveResizeData *mv_resize, gdouble x_root, gdouble y_root) { - GdkWindowState state; + GdkSurfaceState state; gint y; if (mv_resize->is_resize) return; - state = gdk_window_get_state (mv_resize->moveresize_window); + state = gdk_surface_get_state (mv_resize->moveresize_window); - if (state & GDK_WINDOW_STATE_MAXIMIZED) + if (state & GDK_SURFACE_STATE_MAXIMIZED) return; y = mv_resize->moveresize_orig_y + (y_root - mv_resize->moveresize_y); if (y < 10) - gdk_window_maximize (mv_resize->moveresize_window); + gdk_surface_maximize (mv_resize->moveresize_window); } static void @@ -4084,22 +4084,22 @@ check_unmaximize (MoveResizeData *mv_resize, gdouble x_root, gdouble y_root) { - GdkWindowState state; + GdkSurfaceState state; gint dx, dy; if (mv_resize->is_resize) return; - state = gdk_window_get_state (mv_resize->moveresize_window); + state = gdk_surface_get_state (mv_resize->moveresize_window); - if ((state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_TILED)) == 0) + if ((state & (GDK_SURFACE_STATE_MAXIMIZED | GDK_SURFACE_STATE_TILED)) == 0) return; dx = x_root - mv_resize->moveresize_x; dy = y_root - mv_resize->moveresize_y; if (ABS (dx) > 20 || ABS (dy) > 20) - gdk_window_unmaximize (mv_resize->moveresize_window); + gdk_surface_unmaximize (mv_resize->moveresize_window); } static void @@ -4125,37 +4125,37 @@ update_pos (MoveResizeData *mv_resize, switch (mv_resize->resize_edge) { - case GDK_WINDOW_EDGE_NORTH_WEST: + case GDK_SURFACE_EDGE_NORTH_WEST: x += dx; y += dy; w -= dx; h -= dy; break; - case GDK_WINDOW_EDGE_NORTH: + case GDK_SURFACE_EDGE_NORTH: y += dy; h -= dy; break; - case GDK_WINDOW_EDGE_NORTH_EAST: + case GDK_SURFACE_EDGE_NORTH_EAST: y += dy; h -= dy; w += dx; break; - case GDK_WINDOW_EDGE_SOUTH_WEST: + case GDK_SURFACE_EDGE_SOUTH_WEST: h += dy; x += dx; w -= dx; break; - case GDK_WINDOW_EDGE_SOUTH_EAST: + case GDK_SURFACE_EDGE_SOUTH_EAST: w += dx; h += dy; break; - case GDK_WINDOW_EDGE_SOUTH: + case GDK_SURFACE_EDGE_SOUTH: h += dy; break; - case GDK_WINDOW_EDGE_EAST: + case GDK_SURFACE_EDGE_EAST: w += dx; break; - case GDK_WINDOW_EDGE_WEST: + case GDK_SURFACE_EDGE_WEST: x += dx; w -= dx; break; @@ -4170,12 +4170,12 @@ update_pos (MoveResizeData *mv_resize, if (mv_resize->moveresize_geom_mask) { - gdk_window_constrain_size (&mv_resize->moveresize_geometry, + gdk_surface_constrain_size (&mv_resize->moveresize_geometry, mv_resize->moveresize_geom_mask, w, h, &w, &h); } - gdk_window_move_resize (mv_resize->moveresize_window, x, y, w, h); + gdk_surface_move_resize (mv_resize->moveresize_window, x, y, w, h); } else { @@ -4184,14 +4184,14 @@ update_pos (MoveResizeData *mv_resize, x = mv_resize->moveresize_orig_x + dx; y = mv_resize->moveresize_orig_y + dy; - gdk_window_move (mv_resize->moveresize_window, x, y); + gdk_surface_move (mv_resize->moveresize_window, x, y); } } static void finish_drag (MoveResizeData *mv_resize) { - gdk_window_destroy (mv_resize->moveresize_emulation_window); + gdk_surface_destroy (mv_resize->moveresize_emulation_window); mv_resize->moveresize_emulation_window = NULL; g_clear_object (&mv_resize->moveresize_window); g_clear_pointer (&mv_resize->moveresize_pending_event, g_free); @@ -4254,7 +4254,7 @@ _gdk_x11_moveresize_handle_event (const XEvent *event) guint button_mask = 0; GdkDisplay *display = gdk_x11_lookup_xdisplay (event->xany.display); MoveResizeData *mv_resize = get_move_resize_data (display, FALSE); - GdkWindowImplX11 *impl; + GdkSurfaceImplX11 *impl; if (!mv_resize || !mv_resize->moveresize_window) { @@ -4262,7 +4262,7 @@ _gdk_x11_moveresize_handle_event (const XEvent *event) return FALSE; } - impl = GDK_WINDOW_IMPL_X11 (mv_resize->moveresize_window->impl); + impl = GDK_SURFACE_IMPL_X11 (mv_resize->moveresize_window->impl); if (mv_resize->moveresize_button != 0) button_mask = GDK_BUTTON1_MASK << (mv_resize->moveresize_button - 1); @@ -4363,7 +4363,7 @@ _gdk_x11_moveresize_handle_event (const XEvent *event) gboolean _gdk_x11_moveresize_configure_done (GdkDisplay *display, - GdkWindow *window) + GdkSurface *window) { XEvent *tmp_event; MoveResizeData *mv_resize = get_move_resize_data (display, FALSE); @@ -4390,8 +4390,8 @@ create_moveresize_window (MoveResizeData *mv_resize, g_assert (mv_resize->moveresize_emulation_window == NULL); - mv_resize->moveresize_emulation_window = gdk_window_new_temp (mv_resize->display); - gdk_window_show (mv_resize->moveresize_emulation_window); + mv_resize->moveresize_emulation_window = gdk_surface_new_temp (mv_resize->display); + gdk_surface_show (mv_resize->moveresize_emulation_window); status = gdk_seat_grab (gdk_device_get_seat (mv_resize->device), mv_resize->moveresize_emulation_window, @@ -4425,14 +4425,14 @@ calculate_unmoving_origin (MoveResizeData *mv_resize) if (mv_resize->moveresize_geom_mask & GDK_HINT_WIN_GRAVITY && mv_resize->moveresize_geometry.win_gravity == GDK_GRAVITY_STATIC) { - gdk_window_get_origin (mv_resize->moveresize_window, + gdk_surface_get_origin (mv_resize->moveresize_window, &mv_resize->moveresize_orig_x, &mv_resize->moveresize_orig_y); } else { - gdk_window_get_frame_extents (mv_resize->moveresize_window, &rect); - gdk_window_get_geometry (mv_resize->moveresize_window, + gdk_surface_get_frame_extents (mv_resize->moveresize_window, &rect); + gdk_surface_get_geometry (mv_resize->moveresize_window, NULL, NULL, &width, &height); switch (mv_resize->moveresize_geometry.win_gravity) @@ -4483,15 +4483,15 @@ calculate_unmoving_origin (MoveResizeData *mv_resize) } static void -emulate_resize_drag (GdkWindow *window, - GdkWindowEdge edge, +emulate_resize_drag (GdkSurface *window, + GdkSurfaceEdge edge, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp) { - MoveResizeData *mv_resize = get_move_resize_data (GDK_WINDOW_DISPLAY (window), TRUE); + MoveResizeData *mv_resize = get_move_resize_data (GDK_SURFACE_DISPLAY (window), TRUE); if (mv_resize->moveresize_window != NULL) return; /* already a drag operation in progress */ @@ -4504,11 +4504,11 @@ emulate_resize_drag (GdkWindow *window, mv_resize->moveresize_y = root_y; mv_resize->moveresize_window = g_object_ref (window); - mv_resize->moveresize_orig_width = gdk_window_get_width (window); - mv_resize->moveresize_orig_height = gdk_window_get_height (window); + mv_resize->moveresize_orig_width = gdk_surface_get_width (window); + mv_resize->moveresize_orig_height = gdk_surface_get_height (window); mv_resize->moveresize_geom_mask = 0; - gdk_window_get_geometry_hints (window, + gdk_surface_get_geometry_hints (window, &mv_resize->moveresize_geometry, &mv_resize->moveresize_geom_mask); @@ -4518,14 +4518,14 @@ emulate_resize_drag (GdkWindow *window, } static void -emulate_move_drag (GdkWindow *window, +emulate_move_drag (GdkSurface *window, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp) { - MoveResizeData *mv_resize = get_move_resize_data (GDK_WINDOW_DISPLAY (window), TRUE); + MoveResizeData *mv_resize = get_move_resize_data (GDK_SURFACE_DISPLAY (window), TRUE); if (mv_resize->moveresize_window != NULL) return; /* already a drag operation in progress */ @@ -4544,17 +4544,17 @@ emulate_move_drag (GdkWindow *window, } static gboolean -_should_perform_ewmh_drag (GdkWindow *window, +_should_perform_ewmh_drag (GdkSurface *window, GdkDevice *device) { - GdkPointerWindowInfo *info; + GdkPointerSurfaceInfo *info; GdkDisplay *display; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); info = _gdk_display_get_pointer_info (display, device); if ((!info->last_slave || gdk_device_get_source (info->last_slave) != GDK_SOURCE_TOUCHSCREEN) && - gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window), + gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window), g_intern_static_string ("_NET_WM_MOVERESIZE"))) return TRUE; @@ -4562,15 +4562,15 @@ _should_perform_ewmh_drag (GdkWindow *window, } static void -gdk_x11_window_begin_resize_drag (GdkWindow *window, - GdkWindowEdge edge, +gdk_x11_surface_begin_resize_drag (GdkSurface *window, + GdkSurfaceEdge edge, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp) { - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) return; @@ -4582,7 +4582,7 @@ gdk_x11_window_begin_resize_drag (GdkWindow *window, } static void -gdk_x11_window_begin_move_drag (GdkWindow *window, +gdk_x11_surface_begin_move_drag (GdkSurface *window, GdkDevice *device, gint button, gint root_x, @@ -4591,7 +4591,7 @@ gdk_x11_window_begin_move_drag (GdkWindow *window, { gint direction; - if (GDK_WINDOW_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; if (button == 0) @@ -4607,17 +4607,17 @@ gdk_x11_window_begin_move_drag (GdkWindow *window, } static gboolean -gdk_x11_window_beep (GdkWindow *window) +gdk_x11_surface_beep (GdkSurface *window) { GdkDisplay *display; - display = GDK_WINDOW_DISPLAY (window); + display = GDK_SURFACE_DISPLAY (window); #ifdef HAVE_XKB if (GDK_X11_DISPLAY (display)->use_xkb) { XkbBell (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), 0, None); return TRUE; @@ -4628,19 +4628,19 @@ gdk_x11_window_beep (GdkWindow *window) } static void -gdk_x11_window_set_opacity (GdkWindow *window, +gdk_x11_surface_set_opacity (GdkSurface *window, gdouble opacity) { GdkDisplay *display; gulong cardinal; - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - if (GDK_WINDOW_DESTROYED (window) || + if (GDK_SURFACE_DESTROYED (window) || !WINDOW_IS_TOPLEVEL (window)) return; - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); if (opacity < 0) opacity = 0; @@ -4651,11 +4651,11 @@ gdk_x11_window_set_opacity (GdkWindow *window, if (cardinal == 0xffffffff) XDeleteProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_OPACITY")); else XChangeProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_WINDOW_OPACITY"), XA_CARDINAL, 32, PropModeReplace, @@ -4681,7 +4681,7 @@ timestamp_predicate (Display *display, /** * gdk_x11_get_server_time: - * @window: (type GdkX11Window): a #GdkWindow, used for communication + * @window: (type GdkX11Surface): a #GdkSurface, used for communication * with the server. The window must have * GDK_PROPERTY_CHANGE_MASK in its events mask or a hang will * result. @@ -4691,7 +4691,7 @@ timestamp_predicate (Display *display, * Returns: the time stamp. **/ guint32 -gdk_x11_get_server_time (GdkWindow *window) +gdk_x11_get_server_time (GdkSurface *window) { Display *xdisplay; Window xwindow; @@ -4699,13 +4699,13 @@ gdk_x11_get_server_time (GdkWindow *window) XEvent xevent; Atom timestamp_prop_atom; - g_return_val_if_fail (GDK_IS_WINDOW (window), 0); - g_return_val_if_fail (!GDK_WINDOW_DESTROYED (window), 0); + g_return_val_if_fail (GDK_IS_SURFACE (window), 0); + g_return_val_if_fail (!GDK_SURFACE_DESTROYED (window), 0); - xdisplay = GDK_WINDOW_XDISPLAY (window); - xwindow = GDK_WINDOW_XID (window); + xdisplay = GDK_SURFACE_XDISPLAY (window); + xwindow = GDK_SURFACE_XID (window); timestamp_prop_atom = - gdk_x11_get_xatom_by_name_for_display (GDK_WINDOW_DISPLAY (window), + gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (window), "GDK_TIMESTAMP_PROP"); XChangeProperty (xdisplay, xwindow, timestamp_prop_atom, @@ -4719,40 +4719,40 @@ gdk_x11_get_server_time (GdkWindow *window) } /** - * gdk_x11_window_get_xid: - * @window: (type GdkX11Window): a native #GdkWindow. + * gdk_x11_surface_get_xid: + * @window: (type GdkX11Surface): a native #GdkSurface. * - * Returns the X resource (window) belonging to a #GdkWindow. + * Returns the X resource (window) belonging to a #GdkSurface. * * Returns: the ID of @drawable’s X resource. **/ XID -gdk_x11_window_get_xid (GdkWindow *window) +gdk_x11_surface_get_xid (GdkSurface *window) { - if (!GDK_WINDOW_IS_X11 (window) || - !_gdk_window_has_impl (window)) + if (!GDK_SURFACE_IS_X11 (window) || + !_gdk_surface_has_impl (window)) { g_warning (G_STRLOC " drawable is not a native X11 window"); return None; } - return GDK_WINDOW_IMPL_X11 (window->impl)->xid; + return GDK_SURFACE_IMPL_X11 (window->impl)->xid; } static gint -gdk_x11_window_get_scale_factor (GdkWindow *window) +gdk_x11_surface_get_scale_factor (GdkSurface *window) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return 1; return impl->window_scale; } /** - * gdk_x11_window_set_frame_sync_enabled: - * @window: (type GdkX11Window): a native #GdkWindow + * gdk_x11_surface_set_frame_sync_enabled: + * @window: (type GdkX11Surface): a native #GdkSurface * @frame_sync_enabled: whether frame-synchronization should be enabled * * This function can be used to disable frame synchronization for a window. @@ -4763,29 +4763,29 @@ gdk_x11_window_get_scale_factor (GdkWindow *window) * embedded via the XEMBED protocol. */ void -gdk_x11_window_set_frame_sync_enabled (GdkWindow *window, +gdk_x11_surface_set_frame_sync_enabled (GdkSurface *window, gboolean frame_sync_enabled) { - if (!GDK_WINDOW_IS_X11 (window) || - !_gdk_window_has_impl (window)) + if (!GDK_SURFACE_IS_X11 (window) || + !_gdk_surface_has_impl (window)) { g_warning (G_STRLOC " drawable is not a native X11 window"); return; } - GDK_WINDOW_IMPL_X11 (window->impl)->frame_sync_enabled = FALSE; + GDK_SURFACE_IMPL_X11 (window->impl)->frame_sync_enabled = FALSE; } static void -gdk_x11_window_set_opaque_region (GdkWindow *window, +gdk_x11_surface_set_opaque_region (GdkSurface *window, cairo_region_t *region) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); GdkDisplay *display; int nitems; gulong *data; - if (GDK_WINDOW_DESTROYED (window)) + if (GDK_SURFACE_DESTROYED (window)) return; if (region != NULL) @@ -4812,10 +4812,10 @@ gdk_x11_window_set_opaque_region (GdkWindow *window, data = NULL; } - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); XChangeProperty (GDK_DISPLAY_XDISPLAY (display), - GDK_WINDOW_XID (window), + GDK_SURFACE_XID (window), gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_OPAQUE_REGION"), XA_CARDINAL, 32, PropModeReplace, (guchar *) data, nitems); @@ -4824,11 +4824,11 @@ gdk_x11_window_set_opaque_region (GdkWindow *window, } static gboolean -gdk_x11_window_show_window_menu (GdkWindow *window, +gdk_x11_surface_show_window_menu (GdkSurface *window, GdkEvent *event) { - GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl); - GdkDisplay *display = GDK_WINDOW_DISPLAY (window); + GdkSurfaceImplX11 *impl = GDK_SURFACE_IMPL_X11 (window->impl); + GdkDisplay *display = GDK_SURFACE_DISPLAY (window); GdkDevice *device; int device_id; double x_root, y_root; @@ -4843,7 +4843,7 @@ gdk_x11_window_show_window_menu (GdkWindow *window, return FALSE; } - if (!gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window), + if (!gdk_x11_screen_supports_net_wm_hint (GDK_SURFACE_SCREEN (window), g_intern_static_string ("_GTK_SHOW_WINDOW_MENU"))) return FALSE; @@ -4857,14 +4857,14 @@ gdk_x11_window_show_window_menu (GdkWindow *window, gdk_seat_ungrab (gdk_device_get_seat (device)); xclient.type = ClientMessage; - xclient.window = GDK_WINDOW_XID (window); + xclient.window = GDK_SURFACE_XID (window); xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "_GTK_SHOW_WINDOW_MENU"); xclient.data.l[0] = device_id; xclient.data.l[1] = x_root * impl->window_scale; xclient.data.l[2] = y_root * impl->window_scale; xclient.format = 32; - XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XROOTWIN (window), False, + XSendEvent (GDK_DISPLAY_XDISPLAY (display), GDK_SURFACE_XROOTWIN (window), False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent *)&xclient); @@ -4872,77 +4872,77 @@ gdk_x11_window_show_window_menu (GdkWindow *window, } static void -gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass) +gdk_surface_impl_x11_class_init (GdkSurfaceImplX11Class *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - GdkWindowImplClass *impl_class = GDK_WINDOW_IMPL_CLASS (klass); + GdkSurfaceImplClass *impl_class = GDK_SURFACE_IMPL_CLASS (klass); - object_class->finalize = gdk_window_impl_x11_finalize; + object_class->finalize = gdk_surface_impl_x11_finalize; impl_class->ref_cairo_surface = gdk_x11_ref_cairo_surface; - impl_class->show = gdk_window_x11_show; - impl_class->hide = gdk_window_x11_hide; - impl_class->withdraw = gdk_window_x11_withdraw; - impl_class->set_events = gdk_window_x11_set_events; - impl_class->get_events = gdk_window_x11_get_events; - impl_class->raise = gdk_window_x11_raise; - impl_class->lower = gdk_window_x11_lower; - impl_class->restack_toplevel = gdk_window_x11_restack_toplevel; - impl_class->move_resize = gdk_window_x11_move_resize; - impl_class->get_geometry = gdk_window_x11_get_geometry; - impl_class->get_root_coords = gdk_window_x11_get_root_coords; - impl_class->get_device_state = gdk_window_x11_get_device_state; - impl_class->shape_combine_region = gdk_window_x11_shape_combine_region; - impl_class->input_shape_combine_region = gdk_window_x11_input_shape_combine_region; - impl_class->queue_antiexpose = _gdk_x11_window_queue_antiexpose; - impl_class->destroy = gdk_x11_window_destroy; - impl_class->beep = gdk_x11_window_beep; - - impl_class->focus = gdk_x11_window_focus; - impl_class->set_type_hint = gdk_x11_window_set_type_hint; - impl_class->get_type_hint = gdk_x11_window_get_type_hint; - impl_class->set_modal_hint = gdk_x11_window_set_modal_hint; - impl_class->set_skip_taskbar_hint = gdk_x11_window_set_skip_taskbar_hint; - impl_class->set_skip_pager_hint = gdk_x11_window_set_skip_pager_hint; - impl_class->set_urgency_hint = gdk_x11_window_set_urgency_hint; - impl_class->set_geometry_hints = gdk_x11_window_set_geometry_hints; - impl_class->set_title = gdk_x11_window_set_title; - impl_class->set_role = gdk_x11_window_set_role; - impl_class->set_startup_id = gdk_x11_window_set_startup_id; - impl_class->set_transient_for = gdk_x11_window_set_transient_for; - impl_class->get_frame_extents = gdk_x11_window_get_frame_extents; - impl_class->set_accept_focus = gdk_x11_window_set_accept_focus; - impl_class->set_focus_on_map = gdk_x11_window_set_focus_on_map; - impl_class->set_icon_list = gdk_x11_window_set_icon_list; - impl_class->set_icon_name = gdk_x11_window_set_icon_name; - impl_class->iconify = gdk_x11_window_iconify; - impl_class->deiconify = gdk_x11_window_deiconify; - impl_class->stick = gdk_x11_window_stick; - impl_class->unstick = gdk_x11_window_unstick; - impl_class->maximize = gdk_x11_window_maximize; - impl_class->unmaximize = gdk_x11_window_unmaximize; - impl_class->fullscreen = gdk_x11_window_fullscreen; - impl_class->fullscreen_on_monitor = gdk_x11_window_fullscreen_on_monitor; - impl_class->apply_fullscreen_mode = gdk_x11_window_apply_fullscreen_mode; - impl_class->unfullscreen = gdk_x11_window_unfullscreen; - impl_class->set_keep_above = gdk_x11_window_set_keep_above; - impl_class->set_keep_below = gdk_x11_window_set_keep_below; - impl_class->get_group = gdk_x11_window_get_group; - impl_class->set_group = gdk_x11_window_set_group; - impl_class->set_decorations = gdk_x11_window_set_decorations; - impl_class->get_decorations = gdk_x11_window_get_decorations; - impl_class->set_functions = gdk_x11_window_set_functions; - impl_class->begin_resize_drag = gdk_x11_window_begin_resize_drag; - impl_class->begin_move_drag = gdk_x11_window_begin_move_drag; - impl_class->set_opacity = gdk_x11_window_set_opacity; - impl_class->destroy_notify = gdk_x11_window_destroy_notify; - impl_class->register_dnd = _gdk_x11_window_register_dnd; - impl_class->drag_begin = _gdk_x11_window_drag_begin; - impl_class->get_scale_factor = gdk_x11_window_get_scale_factor; - impl_class->set_opaque_region = gdk_x11_window_set_opaque_region; - impl_class->set_shadow_width = gdk_x11_window_set_shadow_width; - impl_class->show_window_menu = gdk_x11_window_show_window_menu; - impl_class->create_gl_context = gdk_x11_window_create_gl_context; - impl_class->get_unscaled_size = gdk_x11_window_get_unscaled_size; - impl_class->supports_edge_constraints = gdk_x11_window_supports_edge_constraints; + impl_class->show = gdk_surface_x11_show; + impl_class->hide = gdk_surface_x11_hide; + impl_class->withdraw = gdk_surface_x11_withdraw; + impl_class->set_events = gdk_surface_x11_set_events; + impl_class->get_events = gdk_surface_x11_get_events; + impl_class->raise = gdk_surface_x11_raise; + impl_class->lower = gdk_surface_x11_lower; + impl_class->restack_toplevel = gdk_surface_x11_restack_toplevel; + impl_class->move_resize = gdk_surface_x11_move_resize; + impl_class->get_geometry = gdk_surface_x11_get_geometry; + impl_class->get_root_coords = gdk_surface_x11_get_root_coords; + impl_class->get_device_state = gdk_surface_x11_get_device_state; + impl_class->shape_combine_region = gdk_surface_x11_shape_combine_region; + impl_class->input_shape_combine_region = gdk_surface_x11_input_shape_combine_region; + impl_class->queue_antiexpose = _gdk_x11_surface_queue_antiexpose; + impl_class->destroy = gdk_x11_surface_destroy; + impl_class->beep = gdk_x11_surface_beep; + + impl_class->focus = gdk_x11_surface_focus; + impl_class->set_type_hint = gdk_x11_surface_set_type_hint; + impl_class->get_type_hint = gdk_x11_surface_get_type_hint; + impl_class->set_modal_hint = gdk_x11_surface_set_modal_hint; + impl_class->set_skip_taskbar_hint = gdk_x11_surface_set_skip_taskbar_hint; + impl_class->set_skip_pager_hint = gdk_x11_surface_set_skip_pager_hint; + impl_class->set_urgency_hint = gdk_x11_surface_set_urgency_hint; + impl_class->set_geometry_hints = gdk_x11_surface_set_geometry_hints; + impl_class->set_title = gdk_x11_surface_set_title; + impl_class->set_role = gdk_x11_surface_set_role; + impl_class->set_startup_id = gdk_x11_surface_set_startup_id; + impl_class->set_transient_for = gdk_x11_surface_set_transient_for; + impl_class->get_frame_extents = gdk_x11_surface_get_frame_extents; + impl_class->set_accept_focus = gdk_x11_surface_set_accept_focus; + impl_class->set_focus_on_map = gdk_x11_surface_set_focus_on_map; + impl_class->set_icon_list = gdk_x11_surface_set_icon_list; + impl_class->set_icon_name = gdk_x11_surface_set_icon_name; + impl_class->iconify = gdk_x11_surface_iconify; + impl_class->deiconify = gdk_x11_surface_deiconify; + impl_class->stick = gdk_x11_surface_stick; + impl_class->unstick = gdk_x11_surface_unstick; + impl_class->maximize = gdk_x11_surface_maximize; + impl_class->unmaximize = gdk_x11_surface_unmaximize; + impl_class->fullscreen = gdk_x11_surface_fullscreen; + impl_class->fullscreen_on_monitor = gdk_x11_surface_fullscreen_on_monitor; + impl_class->apply_fullscreen_mode = gdk_x11_surface_apply_fullscreen_mode; + impl_class->unfullscreen = gdk_x11_surface_unfullscreen; + impl_class->set_keep_above = gdk_x11_surface_set_keep_above; + impl_class->set_keep_below = gdk_x11_surface_set_keep_below; + impl_class->get_group = gdk_x11_surface_get_group; + impl_class->set_group = gdk_x11_surface_set_group; + impl_class->set_decorations = gdk_x11_surface_set_decorations; + impl_class->get_decorations = gdk_x11_surface_get_decorations; + impl_class->set_functions = gdk_x11_surface_set_functions; + impl_class->begin_resize_drag = gdk_x11_surface_begin_resize_drag; + impl_class->begin_move_drag = gdk_x11_surface_begin_move_drag; + impl_class->set_opacity = gdk_x11_surface_set_opacity; + impl_class->destroy_notify = gdk_x11_surface_destroy_notify; + impl_class->register_dnd = _gdk_x11_surface_register_dnd; + impl_class->drag_begin = _gdk_x11_surface_drag_begin; + impl_class->get_scale_factor = gdk_x11_surface_get_scale_factor; + impl_class->set_opaque_region = gdk_x11_surface_set_opaque_region; + impl_class->set_shadow_width = gdk_x11_surface_set_shadow_width; + impl_class->show_window_menu = gdk_x11_surface_show_window_menu; + impl_class->create_gl_context = gdk_x11_surface_create_gl_context; + impl_class->get_unscaled_size = gdk_x11_surface_get_unscaled_size; + impl_class->supports_edge_constraints = gdk_x11_surface_supports_edge_constraints; } diff --git a/gdk/x11/gdkwindow-x11.h b/gdk/x11/gdkwindow-x11.h index 2199692327..b824240ffc 100644 --- a/gdk/x11/gdkwindow-x11.h +++ b/gdk/x11/gdkwindow-x11.h @@ -22,8 +22,8 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#ifndef __GDK_WINDOW_X11_H__ -#define __GDK_WINDOW_X11_H__ +#ifndef __GDK_SURFACE_X11_H__ +#define __GDK_SURFACE_X11_H__ #include "gdk/x11/gdkprivate-x11.h" #include "gdk/gdkwindowimpl.h" @@ -42,25 +42,25 @@ G_BEGIN_DECLS typedef struct _GdkToplevelX11 GdkToplevelX11; -typedef struct _GdkWindowImplX11 GdkWindowImplX11; -typedef struct _GdkWindowImplX11Class GdkWindowImplX11Class; +typedef struct _GdkSurfaceImplX11 GdkSurfaceImplX11; +typedef struct _GdkSurfaceImplX11Class GdkSurfaceImplX11Class; typedef struct _GdkXPositionInfo GdkXPositionInfo; /* Window implementation for X11 */ -#define GDK_TYPE_WINDOW_IMPL_X11 (gdk_window_impl_x11_get_type ()) -#define GDK_WINDOW_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_X11, GdkWindowImplX11)) -#define GDK_WINDOW_IMPL_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL_X11, GdkWindowImplX11Class)) -#define GDK_IS_WINDOW_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_X11)) -#define GDK_IS_WINDOW_IMPL_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_X11)) -#define GDK_WINDOW_IMPL_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_X11, GdkWindowImplX11Class)) +#define GDK_TYPE_SURFACE_IMPL_X11 (gdk_surface_impl_x11_get_type ()) +#define GDK_SURFACE_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE_IMPL_X11, GdkSurfaceImplX11)) +#define GDK_SURFACE_IMPL_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE_IMPL_X11, GdkSurfaceImplX11Class)) +#define GDK_IS_SURFACE_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE_IMPL_X11)) +#define GDK_IS_SURFACE_IMPL_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE_IMPL_X11)) +#define GDK_SURFACE_IMPL_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE_IMPL_X11, GdkSurfaceImplX11Class)) -struct _GdkWindowImplX11 +struct _GdkSurfaceImplX11 { - GdkWindowImpl parent_instance; + GdkSurfaceImpl parent_instance; - GdkWindow *wrapper; + GdkSurface *wrapper; Window xid; @@ -91,9 +91,9 @@ struct _GdkWindowImplX11 #endif }; -struct _GdkWindowImplX11Class +struct _GdkSurfaceImplX11Class { - GdkWindowImplClass parent_class; + GdkSurfaceImplClass parent_class; }; struct _GdkToplevelX11 @@ -151,7 +151,7 @@ struct _GdkToplevelX11 cairo_surface_t *icon_pixmap; cairo_surface_t *icon_mask; - GdkWindow *group_leader; + GdkSurface *group_leader; /* Time of most recent user interaction. */ gulong user_time; @@ -162,7 +162,7 @@ struct _GdkToplevelX11 */ Window focus_window; - GdkWindowHints last_geometry_hints_mask; + GdkSurfaceHints last_geometry_hints_mask; GdkGeometry last_geometry_hints; /* Constrained edge information */ @@ -184,16 +184,16 @@ struct _GdkToplevelX11 #endif }; -GType gdk_window_impl_x11_get_type (void); +GType gdk_surface_impl_x11_get_type (void); -GdkToplevelX11 *_gdk_x11_window_get_toplevel (GdkWindow *window); +GdkToplevelX11 *_gdk_x11_surface_get_toplevel (GdkSurface *window); -GdkCursor *_gdk_x11_window_get_cursor (GdkWindow *window); +GdkCursor *_gdk_x11_surface_get_cursor (GdkSurface *window); -void _gdk_x11_window_update_size (GdkWindowImplX11 *impl); -void _gdk_x11_window_set_window_scale (GdkWindow *window, +void _gdk_x11_surface_update_size (GdkSurfaceImplX11 *impl); +void _gdk_x11_surface_set_window_scale (GdkSurface *window, int scale); G_END_DECLS -#endif /* __GDK_WINDOW_X11_H__ */ +#endif /* __GDK_SURFACE_X11_H__ */ diff --git a/gdk/x11/gdkx-autocleanups.h b/gdk/x11/gdkx-autocleanups.h index d18abfa48b..ff3d5a43a9 100644 --- a/gdk/x11/gdkx-autocleanups.h +++ b/gdk/x11/gdkx-autocleanups.h @@ -31,6 +31,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11DragContext, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11GLContext, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Keymap, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Screen, g_object_unref) -G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Window, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Surface, g_object_unref) #endif diff --git a/gdk/x11/gdkx11window.h b/gdk/x11/gdkx11window.h index a9c13189fc..d2fc1e4a60 100644 --- a/gdk/x11/gdkx11window.h +++ b/gdk/x11/gdkx11window.h @@ -22,8 +22,8 @@ * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ -#ifndef __GDK_X11_WINDOW_H__ -#define __GDK_X11_WINDOW_H__ +#ifndef __GDK_X11_SURFACE_H__ +#define __GDK_X11_SURFACE_H__ #if !defined (__GDKX_H_INSIDE__) && !defined (GDK_COMPILATION) #error "Only <gdk/gdkx.h> can be included directly." @@ -36,78 +36,78 @@ G_BEGIN_DECLS -#define GDK_TYPE_X11_WINDOW (gdk_x11_window_get_type ()) -#define GDK_X11_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_X11_WINDOW, GdkX11Window)) -#define GDK_X11_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_X11_WINDOW, GdkX11WindowClass)) -#define GDK_IS_X11_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_X11_WINDOW)) -#define GDK_IS_X11_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_X11_WINDOW)) -#define GDK_X11_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_X11_WINDOW, GdkX11WindowClass)) +#define GDK_TYPE_X11_SURFACE (gdk_x11_surface_get_type ()) +#define GDK_X11_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_X11_SURFACE, GdkX11Surface)) +#define GDK_X11_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_X11_SURFACE, GdkX11SurfaceClass)) +#define GDK_IS_X11_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_X11_SURFACE)) +#define GDK_IS_X11_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_X11_SURFACE)) +#define GDK_X11_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_X11_SURFACE, GdkX11SurfaceClass)) #ifdef GDK_COMPILATION -typedef struct _GdkX11Window GdkX11Window; +typedef struct _GdkX11Surface GdkX11Surface; #else -typedef GdkWindow GdkX11Window; +typedef GdkSurface GdkX11Surface; #endif -typedef struct _GdkX11WindowClass GdkX11WindowClass; +typedef struct _GdkX11SurfaceClass GdkX11SurfaceClass; GDK_AVAILABLE_IN_ALL -GType gdk_x11_window_get_type (void); +GType gdk_x11_surface_get_type (void); GDK_AVAILABLE_IN_ALL -Window gdk_x11_window_get_xid (GdkWindow *window); +Window gdk_x11_surface_get_xid (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_x11_window_set_user_time (GdkWindow *window, +void gdk_x11_surface_set_user_time (GdkSurface *window, guint32 timestamp); GDK_AVAILABLE_IN_ALL -void gdk_x11_window_set_utf8_property (GdkWindow *window, +void gdk_x11_surface_set_utf8_property (GdkSurface *window, const gchar *name, const gchar *value); GDK_AVAILABLE_IN_ALL -void gdk_x11_window_set_theme_variant (GdkWindow *window, +void gdk_x11_surface_set_theme_variant (GdkSurface *window, const char *variant); GDK_AVAILABLE_IN_ALL -void gdk_x11_window_move_to_current_desktop (GdkWindow *window); +void gdk_x11_surface_move_to_current_desktop (GdkSurface *window); GDK_AVAILABLE_IN_ALL -guint32 gdk_x11_window_get_desktop (GdkWindow *window); +guint32 gdk_x11_surface_get_desktop (GdkSurface *window); GDK_AVAILABLE_IN_ALL -void gdk_x11_window_move_to_desktop (GdkWindow *window, +void gdk_x11_surface_move_to_desktop (GdkSurface *window, guint32 desktop); GDK_AVAILABLE_IN_ALL -void gdk_x11_window_set_frame_sync_enabled (GdkWindow *window, +void gdk_x11_surface_set_frame_sync_enabled (GdkSurface *window, gboolean frame_sync_enabled); /** - * GDK_WINDOW_XDISPLAY: - * @win: a #GdkWindow. + * GDK_SURFACE_XDISPLAY: + * @win: a #GdkSurface. * - * Returns the display of a #GdkWindow. + * Returns the display of a #GdkSurface. * * Returns: an Xlib Display*. */ -#define GDK_WINDOW_XDISPLAY(win) (GDK_DISPLAY_XDISPLAY (gdk_window_get_display (win))) +#define GDK_SURFACE_XDISPLAY(win) (GDK_DISPLAY_XDISPLAY (gdk_surface_get_display (win))) /** - * GDK_WINDOW_XID: - * @win: a #GdkWindow. + * GDK_SURFACE_XID: + * @win: a #GdkSurface. * - * Returns the X window belonging to a #GdkWindow. + * Returns the X window belonging to a #GdkSurface. * * Returns: the Xlib Window of @win. */ -#define GDK_WINDOW_XID(win) (gdk_x11_window_get_xid (win)) +#define GDK_SURFACE_XID(win) (gdk_x11_surface_get_xid (win)) GDK_AVAILABLE_IN_ALL -guint32 gdk_x11_get_server_time (GdkWindow *window); +guint32 gdk_x11_get_server_time (GdkSurface *window); GDK_AVAILABLE_IN_ALL -GdkWindow *gdk_x11_window_foreign_new_for_display (GdkDisplay *display, +GdkSurface *gdk_x11_surface_foreign_new_for_display (GdkDisplay *display, Window window); GDK_AVAILABLE_IN_ALL -GdkWindow *gdk_x11_window_lookup_for_display (GdkDisplay *display, +GdkSurface *gdk_x11_surface_lookup_for_display (GdkDisplay *display, Window window); G_END_DECLS -#endif /* __GDK_X11_WINDOW_H__ */ +#endif /* __GDK_X11_SURFACE_H__ */ diff --git a/gdk/x11/gdkxid.c b/gdk/x11/gdkxid.c index d74b367b41..ec8bf6ab4e 100644 --- a/gdk/x11/gdkxid.c +++ b/gdk/x11/gdkxid.c @@ -44,7 +44,7 @@ gdk_xid_equal (XID *a, XID *b) void _gdk_x11_display_add_window (GdkDisplay *display, XID *xid, - GdkWindow *data) + GdkSurface *data) { GdkX11Display *display_x11; @@ -62,7 +62,7 @@ _gdk_x11_display_add_window (GdkDisplay *display, g_hash_table_insert (display_x11->xid_ht, xid, data); - if (gdk_window_get_parent (GDK_WINDOW (data)) == NULL) + if (gdk_surface_get_parent (GDK_SURFACE (data)) == NULL) display_x11->toplevels = g_list_prepend (display_x11->toplevels, data); } @@ -71,7 +71,7 @@ _gdk_x11_display_remove_window (GdkDisplay *display, XID xid) { GdkX11Display *display_x11; - GdkWindow *window; + GdkSurface *window; g_return_if_fail (GDK_IS_DISPLAY (display)); @@ -81,29 +81,29 @@ _gdk_x11_display_remove_window (GdkDisplay *display, return; window = g_hash_table_lookup (display_x11->xid_ht, &xid); - if (window && gdk_window_get_parent (window) == NULL) + if (window && gdk_surface_get_parent (window) == NULL) display_x11->toplevels = g_list_remove (display_x11->toplevels, window); g_hash_table_remove (display_x11->xid_ht, &xid); } /** - * gdk_x11_window_lookup_for_display: + * gdk_x11_surface_lookup_for_display: * @display: (type GdkX11Display): the #GdkDisplay corresponding to the * window handle * @window: an Xlib Window * - * Looks up the #GdkWindow that wraps the given native window handle. + * Looks up the #GdkSurface that wraps the given native window handle. * - * Returns: (transfer none) (type GdkX11Window): the #GdkWindow wrapper for the native + * Returns: (transfer none) (type GdkX11Surface): the #GdkSurface wrapper for the native * window, or %NULL if there is none. */ -GdkWindow * -gdk_x11_window_lookup_for_display (GdkDisplay *display, +GdkSurface * +gdk_x11_surface_lookup_for_display (GdkDisplay *display, Window window) { GdkX11Display *display_x11; - GdkWindow *data = NULL; + GdkSurface *data = NULL; g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c index f6137b7636..5e19fd9537 100644 --- a/gsk/gl/gskglrenderer.c +++ b/gsk/gl/gskglrenderer.c @@ -1889,7 +1889,7 @@ gsk_gl_renderer_create_programs (GskGLRenderer *self, static gboolean gsk_gl_renderer_realize (GskRenderer *renderer, - GdkWindow *window, + GdkSurface *window, GError **error) { GskGLRenderer *self = GSK_GL_RENDERER (renderer); @@ -1899,7 +1899,7 @@ gsk_gl_renderer_realize (GskRenderer *renderer, */ if (self->gl_context == NULL) { - self->gl_context = gdk_window_create_gl_context (window, error); + self->gl_context = gdk_surface_create_gl_context (window, error); if (self->gl_context == NULL) return FALSE; } @@ -1960,13 +1960,13 @@ gsk_gl_renderer_begin_draw_frame (GskRenderer *renderer, cairo_region_t *damage; GdkDrawingContext *result; GdkRectangle whole_window; - GdkWindow *window; + GdkSurface *window; window = gsk_renderer_get_window (renderer); whole_window = (GdkRectangle) { 0, 0, - gdk_window_get_width (window) * self->scale_factor, - gdk_window_get_height (window) * self->scale_factor + gdk_surface_get_width (window) * self->scale_factor, + gdk_surface_get_height (window) * self->scale_factor }; damage = gdk_gl_context_get_damage (self->gl_context); cairo_region_union (damage, update_area); @@ -1988,7 +1988,7 @@ gsk_gl_renderer_begin_draw_frame (GskRenderer *renderer, self->render_mode = RENDER_SCISSOR; } - result = gdk_window_begin_draw_frame (window, + result = gdk_surface_begin_draw_frame (window, GDK_DRAW_CONTEXT (self->gl_context), damage); @@ -2051,7 +2051,7 @@ gsk_gl_renderer_setup_render_mode (GskGLRenderer *self) case RENDER_SCISSOR: { GdkDrawingContext *context = gsk_renderer_get_drawing_context (GSK_RENDERER (self)); - GdkWindow *window = gsk_renderer_get_window (GSK_RENDERER (self)); + GdkSurface *window = gsk_renderer_get_window (GSK_RENDERER (self)); cairo_region_t *clip = gdk_drawing_context_get_clip (context); cairo_rectangle_int_t extents; int window_height; @@ -2065,7 +2065,7 @@ gsk_gl_renderer_setup_render_mode (GskGLRenderer *self) g_assert (cairo_region_num_rectangles (clip) == 1); - window_height = gdk_window_get_height (window) * self->scale_factor; + window_height = gdk_surface_get_height (window) * self->scale_factor; /*cairo_region_get_extents (clip, &extents);*/ cairo_region_get_rectangle (clip, 0, &extents); @@ -2570,7 +2570,7 @@ gsk_gl_renderer_render_texture (GskRenderer *renderer, width = ceilf (viewport->size.width); height = ceilf (viewport->size.height); - self->scale_factor = gdk_window_get_scale_factor (gsk_renderer_get_window (renderer)); + self->scale_factor = gdk_surface_get_scale_factor (gsk_renderer_get_window (renderer)); gdk_gl_context_make_current (self->gl_context); /* Prepare our framebuffer */ @@ -2608,19 +2608,19 @@ gsk_gl_renderer_render (GskRenderer *renderer, GskRenderNode *root) { GskGLRenderer *self = GSK_GL_RENDERER (renderer); - GdkWindow *window = gsk_renderer_get_window (renderer); + GdkSurface *window = gsk_renderer_get_window (renderer); graphene_rect_t viewport; if (self->gl_context == NULL) return; - self->scale_factor = gdk_window_get_scale_factor (window); + self->scale_factor = gdk_surface_get_scale_factor (window); gdk_gl_context_make_current (self->gl_context); viewport.origin.x = 0; viewport.origin.y = 0; - viewport.size.width = gdk_window_get_width (window) * self->scale_factor; - viewport.size.height = gdk_window_get_height (window) * self->scale_factor; + viewport.size.width = gdk_surface_get_width (window) * self->scale_factor; + viewport.size.height = gdk_surface_get_height (window) * self->scale_factor; gsk_gl_renderer_do_render (renderer, root, &viewport, 0, self->scale_factor); diff --git a/gsk/gskbroadwayrenderer.c b/gsk/gskbroadwayrenderer.c index 887befdd4a..ca58331ad1 100644 --- a/gsk/gskbroadwayrenderer.c +++ b/gsk/gskbroadwayrenderer.c @@ -24,7 +24,7 @@ G_DEFINE_TYPE (GskBroadwayRenderer, gsk_broadway_renderer, GSK_TYPE_RENDERER) static gboolean gsk_broadway_renderer_realize (GskRenderer *self, - GdkWindow *window, + GdkSurface *window, GError **error) { return TRUE; @@ -43,16 +43,16 @@ gsk_broadway_renderer_begin_draw_frame (GskRenderer *renderer, cairo_region_t *region; GdkDrawingContext *result; cairo_rectangle_int_t whole_window; - GdkWindow *window; + GdkSurface *window; window = gsk_renderer_get_window (renderer); whole_window = (cairo_rectangle_int_t) { 0, 0, - gdk_window_get_width (window), - gdk_window_get_height (window) + gdk_surface_get_width (window), + gdk_surface_get_height (window) }; region = cairo_region_create_rectangle (&whole_window); - result = gdk_window_begin_draw_frame (window, NULL, region); + result = gdk_surface_begin_draw_frame (window, NULL, region); cairo_region_destroy (region); return result; @@ -686,12 +686,12 @@ static void gsk_broadway_renderer_render (GskRenderer *self, GskRenderNode *root) { - GdkWindow *window = gsk_renderer_get_window (self); + GdkSurface *window = gsk_renderer_get_window (self); GArray *nodes = g_array_new (FALSE, FALSE, sizeof(guint32)); GPtrArray *node_textures = g_ptr_array_new_with_free_func (g_object_unref); gsk_broadway_renderer_add_node (self, nodes, node_textures, root, 0, 0); - gdk_broadway_window_set_nodes (window, nodes, node_textures); + gdk_broadway_surface_set_nodes (window, nodes, node_textures); g_array_unref (nodes); g_ptr_array_unref (node_textures); } diff --git a/gsk/gskcairorenderer.c b/gsk/gskcairorenderer.c index ca0b493b7a..4fa3d07b57 100644 --- a/gsk/gskcairorenderer.c +++ b/gsk/gskcairorenderer.c @@ -32,7 +32,7 @@ G_DEFINE_TYPE (GskCairoRenderer, gsk_cairo_renderer, GSK_TYPE_RENDERER) static gboolean gsk_cairo_renderer_realize (GskRenderer *renderer, - GdkWindow *window, + GdkSurface *window, GError **error) { return TRUE; @@ -99,7 +99,7 @@ gsk_cairo_renderer_render (GskRenderer *renderer, GskRenderNode *root) { GdkDrawingContext *context = gsk_renderer_get_drawing_context (renderer); - GdkWindow *window = gsk_renderer_get_window (renderer); + GdkSurface *window = gsk_renderer_get_window (renderer); cairo_t *cr; @@ -114,7 +114,7 @@ gsk_cairo_renderer_render (GskRenderer *renderer, cairo_set_operator (cr, CAIRO_OPERATOR_OVER); cairo_rectangle (cr, 0, 0, - gdk_window_get_width (window), gdk_window_get_height (window)); + gdk_surface_get_width (window), gdk_surface_get_height (window)); cairo_set_source_rgba (cr, 0, 0, 0.85, 0.5); cairo_stroke (cr); cairo_restore (cr); diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c index 877aea7106..fb8f675d0d 100644 --- a/gsk/gskrenderer.c +++ b/gsk/gskrenderer.c @@ -25,7 +25,7 @@ * tree of #GskRenderNode instances. * * Typically you will use a #GskRenderer instance with a #GdkDrawingContext - * associated to a #GdkWindow, and call gsk_renderer_render() with the + * associated to a #GdkSurface, and call gsk_renderer_render() with the * drawing context and the scene to be rendered. * * It is necessary to realize a #GskRenderer instance using gsk_renderer_realize() @@ -69,7 +69,7 @@ typedef struct GskScalingFilter min_filter; GskScalingFilter mag_filter; - GdkWindow *window; + GdkSurface *window; GdkDrawingContext *drawing_context; GskRenderNode *root_node; GdkDisplay *display; @@ -98,7 +98,7 @@ static GParamSpec *gsk_renderer_properties[N_PROPS]; static gboolean gsk_renderer_real_realize (GskRenderer *self, - GdkWindow *window, + GdkSurface *window, GError **error) { GSK_RENDERER_WARN_NOT_IMPLEMENTED_METHOD (self, realize); @@ -126,7 +126,7 @@ gsk_renderer_real_begin_draw_frame (GskRenderer *self, { GskRendererPrivate *priv = gsk_renderer_get_instance_private (self); - return gdk_window_begin_draw_frame (priv->window, + return gdk_surface_begin_draw_frame (priv->window, NULL, region); } @@ -137,7 +137,7 @@ gsk_renderer_real_end_draw_frame (GskRenderer *self, { GskRendererPrivate *priv = gsk_renderer_get_instance_private (self); - gdk_window_end_draw_frame (priv->window, + gdk_surface_end_draw_frame (priv->window, context); } @@ -155,7 +155,7 @@ gsk_renderer_real_create_cairo_surface (GskRenderer *self, int height) { GskRendererPrivate *priv = gsk_renderer_get_instance_private (self); - int scale_factor = priv->window ? gdk_window_get_scale_factor (priv->window) : 1; + int scale_factor = priv->window ? gdk_surface_get_scale_factor (priv->window) : 1; int real_width = width * scale_factor; int real_height = height * scale_factor; @@ -286,7 +286,7 @@ gsk_renderer_class_init (GskRendererClass *klass) g_param_spec_object ("window", "Window", "The window associated to the renderer", - GDK_TYPE_WINDOW, + GDK_TYPE_SURFACE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); @@ -319,12 +319,12 @@ gsk_renderer_init (GskRenderer *self) * gsk_renderer_get_window: * @renderer: a #GskRenderer * - * Retrieves the #GdkWindow set using gsk_renderer_realize(). If the renderer + * Retrieves the #GdkSurface set using gsk_renderer_realize(). If the renderer * has not been realized yet, %NULL will be returned. * - * Returns: (transfer none) (nullable): a #GdkWindow + * Returns: (transfer none) (nullable): a #GdkSurface */ -GdkWindow * +GdkSurface * gsk_renderer_get_window (GskRenderer *renderer) { GskRendererPrivate *priv = gsk_renderer_get_instance_private (renderer); @@ -409,7 +409,7 @@ gsk_renderer_is_realized (GskRenderer *renderer) /** * gsk_renderer_realize: * @renderer: a #GskRenderer - * @window: the #GdkWindow renderer will be used on + * @window: the #GdkSurface renderer will be used on * @error: return location for an error * * Creates the resources needed by the @renderer to render the scene @@ -417,14 +417,14 @@ gsk_renderer_is_realized (GskRenderer *renderer) */ gboolean gsk_renderer_realize (GskRenderer *renderer, - GdkWindow *window, + GdkSurface *window, GError **error) { GskRendererPrivate *priv = gsk_renderer_get_instance_private (renderer); g_return_val_if_fail (GSK_IS_RENDERER (renderer), FALSE); g_return_val_if_fail (!gsk_renderer_is_realized (renderer), FALSE); - g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE); + g_return_val_if_fail (GDK_IS_SURFACE (window), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); priv->window = g_object_ref (window); @@ -625,9 +625,9 @@ get_renderer_for_name (const char *renderer_name) } static GType -get_renderer_for_display (GdkWindow *window) +get_renderer_for_display (GdkSurface *window) { - GdkDisplay *display = gdk_window_get_display (window); + GdkDisplay *display = gdk_surface_get_display (window); const char *renderer_name; renderer_name = g_object_get_data (G_OBJECT (display), "gsk-renderer"); @@ -635,7 +635,7 @@ get_renderer_for_display (GdkWindow *window) } static GType -get_renderer_for_env_var (GdkWindow *window) +get_renderer_for_env_var (GdkSurface *window) { static GType env_var_type = G_TYPE_NONE; @@ -649,18 +649,18 @@ get_renderer_for_env_var (GdkWindow *window) } static GType -get_renderer_for_backend (GdkWindow *window) +get_renderer_for_backend (GdkSurface *window) { #ifdef GDK_WINDOWING_X11 - if (GDK_IS_X11_WINDOW (window)) + if (GDK_IS_X11_SURFACE (window)) return GSK_TYPE_GL_RENDERER; #endif #ifdef GDK_WINDOWING_WAYLAND - if (GDK_IS_WAYLAND_WINDOW (window)) + if (GDK_IS_WAYLAND_SURFACE (window)) return GSK_TYPE_GL_RENDERER; #endif #ifdef GDK_WINDOWING_BROADWAY - if (GDK_IS_BROADWAY_WINDOW (window)) + if (GDK_IS_BROADWAY_SURFACE (window)) return GSK_TYPE_BROADWAY_RENDERER; #endif @@ -668,14 +668,14 @@ get_renderer_for_backend (GdkWindow *window) } static GType -get_renderer_fallback (GdkWindow *window) +get_renderer_fallback (GdkSurface *window) { return GSK_TYPE_CAIRO_RENDERER; } static struct { gboolean verbose; - GType (* get_renderer) (GdkWindow *window); + GType (* get_renderer) (GdkSurface *window); } renderer_possibilities[] = { { TRUE, get_renderer_for_display }, { TRUE, get_renderer_for_env_var }, @@ -685,7 +685,7 @@ static struct { /** * gsk_renderer_new_for_window: - * @window: a #GdkWindow + * @window: a #GdkSurface * * Creates an appropriate #GskRenderer instance for the given @window. * @@ -694,7 +694,7 @@ static struct { * Returns: (transfer full) (nullable): a #GskRenderer */ GskRenderer * -gsk_renderer_new_for_window (GdkWindow *window) +gsk_renderer_new_for_window (GdkSurface *window) { GType renderer_type; GskRenderer *renderer; @@ -702,7 +702,7 @@ gsk_renderer_new_for_window (GdkWindow *window) gboolean verbose = FALSE; guint i; - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); for (i = 0; i < G_N_ELEMENTS (renderer_possibilities); i++) { @@ -715,7 +715,7 @@ gsk_renderer_new_for_window (GdkWindow *window) */ verbose |= renderer_possibilities[i].verbose; renderer = g_object_new (renderer_type, - "display", gdk_window_get_display (window), + "display", gdk_surface_get_display (window), NULL); if (gsk_renderer_realize (renderer, window, &error)) @@ -784,8 +784,8 @@ gsk_renderer_begin_draw_frame (GskRenderer *renderer, full_window = cairo_region_create_rectangle (&(GdkRectangle) { 0, 0, - gdk_window_get_width (priv->window), - gdk_window_get_height (priv->window) + gdk_surface_get_width (priv->window), + gdk_surface_get_height (priv->window) }); priv->drawing_context = GSK_RENDERER_GET_CLASS (renderer)->begin_draw_frame (renderer, full_window); diff --git a/gsk/gskrenderer.h b/gsk/gskrenderer.h index 46509bd814..2da995589f 100644 --- a/gsk/gskrenderer.h +++ b/gsk/gskrenderer.h @@ -39,17 +39,17 @@ GDK_AVAILABLE_IN_ALL GType gsk_renderer_get_type (void) G_GNUC_CONST; GDK_AVAILABLE_IN_ALL -GskRenderer * gsk_renderer_new_for_window (GdkWindow *window); +GskRenderer * gsk_renderer_new_for_window (GdkSurface *window); GDK_AVAILABLE_IN_ALL -GdkWindow * gsk_renderer_get_window (GskRenderer *renderer); +GdkSurface * gsk_renderer_get_window (GskRenderer *renderer); GDK_AVAILABLE_IN_ALL GdkDisplay * gsk_renderer_get_display (GskRenderer *renderer); GDK_AVAILABLE_IN_ALL gboolean gsk_renderer_realize (GskRenderer *renderer, - GdkWindow *window, + GdkSurface *window, GError **error); GDK_AVAILABLE_IN_ALL void gsk_renderer_unrealize (GskRenderer *renderer); diff --git a/gsk/gskrendererprivate.h b/gsk/gskrendererprivate.h index 9cd3c57034..c6b29f4242 100644 --- a/gsk/gskrendererprivate.h +++ b/gsk/gskrendererprivate.h @@ -39,7 +39,7 @@ struct _GskRendererClass GObjectClass parent_class; gboolean (* realize) (GskRenderer *renderer, - GdkWindow *window, + GdkSurface *window, GError **error); void (* unrealize) (GskRenderer *renderer); diff --git a/gsk/gskrendernode.c b/gsk/gskrendernode.c index 9775c926bf..5c7af11493 100644 --- a/gsk/gskrendernode.c +++ b/gsk/gskrendernode.c @@ -210,7 +210,7 @@ gsk_render_node_get_name (GskRenderNode *node) * * Typically, you'll use this function to implement fallback rendering * of #GskRenderNodes on an intermediate Cairo context, instead of using - * the drawing context associated to a #GdkWindow's rendering buffer. + * the drawing context associated to a #GdkSurface's rendering buffer. * * For advanced nodes that cannot be supported using Cairo, in particular * for nodes doing 3D operations, this function may fail. diff --git a/gsk/vulkan/gskvulkanrender.c b/gsk/vulkan/gskvulkanrender.c index 66291b9ba5..b42ceff969 100644 --- a/gsk/vulkan/gskvulkanrender.c +++ b/gsk/vulkan/gskvulkanrender.c @@ -67,7 +67,7 @@ gsk_vulkan_render_setup (GskVulkanRender *self, GskVulkanImage *target, const graphene_rect_t *rect) { - GdkWindow *window = gsk_renderer_get_window (self->renderer); + GdkSurface *window = gsk_renderer_get_window (self->renderer); self->target = g_object_ref (target); @@ -83,10 +83,10 @@ gsk_vulkan_render_setup (GskVulkanRender *self, } else { - self->scale_factor = gdk_window_get_scale_factor (gsk_renderer_get_window (self->renderer)); + self->scale_factor = gdk_surface_get_scale_factor (gsk_renderer_get_window (self->renderer)); self->viewport = GRAPHENE_RECT_INIT (0, 0, - gdk_window_get_width (window) * self->scale_factor, - gdk_window_get_height (window) * self->scale_factor); + gdk_surface_get_width (window) * self->scale_factor, + gdk_surface_get_height (window) * self->scale_factor); self->clip = gdk_drawing_context_get_clip (gsk_renderer_get_drawing_context (self->renderer)); } } diff --git a/gsk/vulkan/gskvulkanrenderer.c b/gsk/vulkan/gskvulkanrenderer.c index 0a0cdab3bb..374655a4a6 100644 --- a/gsk/vulkan/gskvulkanrenderer.c +++ b/gsk/vulkan/gskvulkanrenderer.c @@ -84,7 +84,7 @@ static void gsk_vulkan_renderer_update_images_cb (GdkVulkanContext *context, GskVulkanRenderer *self) { - GdkWindow *window; + GdkSurface *window; gint scale_factor; gsize width, height; guint i; @@ -95,9 +95,9 @@ gsk_vulkan_renderer_update_images_cb (GdkVulkanContext *context, self->targets = g_new (GskVulkanImage *, self->n_targets); window = gsk_renderer_get_window (GSK_RENDERER (self)); - scale_factor = gdk_window_get_scale_factor (window); - width = gdk_window_get_width (window) * scale_factor; - height = gdk_window_get_height (window) * scale_factor; + scale_factor = gdk_surface_get_scale_factor (window); + width = gdk_surface_get_width (window) * scale_factor; + height = gdk_surface_get_height (window) * scale_factor; for (i = 0; i < self->n_targets; i++) { @@ -110,12 +110,12 @@ gsk_vulkan_renderer_update_images_cb (GdkVulkanContext *context, static gboolean gsk_vulkan_renderer_realize (GskRenderer *renderer, - GdkWindow *window, + GdkSurface *window, GError **error) { GskVulkanRenderer *self = GSK_VULKAN_RENDERER (renderer); - self->vulkan = gdk_window_create_vulkan_context (window, error); + self->vulkan = gdk_surface_create_vulkan_context (window, error); if (self->vulkan == NULL) return FALSE; @@ -256,7 +256,7 @@ gsk_vulkan_renderer_begin_draw_frame (GskRenderer *renderer, GskVulkanRenderer *self = GSK_VULKAN_RENDERER (renderer); GdkDrawingContext *result; - result = gdk_window_begin_draw_frame (gsk_renderer_get_window (renderer), + result = gdk_surface_begin_draw_frame (gsk_renderer_get_window (renderer), GDK_DRAW_CONTEXT (self->vulkan), region); diff --git a/gtk/a11y/gtkentryaccessible.c b/gtk/a11y/gtkentryaccessible.c index 1061774742..3917b68e80 100644 --- a/gtk/a11y/gtkentryaccessible.c +++ b/gtk/a11y/gtkentryaccessible.c @@ -956,7 +956,7 @@ gtk_entry_accessible_get_character_extents (AtkText *text, PangoRectangle char_rect; gchar *entry_text; gint index, x_layout, y_layout; - GdkWindow *window; + GdkSurface *window; gint x_window, y_window; GtkAllocation allocation; @@ -977,7 +977,7 @@ gtk_entry_accessible_get_character_extents (AtkText *text, _gtk_widget_get_allocation (widget, &allocation); window = gtk_widget_get_window (widget); - gdk_window_get_origin (window, &x_window, &y_window); + gdk_surface_get_origin (window, &x_window, &y_window); *x = x_window + allocation.x + x_layout + char_rect.x; *y = y_window + allocation.y + y_layout + char_rect.y; @@ -986,8 +986,8 @@ gtk_entry_accessible_get_character_extents (AtkText *text, if (coords == ATK_XY_WINDOW) { - window = gdk_window_get_toplevel (window); - gdk_window_get_origin (window, &x_window, &y_window); + window = gdk_surface_get_toplevel (window); + gdk_surface_get_origin (window, &x_window, &y_window); *x -= x_window; *y -= y_window; @@ -1006,7 +1006,7 @@ gtk_entry_accessible_get_offset_at_point (AtkText *atk_text, gint index, x_layout, y_layout; gint x_window, y_window; gint x_local, y_local; - GdkWindow *window; + GdkSurface *window; glong offset; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text)); @@ -1018,15 +1018,15 @@ gtk_entry_accessible_get_offset_at_point (AtkText *atk_text, gtk_entry_get_layout_offsets (entry, &x_layout, &y_layout); window = gtk_widget_get_window (widget); - gdk_window_get_origin (window, &x_window, &y_window); + gdk_surface_get_origin (window, &x_window, &y_window); x_local = x - x_layout - x_window; y_local = y - y_layout - y_window; if (coords == ATK_XY_WINDOW) { - window = gdk_window_get_toplevel (window); - gdk_window_get_origin (window, &x_window, &y_window); + window = gdk_surface_get_toplevel (window); + gdk_surface_get_origin (window, &x_window, &y_window); x_local += x_window; y_local += y_window; diff --git a/gtk/a11y/gtklabelaccessible.c b/gtk/a11y/gtklabelaccessible.c index 91b1ac861d..ac37c6aba0 100644 --- a/gtk/a11y/gtklabelaccessible.c +++ b/gtk/a11y/gtklabelaccessible.c @@ -995,7 +995,7 @@ gtk_label_accessible_get_character_extents (AtkText *text, PangoRectangle char_rect; const gchar *label_text; gint index, x_layout, y_layout; - GdkWindow *window; + GdkSurface *window; gint x_window, y_window; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); @@ -1011,7 +1011,7 @@ gtk_label_accessible_get_character_extents (AtkText *text, pango_extents_to_pixels (&char_rect, NULL); window = gtk_widget_get_window (widget); - gdk_window_get_origin (window, &x_window, &y_window); + gdk_surface_get_origin (window, &x_window, &y_window); *x = x_window + x_layout + char_rect.x; *y = y_window + y_layout + char_rect.y; @@ -1020,8 +1020,8 @@ gtk_label_accessible_get_character_extents (AtkText *text, if (coords == ATK_XY_WINDOW) { - window = gdk_window_get_toplevel (window); - gdk_window_get_origin (window, &x_window, &y_window); + window = gdk_surface_get_toplevel (window); + gdk_surface_get_origin (window, &x_window, &y_window); *x -= x_window; *y -= y_window; @@ -1040,7 +1040,7 @@ gtk_label_accessible_get_offset_at_point (AtkText *atk_text, gint index, x_layout, y_layout; gint x_window, y_window; gint x_local, y_local; - GdkWindow *window; + GdkSurface *window; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_text)); if (widget == NULL) @@ -1051,15 +1051,15 @@ gtk_label_accessible_get_offset_at_point (AtkText *atk_text, gtk_label_get_layout_offsets (label, &x_layout, &y_layout); window = gtk_widget_get_window (widget); - gdk_window_get_origin (window, &x_window, &y_window); + gdk_surface_get_origin (window, &x_window, &y_window); x_local = x - x_layout - x_window; y_local = y - y_layout - y_window; if (coords == ATK_XY_WINDOW) { - window = gdk_window_get_toplevel (window); - gdk_window_get_origin (window, &x_window, &y_window); + window = gdk_surface_get_toplevel (window); + gdk_surface_get_origin (window, &x_window, &y_window); x_local += x_window; y_local += y_window; diff --git a/gtk/a11y/gtktextcellaccessible.c b/gtk/a11y/gtktextcellaccessible.c index a64df616bb..3f8bdb1161 100644 --- a/gtk/a11y/gtktextcellaccessible.c +++ b/gtk/a11y/gtktextcellaccessible.c @@ -484,12 +484,12 @@ get_origins (GtkWidget *widget, gint *x_toplevel, gint *y_toplevel) { - GdkWindow *window; + GdkSurface *window; window = gtk_widget_get_window (widget); - gdk_window_get_origin (window, x_window, y_window); - window = gdk_window_get_toplevel (gtk_widget_get_window (widget)); - gdk_window_get_origin (window, x_toplevel, y_toplevel); + gdk_surface_get_origin (window, x_window, y_window); + window = gdk_surface_get_toplevel (gtk_widget_get_window (widget)); + gdk_surface_get_origin (window, x_toplevel, y_toplevel); if (GTK_IS_TREE_VIEW (widget)) { diff --git a/gtk/a11y/gtktextviewaccessible.c b/gtk/a11y/gtktextviewaccessible.c index c50439e9ed..5aa72d5160 100644 --- a/gtk/a11y/gtktextviewaccessible.c +++ b/gtk/a11y/gtktextviewaccessible.c @@ -446,7 +446,7 @@ gtk_text_view_accessible_get_offset_at_point (AtkText *text, GtkTextIter iter; gint x_widget, y_widget, x_window, y_window, buff_x, buff_y; GtkWidget *widget; - GdkWindow *window; + GdkSurface *window; GdkRectangle rect; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text)); @@ -455,7 +455,7 @@ gtk_text_view_accessible_get_offset_at_point (AtkText *text, view = GTK_TEXT_VIEW (widget); window = gtk_widget_get_window (widget); - gdk_window_get_origin (window, &x_widget, &y_widget); + gdk_surface_get_origin (window, &x_widget, &y_widget); if (coords == ATK_XY_SCREEN) { @@ -464,8 +464,8 @@ gtk_text_view_accessible_get_offset_at_point (AtkText *text, } else if (coords == ATK_XY_WINDOW) { - window = gdk_window_get_toplevel (window); - gdk_window_get_origin (window, &x_window, &y_window); + window = gdk_surface_get_toplevel (window); + gdk_surface_get_origin (window, &x_window, &y_window); x = x - x_widget + x_window; y = y - y_widget + y_window; @@ -506,7 +506,7 @@ gtk_text_view_accessible_get_character_extents (AtkText *text, GtkTextIter iter; GtkWidget *widget; GdkRectangle rectangle; - GdkWindow *window; + GdkSurface *window; gint x_widget, y_widget, x_window, y_window; *x = 0; @@ -527,7 +527,7 @@ gtk_text_view_accessible_get_character_extents (AtkText *text, if (window == NULL) return; - gdk_window_get_origin (window, &x_widget, &y_widget); + gdk_surface_get_origin (window, &x_widget, &y_widget); *height = rectangle.height; *width = rectangle.width; @@ -536,8 +536,8 @@ gtk_text_view_accessible_get_character_extents (AtkText *text, rectangle.x, rectangle.y, x, y); if (coords == ATK_XY_WINDOW) { - window = gdk_window_get_toplevel (window); - gdk_window_get_origin (window, &x_window, &y_window); + window = gdk_surface_get_toplevel (window); + gdk_surface_get_origin (window, &x_window, &y_window); *x += x_widget - x_window; *y += y_widget - y_window; } diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c index 05629a06e3..56e231b8b9 100644 --- a/gtk/a11y/gtktreeviewaccessible.c +++ b/gtk/a11y/gtktreeviewaccessible.c @@ -1096,11 +1096,11 @@ gtk_tree_view_accessible_get_cell_extents (GtkCellAccessibleParent *parent, if (coord_type != ATK_XY_WINDOW) { - GdkWindow *window; + GdkSurface *window; gint x_toplevel, y_toplevel; - window = gdk_window_get_toplevel (gtk_widget_get_window (widget)); - gdk_window_get_origin (window, &x_toplevel, &y_toplevel); + window = gdk_surface_get_toplevel (gtk_widget_get_window (widget)); + gdk_surface_get_origin (window, &x_toplevel, &y_toplevel); w_x += x_toplevel; w_y += y_toplevel; diff --git a/gtk/a11y/gtkwidgetaccessible.c b/gtk/a11y/gtkwidgetaccessible.c index 2bd384c98a..39c2a2bb36 100644 --- a/gtk/a11y/gtkwidgetaccessible.c +++ b/gtk/a11y/gtkwidgetaccessible.c @@ -562,7 +562,7 @@ gtk_widget_accessible_get_extents (AtkComponent *component, gint *height, AtkCoordType coord_type) { - GdkWindow *window; + GdkSurface *window; gint x_window, y_window; gint x_toplevel, y_toplevel; GtkWidget *widget; @@ -594,14 +594,14 @@ gtk_widget_accessible_get_extents (AtkComponent *component, *y = 0; window = gtk_widget_get_window (widget); } - gdk_window_get_origin (window, &x_window, &y_window); + gdk_surface_get_origin (window, &x_window, &y_window); *x += x_window; *y += y_window; if (coord_type == ATK_XY_WINDOW) { - window = gdk_window_get_toplevel (gtk_widget_get_window (widget)); - gdk_window_get_origin (window, &x_toplevel, &y_toplevel); + window = gdk_surface_get_toplevel (gtk_widget_get_window (widget)); + gdk_surface_get_origin (window, &x_toplevel, &y_toplevel); *x -= x_toplevel; *y -= y_toplevel; @@ -663,9 +663,9 @@ gtk_widget_accessible_set_extents (AtkComponent *component, if (coord_type == ATK_XY_WINDOW) { gint x_current, y_current; - GdkWindow *window = gtk_widget_get_window (widget); + GdkSurface *window = gtk_widget_get_window (widget); - gdk_window_get_origin (window, &x_current, &y_current); + gdk_surface_get_origin (window, &x_current, &y_current); x_current += x; y_current += y; if (x_current < 0 || y_current < 0) @@ -703,9 +703,9 @@ gtk_widget_accessible_set_position (AtkComponent *component, if (coord_type == ATK_XY_WINDOW) { gint x_current, y_current; - GdkWindow *window = gtk_widget_get_window (widget); + GdkSurface *window = gtk_widget_get_window (widget); - gdk_window_get_origin (window, &x_current, &y_current); + gdk_surface_get_origin (window, &x_current, &y_current); x_current += x; y_current += y; if (x_current < 0 || y_current < 0) diff --git a/gtk/a11y/gtkwindowaccessible.c b/gtk/a11y/gtkwindowaccessible.c index dc0753a5e2..5cb205c403 100644 --- a/gtk/a11y/gtkwindowaccessible.c +++ b/gtk/a11y/gtkwindowaccessible.c @@ -226,8 +226,8 @@ gtk_window_accessible_ref_state_set (AtkObject *accessible) AtkStateSet *state_set; GtkWidget *widget; GtkWindow *window; - GdkWindow *gdk_window; - GdkWindowState state; + GdkSurface *gdk_surface; + GdkSurfaceState state; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible)); if (widget == NULL) @@ -240,11 +240,11 @@ gtk_window_accessible_ref_state_set (AtkObject *accessible) if (gtk_window_is_active (window)) atk_state_set_add_state (state_set, ATK_STATE_ACTIVE); - gdk_window = gtk_widget_get_window (widget); - if (gdk_window) + gdk_surface = gtk_widget_get_window (widget); + if (gdk_surface) { - state = gdk_window_get_state (gdk_window); - if (state & GDK_WINDOW_STATE_ICONIFIED) + state = gdk_surface_get_state (gdk_surface); + if (state & GDK_SURFACE_STATE_ICONIFIED) atk_state_set_add_state (state_set, ATK_STATE_ICONIFIED); } if (gtk_window_get_modal (window)) @@ -305,7 +305,7 @@ static AtkAttributeSet * gtk_widget_accessible_get_attributes (AtkObject *obj) { GtkWidget *window; - GdkWindowTypeHint hint; + GdkSurfaceTypeHint hint; AtkAttributeSet *attributes; AtkAttribute *attr; GEnumClass *class; @@ -319,7 +319,7 @@ gtk_widget_accessible_get_attributes (AtkObject *obj) window = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); hint = gtk_window_get_type_hint (GTK_WINDOW (window)); - class = g_type_class_ref (GDK_TYPE_WINDOW_TYPE_HINT); + class = g_type_class_ref (GDK_TYPE_SURFACE_TYPE_HINT); for (value = class->values; value->value_name; value++) { if (hint == value->value) @@ -368,7 +368,7 @@ gtk_window_accessible_get_extents (AtkComponent *component, AtkCoordType coord_type) { GtkWidget *widget; - GdkWindow *window; + GdkSurface *window; GdkRectangle rect; gint x_toplevel, y_toplevel; @@ -389,7 +389,7 @@ gtk_window_accessible_get_extents (AtkComponent *component, if (window == NULL) return; - gdk_window_get_frame_extents (window, &rect); + gdk_surface_get_frame_extents (window, &rect); *width = rect.width; *height = rect.height; @@ -404,7 +404,7 @@ gtk_window_accessible_get_extents (AtkComponent *component, *y = rect.y; if (coord_type == ATK_XY_WINDOW) { - gdk_window_get_origin (window, &x_toplevel, &y_toplevel); + gdk_surface_get_origin (window, &x_toplevel, &y_toplevel); *x -= x_toplevel; *y -= y_toplevel; } @@ -416,7 +416,7 @@ gtk_window_accessible_get_size (AtkComponent *component, gint *height) { GtkWidget *widget; - GdkWindow *window; + GdkSurface *window; GdkRectangle rect; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component)); @@ -436,7 +436,7 @@ gtk_window_accessible_get_size (AtkComponent *component, if (window == NULL) return; - gdk_window_get_frame_extents (window, &rect); + gdk_surface_get_frame_extents (window, &rect); *width = rect.width; *height = rect.height; diff --git a/gtk/gtkapplication-wayland.c b/gtk/gtkapplication-wayland.c index 221a1adb3b..f1e85f02df 100644 --- a/gtk/gtkapplication-wayland.c +++ b/gtk/gtkapplication-wayland.c @@ -41,17 +41,17 @@ gtk_application_impl_wayland_handle_window_realize (GtkApplicationImpl *impl, GtkApplicationImplClass *impl_class = GTK_APPLICATION_IMPL_CLASS (gtk_application_impl_wayland_parent_class); GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) impl; - GdkWindow *gdk_window; + GdkSurface *gdk_surface; gchar *window_path; - gdk_window = gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = gtk_widget_get_window (GTK_WIDGET (window)); - if (!GDK_IS_WAYLAND_WINDOW (gdk_window)) + if (!GDK_IS_WAYLAND_SURFACE (gdk_surface)) return; window_path = gtk_application_impl_dbus_get_window_path (dbus, window); - gdk_wayland_window_set_dbus_properties_libgtk_only (gdk_window, + gdk_wayland_surface_set_dbus_properties_libgtk_only (gdk_surface, dbus->application_id, dbus->app_menu_path, dbus->menubar_path, window_path, dbus->object_path, dbus->unique_name); diff --git a/gtk/gtkapplication-x11.c b/gtk/gtkapplication-x11.c index 0d93f3c2c1..ee20c6d3ca 100644 --- a/gtk/gtkapplication-x11.c +++ b/gtk/gtkapplication-x11.c @@ -39,22 +39,22 @@ gtk_application_impl_x11_handle_window_realize (GtkApplicationImpl *impl, GtkWindow *window) { GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) impl; - GdkWindow *gdk_window; + GdkSurface *gdk_surface; gchar *window_path; - gdk_window = gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = gtk_widget_get_window (GTK_WIDGET (window)); - if (!GDK_IS_X11_WINDOW (gdk_window)) + if (!GDK_IS_X11_SURFACE (gdk_surface)) return; window_path = gtk_application_impl_dbus_get_window_path (dbus, window); - gdk_x11_window_set_utf8_property (gdk_window, "_GTK_APPLICATION_ID", dbus->application_id); - gdk_x11_window_set_utf8_property (gdk_window, "_GTK_UNIQUE_BUS_NAME", dbus->unique_name); - gdk_x11_window_set_utf8_property (gdk_window, "_GTK_APPLICATION_OBJECT_PATH", dbus->object_path); - gdk_x11_window_set_utf8_property (gdk_window, "_GTK_WINDOW_OBJECT_PATH", window_path); - gdk_x11_window_set_utf8_property (gdk_window, "_GTK_APP_MENU_OBJECT_PATH", dbus->app_menu_path); - gdk_x11_window_set_utf8_property (gdk_window, "_GTK_MENUBAR_OBJECT_PATH", dbus->menubar_path); + gdk_x11_surface_set_utf8_property (gdk_surface, "_GTK_APPLICATION_ID", dbus->application_id); + gdk_x11_surface_set_utf8_property (gdk_surface, "_GTK_UNIQUE_BUS_NAME", dbus->unique_name); + gdk_x11_surface_set_utf8_property (gdk_surface, "_GTK_APPLICATION_OBJECT_PATH", dbus->object_path); + gdk_x11_surface_set_utf8_property (gdk_surface, "_GTK_WINDOW_OBJECT_PATH", window_path); + gdk_x11_surface_set_utf8_property (gdk_surface, "_GTK_APP_MENU_OBJECT_PATH", dbus->app_menu_path); + gdk_x11_surface_set_utf8_property (gdk_surface, "_GTK_MENUBAR_OBJECT_PATH", dbus->menubar_path); g_free (window_path); } @@ -63,12 +63,12 @@ static GVariant * gtk_application_impl_x11_get_window_system_id (GtkApplicationImplDBus *dbus, GtkWindow *window) { - GdkWindow *gdk_window; + GdkSurface *gdk_surface; - gdk_window = gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = gtk_widget_get_window (GTK_WIDGET (window)); - if (GDK_IS_X11_WINDOW (gdk_window)) - return g_variant_new_uint32 (GDK_WINDOW_XID (gdk_window)); + if (GDK_IS_X11_SURFACE (gdk_surface)) + return g_variant_new_uint32 (GDK_SURFACE_XID (gdk_surface)); return GTK_APPLICATION_IMPL_DBUS_CLASS (gtk_application_impl_x11_parent_class)->get_window_system_id (dbus, window); } diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c index ab9e1c4d86..4a5bf529a3 100644 --- a/gtk/gtkcellrendereraccel.c +++ b/gtk/gtkcellrendereraccel.c @@ -440,7 +440,7 @@ gtk_cell_renderer_accel_start_editing (GtkCellRenderer *cell, GtkWidget *editable; gboolean is_editable; GdkDevice *device, *pointer; - GdkWindow *window; + GdkSurface *window; celltext = GTK_CELL_RENDERER_TEXT (cell); accel = GTK_CELL_RENDERER_ACCEL (cell); diff --git a/gtk/gtkcolorplane.c b/gtk/gtkcolorplane.c index 221664c3be..08c1b32327 100644 --- a/gtk/gtkcolorplane.c +++ b/gtk/gtkcolorplane.c @@ -134,7 +134,7 @@ create_surface (GtkColorPlane *plane) width = gtk_widget_get_width (widget); height = gtk_widget_get_height (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, width, height); diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 0b18c42779..7f3d959ff6 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -1392,7 +1392,7 @@ gtk_combo_box_menu_popup (GtkComboBox *combo_box) gtk_menu_update_scroll_offset, NULL); - g_object_set (priv->popup_widget, "menu-type-hint", GDK_WINDOW_TYPE_HINT_COMBO, NULL); + g_object_set (priv->popup_widget, "menu-type-hint", GDK_SURFACE_TYPE_HINT_COMBO, NULL); if (priv->wrap_width > 0 || priv->cell_view == NULL) { diff --git a/gtk/gtkdebugupdates.c b/gtk/gtkdebugupdates.c index 81ef6ad0cc..c345bca057 100644 --- a/gtk/gtkdebugupdates.c +++ b/gtk/gtkdebugupdates.c @@ -180,7 +180,7 @@ gtk_window_manage_updates (GtkWidget *widget, cairo_region_union (region, draw->region); } gtk_debug_updates_print (updates, region, "Queued update"); - gdk_window_invalidate_region (gtk_widget_get_window (widget), region, TRUE); + gdk_surface_invalidate_region (gtk_widget_get_window (widget), region, TRUE); cairo_region_destroy (region); /* Then remove all outdated regions */ diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c index 9e80abf97e..01cb0238bf 100644 --- a/gtk/gtkdnd-quartz.c +++ b/gtk/gtkdnd-quartz.c @@ -348,10 +348,10 @@ static NSWindow * get_toplevel_nswindow (GtkWidget *widget) { GtkWidget *toplevel = gtk_widget_get_toplevel (widget); - GdkWindow *window = gtk_widget_get_window (toplevel); + GdkSurface *window = gtk_widget_get_window (toplevel); if (gtk_widget_is_toplevel (toplevel) && window) - return [gdk_quartz_window_get_nsview (window) window]; + return [gdk_quartz_surface_get_nsview (window) window]; else return NULL; } @@ -633,8 +633,8 @@ gtk_drag_find_widget (GtkWidget *widget, if (gtk_widget_get_parent (widget)) { gint tx, ty; - GdkWindow *window = gtk_widget_get_window (widget); - GdkWindow *parent_window; + GdkSurface *window = gtk_widget_get_window (widget); + GdkSurface *parent_window; GtkAllocation allocation; parent_window = gtk_widget_get_window (gtk_widget_get_parent (widget)); @@ -651,7 +651,7 @@ gtk_drag_find_widget (GtkWidget *widget, /* The allocation is relative to the parent window for * window widgets, not to widget->window. */ - gdk_window_get_position (window, &tx, &ty); + gdk_surface_get_position (window, &tx, &ty); allocation_to_window_x -= tx; allocation_to_window_y -= ty; @@ -664,18 +664,18 @@ gtk_drag_find_widget (GtkWidget *widget, { GdkRectangle window_rect = { 0, 0, 0, 0 }; - window_rect.width = gdk_window_get_width (window); - window_rect.height = gdk_window_get_height (window); + window_rect.width = gdk_surface_get_width (window); + window_rect.height = gdk_surface_get_height (window); gdk_rectangle_intersect (&new_allocation, &window_rect, &new_allocation); - gdk_window_get_position (window, &tx, &ty); + gdk_surface_get_position (window, &tx, &ty); new_allocation.x += tx; x_offset += tx; new_allocation.y += ty; y_offset += ty; - window = gdk_window_get_parent (window); + window = gdk_surface_get_parent (window); } if (!window) /* Window and widget heirarchies didn't match. */ @@ -930,7 +930,7 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel, } } - gdk_window_get_position (gtk_widget_get_window (toplevel), &tx, &ty); + gdk_surface_get_position (gtk_widget_get_window (toplevel), &tx, &ty); data.x = event->dnd.x_root - tx; data.y = event->dnd.y_root - ty; @@ -1094,7 +1094,7 @@ gtk_drag_begin_idle (gpointer arg) * gdkwindow.h). */ @protocol GdkNSView -- (GdkWindow *)gdkWindow; +- (GdkSurface *)gdkWindow; @end GdkDragContext * @@ -1109,7 +1109,7 @@ gtk_drag_begin_internal (GtkWidget *widget, { GtkDragSourceInfo *info; GdkDevice *pointer; - GdkWindow *window; + GdkSurface *window; GdkDragContext *context; NSWindow *nswindow = get_toplevel_nswindow (widget); NSPoint point = {0, 0}; @@ -1119,14 +1119,14 @@ gtk_drag_begin_internal (GtkWidget *widget, if ((x != -1 && y != -1) || event) { - GdkWindow *window; + GdkSurface *window; gdouble dx, dy; if (x != -1 && y != -1) { GtkWidget *toplevel = gtk_widget_get_toplevel (widget); window = gtk_widget_get_window (toplevel); gtk_widget_translate_coordinates (widget, toplevel, x, y, &x, &y); - gdk_window_get_root_coords (gtk_widget_get_window (toplevel), x, y, + gdk_surface_get_root_coords (gtk_widget_get_window (toplevel), x, y, &x, &y); dx = (gdouble)x; dy = (gdouble)y; @@ -1136,26 +1136,26 @@ gtk_drag_begin_internal (GtkWidget *widget, if (gdk_event_get_coords (event, &dx, &dy)) { /* We need to translate (x, y) to coordinates relative to the - * toplevel GdkWindow, which should be the GdkWindow backing + * toplevel GdkSurface, which should be the GdkSurface backing * nswindow. Then, we convert to the NSWindow coordinate system. */ window = event->any.window; - GdkWindow *toplevel = gdk_window_get_toplevel (window); + GdkSurface *toplevel = gdk_surface_get_toplevel (window); while (window != toplevel) { double old_x = dx; double old_y = dy; - gdk_window_coords_to_parent (window, old_x, old_y, + gdk_surface_coords_to_parent (window, old_x, old_y, &dx, &dy); - window = gdk_window_get_parent (window); + window = gdk_surface_get_parent (window); } } time = (double)gdk_event_get_time (event); } point.x = dx; - point.y = gdk_window_get_height (window) - dy; + point.y = gdk_surface_get_height (window) - dy; } nstime = [[NSDate dateWithTimeIntervalSince1970: time / 1000] timeIntervalSinceReferenceDate]; @@ -1445,7 +1445,7 @@ gtk_drag_set_icon_name (GdkDragContext *context, g_return_if_fail (GDK_IS_DRAG_CONTEXT (context)); g_return_if_fail (icon_name != NULL); - display = gdk_window_get_display (gdk_drag_context_get_source_window (context)); + display = gdk_surface_get_display (gdk_drag_context_get_source_window (context)); g_return_if_fail (display != NULL); gtk_icon_size_lookup (GTK_ICON_SIZE_DND, &width, &height); diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c index ffaf0847ff..b6dc04a83a 100644 --- a/gtk/gtkdnd.c +++ b/gtk/gtkdnd.c @@ -428,7 +428,7 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel, case GDK_DRAG_MOTION: case GDK_DROP_START: { - GdkWindow *window; + GdkSurface *window; gint tx, ty; double x_root, y_root; gboolean found; @@ -447,7 +447,7 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel, window = gtk_widget_get_window (toplevel); - gdk_window_get_position (window, &tx, &ty); + gdk_surface_get_position (window, &tx, &ty); gdk_event_get_root_coords (event, &x_root, &y_root); found = gtk_drag_find_widget (toplevel, @@ -946,7 +946,7 @@ gtk_drag_begin_internal (GtkWidget *widget, toplevel = gtk_widget_get_toplevel (widget); gtk_widget_translate_coordinates (widget, toplevel, x, y, &x, &y); - gdk_window_get_device_position (gtk_widget_get_window (toplevel), + gdk_surface_get_device_position (gtk_widget_get_window (toplevel), device, &dx, &dy, NULL); @@ -1109,7 +1109,7 @@ gtk_drag_set_icon_widget_internal (GdkDragContext *context, display = gdk_drag_context_get_display (context); info->icon_window = gtk_window_new (GTK_WINDOW_POPUP); - gtk_window_set_type_hint (GTK_WINDOW (info->icon_window), GDK_WINDOW_TYPE_HINT_DND); + gtk_window_set_type_hint (GTK_WINDOW (info->icon_window), GDK_SURFACE_TYPE_HINT_DND); gtk_window_set_display (GTK_WINDOW (info->icon_window), display); gtk_widget_set_size_request (info->icon_window, 24, 24); gtk_style_context_remove_class (gtk_widget_get_style_context (info->icon_window), "background"); diff --git a/gtk/gtkdragdest.c b/gtk/gtkdragdest.c index e9cf698e1a..1f762eb80f 100644 --- a/gtk/gtkdragdest.c +++ b/gtk/gtkdragdest.c @@ -37,7 +37,7 @@ gtk_drag_dest_realized (GtkWidget *widget) GtkWidget *toplevel = gtk_widget_get_toplevel (widget); if (gtk_widget_is_toplevel (toplevel)) - gdk_window_register_dnd (gtk_widget_get_window (toplevel)); + gdk_surface_register_dnd (gtk_widget_get_window (toplevel)); } static void @@ -47,7 +47,7 @@ gtk_drag_dest_hierarchy_changed (GtkWidget *widget, GtkWidget *toplevel = gtk_widget_get_toplevel (widget); if (gtk_widget_is_toplevel (toplevel) && gtk_widget_get_realized (toplevel)) - gdk_window_register_dnd (gtk_widget_get_window (toplevel)); + gdk_surface_register_dnd (gtk_widget_get_window (toplevel)); } static void @@ -132,7 +132,7 @@ gtk_drag_dest_set_internal (GtkWidget *widget, * { * GdkModifierType mask; * - * gdk_window_get_pointer (gtk_widget_get_window (widget), + * gdk_surface_get_pointer (gtk_widget_get_window (widget), * NULL, NULL, &mask); * if (mask & GDK_CONTROL_MASK) * gdk_drag_status (context, GDK_ACTION_COPY, time); diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index a5e6aa68af..951739366b 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -568,7 +568,7 @@ gtk_entry_completion_constructed (GObject *object) gtk_window_set_use_subsurface (GTK_WINDOW (priv->popup_window), TRUE); gtk_window_set_resizable (GTK_WINDOW (priv->popup_window), FALSE); gtk_window_set_type_hint (GTK_WINDOW(priv->popup_window), - GDK_WINDOW_TYPE_HINT_COMBO); + GDK_SURFACE_TYPE_HINT_COMBO); g_signal_connect (priv->popup_window, "event", G_CALLBACK (gtk_entry_completion_popup_event), @@ -1372,7 +1372,7 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion) GdkDisplay *display; GdkMonitor *monitor; GdkRectangle area; - GdkWindow *window; + GdkSurface *window; GtkRequisition popup_req; GtkRequisition entry_req; GtkRequisition tree_req; @@ -1394,7 +1394,7 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion) gtk_widget_get_preferred_size (completion->priv->entry, &entry_req, NULL); - gdk_window_get_origin (window, &x, &y); + gdk_surface_get_origin (window, &x, &y); x += allocation.x; y += allocation.y + (allocation.height - entry_req.height) / 2; @@ -1478,7 +1478,7 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion) static void prepare_popup_func (GdkSeat *seat, - GdkWindow *window, + GdkSurface *window, gpointer user_data) { GtkEntryCompletion *completion = user_data; diff --git a/gtk/gtkfilechoosernativequartz.c b/gtk/gtkfilechoosernativequartz.c index 65f2579b90..e1e837c80f 100644 --- a/gtk/gtkfilechoosernativequartz.c +++ b/gtk/gtkfilechoosernativequartz.c @@ -529,7 +529,7 @@ gtk_file_chooser_native_quartz_show (GtkFileChooserNative *self) if (transient_for) { gtk_widget_realize (GTK_WIDGET (transient_for)); - data->parent = gdk_quartz_window_get_nswindow (gtk_widget_get_window (GTK_WIDGET (transient_for))); + data->parent = gdk_quartz_surface_get_nswindow (gtk_widget_get_window (GTK_WIDGET (transient_for))); if (gtk_native_dialog_get_modal (GTK_NATIVE_DIALOG (self))) data->modal = TRUE; diff --git a/gtk/gtkfilechoosernativewin32.c b/gtk/gtkfilechoosernativewin32.c index cb9c42ef4d..09fabb8b27 100644 --- a/gtk/gtkfilechoosernativewin32.c +++ b/gtk/gtkfilechoosernativewin32.c @@ -789,7 +789,7 @@ gtk_file_chooser_native_win32_show (GtkFileChooserNative *self) if (transient_for) { gtk_widget_realize (GTK_WIDGET (transient_for)); - data->parent = gdk_win32_window_get_handle (gtk_widget_get_window (GTK_WIDGET (transient_for))); + data->parent = gdk_win32_surface_get_handle (gtk_widget_get_window (GTK_WIDGET (transient_for))); if (gtk_native_dialog_get_modal (GTK_NATIVE_DIALOG (self))) data->modal = TRUE; diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c index 4cabe4a242..5a0aa3af64 100644 --- a/gtk/gtkgesture.c +++ b/gtk/gtkgesture.c @@ -109,7 +109,7 @@ * On the platforms that support it, #GtkGesture will handle transparently * touchpad gesture events. The only precautions users of #GtkGesture should do * to enable this support are: - * - Enabling %GDK_TOUCHPAD_GESTURE_MASK on their #GdkWindows + * - Enabling %GDK_TOUCHPAD_GESTURE_MASK on their #GdkSurfaces * - If the gesture has %GTK_PHASE_NONE, ensuring events of type * %GDK_TOUCHPAD_SWIPE and %GDK_TOUCHPAD_PINCH are handled by the #GtkGesture */ @@ -600,9 +600,9 @@ _gtk_gesture_cancel_all (GtkGesture *gesture) static gboolean gesture_within_window (GtkGesture *gesture, - GdkWindow *parent) + GdkSurface *parent) { - GdkWindow *window; + GdkSurface *window; GtkWidget *widget; widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture)); @@ -613,7 +613,7 @@ gesture_within_window (GtkGesture *gesture, if (window == parent) return TRUE; - window = gdk_window_get_parent (window); + window = gdk_surface_get_parent (window); } return FALSE; @@ -740,7 +740,7 @@ gtk_gesture_handle_event (GtkEventController *controller, } else if (event_type == GDK_GRAB_BROKEN) { - GdkWindow *window = NULL; + GdkSurface *window = NULL; gdk_event_get_grab_window (event, &window); if (!window || !gesture_within_window (gesture, window)) diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c index 85b3cb9906..b71037f734 100644 --- a/gtk/gtkglarea.c +++ b/gtk/gtkglarea.c @@ -312,7 +312,7 @@ gtk_gl_area_real_create_context (GtkGLArea *area) GError *error = NULL; GdkGLContext *context; - context = gdk_window_create_gl_context (gtk_widget_get_window (widget), &error); + context = gdk_surface_create_gl_context (gtk_widget_get_window (widget), &error); if (error != NULL) { gtk_gl_area_set_error (area, error); diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c index a919fc8235..e9b9657f24 100644 --- a/gtk/gtkheaderbar.c +++ b/gtk/gtkheaderbar.c @@ -94,7 +94,7 @@ struct _GtkHeaderBarPrivate GtkWidget *titlebar_icon; - GdkWindowState state; + GdkSurfaceState state; guint shows_app_menu : 1; }; @@ -326,7 +326,7 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar) is_sovereign_window = (!gtk_window_get_modal (window) && gtk_window_get_transient_for (window) == NULL && - gtk_window_get_type_hint (window) == GDK_WINDOW_TYPE_HINT_NORMAL); + gtk_window_get_type_hint (window) == GDK_SURFACE_TYPE_HINT_NORMAL); tokens = g_strsplit (layout_desc, ":", 2); if (tokens) @@ -1801,19 +1801,19 @@ window_state_changed (GtkWidget *widget) { GtkHeaderBar *bar = GTK_HEADER_BAR (widget); GtkHeaderBarPrivate *priv = gtk_header_bar_get_instance_private (bar); - GdkWindowState changed, new_state; + GdkSurfaceState changed, new_state; - new_state = gdk_window_get_state (_gtk_widget_get_window (widget)); + new_state = gdk_surface_get_state (_gtk_widget_get_window (widget)); changed = new_state ^ priv->state; priv->state = new_state; - if (changed & (GDK_WINDOW_STATE_FULLSCREEN | - GDK_WINDOW_STATE_MAXIMIZED | - GDK_WINDOW_STATE_TILED | - GDK_WINDOW_STATE_TOP_TILED | - GDK_WINDOW_STATE_RIGHT_TILED | - GDK_WINDOW_STATE_BOTTOM_TILED | - GDK_WINDOW_STATE_LEFT_TILED)) + if (changed & (GDK_SURFACE_STATE_FULLSCREEN | + GDK_SURFACE_STATE_MAXIMIZED | + GDK_SURFACE_STATE_TILED | + GDK_SURFACE_STATE_TOP_TILED | + GDK_SURFACE_STATE_RIGHT_TILED | + GDK_SURFACE_STATE_BOTTOM_TILED | + GDK_SURFACE_STATE_LEFT_TILED)) _gtk_header_bar_update_window_buttons (bar); } @@ -1988,7 +1988,7 @@ gtk_header_bar_init (GtkHeaderBar *bar) priv->decoration_layout = NULL; priv->decoration_layout_set = FALSE; priv->shows_app_menu = FALSE; - priv->state = GDK_WINDOW_STATE_WITHDRAWN; + priv->state = GDK_SURFACE_STATE_WITHDRAWN; init_sizing_box (bar); construct_label_box (bar); diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index 7df1100973..0faca7d72c 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -1947,7 +1947,7 @@ choose_icon (GtkIconTheme *icon_theme, * * When rendering on displays with high pixel densities you should not * use a @size multiplied by the scaling factor returned by functions - * like gdk_window_get_scale_factor(). Instead, you should use + * like gdk_surface_get_scale_factor(). Instead, you should use * gtk_icon_theme_lookup_icon_for_scale(), as the assets loaded * for a given scaling factor may be different. * @@ -4832,7 +4832,7 @@ gtk_icon_info_load_symbolic_for_context_finish (GtkIconInfo *icon_info, * * When rendering on displays with high pixel densities you should not * use a @size multiplied by the scaling factor returned by functions - * like gdk_window_get_scale_factor(). Instead, you should use + * like gdk_surface_get_scale_factor(). Instead, you should use * gtk_icon_theme_lookup_by_gicon_for_scale(), as the assets loaded * for a given scaling factor may be different. * diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c index b0d5ae756d..ff065d6cb8 100644 --- a/gtk/gtkiconview.c +++ b/gtk/gtkiconview.c @@ -6719,7 +6719,7 @@ gtk_icon_view_create_drag_icon (GtkIconView *icon_view, item->cell_area.height + icon_view->priv->item_padding * 2 }; - surface = gdk_window_create_similar_surface (gtk_widget_get_window (GTK_WIDGET (icon_view)), + surface = gdk_surface_create_similar_surface (gtk_widget_get_window (GTK_WIDGET (icon_view)), CAIRO_CONTENT_COLOR_ALPHA, rect.width, rect.height); diff --git a/gtk/gtkimcontextime.c b/gtk/gtkimcontextime.c index 146cc129db..4f8f461782 100644 --- a/gtk/gtkimcontextime.c +++ b/gtk/gtkimcontextime.c @@ -119,7 +119,7 @@ static GdkFilterReturn gtk_im_context_ime_message_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data); -static void get_window_position (GdkWindow *win, +static void get_window_position (GdkSurface *win, gint *x, gint *y); static void cb_client_widget_hierarchy_changed (GtkWidget *widget, @@ -261,7 +261,7 @@ gtk_im_context_ime_set_client_widget (GtkIMContext *context, { GtkIMContextIME *context_ime; GtkWidget *toplevel; - GdkWindow *client_window; + GdkSurface *client_window; g_return_if_fail (GTK_IS_IM_CONTEXT_IME (context)); context_ime = GTK_IM_CONTEXT_IME (context); @@ -273,7 +273,7 @@ gtk_im_context_ime_set_client_widget (GtkIMContext *context, HIMC himc; HWND hwnd; - hwnd = gdk_win32_window_get_impl_hwnd (client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (client_window); himc = ImmGetContext (hwnd); if (himc) { @@ -377,7 +377,7 @@ gtk_im_context_ime_filter_keypress (GtkIMContext *context, if (!context_ime->focus) return FALSE; - if (!GDK_IS_WINDOW (context_ime->client_window)) + if (!GDK_IS_SURFACE (context_ime->client_window)) return FALSE; gdk_event_get_keyval ((GdkEvent *) event, &keyval); @@ -430,7 +430,7 @@ gtk_im_context_ime_reset (GtkIMContext *context) if (!context_ime->client_window) return; - hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); himc = ImmGetContext (hwnd); if (!himc) return; @@ -461,7 +461,7 @@ get_utf8_preedit_string (GtkIMContextIME *context_ime, gint *pos_ret) if (!context_ime->client_window) return g_strdup (""); - hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); himc = ImmGetContext (hwnd); if (!himc) return g_strdup (""); @@ -522,7 +522,7 @@ get_pango_attr_list (GtkIMContextIME *context_ime, const gchar *utf8str) if (!context_ime->client_window) return attrs; - hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); himc = ImmGetContext (hwnd); if (!himc) return attrs; @@ -649,26 +649,26 @@ static void gtk_im_context_ime_focus_in (GtkIMContext *context) { GtkIMContextIME *context_ime = GTK_IM_CONTEXT_IME (context); - GdkWindow *toplevel; + GdkSurface *toplevel; GtkWidget *widget = NULL; HWND hwnd; HIMC himc; - if (!GDK_IS_WINDOW (context_ime->client_window)) + if (!GDK_IS_SURFACE (context_ime->client_window)) return; /* swtich current context */ context_ime->focus = TRUE; - hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); himc = ImmGetContext (hwnd); if (!himc) return; - toplevel = gdk_window_get_toplevel (context_ime->client_window); - if (GDK_IS_WINDOW (toplevel)) + toplevel = gdk_surface_get_toplevel (context_ime->client_window); + if (GDK_IS_SURFACE (toplevel)) { - gdk_window_add_filter (toplevel, + gdk_surface_add_filter (toplevel, gtk_im_context_ime_message_filter, context_ime); context_ime->toplevel = toplevel; } @@ -680,7 +680,7 @@ gtk_im_context_ime_focus_in (GtkIMContext *context) } /* trace reparenting (probably no need) */ - gdk_window_get_user_data (context_ime->client_window, (gpointer) & widget); + gdk_surface_get_user_data (context_ime->client_window, (gpointer) & widget); if (GTK_IS_WIDGET (widget)) { g_signal_connect (widget, "hierarchy-changed", @@ -720,18 +720,18 @@ static void gtk_im_context_ime_focus_out (GtkIMContext *context) { GtkIMContextIME *context_ime = GTK_IM_CONTEXT_IME (context); - GdkWindow *toplevel; + GdkSurface *toplevel; GtkWidget *widget = NULL; HWND hwnd; HIMC himc; - if (!GDK_IS_WINDOW (context_ime->client_window)) + if (!GDK_IS_SURFACE (context_ime->client_window)) return; /* swtich current context */ context_ime->focus = FALSE; - hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); himc = ImmGetContext (hwnd); if (!himc) return; @@ -778,7 +778,7 @@ gtk_im_context_ime_focus_out (GtkIMContext *context) } /* remove signal handler */ - gdk_window_get_user_data (context_ime->client_window, (gpointer) & widget); + gdk_surface_get_user_data (context_ime->client_window, (gpointer) & widget); if (GTK_IS_WIDGET (widget)) { g_signal_handlers_disconnect_by_func @@ -787,10 +787,10 @@ gtk_im_context_ime_focus_out (GtkIMContext *context) } /* remove event fileter */ - toplevel = gdk_window_get_toplevel (context_ime->client_window); - if (GDK_IS_WINDOW (toplevel)) + toplevel = gdk_surface_get_toplevel (context_ime->client_window); + if (GDK_IS_SURFACE (toplevel)) { - gdk_window_remove_filter (toplevel, + gdk_surface_remove_filter (toplevel, gtk_im_context_ime_message_filter, context_ime); context_ime->toplevel = NULL; @@ -825,7 +825,7 @@ gtk_im_context_ime_set_cursor_location (GtkIMContext *context, if (!context_ime->client_window) return; - hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); himc = ImmGetContext (hwnd); if (!himc) return; @@ -855,7 +855,7 @@ gtk_im_context_ime_set_use_preedit (GtkIMContext *context, HWND hwnd; HIMC himc; - hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); himc = ImmGetContext (hwnd); if (!himc) return; @@ -889,11 +889,11 @@ gtk_im_context_ime_set_preedit_font (GtkIMContext *context) if (!context_ime->client_window) return; - gdk_window_get_user_data (context_ime->client_window, (gpointer) &widget); + gdk_surface_get_user_data (context_ime->client_window, (gpointer) &widget); if (!GTK_IS_WIDGET (widget)) return; - hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); himc = ImmGetContext (hwnd); if (!himc) return; @@ -1009,7 +1009,7 @@ gtk_im_context_ime_message_filter (GdkXEvent *xevent, if (!context_ime->focus) return retval; - hwnd = gdk_win32_window_get_impl_hwnd (context_ime->client_window); + hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_window); himc = ImmGetContext (hwnd); if (!himc) return retval; @@ -1029,7 +1029,7 @@ gtk_im_context_ime_message_filter (GdkXEvent *xevent, RECT rc; hwnd_top = - gdk_win32_window_get_impl_hwnd (gdk_window_get_toplevel + gdk_win32_surface_get_impl_hwnd (gdk_surface_get_toplevel (context_ime->client_window)); GetWindowRect (hwnd_top, &rc); pt.x = wx; @@ -1127,19 +1127,19 @@ gtk_im_context_ime_message_filter (GdkXEvent *xevent, * x and y must be initialized to 0. */ static void -get_window_position (GdkWindow *win, gint *x, gint *y) +get_window_position (GdkSurface *win, gint *x, gint *y) { - GdkWindow *parent, *toplevel; + GdkSurface *parent, *toplevel; gint wx, wy; - g_return_if_fail (GDK_IS_WINDOW (win)); + g_return_if_fail (GDK_IS_SURFACE (win)); g_return_if_fail (x && y); - gdk_window_get_position (win, &wx, &wy); + gdk_surface_get_position (win, &wx, &wy); *x += wx; *y += wy; - parent = gdk_window_get_parent (win); - toplevel = gdk_window_get_toplevel (win); + parent = gdk_surface_get_parent (win); + toplevel = gdk_surface_get_toplevel (win); if (parent && parent != toplevel) get_window_position (parent, x, y); @@ -1154,7 +1154,7 @@ cb_client_widget_hierarchy_changed (GtkWidget *widget, GtkWidget *widget2, GtkIMContextIME *context_ime) { - GdkWindow *new_toplevel; + GdkSurface *new_toplevel; g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (GTK_IS_IM_CONTEXT_IME (context_ime)); @@ -1164,14 +1164,14 @@ cb_client_widget_hierarchy_changed (GtkWidget *widget, if (!context_ime->focus) return; - new_toplevel = gdk_window_get_toplevel (context_ime->client_window); + new_toplevel = gdk_surface_get_toplevel (context_ime->client_window); if (context_ime->toplevel == new_toplevel) return; /* remove filter from old toplevel */ - if (GDK_IS_WINDOW (context_ime->toplevel)) + if (GDK_IS_SURFACE (context_ime->toplevel)) { - gdk_window_remove_filter (context_ime->toplevel, + gdk_surface_remove_filter (context_ime->toplevel, gtk_im_context_ime_message_filter, context_ime); } @@ -1180,9 +1180,9 @@ cb_client_widget_hierarchy_changed (GtkWidget *widget, } /* add filter to new toplevel */ - if (GDK_IS_WINDOW (new_toplevel)) + if (GDK_IS_SURFACE (new_toplevel)) { - gdk_window_add_filter (new_toplevel, + gdk_surface_add_filter (new_toplevel, gtk_im_context_ime_message_filter, context_ime); } else diff --git a/gtk/gtkimcontextime.h b/gtk/gtkimcontextime.h index 6bb036558f..4fe5b9e141 100644 --- a/gtk/gtkimcontextime.h +++ b/gtk/gtkimcontextime.h @@ -36,8 +36,8 @@ struct _GtkIMContextIME { GtkIMContext object; - GdkWindow *client_window; - GdkWindow *toplevel; + GdkSurface *client_window; + GdkSurface *toplevel; guint use_preedit : 1; guint preediting : 1; guint opened : 1; diff --git a/gtk/gtkimcontextquartz.c b/gtk/gtkimcontextquartz.c index 14637de186..267af4bf46 100644 --- a/gtk/gtkimcontextquartz.c +++ b/gtk/gtkimcontextquartz.c @@ -37,7 +37,7 @@ typedef struct _GtkIMContextQuartz { GtkIMContext parent; GtkIMContext *slave; - GdkWindow *client_window; + GdkSurface *client_window; gchar *preedit_str; unsigned int cursor_index; unsigned int selected_len; @@ -110,7 +110,7 @@ quartz_get_preedit_string (GtkIMContext *context, static gboolean output_result (GtkIMContext *context, - GdkWindow *win) + GdkSurface *win) { GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context); gboolean retval = FALSE; @@ -168,15 +168,15 @@ quartz_filter_keypress (GtkIMContext *context, GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context); gboolean retval; NSView *nsview; - GdkWindow *win; + GdkSurface *win; GTK_NOTE (MISC, g_print ("quartz_filter_keypress\n")); - if (!GDK_IS_QUARTZ_WINDOW (qc->client_window)) + if (!GDK_IS_QUARTZ_SURFACE (qc->client_window)) return FALSE; - nsview = gdk_quartz_window_get_nsview (qc->client_window); - win = (GdkWindow *)[ (GdkQuartzView *)nsview gdkWindow]; + nsview = gdk_quartz_surface_get_nsview (qc->client_window); + win = (GdkSurface *)[ (GdkQuartzView *)nsview gdkWindow]; GTK_NOTE (MISC, g_print ("client_window: %p, win: %p, nsview: %p\n", qc->client_window, win, nsview)); @@ -224,10 +224,10 @@ discard_preedit (GtkIMContext *context) if (!qc->client_window) return; - if (!GDK_IS_QUARTZ_WINDOW (qc->client_window)) + if (!GDK_IS_QUARTZ_SURFACE (qc->client_window)) return; - NSView *nsview = gdk_quartz_window_get_nsview (qc->client_window); + NSView *nsview = gdk_quartz_surface_get_nsview (qc->client_window); if (!nsview) return; @@ -290,7 +290,7 @@ quartz_set_cursor_location (GtkIMContext *context, GdkRectangle *area) GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context); gint x, y; NSView *nsview; - GdkWindow *win; + GdkSurface *win; GTK_NOTE (MISC, g_print ("quartz_set_cursor_location\n")); @@ -305,16 +305,16 @@ quartz_set_cursor_location (GtkIMContext *context, GdkRectangle *area) qc->cursor_rect->width = area->width; qc->cursor_rect->height = area->height; - gdk_window_get_origin (qc->client_window, &x, &y); + gdk_surface_get_origin (qc->client_window, &x, &y); qc->cursor_rect->x = area->x + x; qc->cursor_rect->y = area->y + y; - if (!GDK_IS_QUARTZ_WINDOW (qc->client_window)) + if (!GDK_IS_QUARTZ_SURFACE (qc->client_window)) return; - nsview = gdk_quartz_window_get_nsview (qc->client_window); - win = (GdkWindow *)[ (GdkQuartzView*)nsview gdkWindow]; + nsview = gdk_quartz_surface_get_nsview (qc->client_window); + win = (GdkSurface *)[ (GdkQuartzView*)nsview gdkWindow]; g_object_set_data (G_OBJECT (win), GIC_CURSOR_RECT, qc->cursor_rect); } diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c index 3995b002c6..3f3e234650 100644 --- a/gtk/gtkimcontextsimple.c +++ b/gtk/gtkimcontextsimple.c @@ -1022,9 +1022,9 @@ check_emoji (GtkIMContextSimple *context_simple, } static void -beep_window (GdkWindow *window) +beep_window (GdkSurface *window) { - GdkDisplay *display = gdk_window_get_display (window); + GdkDisplay *display = gdk_surface_get_display (window); gboolean beep; g_object_get (gtk_settings_get_for_display (display), @@ -1032,7 +1032,7 @@ beep_window (GdkWindow *window) NULL); if (beep) - gdk_window_beep (window); + gdk_surface_beep (window); } static gboolean @@ -1102,8 +1102,8 @@ is_hex_keyval (guint keyval) static guint canonical_hex_keyval (GdkEventKey *event) { - GdkWindow *window = gdk_event_get_window ((GdkEvent *) event); - GdkKeymap *keymap = gdk_display_get_keymap (gdk_window_get_display (window)); + GdkSurface *window = gdk_event_get_window ((GdkEvent *) event); + GdkKeymap *keymap = gdk_display_get_keymap (gdk_surface_get_display (window)); guint keyval, event_keyval; guint *keyvals = NULL; gint n_vals = 0; @@ -1162,8 +1162,8 @@ gtk_im_context_simple_filter_keypress (GtkIMContext *context, { GtkIMContextSimple *context_simple = GTK_IM_CONTEXT_SIMPLE (context); GtkIMContextSimplePrivate *priv = context_simple->priv; - GdkWindow *window = gdk_event_get_window ((GdkEvent *) event); - GdkDisplay *display = gdk_window_get_display (window); + GdkSurface *window = gdk_event_get_window ((GdkEvent *) event); + GdkDisplay *display = gdk_surface_get_display (window); GdkKeymap *keymap = gdk_display_get_keymap (display); GSList *tmp_list; int n_compose = 0; diff --git a/gtk/gtkimcontextxim.c b/gtk/gtkimcontextxim.c index 23c4f0f7b3..f894cb59e0 100644 --- a/gtk/gtkimcontextxim.c +++ b/gtk/gtkimcontextxim.c @@ -37,7 +37,7 @@ struct _GtkIMContextXIM gchar *locale; gchar *mb_charset; - GdkWindow *client_window; + GdkSurface *client_window; Window client_window_xid; GtkWidget *client_widget; @@ -123,7 +123,7 @@ static void gtk_im_context_xim_get_preedit_string (GtkIMContext *co static void reinitialize_ic (GtkIMContextXIM *context_xim); static void set_ic_client_window (GtkIMContextXIM *context_xim, - GdkWindow *client_window); + GdkSurface *client_window); static void setup_styles (GtkXIMInfo *info); @@ -397,12 +397,12 @@ xim_destroy_callback (XIM xim, } static GtkXIMInfo * -get_im (GdkWindow *client_window, +get_im (GdkSurface *client_window, const char *locale) { GSList *tmp_list; GtkXIMInfo *info; - GdkDisplay *display = gdk_window_get_display (client_window); + GdkDisplay *display = gdk_surface_get_display (client_window); info = NULL; tmp_list = open_ims; @@ -546,7 +546,7 @@ reinitialize_ic (GtkIMContextXIM *context_xim) static void set_ic_client_window (GtkIMContextXIM *context_xim, - GdkWindow *client_window) + GdkSurface *client_window) { reinitialize_ic (context_xim); if (context_xim->client_window) @@ -560,16 +560,16 @@ set_ic_client_window (GtkIMContextXIM *context_xim, if (context_xim->client_window) { - GdkWindow *native; + GdkSurface *native; context_xim->im_info = get_im (context_xim->client_window, context_xim->locale); context_xim->im_info->ics = g_slist_prepend (context_xim->im_info->ics, context_xim); - for (native = client_window; native; native = gdk_window_get_parent (native)) + for (native = client_window; native; native = gdk_surface_get_parent (native)) { - if (gdk_window_has_native (native)) + if (gdk_surface_has_native (native)) { - context_xim->client_window_xid = gdk_x11_window_get_xid (native); + context_xim->client_window_xid = gdk_x11_surface_get_xid (native); break; } } @@ -583,7 +583,7 @@ gtk_im_context_xim_set_client_widget (GtkIMContext *context, GtkWidget *widget) { GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context); - GdkWindow *window = NULL; + GdkSurface *window = NULL; if (widget != NULL) window = gtk_widget_get_window (gtk_widget_get_toplevel (widget)); @@ -628,7 +628,7 @@ gtk_im_context_xim_filter_keypress (GtkIMContext *context, KeySym keysym; Status status; gboolean result = FALSE; - GdkWindow *window; + GdkSurface *window; XKeyPressedEvent xevent; GdkEventType event_type; guint state; @@ -641,14 +641,14 @@ gtk_im_context_xim_filter_keypress (GtkIMContext *context, if (event_type == GDK_KEY_RELEASE && !context_xim->filter_key_release) return FALSE; - window = gdk_window_get_toplevel (gdk_event_get_window ((GdkEvent *) event)); + window = gdk_surface_get_toplevel (gdk_event_get_window ((GdkEvent *) event)); xevent.type = (event_type == GDK_KEY_PRESS) ? KeyPress : KeyRelease; xevent.serial = 0; /* hope it doesn't matter */ xevent.send_event = gdk_event_is_sent ((GdkEvent *)event); - xevent.display = GDK_WINDOW_XDISPLAY (window); - xevent.window = GDK_WINDOW_XID (window); - xevent.root = DefaultRootWindow(GDK_WINDOW_XDISPLAY (window)); + xevent.display = GDK_SURFACE_XDISPLAY (window); + xevent.window = GDK_SURFACE_XID (window); + xevent.root = DefaultRootWindow(GDK_SURFACE_XDISPLAY (window)); xevent.subwindow = xevent.window; xevent.time = gdk_event_get_time ((GdkEvent *) event); xevent.x = xevent.x_root = 0; @@ -1426,11 +1426,11 @@ gtk_im_context_xim_get_ic (GtkIMContextXIM *context_xim) * For B) we basically have to depend on our callers * calling ::focus-in and ::focus-out at the right time. * - * The toplevel is computed by walking up the GdkWindow + * The toplevel is computed by walking up the GdkSurface * hierarchy from context->client_window until we find a * window that is owned by some widget, and then calling * gtk_widget_get_toplevel() on that widget. This should - * handle both cases where we might have GdkWindows without widgets, + * handle both cases where we might have GdkSurfaces without widgets, * and cases where GtkWidgets have strange window hierarchies * (like a torn off GtkHandleBox.) * @@ -1531,16 +1531,16 @@ on_client_widget_hierarchy_changed (GtkWidget *widget, * widget owning the nearest parent that has a widget. */ static GtkWidget * -widget_for_window (GdkWindow *window) +widget_for_window (GdkSurface *window) { while (window) { gpointer user_data; - gdk_window_get_user_data (window, &user_data); + gdk_surface_get_user_data (window, &user_data); if (user_data) return user_data; - window = gdk_window_get_parent (window); + window = gdk_surface_get_parent (window); } return NULL; @@ -1613,9 +1613,9 @@ on_status_toplevel_configure (GtkWidget *toplevel, if (status_window->window) { - height = DisplayHeight(GDK_WINDOW_XDISPLAY (gtk_widget_get_window (toplevel)), 0); + height = DisplayHeight(GDK_SURFACE_XDISPLAY (gtk_widget_get_window (toplevel)), 0); - gdk_window_get_frame_extents (gtk_widget_get_window (toplevel), &rect); + gdk_surface_get_frame_extents (gtk_widget_get_window (toplevel), &rect); gtk_widget_get_preferred_size ( (status_window->window), &requisition, NULL); if (rect.y + rect.height + requisition.height < height) diff --git a/gtk/gtkimmulticontext.c b/gtk/gtkimmulticontext.c index 83f7a177ab..8c1df632d2 100644 --- a/gtk/gtkimmulticontext.c +++ b/gtk/gtkimmulticontext.c @@ -363,7 +363,7 @@ gtk_im_multicontext_filter_keypress (GtkIMContext *context, GdkDisplay *display; GdkModifierType no_text_input_mask; - display = gdk_window_get_display (gdk_event_get_window ((GdkEvent *) event)); + display = gdk_surface_get_display (gdk_event_get_window ((GdkEvent *) event)); no_text_input_mask = gdk_keymap_get_modifier_mask (gdk_display_get_keymap (display), diff --git a/gtk/gtkinvisible.c b/gtk/gtkinvisible.c index d2aec30cff..c8d330bbaa 100644 --- a/gtk/gtkinvisible.c +++ b/gtk/gtkinvisible.c @@ -220,11 +220,11 @@ gtk_invisible_get_display (GtkInvisible *invisible) static void gtk_invisible_realize (GtkWidget *widget) { - GdkWindow *window; + GdkSurface *window; gtk_widget_set_realized (widget, TRUE); - window = gdk_window_new_temp (gtk_widget_get_display (widget)); + window = gdk_surface_new_temp (gtk_widget_get_display (widget)); gtk_widget_set_window (widget, window); gtk_widget_register_window (widget, window); } diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index bd0720d5c8..fc277ee870 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -1160,16 +1160,16 @@ gtk_main_iteration_do (gboolean blocking) } static void -rewrite_events_translate (GdkWindow *old_window, - GdkWindow *new_window, +rewrite_events_translate (GdkSurface *old_window, + GdkSurface *new_window, gdouble *x, gdouble *y) { gint old_origin_x, old_origin_y; gint new_origin_x, new_origin_y; - gdk_window_get_origin (old_window, &old_origin_x, &old_origin_y); - gdk_window_get_origin (new_window, &new_origin_x, &new_origin_y); + gdk_surface_get_origin (old_window, &old_origin_x, &old_origin_y); + gdk_surface_get_origin (new_window, &new_origin_x, &new_origin_y); *x += old_origin_x - new_origin_x; *y += old_origin_y - new_origin_y; @@ -1177,7 +1177,7 @@ rewrite_events_translate (GdkWindow *old_window, static GdkEvent * rewrite_event_for_window (GdkEvent *event, - GdkWindow *new_window) + GdkSurface *new_window) { event = gdk_event_copy (event); @@ -1245,7 +1245,7 @@ rewrite_event_for_window (GdkEvent *event, static GdkEvent * rewrite_event_for_grabs (GdkEvent *event) { - GdkWindow *grab_window; + GdkSurface *grab_window; GtkWidget *event_widget, *grab_widget; gpointer grab_widget_ptr; gboolean owner_events; @@ -1268,7 +1268,7 @@ rewrite_event_for_grabs (GdkEvent *event) case GDK_TOUCH_CANCEL: case GDK_TOUCHPAD_SWIPE: case GDK_TOUCHPAD_PINCH: - display = gdk_window_get_display (event->any.window); + display = gdk_surface_get_display (event->any.window); device = gdk_event_get_device (event); if (!gdk_device_grab_info (display, device, &grab_window, &owner_events) || @@ -1280,7 +1280,7 @@ rewrite_event_for_grabs (GdkEvent *event) } event_widget = gtk_get_event_widget (event); - gdk_window_get_user_data (grab_window, &grab_widget_ptr); + gdk_surface_get_user_data (grab_window, &grab_widget_ptr); grab_widget = grab_widget_ptr; if (grab_widget && @@ -1659,10 +1659,10 @@ gtk_main_do_event (GdkEvent *event) GList *tmp_list; /* Find the widget which got the event. We store the widget - * in the user_data field of GdkWindow's. Ignore the event + * in the user_data field of GdkSurface's. Ignore the event * if we don't have a widget for it, except for GDK_PROPERTY_NOTIFY * events which are handled specially. Though this happens rarely, - * bogus events can occur for e.g. destroyed GdkWindows. + * bogus events can occur for e.g. destroyed GdkSurfaces. */ event_widget = gtk_get_event_widget (event); if (!event_widget) @@ -1917,7 +1917,7 @@ synth_crossing_for_grab_notify (GtkWidget *from, while (devices) { GdkDevice *device = devices->data; - GdkWindow *from_window, *to_window; + GdkSurface *from_window, *to_window; /* Do not propagate events more than once to * the same windows if non-multidevice aware. @@ -1929,7 +1929,7 @@ synth_crossing_for_grab_notify (GtkWidget *from, from_window = _gtk_widget_get_device_window (from, device); if (from_window && - !gdk_window_get_support_multidevice (from_window) && + !gdk_surface_get_support_multidevice (from_window) && g_list_find (info->notified_windows, from_window)) from_window = NULL; } @@ -1941,7 +1941,7 @@ synth_crossing_for_grab_notify (GtkWidget *from, to_window = _gtk_widget_get_device_window (to, device); if (to_window && - !gdk_window_get_support_multidevice (to_window) && + !gdk_surface_get_support_multidevice (to_window) && g_list_find (info->notified_windows, to_window)) to_window = NULL; } @@ -2318,9 +2318,9 @@ gtk_get_event_widget (const GdkEvent *event) widget = NULL; if (event && event->any.window && - (event->any.type == GDK_DESTROY || !gdk_window_is_destroyed (event->any.window))) + (event->any.type == GDK_DESTROY || !gdk_surface_is_destroyed (event->any.window))) { - gdk_window_get_user_data (event->any.window, &widget_ptr); + gdk_surface_get_user_data (event->any.window, &widget_ptr); widget = widget_ptr; } diff --git a/gtk/gtkmediastream.c b/gtk/gtkmediastream.c index 6c03939ab6..594a29b92c 100644 --- a/gtk/gtkmediastream.c +++ b/gtk/gtkmediastream.c @@ -129,13 +129,13 @@ gtk_media_stream_default_update_audio (GtkMediaStream *self, static void gtk_media_stream_default_realize (GtkMediaStream *self, - GdkWindow *window) + GdkSurface *window) { } static void gtk_media_stream_default_unrealize (GtkMediaStream *self, - GdkWindow *window) + GdkSurface *window) { } @@ -856,9 +856,9 @@ gtk_media_stream_set_volume (GtkMediaStream *self, /** * gtk_media_stream_realize: * @self: a #GtkMediaStream - * @window: a #GdkWindow + * @window: a #GdkSurface * - * Called by users to attach the media stream to a #GdkWindow they manage. + * Called by users to attach the media stream to a #GdkSurface they manage. * The stream can then access the resources of @window for its rendering * purposes. In particular, media streams might want to create * #GdkGLContexts or sync to the #GdkFrameClock. @@ -875,10 +875,10 @@ gtk_media_stream_set_volume (GtkMediaStream *self, **/ void gtk_media_stream_realize (GtkMediaStream *self, - GdkWindow *window) + GdkSurface *window) { g_return_if_fail (GTK_IS_MEDIA_STREAM (self)); - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); g_object_ref (self); g_object_ref (window); @@ -889,17 +889,17 @@ gtk_media_stream_realize (GtkMediaStream *self, /** * gtk_media_stream_unrealize: * @self: a #GtkMediaStream previously realized - * @window: the #GdkWindow the stream was realized with + * @window: the #GdkSurface the stream was realized with * * Undoes a previous call to gtk_media_stream_realize() and causes * the stream to release all resources it had allocated from @window. **/ void gtk_media_stream_unrealize (GtkMediaStream *self, - GdkWindow *window) + GdkSurface *window) { g_return_if_fail (GTK_IS_MEDIA_STREAM (self)); - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); GTK_MEDIA_STREAM_GET_CLASS (self)->unrealize (self, window); diff --git a/gtk/gtkmediastream.h b/gtk/gtkmediastream.h index a04fafd8fa..aa1ba62add 100644 --- a/gtk/gtkmediastream.h +++ b/gtk/gtkmediastream.h @@ -45,9 +45,9 @@ struct _GtkMediaStreamClass gboolean muted, double volume); void (* realize) (GtkMediaStream *self, - GdkWindow *window); + GdkSurface *window); void (* unrealize) (GtkMediaStream *self, - GdkWindow *window); + GdkSurface *window); /* Padding for future expansion */ void (*_gtk_reserved1) (void); @@ -110,10 +110,10 @@ void gtk_media_stream_set_volume (GtkMediaStream double volume); GDK_AVAILABLE_IN_ALL void gtk_media_stream_realize (GtkMediaStream *self, - GdkWindow *window); + GdkSurface *window); GDK_AVAILABLE_IN_ALL void gtk_media_stream_unrealize (GtkMediaStream *self, - GdkWindow *window); + GdkSurface *window); /* for implementations only */ GDK_AVAILABLE_IN_ALL diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index dc8a9ac950..e1215a34f0 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -299,7 +299,7 @@ static void gtk_menu_remove (GtkContainer *menu, GtkWidget *widget); static void menu_grab_transfer_window_destroy (GtkMenu *menu); -static GdkWindow *menu_grab_transfer_window_get (GtkMenu *menu); +static GdkSurface *menu_grab_transfer_window_get (GtkMenu *menu); static gboolean gtk_menu_real_can_activate_accel (GtkWidget *widget, guint signal_id); @@ -773,7 +773,7 @@ gtk_menu_class_init (GtkMenuClass *class) /** * GtkMenu:menu-type-hint: * - * The #GdkWindowTypeHint to use for the menu's #GdkWindow. + * The #GdkSurfaceTypeHint to use for the menu's #GdkSurface. * * See gtk_menu_popup_at_rect (), gtk_menu_popup_at_widget (), * gtk_menu_popup_at_pointer (), #GtkMenu:anchor-hints, @@ -784,8 +784,8 @@ gtk_menu_class_init (GtkMenuClass *class) g_param_spec_enum ("menu-type-hint", P_("Menu type hint"), P_("Menu window type hint"), - GDK_TYPE_WINDOW_TYPE_HINT, - GDK_WINDOW_TYPE_HINT_POPUP_MENU, + GDK_TYPE_SURFACE_TYPE_HINT, + GDK_SURFACE_TYPE_HINT_POPUP_MENU, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_NAME | @@ -1124,7 +1124,7 @@ gtk_menu_init (GtkMenu *menu) priv->anchor_hints = GDK_ANCHOR_FLIP | GDK_ANCHOR_SLIDE | GDK_ANCHOR_RESIZE; priv->rect_anchor_dx = 0; priv->rect_anchor_dy = 0; - priv->menu_type_hint = GDK_WINDOW_TYPE_HINT_POPUP_MENU; + priv->menu_type_hint = GDK_SURFACE_TYPE_HINT_POPUP_MENU; _gtk_widget_set_captured_event_handler (GTK_WIDGET (menu), gtk_menu_captured_event); @@ -1162,7 +1162,7 @@ gtk_menu_init (GtkMenu *menu) } static void -moved_to_rect_cb (GdkWindow *window, +moved_to_rect_cb (GdkSurface *window, const GdkRectangle *flipped_rect, const GdkRectangle *final_rect, gboolean flipped_x, @@ -1470,7 +1470,7 @@ gtk_menu_real_insert (GtkMenuShell *menu_shell, } static gboolean -popup_grab_on_window (GdkWindow *window, +popup_grab_on_window (GdkSurface *window, GdkDevice *pointer) { GdkGrabStatus status; @@ -1488,8 +1488,8 @@ static void associate_menu_grab_transfer_window (GtkMenu *menu) { GtkMenuPrivate *priv = menu->priv; - GdkWindow *toplevel_window; - GdkWindow *transfer_window; + GdkSurface *toplevel_window; + GdkSurface *transfer_window; toplevel_window = gtk_widget_get_window (priv->toplevel); transfer_window = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-window"); @@ -1603,7 +1603,7 @@ gtk_menu_popup_internal (GtkMenu *menu, } else { - GdkWindow *transfer_window; + GdkSurface *transfer_window; xgrab_shell = widget; transfer_window = menu_grab_transfer_window_get (menu); @@ -1861,7 +1861,7 @@ get_device_for_event (const GdkEvent *event) /** * gtk_menu_popup_at_rect: * @menu: the #GtkMenu to pop up - * @rect_window: (not nullable): the #GdkWindow @rect is relative to + * @rect_window: (not nullable): the #GdkSurface @rect is relative to * @rect: (not nullable): the #GdkRectangle to align @menu with * @rect_anchor: the point on @rect to align with @menu's anchor point * @menu_anchor: the point on @menu to align with @rect's anchor point @@ -1889,7 +1889,7 @@ get_device_for_event (const GdkEvent *event) */ void gtk_menu_popup_at_rect (GtkMenu *menu, - GdkWindow *rect_window, + GdkSurface *rect_window, const GdkRectangle *rect, GdkGravity rect_anchor, GdkGravity menu_anchor, @@ -1902,7 +1902,7 @@ gtk_menu_popup_at_rect (GtkMenu *menu, guint32 activate_time = GDK_CURRENT_TIME; g_return_if_fail (GTK_IS_MENU (menu)); - g_return_if_fail (GDK_IS_WINDOW (rect_window)); + g_return_if_fail (GDK_IS_SURFACE (rect_window)); g_return_if_fail (rect); priv = menu->priv; @@ -2054,7 +2054,7 @@ gtk_menu_popup_at_pointer (GtkMenu *menu, const GdkEvent *trigger_event) { GdkEvent *current_event = NULL; - GdkWindow *rect_window = NULL; + GdkSurface *rect_window = NULL; GdkDevice *device = NULL; GdkRectangle rect = { 0, 0, 1, 1 }; @@ -2078,7 +2078,7 @@ gtk_menu_popup_at_pointer (GtkMenu *menu, device = gdk_device_get_associated_device (device); if (device) - gdk_window_get_device_position (rect_window, device, &rect.x, &rect.y, NULL); + gdk_surface_get_device_position (rect_window, device, &rect.x, &rect.y, NULL); } } else @@ -2517,16 +2517,16 @@ gtk_menu_focus (GtkWidget *widget, /* See notes in gtk_menu_popup() for information * about the “grab transfer window” */ -static GdkWindow * +static GdkSurface * menu_grab_transfer_window_get (GtkMenu *menu) { - GdkWindow *window = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-window"); + GdkSurface *window = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-window"); if (!window) { - window = gdk_window_new_temp (gtk_widget_get_display (GTK_WIDGET (menu))); + window = gdk_surface_new_temp (gtk_widget_get_display (GTK_WIDGET (menu))); gtk_widget_register_window (GTK_WIDGET (menu), window); - gdk_window_show (window); + gdk_surface_show (window); g_object_set_data (G_OBJECT (menu), I_("gtk-menu-transfer-window"), window); } @@ -2537,13 +2537,13 @@ menu_grab_transfer_window_get (GtkMenu *menu) static void menu_grab_transfer_window_destroy (GtkMenu *menu) { - GdkWindow *window = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-window"); + GdkSurface *window = g_object_get_data (G_OBJECT (menu), "gtk-menu-transfer-window"); if (window) { - GdkWindow *widget_window; + GdkSurface *widget_window; gtk_widget_unregister_window (GTK_WIDGET (menu), window); - gdk_window_destroy (window); + gdk_surface_destroy (window); g_object_set_data (G_OBJECT (menu), I_("gtk-menu-transfer-window"), NULL); widget_window = gtk_widget_get_window (GTK_WIDGET (menu)); @@ -2956,7 +2956,7 @@ pointer_in_menu_window (GtkWidget *widget, GtkMenuShell *menu_shell; gint window_x, window_y; - gdk_window_get_position (gtk_widget_get_window (priv->toplevel), + gdk_surface_get_position (gtk_widget_get_window (priv->toplevel), &window_x, &window_y); gtk_widget_get_allocation (widget, &allocation); @@ -3194,7 +3194,7 @@ gtk_menu_scroll_by (GtkMenu *menu, if ((priv->scroll_offset >= 0) && (offset < 0)) offset = 0; - view_height = gdk_window_get_height (gtk_widget_get_window (widget)); + view_height = gdk_surface_get_height (gtk_widget_get_window (widget)); if (priv->scroll_offset == 0 && view_height >= priv->requested_height) @@ -3242,7 +3242,7 @@ get_arrows_sensitive_area (GtkMenu *menu, { GtkMenuPrivate *priv = menu->priv; GtkWidget *widget = GTK_WIDGET (menu); - GdkWindow *window; + GdkSurface *window; gint width, height; gint win_x, win_y; gint top_arrow_height, bottom_arrow_height; @@ -3259,10 +3259,10 @@ get_arrows_sensitive_area (GtkMenu *menu, NULL, NULL); window = gtk_widget_get_window (widget); - width = gdk_window_get_width (window); - height = gdk_window_get_height (window); + width = gdk_surface_get_width (window); + height = gdk_surface_get_height (window); - gdk_window_get_position (window, &win_x, &win_y); + gdk_surface_get_position (window, &win_x, &win_y); if (upper) { @@ -3297,7 +3297,7 @@ gtk_menu_handle_scrolling (GtkMenu *menu, menu_shell = GTK_MENU_SHELL (menu); - gdk_window_get_position (gtk_widget_get_window (priv->toplevel), + gdk_surface_get_position (gtk_widget_get_window (priv->toplevel), &top_x, &top_y); x -= top_x; y -= top_y; @@ -3509,7 +3509,7 @@ pointer_on_menu_widget (GtkMenu *menu, gint window_x, window_y; gtk_widget_get_allocation (GTK_WIDGET (menu), &allocation); - gdk_window_get_position (gtk_widget_get_window (priv->toplevel), + gdk_surface_get_position (gtk_widget_get_window (priv->toplevel), &window_x, &window_y); if (x_root >= window_x && x_root < window_x + allocation.width && @@ -3598,7 +3598,7 @@ gtk_menu_captured_event (GtkWidget *widget, y_diff = y_root - priv->drag_start_y; offset = priv->initial_drag_offset - y_diff; - view_height = gdk_window_get_height (gtk_widget_get_window (widget)); + view_height = gdk_surface_get_height (gtk_widget_get_window (widget)); get_arrows_border (menu, &arrow_border); if (priv->upper_arrow_visible) @@ -3772,7 +3772,7 @@ gtk_menu_position_legacy (GtkMenu *menu, * to set a different hint */ if (!gtk_widget_get_visible (priv->toplevel)) - gtk_window_set_type_hint (GTK_WINDOW (priv->toplevel), GDK_WINDOW_TYPE_HINT_POPUP_MENU); + gtk_window_set_type_hint (GTK_WINDOW (priv->toplevel), GDK_SURFACE_TYPE_HINT_POPUP_MENU); if (priv->position_func) { @@ -3977,14 +3977,14 @@ gtk_menu_position (GtkMenu *menu, gboolean set_scroll_offset) { GtkMenuPrivate *priv = menu->priv; - GdkWindow *rect_window = NULL; + GdkSurface *rect_window = NULL; GdkRectangle rect; GtkTextDirection text_direction = GTK_TEXT_DIR_NONE; GdkGravity rect_anchor; GdkGravity menu_anchor; GdkAnchorHints anchor_hints; gint rect_anchor_dx, rect_anchor_dy; - GdkWindow *toplevel; + GdkSurface *toplevel; gboolean emulated_move_to_rect = FALSE; rect_anchor = priv->rect_anchor; @@ -4023,7 +4023,7 @@ gtk_menu_position (GtkMenu *menu, rect = (GdkRectangle) { 0, 0, 1, 1 }; rect_window = gtk_widget_get_window (attach_widget); - gdk_window_get_device_position (rect_window, grab_device, + gdk_surface_get_device_position (rect_window, grab_device, &rect.x, &rect.y, NULL); text_direction = gtk_widget_get_direction (attach_widget); rect_anchor = GDK_GRAVITY_SOUTH_EAST; @@ -4060,7 +4060,7 @@ gtk_menu_position (GtkMenu *menu, toplevel = gtk_widget_get_window (priv->toplevel); - gdk_window_set_transient_for (toplevel, rect_window); + gdk_surface_set_transient_for (toplevel, rect_window); g_signal_handlers_disconnect_by_func (toplevel, moved_to_rect_cb, menu); @@ -4069,7 +4069,7 @@ gtk_menu_position (GtkMenu *menu, menu); - gdk_window_move_to_rect (toplevel, + gdk_surface_move_to_rect (toplevel, &rect, rect_anchor, menu_anchor, @@ -4187,7 +4187,7 @@ gtk_menu_scroll_item_visible (GtkMenuShell *menu_shell, &child_offset, &child_height, &last_child)) { y = priv->scroll_offset; - height = gdk_window_get_height (gtk_widget_get_window (widget)); + height = gdk_surface_get_height (gtk_widget_get_window (widget)); if (child_offset < y) { diff --git a/gtk/gtkmenu.h b/gtk/gtkmenu.h index 119138701e..1eb9dfeaa6 100644 --- a/gtk/gtkmenu.h +++ b/gtk/gtkmenu.h @@ -154,7 +154,7 @@ void gtk_menu_popup_for_device (GtkMenu *menu, guint32 activate_time); GDK_AVAILABLE_IN_ALL void gtk_menu_popup_at_rect (GtkMenu *menu, - GdkWindow *rect_window, + GdkSurface *rect_window, const GdkRectangle *rect, GdkGravity rect_anchor, GdkGravity menu_anchor, diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c index ee0eec7561..2703ea6ee1 100644 --- a/gtk/gtkmenubutton.c +++ b/gtk/gtkmenubutton.c @@ -295,7 +295,7 @@ popup_menu (GtkMenuButton *menu_button, "anchor-hints", (GDK_ANCHOR_FLIP_Y | GDK_ANCHOR_SLIDE | GDK_ANCHOR_RESIZE), - "menu-type-hint", GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU, + "menu-type-hint", GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU, NULL); switch (gtk_widget_get_halign (priv->menu)) diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c index c849677300..353e4795e6 100644 --- a/gtk/gtkmenuitem.c +++ b/gtk/gtkmenuitem.c @@ -1416,8 +1416,8 @@ gtk_menu_item_real_popup_submenu (GtkWidget *widget, GDK_ANCHOR_SLIDE | GDK_ANCHOR_RESIZE), "menu-type-hint", (priv->from_menubar ? - GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU : - GDK_WINDOW_TYPE_HINT_POPUP_MENU), + GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU : + GDK_SURFACE_TYPE_HINT_POPUP_MENU), NULL); gtk_menu_popup_at_widget (GTK_MENU (priv->submenu), diff --git a/gtk/gtkmenuprivate.h b/gtk/gtkmenuprivate.h index ea64d6ea6d..28ca2a6187 100644 --- a/gtk/gtkmenuprivate.h +++ b/gtk/gtkmenuprivate.h @@ -53,7 +53,7 @@ struct _GtkMenuPrivate gint position_x; gint position_y; - GdkWindow *rect_window; + GdkSurface *rect_window; GdkRectangle rect; GtkWidget *widget; GdkGravity rect_anchor; @@ -61,7 +61,7 @@ struct _GtkMenuPrivate GdkAnchorHints anchor_hints; gint rect_anchor_dx; gint rect_anchor_dy; - GdkWindowTypeHint menu_type_hint; + GdkSurfaceTypeHint menu_type_hint; guint toggle_size; guint accel_size; diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index b554b7df35..c942e52556 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -598,7 +598,7 @@ gtk_menu_shell_event (GtkWidget *widget, { GtkMenuShell *menu_shell = GTK_MENU_SHELL (widget); GtkMenuShellPrivate *priv = menu_shell->priv; - GdkWindow *window; + GdkSurface *window; if (gdk_event_get_event_type (event) == GDK_GRAB_BROKEN) { diff --git a/gtk/gtkmnemonichash.c b/gtk/gtkmnemonichash.c index 845119f590..bd5ea6200c 100644 --- a/gtk/gtkmnemonichash.c +++ b/gtk/gtkmnemonichash.c @@ -111,7 +111,7 @@ _gtk_mnemonic_hash_activate (GtkMnemonicHash *mnemonic_hash, { GSList *list, *targets; GtkWidget *widget, *chosen_widget; - GdkWindow *window; + GdkSurface *window; gboolean overloaded; targets = g_hash_table_lookup (mnemonic_hash->hash, @@ -128,7 +128,7 @@ _gtk_mnemonic_hash_activate (GtkMnemonicHash *mnemonic_hash, if (gtk_widget_is_sensitive (widget) && gtk_widget_get_mapped (widget) && - window && gdk_window_is_viewable (window)) + window && gdk_surface_is_viewable (window)) { if (chosen_widget) { diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index 2dcab2f8ad..3d22f05305 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -389,7 +389,7 @@ gtk_popover_hide_internal (GtkPopover *popover) if (gtk_widget_get_realized (widget)) { cairo_region_t *region = cairo_region_create (); - gdk_window_input_shape_combine_region (gtk_widget_get_window (widget), + gdk_surface_input_shape_combine_region (gtk_widget_get_window (widget), region, 0, 0); cairo_region_destroy (region); } @@ -471,7 +471,7 @@ static void gtk_popover_realize (GtkWidget *widget) { GtkAllocation allocation; - GdkWindow *window; + GdkSurface *window; gtk_widget_get_window_allocation (widget, &allocation); @@ -486,16 +486,16 @@ gtk_popover_realize (GtkWidget *widget) g_assert (GTK_IS_WINDOW (toplevel)); - window = gdk_wayland_window_new_subsurface (gtk_widget_get_display (toplevel), + window = gdk_wayland_surface_new_subsurface (gtk_widget_get_display (toplevel), &allocation); - gdk_window_set_transient_for (window, + gdk_surface_set_transient_for (window, gtk_widget_get_window (toplevel)); } else #endif { - window = gdk_window_new_child (gtk_widget_get_parent_window (widget), + window = gdk_surface_new_child (gtk_widget_get_parent_window (widget), &allocation); } @@ -746,7 +746,7 @@ gtk_popover_map (GtkWidget *widget) GTK_WIDGET_CLASS (gtk_popover_parent_class)->map (widget); - gdk_window_show (gtk_widget_get_window (widget)); + gdk_surface_show (gtk_widget_get_window (widget)); gtk_popover_update_position (GTK_POPOVER (widget)); gtk_window_set_default (priv->window, priv->default_widget); @@ -759,7 +759,7 @@ gtk_popover_unmap (GtkWidget *widget) priv->button_pressed = FALSE; - gdk_window_hide (gtk_widget_get_window (widget)); + gdk_surface_hide (gtk_widget_get_window (widget)); GTK_WIDGET_CLASS (gtk_popover_parent_class)->unmap (widget); if (gtk_window_get_default_widget (priv->window) == priv->default_widget) @@ -826,7 +826,7 @@ gtk_popover_get_gap_coords (GtkPopover *popover, gtk_widget_translate_coordinates (priv->widget, GTK_WIDGET (priv->window), rect.x, rect.y, &rect.x, &rect.y); - gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (popover)), + gdk_surface_get_origin (gtk_widget_get_window (GTK_WIDGET (popover)), &win_x, &win_y); rect.x -= win_x; rect.y -= win_y; @@ -1018,7 +1018,7 @@ gtk_popover_update_shape (GtkPopover *popover) GtkWidget *widget = GTK_WIDGET (popover); cairo_surface_t *surface; cairo_region_t *region; - GdkWindow *win; + GdkSurface *win; cairo_t *cr; #ifdef GDK_WINDOWING_WAYLAND @@ -1028,10 +1028,10 @@ gtk_popover_update_shape (GtkPopover *popover) win = gtk_widget_get_window (widget); surface = - gdk_window_create_similar_surface (win, + gdk_surface_create_similar_surface (win, CAIRO_CONTENT_COLOR_ALPHA, - gdk_window_get_width (win), - gdk_window_get_height (win)); + gdk_surface_get_width (win), + gdk_surface_get_height (win)); cr = cairo_create (surface); gtk_popover_fill_border_path (popover, cr); @@ -1043,7 +1043,7 @@ gtk_popover_update_shape (GtkPopover *popover) gtk_widget_shape_combine_region (widget, region); cairo_region_destroy (region); - gdk_window_set_child_shapes (gtk_widget_get_window (widget)); + gdk_surface_set_child_shapes (gtk_widget_get_window (widget)); } static void @@ -1363,7 +1363,7 @@ gtk_popover_size_allocate (GtkWidget *widget, { GtkAllocation a; gtk_widget_get_window_allocation (widget, &a); - gdk_window_move_resize (gtk_widget_get_window (widget), + gdk_surface_move_resize (gtk_widget_get_window (widget), a.x, a.y, a.width, a.height); gtk_popover_update_shape (popover); } @@ -1500,7 +1500,7 @@ gtk_popover_show (GtkWidget *widget) priv->state = STATE_SHOWN; if (gtk_widget_get_realized (widget)) - gdk_window_input_shape_combine_region (gtk_widget_get_window (widget), + gdk_surface_input_shape_combine_region (gtk_widget_get_window (widget), NULL, 0, 0); } diff --git a/gtk/gtkprintoperation-win32.c b/gtk/gtkprintoperation-win32.c index 71c5688f68..c649c12ac9 100644 --- a/gtk/gtkprintoperation-win32.c +++ b/gtk/gtkprintoperation-win32.c @@ -659,7 +659,7 @@ static HWND get_parent_hwnd (GtkWidget *widget) { gtk_widget_realize (widget); - return gdk_win32_window_get_handle (gtk_widget_get_window (widget)); + return gdk_win32_surface_get_handle (gtk_widget_get_window (widget)); } static void @@ -1343,7 +1343,7 @@ plug_grab_notify (GtkWidget *widget, gboolean was_grabbed, GtkPrintOperation *op) { - EnableWindow (GetAncestor (GDK_WINDOW_HWND (gtk_widget_get_window (widget)), GA_ROOT), + EnableWindow (GetAncestor (GDK_SURFACE_HWND (gtk_widget_get_window (widget)), GA_ROOT), was_grabbed); } @@ -1371,7 +1371,7 @@ pageDlgProc (HWND wnd, UINT message, WPARAM wparam, LPARAM lparam) gtk_container_add (GTK_CONTAINER (plug), op->priv->custom_widget); gtk_widget_show (op->priv->custom_widget); gtk_widget_show (plug); - gdk_window_focus (gtk_widget_get_window (plug), GDK_CURRENT_TIME); + gdk_surface_focus (gtk_widget_get_window (plug), GDK_CURRENT_TIME); /* This dialog is modal, so we grab the embed widget */ gtk_grab_add (plug); diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c index 67e377f1ba..050b765db8 100644 --- a/gtk/gtksettings.c +++ b/gtk/gtksettings.c @@ -560,7 +560,7 @@ gtk_settings_class_init (GtkSettingsClass *class) * * When %TRUE, keyboard navigation and other input-related errors * will cause a beep. Since the error bell is implemented using - * gdk_window_beep(), the windowing system may offer ways to + * gdk_surface_beep(), the windowing system may offer ways to * configure the error bell in many ways, such as flashing the * window or similar visual effects. */ diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c index a173512863..771a71018e 100644 --- a/gtk/gtkshortcutswindow.c +++ b/gtk/gtkshortcutswindow.c @@ -876,7 +876,7 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self) PangoAttrList *attributes; gtk_window_set_resizable (GTK_WINDOW (self), FALSE); - gtk_window_set_type_hint (GTK_WINDOW (self), GDK_WINDOW_TYPE_HINT_DIALOG); + gtk_window_set_type_hint (GTK_WINDOW (self), GDK_SURFACE_TYPE_HINT_DIALOG); g_signal_connect (self, "key-press-event", G_CALLBACK (window_key_press_event_cb), NULL); diff --git a/gtk/gtktextutil.c b/gtk/gtktextutil.c index 5a59ee540f..74ca454e5a 100644 --- a/gtk/gtktextutil.c +++ b/gtk/gtktextutil.c @@ -233,7 +233,7 @@ _gtk_text_util_create_drag_icon (GtkWidget *widget, pixmap_width = layout_width / PANGO_SCALE; pixmap_height = layout_height / PANGO_SCALE; - 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_ALPHA, pixmap_width, pixmap_height); cr = cairo_create (surface); @@ -342,7 +342,7 @@ _gtk_text_util_create_rich_drag_icon (GtkWidget *widget, layout_width = MIN (layout_width, DRAG_ICON_MAX_WIDTH); layout_height = MIN (layout_height, DRAG_ICON_MAX_HEIGHT); - 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_ALPHA, layout_width, layout_height); diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 85daa761d0..5985672267 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -104,9 +104,9 @@ * is to change which lines are onscreen. This happens when the value * of a scroll adjustment changes. So the code path begins in * gtk_text_view_value_changed() and goes like this: - * - gdk_window_scroll() to reflect the new adjustment value + * - gdk_surface_scroll() to reflect the new adjustment value * - validate the lines that were moved onscreen - * - gdk_window_process_updates() to handle the exposes immediately + * - gdk_surface_process_updates() to handle the exposes immediately * * The second way is that you get the “invalidated” signal from the layout, * indicating that lines have become invalid. This code path begins in @@ -8978,7 +8978,7 @@ gtk_text_view_selection_bubble_popup_set (GtkTextView *text_view) g_source_set_name_by_id (priv->selection_bubble_timeout_id, "[gtk+] gtk_text_view_selection_bubble_popup_cb"); } -/* Child GdkWindows */ +/* Child GdkSurfaces */ static void node_style_changed_cb (GtkCssNode *node, diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c index 5d923e8223..6549b680ba 100644 --- a/gtk/gtktoolbar.c +++ b/gtk/gtktoolbar.c @@ -2238,7 +2238,7 @@ show_menu (GtkToolbar *toolbar, "anchor-hints", (GDK_ANCHOR_FLIP_Y | GDK_ANCHOR_SLIDE | GDK_ANCHOR_RESIZE), - "menu-type-hint", GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU, + "menu-type-hint", GDK_SURFACE_TYPE_HINT_DROPDOWN_MENU, "rect-anchor-dx", -minimum_size.width, NULL); diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c index 99b8ac736e..c6ad2cbe27 100644 --- a/gtk/gtktooltip.c +++ b/gtk/gtktooltip.c @@ -109,7 +109,7 @@ struct _GtkTooltip gdouble last_x; gdouble last_y; - GdkWindow *last_window; + GdkSurface *last_window; guint timeout_id; guint browse_mode_timeout_id; @@ -137,10 +137,10 @@ static void gtk_tooltip_display_closed (GdkDisplay *display, gboolean was_error, GtkTooltip *tooltip); static void gtk_tooltip_set_last_window (GtkTooltip *tooltip, - GdkWindow *window); + GdkSurface *window); static void gtk_tooltip_handle_event_internal (GdkEventType event_type, - GdkWindow *window, + GdkSurface *window, gdouble dx, gdouble dy); @@ -386,7 +386,7 @@ void gtk_tooltip_trigger_tooltip_query (GdkDisplay *display) { gint x, y; - GdkWindow *window; + GdkSurface *window; GdkDevice *device; /* Trigger logic as if the mouse moved */ @@ -408,7 +408,7 @@ gtk_tooltip_window_hide (GtkWidget *widget, } GtkWidget * -_gtk_widget_find_at_coords (GdkWindow *window, +_gtk_widget_find_at_coords (GdkSurface *window, gint window_x, gint window_y, gint *widget_x, @@ -417,9 +417,9 @@ _gtk_widget_find_at_coords (GdkWindow *window, GtkWidget *event_widget; GtkWidget *picked_widget; - g_return_val_if_fail (GDK_IS_WINDOW (window), NULL); + g_return_val_if_fail (GDK_IS_SURFACE (window), NULL); - gdk_window_get_user_data (window, (void **)&event_widget); + gdk_surface_get_user_data (window, (void **)&event_widget); if (!event_widget) return NULL; @@ -436,7 +436,7 @@ _gtk_widget_find_at_coords (GdkWindow *window, * allocation relative (x, y) of the returned widget. */ static GtkWidget * -find_topmost_widget_coords (GdkWindow *window, +find_topmost_widget_coords (GdkSurface *window, gdouble dx, gdouble dy, gint *x, @@ -518,7 +518,7 @@ gtk_tooltip_display_closed (GdkDisplay *display, static void gtk_tooltip_set_last_window (GtkTooltip *tooltip, - GdkWindow *window) + GdkSurface *window) { GtkWidget *window_widget = NULL; @@ -536,7 +536,7 @@ gtk_tooltip_set_last_window (GtkTooltip *tooltip, (gpointer *) &tooltip->last_window); if (window) - gdk_window_get_user_data (window, (gpointer *) &window_widget); + gdk_surface_get_user_data (window, (gpointer *) &window_widget); if (window_widget) window_widget = gtk_widget_get_toplevel (window_widget); @@ -606,7 +606,7 @@ get_bounding_box (GtkWidget *widget, { GtkWidget *toplevel; GtkAllocation allocation; - GdkWindow *window; + GdkSurface *window; gint x, y; gint w, h; gint x1, y1; @@ -646,10 +646,10 @@ get_bounding_box (GtkWidget *widget, h -= border.top + border.bottom; } - gdk_window_get_root_coords (window, x, y, &x1, &y1); - gdk_window_get_root_coords (window, x + w, y, &x2, &y2); - gdk_window_get_root_coords (window, x, y + h, &x3, &y3); - gdk_window_get_root_coords (window, x + w, y + h, &x4, &y4); + gdk_surface_get_root_coords (window, x, y, &x1, &y1); + gdk_surface_get_root_coords (window, x + w, y, &x2, &y2); + gdk_surface_get_root_coords (window, x, y + h, &x3, &y3); + gdk_surface_get_root_coords (window, x + w, y + h, &x4, &y4); #define MIN4(a,b,c,d) MIN(MIN(a,b),MIN(c,d)) #define MAX4(a,b,c,d) MAX(MAX(a,b),MAX(c,d)) @@ -847,7 +847,7 @@ static void gtk_tooltip_show_tooltip (GdkDisplay *display) { gint x, y; - GdkWindow *window; + GdkSurface *window; GtkWidget *tooltip_widget; GtkTooltip *tooltip; gboolean return_value = FALSE; @@ -866,14 +866,14 @@ gtk_tooltip_show_tooltip (GdkDisplay *display) window = tooltip->last_window; - if (!GDK_IS_WINDOW (window)) + if (!GDK_IS_SURFACE (window)) return; device = gdk_seat_get_pointer (gdk_display_get_default_seat (display)); - gdk_window_get_device_position (window, device, &x, &y, NULL); + gdk_surface_get_device_position (window, device, &x, &y, NULL); - gdk_window_get_root_coords (window, x, y, &tx, &ty); + gdk_surface_get_root_coords (window, x, y, &tx, &ty); tooltip->last_x = tx; tooltip->last_y = ty; @@ -1052,7 +1052,7 @@ _gtk_tooltip_focus_in (GtkWidget *widget) tooltip->keyboard_widget = g_object_ref (widget); - gdk_window_get_device_position (gtk_widget_get_window (widget), + gdk_surface_get_device_position (gtk_widget_get_window (widget), device, &x, &y, NULL); return_value = gtk_tooltip_run_requery (&widget, tooltip, &x, &y); @@ -1174,7 +1174,7 @@ void _gtk_tooltip_handle_event (GdkEvent *event) { GdkEventType event_type; - GdkWindow *window; + GdkSurface *window; gdouble dx, dy; if (!tooltips_enabled (event)) @@ -1189,7 +1189,7 @@ _gtk_tooltip_handle_event (GdkEvent *event) static void gtk_tooltip_handle_event_internal (GdkEventType event_type, - GdkWindow *window, + GdkSurface *window, gdouble dx, gdouble dy) { @@ -1199,7 +1199,7 @@ gtk_tooltip_handle_event_internal (GdkEventType event_type, GtkTooltip *current_tooltip; has_tooltip_widget = find_topmost_widget_coords (window, dx, dy, &x, &y); - display = gdk_window_get_display (window); + display = gdk_surface_get_display (window); current_tooltip = g_object_get_qdata (G_OBJECT (display), quark_current_tooltip); if (current_tooltip) diff --git a/gtk/gtktooltipprivate.h b/gtk/gtktooltipprivate.h index 427015e007..34f37934f4 100644 --- a/gtk/gtktooltipprivate.h +++ b/gtk/gtktooltipprivate.h @@ -37,7 +37,7 @@ void _gtk_tooltip_toggle_keyboard_mode (GtkWidget *widget); void _gtk_tooltip_handle_event (GdkEvent *event); void _gtk_tooltip_hide (GtkWidget *widget); -GtkWidget * _gtk_widget_find_at_coords (GdkWindow *window, +GtkWidget * _gtk_widget_find_at_coords (GdkSurface *window, gint window_x, gint window_y, gint *widget_x, diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index c8be4bba9b..1ee54e8f87 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -389,8 +389,8 @@ struct _GtkTreeViewPrivate guint scroll_timeout; /* Interactive Header reordering */ - GdkWindow *drag_window; - GdkWindow *drag_highlight_window; + GdkSurface *drag_window; + GdkSurface *drag_highlight_window; GtkTreeViewColumn *drag_column; gint drag_column_x; @@ -2271,14 +2271,14 @@ gtk_tree_view_unrealize (GtkWidget *widget) if (priv->drag_window) { gtk_widget_unregister_window (widget, priv->drag_window); - gdk_window_destroy (priv->drag_window); + gdk_surface_destroy (priv->drag_window); priv->drag_window = NULL; } if (priv->drag_highlight_window) { gtk_widget_unregister_window (widget, priv->drag_highlight_window); - gdk_window_destroy (priv->drag_highlight_window); + gdk_surface_destroy (priv->drag_highlight_window); priv->drag_highlight_window = NULL; } @@ -2539,8 +2539,8 @@ gtk_tree_view_size_allocate_drag_column (GtkWidget *widget) drag_allocation.x = 0; drag_allocation.y = 0; - drag_allocation.width = gdk_window_get_width (tree_view->priv->drag_window); - drag_allocation.height = gdk_window_get_height (tree_view->priv->drag_window); + drag_allocation.width = gdk_surface_get_width (tree_view->priv->drag_window); + drag_allocation.height = gdk_surface_get_height (tree_view->priv->drag_window); gtk_widget_size_allocate (button, &drag_allocation, -1, &clip); } @@ -3201,7 +3201,7 @@ gtk_tree_view_button_release_drag_column (GtkTreeView *tree_view) } tree_view->priv->drag_column = NULL; gtk_widget_unregister_window (widget, tree_view->priv->drag_window); - gdk_window_destroy (tree_view->priv->drag_window); + gdk_surface_destroy (tree_view->priv->drag_window); tree_view->priv->drag_window = NULL; for (l = tree_view->priv->column_drag_info; l != NULL; l = l->next) @@ -3211,7 +3211,7 @@ gtk_tree_view_button_release_drag_column (GtkTreeView *tree_view) tree_view->priv->cur_reorder = NULL; if (tree_view->priv->drag_highlight_window) - gdk_window_hide (tree_view->priv->drag_highlight_window); + gdk_surface_hide (tree_view->priv->drag_highlight_window); /* Reset our flags */ tree_view->priv->drag_column_window_state = DRAG_COLUMN_WINDOW_STATE_UNSET; @@ -3645,14 +3645,14 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) if (tree_view->priv->drag_highlight_window) { gtk_widget_unregister_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); - gdk_window_destroy (tree_view->priv->drag_highlight_window); + gdk_surface_destroy (tree_view->priv->drag_highlight_window); } button = gtk_tree_view_column_get_button (tree_view->priv->drag_column); gtk_widget_get_allocation (button, &drag_allocation); width = drag_allocation.width; height = drag_allocation.height; - tree_view->priv->drag_highlight_window = gdk_window_new_child (gtk_widget_get_window (widget), + tree_view->priv->drag_highlight_window = gdk_surface_new_child (gtk_widget_get_window (widget), &(GdkRectangle){ tree_view->priv->drag_column_x, 0, @@ -3698,10 +3698,10 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) if (tree_view->priv->drag_highlight_window) { gtk_widget_unregister_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); - gdk_window_destroy (tree_view->priv->drag_highlight_window); + gdk_surface_destroy (tree_view->priv->drag_highlight_window); } - tree_view->priv->drag_highlight_window = gdk_window_new_popup (gtk_widget_get_display (widget), + tree_view->priv->drag_highlight_window = gdk_surface_new_popup (gtk_widget_get_display (widget), &(GdkRectangle) { x, y, width, height }); gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); @@ -3718,7 +3718,7 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) cairo_destroy (cr); mask_region = gdk_cairo_region_create_from_surface (mask_image); - gdk_window_shape_combine_region (tree_view->priv->drag_highlight_window, + gdk_surface_shape_combine_region (tree_view->priv->drag_highlight_window, mask_region, 0, 0); cairo_region_destroy (mask_region); @@ -3726,7 +3726,7 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) } tree_view->priv->drag_column_window_state = DRAG_COLUMN_WINDOW_STATE_ARROW; - gdk_window_move (tree_view->priv->drag_highlight_window, x, y); + gdk_surface_move (tree_view->priv->drag_highlight_window, x, y); } else if (arrow_type == DRAG_COLUMN_WINDOW_STATE_ARROW_LEFT || arrow_type == DRAG_COLUMN_WINDOW_STATE_ARROW_RIGHT) @@ -3768,10 +3768,10 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) if (tree_view->priv->drag_highlight_window) { gtk_widget_unregister_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); - gdk_window_destroy (tree_view->priv->drag_highlight_window); + gdk_surface_destroy (tree_view->priv->drag_highlight_window); } - tree_view->priv->drag_highlight_window = gdk_window_new_popup (gtk_widget_get_display (widget), + tree_view->priv->drag_highlight_window = gdk_surface_new_popup (gtk_widget_get_display (widget), &(GdkRectangle) { x, y, width, height }); gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window); @@ -3794,7 +3794,7 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) cairo_destroy (cr); mask_region = gdk_cairo_region_create_from_surface (mask_image); - gdk_window_shape_combine_region (tree_view->priv->drag_highlight_window, + gdk_surface_shape_combine_region (tree_view->priv->drag_highlight_window, mask_region, 0, 0); cairo_region_destroy (mask_region); @@ -3802,17 +3802,17 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view) } tree_view->priv->drag_column_window_state = arrow_type; - gdk_window_move (tree_view->priv->drag_highlight_window, x, y); + gdk_surface_move (tree_view->priv->drag_highlight_window, x, y); } else { g_warning (G_STRLOC"Invalid GtkTreeViewColumnReorder struct"); - gdk_window_hide (tree_view->priv->drag_highlight_window); + gdk_surface_hide (tree_view->priv->drag_highlight_window); return; } - gdk_window_show (tree_view->priv->drag_highlight_window); - gdk_window_raise (tree_view->priv->drag_highlight_window); + gdk_surface_show (tree_view->priv->drag_highlight_window); + gdk_surface_raise (tree_view->priv->drag_highlight_window); } static gboolean @@ -3948,13 +3948,13 @@ gtk_tree_view_motion_drag_column (GtkTreeView *tree_view, x += gtk_adjustment_get_value (tree_view->priv->hadjustment); /* Handle moving the header */ - gdk_window_get_position (tree_view->priv->drag_window, &win_x, &win_y); + gdk_surface_get_position (tree_view->priv->drag_window, &win_x, &win_y); width = gtk_widget_get_allocated_width (GTK_WIDGET (tree_view)); button_width = gtk_widget_get_allocated_width (button); win_x = CLAMP (x - _gtk_tree_view_column_get_drag_x (column), 0, MAX (tree_view->priv->width, width) - button_width); - gdk_window_move (tree_view->priv->drag_window, win_x, win_y); - gdk_window_raise (tree_view->priv->drag_window); + gdk_surface_move (tree_view->priv->drag_window, win_x, win_y); + gdk_surface_raise (tree_view->priv->drag_window); /* autoscroll, if needed */ gtk_tree_view_horizontal_autoscroll (tree_view); @@ -5241,8 +5241,8 @@ gtk_tree_view_snapshot (GtkWidget *widget, gdk_cairo_set_source_rgba (cr, &color); cairo_rectangle (cr, 1, 1, - gdk_window_get_width (tree_view->priv->drag_highlight_window) - 2, - gdk_window_get_height (tree_view->priv->drag_highlight_window) - 2); + gdk_surface_get_width (tree_view->priv->drag_highlight_window) - 2, + gdk_surface_get_height (tree_view->priv->drag_highlight_window) - 2); cairo_stroke (cr); } else @@ -7069,7 +7069,7 @@ drag_scan_timeout (gpointer data) tree_view = GTK_TREE_VIEW (data); seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (tree_view))); - gdk_window_get_device_position (tree_view->priv->bin_window, + gdk_surface_get_device_position (tree_view->priv->bin_window, gdk_seat_get_pointer (seat), &x, &y, &state); @@ -9575,7 +9575,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, gtk_widget_get_allocation (button, &button_allocation); button_allocation.y = 0; - tree_view->priv->drag_window = gdk_window_new_child (gtk_widget_get_window (GTK_WIDGET (tree_view)), + tree_view->priv->drag_window = gdk_surface_new_child (gtk_widget_get_window (GTK_WIDGET (tree_view)), &button_allocation); gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_window); @@ -9593,7 +9593,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view, gtk_widget_size_allocate (button, &allocation, -1, &clip); tree_view->priv->drag_column = column; - gdk_window_show (tree_view->priv->drag_window); + gdk_surface_show (tree_view->priv->drag_window); gtk_widget_grab_focus (GTK_WIDGET (tree_view)); @@ -10605,14 +10605,14 @@ send_focus_change (GtkWidget *widget, { GdkDevice *dev = d->data; GdkEvent *fevent; - GdkWindow *window; + GdkSurface *window; /* Skip non-master keyboards that haven't * selected for events from this window */ window = gtk_widget_get_window (widget); if (gdk_device_get_device_type (dev) != GDK_DEVICE_TYPE_MASTER && - !gdk_window_get_device_events (window, dev)) + !gdk_surface_get_device_events (window, dev)) continue; fevent = gdk_event_new (GDK_FOCUS_CHANGE); @@ -10666,7 +10666,7 @@ gtk_tree_view_ensure_interactive_directory (GtkTreeView *tree_view) GTK_WINDOW (tree_view->priv->search_window)); gtk_window_set_type_hint (GTK_WINDOW (tree_view->priv->search_window), - GDK_WINDOW_TYPE_HINT_UTILITY); + GDK_SURFACE_TYPE_HINT_UTILITY); gtk_window_set_modal (GTK_WINDOW (tree_view->priv->search_window), TRUE); gtk_window_set_transient_for (GTK_WINDOW (tree_view->priv->search_window), GTK_WINDOW (toplevel)); @@ -13866,7 +13866,7 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view, bin_window_width = gtk_widget_get_width (GTK_WIDGET (tree_view)); - surface = gdk_window_create_similar_surface (gtk_widget_get_window (GTK_WIDGET (tree_view)), + surface = gdk_surface_create_similar_surface (gtk_widget_get_window (GTK_WIDGET (tree_view)), CAIRO_CONTENT_COLOR, bin_window_width + 2, background_area.height + 2); @@ -14280,7 +14280,7 @@ gtk_tree_view_search_position_func (GtkTreeView *tree_view, GdkDisplay *display; GdkMonitor *monitor; GdkRectangle workarea; - GdkWindow *tree_window = gtk_widget_get_window (GTK_WIDGET (tree_view)); + GdkSurface *tree_window = gtk_widget_get_window (GTK_WIDGET (tree_view)); GtkRequisition requisition; gtk_widget_realize (search_window); diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 902894bec8..62fd26e0af 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -1182,7 +1182,7 @@ gtk_widget_class_init (GtkWidgetClass *klass) g_param_spec_object ("window", P_("Window"), P_("The widget’s window if it is realized"), - GDK_TYPE_WINDOW, + GDK_TYPE_SURFACE, GTK_PARAM_READABLE); /** @@ -1497,7 +1497,7 @@ gtk_widget_class_init (GtkWidgetClass *klass) * @widget: the object which received the signal. * * The ::realize signal is emitted when @widget is associated with a - * #GdkWindow, which means that gtk_widget_realize() has been called or the + * #GdkSurface, which means that gtk_widget_realize() has been called or the * widget has been mapped (that is, it is going to be drawn). */ widget_signals[REALIZE] = @@ -1513,7 +1513,7 @@ gtk_widget_class_init (GtkWidgetClass *klass) * GtkWidget::unrealize: * @widget: the object which received the signal. * - * The ::unrealize signal is emitted when the #GdkWindow associated with + * The ::unrealize signal is emitted when the #GdkSurface associated with * @widget is destroyed, which means that gtk_widget_unrealize() has been * called or the widget has been unmapped (that is, it is going to be * hidden). @@ -1830,7 +1830,7 @@ gtk_widget_class_init (GtkWidgetClass *klass) * The ::key-press-event signal is emitted when a key is pressed. The signal * emission will reoccur at the key-repeat rate when the key is kept pressed. * - * To receive this signal, the #GdkWindow associated to the widget needs + * To receive this signal, the #GdkSurface associated to the widget needs * to enable the #GDK_KEY_PRESS_MASK mask. * * This signal will be sent to the grab widget if there is one. @@ -1857,7 +1857,7 @@ gtk_widget_class_init (GtkWidgetClass *klass) * * The ::key-release-event signal is emitted when a key is released. * - * To receive this signal, the #GdkWindow associated to the widget needs + * To receive this signal, the #GdkSurface associated to the widget needs * to enable the #GDK_KEY_RELEASE_MASK mask. * * This signal will be sent to the grab widget if there is one. @@ -3906,13 +3906,13 @@ gtk_widget_realize (GtkWidget *widget) if (priv->has_shape_mask) { region = g_object_get_qdata (G_OBJECT (widget), quark_shape_info); - gdk_window_shape_combine_region (priv->window, region, 0, 0); + gdk_surface_shape_combine_region (priv->window, region, 0, 0); } gtk_widget_update_input_shape (widget); if (priv->multidevice) - gdk_window_set_support_multidevice (priv->window, TRUE); + gdk_surface_set_support_multidevice (priv->window, TRUE); gtk_widget_update_alpha (widget); @@ -3965,7 +3965,7 @@ gtk_widget_unrealize (GtkWidget *widget) } /* - * Returns the values you're supposed to pass to gdk_window_move_resize + * Returns the values you're supposed to pass to gdk_surface_move_resize * for a windowed widget. */ void @@ -4210,15 +4210,15 @@ gtk_widget_get_frame_clock (GtkWidget *widget) { /* We use gtk_widget_get_toplevel() here to make it explicit that * the frame clock is a property of the toplevel that a widget - * is anchored to; gdk_window_get_toplevel() will go up the + * is anchored to; gdk_surface_get_toplevel() will go up the * hierarchy anyways, but should squash any funny business with * reparenting windows and widgets. */ GtkWidget *toplevel = _gtk_widget_get_toplevel (widget); - GdkWindow *window = _gtk_widget_get_window (toplevel); + GdkSurface *window = _gtk_widget_get_window (toplevel); g_assert (window != NULL); - return gdk_window_get_frame_clock (window); + return gdk_surface_get_frame_clock (window); } else { @@ -4352,7 +4352,7 @@ gtk_widget_queue_draw_region (GtkWidget *widget, invalidate: gtk_debug_updates_add (windowed_parent, region2); - gdk_window_invalidate_region (_gtk_widget_get_window (widget), region2, TRUE); + gdk_surface_invalidate_region (_gtk_widget_get_window (widget), region2, TRUE); cairo_region_destroy (region2); @@ -4575,7 +4575,7 @@ gtk_widget_size_allocate (GtkWidget *widget, GtkAllocation window_alloc; gtk_widget_get_window_allocation (widget, &window_alloc); - gdk_window_move_resize (priv->window, + gdk_surface_move_resize (priv->window, window_alloc.x, window_alloc.y, window_alloc.width, window_alloc.height); } @@ -4889,7 +4889,7 @@ gtk_widget_real_size_allocate (GtkWidget *widget, GtkAllocation window_alloc; gtk_widget_get_window_allocation (widget, &window_alloc); - gdk_window_move_resize (priv->window, + gdk_surface_move_resize (priv->window, window_alloc.x, window_alloc.y, window_alloc.width, window_alloc.height); } @@ -5008,7 +5008,7 @@ gtk_widget_real_can_activate_accel (GtkWidget *widget, /* widgets must be onscreen for accels to take effect */ return gtk_widget_is_sensitive (widget) && _gtk_widget_is_drawable (widget) && - gdk_window_is_viewable (priv->window); + gdk_surface_is_viewable (priv->window); } /** @@ -5441,7 +5441,7 @@ gtk_widget_draw_internal (GtkWidget *widget, if (gdk_cairo_get_clip_rectangle (cr, NULL)) { GtkWidgetClass *widget_class = GTK_WIDGET_GET_CLASS (widget); - GdkWindow *event_window = NULL; + GdkSurface *event_window = NULL; gboolean result; RenderMode mode; @@ -5640,8 +5640,8 @@ gtk_widget_event (GtkWidget *widget, if (event->any.type == GDK_EXPOSE) { g_warning ("Events of type GDK_EXPOSE cannot be synthesized. To get " - "the same effect, call gdk_window_invalidate_rect/region(), " - "followed by gdk_window_process_updates()."); + "the same effect, call gdk_surface_invalidate_rect/region(), " + "followed by gdk_surface_process_updates()."); return TRUE; } @@ -5740,8 +5740,8 @@ _gtk_widget_captured_event (GtkWidget *widget, if (event->any.type == GDK_EXPOSE) { g_warning ("Events of type GDK_EXPOSE cannot be synthesized. To get " - "the same effect, call gdk_window_invalidate_rect/region(), " - "followed by gdk_window_process_updates()."); + "the same effect, call gdk_surface_invalidate_rect/region(), " + "followed by gdk_surface_process_updates()."); return TRUE; } @@ -5787,7 +5787,7 @@ event_window_is_still_viewable (const GdkEvent *event) case GDK_ENTER_NOTIFY: case GDK_PROXIMITY_IN: case GDK_SCROLL: - return event->any.window && gdk_window_is_viewable (event->any.window); + return event->any.window && gdk_surface_is_viewable (event->any.window); #if 0 /* The following events are the second half of paired events; @@ -6993,10 +6993,10 @@ gtk_widget_is_visible (GtkWidget *widget) * @widget: a #GtkWidget * @has_window: whether or not @widget has a window. * - * Specifies whether @widget has a #GdkWindow of its own. Note that + * Specifies whether @widget has a #GdkSurface of its own. Note that * all realized widgets have a non-%NULL “window” pointer * (gtk_widget_get_window() never returns a %NULL window when a widget - * is realized), but for many of them it’s actually the #GdkWindow of + * is realized), but for many of them it’s actually the #GdkSurface of * one of its parent widgets. Widgets that do not create a %window for * themselves in #GtkWidget::realize must announce this by * calling this function with @has_window = %FALSE. @@ -7013,7 +7013,7 @@ gtk_widget_set_has_window (GtkWidget *widget, widget->priv->no_window = !has_window; widget->priv->no_window_set = TRUE; - /* GdkWindow has a min size of 1×1 */ + /* GdkSurface has a min size of 1×1 */ widget->priv->allocation.width = 1; widget->priv->allocation.height = 1; } @@ -7022,7 +7022,7 @@ gtk_widget_set_has_window (GtkWidget *widget, * gtk_widget_get_has_window: * @widget: a #GtkWidget * - * Determines whether @widget has a #GdkWindow of its own. See + * Determines whether @widget has a #GdkSurface of its own. See * gtk_widget_set_has_window(). * * Returns: %TRUE if @widget has a window, %FALSE otherwise @@ -7101,7 +7101,7 @@ gtk_widget_get_realized (GtkWidget *widget) * @realized: %TRUE to mark the widget as realized * * Marks the widget as being realized. This function must only be - * called after all #GdkWindows for the @widget have been created + * called after all #GdkSurfaces for the @widget have been created * and registered. * * This function should only ever be called in a derived widget's @@ -8073,9 +8073,9 @@ gtk_widget_create_pango_layout (GtkWidget *widget, */ void gtk_widget_set_parent_window (GtkWidget *widget, - GdkWindow *parent_window) + GdkSurface *parent_window) { - GdkWindow *old_parent_window; + GdkSurface *old_parent_window; g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (!GTK_IS_WINDOW (widget)); @@ -8103,11 +8103,11 @@ gtk_widget_set_parent_window (GtkWidget *widget, * Returns: (transfer none) (nullable): the parent window of @widget, or %NULL * if it does not have a parent window. **/ -GdkWindow * +GdkSurface * gtk_widget_get_parent_window (GtkWidget *widget) { GtkWidgetPrivate *priv; - GdkWindow *parent_window; + GdkSurface *parent_window; g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); @@ -8232,7 +8232,7 @@ _gtk_widget_scale_changed (GtkWidget *widget) * to the actual device pixels. On traditional systems this is 1, on * high density outputs, it can be a higher value (typically 2). * - * See gdk_window_get_scale_factor(). + * See gdk_surface_get_scale_factor(). * * Returns: the scale factor for @widget */ @@ -8246,7 +8246,7 @@ gtk_widget_get_scale_factor (GtkWidget *widget) g_return_val_if_fail (GTK_IS_WIDGET (widget), 1); if (_gtk_widget_get_realized (widget)) - return gdk_window_get_scale_factor (_gtk_widget_get_window (widget)); + return gdk_surface_get_scale_factor (_gtk_widget_get_window (widget)); toplevel = _gtk_widget_get_toplevel (widget); if (toplevel && toplevel != widget) @@ -8404,9 +8404,9 @@ gtk_widget_keynav_failed (GtkWidget *widget, * * Notifies the user about an input-related error on this widget. * If the #GtkSettings:gtk-error-bell setting is %TRUE, it calls - * gdk_window_beep(), otherwise it does nothing. + * gdk_surface_beep(), otherwise it does nothing. * - * Note that the effect of gdk_window_beep() can be configured in many + * Note that the effect of gdk_surface_beep() can be configured in many * ways, depending on the windowing backend and the desktop environment * or window manager that is used. **/ @@ -8430,7 +8430,7 @@ gtk_widget_error_bell (GtkWidget *widget) NULL); if (beep && priv->window) - gdk_window_beep (priv->window); + gdk_surface_beep (priv->window); } static void @@ -9149,7 +9149,7 @@ gtk_widget_real_map (GtkWidget *widget) priv->mapped = TRUE; if (_gtk_widget_get_has_window (widget)) - gdk_window_show (priv->window); + gdk_surface_show (priv->window); for (p = gtk_widget_get_first_child (widget); p != NULL; @@ -9182,7 +9182,7 @@ gtk_widget_real_unmap (GtkWidget *widget) priv->mapped = FALSE; if (_gtk_widget_get_has_window (widget)) - gdk_window_hide (priv->window); + gdk_surface_hide (priv->window); for (child = gtk_widget_get_first_child (widget); child != NULL; @@ -9236,7 +9236,7 @@ gtk_widget_real_unrealize (GtkWidget *widget) g_assert (!widget->priv->mapped); /* We must do unrealize child widget BEFORE container widget. - * gdk_window_destroy() destroys specified xwindow and its sub-xwindows. + * gdk_surface_destroy() destroys specified xwindow and its sub-xwindows. * So, unrealizing container widget before its children causes the problem * (for example, gdk_ic_destroy () with destroyed window causes crash.) */ @@ -9246,7 +9246,7 @@ gtk_widget_real_unrealize (GtkWidget *widget) if (_gtk_widget_get_has_window (widget)) { gtk_widget_unregister_window (widget, priv->window); - gdk_window_destroy (priv->window); + gdk_surface_destroy (priv->window); priv->window = NULL; } else @@ -9311,14 +9311,14 @@ gtk_widget_adjust_baseline_request (GtkWidget *widget, static gboolean is_my_window (GtkWidget *widget, - GdkWindow *window) + GdkSurface *window) { gpointer user_data; if (!window) return FALSE; - gdk_window_get_user_data (window, &user_data); + gdk_surface_get_user_data (window, &user_data); return (user_data == widget); } @@ -9329,11 +9329,11 @@ is_my_window (GtkWidget *widget, * * Returns: (nullable): the window of @widget that @device is in, or %NULL */ -GdkWindow * +GdkSurface * _gtk_widget_get_device_window (GtkWidget *widget, GdkDevice *device) { - GdkWindow *window; + GdkSurface *window; g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); g_return_val_if_fail (GDK_IS_DEVICE (device), NULL); @@ -9391,7 +9391,7 @@ _gtk_widget_list_devices (GtkWidget *widget) static void synth_crossing (GtkWidget *widget, GdkEventType type, - GdkWindow *window, + GdkSurface *window, GdkDevice *device, GdkCrossingMode mode, GdkNotifyType detail) @@ -9407,7 +9407,7 @@ synth_crossing (GtkWidget *widget, gdk_device_get_position_double (device, &event->crossing.x_root, &event->crossing.y_root); - gdk_window_get_device_position_double (window, + gdk_surface_get_device_position_double (window, device, &event->crossing.x, &event->crossing.y, @@ -9464,7 +9464,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, GdkDevice *device, GdkCrossingMode mode) { - GdkWindow *from_window = NULL, *to_window = NULL; + GdkSurface *from_window = NULL, *to_window = NULL; g_return_if_fail (from != NULL || to != NULL); @@ -9489,11 +9489,11 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, else if (from_window != NULL && to_window == NULL) { GList *from_ancestors = NULL, *list; - GdkWindow *from_ancestor = from_window; + GdkSurface *from_ancestor = from_window; while (from_ancestor != NULL) { - from_ancestor = gdk_window_get_parent (from_ancestor); + from_ancestor = gdk_surface_get_parent (from_ancestor); if (from_ancestor == NULL) break; from_ancestors = g_list_prepend (from_ancestors, from_ancestor); @@ -9503,7 +9503,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, device, mode, GDK_NOTIFY_ANCESTOR); for (list = g_list_last (from_ancestors); list; list = list->prev) { - synth_crossing (NULL, GDK_LEAVE_NOTIFY, (GdkWindow *) list->data, + synth_crossing (NULL, GDK_LEAVE_NOTIFY, (GdkSurface *) list->data, device, mode, GDK_NOTIFY_VIRTUAL); } @@ -9514,11 +9514,11 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, else if (from_window == NULL && to_window != NULL) { GList *to_ancestors = NULL, *list; - GdkWindow *to_ancestor = to_window; + GdkSurface *to_ancestor = to_window; while (to_ancestor != NULL) { - to_ancestor = gdk_window_get_parent (to_ancestor); + to_ancestor = gdk_surface_get_parent (to_ancestor); if (to_ancestor == NULL) break; to_ancestors = g_list_prepend (to_ancestors, to_ancestor); @@ -9528,7 +9528,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, for (list = to_ancestors; list; list = list->next) { - synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkWindow *) list->data, + synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkSurface *) list->data, device, mode, GDK_NOTIFY_VIRTUAL); } synth_crossing (to, GDK_ENTER_NOTIFY, to_window, @@ -9541,13 +9541,13 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, else { GList *from_ancestors = NULL, *to_ancestors = NULL, *list; - GdkWindow *from_ancestor = from_window, *to_ancestor = to_window; + GdkSurface *from_ancestor = from_window, *to_ancestor = to_window; while (from_ancestor != NULL || to_ancestor != NULL) { if (from_ancestor != NULL) { - from_ancestor = gdk_window_get_parent (from_ancestor); + from_ancestor = gdk_surface_get_parent (from_ancestor); if (from_ancestor == to_window) break; if (from_ancestor) @@ -9555,7 +9555,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, } if (to_ancestor != NULL) { - to_ancestor = gdk_window_get_parent (to_ancestor); + to_ancestor = gdk_surface_get_parent (to_ancestor); if (to_ancestor == from_window) break; if (to_ancestor) @@ -9568,7 +9568,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, synth_crossing (from, GDK_LEAVE_NOTIFY, from_window, device, mode, GDK_NOTIFY_INFERIOR); for (list = to_ancestors; list; list = list->next) - synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkWindow *) list->data, + synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkSurface *) list->data, device, mode, GDK_NOTIFY_VIRTUAL); synth_crossing (to, GDK_ENTER_NOTIFY, to_window, device, mode, GDK_NOTIFY_ANCESTOR); @@ -9579,7 +9579,7 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, device, mode, GDK_NOTIFY_ANCESTOR); for (list = g_list_last (from_ancestors); list; list = list->prev) { - synth_crossing (NULL, GDK_LEAVE_NOTIFY, (GdkWindow *) list->data, + synth_crossing (NULL, GDK_LEAVE_NOTIFY, (GdkSurface *) list->data, device, mode, GDK_NOTIFY_VIRTUAL); } if (mode != GDK_CROSSING_GTK_GRAB) @@ -9601,12 +9601,12 @@ _gtk_widget_synthesize_crossing (GtkWidget *from, for (list = g_list_last (from_ancestors); list; list = list->prev) { - synth_crossing (NULL, GDK_LEAVE_NOTIFY, (GdkWindow *) list->data, + synth_crossing (NULL, GDK_LEAVE_NOTIFY, (GdkSurface *) list->data, device, mode, GDK_NOTIFY_NONLINEAR_VIRTUAL); } for (list = to_ancestors; list; list = list->next) { - synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkWindow *) list->data, + synth_crossing (NULL, GDK_ENTER_NOTIFY, (GdkSurface *) list->data, device, mode, GDK_NOTIFY_NONLINEAR_VIRTUAL); } synth_crossing (to, GDK_ENTER_NOTIFY, to_window, @@ -9670,7 +9670,7 @@ gtk_widget_propagate_state (GtkWidget *widget, for (d = devices; d; d = d->next) { - GdkWindow *window; + GdkSurface *window; GdkDevice *device; device = d->data; @@ -9679,7 +9679,7 @@ gtk_widget_propagate_state (GtkWidget *widget, /* Do not propagate more than once to the * same window if non-multidevice aware. */ - if (!gdk_window_get_support_multidevice (window) && + if (!gdk_surface_get_support_multidevice (window) && g_list_find (event_windows, window)) continue; @@ -9727,7 +9727,7 @@ gtk_widget_propagate_state (GtkWidget *widget, * @region: (allow-none): shape to be added, or %NULL to remove an existing shape * * Sets a shape for this widget’s GDK window. This allows for - * transparent windows etc., see gdk_window_shape_combine_region() + * transparent windows etc., see gdk_surface_shape_combine_region() * for more information. **/ void @@ -9747,7 +9747,7 @@ gtk_widget_shape_combine_region (GtkWidget *widget, priv->has_shape_mask = FALSE; if (priv->window) - gdk_window_shape_combine_region (priv->window, NULL, 0, 0); + gdk_surface_shape_combine_region (priv->window, NULL, 0, 0); g_object_set_qdata (G_OBJECT (widget), quark_shape_info, NULL); } @@ -9763,7 +9763,7 @@ gtk_widget_shape_combine_region (GtkWidget *widget, * otherwise the shape is scheduled to be set by gtk_widget_realize(). */ if (priv->window) - gdk_window_shape_combine_region (priv->window, region, 0, 0); + gdk_surface_shape_combine_region (priv->window, region, 0, 0); } } @@ -9800,7 +9800,7 @@ gtk_widget_update_input_shape (GtkWidget *widget) else region = NULL; - gdk_window_input_shape_combine_region (priv->window, region, 0, 0); + gdk_surface_input_shape_combine_region (priv->window, region, 0, 0); if (free_region) cairo_region_destroy (region); @@ -9827,7 +9827,7 @@ gtk_widget_set_csd_input_shape (GtkWidget *widget, * * Sets an input shape for this widget’s GDK window. This allows for * windows which react to mouse click in a nonrectangular region, see - * gdk_window_input_shape_combine_region() for more information. + * gdk_surface_input_shape_combine_region() for more information. **/ void gtk_widget_input_shape_combine_region (GtkWidget *widget, @@ -12098,15 +12098,15 @@ gtk_widget_get_allocated_baseline (GtkWidget *widget) /** * gtk_widget_set_window: * @widget: a #GtkWidget - * @window: (transfer full): a #GdkWindow + * @window: (transfer full): a #GdkSurface * * Sets a widget’s window. This function should only be used in a * widget’s #GtkWidget::realize implementation. The %window passed is - * usually either new window created with gdk_window_new(), or the + * usually either new window created with gdk_surface_new(), or the * window of its parent widget as returned by * gtk_widget_get_parent_window(). * - * Widgets must indicate whether they will create their own #GdkWindow + * Widgets must indicate whether they will create their own #GdkSurface * by calling gtk_widget_set_has_window(). This is usually done in the * widget’s init() function. * @@ -12114,12 +12114,12 @@ gtk_widget_get_allocated_baseline (GtkWidget *widget) */ void gtk_widget_set_window (GtkWidget *widget, - GdkWindow *window) + GdkSurface *window) { GtkWidgetPrivate *priv; g_return_if_fail (GTK_IS_WIDGET (widget)); - g_return_if_fail (window == NULL || GDK_IS_WINDOW (window)); + g_return_if_fail (window == NULL || GDK_IS_SURFACE (window)); priv = widget->priv; @@ -12134,60 +12134,60 @@ gtk_widget_set_window (GtkWidget *widget, /** * gtk_widget_register_window: * @widget: a #GtkWidget - * @window: a #GdkWindow + * @window: a #GdkSurface * - * Registers a #GdkWindow with the widget and sets it up so that + * Registers a #GdkSurface with the widget and sets it up so that * the widget receives events for it. Call gtk_widget_unregister_window() * when destroying the window. * - * Before 3.8 you needed to call gdk_window_set_user_data() directly to set + * Before 3.8 you needed to call gdk_surface_set_user_data() directly to set * this up. This is now deprecated and you should use gtk_widget_register_window() * instead. Old code will keep working as is, although some new features like * transparency might not work perfectly. */ void gtk_widget_register_window (GtkWidget *widget, - GdkWindow *window) + GdkSurface *window) { GtkWidgetPrivate *priv; gpointer user_data; g_return_if_fail (GTK_IS_WIDGET (widget)); - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); - gdk_window_get_user_data (window, &user_data); + gdk_surface_get_user_data (window, &user_data); g_assert (user_data == NULL); priv = widget->priv; - gdk_window_set_user_data (window, widget); + gdk_surface_set_user_data (window, widget); priv->registered_windows = g_list_prepend (priv->registered_windows, window); } /** * gtk_widget_unregister_window: * @widget: a #GtkWidget - * @window: a #GdkWindow + * @window: a #GdkSurface * - * Unregisters a #GdkWindow from the widget that was previously set up with + * Unregisters a #GdkSurface from the widget that was previously set up with * gtk_widget_register_window(). You need to call this when the window is * no longer used by the widget, such as when you destroy it. */ void gtk_widget_unregister_window (GtkWidget *widget, - GdkWindow *window) + GdkSurface *window) { GtkWidgetPrivate *priv; gpointer user_data; g_return_if_fail (GTK_IS_WIDGET (widget)); - g_return_if_fail (GDK_IS_WINDOW (window)); + g_return_if_fail (GDK_IS_SURFACE (window)); priv = widget->priv; - gdk_window_get_user_data (window, &user_data); + gdk_surface_get_user_data (window, &user_data); g_assert (user_data == widget); - gdk_window_set_user_data (window, NULL); + gdk_surface_set_user_data (window, NULL); priv->registered_windows = g_list_remove (priv->registered_windows, window); } @@ -12199,7 +12199,7 @@ gtk_widget_unregister_window (GtkWidget *widget, * * Returns: (transfer none) (nullable): @widget’s window. */ -GdkWindow* +GdkSurface* gtk_widget_get_window (GtkWidget *widget) { g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); @@ -12231,8 +12231,8 @@ gtk_widget_get_support_multidevice (GtkWidget *widget) * * Enables or disables multiple pointer awareness. If this setting is %TRUE, * @widget will start receiving multiple, per device enter/leave events. Note - * that if custom #GdkWindows are created in #GtkWidget::realize, - * gdk_window_set_support_multidevice() will have to be called manually on them. + * that if custom #GdkSurfaces are created in #GtkWidget::realize, + * gdk_surface_set_support_multidevice() will have to be called manually on them. **/ void gtk_widget_set_support_multidevice (GtkWidget *widget, @@ -12246,7 +12246,7 @@ gtk_widget_set_support_multidevice (GtkWidget *widget, priv->multidevice = (support_multidevice == TRUE); if (_gtk_widget_get_realized (widget)) - gdk_window_set_support_multidevice (priv->window, support_multidevice); + gdk_surface_set_support_multidevice (priv->window, support_multidevice); } /* There are multiple alpha related sources. First of all the user can specify alpha @@ -12281,7 +12281,7 @@ gtk_widget_update_alpha (GtkWidget *widget) if (_gtk_widget_get_realized (widget)) { if (_gtk_widget_is_toplevel (widget)) - gdk_window_set_opacity (priv->window, priv->alpha / 255.0); + gdk_surface_set_opacity (priv->window, priv->alpha / 255.0); gtk_widget_queue_draw (widget); } @@ -13976,7 +13976,7 @@ should_record_names (GtkWidget *widget, void gtk_widget_render (GtkWidget *widget, - GdkWindow *window, + GdkSurface *window, const cairo_region_t *region) { GdkDrawingContext *context; @@ -13986,7 +13986,7 @@ gtk_widget_render (GtkWidget *widget, cairo_region_t *clip; /* We only render double buffered on native windows */ - if (!gdk_window_has_native (window)) + if (!gdk_surface_has_native (window)) return; renderer = gtk_widget_get_renderer (widget); diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h index 58b7f3df90..ea0549072f 100644 --- a/gtk/gtkwidget.h +++ b/gtk/gtkwidget.h @@ -146,9 +146,9 @@ struct _GtkWidget * means that either it or any of its parents up to the toplevel * widget have been set as hidden. * @realize: Signal emitted when widget is associated with a - * #GdkWindow, which means that gtk_widget_realize() has been called or + * #GdkSurface, which means that gtk_widget_realize() has been called or * the widget has been mapped (that is, it is going to be drawn). - * @unrealize: Signal emitted when the GdkWindow associated with + * @unrealize: Signal emitted when the GdkSurface associated with * widget is destroyed, which means that gtk_widget_unrealize() has * been called or the widget has been unmapped (that is, it is going * to be hidden). @@ -603,9 +603,9 @@ GtkWidget * gtk_widget_get_parent (GtkWidget *widget); GDK_AVAILABLE_IN_ALL void gtk_widget_set_parent_window (GtkWidget *widget, - GdkWindow *parent_window); + GdkSurface *parent_window); GDK_AVAILABLE_IN_ALL -GdkWindow * gtk_widget_get_parent_window (GtkWidget *widget); +GdkSurface * gtk_widget_get_parent_window (GtkWidget *widget); GDK_AVAILABLE_IN_ALL void gtk_widget_set_child_visible (GtkWidget *widget, @@ -615,15 +615,15 @@ gboolean gtk_widget_get_child_visible (GtkWidget *widget); GDK_AVAILABLE_IN_ALL void gtk_widget_set_window (GtkWidget *widget, - GdkWindow *window); + GdkSurface *window); GDK_AVAILABLE_IN_ALL -GdkWindow * gtk_widget_get_window (GtkWidget *widget); +GdkSurface * gtk_widget_get_window (GtkWidget *widget); GDK_AVAILABLE_IN_ALL void gtk_widget_register_window (GtkWidget *widget, - GdkWindow *window); + GdkSurface *window); GDK_AVAILABLE_IN_ALL void gtk_widget_unregister_window (GtkWidget *widget, - GdkWindow *window); + GdkSurface *window); GDK_AVAILABLE_IN_ALL int gtk_widget_get_allocated_width (GtkWidget *widget); @@ -817,7 +817,7 @@ void gtk_widget_set_default_direction (GtkTextDirection dir); GDK_AVAILABLE_IN_ALL GtkTextDirection gtk_widget_get_default_direction (void); -/* Counterpart to gdk_window_shape_combine_region. +/* Counterpart to gdk_surface_shape_combine_region. */ GDK_AVAILABLE_IN_ALL void gtk_widget_shape_combine_region (GtkWidget *widget, diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h index 5edcbd1e5c..d774599d89 100644 --- a/gtk/gtkwidgetprivate.h +++ b/gtk/gtkwidgetprivate.h @@ -147,7 +147,7 @@ struct _GtkWidgetPrivate * not have a window. (Which will be indicated by the * no_window field being set). */ - GdkWindow *window; + GdkSurface *window; GList *registered_windows; GList *event_controllers; @@ -220,8 +220,8 @@ void _gtk_widget_propagate_display_changed (GtkWidget *widget, void _gtk_widget_set_device_window (GtkWidget *widget, GdkDevice *device, - GdkWindow *pointer_window); -GdkWindow * _gtk_widget_get_device_window (GtkWidget *widget, + GdkSurface *pointer_window); +GdkSurface * _gtk_widget_get_device_window (GtkWidget *widget, GdkDevice *device); GList * _gtk_widget_list_devices (GtkWidget *widget); @@ -278,7 +278,7 @@ gboolean gtk_widget_query_tooltip (GtkWidget *widget, GtkTooltip *tooltip); void gtk_widget_render (GtkWidget *widget, - GdkWindow *window, + GdkSurface *window, const cairo_region_t *region); @@ -429,7 +429,7 @@ _gtk_widget_peek_request_cache (GtkWidget *widget) return &widget->priv->requests; } -static inline GdkWindow * +static inline GdkSurface * _gtk_widget_get_window (GtkWidget *widget) { return widget->priv->window; diff --git a/gtk/gtkwin32theme.c b/gtk/gtkwin32theme.c index 5b5014ada5..9a86e1fc76 100644 --- a/gtk/gtkwin32theme.c +++ b/gtk/gtkwin32theme.c @@ -157,7 +157,7 @@ invalidate_win32_themes (GdkXEvent *xevent, gpointer theme; MSG *msg; - if (!GDK_IS_WIN32_WINDOW (event->any.window)) + if (!GDK_IS_WIN32_SURFACE (event->any.window)) return GDK_FILTER_CONTINUE; msg = (MSG *) xevent; @@ -170,7 +170,7 @@ invalidate_win32_themes (GdkXEvent *xevent, theme_was_open |= gtk_win32_theme_close (theme); } if (theme_was_open) - gtk_style_context_reset_widgets (gdk_window_get_display (event->any.window)); + gtk_style_context_reset_widgets (gdk_surface_get_display (event->any.window)); return GDK_FILTER_CONTINUE; } @@ -233,7 +233,7 @@ gtk_win32_theme_init (void) use_xp_theme = FALSE; } - gdk_window_add_filter (NULL, invalidate_win32_themes, NULL); + gdk_surface_add_filter (NULL, invalidate_win32_themes, NULL); } static HTHEME diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index be5e903233..2331030054 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -226,7 +226,7 @@ struct _GtkWindowPrivate GdkMonitor *initial_fullscreen_monitor; guint edge_constraints; - GdkWindowState state; + GdkSurfaceState state; /* The following flags are initially TRUE (before a window is mapped). * They cause us to compute a configure request that involves @@ -275,12 +275,12 @@ struct _GtkWindowPrivate guint hide_on_close : 1; guint in_emit_close_request : 1; - GdkWindowTypeHint type_hint; + GdkSurfaceTypeHint type_hint; GtkGesture *multipress_gesture; GtkGesture *drag_gesture; - GdkWindow *hardcoded_window; + GdkSurface *hardcoded_window; GtkCssNode *decoration_node; @@ -352,7 +352,7 @@ enum { static GParamSpec *window_props[LAST_ARG] = { NULL, }; -/* Must be kept in sync with GdkWindowEdge ! */ +/* Must be kept in sync with GdkSurfaceEdge ! */ typedef enum { GTK_WINDOW_REGION_EDGE_NW, @@ -379,7 +379,7 @@ typedef struct typedef struct { GdkGeometry geometry; /* Last set of geometry hints we set */ - GdkWindowHints flags; + GdkSurfaceHints flags; GdkRectangle configure_request; } GtkWindowLastGeometryInfo; @@ -988,8 +988,8 @@ gtk_window_class_init (GtkWindowClass *klass) g_param_spec_enum ("type-hint", P_("Type hint"), P_("Hint to help the desktop environment understand what kind of window this is and how to treat it."), - GDK_TYPE_WINDOW_TYPE_HINT, - GDK_WINDOW_TYPE_HINT_NORMAL, + GDK_TYPE_SURFACE_TYPE_HINT, + GDK_SURFACE_TYPE_HINT_NORMAL, GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY); window_props[PROP_SKIP_TASKBAR_HINT] = @@ -1403,13 +1403,13 @@ gtk_window_titlebar_action (GtkWindow *window, * consistency. */ if (gtk_window_get_resizable (window) && - gtk_window_get_type_hint (window) == GDK_WINDOW_TYPE_HINT_NORMAL) + gtk_window_get_type_hint (window) == GDK_SURFACE_TYPE_HINT_NORMAL) _gtk_window_toggle_maximized (window); } else if (g_str_equal (action, "lower")) - gdk_window_lower (_gtk_widget_get_window (GTK_WIDGET (window))); + gdk_surface_lower (_gtk_widget_get_window (GTK_WIDGET (window))); else if (g_str_equal (action, "minimize")) - gdk_window_iconify (_gtk_widget_get_window (GTK_WIDGET (window))); + gdk_surface_iconify (_gtk_widget_get_window (GTK_WIDGET (window))); else if (g_str_equal (action, "menu")) gtk_window_do_popup (window, (GdkEventButton*) event); else @@ -1482,7 +1482,7 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture, event_widget = gtk_get_event_widget ((GdkEvent *) event); if (region == GTK_WINDOW_REGION_TITLE) - gdk_window_raise (_gtk_widget_get_window (widget)); + gdk_surface_raise (_gtk_widget_get_window (widget)); switch (region) { @@ -1524,8 +1524,8 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture, gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED); gdk_event_get_root_coords (event, &x_root, &y_root); - gdk_window_begin_resize_drag_for_device (_gtk_widget_get_window (widget), - (GdkWindowEdge) region, + gdk_surface_begin_resize_drag_for_device (_gtk_widget_get_window (widget), + (GdkSurfaceEdge) region, gdk_event_get_device ((GdkEvent *) event), GDK_BUTTON_PRIMARY, x_root, y_root, @@ -1632,10 +1632,10 @@ drag_gesture_update_cb (GtkGestureDrag *gesture, gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED); gtk_gesture_drag_get_start_point (gesture, &start_x, &start_y); - gdk_window_get_root_coords (_gtk_widget_get_window (GTK_WIDGET (window)), + gdk_surface_get_root_coords (_gtk_widget_get_window (GTK_WIDGET (window)), start_x, start_y, &x_root, &y_root); - gdk_window_begin_move_drag_for_device (_gtk_widget_get_window (GTK_WIDGET (window)), + gdk_surface_begin_move_drag_for_device (_gtk_widget_get_window (GTK_WIDGET (window)), gtk_gesture_get_device (GTK_GESTURE (gesture)), gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture)), x_root, y_root, @@ -1683,26 +1683,26 @@ device_removed_cb (GdkSeat *seat, } static guint -constraints_for_edge (GdkWindowEdge edge) +constraints_for_edge (GdkSurfaceEdge edge) { switch (edge) { - case GDK_WINDOW_EDGE_NORTH_WEST: - return GDK_WINDOW_STATE_LEFT_RESIZABLE | GDK_WINDOW_STATE_TOP_RESIZABLE; - case GDK_WINDOW_EDGE_NORTH: - return GDK_WINDOW_STATE_TOP_RESIZABLE; - case GDK_WINDOW_EDGE_NORTH_EAST: - return GDK_WINDOW_STATE_RIGHT_RESIZABLE | GDK_WINDOW_STATE_TOP_RESIZABLE; - case GDK_WINDOW_EDGE_WEST: - return GDK_WINDOW_STATE_LEFT_RESIZABLE; - case GDK_WINDOW_EDGE_EAST: - return GDK_WINDOW_STATE_RIGHT_RESIZABLE; - case GDK_WINDOW_EDGE_SOUTH_WEST: - return GDK_WINDOW_STATE_LEFT_RESIZABLE | GDK_WINDOW_STATE_BOTTOM_RESIZABLE; - case GDK_WINDOW_EDGE_SOUTH: - return GDK_WINDOW_STATE_BOTTOM_RESIZABLE; - case GDK_WINDOW_EDGE_SOUTH_EAST: - return GDK_WINDOW_STATE_RIGHT_RESIZABLE | GDK_WINDOW_STATE_BOTTOM_RESIZABLE; + case GDK_SURFACE_EDGE_NORTH_WEST: + return GDK_SURFACE_STATE_LEFT_RESIZABLE | GDK_SURFACE_STATE_TOP_RESIZABLE; + case GDK_SURFACE_EDGE_NORTH: + return GDK_SURFACE_STATE_TOP_RESIZABLE; + case GDK_SURFACE_EDGE_NORTH_EAST: + return GDK_SURFACE_STATE_RIGHT_RESIZABLE | GDK_SURFACE_STATE_TOP_RESIZABLE; + case GDK_SURFACE_EDGE_WEST: + return GDK_SURFACE_STATE_LEFT_RESIZABLE; + case GDK_SURFACE_EDGE_EAST: + return GDK_SURFACE_STATE_RIGHT_RESIZABLE; + case GDK_SURFACE_EDGE_SOUTH_WEST: + return GDK_SURFACE_STATE_LEFT_RESIZABLE | GDK_SURFACE_STATE_BOTTOM_RESIZABLE; + case GDK_SURFACE_EDGE_SOUTH: + return GDK_SURFACE_STATE_BOTTOM_RESIZABLE; + case GDK_SURFACE_EDGE_SOUTH_EAST: + return GDK_SURFACE_STATE_RIGHT_RESIZABLE | GDK_SURFACE_STATE_BOTTOM_RESIZABLE; default: g_warn_if_reached (); return 0; @@ -1713,7 +1713,7 @@ static gboolean edge_under_coordinates (GtkWindow *window, gint x, gint y, - GdkWindowEdge edge) + GdkSurfaceEdge edge) { GtkWindowPrivate *priv = window->priv; GtkAllocation allocation; @@ -1730,7 +1730,7 @@ edge_under_coordinates (GtkWindow *window, priv->maximized) return FALSE; - supports_edge_constraints = gdk_window_supports_edge_constraints (_gtk_widget_get_window (GTK_WIDGET (window))); + supports_edge_constraints = gdk_surface_supports_edge_constraints (_gtk_widget_get_window (GTK_WIDGET (window))); constraints = constraints_for_edge (edge); if (!supports_edge_constraints && priv->tiled) @@ -1769,71 +1769,71 @@ edge_under_coordinates (GtkWindow *window, /* Check X axis */ if (x < allocation.x + border.left + handle_h) { - if (edge != GDK_WINDOW_EDGE_NORTH_WEST && - edge != GDK_WINDOW_EDGE_WEST && - edge != GDK_WINDOW_EDGE_SOUTH_WEST && - edge != GDK_WINDOW_EDGE_NORTH && - edge != GDK_WINDOW_EDGE_SOUTH) + if (edge != GDK_SURFACE_EDGE_NORTH_WEST && + edge != GDK_SURFACE_EDGE_WEST && + edge != GDK_SURFACE_EDGE_SOUTH_WEST && + edge != GDK_SURFACE_EDGE_NORTH && + edge != GDK_SURFACE_EDGE_SOUTH) return FALSE; if (supports_edge_constraints && - (edge == GDK_WINDOW_EDGE_NORTH || - edge == GDK_WINDOW_EDGE_SOUTH) && - (priv->edge_constraints & constraints_for_edge (GDK_WINDOW_EDGE_WEST))) + (edge == GDK_SURFACE_EDGE_NORTH || + edge == GDK_SURFACE_EDGE_SOUTH) && + (priv->edge_constraints & constraints_for_edge (GDK_SURFACE_EDGE_WEST))) return FALSE; } else if (x >= allocation.x + allocation.width - border.right - handle_h) { - if (edge != GDK_WINDOW_EDGE_NORTH_EAST && - edge != GDK_WINDOW_EDGE_EAST && - edge != GDK_WINDOW_EDGE_SOUTH_EAST && - edge != GDK_WINDOW_EDGE_NORTH && - edge != GDK_WINDOW_EDGE_SOUTH) + if (edge != GDK_SURFACE_EDGE_NORTH_EAST && + edge != GDK_SURFACE_EDGE_EAST && + edge != GDK_SURFACE_EDGE_SOUTH_EAST && + edge != GDK_SURFACE_EDGE_NORTH && + edge != GDK_SURFACE_EDGE_SOUTH) return FALSE; if (supports_edge_constraints && - (edge == GDK_WINDOW_EDGE_NORTH || - edge == GDK_WINDOW_EDGE_SOUTH) && - (priv->edge_constraints & constraints_for_edge (GDK_WINDOW_EDGE_EAST))) + (edge == GDK_SURFACE_EDGE_NORTH || + edge == GDK_SURFACE_EDGE_SOUTH) && + (priv->edge_constraints & constraints_for_edge (GDK_SURFACE_EDGE_EAST))) return FALSE; } - else if (edge != GDK_WINDOW_EDGE_NORTH && - edge != GDK_WINDOW_EDGE_SOUTH) + else if (edge != GDK_SURFACE_EDGE_NORTH && + edge != GDK_SURFACE_EDGE_SOUTH) return FALSE; /* Check Y axis */ if (y < allocation.y + border.top + handle_v) { - if (edge != GDK_WINDOW_EDGE_NORTH_WEST && - edge != GDK_WINDOW_EDGE_NORTH && - edge != GDK_WINDOW_EDGE_NORTH_EAST && - edge != GDK_WINDOW_EDGE_EAST && - edge != GDK_WINDOW_EDGE_WEST) + if (edge != GDK_SURFACE_EDGE_NORTH_WEST && + edge != GDK_SURFACE_EDGE_NORTH && + edge != GDK_SURFACE_EDGE_NORTH_EAST && + edge != GDK_SURFACE_EDGE_EAST && + edge != GDK_SURFACE_EDGE_WEST) return FALSE; if (supports_edge_constraints && - (edge == GDK_WINDOW_EDGE_EAST || - edge == GDK_WINDOW_EDGE_WEST) && - (priv->edge_constraints & constraints_for_edge (GDK_WINDOW_EDGE_NORTH))) + (edge == GDK_SURFACE_EDGE_EAST || + edge == GDK_SURFACE_EDGE_WEST) && + (priv->edge_constraints & constraints_for_edge (GDK_SURFACE_EDGE_NORTH))) return FALSE; } else if (y > allocation.y + allocation.height - border.bottom - handle_v) { - if (edge != GDK_WINDOW_EDGE_SOUTH_WEST && - edge != GDK_WINDOW_EDGE_SOUTH && - edge != GDK_WINDOW_EDGE_SOUTH_EAST && - edge != GDK_WINDOW_EDGE_EAST && - edge != GDK_WINDOW_EDGE_WEST) + if (edge != GDK_SURFACE_EDGE_SOUTH_WEST && + edge != GDK_SURFACE_EDGE_SOUTH && + edge != GDK_SURFACE_EDGE_SOUTH_EAST && + edge != GDK_SURFACE_EDGE_EAST && + edge != GDK_SURFACE_EDGE_WEST) return FALSE; if (supports_edge_constraints && - (edge == GDK_WINDOW_EDGE_EAST || - edge == GDK_WINDOW_EDGE_WEST) && - (priv->edge_constraints & constraints_for_edge (GDK_WINDOW_EDGE_SOUTH))) + (edge == GDK_SURFACE_EDGE_EAST || + edge == GDK_SURFACE_EDGE_WEST) && + (priv->edge_constraints & constraints_for_edge (GDK_SURFACE_EDGE_SOUTH))) return FALSE; } - else if (edge != GDK_WINDOW_EDGE_WEST && - edge != GDK_WINDOW_EDGE_EAST) + else if (edge != GDK_SURFACE_EDGE_WEST && + edge != GDK_SURFACE_EDGE_EAST) return FALSE; return TRUE; @@ -1910,12 +1910,12 @@ gtk_window_init (GtkWindow *window) priv->mnemonic_modifier = GDK_MOD1_MASK; priv->display = gdk_display_get_default (); - priv->state = GDK_WINDOW_STATE_WITHDRAWN; + priv->state = GDK_SURFACE_STATE_WITHDRAWN; priv->accept_focus = TRUE; priv->focus_on_map = TRUE; priv->deletable = TRUE; - priv->type_hint = GDK_WINDOW_TYPE_HINT_NORMAL; + priv->type_hint = GDK_SURFACE_TYPE_HINT_NORMAL; priv->startup_id = NULL; priv->initial_timestamp = GDK_CURRENT_TIME; priv->mnemonics_visible = TRUE; @@ -2559,7 +2559,7 @@ gtk_window_set_title_internal (GtkWindow *window, priv->title = new_title; if (_gtk_widget_get_realized (widget)) - gdk_window_set_title (_gtk_widget_get_window (widget), new_title != NULL ? new_title : ""); + gdk_surface_set_title (_gtk_widget_get_window (widget), new_title != NULL ? new_title : ""); if (update_titlebar && GTK_IS_HEADER_BAR (priv->title_box)) gtk_header_bar_set_title (GTK_HEADER_BAR (priv->title_box), new_title != NULL ? new_title : ""); @@ -2646,7 +2646,7 @@ gtk_window_set_role (GtkWindow *window, priv->wm_role = new_role; if (_gtk_widget_get_realized (widget)) - gdk_window_set_role (_gtk_widget_get_window (widget), priv->wm_role); + gdk_surface_set_role (_gtk_widget_get_window (widget), priv->wm_role); g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_ROLE]); } @@ -2659,7 +2659,7 @@ gtk_window_set_role (GtkWindow *window, * Startup notification identifiers are used by desktop environment to * track application startup, to provide user feedback and other * features. This function changes the corresponding property on the - * underlying GdkWindow. Normally, startup identifier is managed + * underlying GdkSurface. Normally, startup identifier is managed * automatically and you should only use this function in special cases * like transferring focus from other processes. You should use this * function before calling gtk_window_present() or any equivalent @@ -2684,14 +2684,14 @@ gtk_window_set_startup_id (GtkWindow *window, if (_gtk_widget_get_realized (widget)) { - GdkWindow *gdk_window; + GdkSurface *gdk_surface; guint32 timestamp = extract_time_from_startup_id (priv->startup_id); - gdk_window = _gtk_widget_get_window (widget); + gdk_surface = _gtk_widget_get_window (widget); #ifdef GDK_WINDOWING_X11 - if (timestamp != GDK_CURRENT_TIME && GDK_IS_X11_WINDOW(gdk_window)) - gdk_x11_window_set_user_time (gdk_window, timestamp); + if (timestamp != GDK_CURRENT_TIME && GDK_IS_X11_SURFACE(gdk_surface)) + gdk_x11_surface_set_user_time (gdk_surface, timestamp); #endif /* Here we differentiate real and "fake" startup notification IDs, @@ -2701,7 +2701,7 @@ gtk_window_set_startup_id (GtkWindow *window, gtk_window_present_with_time (window, timestamp); else { - gdk_window_set_startup_id (gdk_window, priv->startup_id); + gdk_surface_set_startup_id (gdk_surface, priv->startup_id); /* If window is mapped, terminate the startup-notification too */ if (_gtk_widget_get_mapped (widget) && !disable_startup_notification) @@ -3237,7 +3237,7 @@ gtk_window_set_modal (GtkWindow *window, /* adjust desired modality state */ if (_gtk_widget_get_realized (widget)) - gdk_window_set_modal_hint (_gtk_widget_get_window (widget), priv->modal); + gdk_surface_set_modal_hint (_gtk_widget_get_window (widget), priv->modal); if (gtk_widget_get_visible (widget)) { @@ -3367,7 +3367,7 @@ gtk_window_transient_parent_realized (GtkWidget *parent, GtkWidget *window) { if (_gtk_widget_get_realized (window)) - gdk_window_set_transient_for (_gtk_widget_get_window (window), + gdk_surface_set_transient_for (_gtk_widget_get_window (window), _gtk_widget_get_window (parent)); } @@ -3376,7 +3376,7 @@ gtk_window_transient_parent_unrealized (GtkWidget *parent, GtkWidget *window) { if (_gtk_widget_get_realized (window)) - gdk_window_set_transient_for (_gtk_widget_get_window (window), NULL); + gdk_surface_set_transient_for (_gtk_widget_get_window (window), NULL); } static void @@ -3439,7 +3439,7 @@ gtk_window_unset_transient_for (GtkWindow *window) * On Wayland, this function can also be used to attach a new * #GTK_WINDOW_POPUP to a #GTK_WINDOW_TOPLEVEL parent already mapped * on screen so that the #GTK_WINDOW_POPUP will be created as a - * subsurface-based window #GDK_WINDOW_SUBSURFACE which can be + * subsurface-based window #GDK_SURFACE_SUBSURFACE which can be * positioned at will relatively to the #GTK_WINDOW_TOPLEVEL surface. * * On Windows, this function puts the child window on top of the parent, @@ -3692,10 +3692,10 @@ gtk_window_set_application (GtkWindow *window, **/ void gtk_window_set_type_hint (GtkWindow *window, - GdkWindowTypeHint hint) + GdkSurfaceTypeHint hint) { GtkWindowPrivate *priv; - GdkWindow *gdk_window; + GdkSurface *gdk_surface; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -3706,9 +3706,9 @@ gtk_window_set_type_hint (GtkWindow *window, priv->type_hint = hint; - gdk_window = _gtk_widget_get_window (GTK_WIDGET (window)); - if (gdk_window) - gdk_window_set_type_hint (gdk_window, hint); + gdk_surface = _gtk_widget_get_window (GTK_WIDGET (window)); + if (gdk_surface) + gdk_surface_set_type_hint (gdk_surface, hint); g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_TYPE_HINT]); @@ -3723,10 +3723,10 @@ gtk_window_set_type_hint (GtkWindow *window, * * Returns: the type hint for @window. **/ -GdkWindowTypeHint +GdkSurfaceTypeHint gtk_window_get_type_hint (GtkWindow *window) { - g_return_val_if_fail (GTK_IS_WINDOW (window), GDK_WINDOW_TYPE_HINT_NORMAL); + g_return_val_if_fail (GTK_IS_WINDOW (window), GDK_SURFACE_TYPE_HINT_NORMAL); return window->priv->type_hint; } @@ -3755,7 +3755,7 @@ gtk_window_set_skip_taskbar_hint (GtkWindow *window, { priv->skips_taskbar = setting; if (_gtk_widget_get_realized (GTK_WIDGET (window))) - gdk_window_set_skip_taskbar_hint (_gtk_widget_get_window (GTK_WIDGET (window)), + gdk_surface_set_skip_taskbar_hint (_gtk_widget_get_window (GTK_WIDGET (window)), priv->skips_taskbar); g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_SKIP_TASKBAR_HINT]); } @@ -3804,7 +3804,7 @@ gtk_window_set_skip_pager_hint (GtkWindow *window, { priv->skips_pager = setting; if (_gtk_widget_get_realized (GTK_WIDGET (window))) - gdk_window_set_skip_pager_hint (_gtk_widget_get_window (GTK_WIDGET (window)), + gdk_surface_set_skip_pager_hint (_gtk_widget_get_window (GTK_WIDGET (window)), priv->skips_pager); g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_SKIP_PAGER_HINT]); } @@ -3850,7 +3850,7 @@ gtk_window_set_urgency_hint (GtkWindow *window, { priv->urgent = setting; if (_gtk_widget_get_realized (GTK_WIDGET (window))) - gdk_window_set_urgency_hint (_gtk_widget_get_window (GTK_WIDGET (window)), + gdk_surface_set_urgency_hint (_gtk_widget_get_window (GTK_WIDGET (window)), priv->urgent); g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_URGENCY_HINT]); } @@ -3896,7 +3896,7 @@ gtk_window_set_accept_focus (GtkWindow *window, { priv->accept_focus = setting; if (_gtk_widget_get_realized (GTK_WIDGET (window))) - gdk_window_set_accept_focus (_gtk_widget_get_window (GTK_WIDGET (window)), + gdk_surface_set_accept_focus (_gtk_widget_get_window (GTK_WIDGET (window)), priv->accept_focus); g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_ACCEPT_FOCUS]); } @@ -3943,7 +3943,7 @@ gtk_window_set_focus_on_map (GtkWindow *window, { priv->focus_on_map = setting; if (_gtk_widget_get_realized (GTK_WIDGET (window))) - gdk_window_set_focus_on_map (_gtk_widget_get_window (GTK_WIDGET (window)), + gdk_surface_set_focus_on_map (_gtk_widget_get_window (GTK_WIDGET (window)), priv->focus_on_map); g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_FOCUS_ON_MAP]); } @@ -4291,7 +4291,7 @@ gtk_window_set_decorated (GtkWindow *window, gboolean setting) { GtkWindowPrivate *priv; - GdkWindow *gdk_window; + GdkSurface *gdk_surface; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -4304,18 +4304,18 @@ gtk_window_set_decorated (GtkWindow *window, priv->decorated = setting; - gdk_window = _gtk_widget_get_window (GTK_WIDGET (window)); - if (gdk_window) + gdk_surface = _gtk_widget_get_window (GTK_WIDGET (window)); + if (gdk_surface) { if (priv->decorated) { if (priv->client_decorated) - gdk_window_set_decorations (gdk_window, 0); + gdk_surface_set_decorations (gdk_surface, 0); else - gdk_window_set_decorations (gdk_window, GDK_DECOR_ALL); + gdk_surface_set_decorations (gdk_surface, GDK_DECOR_ALL); } else - gdk_window_set_decorations (gdk_window, 0); + gdk_surface_set_decorations (gdk_surface, 0); } update_window_buttons (window); @@ -4362,7 +4362,7 @@ gtk_window_set_deletable (GtkWindow *window, gboolean setting) { GtkWindowPrivate *priv; - GdkWindow *gdk_window; + GdkSurface *gdk_surface; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -4375,14 +4375,14 @@ gtk_window_set_deletable (GtkWindow *window, priv->deletable = setting; - gdk_window = _gtk_widget_get_window (GTK_WIDGET (window)); - if (gdk_window) + gdk_surface = _gtk_widget_get_window (GTK_WIDGET (window)); + if (gdk_surface) { if (priv->deletable) - gdk_window_set_functions (gdk_window, + gdk_surface_set_functions (gdk_surface, GDK_FUNC_ALL); else - gdk_window_set_functions (gdk_window, + gdk_surface_set_functions (gdk_surface, GDK_FUNC_ALL | GDK_FUNC_CLOSE); } @@ -4494,13 +4494,13 @@ gtk_window_realize_icon (GtkWindow *window) GtkWindowPrivate *priv = window->priv; GtkWidget *widget; GtkWindowIconInfo *info; - GdkWindow *gdk_window; + GdkSurface *gdk_surface; GList *icon_list; widget = GTK_WIDGET (window); - gdk_window = _gtk_widget_get_window (widget); + gdk_surface = _gtk_widget_get_window (widget); - g_return_if_fail (gdk_window != NULL); + g_return_if_fail (gdk_surface != NULL); /* no point setting an icon on override-redirect */ if (priv->type == GTK_WINDOW_POPUP) @@ -4553,7 +4553,7 @@ gtk_window_realize_icon (GtkWindow *window) info->realized = TRUE; - gdk_window_set_icon_list (gdk_window, icon_list); + gdk_surface_set_icon_list (gdk_surface, icon_list); if (GTK_IS_HEADER_BAR (priv->title_box)) _gtk_header_bar_update_window_icon (GTK_HEADER_BAR (priv->title_box), window); @@ -5474,8 +5474,8 @@ gtk_window_get_size (GtkWindow *window, if (_gtk_widget_get_mapped (GTK_WIDGET (window))) { - w = gdk_window_get_width (_gtk_widget_get_window (GTK_WIDGET (window))); - h = gdk_window_get_height (_gtk_widget_get_window (GTK_WIDGET (window))); + w = gdk_surface_get_width (_gtk_widget_get_window (GTK_WIDGET (window))); + h = gdk_surface_get_height (_gtk_widget_get_window (GTK_WIDGET (window))); } else { @@ -5670,7 +5670,7 @@ gtk_window_move (GtkWindow *window, * the same as the position being changed by the window * manager. */ - gdk_window_move (_gtk_widget_get_window (GTK_WIDGET (window)), x, y); + gdk_surface_move (_gtk_widget_get_window (GTK_WIDGET (window)), x, y); } else { @@ -5734,13 +5734,13 @@ gtk_window_get_position (GtkWindow *window, { GtkWindowPrivate *priv; GtkWidget *widget; - GdkWindow *gdk_window; + GdkSurface *gdk_surface; g_return_if_fail (GTK_IS_WINDOW (window)); priv = window->priv; widget = GTK_WIDGET (window); - gdk_window = _gtk_widget_get_window (widget); + gdk_surface = _gtk_widget_get_window (widget); if (priv->gravity == GDK_GRAVITY_STATIC) { @@ -5748,12 +5748,12 @@ gtk_window_get_position (GtkWindow *window, { /* This does a server round-trip, which is sort of wrong; * but a server round-trip is inevitable for - * gdk_window_get_frame_extents() in the usual + * gdk_surface_get_frame_extents() in the usual * NorthWestGravity case below, so not sure what else to * do. We should likely be consistent about whether we get * the client-side info or the server-side info. */ - gdk_window_get_origin (gdk_window, root_x, root_y); + gdk_surface_get_origin (gdk_surface, root_x, root_y); } else { @@ -5777,7 +5777,7 @@ gtk_window_get_position (GtkWindow *window, if (_gtk_widget_get_mapped (widget)) { - gdk_window_get_frame_extents (gdk_window, &frame_extents); + gdk_surface_get_frame_extents (gdk_surface, &frame_extents); x = frame_extents.x; y = frame_extents.y; gtk_window_get_size (window, &w, &h); @@ -6175,7 +6175,7 @@ gtk_window_map (GtkWidget *widget) GtkWidget *child; GtkWindow *window = GTK_WINDOW (widget); GtkWindowPrivate *priv = window->priv; - GdkWindow *gdk_window; + GdkSurface *gdk_surface; if (!_gtk_widget_is_toplevel (widget)) { @@ -6194,36 +6194,36 @@ gtk_window_map (GtkWidget *widget) gtk_widget_get_child_visible (priv->title_box)) gtk_widget_map (priv->title_box); - gdk_window = _gtk_widget_get_window (widget); + gdk_surface = _gtk_widget_get_window (widget); if (priv->maximize_initially) - gdk_window_maximize (gdk_window); + gdk_surface_maximize (gdk_surface); else - gdk_window_unmaximize (gdk_window); + gdk_surface_unmaximize (gdk_surface); if (priv->stick_initially) - gdk_window_stick (gdk_window); + gdk_surface_stick (gdk_surface); else - gdk_window_unstick (gdk_window); + gdk_surface_unstick (gdk_surface); if (priv->iconify_initially) - gdk_window_iconify (gdk_window); + gdk_surface_iconify (gdk_surface); else - gdk_window_deiconify (gdk_window); + gdk_surface_deiconify (gdk_surface); if (priv->fullscreen_initially) { if (priv->initial_fullscreen_monitor) - gdk_window_fullscreen_on_monitor (gdk_window, priv->initial_fullscreen_monitor); + gdk_surface_fullscreen_on_monitor (gdk_surface, priv->initial_fullscreen_monitor); else - gdk_window_fullscreen (gdk_window); + gdk_surface_fullscreen (gdk_surface); } else - gdk_window_unfullscreen (gdk_window); + gdk_surface_unfullscreen (gdk_surface); - gdk_window_set_keep_above (gdk_window, priv->above_initially); + gdk_surface_set_keep_above (gdk_surface, priv->above_initially); - gdk_window_set_keep_below (gdk_window, priv->below_initially); + gdk_surface_set_keep_below (gdk_surface, priv->below_initially); if (priv->type == GTK_WINDOW_TOPLEVEL) gtk_window_set_theme_variant (window); @@ -6232,7 +6232,7 @@ gtk_window_map (GtkWidget *widget) priv->need_default_size = FALSE; priv->need_default_position = FALSE; - gdk_window_show (gdk_window); + gdk_surface_show (gdk_surface); if (!disable_startup_notification && priv->type != GTK_WINDOW_POPUP) @@ -6276,8 +6276,8 @@ gtk_window_unmap (GtkWidget *widget) GtkWindowPrivate *priv = window->priv; GtkWidget *child; GtkWindowGeometryInfo *info; - GdkWindow *gdk_window; - GdkWindowState state; + GdkSurface *gdk_surface; + GdkSurfaceState state; if (!_gtk_widget_is_toplevel (GTK_WIDGET (widget))) { @@ -6285,15 +6285,15 @@ gtk_window_unmap (GtkWidget *widget) return; } - gdk_window = _gtk_widget_get_window (widget); + gdk_surface = _gtk_widget_get_window (widget); GTK_WIDGET_CLASS (gtk_window_parent_class)->unmap (widget); - gdk_window_withdraw (gdk_window); + gdk_surface_withdraw (gdk_surface); while (priv->configure_request_count > 0) { priv->configure_request_count--; - gdk_window_thaw_toplevel_updates (_gtk_widget_get_window (widget)); + gdk_surface_thaw_toplevel_updates (_gtk_widget_get_window (widget)); } priv->configure_notify_received = FALSE; @@ -6310,12 +6310,12 @@ gtk_window_unmap (GtkWidget *widget) info->position_constraints_changed = FALSE; } - state = gdk_window_get_state (gdk_window); - priv->iconify_initially = (state & GDK_WINDOW_STATE_ICONIFIED) != 0; - priv->maximize_initially = (state & GDK_WINDOW_STATE_MAXIMIZED) != 0; - priv->stick_initially = (state & GDK_WINDOW_STATE_STICKY) != 0; - priv->above_initially = (state & GDK_WINDOW_STATE_ABOVE) != 0; - priv->below_initially = (state & GDK_WINDOW_STATE_BELOW) != 0; + state = gdk_surface_get_state (gdk_surface); + priv->iconify_initially = (state & GDK_SURFACE_STATE_ICONIFIED) != 0; + priv->maximize_initially = (state & GDK_SURFACE_STATE_MAXIMIZED) != 0; + priv->stick_initially = (state & GDK_SURFACE_STATE_STICKY) != 0; + priv->above_initially = (state & GDK_SURFACE_STATE_ABOVE) != 0; + priv->below_initially = (state & GDK_SURFACE_STATE_BELOW) != 0; if (priv->title_box != NULL) gtk_widget_unmap (priv->title_box); @@ -6347,7 +6347,7 @@ gtk_window_guess_default_size (GtkWindow *window, { GtkWidget *widget; GdkDisplay *display; - GdkWindow *gdkwindow; + GdkSurface *gdkwindow; GdkMonitor *monitor; GdkRectangle workarea; int minimum, natural; @@ -6400,16 +6400,16 @@ gtk_window_get_remembered_size (GtkWindow *window, int *height) { GtkWindowGeometryInfo *info; - GdkWindow *gdk_window; + GdkSurface *gdk_surface; *width = 0; *height = 0; - gdk_window = _gtk_widget_get_window (GTK_WIDGET (window)); - if (gdk_window) + gdk_surface = _gtk_widget_get_window (GTK_WIDGET (window)); + if (gdk_surface) { - *width = gdk_window_get_width (gdk_window); - *height = gdk_window_get_height (gdk_window); + *width = gdk_surface_get_width (gdk_surface); + *height = gdk_surface_get_height (gdk_surface); return; } @@ -6674,12 +6674,12 @@ static void update_shadow_width (GtkWindow *window, GtkBorder *border) { - GdkWindow *gdk_window; + GdkSurface *gdk_surface; - gdk_window = _gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = _gtk_widget_get_window (GTK_WIDGET (window)); - if (gdk_window) - gdk_window_set_shadow_width (gdk_window, + if (gdk_surface) + gdk_surface_set_shadow_width (gdk_surface, border->left, border->right, border->top, @@ -6765,7 +6765,7 @@ update_opaque_region (GtkWindow *window, opaque_region = NULL; } - gdk_window_set_opaque_region (_gtk_widget_get_window (widget), opaque_region); + gdk_surface_set_opaque_region (_gtk_widget_get_window (widget), opaque_region); cairo_region_destroy (opaque_region); } @@ -6793,7 +6793,7 @@ gtk_window_realize (GtkWidget *widget) GtkAllocation allocation; GtkAllocation child_allocation; GtkWindow *window; - GdkWindow *gdk_window; + GdkSurface *gdk_surface; GtkBorder window_border; GtkWindowPrivate *priv; @@ -6829,9 +6829,9 @@ gtk_window_realize (GtkWidget *widget) if (priv->hardcoded_window) { - gdk_window = priv->hardcoded_window; + gdk_surface = priv->hardcoded_window; _gtk_widget_get_allocation (widget, &allocation); - gdk_window_resize (gdk_window, allocation.width, allocation.height); + gdk_surface_resize (gdk_surface, allocation.width, allocation.height); } else { @@ -6840,7 +6840,7 @@ gtk_window_realize (GtkWidget *widget) switch (priv->type) { case GTK_WINDOW_TOPLEVEL: - gdk_window = gdk_window_new_toplevel (gtk_widget_get_display (widget), + gdk_surface = gdk_surface_new_toplevel (gtk_widget_get_display (widget), allocation.width, allocation.height); break; @@ -6849,13 +6849,13 @@ gtk_window_realize (GtkWidget *widget) if (priv->use_subsurface && GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (widget))) { - gdk_window = gdk_wayland_window_new_subsurface (gtk_widget_get_display (widget), + gdk_surface = gdk_wayland_surface_new_subsurface (gtk_widget_get_display (widget), &allocation); } else #endif { - gdk_window = gdk_window_new_popup (gtk_widget_get_display (widget), + gdk_surface = gdk_surface_new_popup (gtk_widget_get_display (widget), &allocation); } break; @@ -6865,78 +6865,78 @@ gtk_window_realize (GtkWidget *widget) } } - gtk_widget_set_window (widget, gdk_window); - g_signal_connect_swapped (gdk_window, "notify::state", G_CALLBACK (window_state_changed), widget); - gtk_widget_register_window (widget, gdk_window); + gtk_widget_set_window (widget, gdk_surface); + g_signal_connect_swapped (gdk_surface, "notify::state", G_CALLBACK (window_state_changed), widget); + gtk_widget_register_window (widget, gdk_surface); gtk_widget_set_realized (widget, TRUE); if (priv->renderer == NULL) - priv->renderer = gsk_renderer_new_for_window (gdk_window); + priv->renderer = gsk_renderer_new_for_window (gdk_surface); if (priv->transient_parent && _gtk_widget_get_realized (GTK_WIDGET (priv->transient_parent))) - gdk_window_set_transient_for (gdk_window, + gdk_surface_set_transient_for (gdk_surface, _gtk_widget_get_window (GTK_WIDGET (priv->transient_parent))); - gdk_window_set_type_hint (gdk_window, priv->type_hint); + gdk_surface_set_type_hint (gdk_surface, priv->type_hint); if (priv->title) - gdk_window_set_title (gdk_window, priv->title); + gdk_surface_set_title (gdk_surface, priv->title); if (priv->wm_role) - gdk_window_set_role (gdk_window, priv->wm_role); + gdk_surface_set_role (gdk_surface, priv->wm_role); if (!priv->decorated || priv->client_decorated) - gdk_window_set_decorations (gdk_window, 0); + gdk_surface_set_decorations (gdk_surface, 0); #ifdef GDK_WINDOWING_WAYLAND - if (priv->client_decorated && GDK_IS_WAYLAND_WINDOW (gdk_window)) - gdk_wayland_window_announce_csd (gdk_window); + if (priv->client_decorated && GDK_IS_WAYLAND_SURFACE (gdk_surface)) + gdk_wayland_surface_announce_csd (gdk_surface); #endif if (!priv->deletable) - gdk_window_set_functions (gdk_window, GDK_FUNC_ALL | GDK_FUNC_CLOSE); + gdk_surface_set_functions (gdk_surface, GDK_FUNC_ALL | GDK_FUNC_CLOSE); if (gtk_window_get_skip_pager_hint (window)) - gdk_window_set_skip_pager_hint (gdk_window, TRUE); + gdk_surface_set_skip_pager_hint (gdk_surface, TRUE); if (gtk_window_get_skip_taskbar_hint (window)) - gdk_window_set_skip_taskbar_hint (gdk_window, TRUE); + gdk_surface_set_skip_taskbar_hint (gdk_surface, TRUE); if (gtk_window_get_accept_focus (window)) - gdk_window_set_accept_focus (gdk_window, TRUE); + gdk_surface_set_accept_focus (gdk_surface, TRUE); else - gdk_window_set_accept_focus (gdk_window, FALSE); + gdk_surface_set_accept_focus (gdk_surface, FALSE); if (gtk_window_get_focus_on_map (window)) - gdk_window_set_focus_on_map (gdk_window, TRUE); + gdk_surface_set_focus_on_map (gdk_surface, TRUE); else - gdk_window_set_focus_on_map (gdk_window, FALSE); + gdk_surface_set_focus_on_map (gdk_surface, FALSE); if (priv->modal) - gdk_window_set_modal_hint (gdk_window, TRUE); + gdk_surface_set_modal_hint (gdk_surface, TRUE); else - gdk_window_set_modal_hint (gdk_window, FALSE); + gdk_surface_set_modal_hint (gdk_surface, FALSE); if (priv->startup_id) { #ifdef GDK_WINDOWING_X11 - if (GDK_IS_X11_WINDOW (gdk_window)) + if (GDK_IS_X11_SURFACE (gdk_surface)) { guint32 timestamp = extract_time_from_startup_id (priv->startup_id); if (timestamp != GDK_CURRENT_TIME) - gdk_x11_window_set_user_time (gdk_window, timestamp); + gdk_x11_surface_set_user_time (gdk_surface, timestamp); } #endif if (!startup_id_is_fake (priv->startup_id)) - gdk_window_set_startup_id (gdk_window, priv->startup_id); + gdk_surface_set_startup_id (gdk_surface, priv->startup_id); } #ifdef GDK_WINDOWING_X11 if (priv->initial_timestamp != GDK_CURRENT_TIME) { - if (GDK_IS_X11_WINDOW (gdk_window)) - gdk_x11_window_set_user_time (gdk_window, priv->initial_timestamp); + if (GDK_IS_X11_SURFACE (gdk_surface)) + gdk_x11_surface_set_user_time (gdk_surface, priv->initial_timestamp); } #endif @@ -7029,22 +7029,22 @@ update_window_style_classes (GtkWindow *window) } else { - if (edge_constraints & GDK_WINDOW_STATE_TOP_TILED) + if (edge_constraints & GDK_SURFACE_STATE_TOP_TILED) gtk_style_context_add_class (context, "tiled-top"); else gtk_style_context_remove_class (context, "tiled-top"); - if (edge_constraints & GDK_WINDOW_STATE_RIGHT_TILED) + if (edge_constraints & GDK_SURFACE_STATE_RIGHT_TILED) gtk_style_context_add_class (context, "tiled-right"); else gtk_style_context_remove_class (context, "tiled-right"); - if (edge_constraints & GDK_WINDOW_STATE_BOTTOM_TILED) + if (edge_constraints & GDK_SURFACE_STATE_BOTTOM_TILED) gtk_style_context_add_class (context, "tiled-bottom"); else gtk_style_context_remove_class (context, "tiled-bottom"); - if (edge_constraints & GDK_WINDOW_STATE_LEFT_TILED) + if (edge_constraints & GDK_SURFACE_STATE_LEFT_TILED) gtk_style_context_add_class (context, "tiled-left"); else gtk_style_context_remove_class (context, "tiled-left"); @@ -7162,7 +7162,7 @@ _gtk_window_set_allocation (GtkWindow *window, if (!_gtk_widget_is_toplevel (widget) && _gtk_widget_get_realized (widget)) { - gdk_window_move_resize (_gtk_widget_get_window (widget), + gdk_surface_move_resize (_gtk_widget_get_window (widget), allocation->x, allocation->y, allocation->width, allocation->height); } @@ -7242,7 +7242,7 @@ gtk_window_configure_event (GtkWidget *widget, { priv->configure_request_count -= 1; - gdk_window_thaw_toplevel_updates (_gtk_widget_get_window (widget)); + gdk_surface_thaw_toplevel_updates (_gtk_widget_get_window (widget)); } /* @@ -7264,20 +7264,20 @@ gtk_window_configure_event (GtkWidget *widget, static void update_edge_constraints (GtkWindow *window, - GdkWindowState state) + GdkSurfaceState state) { GtkWindowPrivate *priv = window->priv; - priv->edge_constraints = (state & GDK_WINDOW_STATE_TOP_TILED) | - (state & GDK_WINDOW_STATE_TOP_RESIZABLE) | - (state & GDK_WINDOW_STATE_RIGHT_TILED) | - (state & GDK_WINDOW_STATE_RIGHT_RESIZABLE) | - (state & GDK_WINDOW_STATE_BOTTOM_TILED) | - (state & GDK_WINDOW_STATE_BOTTOM_RESIZABLE) | - (state & GDK_WINDOW_STATE_LEFT_TILED) | - (state & GDK_WINDOW_STATE_LEFT_RESIZABLE); + priv->edge_constraints = (state & GDK_SURFACE_STATE_TOP_TILED) | + (state & GDK_SURFACE_STATE_TOP_RESIZABLE) | + (state & GDK_SURFACE_STATE_RIGHT_TILED) | + (state & GDK_SURFACE_STATE_RIGHT_RESIZABLE) | + (state & GDK_SURFACE_STATE_BOTTOM_TILED) | + (state & GDK_SURFACE_STATE_BOTTOM_RESIZABLE) | + (state & GDK_SURFACE_STATE_LEFT_TILED) | + (state & GDK_SURFACE_STATE_LEFT_RESIZABLE); - priv->tiled = (state & GDK_WINDOW_STATE_TILED) ? 1 : 0; + priv->tiled = (state & GDK_SURFACE_STATE_TILED) ? 1 : 0; } static void @@ -7285,38 +7285,38 @@ window_state_changed (GtkWidget *widget) { GtkWindow *window = GTK_WINDOW (widget); GtkWindowPrivate *priv = window->priv; - GdkWindowState new_window_state; - GdkWindowState changed_mask; + GdkSurfaceState new_window_state; + GdkSurfaceState changed_mask; - new_window_state = gdk_window_get_state (_gtk_widget_get_window (widget)); + new_window_state = gdk_surface_get_state (_gtk_widget_get_window (widget)); changed_mask = new_window_state ^ priv->state; priv->state = new_window_state; - if (changed_mask & GDK_WINDOW_STATE_FOCUSED) + if (changed_mask & GDK_SURFACE_STATE_FOCUSED) ensure_state_flag_backdrop (widget); - if (changed_mask & GDK_WINDOW_STATE_FULLSCREEN) + if (changed_mask & GDK_SURFACE_STATE_FULLSCREEN) { priv->fullscreen = - (new_window_state & GDK_WINDOW_STATE_FULLSCREEN) ? 1 : 0; + (new_window_state & GDK_SURFACE_STATE_FULLSCREEN) ? 1 : 0; } - if (changed_mask & GDK_WINDOW_STATE_MAXIMIZED) + if (changed_mask & GDK_SURFACE_STATE_MAXIMIZED) { priv->maximized = - (new_window_state & GDK_WINDOW_STATE_MAXIMIZED) ? 1 : 0; + (new_window_state & GDK_SURFACE_STATE_MAXIMIZED) ? 1 : 0; g_object_notify_by_pspec (G_OBJECT (widget), window_props[PROP_IS_MAXIMIZED]); } update_edge_constraints (window, new_window_state); - if (changed_mask & (GDK_WINDOW_STATE_FULLSCREEN | - GDK_WINDOW_STATE_MAXIMIZED | - GDK_WINDOW_STATE_TILED | - GDK_WINDOW_STATE_TOP_TILED | - GDK_WINDOW_STATE_RIGHT_TILED | - GDK_WINDOW_STATE_BOTTOM_TILED | - GDK_WINDOW_STATE_LEFT_TILED)) + if (changed_mask & (GDK_SURFACE_STATE_FULLSCREEN | + GDK_SURFACE_STATE_MAXIMIZED | + GDK_SURFACE_STATE_TILED | + GDK_SURFACE_STATE_TOP_TILED | + GDK_SURFACE_STATE_RIGHT_TILED | + GDK_SURFACE_STATE_BOTTOM_TILED | + GDK_SURFACE_STATE_LEFT_TILED)) { update_window_style_classes (window); update_window_buttons (window); @@ -7610,7 +7610,7 @@ gtk_window_event (GtkWidget *widget, * the window being unmapped. more details can be found in: * http://bugzilla.gnome.org/show_bug.cgi?id=316180 */ - gdk_window_hide (_gtk_widget_get_window (widget)); + gdk_surface_hide (_gtk_widget_get_window (widget)); } } else if (event_type == GDK_CONFIGURE) @@ -7652,14 +7652,14 @@ do_focus_change (GtkWidget *widget, { GdkDevice *dev = d->data; GdkEvent *fevent; - GdkWindow *window; + GdkSurface *window; /* Skip non-master keyboards that haven't * selected for events from this window */ window = _gtk_widget_get_window (widget); if (gdk_device_get_device_type (dev) != GDK_DEVICE_TYPE_MASTER && - window && !gdk_window_get_device_events (window, dev)) + window && !gdk_surface_get_device_events (window, dev)) continue; fevent = gdk_event_new (GDK_FOCUS_CHANGE); @@ -8066,18 +8066,18 @@ popup_menu_detach (GtkWidget *widget, GTK_WINDOW (widget)->priv->popup_menu = NULL; } -static GdkWindowState +static GdkSurfaceState gtk_window_get_state (GtkWindow *window) { - GdkWindowState state; - GdkWindow *gdk_window; + GdkSurfaceState state; + GdkSurface *gdk_surface; - gdk_window = gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = gtk_widget_get_window (GTK_WIDGET (window)); state = 0; - if (gdk_window) - state = gdk_window_get_state (gdk_window); + if (gdk_surface) + state = gdk_surface_get_state (gdk_surface); return state; } @@ -8088,7 +8088,7 @@ restore_window_clicked (GtkMenuItem *menuitem, { GtkWindow *window = GTK_WINDOW (user_data); GtkWindowPrivate *priv = window->priv; - GdkWindowState state; + GdkSurfaceState state; if (priv->maximized) { @@ -8099,7 +8099,7 @@ restore_window_clicked (GtkMenuItem *menuitem, state = gtk_window_get_state (window); - if (state & GDK_WINDOW_STATE_ICONIFIED) + if (state & GDK_SURFACE_STATE_ICONIFIED) gtk_window_deiconify (window); } @@ -8147,11 +8147,11 @@ maximize_window_clicked (GtkMenuItem *menuitem, gpointer user_data) { GtkWindow *window = GTK_WINDOW (user_data); - GdkWindowState state; + GdkSurfaceState state; state = gtk_window_get_state (window); - if (state & GDK_WINDOW_STATE_ICONIFIED) + if (state & GDK_SURFACE_STATE_ICONIFIED) gtk_window_deiconify (window); gtk_window_maximize (window); @@ -8181,7 +8181,7 @@ gtk_window_do_popup_fallback (GtkWindow *window, { GtkWindowPrivate *priv = window->priv; GtkWidget *menuitem; - GdkWindowState state; + GdkSurfaceState state; gboolean maximized, iconified; if (priv->popup_menu) @@ -8189,7 +8189,7 @@ gtk_window_do_popup_fallback (GtkWindow *window, state = gtk_window_get_state (window); - iconified = (state & GDK_WINDOW_STATE_ICONIFIED) == GDK_WINDOW_STATE_ICONIFIED; + iconified = (state & GDK_SURFACE_STATE_ICONIFIED) == GDK_SURFACE_STATE_ICONIFIED; maximized = priv->maximized && !iconified; priv->popup_menu = gtk_menu_new (); @@ -8212,7 +8212,7 @@ gtk_window_do_popup_fallback (GtkWindow *window, if ((gtk_widget_is_visible (GTK_WIDGET (window)) && !(maximized || iconified)) || (!iconified && !priv->resizable) || - priv->type_hint != GDK_WINDOW_TYPE_HINT_NORMAL) + priv->type_hint != GDK_SURFACE_TYPE_HINT_NORMAL) gtk_widget_set_sensitive (menuitem, FALSE); g_signal_connect (G_OBJECT (menuitem), "activate", G_CALLBACK (restore_window_clicked), window); @@ -8237,7 +8237,7 @@ gtk_window_do_popup_fallback (GtkWindow *window, menuitem = gtk_menu_item_new_with_label (_("Minimize")); gtk_widget_show (menuitem); if (iconified || - priv->type_hint != GDK_WINDOW_TYPE_HINT_NORMAL) + priv->type_hint != GDK_SURFACE_TYPE_HINT_NORMAL) gtk_widget_set_sensitive (menuitem, FALSE); g_signal_connect (G_OBJECT (menuitem), "activate", G_CALLBACK (minimize_window_clicked), window); @@ -8247,7 +8247,7 @@ gtk_window_do_popup_fallback (GtkWindow *window, gtk_widget_show (menuitem); if (maximized || !priv->resizable || - priv->type_hint != GDK_WINDOW_TYPE_HINT_NORMAL) + priv->type_hint != GDK_SURFACE_TYPE_HINT_NORMAL) gtk_widget_set_sensitive (menuitem, FALSE); g_signal_connect (G_OBJECT (menuitem), "activate", G_CALLBACK (maximize_window_clicked), window); @@ -8284,7 +8284,7 @@ static void gtk_window_do_popup (GtkWindow *window, GdkEventButton *event) { - if (!gdk_window_show_window_menu (_gtk_widget_get_window (GTK_WIDGET (window)), + if (!gdk_surface_show_window_menu (_gtk_widget_get_window (GTK_WIDGET (window)), (GdkEvent *) event)) gtk_window_do_popup_fallback (window, event); } @@ -8535,17 +8535,17 @@ gtk_window_compute_configure_request (GtkWindow *window, case GTK_WIN_POS_CENTER_ON_PARENT: { GtkAllocation allocation; - GdkWindow *gdk_window; + GdkSurface *gdk_surface; GdkMonitor *monitor; GdkRectangle area; gint ox, oy; g_assert (_gtk_widget_get_mapped (parent_widget)); /* established earlier */ - gdk_window = _gtk_widget_get_window (parent_widget); - monitor = gdk_display_get_monitor_at_window (priv->display, gdk_window); + gdk_surface = _gtk_widget_get_window (parent_widget); + monitor = gdk_display_get_monitor_at_window (priv->display, gdk_surface); - gdk_window_get_origin (gdk_window, &ox, &oy); + gdk_surface_get_origin (gdk_surface, &ox, &oy); _gtk_widget_get_allocation (parent_widget, &allocation); x = ox + (allocation.width - w) / 2; @@ -8672,7 +8672,7 @@ gtk_window_move_resize (GtkWindow *window) GtkWidget *widget; GtkWindowGeometryInfo *info; GdkGeometry new_geometry; - GdkWindow *gdk_window; + GdkSurface *gdk_surface; guint new_flags; GdkRectangle new_request; gboolean configure_request_size_changed; @@ -8683,7 +8683,7 @@ gtk_window_move_resize (GtkWindow *window) widget = GTK_WIDGET (window); - gdk_window = _gtk_widget_get_window (widget); + gdk_surface = _gtk_widget_get_window (widget); info = gtk_window_get_geometry_info (window, TRUE); configure_request_size_changed = FALSE; @@ -8851,12 +8851,12 @@ gtk_window_move_resize (GtkWindow *window) /* Set hints if necessary */ if (hints_changed) - gdk_window_set_geometry_hints (gdk_window, + gdk_surface_set_geometry_hints (gdk_surface, &new_geometry, new_flags); - current_width = gdk_window_get_width (gdk_window); - current_height = gdk_window_get_height (gdk_window); + current_width = gdk_surface_get_width (gdk_surface); + current_height = gdk_surface_get_height (gdk_surface); /* handle resizing/moving and widget tree allocation */ @@ -8952,13 +8952,13 @@ gtk_window_move_resize (GtkWindow *window) /* Now send the configure request */ if (configure_request_pos_changed) { - gdk_window_move_resize (gdk_window, + gdk_surface_move_resize (gdk_surface, new_request.x, new_request.y, new_request.width, new_request.height); } else /* only size changed */ { - gdk_window_resize (gdk_window, + gdk_surface_resize (gdk_surface, new_request.width, new_request.height); } @@ -8980,7 +8980,7 @@ gtk_window_move_resize (GtkWindow *window) /* Increment the number of have-not-yet-received-notify requests */ priv->configure_request_count += 1; - gdk_window_freeze_toplevel_updates (gdk_window); + gdk_surface_freeze_toplevel_updates (gdk_surface); /* for GTK_RESIZE_QUEUE toplevels, we are now awaiting a new * configure event in response to our resizing request. @@ -9008,7 +9008,7 @@ gtk_window_move_resize (GtkWindow *window) */ if (configure_request_pos_changed) { - gdk_window_move (gdk_window, + gdk_surface_move (gdk_surface, new_request.x, new_request.y); } @@ -9100,7 +9100,7 @@ gtk_window_constrain_size (GtkWindow *window, else geometry_flags = flags; - gdk_window_constrain_size (geometry, geometry_flags, width, height, + gdk_surface_constrain_size (geometry, geometry_flags, width, height, new_width, new_height); } @@ -9354,7 +9354,7 @@ gtk_window_present_with_time (GtkWindow *window, { GtkWindowPrivate *priv; GtkWidget *widget; - GdkWindow *gdk_window; + GdkSurface *gdk_surface; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -9363,17 +9363,17 @@ gtk_window_present_with_time (GtkWindow *window, if (gtk_widget_get_visible (widget)) { - gdk_window = _gtk_widget_get_window (widget); + gdk_surface = _gtk_widget_get_window (widget); - g_assert (gdk_window != NULL); + g_assert (gdk_surface != NULL); - gdk_window_show (gdk_window); + gdk_surface_show (gdk_surface); /* Translate a timestamp of GDK_CURRENT_TIME appropriately */ if (timestamp == GDK_CURRENT_TIME) { #ifdef GDK_WINDOWING_X11 - if (GDK_IS_X11_WINDOW(gdk_window)) + if (GDK_IS_X11_SURFACE(gdk_surface)) { GdkDisplay *display; @@ -9385,7 +9385,7 @@ gtk_window_present_with_time (GtkWindow *window, timestamp = gtk_get_current_event_time (); } - gdk_window_focus (gdk_window, timestamp); + gdk_surface_focus (gdk_surface, timestamp); } else { @@ -9410,12 +9410,12 @@ gtk_window_present_with_time (GtkWindow *window, * in which case the window will be iconified before it ever appears * onscreen. * - * You can track iconification via the #GdkWindow::state property. + * You can track iconification via the #GdkSurface::state property. */ void gtk_window_iconify (GtkWindow *window) { - GdkWindow *toplevel; + GdkSurface *toplevel; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -9424,7 +9424,7 @@ gtk_window_iconify (GtkWindow *window) toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); if (toplevel != NULL) - gdk_window_iconify (toplevel); + gdk_surface_iconify (toplevel); } /** @@ -9437,12 +9437,12 @@ gtk_window_iconify (GtkWindow *window) * [window manager][gtk-X11-arch])) could iconify it * again before your code which assumes deiconification gets to run. * - * You can track iconification via the #GdkWindow::state property. + * You can track iconification via the #GdkSurface::state property. **/ void gtk_window_deiconify (GtkWindow *window) { - GdkWindow *toplevel; + GdkSurface *toplevel; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -9451,7 +9451,7 @@ gtk_window_deiconify (GtkWindow *window) toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); if (toplevel != NULL) - gdk_window_deiconify (toplevel); + gdk_surface_deiconify (toplevel); } /** @@ -9468,12 +9468,12 @@ gtk_window_deiconify (GtkWindow *window) * * It’s permitted to call this function before showing a window. * - * You can track iconification via the #GdkWindow::state property. + * You can track iconification via the #GdkSurface::state property. **/ void gtk_window_stick (GtkWindow *window) { - GdkWindow *toplevel; + GdkSurface *toplevel; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -9482,7 +9482,7 @@ gtk_window_stick (GtkWindow *window) toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); if (toplevel != NULL) - gdk_window_stick (toplevel); + gdk_surface_stick (toplevel); } /** @@ -9496,12 +9496,12 @@ gtk_window_stick (GtkWindow *window) * stick it again. But normally the window will * end up stuck. Just don’t write code that crashes if not. * - * You can track iconification via the #GdkWindow::state property. + * You can track iconification via the #GdkSurface::state property. **/ void gtk_window_unstick (GtkWindow *window) { - GdkWindow *toplevel; + GdkSurface *toplevel; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -9510,7 +9510,7 @@ gtk_window_unstick (GtkWindow *window) toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); if (toplevel != NULL) - gdk_window_unstick (toplevel); + gdk_surface_unstick (toplevel); } /** @@ -9529,13 +9529,13 @@ gtk_window_unstick (GtkWindow *window) * in which case the window will be maximized when it appears onscreen * initially. * - * You can track iconification via the #GdkWindow::state property + * You can track iconification via the #GdkSurface::state property * or by listening to notifications on the #GtkWindow:is-maximized property. **/ void gtk_window_maximize (GtkWindow *window) { - GdkWindow *toplevel; + GdkSurface *toplevel; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -9544,7 +9544,7 @@ gtk_window_maximize (GtkWindow *window) toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); if (toplevel != NULL) - gdk_window_maximize (toplevel); + gdk_surface_maximize (toplevel); } /** @@ -9558,12 +9558,12 @@ gtk_window_maximize (GtkWindow *window) * managers honor requests to unmaximize. But normally the window will * end up unmaximized. Just don’t write code that crashes if not. * - * You can track iconification via the #GdkWindow::state property + * You can track iconification via the #GdkSurface::state property **/ void gtk_window_unmaximize (GtkWindow *window) { - GdkWindow *toplevel; + GdkSurface *toplevel; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -9572,7 +9572,7 @@ gtk_window_unmaximize (GtkWindow *window) toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); if (toplevel != NULL) - gdk_window_unmaximize (toplevel); + gdk_surface_unmaximize (toplevel); } /** @@ -9587,12 +9587,12 @@ gtk_window_unmaximize (GtkWindow *window) * windows. But normally the window will end up fullscreen. Just * don’t write code that crashes if not. * - * You can track iconification via the #GdkWindow::state property + * You can track iconification via the #GdkSurface::state property **/ void gtk_window_fullscreen (GtkWindow *window) { - GdkWindow *toplevel; + GdkSurface *toplevel; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -9601,7 +9601,7 @@ gtk_window_fullscreen (GtkWindow *window) toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); if (toplevel != NULL) - gdk_window_fullscreen (toplevel); + gdk_surface_fullscreen (toplevel); } static void @@ -9625,7 +9625,7 @@ unset_fullscreen_monitor (GtkWindow *window) * Asks to place @window in the fullscreen state. Note that you shouldn't assume * the window is definitely full screen afterward. * - * You can track iconification via the #GdkWindow::state property + * You can track iconification via the #GdkSurface::state property */ void gtk_window_fullscreen_on_monitor (GtkWindow *window, @@ -9633,7 +9633,7 @@ gtk_window_fullscreen_on_monitor (GtkWindow *window, { GtkWindowPrivate *priv; GtkWidget *widget; - GdkWindow *toplevel; + GdkSurface *toplevel; g_return_if_fail (GTK_IS_WINDOW (window)); g_return_if_fail (GDK_IS_MONITOR (monitor)); @@ -9655,7 +9655,7 @@ gtk_window_fullscreen_on_monitor (GtkWindow *window, toplevel = _gtk_widget_get_window (widget); if (toplevel != NULL) - gdk_window_fullscreen_on_monitor (toplevel, monitor); + gdk_surface_fullscreen_on_monitor (toplevel, monitor); } /** @@ -9670,12 +9670,12 @@ gtk_window_fullscreen_on_monitor (GtkWindow *window, * windows. But normally the window will end up restored to its normal * state. Just don’t write code that crashes if not. * - * You can track iconification via the #GdkWindow::state property + * You can track iconification via the #GdkSurface::state property **/ void gtk_window_unfullscreen (GtkWindow *window) { - GdkWindow *toplevel; + GdkSurface *toplevel; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -9685,7 +9685,7 @@ gtk_window_unfullscreen (GtkWindow *window) toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); if (toplevel != NULL) - gdk_window_unfullscreen (toplevel); + gdk_surface_unfullscreen (toplevel); } /** @@ -9705,7 +9705,7 @@ gtk_window_unfullscreen (GtkWindow *window) * in which case the window will be kept above when it appears onscreen * initially. * - * You can track iconification via the #GdkWindow::state property + * You can track iconification via the #GdkSurface::state property * * Note that, according to the * [Extended Window Manager Hints Specification](http://www.freedesktop.org/Standards/wm-spec), @@ -9717,7 +9717,7 @@ void gtk_window_set_keep_above (GtkWindow *window, gboolean setting) { - GdkWindow *toplevel; + GdkSurface *toplevel; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -9729,7 +9729,7 @@ gtk_window_set_keep_above (GtkWindow *window, toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); if (toplevel != NULL) - gdk_window_set_keep_above (toplevel, setting); + gdk_surface_set_keep_above (toplevel, setting); } /** @@ -9749,7 +9749,7 @@ gtk_window_set_keep_above (GtkWindow *window, * in which case the window will be kept below when it appears onscreen * initially. * - * You can track iconification via the #GdkWindow::state property + * You can track iconification via the #GdkSurface::state property * * Note that, according to the * [Extended Window Manager Hints Specification](http://www.freedesktop.org/Standards/wm-spec), @@ -9761,7 +9761,7 @@ void gtk_window_set_keep_below (GtkWindow *window, gboolean setting) { - GdkWindow *toplevel; + GdkSurface *toplevel; g_return_if_fail (GTK_IS_WINDOW (window)); @@ -9773,7 +9773,7 @@ gtk_window_set_keep_below (GtkWindow *window, toplevel = _gtk_widget_get_window (GTK_WIDGET (window)); if (toplevel != NULL) - gdk_window_set_keep_below (toplevel, setting); + gdk_surface_set_keep_below (toplevel, setting); } /** @@ -9893,14 +9893,14 @@ gtk_window_get_gravity (GtkWindow *window) */ void gtk_window_begin_resize_drag (GtkWindow *window, - GdkWindowEdge edge, + GdkSurfaceEdge edge, gint button, gint root_x, gint root_y, guint32 timestamp) { GtkWidget *widget; - GdkWindow *toplevel; + GdkSurface *toplevel; g_return_if_fail (GTK_IS_WINDOW (window)); widget = GTK_WIDGET (window); @@ -9908,7 +9908,7 @@ gtk_window_begin_resize_drag (GtkWindow *window, toplevel = _gtk_widget_get_window (widget); - gdk_window_begin_resize_drag (toplevel, + gdk_surface_begin_resize_drag (toplevel, edge, button, root_x, root_y, timestamp); @@ -9937,7 +9937,7 @@ gtk_window_begin_move_drag (GtkWindow *window, guint32 timestamp) { GtkWidget *widget; - GdkWindow *toplevel; + GdkSurface *toplevel; g_return_if_fail (GTK_IS_WINDOW (window)); widget = GTK_WIDGET (window); @@ -9945,7 +9945,7 @@ gtk_window_begin_move_drag (GtkWindow *window, toplevel = _gtk_widget_get_window (widget); - gdk_window_begin_move_drag (toplevel, + gdk_surface_begin_move_drag (toplevel, button, root_x, root_y, timestamp); @@ -10017,17 +10017,17 @@ static void gtk_window_set_theme_variant (GtkWindow *window) { #ifdef GDK_WINDOWING_X11 - GdkWindow *gdk_window; + GdkSurface *gdk_surface; gboolean dark_theme_requested; g_object_get (gtk_settings_get_for_display (window->priv->display), "gtk-application-prefer-dark-theme", &dark_theme_requested, NULL); - gdk_window = _gtk_widget_get_window (GTK_WIDGET (window)); + gdk_surface = _gtk_widget_get_window (GTK_WIDGET (window)); - if (GDK_IS_X11_WINDOW (gdk_window)) - gdk_x11_window_set_theme_variant (gdk_window, + if (GDK_IS_X11_SURFACE (gdk_surface)) + gdk_x11_surface_set_theme_variant (gdk_surface, dark_theme_requested ? "dark" : NULL); #endif } @@ -10655,12 +10655,12 @@ gtk_window_set_has_user_ref_count (GtkWindow *window, static void ensure_state_flag_backdrop (GtkWidget *widget) { - GdkWindow *window; + GdkSurface *window; gboolean window_focused = TRUE; window = _gtk_widget_get_window (widget); - window_focused = gdk_window_get_state (window) & GDK_WINDOW_STATE_FOCUSED; + window_focused = gdk_surface_get_state (window) & GDK_SURFACE_STATE_FOCUSED; if (!window_focused) gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_BACKDROP, FALSE); @@ -11074,14 +11074,14 @@ gtk_window_set_use_subsurface (GtkWindow *window, void gtk_window_set_hardcoded_window (GtkWindow *window, - GdkWindow *gdk_window) + GdkSurface *gdk_surface) { GtkWindowPrivate *priv = window->priv; g_return_if_fail (GTK_IS_WINDOW (window)); g_return_if_fail (!_gtk_widget_get_realized (GTK_WIDGET (window))); - g_set_object (&priv->hardcoded_window, gdk_window); + g_set_object (&priv->hardcoded_window, gdk_surface); } #ifdef GDK_WINDOWING_WAYLAND @@ -11089,14 +11089,14 @@ typedef struct { GtkWindow *window; GtkWindowHandleExported callback; gpointer user_data; -} WaylandWindowHandleExportedData; +} WaylandSurfaceHandleExportedData; static void -wayland_window_handle_exported (GdkWindow *window, +wayland_surface_handle_exported (GdkSurface *window, const char *wayland_handle_str, gpointer user_data) { - WaylandWindowHandleExportedData *data = user_data; + WaylandSurfaceHandleExportedData *data = user_data; char *handle_str; handle_str = g_strdup_printf ("wayland:%s", wayland_handle_str); @@ -11114,9 +11114,9 @@ gtk_window_export_handle (GtkWindow *window, #ifdef GDK_WINDOWING_X11 if (GDK_IS_X11_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window)))) { - GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (window)); + GdkSurface *gdk_surface = gtk_widget_get_window (GTK_WIDGET (window)); char *handle_str; - guint32 xid = (guint32) gdk_x11_window_get_xid (gdk_window); + guint32 xid = (guint32) gdk_x11_surface_get_xid (gdk_surface); handle_str = g_strdup_printf ("x11:%x", xid); callback (window, handle_str, user_data); @@ -11127,16 +11127,16 @@ gtk_window_export_handle (GtkWindow *window, #ifdef GDK_WINDOWING_WAYLAND if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window)))) { - GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (window)); - WaylandWindowHandleExportedData *data; + GdkSurface *gdk_surface = gtk_widget_get_window (GTK_WIDGET (window)); + WaylandSurfaceHandleExportedData *data; - data = g_new0 (WaylandWindowHandleExportedData, 1); + data = g_new0 (WaylandSurfaceHandleExportedData, 1); data->window = window; data->callback = callback; data->user_data = user_data; - if (!gdk_wayland_window_export_handle (gdk_window, - wayland_window_handle_exported, + if (!gdk_wayland_surface_export_handle (gdk_surface, + wayland_surface_handle_exported, data, g_free)) { @@ -11161,9 +11161,9 @@ gtk_window_unexport_handle (GtkWindow *window) #ifdef GDK_WINDOWING_WAYLAND if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window)))) { - GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (window)); + GdkSurface *gdk_surface = gtk_widget_get_window (GTK_WIDGET (window)); - gdk_wayland_window_unexport_handle (gdk_window); + gdk_wayland_surface_unexport_handle (gdk_surface); } #endif } @@ -11397,7 +11397,7 @@ update_cursor (GtkWindow *toplevel, break; } - gdk_window_set_device_cursor (gtk_widget_get_window (GTK_WIDGET (toplevel)), + gdk_surface_set_device_cursor (gtk_widget_get_window (GTK_WIDGET (toplevel)), device, cursor); g_list_free (widgets); } diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h index 89547fb0a4..7d8e589486 100644 --- a/gtk/gtkwindow.h +++ b/gtk/gtkwindow.h @@ -196,9 +196,9 @@ GDK_AVAILABLE_IN_ALL GtkWidget *gtk_window_get_attached_to (GtkWindow *window); GDK_AVAILABLE_IN_ALL void gtk_window_set_type_hint (GtkWindow *window, - GdkWindowTypeHint hint); + GdkSurfaceTypeHint hint); GDK_AVAILABLE_IN_ALL -GdkWindowTypeHint gtk_window_get_type_hint (GtkWindow *window); +GdkSurfaceTypeHint gtk_window_get_type_hint (GtkWindow *window); GDK_AVAILABLE_IN_ALL void gtk_window_set_skip_taskbar_hint (GtkWindow *window, gboolean setting); @@ -381,7 +381,7 @@ void gtk_window_set_keep_below (GtkWindow *window, gboolean setting); GDK_AVAILABLE_IN_ALL void gtk_window_begin_resize_drag (GtkWindow *window, - GdkWindowEdge edge, + GdkSurfaceEdge edge, gint button, gint root_x, gint root_y, diff --git a/gtk/gtkwindowprivate.h b/gtk/gtkwindowprivate.h index d82d876f91..95f80f1acd 100644 --- a/gtk/gtkwindowprivate.h +++ b/gtk/gtkwindowprivate.h @@ -116,7 +116,7 @@ GdkTexture * gtk_window_get_icon_for_size (GtkWindow *window, void gtk_window_set_use_subsurface (GtkWindow *window, gboolean use_subsurface); void gtk_window_set_hardcoded_window (GtkWindow *window, - GdkWindow *gdk_window); + GdkSurface *gdk_surface); GdkDisplay *gtk_window_get_display (GtkWindow *window); diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c index 6ccde9bc9a..619a651825 100644 --- a/gtk/inspector/general.c +++ b/gtk/inspector/general.c @@ -95,7 +95,7 @@ init_version (GtkInspectorGeneral *gen) { const char *backend; GdkDisplay *display; - GdkWindow *window; + GdkSurface *window; GskRenderer *gsk_renderer; const char *renderer; @@ -128,7 +128,7 @@ init_version (GtkInspectorGeneral *gen) #endif backend = "Unknown"; - window = gdk_window_new_toplevel (display, 10, 10); + window = gdk_surface_new_toplevel (display, 10, 10); gsk_renderer = gsk_renderer_new_for_window (window); if (strcmp (G_OBJECT_TYPE_NAME (gsk_renderer), "GskVulkanRenderer") == 0) renderer = "Vulkan"; @@ -141,7 +141,7 @@ init_version (GtkInspectorGeneral *gen) gsk_renderer_unrealize (gsk_renderer); g_object_unref (gsk_renderer); - gdk_window_destroy (window); + gdk_surface_destroy (window); gtk_label_set_text (GTK_LABEL (gen->priv->gtk_version), GTK_VERSION); gtk_label_set_text (GTK_LABEL (gen->priv->gdk_backend), backend); @@ -384,13 +384,13 @@ static void init_vulkan (GtkInspectorGeneral *gen) { #ifdef GDK_RENDERING_VULKAN - GdkWindow *window; + GdkSurface *window; GdkVulkanContext *context; GdkDisplay *display = gdk_display_get_default (); - window = gdk_window_new_toplevel (display, 10, 10); - context = gdk_window_create_vulkan_context (window, NULL); - gdk_window_destroy (window); + window = gdk_surface_new_toplevel (display, 10, 10); + context = gdk_surface_create_vulkan_context (window, NULL); + gdk_surface_destroy (window); if (context) { diff --git a/gtk/inspector/inspect-button.c b/gtk/inspector/inspect-button.c index 85a0c17e78..ae3178c644 100644 --- a/gtk/inspector/inspect-button.c +++ b/gtk/inspector/inspect-button.c @@ -80,7 +80,7 @@ static GtkWidget * find_widget_at_pointer (GdkDevice *device) { GtkWidget *widget = NULL; - GdkWindow *pointer_window; + GdkSurface *pointer_window; pointer_window = gdk_device_get_window_at_position (device, NULL, NULL); @@ -88,20 +88,20 @@ find_widget_at_pointer (GdkDevice *device) { gpointer widget_ptr; - gdk_window_get_user_data (pointer_window, &widget_ptr); + gdk_surface_get_user_data (pointer_window, &widget_ptr); widget = widget_ptr; if (!GTK_IS_WINDOW (widget)) { while (TRUE) { - GdkWindow *parent = gdk_window_get_parent (pointer_window); + GdkSurface *parent = gdk_surface_get_parent (pointer_window); if (!parent) break; pointer_window = parent; - gdk_window_get_user_data (pointer_window, &widget_ptr); + gdk_surface_get_user_data (pointer_window, &widget_ptr); widget = widget_ptr; if (GTK_IS_WINDOW (widget)) @@ -115,7 +115,7 @@ find_widget_at_pointer (GdkDevice *device) { double x, y; - gdk_window_get_device_position_double (gtk_widget_get_window (widget), + gdk_surface_get_device_position_double (gtk_widget_get_window (widget), device, &x, &y, NULL); widget = inspector_pick (widget, x, y); @@ -175,7 +175,7 @@ on_inspect_widget (GtkWidget *button, { GtkWidget *widget; - gdk_window_raise (gtk_widget_get_window (GTK_WIDGET (iw))); + gdk_surface_raise (gtk_widget_get_window (GTK_WIDGET (iw))); clear_flash (iw); @@ -234,7 +234,7 @@ deemphasize_window (GtkWidget *window) cairo_region_destroy (region); } else - gdk_window_lower (gtk_widget_get_window (window)); + gdk_surface_lower (gtk_widget_get_window (window)); } static void @@ -249,7 +249,7 @@ reemphasize_window (GtkWidget *window) gtk_widget_input_shape_combine_region (window, NULL); } else - gdk_window_raise (gtk_widget_get_window (window)); + gdk_surface_raise (gtk_widget_get_window (window)); } static gboolean @@ -295,10 +295,10 @@ property_query_event (GtkWidget *widget, static void prepare_inspect_func (GdkSeat *seat, - GdkWindow *window, + GdkSurface *window, gpointer user_data) { - gdk_window_show (window); + gdk_surface_show (window); } diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c index 9ea5ff93a2..470f47ff05 100644 --- a/gtk/inspector/recorder.c +++ b/gtk/inspector/recorder.c @@ -1066,7 +1066,7 @@ void gtk_inspector_recorder_record_render (GtkInspectorRecorder *recorder, GtkWidget *widget, GskRenderer *renderer, - GdkWindow *window, + GdkSurface *window, const cairo_region_t *region, GdkDrawingContext *context, GskRenderNode *node) @@ -1084,8 +1084,8 @@ gtk_inspector_recorder_record_render (GtkInspectorRecorder *recorder, recording = gtk_inspector_render_recording_new (gdk_frame_clock_get_frame_time (frame_clock), gsk_renderer_get_profiler (renderer), &(GdkRectangle) { 0, 0, - gdk_window_get_width (window), - gdk_window_get_height (window) }, + gdk_surface_get_width (window), + gdk_surface_get_height (window) }, region, clip, node); diff --git a/gtk/inspector/recorder.h b/gtk/inspector/recorder.h index 7515bdce46..585046aa68 100644 --- a/gtk/inspector/recorder.h +++ b/gtk/inspector/recorder.h @@ -54,7 +54,7 @@ void gtk_inspector_recorder_set_debug_nodes (GtkInspectorRec void gtk_inspector_recorder_record_render (GtkInspectorRecorder *recorder, GtkWidget *widget, GskRenderer *renderer, - GdkWindow *window, + GdkSurface *window, const cairo_region_t *region, GdkDrawingContext *context, GskRenderNode *node); diff --git a/gtk/inspector/window.c b/gtk/inspector/window.c index 15b38e91e5..fb4bdcb392 100644 --- a/gtk/inspector/window.c +++ b/gtk/inspector/window.c @@ -372,7 +372,7 @@ gtk_inspector_window_get_for_display (GdkDisplay *display) void gtk_inspector_record_render (GtkWidget *widget, GskRenderer *renderer, - GdkWindow *window, + GdkSurface *window, const cairo_region_t *region, GdkDrawingContext *context, GskRenderNode *node) diff --git a/gtk/inspector/window.h b/gtk/inspector/window.h index e0504a784c..3919114729 100644 --- a/gtk/inspector/window.h +++ b/gtk/inspector/window.h @@ -109,7 +109,7 @@ void gtk_inspector_window_rescan (GtkWidget *iw); gboolean gtk_inspector_is_recording (GtkWidget *widget); void gtk_inspector_record_render (GtkWidget *widget, GskRenderer *renderer, - GdkWindow *window, + GdkSurface *window, const cairo_region_t *region, GdkDrawingContext *context, GskRenderNode *node); diff --git a/tests/rendernode.c b/tests/rendernode.c index f56d0880d1..2abdc17249 100644 --- a/tests/rendernode.c +++ b/tests/rendernode.c @@ -114,10 +114,10 @@ main(int argc, char **argv) else { GskRenderer *renderer; - GdkWindow *window; + GdkSurface *window; GdkTexture *texture = NULL; - window = gdk_window_new_toplevel (gdk_display_get_default(), 10 , 10); + window = gdk_surface_new_toplevel (gdk_display_get_default(), 10 , 10); renderer = gsk_renderer_new_for_window (window); for (run = 0; run < runs; run++) diff --git a/tests/showrendernode.c b/tests/showrendernode.c index d4de840c50..d4b854c7bc 100644 --- a/tests/showrendernode.c +++ b/tests/showrendernode.c @@ -165,7 +165,7 @@ main (int argc, char **argv) if (write_to_filename != NULL) { - GdkWindow *window = gdk_window_new_toplevel (gdk_display_get_default(), 10 , 10); + GdkSurface *window = gdk_surface_new_toplevel (gdk_display_get_default(), 10 , 10); GskRenderer *renderer = gsk_renderer_new_for_window (window); GdkTexture *texture = gsk_renderer_render_texture (renderer, GTK_NODE_VIEW (nodeview)->node, NULL); cairo_surface_t *rendered_surface; @@ -194,8 +194,8 @@ main (int argc, char **argv) if (compare_node) { GtkWidget *box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); - GdkWindow *gdk_window = gdk_window_new_toplevel (gdk_display_get_default(), 10 , 10); - GskRenderer *renderer = gsk_renderer_new_for_window (gdk_window); + GdkSurface *gdk_surface = gdk_surface_new_toplevel (gdk_display_get_default(), 10 , 10); + GskRenderer *renderer = gsk_renderer_new_for_window (gdk_surface); GdkTexture *texture = gsk_renderer_render_texture (renderer, GTK_NODE_VIEW (nodeview)->node, NULL); GtkWidget *image = gtk_image_new_from_paintable (GDK_PAINTABLE (texture)); @@ -206,7 +206,7 @@ main (int argc, char **argv) gsk_renderer_unrealize (renderer); g_object_unref (texture); g_object_unref (renderer); - g_object_unref (gdk_window); + g_object_unref (gdk_surface); } else { diff --git a/tests/testfullscreen.c b/tests/testfullscreen.c index 7dbfbd4fba..54b18a6ef5 100644 --- a/tests/testfullscreen.c +++ b/tests/testfullscreen.c @@ -23,20 +23,20 @@ static void set_fullscreen_monitor_cb (GtkWidget *widget, gpointer user_data) { GdkFullscreenMode mode = (GdkFullscreenMode) GPOINTER_TO_INT (user_data); - GdkWindow *window; + GdkSurface *window; window = gtk_widget_get_parent_window (widget); - gdk_window_set_fullscreen_mode (window, mode); - gdk_window_fullscreen (window); + gdk_surface_set_fullscreen_mode (window, mode); + gdk_surface_fullscreen (window); } static void remove_fullscreen_cb (GtkWidget *widget, gpointer user_data) { - GdkWindow *window; + GdkSurface *window; window = gtk_widget_get_parent_window (widget); - gdk_window_unfullscreen (window); + gdk_surface_unfullscreen (window); } int diff --git a/tests/testgtk.c b/tests/testgtk.c index 2561a8b966..c509c0ab15 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -223,7 +223,7 @@ on_composited_changed (GdkDisplay *display, else gtk_label_set_text (label, "Not composited"); - /* We draw a different background on the GdkWindow */ + /* We draw a different background on the GdkSurface */ gtk_widget_queue_draw (gtk_widget_get_toplevel (GTK_WIDGET (label))); } @@ -760,7 +760,7 @@ create_button_box (GtkWidget *widget) static GtkWidget* new_pixbuf (char *filename, - GdkWindow *window) + GdkSurface *window) { GtkWidget *widget; GdkPixbuf *pixbuf; @@ -1381,7 +1381,7 @@ configure_event (GtkWidget *window) lx = g_object_get_data (G_OBJECT (window), "x"); ly = g_object_get_data (G_OBJECT (window), "y"); - gdk_window_get_root_origin (gtk_widget_get_window (window), + gdk_surface_get_root_origin (gtk_widget_get_window (window), &upositionx, &upositiony); sprintf (buffer, "%d", upositionx); gtk_label_set_text (lx, buffer); @@ -1512,7 +1512,7 @@ create_pixbuf (GtkWidget *widget) GtkWidget *label; GtkWidget *separator; GtkWidget *pixbufwid; - GdkWindow *gdk_window; + GdkSurface *gdk_surface; if (!window) { @@ -1537,9 +1537,9 @@ create_pixbuf (GtkWidget *widget) button = gtk_button_new (); gtk_box_pack_start (GTK_BOX (box2), button); - gdk_window = gtk_widget_get_window (window); + gdk_surface = gtk_widget_get_window (window); - pixbufwid = new_pixbuf ("test.xpm", gdk_window); + pixbufwid = new_pixbuf ("test.xpm", gdk_surface); label = gtk_label_new ("Pixbuf\ntest"); box3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); @@ -1550,7 +1550,7 @@ create_pixbuf (GtkWidget *widget) button = gtk_button_new (); gtk_box_pack_start (GTK_BOX (box2), button); - pixbufwid = new_pixbuf ("test.xpm", gdk_window); + pixbufwid = new_pixbuf ("test.xpm", gdk_surface); label = gtk_label_new ("Pixbuf\ntest"); box3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); @@ -5546,7 +5546,7 @@ create_wmhints (GtkWidget *widget) GtkWidget *button; GtkWidget *box1; GtkWidget *box2; - GdkWindow *gdk_window; + GdkSurface *gdk_surface; GdkPixbuf *pixbuf; cairo_surface_t *surface; GList *list; @@ -5566,7 +5566,7 @@ create_wmhints (GtkWidget *widget) gtk_widget_realize (window); - gdk_window = gtk_widget_get_window (window); + gdk_surface = gtk_widget_get_window (window); pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) openfile); surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, 1, NULL); @@ -5579,10 +5579,10 @@ create_wmhints (GtkWidget *widget) cairo_surface_destroy (surface); g_object_unref (pixbuf); - gdk_window_set_icon_name (gdk_window, "WMHints Test Icon"); + gdk_surface_set_icon_name (gdk_surface, "WMHints Test Icon"); - gdk_window_set_decorations (gdk_window, GDK_DECOR_ALL | GDK_DECOR_MENU); - gdk_window_set_functions (gdk_window, GDK_FUNC_ALL | GDK_FUNC_RESIZE); + gdk_surface_set_decorations (gdk_surface, GDK_DECOR_ALL | GDK_DECOR_MENU); + gdk_surface_set_functions (gdk_surface, GDK_FUNC_ALL | GDK_FUNC_RESIZE); box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window), box1); @@ -5627,28 +5627,28 @@ create_wmhints (GtkWidget *widget) */ static void -window_state_callback (GdkWindow *window, +window_state_callback (GdkSurface *window, GParamSpec *pspec, GtkWidget *label) { gchar *msg; - GdkWindowState new_state; + GdkSurfaceState new_state; - new_state = gdk_window_get_state (window); + new_state = gdk_surface_get_state (window); msg = g_strconcat ((const char *)g_object_get_data (G_OBJECT (label), "title"), ": ", - (new_state & GDK_WINDOW_STATE_WITHDRAWN) ? + (new_state & GDK_SURFACE_STATE_WITHDRAWN) ? "withdrawn" : "not withdrawn", ", ", - (new_state & GDK_WINDOW_STATE_ICONIFIED) ? + (new_state & GDK_SURFACE_STATE_ICONIFIED) ? "iconified" : "not iconified", ", ", - (new_state & GDK_WINDOW_STATE_STICKY) ? + (new_state & GDK_SURFACE_STATE_STICKY) ? "sticky" : "not sticky", ", ", - (new_state & GDK_WINDOW_STATE_MAXIMIZED) ? + (new_state & GDK_SURFACE_STATE_MAXIMIZED) ? "maximized" : "not maximized", ", ", - (new_state & GDK_WINDOW_STATE_FULLSCREEN) ? + (new_state & GDK_SURFACE_STATE_FULLSCREEN) ? "fullscreen" : "not fullscreen", ", ", - (new_state & GDK_WINDOW_STATE_ABOVE) ? + (new_state & GDK_SURFACE_STATE_ABOVE) ? "above" : "not above", ", ", - (new_state & GDK_WINDOW_STATE_BELOW) ? + (new_state & GDK_SURFACE_STATE_BELOW) ? "below" : "not below", ", ", NULL); @@ -6637,13 +6637,13 @@ find_widget (GtkWidget *widget, FindWidgetData *data) if (gtk_widget_get_parent (widget) && !data->first) { - GdkWindow *window = gtk_widget_get_window (widget); + GdkSurface *window = gtk_widget_get_window (widget); while (window != gtk_widget_get_window (gtk_widget_get_parent (widget))) { gint tx, ty, twidth, theight; - twidth = gdk_window_get_width (window); - theight = gdk_window_get_height (window); + twidth = gdk_surface_get_width (window); + theight = gdk_surface_get_height (window); if (new_allocation.x < 0) { @@ -6660,13 +6660,13 @@ find_widget (GtkWidget *widget, FindWidgetData *data) if (new_allocation.y + new_allocation.height > theight) new_allocation.height = theight - new_allocation.y; - gdk_window_get_position (window, &tx, &ty); + gdk_surface_get_position (window, &tx, &ty); new_allocation.x += tx; x_offset += tx; new_allocation.y += ty; y_offset += ty; - window = gdk_window_get_parent (window); + window = gdk_surface_get_parent (window); } } @@ -6711,7 +6711,7 @@ static GtkWidget * find_widget_at_pointer (GdkDevice *device) { GtkWidget *widget = NULL; - GdkWindow *pointer_window; + GdkSurface *pointer_window; gint x, y; FindWidgetData data; @@ -6721,13 +6721,13 @@ find_widget_at_pointer (GdkDevice *device) { gpointer widget_ptr; - gdk_window_get_user_data (pointer_window, &widget_ptr); + gdk_surface_get_user_data (pointer_window, &widget_ptr); widget = widget_ptr; } if (widget) { - gdk_window_get_device_position (gtk_widget_get_window (widget), + gdk_surface_get_device_position (gtk_widget_get_window (widget), device, &x, &y, NULL); @@ -6974,7 +6974,7 @@ scroll_test_configure (GtkWidget *widget, GdkEventConfigure *event, static void scroll_test_adjustment_changed (GtkAdjustment *adjustment, GtkWidget *widget) { - GdkWindow *window; + GdkSurface *window; gint dy; dy = scroll_test_pos - (int)gtk_adjustment_get_value (adjustment); @@ -6984,7 +6984,7 @@ scroll_test_adjustment_changed (GtkAdjustment *adjustment, GtkWidget *widget) return; window = gtk_widget_get_window (widget); - gdk_window_scroll (window, 0, dy); + gdk_surface_scroll (window, 0, dy); } diff --git a/tests/testinput.c b/tests/testinput.c index 69b1230159..083590ec8d 100644 --- a/tests/testinput.c +++ b/tests/testinput.c @@ -49,7 +49,7 @@ size_allocate (GtkWidget *widget, { cairo_t *cr; - 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, gtk_widget_get_width (widget), gtk_widget_get_height (widget)); diff --git a/tests/testtooltips.c b/tests/testtooltips.c index 6feda3f950..f464a3142b 100644 --- a/tests/testtooltips.c +++ b/tests/testtooltips.c @@ -363,7 +363,7 @@ main (int argc, char *argv[]) gtk_widget_set_tooltip_window (button, GTK_WINDOW (tooltip_window)); gtk_window_set_type_hint (GTK_WINDOW (tooltip_window), - GDK_WINDOW_TYPE_HINT_TOOLTIP); + GDK_SURFACE_TYPE_HINT_TOOLTIP); gtk_window_set_transient_for (GTK_WINDOW (tooltip_window), GTK_WINDOW (window)); diff --git a/testsuite/gsk/compare-render.c b/testsuite/gsk/compare-render.c index f83e4e0650..a39ad4a264 100644 --- a/testsuite/gsk/compare-render.c +++ b/testsuite/gsk/compare-render.c @@ -67,7 +67,7 @@ main (int argc, char **argv) cairo_surface_t *diff_surface = NULL; GdkTexture *texture; GskRenderer *renderer; - GdkWindow *window; + GdkSurface *window; GskRenderNode *node; const char *node_file; const char *png_file; @@ -79,7 +79,7 @@ main (int argc, char **argv) node_file = argv[1]; png_file = argv[2]; - window = gdk_window_new_toplevel (gdk_display_get_default(), 10 , 10); + window = gdk_surface_new_toplevel (gdk_display_get_default(), 10 , 10); renderer = gsk_renderer_new_for_window (window); g_test_message ("Node file: '%s'\n", node_file); diff --git a/testsuite/gsk/test-render-nodes.c b/testsuite/gsk/test-render-nodes.c index 2f89f2a6eb..9a25463f46 100644 --- a/testsuite/gsk/test-render-nodes.c +++ b/testsuite/gsk/test-render-nodes.c @@ -667,7 +667,7 @@ load_node_file (GFile *file, gboolean generate) GBytes *bytes; GskRenderNode *node; GskRenderer *renderer; - GdkWindow *window; + GdkSurface *window; GdkTexture *texture = NULL; cairo_surface_t *surface; char *png_file; @@ -696,7 +696,7 @@ load_node_file (GFile *file, gboolean generate) return; } - window = gdk_window_new_toplevel (gdk_display_get_default(), 10 , 10); + window = gdk_surface_new_toplevel (gdk_display_get_default(), 10 , 10); renderer = gsk_renderer_new_for_window (window); texture = gsk_renderer_render_texture (renderer, node, NULL); @@ -721,7 +721,7 @@ load_node_file (GFile *file, gboolean generate) g_object_unref (window); gsk_renderer_unrealize (renderer); g_object_unref (renderer); - gdk_window_destroy (window); + gdk_surface_destroy (window); gsk_render_node_unref (node); diff --git a/testsuite/gtk/defaultvalue.c b/testsuite/gtk/defaultvalue.c index f011682fc4..4b4c89f9d8 100644 --- a/testsuite/gtk/defaultvalue.c +++ b/testsuite/gtk/defaultvalue.c @@ -104,9 +104,9 @@ test_type (gconstpointer data) if (g_type_is_a (type, GTK_TYPE_SETTINGS)) instance = g_object_ref (gtk_settings_get_default ()); - else if (g_type_is_a (type, GDK_TYPE_WINDOW)) + else if (g_type_is_a (type, GDK_TYPE_SURFACE)) { - instance = g_object_ref (gdk_window_new_popup (gdk_display_get_default (), + instance = g_object_ref (gdk_surface_new_popup (gdk_display_get_default (), 0, &(GdkRectangle) { 0, 0, 100, 100 })); } @@ -354,8 +354,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS } g_free (pspecs); - if (g_type_is_a (type, GDK_TYPE_WINDOW)) - gdk_window_destroy (GDK_WINDOW (instance)); + if (g_type_is_a (type, GDK_TYPE_SURFACE)) + gdk_surface_destroy (GDK_SURFACE (instance)); else g_object_unref (instance); diff --git a/testsuite/gtk/notify.c b/testsuite/gtk/notify.c index 3f922a2cbe..846a0ed52a 100644 --- a/testsuite/gtk/notify.c +++ b/testsuite/gtk/notify.c @@ -402,9 +402,9 @@ test_type (gconstpointer data) if (g_type_is_a (type, GTK_TYPE_SETTINGS)) instance = G_OBJECT (g_object_ref (gtk_settings_get_default ())); - else if (g_type_is_a (type, GDK_TYPE_WINDOW)) + else if (g_type_is_a (type, GDK_TYPE_SURFACE)) { - instance = G_OBJECT (g_object_ref (gdk_window_new_popup (display, + instance = G_OBJECT (g_object_ref (gdk_surface_new_popup (display, &(GdkRectangle) { 0, 0, 100, 100 }))); } else if (g_str_equal (g_type_name (type), "GdkX11Cursor")) @@ -644,8 +644,8 @@ test_type (gconstpointer data) } g_free (pspecs); - if (g_type_is_a (type, GDK_TYPE_WINDOW)) - gdk_window_destroy (GDK_WINDOW (instance)); + if (g_type_is_a (type, GDK_TYPE_SURFACE)) + gdk_surface_destroy (GDK_SURFACE (instance)); else g_object_unref (instance); diff --git a/testsuite/gtk/object.c b/testsuite/gtk/object.c index afbe9fda98..7939b59e56 100644 --- a/testsuite/gtk/object.c +++ b/testsuite/gtk/object.c @@ -58,7 +58,7 @@ list_ignore_properties (gboolean buglist) { "GtkCList", "selection-mode", (void*) GTK_SELECTION_NONE, }, { "GtkWidget", "has-default", (void*) TRUE, }, /* conflicts with toplevel-less widgets */ { "GtkWidget", "display", (void*) MATCH_ANY_VALUE }, - { "GtkWindow", "type-hint", (void*) GDK_WINDOW_TYPE_HINT_DND, }, /* conflicts with ::visible=TRUE */ + { "GtkWindow", "type-hint", (void*) GDK_SURFACE_TYPE_HINT_DND, }, /* conflicts with ::visible=TRUE */ { "GtkCellView", "background", (void*) "", }, /* "" is not a valid background color */ { "GtkColorButton", "color", (void*) NULL, }, /* not a valid boxed color */ { "GtkInputDialog", "has-separator", (void*) MATCH_ANY_VALUE, }, /* property disabled */ diff --git a/testsuite/gtk/objects-finalize.c b/testsuite/gtk/objects-finalize.c index d08c42619c..077783c023 100644 --- a/testsuite/gtk/objects-finalize.c +++ b/testsuite/gtk/objects-finalize.c @@ -107,7 +107,7 @@ main (int argc, char **argv) G_TYPE_IS_INSTANTIATABLE (all_types[i]) && !G_TYPE_IS_ABSTRACT (all_types[i]) && #ifdef GDK_WINDOWING_X11 - all_types[i] != GDK_TYPE_X11_WINDOW && + all_types[i] != GDK_TYPE_X11_SURFACE && all_types[i] != GDK_TYPE_X11_SCREEN && all_types[i] != GDK_TYPE_X11_DISPLAY && all_types[i] != GDK_TYPE_X11_DEVICE_MANAGER_CORE && diff --git a/testsuite/gtk/templates.c b/testsuite/gtk/templates.c index 712bf3e6aa..4b73e94c12 100644 --- a/testsuite/gtk/templates.c +++ b/testsuite/gtk/templates.c @@ -48,10 +48,10 @@ test_dialog_override_property (void) GtkWidget *dialog; dialog = g_object_new (GTK_TYPE_DIALOG, - "type-hint", GDK_WINDOW_TYPE_HINT_UTILITY, + "type-hint", GDK_SURFACE_TYPE_HINT_UTILITY, NULL); g_assert (GTK_IS_DIALOG (dialog)); - g_assert (gtk_window_get_type_hint (GTK_WINDOW (dialog)) == GDK_WINDOW_TYPE_HINT_UTILITY); + g_assert (gtk_window_get_type_hint (GTK_WINDOW (dialog)) == GDK_SURFACE_TYPE_HINT_UTILITY); gtk_widget_destroy (dialog); } diff --git a/testsuite/reftests/reftest-snapshot.c b/testsuite/reftests/reftest-snapshot.c index ec7f90fcfe..a1071c5821 100644 --- a/testsuite/reftests/reftest-snapshot.c +++ b/testsuite/reftests/reftest-snapshot.c @@ -98,33 +98,33 @@ check_for_draw (GdkEvent *event, gpointer data) } static void -snapshot_window_native (GdkWindow *window, +snapshot_window_native (GdkSurface *window, cairo_t *cr) { #ifdef GDK_WINDOWING_X11 - if (GDK_IS_X11_WINDOW (window)) + if (GDK_IS_X11_SURFACE (window)) { cairo_surface_t *surface; XWindowAttributes attrs; - if (gdk_window_get_window_type (window) == GDK_WINDOW_TOPLEVEL || - gdk_window_get_window_type (window) == GDK_WINDOW_TEMP || - gdk_window_get_window_type (window) == GDK_WINDOW_FOREIGN) + if (gdk_surface_get_window_type (window) == GDK_SURFACE_TOPLEVEL || + gdk_surface_get_window_type (window) == GDK_SURFACE_TEMP || + gdk_surface_get_window_type (window) == GDK_SURFACE_FOREIGN) { /* give the WM/server some time to sync. They need it. * Also, do use popups instead of toplevels in your tests * whenever you can. */ - gdk_display_sync (gdk_window_get_display (window)); + gdk_display_sync (gdk_surface_get_display (window)); g_timeout_add (500, quit_when_idle, loop); g_main_loop_run (loop); } - XGetWindowAttributes (gdk_x11_display_get_xdisplay (gdk_window_get_display (window)), - gdk_x11_window_get_xid (window), + XGetWindowAttributes (gdk_x11_display_get_xdisplay (gdk_surface_get_display (window)), + gdk_x11_surface_get_xid (window), &attrs); - surface = cairo_xlib_surface_create (gdk_x11_display_get_xdisplay (gdk_window_get_display (window)), - gdk_x11_window_get_xid (window), + surface = cairo_xlib_surface_create (gdk_x11_display_get_xdisplay (gdk_surface_get_display (window)), + gdk_x11_surface_get_xid (window), attrs.visual, attrs.width, attrs.height); @@ -159,7 +159,7 @@ snapshot_widget (GtkWidget *widget, SnapshotMode mode) gdk_event_handler_set (check_for_draw, NULL, NULL); g_main_loop_run (loop); - 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, gtk_widget_get_allocated_width (widget), gtk_widget_get_allocated_height (widget)); |