aboutsummaryrefslogtreecommitdiff
path: root/util/fbcompose/XRenderPlugin.hh
diff options
context:
space:
mode:
authorGediminas Liktaras <gliktaras@gmail.com>2011-12-08 13:34:09 (GMT)
committerPaul Tagliamonte <paultag@fluxbox.org>2011-12-10 16:13:19 (GMT)
commitcd339169d1961eb508ea89cee2609ec6d0fc0c15 (patch)
tree01acd158a03fb17a72e067ff0b36701da75e49dc /util/fbcompose/XRenderPlugin.hh
parent85ac5c4b2c6a526992f483a6e91867dc2f82a19e (diff)
downloadfluxbox_paul-cd339169d1961eb508ea89cee2609ec6d0fc0c15.zip
fluxbox_paul-cd339169d1961eb508ea89cee2609ec6d0fc0c15.tar.bz2
fbcompose - A compositing addon for fluxbox window manager.
fbcompose(1) is an optional compositing addon for fluxbox window manager. It augments fluxbox with a number of graphical features. Most notably, fbcompose allows fluxbox to properly display applications that require compositing (docky, for example), adds support for true window transparency (as opposed to fluxbox's pseudo transparency) and provides a plugin framework to extend the compositor's functionality. As this is still a beta version of the compositor, the bugs are likely.
Diffstat (limited to 'util/fbcompose/XRenderPlugin.hh')
-rw-r--r--util/fbcompose/XRenderPlugin.hh124
1 files changed, 124 insertions, 0 deletions
diff --git a/util/fbcompose/XRenderPlugin.hh b/util/fbcompose/XRenderPlugin.hh
new file mode 100644
index 0000000..ffd1a3e
--- /dev/null
+++ b/util/fbcompose/XRenderPlugin.hh
@@ -0,0 +1,124 @@
1/** XRenderPlugin.hh file for the fluxbox compositor. */
2
3// Copyright (c) 2011 Gediminas Liktaras (gliktaras at gmail dot com)
4//
5// Permission is hereby granted, free of charge, to any person obtaining a copy
6// of this software and associated documentation files (the "Software"), to deal
7// in the Software without restriction, including without limitation the rights
8// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9// copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21// THE SOFTWARE.
22
23
24#ifndef FBCOMPOSITOR_XRENDERPLUGIN_HH
25#define FBCOMPOSITOR_XRENDERPLUGIN_HH
26
27#include "BasePlugin.hh"
28#include "Enumerations.hh"
29#include "Exceptions.hh"
30#include "XRenderResources.hh"
31
32#include "FbTk/FbString.hh"
33
34#include <X11/Xlib.h>
35#include <X11/extensions/Xrender.h>
36
37#include <vector>
38
39
40namespace FbCompositor {
41
42 class BasePlugin;
43 class BaseScreen;
44 class InitException;
45 class XRenderScreen;
46 class XRenderWindow;
47 class RenderingException;
48
49
50 //--- SUPPORTING STRUCTURES AND CLASSES ------------------------------------
51
52 /**
53 * A rendering job.
54 */
55 struct XRenderRenderingJob {
56 int operation; ///< Compositing operation to use.
57 XRenderPicturePtr source_picture; ///< Picture to render.
58 XRenderPicturePtr mask_picture; ///< Mask picture to use.
59 int source_x; ///< X offset on the source picture.
60 int source_y; ///< Y offset on the source picture.
61 int mask_x; ///< X offset on the mask picture.
62 int mask_y; ///< Y offset on the mask picture.
63 int destination_x; ///< X offset on the destination picture.
64 int destination_y; ///< Y offset on the destination picture.
65 int width; ///< Width of the picture to render.
66 int height; ///< Height of the picture to render.
67 };
68
69
70 //--- XRENDER PLUGIN BASE CLASS --------------------------------------------
71
72 /**
73 * Plugin for XRender renderer.
74 */
75 class XRenderPlugin : public BasePlugin {
76 public :
77 //--- CONSTRUCTORS AND DESTRUCTORS -------------------------------------
78
79 /** Constructor. */
80 XRenderPlugin(const BaseScreen &screen, const std::vector<FbTk::FbString> &args);
81
82 /** Destructor. */
83 virtual ~XRenderPlugin();
84
85
86 //--- ACCESSORS --------------------------------------------------------
87
88 /** \returns the screen object, cast into the correct class. */
89 const XRenderScreen &xrenderScreen() const;
90
91
92 //--- RENDERING ACTIONS ------------------------------------------------
93
94 /** Rectangles that the plugin wishes to damage. */
95 virtual const std::vector<XRectangle> &damagedAreas();
96
97
98 /** Post background rendering actions and jobs. */
99 virtual const std::vector<XRenderRenderingJob> &postBackgroundRenderingActions();
100
101
102 /** Pre window rendering actions and jobs. */
103 virtual const std::vector<XRenderRenderingJob> &preWindowRenderingActions(const XRenderWindow &window);
104
105 /** Window rendering job initialization. */
106 virtual void windowRenderingJobInit(const XRenderWindow &window, XRenderRenderingJob &job);
107
108 /** Post window rendering actions and jobs. */
109 virtual const std::vector<XRenderRenderingJob> &postWindowRenderingActions(const XRenderWindow &window);
110
111
112 /** Reconfigure rectangle rendering job initialization. */
113 virtual void recRectRenderingJobInit(XRectangle &rect_return, GC gc);
114
115
116 /** Extra rendering actions and jobs. */
117 virtual const std::vector<XRenderRenderingJob> &extraRenderingActions();
118
119 /** Post extra rendering actions. */
120 virtual void postExtraRenderingActions();
121 };
122}
123
124#endif // FBCOMPOSITOR_XRENDERPLUGIN_HH