summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moreau <oreaus@gmail.com>2010-07-02 00:27:26 -0600
committerScott Moreau <oreaus@gmail.com>2010-07-02 00:30:32 -0600
commit0c78c12b0d826acb050651019e1e4adabd032623 (patch)
treede3cfb158dc09552405f7372e3d62163c94acb13
parentd7fe886bda1f336f9e71b3c6a74b25a644cbaea4 (diff)
downloadbench-0c78c12b0d826acb050651019e1e4adabd032623.tar.gz
bench-0c78c12b0d826acb050651019e1e4adabd032623.tar.bz2
Add serialization interface changes.
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/bench.cpp11
-rw-r--r--src/bench.h10
3 files changed, 22 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a52a82e..ce35cef 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,5 +2,5 @@ find_package (Compiz REQUIRED)
include (CompizPlugin)
-compiz_plugin (bench PLUGINDEPS composite opengl)
+compiz_plugin (bench PLUGINDEPS composite opengl compiztoolbox)
diff --git a/src/bench.cpp b/src/bench.cpp
index c918f57..8c53ffa 100644
--- a/src/bench.cpp
+++ b/src/bench.cpp
@@ -271,8 +271,17 @@ BenchScreen::limiterModeChanged (CompOption *opt)
opt->value ().i ());
}
+void
+BenchScreen::postLoad ()
+{
+ cScreen->preparePaintSetEnabled (this, mActive);
+ cScreen->donePaintSetEnabled (this, mActive);
+ gScreen->glPaintOutputSetEnabled (this, mActive);
+}
+
BenchScreen::BenchScreen (CompScreen *screen) :
PluginClassHandler<BenchScreen, CompScreen> (screen),
+ PluginStateWriter <BenchScreen> (this, screen->root ()),
cScreen (CompositeScreen::get (screen)),
gScreen (GLScreen::get (screen)),
mRrVal (0),
@@ -379,6 +388,8 @@ BenchScreen::BenchScreen (CompScreen *screen) :
BenchScreen::~BenchScreen ()
{
+ writeSerializedData ();
+
if (mActive)
{
// Restore FPS limiter mode
diff --git a/src/bench.h b/src/bench.h
index fbf3521..0df5473 100644
--- a/src/bench.h
+++ b/src/bench.h
@@ -21,6 +21,7 @@
**/
#include <core/core.h>
+#include <core/serialization.h>
#include <core/pluginclasshandler.h>
#include <composite/composite.h>
@@ -59,6 +60,7 @@ class BenchScreen :
public CompositeScreenInterface,
public GLScreenInterface,
public PluginClassHandler<BenchScreen, CompScreen>,
+ public PluginStateWriter <BenchScreen>,
public BenchOptions
{
public:
@@ -85,6 +87,14 @@ class BenchScreen :
CompositeFPSLimiterMode mOldLimiterMode;
+ void postLoad ();
+
+ template <class Archive>
+ void serialize (Archive & ar, const unsigned int count)
+ {
+ ar & mActive;
+ }
+
bool initiate (CompOption::Vector &options);
void limiterModeChanged (CompOption *opt);