![]() |
![]() |
![]() |
Clutter 0.2 Reference Manual | ![]() |
---|---|---|---|---|
#define CLUTTER_INIT_ERROR enum ClutterInitError; ClutterInitError clutter_init (int *argc, char ***argv); ClutterInitError clutter_init_with_args (int *argc, char ***argv, char *parameter_string, GOptionEntry *entries, char *translation_domain, GError **error); GOptionGroup* clutter_get_option_group (void); void clutter_main (void); void clutter_main_quit (void); gint clutter_main_level (void); void clutter_redraw (void); Display* clutter_xdisplay (void); gint clutter_xscreen (void); Window clutter_root_xwindow (void); gboolean clutter_want_debug (void); void clutter_threads_enter (void); void clutter_threads_leave (void);
Functions to retrieve various global Clutter resources and other utility functions for mainloops, events and threads
#define CLUTTER_INIT_ERROR (clutter_init_error_quark ())
GError domain for the ClutterInitError enum.
typedef enum { CLUTTER_INIT_SUCCESS = 1, CLUTTER_INIT_ERROR_UNKOWN = 0, CLUTTER_INIT_ERROR_THREADS = -1, CLUTTER_INIT_ERROR_DISPLAY = -2, CLUTTER_INIT_ERROR_INTERNAL = -3, CLUTTER_INIT_ERROR_OPENGL = -4 } ClutterInitError;
Error codes for the Clutter initialisation process.
ClutterInitError clutter_init (int *argc, char ***argv);
It will initialise everything needed to operate with Clutter and
parses some standard command line options. argc
and argv
are
adjusted accordingly so your own code will never see those standard
arguments.
argc : |
The number of arguments in argv
|
argv : |
A pointer to an array of arguments. |
Returns : | 1 on success, < 0 on failure. |
ClutterInitError clutter_init_with_args (int *argc, char ***argv, char *parameter_string, GOptionEntry *entries, char *translation_domain, GError **error);
This function does the same work as clutter_init()
. Additionally,
it allows you to add your own command line options, and it
automatically generates nicely formatted --help
output. Note that your program will be terminated after writing
out the help output. Also note that, in case of error, the
error message will be placed inside error
instead of being
printed on the display.
argc : |
a pointer to the number of command line arguments |
argv : |
a pointer to the array of comman line arguments |
parameter_string : |
a string which is displayed in the
first line of --help output, after
|
entries : |
a NULL terminated array of GOptionEntrys
describing the options of your program
|
translation_domain : |
a translation domain to use for translating
the --help output for the options in entries
with gettext() , or NULL
|
error : |
a return location for a GError |
Returns : | CLUTTER_INIT_SUCCESS if Clutter has been successfully
initialised, or other values or ClutterInitError in case of
error.
|
Since 0.2
GOptionGroup* clutter_get_option_group (void);
Returns a GOptionGroup for the command line arguments recognized
by Clutter. You should add this group to your GOptionContext with
g_option_context_add_group()
, if you are using g_option_context_parse()
to parse your commandline arguments.
Returns : | a GOptionGroup for the commandline arguments recognized by Clutter |
Since 0.2
gint clutter_main_level (void);
Retrieves the depth of the Clutter mainloop.
Returns : | The level of the mainloop. |
Display* clutter_xdisplay (void);
Retrieves the X display that Clutter is using
Returns : | A pointer to an X Display structure. |
gint clutter_xscreen (void);
Retrieves the X screen that Clutter is using.
Returns : | the X screen ID |
gboolean clutter_want_debug (void);
Check if clutter has debugging turned on.
Returns : | TRUE if debugging is turned on, FALSE otherwise. |