![]() |
![]() |
![]() |
katze Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <katze/katze.h> #define katze_assign (lvalue, rvalue) #define katze_object_assign (lvalue, rvalue) #define katze_strv_assign (lvalue, rvalue) constgchar * katze_str_non_null (const
);gchar *strGtkWidget * katze_property_proxy (,
gpointer objectconst
,gchar *propertyconst
); enum KatzeMenuPos;gchar *hintvoid katze_widget_popup (,
GtkWidget *widget,
GtkMenu *menu,
GdkEventButton *eventKatzeMenuPos pos
);GtkWidget * katze_image_menu_item_new_ellipsized (const
);gchar *labelgboolean katze_tree_view_get_selected_iter (,
GtkTreeView *treeview,
GtkTreeModel **model);
GtkTreeIter *itervoid katze_bookmark_populate_tree_view (KatzeArray *array
,,
GtkTreeStore *model);
GtkTreeIter *parentgchar * katze_strip_mnemonics (const
); constgchar *originalgchar * katze_skip_whitespace (const
);gchar *strgint katze_object_get_boolean (,
gpointer objectconst
);gchar *propertygint katze_object_get_int (,
gpointer objectconst
);gchar *propertygint katze_object_get_enum (,
gpointer objectconst
);gchar *propertygchar * katze_object_get_string (,
gpointer objectconst
);gchar *propertygpointer katze_object_get_object (,
gpointer objectconst
);gchar *propertyint katze_mkdir_with_parents (const
,gchar *pathname);
int modeGtkWidget * katze_uri_entry_new ();
GtkWidget *other_widgetvoid katze_widget_add_class (,
GtkWidget *widgetconst
);gchar *class_namevoid katze_assert_str_equal (const
,gchar *inputconst
,gchar *resultconst
);gchar *expectedvoid katze_window_set_sensible_default_size ();
GtkWindow *window
#define katze_assign(lvalue, rvalue) lvalue = (g_free (lvalue), rvalue)
Frees lvalue
if needed and assigns it the value of rvalue
.
|
a pointer |
|
the new value |
#define katze_object_assign(lvalue, rvalue)
Unrefs lvalue
if needed and assigns it the value of rvalue
.
|
a gobject |
|
the new value |
#define katze_strv_assign(lvalue, rvalue) lvalue = (g_strfreev (lvalue), rvalue)
Frees lvalue
if needed and assigns it the value of rvalue
.
|
a string list |
|
the new value |
Since 0.1.7
constgchar * katze_str_non_null (const
);gchar *str
|
a string, or NULL |
Returns : |
"" if str is NULL |
Since 0.4.4
GtkWidget * katze_property_proxy (,
gpointer objectconst
,gchar *propertyconst
);gchar *hint
Create a widget of an appropriate type to represent the specified object's property. If the property is writable changes of the value through the widget will be reflected in the value of the property.
Supported values for hint
are as follows:
"blurb": the blurb of the property will be used to provide a kind
of label, instead of the name.
"file": the widget created will be particularly suitable for
choosing an existing filename.
"folder": the widget created will be particularly suitable for
choosing an existing folder.
"uri": the widget created will be particularly suitable for
choosing an existing filename, encoded as an URI.
"font": the widget created will be particularly suitable for
choosing a variable-width font from installed fonts.
Since 0.1.6 the following hints are also supported:
"toggle": the widget created will be an empty toggle button. This
is only supported with boolean properties.
Since 0.1.8 "toggle" creates GtkCheckButton widgets without checkmarks.
Since 0.2.0 the following hints are also supported:
"font-monospace": the widget created will be particularly suitable for
choosing a fixed-width font from installed fonts.
Since 0.2.1 the following hints are also supported:
"application-TYPE": the widget created will be particularly suitable
for choosing an application to open TYPE files, ie. "text/plain".
"application-CATEGORY": the widget created will be particularly suitable
for choosing an application to open CATEGORY files, ie. "Network".
Since 0.5.8 the CATEGORY hint is no longer supported.
"custom-PROPERTY": the last value of an enumeration will be the "custom"
value, where the user may enter text freely, which then updates
the property PROPERTY instead. This applies only to enumerations.
Since 0.4.1 mnemonics are automatically stripped.
Since 0.2.9 the following hints are also supported:
"languages": the widget will be particularly suitable for choosing
multiple language codes, ie. "de,en_GB".
Since 0.3.6 the following hints are also supported:
"address": the widget will be particularly suitable for typing
a valid URI or IP address and highlight errors.
Since 0.4.0 the following hints are also supported:
"days": the widget will be particularly suitable for choosing
a period of time in days.
Any other values for hint
are silently ignored.
Since 0.1.2 strings without hints and booleans are truly synchronous including property changes causing the proxy to be updated.
Since 0.2.1 the proxy may contain a label if the platform has according widgets.
|
a |
|
the name of a property |
|
a special hint |
Returns : |
a new widget |
typedef enum { KATZE_MENU_POSITION_CURSOR = 0, KATZE_MENU_POSITION_LEFT, KATZE_MENU_POSITION_RIGHT } KatzeMenuPos;
void katze_widget_popup (,
GtkWidget *widget,
GtkMenu *menu,
GdkEventButton *eventKatzeMenuPos pos
);
Pops up the given menu relative to widget
. Use this
instead of writing custom positioning functions.
|
a widget |
|
the menu to popup |
|
a button event, or NULL |
|
the preferred positioning |
Returns : |
a new label widget |
GtkWidget * katze_image_menu_item_new_ellipsized (const
);gchar *label
Creates an image menu item where the label is reasonably ellipsized for you.
|
a label or NULL |
Returns : |
a new label widget |
gboolean katze_tree_view_get_selected_iter (,
GtkTreeView *treeview,
GtkTreeModel **model);
GtkTreeIter *iter
Determines whether there is a selection in treeview
and sets the iter
to the current selection.
If there is a selection and model
is not NULL
Either model
or iter
or both can be NULL
|
a |
|
a pointer to store the model, or NULL |
|
a pointer to store the iter, or NULL |
Returns : |
TRUE |
Since 0.1.3
void katze_bookmark_populate_tree_view (KatzeArray *array
,,
GtkTreeStore *model);
GtkTreeIter *parent
gchar * katze_strip_mnemonics (const
);gchar *original
Parses the given string for mnemonics in the form "B_utton" or "Button (_U)" and returns a string without any mnemonics.
|
a string with mnemonics |
Returns : |
a newly allocated string without mnemonics |
Since 0.1.8
gint katze_object_get_boolean (,
gpointer objectconst
);gchar *property
Retrieve the boolean value of the specified property.
|
a |
|
the name of the property to get |
Returns : |
a boolean |
gint katze_object_get_int (,
gpointer objectconst
);gchar *property
Retrieve the integer value of the specified property.
|
a |
|
the name of the property to get |
Returns : |
an integer |
gint katze_object_get_enum (,
gpointer objectconst
);gchar *property
Retrieve the enum value of the specified property.
|
a |
|
the name of the property to get |
Returns : |
an enumeration |
gchar * katze_object_get_string (,
gpointer objectconst
);gchar *property
Retrieve the string value of the specified property.
|
a |
|
the name of the property to get |
Returns : |
a newly allocated string |
gpointer katze_object_get_object (,
gpointer objectconst
);gchar *property
Retrieve the object value of the specified property.
|
a |
|
the name of the property to get |
Returns : |
an object |
int katze_mkdir_with_parents (const
,gchar *pathname);
int mode
Create a directory if it doesn't already exist. Create intermediate parent directories as needed, too.
|
a pathname in the GLib file name encoding |
|
permissions to use for newly created directories |
Returns : |
0 if the directory already exists, or was successfully created. Returns -1 if an error occurred, with errno set. |
Since 0.2.1
GtkWidget * katze_uri_entry_new ();
GtkWidget *other_widget
Creates an entry that validates the typed URI.
If other_widget
is given, it will become insensitive if
the input is not a valid URI.
|
a NULL |
Returns : |
a |
Since 0.3.6
void katze_assert_str_equal (const
,gchar *inputconst
,gchar *resultconst
);gchar *expected
Compares the two strings for equality, with verbose errors.
|
a string |
|
a string |
|
a string |
Since 0.4.3