all repos — fluxbox @ f6c292a406f183a12b2e327716aad5de4c0abcca

custom fork of the fluxbox windowmanager

split Text.hh into Orientation.hh and TextUtils.{cc,hh}
Mathias Gumz akira at fluxbox dot org
commit

f6c292a406f183a12b2e327716aad5de4c0abcca

parent

e1db89e2d7d56afca5335550ee1c9ff87fd54ba4

M src/ClockTool.ccsrc/ClockTool.cc

@@ -30,6 +30,7 @@ #include "fluxbox.hh"

#include "FbTk/SimpleCommand.hh" #include "FbTk/ImageControl.hh" +#include "FbTk/TextUtils.hh" #include "FbTk/Menu.hh" #include "FbTk/MenuItem.hh" #include "FbTk/I18n.hh"
M src/FbTk/Button.hhsrc/FbTk/Button.hh

@@ -28,7 +28,7 @@ #include "RefCount.hh"

#include "FbWindow.hh" #include "Command.hh" #include "Color.hh" -#include "Text.hh" +#include "Orientation.hh" namespace FbTk {
M src/FbTk/Container.ccsrc/FbTk/Container.cc

@@ -23,6 +23,7 @@

#include "Container.hh" #include "Button.hh" +#include "TextUtils.hh" #include "EventManager.hh" #include "CompareEqual.hh"

@@ -61,37 +62,6 @@ unsigned int width, unsigned int height) {

FbWindow::moveResize(x, y, width, height); repositionItems(); } - -#ifdef NOT_USED -void Container::insertItems(ItemList &item_list, int pos) { - - // make sure all items have parent == this - ItemList::iterator it = m_item_list.begin(); - ItemList::iterator it_end = m_item_list.end(); - for (; it != it_end; ++it) { - if ((*it)->parent() != this) - return; - } - - if (pos > size() || pos < 0) { - // insert last - m_item_list.splice(m_item_list.end(), item_list); - } else if (pos == 0) { - // insert first - m_item_list.splice(m_item_list.begin(), item_list); - } else { - // find insert point - for (it = m_item_list.begin(); pos != 0; ++it, --pos) - continue; - m_item_list.splice(it, item_list); - } - - m_item_list.unique(); - - // update position - repositionItems(); -} -#endif void Container::insertItem(Item item, int pos) { if (find(item) != -1)
M src/FbTk/Container.hhsrc/FbTk/Container.hh

@@ -26,7 +26,7 @@

#include "FbWindow.hh" #include "EventHandler.hh" #include "NotCopyable.hh" -#include "Text.hh" // for Orientation +#include "Orientation.hh" #include <list>

@@ -52,9 +52,6 @@ void resize(unsigned int width, unsigned int height);

void moveResize(int x, int y, unsigned int width, unsigned int height); -#ifdef NOT_USED - void insertItems(ItemList &list, int position=-1); -#endif void insertItem(Item item, int pos = -1); bool removeItem(int item); // return true if something was removed bool removeItem(Item item); // return true if something was removed
M src/FbTk/FbPixmap.ccsrc/FbTk/FbPixmap.cc

@@ -24,6 +24,7 @@ #include "App.hh"

#include "GContext.hh" #include "Transparent.hh" #include "FbWindow.hh" +#include "TextUtils.hh" #include <X11/Xutil.h> #include <X11/Xatom.h>
M src/FbTk/FbPixmap.hhsrc/FbTk/FbPixmap.hh

@@ -23,7 +23,7 @@ #ifndef FBTK_FBPIXMAP_HH

#define FBTK_FBPIXMAP_HH #include "FbDrawable.hh" -#include "Text.hh" // for Orientation +#include "Orientation.hh" namespace FbTk {
M src/FbTk/Font.hhsrc/FbTk/Font.hh

@@ -30,7 +30,7 @@ #endif // HAVE_CONFIG_H

#include "FbString.hh" #include "Color.hh" -#include "Text.hh" +#include "Orientation.hh" namespace FbTk {
M src/FbTk/FontImp.hhsrc/FbTk/FontImp.hh

@@ -22,7 +22,7 @@

#ifndef FBTK_FONTIMP_HH #define FBTK_FONTIMP_HH -#include "Text.hh" +#include "Orientation.hh" #include "FbString.hh" #include <X11/Xlib.h>
M src/FbTk/ImageControl.hhsrc/FbTk/ImageControl.hh

@@ -25,7 +25,7 @@

#ifndef FBTK_IMAGECONTROL_HH #define FBTK_IMAGECONTROL_HH -#include "Text.hh" // actually, Text is rather tool like, that's where orientation comes from +#include "Orientation.hh" #include "Timer.hh" #include "NotCopyable.hh"
M src/FbTk/Makefile.amsrc/FbTk/Makefile.am

@@ -30,7 +30,7 @@ MultiButtonMenuItem.hh MultiButtonMenuItem.cc \

MenuTheme.hh MenuTheme.cc NotCopyable.hh \ BorderTheme.hh BorderTheme.cc TextTheme.hh TextTheme.cc \ RefCount.hh SimpleCommand.hh SignalHandler.cc SignalHandler.hh \ - Text.hh Text.cc \ + TextUtils.hh TextUtils.cc Orientation.hh \ Texture.cc Texture.hh TextureRender.hh TextureRender.cc \ Shape.hh Shape.cc \ Theme.hh Theme.cc ThemeItems.cc Timer.hh Timer.cc \
M src/FbTk/MenuTheme.hhsrc/FbTk/MenuTheme.hh

@@ -27,7 +27,6 @@ #include "Color.hh"

#include "Font.hh" #include "Shape.hh" #include "Texture.hh" -#include "Text.hh" #include "PixmapWithMask.hh" #include "GContext.hh"
A src/FbTk/Orientation.hh

@@ -0,0 +1,34 @@

+// Orientation.hh for FbTk +// Copyright (c) 2008 Henrik Kinnunen (fluxgen at fluxbox dot org) +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef FBTK_ORIENTATION_HH +#define FBTK_ORIENTATION_HH + +namespace FbTk { + +enum Justify {LEFT, RIGHT, CENTER}; + +// clockwise +enum Orientation { ROT0=0, ROT90, ROT180, ROT270 }; + +} // end namespace FbTk + +#endif // FBTK_ORIENTATION_HH
M src/FbTk/Text.ccsrc/FbTk/TextUtils.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -#include "Text.hh" +#include "TextUtils.hh" #include "Font.hh" #include "Theme.hh"
M src/FbTk/Text.hhsrc/FbTk/TextUtils.hh

@@ -1,4 +1,4 @@

-// Text.hh for FbTk - text utils +// TextUtils.hh for FbTk - text utils // Copyright (c) 2002 - 2003 Henrik Kinnunen (fluxgen at fluxbox dot org) // // Permission is hereby granted, free of charge, to any person obtaining a

@@ -19,16 +19,14 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -#ifndef FBTK_TEXT_HH -#define FBTK_TEXT_HH +#ifndef FBTK_TEXTUTILS_HH +#define FBTK_TEXTUTILS_HH + +#include "Orientation.hh" namespace FbTk { class Font; - -enum Justify {LEFT, RIGHT, CENTER}; -// clockwise -enum Orientation { ROT0=0, ROT90, ROT180, ROT270 }; /** Aligns the text after max width and bevel

@@ -132,4 +130,4 @@ }

} // end namespace FbTk -#endif // FBTK_TEXT_HH +#endif // FBTK_TEXTUTILS_HH
M src/FbTk/TextButton.ccsrc/FbTk/TextButton.cc

@@ -20,6 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

// DEALINGS IN THE SOFTWARE. #include "TextButton.hh" +#include "TextUtils.hh" #include "Font.hh" #include "GContext.hh"
M src/FbTk/TextButton.hhsrc/FbTk/TextButton.hh

@@ -23,7 +23,6 @@ #ifndef FBTK_TEXTBUTTON_HH

#define FBTK_TEXTBUTTON_HH #include "Button.hh" -#include "Text.hh" #include <string>
M src/FbTk/TextTheme.hhsrc/FbTk/TextTheme.hh

@@ -26,7 +26,7 @@

#include "Theme.hh" #include "Font.hh" #include "Color.hh" -#include "Text.hh" +#include "Orientation.hh" #include "GContext.hh" namespace FbTk {
M src/FbTk/TextureRender.ccsrc/FbTk/TextureRender.cc

@@ -25,6 +25,7 @@

#include "TextureRender.hh" #include "ImageControl.hh" +#include "TextUtils.hh" #include "Texture.hh" #include "App.hh" #include "FbPixmap.hh"
M src/FbTk/TextureRender.hhsrc/FbTk/TextureRender.hh

@@ -25,7 +25,7 @@

#ifndef FBTK_TEXTURRENDER_HH #define FBTK_TEXTURRENDER_HH -#include "Text.hh" +#include "Orientation.hh" #include <X11/Xlib.h>
M src/FbTk/XmbFontImp.ccsrc/FbTk/XmbFontImp.cc

@@ -22,6 +22,7 @@

#include "XmbFontImp.hh" #include "App.hh" +#include "TextUtils.hh" #include "StringUtil.hh" #include "FbPixmap.hh" #include "GContext.hh"
M src/FbWinFrame.ccsrc/FbWinFrame.cc

@@ -28,6 +28,7 @@ #include "FbTk/SimpleCommand.hh"

#include "FbTk/Compose.hh" #include "FbTk/Transparent.hh" #include "FbTk/CompareEqual.hh" +#include "FbTk/TextUtils.hh" #include "FbWinFrameTheme.hh" #include "Screen.hh"
M src/IconButton.ccsrc/IconButton.cc

@@ -30,6 +30,7 @@ #include "FbTk/App.hh"

#include "FbTk/Command.hh" #include "FbTk/EventManager.hh" #include "FbTk/ImageControl.hh" +#include "FbTk/TextUtils.hh" #include "FbTk/MacroCommand.hh" #include "FbTk/Menu.hh" #include "FbTk/RefCount.hh"
M src/SystemTray.ccsrc/SystemTray.cc

@@ -23,6 +23,7 @@ #include "SystemTray.hh"

#include "FbTk/EventManager.hh" #include "FbTk/ImageControl.hh" +#include "FbTk/TextUtils.hh" #include "AtomHandler.hh" #include "fluxbox.hh"
M src/Toolbar.ccsrc/Toolbar.cc

@@ -45,6 +45,7 @@ #include "Layer.hh"

#include "FbTk/I18n.hh" #include "FbTk/ImageControl.hh" +#include "FbTk/TextUtils.hh" #include "FbTk/MacroCommand.hh" #include "FbTk/EventManager.hh" #include "FbTk/SimpleCommand.hh"
M src/ToolbarItem.hhsrc/ToolbarItem.hh

@@ -24,7 +24,7 @@ #ifndef TOOLBARITEM_HH

#define TOOLBARITEM_HH #include "FbTk/Subject.hh" -#include "FbTk/Text.hh" // orientation +#include "FbTk/Orientation.hh" /// An item in the toolbar that has either fixed or relative size to the toolbar class ToolbarItem {