![]() |
![]() |
![]() |
Netbook Toolkit Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
enum NbtkStyleError; NbtkStyle; NbtkStyle * nbtk_style_get_default (void
); NbtkStyle * nbtk_style_new (void
); gboolean nbtk_style_load_from_file (NbtkStyle *style
,const gchar *filename
,GError **error
); void nbtk_style_get_property (NbtkStyle *style
,NbtkStylable *stylable
,GParamSpec *pspec
,GValue *value
); void nbtk_style_get (NbtkStyle *style
,NbtkStylable *stylable
,const gchar *first_property_name
,...
); void nbtk_style_get_valist (NbtkStyle *style
,NbtkStylable *stylable
,const gchar *first_property_name
,va_list va_args
);
NbtkStyle is a property data store that can read properties from a style sheet. It is queried with objects that implement the NbtkStylable interface.
typedef enum { /*< prefix=NBTK_STYLE_ERROR >*/ NBTK_STYLE_ERROR_INVALID_FILE } NbtkStyleError;
typedef struct _NbtkStyle NbtkStyle;
The contents of this structure is private and should only be accessed using the provided API.
NbtkStyle * nbtk_style_get_default (void
);
Return the default NbtkStyle object. This includes the current theme (if any).
Returns : |
a NbtkStyle object. This must not be freed or unref'd by applications |
NbtkStyle * nbtk_style_new (void
);
Creates a new NbtkStyle object. This must be freed using g_object_unref when no longer required.
Returns : |
a newly allocated NbtkStyle |
gboolean nbtk_style_load_from_file (NbtkStyle *style
,const gchar *filename
,GError **error
);
Load style information from the specified file.
|
a NbtkStyle |
|
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 nbtk_style_get_property (NbtkStyle *style
,NbtkStylable *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 |
void nbtk_style_get (NbtkStyle *style
,NbtkStylable *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 NbtkStyle |
|
a NbtkStylable |
|
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 nbtk_style_get_valist (NbtkStyle *style
,NbtkStylable *stylable
,const gchar *first_property_name
,va_list va_args
);
Gets the style properties for stylable
from style
.
Please refer to nbtk_style_get()
for further information.
|
a NbtkStyle |
|
a NbtkStylable |
|
name of the first property to get |
|
return location for the first property, followed optionally
by more name/return location pairs, followed by NULL
|
"changed"
signalvoid user_function (NbtkStyle *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. |