aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/FbPixmap.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/FbPixmap.hh')
-rw-r--r--src/FbTk/FbPixmap.hh78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/FbTk/FbPixmap.hh b/src/FbTk/FbPixmap.hh
new file mode 100644
index 0000000..787c06f
--- /dev/null
+++ b/src/FbTk/FbPixmap.hh
@@ -0,0 +1,78 @@
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.5 2003/07/10 11:55:01 fluxgen Exp $
23
24#ifndef FBTK_FBPIXMAP_HH
25#define FBTK_FBPIXMAP_HH
26
27#include "FbDrawable.hh"
28
29#include <X11/Xlib.h>
30
31namespace FbTk {
32
33/// a wrapper for X Pixmap
34class FbPixmap:public FbDrawable {
35public:
36 FbPixmap();
37 /// copy pixmap
38 explicit FbPixmap(const FbPixmap &copy);
39 /// creates a FbPixmap from X pixmap
40 explicit FbPixmap(Pixmap pm);
41 FbPixmap(Drawable src,
42 unsigned int width, unsigned int height,
43 int depth);
44
45 ~FbPixmap();
46
47 void copy(const FbPixmap &the_copy);
48 /// rotates the pixmap 90 deg, not implemented!
49 void rotate();
50 /// scales the pixmap to specified size
51 void scale(unsigned int width, unsigned int height);
52 /// drops pixmap and returns it
53 Pixmap release();
54
55 FbPixmap &operator = (const FbPixmap &copy);
56 /// sets new pixmap
57 FbPixmap &operator = (Pixmap pm);
58
59 inline Drawable drawable() const { return m_pm; }
60 inline unsigned int width() const { return m_width; }
61 inline unsigned int height() const { return m_height; }
62 inline int depth() const { return m_depth; }
63
64
65private:
66 void free();
67 void create(Drawable src,
68 unsigned int width, unsigned int height,
69 int depth);
70 Pixmap m_pm;
71 int m_depth;
72 unsigned int m_width, m_height;
73};
74
75}; // end namespace FbTk
76
77#endif // FBTK_FBPIXMAP_HH
78