clutter-main

clutter-main — Various 'global' clutter functions.

Synopsis




#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);

Description

Functions to retrieve various global Clutter resources and other utility functions for mainloops, events and threads

Details

CLUTTER_INIT_ERROR

#define CLUTTER_INIT_ERROR      (clutter_init_error_quark ())

GError domain for the ClutterInitError enum.


enum ClutterInitError

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.

CLUTTER_INIT_SUCCESS Clutter was successfully initialised
CLUTTER_INIT_ERROR_UNKOWN Unknown error while initialising Clutter
CLUTTER_INIT_ERROR_THREADS Unable to initialise threading
CLUTTER_INIT_ERROR_DISPLAY Unable to open the X display
CLUTTER_INIT_ERROR_INTERNAL Internal Clutter error
CLUTTER_INIT_ERROR_OPENGL Unable to initialise OpenGL

clutter_init ()

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.

clutter_init_with_args ()

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 programname [OPTION...]
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


clutter_get_option_group ()

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


clutter_main ()

void        clutter_main                    (void);

Starts the Clutter mainloop.


clutter_main_quit ()

void        clutter_main_quit               (void);

Terminates the Clutter mainloop.


clutter_main_level ()

gint        clutter_main_level              (void);

Retrieves the depth of the Clutter mainloop.

Returns : The level of the mainloop.

clutter_redraw ()

void        clutter_redraw                  (void);

FIXME


clutter_xdisplay ()

Display*    clutter_xdisplay                (void);

Retrieves the X display that Clutter is using

Returns : A pointer to an X Display structure.

clutter_xscreen ()

gint        clutter_xscreen                 (void);

Retrieves the X screen that Clutter is using.

Returns : the X screen ID

clutter_root_xwindow ()

Window      clutter_root_xwindow            (void);

FIXME

Returns : FIXME

clutter_want_debug ()

gboolean    clutter_want_debug              (void);

Check if clutter has debugging turned on.

Returns : TRUE if debugging is turned on, FALSE otherwise.

clutter_threads_enter ()

void        clutter_threads_enter           (void);

Locks the Clutter thread lock.


clutter_threads_leave ()

void        clutter_threads_leave           (void);

Unlocks the Clutter thread lock.