merged with 2_1-merged-to-HEAD-2002-09-30
@@ -64,7 +64,9 @@ SATO Satoru <ssato@adachi.ne.jp>
- Japanese (ja_JP) Hyun Suk Noh <tzesti@users.sourceforge.net> - Korean (ko_KR) - Wilbert Berendsen <wbsoft@xs4all.nl> + Artis Trops <hornet@navigator.lv> + - Latvian (lv_LV) + Wilbert Berendsen <wbsoft@xs4all.nl> - Dutch (nl_NL) Øyvind Stegard <oyvind.stegard@bluezone.no> - Norwegian (no_NO)
@@ -2,11 +2,17 @@ Changelog for Openbox:
2.2.0 * Bitmap buttons (Scott Moynes) +2.1.1: + * A build fix for xftlsfonts. (Scott Moynes) + + * Add a configuration menu for changing Xft font (Ben Jansens) + options, when Xft is compiled in. + 2.1.0: - * make alt-right-click resizing work on bottom window (Ben Jansens) + * Make alt-right-click resizing work on bottom window (Ben Jansens) handles. - * drop shadows for fonts, optional. (dropShadowFonts (Ben Jansens) + * Drop shadows for fonts, optional. (dropShadowFonts (Ben Jansens) in the rc file). * GNOME 2 Support. (Fixed problems with Gnome 2 (Ben Jansens)
@@ -1,9 +1,9 @@
ChangeLog from Blackbox (this code's previous project): Changes from 0.62.1 to 0.65.0: - - added Taiwan Chinese (zh_TW), Hungarian (hu_HU), Korean (ko_KR), - Norwegian (no_NO), Polish (pl_PL), Romanian (ro_RO) and Ukrainian (uk_UA) - nls files and updated most of the others. + - added Taiwan Chinese (zh_TW), Hungarian (hu_HU), Latvian (lv_LV), + Korean (ko_KR), Norwegian (no_NO), Polish (pl_PL), Romanian (ro_RO) and + Ukrainian (uk_UA) nls files and updated most of the others. - added French man pages - remove slit and netwm as compile time options - strip much of BaseDisplay's original functionality and move it to the
@@ -35,7 +35,7 @@ dnl Check for X headers and libraries
AC_PATH_X AC_PATH_XTRA -test x$no_x = "xyes" && AC_MSG_ERROR([Openbox requires the X Window System libraries and headers.]) +test "$no_x" = "yes" && AC_MSG_ERROR([Openbox requires the X Window System libraries and headers.]) test x$x_includes = "x" && x_includes="/usr/include" test x$x_libraries = "x" && x_libraries="/usr/lib"@@ -46,7 +46,7 @@ LIBS="$LIBS $X_LIBS"
LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS" AC_MSG_CHECKING(for GCC) -if test x$GCC = "xyes"; then +if test "$GCC" = "yes"; then AC_MSG_RESULT([yes]) CXXFLAGS="${CXXFLAGS} -Wall -W" else@@ -83,7 +83,7 @@ AC_ARG_ENABLE(
shape, [ --enable-shape enable support of the XShape extension [default=yes]]) : ${enableval="yes"} -if test x$enableval = "xyes"; then +if test "$enableval" = "yes"; then AC_MSG_RESULT([yes]) AC_CHECK_LIB(Xext, XShapeCombineShape, AC_MSG_CHECKING([for X11/extensions/shape.h])@@ -100,7 +100,7 @@ )
else AC_MSG_RESULT([no]) fi -if test x$SHAPE = "xyes"; then +if test "$SHAPE" = "yes"; then LIBS="$LIBS -lXext" AC_DEFINE(SHAPE,1,Enable support of the XShape extension) fi@@ -110,7 +110,7 @@ XINERAMA=""
AC_MSG_CHECKING([whether to build support for the Xinerama extension]) AC_ARG_ENABLE( xinerama, [ --enable-xinerama enable support of the Xinerama extension [default=no]], - if test x$enableval = "xyes"; then + if test "$enableval" = "yes"; then AC_MSG_RESULT([yes]) AC_CHECK_LIB(Xinerama, XineramaQueryExtension,@@ -131,17 +131,18 @@ AC_MSG_RESULT([no])
fi, AC_MSG_RESULT([no]) ) -if test x$XINERAMA = "xyes"; then +if test "$XINERAMA" = "yes"; then AC_DEFINE(XINERAMA,1,Enable support of the Xinerama extension) fi dnl Check for Xft extension support and proper library files. XFT="" +XFT_UTF8="" AC_MSG_CHECKING([whether to build support for the Xft extension]) AC_ARG_ENABLE( xft, [ --enable-xft enable support of the Xft extension [default=yes]]) : ${enableval="yes"} -if test x$enableval = "xyes"; then +if test "$enableval" = "yes"; then AC_MSG_RESULT([yes]) AC_CHECK_LIB(Xft, XftFontOpenXlfd,@@ -152,7 +153,13 @@ #include <X11/Xft/Xft.h>
, XftFont foo, AC_MSG_RESULT([yes]) XFT="yes" - LIBS="$LIBS -lXft", + LIBS="$LIBS -lXft" + + dnl Check for utf8 support in the Xft library + AC_CHECK_LIB(Xft, XftDrawStringUtf8, + XFT_UTF8="yes", + ), + AC_MSG_RESULT([no]) ) )@@ -160,8 +167,11 @@
else AC_MSG_RESULT([no]) fi -if test x$XFT = "xyes"; then - AC_DEFINE(XFT,1,Enable support of the Xft extension) +if test "$XFT" = "yes"; then + AC_DEFINE(XFT,1,[Enable support of the Xft extension]) + if test "$XFT_UTF8" = "yes"; then + AC_DEFINE(XFT_UTF8,1,[Support for Utf8 text in the Xft extension]) + fi fi dnl Check for ordered 8bpp dithering@@ -170,7 +180,7 @@ AC_MSG_CHECKING([whether to include Pseudocolor ordered dithering code])
AC_ARG_ENABLE(ordered-pseudo, [ --enable-ordered-pseudo include code for ordered pseudocolor (8bpp) dithering [default=no]], - if test x$enableval = "xyes"; then + if test "$enableval" = "yes"; then AC_MSG_RESULT([yes]) ORDEREDPSEUDO="yes" else@@ -178,7 +188,7 @@ AC_MSG_RESULT([no])
fi, AC_MSG_RESULT([no]) ) -if test x$ORDEREDPSEUDO = "xyes"; then +if test "$ORDEREDPSEUDO" = "yes"; then AC_DEFINE(ORDEREDPSEUDO,1,Enable pseudocolor ordered dithering) fi@@ -187,9 +197,9 @@ DEBUG=""
AC_MSG_CHECKING([whether to include verbose debugging code]) AC_ARG_ENABLE(debug, [ --enable-debug include verbose debugging code [default=no]], - if test x$enableval = "xyes"; then + if test "$enableval" = "yes"; then AC_MSG_RESULT([yes]) - if test x$GCC = "xyes"; then + if test "$GCC" = "yes"; then DEBUG="-DDEBUG -fno-inline -g" else DEBUG="-DDEBUG"@@ -208,7 +218,7 @@ NLS=""
AC_MSG_CHECKING([whether to include NLS support]) AC_ARG_ENABLE(nls, [ --enable-nls include natural language support [default=yes]], - if test x$enableval = "xyes"; then + if test "$enableval" = "yes"; then AC_MSG_RESULT([yes]) NLS="yes" else@@ -225,7 +235,7 @@ if test x$gencat_cmd = "x"; then
NLS="" fi -if test x$NLS = "xyes"; then +if test "$NLS" = "yes"; then AC_DEFINE(NLS,1,Include natural language support) AC_SUBST(NLS) fi@@ -236,7 +246,7 @@ AC_MSG_CHECKING([whether to use the timed pixmap cache])
AC_ARG_ENABLE( timed-cache, [ --enable-timed-cache use timed pixmap cache [default=yes]], - if test x$enableval = "xyes"; then + if test "$enableval" = "yes"; then AC_MSG_RESULT([yes]) TIMEDCACHE="yes" else@@ -245,7 +255,7 @@ fi,
AC_MSG_RESULT([yes]) TIMEDCACHE="yes" ) -if test x$TIMEDCACHE = "xyes"; then +if test "$TIMEDCACHE" = "yes"; then AC_DEFINE(TIMEDCACHE,1,Use timed pixmap cache) fi@@ -305,6 +315,7 @@ nls/hu_HU/Makefile
nls/it_IT/Makefile nls/ja_JP/Makefile nls/ko_KR/Makefile +nls/lv_LV/Makefile nls/no_NO/Makefile nls/pl_PL/Makefile nls/nl_NL/Makefile
@@ -1,8 +1,8 @@
# nls/Makefile.am for Blackbox - an X11 Window Manager NLSTEST = @NLS@ -SUBDIRS = C da_DK de_DE es_AR es_ES et_EE fr_FR hu_HU it_IT ja_JP ko_KR nl_NL \ - no_NO pl_PL pt_BR ro_RO ru_RU sk_SK sl_SI sv_SE tr_TR uk_UA \ +SUBDIRS = C da_DK de_DE es_AR es_ES et_EE fr_FR hu_HU it_IT ja_JP ko_KR lv_LV \ + nl_NL no_NO pl_PL pt_BR ro_RO ru_RU sk_SK sl_SI sv_SE tr_TR uk_UA \ zh_CN zh_TW MAINTAINERCLEANFILES = Makefile.in blackbox-nls.hh DISTCLEANFILES = blackbox-nls.hh
@@ -270,9 +270,13 @@ c.color.blue = 0;
c.color.alpha = 0x40 | 0x40 << 8; // transparent shadow c.pixel = BlackPixel(_display, _screen->getScreenNumber()); - - XftDrawStringUtf8(draw, &c, _xftfont, x + 1, _xftfont->ascent + y + 1, - (XftChar8 *) string.c_str(), string.size()); +#ifdef XFT_UTF8 + XftDrawStringUtf8( +#else + XftDrawString8( +#endif + draw, &c, _xftfont, x + 1, _xftfont->ascent + y + 1, + (XftChar8 *) string.c_str(), string.size()); } XftColor c;@@ -282,8 +286,13 @@ c.color.blue = color.blue() | color.blue() << 8;
c.pixel = color.pixel(); c.color.alpha = 0xff | 0xff << 8; // no transparency in BColor yet - XftDrawStringUtf8(draw, &c, _xftfont, x, _xftfont->ascent + y, - (XftChar8 *) string.c_str(), string.size()); +#ifdef XFT_UTF8 + XftDrawStringUtf8( +#else + XftDrawString8( +#endif + draw, &c, _xftfont, x, _xftfont->ascent + y, + (XftChar8 *) string.c_str(), string.size()); XftDrawDestroy(draw); return;@@ -309,8 +318,15 @@
#ifdef XFT if (_xftfont) { XGlyphInfo info; - XftTextExtentsUtf8(_display, _xftfont, (XftChar8 *) string.c_str(), - string.size(), &info); + +#ifdef XFT_UTF8 + XftTextExtentsUtf8( +#else + XftTextExtents8( +#endif + _display, _xftfont, (XftChar8 *) string.c_str(), + string.size(), &info); + return info.xOff + (_shadow ? 1 : 0); } #endif // XFT
@@ -429,15 +429,15 @@
void BScreen::saveAAFonts(bool f) { resource.aa_fonts = f; - reconfigure(); config->setValue(screenstr + "antialiasFonts", resource.aa_fonts); + reconfigure(); } void BScreen::saveShadowFonts(bool f) { resource.shadow_fonts = f; - reconfigure(); config->setValue(screenstr + "dropShadowFonts", resource.shadow_fonts); + reconfigure(); }@@ -709,11 +709,12 @@
if (! config->getValue(screenstr + "opaqueMove", resource.opaque_move)) resource.opaque_move = false; - if (! config->getValue(screenstr + "dropShadowFonts", resource.shadow_fonts)) - resource.shadow_fonts = false; - if (! config->getValue(screenstr + "antialiasFonts", resource.aa_fonts)) resource.aa_fonts = true; + + if (! resource.aa_fonts || + ! config->getValue(screenstr + "dropShadowFonts", resource.shadow_fonts)) + resource.shadow_fonts = false; if (! config->getValue(screenstr + "resizeZones", resource.resize_zones) || (resource.resize_zones != 1 && resource.resize_zones != 2 &&@@ -1753,6 +1754,9 @@ int bbwins = 15;
#ifdef XINERAMA ++bbwins; #endif // XINERAMA +#ifdef XFT + ++bbwins; +#endif // XFT Window *session_stack = new Window[(num + workspacesList.size() + rootmenuList.size() +@@ -1776,6 +1780,9 @@ *(session_stack + i++) = configmenu->getEdgeSnapmenu()->getWindowID();
#ifdef XINERAMA *(session_stack + i++) = configmenu->getXineramamenu()->getWindowID(); #endif // XINERAMA +#ifdef XFT + *(session_stack + i++) = configmenu->getXftmenu()->getWindowID(); +#endif // XFT *(session_stack + i++) = configmenu->getWindowID(); *(session_stack + i++) = slit->getMenu()->getDirectionmenu()->getWindowID();@@ -1867,8 +1874,7 @@ void BScreen::propagateWindowName(const BlackboxWindow *bw) {
if (bw->isIconic()) { iconmenu->changeItemLabel(bw->getWindowNumber(), bw->getIconTitle()); iconmenu->update(); - } - else { + } else { Clientmenu *clientmenu = getWorkspace(bw->getWorkspaceNumber())->getMenu(); clientmenu->changeItemLabel(bw->getWindowNumber(), bw->getTitle()); clientmenu->update();@@ -1879,36 +1885,28 @@ }
} -void BScreen::nextFocus(void) { +void BScreen::nextFocus(void) const { BlackboxWindow *focused = blackbox->getFocusedWindow(), *next = focused; - if (focused) { - // if window is not on this screen, ignore it - if (focused->getScreen()->getScreenNumber() != getScreenNumber()) - focused = (BlackboxWindow*) 0; - } - - if (focused && current_workspace->getCount() > 1) { - // next is the next window to recieve focus, current is a place holder - BlackboxWindow *current; + if (focused && + focused->getScreen()->getScreenNumber() == getScreenNumber() && + current_workspace->getCount() > 1) { do { - current = next; - next = current_workspace->getNextWindowInList(current); - } while(! next->setInputFocus() && next != focused); + next = current_workspace->getNextWindowInList(next); + } while (next != focused && ! next->setInputFocus()); if (next != focused) current_workspace->raiseWindow(next); - } else if (current_workspace->getCount() >= 1) { + } else if (current_workspace->getCount() > 0) { next = current_workspace->getTopWindowOnStack(); - - current_workspace->raiseWindow(next); next->setInputFocus(); + current_workspace->raiseWindow(next); } } -void BScreen::prevFocus(void) { +void BScreen::prevFocus(void) const { BlackboxWindow *focused = blackbox->getFocusedWindow(), *next = focused;@@ -1917,27 +1915,26 @@ // if window is not on this screen, ignore it
if (focused->getScreen()->getScreenNumber() != getScreenNumber()) focused = (BlackboxWindow*) 0; } - - if (focused && current_workspace->getCount() > 1) { - // next is the next window to recieve focus, current is a place holder - BlackboxWindow *current; + + if (focused && + focused->getScreen()->getScreenNumber() == getScreenNumber() && + current_workspace->getCount() > 1) { + // next is the next window to receive focus, current is a place holder do { - current = next; - next = current_workspace->getPrevWindowInList(current); - } while(! next->setInputFocus() && next != focused); + next = current_workspace->getPrevWindowInList(next); + } while (next != focused && ! next->setInputFocus()); if (next != focused) current_workspace->raiseWindow(next); - } else if (current_workspace->getCount() >= 1) { + } else if (current_workspace->getCount() > 0) { next = current_workspace->getTopWindowOnStack(); - - current_workspace->raiseWindow(next); next->setInputFocus(); + current_workspace->raiseWindow(next); } } -void BScreen::raiseFocus(void) { +void BScreen::raiseFocus(void) const { BlackboxWindow *focused = blackbox->getFocusedWindow(); if (! focused) return;@@ -2525,7 +2522,7 @@ updateWorkArea();
} -Workspace* BScreen::getWorkspace(unsigned int index) { +Workspace* BScreen::getWorkspace(unsigned int index) const { assert(index < workspacesList.size()); return workspacesList[index]; }
@@ -272,7 +272,7 @@
inline Slit *getSlit(void) { return slit; } inline Toolbar *getToolbar(void) { return toolbar; } - Workspace *getWorkspace(unsigned int index); + Workspace *getWorkspace(unsigned int index) const; inline Workspace *getCurrentWorkspace(void) { return current_workspace; }@@ -397,9 +397,9 @@ void lowerWindows(Window *workspace_stack, unsigned int num);
void reassociateWindow(BlackboxWindow *w, unsigned int wkspc_id, bool ignore_sticky); void propagateWindowName(const BlackboxWindow *bw); - void prevFocus(void); - void nextFocus(void); - void raiseFocus(void); + void prevFocus(void) const; + void nextFocus(void) const; + void raiseFocus(void) const; void load_rc(void); void save_rc(void); void reconfigure(void);
@@ -636,11 +636,24 @@ screen->getBlackbox()->doXineramaPlacement()) {
RectList availableAreas = screen->allAvailableAreas(); RectList::iterator it, end = availableAreas.end(); - for (it = availableAreas.begin(); it != end; ++it) + for (it = availableAreas.begin(); it != end; ++it) { + Rect r = *it; + r.setRect(r.x() + screen->getSnapOffset(), + r.y() + screen->getSnapOffset(), + r.width() - screen->getSnapOffset(), + r.height() - screen->getSnapOffset()); spaces.push_back(*it); + } } else #endif // XINERAMA - spaces.push_back(screen->availableArea()); + { + Rect r = screen->availableArea(); + r.setRect(r.x() + screen->getSnapOffset(), + r.y() + screen->getSnapOffset(), + r.width() - screen->getSnapOffset(), + r.height() - screen->getSnapOffset()); + spaces.push_back(r); + } //Find Free Spaces BlackboxWindowList::const_iterator wit = windowList.begin(),
@@ -128,12 +128,14 @@ case XftTypeBool:
cout << val.u.b; break; +#ifdef XFT_UTF8 case XftTypeMatrix: cout << "xx(" << val.u.m->xx << ") "; cout << "xy(" << val.u.m->xy << ") "; cout << "yx(" << val.u.m->yx << ") "; cout << "yy(" << val.u.m->yy << ")"; break; +#endif } } while ((vallist = vallist->next)); cout << endl;