gnome-commander r1691 - in trunk: . doc doc/C src
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r1691 - in trunk: . doc doc/C src
- Date: Mon, 7 Apr 2008 21:04:44 +0100 (BST)
Author: epiotr
Date: Mon Apr 7 21:04:43 2008
New Revision: 1691
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1691&view=rev
Log:
Support for <super>, <hyper> and <meta> modifiers (since GTK+ 2.10)
Modified:
trunk/ChangeLog
trunk/NEWS
trunk/configure.in
trunk/doc/C/gnome-commander.xml
trunk/doc/ChangeLog
trunk/src/eggcellrendererkeys.cc
trunk/src/gnome-cmd-data.cc
trunk/src/gnome-cmd-user-actions.cc
trunk/src/gnome-cmd-user-actions.h
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Mon Apr 7 21:04:43 2008
@@ -12,6 +12,7 @@
* GUI for keyboard shortcuts management
* Multi-Rename-Tool - new $x and $X placeholders for random hexadecimal numbers
* Revamped search dialog
+ * Support for <super>, <hyper> and <meta> modifiers (since GTK+ 2.10)
* Updated help docs
* New or updated translations: en_GB, es, eu, fi, oc, pl
* New key bindings:
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Mon Apr 7 21:04:43 2008
@@ -118,6 +118,10 @@
else
AC_MSG_ERROR("only ${GTK_VERSION} found")
fi
+
+ if pkg-config --exists gtk+-2.0 '>=' 2.10.0 ; then
+ AC_DEFINE(HAVE_GTK_2_10, 1, [Define to 1 if you have GTK+ >= 2.10])
+ fi
else
AC_MSG_ERROR(no)
fi
Modified: trunk/doc/C/gnome-commander.xml
==============================================================================
--- trunk/doc/C/gnome-commander.xml (original)
+++ trunk/doc/C/gnome-commander.xml Mon Apr 7 21:04:43 2008
@@ -4309,7 +4309,7 @@
(<term><guilabel>~/.gnome2/gnome-commander</guilabel></term>).</para>
<para>Config file syntax:</para>
<para>
- <command>[<shift>][<control>][<alt>][<win>]key_name=action[|options]</command>
+ <command>[<shift>][<control>][<alt>][<super>][<hyper>][<meta>]key_name=action[|options]</command>
</para>
<para>eg.</para>
<programlisting>
@@ -4317,13 +4317,16 @@
<ctrl>t=file.advrename
<shift><ctrl>f5=file.create_symlink
<ctrl>2=file.diff
- <win>f=edit.search
+ <super>f=edit.search
</programlisting>
<tip>
<para>It's possible to assign one action to more than one key.</para>
</tip>
<para>The shortcuts are read at start-up only, so you have to reload application to see the changes.</para>
<para>Entries containing invalid key or user action are reported in console during start-up and then ignored by &app;.</para>
+ <note>
+ <para><hyper> and <meta> modifiers are supported since GTK+ 2.10.</para>
+ </note>
</sect2>
<sect2 id="gnome-commander-user-actions-list">
<title>List of user actions</title>
@@ -5844,6 +5847,9 @@
<para>Revamped search dialog</para>
</listitem>
<listitem>
+ <para>Support for <super>, <hyper> and <meta> modifiers (since GTK+ 2.10)</para>
+ </listitem>
+ <listitem>
<para>Updated help docs</para>
</listitem>
<listitem>
Modified: trunk/src/eggcellrendererkeys.cc
==============================================================================
--- trunk/src/eggcellrendererkeys.cc (original)
+++ trunk/src/eggcellrendererkeys.cc Mon Apr 7 21:04:43 2008
@@ -264,12 +264,14 @@
l += sizeof(text_mod4)-1;
if (accel_mods & GDK_MOD5_MASK)
l += sizeof(text_mod5)-1;
+#ifdef HAVE_GTK_2_10
if (accel_mods & GDK_META_MASK)
l += sizeof(text_meta)-1;
if (accel_mods & GDK_HYPER_MASK)
l += sizeof(text_hyper)-1;
if (accel_mods & GDK_SUPER_MASK)
l += sizeof(text_super)-1;
+#endif
gchar *accelerator = g_new (gchar, l+1);
gchar *s = accelerator;
@@ -309,6 +311,7 @@
strcpy (s, text_mod5);
s += sizeof(text_mod5)-1;
}
+#ifdef HAVE_GTK_2_10
if (accel_mods & GDK_META_MASK)
{
strcpy (s, text_meta);
@@ -324,6 +327,7 @@
strcpy (s, text_super);
s += sizeof(text_super)-1;
}
+#endif
strcpy (s, keyval_name);
@@ -456,13 +460,17 @@
accel_key = GDK_Tab;
+#ifdef HAVE_GTK_2_10
accel_mods = event->state & gtk_accelerator_get_default_mod_mask ();
+#else
+ accel_mods = event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK | GDK_MOD4_MASK);
+#endif
// filter consumed modifiers
if (keys->accel_mode == GTK_CELL_RENDERER_ACCEL_MODE_GTK)
accel_mods &= ~consumed_modifiers;
- // Put shift back if it changed the case of the key, not otherwise.
+ // put shift back if it changed the case of the key, not otherwise.
if (accel_key != event->keyval)
accel_mods |= GDK_SHIFT_MASK;
Modified: trunk/src/gnome-cmd-data.cc
==============================================================================
--- trunk/src/gnome-cmd-data.cc (original)
+++ trunk/src/gnome-cmd-data.cc Mon Apr 7 21:04:43 2008
@@ -1737,8 +1737,16 @@
{GDK_SHIFT_MASK, "<shift>"},
{GDK_CONTROL_MASK, "<control>"},
{GDK_MOD1_MASK, "<alt>"},
- {GDK_MOD4_MASK, "<win>"},
+#ifdef HAVE_GTK_2_10
+ {GDK_SUPER_MASK, "<super>"},
+ {GDK_SUPER_MASK, "<win>"},
+ {GDK_SUPER_MASK, "<mod4>"},
+ {GDK_HYPER_MASK, "<hyper>"},
+ {GDK_META_MASK, "<meta>"},
+#endif
{GDK_MOD1_MASK, "<mod1>"},
+ {GDK_MOD4_MASK, "<super>"},
+ {GDK_MOD4_MASK, "<win>"},
{GDK_MOD4_MASK, "<mod4>"}
};
Modified: trunk/src/gnome-cmd-user-actions.cc
==============================================================================
--- trunk/src/gnome-cmd-user-actions.cc (original)
+++ trunk/src/gnome-cmd-user-actions.cc Mon Apr 7 21:04:43 2008
@@ -108,7 +108,11 @@
if (e1.keyval > e2.keyval)
return false;
+#ifdef HAVE_GTK_2_10
+ return (e1.state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK | GDK_META_MASK)) < (e2.state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK | GDK_META_MASK));
+#else
return (e1.state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_MOD4_MASK)) < (e2.state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_MOD4_MASK));
+#endif
}
@@ -429,8 +433,11 @@
GdkEventKey event;
event.keyval = keyval;
+#ifdef HAVE_GTK_2_10
+ event.state = state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK | GDK_META_MASK);
+#else
event.state = state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_MOD4_MASK);
-
+#endif
if (action.find(event)!=action.end())
return FALSE;
@@ -458,8 +465,11 @@
GdkEventKey event;
event.keyval = keyval;
+#ifdef HAVE_GTK_2_10
+ event.state = state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK | GDK_META_MASK);
+#else
event.state = state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_MOD4_MASK);
-
+#endif
map <GdkEventKey, UserAction>::iterator pos = action.find(event);
if (pos!=action.end())
@@ -487,7 +497,11 @@
GdkEventKey event;
event.keyval = keyval;
+#ifdef HAVE_GTK_2_10
+ event.state = state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK | GDK_META_MASK);
+#else
event.state = state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_MOD4_MASK);
+#endif
return action.find(event)!=action.end();
}
Modified: trunk/src/gnome-cmd-user-actions.h
==============================================================================
--- trunk/src/gnome-cmd-user-actions.h (original)
+++ trunk/src/gnome-cmd-user-actions.h Mon Apr 7 21:04:43 2008
@@ -63,7 +63,13 @@
if (state & GDK_SHIFT_MASK) key_name += gdk_modifiers_names[GDK_SHIFT_MASK];
if (state & GDK_CONTROL_MASK) key_name += gdk_modifiers_names[GDK_CONTROL_MASK];
if (state & GDK_MOD1_MASK) key_name += gdk_modifiers_names[GDK_MOD1_MASK];
+#ifdef HAVE_GTK_2_10
+ if (state & GDK_SUPER_MASK) key_name += gdk_modifiers_names[GDK_SUPER_MASK];
+ if (state & GDK_HYPER_MASK) key_name += gdk_modifiers_names[GDK_HYPER_MASK];
+ if (state & GDK_META_MASK) key_name += gdk_modifiers_names[GDK_META_MASK];
+#else
if (state & GDK_MOD4_MASK) key_name += gdk_modifiers_names[GDK_MOD4_MASK];
+#endif
if (ascii_isalnum (key_val))
key_name += g_ascii_tolower (key_val);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]