aboutsummaryrefslogtreecommitdiff
path: root/src/MenuCreator.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2007-12-28 05:52:00 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2007-12-28 05:52:00 (GMT)
commit39224b0142078376d2bd39789b4de24a18377cf0 (patch)
tree874755d12b5f0ae395ebc3eae29697237667cd31 /src/MenuCreator.cc
parente8a2f155e8d5a082a8c04f291e65c137c20a05cb (diff)
downloadfluxbox-39224b0142078376d2bd39789b4de24a18377cf0.zip
fluxbox-39224b0142078376d2bd39789b4de24a18377cf0.tar.bz2
move Parser to FbTk
Diffstat (limited to 'src/MenuCreator.cc')
-rw-r--r--src/MenuCreator.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc
index df6f829..d68b6fd 100644
--- a/src/MenuCreator.cc
+++ b/src/MenuCreator.cc
@@ -143,7 +143,7 @@ class ParseItem {
143public: 143public:
144 explicit ParseItem(FbTk::Menu *menu):m_menu(menu) {} 144 explicit ParseItem(FbTk::Menu *menu):m_menu(menu) {}
145 145
146 inline void load(Parser &p, FbTk::StringConvertor &m_labelconvertor) { 146 inline void load(FbTk::Parser &p, FbTk::StringConvertor &m_labelconvertor) {
147 p>>m_key>>m_label>>m_cmd>>m_icon; 147 p>>m_key>>m_label>>m_cmd>>m_icon;
148 m_label.second = m_labelconvertor.recode(m_label.second); 148 m_label.second = m_labelconvertor.recode(m_label.second);
149 } 149 }
@@ -153,7 +153,7 @@ public:
153 inline const string &key() const { return m_key.second; } 153 inline const string &key() const { return m_key.second; }
154 inline FbTk::Menu *menu() { return m_menu; } 154 inline FbTk::Menu *menu() { return m_menu; }
155private: 155private:
156 Parser::Item m_key, m_label, m_cmd, m_icon; 156 FbTk::Parser::Item m_key, m_label, m_cmd, m_icon;
157 FbTk::Menu *m_menu; 157 FbTk::Menu *m_menu;
158}; 158};
159 159
@@ -172,10 +172,10 @@ public:
172 172
173}; 173};
174 174
175static void translateMenuItem(Parser &parse, ParseItem &item, FbTk::StringConvertor &labelconvertor); 175static void translateMenuItem(FbTk::Parser &parse, ParseItem &item, FbTk::StringConvertor &labelconvertor);
176 176
177 177
178static void parseMenu(Parser &pars, FbTk::Menu &menu, FbTk::StringConvertor &label_convertor) { 178static void parseMenu(FbTk::Parser &pars, FbTk::Menu &menu, FbTk::StringConvertor &label_convertor) {
179 ParseItem pitem(&menu); 179 ParseItem pitem(&menu);
180 while (!pars.eof()) { 180 while (!pars.eof()) {
181 pitem.load(pars, label_convertor); 181 pitem.load(pars, label_convertor);
@@ -185,7 +185,7 @@ static void parseMenu(Parser &pars, FbTk::Menu &menu, FbTk::StringConvertor &lab
185 } 185 }
186} 186}
187 187
188static void translateMenuItem(Parser &parse, ParseItem &pitem, FbTk::StringConvertor &labelconvertor) { 188static void translateMenuItem(FbTk::Parser &parse, ParseItem &pitem, FbTk::StringConvertor &labelconvertor) {
189 if (pitem.menu() == 0) 189 if (pitem.menu() == 0)
190 throw string("translateMenuItem: We must have a menu in ParseItem!"); 190 throw string("translateMenuItem: We must have a menu in ParseItem!");
191 191
@@ -315,8 +315,8 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem, FbTk::StringConve
315 } else if (str_key == "endencoding") { 315 } else if (str_key == "endencoding") {
316 MenuCreator::endEncoding(); 316 MenuCreator::endEncoding();
317 } 317 }
318 else { // ok, if we didn't find any special menu item we try with command parser 318 else { // ok, if we didn't find any special menu item we try with command FbTk::Parser
319 // we need to attach command with arguments so command parser can parse it 319 // we need to attach command with arguments so command FbTk::Parser can parse it
320 string line = str_key + " " + str_cmd; 320 string line = str_key + " " + str_cmd;
321 FbTk::RefCount<FbTk::Command> command(FbTk::ObjectRegistry<FbTk::Command>::instance().parse(line)); 321 FbTk::RefCount<FbTk::Command> command(FbTk::ObjectRegistry<FbTk::Command>::instance().parse(line));
322 if (*command != 0) { 322 if (*command != 0) {
@@ -341,7 +341,7 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem, FbTk::StringConve
341} 341}
342 342
343 343
344static void parseWindowMenu(Parser &parse, FbTk::Menu &menu, FbTk::StringConvertor &labelconvertor) { 344static void parseWindowMenu(FbTk::Parser &parse, FbTk::Menu &menu, FbTk::StringConvertor &labelconvertor) {
345 345
346 ParseItem pitem(&menu); 346 ParseItem pitem(&menu);
347 while (!parse.eof()) { 347 while (!parse.eof()) {