diff options
author | Alexander Larsson <alexl@redhat.com> | 2018-03-20 16:16:57 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2018-03-20 16:16:57 +0000 |
commit | 695d141f32d8aed14b57cc065554974d541f8ba6 (patch) | |
tree | deb13486e9441d4be37b882b13013ac98d936d42 /tests | |
parent | b83ba41f2d129953572e3ad8d490b4d3e5a7ddf9 (diff) | |
parent | 4ac450b324bcae047d3fa53986133e18da0ec1bf (diff) | |
download | gtk+-695d141f32d8aed14b57cc065554974d541f8ba6.tar.gz |
Merge branch 'rename-window-to-surface' into 'master'
Rename window to surface
See merge request GNOME/gtk!72
Diffstat (limited to 'tests')
-rw-r--r-- | tests/motion-compression.c | 2 | ||||
-rw-r--r-- | tests/rendernode.c | 6 | ||||
-rw-r--r-- | tests/showrendernode.c | 12 | ||||
-rw-r--r-- | tests/testfullscreen.c | 14 | ||||
-rw-r--r-- | tests/testgtk.c | 82 | ||||
-rw-r--r-- | tests/testinput.c | 4 | ||||
-rw-r--r-- | tests/testtooltips.c | 2 | ||||
-rw-r--r-- | tests/testwidgetfocus.c | 2 | ||||
-rw-r--r-- | tests/testxinerama.c | 4 |
9 files changed, 64 insertions, 64 deletions
diff --git a/tests/motion-compression.c b/tests/motion-compression.c index 81ff7c27aa..f869bcfeb4 100644 --- a/tests/motion-compression.c +++ b/tests/motion-compression.c @@ -9,7 +9,7 @@ event_cb (GtkWidget *window, GdkEvent *event) { if (gdk_event_get_event_type (event) == GDK_MOTION_NOTIFY && - gdk_event_get_window (event) == gtk_widget_get_window (window)) + gdk_event_get_surface (event) == gtk_widget_get_surface (window)) { gdouble x, y; float processing_ms = gtk_adjustment_get_value (adjustment); diff --git a/tests/rendernode.c b/tests/rendernode.c index f56d0880d1..e0f5e1f9ec 100644 --- a/tests/rendernode.c +++ b/tests/rendernode.c @@ -114,11 +114,11 @@ 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); - renderer = gsk_renderer_new_for_window (window); + window = gdk_surface_new_toplevel (gdk_display_get_default(), 10 , 10); + renderer = gsk_renderer_new_for_surface (window); for (run = 0; run < runs; run++) { diff --git a/tests/showrendernode.c b/tests/showrendernode.c index d4de840c50..e0b2210ef3 100644 --- a/tests/showrendernode.c +++ b/tests/showrendernode.c @@ -94,7 +94,7 @@ gtk_node_view_finalize (GObject *object) static void gtk_node_view_init (GtkNodeView *self) { - gtk_widget_set_has_window (GTK_WIDGET (self), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE); } static void @@ -165,8 +165,8 @@ main (int argc, char **argv) if (write_to_filename != NULL) { - GdkWindow *window = gdk_window_new_toplevel (gdk_display_get_default(), 10 , 10); - GskRenderer *renderer = gsk_renderer_new_for_window (window); + GdkSurface *window = gdk_surface_new_toplevel (gdk_display_get_default(), 10 , 10); + GskRenderer *renderer = gsk_renderer_new_for_surface (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_surface (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..acdbd15bb0 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); + window = gtk_widget_get_parent_surface (widget); + 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); + window = gtk_widget_get_parent_surface (widget); + gdk_surface_unfullscreen (window); } int diff --git a/tests/testgtk.c b/tests/testgtk.c index 2561a8b966..01f2f409f3 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_surface (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_surface (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_surface (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, +surface_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); @@ -5677,8 +5677,8 @@ tracking_label (GtkWidget *window) gtk_box_pack_start (GTK_BOX (hbox), label); g_object_set_data (G_OBJECT (label), "title", (gpointer)gtk_window_get_title (GTK_WINDOW (window))); - g_signal_connect (gtk_widget_get_window (window), "notify::state", - G_CALLBACK (window_state_callback), + g_signal_connect (gtk_widget_get_surface (window), "notify::state", + G_CALLBACK (surface_state_callback), label); button = gtk_button_new_with_label ("Deiconify"); @@ -5856,7 +5856,7 @@ get_state_controls (GtkWidget *window) } void -create_window_states (GtkWidget *widget) +create_surface_states (GtkWidget *widget) { static GtkWidget *window = NULL; GtkWidget *label; @@ -6629,7 +6629,7 @@ find_widget (GtkWidget *widget, FindWidgetData *data) * but within the allocation are not counted. This is consistent * with the way we highlight drag targets. */ - if (gtk_widget_get_has_window (widget)) + if (gtk_widget_get_has_surface (widget)) { new_allocation.x = 0; new_allocation.y = 0; @@ -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); - while (window != gtk_widget_get_window (gtk_widget_get_parent (widget))) + GdkSurface *window = gtk_widget_get_surface (widget); + while (window != gtk_widget_get_surface (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,23 +6711,23 @@ static GtkWidget * find_widget_at_pointer (GdkDevice *device) { GtkWidget *widget = NULL; - GdkWindow *pointer_window; + GdkSurface *pointer_window; gint x, y; FindWidgetData data; - pointer_window = gdk_device_get_window_at_position (device, NULL, NULL); + pointer_window = gdk_device_get_surface_at_position (device, NULL, NULL); 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; } if (widget) { - gdk_window_get_device_position (gtk_widget_get_window (widget), + gdk_surface_get_device_position (gtk_widget_get_surface (widget), device, &x, &y, NULL); @@ -6846,7 +6846,7 @@ snapshot_widget (GtkButton *button, data->cursor = gdk_cursor_new_from_name ("crosshair", NULL); gdk_seat_grab (gdk_device_get_seat (device), - gtk_widget_get_window (widget), + gtk_widget_get_surface (widget), GDK_SEAT_CAPABILITY_ALL_POINTING, TRUE, data->cursor, NULL, NULL, 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); @@ -6983,8 +6983,8 @@ scroll_test_adjustment_changed (GtkAdjustment *adjustment, GtkWidget *widget) if (!gtk_widget_is_drawable (widget)) return; - window = gtk_widget_get_window (widget); - gdk_window_scroll (window, 0, dy); + window = gtk_widget_get_surface (widget); + gdk_surface_scroll (window, 0, dy); } @@ -7780,7 +7780,7 @@ struct { { "tooltips", create_tooltips }, { "WM hints", create_wmhints }, { "window sizing", create_window_sizing }, - { "window states", create_window_states } + { "window states", create_surface_states } }; int nbuttons = sizeof (buttons) / sizeof (buttons[0]); diff --git a/tests/testinput.c b/tests/testinput.c index 69b1230159..101e3e59c5 100644 --- a/tests/testinput.c +++ b/tests/testinput.c @@ -45,11 +45,11 @@ size_allocate (GtkWidget *widget, surface = NULL; } - if (gtk_widget_get_window (widget)) + if (gtk_widget_get_surface (widget)) { cairo_t *cr; - surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget), + surface = gdk_surface_create_similar_surface (gtk_widget_get_surface (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/tests/testwidgetfocus.c b/tests/testwidgetfocus.c index 3aed9e7376..5d33302bdc 100644 --- a/tests/testwidgetfocus.c +++ b/tests/testwidgetfocus.c @@ -238,7 +238,7 @@ gtk_focus_widget_finalize (GObject *object) static void gtk_focus_widget_init (GtkFocusWidget *self) { - gtk_widget_set_has_window (GTK_WIDGET (self), FALSE); + gtk_widget_set_has_surface (GTK_WIDGET (self), FALSE); self->child1 = gtk_button_new_with_label ("1"); gtk_widget_set_parent (self->child1, GTK_WIDGET (self)); diff --git a/tests/testxinerama.c b/tests/testxinerama.c index 37a9c5126f..8701124cfc 100644 --- a/tests/testxinerama.c +++ b/tests/testxinerama.c @@ -48,8 +48,8 @@ request (GtkWidget *widget, gpointer user_data) { GdkDisplay *display = gtk_widget_get_display (widget); - GdkMonitor *monitor = gdk_display_get_monitor_at_window (display, - gtk_widget_get_window (widget)); + GdkMonitor *monitor = gdk_display_get_monitor_at_surface (display, + gtk_widget_get_surface (widget)); if (monitor == NULL) gtk_label_set_markup (GTK_LABEL (user_data), |