summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2010-11-20 10:07:46 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2010-11-20 10:07:46 +0800
commitd31d55fa24835dde6c4949adf223dc83ab4c2b6f (patch)
tree6eb886da06217529c4f371426767899e1e83890e /include
parentc26f860f5e70c20e32a6b2e7b9c611c4f288f89e (diff)
downloadmobileperf-d31d55fa24835dde6c4949adf223dc83ab4c2b6f.tar.gz
mobileperf-d31d55fa24835dde6c4949adf223dc83ab4c2b6f.tar.bz2
Port C based glib to C++ glibmm
Diffstat (limited to 'include')
-rw-r--r--include/core/screen.h1
-rw-r--r--include/core/timer.h29
2 files changed, 18 insertions, 12 deletions
diff --git a/include/core/screen.h b/include/core/screen.h
index 891e50f..77e584e 100644
--- a/include/core/screen.h
+++ b/include/core/screen.h
@@ -399,6 +399,7 @@ class CompScreen :
friend class CompWindow;
friend class PrivateWindow;
friend class ModifierHandler;
+ friend class CompEventSource;
private:
PrivateScreen *priv;
diff --git a/include/core/timer.h b/include/core/timer.h
index ac38224..cfdf5ae 100644
--- a/include/core/timer.h
+++ b/include/core/timer.h
@@ -30,6 +30,8 @@
#include <sys/time.h>
#include <core/core.h>
+#include <glibmm/main.h>
+
/**
* A simple timer for use with invoking a CallBack during a timed duration.
*/
@@ -38,18 +40,18 @@ class CompTimer {
public:
typedef boost::function<bool ()> CallBack;
-
+
/**
* Empty constructor setting everything to zero and NULL.
*/
CompTimer ();
-
+
/**
* Frees the private data for this timer and any information about it's
* context.
*/
~CompTimer ();
-
+
/**
* Checks if this timer is active and will have it's CallBack invoked.
*/
@@ -58,37 +60,37 @@ class CompTimer {
unsigned int maxTime ();
unsigned int minLeft ();
unsigned int maxLeft ();
-
+
/**
* Sets the timing durations of this timer.
*/
void setTimes (unsigned int min, unsigned int max = 0);
-
+
/**
* Sets the callback function to invoke for this timer. This defaults
* to NULL.
*/
void setCallback (CallBack callback);
-
+
/**
* Starts this timer without modifying any of it's parameters. The timer is
* stop()'d before this occurs.
*/
void start ();
-
+
/**
* Starts this timer setting the paramters with setTimes(). The timer is stop()'d
* before this occurs.
*/
void start (unsigned int min, unsigned int max = 0);
-
+
/**
* Starts this timer setting the parameters with setTimes() and setCallback(). The timer is
* stop()'d before this occurs.
*/
void start (CallBack callback,
unsigned int min, unsigned int max = 0);
-
+
/**
* Stops this timer. After this the timer should not be active() and it's CallBack shouldn't
* be invoked.
@@ -96,12 +98,11 @@ class CompTimer {
void stop ();
void tick ();
-
+
const struct timeval & tickInfo () const;
friend class CompScreen;
friend class PrivateScreen;
- friend gboolean onTimerTimeout (CompTimer *);
private:
bool mActive;
@@ -112,9 +113,13 @@ class CompTimer {
private:
CallBack mCallBack;
- unsigned int mId;
+ bool mForceFail;
+ bool mExecuting;
struct timeval tickStart;
+ bool internalCallback ();
+ Glib::RefPtr <Glib::TimeoutSource> mSource;
+
};
#endif