summaryrefslogtreecommitdiff
path: root/src/FbTk/FbPixmap.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/FbPixmap.hh')
-rw-r--r--src/FbTk/FbPixmap.hh71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/FbTk/FbPixmap.hh b/src/FbTk/FbPixmap.hh
new file mode 100644
index 0000000..05f05e3
--- /dev/null
+++ b/src/FbTk/FbPixmap.hh
@@ -0,0 +1,71 @@
1// FbPixmap.hh for FbTk - Fluxbox ToolKit
2// Copyright (c) 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net)
3//
4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"),
6// to deal in the Software without restriction, including without limitation
7// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8// and/or sell copies of the Software, and to permit persons to whom the
9// Software is furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE.
21
22// $Id: FbPixmap.hh,v 1.1 2003/04/25 12:29:49 fluxgen Exp $
23
24#ifndef FBTK_FBPIXMAP_HH
25#define FBTK_FBPIXMAP_HH
26
27#include <X11/Xlib.h>
28
29namespace FbTk {
30
31/// a wrapper for X Pixmap
32class FbPixmap {
33public:
34 FbPixmap();
35 FbPixmap(const FbPixmap &copy);
36 FbPixmap(Drawable src,
37 unsigned int width, unsigned int height,
38 int depth);
39 ~FbPixmap();
40 void copyArea(Drawable src, GC gc,
41 int src_x, int src_y,
42 int dest_x, int dest_y,
43 unsigned int width, unsigned int height);
44 void fillRectangle(GC gc, int x, int y,
45 unsigned int width, unsigned int height);
46 void drawRectangle(GC gc, int x, int y,
47 unsigned int width, unsigned int height);
48 void fillPolygon(GC gc, XPoint *points, int npoints,
49 int shape, int mode);
50 void copy(const FbPixmap &the_copy);
51 FbPixmap &operator = (const FbPixmap &copy);
52
53 inline Drawable drawable() const { return m_pm; }
54 inline unsigned int width() const { return m_width; }
55 inline unsigned int height() const { return m_height; }
56 inline int depth() const { return m_depth; }
57
58private:
59 void free();
60 void create(Drawable src,
61 unsigned int width, unsigned int height,
62 int depth);
63 Pixmap m_pm;
64 int m_depth;
65 unsigned int m_width, m_height;
66};
67
68}; // end namespace FbTk
69
70#endif // FBTK_FBPIXMAP_HH
71