~brandontschaefer/compiz/lp1002246_fix

« back to all changes in this revision

Viewing changes to include/core/wrapsystem.h

  • Committer: Tarmac
  • Author(s): Daniel van Vugt
  • Date: 2012-12-07 14:51:17 UTC
  • mfrom: (3513.2.5 constify-CompWindow)
  • Revision ID: tarmac-20121207145117-x4o7y97ol1t5fm0a
Const'ify the methods of CompWindow where possible. I think this covers all
candidates except for:
   1. sizeHints() - we need to fix LP: #925867 first.
   2. other methods that return references to ints, because no corresponding
      "set" method exists yet.
As those are logic changes, I would prefer to deal with them separately.

Approved by PS Jenkins bot, Sam Spilsbury.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    return mHandler-> func (__VA_ARGS__);        \
37
37
}
38
38
 
39
 
#define WRAPABLE_HND(num,itype,rtype, func, ...)        \
40
 
   rtype func (__VA_ARGS__);                            \
41
 
   void  func ## SetEnabled (itype *obj, bool enabled)  \
 
39
#define WRAPABLE_HND(num, itype, rtype, func, ...) \
 
40
    WRAPABLE_HND_ANY(num, itype, rtype, func,, __VA_ARGS__)
 
41
 
 
42
#define WRAPABLE_HND_CONST(num, itype, rtype, func, ...) \
 
43
    WRAPABLE_HND_ANY(num, itype, rtype, func, const, __VA_ARGS__)
 
44
 
 
45
#define WRAPABLE_HND_ANY(num, itype, rtype, func, cons, ...)    \
 
46
   rtype func (__VA_ARGS__) cons;                               \
 
47
   void  func ## SetEnabled (cons itype *obj, bool enabled)     \
42
48
   {                                                    \
43
 
       functionSetEnabled (obj, num, enabled);          \
 
49
       functionSetEnabled ((itype*)obj, num, enabled);          \
44
50
   }                                                    \
45
 
   unsigned int func ## GetCurrentIndex ()              \
 
51
   unsigned int func ## GetCurrentIndex () const        \
46
52
   {                                                    \
47
53
       return mCurrFunction[num];                       \
48
54
   }                                                    \
149
155
 
150
156
        void functionSetEnabled (T *, unsigned int, bool);
151
157
 
152
 
        unsigned int mCurrFunction[N];
 
158
        mutable unsigned int mCurrFunction[N];
153
159
        std::vector<Interface> mInterface;
154
160
};
155
161