aboutsummaryrefslogtreecommitdiff
path: root/util/fbcompose/BasePlugin.hh
diff options
context:
space:
mode:
Diffstat (limited to 'util/fbcompose/BasePlugin.hh')
-rw-r--r--util/fbcompose/BasePlugin.hh144
1 files changed, 144 insertions, 0 deletions
diff --git a/util/fbcompose/BasePlugin.hh b/util/fbcompose/BasePlugin.hh
new file mode 100644
index 0000000..ea1707d
--- /dev/null
+++ b/util/fbcompose/BasePlugin.hh
@@ -0,0 +1,144 @@
1/** BasePlugin.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_BASEPLUGIN_HH
25#define FBCOMPOSITOR_BASEPLUGIN_HH
26
27#include "Enumerations.hh"
28
29#include "FbTk/FbString.hh"
30
31#include <X11/Xlib.h>
32
33#include <vector>
34
35
36namespace FbCompositor {
37
38 class BaseCompWindow;
39 class BaseScreen;
40
41
42 /**
43 * Base class for compositor plugins.
44 */
45 class BasePlugin {
46 public :
47 //--- CONSTRUCTORS AND DESTRUCTORS -------------------------------------
48
49 /** Constructor. */
50 BasePlugin(const BaseScreen &screen, const std::vector<FbTk::FbString> &args);
51
52 /** Destructor. */
53 virtual ~BasePlugin();
54
55
56 //--- ACCESSORS --------------------------------------------------------
57
58 /** \returns the current connection to the X server. */
59 Display *display() const;
60
61 /** \returns the name of the plugin. */
62 virtual const char *pluginName() const = 0;
63
64 /** \returns the screen this plugin operates on. */
65 const BaseScreen &screen() const;
66
67
68 //--- WINDOW EVENT CALLBACKS -------------------------------------------
69
70 /** Called, whenever a window becomes ignored. */
71 virtual void windowBecameIgnored(const BaseCompWindow &window);
72
73 /** Called, whenever a window is circulated. */
74 virtual void windowCirculated(const BaseCompWindow &window, int place);
75
76 /** Called, whenever a new window is created. */
77 virtual void windowCreated(const BaseCompWindow &window);
78
79 /** Called, whenever a window is damaged. */
80 virtual void windowDamaged(const BaseCompWindow &window);
81
82 /** Called, whenever a window is destroyed. */
83 virtual void windowDestroyed(const BaseCompWindow &window);
84
85 /** Called, whenever a window is mapped. */
86 virtual void windowMapped(const BaseCompWindow &window);
87
88 /** Called, whenever window's property is changed. */
89 virtual void windowPropertyChanged(const BaseCompWindow &window, Atom property, int state);
90
91 /** Called, whenever a window is reconfigured. */
92 virtual void windowReconfigured(const BaseCompWindow &window);
93
94 /** Called, whenever window's shape changes. */
95 virtual void windowShapeChanged(const BaseCompWindow &window);
96
97 /** Called, whenever a window is unmapped. */
98 virtual void windowUnmapped(const BaseCompWindow &window);
99
100
101 //--- SCREEN CHANGES ---------------------------------------------------
102
103 /** Notifies the screen of a background change. */
104 virtual void setRootPixmapChanged();
105
106 /** Notifies the screen of a root window change. */
107 virtual void setRootWindowSizeChanged();
108
109
110 private :
111 //--- CONSTRUCTORS -----------------------------------------------------
112
113 /** Copy constructor. */
114 BasePlugin(const BasePlugin&);
115
116 /** Assignment operator. */
117 BasePlugin &operator=(const BasePlugin&);
118
119
120 //--- INTERNAL VARIABLES -----------------------------------------------
121
122 /** The current connection to the X server. */
123 Display *m_display;
124
125 /** The screen this plugin operates on. */
126 const BaseScreen &m_screen;
127 };
128
129
130 //--- INLINE FUNCTIONS -----------------------------------------------------
131
132 /** \returns the current connection to the X server. */
133 inline Display *BasePlugin::display() const {
134 return m_display;
135 }
136
137 // Returns the screen this plugin operates on.
138 inline const BaseScreen &BasePlugin::screen() const {
139 return m_screen;
140 }
141}
142
143
144#endif // FBCOMPOSITOR_BASEPLUGIN_HH