![]() |
![]() |
![]() |
gel Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#define GEL_DEFINE_QUARK_FUNC (name) #define GEL_DEFINE_WEAK_REF_CALLBACK (name) gboolean (*GelFilterFunc) (const gpointer data
,gpointer user_data
); enum GelPathComponent; gchar * (*GelPrintFunc) (const gpointer data
); enum GelResourceType; GelSignalDef; gchar * gel_8601_date_now (void
); GList * gel_dir_read (gchar *path
,gboolean absolute
,GError **error
); gchar ** gel_file_strings (gchar *pathname
); #define gel_free_and_invalidate (obj, value, func) #define gel_free_and_invalidate_with_args (obj, value, func, ...) const gchar * gel_get_package_data_dir (void
); const gchar * gel_get_package_lib_dir (void
); const gchar * gel_get_package_name (void
); void gel_init (const gchar *package_name
,const gchar *lib_dir
,const gchar *data_dir
); void gel_list_bisect (GList *input
,GList **accepted
,GList **rejected
,GelFilterFunc callback
,gpointer data
); #define gel_list_deep_free (list, callback) #define gel_list_deep_free_with_data (list, callback, user_data) GList * gel_list_filter (GList *input
,GelFilterFunc callback
,gpointer user_data
); gchar * gel_list_join (const gchar *separator
,GList *list
); void gel_list_printf (GList *list
,const gchar *format
,GelPrintFunc stringify_func
); gchar ** gel_list_to_strv (GList *list
,gboolean copy
); void gel_object_class_print_properties (GObjectClass *object
); guint gel_object_get_ref_count (GObject *object
); const gchar * gel_object_get_type_name (GObject *object
); void gel_object_interface_print_properties (gpointer interface
); #define gel_propagate_error_or_warm (dst, src, ...) gchar * gel_resource_locate (GelResourceType type
,gchar *resource
); const gchar * gel_resource_type_get_env (GelResourceType type
); gchar * gel_resource_type_get_system_dir (GelResourceType type
); gchar * gel_resource_type_get_user_dir (GelResourceType type
); guint gel_run_once_on_idle (GSourceFunc callback
,gpointer data
,GDestroyNotify destroy
); guint gel_run_once_on_timeout (guint interval
,GSourceFunc callback
,gpointer data
,GDestroyNotify destroy
); void gel_show_to_user (const gchar *uri
); #define gel_slist_deep_free (list, callback) #define gel_slist_deep_free_with_data (list, callback, user_data) #define gel_slist_printf (list, format, func) #define gel_str_or_text (str, text) gchar ** gel_strv_concat (gchar **strv_a
,...
); gchar ** gel_strv_copy (gchar **strv
,gboolean deep
); gchar ** gel_strv_delete (gchar **strv
,gint index
); GList * gel_strv_to_list (gchar **strv
,gboolean copy
); #define gel_warn_fix_implementation
#define GEL_DEFINE_QUARK_FUNC(name)
name
: Name for use in the quark function, use 'foo' for quark_foo()
Defines a quark function
#define GEL_DEFINE_WEAK_REF_CALLBACK(name)
name
: Name for use in the weak ref callback, use 'foo' for foo_weak_ref_cb
Defines a weak ref function for use with g_object_weak_ref
gboolean (*GelFilterFunc) (const gpointer data
,gpointer user_data
);
data
: Data to filter or not
user_data
: User data
Filters out (or not) data
from a larger set of values
Returns : |
TRUE if data is accepted (NOT sure about this, refer to caller
function documentation) |
typedef enum { GEL_PATH_COMPONENT_BASENAME, GEL_PATH_COMPONENT_DIRNAME, GEL_PATH_COMPONENT_PATHNAME, GEL_PATH_N_COMPONENTS } GelPathComponent;
Used for access returned data from gel_file_strings
gchar * (*GelPrintFunc) (const gpointer data
);
data
: (transfer none): gpointer holind data to dump
Converts data
to printable strings
Returns : |
Data in a printable form. [transfer full] |
typedef enum { GEL_RESOURCE_TYPE_UI, // ui/ GEL_RESOURCE_TYPE_IMAGE, // pixmaps/ GEL_RESOURCE_TYPE_SHARED, // lib/ GEL_RESOURCE_TYPE_OTHER, // "./" GEL_RESOURCE_N_TYPES } GelResourceType;
GEL_RESOURCE_TYPE_UI
: A .ui file, a UI definition understandable by GtkBuilder
GEL_RESOURCE_TYPE_IMAGE
: An image in any format loadable by Gtk+
GEL_RESOURCE_TYPE_SHARED
: A shared object (.so, .dylib, .dll)
GEL_RESOURCE_OTHER
: Other types
GelResourceType describes which type of file to locate, each type, except
GEL_RESOURCE_OTHER
, is searched in specific locations, where
GEL_RESOURCE_OTHER
is searched at '.'
For specific information about search paths you should to read the code of gel/gel-misc.c.
typedef struct { gchar *object, *signal; GCallback callback; gpointer data; gboolean swapped; } GelSignalDef;
Defines a signal
const gchar * gel_get_package_data_dir (void
);
Get package data_dir from libgel
Returns : |
package data_dir of the app using libgel This string is owned by libgel and should NOT be freeded. [transfer none] |
const gchar * gel_get_package_lib_dir (void
);
Get package libdir from libgel
Returns : |
package libdir of the app using libgel This string is owned by libgel and should NOT be freeded. [transfer none] |
const gchar * gel_get_package_name (void
);
Get package name from libgel
Returns : |
package name of the app using libgel. This string is owned by libgel and should NOT be freeded. [transfer none] |
void gel_init (const gchar *package_name
,const gchar *lib_dir
,const gchar *data_dir
);
package_name
: Name of the package/app using libgel. Something like 'foo' or 'bar'.
lib_dir
: libdir for the app, in most cases something like /usr/local/lib or
/usr/lib
data_dir
: datadir for the app, in most cases something like
/usr/local/share or /usr/share
Initializes the library
void gel_list_bisect (GList *input
,GList **accepted
,GList **rejected
,GelFilterFunc callback
,gpointer data
);
input
: A GList to bisect
accepted
: (inout): A GList to store accepted elements, NULL
is not
allowed
rejected
: (inout): A GList to store rejected elements, NULL
is not
allowed
callback
: A GelFilterFunc
data
: data to pass to callback
Bisect (split) a GList based on the criteria of callback
. Callback is
called in form of callback(element,data). If callback
returns TRUE
element is stored in accepted, else element is stored in rejected.
Original list is completly freeded, since all of his elements are moved to
accepted
or rejected
. Neither of accepted
or rejected
can be NULL
because elements will be leaked.
#define gel_list_deep_free(list,callback) gel_list_deep_free_with_data(list,(GFunc)callback,NULL)
Deep free a GList. callback
is invoked to free each element of list
#define gel_list_deep_free_with_data(list,callback,user_data)
Deep free a GList. callback
is invoked to free each element of list
with
data
as second argument
GList * gel_list_filter (GList *input
,GelFilterFunc callback
,gpointer user_data
);
input
: A GList to filter
callback
: A GelFilterFunc used for filtering
user_data
: data to pass to callback
Filters input
's elements to return a newly created GList based on the
criteria of callback
, if TRUE
is returned, element is included in the
returned list.
Note that elements itself are not copied.
See also: gel_list_bisect()
Returns : |
The filtered list. [transfer container] |
void gel_list_printf (GList *list
,const gchar *format
,GelPrintFunc stringify_func
);
list
: A GList
format
: (allow-none): Format to use for print each the stringified element. By default
"s
\n"
stringify_func
: The GelPrintFunc to use for stringify elements
Prints a GList to stdout using format
for each element and stringify_func
to stringify elements.
gchar ** gel_list_to_strv (GList *list
,gboolean copy
);
list
: A GList to convert to gchar**
copy
: if TRUE
the data is also copied
Converts a GList to a gchar** optionally copying data (a gchar element-type is assumed)
Returns : |
A gchar** with the elements of list
|
guint gel_object_get_ref_count (GObject *object
);
object
: A GObject
Get the number of references over the object
Returns : |
The number of references |
const gchar * gel_object_get_type_name (GObject *object
);
object
: A GObject
Get object's class printable name
Returns : |
A string containing the object's class name. This string is owned by glib-object and should NOT be freeded. [transfer none] |
void gel_object_interface_print_properties
(gpointer interface
);
gchar * gel_resource_type_get_system_dir (GelResourceType type
);
guint gel_run_once_on_idle (GSourceFunc callback
,gpointer data
,GDestroyNotify destroy
);
guint gel_run_once_on_timeout (guint interval
,GSourceFunc callback
,gpointer data
,GDestroyNotify destroy
);
#define gel_slist_deep_free(list,callback) gel_list_deep_free((GList*)list, callback)
#define gel_slist_deep_free_with_data(list,callback,user_data) gel_list_deep_free_with_data((GList*)list,callback,user_data)
#define gel_slist_printf(list,format,func) gel_list_printf((GList*) list, format, func)
gchar ** gel_strv_concat (gchar **strv_a
,...
);
strv_a
: The first NULL
-terminate array of strings
Varargs
: a NULL
-terminated list of NULL
-terminate array of strings
Concatenates a set of NULL
-terminate array of strings (commonly refered as
strv) into a single one.
Returns : |
the new strv with all the strings copied. [transfer full] |
GList * gel_strv_to_list (gchar **strv
,gboolean copy
);
strv
: A NULL
-terminated array of strings
copy
: if TRUE
the data is also copied
Coverts a gchar** to a GList, see also gel_list_to_strv()
Returns : |
A GList with the elements of strv
|