2010-10-21 08:13:00 -04:00
|
|
|
/*
|
|
|
|
* Clutter.
|
|
|
|
*
|
|
|
|
* An OpenGL based 'interactive canvas' library.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Intel Corporation.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2010-10-21 07:16:05 -04:00
|
|
|
#ifndef __CLUTTER_ACTOR_PRIVATE_H__
|
|
|
|
#define __CLUTTER_ACTOR_PRIVATE_H__
|
|
|
|
|
|
|
|
#include <clutter/clutter-actor.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2010-12-09 10:06:12 -05:00
|
|
|
/*< private >
|
2010-10-21 07:16:05 -04:00
|
|
|
* ClutterRedrawFlags:
|
|
|
|
* @CLUTTER_REDRAW_CLIPPED_TO_ALLOCATION: Tells clutter the maximum
|
|
|
|
* extents of what needs to be redrawn lies within the actors
|
|
|
|
* current allocation. (Only use this for 2D actors though because
|
|
|
|
* any actor with depth may be projected outside of its allocation)
|
|
|
|
*
|
|
|
|
* Flags passed to the clutter_actor_queue_redraw_with_clip ()
|
|
|
|
* function
|
|
|
|
*
|
|
|
|
* Since: 1.6
|
|
|
|
*/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
CLUTTER_REDRAW_CLIPPED_TO_ALLOCATION = 1 << 0
|
|
|
|
} ClutterRedrawFlags;
|
|
|
|
|
2010-12-09 10:06:12 -05:00
|
|
|
/*< private >
|
|
|
|
* ClutterActorTraverseFlags:
|
2010-10-20 10:40:30 -04:00
|
|
|
* CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST: Traverse the graph in
|
|
|
|
* a depth first order.
|
|
|
|
* CLUTTER_ACTOR_TRAVERSE_BREADTH_FIRST: Traverse the graph in a
|
|
|
|
* breadth first order.
|
2010-10-21 07:16:05 -04:00
|
|
|
*
|
|
|
|
* Controls some options for how clutter_actor_traverse() iterates
|
|
|
|
* through the graph.
|
|
|
|
*/
|
2010-12-10 11:03:10 -05:00
|
|
|
typedef enum {
|
2010-10-20 10:40:30 -04:00
|
|
|
CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST = 1L<<0,
|
|
|
|
CLUTTER_ACTOR_TRAVERSE_BREADTH_FIRST = 1L<<1
|
2010-10-21 07:16:05 -04:00
|
|
|
} ClutterActorTraverseFlags;
|
|
|
|
|
2010-12-09 10:06:12 -05:00
|
|
|
/*< private >
|
2010-10-20 10:40:30 -04:00
|
|
|
* ClutterActorTraverseVisitFlags:
|
|
|
|
* CLUTTER_ACTOR_TRAVERSE_VISIT_CONTINUE: Continue traversing as
|
|
|
|
* normal
|
|
|
|
* CLUTTER_ACTOR_TRAVERSE_VISIT_SKIP_CHILDREN: Don't traverse the
|
|
|
|
* children of the last visited actor. (Not applicable when using
|
2010-12-09 10:06:12 -05:00
|
|
|
* %CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST_POST_ORDER since the children
|
2010-10-20 10:40:30 -04:00
|
|
|
* are visited before having an opportunity to bail out)
|
|
|
|
* CLUTTER_ACTOR_TRAVERSE_VISIT_BREAK: Immediately bail out without
|
|
|
|
* visiting any more actors.
|
|
|
|
*
|
|
|
|
* Each time an actor is visited during a scenegraph traversal the
|
|
|
|
* ClutterTraverseCallback can return a set of flags that may affect
|
|
|
|
* the continuing traversal. It may stop traversal completely, just
|
|
|
|
* skip over children for the current actor or continue as normal.
|
|
|
|
*/
|
2010-12-10 11:03:10 -05:00
|
|
|
typedef enum {
|
2010-10-20 10:40:30 -04:00
|
|
|
CLUTTER_ACTOR_TRAVERSE_VISIT_CONTINUE = 1L<<0,
|
|
|
|
CLUTTER_ACTOR_TRAVERSE_VISIT_SKIP_CHILDREN = 1L<<1,
|
|
|
|
CLUTTER_ACTOR_TRAVERSE_VISIT_BREAK = 1L<<2
|
|
|
|
} ClutterActorTraverseVisitFlags;
|
|
|
|
|
2010-12-09 10:06:12 -05:00
|
|
|
/*< private >
|
2010-10-20 10:40:30 -04:00
|
|
|
* ClutterTraverseCallback:
|
|
|
|
*
|
|
|
|
* The callback prototype used with clutter_actor_traverse. The
|
|
|
|
* returned flags can be used to affect the continuing traversal
|
|
|
|
* either by continuing as normal, skipping over children of an
|
|
|
|
* actor or bailing out completely.
|
|
|
|
*/
|
|
|
|
typedef ClutterActorTraverseVisitFlags (*ClutterTraverseCallback) (ClutterActor *actor,
|
2010-12-09 10:06:12 -05:00
|
|
|
gint depth,
|
|
|
|
gpointer user_data);
|
2010-10-20 10:40:30 -04:00
|
|
|
|
2010-12-09 10:06:12 -05:00
|
|
|
/*< private >
|
|
|
|
* ClutterForeachCallback:
|
2010-10-21 07:16:05 -04:00
|
|
|
* @actor: The actor being iterated
|
|
|
|
* @user_data: The private data specified when starting the iteration
|
|
|
|
*
|
|
|
|
* A generic callback for iterating over actor, such as with
|
|
|
|
* _clutter_actor_foreach_child. The difference when compared to
|
|
|
|
* #ClutterCallback is that it returns a boolean so it is possible to break
|
|
|
|
* out of an iteration early.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE to continue iterating or %FALSE to break iteration
|
|
|
|
* early.
|
|
|
|
*/
|
|
|
|
typedef gboolean (*ClutterForeachCallback) (ClutterActor *actor,
|
2010-12-09 10:06:12 -05:00
|
|
|
gpointer user_data);
|
2010-10-21 07:16:05 -04:00
|
|
|
|
2011-12-09 09:38:25 -05:00
|
|
|
typedef struct _AnchorCoord AnchorCoord;
|
|
|
|
typedef struct _SizeRequest SizeRequest;
|
|
|
|
|
2011-11-23 13:16:29 -05:00
|
|
|
typedef struct _ClutterLayoutInfo ClutterLayoutInfo;
|
2011-12-09 09:38:25 -05:00
|
|
|
typedef struct _ClutterTransformInfo ClutterTransformInfo;
|
|
|
|
|
|
|
|
/* Internal helper struct to represent a point that can be stored in
|
|
|
|
either direct pixel coordinates or as a fraction of the actor's
|
|
|
|
size. It is used for the anchor point, scale center and rotation
|
|
|
|
centers. */
|
|
|
|
struct _AnchorCoord
|
|
|
|
{
|
|
|
|
gboolean is_fractional;
|
|
|
|
|
|
|
|
union
|
|
|
|
{
|
|
|
|
/* Used when is_fractional == TRUE */
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
gdouble x;
|
|
|
|
gdouble y;
|
|
|
|
} fraction;
|
|
|
|
|
|
|
|
/* Use when is_fractional == FALSE */
|
|
|
|
ClutterVertex units;
|
|
|
|
} v;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _SizeRequest
|
|
|
|
{
|
|
|
|
guint age;
|
|
|
|
gfloat for_size;
|
|
|
|
gfloat min_size;
|
|
|
|
gfloat natural_size;
|
|
|
|
};
|
2011-11-23 13:16:29 -05:00
|
|
|
|
|
|
|
/*< private >
|
|
|
|
* ClutterLayoutInfo:
|
|
|
|
* @fixed_x: the fixed position of the actor, set using clutter_actor_set_x()
|
|
|
|
* @fixed_y: the fixed position of the actor, set using clutter_actor_set_y()
|
|
|
|
* @margin: the composed margin of the actor
|
|
|
|
* @x_expand: whether the actor should expand horizontally
|
|
|
|
* @y_expand: whether the actor should expand vertically
|
|
|
|
* @x_align: the horizontal alignment, if the actor expands horizontally
|
|
|
|
* @y_align: the vertical alignment, if the actor expands vertically
|
2011-11-24 09:13:29 -05:00
|
|
|
* @min_width: the minimum width, set using clutter_actor_set_min_width()
|
|
|
|
* @min_height: the minimum height, set using clutter_actor_set_min_height()
|
|
|
|
* @natural_width: the natural width, set using clutter_actor_set_natural_width()
|
|
|
|
* @natural_height: the natural height, set using clutter_actor_set_natural_height()
|
2011-11-23 13:16:29 -05:00
|
|
|
*
|
|
|
|
* Ancillary layout information for an actor.
|
|
|
|
*/
|
|
|
|
struct _ClutterLayoutInfo
|
|
|
|
{
|
|
|
|
/* fixed position coordinates */
|
|
|
|
float fixed_x;
|
|
|
|
float fixed_y;
|
|
|
|
|
|
|
|
ClutterMargin margin;
|
|
|
|
|
|
|
|
guint x_expand : 1;
|
|
|
|
guint y_expand : 1;
|
|
|
|
|
|
|
|
guint x_align : 4;
|
|
|
|
guint y_align : 4;
|
2011-11-24 09:13:29 -05:00
|
|
|
|
|
|
|
float min_width;
|
|
|
|
float min_height;
|
|
|
|
float natural_width;
|
|
|
|
float natural_height;
|
2011-11-23 13:16:29 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
const ClutterLayoutInfo * _clutter_actor_get_layout_info_or_defaults (ClutterActor *self);
|
|
|
|
ClutterLayoutInfo * _clutter_actor_get_layout_info (ClutterActor *self);
|
|
|
|
|
2011-12-09 09:38:25 -05:00
|
|
|
struct _ClutterTransformInfo
|
|
|
|
{
|
|
|
|
/* rotation (angle and center) */
|
|
|
|
gdouble rx_angle;
|
|
|
|
AnchorCoord rx_center;
|
|
|
|
|
|
|
|
gdouble ry_angle;
|
|
|
|
AnchorCoord ry_center;
|
|
|
|
|
|
|
|
gdouble rz_angle;
|
|
|
|
AnchorCoord rz_center;
|
|
|
|
|
|
|
|
/* scaling */
|
|
|
|
gdouble scale_x;
|
|
|
|
gdouble scale_y;
|
|
|
|
AnchorCoord scale_center;
|
|
|
|
|
|
|
|
/* anchor point */
|
|
|
|
AnchorCoord anchor;
|
|
|
|
};
|
|
|
|
|
|
|
|
const ClutterTransformInfo * _clutter_actor_get_transform_info_or_defaults (ClutterActor *self);
|
|
|
|
ClutterTransformInfo * _clutter_actor_get_transform_info (ClutterActor *self);
|
|
|
|
|
2010-10-21 07:16:05 -04:00
|
|
|
gboolean _clutter_actor_foreach_child (ClutterActor *self,
|
|
|
|
ClutterForeachCallback callback,
|
2010-12-09 10:06:12 -05:00
|
|
|
gpointer user_data);
|
2010-10-20 10:40:30 -04:00
|
|
|
void _clutter_actor_traverse (ClutterActor *actor,
|
2010-10-21 07:16:05 -04:00
|
|
|
ClutterActorTraverseFlags flags,
|
2010-10-20 10:40:30 -04:00
|
|
|
ClutterTraverseCallback before_children_callback,
|
|
|
|
ClutterTraverseCallback after_children_callback,
|
2010-12-09 10:06:12 -05:00
|
|
|
gpointer user_data);
|
2010-10-21 07:16:05 -04:00
|
|
|
ClutterActor *_clutter_actor_get_stage_internal (ClutterActor *actor);
|
|
|
|
|
|
|
|
void _clutter_actor_apply_modelview_transform (ClutterActor *self,
|
|
|
|
CoglMatrix *matrix);
|
2011-06-17 13:27:45 -04:00
|
|
|
void _clutter_actor_apply_relative_transformation_matrix (ClutterActor *self,
|
|
|
|
ClutterActor *ancestor,
|
|
|
|
CoglMatrix *matrix);
|
2010-10-21 07:16:05 -04:00
|
|
|
|
2010-12-09 10:06:12 -05:00
|
|
|
void _clutter_actor_rerealize (ClutterActor *self,
|
|
|
|
ClutterCallback callback,
|
|
|
|
gpointer data);
|
2010-10-21 07:16:05 -04:00
|
|
|
|
2011-02-03 08:58:20 -05:00
|
|
|
void _clutter_actor_set_opacity_override (ClutterActor *self,
|
|
|
|
gint opacity);
|
2011-03-01 14:52:43 -05:00
|
|
|
gint _clutter_actor_get_opacity_override (ClutterActor *self);
|
2011-02-03 08:58:20 -05:00
|
|
|
void _clutter_actor_set_in_clone_paint (ClutterActor *self,
|
2011-02-11 11:27:46 -05:00
|
|
|
gboolean is_in_clone_paint);
|
2010-10-21 07:16:05 -04:00
|
|
|
|
|
|
|
void _clutter_actor_set_enable_model_view_transform (ClutterActor *self,
|
|
|
|
gboolean enable);
|
|
|
|
|
|
|
|
void _clutter_actor_set_enable_paint_unmapped (ClutterActor *self,
|
|
|
|
gboolean enable);
|
|
|
|
|
|
|
|
void _clutter_actor_set_has_pointer (ClutterActor *self,
|
|
|
|
gboolean has_pointer);
|
|
|
|
|
|
|
|
void _clutter_actor_queue_redraw_with_clip (ClutterActor *self,
|
|
|
|
ClutterRedrawFlags flags,
|
|
|
|
ClutterPaintVolume *clip_volume);
|
2011-02-28 07:16:55 -05:00
|
|
|
void _clutter_actor_queue_redraw_full (ClutterActor *self,
|
|
|
|
ClutterRedrawFlags flags,
|
|
|
|
ClutterPaintVolume *volume,
|
|
|
|
ClutterEffect *effect);
|
|
|
|
|
2011-02-01 13:32:08 -05:00
|
|
|
ClutterPaintVolume *_clutter_actor_get_queue_redraw_clip (ClutterActor *self);
|
2010-10-21 07:16:05 -04:00
|
|
|
void _clutter_actor_set_queue_redraw_clip (ClutterActor *self,
|
2011-02-01 13:32:08 -05:00
|
|
|
ClutterPaintVolume *clip_volume);
|
2010-10-21 07:16:05 -04:00
|
|
|
void _clutter_actor_finish_queue_redraw (ClutterActor *self,
|
|
|
|
ClutterPaintVolume *clip);
|
|
|
|
|
Eliminate G_CONST_RETURN
The G_CONST_RETURN define in GLib is, and has always been, a bit fuzzy.
We always used it to conform to the platform, at least for public-facing
API.
At first I assumed it has something to do with brain-damaged compilers
or with weird platforms where const was not really supported; sadly,
it's something much, much worse: it's a define that can be toggled at
compile-time to remove const from the signature of public API. This is a
truly terrifying feature that I assume was added in the past century,
and whose inception clearly had something to do with massive doses of
absynthe and opium — because any other explanation would make the
existence of such a feature even worse than assuming drugs had anything
to do with it.
Anyway, and pleasing the gods, this dubious feature is being
removed/deprecated in GLib; see bug:
https://bugzilla.gnome.org/show_bug.cgi?id=644611
Before deprecation, though, we should just remove its usage from the
whole API. We should especially remove its usage from Cally's internals,
since there it never made sense in the first place.
2011-06-07 10:49:20 -04:00
|
|
|
gboolean _clutter_actor_set_default_paint_volume (ClutterActor *self,
|
|
|
|
GType check_gtype,
|
|
|
|
ClutterPaintVolume *volume);
|
2010-10-21 07:16:05 -04:00
|
|
|
|
Eliminate G_CONST_RETURN
The G_CONST_RETURN define in GLib is, and has always been, a bit fuzzy.
We always used it to conform to the platform, at least for public-facing
API.
At first I assumed it has something to do with brain-damaged compilers
or with weird platforms where const was not really supported; sadly,
it's something much, much worse: it's a define that can be toggled at
compile-time to remove const from the signature of public API. This is a
truly terrifying feature that I assume was added in the past century,
and whose inception clearly had something to do with massive doses of
absynthe and opium — because any other explanation would make the
existence of such a feature even worse than assuming drugs had anything
to do with it.
Anyway, and pleasing the gods, this dubious feature is being
removed/deprecated in GLib; see bug:
https://bugzilla.gnome.org/show_bug.cgi?id=644611
Before deprecation, though, we should just remove its usage from the
whole API. We should especially remove its usage from Cally's internals,
since there it never made sense in the first place.
2011-06-07 10:49:20 -04:00
|
|
|
const gchar * _clutter_actor_get_debug_name (ClutterActor *self);
|
2010-11-12 13:07:44 -05:00
|
|
|
|
2010-11-13 11:29:49 -05:00
|
|
|
void _clutter_actor_push_clone_paint (void);
|
|
|
|
void _clutter_actor_pop_clone_paint (void);
|
|
|
|
|
2011-04-11 07:30:51 -04:00
|
|
|
guint32 _clutter_actor_get_pick_id (ClutterActor *self);
|
|
|
|
|
2010-10-21 07:16:05 -04:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __CLUTTER_ACTOR_PRIVATE_H__ */
|