OpenASIP  2.0
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
GUIOptionsSerializer Class Reference

#include <GUIOptionsSerializer.hh>

Inheritance diagram for GUIOptionsSerializer:
Inheritance graph
Collaboration diagram for GUIOptionsSerializer:
Collaboration graph

Public Member Functions

 GUIOptionsSerializer (std::string configurationName)
 
virtual ~GUIOptionsSerializer ()
 
void writeState (const ObjectState *optionsState)
 
ObjectStatereadState ()
 
void writeOptions (const GUIOptions &options)
 
GUIOptionsreadOptions ()
 
- Public Member Functions inherited from XMLSerializer
 XMLSerializer ()
 
virtual ~XMLSerializer ()
 
void setSourceFile (const std::string &fileName)
 
void setSourceString (const std::string &source)
 
void setDestinationFile (const std::string &fileName)
 
void setDestinationString (std::string &destination)
 
void setSchemaFile (const std::string &fileName)
 
void setUseSchema (bool useSchema)
 
void setXMLNamespace (std::string nsUri)
 
- Public Member Functions inherited from TCETools::Serializer
virtual ~Serializer ()
 

Protected Member Functions

virtual ObjectStateconvertToConfigFileFormat (const ObjectState *options) const
 
virtual ObjectStateconvertToOptionsObjectFormat (const ObjectState *root) const
 
- Protected Member Functions inherited from XMLSerializer
std::string sourceFile () const
 

Private Member Functions

void setWindowProperties (const ObjectState *windowElem, ObjectState *options) const
 
void setToolbarProperties (const ObjectState *toolbarElem, ObjectState *options) const
 
void addKeyboardShortcut (const ObjectState *ksElem, ObjectState *options) const
 
 GUIOptionsSerializer (const GUIOptionsSerializer &)
 Copying not allowed. More...
 
GUIOptionsSerializeroperator= (const GUIOptionsSerializer &)
 Assignment not allowed. More...
 

Private Attributes

std::string configurationName_
 Name of the configuration to read/write. More...
 

Detailed Description

Reads and writes options of a graphical user interface from an XML file.

This is a base class which provides storing of options common to all GUIs, such as window size and position, toolbar contents and list of keyboard shortcuts. If a GUI needs application specific options, a custom options serializer can be derived from this class. See design documentation for details.

Definition at line 52 of file GUIOptionsSerializer.hh.

Constructor & Destructor Documentation

◆ GUIOptionsSerializer() [1/2]

GUIOptionsSerializer::GUIOptionsSerializer ( std::string  name)

Constructor.

Parameters
nameName of the configuration.

Definition at line 113 of file GUIOptionsSerializer.cc.

113  :
114  XMLSerializer(),
115  configurationName_(name) {
116 }

◆ ~GUIOptionsSerializer()

GUIOptionsSerializer::~GUIOptionsSerializer ( )
virtual

Destructor.

Definition at line 122 of file GUIOptionsSerializer.cc.

122  {
123 }

◆ GUIOptionsSerializer() [2/2]

GUIOptionsSerializer::GUIOptionsSerializer ( const GUIOptionsSerializer )
private

Copying not allowed.

Member Function Documentation

◆ addKeyboardShortcut()

void GUIOptionsSerializer::addKeyboardShortcut ( const ObjectState ksElem,
ObjectState options 
) const
private

Adds a keyboard shortcut to the given options according to the given keyboard-shortcut element.

Parameters
ksElemObjectState representing a keyboard-shortcut element in options file.
optionsOptions ObjectState which is modified.

Definition at line 495 of file GUIOptionsSerializer.cc.

497  {
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 }

References ObjectState::childByName(), DELETE_KEY, FKEY_NUMBER, ObjectState::hasChild(), ObjectState::intAttribute(), KEY_COMB_ALT, KEY_COMB_CTRL, KEY_COMB_FKEY, KEY_COMB_KEY, KEY_VALUE, KS_ACTION, KS_KEY_COMBINATION, options, KeyboardShortcut::OSKEY_ACTION, KeyboardShortcut::OSKEY_ALT, KeyboardShortcut::OSKEY_CTRL, KeyboardShortcut::OSKEY_FKEY, KeyboardShortcut::OSKEY_KEY, KeyboardShortcut::OSNAME_KEYBOARD_SHORTCUT, ObjectState::setAttribute(), ObjectState::stringAttribute(), and ObjectState::stringValue().

Referenced by convertToOptionsObjectFormat().

Here is the call graph for this function:

◆ convertToConfigFileFormat()

ObjectState * GUIOptionsSerializer::convertToConfigFileFormat ( const ObjectState options) const
protectedvirtual

Converts the given ObjectState tree created by GUIOptions::saveState to the format of configuration file.

Parameters
optionsObjectState tree to be converted.
Returns
The newly created ObjectState tree which matches with configuration file format.

Reimplemented in ProDeOptionsSerializer.

Definition at line 194 of file GUIOptionsSerializer.cc.

195  {
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 }

References ObjectState::addChild(), configurationName_, DELETE_KEY, FALSE, FKEY_NUMBER, ObjectState::hasAttribute(), ObjectState::intAttribute(), KEY_COMB_ALT, KEY_COMB_CTRL, KEY_COMB_FKEY, KEY_COMB_KEY, KEY_VALUE, KEYBOARD_SHORTCUT, KS_ACTION, KS_KEY_COMBINATION, ObjectState::name(), options, ToolbarButton::OSKEY_ACTION, KeyboardShortcut::OSKEY_ACTION, KeyboardShortcut::OSKEY_ALT, KeyboardShortcut::OSKEY_CTRL, KeyboardShortcut::OSKEY_FKEY, GUIOptions::OSKEY_FULL_SCREEN, KeyboardShortcut::OSKEY_KEY, GUIOptions::OSKEY_POSITION, ToolbarButton::OSKEY_SLOT, GUIOptions::OSKEY_TOOLBAR_LAYOUT, GUIOptions::OSKEY_TOOLBAR_VISIBILITY, GUIOptions::OSKEY_WINDOW_HEIGHT, GUIOptions::OSKEY_WINDOW_WIDTH, GUIOptions::OSKEY_X_POS, GUIOptions::OSKEY_Y_POS, KeyboardShortcut::OSNAME_KEYBOARD_SHORTCUT, GUIOptions::OSNAME_SEPARATOR, ToolbarButton::OSNAME_TOOLBAR_BUTTON, GUIOptions::OSVALUE_ICON, GUIOptions::OSVALUE_TEXT, SEPARATOR_POSITION, ObjectState::setAttribute(), ObjectState::setValue(), SLOT_POSITION, ObjectState::stringAttribute(), TB_LA_ICON, TB_LA_TEXT, TB_LAYOUT, TB_SEPARATOR, TB_SLOT, TB_SLOT_ACTION, TB_VISIBLE, TOOLBAR, Conversion::toString(), TRUE, WI_FULLSCREEN, WI_HEIGHT, WI_WIDTH, WI_X_POSITION, WI_Y_POSITION, and WINDOW.

Referenced by ProDeOptionsSerializer::convertToConfigFileFormat(), and writeState().

Here is the call graph for this function:

◆ convertToOptionsObjectFormat()

ObjectState * GUIOptionsSerializer::convertToOptionsObjectFormat ( const ObjectState root) const
protectedvirtual

Creates a new ObjectState tree which can be given to GUIOptions constructor. The tree is created according to the given tree which matches with the syntax of the options file.

Parameters
rootRoot node of the ObjectState tree to be converted.

Reimplemented in ProDeOptionsSerializer.

Definition at line 343 of file GUIOptionsSerializer.cc.

344  {
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 }

References addKeyboardShortcut(), ObjectState::child(), ObjectState::childByName(), ObjectState::childCount(), DEFAULT_HEIGHT, DEFAULT_WIDTH, DEFAULT_X_POS, DEFAULT_Y_POS, ObjectState::hasChild(), KEYBOARD_SHORTCUT, ObjectState::name(), options, GUIOptions::OSKEY_FULL_SCREEN, GUIOptions::OSKEY_TOOLBAR_LAYOUT, GUIOptions::OSKEY_TOOLBAR_VISIBILITY, GUIOptions::OSKEY_WINDOW_HEIGHT, GUIOptions::OSKEY_WINDOW_WIDTH, GUIOptions::OSKEY_X_POS, GUIOptions::OSKEY_Y_POS, GUIOptions::OSNAME_OPTIONS, GUIOptions::OSVALUE_BOTH, setToolbarProperties(), setWindowProperties(), TOOLBAR, and WINDOW.

Referenced by ProDeOptionsSerializer::convertToOptionsObjectFormat(), and readState().

Here is the call graph for this function:

◆ operator=()

GUIOptionsSerializer& GUIOptionsSerializer::operator= ( const GUIOptionsSerializer )
private

Assignment not allowed.

◆ readOptions()

GUIOptions * GUIOptionsSerializer::readOptions ( )

Reads the current input file and creates GUIOptions according to it.

Returns
The newly created GUIOptions instance.
Exceptions
SerializerExceptionIf an error occurs while reading the file.
ObjectStateLoadingExceptionIf an error occurs while creating options.

Definition at line 178 of file GUIOptionsSerializer.cc.

178  {
179  ObjectState* optionsState = readState();
180  GUIOptions* options = new GUIOptions(optionsState);
181  delete optionsState;
182  return options;
183 }

References options, and readState().

Here is the call graph for this function:

◆ readState()

ObjectState * GUIOptionsSerializer::readState ( )
virtual

Reads the options from the current XML file set and creates an ObjectState tree which can be read by GUIOptions::loadState.

Returns
The newly created ObjectState tree.
Exceptions
SerializerExceptionIf an error occurs while reading the file.

Reimplemented from XMLSerializer.

Definition at line 149 of file GUIOptionsSerializer.cc.

149  {
151  ObjectState* converted = convertToOptionsObjectFormat(state);
152  delete state;
153  return converted;
154 }

References convertToOptionsObjectFormat(), and XMLSerializer::readState().

Referenced by Proxim::loadOptions(), ProDe::OnInit(), and readOptions().

Here is the call graph for this function:

◆ setToolbarProperties()

void GUIOptionsSerializer::setToolbarProperties ( const ObjectState toolbarElem,
ObjectState options 
) const
private

Sets the toolbar properties for the given options according to the given toolbar element.

Parameters
toolbarElemObjectState representing toolbar element in options file.
optionsOptions ObjectState which is modified.

Definition at line 430 of file GUIOptionsSerializer.cc.

432  {
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 }

References assert, ObjectState::child(), ObjectState::childByName(), ObjectState::childCount(), FALSE, ObjectState::hasChild(), ObjectState::name(), options, ToolbarButton::OSKEY_ACTION, GUIOptions::OSKEY_POSITION, ToolbarButton::OSKEY_SLOT, GUIOptions::OSKEY_TOOLBAR_LAYOUT, GUIOptions::OSKEY_TOOLBAR_VISIBILITY, GUIOptions::OSNAME_SEPARATOR, ToolbarButton::OSNAME_TOOLBAR_BUTTON, GUIOptions::OSVALUE_BOTH, GUIOptions::OSVALUE_ICON, GUIOptions::OSVALUE_TEXT, SEPARATOR_POSITION, ObjectState::setAttribute(), SLOT_POSITION, ObjectState::stringAttribute(), ObjectState::stringValue(), TB_LA_ICON, TB_LA_TEXT, TB_LAYOUT, TB_SEPARATOR, TB_SLOT, TB_SLOT_ACTION, TB_VISIBLE, and TRUE.

Referenced by convertToOptionsObjectFormat().

Here is the call graph for this function:

◆ setWindowProperties()

void GUIOptionsSerializer::setWindowProperties ( const ObjectState windowElem,
ObjectState options 
) const
private

Sets the window properties for the given options according to the given window element.

Parameters
windowElemObjectState representing window element in options file.
optionsOptions ObjectState which is modified.

Definition at line 390 of file GUIOptionsSerializer.cc.

392  {
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 }

References assert, ObjectState::childByName(), FALSE, options, GUIOptions::OSKEY_FULL_SCREEN, GUIOptions::OSKEY_WINDOW_HEIGHT, GUIOptions::OSKEY_WINDOW_WIDTH, GUIOptions::OSKEY_X_POS, GUIOptions::OSKEY_Y_POS, ObjectState::stringValue(), TRUE, WI_FULLSCREEN, WI_HEIGHT, WI_WIDTH, WI_X_POSITION, and WI_Y_POSITION.

Referenced by convertToOptionsObjectFormat().

Here is the call graph for this function:

◆ writeOptions()

void GUIOptionsSerializer::writeOptions ( const GUIOptions options)

Serializes the given options to the file set.

Parameters
optionsThe options to be serialized.
Exceptions
SerializerExceptionIf an error occurs while serializing.

Definition at line 163 of file GUIOptionsSerializer.cc.

163  {
164  ObjectState* optionsState = options.saveState();
165  writeState(optionsState);
166  delete optionsState;
167 }

References options, and writeState().

Referenced by SaveOptionsCmd::Do(), and ProximQuitCmd::Do().

Here is the call graph for this function:

◆ writeState()

void GUIOptionsSerializer::writeState ( const ObjectState optionsState)
virtual

Serializes the given ObjectState tree created by GUIOptions::saveState to an XML file.

Parameters
optionsStateObjectState tree created by GUIOptions::saveState.
Exceptions
SerializerExceptionIf the current destination file cannot be written.

Reimplemented from XMLSerializer.

Definition at line 135 of file GUIOptionsSerializer.cc.

135  {
136  ObjectState* converted = convertToConfigFileFormat(optionsState);
137  XMLSerializer::writeState(converted);
138  delete converted;
139 }

References convertToConfigFileFormat(), and XMLSerializer::writeState().

Referenced by writeOptions().

Here is the call graph for this function:

Member Data Documentation

◆ configurationName_

std::string GUIOptionsSerializer::configurationName_
private

Name of the configuration to read/write.

Definition at line 84 of file GUIOptionsSerializer.hh.

Referenced by convertToConfigFileFormat().


The documentation for this class was generated from the following files:
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
XMLSerializer::XMLSerializer
XMLSerializer()
Definition: XMLSerializer.cc:78
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
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
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
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
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
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
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
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
ObjectState::setValue
void setValue(const std::string &value)
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
XMLSerializer::writeState
virtual void writeState(const ObjectState *rootState)
Definition: XMLSerializer.cc:219