remove unneeded test object,
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 19 Dec 2006 15:41:53 +0000 (15:41 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Tue, 19 Dec 2006 15:41:53 +0000 (15:41 +0000)
export windowstyle enums to python

lib/gui/ewindowstyle.h
lib/python/enigma_python.i
lib/python/python.cpp
lib/python/python.h

index 91f2f0b..a2a9e67 100644 (file)
@@ -7,22 +7,13 @@ class gFont;
 
 #include <lib/base/object.h>
 
 
 #include <lib/base/object.h>
 
-SWIG_IGNORE(eWindowStyle);
-class eWindowStyle: public iObject
+class eWindowStyle_ENUMS
 {
 #ifdef SWIG
 {
 #ifdef SWIG
-       eWindowStyle();
+       eWindowStyle_ENUMS();
+       ~eWindowStyle_ENUMS();
 #endif
 public:
 #endif
 public:
-#ifndef SWIG
-       virtual void handleNewSize(eWindow *wnd, eSize &size, eSize &offset) = 0;
-       virtual void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title) = 0;
-       virtual void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size) = 0;
-       virtual void setStyle(gPainter &painter, int what) = 0;
-       virtual void drawFrame(gPainter &painter, const eRect &frame, int type) = 0;
-       virtual RESULT getFont(int what, ePtr<gFont> &font) = 0;
-#endif
-       virtual ~eWindowStyle() = 0;
        enum {
                styleLabel,
                styleListboxSelected,
        enum {
                styleLabel,
                styleListboxSelected,
@@ -30,18 +21,36 @@ public:
                styleListboxMarked,
                styleListboxMarkedAndSelected
        };
                styleListboxMarked,
                styleListboxMarkedAndSelected
        };
-       
+
        enum {
                frameButton,
                frameListboxEntry
        };
        enum {
                frameButton,
                frameListboxEntry
        };
-       
+
        enum {
                fontStatic,
                fontButton,
                fontTitlebar
        };
 };
        enum {
                fontStatic,
                fontButton,
                fontTitlebar
        };
 };
+
+SWIG_IGNORE(eWindowStyle);
+class eWindowStyle: public eWindowStyle_ENUMS, public iObject
+{
+#ifdef SWIG
+       eWindowStyle();
+#endif
+public:
+#ifndef SWIG
+       virtual void handleNewSize(eWindow *wnd, eSize &size, eSize &offset) = 0;
+       virtual void paintWindowDecoration(eWindow *wnd, gPainter &painter, const std::string &title) = 0;
+       virtual void paintBackground(gPainter &painter, const ePoint &offset, const eSize &size) = 0;
+       virtual void setStyle(gPainter &painter, int what) = 0;
+       virtual void drawFrame(gPainter &painter, const eRect &frame, int type) = 0;
+       virtual RESULT getFont(int what, ePtr<gFont> &font) = 0;
+#endif
+       virtual ~eWindowStyle() = 0;
+};
 SWIG_TEMPLATE_TYPEDEF(ePtr<eWindowStyle>, eWindowStylePtr);
 
 SWIG_IGNORE(eWindowStyleManager);
 SWIG_TEMPLATE_TYPEDEF(ePtr<eWindowStyle>, eWindowStylePtr);
 
 SWIG_IGNORE(eWindowStyleManager);
@@ -56,10 +65,10 @@ public:
 #ifndef SWIG
        eWindowStyleManager();
        ~eWindowStyleManager();
 #ifndef SWIG
        eWindowStyleManager();
        ~eWindowStyleManager();
+       static SWIG_VOID(int) getInstance(ePtr<eWindowStyleManager> &SWIG_NAMED_OUTPUT(mgr)) { mgr = m_instance; if (!mgr) return -1; return 0; }
 #endif
        void getStyle(int style_id, ePtr<eWindowStyle> &SWIG_OUTPUT);
        void setStyle(int style_id, eWindowStyle *style);
 #endif
        void getStyle(int style_id, ePtr<eWindowStyle> &SWIG_OUTPUT);
        void setStyle(int style_id, eWindowStyle *style);
-       static SWIG_VOID(int) getInstance(ePtr<eWindowStyleManager> &SWIG_NAMED_OUTPUT(mgr)) { mgr = m_instance; if (!mgr) return -1; return 0; }
 private:
        static eWindowStyleManager *m_instance;
        std::map<int, ePtr<eWindowStyle> > m_current_style;
 private:
        static eWindowStyleManager *m_instance;
        std::map<int, ePtr<eWindowStyle> > m_current_style;
index 1debfee..6c2ece3 100644 (file)
@@ -262,11 +262,6 @@ RESULT SwigFromPython(ePtr<gPixmap> &result, PyObject *obj)
        result = *res;
        return 0;
 }
        result = *res;
        return 0;
 }
-PyObject *New_TestObj()
-{
-    TestObj *result = (TestObj *)new TestObj();
-    return SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_TestObj, 1);
-}
 PyObject *New_eServiceReference(const eServiceReference &ref)
 {
     eServiceReference *result = new eServiceReference(ref);
 PyObject *New_eServiceReference(const eServiceReference &ref)
 {
     eServiceReference *result = new eServiceReference(ref);
index 8947bb3..b5a7abb 100644 (file)
@@ -114,18 +114,6 @@ void ePyObject::decref(const char *file, int line)
 #include <lib/python/python.h>
 #undef SKIP_PART1
 
 #include <lib/python/python.h>
 #undef SKIP_PART1
 
-DEFINE_REF(TestObj);
-
-TestObj::TestObj()
-{
-       eDebug("create %p", this);
-}
-
-TestObj::~TestObj()
-{
-       eDebug("destroy %p", this);
-}
-
 ePython::ePython()
 {
 //     Py_VerboseFlag = 1;
 ePython::ePython()
 {
 //     Py_VerboseFlag = 1;
index 76d2d19..f5f793f 100644 (file)
@@ -149,18 +149,7 @@ inline void ePyObject::decref()
 #endif  // !SWIG && !SKIP_PART1
 
 #ifndef SKIP_PART2
 #endif  // !SWIG && !SKIP_PART1
 
 #ifndef SKIP_PART2
-
-class TestObj
-{
-DECLARE_REF(TestObj);
-public:
-       TestObj();
-       ~TestObj();
-};
-SWIG_TEMPLATE_TYPEDEF(ePtr<TestObj>, TestObjPtr);
-
 #ifndef SWIG
 #ifndef SWIG
-extern PyObject *New_TestObj();
 #ifdef PYTHON_REFCOUNT_DEBUG
 inline void Impl_Py_DECREF(const char* file, int line, const ePyObject &obj)
 {
 #ifdef PYTHON_REFCOUNT_DEBUG
 inline void Impl_Py_DECREF(const char* file, int line, const ePyObject &obj)
 {
@@ -233,11 +222,6 @@ inline ePyObject Impl_PyLong_FromLongLong(const char* file, int line, long long
        return ePyObject(PyLong_FromLongLong(val), file, line);
 }
 
        return ePyObject(PyLong_FromLongLong(val), file, line);
 }
 
-inline ePyObject Impl_New_TestObj(const char* file, int line)
-{
-       return ePyObject(New_TestObj(), file, line);
-}
-
 inline ePyObject Impl_PyList_GET_ITEM(const char *file, int line, ePyObject list, unsigned int pos)
 {
        return ePyObject(PyList_GET_ITEM(list, pos), file, line);
 inline ePyObject Impl_PyList_GET_ITEM(const char *file, int line, ePyObject list, unsigned int pos)
 {
        return ePyObject(PyList_GET_ITEM(list, pos), file, line);
@@ -319,11 +303,6 @@ inline ePyObject Impl_PyLong_FromLongLong(long long val)
        return PyLong_FromLongLong(val);
 }
 
        return PyLong_FromLongLong(val);
 }
 
-inline ePyObject Impl_New_TestObj()
-{
-       return New_TestObj();
-}
-
 inline ePyObject Impl_PyList_GET_ITEM(ePyObject list, unsigned int pos)
 {
        return PyList_GET_ITEM(list, pos);
 inline ePyObject Impl_PyList_GET_ITEM(ePyObject list, unsigned int pos)
 {
        return PyList_GET_ITEM(list, pos);
@@ -360,7 +339,6 @@ inline void Impl_DECREF(PyObject *ob)
 #define PyLong_FromLong(val) Impl_PyLong_FromLong(__FILE__, __LINE__, val)
 #define PyLong_FromUnsignedLong(val) Impl_PyLong_FromUnsignedLong(__FILE__, __LINE__, val)
 #define PyLong_FromLongLong(val) Impl_PyLong_FromLongLong(__FILE__, __LINE__, val)
 #define PyLong_FromLong(val) Impl_PyLong_FromLong(__FILE__, __LINE__, val)
 #define PyLong_FromUnsignedLong(val) Impl_PyLong_FromUnsignedLong(__FILE__, __LINE__, val)
 #define PyLong_FromLongLong(val) Impl_PyLong_FromLongLong(__FILE__, __LINE__, val)
-#define NEW_TestObj(...) Impl_New_TestObj(__FILE__, __LINE__)
 #define PyList_GET_ITEM(list, pos) Impl_PyList_GET_ITEM(__FILE__, __LINE__, list, pos)
 #define PyTuple_GET_ITEM(list, pos) Impl_PyTuple_GET_ITEM(__FILE__, __LINE__, list, pos)
 #else
 #define PyList_GET_ITEM(list, pos) Impl_PyList_GET_ITEM(__FILE__, __LINE__, list, pos)
 #define PyTuple_GET_ITEM(list, pos) Impl_PyTuple_GET_ITEM(__FILE__, __LINE__, list, pos)
 #else
@@ -377,7 +355,6 @@ inline void Impl_DECREF(PyObject *ob)
 #define PyLong_FromLong(val) Impl_PyLong_FromLong(val)
 #define PyLong_FromUnsignedLong(val) Impl_PyLong_FromUnsignedLong(val)
 #define PyLong_FromLongLong(val) Impl_PyLong_FromLongLong(val)
 #define PyLong_FromLong(val) Impl_PyLong_FromLong(val)
 #define PyLong_FromUnsignedLong(val) Impl_PyLong_FromUnsignedLong(val)
 #define PyLong_FromLongLong(val) Impl_PyLong_FromLongLong(val)
-#define NEW_TestObj(...) Impl_New_TestObj()
 #define PyList_GET_ITEM(list, pos) Impl_PyList_GET_ITEM(list, pos)
 #define PyTuple_GET_ITEM(list, pos) Impl_PyTuple_GET_ITEM(list, pos)
 #endif
 #define PyList_GET_ITEM(list, pos) Impl_PyList_GET_ITEM(list, pos)
 #define PyTuple_GET_ITEM(list, pos) Impl_PyTuple_GET_ITEM(list, pos)
 #endif