From 2526e4bce821eedcd4bcc13e0f27ac7b9e255350 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Thu, 4 Apr 2002 11:28:19 +0000 Subject: moved nls defines to enums in namespace FBNLS --- src/BaseDisplay.cc | 52 +++--------- src/Basemenu.cc | 10 +-- src/Configmenu.cc | 184 +++++++++++++----------------------------- src/Icon.cc | 8 +- src/Image.cc | 108 ++++++++----------------- src/Screen.cc | 222 +++++++++++++++------------------------------------ src/Slit.cc | 142 +++++++++----------------------- src/Theme.cc | 26 ++---- src/Toolbar.cc | 118 ++++++++------------------- src/Window.cc | 51 +++--------- src/Windowmenu.cc | 90 ++++++--------------- src/Workspace.cc | 8 +- src/Workspacemenu.cc | 27 ++----- src/fluxbox.cc | 16 +--- src/i18n.cc | 4 +- src/main.cc | 23 +++--- 16 files changed, 307 insertions(+), 782 deletions(-) diff --git a/src/BaseDisplay.cc b/src/BaseDisplay.cc index d92c533..984a9db 100644 --- a/src/BaseDisplay.cc +++ b/src/BaseDisplay.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: BaseDisplay.cc,v 1.11 2002/03/23 02:02:00 pekdon Exp $ +// $Id: BaseDisplay.cc,v 1.12 2002/04/04 11:28:19 fluxgen Exp $ // use GNU extensions #ifndef _GNU_SOURCE @@ -107,11 +107,7 @@ static int handleXErrors(Display *d, XErrorEvent *e) { fprintf(stderr, I18n::instance()-> getMessage( - #ifdef NLS - BaseDisplaySet, BaseDisplayXError, - #else // !NLS - 0, 0, - #endif // NLS + FBNLS::BaseDisplaySet, FBNLS::BaseDisplayXError, "%s: X error: %s(%d) opcodes %d/%d\n resource 0x%lx\n"), base_display->getApplicationName(), errtxt, e->error_code, e->request_code, e->minor_code, e->resourceid); @@ -165,11 +161,7 @@ static void signalhandler(int sig) { fprintf(stderr, i18n->getMessage( - #ifdef NLS - BaseDisplaySet, BaseDisplaySignalCaught, - #else // !NLS - 0, 0, - #endif // NLS + FBNLS::BaseDisplaySet, FBNLS::BaseDisplaySignalCaught, "%s: signal %d caught\n"), base_display->getApplicationName(), sig); @@ -179,23 +171,15 @@ static void signalhandler(int sig) { re_enter = 1; fprintf(stderr, i18n->getMessage( - #ifdef NLS - BaseDisplaySet, BaseDisplayShuttingDown, - #else // !NLS - 0, 0, - #endif // NLS - "shutting down\n")); + FBNLS::BaseDisplaySet, FBNLS::BaseDisplayShuttingDown, + "shutting down\n")); base_display->shutdown(); } if (sig != SIGTERM && sig != SIGINT) { fprintf(stderr, i18n->getMessage( - #ifdef NLS - BaseDisplaySet, BaseDisplayAborting, - #else // !NLS - 0, 0, - #endif // NLS + FBNLS::BaseDisplaySet, FBNLS::BaseDisplayAborting, "aborting... dumping core\n")); abort(); } @@ -260,25 +244,17 @@ m_server_grabs(0) fprintf(stderr, i18n-> getMessage( - #ifdef NLS - BaseDisplaySet, BaseDisplayXConnectFail, - #else // !NLS - 0, 0, - #endif // NLS - "BaseDisplay::BaseDisplay: connection to X server failed.\n")); + FBNLS::BaseDisplaySet, FBNLS::BaseDisplayXConnectFail, + "BaseDisplay::BaseDisplay: connection to X server failed.\n")); throw static_cast(2); //throw error 2 } else if (fcntl(ConnectionNumber(m_display), F_SETFD, 1) == -1) { fprintf(stderr, i18n-> getMessage( - #ifdef NLS - BaseDisplaySet, BaseDisplayCloseOnExecFail, - #else // !NLS - 0, 0, - #endif // NLS - "BaseDisplay::BaseDisplay: couldn't mark display connection " - "as close-on-exec\n")); + FBNLS::BaseDisplaySet, FBNLS::BaseDisplayCloseOnExecFail, + "BaseDisplay::BaseDisplay: couldn't mark display connection " + "as close-on-exec\n")); throw static_cast(2); //throw error 2 } //initiate atoms @@ -332,11 +308,7 @@ void BaseDisplay::eventLoop(void) { fprintf(stderr, I18n::instance()-> getMessage( - #ifdef NLS - BaseDisplaySet, BaseDisplayBadWindowRemove, - #else // !NLS - 0, 0, - #endif // NLS + FBNLS::BaseDisplaySet, FBNLS::BaseDisplayBadWindowRemove, "BaseDisplay::eventLoop(): removing bad window " "from event queue\n")); #endif // DEBUG diff --git a/src/Basemenu.cc b/src/Basemenu.cc index cdb7ea2..79e53e5 100644 --- a/src/Basemenu.cc +++ b/src/Basemenu.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Basemenu.cc,v 1.17 2002/04/03 23:08:19 fluxgen Exp $ +// $Id: Basemenu.cc,v 1.18 2002/04/04 11:28:19 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -281,7 +281,7 @@ void Basemenu::update(void) { if (title_vis) { const char *s = (menu.label) ? menu.label : i18n->getMessage( - BasemenuSet, BasemenuBlackboxMenu, + FBNLS::BasemenuSet, FBNLS::BasemenuBlackboxMenu, "fluxbox Menu"); int l = strlen(s); @@ -484,11 +484,7 @@ void Basemenu::redrawTitle(void) { I18n *i18n = I18n::instance(); char *text = (char *) ((menu.label) ? menu.label : i18n->getMessage( -#ifdef NLS - BasemenuSet, BasemenuBlackboxMenu, -#else // !NLS - 0, 0, -#endif // NLS + FBNLS::BasemenuSet, FBNLS::BasemenuBlackboxMenu, "fluxbox Menu")); int dx = menu.bevel_w, len = strlen(text); unsigned int l; diff --git a/src/Configmenu.cc b/src/Configmenu.cc index 0f8257f..4f24df4 100644 --- a/src/Configmenu.cc +++ b/src/Configmenu.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Configmenu.cc,v 1.11 2002/04/03 12:08:53 fluxgen Exp $ +// $Id: Configmenu.cc,v 1.12 2002/04/04 11:28:19 fluxgen Exp $ // stupid macros needed to access some functions in version 2 of the GNU C // library @@ -48,105 +48,51 @@ Configmenu::Configmenu(BScreen *scr) : Basemenu(scr) { I18n *i18n = I18n::instance(); setLabel(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuConfigOptions, -#else // !NLS - 0, 0, -#endif // NLS - "Config options")); + FBNLS::ConfigmenuSet, FBNLS::ConfigmenuConfigOptions, + "Config options")); setInternalMenu(); focusmenu = new Focusmenu(this); placementmenu = new Placementmenu(this); tabmenu = new Tabmenu(this); - + using namespace FBNLS; insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuFocusModel, -#else // !NLS - 0, 0, -#endif // NLS - "Focus Model"), focusmenu); - insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuWindowPlacement, -#else //! NLS - 0, 0, -#endif // NLS - "Window Placement"), placementmenu); - insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuTabPlacement, -#else // !NLS - 0, 0, -#endif // NLS - "Tab Placement"), tabmenu); - insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuImageDithering, -#else // !NLS - 0, 0, -#endif // NLS - "Image Dithering"), 1); - insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuOpaqueMove, -#else // !NLS - 0, 0, -#endif // NLS - "Opaque Window Moving"), 2); - insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuFullMax, -#else // !NLS - 0, 0, -#endif // NLS - "Full Maximization"), 3); - insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuFocusNew, -#else // !NLS - 0, 0, -#endif // NLS - "Focus New Windows"), 4); - insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuFocusLast, -#else // !NLS - 0, 0, -#endif // NLS - "Focus Last Window on Workspace"), 5); - insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuMaxOverSlit, -#else // !NLS - 0, 0, -#endif // NLS - "Maxmize Over Slit"), 6); - - + ConfigmenuSet, ConfigmenuFocusModel, + "Focus Model"), focusmenu); + insert(i18n->getMessage( + ConfigmenuSet, ConfigmenuWindowPlacement, + "Window Placement"), placementmenu); + insert(i18n->getMessage( + ConfigmenuSet, ConfigmenuTabPlacement, + "Tab Placement"), tabmenu); + insert(i18n->getMessage( + ConfigmenuSet, ConfigmenuImageDithering, + "Image Dithering"), 1); + insert(i18n->getMessage( + ConfigmenuSet, ConfigmenuOpaqueMove, + "Opaque Window Moving"), 2); + insert(i18n->getMessage( + ConfigmenuSet, ConfigmenuFullMax, + "Full Maximization"), 3); + insert(i18n->getMessage( + ConfigmenuSet, ConfigmenuFocusNew, + "Focus New Windows"), 4); + insert(i18n->getMessage( + ConfigmenuSet, ConfigmenuFocusLast, + "Focus Last Window on Workspace"), 5); + insert(i18n->getMessage( + ConfigmenuSet, ConfigmenuMaxOverSlit, + "Maxmize Over Slit"), 6); insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuTabs, -#else // !NLS - 0, 0, -#endif // NLS - "Use Tabs"), CMENU_USE_TABS); - insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuIcons, -#else // !NLS - 0, 0, -#endif // NLS - "Use Icons"), CMENU_USE_ICONS); - insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuSloppyWindowGrouping, -#else // !NLS - 0, 0, -#endif // NLS - "Sloppy Window Grouping"), CMENU_SLOPPY_WIN_GROUP); + ConfigmenuSet, ConfigmenuTabs, + "Use Tabs"), CMENU_USE_TABS); + insert(i18n->getMessage( + ConfigmenuSet, ConfigmenuIcons, + "Use Icons"), CMENU_USE_ICONS); + insert(i18n->getMessage( + ConfigmenuSet, ConfigmenuSloppyWindowGrouping, + "Sloppy Window Grouping"), CMENU_SLOPPY_WIN_GROUP); update(); setItemSelected(8, screen->doMaxOverSlit()); @@ -253,52 +199,33 @@ void Configmenu::reconfigure(void) { Configmenu::Focusmenu::Focusmenu(Configmenu *cm) : Basemenu(cm->screen) { configmenu = cm; I18n *i18n = I18n::instance(); + using namespace FBNLS; setLabel(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuFocusModel, -#else // !NLS - 0, 0, -#endif // NLS - "Focus Model")); + ConfigmenuSet, ConfigmenuFocusModel, + "Focus Model")); setInternalMenu(); insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuClickToFocus, -#else // !NLS - 0, 0, -#endif // NLS - "Click To Focus"), 1); - insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuSloppyFocus, -#else // !NLS - 0, 0, -#endif // NLS - "Sloppy Focus"), 2); - insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuSemiSloppyFocus, -#else // !NLS - 0, 0, -#endif // NLS - "Semi Sloppy Focus"), 3); - insert(i18n->getMessage( -#ifdef NLS - ConfigmenuSet, ConfigmenuAutoRaise, -#else // !NLS - 0, 0, -#endif // NLS - "Auto Raise"), 4); + ConfigmenuSet, ConfigmenuClickToFocus, + "Click To Focus"), 1); + insert(i18n->getMessage( + ConfigmenuSet, ConfigmenuSloppyFocus, + "Sloppy Focus"), 2); + insert(i18n->getMessage( + ConfigmenuSet, ConfigmenuSemiSloppyFocus, + "Semi Sloppy Focus"), 3); + insert(i18n->getMessage( + ConfigmenuSet, ConfigmenuAutoRaise, + "Auto Raise"), 4); update(); setItemSelected(0, !(configmenu->screen->isSloppyFocus() || - configmenu->screen->isSemiSloppyFocus())); + configmenu->screen->isSemiSloppyFocus())); setItemSelected(1, configmenu->screen->isSloppyFocus()); setItemSelected(2, configmenu->screen->isSemiSloppyFocus()); setItemEnabled(3, (configmenu->screen->isSloppyFocus() || - configmenu->screen->isSemiSloppyFocus())); + configmenu->screen->isSemiSloppyFocus())); setItemSelected(3, configmenu->screen->doAutoRaise()); } @@ -366,7 +293,7 @@ void Configmenu::Focusmenu::itemSelected(int button, unsigned int index) { Configmenu::Placementmenu::Placementmenu(Configmenu *cm) : Basemenu(cm->screen) { configmenu = cm; I18n *i18n = I18n::instance(); - + using namespace FBNLS; setLabel(i18n->getMessage( ConfigmenuSet, ConfigmenuWindowPlacement, "Window Placement")); @@ -495,6 +422,7 @@ void Configmenu::Placementmenu::itemSelected(int button, unsigned int index) { Configmenu::Tabmenu::Tabmenu(Configmenu *cm) : Basemenu(cm->screen) { configmenu = cm; I18n *i18n = I18n::instance(); + using namespace FBNLS; setLabel(i18n->getMessage( ConfigmenuSet, ConfigmenuTabPlacement, diff --git a/src/Icon.cc b/src/Icon.cc index 423cb60..7e3b53d 100644 --- a/src/Icon.cc +++ b/src/Icon.cc @@ -39,12 +39,8 @@ Iconmenu::Iconmenu(BScreen *scrn) : Basemenu(scrn) { screen = scrn; setLabel(I18n::instance()->getMessage( -#ifdef NLS - IconSet, IconIcons, -#else // !NLS - 0, 0, -#endif // NLS - "Icons")); + FBNLS::IconSet, FBNLS::IconIcons, + "Icons")); update(); } diff --git a/src/Image.cc b/src/Image.cc index 0831517..9d3f044 100644 --- a/src/Image.cc +++ b/src/Image.cc @@ -25,7 +25,7 @@ // stupid macros needed to access some functions in version 2 of the GNU C // library -// $Id: Image.cc,v 1.6 2002/03/19 00:04:36 fluxgen Exp $ +// $Id: Image.cc,v 1.7 2002/04/04 11:28:19 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -134,11 +134,7 @@ Pixmap BImage::render_solid(BTexture *texture) { if (pixmap == None) { fprintf(stderr, I18n::instance()->getMessage( -#ifdef NLS - ImageSet, ImageErrorCreatingSolidPixmap, -#else // !NLS - 0, 0, -#endif // NLS + FBNLS::ImageSet, FBNLS::ImageErrorCreatingSolidPixmap, "BImage::render_solid: error creating pixmap\n")); return None; } @@ -278,19 +274,15 @@ XImage *BImage::renderXImage(void) { I18n *i18n = I18n::instance(); XImage *image = XCreateImage(control->getBaseDisplay()->getXDisplay(), - control->getVisual(), control->getDepth(), ZPixmap, 0, 0, - width, height, 32, 0); + control->getVisual(), control->getDepth(), ZPixmap, 0, 0, + width, height, 32, 0); if (! image) { fprintf(stderr, i18n-> getMessage( -#ifdef NLS - ImageSet, ImageErrorCreatingXImage, -#else // !NLS - 0, 0, -#endif // NLS - "BImage::renderXImage: error creating XImage\n")); + FBNLS::ImageSet, FBNLS::ImageErrorCreatingXImage, + "BImage::renderXImage: error creating XImage\n")); return (XImage *) 0; } @@ -565,12 +557,8 @@ XImage *BImage::renderXImage(void) { fprintf(stderr, i18n-> getMessage( -#ifdef NLS - ImageSet, ImageUnsupVisual, -#else // !NLS - 0, 0, -#endif // NLS - "BImage::renderXImage: unsupported visual\n")); + FBNLS::ImageSet, FBNLS::ImageUnsupVisual, + "BImage::renderXImage: unsupported visual\n")); delete [] d; XDestroyImage(image); return (XImage *) 0; @@ -672,7 +660,7 @@ XImage *BImage::renderXImage(void) { fprintf(stderr, i18n-> getMessage( - ImageSet, ImageUnsupVisual, + FBNLS::ImageSet, FBNLS::ImageUnsupVisual, "BImage::renderXImage: unsupported visual\n")); delete [] d; XDestroyImage(image); @@ -689,17 +677,13 @@ Pixmap BImage::renderPixmap(void) { I18n *i18n = I18n::instance(); Pixmap pixmap = XCreatePixmap(control->getBaseDisplay()->getXDisplay(), - control->getDrawable(), width, height, control->getDepth()); + control->getDrawable(), width, height, control->getDepth()); if (pixmap == None) { fprintf(stderr, - i18n->getMessage( -#ifdef NLS - ImageSet, ImageErrorCreatingPixmap, -#else // !NLS - 0, 0, -#endif // NLS - "BImage::renderPixmap: error creating pixmap\n")); + i18n->getMessage( + FBNLS::ImageSet, FBNLS::ImageErrorCreatingPixmap, + "BImage::renderPixmap: error creating pixmap\n")); return None; } @@ -1939,15 +1923,11 @@ BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither, fprintf(stderr, i18n-> getMessage( -#ifdef NLS - ImageSet, ImageInvalidColormapSize, -#else // !NLS - 0, 0, -#endif // NLS - "BImageControl::BImageControl: invalid colormap size %d " - "(%d/%d/%d) - reducing"), - ncolors, colors_per_channel, colors_per_channel, - colors_per_channel); + FBNLS::ImageSet, FBNLS::ImageInvalidColormapSize, + "BImageControl::BImageControl: invalid colormap size %d " + "(%d/%d/%d) - reducing"), + ncolors, colors_per_channel, colors_per_channel, + colors_per_channel); colors_per_channel = (1 << screen_depth) / 3; } @@ -1957,13 +1937,9 @@ BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither, fprintf(stderr, i18n-> getMessage( -#ifdef NLS - ImageSet, ImageErrorAllocatingColormap, -#else // !NLS - 0, 0, -#endif // NLS - "BImageControl::BImageControl: error allocating " - "colormap\n")); + FBNLS::ImageSet, FBNLS::ImageErrorAllocatingColormap, + "BImageControl::BImageControl: error allocating " + "colormap\n")); throw static_cast(1); //throw exit code 1 } @@ -1996,11 +1972,7 @@ BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither, if (! XAllocColor(basedisplay->getXDisplay(), colormap, &colors[i])) { fprintf(stderr, i18n->getMessage( -#ifdef NLS - ImageSet, ImageColorAllocFail, -#else // !NLS - 0, 0, -#endif // NLS + FBNLS::ImageSet, FBNLS::ImageColorAllocFail, "couldn't alloc color %i %i %i\n"), colors[i].red, colors[i].green, colors[i].blue); colors[i].flags = 0; @@ -2071,11 +2043,7 @@ BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither, fprintf(stderr, i18n-> getMessage( -#ifdef NLS - ImageSet, ImageInvalidColormapSize, -#else // !NLS - 0, 0, -#endif // NLS + FBNLS::ImageSet, FBNLS::ImageInvalidColormapSize, "BImageControl::BImageControl: invalid colormap size %d " "(%d/%d/%d) - reducing"), ncolors, colors_per_channel, colors_per_channel, @@ -2089,11 +2057,7 @@ BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither, fprintf(stderr, i18n-> getMessage( -#ifdef NLS - ImageSet, ImageErrorAllocatingColormap, -#else // !NLS - 0, 0, -#endif // NLS + FBNLS::ImageSet, FBNLS::ImageErrorAllocatingColormap, "BImageControl::BImageControl: error allocating " "colormap\n")); throw static_cast(1); // throw exit code 1 @@ -2118,11 +2082,7 @@ BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither, fprintf(stderr, i18n-> getMessage( -#ifdef NLS - ImageSet, ImageColorAllocFail, -#else // !NLS - 0, 0, -#endif // NLS + FBNLS::ImageSet, FBNLS::ImageColorAllocFail, "couldn't alloc color %i %i %i\n"), colors[i].red, colors[i].green, colors[i].blue); colors[i].flags = 0; @@ -2178,12 +2138,8 @@ BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither, fprintf(stderr, i18n-> getMessage( -#ifdef NLS - ImageSet, ImageUnsupVisual, -#else // !NLS - 0, 0, -#endif // NLS - "BImageControl::BImageControl: unsupported visual %d\n"), + FBNLS::ImageSet, FBNLS::ImageUnsupVisual, + "BImageControl::BImageControl: unsupported visual %d\n"), getVisual()->c_class); throw static_cast(1); //throw error code 1 @@ -2219,10 +2175,10 @@ BImageControl::~BImageControl(void) { if (cache.size() > 0) { fprintf(stderr, I18n::instance()-> - getMessage( - ImageSet, ImagePixmapRelease, - "BImageContol::~BImageControl: pixmap cache - " - "releasing %d pixmaps\n"), cache.size()); + getMessage( + FBNLS::ImageSet, FBNLS::ImagePixmapRelease, + "BImageContol::~BImageControl: pixmap cache - " + "releasing %d pixmaps\n"), cache.size()); CacheList::iterator it = cache.begin(); CacheList::iterator it_end = cache.end(); @@ -2294,7 +2250,7 @@ Pixmap BImageControl::renderImage(unsigned int width, unsigned int height, fprintf(stderr, I18n::instance()-> getMessage( - ImageSet, ImagePixmapCacheLarge, + FBNLS::ImageSet, FBNLS::ImagePixmapCacheLarge, "BImageControl::renderImage: cache is large, " "forcing cleanout\n")); #endif // DEBUG diff --git a/src/Screen.cc b/src/Screen.cc index cce934d..652c7ac 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.41 2002/04/03 23:02:16 fluxgen Exp $ +// $Id: Screen.cc,v 1.42 2002/04/04 11:28:19 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -104,11 +104,7 @@ static int anotherWMRunning(Display *display, XErrorEvent *) { fprintf(stderr, I18n::instance()-> getMessage( -#ifdef NLS - ScreenSet, ScreenAnotherWMRunning, -#else // !NLS - 0, 0, -#endif // NLS + FBNLS::ScreenSet, FBNLS::ScreenAnotherWMRunning, "BScreen::BScreen: an error occured while querying the X server.\n" " another window manager already running on display %s.\n"), DisplayString(display)); @@ -252,15 +248,11 @@ resource(rm, screenname, altscreenname) fprintf(stderr, i18n-> getMessage( - #ifdef NLS - ScreenSet, ScreenManagingScreen, - #else // !NLS - 0, 0, - #endif // NLS - "BScreen::BScreen: managing screen %d " - "using visual 0x%lx, depth %d\n"), - getScreenNumber(), XVisualIDFromVisual(getVisual()), - getDepth()); + FBNLS::ScreenSet, FBNLS::ScreenManagingScreen, + "BScreen::BScreen: managing screen %d " + "using visual 0x%lx, depth %d\n"), + getScreenNumber(), XVisualIDFromVisual(getVisual()), + getDepth()); rootmenu = 0; @@ -311,11 +303,7 @@ resource(rm, screenname, altscreenname) #endif //!NEWWMSPEC const char *s = i18n->getMessage( - #ifdef NLS - ScreenSet, ScreenPositionLength, - #else // !NLS - 0, 0, - #endif // NLS + FBNLS::ScreenSet, FBNLS::ScreenPositionLength, "0: 0000 x 0: 0000"); int l = strlen(s); @@ -393,11 +381,7 @@ resource(rm, screenname, altscreenname) workspacemenu->insert(i18n-> getMessage( - #ifdef NLS - IconSet, IconIcons, - #else // !NLS - 0, 0, - #endif // NLS + FBNLS::IconSet, FBNLS::IconIcons, "Icons"), iconmenu); workspacemenu->update(); @@ -555,12 +539,8 @@ void BScreen::reconfigure(void) { I18n *i18n = I18n::instance(); const char *s = i18n->getMessage( -#ifdef NLS - ScreenSet, ScreenPositionLength, -#else // !NLS - 0, 0, -#endif // NLS - "0: 0000 x 0: 0000"); + FBNLS::ScreenSet, FBNLS::ScreenPositionLength, + "0: 0000 x 0: 0000"); int l = strlen(s); if (i18n->multibyte()) { @@ -1251,11 +1231,7 @@ void BScreen::initMenu(void) { } else { fprintf(stderr, i18n->getMessage( - #ifdef NLS - ScreenSet, ScreenEmptyMenuFile, - #else // !NLS - 0, 0, - #endif // NLS + FBNLS::ScreenSet, FBNLS::ScreenEmptyMenuFile, "%s: Empty menu file"), fluxbox->getMenuFilename()); } @@ -1267,36 +1243,20 @@ void BScreen::initMenu(void) { if (defaultMenu) { rootmenu->setInternalMenu(); rootmenu->insert(i18n->getMessage( - #ifdef NLS - ScreenSet, Screenxterm, - #else // !NLS - 0, 0, - #endif // NLS - "xterm"), - BScreen::EXECUTE, - i18n->getMessage( - #ifdef NLS - ScreenSet, Screenxterm, - #else // !NLS - 0, 0, - #endif // NLS - "xterm")); + FBNLS::ScreenSet, FBNLS::Screenxterm, + "xterm"), + BScreen::EXECUTE, + i18n->getMessage( + FBNLS::ScreenSet, FBNLS::Screenxterm, + "xterm")); rootmenu->insert(i18n->getMessage( - #ifdef NLS - ScreenSet, ScreenRestart, - #else // !NLS - 0, 0, - #endif // NLS - "Restart"), - BScreen::RESTART); + FBNLS::ScreenSet, FBNLS::ScreenRestart, + "Restart"), + BScreen::RESTART); rootmenu->insert(i18n->getMessage( - #ifdef NLS - ScreenSet, ScreenExit, - #else // !NLS - 0, 0, - #endif // NLS - "Exit"), - BScreen::EXIT); + FBNLS::ScreenSet, FBNLS::ScreenExit, + "Exit"), + BScreen::EXIT); } else fluxbox->saveMenuFilename(fluxbox->getMenuFilename()); } @@ -1339,13 +1299,9 @@ Bool BScreen::parseMenuFile(ifstream &file, Rootmenu *menu, int &row) { if (!(str_label.size() && str_cmd.size())) { fprintf(stderr, i18n->getMessage( - #ifdef NLS - ScreenSet, ScreenEXECError, - #else // !NLS - 0, 0, - #endif // NLS - "BScreen::parseMenuFile: [exec] error, " - "no menu label and/or command defined\n")); + FBNLS::ScreenSet, FBNLS::ScreenEXECError, + "BScreen::parseMenuFile: [exec] error, " + "no menu label and/or command defined\n")); cerr<<"Row: "<insert(str_label.c_str(), BScreen::EXECUTE, str_cmd.c_str()); @@ -1354,13 +1310,9 @@ Bool BScreen::parseMenuFile(ifstream &file, Rootmenu *menu, int &row) { if (!str_label.size()) { fprintf(stderr, i18n->getMessage( - #ifdef NLS - ScreenSet, ScreenEXITError, - #else // !NLS - 0, 0, - #endif // NLS - "BScreen::parseMenuFile: [exit] error, " - "no menu label defined\n")); + FBNLS::ScreenSet, FBNLS::ScreenEXITError, + "BScreen::parseMenuFile: [exit] error, " + "no menu label defined\n")); cerr<<"Row: "<insert(str_label.c_str(), BScreen::EXIT); @@ -1370,13 +1322,9 @@ Bool BScreen::parseMenuFile(ifstream &file, Rootmenu *menu, int &row) { fprintf(stderr, i18n-> getMessage( - #ifdef NLS - ScreenSet, ScreenSTYLEError, - #else // !NLS - 0, 0, - #endif // NLS - "BScreen::parseMenuFile: [style] error, " - "no menu label and/or filename defined\n")); + FBNLS::ScreenSet, FBNLS::ScreenSTYLEError, + "BScreen::parseMenuFile: [style] error, " + "no menu label and/or filename defined\n")); cerr<<"Row: "< getMessage( - #ifdef NLS - ScreenSet, ScreenCONFIGError, - #else // !NLS - 0, 0, - #endif // NLS - "BScreen::parseMenufile: [config] error, " - "no label defined")); + FBNLS::ScreenSet, FBNLS::ScreenCONFIGError, + "BScreen::parseMenufile: [config] error, " + "no label defined")); cerr<<"Row: "<insert(str_label.c_str(), configmenu); @@ -1409,13 +1353,9 @@ Bool BScreen::parseMenuFile(ifstream &file, Rootmenu *menu, int &row) { fprintf(stderr, i18n-> getMessage( - #ifdef NLS - ScreenSet, ScreenINCLUDEError, - #else // !NLS - 0, 0, - #endif // NLS - "BScreen::parseMenuFile: [include] error, " - "no filename defined\n")); + FBNLS::ScreenSet, FBNLS::ScreenINCLUDEError, + "BScreen::parseMenuFile: [include] error, " + "no filename defined\n")); cerr<<"Row: "< getMessage( - #ifdef NLS - ScreenSet, ScreenINCLUDEErrorReg, - #else // !NLS - 0, 0, - #endif // NLS - "BScreen::parseMenuFile: [include] error: " - "'%s' is not a regular file\n"), newfile); + FBNLS::ScreenSet, FBNLS::ScreenINCLUDEErrorReg, + "BScreen::parseMenuFile: [include] error: " + "'%s' is not a regular file\n"), newfile); cerr<<"Row: "< getMessage( - #ifdef NLS - ScreenSet, ScreenSUBMENUError, - #else // !NLS - 0, 0, - #endif // NLS - "BScreen::parseMenuFile: [submenu] error, " - "no menu label defined\n")); + FBNLS::ScreenSet, FBNLS::ScreenSUBMENUError, + "BScreen::parseMenuFile: [submenu] error, " + "no menu label defined\n")); cerr<<"Row: "< getMessage( - #ifdef NLS - ScreenSet, ScreenRESTARTError, - #else // !NLS - 0, 0, - #endif // NLS - "BScreen::parseMenuFile: [restart] error, " - "no menu label defined\n")); + FBNLS::ScreenSet, FBNLS::ScreenRESTARTError, + "BScreen::parseMenuFile: [restart] error, " + "no menu label defined\n")); cerr<<"Row: "< getMessage( - #ifdef NLS - ScreenSet, ScreenRECONFIGError, - #else // !NLS - 0, 0, - #endif // NLS - "BScreen::parseMenuFile: [reconfig] error, " - "no menu label defined\n")); + FBNLS::ScreenSet, FBNLS::ScreenRECONFIGError, + "BScreen::parseMenuFile: [reconfig] error, " + "no menu label defined\n")); cerr<<"Row: "<insert(str_label.c_str(), BScreen::RECONFIGURE); @@ -1524,13 +1448,9 @@ Bool BScreen::parseMenuFile(ifstream &file, Rootmenu *menu, int &row) { fprintf(stderr, i18n-> getMessage( - #ifdef NLS - ScreenSet, ScreenSTYLESDIRError, - #else // !NLS - 0, 0, - #endif // NLS - "BScreen::parseMenuFile: [stylesdir/stylesmenu]" - " error, no directory defined\n")); + FBNLS::ScreenSet, FBNLS::ScreenSTYLESDIRError, + "BScreen::parseMenuFile: [stylesdir/stylesmenu]" + " error, no directory defined\n")); cerr<<"Row: "<getMessage( - ScreenSet, ScreenWORKSPACESError, + FBNLS::ScreenSet, FBNLS::ScreenWORKSPACESError, "BScreen:parseMenuFile: [workspaces] error, " "no menu label defined\n")); cerr<<"Row: "< getMessage( - #ifdef NLS - ScreenSet, ScreenSTYLESDIRErrorNotDir, - #else // !NLS - 0, 0, - #endif // NLS + FBNLS::ScreenSet, FBNLS::ScreenSTYLESDIRErrorNotDir, "BScreen::parseMenuFile:" " [stylesdir/stylesmenu] error, %s is not a" " directory\n"), stylesdir.get()); @@ -1625,13 +1541,9 @@ void BScreen::createStyleMenu(Rootmenu *menu, bool newmenu, const char *label, c fprintf(stderr, i18n-> getMessage( - #ifdef NLS - ScreenSet, ScreenSTYLESDIRErrorNoExist, - #else // !NLS - 0, 0, - #endif // NLS - "BScreen::parseMenuFile: [stylesdir/stylesmenu]" - " error, %s does not exist\n"), stylesdir.get()); + FBNLS::ScreenSet, FBNLS::ScreenSTYLESDIRErrorNoExist, + "BScreen::parseMenuFile: [stylesdir/stylesmenu]" + " error, %s does not exist\n"), stylesdir.get()); } // end of 'stat' } @@ -1689,12 +1601,8 @@ void BScreen::showPosition(int x, int y) { snprintf(label, label_size, I18n::instance()->getMessage( -#ifdef NLS - ScreenSet, ScreenPositionFormat, -#else // !NLS - 0, 0, -#endif // NLS - "X: %4d x Y: %4d"), x, y); + FBNLS::ScreenSet, FBNLS::ScreenPositionFormat, + "X: %4d x Y: %4d"), x, y); XClearWindow(getBaseDisplay()->getXDisplay(), geom_window); @@ -1737,12 +1645,8 @@ void BScreen::showGeometry(unsigned int gx, unsigned int gy) { sprintf(label, I18n::instance()->getMessage( -#ifdef NLS - ScreenSet, ScreenGeometryFormat, -#else // !NLS - 0, 0, -#endif // NLS - "W: %4d x H: %4d"), gx, gy); + FBNLS::ScreenSet, FBNLS::ScreenGeometryFormat, + "W: %4d x H: %4d"), gx, gy); XClearWindow(getBaseDisplay()->getXDisplay(), geom_window); diff --git a/src/Slit.cc b/src/Slit.cc index 08370f9..388e4c2 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -663,14 +663,10 @@ void Slit::timeout(void) { Slitmenu::Slitmenu(Slit *sl) : Basemenu(sl->screen) { slit = sl; I18n *i18n = I18n::instance(); - + using namespace FBNLS; setLabel(i18n->getMessage( -#ifdef NLS - SlitSet, SlitSlitTitle, -#else // !NLS - 0, 0, -#endif // NLS - "Slit")); + SlitSet, SlitSlitTitle, + "Slit")); setInternalMenu(); directionmenu = new Directionmenu(this); @@ -682,20 +678,12 @@ Slitmenu::Slitmenu(Slit *sl) : Basemenu(sl->screen) { #endif // XINERAMA insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonDirectionTitle, -#else // !NLS - 0, 0, -#endif // NLS - "Direction"), + CommonSet, CommonDirectionTitle, + "Direction"), directionmenu); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementTitle, -#else // !NLS - 0, 0, -#endif // NLS - "Placement"), + CommonSet, CommonPlacementTitle, + "Placement"), placementmenu); #ifdef XINERAMA @@ -706,19 +694,11 @@ Slitmenu::Slitmenu(Slit *sl) : Basemenu(sl->screen) { #endif // XINERAMA insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonAlwaysOnTop, -#else // !NLS - 0, 0, -#endif // NLS - "Always on top"), 1); + CommonSet, CommonAlwaysOnTop, + "Always on top"), 1); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonAutoHide, -#else // !NLS - 0, 0, -#endif // NLS - "Auto hide"), 2); + CommonSet, CommonAutoHide, + "Auto hide"), 2); update(); @@ -792,31 +772,19 @@ void Slitmenu::reconfigure(void) { Slitmenu::Directionmenu::Directionmenu(Slitmenu *sm) : Basemenu(sm->slit->screen) { slitmenu = sm; I18n *i18n = I18n::instance(); - + using namespace FBNLS; setLabel(i18n->getMessage( -#ifdef NLS - SlitSet, SlitSlitDirection, -#else // !NLS - 0, 0, -#endif // NLS - "Slit Direction")); + SlitSet, SlitSlitDirection, + "Slit Direction")); setInternalMenu(); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonDirectionHoriz, -#else // !NLS - 0, 0, -#endif // NLS - "Horizontal"), + CommonSet, CommonDirectionHoriz, + "Horizontal"), Slit::HORIZONTAL); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonDirectionVert, -#else // !NLS - 0, 0, -#endif // NLS - "Vertical"), + CommonSet, CommonDirectionVert, + "Vertical"), Slit::VERTICAL); update(); @@ -852,81 +820,45 @@ void Slitmenu::Directionmenu::itemSelected(int button, unsigned int index) { Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen) { slitmenu = sm; I18n *i18n = I18n::instance(); - + using namespace FBNLS; setLabel(i18n->getMessage( -#ifdef NLS - SlitSet, SlitSlitPlacement, -#else // !NLS - 0, 0, -#endif // NLS - "Slit Placement")); + SlitSet, SlitSlitPlacement, + "Slit Placement")); setMinimumSublevels(3); setInternalMenu(); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementTopLeft, -#else // !NLS - 0, 0, -#endif // NLS - "Top Left"), + CommonSet, CommonPlacementTopLeft, + "Top Left"), Slit::TOPLEFT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementCenterLeft, -#else // !NLS - 0, 0, -#endif // NLS - "Center Left"), + CommonSet, CommonPlacementCenterLeft, + "Center Left"), Slit::CENTERLEFT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementBottomLeft, -#else // !NLS - 0, 0, -#endif // NLS - "Bottom Left"), + CommonSet, CommonPlacementBottomLeft, + "Bottom Left"), Slit::BOTTOMLEFT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementTopCenter, -#else // !NLS - 0, 0, -#endif // NLS - "Top Center"), + CommonSet, CommonPlacementTopCenter, + "Top Center"), Slit::TOPCENTER); insert(""); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementBottomCenter, -#else // !NLS - 0, 0, -#endif // NLS - "Bottom Center"), + CommonSet, CommonPlacementBottomCenter, + "Bottom Center"), Slit::BOTTOMCENTER); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementTopRight, -#else // !NLS - 0, 0, -#endif // NLS - "Top Right"), + CommonSet, CommonPlacementTopRight, + "Top Right"), Slit::TOPRIGHT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementCenterRight, -#else // !NLS - 0, 0, -#endif // NLS - "Center Right"), + CommonSet, CommonPlacementCenterRight, + "Center Right"), Slit::CENTERRIGHT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementBottomRight, -#else // !NLS - 0, 0, -#endif // NLS - "Bottom Right"), + CommonSet, CommonPlacementBottomRight, + "Bottom Right"), Slit::BOTTOMRIGHT); update(); diff --git a/src/Theme.cc b/src/Theme.cc index d712f86..9c379e5 100644 --- a/src/Theme.cc +++ b/src/Theme.cc @@ -41,7 +41,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Theme.cc,v 1.18 2002/03/21 10:54:29 fluxgen Exp $ +// $Id: Theme.cc,v 1.19 2002/04/04 11:28:19 fluxgen Exp $ #ifndef _GNU_SOURCE #define _GNU_SOURCE @@ -889,11 +889,7 @@ void Theme::readDatabaseFontSet(char *rname, char *rclass, XFontSet *fontset) { fprintf(stderr, I18n::instance()-> getMessage( - #ifdef NLS - ScreenSet, ScreenDefaultFontLoadFail, - #else // !NLS - 0, 0, - #endif // NLS + FBNLS::ScreenSet, FBNLS::ScreenDefaultFontLoadFail, "BScreen::LoadStyle(): couldn't load default font.\n")); throw 2; } @@ -922,12 +918,8 @@ void Theme::readDatabaseFont(char *rname, char *rclass, XFontStruct **font) { fprintf(stderr, I18n::instance()-> getMessage( - #ifdef NLS - ScreenSet, ScreenFontLoadFail, - #else // !NLS - 0, 0, - #endif // NLS - "BScreen::LoadStyle(): couldn't load font '%s'\n"), + FBNLS::ScreenSet, FBNLS::ScreenFontLoadFail, + "BScreen::LoadStyle(): couldn't load font '%s'\n"), value.addr); load_default = true; @@ -941,13 +933,9 @@ void Theme::readDatabaseFont(char *rname, char *rclass, XFontStruct **font) { fprintf(stderr, I18n::instance()-> getMessage( -#ifdef NLS - ScreenSet, ScreenDefaultFontLoadFail, -#else // !NLS - 0, 0, -#endif // NLS - "BScreen::LoadStyle(): couldn't load default font.\n")); - throw (int)(2); + FBNLS::ScreenSet, FBNLS::ScreenDefaultFontLoadFail, + "BScreen::LoadStyle(): couldn't load default font.\n")); + throw 2; //fatal! } } } diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 295a44c..546d970 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.cc,v 1.18 2002/04/03 23:02:49 fluxgen Exp $ +// $Id: Toolbar.cc,v 1.19 2002/04/04 11:28:19 fluxgen Exp $ // stupid macros needed to access some functions in version 2 of the GNU C // library @@ -1248,14 +1248,10 @@ void Toolbar::HideHandler::timeout(void) { Toolbarmenu::Toolbarmenu(Toolbar *tb) : Basemenu(tb->screen) { toolbar = tb; I18n *i18n = I18n::instance(); - + using namespace FBNLS; setLabel(i18n->getMessage( -#ifdef NLS - ToolbarSet, ToolbarToolbarTitle, -#else // !NLS - 0, 0, -#endif // NLS - "Toolbar")); + ToolbarSet, ToolbarToolbarTitle, + "Toolbar")); setInternalMenu(); placementmenu = new Placementmenu(this); @@ -1266,13 +1262,9 @@ Toolbarmenu::Toolbarmenu(Toolbar *tb) : Basemenu(tb->screen) { #endif // XINERAMA insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementTitle, -#else // !NLS - 0, 0, -#endif // NLS - "Placement"), - placementmenu); + CommonSet, CommonPlacementTitle, + "Placement"), + placementmenu); #ifdef XINERAMA if (toolbar->screen->hasXinerama()) { //TODO: NLS @@ -1281,29 +1273,17 @@ Toolbarmenu::Toolbarmenu(Toolbar *tb) : Basemenu(tb->screen) { #endif // XINERAMA insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonAlwaysOnTop, -#else // !NLS - 0, 0, -#endif // NLS - "Always on top"), - 1); + CommonSet, CommonAlwaysOnTop, + "Always on top"), + 1); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonAutoHide, -#else // !NLS - 0, 0, -#endif // NLS - "Auto hide"), + CommonSet, CommonAutoHide, + "Auto hide"), 2); insert(i18n->getMessage( -#ifdef NLS - ToolbarSet, ToolbarEditWkspcName, -#else // !NLS - 0, 0, -#endif // NLS - "Edit current workspace name"), - 3); + ToolbarSet, ToolbarEditWkspcName, + "Edit current workspace name"), + 3); update(); @@ -1386,64 +1366,36 @@ Toolbarmenu::Placementmenu::Placementmenu(Toolbarmenu *tm) : Basemenu(tm->toolbar->screen) { toolbarmenu = tm; I18n *i18n = I18n::instance(); - + using namespace FBNLS; setLabel(i18n->getMessage( -#ifdef NLS - ToolbarSet, ToolbarToolbarPlacement, -#else // !NLS - 0, 0, -#endif // NLS - "Toolbar Placement")); + ToolbarSet, ToolbarToolbarPlacement, + "Toolbar Placement")); setInternalMenu(); setMinimumSublevels(3); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementTopLeft, -#else // !NLS - 0, 0, -#endif // NLS - "Top Left"), - Toolbar::TOPLEFT); + CommonSet, CommonPlacementTopLeft, + "Top Left"), + Toolbar::TOPLEFT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementBottomLeft, -#else // !NLS - 0, 0, -#endif // NLS - "Bottom Left"), - Toolbar::BOTTOMLEFT); + CommonSet, CommonPlacementBottomLeft, + "Bottom Left"), + Toolbar::BOTTOMLEFT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementTopCenter, -#else // !NLS - 0, 0, -#endif // NLS - "Top Center"), - Toolbar::TOPCENTER); + CommonSet, CommonPlacementTopCenter, + "Top Center"), + Toolbar::TOPCENTER); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementBottomCenter, -#else // !NLS - 0, 0, -#endif // NLS - "Bottom Center"), - Toolbar::BOTTOMCENTER); + CommonSet, CommonPlacementBottomCenter, + "Bottom Center"), + Toolbar::BOTTOMCENTER); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementTopRight, -#else // !NLS - 0, 0, -#endif // NLS - "Top Right"), - Toolbar::TOPRIGHT); + CommonSet, CommonPlacementTopRight, + "Top Right"), + Toolbar::TOPRIGHT); insert(i18n->getMessage( -#ifdef NLS - CommonSet, CommonPlacementBottomRight, -#else // !NLS - 0, 0, -#endif // NLS - "Bottom Right"), + CommonSet, CommonPlacementBottomRight, + "Bottom Right"), Toolbar::BOTTOMRIGHT); update(); diff --git a/src/Window.cc b/src/Window.cc index 06c295a..ba18a05 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.36 2002/04/03 23:01:04 fluxgen Exp $ +// $Id: Window.cc,v 1.37 2002/04/04 11:28:19 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -81,18 +81,13 @@ tab(0) { lastFocusTime.tv_sec = lastFocusTime.tv_usec = 0; - #ifdef DEBUG fprintf(stderr, I18n::instance()-> getMessage( - #ifdef NLS - WindowSet, WindowCreating, - #else // !NLS - 0, 0, - #endif // NLS + FBNLS::WindowSet, FBNLS::WindowCreating, "FluxboxWindow::FluxboxWindow(): creating 0x%lx\n"), - w); - #endif // DEBUG + w); + Fluxbox *fluxbox = Fluxbox::instance(); display = fluxbox->getXDisplay(); @@ -528,11 +523,7 @@ void FluxboxWindow::showError(FluxboxWindow::Error error) { fprintf(stderr, I18n::instance()-> getMessage( - #ifdef NLS - WindowSet, WindowXGetWindowAttributesFail, - #else // !NLS - 0, 0, - #endif // NLS + FBNLS::WindowSet, FBNLS::WindowXGetWindowAttributesFail, "FluxboxWindow::FluxboxWindow(): XGetWindowAttributes " "failed\n") ); @@ -541,11 +532,7 @@ void FluxboxWindow::showError(FluxboxWindow::Error error) { fprintf(stderr, I18n::instance()-> getMessage( - #ifdef NLS - WindowSet, WindowCannotFindScreen, - #else // !NLS - 0, 0, - #endif // NLS + FBNLS::WindowSet, FBNLS::WindowCannotFindScreen, "FluxboxWindow::FluxboxWindow(): can't find screen\n" " for root window")); break; @@ -1463,11 +1450,11 @@ void FluxboxWindow::getWMName(void) { XFree((char *) text_prop.value); } else client.title = i18n->getMessage( - WindowSet, WindowUnnamed, + FBNLS::WindowSet, FBNLS::WindowUnnamed, "Unnamed"); } else { client.title = i18n->getMessage( - WindowSet, WindowUnnamed, + FBNLS::WindowSet, FBNLS::WindowUnnamed, "Unnamed"); } @@ -2816,11 +2803,7 @@ void FluxboxWindow::mapRequestEvent(XMapRequestEvent *re) { #ifdef DEBUG fprintf(stderr, I18n::instance()->getMessage( -#ifdef NLS - WindowSet, WindowMapRequest, -#else // !NLS - 0, 0, -#endif // NLS + FBNLS::WindowSet, FBNLS::WindowMapRequest, "FluxboxWindow::mapRequestEvent() for 0x%lx\n"), client.window); #endif // DEBUG @@ -2907,11 +2890,7 @@ bool FluxboxWindow::unmapNotifyEvent(XUnmapEvent *ue) { #ifdef DEBUG fprintf(stderr, I18n::instance()->getMessage( - #ifdef NLS - WindowSet, WindowUnmapNotify, - #else // !NLS - 0, 0, - #endif // NLS + FBNLS::WindowSet, FBNLS::WindowUnmapNotify, "FluxboxWindow::unmapNotifyEvent() for 0x%lx\n"), client.window); #endif // DEBUG @@ -2937,13 +2916,9 @@ bool FluxboxWindow::unmapNotifyEvent(XUnmapEvent *ue) { #ifdef DEBUG fprintf(stderr, I18n::instance()->getMessage( - #ifdef NLS - WindowSet, WindowUnmapNotifyReparent, - #else // !NLS - 0, 0, - #endif // NLS - "FluxboxWindow::unmapNotifyEvent(): reparent 0x%lx to " - "root.\n"), client.window); + FBNLS::WindowSet, FBNLS::WindowUnmapNotifyReparent, + "FluxboxWindow::unmapNotifyEvent(): reparent 0x%lx to " + "root.\n"), client.window); #endif // DEBUG restoreGravity(); XReparentWindow(display, client.window, screen->getRootWindow(), diff --git a/src/Windowmenu.cc b/src/Windowmenu.cc index 3946e92..a79c608 100644 --- a/src/Windowmenu.cc +++ b/src/Windowmenu.cc @@ -52,96 +52,52 @@ screen(window->getScreen()){ sendToMenu = new SendtoWorkspacemenu(this); sendGroupToMenu = new SendGroupToWorkspacemenu(this); - + using namespace FBNLS; insert(i18n->getMessage( -#ifdef NLS - WindowmenuSet, WindowmenuSendTo, -#else // !NLS - 0, 0, -#endif // NLS - "Send To ..."), + WindowmenuSet, WindowmenuSendTo, + "Send To ..."), sendToMenu); insert(i18n->getMessage( -#ifdef NLS - WindowmenuSet, WindowmenuSendGroupTo, -#else // !NLS - 0, 0, -#endif // NLS - "Send Group To ..."), + WindowmenuSet, WindowmenuSendGroupTo, + "Send Group To ..."), sendGroupToMenu); insert(i18n->getMessage( -#ifdef NLS - WindowmenuSet, WindowmenuShade, -#else // !NLS - 0, 0, -#endif // NLS - "Shade"), + WindowmenuSet, WindowmenuShade, + "Shade"), BScreen::WINDOWSHADE); insert(i18n->getMessage( -#ifdef NLS - WindowmenuSet, WindowmenuIconify, -#else // !NLS - 0, 0, -#endif // NLS - "Iconify"), + WindowmenuSet, WindowmenuIconify, + "Iconify"), BScreen::WINDOWICONIFY); insert(i18n->getMessage( -#ifdef NLS - WindowmenuSet, WindowmenuMaximize, -#else // !NLS - 0, 0, -#endif // NLS - "Maximize"), + WindowmenuSet, WindowmenuMaximize, + "Maximize"), BScreen::WINDOWMAXIMIZE); insert(i18n->getMessage( -#ifdef NLS - WindowmenuSet, WindowmenuRaise, -#else // !NLS - 0, 0, -#endif // NLS - "Raise"), + WindowmenuSet, WindowmenuRaise, + "Raise"), BScreen::WINDOWRAISE); insert(i18n->getMessage( -#ifdef NLS - WindowmenuSet, WindowmenuLower, -#else // !NLS - 0, 0, -#endif // NLS - "Lower"), + WindowmenuSet, WindowmenuLower, + "Lower"), BScreen::WINDOWLOWER); insert(i18n->getMessage( -#ifdef NLS - WindowmenuSet, WindowmenuStick, -#else // !NLS - 0, 0, -#endif // NLS - "Stick"), + WindowmenuSet, WindowmenuStick, + "Stick"), BScreen::WINDOWSTICK); insert(i18n->getMessage( -#ifdef NLS - WindowmenuSet, WindowmenuKillClient, -#else // !NLS - 0, 0, -#endif // NLS - "Kill Client"), + WindowmenuSet, WindowmenuKillClient, + "Kill Client"), BScreen::WINDOWKILL); insert(i18n->getMessage( -#ifdef NLS - WindowmenuSet, WindowmenuClose, -#else // !NLS - 0, 0, -#endif // NLS - "Close"), + WindowmenuSet, WindowmenuClose, + "Close"), BScreen::WINDOWCLOSE); insert(i18n->getMessage( -#ifdef NLS - WindowmenuSet, WindowmenuTab, -#else // !NLS - 0, 0, -#endif // NLS - "Tab"), + WindowmenuSet, WindowmenuTab, + "Tab"), BScreen::WINDOWTAB); update(); diff --git a/src/Workspace.cc b/src/Workspace.cc index 761cdb1..6b93c5d 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Workspace.cc,v 1.16 2002/04/03 23:04:01 fluxgen Exp $ +// $Id: Workspace.cc,v 1.17 2002/04/04 11:28:19 fluxgen Exp $ // use GNU extensions #ifndef _GNU_SOURCE @@ -351,11 +351,7 @@ void Workspace::setName(char *new_name) { char tname[128]; sprintf(tname, I18n::instance()-> getMessage( -#ifdef NLS - WorkspaceSet, WorkspaceDefaultNameFormat, -#else // !NLS - 0, 0, -#endif // NLS + FBNLS::WorkspaceSet, FBNLS::WorkspaceDefaultNameFormat, "Workspace %d"), id + 1); name = tname; } diff --git a/src/Workspacemenu.cc b/src/Workspacemenu.cc index bedb6c0..ba4ff0a 100644 --- a/src/Workspacemenu.cc +++ b/src/Workspacemenu.cc @@ -44,29 +44,16 @@ Workspacemenu::Workspacemenu(BScreen *scrn) : Basemenu(scrn) { setInternalMenu(); I18n *i18n = I18n::instance(); - + using namespace FBNLS; setLabel(i18n->getMessage( -#ifdef NLS - WorkspacemenuSet, WorkspacemenuWorkspacesTitle, -#else // !NLS - 0, 0, -#endif // NLS - "Workspaces")); - + WorkspacemenuSet, WorkspacemenuWorkspacesTitle, + "Workspaces")); insert(i18n->getMessage( -#ifdef NLS - WorkspacemenuSet, WorkspacemenuNewWorkspace, -#else // !NLS - 0, 0, -#endif // NLS - "New Workspace")); + WorkspacemenuSet, WorkspacemenuNewWorkspace, + "New Workspace")); insert(i18n->getMessage( -#ifdef NLS - WorkspacemenuSet, WorkspacemenuRemoveLast, -#else // !NLS - 0, 0, -#endif // NLS - "Remove Last")); + WorkspacemenuSet, WorkspacemenuRemoveLast, + "Remove Last")); } diff --git a/src/fluxbox.cc b/src/fluxbox.cc index aa53087..aaeb466 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.43 2002/04/02 23:13:38 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.44 2002/04/04 11:28:19 fluxgen Exp $ //Use some GNU extensions #ifndef _GNU_SOURCE @@ -380,11 +380,7 @@ key(0) fprintf(stderr, i18n-> getMessage( -#ifdef NLS - blackboxSet, blackboxNoManagableScreens, -#else // !NLS - 0, 0, -#endif // NLS + FBNLS::blackboxSet, FBNLS::blackboxNoManagableScreens, "Fluxbox::Fluxbox: no managable screens found, aborting.\n")); throw static_cast(3); @@ -602,13 +598,9 @@ void Fluxbox::process_event(XEvent *e) { fprintf(stderr, I18n::instance()-> getMessage( - #ifdef NLS - blackboxSet, blackboxMapRequest, - #else // !NLS - 0, 0, - #endif // NLS + FBNLS::blackboxSet, FBNLS::blackboxMapRequest, "Fluxbox::process_event(): MapRequest for 0x%lx\n"), - e->xmaprequest.window); + e->xmaprequest.window); #endif // DEBUG #ifdef SLIT diff --git a/src/i18n.cc b/src/i18n.cc index 85c170e..10aab7e 100644 --- a/src/i18n.cc +++ b/src/i18n.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: i18n.cc,v 1.3 2002/04/04 00:21:48 fluxgen Exp $ +// $Id: i18n.cc,v 1.4 2002/04/04 11:28:19 fluxgen Exp $ //usr GNU extensions #ifndef _GNU_SOURCE @@ -58,7 +58,7 @@ void NLSInit(const char *catalog) { } -I18n::I18n():m_multibyte(false), m_catalog_fd(0) { +I18n::I18n():m_multibyte(false), m_catalog_fd(-1) { #ifdef HAVE_SETLOCALE //make sure we don't get 0 to m_locale string char *temp = setlocale(LC_ALL, ""); diff --git a/src/main.cc b/src/main.cc index ba2ef26..0ab2b24 100644 --- a/src/main.cc +++ b/src/main.cc @@ -22,10 +22,9 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: main.cc,v 1.5 2002/03/08 12:21:46 fluxgen Exp $ +// $Id: main.cc,v 1.6 2002/04/04 11:28:19 fluxgen Exp $ -// stupid macros needed to access some functions in version 2 of the GNU C -// library +//use GNU extensions #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif // _GNU_SOURCE @@ -75,12 +74,12 @@ uds::uds_flags_t uds::flags = uds::leak_check; const char *getNLSYesNoMsg(bool val) { if (val) { return I18n::instance()->getMessage( - CommonSet, CommonYes, + FBNLS::CommonSet, FBNLS::CommonYes, "yes"); } return I18n::instance()->getMessage( - CommonSet, CommonNo, + FBNLS::CommonSet, FBNLS::CommonNo, "no"); } @@ -103,7 +102,7 @@ int main(int argc, char **argv) { if ((++i) >= argc) { fprintf(stderr, i18n->getMessage( - mainSet, mainRCRequiresArg, + FBNLS::mainSet, FBNLS::mainRCRequiresArg, "error: '-rc' requires and argument\n")); exit(1); } @@ -116,7 +115,7 @@ int main(int argc, char **argv) { if ((++i) >= argc) { fprintf(stderr, i18n->getMessage( - mainSet, mainDISPLAYRequiresArg, + FBNLS::mainSet, FBNLS::mainDISPLAYRequiresArg, "error: '-display' requires an argument\n")); exit(1); } @@ -129,7 +128,7 @@ int main(int argc, char **argv) { fprintf(stderr, i18n-> getMessage( - mainSet, mainWarnDisplaySet, + FBNLS::mainSet, FBNLS::mainWarnDisplaySet, "warning: couldn't set environment variable 'DISPLAY'\n")); perror("putenv()"); } @@ -143,7 +142,7 @@ int main(int argc, char **argv) { // print program usage and command line options printf(i18n-> getMessage( - mainSet, mainUsage, + FBNLS::mainSet, FBNLS::mainUsage, "Fluxbox %s : (c) 2001-2002 Henrik Kinnunen\n\n" " -display \t\tuse display connection.\n" " -rc \t\t\tuse alternate resource file.\n" @@ -155,11 +154,7 @@ int main(int argc, char **argv) { // as well printf(i18n-> getMessage( - #ifdef NLS - mainSet, mainCompileOptions, - #else // !NLS - 0, 0, - #endif // NLS + FBNLS::mainSet, FBNLS::mainCompileOptions, "Compile time options:\n" " Debugging:\t\t\t%s\n" " Interlacing:\t\t\t%s\n" -- cgit v0.11.2