gnome-commander r1641 - in trunk: . src
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r1641 - in trunk: . src
- Date: Thu, 13 Mar 2008 17:20:54 +0000 (GMT)
Author: epiotr
Date: Thu Mar 13 17:20:54 2008
New Revision: 1641
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1641&view=rev
Log:
Added GnomeCmdUserActions iterators for accessing registered GdkEventKeys
Modified:
trunk/ChangeLog
trunk/src/gnome-cmd-user-actions.cc
trunk/src/gnome-cmd-user-actions.h
Modified: trunk/src/gnome-cmd-user-actions.cc
==============================================================================
--- trunk/src/gnome-cmd-user-actions.cc (original)
+++ trunk/src/gnome-cmd-user-actions.cc Thu Mar 13 17:20:54 2008
@@ -400,7 +400,7 @@
g_free (action_name);
}
- for (map<GdkEventKey, UserAction>::const_iterator i=action.begin(); i!=action.end(); ++i)
+ for (ACTIONS_COLL::const_iterator i=action.begin(); i!=action.end(); ++i)
{
string path = section_path + key2str(i->first);
@@ -472,7 +472,7 @@
if (!func)
return FALSE;
- for (map<GdkEventKey, UserAction>::const_iterator i=action.begin(); i!=action.end(); ++i)
+ for (ACTIONS_COLL::const_iterator i=action.begin(); i!=action.end(); ++i)
if (i->second.func==func)
return TRUE;
Modified: trunk/src/gnome-cmd-user-actions.h
==============================================================================
--- trunk/src/gnome-cmd-user-actions.h (original)
+++ trunk/src/gnome-cmd-user-actions.h Thu Mar 13 17:20:54 2008
@@ -53,7 +53,10 @@
static DICT<GnomeCmdUserActionFunc> action_func;
static DICT<GnomeCmdUserActionFunc> action_name;
- std::map <GdkEventKey, UserAction> action;
+ typedef std::map<GdkEventKey, UserAction> ACTIONS_COLL;
+
+ ACTIONS_COLL action;
+
public:
@@ -83,6 +86,21 @@
GdkEventKey str2key(gchar *s, guint &state, guint &key_val);
GdkEventKey str2key(gchar *s, GdkEventKey &event) { return str2key(s, event.state, event.keyval); }
GdkEventKey str2key(gchar *s);
+
+ public:
+
+ struct const_iterator: ACTIONS_COLL::iterator
+ {
+ const_iterator (const ACTIONS_COLL::iterator &i): ACTIONS_COLL::iterator(i) {}
+
+ const ACTIONS_COLL::key_type &operator * () const { return (ACTIONS_COLL::iterator::operator * ()).first; }
+ };
+
+ const_iterator begin() { return action.begin(); }
+ const_iterator end() { return action.end(); }
+
+ const gchar *description(const_iterator &i) { return _(action_name[i->second.func].c_str()); }
+ const gchar *options(const_iterator &i) { return i->second.user_data.c_str(); }
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]