aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ClockTool.cc1
-rw-r--r--src/FbTk/Button.hh2
-rw-r--r--src/FbTk/Container.cc32
-rw-r--r--src/FbTk/Container.hh5
-rw-r--r--src/FbTk/FbPixmap.cc1
-rw-r--r--src/FbTk/FbPixmap.hh2
-rw-r--r--src/FbTk/Font.hh2
-rw-r--r--src/FbTk/FontImp.hh2
-rw-r--r--src/FbTk/ImageControl.hh2
-rw-r--r--src/FbTk/Makefile.am2
-rw-r--r--src/FbTk/MenuTheme.hh1
-rw-r--r--src/FbTk/Orientation.hh34
-rw-r--r--src/FbTk/TextButton.cc1
-rw-r--r--src/FbTk/TextButton.hh1
-rw-r--r--src/FbTk/TextTheme.hh2
-rw-r--r--src/FbTk/TextUtils.cc (renamed from src/FbTk/Text.cc)2
-rw-r--r--src/FbTk/TextUtils.hh (renamed from src/FbTk/Text.hh)14
-rw-r--r--src/FbTk/TextureRender.cc1
-rw-r--r--src/FbTk/TextureRender.hh2
-rw-r--r--src/FbTk/XmbFontImp.cc1
-rw-r--r--src/FbWinFrame.cc1
-rw-r--r--src/IconButton.cc1
-rw-r--r--src/SystemTray.cc1
-rw-r--r--src/Toolbar.cc1
-rw-r--r--src/ToolbarItem.hh2
25 files changed, 61 insertions, 55 deletions
diff --git a/src/ClockTool.cc b/src/ClockTool.cc
index ae78266..1dd07cd 100644
--- a/src/ClockTool.cc
+++ b/src/ClockTool.cc
@@ -30,6 +30,7 @@
30 30
31#include "FbTk/SimpleCommand.hh" 31#include "FbTk/SimpleCommand.hh"
32#include "FbTk/ImageControl.hh" 32#include "FbTk/ImageControl.hh"
33#include "FbTk/TextUtils.hh"
33#include "FbTk/Menu.hh" 34#include "FbTk/Menu.hh"
34#include "FbTk/MenuItem.hh" 35#include "FbTk/MenuItem.hh"
35#include "FbTk/I18n.hh" 36#include "FbTk/I18n.hh"
diff --git a/src/FbTk/Button.hh b/src/FbTk/Button.hh
index bcf909b..99d8ee9 100644
--- a/src/FbTk/Button.hh
+++ b/src/FbTk/Button.hh
@@ -28,7 +28,7 @@
28#include "FbWindow.hh" 28#include "FbWindow.hh"
29#include "Command.hh" 29#include "Command.hh"
30#include "Color.hh" 30#include "Color.hh"
31#include "Text.hh" 31#include "Orientation.hh"
32 32
33namespace FbTk { 33namespace FbTk {
34 34
diff --git a/src/FbTk/Container.cc b/src/FbTk/Container.cc
index 9da25c6..0c9b6ac 100644
--- a/src/FbTk/Container.cc
+++ b/src/FbTk/Container.cc
@@ -23,6 +23,7 @@
23#include "Container.hh" 23#include "Container.hh"
24 24
25#include "Button.hh" 25#include "Button.hh"
26#include "TextUtils.hh"
26#include "EventManager.hh" 27#include "EventManager.hh"
27#include "CompareEqual.hh" 28#include "CompareEqual.hh"
28 29
@@ -62,37 +63,6 @@ void Container::moveResize(int x, int y,
62 repositionItems(); 63 repositionItems();
63} 64}
64 65
65#ifdef NOT_USED
66void Container::insertItems(ItemList &item_list, int pos) {
67
68 // make sure all items have parent == this
69 ItemList::iterator it = m_item_list.begin();
70 ItemList::iterator it_end = m_item_list.end();
71 for (; it != it_end; ++it) {
72 if ((*it)->parent() != this)
73 return;
74 }
75
76 if (pos > size() || pos < 0) {
77 // insert last
78 m_item_list.splice(m_item_list.end(), item_list);
79 } else if (pos == 0) {
80 // insert first
81 m_item_list.splice(m_item_list.begin(), item_list);
82 } else {
83 // find insert point
84 for (it = m_item_list.begin(); pos != 0; ++it, --pos)
85 continue;
86 m_item_list.splice(it, item_list);
87 }
88
89 m_item_list.unique();
90
91 // update position
92 repositionItems();
93}
94#endif
95
96void Container::insertItem(Item item, int pos) { 66void Container::insertItem(Item item, int pos) {
97 if (find(item) != -1) 67 if (find(item) != -1)
98 return; 68 return;
diff --git a/src/FbTk/Container.hh b/src/FbTk/Container.hh
index 954f929..d2b826c 100644
--- a/src/FbTk/Container.hh
+++ b/src/FbTk/Container.hh
@@ -26,7 +26,7 @@
26#include "FbWindow.hh" 26#include "FbWindow.hh"
27#include "EventHandler.hh" 27#include "EventHandler.hh"
28#include "NotCopyable.hh" 28#include "NotCopyable.hh"
29#include "Text.hh" // for Orientation 29#include "Orientation.hh"
30 30
31#include <list> 31#include <list>
32 32
@@ -52,9 +52,6 @@ public:
52 void moveResize(int x, int y, 52 void moveResize(int x, int y,
53 unsigned int width, unsigned int height); 53 unsigned int width, unsigned int height);
54 54
55#ifdef NOT_USED
56 void insertItems(ItemList &list, int position=-1);
57#endif
58 void insertItem(Item item, int pos = -1); 55 void insertItem(Item item, int pos = -1);
59 bool removeItem(int item); // return true if something was removed 56 bool removeItem(int item); // return true if something was removed
60 bool removeItem(Item item); // return true if something was removed 57 bool removeItem(Item item); // return true if something was removed
diff --git a/src/FbTk/FbPixmap.cc b/src/FbTk/FbPixmap.cc
index 9d90c5a..7c1d674 100644
--- a/src/FbTk/FbPixmap.cc
+++ b/src/FbTk/FbPixmap.cc
@@ -24,6 +24,7 @@
24#include "GContext.hh" 24#include "GContext.hh"
25#include "Transparent.hh" 25#include "Transparent.hh"
26#include "FbWindow.hh" 26#include "FbWindow.hh"
27#include "TextUtils.hh"
27 28
28#include <X11/Xutil.h> 29#include <X11/Xutil.h>
29#include <X11/Xatom.h> 30#include <X11/Xatom.h>
diff --git a/src/FbTk/FbPixmap.hh b/src/FbTk/FbPixmap.hh
index 5c2e2b8..256f6b6 100644
--- a/src/FbTk/FbPixmap.hh
+++ b/src/FbTk/FbPixmap.hh
@@ -23,7 +23,7 @@
23#define FBTK_FBPIXMAP_HH 23#define FBTK_FBPIXMAP_HH
24 24
25#include "FbDrawable.hh" 25#include "FbDrawable.hh"
26#include "Text.hh" // for Orientation 26#include "Orientation.hh"
27 27
28namespace FbTk { 28namespace FbTk {
29 29
diff --git a/src/FbTk/Font.hh b/src/FbTk/Font.hh
index 8fb493e..28bbf22 100644
--- a/src/FbTk/Font.hh
+++ b/src/FbTk/Font.hh
@@ -30,7 +30,7 @@
30 30
31#include "FbString.hh" 31#include "FbString.hh"
32#include "Color.hh" 32#include "Color.hh"
33#include "Text.hh" 33#include "Orientation.hh"
34 34
35namespace FbTk { 35namespace FbTk {
36 36
diff --git a/src/FbTk/FontImp.hh b/src/FbTk/FontImp.hh
index bdbab48..d903a4e 100644
--- a/src/FbTk/FontImp.hh
+++ b/src/FbTk/FontImp.hh
@@ -22,7 +22,7 @@
22#ifndef FBTK_FONTIMP_HH 22#ifndef FBTK_FONTIMP_HH
23#define FBTK_FONTIMP_HH 23#define FBTK_FONTIMP_HH
24 24
25#include "Text.hh" 25#include "Orientation.hh"
26#include "FbString.hh" 26#include "FbString.hh"
27 27
28#include <X11/Xlib.h> 28#include <X11/Xlib.h>
diff --git a/src/FbTk/ImageControl.hh b/src/FbTk/ImageControl.hh
index 3c3cbb1..a8e18b7 100644
--- a/src/FbTk/ImageControl.hh
+++ b/src/FbTk/ImageControl.hh
@@ -25,7 +25,7 @@
25#ifndef FBTK_IMAGECONTROL_HH 25#ifndef FBTK_IMAGECONTROL_HH
26#define FBTK_IMAGECONTROL_HH 26#define FBTK_IMAGECONTROL_HH
27 27
28#include "Text.hh" // actually, Text is rather tool like, that's where orientation comes from 28#include "Orientation.hh"
29#include "Timer.hh" 29#include "Timer.hh"
30#include "NotCopyable.hh" 30#include "NotCopyable.hh"
31 31
diff --git a/src/FbTk/Makefile.am b/src/FbTk/Makefile.am
index 0fdb155..6fa874a 100644
--- a/src/FbTk/Makefile.am
+++ b/src/FbTk/Makefile.am
@@ -30,7 +30,7 @@ libFbTk_a_SOURCES = App.hh App.cc Color.cc Color.hh Command.hh \
30 MenuTheme.hh MenuTheme.cc NotCopyable.hh \ 30 MenuTheme.hh MenuTheme.cc NotCopyable.hh \
31 BorderTheme.hh BorderTheme.cc TextTheme.hh TextTheme.cc \ 31 BorderTheme.hh BorderTheme.cc TextTheme.hh TextTheme.cc \
32 RefCount.hh SimpleCommand.hh SignalHandler.cc SignalHandler.hh \ 32 RefCount.hh SimpleCommand.hh SignalHandler.cc SignalHandler.hh \
33 Text.hh Text.cc \ 33 TextUtils.hh TextUtils.cc Orientation.hh \
34 Texture.cc Texture.hh TextureRender.hh TextureRender.cc \ 34 Texture.cc Texture.hh TextureRender.hh TextureRender.cc \
35 Shape.hh Shape.cc \ 35 Shape.hh Shape.cc \
36 Theme.hh Theme.cc ThemeItems.cc Timer.hh Timer.cc \ 36 Theme.hh Theme.cc ThemeItems.cc Timer.hh Timer.cc \
diff --git a/src/FbTk/MenuTheme.hh b/src/FbTk/MenuTheme.hh
index 273104c..70fc9b8 100644
--- a/src/FbTk/MenuTheme.hh
+++ b/src/FbTk/MenuTheme.hh
@@ -27,7 +27,6 @@
27#include "Font.hh" 27#include "Font.hh"
28#include "Shape.hh" 28#include "Shape.hh"
29#include "Texture.hh" 29#include "Texture.hh"
30#include "Text.hh"
31#include "PixmapWithMask.hh" 30#include "PixmapWithMask.hh"
32#include "GContext.hh" 31#include "GContext.hh"
33 32
diff --git a/src/FbTk/Orientation.hh b/src/FbTk/Orientation.hh
new file mode 100644
index 0000000..bf6bd69
--- /dev/null
+++ b/src/FbTk/Orientation.hh
@@ -0,0 +1,34 @@
1// Orientation.hh for FbTk
2// Copyright (c) 2008 Henrik Kinnunen (fluxgen at fluxbox dot org)
3//
4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"),
6// to deal in the Software without restriction, including without limitation
7// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8// and/or sell copies of the Software, and to permit persons to whom the
9// Software is furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE.
21
22#ifndef FBTK_ORIENTATION_HH
23#define FBTK_ORIENTATION_HH
24
25namespace FbTk {
26
27enum Justify {LEFT, RIGHT, CENTER};
28
29// clockwise
30enum Orientation { ROT0=0, ROT90, ROT180, ROT270 };
31
32} // end namespace FbTk
33
34#endif // FBTK_ORIENTATION_HH
diff --git a/src/FbTk/TextButton.cc b/src/FbTk/TextButton.cc
index 85ac5c8..5a7afa6 100644
--- a/src/FbTk/TextButton.cc
+++ b/src/FbTk/TextButton.cc
@@ -20,6 +20,7 @@
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22#include "TextButton.hh" 22#include "TextButton.hh"
23#include "TextUtils.hh"
23#include "Font.hh" 24#include "Font.hh"
24#include "GContext.hh" 25#include "GContext.hh"
25 26
diff --git a/src/FbTk/TextButton.hh b/src/FbTk/TextButton.hh
index 50d509b..eb48e61 100644
--- a/src/FbTk/TextButton.hh
+++ b/src/FbTk/TextButton.hh
@@ -23,7 +23,6 @@
23#define FBTK_TEXTBUTTON_HH 23#define FBTK_TEXTBUTTON_HH
24 24
25#include "Button.hh" 25#include "Button.hh"
26#include "Text.hh"
27 26
28#include <string> 27#include <string>
29 28
diff --git a/src/FbTk/TextTheme.hh b/src/FbTk/TextTheme.hh
index 9a83788..02adf92 100644
--- a/src/FbTk/TextTheme.hh
+++ b/src/FbTk/TextTheme.hh
@@ -26,7 +26,7 @@
26#include "Theme.hh" 26#include "Theme.hh"
27#include "Font.hh" 27#include "Font.hh"
28#include "Color.hh" 28#include "Color.hh"
29#include "Text.hh" 29#include "Orientation.hh"
30#include "GContext.hh" 30#include "GContext.hh"
31 31
32namespace FbTk { 32namespace FbTk {
diff --git a/src/FbTk/Text.cc b/src/FbTk/TextUtils.cc
index 710b48a..2b47531 100644
--- a/src/FbTk/Text.cc
+++ b/src/FbTk/TextUtils.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22#include "Text.hh" 22#include "TextUtils.hh"
23 23
24#include "Font.hh" 24#include "Font.hh"
25#include "Theme.hh" 25#include "Theme.hh"
diff --git a/src/FbTk/Text.hh b/src/FbTk/TextUtils.hh
index 494d365..efb6020 100644
--- a/src/FbTk/Text.hh
+++ b/src/FbTk/TextUtils.hh
@@ -1,4 +1,4 @@
1// Text.hh for FbTk - text utils 1// TextUtils.hh for FbTk - text utils
2// Copyright (c) 2002 - 2003 Henrik Kinnunen (fluxgen at fluxbox dot org) 2// Copyright (c) 2002 - 2003 Henrik Kinnunen (fluxgen at fluxbox dot org)
3// 3//
4// Permission is hereby granted, free of charge, to any person obtaining a 4// Permission is hereby granted, free of charge, to any person obtaining a
@@ -19,17 +19,15 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22#ifndef FBTK_TEXT_HH 22#ifndef FBTK_TEXTUTILS_HH
23#define FBTK_TEXT_HH 23#define FBTK_TEXTUTILS_HH
24
25#include "Orientation.hh"
24 26
25namespace FbTk { 27namespace FbTk {
26 28
27class Font; 29class Font;
28 30
29enum Justify {LEFT, RIGHT, CENTER};
30// clockwise
31enum Orientation { ROT0=0, ROT90, ROT180, ROT270 };
32
33/** 31/**
34 Aligns the text after max width and bevel 32 Aligns the text after max width and bevel
35 */ 33 */
@@ -132,4 +130,4 @@ inline void translateSize(Orientation orient, unsigned int w, unsigned int h) {
132 130
133} // end namespace FbTk 131} // end namespace FbTk
134 132
135#endif // FBTK_TEXT_HH 133#endif // FBTK_TEXTUTILS_HH
diff --git a/src/FbTk/TextureRender.cc b/src/FbTk/TextureRender.cc
index c7c29c1..a4bb50c 100644
--- a/src/FbTk/TextureRender.cc
+++ b/src/FbTk/TextureRender.cc
@@ -25,6 +25,7 @@
25#include "TextureRender.hh" 25#include "TextureRender.hh"
26 26
27#include "ImageControl.hh" 27#include "ImageControl.hh"
28#include "TextUtils.hh"
28#include "Texture.hh" 29#include "Texture.hh"
29#include "App.hh" 30#include "App.hh"
30#include "FbPixmap.hh" 31#include "FbPixmap.hh"
diff --git a/src/FbTk/TextureRender.hh b/src/FbTk/TextureRender.hh
index ab03252..cfedba5 100644
--- a/src/FbTk/TextureRender.hh
+++ b/src/FbTk/TextureRender.hh
@@ -25,7 +25,7 @@
25#ifndef FBTK_TEXTURRENDER_HH 25#ifndef FBTK_TEXTURRENDER_HH
26#define FBTK_TEXTURRENDER_HH 26#define FBTK_TEXTURRENDER_HH
27 27
28#include "Text.hh" 28#include "Orientation.hh"
29 29
30#include <X11/Xlib.h> 30#include <X11/Xlib.h>
31 31
diff --git a/src/FbTk/XmbFontImp.cc b/src/FbTk/XmbFontImp.cc
index 8ef0fbc..e05609c 100644
--- a/src/FbTk/XmbFontImp.cc
+++ b/src/FbTk/XmbFontImp.cc
@@ -22,6 +22,7 @@
22#include "XmbFontImp.hh" 22#include "XmbFontImp.hh"
23 23
24#include "App.hh" 24#include "App.hh"
25#include "TextUtils.hh"
25#include "StringUtil.hh" 26#include "StringUtil.hh"
26#include "FbPixmap.hh" 27#include "FbPixmap.hh"
27#include "GContext.hh" 28#include "GContext.hh"
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index ea1236a..234364e 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -28,6 +28,7 @@
28#include "FbTk/Compose.hh" 28#include "FbTk/Compose.hh"
29#include "FbTk/Transparent.hh" 29#include "FbTk/Transparent.hh"
30#include "FbTk/CompareEqual.hh" 30#include "FbTk/CompareEqual.hh"
31#include "FbTk/TextUtils.hh"
31 32
32#include "FbWinFrameTheme.hh" 33#include "FbWinFrameTheme.hh"
33#include "Screen.hh" 34#include "Screen.hh"
diff --git a/src/IconButton.cc b/src/IconButton.cc
index 2df741a..09791c8 100644
--- a/src/IconButton.cc
+++ b/src/IconButton.cc
@@ -30,6 +30,7 @@
30#include "FbTk/Command.hh" 30#include "FbTk/Command.hh"
31#include "FbTk/EventManager.hh" 31#include "FbTk/EventManager.hh"
32#include "FbTk/ImageControl.hh" 32#include "FbTk/ImageControl.hh"
33#include "FbTk/TextUtils.hh"
33#include "FbTk/MacroCommand.hh" 34#include "FbTk/MacroCommand.hh"
34#include "FbTk/Menu.hh" 35#include "FbTk/Menu.hh"
35#include "FbTk/RefCount.hh" 36#include "FbTk/RefCount.hh"
diff --git a/src/SystemTray.cc b/src/SystemTray.cc
index 5ba89c3..5aa7323 100644
--- a/src/SystemTray.cc
+++ b/src/SystemTray.cc
@@ -23,6 +23,7 @@
23 23
24#include "FbTk/EventManager.hh" 24#include "FbTk/EventManager.hh"
25#include "FbTk/ImageControl.hh" 25#include "FbTk/ImageControl.hh"
26#include "FbTk/TextUtils.hh"
26 27
27#include "AtomHandler.hh" 28#include "AtomHandler.hh"
28#include "fluxbox.hh" 29#include "fluxbox.hh"
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 18f07fc..89ec898 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -45,6 +45,7 @@
45 45
46#include "FbTk/I18n.hh" 46#include "FbTk/I18n.hh"
47#include "FbTk/ImageControl.hh" 47#include "FbTk/ImageControl.hh"
48#include "FbTk/TextUtils.hh"
48#include "FbTk/MacroCommand.hh" 49#include "FbTk/MacroCommand.hh"
49#include "FbTk/EventManager.hh" 50#include "FbTk/EventManager.hh"
50#include "FbTk/SimpleCommand.hh" 51#include "FbTk/SimpleCommand.hh"
diff --git a/src/ToolbarItem.hh b/src/ToolbarItem.hh
index c4327b2..4a92c97 100644
--- a/src/ToolbarItem.hh
+++ b/src/ToolbarItem.hh
@@ -24,7 +24,7 @@
24#define TOOLBARITEM_HH 24#define TOOLBARITEM_HH
25 25
26#include "FbTk/Subject.hh" 26#include "FbTk/Subject.hh"
27#include "FbTk/Text.hh" // orientation 27#include "FbTk/Orientation.hh"
28 28
29/// An item in the toolbar that has either fixed or relative size to the toolbar 29/// An item in the toolbar that has either fixed or relative size to the toolbar
30class ToolbarItem { 30class ToolbarItem {