diff options
author | Alexander Larsson <alexl@redhat.com> | 2018-03-20 11:40:08 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2018-03-20 11:40:08 +0100 |
commit | 391727bd0dff0f1d2d937f125bb08a541da02348 (patch) | |
tree | d7bac00df572f7efde9c8a9ffde46accb971ad20 /gtk/gtkimcontextime.c | |
parent | f7326ff828ad133a7884906ad4cd03e2d9980535 (diff) | |
download | gtk+-391727bd0dff0f1d2d937f125bb08a541da02348.tar.gz |
GdkWindow -> GdkSurface initial type rename
This renames the GdkWindow class and related classes (impl, backend
subclasses) to surface. Additionally it renames related types:
GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType,
GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge
This is an automatic conversion using the below commands:
git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass
git sed -f g GdkWindow GdkSurface
git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing
git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING
git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2"
git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE
git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo
git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE"
git sed -f g "broadway_window" "broadway_surface"
git sed -f g "BroadwayWindow" "BroadwaySurface"
git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE"
git sed -f g "wayland_window" "wayland_surface"
git sed -f g "WaylandWindow" "WaylandSurface"
git sed -f g "X11_WINDOW" "X11_SURFACE"
git sed -f g "x11_window" "x11_surface"
git sed -f g "X11Window" "X11Surface"
git sed -f g "WIN32_WINDOW" "WIN32_SURFACE"
git sed -f g "win32_window" "win32_surface"
git sed -f g "Win32Window" "Win32Surface"
git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE"
git sed -f g "quartz_window" "quartz_surface"
git sed -f g "QuartzWindow" "QuartzSurface"
git checkout NEWS* po-properties
Diffstat (limited to 'gtk/gtkimcontextime.c')
-rw-r--r-- | gtk/gtkimcontextime.c | 78 |
1 files changed, 39 insertions, 39 deletions
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 |