summaryrefslogtreecommitdiff
path: root/packages/matchbox-keyboard/files/2-Add-new-modifier--layout--Used-to-cycle-thru-all-available-layouts.patch
diff options
context:
space:
mode:
authorPaul Sokolovsky <pmiscml@gmail.com>2007-06-11 13:36:25 +0000
committerPaul Sokolovsky <pmiscml@gmail.com>2007-06-11 13:36:25 +0000
commit4ce057ac6e3ec54c9e32faca581d98956a42768e (patch)
tree945cd41372795d759528b115258081e2f3d13b8d /packages/matchbox-keyboard/files/2-Add-new-modifier--layout--Used-to-cycle-thru-all-available-layouts.patch
parent1e705365335cdaac70e4dad67b938646c527289f (diff)
matchbox-keyboard svn: Add patches to support multiple layouts.
* Allows to load multiple layouts from independent files located in ~/.matchbox/keyboard.d/ (is most cases those going to be symlinks to /usr/share) and switch among them (this requires corresponding button present in layout). * Config UI to setup active layouts to follow.
Diffstat (limited to 'packages/matchbox-keyboard/files/2-Add-new-modifier--layout--Used-to-cycle-thru-all-available-layouts.patch')
-rw-r--r--packages/matchbox-keyboard/files/2-Add-new-modifier--layout--Used-to-cycle-thru-all-available-layouts.patch91
1 files changed, 91 insertions, 0 deletions
diff --git a/packages/matchbox-keyboard/files/2-Add-new-modifier--layout--Used-to-cycle-thru-all-available-layouts.patch b/packages/matchbox-keyboard/files/2-Add-new-modifier--layout--Used-to-cycle-thru-all-available-layouts.patch
new file mode 100644
index 0000000000..2d05e5d652
--- /dev/null
+++ b/packages/matchbox-keyboard/files/2-Add-new-modifier--layout--Used-to-cycle-thru-all-available-layouts.patch
@@ -0,0 +1,91 @@
+# HG changeset patch
+# User pfalcon@localhost
+# Date 1176076569 0
+# Node ID ff9cf1fd8177dded04b9fc81ba630203848fc3ca
+# Parent 96305d94eb31f06f5618c99310192c47c68a1f21
+Add new modifier: layout. Used to cycle thru all available layouts.
+
+diff -r 96305d94eb31 -r ff9cf1fd8177 src/config-parser.c
+--- a/src/config-parser.c Sun Apr 08 23:28:43 2007 +0000
++++ b/src/config-parser.c Sun Apr 08 23:56:09 2007 +0000
+@@ -113,7 +113,8 @@ ModLookup[] =
+ { "mod1", MBKeyboardKeyModMod1 },
+ { "mod2", MBKeyboardKeyModMod2 },
+ { "mod3", MBKeyboardKeyModMod3 },
+- { "caps", MBKeyboardKeyModCaps }
++ { "caps", MBKeyboardKeyModCaps },
++ { "layout", MBKeyboardKeyModLayout },
+ };
+
+ typedef struct MBKeyboardConfigState
+diff -r 96305d94eb31 -r ff9cf1fd8177 src/matchbox-keyboard-key.c
+--- a/src/matchbox-keyboard-key.c Sun Apr 08 23:28:43 2007 +0000
++++ b/src/matchbox-keyboard-key.c Sun Apr 08 23:56:09 2007 +0000
+@@ -493,6 +493,16 @@ mb_kbd_key_press(MBKeyboardKey *key)
+ case MBKeyboardKeyModAlt:
+ mb_kbd_toggle_state(key->kbd, MBKeyboardStateAlt);
+ break;
++ case MBKeyboardKeyModLayout:
++ key->kbd->selected_layout_no++;
++ if (key->kbd->selected_layout_no >= util_list_length(key->kbd->layouts))
++ key->kbd->selected_layout_no = 0;
++ key->kbd->selected_layout =
++ (MBKeyboardLayout *)util_list_get_nth_data(key->kbd->layouts,
++ key->kbd->selected_layout_no);
++ mb_kbd_ui_recalc_ui_layout(key->kbd->ui);
++ queue_full_kbd_redraw = True;
++ break;
+ default:
+ DBG("unknown modifier action");
+ break;
+diff -r 96305d94eb31 -r ff9cf1fd8177 src/matchbox-keyboard-ui.c
+--- a/src/matchbox-keyboard-ui.c Sun Apr 08 23:28:43 2007 +0000
++++ b/src/matchbox-keyboard-ui.c Sun Apr 08 23:56:09 2007 +0000
+@@ -505,6 +505,15 @@ mb_kbd_ui_allocate_ui_layout(MBKeyboardU
+ }
+
+ *width = max_row_width;
++}
++
++void
++mb_kbd_ui_recalc_ui_layout(MBKeyboardUI *ui)
++{
++ mb_kbd_ui_allocate_ui_layout(ui,
++ &ui->base_alloc_width, &ui->base_alloc_height);
++
++ mb_kbd_ui_resize(ui, ui->xwin_width, ui->xwin_height);
+ }
+
+ void
+diff -r 96305d94eb31 -r ff9cf1fd8177 src/matchbox-keyboard.c
+--- a/src/matchbox-keyboard.c Sun Apr 08 23:28:43 2007 +0000
++++ b/src/matchbox-keyboard.c Sun Apr 08 23:56:09 2007 +0000
+@@ -85,6 +85,7 @@ mb_kbd_new (int argc, char **argv)
+
+ kb->selected_layout
+ = (MBKeyboardLayout *)util_list_get_nth_data(kb->layouts, 0);
++ kb->selected_layout_no = 0;
+
+ if (want_embedding)
+ mb_kbd_ui_set_embeded( kb->ui, True );
+diff -r 96305d94eb31 -r ff9cf1fd8177 src/matchbox-keyboard.h
+--- a/src/matchbox-keyboard.h Sun Apr 08 23:28:43 2007 +0000
++++ b/src/matchbox-keyboard.h Sun Apr 08 23:56:09 2007 +0000
+@@ -148,6 +148,7 @@ struct MBKeyboard
+
+ List *layouts;
+ MBKeyboardLayout *selected_layout;
++ int selected_layout_no;
+
+ int key_border, key_pad, key_margin;
+ int row_spacing, col_spacing;
+@@ -177,6 +178,9 @@ int
+ int
+ mb_kbd_ui_init(MBKeyboard *kbd);
+
++void
++mb_kbd_ui_recalc_ui_layout(MBKeyboardUI *ui);
++
+ int
+ mb_kbd_ui_realize(MBKeyboardUI *ui);
+