diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-15 11:04:56 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-15 11:04:56 (GMT) |
commit | 4fa3773267362f8ca9f653bb8ee7c98baa09d5fd (patch) | |
tree | d77ee1cde06ab0b5d4a403f236aff4a51d418c89 /src/FbWinFrame.hh | |
parent | 80059c6dae8de4962b14f08bd75f1c773e37a78d (diff) | |
download | fluxbox_pavel-4fa3773267362f8ca9f653bb8ee7c98baa09d5fd.zip fluxbox_pavel-4fa3773267362f8ca9f653bb8ee7c98baa09d5fd.tar.bz2 |
move size hint code to FbWinFrame
Diffstat (limited to 'src/FbWinFrame.hh')
-rw-r--r-- | src/FbWinFrame.hh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh index e24612e..d2a27c9 100644 --- a/src/FbWinFrame.hh +++ b/src/FbWinFrame.hh | |||
@@ -95,6 +95,21 @@ public: | |||
95 | DECOR_TAB = DECORM_BORDER|DECORM_MENU|DECORM_TAB | 95 | DECOR_TAB = DECORM_BORDER|DECORM_MENU|DECORM_TAB |
96 | }; | 96 | }; |
97 | 97 | ||
98 | typedef struct SizeHints { | ||
99 | unsigned int min_width; | ||
100 | unsigned int max_width; | ||
101 | unsigned int min_height; | ||
102 | unsigned int max_height; | ||
103 | unsigned int width_inc; | ||
104 | unsigned int height_inc; | ||
105 | unsigned int min_aspect_x; | ||
106 | unsigned int max_aspect_x; | ||
107 | unsigned int min_aspect_y; | ||
108 | unsigned int max_aspect_y; | ||
109 | unsigned int base_width; | ||
110 | unsigned int base_height; | ||
111 | } SizeHints; | ||
112 | |||
98 | /// create a top level window | 113 | /// create a top level window |
99 | FbWinFrame(BScreen &screen, FocusableTheme<FbWinFrameTheme> &theme, | 114 | FbWinFrame(BScreen &screen, FocusableTheme<FbWinFrameTheme> &theme, |
100 | FbTk::ImageControl &imgctrl, | 115 | FbTk::ImageControl &imgctrl, |
@@ -185,6 +200,18 @@ public: | |||
185 | /// remove any handler for the windows | 200 | /// remove any handler for the windows |
186 | void removeEventHandler(); | 201 | void removeEventHandler(); |
187 | 202 | ||
203 | /** | ||
204 | * Changes width and height to the nearest (lower) value | ||
205 | * that conforms to it's size hints. | ||
206 | * | ||
207 | * display_* give the values that would be displayed | ||
208 | * to the user when resizing. | ||
209 | * We use pointers for display_* since they are optional. | ||
210 | */ | ||
211 | void applySizeHints(int &width, int &height, int *display_width = 0, | ||
212 | int *display_height = 0, bool maximizing = false); | ||
213 | void setSizeHints(const SizeHints &hint) { m_size_hints = hint; } | ||
214 | |||
188 | void setDecorationMask(unsigned int mask) { m_decoration_mask = mask; } | 215 | void setDecorationMask(unsigned int mask) { m_decoration_mask = mask; } |
189 | void applyDecorations(); | 216 | void applyDecorations(); |
190 | 217 | ||
@@ -392,6 +419,7 @@ private: | |||
392 | // last gravity that this window was *actively* placed with | 419 | // last gravity that this window was *actively* placed with |
393 | int m_active_gravity; | 420 | int m_active_gravity; |
394 | unsigned int m_active_orig_client_bw; | 421 | unsigned int m_active_orig_client_bw; |
422 | SizeHints m_size_hints; | ||
395 | 423 | ||
396 | bool m_need_render; | 424 | bool m_need_render; |
397 | int m_button_size; ///< size for all titlebar buttons | 425 | int m_button_size; ///< size for all titlebar buttons |