![]() |
![]() |
![]() |
Mx Toolkit Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Known Implementations | Properties | Signals |
MxStylable; MxStylableIface; enum MxStyleError; struct MxStyle; MxStyle * mx_style_get_default (void
); MxStyle * mx_style_new (void
); gboolean mx_style_load_from_file (MxStyle *style
,const gchar *filename
,GError **error
); void mx_style_get_property (MxStyle *style
,MxStylable *stylable
,GParamSpec *pspec
,GValue *value
); void mx_style_get (MxStyle *style
,MxStylable *stylable
,const gchar *first_property_name
,...
); void mx_style_get_valist (MxStyle *style
,MxStylable *stylable
,const gchar *first_property_name
,va_list va_args
);
MxStylable is implemented by MxBin, MxBoxLayout, MxButton, MxComboBox, MxDeformBowTie, MxDeformPageTurn, MxDeformTexture, MxDeformWaves, MxDialog, MxEntry, MxExpander, MxFloatingWidget, MxFrame, MxGrid, MxIcon, MxImage, MxItemView, MxKineticScrollView, MxLabel, MxListView, MxMenu, MxNotebook, MxPathBar, MxProgressBar, MxScrollBar, MxScrollView, MxSlider, MxSpinner, MxStack, MxTable, MxToggle, MxToolbar, MxTooltip, MxViewport and MxWidget.
"style" MxStyle* : Read / Write "style-class" gchar* : Read / Write "style-pseudo-class" gchar* : Read / Write
MxStyle is a property data store that can read properties from a style sheet. It is queried with objects that implement the MxStylable interface.
typedef struct _MxStylable MxStylable;
This is an opaque structure whose members cannot be directly accessed.
typedef struct { GTypeInterface g_iface; /* virtual functions */ MxStyle * (* get_style) (MxStylable *stylable); void (* set_style) (MxStylable *stylable, MxStyle *style); G_CONST_RETURN gchar* (* get_style_class) (MxStylable *stylable); void (* set_style_class) (MxStylable *stylable, const gchar *style_class); G_CONST_RETURN gchar* (* get_style_pseudo_class) (MxStylable *stylable); void (* set_style_pseudo_class) (MxStylable *stylable, const gchar *style_class); /* context virtual functions */ /* signals, not vfuncs */ #if 0 void (* style_notify) (MxStylable *stylable, GParamSpec *pspec); #endif void (* style_changed) (MxStylable *stylable, MxStyleChangedFlags flags); } MxStylableIface;
typedef enum { /*< prefix=MX_STYLE_ERROR >*/ MX_STYLE_ERROR_INVALID_FILE } MxStyleError;
struct MxStyle;
The contents of this structure is private and should only be accessed using the provided API.
MxStyle * mx_style_get_default (void
);
Return the default MxStyle object. This includes the current theme (if any).
Returns : |
a MxStyle object. This must not be freed or unref'd by applications. [transfer none] |
MxStyle * mx_style_new (void
);
Creates a new MxStyle object. This must be freed using g_object_unref when no longer required.
Returns : |
a newly allocated MxStyle |
gboolean mx_style_load_from_file (MxStyle *style
,const gchar *filename
,GError **error
);
Load style information from the specified file.
|
a MxStyle |
|
filename of the style sheet to load |
|
a GError or NULL |
Returns : |
TRUE if the style information was loaded successfully. Returns FALSE on error. |
void mx_style_get_property (MxStyle *style
,MxStylable *stylable
,GParamSpec *pspec
,GValue *value
);
Requests the property described in pspec
for the specified stylable
|
the style data store object |
|
a stylable to retreive the data for |
|
a GParamSpec describing the property required |
|
a GValue to place the return value in. [out] |
void mx_style_get (MxStyle *style
,MxStylable *stylable
,const gchar *first_property_name
,...
);
Gets the style properties for stylable
from style
.
In general, a copy is made of the property contents and the caller is responsible for freeing the memory in the appropriate manner for the property type.
|
a MxStyle |
|
a MxStylable |
|
name of the first property to get |
|
return location for the first property, followed optionally
by more name/return location pairs, followed by NULL
|
void mx_style_get_valist (MxStyle *style
,MxStylable *stylable
,const gchar *first_property_name
,va_list va_args
);
Gets the style properties for stylable
from style
.
Please refer to mx_style_get()
for further information.
|
a MxStyle |
|
a MxStylable |
|
name of the first property to get |
|
return location for the first property, followed optionally
by more name/return location pairs, followed by NULL
|
"style-class"
property "style-class" gchar* : Read / Write
String representation of the item's class.
Default value: ""
"style-changed"
signalvoid user_function (MxStylable *stylable,
MxStyleChangedFlags flags,
gpointer user_data) : Run First
The ::style-changed signal is emitted each time one of the style properties have changed.
|
the MxStylable that received the signal |
|
the MxStyleChangedFlags associated with the signal |
|
user data set when the signal handler was connected. |
"changed"
signalvoid user_function (MxStyle *arg0,
gpointer user_data) : Run Last
Indicates that the style data has changed in some way. For example, a new stylesheet may have been loaded.
|
user data set when the signal handler was connected. |