1. Overview
The Monet API is split roughly into two halves: one to deal with loading and storing style options, and the other half to paint widgets.
1.1. Style Data
The MnStyleSheet is an object that represents a loaded style sheet (a "theme"). This contains data that can be applied to an object that implements the MnStylable interface (a basic implementation is provided). The MnStylable has a set of properties that are used to look up data in the stylesheet. The MnStylable is used to represent one specific item in a scene graph.
1.2. Widget Drawing
Widget drawing is implemented by a class that implements the MnDrawingEnging type. This has one function which uses the properties available from a MnStylable to draw the requested interface element from a standard list. The list is extendable, and if the subclass does not implement the requested element, it will return false from the drawing function and a default implementation may be used.
2. MnStyleSheet
An object representing a parsed style sheet. Possibly contains data applying to multiple Stylable objects.
2.1. Functions
gboolean load_from_file (gchar filename, GError *err) gboolean get_style_property (MnStylable *stylable, gchar *property_name, ...)
3. MnStylable
Interface to allow gobjects to be styled. Has style properties that can be set from a stylesheet.
A default implementation (derived from GObject) is available as MnItem.
3.1. Default Properties
- style-type (if null, use object's type?)
- style-id
- style-parent
- style-class
- style-stylesheet
3.2. Default Style Properties
(these properties are read from the stylesheet)
- background-color
- foreground-color
- selection-fg-color
- selection-bg-color
- border-color
- border-width
4. MnSimpleWidget
An abstract object that deals with drawing simple (non-composite) widgets. Can be subclassed to add new styles. All drawing happens on a cairo canvas provided by the user.
4.1. Properties
MnType type
MnState state
MnFlags flags
MnColor background-color
MnColor foreground-color
MnColor border-color
MnColor highlight-fg-color
MnColor highlight-bg-color
MnBorder border-width
4.2. Functions
gboolean paint (MnSimpleWidget widget, cairo_t *surface, MnRectangle *area)
5. MnCompositeWidget
An abstract class for drawing widgets which contain distinct independant areas (e.g. multiple buttons).
5.1. Properties
5.2. Functions
gboolean paint (MnCompositeWidget widget, cairo_t *surface, MnRectangle *area, MnPart part,...)
6. Other Types
6.1. MnState
enum MnState { MN_NORMAL MN_ACTIVE MN_HOVER MN_DISABLED }
6.2. MnFlags
enum MnFlags { MN_STATE_FOCUS = 1 << 0, MN_STATE_CHECKED = 1 << 1 }
6.3. MnRectangle
struct MnRectangle { gfloat x, gfloat y, gfloat width, gfloat height }
6.4. MnWidget
enum MnWidget { MN_BUTTON, MN_CHECK_BUTTON, MN_RADIO_BUTTON, MN_SINGLE_LINE_ENTRY, MN_MULTI_LINE_ENTRY, MN_MENU_WINDOW, MN_MENU_ITEM, MN_MENU_BAR, MN_EXPANDER, MN_TOOLBAR_ITEM, MN_SEPARATOR, MN_RESIZE_GRIP, MN_CORNER_GRIP, MN_SELECTION, MN_TOOLTIP, ... } enum MnPosition { MN_POSITION_LAST = -1 MN_POSITION_FIRST = 0