[mutter] keybindings: Make MetaKeyPref, MetaKeyCombo and MetaKeyHandler private



commit 91389c89a1a7e237df72d4f7ae2fe2cf0507f0d5
Author: Rui Matos <tiagomatos gmail com>
Date:   Tue Feb 25 19:07:49 2014 +0100

    keybindings: Make MetaKeyPref, MetaKeyCombo and MetaKeyHandler private
    
    There's no need for these to be public and keeping them all together
    in the same header makes it easier when reading the code.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725588

 src/core/keybindings-private.h |   42 +++++++++++++++++++++++++++++++++++++
 src/core/prefs.c               |    5 ----
 src/meta/prefs.h               |   45 ----------------------------------------
 3 files changed, 42 insertions(+), 50 deletions(-)
---
diff --git a/src/core/keybindings-private.h b/src/core/keybindings-private.h
index 5608905..27bd76c 100644
--- a/src/core/keybindings-private.h
+++ b/src/core/keybindings-private.h
@@ -30,6 +30,7 @@
 #include <gio/gio.h>
 #include <meta/keybindings.h>
 
+typedef struct _MetaKeyHandler MetaKeyHandler;
 struct _MetaKeyHandler
 {
   char *name;
@@ -51,6 +52,44 @@ struct _MetaKeyBinding
   MetaKeyHandler *handler;
 };
 
+/**
+ * MetaKeyCombo:
+ * @keysym: keysym
+ * @keycode: keycode
+ * @modifiers: modifiers
+ */
+typedef struct _MetaKeyCombo MetaKeyCombo;
+struct _MetaKeyCombo
+{
+  unsigned int keysym;
+  unsigned int keycode;
+  MetaVirtualModifier modifiers;
+};
+
+typedef struct
+{
+  char *name;
+  GSettings *settings;
+
+  MetaKeyBindingAction action;
+
+  /*
+   * A list of MetaKeyCombos. Each of them is bound to
+   * this keypref. If one has keysym==modifiers==0, it is
+   * ignored.
+   */
+  GSList *bindings;
+
+  /* for keybindings that can have shift or not like Alt+Tab */
+  gboolean      add_shift:1;
+
+  /* for keybindings that apply only to a window */
+  gboolean      per_window:1;
+
+  /* for keybindings not added with meta_display_add_keybinding() */
+  gboolean      builtin:1;
+} MetaKeyPref;
+
 void     meta_display_init_keys             (MetaDisplay *display);
 void     meta_display_shutdown_keys         (MetaDisplay *display);
 void     meta_screen_grab_keys              (MetaScreen  *screen);
@@ -78,6 +117,9 @@ gboolean meta_prefs_add_keybinding          (const char           *name,
 
 gboolean meta_prefs_remove_keybinding       (const char    *name);
 
+GList *meta_prefs_get_keybindings (void);
+void meta_prefs_get_overlay_binding (MetaKeyCombo *combo);
+const char *meta_prefs_get_iso_next_group_option (void);
 
 #endif
 
diff --git a/src/core/prefs.c b/src/core/prefs.c
index d9f0f28..4bf458b 100644
--- a/src/core/prefs.c
+++ b/src/core/prefs.c
@@ -2154,11 +2154,6 @@ meta_prefs_remove_keybinding (const char *name)
   return TRUE;
 }
 
-/**
- * meta_prefs_get_keybindings:
- *
- * Returns: (element-type MetaKeyPref) (transfer container):
- */
 GList *
 meta_prefs_get_keybindings ()
 {
diff --git a/src/meta/prefs.h b/src/meta/prefs.h
index a5a3ab2..49d5076 100644
--- a/src/meta/prefs.h
+++ b/src/meta/prefs.h
@@ -372,20 +372,6 @@ typedef enum
 } MetaKeyBindingFlags;
 
 /**
- * MetaKeyCombo:
- * @keysym: keysym
- * @keycode: keycode
- * @modifiers: modifiers
- */
-typedef struct _MetaKeyCombo MetaKeyCombo;
-struct _MetaKeyCombo
-{
-  unsigned int keysym;
-  unsigned int keycode;
-  MetaVirtualModifier modifiers;
-};
-
-/**
  * MetaKeyHandlerFunc:
  * @display: a #MetaDisplay
  * @screen: a #MetaScreen
@@ -402,45 +388,14 @@ typedef void (* MetaKeyHandlerFunc) (MetaDisplay    *display,
                                      MetaKeyBinding *binding,
                                      gpointer        user_data);
 
-typedef struct _MetaKeyHandler MetaKeyHandler;
-
-typedef struct
-{
-  char *name;
-  GSettings *settings;
-
-  MetaKeyBindingAction action;
-
-  /*
-   * A list of MetaKeyCombos. Each of them is bound to
-   * this keypref. If one has keysym==modifiers==0, it is
-   * ignored.
-   */
-  GSList *bindings;
-
-  /* for keybindings that can have shift or not like Alt+Tab */
-  gboolean      add_shift:1;
-
-  /* for keybindings that apply only to a window */
-  gboolean      per_window:1;
-
-  /* for keybindings not added with meta_display_add_keybinding() */
-  gboolean      builtin:1;
-} MetaKeyPref;
-
 GType meta_key_binding_get_type    (void);
 
-GList *meta_prefs_get_keybindings (void);
-
 MetaKeyBindingAction meta_prefs_get_keybinding_action (const char *name);
 
 void meta_prefs_get_window_binding (const char          *name,
                                     unsigned int        *keysym,
                                     MetaVirtualModifier *modifiers);
 
-void meta_prefs_get_overlay_binding (MetaKeyCombo *combo);
-const char *meta_prefs_get_iso_next_group_option (void);
-
 gboolean           meta_prefs_get_visual_bell      (void);
 gboolean           meta_prefs_bell_is_audible      (void);
 GDesktopVisualBellType meta_prefs_get_visual_bell_type (void);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]