- added missing actions (sorry)
[enigma2.git] / lib / base / ebase.h
index b929cb6d8516a7418e2f7f842010b2debd229dd9..d9a17b79881cf7714775f883cbaafe96f2a6dc6a 100644 (file)
@@ -9,6 +9,7 @@
 #include <time.h>
 
 #include <lib/base/eptrlist.h>
+#include <lib/python/connections.h>
 #include <libsig_comp.h>
 
 class eApplication;
@@ -158,7 +159,7 @@ public:
        eSocketNotifier(eMainloop *context, int fd, int req, bool startnow=true);
        ~eSocketNotifier();
 
-       Signal1<void, int> activated;
+       PSignal1<void, int> activated;
        void activate(int what) { /*emit*/ activated(what); }
 
        void start();
@@ -170,40 +171,7 @@ public:
        void setRequested(int req) { requested=req; }
 };
 
-                               // ... und Timer
-/**
- * \brief Gives a callback after a specified timeout.
- *
- * This class emits the signal \c eTimer::timeout after the specified timeout.
- */
-class eTimer
-{
-       eMainloop &context;
-       timeval nextActivation;
-       long interval;
-       bool bSingleShot;
-       bool bActive;
-public:
-       /**
-        * \brief Constructs a timer.
-        *
-        * The timer is not yet active, it has to be started with \c start.
-        * \param context The thread from which the signal should be emitted.
-        */
-       eTimer(eMainloop *context): context(*context), bActive(false) { }
-       ~eTimer()       { if (bActive) stop(); }
-
-       Signal0<void> timeout;
-       void activate();
-
-       bool isActive() { return bActive; }
-       timeval &getNextActivation() { return nextActivation; }
-
-       void start(long msec, bool singleShot=false);
-       void stop();
-       void changeInterval(long msek);
-       bool operator<(const eTimer& t) const   {               return nextActivation < t.nextActivation;               }
-};
+class eTimer;
 
                        // werden in einer mainloop verarbeitet
 class eMainloop
@@ -230,6 +198,7 @@ public:
        void exit_loop();
 };
 
+
 /**
  * \brief The application class.
  *
@@ -249,4 +218,40 @@ public:
                eApp = 0;
        }
 };
+
+                               // ... und Timer
+/**
+ * \brief Gives a callback after a specified timeout.
+ *
+ * This class emits the signal \c eTimer::timeout after the specified timeout.
+ */
+class eTimer
+{
+       eMainloop &context;
+       timeval nextActivation;
+       long interval;
+       bool bSingleShot;
+       bool bActive;
+public:
+       /**
+        * \brief Constructs a timer.
+        *
+        * The timer is not yet active, it has to be started with \c start.
+        * \param context The thread from which the signal should be emitted.
+        */
+       eTimer(eMainloop *context = eApp): context(*context), bActive(false) { }
+       ~eTimer()       { if (bActive) stop(); }
+
+       PSignal0<void> timeout;
+       void activate();
+
+       bool isActive() { return bActive; }
+       timeval &getNextActivation() { return nextActivation; }
+
+       void start(long msec, bool singleShot=false);
+       void stop();
+       void changeInterval(long msek);
+       bool operator<(const eTimer& t) const   {               return nextActivation < t.nextActivation;               }
+};
+
 #endif