Widget themes. More...
#include <CThemes.h>
Public Member Functions | |
CThemes () | |
~CThemes () | |
Static Public Member Functions | |
static void | set (std::string themeName) |
static CIcon * | getIcon (const String &iconName, CIconSize iconSize) |
Returns a button icon by symbolic name. More... | |
static CPngImage * | getIconImage (const String &iconName, CIconSize iconSize) |
Returns a button icon image by symbolic name. More... | |
static void | registerIcon (CIcon *icon, CIconSize iconSize) |
Registers a new button icon. More... | |
static void | drawFlatBox (int x, int y, int w, int h, Fl_Color clr) |
static void | drawThinUpBox (int x, int y, int w, int h, Fl_Color clr) |
static void | drawUpBox (int x, int y, int w, int h, Fl_Color clr) |
static void | drawThinDownBox (int x, int y, int w, int h, Fl_Color clr) |
static void | drawDownBox (int x, int y, int w, int h, Fl_Color clr) |
static void | drawThinUpFrame (int x, int y, int w, int h, Fl_Color clr) |
static void | drawUpFrame (int x, int y, int w, int h, Fl_Color clr) |
static void | drawThinDownFrame (int x, int y, int w, int h, Fl_Color clr) |
static void | drawDownFrame (int x, int y, int w, int h, Fl_Color clr) |
static bool | drawButton (CThemeButtonType sz, int x, int y, int &w, int &h, bool highlited, bool pressed, bool defaultButton) |
static bool | sizeButton (CThemeButtonType sz, int &w, int &h) |
static bool | sizeProgressBar (int &w, int &h) |
static int | buttonFocusRadius () |
static bool | drawCheckButton (int x, int y, bool checked, bool highlited) |
static bool | drawRadioButton (int x, int y, bool checked, bool highlited) |
static bool | drawProgressBar (int x, int y, int w, float percent) |
static bool | drawTab (int x, int y, int w, int h, bool active) |
Draws a tab. More... | |
static bool | drawTabFrame (int x, int y, int w, int h) |
Draws a tab frame. More... | |
static Strings | availableThemes () |
static const Strings & | searchDirectories () |
Themes root directories. More... | |
static std::string | name () |
Returns theme name. | |
static std::string | themeFolder () |
Returns path to the theme folder. | |
Static Public Member Functions inherited from sptk::CThemeScrollBar | |
static void | loadGtkScrollbarButtons (xdoc::Document &xml, const String &orientation, CThemeImageCollection &buttonImages) |
Loads GTK theme scrollbar button images from 'style' node. More... | |
static void | loadGtkScrollbarTroughs (xdoc::Document &xml) |
Loads GTK theme scrollbar troughs. More... | |
static void | loadGtkScrollbarSliders (xdoc::Document &xml) |
Loads GTK theme scrollbar sliders. More... | |
static void | loadGtkScrollbars (xdoc::Document &xml) |
Loads GTK theme scrollbar button images from GTK theme. More... | |
static bool | sizeScrollBar (int &w, int &h) |
Computes and returns the minimum size of the scroll bar. More... | |
static bool | drawScrollBar (int x, int y, int w, int h, float minimum, float maximum, float value, float size, int activeZone, bool active) |
Draws a scroll bar image. More... | |
Static Public Attributes | |
static CFontsVector | screenFonts |
All the available screen fonts. | |
static Tar | m_tar |
Theme tar archive. Contains all the theme data. | |
Static Public Attributes inherited from sptk::CThemeScrollBar | |
static CScrollBarImages | m_scrollBar [2] |
Images for painting a scroll bar (horizontal and vertical) More... | |
static int | m_scrollBarTroughBorder |
static int | m_scrollBarSliderWidth |
static int | m_scrollBarStepperSize |
Static Protected Member Functions | |
static void | loadGtkButton (const xdoc::SNode &imageNode, std::map< CThemeImageState, std::string > &buttonFileNames) |
Loads GTK theme button file name from 'image' node, and stores it into the map. More... | |
static void | loadGtkButtonFileNames (xdoc::Document &xml, std::string XPath, std::map< CThemeImageState, std::string > &fileNames, std::string orientation="") |
Loads GTK theme button file names from XPath. More... | |
static void | loadGtkButtons (xdoc::Document &xml, const String &styleName, CThemeImageCollection &buttons, const String &function) |
Loads GTK theme button images from 'style' node. More... | |
static void | loadGtkTheme (const String >kThemeName) |
Loads current Gnome GTK theme. More... | |
Static Protected Attributes | |
static CIconMap | m_icons [4] |
Friends | |
class | CBaseButton |
Widget themes.
Class CThemes is a static loader for the themes. Only one one instance of the class should exist, and it's created automatically. The class allows to load a set of routines to draw the particular elements of the interface, and the images for these routines.
sptk::CThemes::CThemes | ( | ) |
Default constructor
sptk::CThemes::~CThemes | ( | ) |
Destructor
|
static |
Returns the list of the available themes
|
static |
Returns the button focuse corner radius
|
static |
The rountine to draw theme button
sz | CThemeButtonType, |
x | int, button x-coordinate |
y | int, button y-coordinate |
w | int&, button width, may be altered by button to meet the button size requirements |
h | int&, button height, may be altered by button to meet the button size requirements |
highlited | bool, true to draw the highlighted button |
pressed | bool, true to draw pressed button |
defaultButton | bool, true to draw default button |
|
static |
Draws a check button image
x | int, x-coordinate of the button |
y | int, y-coordinate of the button |
checked | bool, is button checked? |
highlited | bool, is button highlited? |
|
static |
The replacement rountine to draw FL_DOWN_BOX
|
static |
The replacement rountine to draw FL_DOWN_FRAME
|
static |
The replacement rountine to draw FL_FLAT_BOX
|
static |
Draws a progress bar image The height of the image is defined by the 'progress0.png' image of the theme. The width of the image is adjusted as required, but it can't be less than returned by sizeProgressBar() method.
x | int, x-coordinate of the progress bar |
y | int, y-coordinate of the progress bar |
w | int, width of the progress bar |
percent | float, percent value of the progress bar |
|
static |
Draws a radio button image
x | int, x-coordinate of the button |
y | int, y-coordinate of the button |
checked | bool, is button checked? |
highlited | bool, is button highlited? |
|
static |
Draws a tab.
x | int, x-coordinate of the scroll bar |
y | int, y-coordinate of the scroll bar |
w | int, width of the scroll bar |
h | int, width of the scroll bar |
active | bool, true if stab is active |
|
static |
Draws a tab frame.
Draws a bottom frame for the tabs
x | int, x-coordinate of the scroll bar |
y | int, y-coordinate of the scroll bar |
w | int, width of the scroll bar |
h | int, width of the scroll bar |
|
static |
The replacement rountine to draw FL_THIN_DOWN_BOX
|
static |
The replacement rountine to draw FL_THIN_DOWN_FRAME
|
static |
The replacement rountine to draw FL_THIN_UP_BOX
|
static |
The replacement rountine to draw FL_THIN_UP_FRAME
|
static |
The replacement rountine to draw FL_UP_BOX
|
static |
The replacement rountine to draw FL_UP_FRAME
Returns a button icon by symbolic name.
iconName | string, symbolic name for an icons |
iconSize | CIconSize, the size of the icon |
|
static |
Returns a button icon image by symbolic name.
iconName | string, symbolic name for an icons |
iconSize | CIconSize, the size of the icon |
|
staticprotected |
Loads GTK theme button file name from 'image' node, and stores it into the map.
imageNode | xml::Node*, an image node from GTK theme description |
buttonFileNames | std::map<CThemeImageState,std::string>&, file names for buttons |
|
staticprotected |
Loads GTK theme button file names from XPath.
xml | xml::Document&, GTK theme converted to XML |
XPath | std::string, XPath to button images |
fileNames | std::map<CThemeImageState,std::string>&, file names for buttons |
orientation | std::string, optional orientation (used for scrollbar elements) |
|
staticprotected |
Loads GTK theme button images from 'style' node.
xml | xml::Document&, GTK theme converted to XML |
styleName | std::string, image style name ("button", "checkbutton", etc) |
buttons | CThemeImageCollection&, set of images for the button type |
function | std::string, function ("BOX", CHECK", "OPTION", etc) |
|
staticprotected |
Loads current Gnome GTK theme.
The GTK theme name is read from .gconf directory.
gtkThemeName | std::string, GTK2 theme name |
Registers a new button icon.
icon | CIcon*, pointer to the icon |
iconSize | CIconSize, the size of the icon |
|
static |
Themes root directories.
On different system it may be a different set of directories. The first available correct combination of theme directory and theme name defines the theme directory
|
static |
Loads and sets the theme. The themeName is the directory with the theme images.
|
static |
Computes and returns the correct size of the button in the parameters.
sz | CThemeButtonType, the general type of the button. |
w | int&, button width, may be altered by button to meet the button size requirements |
h | int&, button height, may be altered by button to meet the button size requirements |
|
static |
Computes and returns the minimum size of the progress bar
w | int&, progress bar width, may be altered by progress bar to meet the progress bar size requirements |
h | int&, progress bar height, may be altered by progress bar to meet the progress bar size requirements |
|
staticprotected |
Icons for use with buttons (four different sizes available,