You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
3.3 KiB

Index: ibus-m17n-1.3.4/src/default.xml
===================================================================
--- ibus-m17n-1.3.4.orig/src/default.xml
+++ ibus-m17n-1.3.4/src/default.xml
@@ -184,6 +184,15 @@
<name>m17n:si:samanala</name>
<rank>0</rank>
</engine>
+ <!-- Some Indic engines expect AltGr is automatically mapped -->
+ <engine>
+ <name>m17n:*:inscript*</name>
+ <layout>default[lv3:ralt_switch]</layout>
+ </engine>
+ <engine>
+ <name>m17n:si:*</name>
+ <layout>default[lv3:ralt_switch]</layout>
+ </engine>
<!-- Some CJK engines use preedit. -->
<engine>
<name>m17n:zh:cangjie</name>
Index: ibus-m17n-1.3.4/src/m17nutil.c
===================================================================
--- ibus-m17n-1.3.4.orig/src/m17nutil.c
+++ ibus-m17n-1.3.4/src/m17nutil.c
@@ -17,7 +17,8 @@ typedef enum {
ENGINE_CONFIG_RANK_MASK = 1 << 0,
ENGINE_CONFIG_SYMBOL_MASK = 1 << 1,
ENGINE_CONFIG_LONGNAME_MASK = 1 << 2,
- ENGINE_CONFIG_PREEDIT_HIGHLIGHT_MASK = 1 << 3
+ ENGINE_CONFIG_LAYOUT_MASK = 1 << 3,
+ ENGINE_CONFIG_PREEDIT_HIGHLIGHT_MASK = 1 << 4
} EngineConfigMask;
struct _EngineConfigNode {
@@ -137,7 +138,7 @@ ibus_m17n_engine_new (MSymbol lang,
"language", msymbol_name (lang),
"license", "GPL",
"icon", engine_icon ? engine_icon : "",
- "layout", "default",
+ "layout", config->layout ? config->layout : "default",
"rank", config->rank,
"symbol", config->symbol ? config->symbol : "",
"setup", engine_setup,
@@ -272,6 +273,8 @@ ibus_m17n_get_engine_config (const gchar
config->symbol = cnode->config.symbol;
if (cnode->mask & ENGINE_CONFIG_LONGNAME_MASK)
config->longname = cnode->config.longname;
+ if (cnode->mask & ENGINE_CONFIG_LAYOUT_MASK)
+ config->layout = cnode->config.layout;
if (cnode->mask & ENGINE_CONFIG_PREEDIT_HIGHLIGHT_MASK)
config->preedit_highlight = cnode->config.preedit_highlight;
}
@@ -314,6 +317,12 @@ ibus_m17n_engine_config_parse_xml_node (
cnode->mask |= ENGINE_CONFIG_LONGNAME_MASK;
continue;
}
+ if (g_strcmp0 (sub_node->name , "layout") == 0) {
+ g_free (cnode->config.layout);
+ cnode->config.layout = g_strdup (sub_node->text);
+ cnode->mask |= ENGINE_CONFIG_LAYOUT_MASK;
+ continue;
+ }
if (g_strcmp0 (sub_node->name , "preedit-highlight") == 0) {
if (g_ascii_strcasecmp ("TRUE", sub_node->text) == 0)
cnode->config.preedit_highlight = TRUE;
Index: ibus-m17n-1.3.4/src/m17nutil.h
===================================================================
--- ibus-m17n-1.3.4.orig/src/m17nutil.h
+++ ibus-m17n-1.3.4/src/m17nutil.h
@@ -20,6 +20,9 @@ struct _IBusM17NEngineConfig {
/* overridding longname shown on panel */
gchar *longname;
+ /* keyboard layout */
+ gchar *layout;
+
/* whether to highlight preedit */
gboolean preedit_highlight;
};