keyboard: Rename XkbOption
and XkbModifier
with Cc
prefix
This commit is contained in:
parent
5a9fa905bc
commit
e224e5177a
3 changed files with 17 additions and 17 deletions
|
@ -66,11 +66,11 @@ enum {
|
||||||
PROP_PARAMETERS
|
PROP_PARAMETERS
|
||||||
};
|
};
|
||||||
|
|
||||||
static const XkbModifier LV3_MODIFIER = {
|
static const CcXkbModifier LV3_MODIFIER = {
|
||||||
"lv3:",
|
"lv3:",
|
||||||
N_("Alternate Characters Key"),
|
N_("Alternate Characters Key"),
|
||||||
N_("The alternate characters key can be used to enter additional characters. These are sometimes printed as a third-option on your keyboard."),
|
N_("The alternate characters key can be used to enter additional characters. These are sometimes printed as a third-option on your keyboard."),
|
||||||
(XkbOption[]){
|
(CcXkbOption[]){
|
||||||
{ NC_("keyboard key", "Left Alt"), "lv3:lalt_switch" },
|
{ NC_("keyboard key", "Left Alt"), "lv3:lalt_switch" },
|
||||||
{ NC_("keyboard key", "Right Alt"), "lv3:ralt_switch" },
|
{ NC_("keyboard key", "Right Alt"), "lv3:ralt_switch" },
|
||||||
{ NC_("keyboard key", "Left Super"), "lv3:lwin_switch" },
|
{ NC_("keyboard key", "Left Super"), "lv3:lwin_switch" },
|
||||||
|
@ -82,13 +82,13 @@ static const XkbModifier LV3_MODIFIER = {
|
||||||
"lv3:ralt_switch",
|
"lv3:ralt_switch",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const XkbModifier COMPOSE_MODIFIER = {
|
static const CcXkbModifier COMPOSE_MODIFIER = {
|
||||||
"compose:",
|
"compose:",
|
||||||
N_("Compose Key"),
|
N_("Compose Key"),
|
||||||
N_("The compose key allows a wide variety of characters to be entered. To use it, press compose then a sequence of characters. "
|
N_("The compose key allows a wide variety of characters to be entered. To use it, press compose then a sequence of characters. "
|
||||||
" For example, compose key followed by <b>C</b> and <b>o</b> will enter <b>©</b>, "
|
" For example, compose key followed by <b>C</b> and <b>o</b> will enter <b>©</b>, "
|
||||||
"<b>a</b> followed by <b>'</b> will enter <b>á</b>."),
|
"<b>a</b> followed by <b>'</b> will enter <b>á</b>."),
|
||||||
(XkbOption[]){
|
(CcXkbOption[]){
|
||||||
{ NC_("keyboard key", "Left Alt"), "compose:lalt" },
|
{ NC_("keyboard key", "Left Alt"), "compose:lalt" },
|
||||||
{ NC_("keyboard key", "Right Alt"), "compose:ralt" },
|
{ NC_("keyboard key", "Right Alt"), "compose:ralt" },
|
||||||
{ NC_("keyboard key", "Left Super"), "compose:lwin" },
|
{ NC_("keyboard key", "Left Super"), "compose:lwin" },
|
||||||
|
|
|
@ -36,7 +36,7 @@ struct _CcXkbModifierDialog
|
||||||
HdyActionRow *switch_row;
|
HdyActionRow *switch_row;
|
||||||
|
|
||||||
GSettings *input_source_settings;
|
GSettings *input_source_settings;
|
||||||
const XkbModifier *modifier;
|
const CcXkbModifier *modifier;
|
||||||
GSList *radio_group;
|
GSList *radio_group;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -47,10 +47,10 @@ static const gchar *custom_css =
|
||||||
" padding: 12px"
|
" padding: 12px"
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
static const XkbOption*
|
static const CcXkbOption*
|
||||||
get_xkb_option_from_name (const XkbModifier *modifier, const gchar* name)
|
get_xkb_option_from_name (const CcXkbModifier *modifier, const gchar* name)
|
||||||
{
|
{
|
||||||
const XkbOption *options = modifier->options;
|
const CcXkbOption *options = modifier->options;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; options[i].label && options[i].xkb_option; i++)
|
for (i = 0; options[i].label && options[i].xkb_option; i++)
|
||||||
|
@ -84,7 +84,7 @@ update_active_radio (CcXkbModifierDialog *self)
|
||||||
{
|
{
|
||||||
g_auto(GStrv) options = NULL;
|
g_auto(GStrv) options = NULL;
|
||||||
GtkRadioButton *rightalt_radio;
|
GtkRadioButton *rightalt_radio;
|
||||||
const XkbOption *default_option;
|
const CcXkbOption *default_option;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
options = g_settings_get_strv (self->input_source_settings, "xkb-options");
|
options = g_settings_get_strv (self->input_source_settings, "xkb-options");
|
||||||
|
@ -246,7 +246,7 @@ static void
|
||||||
add_radio_buttons (CcXkbModifierDialog *self)
|
add_radio_buttons (CcXkbModifierDialog *self)
|
||||||
{
|
{
|
||||||
GtkWidget *row, *radio_button, *label, *last_button = NULL;
|
GtkWidget *row, *radio_button, *label, *last_button = NULL;
|
||||||
XkbOption *options = self->modifier->options;
|
CcXkbOption *options = self->modifier->options;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; options[i].label && options[i].xkb_option; i++)
|
for (i = 0; options[i].label && options[i].xkb_option; i++)
|
||||||
|
@ -310,7 +310,7 @@ cc_xkb_modifier_dialog_init (CcXkbModifierDialog *self)
|
||||||
|
|
||||||
CcXkbModifierDialog *
|
CcXkbModifierDialog *
|
||||||
cc_xkb_modifier_dialog_new (GSettings *input_settings,
|
cc_xkb_modifier_dialog_new (GSettings *input_settings,
|
||||||
const XkbModifier *modifier)
|
const CcXkbModifier *modifier)
|
||||||
{
|
{
|
||||||
CcXkbModifierDialog *self;
|
CcXkbModifierDialog *self;
|
||||||
|
|
||||||
|
@ -336,8 +336,8 @@ xcb_modifier_transform_binding_to_label (GValue *value,
|
||||||
GVariant *variant,
|
GVariant *variant,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
const XkbModifier *modifier = user_data;
|
const CcXkbModifier *modifier = user_data;
|
||||||
const XkbOption *entry = NULL;
|
const CcXkbOption *entry = NULL;
|
||||||
const char **items;
|
const char **items;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
|
|
|
@ -28,21 +28,21 @@ typedef struct
|
||||||
{
|
{
|
||||||
gchar *label;
|
gchar *label;
|
||||||
gchar *xkb_option;
|
gchar *xkb_option;
|
||||||
} XkbOption;
|
} CcXkbOption;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
gchar *prefix;
|
gchar *prefix;
|
||||||
gchar *title;
|
gchar *title;
|
||||||
gchar *description;
|
gchar *description;
|
||||||
XkbOption *options;
|
CcXkbOption *options;
|
||||||
gchar *default_option;
|
gchar *default_option;
|
||||||
} XkbModifier;
|
} CcXkbModifier;
|
||||||
|
|
||||||
#define CC_TYPE_XKB_MODIFIER_DIALOG (cc_xkb_modifier_dialog_get_type())
|
#define CC_TYPE_XKB_MODIFIER_DIALOG (cc_xkb_modifier_dialog_get_type())
|
||||||
G_DECLARE_FINAL_TYPE (CcXkbModifierDialog, cc_xkb_modifier_dialog, CC, XKB_MODIFIER_DIALOG, GtkDialog)
|
G_DECLARE_FINAL_TYPE (CcXkbModifierDialog, cc_xkb_modifier_dialog, CC, XKB_MODIFIER_DIALOG, GtkDialog)
|
||||||
|
|
||||||
CcXkbModifierDialog *cc_xkb_modifier_dialog_new (GSettings *input_settings, const XkbModifier*);
|
CcXkbModifierDialog *cc_xkb_modifier_dialog_new (GSettings *input_settings, const CcXkbModifier*);
|
||||||
|
|
||||||
gboolean xcb_modifier_transform_binding_to_label (GValue*, GVariant*, gpointer);
|
gboolean xcb_modifier_transform_binding_to_label (GValue*, GVariant*, gpointer);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue