mirror of
https://github.com/brl/mutter.git
synced 2025-01-03 08:12:15 +00:00
2006-07-27 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-private.h: Move clutter_feature_init() declaration here: you shouldn't even need to initialise features yourself. * clutter/clutter-feature.c: call clutter_feature_init() each time you try to access the feature list; add a static lock around the feature flags container; add api documentation. * clutter/clutter-feature.h: Add a type for the feature flags to make bindings happy.
This commit is contained in:
parent
ecccec75cb
commit
ad29f37780
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
|||||||
|
2006-07-27 Emmanuele Bassi <ebassi@openedhand.com>
|
||||||
|
|
||||||
|
* clutter/clutter-private.h: Move clutter_feature_init()
|
||||||
|
declaration here: you shouldn't even need to initialise
|
||||||
|
features yourself.
|
||||||
|
|
||||||
|
* clutter/clutter-feature.c: call clutter_feature_init()
|
||||||
|
each time you try to access the feature list; add a static
|
||||||
|
lock around the feature flags container; add api documentation.
|
||||||
|
|
||||||
|
* clutter/clutter-feature.h: Add a type for the feature flags
|
||||||
|
to make bindings happy.
|
||||||
|
|
||||||
2006-07-24 Matthew Allum <mallum@openedhand.com>
|
2006-07-24 Matthew Allum <mallum@openedhand.com>
|
||||||
|
|
||||||
* clutter/Makefile.am:
|
* clutter/Makefile.am:
|
||||||
|
@ -34,7 +34,8 @@
|
|||||||
#include "clutter-feature.h"
|
#include "clutter-feature.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
|
||||||
static gulong __features;
|
G_LOCK_DEFINE_STATIC (__features);
|
||||||
|
static ClutterFeatureFlags __features;
|
||||||
|
|
||||||
/* Note must be called after context created */
|
/* Note must be called after context created */
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -65,20 +66,9 @@ check_gl_extension (const gchar *name)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
/* HOLDS: __features lock */
|
||||||
clutter_feature_available (gulong query)
|
static void
|
||||||
{
|
clutter_feature_init_do (void)
|
||||||
return (__features & query);
|
|
||||||
}
|
|
||||||
|
|
||||||
gulong
|
|
||||||
clutter_feature_all (void)
|
|
||||||
{
|
|
||||||
return __features;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
clutter_feature_init (void)
|
|
||||||
{
|
{
|
||||||
if (__features)
|
if (__features)
|
||||||
return;
|
return;
|
||||||
@ -87,5 +77,46 @@ clutter_feature_init (void)
|
|||||||
|
|
||||||
if (check_gl_extension ("GL_ARB_texture_rectangle"))
|
if (check_gl_extension ("GL_ARB_texture_rectangle"))
|
||||||
__features |= CLUTTER_FEATURE_TEXTURE_RECTANGLE;
|
__features |= CLUTTER_FEATURE_TEXTURE_RECTANGLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
clutter_feature_init (void)
|
||||||
|
{
|
||||||
|
G_LOCK (__features);
|
||||||
|
clutter_feature_init_do ();
|
||||||
|
G_UNLOCK (__features);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_feature_available:
|
||||||
|
* @feature: a #ClutterFeatureFlags
|
||||||
|
*
|
||||||
|
* Checks whether @feature is available. @feature can be a logical
|
||||||
|
* OR of #ClutterFeatureFlags.
|
||||||
|
*
|
||||||
|
* Return value: %TRUE if a feature is available
|
||||||
|
*
|
||||||
|
* Since: 0.1.1
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
clutter_feature_available (ClutterFeatureFlags feature)
|
||||||
|
{
|
||||||
|
clutter_feature_init ();
|
||||||
|
return (__features & feature);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_feature_all:
|
||||||
|
*
|
||||||
|
* Returns all the suppoerted features.
|
||||||
|
*
|
||||||
|
* Return value: a logical OR of all the supported features.
|
||||||
|
*
|
||||||
|
* Since: 0.1.1
|
||||||
|
*/
|
||||||
|
ClutterFeatureFlags
|
||||||
|
clutter_feature_all (void)
|
||||||
|
{
|
||||||
|
clutter_feature_init ();
|
||||||
|
return __features;
|
||||||
}
|
}
|
||||||
|
@ -39,19 +39,13 @@
|
|||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
enum
|
typedef enum
|
||||||
{
|
{
|
||||||
CLUTTER_FEATURE_TEXTURE_RECTANGLE = (1 << 1)
|
CLUTTER_FEATURE_TEXTURE_RECTANGLE = (1 << 1)
|
||||||
};
|
} ClutterFeatureFlags;
|
||||||
|
|
||||||
gboolean
|
gboolean clutter_feature_available (ClutterFeatureFlags flags);
|
||||||
clutter_feature_available (gulong query);
|
ClutterFeatureFlags clutter_feature_get_all (void);
|
||||||
|
|
||||||
gulong
|
|
||||||
clutter_feature_get_all (void);
|
|
||||||
|
|
||||||
void
|
|
||||||
clutter_feature_init (void);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@ -82,6 +82,8 @@ typedef enum {
|
|||||||
#define CLUTTER_SET_PRIVATE_FLAGS(a,f) G_STMT_START{ (CLUTTER_PRIVATE_FLAGS (a) |= (f)); }G_STMT_END
|
#define CLUTTER_SET_PRIVATE_FLAGS(a,f) G_STMT_START{ (CLUTTER_PRIVATE_FLAGS (a) |= (f)); }G_STMT_END
|
||||||
#define CLUTTER_UNSET_PRIVATE_FLAGS(a,f) G_STMT_START{ (CLUTTER_PRIVATE_FLAGS (a) &= ~(f)); }G_STMT_END
|
#define CLUTTER_UNSET_PRIVATE_FLAGS(a,f) G_STMT_START{ (CLUTTER_PRIVATE_FLAGS (a) &= ~(f)); }G_STMT_END
|
||||||
|
|
||||||
|
void clutter_feature_init (void);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user