[gtk/keymap-rework-2: 2/13] gdk: Make GdkKeymap a private api
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/keymap-rework-2: 2/13] gdk: Make GdkKeymap a private api
- Date: Mon, 6 Apr 2020 19:34:57 +0000 (UTC)
commit f238efe9846e03332eca8c7e68260cbc7d22c64c
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Apr 5 11:29:12 2020 -0400
gdk: Make GdkKeymap a private api
We have replacement apis in GdkDevice and GdkDisplay.
docs/reference/gdk/gdk4-sections.txt | 34 -----------------
docs/reference/gdk/gdk4.types | 1 -
gdk/gdk-autocleanup.h | 1 -
gdk/gdkdevice.c | 2 +-
gdk/gdkdisplay.h | 3 --
gdk/gdkevents.c | 1 +
gdk/gdkinternals.h | 2 +
gdk/gdkkeys.h | 71 ------------------------------------
gdk/gdkkeysprivate.h | 41 +++++++++++++++++++++
gdk/gdktypes.h | 1 -
gdk/wayland/gdkdevice-wayland.c | 1 +
gdk/x11/gdkdevicemanager-xi2.c | 1 +
gdk/x11/gdkdisplay-x11.c | 1 +
gdk/x11/gdkx-autocleanups.h | 1 -
gdk/x11/gdkx.h | 1 -
gdk/x11/gdkx11keys.h | 1 +
16 files changed, 49 insertions(+), 114 deletions(-)
---
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt
index 9585188c1b..dff48e9e1a 100644
--- a/docs/reference/gdk/gdk4-sections.txt
+++ b/docs/reference/gdk/gdk4-sections.txt
@@ -98,7 +98,6 @@ gdk_display_get_monitor_at_surface
gdk_display_get_clipboard
gdk_display_get_primary_clipboard
gdk_display_get_setting
-gdk_display_get_keymap
<SUBSECTION>
gdk_display_map_keyval
@@ -341,49 +340,16 @@ gdk_rectangle_get_type
<SECTION>
<TITLE>Keyboard Handling</TITLE>
<FILE>keys</FILE>
-GdkKeymap
-GdkKeymapKey
-gdk_keymap_lookup_key
-gdk_keymap_translate_keyboard_state
-gdk_keymap_get_entries_for_keyval
-gdk_keymap_get_entries_for_keycode
-gdk_keymap_get_direction
-gdk_keymap_have_bidi_layouts
-gdk_keymap_get_caps_lock_state
-gdk_keymap_get_num_lock_state
-gdk_keymap_get_scroll_lock_state
-gdk_keymap_get_modifier_state
-gdk_keymap_add_virtual_modifiers
-gdk_keymap_map_virtual_modifiers
-gdk_keymap_get_modifier_mask
-gdk_keymap_get_display
-
-<SUBSECTION>
gdk_keyval_name
gdk_keyval_from_name
-
-<SUBSECTION>
gdk_keyval_convert_case
gdk_keyval_to_upper
gdk_keyval_to_lower
gdk_keyval_is_upper
gdk_keyval_is_lower
-
-<SUBSECTION>
gdk_keyval_to_unicode
gdk_unicode_to_keyval
-<SUBSECTION Standard>
-GDK_KEYMAP
-GDK_IS_KEYMAP
-GDK_TYPE_KEYMAP
-GDK_KEYMAP_CLASS
-GDK_IS_KEYMAP_CLASS
-GDK_KEYMAP_GET_CLASS
-
-<SUBSECTION Private>
-GdkKeymapClass
-gdk_keymap_get_type
</SECTION>
<SECTION>
diff --git a/docs/reference/gdk/gdk4.types b/docs/reference/gdk/gdk4.types
index 7a7eb76026..3127e63a5c 100644
--- a/docs/reference/gdk/gdk4.types
+++ b/docs/reference/gdk/gdk4.types
@@ -17,7 +17,6 @@ gdk_event_get_type
gdk_frame_clock_get_type
gdk_gl_context_get_type
gdk_gl_texture_get_type
-gdk_keymap_get_type
gdk_memory_texture_get_type
gdk_monitor_get_type
gdk_paintable_get_type
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
@@ -115,9 +115,6 @@ GDK_AVAILABLE_IN_ALL
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/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..38a46448eb 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]