diff options
author | fluxgen <fluxgen> | 2006-03-18 22:03:23 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2006-03-18 22:03:23 (GMT) |
commit | 1eda33b8567227bdc0d180fedff86045efd0fbdc (patch) | |
tree | 6521dbec495c6ed37f6c575d093a38bfc22ab634 | |
parent | 716bb32ec2999c1418ebd56d53b1ec43285a1b07 (diff) | |
download | fluxbox_lack-1eda33b8567227bdc0d180fedff86045efd0fbdc.zip fluxbox_lack-1eda33b8567227bdc0d180fedff86045efd0fbdc.tar.bz2 |
added addManagedResource, which adds a resource to BScreen and will be destroy by BScreen. + removed geom window nls
-rw-r--r-- | src/Screen.cc | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 2ee7c28..805d19d 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -424,6 +424,7 @@ BScreen::~BScreen() { | |||
424 | 424 | ||
425 | destroyAndClearList(m_workspaces_list); | 425 | destroyAndClearList(m_workspaces_list); |
426 | destroyAndClearList(m_netizen_list); | 426 | destroyAndClearList(m_netizen_list); |
427 | destroyAndClearList(m_managed_resources); | ||
427 | 428 | ||
428 | //why not destroyAndClearList(m_icon_list); ? | 429 | //why not destroyAndClearList(m_icon_list); ? |
429 | //problem with that: a delete FluxboxWindow* calls m_diesig.notify() | 430 | //problem with that: a delete FluxboxWindow* calls m_diesig.notify() |
@@ -1414,8 +1415,7 @@ void BScreen::initMenu() { | |||
1414 | FbTk::RefCount<FbTk::Command> exit_fb(CommandParser::instance().parseLine("exit")); | 1415 | FbTk::RefCount<FbTk::Command> exit_fb(CommandParser::instance().parseLine("exit")); |
1415 | FbTk::RefCount<FbTk::Command> execute_xterm(CommandParser::instance().parseLine("exec xterm")); | 1416 | FbTk::RefCount<FbTk::Command> execute_xterm(CommandParser::instance().parseLine("exec xterm")); |
1416 | m_rootmenu->setInternalMenu(); | 1417 | m_rootmenu->setInternalMenu(); |
1417 | m_rootmenu->insert(_FBTEXT(Menu, xterm, "xterm", "xterm - in fallback menu"), | 1418 | m_rootmenu->insert("xterm", execute_xterm); |
1418 | execute_xterm); | ||
1419 | m_rootmenu->insert(_FBTEXT(Menu, Restart, "Restart", "Restart command"), | 1419 | m_rootmenu->insert(_FBTEXT(Menu, Restart, "Restart", "Restart command"), |
1420 | restart_fb); | 1420 | restart_fb); |
1421 | m_rootmenu->insert(_FBTEXT(Menu, Exit, "Exit", "Exit command"), | 1421 | m_rootmenu->insert(_FBTEXT(Menu, Exit, "Exit", "Exit command"), |
@@ -1442,6 +1442,11 @@ void BScreen::removeConfigMenu(FbTk::Menu &menu) { | |||
1442 | 1442 | ||
1443 | } | 1443 | } |
1444 | 1444 | ||
1445 | |||
1446 | void BScreen::addManagedResource(FbTk::Resource_base *resource) { | ||
1447 | m_managed_resources.push_back(resource); | ||
1448 | } | ||
1449 | |||
1445 | void BScreen::setupConfigmenu(FbTk::Menu &menu) { | 1450 | void BScreen::setupConfigmenu(FbTk::Menu &menu) { |
1446 | _FB_USES_NLS; | 1451 | _FB_USES_NLS; |
1447 | 1452 | ||
@@ -1631,14 +1636,9 @@ void BScreen::showPosition(int x, int y) { | |||
1631 | 1636 | ||
1632 | pos_visible = true; | 1637 | pos_visible = true; |
1633 | } | 1638 | } |
1634 | char label[256]; | ||
1635 | 1639 | ||
1636 | _FB_USES_NLS; | 1640 | char label[256]; |
1637 | 1641 | sprintf(label, "X: %4d x Y: %4d", x, y); | |
1638 | sprintf(label, | ||
1639 | _FBTEXT(Screen, PositionFormat, | ||
1640 | "X: %4d x Y: %4d", | ||
1641 | "Format for screen coordinates - %4d for X, and %4d for Y"), x, y); | ||
1642 | 1642 | ||
1643 | m_pos_window.clear(); | 1643 | m_pos_window.clear(); |
1644 | 1644 | ||
@@ -1748,16 +1748,17 @@ void BScreen::leftWorkspace(const int delta) { | |||
1748 | 1748 | ||
1749 | 1749 | ||
1750 | void BScreen::renderGeomWindow() { | 1750 | void BScreen::renderGeomWindow() { |
1751 | |||
1752 | char label[256]; | ||
1751 | _FB_USES_NLS; | 1753 | _FB_USES_NLS; |
1752 | 1754 | ||
1753 | const char *s = _FBTEXT(Screen, | 1755 | sprintf(label, |
1754 | GeometryLength, | 1756 | _FBTEXT(Screen, GeometryFormat, |
1755 | "W: 0000 x H: 0000", | 1757 | "W: %4d x H: %4d", "Representative maximum sized text for width and height dialog"), |
1756 | "Representative maximum sized text for width and height dialog"); | 1758 | 0, 0); |
1757 | int l = strlen(s); | ||
1758 | 1759 | ||
1759 | int geom_h = winFrameTheme().font().height() + winFrameTheme().bevelWidth()*2; | 1760 | int geom_h = winFrameTheme().font().height() + winFrameTheme().bevelWidth()*2; |
1760 | int geom_w = winFrameTheme().font().textWidth(s, l) + winFrameTheme().bevelWidth()*2; | 1761 | int geom_w = winFrameTheme().font().textWidth(label, strlen(label)) + winFrameTheme().bevelWidth()*2; |
1761 | m_geom_window.resize(geom_w, geom_h); | 1762 | m_geom_window.resize(geom_w, geom_h); |
1762 | 1763 | ||
1763 | m_geom_window.setBorderWidth(winFrameTheme().border().width()); | 1764 | m_geom_window.setBorderWidth(winFrameTheme().border().width()); |
@@ -1793,16 +1794,9 @@ void BScreen::renderGeomWindow() { | |||
1793 | 1794 | ||
1794 | 1795 | ||
1795 | void BScreen::renderPosWindow() { | 1796 | void BScreen::renderPosWindow() { |
1796 | _FB_USES_NLS; | ||
1797 | |||
1798 | const char *s = _FBTEXT(Screen, | ||
1799 | PositionLength, | ||
1800 | "0: 0000 x 0: 0000", | ||
1801 | "Representative maximum sized text for X and Y dialog"); | ||
1802 | int l = strlen(s); | ||
1803 | 1797 | ||
1804 | int pos_h = winFrameTheme().font().height() + winFrameTheme().bevelWidth()*2; | 1798 | int pos_h = winFrameTheme().font().height() + winFrameTheme().bevelWidth()*2; |
1805 | int pos_w = winFrameTheme().font().textWidth(s, l) + winFrameTheme().bevelWidth()*2; | 1799 | int pos_w = winFrameTheme().font().textWidth("0: 0000 x 0: 0000", 17) + winFrameTheme().bevelWidth()*2; |
1806 | m_pos_window.resize(pos_w, pos_h); | 1800 | m_pos_window.resize(pos_w, pos_h); |
1807 | 1801 | ||
1808 | m_pos_window.setBorderWidth(winFrameTheme().border().width()); | 1802 | m_pos_window.setBorderWidth(winFrameTheme().border().width()); |