set subtitle-sink gstreamer caps (fixed #506, requires gst-plugin-playbin_0.10.28...
[enigma2.git] / lib / actions / action.h
index e43e48a74e64488fd5f12185791058555d86c0b1..cbf5370a4ead2e6b40c75ea6a9e942f4cf21aa6f 100644 (file)
@@ -7,16 +7,16 @@
 #include <features.h>
 #undef _POSIX_C_SOURCE
 #define _POSIX_C_SOURCE 200112L
-#include <Python.h>
 #include <lib/python/python.h>
 #include <string>
 #include <map>
 
 class eWidget;
 
+SWIG_IGNORE(eActionMap);
 class eActionMap: public iObject
 {
-DECLARE_REF(eActionMap);
+       DECLARE_REF(eActionMap);
 #ifdef SWIG
        eActionMap();
        ~eActionMap();
@@ -29,26 +29,32 @@ public:
        void unbindAction(eWidget *widget, int id);
 #endif
 
-       void bindAction(const std::string &context, int priority, PyObject *function);
-       void unbindAction(const std::string &context, PyObject *function);
-       
-       void bindKey(const std::string &device, int key, int flags, const std::string &context, const std::string &action);
+       void bindAction(const std::string &context, int priority, SWIG_PYOBJECT(ePyObject) function);
+       void unbindAction(const std::string &context, SWIG_PYOBJECT(ePyObject) function);
+
+       void bindKey(const std::string &domain, const std::string &device, int key, int flags, const std::string &context, const std::string &action);
+       void unbindKeyDomain(const std::string &domain);
        
-       void keyPressed(int device, int key, int flags);
+       void keyPressed(const std::string &device, int key, int flags);
        
-       static RESULT getInstance(ePtr<eActionMap> &ptr);
 #ifndef SWIG
+       static RESULT getInstance(ePtr<eActionMap> &);
 private:
        static eActionMap *instance;
        struct eActionBinding
        {
+               eActionBinding()
+                       :m_prev_seen_make_key(-1)
+               {}
 //             eActionContext *m_context;
                std::string m_context; // FIXME
+               std::string m_domain;
                
-               PyObject *m_fnc;
+               ePyObject m_fnc;
                
                eWidget *m_widget;
                int m_id;
+               int m_prev_seen_make_key;
        };
        
        std::multimap<int, eActionBinding> m_bindings;
@@ -56,7 +62,8 @@ private:
        friend struct compare_string_keybind_native;
        struct eNativeKeyBinding
        {
-               int m_device;
+               std::string m_device;
+               std::string m_domain;
                int m_key;
                int m_flags;
                
@@ -69,7 +76,8 @@ private:
        friend struct compare_string_keybind_python;
        struct ePythonKeyBinding
        {
-               int m_device;
+               std::string m_device;
+               std::string m_domain;
                int m_key;
                int m_flags;
                
@@ -79,5 +87,13 @@ private:
        std::multimap<std::string, ePythonKeyBinding> m_python_keys;
 #endif
 };
+SWIG_TEMPLATE_TYPEDEF(ePtr<eActionMap>, eActionMap);
+SWIG_EXTEND(ePtr<eActionMap>,
+       static ePtr<eActionMap> getInstance()
+       {
+               extern ePtr<eActionMap> NewActionMapPtr(void);
+               return NewActionMapPtr();
+       }
+);
 
 #endif