1 #ifndef __lib_driver_action_h
2 #define __lib_driver_action_h
4 #include <lib/base/object.h>
9 #define _POSIX_C_SOURCE 200112L
11 #include <lib/python/python.h>
17 class eActionMap: public iObject
19 DECLARE_REF(eActionMap);
24 void bindAction(const std::string &context, int priority, int id, eWidget *widget);
25 void unbindAction(eWidget *widget, int id);
28 void bindAction(const std::string &context, int priority, PyObject *function);
29 void unbindAction(const std::string &context, PyObject *function);
31 void bindKey(const std::string &device, int key, int flags, const std::string &context, const std::string &action);
33 void keyPressed(int device, int key, int flags);
35 static RESULT getInstance(ePtr<eActionMap> &ptr);
38 static eActionMap *instance;
41 // eActionContext *m_context;
42 std::string m_context; // FIXME
50 std::multimap<int, eActionBinding> m_bindings;
52 friend struct compare_string_keybind_native;
53 struct eNativeKeyBinding
59 // eActionContext *m_context;
63 std::multimap<std::string, eNativeKeyBinding> m_native_keys;
65 friend struct compare_string_keybind_python;
66 struct ePythonKeyBinding
75 std::multimap<std::string, ePythonKeyBinding> m_python_keys;