2
* Copyright © 2005 Novell, Inc.
4
* Permission to use, copy, modify, distribute, and sell this software
5
* and its documentation for any purpose is hereby granted without
6
* fee, provided that the above copyright notice appear in all copies
7
* and that both that copyright notice and this permission notice
8
* appear in supporting documentation, and that the name of
9
* Novell, Inc. not be used in advertising or publicity pertaining to
10
* distribution of the software without specific, written prior permission.
11
* Novell, Inc. makes no representations about the suitability of this
12
* software for any purpose. It is provided "as is" without express or
15
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17
* NO EVENT SHALL NOVELL, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23
* Author: David Reveman <davidr@novell.com>
26
#ifndef _COMPIZ_DECOR_PIXMAP_REQUESTS_H
27
#define _COMPIZ_DECOR_PIXMAP_REQUESTS_H
29
#include <boost/shared_ptr.hpp>
30
#include <boost/shared_array.hpp>
31
#include <boost/make_shared.hpp>
32
#include <decoration.h>
36
class DecorPixmapInterface
40
typedef boost::shared_ptr <DecorPixmapInterface> Ptr;
42
virtual ~DecorPixmapInterface () {};
44
virtual Pixmap getPixmap () = 0;
47
class DecorPixmapReceiverInterface
51
virtual ~DecorPixmapReceiverInterface () {}
53
virtual void pending () = 0;
54
virtual void update () = 0;
57
/* So far, nothing particularly interesting here
58
* we just need a way to pass around pointers for
60
class DecorationInterface
64
typedef boost::shared_ptr <DecorationInterface> Ptr;
66
virtual ~DecorationInterface () {}
68
virtual DecorPixmapReceiverInterface & receiverInterface () = 0;
69
virtual unsigned int getFrameType () const = 0;
70
virtual unsigned int getFrameState () const = 0;
71
virtual unsigned int getFrameActions () const = 0;
74
class DecorPixmapDeletionInterface
78
typedef boost::shared_ptr <DecorPixmapDeletionInterface> Ptr;
80
virtual ~DecorPixmapDeletionInterface () {}
82
virtual int postDeletePixmap (Pixmap pixmap) = 0;
85
class X11PixmapDeletor :
86
public DecorPixmapDeletionInterface
90
typedef boost::shared_ptr <X11PixmapDeletor> Ptr;
92
X11PixmapDeletor (Display *dpy) :
97
int postDeletePixmap (Pixmap pixmap) { return decor_post_delete_pixmap (mDisplay, pixmap); }
105
public DecorPixmapInterface
109
typedef boost::shared_ptr <DecorPixmap> Ptr;
111
DecorPixmap (Pixmap p, DecorPixmapDeletionInterface::Ptr deletor);
119
DecorPixmapDeletionInterface::Ptr mDeletor;
122
class DecorPixmapRequestorInterface
126
virtual ~DecorPixmapRequestorInterface () {}
128
virtual int postGenerateRequest (unsigned int frameType,
129
unsigned int frameState,
130
unsigned int frameActions) = 0;
132
virtual void handlePending (long *data) = 0;
135
class DecorationListFindMatchingInterface
139
virtual ~DecorationListFindMatchingInterface () {}
141
virtual DecorationInterface::Ptr findMatchingDecoration (unsigned int frameType,
142
unsigned int frameState,
143
unsigned int frameActions) = 0;
146
class X11DecorPixmapRequestor :
147
public DecorPixmapRequestorInterface
151
X11DecorPixmapRequestor (Display *dpy,
153
DecorationListFindMatchingInterface *listFinder);
155
int postGenerateRequest (unsigned int frameType,
156
unsigned int frameState,
157
unsigned int frameActions);
159
void handlePending (long *data);
165
DecorationListFindMatchingInterface *mListFinder;
168
class X11DecorPixmapReceiver :
169
public DecorPixmapReceiverInterface
173
static const unsigned int UpdateRequested = 1 << 0;
174
static const unsigned int UpdatesPending = 1 << 1;
176
X11DecorPixmapReceiver (DecorPixmapRequestorInterface *,
177
DecorationInterface *decor);
183
unsigned int mUpdateState;
184
DecorPixmapRequestorInterface *mDecorPixmapRequestor;
185
DecorationInterface *mDecoration;