edelib 1.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
Theme Class Reference
FLTK widgets and functions

Theming engine for widgets. More...

`#include <edelib/Theme.h>`

## Public Member Functions
| Theme (const char *msg_domain="edelib")
| ~Theme ()
bool | load (const char *f)
void | clear (void)
bool | loaded (void) const
void | set_error_handler (ThemeErrorHandler func, void *data=0)
void * | error_handler_data (void) const
ThemeErrorHandler | error_handler (void) const
void | prompt (void)
bool | get_item (const char *style_name, const char *item_name, char *ret, unsigned int sz)
bool | get_item (const char *style_name, const char *item_name, long &ret, long fallback=0)
const char * | author (void) const
const char * | name (void) const
const char * | sample_image (void) const
scheme * | get_interpreter (void)

## Detailed Description

Theming engine for widgets.

Theme class implements abastract theming engine suitable for FLTK and edelib widgets. Unlike Config or Resource, theme engine implements full language to load and parse theme files giving huge flexibility to represent the final visual appearance and behaviour.

This class should not be used directly to load themes; ThemeLoader should be used for that.

## Constructor & Destructor Documentation

Theme | ( | const char * | msg_domain = `"edelib"` | ) |

Constructor.

Parameters

  msg_domain | is used for translatable strings and should be set to application name that uses Theme class.

~Theme | ( |  | ) |

Destructor.

## Member Function Documentation

const char* author | ( | void |  | ) | const

Return author entry.

void clear | ( | void |  | ) |

Deinitialize interpreter and clears internal data.

ThemeErrorHandler error_handler | ( | void |  | ) | const

Return error handler or NULL if not set.

void* error_handler_data | ( | void |  | ) | const

Return error handler data.

scheme* get_interpreter | ( | void |  | ) |

Return interpreter instance and can return NULL if theme isn't loaded successfully. This function makes sense only if you loaded some theme.

bool get_item | ( | const char * | style_name,
|  | const char * | item_name,
|  | char * | ret,
|  | unsigned int | sz
| ) |  |

Get C string item from theme using style_name style. Item will be stored in ret using no more than sz bytes. Return true if found and ret was set.

bool get_item | ( | const char * | style_name,
|  | const char * | item_name,
|  | long & | ret,
|  | long | fallback = `0`
| ) |  |

Get long item from theme using style_name style. If given item wasn't found, the function will return false and ret will have fallback value. Otherwise, ret will have value associated with item_name.

bool load | ( | const char * | f | ) |

Load and parse theme from given file. If fails returns false.

bool loaded | ( | void |  | ) | const

Return true if theme loaded successfully.

const char* name | ( | void |  | ) | const

Return theme name.

void prompt | ( | void |  | ) |

Show prompt and wait for input. This function is intended to be called from console progams, as it will wait intfinitely for user input, where scheme/theme expressions could be evaluated.

This function is mostly for writing external tools for easier debugging.

const char* sample_image | ( | void |  | ) | const

Return name of theme example image.

void set_error_handler | ( | ThemeErrorHandler | func,
|  | void * | data = `0`
| ) |  |

Install error handler that will be called when error occured during reading/parsing phase. Handler should be installed before load() call. When load() completes and return status, handler function will not be called any more, so all collected errors could be displayed or processed further.

The documentation for this class was generated from the following file:

- edelib/Theme.h