diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-08-15 21:03:57 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2013-02-18 21:04:26 (GMT) |
commit | cab5fa69f059033c4e304076f1892d9cf7c84031 (patch) | |
tree | dd56d66c9f19dbdc606c144e8c6af2a6a444c324 /src/Resources.cc | |
parent | a897844ea1cfa6303112fd3f0d472d3e135bdc6d (diff) | |
download | fluxbox_pavel-cab5fa69f059033c4e304076f1892d9cf7c84031.zip fluxbox_pavel-cab5fa69f059033c4e304076f1892d9cf7c84031.tar.bz2 |
Move declarations of Resource enums to a separate file
The reason for this is that I need to access those enums from fluxbox-update_configs and I don't
want to #include and link everything in src.
I also merged Slit::Placement, Toolbar::Placement and FbWinFrame::TabPlacement into one enum.
Diffstat (limited to 'src/Resources.cc')
-rw-r--r-- | src/Resources.cc | 141 |
1 files changed, 104 insertions, 37 deletions
diff --git a/src/Resources.cc b/src/Resources.cc index 2cae2b6..cbcc431 100644 --- a/src/Resources.cc +++ b/src/Resources.cc | |||
@@ -21,14 +21,12 @@ | |||
21 | 21 | ||
22 | // holds main resource functions | 22 | // holds main resource functions |
23 | 23 | ||
24 | #include "Resources.hh" | ||
25 | |||
26 | #include "FbTk/Container.hh" | ||
24 | #include "FbTk/StringUtil.hh" | 27 | #include "FbTk/StringUtil.hh" |
25 | #include "FbTk/Resource.hh" | 28 | #include "FbTk/Resource.hh" |
26 | #include "FbTk/Luamm.hh" | 29 | #include "FbTk/Luamm.hh" |
27 | #include "WinButton.hh" | ||
28 | |||
29 | #include "fluxbox.hh" | ||
30 | |||
31 | #include "Layer.hh" | ||
32 | 30 | ||
33 | #include <stdio.h> | 31 | #include <stdio.h> |
34 | #include <string> | 32 | #include <string> |
@@ -42,47 +40,116 @@ | |||
42 | using std::string; | 40 | using std::string; |
43 | using std::vector; | 41 | using std::vector; |
44 | 42 | ||
45 | //----------------------------------------------------------------- | 43 | //-------------------------------------------------- |
46 | //---- accessors for int, bool, and some enums with Resource ------ | 44 | //---- accessors for some enums with Resource ------ |
47 | //----------------------------------------------------------------- | 45 | //-------------------------------------------------- |
48 | namespace FbTk { | 46 | namespace FbTk { |
49 | 47 | ||
50 | template<> | 48 | template<> |
51 | const EnumTraits<WinButton::Type>::Pair EnumTraits<WinButton::Type>::s_map[] = { | 49 | const EnumTraits<WinButtonType>::Pair EnumTraits<WinButtonType>::s_map[] = { |
52 | { "Shade", WinButton::SHADE }, | 50 | { "Shade", SHADEBUTTON }, |
53 | { "Minimize", WinButton::MINIMIZE }, | 51 | { "Minimize", MINIMIZEBUTTON }, |
54 | { "Maximize", WinButton::MAXIMIZE }, | 52 | { "Maximize", MAXIMIZEBUTTON }, |
55 | { "Close", WinButton::CLOSE }, | 53 | { "Close", CLOSEBUTTON }, |
56 | { "Stick", WinButton::STICK }, | 54 | { "Stick", STICKBUTTON }, |
57 | { "MenuIcon", WinButton::MENUICON }, | 55 | { "MenuIcon", MENUICONBUTTON }, |
58 | { "LHalf", WinButton::LEFT_HALF }, | 56 | { "LHalf", LEFT_HALFBUTTON }, |
59 | { "RHalf", WinButton::RIGHT_HALF }, | 57 | { "RHalf", RIGHT_HALFBUTTON }, |
60 | { NULL, WinButton::MENUICON } | 58 | { NULL, MENUICONBUTTON } |
59 | }; | ||
60 | |||
61 | template<> | ||
62 | const EnumTraits<TabsAttachArea>::Pair EnumTraits<TabsAttachArea>::s_map[] = { | ||
63 | { "Titlebar", ATTACH_AREA_TITLEBAR }, | ||
64 | { "Window", ATTACH_AREA_WINDOW }, | ||
65 | { NULL, ATTACH_AREA_WINDOW } | ||
66 | }; | ||
67 | |||
68 | template<> | ||
69 | const EnumTraits<LayerType>::Pair EnumTraits<LayerType>::s_map[] = { | ||
70 | { "Menu", LAYERMENU }, | ||
71 | { "1", LAYER1 }, | ||
72 | { "AboveDock",LAYERABOVE_DOCK }, | ||
73 | { "3", LAYER3 }, | ||
74 | { "Dock", LAYERDOCK }, | ||
75 | { "5", LAYER5 }, | ||
76 | { "Top", LAYERTOP }, | ||
77 | { "7", LAYER7 }, | ||
78 | { "Normal", LAYERNORMAL }, | ||
79 | { "9", LAYER9 }, | ||
80 | { "Bottom", LAYERBOTTOM }, | ||
81 | { "11", LAYER11 }, | ||
82 | { "Desktop", LAYERDESKTOP }, | ||
83 | { NULL, LAYERDESKTOP } | ||
84 | }; | ||
85 | |||
86 | template<> | ||
87 | const EnumTraits<Container::Alignment>::Pair EnumTraits<Container::Alignment>::s_map[] = { | ||
88 | { "Left", Container::LEFT }, | ||
89 | { "Right", Container::RIGHT }, | ||
90 | { "Relative", Container::RELATIVE }, | ||
91 | { NULL, Container::RELATIVE } | ||
92 | }; | ||
93 | |||
94 | template<> | ||
95 | const EnumTraits<Placement>::Pair EnumTraits<Placement>::s_map[] = { | ||
96 | { "TopLeft", TOPLEFT }, | ||
97 | { "TopCenter", TOPCENTER }, | ||
98 | { "TopRight", TOPRIGHT }, | ||
99 | { "BottomLeft", BOTTOMLEFT }, | ||
100 | { "BottomCenter", BOTTOMCENTER }, | ||
101 | { "BottomRight", BOTTOMRIGHT }, | ||
102 | { "LeftBottom", LEFTBOTTOM }, | ||
103 | { "LeftCenter", LEFTCENTER }, | ||
104 | { "LeftTop", LEFTTOP }, | ||
105 | { "RightBottom", RIGHTBOTTOM }, | ||
106 | { "RightCenter", RIGHTCENTER }, | ||
107 | { "RightTop", RIGHTTOP }, | ||
108 | { "Top", TOPCENTER }, | ||
109 | { "Bottom", BOTTOMCENTER }, | ||
110 | { "Left", LEFTCENTER }, | ||
111 | { "Right", RIGHTCENTER }, | ||
112 | { NULL, RIGHTTOP } | ||
113 | }; | ||
114 | |||
115 | template <> | ||
116 | const EnumTraits<PlacementPolicy>::Pair EnumTraits<PlacementPolicy>::s_map[] = { | ||
117 | { "RowSmartPlacement", ROWSMARTPLACEMENT }, | ||
118 | { "ColSmartPlacement", COLSMARTPLACEMENT }, | ||
119 | { "RowMinOverlapPlacement", ROWMINOVERLAPPLACEMENT }, | ||
120 | { "ColMinOverlapPlacement", COLMINOVERLAPPLACEMENT }, | ||
121 | { "UnderMousePlacement", UNDERMOUSEPLACEMENT }, | ||
122 | { "CascadePlacement", CASCADEPLACEMENT }, | ||
123 | { NULL, CASCADEPLACEMENT } | ||
124 | }; | ||
125 | |||
126 | template <> | ||
127 | const EnumTraits<RowDirection>::Pair EnumTraits<RowDirection>::s_map[] = { | ||
128 | { "LeftToRight", LEFTRIGHTDIRECTION }, | ||
129 | { "RightToLeft", RIGHTLEFTDIRECTION }, | ||
130 | { NULL, RIGHTLEFTDIRECTION }, | ||
131 | }; | ||
132 | |||
133 | template <> | ||
134 | const EnumTraits<ColumnDirection>::Pair EnumTraits<ColumnDirection>::s_map[] = { | ||
135 | { "TopToBottom", TOPBOTTOMDIRECTION }, | ||
136 | { "BottomToTop", BOTTOMTOPDIRECTION }, | ||
137 | { NULL, BOTTOMTOPDIRECTION }, | ||
61 | }; | 138 | }; |
62 | 139 | ||
63 | template<> | 140 | template<> |
64 | const EnumTraits<Fluxbox::TabsAttachArea>::Pair EnumTraits<Fluxbox::TabsAttachArea>::s_map[] = { | 141 | const EnumTraits<FocusModel>::Pair EnumTraits<FocusModel>::s_map[] = { |
65 | { "Titlebar", Fluxbox::ATTACH_AREA_TITLEBAR }, | 142 | { "MouseFocus", MOUSEFOCUS }, |
66 | { "Window", Fluxbox::ATTACH_AREA_WINDOW }, | 143 | { "StrictMouseFocus", STRICTMOUSEFOCUS }, |
67 | { NULL, Fluxbox::ATTACH_AREA_WINDOW } | 144 | { "ClickFocus", CLICKFOCUS }, |
145 | { NULL, CLICKFOCUS } | ||
68 | }; | 146 | }; |
69 | 147 | ||
70 | template<> | 148 | template<> |
71 | const EnumTraits<ResourceLayer::Type>::Pair EnumTraits<ResourceLayer::Type>::s_map[] = { | 149 | const EnumTraits<TabFocusModel>::Pair EnumTraits<TabFocusModel>::s_map[] = { |
72 | { "Menu", ResourceLayer::MENU }, | 150 | { "SloppyTabFocus", MOUSETABFOCUS }, |
73 | { "1", ResourceLayer::LAYER1 }, | 151 | { "ClickToTabFocus", CLICKTABFOCUS }, |
74 | { "AboveDock",ResourceLayer::ABOVE_DOCK }, | 152 | { NULL, CLICKTABFOCUS } |
75 | { "3", ResourceLayer::LAYER3 }, | ||
76 | { "Dock", ResourceLayer::DOCK }, | ||
77 | { "5", ResourceLayer::LAYER5 }, | ||
78 | { "Top", ResourceLayer::TOP }, | ||
79 | { "7", ResourceLayer::LAYER7 }, | ||
80 | { "Normal", ResourceLayer::NORMAL }, | ||
81 | { "9", ResourceLayer::LAYER9 }, | ||
82 | { "Bottom", ResourceLayer::BOTTOM }, | ||
83 | { "11", ResourceLayer::LAYER11 }, | ||
84 | { "Desktop", ResourceLayer::DESKTOP }, | ||
85 | { NULL, ResourceLayer::DESKTOP } | ||
86 | }; | 153 | }; |
87 | 154 | ||
88 | } // end namespace FbTk | 155 | } // end namespace FbTk |