Add base initialisation function

Add a semi-private function, called clutter_base_init(), which initialises
the basic Clutter functionalities (at the moment, just the GLib type system)
without calling in the backend-specific code. This function is only useful
for gtk-doc, to introspect the library when generating documentation for
signals, properties and class hierarchy.

Also, change the documentation build system to use clutter_base_init() when
launching the scanner program.
This commit is contained in:
Emmanuele Bassi 2007-05-16 15:00:41 +00:00
parent 06bf2ddaef
commit 507f04a8f6
11 changed files with 71 additions and 74 deletions

View File

@ -1,3 +1,12 @@
2007-05-16 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-main.[ch]: Add clutter_base_init(), semi-private
function to initialise just the base Clutter functionalities; it's
only used by gtk-doc to introspect the classes.
* clutter/clutter-feature.c: Do not access the private features
data structure unless it has been initialised.
2007-05-16 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-alpha.h:

View File

@ -93,7 +93,10 @@ _clutter_feature_init (void)
gboolean
clutter_feature_available (ClutterFeatureFlags feature)
{
return (__features->flags & feature);
if (G_UNLIKELY (!__features))
return FALSE;
return (__features->flags & feature);
}
/**

View File

@ -642,3 +642,18 @@ _clutter_boolean_accumulator (GSignalInvocationHint *ihint,
return continue_emission;
}
void
clutter_base_init (void)
{
static gboolean initialised = FALSE;
if (!initialised)
{
initialised = TRUE;
/* initialise GLib type system */
g_type_init ();
clutter_actor_get_type ();
}
}

View File

@ -60,12 +60,14 @@ gint clutter_main_level (void);
void clutter_redraw (void);
gboolean clutter_get_debug_enabled (void);
gboolean clutter_get_show_fps (void);
gboolean clutter_get_debug_enabled (void);
gboolean clutter_get_show_fps (void);
void clutter_threads_enter (void);
void clutter_threads_leave (void);
void clutter_base_init (void);
G_END_DECLS
#endif

View File

@ -1,3 +1,8 @@
2007-05-16 Emmanuele Bassi <ebassi@openedhand.com>
* Makefile.am: Use the newly added clutter_base_init() function
when scanning the library for documentation.
2007-04-16 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-docs.sgml:

View File

@ -21,7 +21,7 @@ DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
DOC_SOURCE_DIR=../../clutter
# Extra options to pass to gtkdoc-scangobj. Not normally needed.
SCANGOBJ_OPTIONS=
SCANGOBJ_OPTIONS=--type-init-func="clutter_base_init()"
# Extra options to supply to gtkdoc-scan.
# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"

View File

@ -134,7 +134,6 @@ frame 15, and threshold of 1.0 to frame 60.
@min: lower threshold; a #ClutterFixed value from &lt;0,1&gt;
@max: upper threshold; a #ClutterFixed value from &lt;0,1&gt;
<!-- ##### FUNCTION clutter_smoothstep_copy ##### -->
<para>
@ -237,3 +236,20 @@ Symbolic name for passing clutter_sine_func().
@Returns:
<!-- ##### MACRO CLUTTER_ALPHA_SMOOTHSTEP ##### -->
<para>
</para>
<!-- ##### FUNCTION clutter_smoothstep_func ##### -->
<para>
</para>
@alpha:
@data:
@Returns:

View File

@ -58,60 +58,6 @@ ClutterBackend
@event:
<!-- ##### FUNCTION clutter_backend_get_width ##### -->
<para>
</para>
@backend:
@Returns:
<!-- ##### FUNCTION clutter_backend_get_height ##### -->
<para>
</para>
@backend:
@Returns:
<!-- ##### FUNCTION clutter_backend_get_width_mm ##### -->
<para>
</para>
@backend:
@Returns:
<!-- ##### FUNCTION clutter_backend_get_height_mm ##### -->
<para>
</para>
@backend:
@Returns:
<!-- ##### FUNCTION clutter_backend_get_screen_number ##### -->
<para>
</para>
@backend:
@Returns:
<!-- ##### FUNCTION clutter_backend_get_n_screens ##### -->
<para>
</para>
@backend:
@Returns:
<!-- ##### FUNCTION clutter_backend_get_double_click_time ##### -->
<para>

View File

@ -24,6 +24,7 @@ clutter-feature
@CLUTTER_FEATURE_TEXTURE_RECTANGLE:
@CLUTTER_FEATURE_SYNC_TO_VBLANK:
@CLUTTER_FEATURE_TEXTURE_READ_PIXELS:
<!-- ##### FUNCTION clutter_feature_available ##### -->
<para>
@ -42,10 +43,3 @@ clutter-feature
@Returns:
<!-- ##### FUNCTION clutter_feature_wait_for_vblank ##### -->
<para>
</para>

View File

@ -83,14 +83,6 @@ Error codes for the Clutter initialisation process.
@Returns:
<!-- ##### FUNCTION clutter_get_vblank_method ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION clutter_main ##### -->
<para>

View File

@ -23,6 +23,21 @@ clutter-media
</para>
<!-- ##### SIGNAL ClutterMedia::eos ##### -->
<para>
</para>
@cluttermedia: the object which received the signal.
<!-- ##### SIGNAL ClutterMedia::error ##### -->
<para>
</para>
@cluttermedia: the object which received the signal.
@arg1:
<!-- ##### ARG ClutterMedia:buffer-percent ##### -->
<para>