~mc-return/compiz/compiz.merge-src-header-files-cleanup

« back to all changes in this revision

Viewing changes to plugins/cube/src/privates.h

Cube code cleanup:

Replaced 0xffff with GLfloat MaxUShortFloat = static_cast <GLfloat>
(std::numeric_limits <unsigned short>::max ());.
Use prefix instead of postfix de- and increments.
Declaration and assignment of variables in one line.
Declare variables shortly before you need them.
Merged if condition checks.
Added missing breaks (just a style issue).
Added and removed brackets.
Added and removed newlines.
Fixed indentation.

Approved by PS Jenkins bot, Sam Spilsbury.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
        void paint (CompOutput::ptrList &outputs, unsigned int);
51
51
 
52
52
        bool glPaintOutput (const GLScreenPaintAttrib &,
53
 
                            const GLMatrix &, const CompRegion &,
54
 
                            CompOutput *, unsigned int);
 
53
                            const GLMatrix            &,
 
54
                            const CompRegion          &,
 
55
                            CompOutput                *,
 
56
                            unsigned int                );
55
57
        
56
58
        void glPaintTransformedOutput (const GLScreenPaintAttrib &,
57
 
                                       const GLMatrix &, const CompRegion &,
58
 
                                       CompOutput *, unsigned int);
59
 
 
60
 
 
61
 
        void glEnableOutputClipping (const GLMatrix &, const CompRegion &,
62
 
                                     CompOutput *);
 
59
                                       const GLMatrix            &,
 
60
                                       const CompRegion          &,
 
61
                                       CompOutput                *,
 
62
                                       unsigned int                );
 
63
 
 
64
 
 
65
        void glEnableOutputClipping (const GLMatrix   &,
 
66
                                     const CompRegion &,
 
67
                                     CompOutput       *);
63
68
 
64
69
        void glApplyTransform (const GLScreenPaintAttrib &,
65
 
                               CompOutput *, GLMatrix *);
 
70
                               CompOutput                *,
 
71
                               GLMatrix                  *);
66
72
 
67
 
        bool setOptionForPlugin (const char *plugin,
68
 
                                 const char *name,
69
 
                                 CompOption::Value &v);
 
73
        bool setOptionForPlugin (const char        *plugin,
 
74
                                 const char        *name,
 
75
                                 CompOption::Value &v);
70
76
 
71
77
        void outputChangeNotify ();
72
78
 
73
79
        const CompWindowList & getWindowPaintList ();
74
80
 
75
 
        bool updateGeometry (int sides, int invert);
 
81
        bool updateGeometry (int sides,
 
82
                             int invert);
76
83
        void updateOutputs ();
77
84
        void updateSkydomeTexture ();
78
85
        void updateSkydomeList (GLfloat fRadius);
79
86
 
80
 
        bool setOption (const CompString &name, CompOption::Value &value);
 
87
        bool setOption (const CompString  &name,
 
88
                        CompOption::Value &value);
81
89
 
82
90
        bool adjustVelocity ();
83
91
 
108
116
 
109
117
    public:
110
118
 
111
 
        int       mInvert;
112
 
        int       mXRotations;
113
 
        PaintOrder mPaintOrder;
 
119
        int                       mInvert;
 
120
        int                       mXRotations;
 
121
        PaintOrder                mPaintOrder;
114
122
 
115
123
        CubeScreen::RotationState mRotationState;
116
124
 
117
 
        bool mPaintAllViewports;
118
 
 
119
 
        GLfloat  mDistance;
120
 
        GLfloat  mTc[12];
121
 
 
122
 
        CompScreen::GrabHandle mGrabIndex;
123
 
 
124
 
        int mSrcOutput;
125
 
 
126
 
        bool    mUnfolded;
127
 
        GLfloat mUnfold, mUnfoldVelocity;
128
 
 
129
 
        GLfloat  *mVertices;
130
 
        int      mNVertices;
131
 
 
132
 
        GLuint mSkyListId;
133
 
 
134
 
        int              mPw, mPh;
135
 
        CompSize mSkySize;
136
 
        GLTexture::List mTexture, mSky;
137
 
 
138
 
        int     mImgCurFile;
139
 
 
140
 
        int mNOutput;
141
 
        int mOutput[64];
142
 
        int mOutputMask[64];
143
 
 
144
 
        bool mCleared[64];
145
 
 
146
 
        bool mCapsPainted[64];
147
 
 
148
 
        bool mFullscreenOutput;
149
 
 
150
 
        float mOutputXScale;
151
 
        float mOutputYScale;
152
 
        float mOutputXOffset;
153
 
        float mOutputYOffset;
154
 
 
155
 
        float mDesktopOpacity;
156
 
        float mToOpacity;
157
 
        int   mLastOpacityIndex;
158
 
 
159
 
        bool mRecalcOutput;
 
125
        bool                      mPaintAllViewports;
 
126
 
 
127
        GLfloat                   mDistance;
 
128
        GLfloat                   mTc[12];
 
129
 
 
130
        CompScreen::GrabHandle    mGrabIndex;
 
131
 
 
132
        int                       mSrcOutput;
 
133
 
 
134
        bool                      mUnfolded;
 
135
        GLfloat                   mUnfold;
 
136
        GLfloat                   mUnfoldVelocity;
 
137
 
 
138
        GLfloat                   *mVertices;
 
139
        int                       mNVertices;
 
140
 
 
141
        GLuint                    mSkyListId;
 
142
 
 
143
        int                       mPw;
 
144
        int                       mPh;
 
145
        CompSize                  mSkySize;
 
146
        GLTexture::List           mTexture;
 
147
        GLTexture::List           mSky;
 
148
 
 
149
        int                       mImgCurFile;
 
150
 
 
151
        int                       mNOutput;
 
152
        int                       mOutput[64];
 
153
        int                       mOutputMask[64];
 
154
 
 
155
        bool                      mCleared[64];
 
156
 
 
157
        bool                      mCapsPainted[64];
 
158
 
 
159
        bool                      mFullscreenOutput;
 
160
 
 
161
        float                     mOutputXScale;
 
162
        float                     mOutputYScale;
 
163
        float                     mOutputXOffset;
 
164
        float                     mOutputYOffset;
 
165
 
 
166
        float                     mDesktopOpacity;
 
167
        float                     mToOpacity;
 
168
        int                       mLastOpacityIndex;
 
169
 
 
170
        bool                      mRecalcOutput;
160
171
        
161
 
        CompWindowList mReversedWindowList;
 
172
        CompWindowList            mReversedWindowList;
162
173
};
163
174
 
164
175
class PrivateCubeWindow;
173
184
        PrivateCubeWindow (CompWindow *w);
174
185
        ~PrivateCubeWindow ();
175
186
 
176
 
        bool glPaint (const GLWindowPaintAttrib &, const GLMatrix &,
177
 
                      const CompRegion &, unsigned int);
 
187
        bool glPaint (const GLWindowPaintAttrib &,
 
188
                      const GLMatrix            &,
 
189
                      const CompRegion          &,
 
190
                      unsigned int                );
178
191
 
179
192
        CompWindow      *window;
180
193
        CompositeWindow *cWindow;