keyboard: Simplify keyboard option object creation

https://bugzilla.gnome.org/show_bug.cgi?id=771009
This commit is contained in:
Bastien Nocera 2016-09-07 13:38:35 +02:00 committed by Georges Basile Stavracas Neto
parent dc0988d47c
commit 3dafd78569
2 changed files with 3 additions and 15 deletions

View file

@ -27,13 +27,6 @@
#include "cc-keyboard-option.h" #include "cc-keyboard-option.h"
#define CC_TYPE_KEYBOARD_OPTION (cc_keyboard_option_get_type ())
#define CC_KEYBOARD_OPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CC_TYPE_KEYBOARD_OPTION, CcKeyboardOption))
#define CC_KEYBOARD_OPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CC_TYPE_KEYBOARD_OPTION, CcKeyboardOptionClass))
#define CC_IS_KEYBOARD_OPTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CC_TYPE_KEYBOARD_OPTION))
#define CC_IS_KEYBOARD_OPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CC_TYPE_KEYBOARD_OPTION))
#define CC_KEYBOARD_OPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CC_TYPE_KEYBOARD_OPTION, CcKeyboardOptionClass))
#define INPUT_SOURCES_SCHEMA "org.gnome.desktop.input-sources" #define INPUT_SOURCES_SCHEMA "org.gnome.desktop.input-sources"
#define XKB_OPTIONS_KEY "xkb-options" #define XKB_OPTIONS_KEY "xkb-options"
@ -66,12 +59,6 @@ struct _CcKeyboardOption
const gchar * const *whitelist; const gchar * const *whitelist;
}; };
typedef struct _CcKeyboardOptionClass CcKeyboardOptionClass;
struct _CcKeyboardOptionClass
{
GObjectClass parent_class;
};
static guint keyboard_option_signals[LAST_SIGNAL] = { 0 }; static guint keyboard_option_signals[LAST_SIGNAL] = { 0 };
static GnomeXkbInfo *xkb_info = NULL; static GnomeXkbInfo *xkb_info = NULL;

View file

@ -26,6 +26,9 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define CC_TYPE_KEYBOARD_OPTION (cc_keyboard_option_get_type ())
G_DECLARE_FINAL_TYPE (CcKeyboardOption, cc_keyboard_option, CC, KEYBOARD_OPTION, GObject)
enum enum
{ {
XKB_OPTION_DESCRIPTION_COLUMN, XKB_OPTION_DESCRIPTION_COLUMN,
@ -33,8 +36,6 @@ enum
XKB_OPTION_N_COLUMNS XKB_OPTION_N_COLUMNS
}; };
typedef struct _CcKeyboardOption CcKeyboardOption;
GList * cc_keyboard_option_get_all (void); GList * cc_keyboard_option_get_all (void);
const gchar * cc_keyboard_option_get_description (CcKeyboardOption *self); const gchar * cc_keyboard_option_get_description (CcKeyboardOption *self);
GtkListStore * cc_keyboard_option_get_store (CcKeyboardOption *self); GtkListStore * cc_keyboard_option_get_store (CcKeyboardOption *self);