OpenASIP  2.0
GUIOptionsSerializer.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file GUIOptionsSerializer.cc
26  *
27  * Implementation of GUIOptionsSerializer class.
28  *
29  * @author Lasse Laasonen 2004 (lasse.laasonen-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #include "Application.hh"
34 #include "GUIOptionsSerializer.hh"
35 #include "KeyboardShortcut.hh"
36 #include "Conversion.hh"
37 #include "GUIOptions.hh"
38 #include "ObjectState.hh"
39 
40 using std::string;
41 
42 /// Name of the element containing window declaration.
43 const string WINDOW = "window";
44 /// Name of the full-screen element inside window element.
45 const string WI_FULLSCREEN = "full-screen";
46 /// Name of the element declaring window width.
47 const string WI_WIDTH = "width";
48 /// Name of the element declaring window height.
49 const string WI_HEIGHT = "height";
50 /// Name of the element declaring x position of the window.
51 const string WI_X_POSITION = "x-position";
52 /// Name of the element declaring y position of the window.
53 const string WI_Y_POSITION = "y-position";
54 /// Name of the element containing toolbar declaration.
55 const string TOOLBAR = "toolbar";
56 /// Name of the element containing toolbar layout declaration.
57 const string TB_LAYOUT = "layout";
58 /// Name of the text element inside layout element.
59 const string TB_LA_TEXT = "text";
60 /// Name of the icon element insie layout element.
61 const string TB_LA_ICON = "icon";
62 /// Name of the element declaring toolbar visibility.
63 const string TB_VISIBLE = "visible";
64 /// Value used for true in attribute and element values.
65 const string TRUE = "true";
66 /// Value used for false in attribute and element values.
67 const string FALSE = "false";
68 /// Name of the element declaring a toolbar button.
69 const string TB_SLOT = "slot";
70 /// Name of the attribute of the slot element.
71 const string SLOT_POSITION = "position";
72 /// Name of the element declaring action name inside slot element.
73 const string TB_SLOT_ACTION = "action";
74 /// Name of the element declaring a toolbar separator.
75 const string TB_SEPARATOR = "separator";
76 /// Name of the attribute of the separator element.
77 const string SEPARATOR_POSITION = "position";
78 /// Name of the element declaring a keyboard shortcut.
79 const string KEYBOARD_SHORTCUT = "keyboard-shortcut";
80 /// Name of the element declaring key combination.
81 const string KS_KEY_COMBINATION = "key-combination";
82 /// Name of the element meaning ctrl key in key combination.
83 const string KEY_COMB_CTRL = "ctrl";
84 /// Name of the element meaning alt key in key combination.
85 const string KEY_COMB_ALT = "alt";
86 /// Name of the element meaning some function key in key combination.
87 const string KEY_COMB_FKEY = "F-key";
88 /// Name of the attribute declaring function key number.
89 const string FKEY_NUMBER = "number";
90 /// Name of the element meaning some other key in key combination.
91 const string KEY_COMB_KEY = "key";
92 /// Name of the attribute which declares the actual key of the key element.
93 const string KEY_VALUE = "value";
94 /// Name of the element declaring the action performed by the keyboard shortcut
95 const string KS_ACTION = "action";
96 
97 /// Default window width.
98 const int DEFAULT_WIDTH = 600;
99 /// Default window height.
100 const int DEFAULT_HEIGHT = 500;
101 /// Default x position.
102 const int DEFAULT_X_POS = 0;
103 /// Default y position.
104 const int DEFAULT_Y_POS = 0;
105 /// String to mean delete key.
106 const string DELETE_KEY = "del";
107 
108 /**
109  * Constructor.
110  *
111  * @param name Name of the configuration.
112  */
114  XMLSerializer(),
115  configurationName_(name) {
116 }
117 
118 
119 /**
120  * Destructor.
121  */
123 }
124 
125 
126 /**
127  * Serializes the given ObjectState tree created by GUIOptions::saveState
128  * to an XML file.
129  *
130  * @param optionsState ObjectState tree created by GUIOptions::saveState.
131  * @exception SerializerException If the current destination file cannot be
132  * written.
133  */
134 void
136  ObjectState* converted = convertToConfigFileFormat(optionsState);
137  XMLSerializer::writeState(converted);
138  delete converted;
139 }
140 
141 /**
142  * Reads the options from the current XML file set and creates an
143  * ObjectState tree which can be read by GUIOptions::loadState.
144  *
145  * @return The newly created ObjectState tree.
146  * @exception SerializerException If an error occurs while reading the file.
147  */
151  ObjectState* converted = convertToOptionsObjectFormat(state);
152  delete state;
153  return converted;
154 }
155 
156 /**
157  * Serializes the given options to the file set.
158  *
159  * @param options The options to be serialized.
160  * @exception SerializerException If an error occurs while serializing.
161  */
162 void
164  ObjectState* optionsState = options.saveState();
165  writeState(optionsState);
166  delete optionsState;
167 }
168 
169 /**
170  * Reads the current input file and creates GUIOptions according to it.
171  *
172  * @return The newly created GUIOptions instance.
173  * @exception SerializerException If an error occurs while reading the file.
174  * @exception ObjectStateLoadingException If an error occurs while creating
175  * options.
176  */
177 GUIOptions*
179  ObjectState* optionsState = readState();
180  GUIOptions* options = new GUIOptions(optionsState);
181  delete optionsState;
182  return options;
183 }
184 
185 /**
186  * Converts the given ObjectState tree created by GUIOptions::saveState
187  * to the format of configuration file.
188  *
189  * @param options ObjectState tree to be converted.
190  * @return The newly created ObjectState tree which matches with
191  * configuration file format.
192  */
195  const ObjectState* options) const {
196 
198 
199  // add window element
200  ObjectState* window = new ObjectState(WINDOW);
201  root->addChild(window);
202 
203  ObjectState* fullScreen = new ObjectState(WI_FULLSCREEN);
204  window->addChild(fullScreen);
205  if (options->intAttribute(GUIOptions::OSKEY_FULL_SCREEN)) {
206  fullScreen->setValue(TRUE);
207  } else {
208  fullScreen->setValue(FALSE);
209  }
210 
211  ObjectState* width = new ObjectState(WI_WIDTH);
212  window->addChild(width);
213  width->setValue(options->stringAttribute(GUIOptions::OSKEY_WINDOW_WIDTH));
214 
215  ObjectState* height = new ObjectState(WI_HEIGHT);
216  window->addChild(height);
217  height->setValue(
218  options->stringAttribute(GUIOptions::OSKEY_WINDOW_HEIGHT));
219 
221  window->addChild(xPos);
222  xPos->setValue(options->stringAttribute(GUIOptions::OSKEY_X_POS));
223 
225  window->addChild(yPos);
226  yPos->setValue(options->stringAttribute(GUIOptions::OSKEY_Y_POS));
227 
228  // add toolbar element
229  ObjectState* toolbar = new ObjectState(TOOLBAR);
230  root->addChild(toolbar);
231 
232  ObjectState* layout = new ObjectState(TB_LAYOUT);
233  toolbar->addChild(layout);
234 
235  string toolbarLayout = options->
236  stringAttribute(GUIOptions::OSKEY_TOOLBAR_LAYOUT);
237  if (toolbarLayout == GUIOptions::OSVALUE_TEXT) {
238  layout->addChild(new ObjectState(TB_LA_TEXT));
239  } else if (toolbarLayout == GUIOptions::OSVALUE_ICON) {
240  layout->addChild(new ObjectState(TB_LA_ICON));
241  } else {
242  layout->addChild(new ObjectState(TB_LA_TEXT));
243  layout->addChild(new ObjectState(TB_LA_ICON));
244  }
245 
246  ObjectState* visible = new ObjectState(TB_VISIBLE);
247  toolbar->addChild(visible);
248  int vis =
250  if (vis) {
251  visible->setValue(TRUE);
252  } else {
253  visible->setValue(FALSE);
254  }
255 
256  // add toolbar buttons
257  for (int i = 0; i < options->childCount(); i++) {
258  ObjectState* child = options->child(i);
259  if (child->name() == ToolbarButton::OSNAME_TOOLBAR_BUTTON) {
260  ObjectState* slot = new ObjectState(TB_SLOT);
261  toolbar->addChild(slot);
263  child->stringAttribute(
265  ObjectState* action = new ObjectState(TB_SLOT_ACTION);
266  slot->addChild(action);
267  action->setValue(child->stringAttribute(
269  }
270  }
271 
272  // add toolbar separators
273  for (int i = 0; i < options->childCount(); i++) {
274  ObjectState* child = options->child(i);
275  if (child->name() == GUIOptions::OSNAME_SEPARATOR) {
276  ObjectState* separator = new ObjectState(TB_SEPARATOR);
277  toolbar->addChild(separator);
278  separator->setAttribute(SEPARATOR_POSITION,
279  child->stringAttribute(
281  }
282  }
283 
284  // add keyboard shortcuts
285  for (int i = 0; i < options->childCount(); i++) {
286  ObjectState* child = options->child(i);
287  if (child->name() !=
289  continue;
290  }
292  root->addChild(sc);
294  sc->addChild(keyComb);
295 
297  keyComb->addChild(new ObjectState(KEY_COMB_CTRL));
298  }
300  keyComb->addChild(new ObjectState(KEY_COMB_ALT));
301  }
304  keyComb->addChild(fKey);
306  child->stringAttribute(
308  }
311  keyComb->addChild(key);
312  char charKey = child->intAttribute(
314  string stringKey;
315 
316  // check if key is 'del'
317  if (charKey == 127) {
318  stringKey = DELETE_KEY;
319  } else {
320  stringKey = Conversion::toString(charKey);
321  }
322 
323  key->setAttribute(KEY_VALUE, stringKey);
324  }
325  ObjectState* action = new ObjectState(KS_ACTION);
326  sc->addChild(action);
327  action->setValue(child->stringAttribute(
329  }
330 
331  return root;
332 }
333 
334 
335 /**
336  * Creates a new ObjectState tree which can be given to GUIOptions
337  * constructor. The tree is created according to the given tree which matches
338  * with the syntax of the options file.
339  *
340  * @param root Root node of the ObjectState tree to be converted.
341  */
344  const ObjectState* root) const {
345 
347 
348  // set window properties
349  if (root->hasChild(WINDOW)) {
350  ObjectState* window = root->childByName(WINDOW);
351  setWindowProperties(window, options);
352  } else {
353  options->setAttribute(GUIOptions::OSKEY_FULL_SCREEN, true);
358  }
359 
360  // set toolbar properties
361  if (root->hasChild(TOOLBAR)) {
362  ObjectState* toolbar = root->childByName(TOOLBAR);
363  setToolbarProperties(toolbar, options);
364  } else {
365  options->setAttribute(GUIOptions::OSKEY_TOOLBAR_VISIBILITY, false);
368  }
369 
370  // set keyboard shortcuts
371  for (int i = 0; i < root->childCount(); i++) {
372  ObjectState* child = root->child(i);
373  if (child->name() == KEYBOARD_SHORTCUT) {
375  }
376  }
377 
378  return options;
379 }
380 
381 
382 /**
383  * Sets the window properties for the given options according to the given
384  * window element.
385  *
386  * @param windowElem ObjectState representing window element in options file.
387  * @param options Options ObjectState which is modified.
388  */
389 void
391  const ObjectState* windowElem,
392  ObjectState* options) const {
393 
394  ObjectState* fullscreenElem = windowElem->childByName(WI_FULLSCREEN);
395  if (fullscreenElem->stringValue() == TRUE) {
396  options->setAttribute(GUIOptions::OSKEY_FULL_SCREEN, true);
397  } else if (fullscreenElem->stringValue() == FALSE) {
398  options->setAttribute(GUIOptions::OSKEY_FULL_SCREEN, false);
399  } else {
400  assert(false);
401  }
402 
403  ObjectState* widthElem = windowElem->childByName(WI_WIDTH);
405  widthElem->stringValue());
406 
407  ObjectState* heightElem = windowElem->childByName(WI_HEIGHT);
409  heightElem->stringValue());
410 
411  ObjectState* xPosElem = windowElem->childByName(WI_X_POSITION);
412  options->setAttribute(GUIOptions::OSKEY_X_POS,
413  xPosElem->stringValue());
414 
415  ObjectState* yPosElem = windowElem->childByName(WI_Y_POSITION);
416  options->setAttribute(GUIOptions::OSKEY_Y_POS,
417  yPosElem->stringValue());
418 }
419 
420 
421 /**
422  * Sets the toolbar properties for the given options according to the given
423  * toolbar element.
424  *
425  * @param toolbarElem ObjectState representing toolbar element in options
426  * file.
427  * @param options Options ObjectState which is modified.
428  */
429 void
431  const ObjectState* toolbarElem,
432  ObjectState* options) const {
433 
434  // set layout
435  ObjectState* layoutElem = toolbarElem->childByName(TB_LAYOUT);
436  if (layoutElem->hasChild(TB_LA_TEXT) &&
437  layoutElem->hasChild(TB_LA_ICON)) {
440  } else if (layoutElem->hasChild(TB_LA_TEXT)) {
443  } else if (layoutElem->hasChild(TB_LA_ICON)) {
446  } else {
447  assert(false);
448  }
449 
450  // set visibility
451  ObjectState* visibleElem = toolbarElem->childByName(TB_VISIBLE);
452  if (visibleElem->stringValue() == TRUE) {
454  true);
455  } else if (visibleElem->stringValue() == FALSE) {
457  false);
458  }
459 
460  // set buttons and separators
461  for (int i = 0; i < toolbarElem->childCount(); i++) {
462  ObjectState* child = toolbarElem->child(i);
463  if (child->name() == TB_SLOT) {
464  ObjectState* button = new ObjectState(
466  options->addChild(button);
467 
468  string slot = child->stringAttribute(SLOT_POSITION);
470 
471  ObjectState* action = child->childByName(TB_SLOT_ACTION);
472  string actionString = action->stringValue();
473  button->setAttribute(ToolbarButton::OSKEY_ACTION, actionString);
474 
475  } else if (child->name() == TB_SEPARATOR) {
476  ObjectState* separator =
478  options->addChild(separator);
479  string position = child->stringAttribute(SEPARATOR_POSITION);
480  separator->setAttribute(GUIOptions::OSKEY_POSITION, position);
481  }
482  }
483 }
484 
485 
486 /**
487  * Adds a keyboard shortcut to the given options according to the given
488  * keyboard-shortcut element.
489  *
490  * @param ksElem ObjectState representing a keyboard-shortcut element in
491  * options file.
492  * @param options Options ObjectState which is modified.
493  */
494 void
496  const ObjectState* ksElem,
497  ObjectState* options) const {
498 
499  ObjectState* shortcut =
501  options->addChild(shortcut);
502 
503  ObjectState* keyCombElem = ksElem->childByName(KS_KEY_COMBINATION);
504  if (keyCombElem->hasChild(KEY_COMB_CTRL)) {
506  } else {
507  shortcut->setAttribute(KeyboardShortcut::OSKEY_CTRL, false);
508  }
509 
510  if (keyCombElem->hasChild(KEY_COMB_ALT)) {
511  shortcut->setAttribute(KeyboardShortcut::OSKEY_ALT, true);
512  } else {
513  shortcut->setAttribute(KeyboardShortcut::OSKEY_ALT, false);
514  }
515 
516  if (keyCombElem->hasChild(KEY_COMB_KEY)) {
517  ObjectState* keyElem = keyCombElem->childByName(KEY_COMB_KEY);
518  string key = keyElem->stringAttribute(KEY_VALUE);
519  char keyChar = 0;
520 
521  // delete key requires extra checking
522  if (key == DELETE_KEY) {
523  keyChar = 127; // ASCII 127 = DEL
524  } else {
525  keyChar = *(key.c_str());
526  }
527 
528  shortcut->setAttribute(KeyboardShortcut::OSKEY_KEY, keyChar);
529  }
530 
531  if (keyCombElem->hasChild(KEY_COMB_FKEY)) {
532  ObjectState* fKeyElem = keyCombElem->childByName(KEY_COMB_FKEY);
533  int number = fKeyElem->intAttribute(FKEY_NUMBER);
534  shortcut->setAttribute(KeyboardShortcut::OSKEY_FKEY, number);
535  }
536 
537  ObjectState* actionElem = ksElem->childByName(KS_ACTION);
538  string action = actionElem->stringValue();
539  shortcut->setAttribute(KeyboardShortcut::OSKEY_ACTION, action);
540 }
GUIOptions::OSNAME_SEPARATOR
static const std::string OSNAME_SEPARATOR
ObjectState name for separator.
Definition: GUIOptions.hh:151
GUIOptions::OSNAME_OPTIONS
static const std::string OSNAME_OPTIONS
ObjectState name for the options.
Definition: GUIOptions.hh:129
ObjectState::hasAttribute
bool hasAttribute(const std::string &name) const
Definition: ObjectState.cc:205
WI_FULLSCREEN
const string WI_FULLSCREEN
Name of the full-screen element inside window element.
Definition: GUIOptionsSerializer.cc:45
GUIOptionsSerializer::readOptions
GUIOptions * readOptions()
Definition: GUIOptionsSerializer.cc:178
TB_LA_ICON
const string TB_LA_ICON
Name of the icon element insie layout element.
Definition: GUIOptionsSerializer.cc:61
ToolbarButton::OSKEY_ACTION
static const std::string OSKEY_ACTION
ObjectState attribute key for action name.
Definition: ToolbarButton.hh:55
GUIOptionsSerializer::setWindowProperties
void setWindowProperties(const ObjectState *windowElem, ObjectState *options) const
Definition: GUIOptionsSerializer.cc:390
ObjectState::stringAttribute
std::string stringAttribute(const std::string &name) const
Definition: ObjectState.cc:249
KeyboardShortcut::OSKEY_ACTION
static const std::string OSKEY_ACTION
ObjectState attribute key for action name.
Definition: KeyboardShortcut.hh:55
KeyboardShortcut::OSKEY_KEY
static const std::string OSKEY_KEY
ObjectState attribute key for normal letter or number key.
Definition: KeyboardShortcut.hh:63
KeyboardShortcut::OSNAME_KEYBOARD_SHORTCUT
static const std::string OSNAME_KEYBOARD_SHORTCUT
ObjectState name for keyboard shortcut.
Definition: KeyboardShortcut.hh:53
DEFAULT_WIDTH
const int DEFAULT_WIDTH
Default window width.
Definition: GUIOptionsSerializer.cc:98
DELETE_KEY
const string DELETE_KEY
String to mean delete key.
Definition: GUIOptionsSerializer.cc:106
GUIOptions::OSKEY_POSITION
static const std::string OSKEY_POSITION
ObjectState attribute key for separator position.
Definition: GUIOptions.hh:153
WI_X_POSITION
const string WI_X_POSITION
Name of the element declaring x position of the window.
Definition: GUIOptionsSerializer.cc:51
DEFAULT_X_POS
const int DEFAULT_X_POS
Default x position.
Definition: GUIOptionsSerializer.cc:102
GUIOptionsSerializer.hh
TB_SLOT
const string TB_SLOT
Name of the element declaring a toolbar button.
Definition: GUIOptionsSerializer.cc:69
GUIOptions::OSKEY_FULL_SCREEN
static const std::string OSKEY_FULL_SCREEN
ObjectState attribute key for full screen feature.
Definition: GUIOptions.hh:131
GUIOptions.hh
TOOLBAR
const string TOOLBAR
Name of the element containing toolbar declaration.
Definition: GUIOptionsSerializer.cc:55
ObjectState
Definition: ObjectState.hh:59
DEFAULT_HEIGHT
const int DEFAULT_HEIGHT
Default window height.
Definition: GUIOptionsSerializer.cc:100
GUIOptions::OSKEY_TOOLBAR_VISIBILITY
static const std::string OSKEY_TOOLBAR_VISIBILITY
ObjectState attribute key for toolbar visibility.
Definition: GUIOptions.hh:141
KS_ACTION
const string KS_ACTION
Name of the element declaring the action performed by the keyboard shortcut.
Definition: GUIOptionsSerializer.cc:95
TB_SEPARATOR
const string TB_SEPARATOR
Name of the element declaring a toolbar separator.
Definition: GUIOptionsSerializer.cc:75
ToolbarButton::OSNAME_TOOLBAR_BUTTON
static const std::string OSNAME_TOOLBAR_BUTTON
ObjectState name for ToolbarButton.
Definition: ToolbarButton.hh:51
TB_LAYOUT
const string TB_LAYOUT
Name of the element containing toolbar layout declaration.
Definition: GUIOptionsSerializer.cc:57
Conversion::toString
static std::string toString(const T &source)
WI_Y_POSITION
const string WI_Y_POSITION
Name of the element declaring y position of the window.
Definition: GUIOptionsSerializer.cc:53
GUIOptionsSerializer::readState
ObjectState * readState()
Definition: GUIOptionsSerializer.cc:149
ObjectState::childByName
ObjectState * childByName(const std::string &name) const
Definition: ObjectState.cc:443
assert
#define assert(condition)
Definition: Application.hh:86
GUIOptionsSerializer::convertToConfigFileFormat
virtual ObjectState * convertToConfigFileFormat(const ObjectState *options) const
Definition: GUIOptionsSerializer.cc:194
KEY_COMB_ALT
const string KEY_COMB_ALT
Name of the element meaning alt key in key combination.
Definition: GUIOptionsSerializer.cc:85
KeyboardShortcut::OSKEY_ALT
static const std::string OSKEY_ALT
ObjectState attribute key for alt key.
Definition: KeyboardShortcut.hh:61
FKEY_NUMBER
const string FKEY_NUMBER
Name of the attribute declaring function key number.
Definition: GUIOptionsSerializer.cc:89
KeyboardShortcut.hh
KEY_COMB_FKEY
const string KEY_COMB_FKEY
Name of the element meaning some function key in key combination.
Definition: GUIOptionsSerializer.cc:87
TB_SLOT_ACTION
const string TB_SLOT_ACTION
Name of the element declaring action name inside slot element.
Definition: GUIOptionsSerializer.cc:73
GUIOptions::OSKEY_Y_POS
static const std::string OSKEY_Y_POS
ObjectState attribute key for window y position.
Definition: GUIOptions.hh:139
TB_LA_TEXT
const string TB_LA_TEXT
Name of the text element inside layout element.
Definition: GUIOptionsSerializer.cc:59
WI_HEIGHT
const string WI_HEIGHT
Name of the element declaring window height.
Definition: GUIOptionsSerializer.cc:49
Conversion.hh
GUIOptionsSerializer::setToolbarProperties
void setToolbarProperties(const ObjectState *toolbarElem, ObjectState *options) const
Definition: GUIOptionsSerializer.cc:430
XMLSerializer::readState
virtual ObjectState * readState()
Definition: XMLSerializer.cc:200
GUIOptions::OSKEY_WINDOW_HEIGHT
static const std::string OSKEY_WINDOW_HEIGHT
ObjectState attribute key for window height.
Definition: GUIOptions.hh:135
Application.hh
ObjectState.hh
GUIOptions::OSVALUE_ICON
static const std::string OSVALUE_ICON
ObjectState attribute value for icon layout.
Definition: GUIOptions.hh:147
KEY_COMB_KEY
const string KEY_COMB_KEY
Name of the element meaning some other key in key combination.
Definition: GUIOptionsSerializer.cc:91
GUIOptions::OSVALUE_BOTH
static const std::string OSVALUE_BOTH
ObjectState attribute value for text & icon layout.
Definition: GUIOptions.hh:149
ObjectState::child
ObjectState * child(int index) const
Definition: ObjectState.cc:471
ObjectState::addChild
void addChild(ObjectState *child)
Definition: ObjectState.cc:376
KeyboardShortcut::OSKEY_CTRL
static const std::string OSKEY_CTRL
ObjectState attribute key for ctrl key.
Definition: KeyboardShortcut.hh:59
ObjectState::childCount
int childCount() const
GUIOptions::OSKEY_X_POS
static const std::string OSKEY_X_POS
ObjectState attribute key for window x position.
Definition: GUIOptions.hh:137
ObjectState::hasChild
bool hasChild(const std::string &name) const
Definition: ObjectState.cc:358
TRUE
const string TRUE
Value used for true in attribute and element values.
Definition: GUIOptionsSerializer.cc:65
ObjectState::name
std::string name() const
SEPARATOR_POSITION
const string SEPARATOR_POSITION
Name of the attribute of the separator element.
Definition: GUIOptionsSerializer.cc:77
WINDOW
const string WINDOW
Name of the element containing window declaration.
Definition: GUIOptionsSerializer.cc:43
options
static MachInfoCmdLineOptions options
Definition: MachInfo.cc:46
GUIOptions
Definition: GUIOptions.hh:58
WI_WIDTH
const string WI_WIDTH
Name of the element declaring window width.
Definition: GUIOptionsSerializer.cc:47
KeyboardShortcut::OSKEY_FKEY
static const std::string OSKEY_FKEY
ObjectState attribute key for function key number.
Definition: KeyboardShortcut.hh:57
KEY_COMB_CTRL
const string KEY_COMB_CTRL
Name of the element meaning ctrl key in key combination.
Definition: GUIOptionsSerializer.cc:83
ToolbarButton::OSKEY_SLOT
static const std::string OSKEY_SLOT
ObjectState attribute key for slot position.
Definition: ToolbarButton.hh:53
GUIOptions::OSKEY_WINDOW_WIDTH
static const std::string OSKEY_WINDOW_WIDTH
ObjectState attribute key for window width.
Definition: GUIOptions.hh:133
TB_VISIBLE
const string TB_VISIBLE
Name of the element declaring toolbar visibility.
Definition: GUIOptionsSerializer.cc:63
GUIOptionsSerializer::addKeyboardShortcut
void addKeyboardShortcut(const ObjectState *ksElem, ObjectState *options) const
Definition: GUIOptionsSerializer.cc:495
FALSE
const string FALSE
Value used for false in attribute and element values.
Definition: GUIOptionsSerializer.cc:67
GUIOptions::OSVALUE_TEXT
static const std::string OSVALUE_TEXT
ObjectState attribute value for text layout.
Definition: GUIOptions.hh:145
SLOT_POSITION
const string SLOT_POSITION
Name of the attribute of the slot element.
Definition: GUIOptionsSerializer.cc:71
ObjectState::stringValue
std::string stringValue() const
ObjectState::intAttribute
int intAttribute(const std::string &name) const
Definition: ObjectState.cc:276
KEY_VALUE
const string KEY_VALUE
Name of the attribute which declares the actual key of the key element.
Definition: GUIOptionsSerializer.cc:93
GUIOptions::OSKEY_TOOLBAR_LAYOUT
static const std::string OSKEY_TOOLBAR_LAYOUT
ObjectState attribute key for toolbar layout.
Definition: GUIOptions.hh:143
GUIOptionsSerializer::convertToOptionsObjectFormat
virtual ObjectState * convertToOptionsObjectFormat(const ObjectState *root) const
Definition: GUIOptionsSerializer.cc:343
GUIOptionsSerializer::writeOptions
void writeOptions(const GUIOptions &options)
Definition: GUIOptionsSerializer.cc:163
KEYBOARD_SHORTCUT
const string KEYBOARD_SHORTCUT
Name of the element declaring a keyboard shortcut.
Definition: GUIOptionsSerializer.cc:79
GUIOptionsSerializer::configurationName_
std::string configurationName_
Name of the configuration to read/write.
Definition: GUIOptionsSerializer.hh:84
XMLSerializer
Definition: XMLSerializer.hh:62
ObjectState::setValue
void setValue(const std::string &value)
GUIOptionsSerializer::~GUIOptionsSerializer
virtual ~GUIOptionsSerializer()
Definition: GUIOptionsSerializer.cc:122
DEFAULT_Y_POS
const int DEFAULT_Y_POS
Default y position.
Definition: GUIOptionsSerializer.cc:104
ObjectState::setAttribute
void setAttribute(const std::string &name, const std::string &value)
Definition: ObjectState.cc:100
GUIOptionsSerializer::writeState
void writeState(const ObjectState *optionsState)
Definition: GUIOptionsSerializer.cc:135
KS_KEY_COMBINATION
const string KS_KEY_COMBINATION
Name of the element declaring key combination.
Definition: GUIOptionsSerializer.cc:81
GUIOptionsSerializer::GUIOptionsSerializer
GUIOptionsSerializer(std::string configurationName)
Definition: GUIOptionsSerializer.cc:113
XMLSerializer::writeState
virtual void writeState(const ObjectState *rootState)
Definition: XMLSerializer.cc:219