summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2011-07-04 15:35:02 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2011-07-04 15:35:02 +0800
commitf0c5e589a2de9e149ef7f3057e958726a70ebdb4 (patch)
treebf5635afade379ee84ff81b970d3c993ed197e94 /include
parent1913edd4068503653004b35c32a8097bfc19faa1 (diff)
downloadmobileperf-f0c5e589a2de9e149ef7f3057e958726a70ebdb4.tar.gz
mobileperf-f0c5e589a2de9e149ef7f3057e958726a70ebdb4.tar.bz2
Break CompTimer's dependency on CompScreen
Diffstat (limited to 'include')
-rw-r--r--include/core/core.h3
-rw-r--r--include/core/timeouthandler.h57
-rw-r--r--include/core/timer.h4
3 files changed, 60 insertions, 4 deletions
diff --git a/include/core/core.h b/include/core/core.h
index d47b0da..bf7c716 100644
--- a/include/core/core.h
+++ b/include/core/core.h
@@ -27,7 +27,7 @@
#define _COMPIZ_CORE_H
-#define CORE_ABIVERSION 20110322
+#define CORE_ABIVERSION 20110703
#include <stdio.h>
#include <assert.h>
@@ -84,5 +84,6 @@ typedef XBool Bool;
#include <core/size.h>
#include <core/region.h>
#include <core/countedlist.h>
+#include <core/timeouthandler.h>
#endif
diff --git a/include/core/timeouthandler.h b/include/core/timeouthandler.h
new file mode 100644
index 0000000..084b24e
--- /dev/null
+++ b/include/core/timeouthandler.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright © 2010 Canonical Ltd.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Canonical Ltd. not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ * Canonical Ltd. makes no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * CANONICAL, LTD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL CANONICAL, LTD. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authored by: Sam Spilsbury <sam.spilsbury@canonical.com>
+ */
+
+#ifndef _COMPIZ_TIMEOUTHANDLER_H
+#define _COMPIZ_TIMEOUTHANDLER_H
+
+#include <core/timer.h>
+
+class PrivateTimeoutHandler;
+class CompTimer;
+
+class TimeoutHandler
+{
+ public:
+
+ TimeoutHandler ();
+ ~TimeoutHandler ();
+
+ void addTimer (CompTimer *timer);
+ void removeTimer (CompTimer *timer);
+
+ std::list <CompTimer *> & timers ();
+
+ static TimeoutHandler *
+ Default ();
+
+ static void
+ SetDefault (TimeoutHandler *);
+
+ private:
+
+ PrivateTimeoutHandler *priv;
+
+};
+#endif
diff --git a/include/core/timer.h b/include/core/timer.h
index 98d0c12..c0fcd4a 100644
--- a/include/core/timer.h
+++ b/include/core/timer.h
@@ -28,7 +28,6 @@
#include <boost/function.hpp>
#include <sys/time.h>
-#include <core/core.h>
#include <glibmm/main.h>
class CompTimeoutSource;
@@ -97,9 +96,8 @@ class CompTimer {
*/
void stop ();
- friend class CompScreen;
- friend class PrivateScreen;
friend class CompTimeoutSource;
+ friend class TimeoutHandler;
private:
bool mActive;