Commit e8c670f191cdad5824faab932440a69b3d109e70

Authored by Luca Saiu
1 parent 0b671c45

add Luca's sample plugin

* compizconfig/ccsm/installed_files: Here.
* debian/compiz-gnome.gconf-defaults: Here.
* debian/compiz-plugins-default.install: Here.
* debian/compiz-plugins.install: Here.
* debian/compiz-plugins.install.armel: Here.
* debian/compiz-plugins.install.armhf: Here.
* plugins/luca/CMakeLists.txt: New.
* plugins/luca/luca.xml.in: New.
* plugins/luca/src/luca.cpp: New.
* plugins/luca/src/luca.h: New.
compizconfig/ccsm/installed_files
... ... @@ -111,6 +111,7 @@
111 111 /share/ccsm/icons/hicolor/scalable/apps/plugin-stars.svg
112 112 /share/ccsm/icons/hicolor/scalable/apps/plugin-fade.svg
113 113 /share/ccsm/icons/hicolor/scalable/apps/plugin-scalefilter.svg
  114 +/share/ccsm/icons/hicolor/scalable/apps/plugin-luca.svg
114 115 /share/ccsm/icons/hicolor/scalable/apps/plugin-gears.svg
115 116 /share/ccsm/icons/hicolor/scalable/apps/plugin-grid.svg
116 117 /share/ccsm/icons/hicolor/scalable/apps/plugin-fadedesktop.svg
... ...
debian/compiz-gnome.gconf-defaults
... ... @@ -4,7 +4,7 @@
4 4 /apps/gwd/blur_type all
5 5 /apps/gwd/metacity_theme_opacity 1.0
6 6 /apps/gwd/metacity_theme_shade_opacity true
7   -/apps/compizconfig-1/profiles/unity/general/screen0/options/active_plugins [core,composite,opengl,compiztoolbox,vpswitch,snap,mousepoll,resize,place,move,wall,grid,regex,imgpng,session,gnomecompat,animation,fade,unitymtgrabhandles,workarounds,scale,expo,ezoom,unityshell]
  7 +/apps/compizconfig-1/profiles/unity/general/screen0/options/active_plugins [core,composite,opengl,compiztoolbox,vpswitch,snap,mousepoll,resize,place,move,wall,grid,regex,imgpng,session,gnomecompat,animation,fade,unitymtgrabhandles,workarounds,scale,expo,ezoom,unityshell,luca]
8 8 /apps/compizconfig-1/profiles/unity/plugins/gnomecompat/screen0/options/main_menu_key ""
9 9 /apps/compizconfig-1/profiles/unity/plugins/gnomecompat/screen0/options/run_key ""
10   -/apps/compizconfig-1/profiles/Default/general/screen0/options/active_plugins [core,composite,opengl,compiztoolbox,decor,vpswitch,snap,mousepoll,resize,place,move,wall,grid,regex,imgpng,session,gnomecompat,animation,fade,workarounds,scale,expo,ezoom]
  10 +/apps/compizconfig-1/profiles/Default/general/screen0/options/active_plugins [core,composite,opengl,compiztoolbox,decor,vpswitch,snap,mousepoll,resize,place,move,wall,grid,regex,imgpng,session,gnomecompat,animation,fade,workarounds,scale,expo,ezoom,luca]
... ...
debian/compiz-plugins-default.install
... ... @@ -10,6 +10,7 @@ debian/tmp/usr/*/compiz/*fade.*
10 10 debian/tmp/usr/*/compiz/*gnomecompat.*
11 11 debian/tmp/usr/*/compiz/*grid.*
12 12 debian/tmp/usr/*/compiz/*imgpng.*
  13 +debian/tmp/usr/*/compiz/*luca.*
13 14 debian/tmp/usr/*/compiz/*mousepoll.*
14 15 debian/tmp/usr/*/compiz/*mousetheme.*
15 16 debian/tmp/usr/*/compiz/*move.*
... ...
debian/compiz-plugins.install
... ... @@ -17,6 +17,7 @@ debian/tmp/usr/*/compiz/*imgjpeg.*
17 17 debian/tmp/usr/*/compiz/*imgsvg.*
18 18 debian/tmp/usr/*/compiz/*inotify.*
19 19 debian/tmp/usr/*/compiz/*kdecompat.*
  20 +debian/tmp/usr/*/compiz/*luca.*
20 21 debian/tmp/usr/*/compiz/*mag.*
21 22 debian/tmp/usr/share/compiz/mag
22 23 debian/tmp/usr/*/compiz/*maximumize.*
... ...
debian/compiz-plugins.install.armel
... ... @@ -16,6 +16,7 @@ debian/tmp/usr/*/compiz/*imgjpeg.*
16 16 debian/tmp/usr/*/compiz/*imgsvg.*
17 17 debian/tmp/usr/*/compiz/*inotify.*
18 18 debian/tmp/usr/*/compiz/*kdecompat.*
  19 +debian/tmp/usr/*/compiz/*luca.*
19 20 debian/tmp/usr/*/compiz/*mag.*
20 21 debian/tmp/usr/share/compiz/mag
21 22 debian/tmp/usr/*/compiz/*maximumize.*
... ...
debian/compiz-plugins.install.armhf
... ... @@ -16,6 +16,7 @@ debian/tmp/usr/*/compiz/*imgjpeg.*
16 16 debian/tmp/usr/*/compiz/*imgsvg.*
17 17 debian/tmp/usr/*/compiz/*inotify.*
18 18 debian/tmp/usr/*/compiz/*kdecompat.*
  19 +debian/tmp/usr/*/compiz/*luca.*
19 20 debian/tmp/usr/*/compiz/*mag.*
20 21 debian/tmp/usr/share/compiz/mag
21 22 debian/tmp/usr/*/compiz/*maximumize.*
... ...
plugins/luca/CMakeLists.txt 0 → 100644
... ... @@ -0,0 +1,5 @@
  1 +find_package (Compiz REQUIRED)
  2 +
  3 +include (CompizPlugin)
  4 +
  5 +compiz_plugin(luca PLUGINDEPS composite opengl)
... ...
plugins/luca/luca.xml.in 0 → 100644
... ... @@ -0,0 +1,86 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<compiz>
  3 + <plugin name="luca" useBcop="true">
  4 + <_short>Luca's sample plugin</_short>
  5 + <_long>Luca in windows when mapped and luca out windows when unmapped</_long>
  6 + <category>Effects</category>
  7 + <deps>
  8 + <requirement>
  9 + <plugin>opengl</plugin>
  10 + </requirement>
  11 + <relation type="after">
  12 + <plugin>decor</plugin>
  13 + </relation>
  14 + <relation type="before">
  15 + <plugin>cube</plugin>
  16 + <plugin>scale</plugin>
  17 + </relation>
  18 + </deps>
  19 + <options>
  20 + <option name="luca_mode" type="int">
  21 + <_short>Luca Mode</_short>
  22 + <_long>Window luca mode</_long>
  23 + <min>0</min>
  24 + <max>1</max>
  25 + <default>0</default>
  26 + <desc>
  27 + <value>0</value>
  28 + <_name>Constant speed</_name>
  29 + </desc>
  30 + <desc>
  31 + <value>1</value>
  32 + <_name>Constant time</_name>
  33 + </desc>
  34 + </option>
  35 + <option name="luca_speed" type="float">
  36 + <_short>Luca Speed</_short>
  37 + <_long>Window luca speed</_long>
  38 + <default>5.0</default>
  39 + <min>0.1</min>
  40 + <max>25.0</max>
  41 + <precision>0.1</precision>
  42 + </option>
  43 + <option name="luca_time" type="int">
  44 + <_short>Luca Time</_short>
  45 + <_long>Window luca time (in ms) in "Constant time" mode</_long>
  46 + <default>100</default>
  47 + <min>1</min>
  48 + <max>5000</max>
  49 + </option>
  50 + <option name="window_match" type="match">
  51 + <_short>Luca windows</_short>
  52 + <_long>Windows that should be fading</_long>
  53 + <default>any</default>
  54 + </option>
  55 + <option name="visual_bell" type="bell">
  56 + <_short>Visual Bell</_short>
  57 + <_long>Luca effect on system beep</_long>
  58 + <default>false</default>
  59 + </option>
  60 + <option name="fullscreen_visual_bell" type="bool">
  61 + <_short>Fullscreen Visual Bell</_short>
  62 + <_long>Fullscreen luca effect on system beep</_long>
  63 + <default>false</default>
  64 + </option>
  65 + <option name="dim_unresponsive" type="bool">
  66 + <_short>Dim Unresponsive Windows</_short>
  67 + <_long>Dim windows that are not responding to window manager requests</_long>
  68 + <default>true</default>
  69 + </option>
  70 + <option name="unresponsive_brightness" type="int">
  71 + <_short>Unresponsive Window Brightness</_short>
  72 + <_long>Brightness (in %) of unresponsive windows</_long>
  73 + <min>0</min>
  74 + <max>100</max>
  75 + <default>65</default>
  76 + </option>
  77 + <option name="unresponsive_saturation" type="int">
  78 + <_short>Unresponsive Window Saturation</_short>
  79 + <_long>Saturation (in %) of unresponsive windows</_long>
  80 + <min>0</min>
  81 + <max>100</max>
  82 + <default>0</default>
  83 + </option>
  84 + </options>
  85 + </plugin>
  86 +</compiz>
... ...
plugins/luca/src/luca.cpp 0 → 100644
... ... @@ -0,0 +1,381 @@
  1 +/*
  2 + * Copyright © 2005 Novell, Inc.
  3 + *
  4 + * Permission to use, copy, modify, distribute, and sell this software
  5 + * and its documentation for any purpose is hereby granted without
  6 + * fee, provided that the above copyright notice appear in all copies
  7 + * and that both that copyright notice and this permission notice
  8 + * appear in supporting documentation, and that the name of
  9 + * Novell, Inc. not be used in advertising or publicity pertaining to
  10 + * distribution of the software without specific, written prior permission.
  11 + * Novell, Inc. makes no representations about the suitability of this
  12 + * software for any purpose. It is provided "as is" without express or
  13 + * implied warranty.
  14 + *
  15 + * NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  16 + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
  17 + * NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  18 + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
  19 + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
  20 + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  21 + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22 + *
  23 + * Author: David Reveman <davidr@novell.com>
  24 + */
  25 +
  26 +#include "luca.h"
  27 +#include <core/atoms.h>
  28 +
  29 +COMPIZ_PLUGIN_20090315 (luca, LucaPluginVTable);
  30 +
  31 +bool
  32 +LucaScreen::bell (CompAction *action,
  33 + CompAction::State state,
  34 + CompOption::Vector &options)
  35 +{
  36 + if (optionGetFullscreenVisualBell () && CompOption::getBoolOptionNamed (options, "fullscreen", false))
  37 + {
  38 + foreach (CompWindow *w, screen->windows ())
  39 + {
  40 + if (w->destroyed () ||
  41 + !w->isViewable ())
  42 + continue;
  43 +
  44 + LucaWindow::get (w)->dim (false);
  45 + }
  46 +
  47 + cScreen->damageScreen ();
  48 + }
  49 + else
  50 + {
  51 + CompWindow *w = screen->findWindow (CompOption::getIntOptionNamed (options, "window", 0));
  52 +
  53 + if (w)
  54 + LucaWindow::get (w)->dim (true);
  55 + }
  56 +
  57 + return true;
  58 +}
  59 +
  60 +void
  61 +LucaScreen::handleEvent (XEvent *event)
  62 +{
  63 + screen->handleEvent (event);
  64 +
  65 + if (event->type == PropertyNotify &&
  66 + event->xproperty.atom == Atoms::winState)
  67 + {
  68 + CompWindow *w = screen->findWindow (event->xproperty.window);
  69 +
  70 + if (w && w->isViewable ())
  71 + {
  72 + if (w->state () & CompWindowStateDisplayModalMask)
  73 + LucaWindow::get (w)->addDisplayModal ();
  74 + else
  75 + LucaWindow::get (w)->removeDisplayModal ();
  76 + }
  77 + }
  78 +}
  79 +
  80 +void
  81 +LucaScreen::preparePaint (int msSinceLastPaint)
  82 +{
  83 + int steps = MAX (12, (msSinceLastPaint * OPAQUE) / lucaTime);
  84 + unsigned int mode = optionGetLucaMode ();
  85 +
  86 + foreach (CompWindow *w, screen->windows ())
  87 + LucaWindow::get (w)->paintStep (mode, msSinceLastPaint, steps);
  88 +
  89 + cScreen->preparePaint (msSinceLastPaint);
  90 +}
  91 +
  92 +void
  93 +LucaWindow::dim (bool damage)
  94 +{
  95 + if (!cWindow->damaged ())
  96 + return;
  97 +
  98 + brightness = cWindow->brightness () / 2;
  99 +
  100 + if (damage)
  101 + cWindow->addDamage ();
  102 +}
  103 +
  104 +void
  105 +LucaWindow::addDisplayModal ()
  106 +{
  107 + if (!(window->state () & CompWindowStateDisplayModalMask) ||
  108 + dModal)
  109 + return;
  110 +
  111 + dModal = true;
  112 +
  113 + ++fScreen->displayModals;
  114 +
  115 + if (fScreen->displayModals == 1)
  116 + fScreen->cScreen->damageScreen ();
  117 +}
  118 +
  119 +void
  120 +LucaWindow::removeDisplayModal ()
  121 +{
  122 + if (!dModal)
  123 + return;
  124 +
  125 + dModal = false;
  126 +
  127 + --fScreen->displayModals;
  128 +
  129 + if (fScreen->displayModals == 0)
  130 + fScreen->cScreen->damageScreen ();
  131 +}
  132 +
  133 +void
  134 +LucaWindow::paintStep (unsigned int mode,
  135 + int msSinceLastPaint,
  136 + int step)
  137 +{
  138 + if (mode == LucaOptions::LucaModeConstantSpeed)
  139 + {
  140 + steps = step;
  141 + lucaTime = 0;
  142 + }
  143 + else if (mode == LucaOptions::LucaModeConstantTime)
  144 + {
  145 + if (lucaTime)
  146 + {
  147 + steps = 1;
  148 + lucaTime -= msSinceLastPaint;
  149 +
  150 + if (lucaTime < 0)
  151 + lucaTime = 0;
  152 + }
  153 + else
  154 + steps = 0;
  155 + }
  156 +}
  157 +
  158 +void
  159 +LucaWindow::windowNotify (CompWindowNotify n)
  160 +{
  161 + window->windowNotify (n);
  162 +
  163 + if (n == CompWindowNotifyAliveChanged)
  164 + cWindow->addDamage ();
  165 +}
  166 +
  167 +bool
  168 +LucaWindow::glPaint (const GLWindowPaintAttrib &attrib,
  169 + const GLMatrix &transform,
  170 + const CompRegion &region,
  171 + unsigned int mask)
  172 +{
  173 + if (!GL::canDoSlightlySaturated)
  174 + saturation = attrib.saturation;
  175 +
  176 + if (window->alive () &&
  177 + opacity == attrib.opacity &&
  178 + brightness == attrib.brightness &&
  179 + saturation == attrib.saturation &&
  180 + !fScreen->displayModals)
  181 + return gWindow->glPaint (attrib, transform, region, mask);
  182 +
  183 + GLWindowPaintAttrib fAttrib (attrib);
  184 +
  185 + int mode = fScreen->optionGetLucaMode ();
  186 +
  187 + if (!window->alive () &&
  188 + fScreen->optionGetDimUnresponsive ())
  189 + {
  190 + GLuint value = fScreen->optionGetUnresponsiveBrightness ();
  191 +
  192 + if (value != 100)
  193 + fAttrib.brightness = fAttrib.brightness * value / 100;
  194 +
  195 + value = fScreen->optionGetUnresponsiveSaturation ();
  196 +
  197 + if (value != 100 && GL::canDoSlightlySaturated)
  198 + fAttrib.saturation = fAttrib.saturation * value / 100;
  199 + }
  200 + else if (fScreen->displayModals && !dModal)
  201 + {
  202 + fAttrib.brightness = 0xa8a8;
  203 + fAttrib.saturation = 0;
  204 + }
  205 +
  206 + if (mode == LucaOptions::LucaModeConstantTime &&
  207 + (fAttrib.opacity != targetOpacity ||
  208 + fAttrib.brightness != targetBrightness ||
  209 + fAttrib.saturation != targetSaturation))
  210 + {
  211 + lucaTime = fScreen->optionGetLucaTime ();
  212 + steps = 1;
  213 +
  214 + opacityDiff = fAttrib.opacity - opacity;
  215 + brightnessDiff = fAttrib.brightness - brightness;
  216 + saturationDiff = fAttrib.saturation - saturation;
  217 +
  218 + targetOpacity = fAttrib.opacity;
  219 + targetBrightness = fAttrib.brightness;
  220 + targetSaturation = fAttrib.saturation;
  221 + }
  222 +
  223 + if (steps)
  224 + {
  225 + GLint newOpacity = OPAQUE;
  226 + GLint newBrightness = BRIGHT;
  227 + GLint newSaturation = COLOR;
  228 +
  229 + if (mode == LucaOptions::LucaModeConstantSpeed)
  230 + {
  231 + newOpacity = opacity;
  232 +
  233 + if (fAttrib.opacity > opacity)
  234 + newOpacity = MIN (opacity + steps, fAttrib.opacity);
  235 + else if (fAttrib.opacity < opacity)
  236 + newOpacity = MAX (opacity - steps, fAttrib.opacity);
  237 +
  238 + newBrightness = brightness;
  239 +
  240 + if (fAttrib.brightness > brightness)
  241 + newBrightness = MIN (brightness + (steps / 12), fAttrib.brightness);
  242 + else if (fAttrib.brightness < brightness)
  243 + newBrightness = MAX (brightness - (steps / 12), fAttrib.brightness);
  244 +
  245 + newSaturation = saturation;
  246 +
  247 + if (fAttrib.saturation > saturation)
  248 + newSaturation = MIN (saturation + (steps / 6), fAttrib.saturation);
  249 + else if (fAttrib.saturation < saturation)
  250 + newSaturation = MAX (saturation - (steps / 6), fAttrib.saturation);
  251 + }
  252 + else if (mode == LucaOptions::LucaModeConstantTime)
  253 + {
  254 + int totalLucaTime = fScreen->optionGetLucaTime ();
  255 +
  256 + if (totalLucaTime == 0)
  257 + totalLucaTime = lucaTime;
  258 +
  259 + newOpacity = fAttrib.opacity -
  260 + (opacityDiff * lucaTime / totalLucaTime);
  261 + newBrightness = fAttrib.brightness -
  262 + (brightnessDiff * lucaTime / totalLucaTime);
  263 + newSaturation = fAttrib.saturation -
  264 + (saturationDiff * lucaTime / totalLucaTime);
  265 + }
  266 +
  267 + steps = 0;
  268 +
  269 + if (newOpacity > 0)
  270 + {
  271 + opacity = newOpacity;
  272 + brightness = newBrightness;
  273 + saturation = newSaturation;
  274 +
  275 + if (newOpacity != fAttrib.opacity ||
  276 + newBrightness != fAttrib.brightness ||
  277 + newSaturation != fAttrib.saturation)
  278 + cWindow->addDamage ();
  279 + }
  280 + else
  281 + opacity = 0;
  282 + }
  283 +
  284 + fAttrib.opacity = opacity;
  285 + fAttrib.brightness = brightness;
  286 + fAttrib.saturation = saturation;
  287 +
  288 + return gWindow->glPaint (fAttrib, transform, region, mask);
  289 +}
  290 +
  291 +LucaScreen::LucaScreen (CompScreen *s) :
  292 + PluginClassHandler<LucaScreen, CompScreen> (s),
  293 + displayModals (0),
  294 + cScreen (CompositeScreen::get (s))
  295 +{
  296 + lucaTime = 1000.0f / optionGetLucaSpeed ();
  297 +
  298 + optionSetVisualBellInitiate (boost::bind (&LucaScreen::bell, this, _1, _2, _3));
  299 +
  300 + ScreenInterface::setHandler (screen);
  301 + CompositeScreenInterface::setHandler (cScreen);
  302 +}
  303 +
  304 +bool
  305 +LucaScreen::setOption (const CompString &name,
  306 + CompOption::Value &value)
  307 +{
  308 + unsigned int index;
  309 +
  310 + bool rv = LucaOptions::setOption (name, value);
  311 +
  312 + if (!rv || !CompOption::findOption (getOptions (), name, &index))
  313 + return false;
  314 +
  315 + switch (index)
  316 + {
  317 + case LucaOptions::LucaSpeed:
  318 + lucaTime = 1000.0f / optionGetLucaSpeed ();
  319 + break;
  320 +
  321 + case LucaOptions::WindowMatch:
  322 + cScreen->damageScreen ();
  323 + break;
  324 +
  325 + case LucaOptions::DimUnresponsive:
  326 + foreach (CompWindow *w, screen->windows ())
  327 + w->windowNotifySetEnabled (LucaWindow::get (w), optionGetDimUnresponsive ());
  328 +
  329 + break;
  330 +
  331 + default:
  332 + break;
  333 + }
  334 +
  335 + return rv;
  336 +}
  337 +
  338 +LucaWindow::LucaWindow (CompWindow *w) :
  339 + PluginClassHandler<LucaWindow, CompWindow> (w),
  340 + fScreen (LucaScreen::get (screen)),
  341 + window (w),
  342 + cWindow (CompositeWindow::get (w)),
  343 + gWindow (GLWindow::get (w)),
  344 + opacity (cWindow->opacity ()),
  345 + brightness (cWindow->brightness ()),
  346 + saturation (cWindow->saturation ()),
  347 + targetOpacity (opacity),
  348 + targetBrightness (brightness),
  349 + targetSaturation (saturation),
  350 + dModal (false),
  351 + steps (0),
  352 + lucaTime (0),
  353 + opacityDiff (0),
  354 + brightnessDiff (0),
  355 + saturationDiff (0)
  356 +{
  357 + if (window->isViewable ())
  358 + addDisplayModal ();
  359 +
  360 + WindowInterface::setHandler (window, false);
  361 + GLWindowInterface::setHandler (gWindow);
  362 +
  363 + if (fScreen->optionGetDimUnresponsive ())
  364 + window->windowNotifySetEnabled (this, true);
  365 +}
  366 +
  367 +LucaWindow::~LucaWindow ()
  368 +{
  369 + removeDisplayModal ();
  370 +}
  371 +
  372 +bool
  373 +LucaPluginVTable::init ()
  374 +{
  375 + if (CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) &&
  376 + CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) &&
  377 + CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI))
  378 + return true;
  379 +
  380 + return false;
  381 +}
... ...
plugins/luca/src/luca.h 0 → 100644
... ... @@ -0,0 +1,119 @@
  1 +/*
  2 + * Copyright © 2005 Novell, Inc.
  3 + *
  4 + * Permission to use, copy, modify, distribute, and sell this software
  5 + * and its documentation for any purpose is hereby granted without
  6 + * fee, provided that the above copyright notice appear in all copies
  7 + * and that both that copyright notice and this permission notice
  8 + * appear in supporting documentation, and that the name of
  9 + * Novell, Inc. not be used in advertising or publicity pertaining to
  10 + * distribution of the software without specific, written prior permission.
  11 + * Novell, Inc. makes no representations about the suitability of this
  12 + * software for any purpose. It is provided "as is" without express or
  13 + * implied warranty.
  14 + *
  15 + * NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  16 + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
  17 + * NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  18 + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
  19 + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
  20 + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  21 + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22 + *
  23 + * Author: David Reveman <davidr@novell.com>
  24 + */
  25 +
  26 +#include <core/window.h>
  27 +#include <core/pluginclasshandler.h>
  28 +#include <composite/composite.h>
  29 +
  30 +#include "luca_options.h"
  31 +
  32 +#include <opengl/opengl.h>
  33 +
  34 +class LucaScreen :
  35 + public ScreenInterface,
  36 + public CompositeScreenInterface,
  37 + public PluginClassHandler<LucaScreen, CompScreen>,
  38 + public LucaOptions
  39 +{
  40 + public:
  41 +
  42 + LucaScreen (CompScreen *s);
  43 +
  44 + bool setOption (const CompString &,
  45 + CompOption::Value &);
  46 +
  47 + bool bell (CompAction *,
  48 + CompAction::State state,
  49 + CompOption::Vector &);
  50 +
  51 + void handleEvent (XEvent *);
  52 +
  53 + void preparePaint (int);
  54 +
  55 + int displayModals;
  56 + int lucaTime;
  57 +
  58 + CompositeScreen *cScreen;
  59 +};
  60 +
  61 +class LucaWindow :
  62 + public WindowInterface,
  63 + public GLWindowInterface,
  64 + public PluginClassHandler<LucaWindow, CompWindow>
  65 +{
  66 + public:
  67 +
  68 + LucaWindow (CompWindow *w);
  69 + ~LucaWindow ();
  70 +
  71 + void windowNotify (CompWindowNotify);
  72 +
  73 + void paintStep (unsigned int ,
  74 + int ,
  75 + int );
  76 +
  77 + bool glPaint (const GLWindowPaintAttrib &,
  78 + const GLMatrix &,
  79 + const CompRegion &,
  80 + unsigned int );
  81 +
  82 + void addDisplayModal ();
  83 +
  84 + void removeDisplayModal ();
  85 +
  86 + void dim (bool);
  87 +
  88 + private:
  89 +
  90 + LucaScreen *fScreen;
  91 + CompWindow *window;
  92 + CompositeWindow *cWindow;
  93 + GLWindow *gWindow;
  94 +
  95 + GLushort opacity;
  96 + GLushort brightness;
  97 + GLushort saturation;
  98 +
  99 + GLushort targetOpacity;
  100 + GLushort targetBrightness;
  101 + GLushort targetSaturation;
  102 +
  103 + bool dModal;
  104 +
  105 + int steps;
  106 + int lucaTime;
  107 +
  108 + int opacityDiff;
  109 + int brightnessDiff;
  110 + int saturationDiff;
  111 +};
  112 +
  113 +class LucaPluginVTable :
  114 + public CompPlugin::VTableForScreenAndWindow<LucaScreen, LucaWindow>
  115 +{
  116 + public:
  117 +
  118 + bool init ();
  119 +};
... ...