4 * An OpenGL based 'interactive canvas' library.
6 * Authored By Matthew Allum <mallum@openedhand.com>
8 * Copyright (C) 2006 OpenedHand
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
24 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
25 #error "Only <clutter/clutter.h> can be included directly."
28 #ifndef __CLUTTER_MAIN_H__
29 #define __CLUTTER_MAIN_H__
31 #include <clutter/clutter-actor.h>
32 #include <clutter/clutter-stage.h>
33 #include <pango/pango.h>
40 * #GError domain for #ClutterInitError
42 #define CLUTTER_INIT_ERROR (clutter_init_error_quark ())
46 * @CLUTTER_INIT_SUCCESS: Initialisation successful
47 * @CLUTTER_INIT_ERROR_UNKNOWN: Unknown error
48 * @CLUTTER_INIT_ERROR_THREADS: Thread initialisation failed
49 * @CLUTTER_INIT_ERROR_BACKEND: Backend initialisation failed
50 * @CLUTTER_INIT_ERROR_INTERNAL: Internal error
52 * Error conditions returned by clutter_init() and clutter_init_with_args().
57 CLUTTER_INIT_SUCCESS = 1,
58 CLUTTER_INIT_ERROR_UNKNOWN = 0,
59 CLUTTER_INIT_ERROR_THREADS = -1,
60 CLUTTER_INIT_ERROR_BACKEND = -2,
61 CLUTTER_INIT_ERROR_INTERNAL = -3
64 GQuark clutter_init_error_quark (void);
67 * CLUTTER_PRIORITY_REDRAW:
69 * Priority of the redraws. This is chosen to be lower than the GTK+
70 * redraw and resize priorities, because in application with both
71 * GTK+ and Clutter it's more likely that the Clutter part will be
72 * continually animating (and thus able to starve GTK+) than
77 #define CLUTTER_PRIORITY_REDRAW (G_PRIORITY_HIGH_IDLE + 50)
80 void clutter_base_init (void);
81 ClutterInitError clutter_init (int *argc,
82 char ***argv) G_GNUC_WARN_UNUSED_RESULT;
83 ClutterInitError clutter_init_with_args (int *argc,
85 const char *parameter_string,
86 GOptionEntry *entries,
87 const char *translation_domain,
88 GError **error) G_GNUC_WARN_UNUSED_RESULT;
90 GOptionGroup * clutter_get_option_group (void);
91 GOptionGroup * clutter_get_option_group_without_init (void);
94 void clutter_main (void);
95 void clutter_main_quit (void);
96 gint clutter_main_level (void);
98 void clutter_do_event (ClutterEvent *event);
100 /* Debug utility functions */
101 gboolean clutter_get_accessibility_enabled (void);
103 /* Threading functions */
104 void clutter_threads_enter (void);
105 void clutter_threads_leave (void);
106 void clutter_threads_set_lock_functions (GCallback enter_fn,
108 guint clutter_threads_add_idle (GSourceFunc func,
110 guint clutter_threads_add_idle_full (gint priority,
113 GDestroyNotify notify);
114 guint clutter_threads_add_timeout (guint interval,
117 guint clutter_threads_add_timeout_full (gint priority,
121 GDestroyNotify notify);
122 guint clutter_threads_add_repaint_func (GSourceFunc func,
124 GDestroyNotify notify);
125 CLUTTER_AVAILABLE_IN_1_10
126 guint clutter_threads_add_repaint_func_full (ClutterRepaintFlags flags,
129 GDestroyNotify notify);
130 void clutter_threads_remove_repaint_func (guint handle_id);
132 void clutter_grab_pointer (ClutterActor *actor);
133 void clutter_ungrab_pointer (void);
134 ClutterActor * clutter_get_pointer_grab (void);
135 void clutter_grab_keyboard (ClutterActor *actor);
136 void clutter_ungrab_keyboard (void);
137 ClutterActor * clutter_get_keyboard_grab (void);
139 PangoFontMap * clutter_get_font_map (void);
141 ClutterTextDirection clutter_get_default_text_direction (void);
143 guint clutter_get_default_frame_rate (void);
147 #endif /* _CLUTTER_MAIN_H__ */