~gloob/compiz/texttracking

« back to all changes in this revision

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

  • Committer: Daniel van Vugt
  • Author(s): smspillaz
  • Date: 2012-06-06 05:12:28 UTC
  • mfrom: (3221.2.17 pixmap)
  • Revision ID: daniel.van.vugt@canonical.com-20120606051228-oh5x09genim3x7nn
Adds some tests for the pixmap rebinding code ... which also means some
refactoring was done.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#ifndef _COMPOSITE_PRIVATES_H
29
29
#define _COMPOSITE_PRIVATES_H
30
30
 
 
31
#include <memory>
 
32
#include <boost/shared_ptr.hpp>
 
33
 
31
34
#include <composite/composite.h>
32
35
#include <core/atoms.h>
33
36
 
 
37
#include "pixmapbinding.h"
34
38
#include "composite_options.h"
35
39
 
36
40
extern CompPlugin::VTable *compositeVTable;
108
112
        Window newCmSnOwner;
109
113
};
110
114
 
111
 
class PrivateCompositeWindow : WindowInterface
 
115
class PrivateCompositeWindow :
 
116
    public WindowInterface,
 
117
    public CompositePixmapRebindInterface,
 
118
    public WindowPixmapGetInterface,
 
119
    public WindowAttributesGetInterface
112
120
{
113
121
    public:
114
122
        PrivateCompositeWindow (CompWindow *w, CompositeWindow *cw);
118
126
        void resizeNotify (int dx, int dy, int dwidth, int dheight);
119
127
        void moveNotify (int dx, int dy, bool now);
120
128
 
 
129
        Pixmap pixmap () const;
 
130
        bool   bind ();
 
131
        const CompSize & size () const;
 
132
        void release ();
 
133
        void setNewPixmapReadyCallback (const boost::function <void ()> &);
 
134
        void allowFurtherRebindAttempts ();
 
135
 
121
136
        static void handleDamageRect (CompositeWindow *w,
122
137
                                      int             x,
123
138
                                      int             y,
129
144
        CompositeWindow *cWindow;
130
145
        CompositeScreen *cScreen;
131
146
 
132
 
        Pixmap        pixmap;
133
 
        CompSize      size;
134
 
        bool          needsRebind;
135
 
        CompositeWindow::NewPixmapReadyCallback newPixmapReadyCallback;
 
147
        PixmapBinding mPixmapBinding;
136
148
 
137
149
        Damage        damage;
138
150
 
139
151
        bool          damaged;
140
152
        bool          redirected;
141
153
        bool          overlayWindow;
142
 
        bool          bindFailed;
143
154
 
144
155
        unsigned short opacity;
145
156
        unsigned short brightness;
148
159
        XRectangle *damageRects;
149
160
        int        sizeDamage;
150
161
        int        nDamage;
 
162
    private:
 
163
 
 
164
        bool getAttributes (XWindowAttributes &);
 
165
        WindowPixmapInterface::Ptr getPixmap ();
151
166
};
152
167
 
153
168
#endif