aboutsummaryrefslogtreecommitdiff
path: root/src/Shape.hh
diff options
context:
space:
mode:
authorsimonb <simonb>2007-08-09 03:45:31 (GMT)
committersimonb <simonb>2007-08-09 03:45:31 (GMT)
commita0f44b9e9a7c2e401e2cf1ef80fed98acf1d7e44 (patch)
tree2c2658372e5e85c2d0c186f7080e9534430af633 /src/Shape.hh
parenta04eed16c5287c11e565ecb25f465b96d6f61279 (diff)
downloadfluxbox-a0f44b9e9a7c2e401e2cf1ef80fed98acf1d7e44.zip
fluxbox-a0f44b9e9a7c2e401e2cf1ef80fed98acf1d7e44.tar.bz2
Fix handling of Shape, stage 2 (more involved/complete handling)
Diffstat (limited to 'src/Shape.hh')
-rw-r--r--src/Shape.hh26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/Shape.hh b/src/Shape.hh
index c8db79a..5f26d05 100644
--- a/src/Shape.hh
+++ b/src/Shape.hh
@@ -24,12 +24,14 @@
24#ifndef SHAPE_HH 24#ifndef SHAPE_HH
25#define SHAPE_HH 25#define SHAPE_HH
26 26
27#include "FbTk/FbPixmap.hh"
28
27#include <X11/Xlib.h> 29#include <X11/Xlib.h>
28#include <memory> 30#include <memory>
31#include <vector>
29 32
30namespace FbTk { 33namespace FbTk {
31class FbWindow; 34class FbWindow;
32class FbPixmap;
33} 35}
34 36
35/// creates round corners on windows 37/// creates round corners on windows
@@ -51,6 +53,10 @@ public:
51 void update(); 53 void update();
52 /// assign a new window 54 /// assign a new window
53 void setWindow(FbTk::FbWindow &win); 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);
54 unsigned int width() const; 60 unsigned int width() const;
55 unsigned int height() const; 61 unsigned int height() const;
56 unsigned int clipWidth() const; 62 unsigned int clipWidth() const;
@@ -60,11 +66,21 @@ public:
60 /// @return true if window has shape 66 /// @return true if window has shape
61 static bool isShaped(const FbTk::FbWindow &win); 67 static bool isShaped(const FbTk::FbWindow &win);
62private: 68private:
63 FbTk::FbPixmap *createShape(bool clipshape); // true for clip, false for bounding
64
65 FbTk::FbWindow *m_win; ///< window to be shaped 69 FbTk::FbWindow *m_win; ///< window to be shaped
66 std::auto_ptr<FbTk::FbPixmap> m_clipshape; ///< our shape pixmap 70 FbTk::FbWindow *m_shapesource; ///< window to pull shape from
67 std::auto_ptr<FbTk::FbPixmap> m_boundingshape; ///< our shape pixmap 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;
68 int m_shapeplaces; ///< places to shape 84 int m_shapeplaces; ///< places to shape
69 85
70}; 86};