~ubuntu-branches/ubuntu/trusty/compiz/trusty

« back to all changes in this revision

Viewing changes to plugins/composite/privates.h

  • Committer: Dennis kasprzyk
  • Author(s): Dennis Kasprzyk
  • Date: 2009-03-15 05:09:18 UTC
  • Revision ID: git-v1:163f6b6f3c3b7764987cbdf8e03cc355edeaa499
New generalized build system.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright © 2008 Dennis Kasprzyk
3
 
 * Copyright © 2007 Novell, Inc.
4
 
 *
5
 
 * Permission to use, copy, modify, distribute, and sell this software
6
 
 * and its documentation for any purpose is hereby granted without
7
 
 * fee, provided that the above copyright notice appear in all copies
8
 
 * and that both that copyright notice and this permission notice
9
 
 * appear in supporting documentation, and that the name of
10
 
 * Dennis Kasprzyk not be used in advertising or publicity pertaining to
11
 
 * distribution of the software without specific, written prior permission.
12
 
 * Dennis Kasprzyk makes no representations about the suitability of this
13
 
 * software for any purpose. It is provided "as is" without express or
14
 
 * implied warranty.
15
 
 *
16
 
 * DENNIS KASPRZYK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17
 
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
18
 
 * NO EVENT SHALL DENNIS KASPRZYK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19
 
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
20
 
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
21
 
 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
22
 
 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23
 
 *
24
 
 * Authors: Dennis Kasprzyk <onestone@compiz-fusion.org>
25
 
 *          David Reveman <davidr@novell.com>
26
 
 */
27
 
 
28
 
#ifndef _COMPOSITE_PRIVATES_H
29
 
#define _COMPOSITE_PRIVATES_H
30
 
 
31
 
#include <composite/composite.h>
32
 
#include <core/atoms.h>
33
 
 
34
 
#if COMPOSITE_MAJOR > 0 || COMPOSITE_MINOR > 2
35
 
#define USE_COW
36
 
extern bool       useCow;
37
 
#endif
38
 
 
39
 
#define COMPOSITE_OPTION_SLOW_ANIMATIONS_KEY 0
40
 
#define COMPOSITE_OPTION_DETECT_REFRESH_RATE 1
41
 
#define COMPOSITE_OPTION_REFRESH_RATE        2
42
 
#define COMPOSITE_OPTION_UNREDIRECT_FS       3
43
 
#define COMPOSITE_OPTION_FORCE_INDEPENDENT   4
44
 
#define COMPOSITE_OPTION_NUM                 5
45
 
 
46
 
extern CompPlugin::VTable *compositeVTable;
47
 
 
48
 
extern const CompMetadata::OptionInfo
49
 
   compositeOptionInfo[COMPOSITE_OPTION_NUM];
50
 
 
51
 
extern CompWindow *lastDamagedWindow;
52
 
 
53
 
class PrivateCompositeScreen : ScreenInterface
54
 
{
55
 
    public:
56
 
        PrivateCompositeScreen (CompositeScreen *cs);
57
 
        ~PrivateCompositeScreen ();
58
 
 
59
 
        void outputChangeNotify ();
60
 
 
61
 
        void handleEvent (XEvent *event);
62
 
 
63
 
        void makeOutputWindow ();
64
 
 
65
 
        bool init ();
66
 
 
67
 
        void handleExposeEvent (XExposeEvent *event);
68
 
 
69
 
    public:
70
 
 
71
 
        CompositeScreen *cScreen;
72
 
 
73
 
        int compositeEvent, compositeError, compositeOpcode;
74
 
        int damageEvent, damageError;
75
 
        int fixesEvent, fixesError, fixesVersion;
76
 
 
77
 
        bool shapeExtension;
78
 
        int  shapeEvent, shapeError;
79
 
 
80
 
        bool randrExtension;
81
 
        int  randrEvent, randrError;
82
 
 
83
 
        CompRegion    damage;
84
 
        unsigned long damageMask;
85
 
 
86
 
        CompRegion    tmpRegion;
87
 
        
88
 
        Window        overlay;
89
 
        Window        output;
90
 
 
91
 
        std::list <CompRect> exposeRects;
92
 
 
93
 
        CompPoint windowPaintOffset;
94
 
 
95
 
        int overlayWindowCount;
96
 
 
97
 
        struct timeval lastRedraw;
98
 
        int            nextRedraw;
99
 
        int            redrawTime;
100
 
        int            optimalRedrawTime;
101
 
        int            frameStatus;
102
 
        int            timeMult;
103
 
        bool           idle;
104
 
        int            timeLeft;
105
 
 
106
 
        bool slowAnimations;
107
 
 
108
 
        CompTimer paintTimer;
109
 
 
110
 
        bool active;
111
 
        CompositeScreen::PaintHandler *pHnd;
112
 
 
113
 
        CompOption::Vector opt;
114
 
};
115
 
 
116
 
class PrivateCompositeWindow : WindowInterface
117
 
{
118
 
    public:
119
 
        PrivateCompositeWindow (CompWindow *w, CompositeWindow *cw);
120
 
        ~PrivateCompositeWindow ();
121
 
 
122
 
        void windowNotify (CompWindowNotify n);
123
 
        void resizeNotify (int dx, int dy, int dwidth, int dheight);
124
 
        void moveNotify (int dx, int dy, bool now);
125
 
 
126
 
        static void handleDamageRect (CompositeWindow *w,
127
 
                                      int             x,
128
 
                                      int             y,
129
 
                                      int             width,
130
 
                                      int             height);
131
 
 
132
 
    public:
133
 
 
134
 
        CompWindow      *window;
135
 
        CompositeWindow *cWindow;
136
 
        CompositeScreen *cScreen;
137
 
 
138
 
        Pixmap        pixmap;
139
 
 
140
 
        Damage        damage;
141
 
 
142
 
        bool          damaged;
143
 
        bool          redirected;
144
 
        bool          overlayWindow;
145
 
        bool          bindFailed;
146
 
 
147
 
        unsigned short opacity;
148
 
        unsigned short brightness;
149
 
        unsigned short saturation;
150
 
        
151
 
        XRectangle *damageRects;
152
 
        int        sizeDamage;
153
 
        int        nDamage;
154
 
};
155
 
 
156
 
#endif