#include <edelib/Theme.h>
Public Member Functions | |
Theme () | |
~Theme () | |
bool | load (const char *name="default", const char *prefix="ede") |
bool | load_from_file (const char *f) |
void | clear (void) |
bool | loaded (void) const |
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 |
void | apply_common_gui_elements (void) |
Theme class implements abastract theming engine for FLTK and edelib widgets. It also loads target theme from appropriate place. Theme also understainds commong GUI elements from already known style and will apply them on widgets on demand
For more details see Themes and theming details.
Theme | ( | ) |
Constructor.
~Theme | ( | ) |
Destructor.
void apply_common_gui_elements | ( | void | ) |
Apply common items to FLTK window tree and underlaying widgets. Style name it will look for will be ede. This affects edelib widgets, windows and icon theme.
const char* author | ( | void | ) | const |
Return author entry.
void clear | ( | void | ) |
Deinitialize interpreter and clears internal data.
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 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 load | ( | const char * | name = "default" , |
|
const char * | prefix = "ede" | |||
) |
Load theme. Theme will be searched in $XDG_DATA_DIRS/prefix/themes paths if prefix was set (by default it is ede).
Default theme has default name and will be searched for if nothing was given.
bool load_from_file | ( | const char * | f | ) |
Load 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.
const char* sample_image | ( | void | ) | const |
Return name of theme example image.