Merge lp:~mc-return/compiz/compiz.merge-src-header-files-cleanup into lp:compiz/0.9.10

Proposed by MC Return
Status: Work in progress
Proposed branch: lp:~mc-return/compiz/compiz.merge-src-header-files-cleanup
Merge into: lp:compiz/0.9.10
Diff against target: 980 lines (+311/-234)
9 files modified
src/asyncserverwindow.h (+4/-0)
src/configurerequestbuffer-impl.h (+7/-3)
src/eventmanagement.h (+0/-2)
src/privateaction.h (+7/-6)
src/privateeventsource.h (+3/-3)
src/privateiosource.h (+11/-8)
src/privatematch.h (+17/-6)
src/privateoption.h (+10/-6)
src/privatescreen.h (+252/-200)
To merge this branch: bzr merge lp:~mc-return/compiz/compiz.merge-src-header-files-cleanup
Reviewer Review Type Date Requested Status
Compiz Maintainers Pending
Review via email: mp+165781@code.launchpad.net

Commit message

src/*.h files cleanup:

Used prefix instead of postfix increment.
Fixed indentation.

Description of the change

WIP

To post a comment you must log in.
3726. By MC Return

More cleanup

3727. By MC Return

Merged latest lp:compiz and fixed conflicts

3728. By MC Return

More cleanup

Unmerged revisions

3728. By MC Return

More cleanup

3727. By MC Return

Merged latest lp:compiz and fixed conflicts

3726. By MC Return

More cleanup

3725. By MC Return

src/*.h files cleanup (please see main commit message for details)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/asyncserverwindow.h'
--- src/asyncserverwindow.h 2012-12-13 11:12:32 +0000
+++ src/asyncserverwindow.h 2013-06-20 07:03:30 +0000
@@ -39,11 +39,15 @@
3939
40 virtual int requestConfigureOnClient (const XWindowChanges &xwc,40 virtual int requestConfigureOnClient (const XWindowChanges &xwc,
41 unsigned int valueMask) = 0;41 unsigned int valueMask) = 0;
42
42 virtual int requestConfigureOnWrapper (const XWindowChanges &xwc,43 virtual int requestConfigureOnWrapper (const XWindowChanges &xwc,
43 unsigned int valueMask) = 0;44 unsigned int valueMask) = 0;
45
44 virtual int requestConfigureOnFrame (const XWindowChanges &xwc,46 virtual int requestConfigureOnFrame (const XWindowChanges &xwc,
45 unsigned int valueMask) = 0;47 unsigned int valueMask) = 0;
48
46 virtual void sendSyntheticConfigureNotify () = 0;49 virtual void sendSyntheticConfigureNotify () = 0;
50
47 virtual bool hasCustomShape () const = 0;51 virtual bool hasCustomShape () const = 0;
48};52};
49}53}
5054
=== modified file 'src/configurerequestbuffer-impl.h'
--- src/configurerequestbuffer-impl.h 2012-12-13 11:12:32 +0000
+++ src/configurerequestbuffer-impl.h 2013-06-20 07:03:30 +0000
@@ -59,6 +59,7 @@
59 public Releasable59 public Releasable
60{60{
61 public:61 public:
62
62 typedef boost::shared_ptr <BufferLock> Ptr;63 typedef boost::shared_ptr <BufferLock> Ptr;
6364
64 virtual ~BufferLock () {}65 virtual ~BufferLock () {}
@@ -89,9 +90,12 @@
8990
90 void untrackLock (compiz::window::configure_buffers::BufferLock *lock);91 void untrackLock (compiz::window::configure_buffers::BufferLock *lock);
9192
92 void pushClientRequest (const XWindowChanges &xwc, unsigned int mask);93 void pushClientRequest (const XWindowChanges &xwc,
93 void pushWrapperRequest (const XWindowChanges &xwc, unsigned int mask);94 unsigned int mask);
94 void pushFrameRequest (const XWindowChanges &xwc, unsigned int mask);95 void pushWrapperRequest (const XWindowChanges &xwc,
96 unsigned int mask);
97 void pushFrameRequest (const XWindowChanges &xwc,
98 unsigned int mask);
95 void pushSyntheticConfigureNotify ();99 void pushSyntheticConfigureNotify ();
96 compiz::window::configure_buffers::Releasable::Ptr obtainLock ();100 compiz::window::configure_buffers::Releasable::Ptr obtainLock ();
97101
98102
=== modified file 'src/eventmanagement.h'
--- src/eventmanagement.h 2012-10-11 10:06:30 +0000
+++ src/eventmanagement.h 2013-06-20 07:03:30 +0000
@@ -75,6 +75,4 @@
75}75}
76}76}
7777
78
79
80#endif78#endif
8179
=== modified file 'src/privateaction.h'
--- src/privateaction.h 2012-10-02 10:28:01 +0000
+++ src/privateaction.h 2013-06-20 07:03:30 +0000
@@ -41,8 +41,8 @@
41 virtual void setActive (bool) = 0;41 virtual void setActive (bool) = 0;
42};42};
4343
44void setActionActiveState (const CompAction &action,44void setActionActiveState (const CompAction &action,
45 bool active);45 bool active);
46}46}
47}47}
4848
@@ -50,15 +50,16 @@
50 public compiz::actions::BoundAction50 public compiz::actions::BoundAction
51{51{
52 public:52 public:
53
53 PrivateAction ();54 PrivateAction ();
54 PrivateAction (const PrivateAction&);55 PrivateAction (const PrivateAction &);
5556
56 void setActive (bool);57 void setActive (bool);
5758
58 CompAction::CallBack initiate;59 CompAction::CallBack initiate;
59 CompAction::CallBack terminate;60 CompAction::CallBack terminate;
6061
61 CompAction::State state;62 CompAction::State state;
6263
63 CompAction::BindingType type;64 CompAction::BindingType type;
6465
6566
=== modified file 'src/privateeventsource.h'
--- src/privateeventsource.h 2012-12-02 12:06:02 +0000
+++ src/privateeventsource.h 2013-06-20 07:03:30 +0000
@@ -54,9 +54,9 @@
5454
55 private:55 private:
5656
57 Display *mDpy;57 Display *mDpy;
58 Glib::PollFD mPollFD;58 Glib::PollFD mPollFD;
59 int mConnectionFD;59 int mConnectionFD;
60};60};
6161
62#endif62#endif
6363
=== modified file 'src/privateiosource.h'
--- src/privateiosource.h 2012-12-02 12:06:02 +0000
+++ src/privateiosource.h 2013-06-20 07:03:30 +0000
@@ -47,22 +47,25 @@
47 virtual ~CompWatchFd ();47 virtual ~CompWatchFd ();
4848
49 static49 static
50 CompWatchFd * create (int,50 CompWatchFd * create (int ,
51 Glib::IOCondition,51 Glib::IOCondition ,
52 FdWatchCallBack);52 FdWatchCallBack );
5353
54 protected:54 protected:
5555
56 explicit CompWatchFd (int, Glib::IOCondition, FdWatchCallBack);56 explicit
57 bool internalCallback (Glib::IOCondition);57 CompWatchFd (int ,
58 Glib::IOCondition ,
59 FdWatchCallBack );
60 bool internalCallback (Glib::IOCondition);
5861
59 private:62 private:
6063
61 int mFd;64 int mFd;
62 FdWatchCallBack mCallBack;65 FdWatchCallBack mCallBack;
63 CompWatchFdHandle mHandle;66 CompWatchFdHandle mHandle;
64 bool mForceFail;67 bool mForceFail;
65 bool mExecuting;68 bool mExecuting;
6669
67 friend class ::compiz::private_screen::EventManager;70 friend class ::compiz::private_screen::EventManager;
68};71};
6972
=== modified file 'src/privatematch.h'
--- src/privatematch.h 2009-03-16 09:18:16 +0000
+++ src/privatematch.h 2013-06-20 07:03:30 +0000
@@ -34,9 +34,12 @@
34#define MATCH_OP_AND_MASK (1 << 0)34#define MATCH_OP_AND_MASK (1 << 0)
35#define MATCH_OP_NOT_MASK (1 << 1)35#define MATCH_OP_NOT_MASK (1 << 1)
3636
37class MatchOp {37class MatchOp
38{
38 public:39 public:
39 typedef enum {40
41 typedef enum
42 {
40 TypeNone,43 TypeNone,
41 TypeGroup,44 TypeGroup,
42 TypeExp45 TypeExp
@@ -52,22 +55,27 @@
52 unsigned int flags;55 unsigned int flags;
53};56};
5457
55class MatchExpOp : public MatchOp {58class MatchExpOp : public MatchOp
59{
56 public:60 public:
61
57 MatchExpOp ();62 MatchExpOp ();
58 MatchExpOp (const MatchExpOp &);63 MatchExpOp (const MatchExpOp &);
5964
60 MatchOp::Type type () { return MatchOp::TypeExp; };65 MatchOp::Type type () { return MatchOp::TypeExp; };
6166
62 CompString value;67 CompString value;
6368
64 boost::shared_ptr<CompMatch::Expression> e;69 boost::shared_ptr<CompMatch::Expression> e;
65};70};
6671
67class MatchGroupOp : public MatchOp {72class MatchGroupOp : public MatchOp
73{
68 public:74 public:
75
69 MatchGroupOp ();76 MatchGroupOp ();
70 ~MatchGroupOp ();77 ~MatchGroupOp ();
78
71 MatchGroupOp (const MatchGroupOp &);79 MatchGroupOp (const MatchGroupOp &);
7280
73 MatchGroupOp & operator= (const MatchGroupOp &);81 MatchGroupOp & operator= (const MatchGroupOp &);
@@ -77,11 +85,14 @@
77 MatchOp::List op;85 MatchOp::List op;
78};86};
7987
80class PrivateMatch {88class PrivateMatch
89{
81 public:90 public:
91
82 PrivateMatch ();92 PrivateMatch ();
8393
84 public:94 public:
95
85 MatchGroupOp op;96 MatchGroupOp op;
86};97};
8798
8899
=== modified file 'src/privateoption.h'
--- src/privateoption.h 2012-01-24 08:24:18 +0000
+++ src/privateoption.h 2013-06-20 07:03:30 +0000
@@ -34,23 +34,27 @@
34#include <core/match.h>34#include <core/match.h>
35#include <core/screen.h>35#include <core/screen.h>
3636
37typedef struct _CompOptionIntRestriction {37typedef struct _CompOptionIntRestriction
38{
38 int min;39 int min;
39 int max;40 int max;
40} IntRestriction;41} IntRestriction;
4142
42typedef struct _CompOptionFloatRestriction {43typedef struct _CompOptionFloatRestriction
44{
43 float min;45 float min;
44 float max;46 float max;
45 float precision;47 float precision;
46} FloatRestriction;48} FloatRestriction;
4749
48typedef union {50typedef union
49 IntRestriction i;51{
50 FloatRestriction f;52 IntRestriction i;
53 FloatRestriction f;
51} RestrictionUnion;54} RestrictionUnion;
5255
53class PrivateRestriction {56class PrivateRestriction
57{
54 public:58 public:
55 CompOption::Type type;59 CompOption::Type type;
56 RestrictionUnion rest;60 RestrictionUnion rest;
5761
=== modified file 'src/privatescreen.h'
--- src/privatescreen.h 2013-05-12 08:20:10 +0000
+++ src/privatescreen.h 2013-06-20 07:03:30 +0000
@@ -53,10 +53,10 @@
5353
54class CoreWindow;54class CoreWindow;
5555
56extern bool shutDown;56extern bool shutDown;
57extern bool restartSignal;57extern bool restartSignal;
5858
59extern bool useDesktopHints;59extern bool useDesktopHints;
6060
61extern std::list <CompString> initialPlugins;61extern std::list <CompString> initialPlugins;
6262
@@ -66,27 +66,30 @@
66 CompAction::CallBack initiate;66 CompAction::CallBack initiate;
67 CompAction::CallBack terminate;67 CompAction::CallBack terminate;
6868
69 unsigned int edge;69 unsigned int edge;
70 unsigned int state;70 unsigned int state;
7171
72 CompOption::Vector options;72 CompOption::Vector options;
73} CompDelayedEdgeSettings;73} CompDelayedEdgeSettings;
7474
7575
76struct CompScreenEdge {76struct CompScreenEdge
77 Window id;77{
78 Window id;
78 unsigned int count;79 unsigned int count;
79};80};
8081
81struct CompGroup {82struct CompGroup
82 unsigned int refCnt;83{
83 Window id;84 unsigned int refCnt;
85 Window id;
84};86};
8587
86struct CompStartupSequence {88struct CompStartupSequence
87 SnStartupSequence *sequence;89{
88 unsigned int viewportX;90 SnStartupSequence *sequence;
89 unsigned int viewportY;91 unsigned int viewportX;
92 unsigned int viewportY;
90};93};
9194
92namespace compiz95namespace compiz
@@ -118,7 +121,7 @@
118121
119 typedef CompWindow::ForEach Functor;122 typedef CompWindow::ForEach Functor;
120123
121 WindowManager();124 WindowManager ();
122125
123 CompGroup * addGroup (Window id);126 CompGroup * addGroup (Window id);
124 void removeGroup (CompGroup *group);127 void removeGroup (CompGroup *group);
@@ -127,90 +130,102 @@
127 void eraseWindowFromMap (Window id);130 void eraseWindowFromMap (Window id);
128 void removeDestroyed ();131 void removeDestroyed ();
129132
130 void updateClientList (PrivateScreen& ps);133 void updateClientList (PrivateScreen &ps);
131134
132 void addToDestroyedWindows(CompWindow * cw)135 void addToDestroyedWindows (CompWindow *cw)
133 { destroyedWindows.push_back (cw); }136 { destroyedWindows.push_back (cw); }
134137
135 void incrementPendingDestroys() { pendingDestroys++; }138 void incrementPendingDestroys ()
136 const CompWindowVector& getClientList () const139 {
137 { return clientList; }140 ++pendingDestroys;
138 const CompWindowVector& getClientListStacking () const141 }
139 { return clientListStacking; }142
143 const CompWindowVector &getClientList () const
144 {
145 return clientList;
146 }
147
148 const CompWindowVector &getClientListStacking () const
149 {
150 return clientListStacking;
151 }
140152
141 CompWindow * findWindow (Window id) const;153 CompWindow * findWindow (Window id) const;
142 CompWindow * getTopWindow() const;154 CompWindow * getTopWindow () const;
143 CompWindow * getTopServerWindow() const;155 CompWindow * getTopServerWindow () const;
144156
145157
146 void removeFromFindWindowCache(CompWindow* w)158 void removeFromFindWindowCache (CompWindow *w)
147 {159 {
148 if (w == lastFoundWindow)160 if (w == lastFoundWindow)
149 lastFoundWindow = 0;161 lastFoundWindow = 0;
150 }162 }
151163
152 void addWindowToMap(CompWindow* w)164 void addWindowToMap(CompWindow *w)
153 {165 {
154 if (w->id () != 1)166 if (w->id () != 1)
155 windowsMap[w->id ()] = w;167 windowsMap[w->id ()] = w;
156 }168 }
157169
158 void validateServerWindows();170 void validateServerWindows ();
159171
160 void invalidateServerWindows();172 void invalidateServerWindows ();
161173
162 void insertWindow (CompWindow* w, Window aboveId);174 void insertWindow (CompWindow *w,
175 Window aboveId);
163 void unhookWindow (CompWindow *w);176 void unhookWindow (CompWindow *w);
164 CompWindowList& getWindows() { return windows; }177 CompWindowList &getWindows () { return windows; }
165178
166 CompWindowList& getDestroyedWindows() { return destroyedWindows; }179 CompWindowList &getDestroyedWindows () { return destroyedWindows; }
167180
168 void insertServerWindow(CompWindow* w, Window aboveId);181 void insertServerWindow (CompWindow *w,
169 void unhookServerWindow(CompWindow *w);182 Window aboveId);
170 CompWindowList& getServerWindows() { return serverWindows; }183 void unhookServerWindow (CompWindow *w);
184 CompWindowList &getServerWindows () { return serverWindows; }
171185
172 typedef CompWindowList::const_iterator iterator;186 typedef CompWindowList::const_iterator iterator;
173 typedef CompWindowList::const_reverse_iterator reverse_iterator;187 typedef CompWindowList::const_reverse_iterator reverse_iterator;
174188
175 iterator begin() const { return windows.begin(); }189 iterator begin () const { return windows.begin (); }
176 iterator end() const { return windows.end(); }190 iterator end () const { return windows.end (); }
177 reverse_iterator rbegin() const { return windows.rbegin(); }191 reverse_iterator rbegin () const { return windows.rbegin (); }
178 reverse_iterator rend() const { return windows.rend(); }192 reverse_iterator rend () const { return windows.rend (); }
179193
180 iterator serverBegin() const { return serverWindows.begin(); }194 iterator serverBegin () const { return serverWindows.begin (); }
181 iterator serverEnd() const { return serverWindows.end(); }195 iterator serverEnd () const { return serverWindows.end (); }
182 reverse_iterator rserverBegin() const { return serverWindows.rbegin(); }196 reverse_iterator rserverBegin () const { return serverWindows.rbegin (); }
183 reverse_iterator rserverEnd() const { return serverWindows.rend(); }197 reverse_iterator rserverEnd () const { return serverWindows.rend (); }
184198
185 void clearFullscreenHints() const;199 void clearFullscreenHints () const;
186 void showOrHideForDesktop(unsigned int desktop) const;200 void showOrHideForDesktop (unsigned int desktop) const;
187 void setWindowActiveness(::compiz::private_screen::History& history) const;201 void setWindowActiveness (::compiz::private_screen::History& history) const;
188 void setNumberOfDesktops (unsigned int nDesktop) const;202 void setNumberOfDesktops (unsigned int nDesktop) const;
189 void updateWindowSizes() const;203 void updateWindowSizes () const;
190204
191 void forEachWindow(Functor const& f) const205 void forEachWindow (Functor const& f) const
192 {206 {
193 std::for_each(windows.begin(), windows.end(), f);207 std::for_each (windows.begin (), windows.end (), f);
194 }208 }
195209
196 private:210 private:
197 CompWindowList windows;211
198 CompWindowList serverWindows;212 CompWindowList windows;
199 CompWindowList destroyedWindows;213 CompWindowList serverWindows;
200 bool stackIsFresh;214 CompWindowList destroyedWindows;
201215 bool stackIsFresh;
202 CompWindow::Map windowsMap;216
217 CompWindow::Map windowsMap;
203 std::list<CompGroup *> groups;218 std::list<CompGroup *> groups;
204219
205 CompWindowVector clientList; /* clients in mapping order */220 CompWindowVector clientList; /* clients in mapping order */
206 CompWindowVector clientListStacking; /* clients in stacking order */221 CompWindowVector clientListStacking; /* clients in stacking order */
207222
208 std::vector<Window> clientIdList; /* client ids in mapping order */223 std::vector<Window> clientIdList; /* client ids in mapping order */
209 std::vector<Window> clientIdListStacking;/* client ids in stacking order */224 std::vector<Window> clientIdListStacking;/* client ids in stacking order */
210225
211 unsigned int pendingDestroys;226 unsigned int pendingDestroys;
212227
213 mutable CompWindow* lastFoundWindow;228 mutable CompWindow *lastFoundWindow;
214};229};
215230
216unsigned int windowStateFromString (const char *str);231unsigned int windowStateFromString (const char *str);
@@ -218,11 +233,13 @@
218class PluginManager233class PluginManager
219{234{
220 public:235 public:
236
221 PluginManager();237 PluginManager();
222238
223 void updatePlugins (CompScreen* screen, CompOption::Value::Vector const& extraPluginsRequested);239 void updatePlugins (CompScreen *screen,
240 CompOption::Value::Vector const &extraPluginsRequested);
224241
225 void setPlugins(CompOption::Value::Vector const& vList)242 void setPlugins(CompOption::Value::Vector const &vList)
226 {243 {
227 plugin.set (CompOption::TypeString, vList);244 plugin.set (CompOption::TypeString, vList);
228 }245 }
@@ -230,9 +247,10 @@
230 bool isDirtyPluginList () const { return dirtyPluginList; }247 bool isDirtyPluginList () const { return dirtyPluginList; }
231 void setDirtyPluginList () { dirtyPluginList = true; }248 void setDirtyPluginList () { dirtyPluginList = true; }
232249
233 CompOption::Value::Vector mergedPluginList(CompOption::Value::Vector const& extraPluginsRequested) const;250 CompOption::Value::Vector mergedPluginList(CompOption::Value::Vector const &extraPluginsRequested) const;
234251
235 private:252 private:
253
236 CompOption::Value plugin;254 CompOption::Value plugin;
237 bool dirtyPluginList;255 bool dirtyPluginList;
238 typedef std::set<CompString> CompStringSet;256 typedef std::set<CompString> CompStringSet;
@@ -265,6 +283,7 @@
265 public GrabList283 public GrabList
266{284{
267 public:285 public:
286
268 EventManager ();287 EventManager ();
269 ~EventManager ();288 ~EventManager ();
270289
@@ -278,24 +297,22 @@
278 CompAction::State state,297 CompAction::State state,
279 CompOption::Vector &arguments);298 CompOption::Vector &arguments);
280299
281 void startEventLoop(Display* dpy);300 void startEventLoop (Display *dpy);
282 void quit() { mainloop->quit(); }301 void quit () { mainloop->quit(); }
283302
284 CompWatchFdHandle addWatchFd (303 CompWatchFdHandle addWatchFd (int fd,
285 int fd,304 short int events,
286 short int events,305 FdWatchCallBack callBack);
287 FdWatchCallBack callBack);
288306
289 void removeWatchFd (CompWatchFdHandle handle);307 void removeWatchFd (CompWatchFdHandle handle);
290308
291 CompFileWatch* addFileWatch (309 CompFileWatch* addFileWatch (const char *path,
292 const char *path,310 int mask,
293 int mask,311 FileWatchCallBack callBack);
294 FileWatchCallBack callBack);
295312
296 CompFileWatch* removeFileWatch (CompFileWatchHandle handle);313 CompFileWatch* removeFileWatch (CompFileWatchHandle handle);
297314
298 const CompFileWatchList& getFileWatches () const;315 const CompFileWatchList &getFileWatches () const;
299316
300 void grabNotified() { grabbed = true; }317 void grabNotified() { grabbed = true; }
301 void ungrabNotified() { grabbed = false; }318 void ungrabNotified() { grabbed = false; }
@@ -310,7 +327,8 @@
310 void resetPossibleTap() { possibleTap = 0; }327 void resetPossibleTap() { possibleTap = 0; }
311328
312 private:329 private:
313 void *possibleTap;330
331 void *possibleTap;
314332
315 Glib::RefPtr <Glib::MainLoop> mainloop;333 Glib::RefPtr <Glib::MainLoop> mainloop;
316334
@@ -338,22 +356,27 @@
338 Window grabWindow;356 Window grabWindow;
339};357};
340358
341class KeyGrab {359class KeyGrab
360{
342 public:361 public:
362
343 int keycode;363 int keycode;
344 unsigned int modifiers;364 unsigned int modifiers;
345 int count;365 int count;
346};366};
347367
348class ButtonGrab {368class ButtonGrab
369{
349 public:370 public:
371
350 int button;372 int button;
351 unsigned int modifiers;373 unsigned int modifiers;
352 int count;374 int count;
353};375};
354376
355struct Grab {377struct Grab
356 Grab(Cursor cursor, const char *name) : cursor(cursor), name(name) {}378{
379 Grab (Cursor cursor, const char *name) : cursor (cursor), name (name) {}
357 Cursor cursor;380 Cursor cursor;
358 const char *name;381 const char *name;
359};382};
@@ -371,40 +394,44 @@
371394
372class GrabManager : boost::noncopyable395class GrabManager : boost::noncopyable
373{396{
374public:397 public:
375 GrabManager(CompScreen *screen);398
376399 GrabManager(CompScreen *screen);
377 bool addPassiveKeyGrab (CompAction::KeyBinding &key);400
378 void removePassiveKeyGrab (CompAction::KeyBinding &key);401 bool addPassiveKeyGrab (CompAction::KeyBinding &key);
379 bool addPassiveButtonGrab (CompAction::ButtonBinding &button);402 void removePassiveKeyGrab (CompAction::KeyBinding &key);
380 void removePassiveButtonGrab (CompAction::ButtonBinding &button);403 bool addPassiveButtonGrab (CompAction::ButtonBinding &button);
381404 void removePassiveButtonGrab (CompAction::ButtonBinding &button);
382 void grabUngrabOneKey (unsigned int modifiers,405
383 int keycode,406 void grabUngrabOneKey (unsigned int modifiers,
384 bool grab);407 int keycode,
385 bool grabUngrabKeys (unsigned int modifiers,408 bool grab);
386 int keycode,409 bool grabUngrabKeys (unsigned int modifiers,
387 bool grab);410 int keycode,
388 void updatePassiveKeyGrabs ();411 bool grab);
389 void updatePassiveButtonGrabs(Window serverFrame);412 void updatePassiveKeyGrabs ();
390413 void updatePassiveButtonGrabs(Window serverFrame);
391 void setCurrentState(CompAction::State state);414
392415 void setCurrentState(CompAction::State state);
393private:416
394 CompScreen * const screen;417 private:
395 CompAction::State currentState;418
396419 CompScreen *const screen;
397 std::list<ButtonGrab> buttonGrabs;420 CompAction::State currentState;
398 std::list<KeyGrab> keyGrabs;421
422 std::list<ButtonGrab> buttonGrabs;
423 std::list<KeyGrab> keyGrabs;
399};424};
400425
401class History : public virtual ::compiz::History,426class History : public virtual ::compiz::History,
402 boost::noncopyable427 boost::noncopyable
403{428{
404 public:429 public:
430
405 History();431 History();
406432
407 void setCurrentActiveWindowHistory (int x, int y);433 void setCurrentActiveWindowHistory (int x,
434 int y);
408435
409 void addToCurrentActiveWindowHistory (Window id);436 void addToCurrentActiveWindowHistory (Window id);
410437
@@ -414,9 +441,10 @@
414 unsigned int activeNum () const;441 unsigned int activeNum () const;
415442
416 private:443 private:
444
417 CompActiveWindowHistory history[ACTIVE_WINDOW_HISTORY_NUM];445 CompActiveWindowHistory history[ACTIVE_WINDOW_HISTORY_NUM];
418 int currentHistory_;446 int currentHistory_;
419 unsigned int activeNum_;447 unsigned int activeNum_;
420};448};
421449
422class ViewportRetrievalInterface450class ViewportRetrievalInterface
@@ -449,14 +477,15 @@
449namespace viewports477namespace viewports
450{478{
451 void viewportForGeometry (const CompWindow::Geometry &gm,479 void viewportForGeometry (const CompWindow::Geometry &gm,
452 CompPoint &viewport,480 CompPoint &viewport,
453 ViewportRetrievalInterface *viewports,481 ViewportRetrievalInterface *viewports,
454 const CompSize &screenSize);482 const CompSize &screenSize);
455}483}
456484
457class StartupSequence : boost::noncopyable485class StartupSequence : boost::noncopyable
458{486{
459 public:487 public:
488
460 StartupSequence();489 StartupSequence();
461 void addSequence (SnStartupSequence *sequence, CompPoint const& vp);490 void addSequence (SnStartupSequence *sequence, CompPoint const& vp);
462 void removeSequence (SnStartupSequence *sequence);491 void removeSequence (SnStartupSequence *sequence);
@@ -466,6 +495,7 @@
466 virtual void updateStartupFeedback () = 0;495 virtual void updateStartupFeedback () = 0;
467 bool emptySequence() const { return startupSequences.empty(); }496 bool emptySequence() const { return startupSequences.empty(); }
468 private:497 private:
498
469 std::list<CompStartupSequence *> startupSequences;499 std::list<CompStartupSequence *> startupSequences;
470 CompTimer startupSequenceTimer;500 CompTimer startupSequenceTimer;
471};501};
@@ -474,44 +504,49 @@
474class StartupSequenceImpl : public StartupSequence504class StartupSequenceImpl : public StartupSequence
475{505{
476 public:506 public:
477 StartupSequenceImpl(PrivateScreen* priv) : priv(priv) {}507
508 StartupSequenceImpl(PrivateScreen *priv) : priv (priv) {}
478509
479 virtual void updateStartupFeedback ();510 virtual void updateStartupFeedback ();
480 private:511 private:
481 PrivateScreen* const priv;512
513 PrivateScreen *const priv;
482};514};
483515
484class Extension516class Extension
485{517{
486public:518 public:
487 Extension() : is_enabled(), extension() {}519
488520 Extension() : is_enabled(), extension() {}
489 template<Bool ExtensionQuery (Display*, int*, int*)>521
490 bool init(Display * dpy)522 template<Bool ExtensionQuery (Display*, int*, int*)>
491 {523 bool init(Display * dpy)
492 int error;524 {
493 is_enabled = ExtensionQuery(dpy, &extension, &error);525 int error;
494 return is_enabled;526 is_enabled = ExtensionQuery(dpy, &extension, &error);
495 }527 return is_enabled;
496528 }
497 template<Bool ExtensionQuery(Display*, int*, int*, int*, int*, int*)>529
498 bool init(Display * dpy)530 template<Bool ExtensionQuery(Display*, int*, int*, int*, int*, int*)>
499 {531 bool init(Display * dpy)
500 int opcode;532 {
501 int error;533 int opcode;
502 is_enabled = ExtensionQuery(dpy, &opcode, &extension, &error, NULL, NULL);534 int error;
503535 is_enabled = ExtensionQuery(dpy, &opcode, &extension, &error, NULL, NULL);
504 if (!is_enabled) extension = -1;536
505537 if (!is_enabled)
506 return is_enabled;538 extension = -1;
507 }539
508540 return is_enabled;
509 int isEnabled () const { return is_enabled; }541 }
510 int get () const { return extension; }542
511543 int isEnabled () const { return is_enabled; }
512private:544 int get () const { return extension; }
513 bool is_enabled;545
514 int extension;546 private:
547
548 bool is_enabled;
549 int extension;
515};550};
516551
517class Ping :552class Ping :
@@ -724,6 +759,7 @@
724 { pingTimer.setCallback(callback); }759 { pingTimer.setCallback(callback); }
725760
726public:761public:
762
727 Display* dpy;763 Display* dpy;
728 compiz::private_screen::Extension xSync;764 compiz::private_screen::Extension xSync;
729 compiz::private_screen::Extension xRandr;765 compiz::private_screen::Extension xRandr;
@@ -744,7 +780,6 @@
744780
745 Window wmSnSelectionWindow;781 Window wmSnSelectionWindow;
746782
747 int clientPointerDeviceId;
748 Cursor normalCursor;783 Cursor normalCursor;
749 Cursor busyCursor;784 Cursor busyCursor;
750 Cursor invisibleCursor;785 Cursor invisibleCursor;
@@ -753,6 +788,7 @@
753 bool initialized;788 bool initialized;
754789
755private:790private:
791
756 CompScreen* screen;792 CompScreen* screen;
757 compiz::private_screen::Extension xkbEvent;793 compiz::private_screen::Extension xkbEvent;
758794
@@ -822,6 +858,7 @@
822 ::compiz::private_screen::History858 ::compiz::private_screen::History
823{859{
824 public:860 public:
861
825 CompScreenImpl ();862 CompScreenImpl ();
826 ~CompScreenImpl ();863 ~CompScreenImpl ();
827864
@@ -919,7 +956,8 @@
919 CompWindowList & serverWindows ();956 CompWindowList & serverWindows ();
920 CompWindowList & destroyedWindows ();957 CompWindowList & destroyedWindows ();
921958
922 void warpPointer (int dx, int dy);959 void warpPointer (int dx,
960 int dy);
923961
924 Time getCurrentTime ();962 Time getCurrentTime ();
925963
@@ -929,7 +967,8 @@
929967
930 void focusDefaultWindow ();968 void focusDefaultWindow ();
931969
932 void insertWindow (CompWindow *w, Window aboveId);970 void insertWindow (CompWindow *w,
971 Window aboveId);
933 void unhookWindow (CompWindow *w);972 void unhookWindow (CompWindow *w);
934973
935 void insertServerWindow (CompWindow *w, Window aboveId);974 void insertServerWindow (CompWindow *w, Window aboveId);
@@ -981,7 +1020,9 @@
9811020
982 void runCommand (CompString command);1021 void runCommand (CompString command);
9831022
984 void moveViewport (int tx, int ty, bool sync);1023 void moveViewport (int tx,
1024 int ty,
1025 bool sync);
9851026
986 void sendWindowActivationRequest (Window id);1027 void sendWindowActivationRequest (Window id);
9871028
@@ -1026,32 +1067,32 @@
10261067
1027 void updateSupportedWmHints ();1068 void updateSupportedWmHints ();
10281069
1029 unsigned int showingDesktopMask() const;1070 unsigned int showingDesktopMask () const;
1030 virtual bool grabsEmpty() const;1071 virtual bool grabsEmpty () const;
1031 virtual void sizePluginClasses(unsigned int size);1072 virtual void sizePluginClasses (unsigned int size);
1032 virtual void setWindowState (unsigned int state, Window id);1073 virtual void setWindowState (unsigned int state, Window id);
1033 virtual void addToDestroyedWindows(CompWindow * cw);1074 virtual void addToDestroyedWindows (CompWindow * cw);
1034 virtual void processEvents ();1075 virtual void processEvents ();
1035 virtual void alwaysHandleEvent (XEvent *event);1076 virtual void alwaysHandleEvent (XEvent *event);
10361077
1037 virtual ServerGrabInterface * serverGrabInterface ();1078 virtual ServerGrabInterface * serverGrabInterface ();
10381079
1039 virtual void updatePassiveKeyGrabs () const;1080 virtual void updatePassiveKeyGrabs () const;
1040 virtual void updatePassiveButtonGrabs(Window serverFrame);1081 virtual void updatePassiveButtonGrabs (Window serverFrame);
10411082
1042 virtual bool displayInitialised() const;1083 virtual bool displayInitialised () const;
1043 virtual void applyStartupProperties (CompWindow *window);1084 virtual void applyStartupProperties (CompWindow *window);
1044 virtual void updateClientList();1085 virtual void updateClientList ();
1045 virtual CompWindow * getTopWindow() const;1086 virtual CompWindow * getTopWindow () const;
1046 virtual CompWindow * getTopServerWindow() const;1087 virtual CompWindow * getTopServerWindow () const;
1047 virtual CoreOptions& getCoreOptions();1088 virtual CoreOptions& getCoreOptions ();
1048 virtual Colormap colormap() const;1089 virtual Colormap colormap () const;
1049 virtual void setCurrentDesktop (unsigned int desktop);1090 virtual void setCurrentDesktop (unsigned int desktop);
1050 virtual Window activeWindow() const;1091 virtual Window activeWindow () const;
1051 virtual bool grabWindowIsNot(Window w) const;1092 virtual bool grabWindowIsNot (Window w) const;
1052 virtual void incrementPendingDestroys();1093 virtual void incrementPendingDestroys ();
1053 virtual void setNextActiveWindow(Window id);1094 virtual void setNextActiveWindow (Window id);
1054 virtual Window getNextActiveWindow() const;1095 virtual Window getNextActiveWindow () const;
1055 virtual CompWindow * focusTopMostWindow ();1096 virtual CompWindow * focusTopMostWindow ();
10561097
1057 public :1098 public :
@@ -1120,43 +1161,54 @@
11201161
11211162
1122 private:1163 private:
1123 virtual bool _setOptionForPlugin(const char *, const char *, CompOption::Value &);1164 virtual bool _setOptionForPlugin (const char *, const char *, CompOption::Value &);
1124 virtual bool _initPluginForScreen(CompPlugin *);1165 virtual bool _initPluginForScreen (CompPlugin *);
1125 virtual void _finiPluginForScreen(CompPlugin *);1166 virtual void _finiPluginForScreen (CompPlugin *);
1126 virtual void _handleEvent(XEvent *event);1167 virtual void _handleEvent (XEvent *event);
1127 virtual void _logMessage(const char *, CompLogLevel, const char*);1168 virtual void _logMessage (const char *,
1128 virtual void _enterShowDesktopMode();1169 CompLogLevel, const char *);
1129 virtual void _leaveShowDesktopMode(CompWindow *);1170 virtual void _enterShowDesktopMode ();
1130 virtual void _addSupportedAtoms(std::vector<Atom>& atoms);1171 virtual void _leaveShowDesktopMode (CompWindow *);
1172 virtual void _addSupportedAtoms (std::vector<Atom>& atoms);
11311173
1132 // These are stubs - but allow mocking of AbstractCompWindow1174 // These are stubs - but allow mocking of AbstractCompWindow
1133 virtual void _fileWatchAdded(CompFileWatch *);1175 virtual void _fileWatchAdded (CompFileWatch *);
1134 virtual void _fileWatchRemoved(CompFileWatch *);1176 virtual void _fileWatchRemoved (CompFileWatch *);
1135 virtual void _sessionEvent(CompSession::Event, CompOption::Vector &);1177 virtual void _sessionEvent (CompSession::Event ,
1136 virtual void _handleCompizEvent(const char *, const char *, CompOption::Vector &);1178 CompOption::Vector &);
1137 virtual bool _fileToImage(CompString &, CompSize &, int &, void *&);1179 virtual void _handleCompizEvent (const char *,
1138 virtual bool _imageToFile(CompString &, CompString &, CompSize &, int, void *);1180 const char *,
1139 virtual CompMatch::Expression * _matchInitExp(const CompString&);1181 CompOption::Vector &);
1140 virtual void _matchExpHandlerChanged();1182 virtual bool _fileToImage (CompString &,
1141 virtual void _matchPropertyChanged(CompWindow *);1183 CompSize &,
1142 virtual void _outputChangeNotify();1184 int &,
1185 void *&);
1186 virtual bool _imageToFile (CompString &,
1187 CompString &,
1188 CompSize &,
1189 int ,
1190 void *);
1191 virtual CompMatch::Expression * _matchInitExp (const CompString &);
1192 virtual void _matchExpHandlerChanged ();
1193 virtual void _matchPropertyChanged (CompWindow *);
1194 virtual void _outputChangeNotify ();
11431195
1144 void grabServer ();1196 void grabServer ();
1145 void ungrabServer ();1197 void ungrabServer ();
1146 void syncServer ();1198 void syncServer ();
11471199
1148 bool handlePingTimeout();1200 bool handlePingTimeout();
11491201
1150 Window below;1202 Window below;
1151 CompTimer autoRaiseTimer_;1203 CompTimer autoRaiseTimer_;
1152 Window autoRaiseWindow_;1204 Window autoRaiseWindow_;
1153 CompIcon *defaultIcon_;1205 CompIcon *defaultIcon_;
1154 compiz::private_screen::GrabManager mutable grabManager;1206 compiz::private_screen::GrabManager mutable grabManager;
1155 ValueHolder valueHolder;1207 ValueHolder valueHolder;
1156 bool eventHandled;1208 bool eventHandled;
1157 PrivateScreen privateScreen;1209 PrivateScreen privateScreen;
1158 compiz::private_screen::WindowManager windowManager;1210 compiz::private_screen::WindowManager windowManager;
1159 unsigned int showingDesktopMask_;1211 unsigned int showingDesktopMask_;
1160};1212};
11611213
1162#endif1214#endif

Subscribers

People subscribed via source and target branches

to all changes: