aboutsummaryrefslogtreecommitdiff
path: root/src/FbWinFrame.hh
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-01-07 01:30:57 (GMT)
committerfluxgen <fluxgen>2003-01-07 01:30:57 (GMT)
commit06f63eec84fa37e0832fee0432cd398f55f7aeba (patch)
tree48644dbb2b3571baff95513f9e9768725bc4f82d /src/FbWinFrame.hh
parent65fe7c36750f0c8418acbdc2732e0095eb344344 (diff)
downloadfluxbox_pavel-06f63eec84fa37e0832fee0432cd398f55f7aeba.zip
fluxbox_pavel-06f63eec84fa37e0832fee0432cd398f55f7aeba.tar.bz2
added double click interval, fixed actions on titlebar, added hide/show decorations
Diffstat (limited to 'src/FbWinFrame.hh')
-rw-r--r--src/FbWinFrame.hh28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
index c74b73c..ba553cc 100644
--- a/src/FbWinFrame.hh
+++ b/src/FbWinFrame.hh
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbWinFrame.hh,v 1.1 2003/01/05 22:14:10 fluxgen Exp $ 22// $Id: FbWinFrame.hh,v 1.2 2003/01/07 01:28:16 fluxgen Exp $
23 23
24#ifndef FBWINFRAME_HH 24#ifndef FBWINFRAME_HH
25#define FBWINFRAME_HH 25#define FBWINFRAME_HH
@@ -30,14 +30,17 @@
30#include "Font.hh" 30#include "Font.hh"
31#include "Text.hh" 31#include "Text.hh"
32#include "FbWinFrameTheme.hh" 32#include "FbWinFrameTheme.hh"
33#include "RefCount.hh"
34#include "Command.hh"
33 35
34#include <vector> 36#include <vector>
35#include <string> 37#include <string>
36 38
39
37class FbWinFrameTheme; 40class FbWinFrameTheme;
38class BImageControl; 41class BImageControl;
39 42
40/// holds a window frame with a client window 43/// holds a window frame with a client window (see: <a href="fluxbox_fbwinframe.png">image</a>)
41class FbWinFrame:public FbTk::EventHandler { 44class FbWinFrame:public FbTk::EventHandler {
42public: 45public:
43 46
@@ -53,6 +56,10 @@ public:
53 /// destroy frame 56 /// destroy frame
54 ~FbWinFrame(); 57 ~FbWinFrame();
55 58
59 /// setup actions for titlebar
60 bool setOnClickTitlebar(FbTk::RefCount<FbTk::Command> &cmd, int button_num,
61 bool double_click=false, bool pressed=false);
62
56 void hide(); 63 void hide();
57 void show(); 64 void show();
58 /// shade frame (ie resize to titlebar size) 65 /// shade frame (ie resize to titlebar size)
@@ -66,6 +73,7 @@ public:
66 void setTitle(const std::string &title); 73 void setTitle(const std::string &title);
67 /// set focus/unfocus style 74 /// set focus/unfocus style
68 void setFocus(bool newvalue); 75 void setFocus(bool newvalue);
76 void setDoubleClickTime(unsigned int time);
69 void setBevel(int bevel); 77 void setBevel(int bevel);
70 /// add a button to the left of the label 78 /// add a button to the left of the label
71 void addLeftButton(FbTk::Button *btn); 79 void addLeftButton(FbTk::Button *btn);
@@ -88,12 +96,15 @@ public:
88 void showTitlebar(); 96 void showTitlebar();
89 void hideHandle(); 97 void hideHandle();
90 void showHandle(); 98 void showHandle();
99 void hideAllDecorations();
100 void showAllDecorations();
91 101
92 /** 102 /**
93 @name Event handlers 103 @name Event handlers
94 */ 104 */
95 //@{ 105 //@{
96 void buttonPressEvent(XButtonEvent &event); 106 void buttonPressEvent(XButtonEvent &event);
107 void buttonReleaseEvent(XButtonEvent &event);
97 void exposeEvent(XExposeEvent &event); 108 void exposeEvent(XExposeEvent &event);
98 void configureNotifyEvent(XConfigureEvent &event); 109 void configureNotifyEvent(XConfigureEvent &event);
99 void handleEvent(XEvent &event); 110 void handleEvent(XEvent &event);
@@ -128,7 +139,9 @@ public:
128 inline FbTk::FbWindow &gripRight() { return m_grip_right; } 139 inline FbTk::FbWindow &gripRight() { return m_grip_right; }
129 inline bool focused() const { return m_focused; } 140 inline bool focused() const { return m_focused; }
130 inline bool isShaded() const { return m_shaded; } 141 inline bool isShaded() const { return m_shaded; }
142 /// @return titlebar height
131 unsigned int titleHeight() const; 143 unsigned int titleHeight() const;
144 /// @return size of button
132 unsigned int buttonHeight() const; 145 unsigned int buttonHeight() const;
133 146
134 //@} 147 //@}
@@ -178,8 +191,9 @@ private:
178 std::string m_titletext; ///< text to be displayed int m_label 191 std::string m_titletext; ///< text to be displayed int m_label
179 int m_bevel; ///< bevel between titlebar items and titlebar 192 int m_bevel; ///< bevel between titlebar items and titlebar
180 bool m_use_titlebar; ///< if we should use titlebar 193 bool m_use_titlebar; ///< if we should use titlebar
181 bool m_use_handles; ///< if we should use handles 194 bool m_use_handle; ///< if we should use handle
182 bool m_focused; ///< focused/unfocused mode 195 bool m_focused; ///< focused/unfocused mode
196
183 /** 197 /**
184 @name pixmaps and colors for rendering 198 @name pixmaps and colors for rendering
185 */ 199 */
@@ -215,7 +229,13 @@ private:
215 unsigned int m_width_before_shade, ///< width before shade, so we can restore it when we unshade 229 unsigned int m_width_before_shade, ///< width before shade, so we can restore it when we unshade
216 m_height_before_shade; ///< height before shade, so we can restore it when we unshade 230 m_height_before_shade; ///< height before shade, so we can restore it when we unshade
217 bool m_shaded; ///< wheter we're shaded or not 231 bool m_shaded; ///< wheter we're shaded or not
218 232 unsigned int m_double_click_time; ///< the time period that's considerd to be a double click
233 struct MouseButtonAction {
234 FbTk::RefCount<FbTk::Command> click; ///< what to do when we release mouse button
235 FbTk::RefCount<FbTk::Command> click_pressed; ///< what to do when we press mouse button
236 FbTk::RefCount<FbTk::Command> double_click; ///< what to do when we double click
237 };
238 MouseButtonAction m_commands[5]; ///< hardcoded to five ...TODO, change this
219}; 239};
220 240
221#endif // FBWINFRAME_HH 241#endif // FBWINFRAME_HH