diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-16 12:54:07 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-16 12:54:07 (GMT) |
commit | 38654bae459716409ad2ee7975671fc2f131c869 (patch) | |
tree | 6f2f3c662f8317f47a422db02d17bff378266817 /src | |
parent | 06837ba8642b8a126de92f60ae05d5f84bba8bfe (diff) | |
download | fluxbox-38654bae459716409ad2ee7975671fc2f131c869.zip fluxbox-38654bae459716409ad2ee7975671fc2f131c869.tar.bz2 |
some cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/Ewmh.cc | 2 | ||||
-rw-r--r-- | src/FbTk/Container.cc | 11 | ||||
-rw-r--r-- | src/FbTk/FbDrawable.cc | 8 | ||||
-rw-r--r-- | src/FbTk/FbDrawable.hh | 4 | ||||
-rw-r--r-- | src/FbTk/FbWindow.cc | 9 | ||||
-rw-r--r-- | src/FbTk/FbWindow.hh | 5 | ||||
-rw-r--r-- | src/FbTk/GContext.hh | 14 | ||||
-rw-r--r-- | src/FbTk/Layer.hh | 79 | ||||
-rw-r--r-- | src/FbTk/LayerItem.hh | 5 | ||||
-rw-r--r-- | src/FbTk/Menu.cc | 2 | ||||
-rw-r--r-- | src/FbTk/Menu.hh | 9 | ||||
-rw-r--r-- | src/FbTk/RefCount.hh | 5 | ||||
-rw-r--r-- | src/FbTk/SignalHandler.cc | 7 | ||||
-rw-r--r-- | src/FbTk/SignalHandler.hh | 8 | ||||
-rw-r--r-- | src/FbTk/TextButton.cc | 16 | ||||
-rw-r--r-- | src/FbTk/TextButton.hh | 10 | ||||
-rw-r--r-- | src/FbTk/Texture.cc | 3 | ||||
-rw-r--r-- | src/FbTk/XLayer.cc | 94 | ||||
-rw-r--r-- | src/FbTk/XLayer.hh | 9 | ||||
-rw-r--r-- | src/FbTk/XLayerItem.cc | 10 | ||||
-rw-r--r-- | src/FbTk/XLayerItem.hh | 6 | ||||
-rw-r--r-- | src/FbWinFrame.cc | 12 | ||||
-rw-r--r-- | src/Remember.cc | 8 | ||||
-rw-r--r-- | src/Window.cc | 30 |
24 files changed, 42 insertions, 324 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc index 5db7478..8938e7d 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc | |||
@@ -1251,7 +1251,7 @@ void Ewmh::toggleState(FluxboxWindow &win, Atom state) { | |||
1251 | void Ewmh::setState(FluxboxWindow &win, Atom state, bool value, | 1251 | void Ewmh::setState(FluxboxWindow &win, Atom state, bool value, |
1252 | WinClient &client) { | 1252 | WinClient &client) { |
1253 | if (state == m_net->wm_state_sticky) { // STICKY | 1253 | if (state == m_net->wm_state_sticky) { // STICKY |
1254 | if (value && !win.isStuck() || | 1254 | if ((value && !win.isStuck()) || |
1255 | (!value && win.isStuck())) | 1255 | (!value && win.isStuck())) |
1256 | win.stick(); | 1256 | win.stick(); |
1257 | } else if (state == m_net->wm_state_shaded) { // SHADED | 1257 | } else if (state == m_net->wm_state_shaded) { // SHADED |
diff --git a/src/FbTk/Container.cc b/src/FbTk/Container.cc index 8175829..381f13f 100644 --- a/src/FbTk/Container.cc +++ b/src/FbTk/Container.cc | |||
@@ -332,7 +332,8 @@ void Container::repositionItems() { | |||
332 | // calling Container::resize here risks infinite loops | 332 | // calling Container::resize here risks infinite loops |
333 | unsigned int neww = total_width, newh = height; | 333 | unsigned int neww = total_width, newh = height; |
334 | translateSize(m_orientation, neww, newh); | 334 | translateSize(m_orientation, neww, newh); |
335 | if (align == RIGHT && m_orientation != ROT270 || align == LEFT && m_orientation == ROT270) { | 335 | if ((align == RIGHT && m_orientation != ROT270) || |
336 | (align == LEFT && m_orientation == ROT270)) { | ||
336 | int deltax = 0; | 337 | int deltax = 0; |
337 | int deltay = 0; | 338 | int deltay = 0; |
338 | if (m_orientation == ROT0 || m_orientation == ROT180) | 339 | if (m_orientation == ROT0 || m_orientation == ROT180) |
@@ -477,10 +478,10 @@ void Container::setOrientation(Orientation orient) { | |||
477 | for (; it != it_end; ++it) | 478 | for (; it != it_end; ++it) |
478 | (*it)->setOrientation(orient); | 479 | (*it)->setOrientation(orient); |
479 | 480 | ||
480 | if ((m_orientation == ROT0 || m_orientation == ROT180) && | 481 | if (((m_orientation == ROT0 || m_orientation == ROT180) && |
481 | (orient == ROT90 || orient == ROT270) || | 482 | (orient == ROT90 || orient == ROT270)) || |
482 | (m_orientation == ROT90 || m_orientation == ROT270) && | 483 | ((m_orientation == ROT90 || m_orientation == ROT270) && |
483 | (orient == ROT0 || orient == ROT180)) { | 484 | (orient == ROT0 || orient == ROT180))) { |
484 | // flip width and height | 485 | // flip width and height |
485 | m_orientation = orient; | 486 | m_orientation = orient; |
486 | resize(height(), width()); | 487 | resize(height(), width()); |
diff --git a/src/FbTk/FbDrawable.cc b/src/FbTk/FbDrawable.cc index 766dd56..3579268 100644 --- a/src/FbTk/FbDrawable.cc +++ b/src/FbTk/FbDrawable.cc | |||
@@ -151,14 +151,6 @@ void FbDrawable::drawTriangle(GC gc, FbDrawable::TriangleType type, | |||
151 | Convex, CoordModePrevious); | 151 | Convex, CoordModePrevious); |
152 | } | 152 | } |
153 | 153 | ||
154 | #ifdef NOT_USED | ||
155 | void FbDrawable::drawPoint(GC gc, int x, int y) { | ||
156 | if (drawable() == 0 || gc == 0) | ||
157 | return; | ||
158 | XDrawPoint(display(), drawable(), gc, x, y); | ||
159 | } | ||
160 | #endif | ||
161 | |||
162 | XImage *FbDrawable::image(int x, int y, unsigned int width, unsigned int height) const { | 154 | XImage *FbDrawable::image(int x, int y, unsigned int width, unsigned int height) const { |
163 | return XGetImage(display(), drawable(), | 155 | return XGetImage(display(), drawable(), |
164 | x, y, width, height, | 156 | x, y, width, height, |
diff --git a/src/FbTk/FbDrawable.hh b/src/FbTk/FbDrawable.hh index e98c732..9add5a0 100644 --- a/src/FbTk/FbDrawable.hh +++ b/src/FbTk/FbDrawable.hh | |||
@@ -61,10 +61,6 @@ public: | |||
61 | 61 | ||
62 | virtual void drawTriangle(GC gc, TriangleType type, int x, int y, unsigned int width, unsigned int height, int scale); | 62 | virtual void drawTriangle(GC gc, TriangleType type, int x, int y, unsigned int width, unsigned int height, int scale); |
63 | 63 | ||
64 | #ifdef NOT_USED | ||
65 | virtual void drawPoint(GC gc, int x, int y); | ||
66 | #endif | ||
67 | |||
68 | virtual XImage *image(int x, int y, unsigned int width, unsigned int height) const; | 64 | virtual XImage *image(int x, int y, unsigned int width, unsigned int height) const; |
69 | 65 | ||
70 | /// X drawable | 66 | /// X drawable |
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index fb68eb9..56f354b 100644 --- a/src/FbTk/FbWindow.cc +++ b/src/FbTk/FbWindow.cc | |||
@@ -283,7 +283,8 @@ void FbWindow::updateTransparent(int the_x, int the_y, unsigned int the_width, u | |||
283 | if (width() == 0 || height() == 0) | 283 | if (width() == 0 || height() == 0) |
284 | return; | 284 | return; |
285 | 285 | ||
286 | if (!dest_override && (the_width == 0 && the_height == 0 || the_width == width() && the_height == height()) && | 286 | if (!dest_override && ((the_width == 0 && the_height == 0) || |
287 | (the_width == width() && the_height == height())) && | ||
287 | the_x <= 0 && the_y <= 0) { | 288 | the_x <= 0 && the_y <= 0) { |
288 | // do the whole thing | 289 | // do the whole thing |
289 | updateBackground(true); | 290 | updateBackground(true); |
@@ -453,12 +454,6 @@ void FbWindow::setCursor(Cursor cur) { | |||
453 | XDefineCursor(display(), window(), cur); | 454 | XDefineCursor(display(), window(), cur); |
454 | } | 455 | } |
455 | 456 | ||
456 | #ifdef NOT_USED | ||
457 | void FbWindow::unsetCursor() { | ||
458 | XUndefineCursor(display(), window()); | ||
459 | } | ||
460 | #endif | ||
461 | |||
462 | void FbWindow::reparent(const FbWindow &parent, int x, int y, bool continuing) { | 457 | void FbWindow::reparent(const FbWindow &parent, int x, int y, bool continuing) { |
463 | XReparentWindow(display(), window(), parent.window(), x, y); | 458 | XReparentWindow(display(), window(), parent.window(), x, y); |
464 | m_parent = &parent; | 459 | m_parent = &parent; |
diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh index f212e50..a80a5b0 100644 --- a/src/FbTk/FbWindow.hh +++ b/src/FbTk/FbWindow.hh | |||
@@ -137,10 +137,7 @@ public: | |||
137 | void setInputFocus(int revert_to, int time); | 137 | void setInputFocus(int revert_to, int time); |
138 | /// defines a cursor for this window | 138 | /// defines a cursor for this window |
139 | void setCursor(Cursor cur); | 139 | void setCursor(Cursor cur); |
140 | #ifdef NOT_USED | 140 | |
141 | /// uses the parents cursor instead | ||
142 | void unsetCursor(); | ||
143 | #endif | ||
144 | void reparent(const FbWindow &parent, int x, int y, bool continuing = true); | 141 | void reparent(const FbWindow &parent, int x, int y, bool continuing = true); |
145 | 142 | ||
146 | bool property(Atom property, | 143 | bool property(Atom property, |
diff --git a/src/FbTk/GContext.hh b/src/FbTk/GContext.hh index 7fd16d4..e100bb6 100644 --- a/src/FbTk/GContext.hh +++ b/src/FbTk/GContext.hh | |||
@@ -89,15 +89,7 @@ public: | |||
89 | void setFont(int fid) { | 89 | void setFont(int fid) { |
90 | XSetFont(m_display, m_gc, fid); | 90 | XSetFont(m_display, m_gc, fid); |
91 | } | 91 | } |
92 | #ifdef NOT_USED | ||
93 | void setClipMask(const FbTk::FbPixmap &mask) { | ||
94 | XSetClipMask(m_display, m_gc, mask.drawable()); | ||
95 | } | ||
96 | 92 | ||
97 | void setClipOrigin(int x, int y) { | ||
98 | XSetClipOrigin(m_display, m_gc, x, y); | ||
99 | } | ||
100 | #endif | ||
101 | void setGraphicsExposure(bool value) { | 93 | void setGraphicsExposure(bool value) { |
102 | XSetGraphicsExposures(m_display, m_gc, value); | 94 | XSetGraphicsExposures(m_display, m_gc, value); |
103 | } | 95 | } |
@@ -112,11 +104,7 @@ public: | |||
112 | void setFillStyle(int style) { | 104 | void setFillStyle(int style) { |
113 | XSetFillStyle(m_display, m_gc, style); | 105 | XSetFillStyle(m_display, m_gc, style); |
114 | } | 106 | } |
115 | #ifdef NOT_USED | 107 | |
116 | void setFillRule(int rule) { | ||
117 | XSetFillRule(m_display, m_gc, rule); | ||
118 | } | ||
119 | #endif | ||
120 | void setLineAttributes(unsigned int width, | 108 | void setLineAttributes(unsigned int width, |
121 | int line_style, | 109 | int line_style, |
122 | int cap_style, | 110 | int cap_style, |
diff --git a/src/FbTk/Layer.hh b/src/FbTk/Layer.hh index 954449d..405285c 100644 --- a/src/FbTk/Layer.hh +++ b/src/FbTk/Layer.hh | |||
@@ -39,22 +39,10 @@ public: | |||
39 | virtual iterator insert(ItemType &item, unsigned int pos=0); | 39 | virtual iterator insert(ItemType &item, unsigned int pos=0); |
40 | /// remove item from list | 40 | /// remove item from list |
41 | virtual void remove(ItemType &item); | 41 | virtual void remove(ItemType &item); |
42 | #ifdef NOT_USED | ||
43 | /// cycle all item upwards | ||
44 | virtual void cycleUp(); | ||
45 | /// cycle all items downwards | ||
46 | virtual void cycleDown(); | ||
47 | #endif // NOT_USED | ||
48 | /// move item to top | 42 | /// move item to top |
49 | virtual void raise(ItemType &item); | 43 | virtual void raise(ItemType &item); |
50 | /// move item to bottom | 44 | /// move item to bottom |
51 | virtual void lower(ItemType &item); | 45 | virtual void lower(ItemType &item); |
52 | #ifdef NOT_USED | ||
53 | /// raise a specific item one step | ||
54 | virtual void stepUp(ItemType &item); | ||
55 | /// lower a specific item one step | ||
56 | virtual void stepDown(ItemType &item); | ||
57 | #endif // NOT_USED | ||
58 | virtual void restack(); | 46 | virtual void restack(); |
59 | /// @return layer item on specific position, on failure 0 | 47 | /// @return layer item on specific position, on failure 0 |
60 | ItemType *getItem(unsigned int position); | 48 | ItemType *getItem(unsigned int position); |
@@ -95,73 +83,6 @@ void Layer<ItemType, Container>::remove(ItemType &item) { | |||
95 | m_list.erase(it); | 83 | m_list.erase(it); |
96 | } | 84 | } |
97 | 85 | ||
98 | #ifdef NOT_USED | ||
99 | template <typename ItemType, typename Container> | ||
100 | void Layer<ItemType, Container>::cycleUp() { | ||
101 | if (size() == 0) | ||
102 | return; | ||
103 | iterator it = itemList().begin(); | ||
104 | it++; | ||
105 | rotate(itemList().begin(), it, itemList().end()); | ||
106 | restack(); | ||
107 | } | ||
108 | |||
109 | |||
110 | template <typename ItemType, typename Container> | ||
111 | void Layer<ItemType, Container>::cycleDown() { | ||
112 | if (size() == 0) | ||
113 | return; | ||
114 | // save last item and remove it from list | ||
115 | ItemType *last_item = itemList().back(); | ||
116 | itemList().pop_back(); | ||
117 | // add last item to front | ||
118 | itemList().insert(itemList().begin(), last_item); | ||
119 | restack(); | ||
120 | } | ||
121 | |||
122 | template <typename ItemType, typename Container> | ||
123 | void Layer<ItemType, Container>::stepUp(ItemType &item) { | ||
124 | iterator it = | ||
125 | find(itemList().begin(), itemList().end(), &item); | ||
126 | |||
127 | if (it == itemList().end()) | ||
128 | return; | ||
129 | |||
130 | if (it == itemList().begin()) // we can't raise it more | ||
131 | return; | ||
132 | |||
133 | iterator new_pos = it; | ||
134 | new_pos--; | ||
135 | ItemType *textitem = *it; | ||
136 | // remove item from list | ||
137 | itemList().erase(it); | ||
138 | // insert above last pos | ||
139 | itemList().insert(new_pos, textitem); | ||
140 | restack(); | ||
141 | } | ||
142 | |||
143 | template <typename ItemType, typename Container> | ||
144 | void Layer<ItemType, Container>::stepDown(ItemType &item) { | ||
145 | iterator it = | ||
146 | find(itemList().begin(), itemList().end(), &item); | ||
147 | |||
148 | if (it == itemList().end()) // we didn't find the item in our list | ||
149 | return; | ||
150 | |||
151 | if (*it == itemList().back()) // it's already at the bottom | ||
152 | return; | ||
153 | |||
154 | iterator new_pos = it; | ||
155 | new_pos++; | ||
156 | ItemType *textitem = *it; | ||
157 | // remove from list | ||
158 | itemList().erase(it); | ||
159 | // insert on the new place | ||
160 | itemList().insert(new_pos, textitem); | ||
161 | restack(); | ||
162 | } | ||
163 | #endif // NOT_USED | ||
164 | |||
165 | template <typename ItemType, typename Container> | 86 | template <typename ItemType, typename Container> |
166 | void Layer<ItemType, Container>::raise(ItemType &item) { | 87 | void Layer<ItemType, Container>::raise(ItemType &item) { |
167 | if (&item == itemList().front()) // already at the bottom | 88 | if (&item == itemList().front()) // already at the bottom |
diff --git a/src/FbTk/LayerItem.hh b/src/FbTk/LayerItem.hh index 981d9f5..945bb9a 100644 --- a/src/FbTk/LayerItem.hh +++ b/src/FbTk/LayerItem.hh | |||
@@ -32,11 +32,6 @@ public: | |||
32 | 32 | ||
33 | virtual void raise() = 0; | 33 | virtual void raise() = 0; |
34 | virtual void lower() = 0; | 34 | virtual void lower() = 0; |
35 | |||
36 | #ifdef NOT_USED | ||
37 | virtual void stepUp() = 0; | ||
38 | virtual void stepDown() = 0; | ||
39 | #endif // NOT_USED | ||
40 | }; | 35 | }; |
41 | 36 | ||
42 | } // end namespace FbTk | 37 | } // end namespace FbTk |
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index ec60b24..4bdc597 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc | |||
@@ -1136,7 +1136,7 @@ void Menu::openSubmenu() { | |||
1136 | 1136 | ||
1137 | int item = m_active_index; | 1137 | int item = m_active_index; |
1138 | if (!isVisible() || !validIndex(item) || !menuitems[item]->isEnabled() || | 1138 | if (!isVisible() || !validIndex(item) || !menuitems[item]->isEnabled() || |
1139 | s_focused != this && s_focused && s_focused->isVisible()) | 1139 | (s_focused != this && s_focused && s_focused->isVisible())) |
1140 | return; | 1140 | return; |
1141 | 1141 | ||
1142 | clearItem(item); | 1142 | clearItem(item); |
diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh index 2675502..ee57a23 100644 --- a/src/FbTk/Menu.hh +++ b/src/FbTk/Menu.hh | |||
@@ -76,10 +76,7 @@ public: | |||
76 | void removeAll(); | 76 | void removeAll(); |
77 | void setInternalMenu(bool val = true) { m_internal_menu = val; } | 77 | void setInternalMenu(bool val = true) { m_internal_menu = val; } |
78 | void setAlignment(Alignment a) { m_alignment = a; } | 78 | void setAlignment(Alignment a) { m_alignment = a; } |
79 | #ifdef NOT_USED | 79 | |
80 | void setTorn() { m_torn = true; } | ||
81 | void removeParent() { if (m_internal_menu) m_parent = 0; } | ||
82 | #endif | ||
83 | /// raise this window | 80 | /// raise this window |
84 | virtual void raise(); | 81 | virtual void raise(); |
85 | /// lower this window | 82 | /// lower this window |
@@ -122,16 +119,12 @@ public: | |||
122 | /// hide menu | 119 | /// hide menu |
123 | virtual void hide(bool force = false); | 120 | virtual void hide(bool force = false); |
124 | virtual void clearWindow(); | 121 | virtual void clearWindow(); |
125 | #ifdef NOT_USED | ||
126 | void setActiveIndex(int index) { m_active_index = index; } | ||
127 | /*@}*/ | 122 | /*@}*/ |
128 | 123 | ||
129 | /** | 124 | /** |
130 | @name accessors | 125 | @name accessors |
131 | */ | 126 | */ |
132 | //@{ | 127 | //@{ |
133 | int activeIndex() const { return m_active_index; } | ||
134 | #endif | ||
135 | bool isTorn() const { return m_torn; } | 128 | bool isTorn() const { return m_torn; } |
136 | bool isVisible() const { return m_visible; } | 129 | bool isVisible() const { return m_visible; } |
137 | bool isMoving() const { return m_moving; } | 130 | bool isMoving() const { return m_moving; } |
diff --git a/src/FbTk/RefCount.hh b/src/FbTk/RefCount.hh index adeebf0..6d1b9b7 100644 --- a/src/FbTk/RefCount.hh +++ b/src/FbTk/RefCount.hh | |||
@@ -38,10 +38,7 @@ public: | |||
38 | Pointer *operator * () const { return get(); } | 38 | Pointer *operator * () const { return get(); } |
39 | Pointer *operator -> () const { return get(); } | 39 | Pointer *operator -> () const { return get(); } |
40 | Pointer *get() const { return m_data; } | 40 | Pointer *get() const { return m_data; } |
41 | #ifdef NOT_USED | 41 | |
42 | /// @return number of references | ||
43 | unsigned int usedBy() const { return (m_refcount != 0 ? *m_refcount : 0); } | ||
44 | #endif | ||
45 | private: | 42 | private: |
46 | /// increase reference count | 43 | /// increase reference count |
47 | void incRefCount(); | 44 | void incRefCount(); |
diff --git a/src/FbTk/SignalHandler.cc b/src/FbTk/SignalHandler.cc index c7a4fa7..ea0f86f 100644 --- a/src/FbTk/SignalHandler.cc +++ b/src/FbTk/SignalHandler.cc | |||
@@ -60,13 +60,6 @@ bool SignalHandler::registerHandler(int signum, SignalEventHandler *eh, | |||
60 | return true; | 60 | return true; |
61 | } | 61 | } |
62 | 62 | ||
63 | #ifdef NOT_USED | ||
64 | void SignalHandler::removeHandler(int signum) { | ||
65 | if (signum < NSIG) | ||
66 | s_signal_handler[signum] = 0; // clear handler pointer | ||
67 | } | ||
68 | #endif | ||
69 | |||
70 | void SignalHandler::handleSignal(int signum) { | 63 | void SignalHandler::handleSignal(int signum) { |
71 | if (signum >= NSIG) | 64 | if (signum >= NSIG) |
72 | return; | 65 | return; |
diff --git a/src/FbTk/SignalHandler.hh b/src/FbTk/SignalHandler.hh index 9c8e680..774f4b1 100644 --- a/src/FbTk/SignalHandler.hh +++ b/src/FbTk/SignalHandler.hh | |||
@@ -52,13 +52,7 @@ public: | |||
52 | @param oldhandler_ret return handler to old sighandler | 52 | @param oldhandler_ret return handler to old sighandler |
53 | */ | 53 | */ |
54 | bool registerHandler(int signum, SignalEventHandler *eh, SignalEventHandler **oldhandler_ret = 0); | 54 | bool registerHandler(int signum, SignalEventHandler *eh, SignalEventHandler **oldhandler_ret = 0); |
55 | #ifdef NOT_USED | 55 | |
56 | /** | ||
57 | removes the signum handler | ||
58 | @param signum signal number | ||
59 | */ | ||
60 | void removeHandler(int signum); | ||
61 | #endif | ||
62 | private: | 56 | private: |
63 | SignalHandler(); | 57 | SignalHandler(); |
64 | 58 | ||
diff --git a/src/FbTk/TextButton.cc b/src/FbTk/TextButton.cc index f259d89..79ed1ab 100644 --- a/src/FbTk/TextButton.cc +++ b/src/FbTk/TextButton.cc | |||
@@ -97,15 +97,6 @@ void TextButton::setFont(FbTk::Font &font) { | |||
97 | font.validOrientation(m_orientation); // load the orientation! | 97 | font.validOrientation(m_orientation); // load the orientation! |
98 | } | 98 | } |
99 | 99 | ||
100 | #ifdef NOT_USED | ||
101 | /// set bevel and redraw text | ||
102 | void TextButton::setBevel(int bevel) { | ||
103 | if (m_bevel == bevel) | ||
104 | return; | ||
105 | m_bevel = bevel; | ||
106 | } | ||
107 | #endif | ||
108 | |||
109 | void TextButton::setTextPaddingLeft(unsigned int leftpadding) { | 100 | void TextButton::setTextPaddingLeft(unsigned int leftpadding) { |
110 | m_left_padding = leftpadding; | 101 | m_left_padding = leftpadding; |
111 | } | 102 | } |
@@ -138,13 +129,6 @@ unsigned int TextButton::textWidth() const { | |||
138 | return font().textWidth(text().data(), text().size()); | 129 | return font().textWidth(text().data(), text().size()); |
139 | } | 130 | } |
140 | 131 | ||
141 | #ifdef NOT_USED | ||
142 | unsigned int TextButton::textHeight() const { | ||
143 | return font().height(); | ||
144 | |||
145 | } | ||
146 | #endif | ||
147 | |||
148 | void TextButton::renderForeground(FbWindow &win, FbDrawable &drawable) { | 132 | void TextButton::renderForeground(FbWindow &win, FbDrawable &drawable) { |
149 | // (win should always be *this, no need to check) | 133 | // (win should always be *this, no need to check) |
150 | drawText(0, 0, &drawable); | 134 | drawText(0, 0, &drawable); |
diff --git a/src/FbTk/TextButton.hh b/src/FbTk/TextButton.hh index 22cda82..6ddcd8f 100644 --- a/src/FbTk/TextButton.hh +++ b/src/FbTk/TextButton.hh | |||
@@ -40,9 +40,6 @@ public: | |||
40 | bool setOrientation(FbTk::Orientation orient); | 40 | bool setOrientation(FbTk::Orientation orient); |
41 | void setText(const std::string &text); | 41 | void setText(const std::string &text); |
42 | void setFont(FbTk::Font &font); | 42 | void setFont(FbTk::Font &font); |
43 | #ifdef NOT_USED | ||
44 | void setBevel(int bevel); | ||
45 | #endif | ||
46 | void setTextPadding(unsigned int padding); | 43 | void setTextPadding(unsigned int padding); |
47 | void setTextPaddingLeft(unsigned int leftpadding); | 44 | void setTextPaddingLeft(unsigned int leftpadding); |
48 | void setTextPaddingRight(unsigned int rightpadding); | 45 | void setTextPaddingRight(unsigned int rightpadding); |
@@ -67,14 +64,7 @@ public: | |||
67 | FbTk::Font &font() const { return *m_font; } | 64 | FbTk::Font &font() const { return *m_font; } |
68 | FbTk::Orientation orientation() const { return m_orientation; } | 65 | FbTk::Orientation orientation() const { return m_orientation; } |
69 | unsigned int textWidth() const; | 66 | unsigned int textWidth() const; |
70 | #ifdef NOT_USED | ||
71 | unsigned int textHeight() const; | ||
72 | #endif | ||
73 | int bevel() const { return m_bevel; } | 67 | int bevel() const { return m_bevel; } |
74 | #ifdef NOT_USED | ||
75 | unsigned int leftPadding() const { return m_left_padding; } | ||
76 | unsigned int rightPadding() const { return m_right_padding; } | ||
77 | #endif | ||
78 | 68 | ||
79 | void renderForeground(FbWindow &win, FbDrawable &drawable); | 69 | void renderForeground(FbWindow &win, FbDrawable &drawable); |
80 | 70 | ||
diff --git a/src/FbTk/Texture.cc b/src/FbTk/Texture.cc index 5a12e8d..2fcd915 100644 --- a/src/FbTk/Texture.cc +++ b/src/FbTk/Texture.cc | |||
@@ -89,11 +89,12 @@ void Texture::setFromString(const char * const texture_str) { | |||
89 | else | 89 | else |
90 | addType(Texture::DEFAULT_BEVEL); | 90 | addType(Texture::DEFAULT_BEVEL); |
91 | 91 | ||
92 | if (! (type() & Texture::FLAT)) | 92 | if (! (type() & Texture::FLAT)) { |
93 | if (strstr(ts, "bevel2")) | 93 | if (strstr(ts, "bevel2")) |
94 | addType(Texture::BEVEL2); | 94 | addType(Texture::BEVEL2); |
95 | else | 95 | else |
96 | addType(Texture::BEVEL1); | 96 | addType(Texture::BEVEL1); |
97 | } | ||
97 | 98 | ||
98 | if (strstr(ts, "invert")) | 99 | if (strstr(ts, "invert")) |
99 | addType(Texture::INVERT); | 100 | addType(Texture::INVERT); |
diff --git a/src/FbTk/XLayer.cc b/src/FbTk/XLayer.cc index 51a0fe0..0d878d3 100644 --- a/src/FbTk/XLayer.cc +++ b/src/FbTk/XLayer.cc | |||
@@ -174,100 +174,6 @@ void XLayer::remove(XLayerItem &item) { | |||
174 | } | 174 | } |
175 | } | 175 | } |
176 | 176 | ||
177 | #ifdef NOT_USED | ||
178 | void XLayer::cycleUp() { | ||
179 | // need to find highest visible window, and move it to bottom | ||
180 | iterator it = itemList().begin(); | ||
181 | iterator it_end = itemList().end(); | ||
182 | while (it != it_end && !(*it)->visible()) | ||
183 | ++it; | ||
184 | |||
185 | // if there is something to do | ||
186 | if (it != it_end) | ||
187 | lower(**it); | ||
188 | |||
189 | } | ||
190 | |||
191 | void XLayer::cycleDown() { | ||
192 | // need to find lowest visible window, and move it to top | ||
193 | // so use a reverse iterator, and the same logic as cycleUp() | ||
194 | reverse_iterator it = itemList().rbegin(); | ||
195 | reverse_iterator it_end = itemList().rend(); | ||
196 | while (it != it_end && !(*it)->visible()) | ||
197 | ++it; | ||
198 | |||
199 | // if there is something to do | ||
200 | if (it != it_end) | ||
201 | raise(**it); | ||
202 | |||
203 | } | ||
204 | |||
205 | void XLayer::stepUp(XLayerItem &item) { | ||
206 | // need to find next visible window upwards, and put it above that | ||
207 | |||
208 | if (&item == itemList().front()) | ||
209 | return; // nothing to do | ||
210 | |||
211 | // TODO: is there a better way of doing this? | ||
212 | |||
213 | // get our item | ||
214 | iterator myit = find(itemList().begin(), itemList().end(), &item); | ||
215 | iterator it = myit; | ||
216 | |||
217 | // go to the one above it in our layer (top is front, so we decrement) | ||
218 | --it; | ||
219 | |||
220 | // keep going until we find one that is currently visible to the user | ||
221 | while (it != itemList().begin() && !(*it)->visible()) | ||
222 | --it; | ||
223 | |||
224 | if (it == itemList().begin() && !(*it)->visible()) { | ||
225 | // reached front item, but it wasn't visible, therefore it was already raised | ||
226 | } else { | ||
227 | // it is the next visible item down, we need to be above it. | ||
228 | // remove that item from the list and add it back to before it (the one we want to go above) | ||
229 | |||
230 | itemList().erase(myit); | ||
231 | itemList().insert(it, &item); | ||
232 | |||
233 | // if we've reached the top of the layer, we need to stack below the next one up | ||
234 | if (it == itemList().begin()) { | ||
235 | stackBelowItem(&item, m_manager.getLowestItemAboveLayer(m_layernum)); | ||
236 | } else { | ||
237 | // otherwise go up one in this layer (i.e. above the one we want to go above) | ||
238 | --it; | ||
239 | // and stack below that. | ||
240 | stackBelowItem(&item, *it); | ||
241 | } | ||
242 | } | ||
243 | } | ||
244 | |||
245 | void XLayer::stepDown(XLayerItem &item) { | ||
246 | // need to find next visible window down, and put it below that | ||
247 | |||
248 | // if we're already the bottom of the layer | ||
249 | if (&item == itemList().back()) | ||
250 | return; // nothing to do | ||
251 | |||
252 | // get our position | ||
253 | iterator it = find(itemList().begin(), itemList().end(), &item); | ||
254 | |||
255 | // go one below it (top is front, so we must increment) | ||
256 | it++; | ||
257 | iterator it_end = itemList().end(); | ||
258 | |||
259 | // keep going down until we find a visible one | ||
260 | while (it != it_end && !(*it)->visible()) | ||
261 | it++; | ||
262 | |||
263 | // if we didn't reach the end, then stack below the | ||
264 | // item that we found. | ||
265 | if (it != it_end) | ||
266 | stackBelowItem(&item, *it); | ||
267 | // if we did reach the end, then there are no visible windows, so we don't do anything | ||
268 | } | ||
269 | #endif // NOT_USED | ||
270 | |||
271 | void XLayer::raise(XLayerItem &item) { | 177 | void XLayer::raise(XLayerItem &item) { |
272 | // assume it is already in this layer | 178 | // assume it is already in this layer |
273 | 179 | ||
diff --git a/src/FbTk/XLayer.hh b/src/FbTk/XLayer.hh index b9e34da..acc299c 100644 --- a/src/FbTk/XLayer.hh +++ b/src/FbTk/XLayer.hh | |||
@@ -60,15 +60,6 @@ public: | |||
60 | iterator insert(XLayerItem &item, unsigned int pos=0); | 60 | iterator insert(XLayerItem &item, unsigned int pos=0); |
61 | void remove(XLayerItem &item); | 61 | void remove(XLayerItem &item); |
62 | 62 | ||
63 | #ifdef NOT_USED | ||
64 | // move highest to bottom | ||
65 | void cycleUp(); | ||
66 | void cycleDown(); | ||
67 | // just go above the next window up in the current layer (not all the way to the top) | ||
68 | void stepUp(XLayerItem &item); | ||
69 | void stepDown(XLayerItem &item); | ||
70 | #endif // NOT_USED | ||
71 | |||
72 | // bring to top of layer | 63 | // bring to top of layer |
73 | void raise(XLayerItem &item); | 64 | void raise(XLayerItem &item); |
74 | void lower(XLayerItem &item); | 65 | void lower(XLayerItem &item); |
diff --git a/src/FbTk/XLayerItem.cc b/src/FbTk/XLayerItem.cc index c4e0393..d822590 100644 --- a/src/FbTk/XLayerItem.cc +++ b/src/FbTk/XLayerItem.cc | |||
@@ -58,16 +58,6 @@ void XLayerItem::tempRaise() { | |||
58 | m_layer->tempRaise(*this); | 58 | m_layer->tempRaise(*this); |
59 | } | 59 | } |
60 | 60 | ||
61 | #ifdef NOT_USED | ||
62 | void XLayerItem::stepUp() { | ||
63 | m_layer->stepUp(*this); | ||
64 | } | ||
65 | |||
66 | void XLayerItem::stepDown() { | ||
67 | m_layer->stepDown(*this); | ||
68 | } | ||
69 | #endif // NOT_USED | ||
70 | |||
71 | void XLayerItem::raiseLayer() { | 61 | void XLayerItem::raiseLayer() { |
72 | m_layer->raiseLayer(*this); | 62 | m_layer->raiseLayer(*this); |
73 | } | 63 | } |
diff --git a/src/FbTk/XLayerItem.hh b/src/FbTk/XLayerItem.hh index 6548665..8f9aebe 100644 --- a/src/FbTk/XLayerItem.hh +++ b/src/FbTk/XLayerItem.hh | |||
@@ -44,12 +44,6 @@ public: | |||
44 | void lower(); | 44 | void lower(); |
45 | void tempRaise(); // this raise gets reverted by a restack() | 45 | void tempRaise(); // this raise gets reverted by a restack() |
46 | 46 | ||
47 | #ifdef NOT_USED | ||
48 | // go above the next item visible in this layer | ||
49 | void stepUp(); | ||
50 | void stepDown(); | ||
51 | #endif // NOT_USED | ||
52 | |||
53 | // send to next layer up | 47 | // send to next layer up |
54 | void raiseLayer(); | 48 | void raiseLayer(); |
55 | void lowerLayer(); | 49 | void lowerLayer(); |
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index c7eaef3..d0d1e21 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc | |||
@@ -247,8 +247,8 @@ void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int heigh | |||
247 | if (move && x == window().x() && y == window().y()) | 247 | if (move && x == window().x() && y == window().y()) |
248 | move = false; | 248 | move = false; |
249 | 249 | ||
250 | if (resize && (m_state.shaded || width == FbWinFrame::width() && | 250 | if (resize && (m_state.shaded || (width == FbWinFrame::width() && |
251 | height == FbWinFrame::height())) | 251 | height == FbWinFrame::height()))) |
252 | resize = false; | 252 | resize = false; |
253 | 253 | ||
254 | if (!move && !resize) | 254 | if (!move && !resize) |
@@ -265,7 +265,7 @@ void FbWinFrame::moveResize(int x, int y, unsigned int width, unsigned int heigh | |||
265 | m_window.resize(width, height); | 265 | m_window.resize(width, height); |
266 | } | 266 | } |
267 | 267 | ||
268 | if (move || resize && m_screen.getTabPlacement() != TOPLEFT) | 268 | if (move || (resize && m_screen.getTabPlacement() != TOPLEFT)) |
269 | alignTabs(); | 269 | alignTabs(); |
270 | 270 | ||
271 | if (resize) { | 271 | if (resize) { |
@@ -413,7 +413,7 @@ void FbWinFrame::notifyMoved(bool clear) { | |||
413 | if (alpha == 255) | 413 | if (alpha == 255) |
414 | return; | 414 | return; |
415 | 415 | ||
416 | if (m_tabmode == EXTERNAL && m_use_tabs || m_use_titlebar) { | 416 | if ((m_tabmode == EXTERNAL && m_use_tabs) || m_use_titlebar) { |
417 | m_tab_container.parentMoved(); | 417 | m_tab_container.parentMoved(); |
418 | m_tab_container.for_each(mem_fun(&FbTk::Button::parentMoved)); | 418 | m_tab_container.for_each(mem_fun(&FbTk::Button::parentMoved)); |
419 | } | 419 | } |
@@ -1430,8 +1430,8 @@ int FbWinFrame::getDecoMaskFromString(const string &str_label) { | |||
1430 | if (label == "tab") | 1430 | if (label == "tab") |
1431 | return DECOR_TAB; | 1431 | return DECOR_TAB; |
1432 | int mask = -1; | 1432 | int mask = -1; |
1433 | if (str_label.size() > 1 && str_label[0] == '0' && str_label[1] == 'x' || | 1433 | if ((str_label.size() > 1 && str_label[0] == '0' && str_label[1] == 'x') || |
1434 | str_label.size() > 0 && isdigit(str_label[0])) | 1434 | (str_label.size() > 0 && isdigit(str_label[0]))) |
1435 | mask = strtol(str_label.c_str(), NULL, 0); | 1435 | mask = strtol(str_label.c_str(), NULL, 0); |
1436 | return mask; | 1436 | return mask; |
1437 | } | 1437 | } |
diff --git a/src/Remember.cc b/src/Remember.cc index fc5d9b6..3e9e16a 100644 --- a/src/Remember.cc +++ b/src/Remember.cc | |||
@@ -1310,8 +1310,8 @@ void Remember::setupFrame(FluxboxWindow &win) { | |||
1310 | 1310 | ||
1311 | if (app->shadedstate_remember) | 1311 | if (app->shadedstate_remember) |
1312 | // if inconsistent... | 1312 | // if inconsistent... |
1313 | if (win.isShaded() && !app->shadedstate || | 1313 | if ((win.isShaded() && !app->shadedstate) || |
1314 | !win.isShaded() && app->shadedstate) | 1314 | (!win.isShaded() && app->shadedstate)) |
1315 | win.shade(); // toggles | 1315 | win.shade(); // toggles |
1316 | 1316 | ||
1317 | // external tabs aren't available atm... | 1317 | // external tabs aren't available atm... |
@@ -1319,8 +1319,8 @@ void Remember::setupFrame(FluxboxWindow &win) { | |||
1319 | 1319 | ||
1320 | if (app->stuckstate_remember) | 1320 | if (app->stuckstate_remember) |
1321 | // if inconsistent... | 1321 | // if inconsistent... |
1322 | if (win.isStuck() && !app->stuckstate || | 1322 | if ((win.isStuck() && !app->stuckstate) || |
1323 | !win.isStuck() && app->stuckstate) | 1323 | (!win.isStuck() && app->stuckstate)) |
1324 | win.stick(); // toggles | 1324 | win.stick(); // toggles |
1325 | 1325 | ||
1326 | if (app->minimizedstate_remember) { | 1326 | if (app->minimizedstate_remember) { |
diff --git a/src/Window.cc b/src/Window.cc index 43dc311..269665e 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -1277,9 +1277,9 @@ void FluxboxWindow::getMaxSize(unsigned int* width, unsigned int* height) const | |||
1277 | for (; it != it_end; ++it) { | 1277 | for (; it != it_end; ++it) { |
1278 | // special case for max height/width == 0 | 1278 | // special case for max height/width == 0 |
1279 | // 0 indicates unlimited size, so we skip them | 1279 | // 0 indicates unlimited size, so we skip them |
1280 | if (h || (*it)->maxHeight() && h > (*it)->maxHeight()) | 1280 | if (!h || ((*it)->maxHeight() && h > (*it)->maxHeight())) |
1281 | h = (*it)->maxHeight(); | 1281 | h = (*it)->maxHeight(); |
1282 | if (!w || (*it)->maxWidth() && w > (*it)->maxWidth()) | 1282 | if (!w || ((*it)->maxWidth() && w > (*it)->maxWidth())) |
1283 | w = (*it)->maxWidth(); | 1283 | w = (*it)->maxWidth(); |
1284 | } | 1284 | } |
1285 | 1285 | ||
@@ -1876,7 +1876,7 @@ void FluxboxWindow::moveToLayer(int layernum, bool force) { | |||
1876 | if (!m_initialized) | 1876 | if (!m_initialized) |
1877 | m_layernum = layernum; | 1877 | m_layernum = layernum; |
1878 | 1878 | ||
1879 | if (m_layernum == layernum && !force || !m_client) | 1879 | if ((m_layernum == layernum && !force) || !m_client) |
1880 | return; | 1880 | return; |
1881 | 1881 | ||
1882 | // get root window | 1882 | // get root window |
@@ -2475,9 +2475,9 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) { | |||
2475 | } | 2475 | } |
2476 | 2476 | ||
2477 | // don't allow moving/resizing fullscreen or maximized windows | 2477 | // don't allow moving/resizing fullscreen or maximized windows |
2478 | if (isFullscreen() || isMaximizedHorz() && screen().getMaxIgnoreIncrement()) | 2478 | if (isFullscreen() || (isMaximizedHorz() && screen().getMaxIgnoreIncrement())) |
2479 | cr.value_mask = cr.value_mask & ~(CWWidth | CWX); | 2479 | cr.value_mask = cr.value_mask & ~(CWWidth | CWX); |
2480 | if (isFullscreen() || isMaximizedVert() && screen().getMaxIgnoreIncrement()) | 2480 | if (isFullscreen() || (isMaximizedVert() && screen().getMaxIgnoreIncrement())) |
2481 | cr.value_mask = cr.value_mask & ~(CWHeight | CWY); | 2481 | cr.value_mask = cr.value_mask & ~(CWHeight | CWY); |
2482 | 2482 | ||
2483 | #ifdef REMEMBER | 2483 | #ifdef REMEMBER |
@@ -2545,7 +2545,7 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) { | |||
2545 | case Above: | 2545 | case Above: |
2546 | case TopIf: | 2546 | case TopIf: |
2547 | default: | 2547 | default: |
2548 | if (isFocused() && focusRequestFromClient(*client) || | 2548 | if ((isFocused() && focusRequestFromClient(*client)) || |
2549 | !FocusControl::focusedWindow()) { | 2549 | !FocusControl::focusedWindow()) { |
2550 | setCurrentClient(*client, true); | 2550 | setCurrentClient(*client, true); |
2551 | raise(); | 2551 | raise(); |
@@ -2618,8 +2618,8 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent &be) { | |||
2618 | 2618 | ||
2619 | // check keys file first | 2619 | // check keys file first |
2620 | Keys *k = Fluxbox::instance()->keys(); | 2620 | Keys *k = Fluxbox::instance()->keys(); |
2621 | if (onTitlebar && k->doAction(be.type, be.state, be.button, | 2621 | if ((onTitlebar && k->doAction(be.type, be.state, be.button, |
2622 | Keys::ON_TITLEBAR, m_client, be.time) || | 2622 | Keys::ON_TITLEBAR, m_client, be.time)) || |
2623 | k->doAction(be.type, be.state, be.button, Keys::ON_WINDOW, m_client, | 2623 | k->doAction(be.type, be.state, be.button, Keys::ON_WINDOW, m_client, |
2624 | be.time)) { | 2624 | be.time)) { |
2625 | return; | 2625 | return; |
@@ -2706,8 +2706,8 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { | |||
2706 | return; | 2706 | return; |
2707 | } | 2707 | } |
2708 | 2708 | ||
2709 | if (moving || (me.state & Button1Mask) && functions.move && | 2709 | if (moving || ((me.state & Button1Mask) && functions.move && |
2710 | inside_titlebar && !isResizing() && m_attaching_tab == 0) { | 2710 | inside_titlebar && !isResizing() && m_attaching_tab == 0)) { |
2711 | 2711 | ||
2712 | if (! isMoving()) { | 2712 | if (! isMoving()) { |
2713 | startMoving(me.x_root, me.y_root); | 2713 | startMoving(me.x_root, me.y_root); |
@@ -2781,11 +2781,11 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { | |||
2781 | 2781 | ||
2782 | screen().showPosition(dx, dy); | 2782 | screen().showPosition(dx, dy); |
2783 | } // end if moving | 2783 | } // end if moving |
2784 | } else if (resizing || m_attaching_tab == 0 && functions.resize && | 2784 | } else if (resizing || (m_attaching_tab == 0 && functions.resize && |
2785 | (((me.state & Button1Mask) && | 2785 | (((me.state & Button1Mask) && |
2786 | (me.window == frame().gripRight() || | 2786 | (me.window == frame().gripRight() || |
2787 | me.window == frame().gripLeft())) || | 2787 | me.window == frame().gripLeft())) || |
2788 | me.window == frame().window())) { | 2788 | me.window == frame().window()))) { |
2789 | 2789 | ||
2790 | if (! resizing) { | 2790 | if (! resizing) { |
2791 | 2791 | ||