[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.7.0-20110116-8-g77b5bd3)
The branch, master has been updated
via 77b5bd3b9b49d907492aa3b20e3362f3fc4f6209 (commit)
via f4c86354333a8dfc0d5bca04532a9fb0efe7513f (commit)
via 0c46b10b3965054be0d2ad00a6659164b830a91b (commit)
via cf7da69276fe7626677cc843fbb7a916ed36e0e4 (commit)
from 23383c5d04f17d5fd7491f2c631bfc1e3f15e96f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
gschem/lib/system-gschemrc.scm | 7 +++----
gschem/scheme/gschem.scm | 26 ++++++++++++++++++++++++++
gschem/src/g_keys.c | 20 +++++++++++++-------
3 files changed, 42 insertions(+), 11 deletions(-)
=================
Commit Messages
=================
commit 77b5bd3b9b49d907492aa3b20e3362f3fc4f6209
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
gschem: Don't use "Select All" icon for "Deselect" action.
The wrong icon was set in commit cfed6e31d278.
:100644 100644 010162e... 65a8c3b... M gschem/lib/system-gschemrc.scm
commit f4c86354333a8dfc0d5bca04532a9fb0efe7513f
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
gschem: add keymapping for edit-deselect action
Deselect is now triggered by Ctrl+Shift+A shortcut.
Closes-bug: lp-699852
:100644 100644 95df6d7... 010162e... M gschem/lib/system-gschemrc.scm
commit 0c46b10b3965054be0d2ad00a6659164b830a91b
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
gschem: normalize key mappings defined in rc files
Add Scheme routines to normalize defind key mappings at gschem startup.
List of accel modifiers is sorted alphabetically to match ordering
implemented in g_keys_execute.
This allows the user can specify accelerators in any order.
Affects-bug: lp-699852
:100644 100644 fbe0bfd... f36ba46... M gschem/scheme/gschem.scm
commit cf7da69276fe7626677cc843fbb7a916ed36e0e4
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
gschem: support multiple key modifiers in c-code
Modify g_keys_execute() to support multiple keypress modifiers.
Modifiers are ordered alphabetically: Alt Control Shift.
Affects-bug: lp-699852
:100644 100644 f3d36c4... c0b2fde... M gschem/src/g_keys.c
=========
Changes
=========
commit 77b5bd3b9b49d907492aa3b20e3362f3fc4f6209
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
gschem: Don't use "Select All" icon for "Deselect" action.
The wrong icon was set in commit cfed6e31d278.
diff --git a/gschem/lib/system-gschemrc.scm b/gschem/lib/system-gschemrc.scm
index 010162e..65a8c3b 100644
--- a/gschem/lib/system-gschemrc.scm
+++ b/gschem/lib/system-gschemrc.scm
@@ -1406,7 +1406,7 @@
("SEPARATOR" #f #f #f)
(,(N_ "Select Mode") edit-select edit-select #f)
(,(N_ "Select All") edit-select-all edit-select-all "gtk-select-all")
- (,(N_ "Deselect") edit-deselect edit-deselect "gtk-select-all")
+ (,(N_ "Deselect") edit-deselect edit-deselect #f)
(,(N_ "Copy Mode") edit-copy edit-copy-hotkey #f)
(,(N_ "Multiple Copy Mode") edit-mcopy edit-mcopy-hotkey #f)
(,(N_ "Move Mode") edit-move edit-move-hotkey #f)
commit f4c86354333a8dfc0d5bca04532a9fb0efe7513f
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
gschem: add keymapping for edit-deselect action
Deselect is now triggered by Ctrl+Shift+A shortcut.
Closes-bug: lp-699852
diff --git a/gschem/lib/system-gschemrc.scm b/gschem/lib/system-gschemrc.scm
index 95df6d7..010162e 100644
--- a/gschem/lib/system-gschemrc.scm
+++ b/gschem/lib/system-gschemrc.scm
@@ -1151,8 +1151,6 @@
; - For Shift-A -- "Shift A"
; - For Control-a -- "Control a"
; - For Alt-a -- "Alt a"
-; - At this point in time you can only have one modifier
-; (shift, control, alt) at a time.
; - Keys must be unique in each keymap, especially the global one
; - Strings (without any modifers) are the same strings specified
; for the keys in the file /usr/lib/X11/XKeysymDB (at least on
@@ -1341,7 +1339,8 @@
("Control v" . clipboard-paste-hotkey)
("Control z" . edit-undo)
("Control y" . edit-redo)
- ("Control a" . edit-select-all)))
+ ("Control a" . edit-select-all)
+ ("Control Shift A" . edit-deselect)))
; finally set the keymap point to the newly created datastructure
(define current-keymap global-keymap)
commit 0c46b10b3965054be0d2ad00a6659164b830a91b
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
gschem: normalize key mappings defined in rc files
Add Scheme routines to normalize defind key mappings at gschem startup.
List of accel modifiers is sorted alphabetically to match ordering
implemented in g_keys_execute.
This allows the user can specify accelerators in any order.
Affects-bug: lp-699852
diff --git a/gschem/scheme/gschem.scm b/gschem/scheme/gschem.scm
index fbe0bfd..f36ba46 100644
--- a/gschem/scheme/gschem.scm
+++ b/gschem/scheme/gschem.scm
@@ -139,3 +139,29 @@
(cons (cons (cdr entry)
(string-join (reverse (cons key keys)) " "))
(loop (cdr keymap) keys))))))))
+
+;; Predicate to test if entry is keymap or action
+(define gschem:keymap? list?)
+
+;; Map over keymap tree, applying f to every node before descending
+(define (gschem:for-each-keymap f kmap)
+ (if (gschem:keymap? kmap)
+ (for-each
+ (lambda (kmap-entry)
+ (apply f (list kmap-entry))
+ (gschem:for-each-keymap f (eval-cm (cdr kmap-entry))))
+ kmap)))
+
+;; Sorting multiple key modifiers for unambiguos keymaps
+(define gschem:normalize-accel!
+ (lambda (kmap-entry)
+ (let* ((accel-list (reverse (string-split (car kmap-entry) #\space)))
+ (modifiers (cdr accel-list))
+ (key (car accel-list))
+ (sorted (sort modifiers string<?))
+ (appended (append sorted (list key)))
+ (joined (string-join appended " ")))
+ (set-car! kmap-entry joined))))
+
+;; Once at startup normalize the global keymap
+(gschem:for-each-keymap gschem:normalize-accel! global-keymap)
commit cf7da69276fe7626677cc843fbb7a916ed36e0e4
Author: Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@xxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
gschem: support multiple key modifiers in c-code
Modify g_keys_execute() to support multiple keypress modifiers.
Modifiers are ordered alphabetically: Alt Control Shift.
Affects-bug: lp-699852
diff --git a/gschem/src/g_keys.c b/gschem/src/g_keys.c
index f3d36c4..c0b2fde 100644
--- a/gschem/src/g_keys.c
+++ b/gschem/src/g_keys.c
@@ -49,6 +49,7 @@ int g_keys_execute(GSCHEM_TOPLEVEL *w_current, int state, int keyval)
char *guile_string = NULL;
char *modifier = NULL;
char *key_name = NULL;
+ char *mod_end = NULL;
SCM scm_retval;
if (keyval == 0) {
@@ -67,14 +68,19 @@ int g_keys_execute(GSCHEM_TOPLEVEL *w_current, int state, int keyval)
return 0;
}
+ /* Allocate space for concatenation of all strings below */
+ modifier = mod_end = g_strnfill(3*10, '\0');
+
+ /* The accels below must be in alphabetic order! */
+ if (state & GDK_MOD1_MASK) {
+ mod_end = g_stpcpy(mod_end, "Alt ");
+ }
+ if (state & GDK_CONTROL_MASK) {
+ mod_end = g_stpcpy(mod_end, "Control ");
+ }
if (state & GDK_SHIFT_MASK) {
- modifier = g_strdup_printf("Shift ");
- } else if (state & GDK_CONTROL_MASK) {
- modifier = g_strdup_printf("Control ");
- } else if (state & GDK_MOD1_MASK) {
- modifier = g_strdup_printf("Alt ");
- } else
- modifier = g_strdup("");
+ mod_end = g_stpcpy(mod_end, "Shift ");
+ }
if(strcmp(key_name, "Escape") == 0) {
g_free(w_current->keyaccel_string);
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs