A theme engine must export these functions:
void metatheme_init(MT_ENGINE *engine); void metatheme_exit(MT_ENGINE *engine); void metatheme_realize(MT_ENGINE *engine); void metatheme_draw_widget(MT_ENGINE *engine, MT_WINDOW *win, MT_RECTANGLE *area, int type, int state, int x, int y, int width, int height, MT_WIDGET_DATA *data); void metatheme_draw_string(MT_ENGINE *engine, MT_WINDOW *win, int type, int state, MT_STRING *str);
This function should initialize a theme. It might allocate a structure with it's private data and store the pointer to the data
member of the MT_ENGINE structure.
This function should also set all metrics and gather colors from current palette. This function must not create any graphics contexts or pixmaps.
This function is the core bussiness of a theme engine.
This is a window we draw on.
This is a (clip) rectangle which should be drawed. It might be NULL.
This rectangle is automatically used for clipping area, so you needn't to bother with it. It is provided for possibility of optimalization of drawing.
Type of the widget or it's part (see Widget types).
Current state of the widget or it's part (see Widget states).
This is a rectangle we draw within.
Additional informations about widget or it's part. For reference see the metatheme.h
file and the chapter about Constants.
This function is used for customizing the appearance of texts in various widgets. However, it's use is very limited. The text is given as an opaque structure by which you can do ONLY the following things:
do not display it at all
display it as normal
change the color of text and/or position
repeat previous steps
The list of allowed widget types and states is listed here.