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);
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, PyObject *function);
33 void unbindAction(const std::string &context, PyObject *function);
35 void bindKey(const std::string &device, int key, int flags, const std::string &context, const std::string &action);
37 void keyPressed(int device, int key, int flags);
39 static RESULT getInstance(ePtr<eActionMap> &ptr);
42 static eActionMap *instance;
45 // eActionContext *m_context;
46 std::string m_context; // FIXME
54 std::multimap<int, eActionBinding> m_bindings;
56 friend struct compare_string_keybind_native;
57 struct eNativeKeyBinding
63 // eActionContext *m_context;
67 std::multimap<std::string, eNativeKeyBinding> m_native_keys;
69 friend struct compare_string_keybind_python;
70 struct ePythonKeyBinding
79 std::multimap<std::string, ePythonKeyBinding> m_python_keys;