diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-04-05 11:29:12 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-04-06 16:32:03 -0400 |
commit | 89ad7893adb25a79d7cbdd5ddbf786b299b66453 (patch) | |
tree | 9727ba950567ed1fcce818d9a6cd9efa80cbfa32 /gdk | |
parent | 0eb728aa517ccdefbdee1e329a30e90adcc7a31f (diff) | |
download | gtk+-89ad7893adb25a79d7cbdd5ddbf786b299b66453.tar.gz |
gdk: Make GdkKeymap a private api
We have replacement apis in GdkDevice and GdkDisplay.
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/gdk-autocleanup.h | 1 | ||||
-rw-r--r-- | gdk/gdkdevice.c | 2 | ||||
-rw-r--r-- | gdk/gdkdisplay.h | 3 | ||||
-rw-r--r-- | gdk/gdkevents.c | 1 | ||||
-rw-r--r-- | gdk/gdkinternals.h | 2 | ||||
-rw-r--r-- | gdk/gdkkeys.h | 71 | ||||
-rw-r--r-- | gdk/gdkkeysprivate.h | 41 | ||||
-rw-r--r-- | gdk/gdktypes.h | 1 | ||||
-rw-r--r-- | gdk/wayland/gdkdevice-wayland.c | 1 | ||||
-rw-r--r-- | gdk/win32/gdkwin32.h | 1 | ||||
-rw-r--r-- | gdk/win32/gdkwin32keys.h | 3 | ||||
-rw-r--r-- | gdk/x11/gdkdevicemanager-xi2.c | 1 | ||||
-rw-r--r-- | gdk/x11/gdkdisplay-x11.c | 1 | ||||
-rw-r--r-- | gdk/x11/gdkx-autocleanups.h | 1 | ||||
-rw-r--r-- | gdk/x11/gdkx.h | 1 | ||||
-rw-r--r-- | gdk/x11/gdkx11keys.h | 3 | ||||
-rw-r--r-- | gdk/x11/meson.build | 1 |
17 files changed, 50 insertions, 85 deletions
diff --git a/gdk/gdk-autocleanup.h b/gdk/gdk-autocleanup.h index d566986a45..a7c8586962 100644 --- a/gdk/gdk-autocleanup.h +++ b/gdk/gdk-autocleanup.h @@ -32,7 +32,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrag, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrawContext, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameClock, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLContext, g_object_unref) -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(GdkPopupLayout, gdk_popup_layout_unref) diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c index b68a128004..907c53ce62 100644 --- a/gdk/gdkdevice.c +++ b/gdk/gdkdevice.c @@ -24,7 +24,7 @@ #include "gdkdisplayprivate.h" #include "gdkinternals.h" #include "gdkintl.h" -#include "gdkkeys.h" +#include "gdkkeysprivate.h" /* for the use of round() */ #include "fallback-c89.c" diff --git a/gdk/gdkdisplay.h b/gdk/gdkdisplay.h index 5e70e7e047..cdd7012aa2 100644 --- a/gdk/gdkdisplay.h +++ b/gdk/gdkdisplay.h @@ -116,9 +116,6 @@ GdkMonitor * gdk_display_get_monitor_at_surface (GdkDisplay *display, GdkSurface *surface); GDK_AVAILABLE_IN_ALL -GdkKeymap * gdk_display_get_keymap (GdkDisplay *display); - -GDK_AVAILABLE_IN_ALL GdkModifierType gdk_display_get_modifier_mask (GdkDisplay *display, GdkModifierIntent intent); diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c index 45531bd6af..1e16dde660 100644 --- a/gdk/gdkevents.c +++ b/gdk/gdkevents.c @@ -30,6 +30,7 @@ #include "gdkdisplayprivate.h" #include "gdkdragprivate.h" #include "gdkdropprivate.h" +#include "gdkkeysprivate.h" #include "gdk-private.h" #include <string.h> diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index 73e356170c..30715af56e 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -33,6 +33,7 @@ #include "gdksurfaceprivate.h" #include "gdkenumtypes.h" #include "gdkdragprivate.h" +#include "gdkkeysprivate.h" G_BEGIN_DECLS @@ -322,6 +323,7 @@ void gdk_seat_ungrab (GdkSeat *seat); GdkSurface * gdk_surface_new_temp (GdkDisplay *display, const GdkRectangle *position); +GdkKeymap * gdk_display_get_keymap (GdkDisplay *display); G_END_DECLS diff --git a/gdk/gdkkeys.h b/gdk/gdkkeys.h index d58c6b2475..8baef542c6 100644 --- a/gdk/gdkkeys.h +++ b/gdk/gdkkeys.h @@ -34,77 +34,6 @@ G_BEGIN_DECLS - -#define GDK_TYPE_KEYMAP (gdk_keymap_get_type ()) -#define GDK_KEYMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_KEYMAP, GdkKeymap)) -#define GDK_IS_KEYMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_KEYMAP)) - -/** - * GdkKeymap: - * - * A #GdkKeymap defines the translation from keyboard state - * (including a hardware key, a modifier mask, and active keyboard group) - * to a keyval. This translation has two phases. The first phase is - * to determine the effective keyboard group and level for the keyboard - * state; the second phase is to look up the keycode/group/level triplet - * in the keymap and see what keyval it corresponds to. - */ - -GDK_AVAILABLE_IN_ALL -GType gdk_keymap_get_type (void) G_GNUC_CONST; - -GDK_AVAILABLE_IN_ALL -GdkDisplay * gdk_keymap_get_display (GdkKeymap *keymap); - -GDK_AVAILABLE_IN_ALL -guint gdk_keymap_lookup_key (GdkKeymap *keymap, - const GdkKeymapKey *key); -GDK_AVAILABLE_IN_ALL -gboolean gdk_keymap_translate_keyboard_state (GdkKeymap *keymap, - guint hardware_keycode, - GdkModifierType state, - gint group, - guint *keyval, - gint *effective_group, - gint *level, - GdkModifierType *consumed_modifiers); -GDK_AVAILABLE_IN_ALL -gboolean gdk_keymap_get_entries_for_keyval (GdkKeymap *keymap, - guint keyval, - GdkKeymapKey **keys, - gint *n_keys); -GDK_AVAILABLE_IN_ALL -gboolean gdk_keymap_get_entries_for_keycode (GdkKeymap *keymap, - guint hardware_keycode, - GdkKeymapKey **keys, - guint **keyvals, - gint *n_entries); - -GDK_AVAILABLE_IN_ALL -PangoDirection gdk_keymap_get_direction (GdkKeymap *keymap); -GDK_AVAILABLE_IN_ALL -gboolean gdk_keymap_have_bidi_layouts (GdkKeymap *keymap); -GDK_AVAILABLE_IN_ALL -gboolean gdk_keymap_get_caps_lock_state (GdkKeymap *keymap); -GDK_AVAILABLE_IN_ALL -gboolean gdk_keymap_get_num_lock_state (GdkKeymap *keymap); -GDK_AVAILABLE_IN_ALL -gboolean gdk_keymap_get_scroll_lock_state (GdkKeymap *keymap); -GDK_AVAILABLE_IN_ALL -guint gdk_keymap_get_modifier_state (GdkKeymap *keymap); -GDK_AVAILABLE_IN_ALL -void gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap, - GdkModifierType *state); -GDK_AVAILABLE_IN_ALL -gboolean gdk_keymap_map_virtual_modifiers (GdkKeymap *keymap, - GdkModifierType *state); -GDK_AVAILABLE_IN_ALL -GdkModifierType gdk_keymap_get_modifier_mask (GdkKeymap *keymap, - GdkModifierIntent intent); - - -/* Key values - */ GDK_AVAILABLE_IN_ALL const char *gdk_keyval_name (guint keyval) G_GNUC_CONST; diff --git a/gdk/gdkkeysprivate.h b/gdk/gdkkeysprivate.h index 96f67b1519..564e63da52 100644 --- a/gdk/gdkkeysprivate.h +++ b/gdk/gdkkeysprivate.h @@ -22,10 +22,14 @@ G_BEGIN_DECLS +#define GDK_TYPE_KEYMAP (gdk_keymap_get_type ()) +#define GDK_KEYMAP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_KEYMAP, GdkKeymap)) +#define GDK_IS_KEYMAP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_KEYMAP)) #define GDK_KEYMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_KEYMAP, GdkKeymapClass)) #define GDK_IS_KEYMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_KEYMAP)) #define GDK_KEYMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_KEYMAP, GdkKeymapClass)) +typedef struct _GdkKeymap GdkKeymap; typedef struct _GdkKeymapClass GdkKeymapClass; struct _GdkKeymapClass @@ -77,6 +81,43 @@ struct _GdkKeymap GdkDisplay *display; }; +GType gdk_keymap_get_type (void) G_GNUC_CONST; + +GdkDisplay * gdk_keymap_get_display (GdkKeymap *keymap); + +guint gdk_keymap_lookup_key (GdkKeymap *keymap, + const GdkKeymapKey *key); +gboolean gdk_keymap_translate_keyboard_state (GdkKeymap *keymap, + guint hardware_keycode, + GdkModifierType state, + gint group, + guint *keyval, + gint *effective_group, + gint *level, + GdkModifierType *consumed_modifiers); +gboolean gdk_keymap_get_entries_for_keyval (GdkKeymap *keymap, + guint keyval, + GdkKeymapKey **keys, + gint *n_keys); +gboolean gdk_keymap_get_entries_for_keycode (GdkKeymap *keymap, + guint hardware_keycode, + GdkKeymapKey **keys, + guint **keyvals, + gint *n_entries); + +PangoDirection gdk_keymap_get_direction (GdkKeymap *keymap); +gboolean gdk_keymap_have_bidi_layouts (GdkKeymap *keymap); +gboolean gdk_keymap_get_caps_lock_state (GdkKeymap *keymap); +gboolean gdk_keymap_get_num_lock_state (GdkKeymap *keymap); +gboolean gdk_keymap_get_scroll_lock_state (GdkKeymap *keymap); +guint gdk_keymap_get_modifier_state (GdkKeymap *keymap); +void gdk_keymap_add_virtual_modifiers (GdkKeymap *keymap, + GdkModifierType *state); +gboolean gdk_keymap_map_virtual_modifiers (GdkKeymap *keymap, + GdkModifierType *state); +GdkModifierType gdk_keymap_get_modifier_mask (GdkKeymap *keymap, + GdkModifierIntent intent); + G_END_DECLS #endif diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h index 8497c6369a..9061d1dd33 100644 --- a/gdk/gdktypes.h +++ b/gdk/gdktypes.h @@ -122,7 +122,6 @@ typedef struct _GdkClipboard GdkClipboard; typedef struct _GdkDisplayManager GdkDisplayManager; typedef struct _GdkDisplay GdkDisplay; typedef struct _GdkSurface GdkSurface; -typedef struct _GdkKeymap GdkKeymap; typedef struct _GdkAppLaunchContext GdkAppLaunchContext; typedef struct _GdkSeat GdkSeat; typedef struct _GdkSnapshot GdkSnapshot; diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index c4fdcbcde8..e29541c108 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -30,6 +30,7 @@ #include "gdkseat-wayland.h" #include "gdkwayland.h" #include "gdkkeysyms.h" +#include "gdkkeysprivate.h" #include "gdkcursorprivate.h" #include "gdkdeviceprivate.h" #include "gdkdevicepadprivate.h" diff --git a/gdk/win32/gdkwin32.h b/gdk/win32/gdkwin32.h index f4001dabb5..739624d84c 100644 --- a/gdk/win32/gdkwin32.h +++ b/gdk/win32/gdkwin32.h @@ -31,7 +31,6 @@ #include <gdk/win32/gdkwin32display.h> #include <gdk/win32/gdkwin32displaymanager.h> #include <gdk/win32/gdkwin32dnd.h> -#include <gdk/win32/gdkwin32keys.h> #include <gdk/win32/gdkwin32screen.h> #include <gdk/win32/gdkwin32surface.h> #include <gdk/win32/gdkwin32misc.h> diff --git a/gdk/win32/gdkwin32keys.h b/gdk/win32/gdkwin32keys.h index 5dcef11fa1..a35cd74f33 100644 --- a/gdk/win32/gdkwin32keys.h +++ b/gdk/win32/gdkwin32keys.h @@ -23,6 +23,7 @@ #endif #include <gdk/gdk.h> +#include "gdkkeysprivate.h" G_BEGIN_DECLS @@ -58,10 +59,8 @@ typedef struct _GdkWin32KeymapClass GdkWin32KeymapClass; #define GDK_IS_WIN32_KEYMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WIN32_KEYMAP)) #define GDK_WIN32_KEYMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WIN32_KEYMAP, GdkWin32KeymapClass)) -GDK_AVAILABLE_IN_ALL GType gdk_win32_keymap_get_type (void); -GDK_AVAILABLE_IN_ALL GdkWin32KeymapMatch gdk_win32_keymap_check_compose (GdkWin32Keymap *keymap, guint16 *compose_buffer, gsize compose_buffer_len, diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c index dc98e76bd9..d3c690bb19 100644 --- a/gdk/x11/gdkdevicemanager-xi2.c +++ b/gdk/x11/gdkdevicemanager-xi2.c @@ -19,6 +19,7 @@ #include "gdkx11devicemanager-xi2.h" #include "gdkx11device-xi2.h" +#include "gdkx11keys.h" #include "gdkdeviceprivate.h" #include "gdkdevicetoolprivate.h" diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 2d34eb314a..97dfcae5e9 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -26,6 +26,7 @@ #include "gdkdisplay-x11.h" #include "gdkdisplayprivate.h" +#include "gdkx11keys.h" #include "gdkasync.h" #include "gdkdisplay.h" diff --git a/gdk/x11/gdkx-autocleanups.h b/gdk/x11/gdkx-autocleanups.h index 123f77e811..465b412727 100644 --- a/gdk/x11/gdkx-autocleanups.h +++ b/gdk/x11/gdkx-autocleanups.h @@ -27,7 +27,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11DeviceXI2, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Display, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Drag, 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(GdkX11Surface, g_object_unref) diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h index 2705305964..c94f52fbb8 100644 --- a/gdk/x11/gdkx.h +++ b/gdk/x11/gdkx.h @@ -40,7 +40,6 @@ #include <gdk/x11/gdkx11display.h> #include <gdk/x11/gdkx11dnd.h> #include <gdk/x11/gdkx11glcontext.h> -#include <gdk/x11/gdkx11keys.h> #include <gdk/x11/gdkx11monitor.h> #include <gdk/x11/gdkx11property.h> #include <gdk/x11/gdkx11screen.h> diff --git a/gdk/x11/gdkx11keys.h b/gdk/x11/gdkx11keys.h index b33d4cddf0..65d3531b5b 100644 --- a/gdk/x11/gdkx11keys.h +++ b/gdk/x11/gdkx11keys.h @@ -23,6 +23,7 @@ #endif #include <gdk/gdk.h> +#include <gdk/gdkkeysprivate.h> G_BEGIN_DECLS @@ -43,11 +44,9 @@ typedef struct _GdkX11KeymapClass GdkX11KeymapClass; GDK_AVAILABLE_IN_ALL GType gdk_x11_keymap_get_type (void); -GDK_AVAILABLE_IN_ALL gint gdk_x11_keymap_get_group_for_state (GdkKeymap *keymap, guint state); -GDK_AVAILABLE_IN_ALL gboolean gdk_x11_keymap_key_is_modifier (GdkKeymap *keymap, guint keycode); G_END_DECLS diff --git a/gdk/x11/meson.build b/gdk/x11/meson.build index bfc6243978..6db7e695b3 100644 --- a/gdk/x11/meson.build +++ b/gdk/x11/meson.build @@ -41,7 +41,6 @@ gdk_x11_public_headers = files([ 'gdkx11display.h', 'gdkx11dnd.h', 'gdkx11glcontext.h', - 'gdkx11keys.h', 'gdkx11monitor.h', 'gdkx11property.h', 'gdkx11screen.h', |