1 #ifndef __lib_driver_action_h
2 #define __lib_driver_action_h
4 #include <lib/base/object.h>
9 #define _POSIX_C_SOURCE 200112L
10 #include <lib/python/python.h>
16 SWIG_IGNORE(eActionMap);
17 class eActionMap: public iObject
19 DECLARE_REF(eActionMap);
28 void bindAction(const std::string &context, int priority, int id, eWidget *widget);
29 void unbindAction(eWidget *widget, int id);
32 void bindAction(const std::string &context, int priority, SWIG_PYOBJECT(ePyObject) function);
33 void unbindAction(const std::string &context, SWIG_PYOBJECT(ePyObject) function);
35 void bindKey(const std::string &domain, const std::string &device, int key, int flags, const std::string &context, const std::string &action);
36 void unbindKeyDomain(const std::string &domain);
38 void keyPressed(const std::string &device, int key, int flags);
41 static RESULT getInstance(ePtr<eActionMap> &);
43 static eActionMap *instance;
47 :m_prev_seen_make_key(-1)
49 // eActionContext *m_context;
50 std::string m_context; // FIXME
57 int m_prev_seen_make_key;
60 std::multimap<int, eActionBinding> m_bindings;
62 friend struct compare_string_keybind_native;
63 struct eNativeKeyBinding
70 // eActionContext *m_context;
74 std::multimap<std::string, eNativeKeyBinding> m_native_keys;
76 friend struct compare_string_keybind_python;
77 struct ePythonKeyBinding
87 std::multimap<std::string, ePythonKeyBinding> m_python_keys;
90 SWIG_TEMPLATE_TYPEDEF(ePtr<eActionMap>, eActionMap);
91 SWIG_EXTEND(ePtr<eActionMap>,
92 static ePtr<eActionMap> getInstance()
94 extern ePtr<eActionMap> NewActionMapPtr(void);
95 return NewActionMapPtr();