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
1=== modified file 'src/asyncserverwindow.h'
2--- src/asyncserverwindow.h 2012-12-13 11:12:32 +0000
3+++ src/asyncserverwindow.h 2013-06-20 07:03:30 +0000
4@@ -39,11 +39,15 @@
5
6 virtual int requestConfigureOnClient (const XWindowChanges &xwc,
7 unsigned int valueMask) = 0;
8+
9 virtual int requestConfigureOnWrapper (const XWindowChanges &xwc,
10 unsigned int valueMask) = 0;
11+
12 virtual int requestConfigureOnFrame (const XWindowChanges &xwc,
13 unsigned int valueMask) = 0;
14+
15 virtual void sendSyntheticConfigureNotify () = 0;
16+
17 virtual bool hasCustomShape () const = 0;
18 };
19 }
20
21=== modified file 'src/configurerequestbuffer-impl.h'
22--- src/configurerequestbuffer-impl.h 2012-12-13 11:12:32 +0000
23+++ src/configurerequestbuffer-impl.h 2013-06-20 07:03:30 +0000
24@@ -59,6 +59,7 @@
25 public Releasable
26 {
27 public:
28+
29 typedef boost::shared_ptr <BufferLock> Ptr;
30
31 virtual ~BufferLock () {}
32@@ -89,9 +90,12 @@
33
34 void untrackLock (compiz::window::configure_buffers::BufferLock *lock);
35
36- void pushClientRequest (const XWindowChanges &xwc, unsigned int mask);
37- void pushWrapperRequest (const XWindowChanges &xwc, unsigned int mask);
38- void pushFrameRequest (const XWindowChanges &xwc, unsigned int mask);
39+ void pushClientRequest (const XWindowChanges &xwc,
40+ unsigned int mask);
41+ void pushWrapperRequest (const XWindowChanges &xwc,
42+ unsigned int mask);
43+ void pushFrameRequest (const XWindowChanges &xwc,
44+ unsigned int mask);
45 void pushSyntheticConfigureNotify ();
46 compiz::window::configure_buffers::Releasable::Ptr obtainLock ();
47
48
49=== modified file 'src/eventmanagement.h'
50--- src/eventmanagement.h 2012-10-11 10:06:30 +0000
51+++ src/eventmanagement.h 2013-06-20 07:03:30 +0000
52@@ -75,6 +75,4 @@
53 }
54 }
55
56-
57-
58 #endif
59
60=== modified file 'src/privateaction.h'
61--- src/privateaction.h 2012-10-02 10:28:01 +0000
62+++ src/privateaction.h 2013-06-20 07:03:30 +0000
63@@ -41,8 +41,8 @@
64 virtual void setActive (bool) = 0;
65 };
66
67-void setActionActiveState (const CompAction &action,
68- bool active);
69+void setActionActiveState (const CompAction &action,
70+ bool active);
71 }
72 }
73
74@@ -50,15 +50,16 @@
75 public compiz::actions::BoundAction
76 {
77 public:
78+
79 PrivateAction ();
80- PrivateAction (const PrivateAction&);
81+ PrivateAction (const PrivateAction &);
82
83 void setActive (bool);
84
85- CompAction::CallBack initiate;
86- CompAction::CallBack terminate;
87+ CompAction::CallBack initiate;
88+ CompAction::CallBack terminate;
89
90- CompAction::State state;
91+ CompAction::State state;
92
93 CompAction::BindingType type;
94
95
96=== modified file 'src/privateeventsource.h'
97--- src/privateeventsource.h 2012-12-02 12:06:02 +0000
98+++ src/privateeventsource.h 2013-06-20 07:03:30 +0000
99@@ -54,9 +54,9 @@
100
101 private:
102
103- Display *mDpy;
104- Glib::PollFD mPollFD;
105- int mConnectionFD;
106+ Display *mDpy;
107+ Glib::PollFD mPollFD;
108+ int mConnectionFD;
109 };
110
111 #endif
112
113=== modified file 'src/privateiosource.h'
114--- src/privateiosource.h 2012-12-02 12:06:02 +0000
115+++ src/privateiosource.h 2013-06-20 07:03:30 +0000
116@@ -47,22 +47,25 @@
117 virtual ~CompWatchFd ();
118
119 static
120- CompWatchFd * create (int,
121- Glib::IOCondition,
122- FdWatchCallBack);
123+ CompWatchFd * create (int ,
124+ Glib::IOCondition ,
125+ FdWatchCallBack );
126
127 protected:
128
129- explicit CompWatchFd (int, Glib::IOCondition, FdWatchCallBack);
130- bool internalCallback (Glib::IOCondition);
131+ explicit
132+ CompWatchFd (int ,
133+ Glib::IOCondition ,
134+ FdWatchCallBack );
135+ bool internalCallback (Glib::IOCondition);
136
137 private:
138
139- int mFd;
140+ int mFd;
141 FdWatchCallBack mCallBack;
142 CompWatchFdHandle mHandle;
143- bool mForceFail;
144- bool mExecuting;
145+ bool mForceFail;
146+ bool mExecuting;
147
148 friend class ::compiz::private_screen::EventManager;
149 };
150
151=== modified file 'src/privatematch.h'
152--- src/privatematch.h 2009-03-16 09:18:16 +0000
153+++ src/privatematch.h 2013-06-20 07:03:30 +0000
154@@ -34,9 +34,12 @@
155 #define MATCH_OP_AND_MASK (1 << 0)
156 #define MATCH_OP_NOT_MASK (1 << 1)
157
158-class MatchOp {
159+class MatchOp
160+{
161 public:
162- typedef enum {
163+
164+ typedef enum
165+ {
166 TypeNone,
167 TypeGroup,
168 TypeExp
169@@ -52,22 +55,27 @@
170 unsigned int flags;
171 };
172
173-class MatchExpOp : public MatchOp {
174+class MatchExpOp : public MatchOp
175+{
176 public:
177+
178 MatchExpOp ();
179 MatchExpOp (const MatchExpOp &);
180
181 MatchOp::Type type () { return MatchOp::TypeExp; };
182
183- CompString value;
184+ CompString value;
185
186 boost::shared_ptr<CompMatch::Expression> e;
187 };
188
189-class MatchGroupOp : public MatchOp {
190+class MatchGroupOp : public MatchOp
191+{
192 public:
193+
194 MatchGroupOp ();
195 ~MatchGroupOp ();
196+
197 MatchGroupOp (const MatchGroupOp &);
198
199 MatchGroupOp & operator= (const MatchGroupOp &);
200@@ -77,11 +85,14 @@
201 MatchOp::List op;
202 };
203
204-class PrivateMatch {
205+class PrivateMatch
206+{
207 public:
208+
209 PrivateMatch ();
210
211 public:
212+
213 MatchGroupOp op;
214 };
215
216
217=== modified file 'src/privateoption.h'
218--- src/privateoption.h 2012-01-24 08:24:18 +0000
219+++ src/privateoption.h 2013-06-20 07:03:30 +0000
220@@ -34,23 +34,27 @@
221 #include <core/match.h>
222 #include <core/screen.h>
223
224-typedef struct _CompOptionIntRestriction {
225+typedef struct _CompOptionIntRestriction
226+{
227 int min;
228 int max;
229 } IntRestriction;
230
231-typedef struct _CompOptionFloatRestriction {
232+typedef struct _CompOptionFloatRestriction
233+{
234 float min;
235 float max;
236 float precision;
237 } FloatRestriction;
238
239-typedef union {
240- IntRestriction i;
241- FloatRestriction f;
242+typedef union
243+{
244+ IntRestriction i;
245+ FloatRestriction f;
246 } RestrictionUnion;
247
248-class PrivateRestriction {
249+class PrivateRestriction
250+{
251 public:
252 CompOption::Type type;
253 RestrictionUnion rest;
254
255=== modified file 'src/privatescreen.h'
256--- src/privatescreen.h 2013-05-12 08:20:10 +0000
257+++ src/privatescreen.h 2013-06-20 07:03:30 +0000
258@@ -53,10 +53,10 @@
259
260 class CoreWindow;
261
262-extern bool shutDown;
263-extern bool restartSignal;
264+extern bool shutDown;
265+extern bool restartSignal;
266
267-extern bool useDesktopHints;
268+extern bool useDesktopHints;
269
270 extern std::list <CompString> initialPlugins;
271
272@@ -66,27 +66,30 @@
273 CompAction::CallBack initiate;
274 CompAction::CallBack terminate;
275
276- unsigned int edge;
277- unsigned int state;
278+ unsigned int edge;
279+ unsigned int state;
280
281- CompOption::Vector options;
282+ CompOption::Vector options;
283 } CompDelayedEdgeSettings;
284
285
286-struct CompScreenEdge {
287- Window id;
288+struct CompScreenEdge
289+{
290+ Window id;
291 unsigned int count;
292 };
293
294-struct CompGroup {
295- unsigned int refCnt;
296- Window id;
297+struct CompGroup
298+{
299+ unsigned int refCnt;
300+ Window id;
301 };
302
303-struct CompStartupSequence {
304- SnStartupSequence *sequence;
305- unsigned int viewportX;
306- unsigned int viewportY;
307+struct CompStartupSequence
308+{
309+ SnStartupSequence *sequence;
310+ unsigned int viewportX;
311+ unsigned int viewportY;
312 };
313
314 namespace compiz
315@@ -118,7 +121,7 @@
316
317 typedef CompWindow::ForEach Functor;
318
319- WindowManager();
320+ WindowManager ();
321
322 CompGroup * addGroup (Window id);
323 void removeGroup (CompGroup *group);
324@@ -127,90 +130,102 @@
325 void eraseWindowFromMap (Window id);
326 void removeDestroyed ();
327
328- void updateClientList (PrivateScreen& ps);
329+ void updateClientList (PrivateScreen &ps);
330
331- void addToDestroyedWindows(CompWindow * cw)
332+ void addToDestroyedWindows (CompWindow *cw)
333 { destroyedWindows.push_back (cw); }
334
335- void incrementPendingDestroys() { pendingDestroys++; }
336- const CompWindowVector& getClientList () const
337- { return clientList; }
338- const CompWindowVector& getClientListStacking () const
339- { return clientListStacking; }
340+ void incrementPendingDestroys ()
341+ {
342+ ++pendingDestroys;
343+ }
344+
345+ const CompWindowVector &getClientList () const
346+ {
347+ return clientList;
348+ }
349+
350+ const CompWindowVector &getClientListStacking () const
351+ {
352+ return clientListStacking;
353+ }
354
355 CompWindow * findWindow (Window id) const;
356- CompWindow * getTopWindow() const;
357- CompWindow * getTopServerWindow() const;
358-
359-
360- void removeFromFindWindowCache(CompWindow* w)
361+ CompWindow * getTopWindow () const;
362+ CompWindow * getTopServerWindow () const;
363+
364+
365+ void removeFromFindWindowCache (CompWindow *w)
366 {
367 if (w == lastFoundWindow)
368 lastFoundWindow = 0;
369 }
370
371- void addWindowToMap(CompWindow* w)
372+ void addWindowToMap(CompWindow *w)
373 {
374 if (w->id () != 1)
375 windowsMap[w->id ()] = w;
376 }
377
378- void validateServerWindows();
379-
380- void invalidateServerWindows();
381-
382- void insertWindow (CompWindow* w, Window aboveId);
383+ void validateServerWindows ();
384+
385+ void invalidateServerWindows ();
386+
387+ void insertWindow (CompWindow *w,
388+ Window aboveId);
389 void unhookWindow (CompWindow *w);
390- CompWindowList& getWindows() { return windows; }
391-
392- CompWindowList& getDestroyedWindows() { return destroyedWindows; }
393-
394- void insertServerWindow(CompWindow* w, Window aboveId);
395- void unhookServerWindow(CompWindow *w);
396- CompWindowList& getServerWindows() { return serverWindows; }
397+ CompWindowList &getWindows () { return windows; }
398+
399+ CompWindowList &getDestroyedWindows () { return destroyedWindows; }
400+
401+ void insertServerWindow (CompWindow *w,
402+ Window aboveId);
403+ void unhookServerWindow (CompWindow *w);
404+ CompWindowList &getServerWindows () { return serverWindows; }
405
406 typedef CompWindowList::const_iterator iterator;
407 typedef CompWindowList::const_reverse_iterator reverse_iterator;
408
409- iterator begin() const { return windows.begin(); }
410- iterator end() const { return windows.end(); }
411- reverse_iterator rbegin() const { return windows.rbegin(); }
412- reverse_iterator rend() const { return windows.rend(); }
413-
414- iterator serverBegin() const { return serverWindows.begin(); }
415- iterator serverEnd() const { return serverWindows.end(); }
416- reverse_iterator rserverBegin() const { return serverWindows.rbegin(); }
417- reverse_iterator rserverEnd() const { return serverWindows.rend(); }
418-
419- void clearFullscreenHints() const;
420- void showOrHideForDesktop(unsigned int desktop) const;
421- void setWindowActiveness(::compiz::private_screen::History& history) const;
422+ iterator begin () const { return windows.begin (); }
423+ iterator end () const { return windows.end (); }
424+ reverse_iterator rbegin () const { return windows.rbegin (); }
425+ reverse_iterator rend () const { return windows.rend (); }
426+
427+ iterator serverBegin () const { return serverWindows.begin (); }
428+ iterator serverEnd () const { return serverWindows.end (); }
429+ reverse_iterator rserverBegin () const { return serverWindows.rbegin (); }
430+ reverse_iterator rserverEnd () const { return serverWindows.rend (); }
431+
432+ void clearFullscreenHints () const;
433+ void showOrHideForDesktop (unsigned int desktop) const;
434+ void setWindowActiveness (::compiz::private_screen::History& history) const;
435 void setNumberOfDesktops (unsigned int nDesktop) const;
436- void updateWindowSizes() const;
437+ void updateWindowSizes () const;
438
439- void forEachWindow(Functor const& f) const
440+ void forEachWindow (Functor const& f) const
441 {
442- std::for_each(windows.begin(), windows.end(), f);
443+ std::for_each (windows.begin (), windows.end (), f);
444 }
445
446 private:
447- CompWindowList windows;
448- CompWindowList serverWindows;
449- CompWindowList destroyedWindows;
450- bool stackIsFresh;
451-
452- CompWindow::Map windowsMap;
453+
454+ CompWindowList windows;
455+ CompWindowList serverWindows;
456+ CompWindowList destroyedWindows;
457+ bool stackIsFresh;
458+
459+ CompWindow::Map windowsMap;
460 std::list<CompGroup *> groups;
461
462- CompWindowVector clientList; /* clients in mapping order */
463- CompWindowVector clientListStacking; /* clients in stacking order */
464-
465- std::vector<Window> clientIdList; /* client ids in mapping order */
466- std::vector<Window> clientIdListStacking;/* client ids in stacking order */
467-
468- unsigned int pendingDestroys;
469-
470- mutable CompWindow* lastFoundWindow;
471+ CompWindowVector clientList; /* clients in mapping order */
472+ CompWindowVector clientListStacking; /* clients in stacking order */
473+
474+ std::vector<Window> clientIdList; /* client ids in mapping order */
475+ std::vector<Window> clientIdListStacking;/* client ids in stacking order */
476+
477+ unsigned int pendingDestroys;
478+
479+ mutable CompWindow *lastFoundWindow;
480 };
481
482 unsigned int windowStateFromString (const char *str);
483@@ -218,11 +233,13 @@
484 class PluginManager
485 {
486 public:
487+
488 PluginManager();
489
490- void updatePlugins (CompScreen* screen, CompOption::Value::Vector const& extraPluginsRequested);
491+ void updatePlugins (CompScreen *screen,
492+ CompOption::Value::Vector const &extraPluginsRequested);
493
494- void setPlugins(CompOption::Value::Vector const& vList)
495+ void setPlugins(CompOption::Value::Vector const &vList)
496 {
497 plugin.set (CompOption::TypeString, vList);
498 }
499@@ -230,9 +247,10 @@
500 bool isDirtyPluginList () const { return dirtyPluginList; }
501 void setDirtyPluginList () { dirtyPluginList = true; }
502
503- CompOption::Value::Vector mergedPluginList(CompOption::Value::Vector const& extraPluginsRequested) const;
504+ CompOption::Value::Vector mergedPluginList(CompOption::Value::Vector const &extraPluginsRequested) const;
505
506 private:
507+
508 CompOption::Value plugin;
509 bool dirtyPluginList;
510 typedef std::set<CompString> CompStringSet;
511@@ -265,6 +283,7 @@
512 public GrabList
513 {
514 public:
515+
516 EventManager ();
517 ~EventManager ();
518
519@@ -278,24 +297,22 @@
520 CompAction::State state,
521 CompOption::Vector &arguments);
522
523- void startEventLoop(Display* dpy);
524- void quit() { mainloop->quit(); }
525+ void startEventLoop (Display *dpy);
526+ void quit () { mainloop->quit(); }
527
528- CompWatchFdHandle addWatchFd (
529- int fd,
530- short int events,
531- FdWatchCallBack callBack);
532+ CompWatchFdHandle addWatchFd (int fd,
533+ short int events,
534+ FdWatchCallBack callBack);
535
536 void removeWatchFd (CompWatchFdHandle handle);
537
538- CompFileWatch* addFileWatch (
539- const char *path,
540- int mask,
541- FileWatchCallBack callBack);
542+ CompFileWatch* addFileWatch (const char *path,
543+ int mask,
544+ FileWatchCallBack callBack);
545
546 CompFileWatch* removeFileWatch (CompFileWatchHandle handle);
547
548- const CompFileWatchList& getFileWatches () const;
549+ const CompFileWatchList &getFileWatches () const;
550
551 void grabNotified() { grabbed = true; }
552 void ungrabNotified() { grabbed = false; }
553@@ -310,7 +327,8 @@
554 void resetPossibleTap() { possibleTap = 0; }
555
556 private:
557- void *possibleTap;
558+
559+ void *possibleTap;
560
561 Glib::RefPtr <Glib::MainLoop> mainloop;
562
563@@ -338,22 +356,27 @@
564 Window grabWindow;
565 };
566
567-class KeyGrab {
568+class KeyGrab
569+{
570 public:
571+
572 int keycode;
573 unsigned int modifiers;
574 int count;
575 };
576
577-class ButtonGrab {
578+class ButtonGrab
579+{
580 public:
581+
582 int button;
583 unsigned int modifiers;
584 int count;
585 };
586
587-struct Grab {
588- Grab(Cursor cursor, const char *name) : cursor(cursor), name(name) {}
589+struct Grab
590+{
591+ Grab (Cursor cursor, const char *name) : cursor (cursor), name (name) {}
592 Cursor cursor;
593 const char *name;
594 };
595@@ -371,40 +394,44 @@
596
597 class GrabManager : boost::noncopyable
598 {
599-public:
600- GrabManager(CompScreen *screen);
601-
602- bool addPassiveKeyGrab (CompAction::KeyBinding &key);
603- void removePassiveKeyGrab (CompAction::KeyBinding &key);
604- bool addPassiveButtonGrab (CompAction::ButtonBinding &button);
605- void removePassiveButtonGrab (CompAction::ButtonBinding &button);
606-
607- void grabUngrabOneKey (unsigned int modifiers,
608- int keycode,
609- bool grab);
610- bool grabUngrabKeys (unsigned int modifiers,
611- int keycode,
612- bool grab);
613- void updatePassiveKeyGrabs ();
614- void updatePassiveButtonGrabs(Window serverFrame);
615-
616- void setCurrentState(CompAction::State state);
617-
618-private:
619- CompScreen * const screen;
620- CompAction::State currentState;
621-
622- std::list<ButtonGrab> buttonGrabs;
623- std::list<KeyGrab> keyGrabs;
624+ public:
625+
626+ GrabManager(CompScreen *screen);
627+
628+ bool addPassiveKeyGrab (CompAction::KeyBinding &key);
629+ void removePassiveKeyGrab (CompAction::KeyBinding &key);
630+ bool addPassiveButtonGrab (CompAction::ButtonBinding &button);
631+ void removePassiveButtonGrab (CompAction::ButtonBinding &button);
632+
633+ void grabUngrabOneKey (unsigned int modifiers,
634+ int keycode,
635+ bool grab);
636+ bool grabUngrabKeys (unsigned int modifiers,
637+ int keycode,
638+ bool grab);
639+ void updatePassiveKeyGrabs ();
640+ void updatePassiveButtonGrabs(Window serverFrame);
641+
642+ void setCurrentState(CompAction::State state);
643+
644+ private:
645+
646+ CompScreen *const screen;
647+ CompAction::State currentState;
648+
649+ std::list<ButtonGrab> buttonGrabs;
650+ std::list<KeyGrab> keyGrabs;
651 };
652
653 class History : public virtual ::compiz::History,
654 boost::noncopyable
655 {
656 public:
657+
658 History();
659
660- void setCurrentActiveWindowHistory (int x, int y);
661+ void setCurrentActiveWindowHistory (int x,
662+ int y);
663
664 void addToCurrentActiveWindowHistory (Window id);
665
666@@ -414,9 +441,10 @@
667 unsigned int activeNum () const;
668
669 private:
670+
671 CompActiveWindowHistory history[ACTIVE_WINDOW_HISTORY_NUM];
672 int currentHistory_;
673- unsigned int activeNum_;
674+ unsigned int activeNum_;
675 };
676
677 class ViewportRetrievalInterface
678@@ -449,14 +477,15 @@
679 namespace viewports
680 {
681 void viewportForGeometry (const CompWindow::Geometry &gm,
682- CompPoint &viewport,
683+ CompPoint &viewport,
684 ViewportRetrievalInterface *viewports,
685- const CompSize &screenSize);
686+ const CompSize &screenSize);
687 }
688
689 class StartupSequence : boost::noncopyable
690 {
691 public:
692+
693 StartupSequence();
694 void addSequence (SnStartupSequence *sequence, CompPoint const& vp);
695 void removeSequence (SnStartupSequence *sequence);
696@@ -466,6 +495,7 @@
697 virtual void updateStartupFeedback () = 0;
698 bool emptySequence() const { return startupSequences.empty(); }
699 private:
700+
701 std::list<CompStartupSequence *> startupSequences;
702 CompTimer startupSequenceTimer;
703 };
704@@ -474,44 +504,49 @@
705 class StartupSequenceImpl : public StartupSequence
706 {
707 public:
708- StartupSequenceImpl(PrivateScreen* priv) : priv(priv) {}
709+
710+ StartupSequenceImpl(PrivateScreen *priv) : priv (priv) {}
711
712 virtual void updateStartupFeedback ();
713 private:
714- PrivateScreen* const priv;
715+
716+ PrivateScreen *const priv;
717 };
718
719 class Extension
720 {
721-public:
722- Extension() : is_enabled(), extension() {}
723-
724- template<Bool ExtensionQuery (Display*, int*, int*)>
725- bool init(Display * dpy)
726- {
727- int error;
728- is_enabled = ExtensionQuery(dpy, &extension, &error);
729- return is_enabled;
730- }
731-
732- template<Bool ExtensionQuery(Display*, int*, int*, int*, int*, int*)>
733- bool init(Display * dpy)
734- {
735- int opcode;
736- int error;
737- is_enabled = ExtensionQuery(dpy, &opcode, &extension, &error, NULL, NULL);
738-
739- if (!is_enabled) extension = -1;
740-
741- return is_enabled;
742- }
743-
744- int isEnabled () const { return is_enabled; }
745- int get () const { return extension; }
746-
747-private:
748- bool is_enabled;
749- int extension;
750+ public:
751+
752+ Extension() : is_enabled(), extension() {}
753+
754+ template<Bool ExtensionQuery (Display*, int*, int*)>
755+ bool init(Display * dpy)
756+ {
757+ int error;
758+ is_enabled = ExtensionQuery(dpy, &extension, &error);
759+ return is_enabled;
760+ }
761+
762+ template<Bool ExtensionQuery(Display*, int*, int*, int*, int*, int*)>
763+ bool init(Display * dpy)
764+ {
765+ int opcode;
766+ int error;
767+ is_enabled = ExtensionQuery(dpy, &opcode, &extension, &error, NULL, NULL);
768+
769+ if (!is_enabled)
770+ extension = -1;
771+
772+ return is_enabled;
773+ }
774+
775+ int isEnabled () const { return is_enabled; }
776+ int get () const { return extension; }
777+
778+ private:
779+
780+ bool is_enabled;
781+ int extension;
782 };
783
784 class Ping :
785@@ -724,6 +759,7 @@
786 { pingTimer.setCallback(callback); }
787
788 public:
789+
790 Display* dpy;
791 compiz::private_screen::Extension xSync;
792 compiz::private_screen::Extension xRandr;
793@@ -744,7 +780,6 @@
794
795 Window wmSnSelectionWindow;
796
797- int clientPointerDeviceId;
798 Cursor normalCursor;
799 Cursor busyCursor;
800 Cursor invisibleCursor;
801@@ -753,6 +788,7 @@
802 bool initialized;
803
804 private:
805+
806 CompScreen* screen;
807 compiz::private_screen::Extension xkbEvent;
808
809@@ -822,6 +858,7 @@
810 ::compiz::private_screen::History
811 {
812 public:
813+
814 CompScreenImpl ();
815 ~CompScreenImpl ();
816
817@@ -919,7 +956,8 @@
818 CompWindowList & serverWindows ();
819 CompWindowList & destroyedWindows ();
820
821- void warpPointer (int dx, int dy);
822+ void warpPointer (int dx,
823+ int dy);
824
825 Time getCurrentTime ();
826
827@@ -929,7 +967,8 @@
828
829 void focusDefaultWindow ();
830
831- void insertWindow (CompWindow *w, Window aboveId);
832+ void insertWindow (CompWindow *w,
833+ Window aboveId);
834 void unhookWindow (CompWindow *w);
835
836 void insertServerWindow (CompWindow *w, Window aboveId);
837@@ -981,7 +1020,9 @@
838
839 void runCommand (CompString command);
840
841- void moveViewport (int tx, int ty, bool sync);
842+ void moveViewport (int tx,
843+ int ty,
844+ bool sync);
845
846 void sendWindowActivationRequest (Window id);
847
848@@ -1026,32 +1067,32 @@
849
850 void updateSupportedWmHints ();
851
852- unsigned int showingDesktopMask() const;
853- virtual bool grabsEmpty() const;
854- virtual void sizePluginClasses(unsigned int size);
855+ unsigned int showingDesktopMask () const;
856+ virtual bool grabsEmpty () const;
857+ virtual void sizePluginClasses (unsigned int size);
858 virtual void setWindowState (unsigned int state, Window id);
859- virtual void addToDestroyedWindows(CompWindow * cw);
860+ virtual void addToDestroyedWindows (CompWindow * cw);
861 virtual void processEvents ();
862 virtual void alwaysHandleEvent (XEvent *event);
863
864 virtual ServerGrabInterface * serverGrabInterface ();
865
866 virtual void updatePassiveKeyGrabs () const;
867- virtual void updatePassiveButtonGrabs(Window serverFrame);
868+ virtual void updatePassiveButtonGrabs (Window serverFrame);
869
870- virtual bool displayInitialised() const;
871+ virtual bool displayInitialised () const;
872 virtual void applyStartupProperties (CompWindow *window);
873- virtual void updateClientList();
874- virtual CompWindow * getTopWindow() const;
875- virtual CompWindow * getTopServerWindow() const;
876- virtual CoreOptions& getCoreOptions();
877- virtual Colormap colormap() const;
878+ virtual void updateClientList ();
879+ virtual CompWindow * getTopWindow () const;
880+ virtual CompWindow * getTopServerWindow () const;
881+ virtual CoreOptions& getCoreOptions ();
882+ virtual Colormap colormap () const;
883 virtual void setCurrentDesktop (unsigned int desktop);
884- virtual Window activeWindow() const;
885- virtual bool grabWindowIsNot(Window w) const;
886- virtual void incrementPendingDestroys();
887- virtual void setNextActiveWindow(Window id);
888- virtual Window getNextActiveWindow() const;
889+ virtual Window activeWindow () const;
890+ virtual bool grabWindowIsNot (Window w) const;
891+ virtual void incrementPendingDestroys ();
892+ virtual void setNextActiveWindow (Window id);
893+ virtual Window getNextActiveWindow () const;
894 virtual CompWindow * focusTopMostWindow ();
895
896 public :
897@@ -1120,43 +1161,54 @@
898
899
900 private:
901- virtual bool _setOptionForPlugin(const char *, const char *, CompOption::Value &);
902- virtual bool _initPluginForScreen(CompPlugin *);
903- virtual void _finiPluginForScreen(CompPlugin *);
904- virtual void _handleEvent(XEvent *event);
905- virtual void _logMessage(const char *, CompLogLevel, const char*);
906- virtual void _enterShowDesktopMode();
907- virtual void _leaveShowDesktopMode(CompWindow *);
908- virtual void _addSupportedAtoms(std::vector<Atom>& atoms);
909+ virtual bool _setOptionForPlugin (const char *, const char *, CompOption::Value &);
910+ virtual bool _initPluginForScreen (CompPlugin *);
911+ virtual void _finiPluginForScreen (CompPlugin *);
912+ virtual void _handleEvent (XEvent *event);
913+ virtual void _logMessage (const char *,
914+ CompLogLevel, const char *);
915+ virtual void _enterShowDesktopMode ();
916+ virtual void _leaveShowDesktopMode (CompWindow *);
917+ virtual void _addSupportedAtoms (std::vector<Atom>& atoms);
918
919- // These are stubs - but allow mocking of AbstractCompWindow
920- virtual void _fileWatchAdded(CompFileWatch *);
921- virtual void _fileWatchRemoved(CompFileWatch *);
922- virtual void _sessionEvent(CompSession::Event, CompOption::Vector &);
923- virtual void _handleCompizEvent(const char *, const char *, CompOption::Vector &);
924- virtual bool _fileToImage(CompString &, CompSize &, int &, void *&);
925- virtual bool _imageToFile(CompString &, CompString &, CompSize &, int, void *);
926- virtual CompMatch::Expression * _matchInitExp(const CompString&);
927- virtual void _matchExpHandlerChanged();
928- virtual void _matchPropertyChanged(CompWindow *);
929- virtual void _outputChangeNotify();
930+ // These are stubs - but allow mocking of AbstractCompWindow
931+ virtual void _fileWatchAdded (CompFileWatch *);
932+ virtual void _fileWatchRemoved (CompFileWatch *);
933+ virtual void _sessionEvent (CompSession::Event ,
934+ CompOption::Vector &);
935+ virtual void _handleCompizEvent (const char *,
936+ const char *,
937+ CompOption::Vector &);
938+ virtual bool _fileToImage (CompString &,
939+ CompSize &,
940+ int &,
941+ void *&);
942+ virtual bool _imageToFile (CompString &,
943+ CompString &,
944+ CompSize &,
945+ int ,
946+ void *);
947+ virtual CompMatch::Expression * _matchInitExp (const CompString &);
948+ virtual void _matchExpHandlerChanged ();
949+ virtual void _matchPropertyChanged (CompWindow *);
950+ virtual void _outputChangeNotify ();
951
952 void grabServer ();
953 void ungrabServer ();
954 void syncServer ();
955
956- bool handlePingTimeout();
957+ bool handlePingTimeout();
958
959- Window below;
960- CompTimer autoRaiseTimer_;
961- Window autoRaiseWindow_;
962- CompIcon *defaultIcon_;
963+ Window below;
964+ CompTimer autoRaiseTimer_;
965+ Window autoRaiseWindow_;
966+ CompIcon *defaultIcon_;
967 compiz::private_screen::GrabManager mutable grabManager;
968- ValueHolder valueHolder;
969- bool eventHandled;
970- PrivateScreen privateScreen;
971- compiz::private_screen::WindowManager windowManager;
972- unsigned int showingDesktopMask_;
973+ ValueHolder valueHolder;
974+ bool eventHandled;
975+ PrivateScreen privateScreen;
976+ compiz::private_screen::WindowManager windowManager;
977+ unsigned int showingDesktopMask_;
978 };
979
980 #endif

Subscribers

People subscribed via source and target branches

to all changes: