aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authorsimonb <simonb>2006-05-20 15:08:14 (GMT)
committersimonb <simonb>2006-05-20 15:08:14 (GMT)
commit0861f3a9073ccd016302af26ff992fa19331a02d (patch)
treef1a2276449a5fc9b27f2d1afa5ffff4410141345 /src/Screen.cc
parent5ddabb0f390f69db793b5a6e40be9f94b8f83136 (diff)
downloadfluxbox-0861f3a9073ccd016302af26ff992fa19331a02d.zip
fluxbox-0861f3a9073ccd016302af26ff992fa19331a02d.tar.bz2
improve native language handling, move messages and menu labels to
FbTk::FbString
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc41
1 files changed, 18 insertions, 23 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 715411c..a018c17 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -161,7 +161,7 @@ int anotherWMRunning(Display *display, XErrorEvent *) {
161 161
162class TabPlacementMenuItem: public FbTk::MenuItem { 162class TabPlacementMenuItem: public FbTk::MenuItem {
163public: 163public:
164 TabPlacementMenuItem(const char * label, BScreen &screen, 164 TabPlacementMenuItem(FbTk::FbString & label, BScreen &screen,
165 FbWinFrame::TabPlacement place, 165 FbWinFrame::TabPlacement place,
166 FbTk::RefCount<FbTk::Command> &cmd): 166 FbTk::RefCount<FbTk::Command> &cmd):
167 FbTk::MenuItem(label, cmd), 167 FbTk::MenuItem(label, cmd),
@@ -363,7 +363,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
363 fprintf(stderr, _FBTEXT(Screen, ManagingScreen, 363 fprintf(stderr, _FBTEXT(Screen, ManagingScreen,
364 "BScreen::BScreen: managing screen %d " 364 "BScreen::BScreen: managing screen %d "
365 "using visual 0x%lx, depth %d\n", 365 "using visual 0x%lx, depth %d\n",
366 "informational message saying screen number (%d), visual (%lx), and colour depth (%d)"), 366 "informational message saying screen number (%d), visual (%lx), and colour depth (%d)").c_str(),
367 screenNumber(), XVisualIDFromVisual(rootWindow().visual()), 367 screenNumber(), XVisualIDFromVisual(rootWindow().visual()),
368 rootWindow().depth()); 368 rootWindow().depth());
369 369
@@ -703,7 +703,7 @@ FbTk::Menu *BScreen::createMenu(const std::string &label) {
703 imageControl(), 703 imageControl(),
704 *layerManager().getLayer(Layer::MENU)); 704 *layerManager().getLayer(Layer::MENU));
705 if (!label.empty()) 705 if (!label.empty())
706 menu->setLabel(label.c_str()); 706 menu->setLabel(label);
707 707
708 return menu; 708 return menu;
709} 709}
@@ -712,12 +712,12 @@ FbTk::Menu *BScreen::createToggleMenu(const std::string &label) {
712 imageControl(), 712 imageControl(),
713 *layerManager().getLayer(Layer::MENU)); 713 *layerManager().getLayer(Layer::MENU));
714 if (!label.empty()) 714 if (!label.empty())
715 menu->setLabel(label.c_str()); 715 menu->setLabel(label);
716 716
717 return menu; 717 return menu;
718} 718}
719 719
720void BScreen::addExtraWindowMenu(const char *label, FbTk::Menu *menu) { 720void BScreen::addExtraWindowMenu(const FbTk::FbString &label, FbTk::Menu *menu) {
721 menu->setInternalMenu(); 721 menu->setInternalMenu();
722 menu->disableTitle(); 722 menu->disableTitle();
723 m_extramenus.push_back(std::make_pair(label, menu)); 723 m_extramenus.push_back(std::make_pair(label, menu));
@@ -1541,7 +1541,7 @@ void BScreen::initMenu() {
1541} 1541}
1542 1542
1543 1543
1544void BScreen::addConfigMenu(const char *label, FbTk::Menu &menu) { 1544void BScreen::addConfigMenu(const FbTk::FbString &label, FbTk::Menu &menu) {
1545 m_configmenu_list.push_back(std::make_pair(label, &menu)); 1545 m_configmenu_list.push_back(std::make_pair(label, &menu));
1546 setupConfigmenu(*m_configmenu.get()); 1546 setupConfigmenu(*m_configmenu.get());
1547} 1547}
@@ -1587,10 +1587,10 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1587 // create focus menu 1587 // create focus menu
1588 // we don't set this to internal menu so will 1588 // we don't set this to internal menu so will
1589 // be deleted toghether with the parent 1589 // be deleted toghether with the parent
1590 const char *focusmenu_label = _FBTEXT(Configmenu, FocusModel, 1590 FbTk::FbString focusmenu_label = _FBTEXT(Configmenu, FocusModel,
1591 "Focus Model", 1591 "Focus Model",
1592 "Method used to give focus to windows"); 1592 "Method used to give focus to windows");
1593 FbTk::Menu *focus_menu = createMenu(focusmenu_label ? focusmenu_label : ""); 1593 FbTk::Menu *focus_menu = createMenu(focusmenu_label);
1594 1594
1595#define _BOOLITEM(m,a, b, c, d, e, f) (m).insert(new BoolMenuItem(_FBTEXT(a, b, c, d), e, f)) 1595#define _BOOLITEM(m,a, b, c, d, e, f) (m).insert(new BoolMenuItem(_FBTEXT(a, b, c, d), e, f))
1596 1596
@@ -1630,11 +1630,11 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1630 1630
1631 // BEGIN tab menu 1631 // BEGIN tab menu
1632 1632
1633 const char *tabmenu_label = _FBTEXT(Configmenu, TabMenu, 1633 FbTk::FbString tabmenu_label = _FBTEXT(Configmenu, TabMenu,
1634 "Tab Options", 1634 "Tab Options",
1635 "heading for tab-related options"); 1635 "heading for tab-related options");
1636 FbTk::Menu *tab_menu = createMenu(tabmenu_label ? tabmenu_label : ""); 1636 FbTk::Menu *tab_menu = createMenu(tabmenu_label);
1637 const char *tabplacement_label = _FBTEXT(Menu, Placement, "Placement", "Title of Placement menu"); 1637 FbTk::FbString tabplacement_label = _FBTEXT(Menu, Placement, "Placement", "Title of Placement menu");
1638 FbTk::Menu *tabplacement_menu = createToggleMenu(tabplacement_label); 1638 FbTk::Menu *tabplacement_menu = createToggleMenu(tabplacement_label);
1639 1639
1640 tab_menu->insert(tabplacement_label, tabplacement_menu); 1640 tab_menu->insert(tabplacement_label, tabplacement_menu);
@@ -1653,7 +1653,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1653 tab_menu->insert(tab_width_item); 1653 tab_menu->insert(tab_width_item);
1654 1654
1655 1655
1656 typedef pair<const char*, FbWinFrame::TabPlacement> PlacementP; 1656 typedef pair<FbTk::FbString, FbWinFrame::TabPlacement> PlacementP;
1657 typedef list<PlacementP> Placements; 1657 typedef list<PlacementP> Placements;
1658 Placements place_menu; 1658 Placements place_menu;
1659 1659
@@ -1672,15 +1672,10 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1672 size_t i=0; 1672 size_t i=0;
1673 while (!place_menu.empty()) { 1673 while (!place_menu.empty()) {
1674 i++; 1674 i++;
1675 const char *str = place_menu.front().first; 1675 FbTk::FbString &str = place_menu.front().first;
1676 FbWinFrame::TabPlacement placement = place_menu.front().second; 1676 FbWinFrame::TabPlacement placement = place_menu.front().second;
1677 1677
1678 if (str == 0) { 1678 tabplacement_menu->insert(new TabPlacementMenuItem(str, *this, placement, save_and_reconftabs));
1679 tabplacement_menu->insert("");
1680 tabplacement_menu->setItemEnabled(i, false);
1681 } else {
1682 tabplacement_menu->insert(new TabPlacementMenuItem(str, *this, placement, save_and_reconftabs));
1683 }
1684 place_menu.pop_front(); 1679 place_menu.pop_front();
1685 } 1680 }
1686 tabplacement_menu->updateMenu(); 1681 tabplacement_menu->updateMenu();
@@ -1738,10 +1733,10 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1738 if (FbTk::Transparent::haveRender() || 1733 if (FbTk::Transparent::haveRender() ||
1739 FbTk::Transparent::haveComposite()) { 1734 FbTk::Transparent::haveComposite()) {
1740 1735
1741 const char *alphamenu_label = _FBTEXT(Configmenu, Transparency, 1736 FbTk::FbString alphamenu_label = _FBTEXT(Configmenu, Transparency,
1742 "Transparency", 1737 "Transparency",
1743 "Menu containing various transparency options"); 1738 "Menu containing various transparency options");
1744 FbTk::Menu *alpha_menu = createMenu(alphamenu_label ? alphamenu_label : ""); 1739 FbTk::Menu *alpha_menu = createMenu(alphamenu_label);
1745 1740
1746 if (FbTk::Transparent::haveComposite(true)) { 1741 if (FbTk::Transparent::haveComposite(true)) {
1747 alpha_menu->insert(new BoolMenuItem(_FBTEXT(Configmenu, ForcePseudoTrans, 1742 alpha_menu->insert(new BoolMenuItem(_FBTEXT(Configmenu, ForcePseudoTrans,
@@ -1869,7 +1864,7 @@ void BScreen::showGeometry(unsigned int gx, unsigned int gy) {
1869 sprintf(label, 1864 sprintf(label,
1870 _FBTEXT(Screen, GeometryFormat, 1865 _FBTEXT(Screen, GeometryFormat,
1871 "W: %4d x H: %4d", 1866 "W: %4d x H: %4d",
1872 "Format for width and height window, %4d for width, and %4d for height"), 1867 "Format for width and height window, %4d for width, and %4d for height").c_str(),
1873 gx, gy); 1868 gx, gy);
1874 1869
1875 m_geom_window.clear(); 1870 m_geom_window.clear();
@@ -1935,7 +1930,7 @@ void BScreen::renderGeomWindow() {
1935 1930
1936 sprintf(label, 1931 sprintf(label,
1937 _FBTEXT(Screen, GeometryFormat, 1932 _FBTEXT(Screen, GeometryFormat,
1938 "W: %4d x H: %4d", "Representative maximum sized text for width and height dialog"), 1933 "W: %4d x H: %4d", "Representative maximum sized text for width and height dialog").c_str(),
1939 0, 0); 1934 0, 0);
1940 1935
1941 int geom_h = winFrameTheme().font().height() + winFrameTheme().bevelWidth()*2; 1936 int geom_h = winFrameTheme().font().height() + winFrameTheme().bevelWidth()*2;