mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 19:40:43 -05:00
Merge branch 'master' into msvc-support-master
This commit is contained in:
commit
b1780711f7
@ -284,6 +284,8 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "cogl/cogl.h"
|
||||
|
||||
#include "clutter-actor-private.h"
|
||||
@ -10200,6 +10202,26 @@ clutter_actor_shader_post_paint (ClutterActor *actor)
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
clutter_actor_set_shader_param_internal (ClutterActor *self,
|
||||
const gchar *param,
|
||||
const GValue *value)
|
||||
{
|
||||
ShaderData *shader_data;
|
||||
GValue *var;
|
||||
|
||||
shader_data = g_object_get_qdata (G_OBJECT (self), quark_shader_data);
|
||||
if (shader_data == NULL)
|
||||
return;
|
||||
|
||||
var = g_slice_new0 (GValue);
|
||||
g_value_init (var, G_VALUE_TYPE (value));
|
||||
g_value_copy (value, var);
|
||||
g_hash_table_insert (shader_data->value_hash, g_strdup (param), var);
|
||||
|
||||
clutter_actor_queue_redraw (self);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_actor_set_shader_param:
|
||||
* @self: a #ClutterActor
|
||||
@ -10218,9 +10240,6 @@ clutter_actor_set_shader_param (ClutterActor *self,
|
||||
const gchar *param,
|
||||
const GValue *value)
|
||||
{
|
||||
ShaderData *shader_data;
|
||||
GValue *var;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||
g_return_if_fail (param != NULL);
|
||||
g_return_if_fail (CLUTTER_VALUE_HOLDS_SHADER_FLOAT (value) ||
|
||||
@ -10229,16 +10248,7 @@ clutter_actor_set_shader_param (ClutterActor *self,
|
||||
G_VALUE_HOLDS_FLOAT (value) ||
|
||||
G_VALUE_HOLDS_INT (value));
|
||||
|
||||
shader_data = g_object_get_qdata (G_OBJECT (self), quark_shader_data);
|
||||
if (shader_data == NULL)
|
||||
return;
|
||||
|
||||
var = g_slice_new0 (GValue);
|
||||
g_value_init (var, G_VALUE_TYPE (value));
|
||||
g_value_copy (value, var);
|
||||
g_hash_table_insert (shader_data->value_hash, g_strdup (param), var);
|
||||
|
||||
clutter_actor_queue_redraw (self);
|
||||
clutter_actor_set_shader_param_internal (self, param, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -10264,7 +10274,7 @@ clutter_actor_set_shader_param_float (ClutterActor *self,
|
||||
g_value_init (&var, G_TYPE_FLOAT);
|
||||
g_value_set_float (&var, value);
|
||||
|
||||
clutter_actor_set_shader_param (self, param, &var);
|
||||
clutter_actor_set_shader_param_internal (self, param, &var);
|
||||
|
||||
g_value_unset (&var);
|
||||
}
|
||||
@ -10292,7 +10302,7 @@ clutter_actor_set_shader_param_int (ClutterActor *self,
|
||||
g_value_init (&var, G_TYPE_INT);
|
||||
g_value_set_int (&var, value);
|
||||
|
||||
clutter_actor_set_shader_param (self, param, &var);
|
||||
clutter_actor_set_shader_param_internal (self, param, &var);
|
||||
|
||||
g_value_unset (&var);
|
||||
}
|
||||
|
@ -142,13 +142,14 @@ clutter_align_constraint_update_allocation (ClutterConstraint *constraint,
|
||||
if (align->source == NULL)
|
||||
return;
|
||||
|
||||
clutter_actor_box_get_size (allocation, &actor_width, &actor_height);
|
||||
|
||||
clutter_actor_get_position (align->source, &source_x, &source_y);
|
||||
clutter_actor_get_size (align->source, &source_width, &source_height);
|
||||
|
||||
switch (align->align_axis)
|
||||
{
|
||||
case CLUTTER_ALIGN_X_AXIS:
|
||||
actor_width = clutter_actor_box_get_width (allocation);
|
||||
allocation->x1 = ((source_width - actor_width) * align->factor)
|
||||
+ source_x;
|
||||
allocation->x1 = floorf (allocation->x1 + 0.5);
|
||||
@ -156,13 +157,23 @@ clutter_align_constraint_update_allocation (ClutterConstraint *constraint,
|
||||
break;
|
||||
|
||||
case CLUTTER_ALIGN_Y_AXIS:
|
||||
actor_height = clutter_actor_box_get_height (allocation);
|
||||
allocation->y1 = ((source_height - actor_height) * align->factor)
|
||||
+ source_y;
|
||||
allocation->y1 = floorf (allocation->y1 + 0.5);
|
||||
allocation->y2 = allocation->y1 + actor_height;
|
||||
break;
|
||||
|
||||
case CLUTTER_ALIGN_BOTH:
|
||||
allocation->x1 = ((source_width - actor_width) * align->factor)
|
||||
+ source_x;
|
||||
allocation->y1 = ((source_height - actor_height) * align->factor)
|
||||
+ source_y;
|
||||
allocation->x1 = floorf (allocation->x1 + 0.5f);
|
||||
allocation->y1 = floorf (allocation->y1 + 0.5f);
|
||||
allocation->x2 = allocation->x1 + actor_width;
|
||||
allocation->y2 = allocation->y1 + actor_height;
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
|
@ -27,8 +27,7 @@ typedef enum {
|
||||
CLUTTER_DEBUG_PICK = 1 << 16,
|
||||
CLUTTER_DEBUG_EVENTLOOP = 1 << 17,
|
||||
CLUTTER_DEBUG_CLIPPING = 1 << 18,
|
||||
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 19,
|
||||
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 20,
|
||||
CLUTTER_DEBUG_OOB_TRANSFORMS = 1 << 19
|
||||
} ClutterDebugFlag;
|
||||
|
||||
typedef enum {
|
||||
@ -43,7 +42,8 @@ typedef enum {
|
||||
CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3,
|
||||
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
|
||||
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
|
||||
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6
|
||||
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
|
||||
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7
|
||||
} ClutterDrawDebugFlag;
|
||||
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
|
@ -291,7 +291,7 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect)
|
||||
else if (priv->back_material == COGL_INVALID_HANDLE && is_cull_enabled)
|
||||
cogl_set_backface_culling_enabled (TRUE);
|
||||
|
||||
if (G_UNLIKELY (clutter_debug_flags & CLUTTER_DEBUG_PAINT_DEFORM_TILES))
|
||||
if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_DEFORM_TILES))
|
||||
{
|
||||
cogl_set_source_color4f (1.0, 0, 0, 1.0);
|
||||
cogl_vertex_buffer_draw_elements (priv->vbo,
|
||||
|
@ -416,15 +416,17 @@ typedef enum {
|
||||
* ClutterAlignAxis:
|
||||
* @CLUTTER_ALIGN_X_AXIS: Maintain the alignment on the X axis
|
||||
* @CLUTTER_ALIGN_Y_AXIS: Maintain the alignment on the Y axis
|
||||
* @CLUTTER_ALIGN_BOTH: Maintain the alignment on both the X and Y axis
|
||||
*
|
||||
* Specifies the axis on which #ClutterAlignConstraint should maintain
|
||||
* the alignment
|
||||
* the alignment.
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
typedef enum { /*< prefix=CLUTTER_ALIGN >*/
|
||||
CLUTTER_ALIGN_X_AXIS,
|
||||
CLUTTER_ALIGN_Y_AXIS
|
||||
CLUTTER_ALIGN_Y_AXIS,
|
||||
CLUTTER_ALIGN_BOTH
|
||||
} ClutterAlignAxis;
|
||||
|
||||
/**
|
||||
|
@ -77,6 +77,16 @@
|
||||
* g_timeout_add() that acquire the Clutter lock before invoking the provided
|
||||
* callback: clutter_threads_add_idle() and
|
||||
* clutter_threads_add_timeout().</para>
|
||||
* <para>The example below shows how to use a worker thread to perform a
|
||||
* blocking operation, and perform UI updates using the main loop.</para>
|
||||
* <example id="worker-thread-example">
|
||||
* <title>A worker thread example</title>
|
||||
* <programlisting>
|
||||
* <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../tests/interactive/test-thread.c">
|
||||
* <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback>
|
||||
* </xi:include>
|
||||
* </programlisting>
|
||||
* </example>
|
||||
* </refsect2>
|
||||
*/
|
||||
|
||||
@ -166,13 +176,12 @@ static const GDebugKey clutter_debug_keys[] = {
|
||||
{ "layout", CLUTTER_DEBUG_LAYOUT },
|
||||
{ "clipping", CLUTTER_DEBUG_CLIPPING },
|
||||
{ "oob-transforms", CLUTTER_DEBUG_OOB_TRANSFORMS },
|
||||
{ "paint-deform-tiles", CLUTTER_DEBUG_PAINT_DEFORM_TILES },
|
||||
};
|
||||
#endif /* CLUTTER_ENABLE_DEBUG */
|
||||
|
||||
static const GDebugKey clutter_pick_debug_keys[] = {
|
||||
{ "nop-picking", CLUTTER_DEBUG_NOP_PICKING },
|
||||
{ "dump-pick-buffers", CLUTTER_DEBUG_DUMP_PICK_BUFFERS }
|
||||
{ "dump-pick-buffers", CLUTTER_DEBUG_DUMP_PICK_BUFFERS },
|
||||
};
|
||||
|
||||
static const GDebugKey clutter_paint_debug_keys[] = {
|
||||
@ -182,7 +191,8 @@ static const GDebugKey clutter_paint_debug_keys[] = {
|
||||
{ "paint-volumes", CLUTTER_DEBUG_PAINT_VOLUMES },
|
||||
{ "disable-culling", CLUTTER_DEBUG_DISABLE_CULLING },
|
||||
{ "disable-offscreen-redirect", CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT },
|
||||
{ "continuous-redraw", CLUTTER_DEBUG_CONTINUOUS_REDRAW }
|
||||
{ "continuous-redraw", CLUTTER_DEBUG_CONTINUOUS_REDRAW },
|
||||
{ "paint-deform-tiles", CLUTTER_DEBUG_PAINT_DEFORM_TILES },
|
||||
};
|
||||
|
||||
#ifdef CLUTTER_ENABLE_PROFILE
|
||||
@ -2855,6 +2865,7 @@ void
|
||||
clutter_grab_pointer_for_device (ClutterActor *actor,
|
||||
gint id_)
|
||||
{
|
||||
ClutterDeviceManager *manager;
|
||||
ClutterInputDevice *dev;
|
||||
|
||||
g_return_if_fail (actor == NULL || CLUTTER_IS_ACTOR (actor));
|
||||
@ -2870,7 +2881,8 @@ clutter_grab_pointer_for_device (ClutterActor *actor,
|
||||
return;
|
||||
}
|
||||
|
||||
dev = clutter_get_input_device_for_id (id_);
|
||||
manager = clutter_device_manager_get_default ();
|
||||
dev = clutter_device_manager_get_device (manager, id_);
|
||||
if (dev == NULL)
|
||||
return;
|
||||
|
||||
@ -2910,7 +2922,13 @@ clutter_ungrab_pointer (void)
|
||||
void
|
||||
clutter_ungrab_pointer_for_device (gint id_)
|
||||
{
|
||||
clutter_grab_pointer_for_device (NULL, id_);
|
||||
ClutterDeviceManager *manager;
|
||||
ClutterInputDevice *device;
|
||||
|
||||
manager = clutter_device_manager_get_default ();
|
||||
device = clutter_device_manager_get_device (manager, id_);
|
||||
if (device != NULL)
|
||||
clutter_input_device_ungrab (device);
|
||||
}
|
||||
|
||||
|
||||
@ -3061,29 +3079,47 @@ clutter_set_font_flags (ClutterFontFlags flags)
|
||||
ClutterFontFlags old_flags, changed_flags;
|
||||
const cairo_font_options_t *font_options;
|
||||
cairo_font_options_t *new_font_options;
|
||||
cairo_hint_style_t hint_style;
|
||||
gboolean use_mipmapping;
|
||||
ClutterBackend *backend;
|
||||
|
||||
backend = clutter_get_default_backend ();
|
||||
|
||||
font_map = clutter_context_get_pango_fontmap ();
|
||||
use_mipmapping = (flags & CLUTTER_FONT_MIPMAPPING) != 0;
|
||||
cogl_pango_font_map_set_use_mipmapping (font_map, use_mipmapping);
|
||||
|
||||
old_flags = clutter_get_font_flags ();
|
||||
|
||||
font_options = clutter_backend_get_font_options (backend);
|
||||
old_flags = 0;
|
||||
|
||||
if (cogl_pango_font_map_get_use_mipmapping (font_map))
|
||||
old_flags |= CLUTTER_FONT_MIPMAPPING;
|
||||
|
||||
hint_style = cairo_font_options_get_hint_style (font_options);
|
||||
if (hint_style != CAIRO_HINT_STYLE_DEFAULT &&
|
||||
hint_style != CAIRO_HINT_STYLE_NONE)
|
||||
old_flags |= CLUTTER_FONT_HINTING;
|
||||
|
||||
if (old_flags == flags)
|
||||
return;
|
||||
|
||||
new_font_options = cairo_font_options_copy (font_options);
|
||||
|
||||
/* Only set the font options that have actually changed so we don't
|
||||
override a detailed setting from the backend */
|
||||
changed_flags = old_flags ^ flags;
|
||||
|
||||
if ((changed_flags & CLUTTER_FONT_MIPMAPPING))
|
||||
{
|
||||
use_mipmapping = (changed_flags & CLUTTER_FONT_MIPMAPPING) != 0;
|
||||
|
||||
cogl_pango_font_map_set_use_mipmapping (font_map, use_mipmapping);
|
||||
}
|
||||
|
||||
if ((changed_flags & CLUTTER_FONT_HINTING))
|
||||
cairo_font_options_set_hint_style (new_font_options,
|
||||
(flags & CLUTTER_FONT_HINTING)
|
||||
? CAIRO_HINT_STYLE_FULL
|
||||
: CAIRO_HINT_STYLE_NONE);
|
||||
{
|
||||
hint_style = (flags & CLUTTER_FONT_HINTING)
|
||||
? CAIRO_HINT_STYLE_FULL
|
||||
: CAIRO_HINT_STYLE_NONE;
|
||||
|
||||
cairo_font_options_set_hint_style (new_font_options, hint_style);
|
||||
}
|
||||
|
||||
clutter_backend_set_font_options (backend, new_font_options);
|
||||
|
||||
|
@ -1582,3 +1582,65 @@ clutter_path_node_equal (const ClutterPathNode *node_a,
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
G_DEFINE_BOXED_TYPE (ClutterKnot, clutter_knot,
|
||||
clutter_knot_copy,
|
||||
clutter_knot_free);
|
||||
|
||||
/**
|
||||
* clutter_knot_copy:
|
||||
* @knot: a #ClutterKnot
|
||||
*
|
||||
* Makes an allocated copy of a knot.
|
||||
*
|
||||
* Return value: the copied knot.
|
||||
*
|
||||
* Since: 0.2
|
||||
*/
|
||||
ClutterKnot *
|
||||
clutter_knot_copy (const ClutterKnot *knot)
|
||||
{
|
||||
if (G_UNLIKELY (knot == NULL))
|
||||
return NULL;
|
||||
|
||||
return g_slice_dup (ClutterKnot, knot);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_knot_free:
|
||||
* @knot: a #ClutterKnot
|
||||
*
|
||||
* Frees the memory of an allocated knot.
|
||||
*
|
||||
* Since: 0.2
|
||||
*/
|
||||
void
|
||||
clutter_knot_free (ClutterKnot *knot)
|
||||
{
|
||||
if (G_LIKELY (knot != NULL))
|
||||
g_slice_free (ClutterKnot, knot);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_knot_equal:
|
||||
* @knot_a: First knot
|
||||
* @knot_b: Second knot
|
||||
*
|
||||
* Compares to knot and checks if the point to the same location.
|
||||
*
|
||||
* Return value: %TRUE if the knots point to the same location.
|
||||
*
|
||||
* Since: 0.2
|
||||
*/
|
||||
gboolean
|
||||
clutter_knot_equal (const ClutterKnot *knot_a,
|
||||
const ClutterKnot *knot_b)
|
||||
{
|
||||
g_return_val_if_fail (knot_a != NULL, FALSE);
|
||||
g_return_val_if_fail (knot_b != NULL, FALSE);
|
||||
|
||||
if (knot_a == knot_b)
|
||||
return TRUE;
|
||||
|
||||
return knot_a->x == knot_b->x && knot_a->y == knot_b->y;
|
||||
}
|
||||
|
@ -44,6 +44,9 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
/* sadly, we are still using ClutterShader internally */
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "clutter-texture.h"
|
||||
|
||||
#include "clutter-actor-private.h"
|
||||
@ -54,8 +57,9 @@
|
||||
#include "clutter-marshal.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-scriptable.h"
|
||||
#include "clutter-shader.h"
|
||||
#include "clutter-stage-private.h"
|
||||
|
||||
#include "clutter-shader.h"
|
||||
#include "clutter-util.h"
|
||||
|
||||
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "clutter-behaviour.h"
|
||||
#include "clutter-behaviour-depth.h"
|
||||
#include "clutter-enum-types.h"
|
||||
|
@ -34,8 +34,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION)
|
||||
|
||||
#define CLUTTER_TYPE_BEHAVIOUR_DEPTH (clutter_behaviour_depth_get_type ())
|
||||
#define CLUTTER_BEHAVIOUR_DEPTH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BEHAVIOUR_DEPTH, ClutterBehaviourDepth))
|
||||
#define CLUTTER_IS_BEHAVIOUR_DEPTH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BEHAVIOUR_DEPTH))
|
||||
@ -82,19 +80,21 @@ struct _ClutterBehaviourDepthClass
|
||||
};
|
||||
|
||||
GType clutter_behaviour_depth_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_actor_animate and ClutterActor:depth)
|
||||
ClutterBehaviour *clutter_behaviour_depth_new (ClutterAlpha *alpha,
|
||||
gint depth_start,
|
||||
gint depth_end);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_depth_set_bounds (ClutterBehaviourDepth *behaviour,
|
||||
gint depth_start,
|
||||
gint depth_end);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_depth_get_bounds (ClutterBehaviourDepth *behaviour,
|
||||
gint *depth_start,
|
||||
gint *depth_end);
|
||||
|
||||
#endif /* CLUTTER_DISABLE_DEPRECATED */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_BEHAVIOUR_DEPTH__ */
|
||||
|
@ -50,6 +50,8 @@
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "clutter-behaviour.h"
|
||||
#include "clutter-behaviour-ellipse.h"
|
||||
#include "clutter-debug.h"
|
||||
|
@ -32,8 +32,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION)
|
||||
|
||||
#define CLUTTER_TYPE_BEHAVIOUR_ELLIPSE (clutter_behaviour_ellipse_get_type ())
|
||||
|
||||
#define CLUTTER_BEHAVIOUR_ELLIPSE(obj) \
|
||||
@ -94,6 +92,7 @@ struct _ClutterBehaviourEllipseClass
|
||||
|
||||
GType clutter_behaviour_ellipse_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_actor_animate)
|
||||
ClutterBehaviour * clutter_behaviour_ellipse_new (ClutterAlpha *alpha,
|
||||
gint x,
|
||||
gint y,
|
||||
@ -102,43 +101,58 @@ ClutterBehaviour * clutter_behaviour_ellipse_new (ClutterAlpha
|
||||
ClutterRotateDirection direction,
|
||||
gdouble start,
|
||||
gdouble end);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_ellipse_set_center (ClutterBehaviourEllipse *self,
|
||||
gint x,
|
||||
gint y);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_ellipse_get_center (ClutterBehaviourEllipse *self,
|
||||
gint *x,
|
||||
gint *y);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_ellipse_set_width (ClutterBehaviourEllipse *self,
|
||||
gint width);
|
||||
CLUTTER_DEPRECATED
|
||||
gint clutter_behaviour_ellipse_get_width (ClutterBehaviourEllipse *self);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_ellipse_set_height (ClutterBehaviourEllipse *self,
|
||||
gint height);
|
||||
CLUTTER_DEPRECATED
|
||||
gint clutter_behaviour_ellipse_get_height (ClutterBehaviourEllipse *self);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_ellipse_set_angle_start (ClutterBehaviourEllipse *self,
|
||||
gdouble angle_start);
|
||||
CLUTTER_DEPRECATED
|
||||
gdouble clutter_behaviour_ellipse_get_angle_start (ClutterBehaviourEllipse *self);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_ellipse_set_angle_end (ClutterBehaviourEllipse *self,
|
||||
gdouble angle_end);
|
||||
CLUTTER_DEPRECATED
|
||||
gdouble clutter_behaviour_ellipse_get_angle_end (ClutterBehaviourEllipse *self);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_ellipse_set_angle_tilt (ClutterBehaviourEllipse *self,
|
||||
ClutterRotateAxis axis,
|
||||
gdouble angle_tilt);
|
||||
CLUTTER_DEPRECATED
|
||||
gdouble clutter_behaviour_ellipse_get_angle_tilt (ClutterBehaviourEllipse *self,
|
||||
ClutterRotateAxis axis);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_ellipse_set_tilt (ClutterBehaviourEllipse *self,
|
||||
gdouble angle_tilt_x,
|
||||
gdouble angle_tilt_y,
|
||||
gdouble angle_tilt_z);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_ellipse_get_tilt (ClutterBehaviourEllipse *self,
|
||||
gdouble *angle_tilt_x,
|
||||
gdouble *angle_tilt_y,
|
||||
gdouble *angle_tilt_z);
|
||||
CLUTTER_DEPRECATED
|
||||
ClutterRotateDirection clutter_behaviour_ellipse_get_direction (ClutterBehaviourEllipse *self);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_ellipse_set_direction (ClutterBehaviourEllipse *self,
|
||||
ClutterRotateDirection direction);
|
||||
|
||||
#endif /* CLUTTER_DISABLE_DEPRECATED */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_BEHAVIOUR_ELLIPSE_H__ */
|
||||
|
@ -42,6 +42,8 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "clutter-behaviour.h"
|
||||
#include "clutter-behaviour-opacity.h"
|
||||
#include "clutter-private.h"
|
||||
|
@ -34,8 +34,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION)
|
||||
|
||||
#define CLUTTER_TYPE_BEHAVIOUR_OPACITY (clutter_behaviour_opacity_get_type ())
|
||||
|
||||
#define CLUTTER_BEHAVIOUR_OPACITY(obj) \
|
||||
@ -97,19 +95,20 @@ struct _ClutterBehaviourOpacityClass
|
||||
|
||||
GType clutter_behaviour_opacity_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_actor_animate and ClutterActor:opacity)
|
||||
ClutterBehaviour *clutter_behaviour_opacity_new (ClutterAlpha *alpha,
|
||||
guint8 opacity_start,
|
||||
guint8 opacity_end);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_opacity_set_bounds (ClutterBehaviourOpacity *behaviour,
|
||||
guint8 opacity_start,
|
||||
guint8 opacity_end);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_opacity_get_bounds (ClutterBehaviourOpacity *behaviour,
|
||||
guint8 *opacity_start,
|
||||
guint8 *opacity_end);
|
||||
|
||||
#endif /* CLUTTER_DISABLE_DEPRECATED */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_BEHAVIOUR_OPACITY_H__ */
|
||||
|
@ -67,6 +67,8 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "clutter-behaviour.h"
|
||||
#include "clutter-behaviour-path.h"
|
||||
#include "clutter-bezier.h"
|
||||
|
@ -35,8 +35,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION)
|
||||
|
||||
#define CLUTTER_TYPE_BEHAVIOUR_PATH (clutter_behaviour_path_get_type ())
|
||||
|
||||
#define CLUTTER_BEHAVIOUR_PATH(obj) \
|
||||
@ -110,25 +108,27 @@ struct _ClutterBehaviourPathClass
|
||||
|
||||
GType clutter_behaviour_path_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_actor_animate)
|
||||
ClutterBehaviour *clutter_behaviour_path_new (ClutterAlpha *alpha,
|
||||
ClutterPath *path);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_actor_animate)
|
||||
ClutterBehaviour *clutter_behaviour_path_new_with_description
|
||||
(ClutterAlpha *alpha,
|
||||
const gchar *desc);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_actor_animate)
|
||||
ClutterBehaviour *clutter_behaviour_path_new_with_knots
|
||||
(ClutterAlpha *alpha,
|
||||
const ClutterKnot *knots,
|
||||
guint n_knots);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_path_set_path (ClutterBehaviourPath *pathb,
|
||||
ClutterPath *path);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
ClutterPath * clutter_behaviour_path_get_path (ClutterBehaviourPath *pathb);
|
||||
|
||||
#endif /* CLUTTER_DISABLE_DEPRECATED */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_BEHAVIOUR_PATH_H__ */
|
||||
|
@ -41,6 +41,8 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "clutter-behaviour.h"
|
||||
#include "clutter-behaviour-rotate.h"
|
||||
#include "clutter-debug.h"
|
||||
|
@ -32,8 +32,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION)
|
||||
|
||||
#define CLUTTER_TYPE_BEHAVIOUR_ROTATE (clutter_behaviour_rotate_get_type ())
|
||||
#define CLUTTER_BEHAVIOUR_ROTATE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BEHAVIOUR_ROTATE, ClutterBehaviourRotate))
|
||||
#define CLUTTER_IS_BEHAVIOUR_ROTATE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BEHAVIOUR_ROTATE))
|
||||
@ -80,34 +78,41 @@ struct _ClutterBehaviourRotateClass
|
||||
|
||||
GType clutter_behaviour_rotate_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_actor_animate)
|
||||
ClutterBehaviour * clutter_behaviour_rotate_new (ClutterAlpha *alpha,
|
||||
ClutterRotateAxis axis,
|
||||
ClutterRotateDirection direction,
|
||||
gdouble angle_start,
|
||||
gdouble angle_end);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_rotate_get_center (ClutterBehaviourRotate *rotate,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *z);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_rotate_set_center (ClutterBehaviourRotate *rotate,
|
||||
gint x,
|
||||
gint y,
|
||||
gint z);
|
||||
CLUTTER_DEPRECATED
|
||||
ClutterRotateAxis clutter_behaviour_rotate_get_axis (ClutterBehaviourRotate *rotate);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_rotate_set_axis (ClutterBehaviourRotate *rotate,
|
||||
ClutterRotateAxis axis);
|
||||
CLUTTER_DEPRECATED
|
||||
ClutterRotateDirection clutter_behaviour_rotate_get_direction (ClutterBehaviourRotate *rotate);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_rotate_set_direction (ClutterBehaviourRotate *rotate,
|
||||
ClutterRotateDirection direction);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_rotate_get_bounds (ClutterBehaviourRotate *rotate,
|
||||
gdouble *angle_start,
|
||||
gdouble *angle_end);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_rotate_set_bounds (ClutterBehaviourRotate *rotate,
|
||||
gdouble angle_start,
|
||||
gdouble angle_end);
|
||||
|
||||
#endif /* CLUTTER_DISABLE_DEPRECATED */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_BEHAVIOUR_ROTATE_H__ */
|
||||
|
@ -41,6 +41,8 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "clutter-behaviour.h"
|
||||
#include "clutter-behaviour-scale.h"
|
||||
#include "clutter-debug.h"
|
||||
|
@ -34,8 +34,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION)
|
||||
|
||||
#define CLUTTER_TYPE_BEHAVIOUR_SCALE (clutter_behaviour_scale_get_type ())
|
||||
#define CLUTTER_BEHAVIOUR_SCALE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BEHAVIOUR_SCALE, ClutterBehaviourScale))
|
||||
#define CLUTTER_BEHAVIOUR_SCALE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BEHAVIOUR_SCALE, ClutterBehaviourScaleClass))
|
||||
@ -83,24 +81,26 @@ struct _ClutterBehaviourScaleClass
|
||||
|
||||
GType clutter_behaviour_scale_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_actor_animate with ClutterActor:scale-x and ClutterActor:scale-y)
|
||||
ClutterBehaviour *clutter_behaviour_scale_new (ClutterAlpha *alpha,
|
||||
gdouble x_scale_start,
|
||||
gdouble y_scale_start,
|
||||
gdouble x_scale_end,
|
||||
gdouble y_scale_end);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_scale_set_bounds (ClutterBehaviourScale *scale,
|
||||
gdouble x_scale_start,
|
||||
gdouble y_scale_start,
|
||||
gdouble x_scale_end,
|
||||
gdouble y_scale_end);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_scale_get_bounds (ClutterBehaviourScale *scale,
|
||||
gdouble *x_scale_start,
|
||||
gdouble *y_scale_start,
|
||||
gdouble *x_scale_end,
|
||||
gdouble *y_scale_end);
|
||||
|
||||
#endif /* CLUTTER_DISABLE_DEPRECATED */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_BEHAVIOUR_SCALE_H__ */
|
||||
|
@ -77,6 +77,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
#include "clutter-behaviour.h"
|
||||
|
||||
#include "clutter-debug.h"
|
||||
@ -86,73 +87,6 @@
|
||||
#include "clutter-scriptable.h"
|
||||
#include "clutter-script-private.h"
|
||||
|
||||
/**
|
||||
* clutter_knot_copy:
|
||||
* @knot: a #ClutterKnot
|
||||
*
|
||||
* Makes an allocated copy of a knot.
|
||||
*
|
||||
* Return value: the copied knot.
|
||||
*
|
||||
* Since: 0.2
|
||||
*/
|
||||
ClutterKnot *
|
||||
clutter_knot_copy (const ClutterKnot *knot)
|
||||
{
|
||||
ClutterKnot *copy;
|
||||
|
||||
copy = g_slice_new0 (ClutterKnot);
|
||||
|
||||
*copy = *knot;
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_knot_free:
|
||||
* @knot: a #ClutterKnot
|
||||
*
|
||||
* Frees the memory of an allocated knot.
|
||||
*
|
||||
* Since: 0.2
|
||||
*/
|
||||
void
|
||||
clutter_knot_free (ClutterKnot *knot)
|
||||
{
|
||||
if (G_LIKELY (knot))
|
||||
{
|
||||
g_slice_free (ClutterKnot, knot);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_knot_equal:
|
||||
* @knot_a: First knot
|
||||
* @knot_b: Second knot
|
||||
*
|
||||
* Compares to knot and checks if the point to the same location.
|
||||
*
|
||||
* Return value: %TRUE if the knots point to the same location.
|
||||
*
|
||||
* Since: 0.2
|
||||
*/
|
||||
gboolean
|
||||
clutter_knot_equal (const ClutterKnot *knot_a,
|
||||
const ClutterKnot *knot_b)
|
||||
{
|
||||
g_return_val_if_fail (knot_a != NULL, FALSE);
|
||||
g_return_val_if_fail (knot_b != NULL, FALSE);
|
||||
|
||||
if (knot_a == knot_b)
|
||||
return TRUE;
|
||||
|
||||
return knot_a->x == knot_b->x && knot_a->y == knot_b->y;
|
||||
}
|
||||
|
||||
G_DEFINE_BOXED_TYPE (ClutterKnot, clutter_knot,
|
||||
clutter_knot_copy,
|
||||
clutter_knot_free);
|
||||
|
||||
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (ClutterBehaviour,
|
||||
@ -298,6 +232,8 @@ clutter_behaviour_class_init (ClutterBehaviourClass *klass)
|
||||
* the alpha-notify virtual function is called.
|
||||
*
|
||||
* Since: 0.2
|
||||
*
|
||||
* Deprecated: 1.6
|
||||
*/
|
||||
obj_props[PROP_ALPHA] =
|
||||
g_param_spec_object ("alpha",
|
||||
@ -321,6 +257,8 @@ clutter_behaviour_class_init (ClutterBehaviourClass *klass)
|
||||
* to an actor.
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.6
|
||||
*/
|
||||
behave_signals[APPLIED] =
|
||||
g_signal_new ("applied",
|
||||
@ -340,6 +278,8 @@ clutter_behaviour_class_init (ClutterBehaviourClass *klass)
|
||||
* to an actor anymore.
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.6
|
||||
*/
|
||||
behave_signals[REMOVED] =
|
||||
g_signal_new ("removed",
|
||||
@ -376,6 +316,8 @@ remove_actor_on_destroy (ClutterActor *actor,
|
||||
* the actor.
|
||||
*
|
||||
* Since: 0.2
|
||||
*
|
||||
* Deprecated: 1.6
|
||||
*/
|
||||
void
|
||||
clutter_behaviour_apply (ClutterBehaviour *behave,
|
||||
@ -415,6 +357,8 @@ clutter_behaviour_apply (ClutterBehaviour *behave,
|
||||
* Return value: TRUE if actor has behaviour. FALSE otherwise.
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.6
|
||||
*/
|
||||
gboolean
|
||||
clutter_behaviour_is_applied (ClutterBehaviour *behave,
|
||||
@ -435,6 +379,8 @@ clutter_behaviour_is_applied (ClutterBehaviour *behave,
|
||||
* @behave applies. This function removes a reference on the actor.
|
||||
*
|
||||
* Since: 0.2
|
||||
*
|
||||
* Deprecated: 1.6
|
||||
*/
|
||||
void
|
||||
clutter_behaviour_remove (ClutterBehaviour *behave,
|
||||
@ -476,6 +422,8 @@ clutter_behaviour_remove (ClutterBehaviour *behave,
|
||||
* Return value: The number of applied actors
|
||||
*
|
||||
* Since: 0.2
|
||||
*
|
||||
* Deprecated: 1.6
|
||||
*/
|
||||
gint
|
||||
clutter_behaviour_get_n_actors (ClutterBehaviour *behave)
|
||||
@ -495,8 +443,10 @@ clutter_behaviour_get_n_actors (ClutterBehaviour *behave)
|
||||
* Return value: (transfer none): A Clutter actor or NULL if @index_ is invalid.
|
||||
*
|
||||
* Since: 0.2
|
||||
*
|
||||
* Deprecated: 1.6
|
||||
*/
|
||||
ClutterActor*
|
||||
ClutterActor *
|
||||
clutter_behaviour_get_nth_actor (ClutterBehaviour *behave,
|
||||
gint index_)
|
||||
{
|
||||
@ -515,6 +465,8 @@ clutter_behaviour_get_nth_actor (ClutterBehaviour *behave,
|
||||
* Calls @func for every actor driven by @behave.
|
||||
*
|
||||
* Since: 0.2
|
||||
*
|
||||
* Deprecated: 1.6
|
||||
*/
|
||||
void
|
||||
clutter_behaviour_actors_foreach (ClutterBehaviour *behave,
|
||||
@ -546,6 +498,8 @@ clutter_behaviour_actors_foreach (ClutterBehaviour *behave,
|
||||
* object has been bound to this behaviour.
|
||||
*
|
||||
* Since: 0.2
|
||||
*
|
||||
* Deprecated: 1.6
|
||||
*/
|
||||
ClutterAlpha *
|
||||
clutter_behaviour_get_alpha (ClutterBehaviour *behave)
|
||||
@ -598,6 +552,8 @@ notify_cb (GObject *object,
|
||||
* of the #ClutterAlpha instance.
|
||||
*
|
||||
* Since: 0.2
|
||||
*
|
||||
* Deprecated: 1.6
|
||||
*/
|
||||
void
|
||||
clutter_behaviour_set_alpha (ClutterBehaviour *behave,
|
||||
@ -658,6 +614,8 @@ clutter_behaviour_set_alpha (ClutterBehaviour *behave,
|
||||
* finished using it.
|
||||
*
|
||||
* Since: 0.2
|
||||
*
|
||||
* Deprecated: 1.6
|
||||
*/
|
||||
GSList *
|
||||
clutter_behaviour_get_actors (ClutterBehaviour *behave)
|
||||
@ -682,6 +640,8 @@ clutter_behaviour_get_actors (ClutterBehaviour *behave)
|
||||
* Removes every actor from the list that @behave holds.
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.6
|
||||
*/
|
||||
void
|
||||
clutter_behaviour_remove_all (ClutterBehaviour *behave)
|
||||
|
@ -34,8 +34,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION)
|
||||
|
||||
#define CLUTTER_TYPE_BEHAVIOUR clutter_behaviour_get_type()
|
||||
|
||||
#define CLUTTER_BEHAVIOUR(obj) \
|
||||
@ -138,26 +136,34 @@ struct _ClutterBehaviourClass
|
||||
|
||||
GType clutter_behaviour_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_apply (ClutterBehaviour *behave,
|
||||
ClutterActor *actor);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_remove (ClutterBehaviour *behave,
|
||||
ClutterActor *actor);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_remove_all (ClutterBehaviour *behave);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_actors_foreach (ClutterBehaviour *behave,
|
||||
ClutterBehaviourForeachFunc func,
|
||||
gpointer data);
|
||||
CLUTTER_DEPRECATED
|
||||
gint clutter_behaviour_get_n_actors (ClutterBehaviour *behave);
|
||||
CLUTTER_DEPRECATED
|
||||
ClutterActor *clutter_behaviour_get_nth_actor (ClutterBehaviour *behave,
|
||||
gint index_);
|
||||
CLUTTER_DEPRECATED
|
||||
GSList * clutter_behaviour_get_actors (ClutterBehaviour *behave);
|
||||
CLUTTER_DEPRECATED
|
||||
ClutterAlpha *clutter_behaviour_get_alpha (ClutterBehaviour *behave);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_behaviour_set_alpha (ClutterBehaviour *behave,
|
||||
ClutterAlpha *alpha);
|
||||
CLUTTER_DEPRECATED
|
||||
gboolean clutter_behaviour_is_applied (ClutterBehaviour *behave,
|
||||
ClutterActor *actor);
|
||||
|
||||
#endif /* !CLUTTER_DISABLE_DEPRECATED || CLUTTER_COMPILATION */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_BEHAVIOUR_H__ */
|
||||
|
@ -29,6 +29,8 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include <cogl/cogl.h>
|
||||
|
||||
#include <glib-object.h>
|
||||
|
@ -29,13 +29,11 @@
|
||||
#ifndef __CLUTTER_FIXED_H__
|
||||
#define __CLUTTER_FIXED_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <cogl/cogl.h>
|
||||
#include <clutter/clutter-types.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION)
|
||||
|
||||
#define CLUTTER_TYPE_PARAM_FIXED (clutter_param_fixed_get_type ())
|
||||
#define CLUTTER_PARAM_SPEC_FIXED(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), CLUTTER_TYPE_PARAM_FIXED, ClutterParamSpecFixed))
|
||||
#define CLUTTER_IS_PARAM_SPEC_FIXED(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), CLUTTER_TYPE_PARAM_FIXED))
|
||||
@ -79,10 +77,13 @@ struct _ClutterParamSpecFixed
|
||||
|
||||
GType clutter_param_fixed_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(g_value_set_int)
|
||||
void clutter_value_set_fixed (GValue *value,
|
||||
CoglFixed fixed_);
|
||||
CLUTTER_DEPRECATED_FOR(g_value_get_int)
|
||||
CoglFixed clutter_value_get_fixed (const GValue *value);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(g_param_spec_int)
|
||||
GParamSpec * clutter_param_spec_fixed (const gchar *name,
|
||||
const gchar *nick,
|
||||
const gchar *blurb,
|
||||
@ -91,9 +92,6 @@ GParamSpec * clutter_param_spec_fixed (const gchar *name,
|
||||
CoglFixed default_value,
|
||||
GParamFlags flags);
|
||||
|
||||
|
||||
#endif /* DISABLE_DEPRECATED */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_FIXED_H__ */
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "clutter-frame-source.h"
|
||||
#include "clutter-timeout-interval.h"
|
||||
#include "clutter-private.h"
|
||||
|
@ -28,24 +28,22 @@
|
||||
#ifndef __CLUTTER_FRAME_SOURCE_H__
|
||||
#define __CLUTTER_FRAME_SOURCE_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <clutter/clutter-types.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION)
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
guint clutter_frame_source_add (guint fps,
|
||||
GSourceFunc func,
|
||||
gpointer data);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
guint clutter_frame_source_add_full (gint priority,
|
||||
guint fps,
|
||||
GSourceFunc func,
|
||||
gpointer data,
|
||||
GDestroyNotify notify);
|
||||
|
||||
#endif /* CLUTTER_DISABLE_DEPRECATED */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_FRAME_SOURCE_H__ */
|
||||
|
@ -83,6 +83,8 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "clutter-score.h"
|
||||
#include "clutter-main.h"
|
||||
#include "clutter-marshal.h"
|
||||
|
@ -32,8 +32,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION)
|
||||
|
||||
#define CLUTTER_TYPE_SCORE (clutter_score_get_type ())
|
||||
|
||||
#define CLUTTER_SCORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_SCORE, ClutterScore))
|
||||
@ -100,34 +98,46 @@ struct _ClutterScoreClass
|
||||
|
||||
GType clutter_score_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
ClutterScore * clutter_score_new (void);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_score_set_loop (ClutterScore *score,
|
||||
gboolean loop);
|
||||
CLUTTER_DEPRECATED
|
||||
gboolean clutter_score_get_loop (ClutterScore *score);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
gulong clutter_score_append (ClutterScore *score,
|
||||
ClutterTimeline *parent,
|
||||
ClutterTimeline *timeline);
|
||||
CLUTTER_DEPRECATED
|
||||
gulong clutter_score_append_at_marker (ClutterScore *score,
|
||||
ClutterTimeline *parent,
|
||||
const gchar *marker_name,
|
||||
ClutterTimeline *timeline);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_score_remove (ClutterScore *score,
|
||||
gulong id_);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_score_remove_all (ClutterScore *score);
|
||||
CLUTTER_DEPRECATED
|
||||
ClutterTimeline *clutter_score_get_timeline (ClutterScore *score,
|
||||
gulong id_);
|
||||
CLUTTER_DEPRECATED
|
||||
GSList * clutter_score_list_timelines (ClutterScore *score);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_score_start (ClutterScore *score);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_score_stop (ClutterScore *score);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_score_pause (ClutterScore *score);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_score_rewind (ClutterScore *score);
|
||||
CLUTTER_DEPRECATED
|
||||
gboolean clutter_score_is_playing (ClutterScore *score);
|
||||
|
||||
#endif /* CLUTTER_DISABLE_DEPRECATED */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_SCORE_H__ */
|
||||
|
@ -52,6 +52,8 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
|
||||
@ -819,20 +821,6 @@ clutter_shader_set_uniform (ClutterShader *shader,
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
/*
|
||||
* _clutter_shader_release_all:
|
||||
*
|
||||
* Iterate through all #ClutterShaders and tell them to release GL context
|
||||
* related sources.
|
||||
*/
|
||||
void
|
||||
_clutter_shader_release_all (void)
|
||||
{
|
||||
g_list_foreach (clutter_shaders_list,
|
||||
(GFunc) clutter_shader_release,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_shader_get_fragment_source:
|
||||
* @shader: a #ClutterShader
|
||||
|
@ -34,8 +34,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION)
|
||||
|
||||
#define CLUTTER_TYPE_SHADER (clutter_shader_get_type ())
|
||||
#define CLUTTER_SHADER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CLUTTER_TYPE_SHADER, ClutterShader))
|
||||
#define CLUTTER_SHADER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CLUTTER_TYPE_SHADER, ClutterShaderClass))
|
||||
@ -110,40 +108,48 @@ struct _ClutterShaderClass
|
||||
GQuark clutter_shader_error_quark (void);
|
||||
GType clutter_shader_get_type (void) G_GNUC_CONST;
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
||||
ClutterShader * clutter_shader_new (void);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
||||
void clutter_shader_set_is_enabled (ClutterShader *shader,
|
||||
gboolean enabled);
|
||||
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
||||
gboolean clutter_shader_get_is_enabled (ClutterShader *shader);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
||||
gboolean clutter_shader_compile (ClutterShader *shader,
|
||||
GError **error);
|
||||
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
||||
void clutter_shader_release (ClutterShader *shader);
|
||||
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
||||
gboolean clutter_shader_is_compiled (ClutterShader *shader);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
||||
void clutter_shader_set_vertex_source (ClutterShader *shader,
|
||||
const gchar *data,
|
||||
gssize length);
|
||||
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
||||
void clutter_shader_set_fragment_source (ClutterShader *shader,
|
||||
const gchar *data,
|
||||
gssize length);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
||||
const gchar * clutter_shader_get_vertex_source (ClutterShader *shader);
|
||||
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
||||
const gchar * clutter_shader_get_fragment_source (ClutterShader *shader);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
||||
void clutter_shader_set_uniform (ClutterShader *shader,
|
||||
const gchar *name,
|
||||
const GValue *value);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
||||
CoglHandle clutter_shader_get_cogl_program (ClutterShader *shader);
|
||||
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
||||
CoglHandle clutter_shader_get_cogl_fragment_shader (ClutterShader *shader);
|
||||
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
|
||||
CoglHandle clutter_shader_get_cogl_vertex_shader (ClutterShader *shader);
|
||||
|
||||
/* private */
|
||||
void _clutter_shader_release_all (void);
|
||||
|
||||
#endif /* CLUTTER_DISABLE_DEPRECATED */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_SHADER_H__ */
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
/* This file contains the common code to check whether an interval has
|
||||
expired used in clutter-frame-source and clutter-timeout-pool. */
|
||||
|
||||
|
@ -34,6 +34,8 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "clutter-timeout-pool.h"
|
||||
|
||||
#include "clutter-debug.h"
|
||||
|
@ -35,12 +35,10 @@
|
||||
#ifndef __CLUTTER_TIMEOUT_POOL_H__
|
||||
#define __CLUTTER_TIMEOUT_POOL_H__
|
||||
|
||||
#include <glib.h>
|
||||
#include <clutter/clutter-types.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#if !defined(CLUTTER_DISABLE_DEPRECATED) || defined(CLUTTER_COMPILATION)
|
||||
|
||||
/**
|
||||
* ClutterTimeoutPool: (skip)
|
||||
*
|
||||
@ -53,17 +51,19 @@ G_BEGIN_DECLS
|
||||
*/
|
||||
typedef struct _ClutterTimeoutPool ClutterTimeoutPool;
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
ClutterTimeoutPool *clutter_timeout_pool_new (gint priority);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
guint clutter_timeout_pool_add (ClutterTimeoutPool *pool,
|
||||
guint fps,
|
||||
GSourceFunc func,
|
||||
gpointer data,
|
||||
GDestroyNotify notify);
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_timeout_pool_remove (ClutterTimeoutPool *pool,
|
||||
guint id_);
|
||||
|
||||
#endif /* CLUTTER_DISABLE_DEPRECATED */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_TIMEOUT_POOL_H__ */
|
||||
|
@ -228,8 +228,6 @@ clutter_backend_osx_dispose (GObject *object)
|
||||
{
|
||||
ClutterBackendOSX *self = CLUTTER_BACKEND_OSX (object);
|
||||
|
||||
_clutter_shader_release_all ();
|
||||
|
||||
[self->context release];
|
||||
self->context = NULL;
|
||||
|
||||
|
@ -148,9 +148,6 @@ clutter_backend_win32_dispose (GObject *gobject)
|
||||
CLUTTER_NOTE (BACKEND, "Removing the event source");
|
||||
_clutter_backend_win32_events_uninit (CLUTTER_BACKEND (backend_win32));
|
||||
|
||||
/* Unrealize all shaders, since the GL context is going away */
|
||||
_clutter_shader_release_all ();
|
||||
|
||||
G_OBJECT_CLASS (clutter_backend_win32_parent_class)->dispose (gobject);
|
||||
|
||||
if (backend->cogl_context)
|
||||
|
@ -121,7 +121,7 @@ m4_define([cairo_req_version], [1.10])
|
||||
m4_define([pango_req_version], [1.20])
|
||||
m4_define([gi_req_version], [0.9.5])
|
||||
m4_define([uprof_req_version], [0.3])
|
||||
m4_define([gtk_doc_req_version], [1.13])
|
||||
m4_define([gtk_doc_req_version], [1.15])
|
||||
m4_define([xfixes_req_version], [3])
|
||||
m4_define([xcomposite_req_version], [0.4])
|
||||
|
||||
@ -736,7 +736,7 @@ AS_CASE([$enable_deprecated],
|
||||
|
||||
[no],
|
||||
[
|
||||
CLUTTER_DEPRECATED_CFLAGS="-DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DCOGL_DISABLE_DEPRECATED -DCLUTTER_DISABLE_DEPRECATED"
|
||||
CLUTTER_DEPRECATED_CFLAGS="-DG_DISABLE_SINGLE_INCLUDES -DCOGL_DISABLE_DEPRECATED -DCLUTTER_DISABLE_DEPRECATED"
|
||||
],
|
||||
|
||||
[yes],
|
||||
|
@ -6,6 +6,13 @@ clutter/clutter-alpha.c
|
||||
clutter/clutter-animation.c
|
||||
clutter/clutter-animator.c
|
||||
clutter/clutter-backend.c
|
||||
clutter/deprecated/clutter-behaviour.c
|
||||
clutter/deprecated/clutter-behaviour-depth.c
|
||||
clutter/deprecated/clutter-behaviour-ellipse.c
|
||||
clutter/deprecated/clutter-behaviour-opacity.c
|
||||
clutter/deprecated/clutter-behaviour-path.c
|
||||
clutter/deprecated/clutter-behaviour-rotate.c
|
||||
clutter/deprecated/clutter-behaviour-scale.c
|
||||
clutter/clutter-bind-constraint.c
|
||||
clutter/clutter-binding-pool.c
|
||||
clutter/clutter-bin-layout.c
|
||||
@ -24,6 +31,8 @@ clutter/clutter-device-manager.c
|
||||
clutter/clutter-drag-action.c
|
||||
clutter/clutter-drop-action.c
|
||||
clutter/clutter-event.c
|
||||
clutter/deprecated/clutter-fixed.c
|
||||
clutter/deprecated/clutter-fixed.h
|
||||
clutter/clutter-flow-layout.c
|
||||
clutter/clutter-gesture-action.c
|
||||
clutter/clutter-input-device.c
|
||||
@ -36,6 +45,7 @@ clutter/clutter-path-constraint.c
|
||||
clutter/clutter-rectangle.c
|
||||
clutter/clutter-script.c
|
||||
clutter/clutter-settings.c
|
||||
clutter/deprecated/clutter-shader.c
|
||||
clutter/clutter-shader-effect.c
|
||||
clutter/clutter-shader-types.c
|
||||
clutter/clutter-snap-constraint.c
|
||||
|
@ -164,8 +164,8 @@ INCLUDES = \
|
||||
test_conformance_CPPFLAGS = \
|
||||
-DG_DISABLE_SINGLE_INCLUDES \
|
||||
-DCOGL_ENABLE_EXPERIMENTAL_API \
|
||||
-DCOGL_DISABLE_DEPRECATED \
|
||||
-DCLUTTER_DISABLE_DEPRECATED \
|
||||
-DG_DISABLE_DEPRECATION_WARNINGS \
|
||||
-DCLUTTER_DISABLE_DEPRECATION_WARNINGS \
|
||||
-DTESTS_DATADIR=\""$(top_srcdir)/tests/data"\"
|
||||
|
||||
test_conformance_CFLAGS = -g $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
|
||||
|
@ -1,4 +1,3 @@
|
||||
#undef CLUTTER_DISABLE_DEPRECATED
|
||||
#include <clutter/clutter.h>
|
||||
#include <cogl/cogl.h>
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
#undef CLUTTER_DISABLE_DEPRECATED
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
#include <cogl/cogl.h>
|
||||
|
||||
|
@ -156,8 +156,8 @@ test_interactive_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
|
||||
test_interactive_CPPFLAGS = \
|
||||
-DTESTS_DATADIR=\""$(abs_top_srcdir)/tests/data"\" \
|
||||
-DG_DISABLE_SINGLE_INCLUDES \
|
||||
-DCOGL_DISABLE_DEPRECATED \
|
||||
-DCLUTTER_DISABLE_DEPRECATED
|
||||
-DGLIB_DISABLE_DEPRECATION_WARNINGS \
|
||||
-DCLUTTER_DISABLE_DEPRECATION_WARNINGS
|
||||
test_interactive_LDFLAGS = -export-dynamic
|
||||
test_interactive_LDADD = $(CLUTTER_LIBS) $(common_ldadd) -lm
|
||||
|
||||
|
@ -216,8 +216,7 @@ test_actors_main (int argc, char *argv[])
|
||||
oh->group = clutter_group_new();
|
||||
clutter_actor_set_name (oh->group, "Group");
|
||||
g_signal_connect (oh->group, "destroy", G_CALLBACK (on_group_destroy), oh);
|
||||
clutter_actor_add_constraint (oh->group, clutter_align_constraint_new (stage, CLUTTER_ALIGN_X_AXIS, 0.5));
|
||||
clutter_actor_add_constraint (oh->group, clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.5));
|
||||
clutter_actor_add_constraint (oh->group, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5));
|
||||
clutter_actor_add_constraint (oh->group, clutter_bind_constraint_new (stage, CLUTTER_BIND_SIZE, 0.0f));
|
||||
|
||||
oh->hand = g_new (ClutterActor*, n_hands);
|
||||
|
@ -1,8 +1,6 @@
|
||||
/*
|
||||
* Pretty cairo flower hack.
|
||||
*/
|
||||
|
||||
#undef CLUTTER_DISABLE_DEPRECATED
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#ifndef _MSC_VER
|
||||
|
@ -186,11 +186,8 @@ test_constraints_main (int argc, char *argv[])
|
||||
clutter_container_add_actor (CLUTTER_CONTAINER (stage), rect);
|
||||
|
||||
/* align the center rectangle to the center of the stage */
|
||||
constraint = clutter_align_constraint_new (stage, CLUTTER_ALIGN_X_AXIS, 0.5);
|
||||
clutter_actor_add_constraint_with_name (rect, "x-align", constraint);
|
||||
|
||||
constraint = clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.5);
|
||||
clutter_actor_add_constraint_with_name (rect, "y-align", constraint);
|
||||
constraint = clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5);
|
||||
clutter_actor_add_constraint_with_name (rect, "align", constraint);
|
||||
|
||||
/* this is the equivalent of the DesaturateEffect; we cannot animate
|
||||
* the factor because the animation API only understands GObject
|
||||
|
@ -1,5 +1,3 @@
|
||||
#undef CLUTTER_DISABLE_DEPRECATED
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
@ -139,7 +139,7 @@ main (int argc, char **argv)
|
||||
|
||||
g_print (" - %s:%*s%s\n",
|
||||
test_unit_names[i],
|
||||
(int) len - strlen (str), " ",
|
||||
(int) (len - strlen (str)), " ",
|
||||
str);
|
||||
|
||||
g_free (str);
|
||||
|
@ -88,8 +88,7 @@ test_scrolling_main (int argc, char *argv[])
|
||||
scroll = clutter_group_new ();
|
||||
clutter_container_add_actor (CLUTTER_CONTAINER (stage), scroll);
|
||||
clutter_actor_set_size (scroll, RECT_WIDTH, RECT_HEIGHT);
|
||||
clutter_actor_add_constraint (scroll, clutter_align_constraint_new (stage, CLUTTER_ALIGN_X_AXIS, 0.5));
|
||||
clutter_actor_add_constraint (scroll, clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.5));
|
||||
clutter_actor_add_constraint (scroll, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5));
|
||||
clutter_actor_set_clip_to_allocation (scroll, TRUE);
|
||||
|
||||
/* viewport: the actual container for the children; we scroll it using
|
||||
|
@ -1,7 +1,3 @@
|
||||
/*#define TEST_GROUP */
|
||||
|
||||
#undef CLUTTER_DISABLE_DEPRECATED
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
@ -27,8 +27,7 @@ test_snap_constraint_main (int argc,
|
||||
clutter_actor_set_size (layer_a, 100.0, 25.0);
|
||||
|
||||
/* the first layer is anchored to the middle of the stage */
|
||||
clutter_actor_add_constraint (layer_a, clutter_align_constraint_new (stage, CLUTTER_ALIGN_X_AXIS, 0.5));
|
||||
clutter_actor_add_constraint (layer_a, clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.5));
|
||||
clutter_actor_add_constraint (layer_a, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5));
|
||||
|
||||
/* second layer, with no implicit size */
|
||||
layer_b = clutter_rectangle_new_with_color (CLUTTER_COLOR_DarkButter);
|
||||
|
@ -41,8 +41,7 @@ test_state_script_main (int argc, char *argv[])
|
||||
|
||||
button = CLUTTER_ACTOR (clutter_script_get_object (script, "button"));
|
||||
clutter_container_add_actor (CLUTTER_CONTAINER (stage), button);
|
||||
clutter_actor_add_constraint (button, clutter_align_constraint_new (stage, CLUTTER_ALIGN_X_AXIS, 0.5));
|
||||
clutter_actor_add_constraint (button, clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.5));
|
||||
clutter_actor_add_constraint (button, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5));
|
||||
|
||||
clutter_script_connect_signals (script, NULL);
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#undef CLUTTER_DISABLE_DEPRECATED
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
/* our thread-specific data */
|
||||
typedef struct
|
||||
{
|
||||
ClutterActor *stage;
|
||||
@ -12,8 +13,6 @@ typedef struct
|
||||
ClutterActor *progress;
|
||||
|
||||
ClutterTimeline *timeline;
|
||||
|
||||
volatile gboolean cancelled;
|
||||
} TestThreadData;
|
||||
|
||||
static TestThreadData *
|
||||
@ -27,8 +26,13 @@ test_thread_data_new (void)
|
||||
}
|
||||
|
||||
static void
|
||||
test_thread_data_free (TestThreadData *data)
|
||||
test_thread_data_free (gpointer _data)
|
||||
{
|
||||
TestThreadData *data = _data;
|
||||
|
||||
if (data == NULL)
|
||||
return;
|
||||
|
||||
g_object_unref (data->progress);
|
||||
g_object_unref (data->label);
|
||||
g_object_unref (data->stage);
|
||||
@ -52,7 +56,22 @@ test_thread_done_idle (gpointer user_data)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GPrivate test_thread_data = G_PRIVATE_INIT (test_thread_data_free);
|
||||
static void
|
||||
test_thread_data_done (gpointer _data)
|
||||
{
|
||||
TestThreadData *data = _data;
|
||||
|
||||
/* since the TestThreadData structure references Clutter data structures
|
||||
* we need to free it from within the same thread that called clutter_main()
|
||||
* which means using an idle handler in the main loop.
|
||||
*
|
||||
* clutter_threads_add_idle() is guaranteed to run the callback passed to
|
||||
* to it under the Big Clutter Lock.
|
||||
*/
|
||||
clutter_threads_add_idle (test_thread_done_idle, data);
|
||||
}
|
||||
|
||||
static GPrivate test_thread_data = G_PRIVATE_INIT (test_thread_data_done);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@ -68,7 +87,6 @@ update_label_idle (gpointer data)
|
||||
gchar *text;
|
||||
|
||||
text = g_strdup_printf ("Count to %d", update->count);
|
||||
|
||||
clutter_text_set_text (CLUTTER_TEXT (update->thread_data->label), text);
|
||||
clutter_actor_set_width (update->thread_data->label, -1);
|
||||
|
||||
@ -94,8 +112,6 @@ do_something_very_slow (void)
|
||||
gint i;
|
||||
|
||||
data = g_private_get (&test_thread_data);
|
||||
if (data->cancelled)
|
||||
return;
|
||||
|
||||
for (i = 0; i < 100; i++)
|
||||
{
|
||||
@ -103,13 +119,18 @@ do_something_very_slow (void)
|
||||
|
||||
msecs = 1 + (int) (100.0 * rand () / ((RAND_MAX + 1.0) / 3));
|
||||
|
||||
/* sleep for a while */
|
||||
/* sleep for a while, to emulate some work being done */
|
||||
g_usleep (msecs * 1000);
|
||||
|
||||
if ((i % 10) == 0)
|
||||
{
|
||||
TestUpdate *update;
|
||||
|
||||
/* update the UI from within the main loop, making sure that the
|
||||
* Big Clutter Lock is held; only one thread at a time can call
|
||||
* Clutter API, and it's better to do this from the same thread
|
||||
* that called clutter_init()/clutter_main().
|
||||
*/
|
||||
update = g_new (TestUpdate, 1);
|
||||
update->count = i;
|
||||
update->thread_data = data;
|
||||
@ -128,12 +149,9 @@ test_thread_func (gpointer user_data)
|
||||
|
||||
g_private_set (&test_thread_data, data);
|
||||
|
||||
/* this function will block */
|
||||
do_something_very_slow ();
|
||||
|
||||
clutter_threads_add_idle_full (G_PRIORITY_DEFAULT + 30,
|
||||
test_thread_done_idle,
|
||||
data, NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -162,7 +180,8 @@ on_key_press_event (ClutterStage *stage,
|
||||
data->progress = g_object_ref (progress_rect);
|
||||
data->timeline = g_object_ref (timeline);
|
||||
|
||||
g_thread_new ("counter", test_thread_func, data, FALSE, NULL);
|
||||
/* start the thread that updates the counter and the progress bar */
|
||||
g_thread_new ("counter", test_thread_func, data);
|
||||
|
||||
return TRUE;
|
||||
|
||||
@ -256,3 +275,9 @@ test_threads_main (int argc, char *argv[])
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
const char *
|
||||
test_threads_describe (void)
|
||||
{
|
||||
return "Multi-threading programming with Clutter";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user