aboutsummaryrefslogtreecommitdiff
path: root/util/fbcompose/XRenderWindow.hh
diff options
context:
space:
mode:
Diffstat (limited to 'util/fbcompose/XRenderWindow.hh')
-rw-r--r--util/fbcompose/XRenderWindow.hh115
1 files changed, 115 insertions, 0 deletions
diff --git a/util/fbcompose/XRenderWindow.hh b/util/fbcompose/XRenderWindow.hh
new file mode 100644
index 0000000..564225f
--- /dev/null
+++ b/util/fbcompose/XRenderWindow.hh
@@ -0,0 +1,115 @@
1/** XRenderWindow.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_XRENDERWINDOW_HH
25#define FBCOMPOSITOR_XRENDERWINDOW_HH
26
27
28#include "BaseCompWindow.hh"
29#include "Exceptions.hh"
30#include "XRenderResources.hh"
31
32#include <X11/extensions/Xrender.h>
33
34
35namespace FbCompositor {
36
37 class InitException;
38 class XRenderScreen;
39 class XRenderWindow;
40
41
42 /**
43 * Manages windows in XRender rendering mode.
44 */
45 class XRenderWindow : public BaseCompWindow {
46 public:
47 //--- CONSTRUCTORS AND DESTRUCTORS -------------------------------------
48
49 /** Constructor. */
50 XRenderWindow(const XRenderScreen &screen, Window window_xid, const char *pict_filter);
51
52 /** Destructor. */
53 ~XRenderWindow();
54
55
56 //--- ACCESSORS --------------------------------------------------------
57
58 /** \returns an object, holding the window's contents as an XRender picture. */
59 XRenderPicturePtr contentPicture() const;
60
61 /** \returns an object, the window's mask picture. */
62 XRenderPicturePtr maskPicture() const;
63
64
65 //--- WINDOW MANIPULATION ----------------------------------------------
66
67 /** Update the window's contents. */
68 void updateContents();
69
70 /** Update window's property. */
71 void updateProperty(Atom property, int state);
72
73
74 protected:
75 //--- PROTECTED WINDOW MANIPULATION ------------------------------------
76
77 /** Update the window's clip shape. */
78 void updateShape();
79
80
81 private:
82 //--- INTERNAL FUNCTIONS -----------------------------------------------
83
84 /** Update the window's mask picture. */
85 void updateMaskPicture();
86
87
88 //--- RENDERING RELATED ------------------------------------------------
89
90 /** The window's content picture. */
91 XRenderPicturePtr m_content_picture;
92
93 /** The window's mask picture. */
94 XRenderPicturePtr m_mask_picture;
95
96
97 /** The picture filter. */
98 const char *m_pict_filter;
99 };
100
101
102 //--- INLINE FUNCTIONS -----------------------------------------------------
103
104 // Returns the window's contents as an XRender picture.
105 inline XRenderPicturePtr XRenderWindow::contentPicture() const {
106 return m_content_picture;
107 }
108
109 // Returns the window's mask picture.
110 inline XRenderPicturePtr XRenderWindow::maskPicture() const {
111 return m_mask_picture;
112 }
113}
114
115#endif // FBCOMPOSITOR_XRENDERWINDOW_HH