aboutsummaryrefslogtreecommitdiff
path: root/src/Shape.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/Shape.hh')
-rw-r--r--src/Shape.hh88
1 files changed, 0 insertions, 88 deletions
diff --git a/src/Shape.hh b/src/Shape.hh
deleted file mode 100644
index 5f26d05..0000000
--- a/src/Shape.hh
+++ /dev/null
@@ -1,88 +0,0 @@
1// Shape.hh
2// Copyright (c) 2003 - 2006 Henrik Kinnunen (fluxgen at fluxbox dot org)
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$
23
24#ifndef SHAPE_HH
25#define SHAPE_HH
26
27#include "FbTk/FbPixmap.hh"
28
29#include <X11/Xlib.h>
30#include <memory>
31#include <vector>
32
33namespace FbTk {
34class FbWindow;
35}
36
37/// creates round corners on windows
38class Shape {
39public:
40 enum ShapePlace {
41 NONE = 0,
42 BOTTOMRIGHT = 0x01,
43 TOPRIGHT = 0x02,
44 BOTTOMLEFT = 0x04,
45 TOPLEFT = 0x08
46 };
47
48 Shape(FbTk::FbWindow &win, int shapeplaces);
49 ~Shape();
50 /// set new shape places
51 void setPlaces(int shapeplaces);
52 /// update our shape
53 void update();
54 /// assign a new window
55 void setWindow(FbTk::FbWindow &win);
56 /// Assign a window to merge our shape with.
57 /// (note that this is currently specific to frames)
58 void setShapeSource(FbTk::FbWindow *win, int xoff, int yoff, bool always_update);
59 void setShapeOffsets(int xoff, int yoff);
60 unsigned int width() const;
61 unsigned int height() const;
62 unsigned int clipWidth() const;
63 unsigned int clipHeight() const;
64 // sets shape notify mask
65 static void setShapeNotify(const FbTk::FbWindow &win);
66 /// @return true if window has shape
67 static bool isShaped(const FbTk::FbWindow &win);
68private:
69 FbTk::FbWindow *m_win; ///< window to be shaped
70 FbTk::FbWindow *m_shapesource; ///< window to pull shape from
71 int m_shapesource_xoff, m_shapesource_yoff;
72
73 void initCorners(int screen_num);
74
75 struct CornerPixmaps {
76 FbTk::FbPixmap topleft;
77 FbTk::FbPixmap topright;
78 FbTk::FbPixmap botleft;
79 FbTk::FbPixmap botright;
80 };
81
82 // unfortunately, we need a separate pixmap per screen
83 static std::vector<CornerPixmaps> s_corners;
84 int m_shapeplaces; ///< places to shape
85
86};
87
88#endif // SHAPE_HH