/* Compiz example plugin
* Copyright (c) 2008 Sam Spilsbury <email@example.com>
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* Your own copyright notice would go above. You are free to choose whatever
* licence you want, just take note that some compiz code is GPL and you will
* not be able to re-use it if you want to use a different licence.
/* The include path is set to /PREFIX/include/compiz in the Makefile, so you
* don't need to worry about not being able to find compiz headers */
/* You need to include this in order to get access to the CompPrivate templates */
/* Compositing is no longer built in by-default, so you need to include the interface
* of the composite plugin. You also need to do the same with opengl.h if you plan to
* use opengl functions
/* This is your base screen class. This class definition can be considered the top most
* as there is no multi-screen or multi-display support in compiz++, only one compiz
* instance per screen.
class ExampleScreen :
/* You should inherit the ScreenInterface class if you want to dynamically hook
* screen-level core functions. */
/* Same goes for screen functions in the composite plugin */
/* This sets up a privates handler, where you can access an instance of your class for
* every CompScreen object (same goes for ExampleWindow and CompWindow). It adds the
* member function ::get, which will allow you get an instance of this class from a
* CompScreen * object. Oh, and the memory management is done for you now ^_^
public PrivateHandler <ExampleScreen, CompScreen>,
/* And finally, because we are using BCOP to generate our options, it creates a class
* with a bunch of getters and setters that are added to out class when we inherit it. Yay.
/* Lets get into buisness. This is the constructor, it replaces the initScreen, initEtc
* things that used to be in compiz and is called automatically when an instance of this
* class is created. Notice how it is the same name as the class name. It has to be that way.
ExampleScreen::ExampleScreen (CompScreen *s);
/* This is the destructor. It is called when the class is destroyed. If you allocated any
* memory or need to do some cleanup, here is where you do it. Note the tilde (~)?
/* We store CompositeScreen and CompScreen to avoid unecessary calls to ::get */
/* And some member variables */
/* Now. Because we imported ScreenInterface and CompositeScreenInterface, we get all the
* core functions in there for free. Here's the twist. Those functions are stored as 'virtual',
* so they can be overridden. That is what we do here. So instead of a core function being called,
* our own is
handleEvent (XEvent *);