- default fonts handled in windowstyle
[enigma2.git] / lib / python / enigma_python.i
index ae15d0d9b451e00ca9d67a1fa87b1f922a897675..59133cc57ca84f90c28fdd842d05d6356fcb8d98 100644 (file)
 
 
 Oh, things like "operator= is private in this context" etc.
-is usually caused by not marking PSignals as immutable.
-
+is usually caused by not marking PSignals as immutable. 
 */
 
-%define RefCount(...)
-%typemap(newfree) __VA_ARGS__ * { eDebug("adding ref"); $1->AddRef(); }
-%extend __VA_ARGS__  { ~__VA_ARGS__() { eDebug("removing ref!"); self->Release(); } }
-%ignore __VA_ARGS__::~__VA_ARGS__();
-%enddef
-
 %module enigma
 %{
+
 #define SWIG_COMPILE
 #include <lib/base/ebase.h>
 #include <lib/base/smartptr.h>
@@ -48,25 +42,37 @@ is usually caused by not marking PSignals as immutable.
 #include <lib/base/econfig.h>
 #include <lib/service/iservice.h>
 #include <lib/service/service.h>
+#include <lib/service/event.h>
 
 #include <lib/gui/ewidget.h>
 #include <lib/gui/elabel.h>
 #include <lib/gui/ebutton.h>
 #include <lib/gui/ewindow.h>
 #include <lib/gui/ewidgetdesktop.h>
+#include <lib/gui/ewindowstyle.h>
 #include <lib/gui/eslider.h>
 #include <lib/python/connections.h>
 #include <lib/gui/elistbox.h>
 #include <lib/gui/elistboxcontent.h>
+#include <lib/service/listboxservice.h>
+#include <lib/components/scan.h>
+#include <lib/nav/pcore.h>
+#include <lib/actions/action.h>
+#include <lib/gdi/gfont.h>
 
 extern void runMainloop();
+extern void quitMainloop();
 
 extern PSignal1<void,int> &keyPressedSignal();
 %}
 
-RefCount(eListboxPythonStringContent)
+%feature("ref")   iObject "$this->AddRef(); eDebug(\"AddRef (%s:%d)!\", __FILE__, __LINE__); "
+%feature("unref") iObject "$this->Release(); eDebug(\"Release! %s:%d\", __FILE__, __LINE__); "
+
+%newobject eDebugClassPtr::operator->;
 
 #define DEBUG
+%include "typemaps.i"
 %include "stl.i"
 %include <lib/base/object.h>
 %include <lib/base/eerror.h>
@@ -74,9 +80,15 @@ RefCount(eListboxPythonStringContent)
 %include <lib/base/smartptr.h>
 %include <lib/service/iservice.h>
 %include <lib/service/service.h>
+
 %template(eServiceCenterPtr) ePtr<eServiceCenter>;
+%include <lib/service/event.h>
 
+
+// TODO: embed these...
 %immutable eButton::selected;
+%immutable eComponentScan::statusChanged;
+%immutable pNavigation::m_event;
 
 %include <lib/gdi/epoint.h>
 %include <lib/gdi/erect.h>
@@ -90,6 +102,20 @@ RefCount(eListboxPythonStringContent)
 %include <lib/gui/ewidgetdesktop.h>
 %include <lib/gui/elistbox.h>
 %include <lib/gui/elistboxcontent.h>
+%include <lib/gui/ewindowstyle.h>
+%include <lib/service/listboxservice.h>
+%include <lib/components/scan.h>
+%include <lib/nav/pcore.h>
+%include <lib/actions/action.h>
+%include <lib/gdi/gfont.h>
+
+/**************  eptr  **************/
+
+%template(eActionMapPtr) ePtr<eActionMap>;
+%apply eActionMapPtr OUTPUT { eActionMapPtr &ptr }
+%apply eActionMap* *OUTPUT { eActionMap **ptr }
+
+/**************  signals  **************/
 
 template<class R> class PSignal0
 {
@@ -140,5 +166,7 @@ public:
 /**************  debug  **************/
 
 void runMainloop();
+void quitMainloop();
 %immutable keyPressed;
 PSignal1<void,int> &keyPressedSignal();
+