diff options
author | fluxgen <fluxgen> | 2003-07-01 12:39:09 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-07-01 12:39:09 (GMT) |
commit | 6fce27ea136416be45d2b9d1eeed6d6f8585d601 (patch) | |
tree | e20dee000f753bd610a3f9f0fe8100ec3931a09e | |
parent | 1e097242f948c424585fc087900c8657695ca1fa (diff) | |
download | fluxbox_lack-6fce27ea136416be45d2b9d1eeed6d6f8585d601.zip fluxbox_lack-6fce27ea136416be45d2b9d1eeed6d6f8585d601.tar.bz2 |
added reconfig signal
-rw-r--r-- | src/Screen.cc | 55 | ||||
-rw-r--r-- | src/Screen.hh | 9 |
2 files changed, 15 insertions, 49 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index ab1b707..5a62820 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Screen.cc,v 1.198 2003/06/30 18:04:48 fluxgen Exp $ | 25 | // $Id: Screen.cc,v 1.199 2003/07/01 12:39:09 fluxgen Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "Screen.hh" | 28 | #include "Screen.hh" |
@@ -227,34 +227,6 @@ void setupWorkspacemenu(BScreen &scr, FbTk::Menu &menu) { | |||
227 | }; | 227 | }; |
228 | 228 | ||
229 | 229 | ||
230 | template <> | ||
231 | void FbTk::ThemeItem<std::string>::load() { } | ||
232 | |||
233 | template <> | ||
234 | void FbTk::ThemeItem<std::string>::setDefaultValue() { | ||
235 | *(*this) = ""; | ||
236 | } | ||
237 | |||
238 | template <> | ||
239 | void FbTk::ThemeItem<std::string>::setFromString(const char *str) { | ||
240 | *(*this) = (str ? str : ""); | ||
241 | } | ||
242 | |||
243 | template <> | ||
244 | void FbTk::ThemeItem<int>::load() { } | ||
245 | |||
246 | template <> | ||
247 | void FbTk::ThemeItem<int>::setDefaultValue() { | ||
248 | *(*this) = 0; | ||
249 | } | ||
250 | |||
251 | template <> | ||
252 | void FbTk::ThemeItem<int>::setFromString(const char *str) { | ||
253 | if (str == 0) | ||
254 | return; | ||
255 | sscanf(str, "%d", &m_value); | ||
256 | } | ||
257 | |||
258 | BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm, | 230 | BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm, |
259 | const std::string &scrname, | 231 | const std::string &scrname, |
260 | const std::string &altscrname): | 232 | const std::string &altscrname): |
@@ -287,6 +259,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
287 | m_workspacecount_sig(*this), // workspace count signal | 259 | m_workspacecount_sig(*this), // workspace count signal |
288 | m_workspacenames_sig(*this), // workspace names signal | 260 | m_workspacenames_sig(*this), // workspace names signal |
289 | m_currentworkspace_sig(*this), // current workspace signal | 261 | m_currentworkspace_sig(*this), // current workspace signal |
262 | m_reconfigure_sig(*this), // reconfigure signal | ||
290 | m_layermanager(num_layers), | 263 | m_layermanager(num_layers), |
291 | cycling_focus(false), | 264 | cycling_focus(false), |
292 | cycling_last(0), | 265 | cycling_last(0), |
@@ -386,7 +359,6 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
386 | 359 | ||
387 | renderGeomWindow(); | 360 | renderGeomWindow(); |
388 | 361 | ||
389 | |||
390 | // setup workspaces and workspace menu | 362 | // setup workspaces and workspace menu |
391 | 363 | ||
392 | workspacemenu.reset(createMenuFromScreen(*this)); | 364 | workspacemenu.reset(createMenuFromScreen(*this)); |
@@ -426,12 +398,9 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
426 | m_configmenu->setInternalMenu(); | 398 | m_configmenu->setInternalMenu(); |
427 | 399 | ||
428 | workspacemenu->setItemSelected(2, true); | 400 | workspacemenu->setItemSelected(2, true); |
429 | 401 | // create and initiate rootmenu | |
430 | 402 | rereadMenu(); | |
431 | initMenu(); // create and initiate rootmenu | 403 | |
432 | |||
433 | //update menus | ||
434 | m_rootmenu->update(); | ||
435 | m_configmenu->update(); | 404 | m_configmenu->update(); |
436 | 405 | ||
437 | #ifdef SLIT | 406 | #ifdef SLIT |
@@ -663,8 +632,7 @@ void BScreen::reconfigure() { | |||
663 | } | 632 | } |
664 | } | 633 | } |
665 | 634 | ||
666 | initMenu(); | 635 | rereadMenu(); |
667 | m_rootmenu->reconfigure(); | ||
668 | 636 | ||
669 | if (restore_menus) { | 637 | if (restore_menus) { |
670 | // restore submenus, no timestamp changed | 638 | // restore submenus, no timestamp changed |
@@ -700,13 +668,13 @@ void BScreen::reconfigure() { | |||
700 | mem_fun(&FluxboxWindow::reconfigure)); | 668 | mem_fun(&FluxboxWindow::reconfigure)); |
701 | 669 | ||
702 | imageControl().timeout(); | 670 | imageControl().timeout(); |
703 | 671 | // notify objects that the screen is reconfigured | |
672 | m_reconfigure_sig.notify(); | ||
704 | } | 673 | } |
705 | 674 | ||
706 | 675 | ||
707 | void BScreen::rereadMenu() { | 676 | void BScreen::rereadMenu() { |
708 | initMenu(); | 677 | initMenu(); |
709 | |||
710 | m_rootmenu->reconfigure(); | 678 | m_rootmenu->reconfigure(); |
711 | } | 679 | } |
712 | 680 | ||
@@ -717,7 +685,6 @@ void BScreen::removeWorkspaceNames() { | |||
717 | 685 | ||
718 | void BScreen::updateWorkspaceNamesAtom() { | 686 | void BScreen::updateWorkspaceNamesAtom() { |
719 | m_workspacenames_sig.notify(); | 687 | m_workspacenames_sig.notify(); |
720 | |||
721 | } | 688 | } |
722 | 689 | ||
723 | void BScreen::addIcon(FluxboxWindow *w) { | 690 | void BScreen::addIcon(FluxboxWindow *w) { |
@@ -731,7 +698,6 @@ void BScreen::removeIcon(FluxboxWindow *w) { | |||
731 | if (! w) | 698 | if (! w) |
732 | return; | 699 | return; |
733 | 700 | ||
734 | |||
735 | Icons::iterator erase_it = remove_if(m_icon_list.begin(), | 701 | Icons::iterator erase_it = remove_if(m_icon_list.begin(), |
736 | m_icon_list.end(), | 702 | m_icon_list.end(), |
737 | bind2nd(equal_to<FluxboxWindow *>(), w)); | 703 | bind2nd(equal_to<FluxboxWindow *>(), w)); |
@@ -915,10 +881,6 @@ void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS | |||
915 | changeWorkspaceID(id); | 881 | changeWorkspaceID(id); |
916 | win->setInputFocus(); | 882 | win->setInputFocus(); |
917 | } | 883 | } |
918 | #ifdef DEBUG | ||
919 | cerr<<__FILE__<<": Sending to id = "<<id<<endl; | ||
920 | cerr<<__FILE__<<": win->workspaceId="<<win->workspaceNumber()<<endl; | ||
921 | #endif //DEBUG | ||
922 | 884 | ||
923 | } | 885 | } |
924 | 886 | ||
@@ -990,6 +952,7 @@ void BScreen::updateNetizenWindowFocus() { | |||
990 | for (; it != it_end; ++it) { | 952 | for (; it != it_end; ++it) { |
991 | (*it)->sendWindowFocus(f); | 953 | (*it)->sendWindowFocus(f); |
992 | } | 954 | } |
955 | |||
993 | } | 956 | } |
994 | 957 | ||
995 | 958 | ||
diff --git a/src/Screen.hh b/src/Screen.hh index d4cdb3b..ab09487 100644 --- a/src/Screen.hh +++ b/src/Screen.hh | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Screen.hh,v 1.112 2003/06/25 05:46:21 fluxgen Exp $ | 25 | // $Id: Screen.hh,v 1.113 2003/07/01 12:39:09 fluxgen Exp $ |
26 | 26 | ||
27 | #ifndef SCREEN_HH | 27 | #ifndef SCREEN_HH |
28 | #define SCREEN_HH | 28 | #define SCREEN_HH |
@@ -147,6 +147,8 @@ public: | |||
147 | FbTk::Subject &workspaceNamesSig() { return m_workspacenames_sig; } | 147 | FbTk::Subject &workspaceNamesSig() { return m_workspacenames_sig; } |
148 | /// current workspace signal | 148 | /// current workspace signal |
149 | FbTk::Subject ¤tWorkspaceSig() { return m_currentworkspace_sig; } | 149 | FbTk::Subject ¤tWorkspaceSig() { return m_currentworkspace_sig; } |
150 | /// reconfigure signal | ||
151 | FbTk::Subject &reconfigureSig() { return m_reconfigure_sig; } | ||
150 | //@} | 152 | //@} |
151 | 153 | ||
152 | /// @return the resource value of number of workspace | 154 | /// @return the resource value of number of workspace |
@@ -203,7 +205,7 @@ public: | |||
203 | const std::string &altName() const { return m_altname; } | 205 | const std::string &altName() const { return m_altname; } |
204 | int addWorkspace(); | 206 | int addWorkspace(); |
205 | int removeLastWorkspace(); | 207 | int removeLastWorkspace(); |
206 | //scroll workspaces | 208 | // scroll workspaces |
207 | void nextWorkspace() { nextWorkspace(1); } | 209 | void nextWorkspace() { nextWorkspace(1); } |
208 | void prevWorkspace() { prevWorkspace(1); } | 210 | void prevWorkspace() { prevWorkspace(1); } |
209 | void nextWorkspace(int delta); | 211 | void nextWorkspace(int delta); |
@@ -340,7 +342,8 @@ private: | |||
340 | m_clientlist_sig, ///< client signal | 342 | m_clientlist_sig, ///< client signal |
341 | m_workspacecount_sig, ///< workspace count signal | 343 | m_workspacecount_sig, ///< workspace count signal |
342 | m_workspacenames_sig, ///< workspace names signal | 344 | m_workspacenames_sig, ///< workspace names signal |
343 | m_currentworkspace_sig; ///< current workspace signal | 345 | m_currentworkspace_sig, ///< current workspace signal |
346 | m_reconfigure_sig; ///< reconfigure signal | ||
344 | 347 | ||
345 | FbTk::MultLayers m_layermanager; | 348 | FbTk::MultLayers m_layermanager; |
346 | 349 | ||