2007-11-28 Tomas Frydrych <tf@openedhand.com>

* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
	(clutter_actor_set_positionu):
	(clutter_actor_set_sizeu):
	(clutter_actor_get_widthu):
	(clutter_actor_get_heightu):
	(clutter_actor_set_widthu):
	(clutter_actor_set_heightu):
	(clutter_actor_get_xu):
	(clutter_actor_get_yu):
	(clutter_actor_set_xu):
	(clutter_actor_set_yu):
	Expanded ClutterActor API with new ClutterUnit-base functions.

        * clutter/clutter-stage.c:
        * clutter/clutter-stage.h:
	(clutter_stage_get_resolution):
	(clutter_stage_get_resolutionx):
	New function to query stage resolution (floating and fixed point
	versions).

        * clutter/clutter-units.h:
	(CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE):
	(CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE):
	(CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE):
	(CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE):
	(CLUTTER_UNITS_FROM_MM):
	(CLUTTER_UNITS_FROM_MMX):
	(CLUTTER_UNITS_FROM_POINTS):
	(CLUTTER_UNITS_FROM_POINTSX):
	New macros for conversions to ClutterUnits.

	* clutter.symbols:
	Added:
	        ClutterActor anchor_point functions,
                clutter_stage_get_resolution functions.

	Removed:
                clutter_actor_scale_with_gravity functions.
This commit is contained in:
Tomas Frydrych 2007-11-28 15:31:41 +00:00
parent be3f09d64c
commit 132296dcc3
9 changed files with 494 additions and 117 deletions

View File

@ -1,3 +1,45 @@
2007-11-28 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.c:
* clutter/clutter-actor.h:
(clutter_actor_set_positionu):
(clutter_actor_set_sizeu):
(clutter_actor_get_widthu):
(clutter_actor_get_heightu):
(clutter_actor_set_widthu):
(clutter_actor_set_heightu):
(clutter_actor_get_xu):
(clutter_actor_get_yu):
(clutter_actor_set_xu):
(clutter_actor_set_yu):
Expanded ClutterActor API with new ClutterUnit-base functions.
* clutter/clutter-stage.c:
* clutter/clutter-stage.h:
(clutter_stage_get_resolution):
(clutter_stage_get_resolutionx):
New function to query stage resolution (floating and fixed point
versions).
* clutter/clutter-units.h:
(CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE):
(CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE):
(CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE):
(CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE):
(CLUTTER_UNITS_FROM_MM):
(CLUTTER_UNITS_FROM_MMX):
(CLUTTER_UNITS_FROM_POINTS):
(CLUTTER_UNITS_FROM_POINTSX):
New macros for conversions to ClutterUnits.
* clutter.symbols:
Added:
ClutterActor anchor_point functions,
clutter_stage_get_resolution functions.
Removed:
clutter_actor_scale_with_gravity functions.
2007-11-28 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Documentation fixes.
@ -13,12 +55,12 @@
* clutter/clutter-layout.[ch]: Remove the ClutterLayout
interface.
* clutter/clutter-box.[ch]:
* clutter/clutter-hbox.[ch]:
* clutter/clutter-vbox.[ch]: Remove ClutterBox and its
subclasses.
* clutter/clutter-label.c: Remove ClutterLayout implementation
* clutter/clutter-script-private.h:

View File

@ -16,7 +16,9 @@ clutter_actor_set_geometry
clutter_actor_get_geometry
clutter_actor_get_coords
clutter_actor_set_size
clutter_actor_set_sizeu
clutter_actor_set_position
clutter_actor_set_positionu
clutter_actor_get_abs_position
clutter_actor_get_width
clutter_actor_get_height
@ -26,6 +28,14 @@ clutter_actor_get_x
clutter_actor_set_x
clutter_actor_get_y
clutter_actor_set_y
clutter_actor_get_widthu
clutter_actor_get_heightu
clutter_actor_set_widthu
clutter_actor_set_heightu
clutter_actor_get_xu
clutter_actor_set_xu
clutter_actor_get_yu
clutter_actor_set_yu
clutter_actor_set_rotation
clutter_actor_set_rotationx
clutter_actor_get_rotation
@ -33,7 +43,7 @@ clutter_actor_get_rotationx
clutter_actor_set_opacity
clutter_actor_get_opacity
clutter_actor_set_name
clutter_actor_get_name
clutter_actor_get_name
clutter_actor_get_id
clutter_actor_set_clip
clutter_actor_remove_clip
@ -53,23 +63,26 @@ clutter_actor_set_scalex
clutter_actor_set_scale
clutter_actor_get_scalex
clutter_actor_get_scale
clutter_actor_set_scale_with_gravityx
clutter_actor_set_scale_with_gravity
clutter_actor_set_anchor_point
clutter_actor_get_anchor_point
clutter_actor_set_anchor_pointu
clutter_actor_get_anchor_pointu
clutter_actor_set_anchor_point_from_gravity
clutter_actor_get_abs_size
clutter_actor_get_size
clutter_actor_move_by
clutter_actor_get_vertices
clutter_actor_apply_transform_to_point
clutter_actor_set_reactive
clutter_actor_get_reactive
clutter_get_actor_by_id
clutter_actor_set_reactive
clutter_actor_get_reactive
clutter_get_actor_by_id
clutter_alpha_get_type
clutter_alpha_new
clutter_alpha_new_full
clutter_alpha_get_alpha
clutter_alpha_set_func
clutter_alpha_set_timeline
clutter_alpha_get_timeline
clutter_alpha_get_timeline
clutter_ramp_inc_func
clutter_ramp_dec_func
clutter_ramp_func
@ -83,7 +96,7 @@ clutter_smoothstep_dec_func
clutter_exp_inc_func
clutter_exp_dec_func
clutter_backend_get_type
clutter_get_default_backend
clutter_get_default_backend
clutter_backend_set_resolution
clutter_backend_get_resolution
clutter_backend_set_double_click_time
@ -91,18 +104,18 @@ clutter_backend_get_double_click_time
clutter_backend_set_double_click_distance
clutter_backend_get_double_click_distance
clutter_behaviour_bspline_get_type
clutter_behaviour_bspline_new
clutter_behaviour_bspline_new
clutter_behaviour_bspline_append_knot
clutter_behaviour_bspline_append
clutter_behaviour_bspline_truncate
clutter_behaviour_bspline_join
clutter_behaviour_bspline_split
clutter_behaviour_bspline_split
clutter_behaviour_bspline_clear
clutter_behaviour_bspline_adjust
clutter_behaviour_bspline_set_origin
clutter_behaviour_bspline_get_origin
clutter_behaviour_depth_get_type
clutter_behaviour_depth_new
clutter_behaviour_depth_new
clutter_behaviour_ellipse_get_type
clutter_behaviour_ellipse_new
clutter_behaviour_ellipse_newx
@ -131,9 +144,9 @@ clutter_behaviour_ellipse_get_tiltx
clutter_behaviour_ellipse_get_direction
clutter_behaviour_ellipse_set_direction
clutter_behaviour_opacity_get_type
clutter_behaviour_opacity_new
clutter_behaviour_opacity_new
clutter_behaviour_path_get_type
clutter_behaviour_path_new
clutter_behaviour_path_new
clutter_behaviour_path_get_knots
clutter_behaviour_path_append_knot
clutter_behaviour_path_append_knots
@ -141,8 +154,8 @@ clutter_behaviour_path_insert_knot
clutter_behaviour_path_remove_knot
clutter_behaviour_path_clear
clutter_behaviour_rotate_get_type
clutter_behaviour_rotate_new
clutter_behaviour_rotate_newx
clutter_behaviour_rotate_new
clutter_behaviour_rotate_newx
clutter_behaviour_rotate_get_center
clutter_behaviour_rotate_set_center
clutter_behaviour_rotate_get_axis
@ -154,8 +167,8 @@ clutter_behaviour_rotate_set_bounds
clutter_behaviour_rotate_get_boundsx
clutter_behaviour_rotate_set_boundsx
clutter_behaviour_scale_get_type
clutter_behaviour_scale_new
clutter_behaviour_scale_newx
clutter_behaviour_scale_new
clutter_behaviour_scale_newx
clutter_behaviour_scale_get_bounds
clutter_behaviour_scale_get_boundsx
clutter_behaviour_scale_get_gravity
@ -165,9 +178,9 @@ clutter_behaviour_remove
clutter_behaviour_remove_all
clutter_behaviour_actors_foreach
clutter_behaviour_get_n_actors
clutter_behaviour_get_nth_actor
clutter_behaviour_get_nth_actor
clutter_behaviour_get_actors
clutter_behaviour_get_alpha
clutter_behaviour_get_alpha
clutter_behaviour_set_alpha
clutter_behaviour_is_applied
clutter_box_get_type
@ -184,9 +197,9 @@ clutter_box_query_child
clutter_box_query_nth_child
clutter_clone_texture_get_type
clutter_clone_texture_new
clutter_clone_texture_get_parent_texture
clutter_clone_texture_get_parent_texture
clutter_clone_texture_set_parent_texture
clutter_color_copy
clutter_color_copy
clutter_color_free
clutter_color_parse
clutter_color_equal
@ -219,26 +232,26 @@ clutter_container_lower_child
clutter_container_sort_depth_order
clutter_debug_flags;
clutter_effect_template_get_type
clutter_effect_template_new
clutter_effect_template_new_full
clutter_effect_template_new
clutter_effect_template_new_full
clutter_effect_template_new_for_duration
clutter_effect_template_set_timeline_clone
clutter_effect_template_get_timeline_clone
clutter_effect_fade
clutter_effect_depth
clutter_effect_move
clutter_effect_scale
clutter_effect_rotate_x
clutter_effect_rotate_y
clutter_effect_rotate_z
clutter_effect_fade
clutter_effect_depth
clutter_effect_move
clutter_effect_scale
clutter_effect_rotate_x
clutter_effect_rotate_y
clutter_effect_rotate_z
clutter_entry_get_type
clutter_entry_new
clutter_entry_new_full
clutter_entry_new_with_text
clutter_entry_set_text
clutter_entry_get_text
clutter_entry_get_text
clutter_entry_set_font_name
clutter_entry_get_font_name
clutter_entry_get_font_name
clutter_entry_set_color
clutter_entry_get_color
clutter_entry_get_layout
@ -288,32 +301,32 @@ clutter_sqrti
clutter_log2x
clutter_pow2x
clutter_powx
_clutter_double_to_fixed
_clutter_double_to_int
_clutter_double_to_uint
_clutter_double_to_fixed
_clutter_double_to_int
_clutter_double_to_uint
clutter_group_get_type
clutter_group_new
clutter_group_get_nth_child
clutter_group_new
clutter_group_get_nth_child
clutter_group_get_n_children
clutter_group_remove_all
clutter_group_add
clutter_group_add_many
clutter_group_add_many_valist
clutter_group_remove
clutter_group_find_child_by_id
clutter_group_find_child_by_id
clutter_group_raise
clutter_group_lower
clutter_group_sort_depth_order
clutter_hbox_get_type
clutter_hbox_new
clutter_hbox_new
clutter_label_get_type
clutter_label_new
clutter_label_new_full
clutter_label_new_with_text
clutter_label_set_text
clutter_label_get_text
clutter_label_get_text
clutter_label_set_font_name
clutter_label_get_font_name
clutter_label_get_font_name
clutter_label_set_color
clutter_label_get_color
clutter_label_set_ellipsize
@ -365,16 +378,16 @@ clutter_grab_keyboard
clutter_ungrab_keyboard
clutter_get_keyboard_grab
clutter_media_get_type
clutter_media_get_uri
clutter_media_get_playing
clutter_media_get_position
clutter_media_get_volume
clutter_media_get_can_seek
clutter_media_get_buffer_percent
clutter_media_get_duration
clutter_media_get_uri
clutter_media_get_playing
clutter_media_get_position
clutter_media_get_volume
clutter_media_get_can_seek
clutter_media_get_buffer_percent
clutter_media_get_duration
clutter_rectangle_get_type
clutter_rectangle_new
clutter_rectangle_new_with_color
clutter_rectangle_new
clutter_rectangle_new_with_color
clutter_rectangle_get_color
clutter_rectangle_set_color
clutter_rectangle_get_border_width
@ -382,10 +395,10 @@ clutter_rectangle_set_border_width
clutter_rectangle_get_border_color
clutter_rectangle_set_border_color
clutter_perspective_get_type
clutter_perspective_copy
clutter_perspective_copy
clutter_perspective_free
clutter_stage_get_type
clutter_stage_get_default
clutter_stage_get_default
clutter_stage_set_color
clutter_stage_get_color
clutter_stage_set_perspectivex
@ -396,24 +409,26 @@ clutter_stage_fullscreen
clutter_stage_unfullscreen
clutter_stage_show_cursor
clutter_stage_hide_cursor
clutter_stage_get_actor_at_pos
clutter_stage_get_actor_at_pos
clutter_stage_snapshot
clutter_stage_event
clutter_stage_set_title
clutter_stage_get_title
clutter_stage_get_title
clutter_stage_set_user_resizable
clutter_stage_get_user_resizable
clutter_stage_set_key_focus
clutter_stage_set_key_focus
clutter_stage_set_use_fog
clutter_stage_get_use_fog
clutter_stage_set_fog
clutter_stage_get_fog
clutter_stage_set_fogx
clutter_stage_get_fogx
clutter_stage_get_resolution
clutter_stage_get_resolutionx
clutter_texture_error_quark
clutter_texture_get_type
clutter_texture_new
clutter_texture_new_from_pixbuf
clutter_texture_new
clutter_texture_new_from_pixbuf
clutter_texture_set_from_rgb_data
clutter_texture_set_from_yuv_data
clutter_texture_set_pixbuf
@ -426,9 +441,9 @@ clutter_texture_get_y_tile_detail
clutter_texture_has_generated_tiles
clutter_texture_is_tiled
clutter_timeline_get_type
clutter_timeline_new
clutter_timeline_new
clutter_timeline_new_for_duration
clutter_timeline_clone
clutter_timeline_clone
clutter_timeline_get_speed
clutter_timeline_set_speed
clutter_timeline_get_direction
@ -449,55 +464,55 @@ clutter_timeline_set_delay
clutter_timeline_get_delay
clutter_timeline_set_duration
clutter_timeline_get_duration
clutter_timeout_pool_new
clutter_timeout_pool_new
clutter_timeout_pool_add
clutter_timeout_pool_remove
clutter_geometry_get_type
clutter_vertex_get_type
clutter_knot_get_type
clutter_knot_copy
clutter_knot_copy
clutter_knot_free
clutter_knot_equal
clutter_margin_get_type
clutter_padding_get_type
clutter_vbox_get_type
clutter_vbox_new
cogl_get_proc_address
cogl_check_extension
cogl_paint_init
cogl_push_matrix
cogl_pop_matrix
cogl_scale
cogl_translatex
cogl_translate
cogl_rotatex
cogl_rotate
cogl_color
cogl_clip_set
cogl_clip_unset
cogl_enable
cogl_textures_create
cogl_textures_destroy
cogl_texture_bind
cogl_rectangle
cogl_get_features
cogl_get_modelview_matrix
cogl_get_projection_matrix
cogl_get_viewport
cogl_get_bitmasks
clutter_vbox_new
cogl_get_proc_address
cogl_check_extension
cogl_paint_init
cogl_push_matrix
cogl_pop_matrix
cogl_scale
cogl_translatex
cogl_translate
cogl_rotatex
cogl_rotate
cogl_color
cogl_clip_set
cogl_clip_unset
cogl_enable
cogl_textures_create
cogl_textures_destroy
cogl_texture_bind
cogl_rectangle
cogl_get_features
cogl_get_modelview_matrix
cogl_get_projection_matrix
cogl_get_viewport
cogl_get_bitmasks
pango_clutter_font_map_get_type
pango_clutter_font_map_new
pango_clutter_font_map_substitute_changed
pango_clutter_font_map_create_context
pango_clutter_render_clear_caches
pango_clutter_font_map_new
pango_clutter_font_map_substitute_changed
pango_clutter_font_map_create_context
pango_clutter_render_clear_caches
clutter_score_get_type
clutter_score_new
clutter_score_get_loop
clutter_score_rewind
clutter_score_is_playing
clutter_score_start
clutter_score_stop
clutter_score_remove_all
clutter_score_new
clutter_score_get_loop
clutter_score_rewind
clutter_score_is_playing
clutter_score_start
clutter_score_stop
clutter_score_remove_all
clutter_score_add
clutter_score_append
clutter_actor_flags_get_type
@ -518,7 +533,7 @@ clutter_rotate_axis_get_type
clutter_rotate_direction_get_type
clutter_script_error_quark
clutter_script_get_type
clutter_script_new
clutter_script_new
clutter_script_load_from_file
clutter_script_load_from_data
clutter_script_get_object

View File

@ -1903,6 +1903,37 @@ clutter_actor_set_position (ClutterActor *self,
clutter_actor_request_coords (self, &box);
}
/**
* clutter_actor_set_positionu
* @self: A #ClutterActor
* @x: New left position of actor in #ClutterUnit
* @y: New top position of actor in #ClutterUnit
*
* Sets the actors position in #ClutterUnit relative to any
* parent actor.
*
* Since: 0.6
*/
void
clutter_actor_set_positionu (ClutterActor *self,
ClutterUnit x,
ClutterUnit y)
{
ClutterActorBox box;
g_return_if_fail (CLUTTER_IS_ACTOR (self));
clutter_actor_query_coords (self, &box);
box.x2 += (x - box.x1);
box.y2 += (y - box.y1);
box.x1 = x;
box.y1 = y;
clutter_actor_request_coords (self, &box);
}
/**
* clutter_actor_move_by
* @self: A #ClutterActor
@ -1957,6 +1988,28 @@ clutter_actor_set_size_internal (ClutterActor *self,
clutter_actor_request_coords (self, &box);
}
/* local inline unit version, without type checking to be used by
* set_width() and set_height(). if one of the dimensions is < 0
* it will not be changed
*/
static inline void
clutter_actor_set_size_internalu (ClutterActor *self,
ClutterUnit width,
ClutterUnit height)
{
ClutterActorBox box;
clutter_actor_query_coords (self, &box);
if (width > 0)
box.x2 = box.x1 + width;
if (height > 0)
box.y2 = box.y1 + height;
clutter_actor_request_coords (self, &box);
}
/**
* clutter_actor_set_size
* @self: A #ClutterActor
@ -1976,6 +2029,27 @@ clutter_actor_set_size (ClutterActor *self,
clutter_actor_set_size_internal (self, width, height);
}
/**
* clutter_actor_set_sizeu
* @self: A #ClutterActor
* @width: New width of actor in #ClutterUnit, or -1
* @height: New height of actor in #ClutterUnit, or -1
*
* Sets the actors size in #ClutterUnit. If @width and/or @height are -1 the
* actor will assume the same size of its bounding box.
*
* Since: 0.6
*/
void
clutter_actor_set_sizeu (ClutterActor *self,
ClutterUnit width,
ClutterUnit height)
{
g_return_if_fail (CLUTTER_IS_ACTOR (self));
clutter_actor_set_size_internalu (self, width, height);
}
/**
* clutter_actor_get_size:
* @self: A #ClutterActor
@ -2185,6 +2259,28 @@ clutter_actor_get_width (ClutterActor *self)
return CLUTTER_UNITS_TO_INT (box.x2 - box.x1);
}
/**
* clutter_actor_get_widthu
* @self: A #ClutterActor
*
* Retrieves the actors width ignoring any scaling factors.
*
* Return value: The actor width in #ClutterUnit
*
* since: 0.6
**/
ClutterUnit
clutter_actor_get_widthu (ClutterActor *self)
{
ClutterActorBox box;
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0);
clutter_actor_query_coords (self, &box);
return box.x2 - box.x1;
}
/**
* clutter_actor_get_height
* @self: A #ClutterActor
@ -2205,6 +2301,28 @@ clutter_actor_get_height (ClutterActor *self)
return CLUTTER_UNITS_TO_INT (box.y2 - box.y1);
}
/**
* clutter_actor_get_heightu
* @self: A #ClutterActor
*
* Retrieves the actors height ignoring any scaling factors.
*
* Return value: The actor height in #ClutterUnit
*
* since: 0.6
**/
ClutterUnit
clutter_actor_get_heightu (ClutterActor *self)
{
ClutterActorBox box;
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0);
clutter_actor_query_coords (self, &box);
return box.y2 - box.y1;
}
/**
* clutter_actor_set_width
* @self: A #ClutterActor
@ -2212,7 +2330,7 @@ clutter_actor_get_height (ClutterActor *self)
*
* Requests a new width for actor
*
* since: 2.0
* since: 0.2
**/
void
clutter_actor_set_width (ClutterActor *self,
@ -2223,6 +2341,24 @@ clutter_actor_set_width (ClutterActor *self,
clutter_actor_set_size_internal (self, width, -1);
}
/**
* clutter_actor_set_widthu
* @self: A #ClutterActor
* @width: Requested new width for actor in #ClutterUnit
*
* Requests a new width for actor
*
* since: 0.6
**/
void
clutter_actor_set_widthu (ClutterActor *self,
ClutterUnit width)
{
g_return_if_fail (CLUTTER_IS_ACTOR (self));
clutter_actor_set_size_internalu (self, width, -1);
}
/**
* clutter_actor_set_height
* @self: A #ClutterActor
@ -2230,7 +2366,7 @@ clutter_actor_set_width (ClutterActor *self,
*
* Requests a new height for actor
*
* since: 2.0
* since: 0.2
**/
void
clutter_actor_set_height (ClutterActor *self,
@ -2241,6 +2377,24 @@ clutter_actor_set_height (ClutterActor *self,
clutter_actor_set_size_internal (self, -1, height);
}
/**
* clutter_actor_set_heightu
* @self: A #ClutterActor
* @height: Requested new height for actor in #ClutterUnit
*
* Requests a new height for actor
*
* since: 0.6
**/
void
clutter_actor_set_heightu (ClutterActor *self,
ClutterUnit height)
{
g_return_if_fail (CLUTTER_IS_ACTOR (self));
clutter_actor_set_size_internalu (self, -1, height);
}
/**
* clutter_actor_set_x:
* @self: a #ClutterActor
@ -2261,6 +2415,26 @@ clutter_actor_set_x (ClutterActor *self,
clutter_actor_get_y (self));
}
/**
* clutter_actor_set_xu:
* @self: a #ClutterActor
* @x: the actors position on the X axis in #ClutterUnit
*
* Sets the actor's x position relative to its parent.
*
* Since: 0.6
*/
void
clutter_actor_set_xu (ClutterActor *self,
ClutterUnit x)
{
g_return_if_fail (CLUTTER_IS_ACTOR (self));
clutter_actor_set_positionu (self,
x,
clutter_actor_get_yu (self));
}
/**
* clutter_actor_set_y:
* @self: a #ClutterActor
@ -2281,6 +2455,26 @@ clutter_actor_set_y (ClutterActor *self,
y);
}
/**
* clutter_actor_set_yu:
* @self: a #ClutterActor
* @y: the actors position on the Y axis in #ClutterUnit
*
* Sets the actor's y position relative to its parent.
*
* Since: 0.6
*/
void
clutter_actor_set_yu (ClutterActor *self,
ClutterUnit y)
{
g_return_if_fail (CLUTTER_IS_ACTOR (self));
clutter_actor_set_positionu (self,
clutter_actor_get_xu (self),
y);
}
/**
* clutter_actor_get_x
* @self: A #ClutterActor
@ -2302,6 +2496,29 @@ clutter_actor_get_x (ClutterActor *self)
return CLUTTER_UNITS_TO_INT (box.x1);
}
/**
* clutter_actor_get_xu
* @self: A #ClutterActor
*
* Retrieves the actors x position relative to any parent, in #ClutterUnit
*
* Return value: The actor x position in #ClutterUnit ignoring any tranforms
* (i.e scaling, rotation).
*
* Since: 0.6
**/
ClutterUnit
clutter_actor_get_xu (ClutterActor *self)
{
ClutterActorBox box;
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0);
clutter_actor_query_coords (self, &box);
return box.x1;
}
/**
* clutter_actor_get_y:
* @self: A #ClutterActor
@ -2323,6 +2540,27 @@ clutter_actor_get_y (ClutterActor *self)
return CLUTTER_UNITS_TO_INT (box.y1);
}
/**
* clutter_actor_get_yu:
* @self: A #ClutterActor
*
* Retrieves the actors y position relative to any parent, in #ClutterUnit
*
* Return value: The actor y position in #ClutterUnit ignoring any tranforms
* (i.e scaling, rotation).
**/
ClutterUnit
clutter_actor_get_yu (ClutterActor *self)
{
ClutterActorBox box;
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), 0);
clutter_actor_query_coords (self, &box);
return box.y1;
}
/**
* clutter_actor_set_scalex:
* @self: A #ClutterActor

View File

@ -251,9 +251,15 @@ void clutter_actor_get_coords (ClutterActor *sel
void clutter_actor_set_size (ClutterActor *self,
gint width,
gint height);
void clutter_actor_set_sizeu (ClutterActor *self,
ClutterUnit width,
ClutterUnit height);
void clutter_actor_set_position (ClutterActor *self,
gint x,
gint y);
void clutter_actor_set_positionu (ClutterActor *self,
ClutterUnit x,
ClutterUnit y);
void clutter_actor_get_position (ClutterActor *self,
gint *x,
gint *y);
@ -261,17 +267,29 @@ void clutter_actor_get_abs_position (ClutterActor *sel
gint *x,
gint *y);
guint clutter_actor_get_width (ClutterActor *self);
ClutterUnit clutter_actor_get_widthu (ClutterActor *self);
guint clutter_actor_get_height (ClutterActor *self);
ClutterUnit clutter_actor_get_heightu (ClutterActor *self);
void clutter_actor_set_width (ClutterActor *self,
guint width);
void clutter_actor_set_widthu (ClutterActor *self,
ClutterUnit width);
void clutter_actor_set_height (ClutterActor *self,
guint height);
void clutter_actor_set_heightu (ClutterActor *self,
ClutterUnit height);
gint clutter_actor_get_x (ClutterActor *self);
ClutterUnit clutter_actor_get_xu (ClutterActor *self);
gint clutter_actor_get_y (ClutterActor *self);
ClutterUnit clutter_actor_get_yu (ClutterActor *self);
void clutter_actor_set_x (ClutterActor *self,
gint x);
void clutter_actor_set_xu (ClutterActor *self,
ClutterUnit x);
void clutter_actor_set_y (ClutterActor *self,
gint y);
void clutter_actor_set_yu (ClutterActor *self,
ClutterUnit y);
void clutter_actor_set_rotation (ClutterActor *self,
ClutterRotateAxis axis,
gdouble angle,

View File

@ -1139,7 +1139,7 @@ clutter_stage_get_fog (ClutterStage *stage,
* @z_near: starting point of the depth cueing
* @z_far: ending point of the depth cueing
*
* Sets the GL fog settings used to create the depth cueing effect
* Sets the GL fog settings used to create the depth cueing effect
* on the @stage.
*
* If the actors are all near the view point you will need a higher @density
@ -1216,6 +1216,31 @@ clutter_stage_get_fogx (ClutterStage *stage,
*fog = stage->priv->fog;
}
gdouble
clutter_stage_get_resolution (ClutterStage *stage)
{
ClutterMainContext *context;
context = clutter_context_get_default ();
g_assert (context != NULL);
return clutter_backend_get_resolution (context->backend);
}
ClutterFixed
clutter_stage_get_resolutionx (ClutterStage *stage)
{
ClutterFixed res;
ClutterMainContext *context;
context = clutter_context_get_default ();
g_assert (context != NULL);
res = clutter_backend_get_resolution (context->backend);
return CLUTTER_FLOAT_TO_FIXED (res);
}
/*** Perspective boxed type ******/
static ClutterPerspective *

View File

@ -74,11 +74,11 @@ struct _ClutterStage
{
/*< private >*/
ClutterGroup parent_instance;
ClutterStagePrivate *priv;
};
struct _ClutterStageClass
ClutterStagePrivate *priv;
};
struct _ClutterStageClass
{
/*< private >*/
ClutterGroupClass parent_class;
@ -193,7 +193,7 @@ gboolean clutter_stage_event (ClutterStage *stage,
void clutter_stage_set_title (ClutterStage *stage,
const gchar *title);
G_CONST_RETURN gchar *clutter_stage_get_title (ClutterStage *stage);
void clutter_stage_set_user_resizable (ClutterStage *stage,
void clutter_stage_set_user_resizable (ClutterStage *stage,
gboolean resizable);
gboolean clutter_stage_get_user_resizable (ClutterStage *stage);
void clutter_stage_set_use_fog (ClutterStage *stage,
@ -211,6 +211,8 @@ void clutter_stage_set_fogx (ClutterStage *stage,
ClutterFog *fog);
void clutter_stage_get_fogx (ClutterStage *stage,
ClutterFog *fog);
gdouble clutter_stage_get_resolution (ClutterStage *stage);
ClutterFixed clutter_stage_get_resolutionx (ClutterStage *stage);
/* New experiental calls */
void clutter_stage_set_key_focus (ClutterStage *stage,

View File

@ -40,7 +40,7 @@
* but when the API transition happens will map to #CLUTTER_UNITS_TO_DEVICE and
* #CLUTTER_UNITS_FROM_DEVICE respectively. You can use these in newly written
* code as place holders.
*
*
* Since: 0.4
*/
@ -66,6 +66,7 @@ typedef gint32 ClutterUnit;
* _FROM_FIXED and _TO_FIXED macros should always be used in case that we
* decide to change this relationship in the future.
*/
#define CLUTTER_UNITS_FROM_DEVICE(x) CLUTTER_UNITS_FROM_INT (x)
#define CLUTTER_UNITS_TO_DEVICE(x) CLUTTER_UNITS_TO_INT (x)
@ -84,6 +85,30 @@ typedef gint32 ClutterUnit;
#define CLUTTER_UNITS_FROM_PANGO_UNIT(x) ((x) << 6)
#define CLUTTER_UNITS_TO_PANGO_UNIT(x) ((x) >> 6)
#define CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE(x) \
((clutter_actor_get_widthu (clutter_stage_get_default ()) * x)/100)
#define CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE(x) \
((clutter_actor_get_heightu (clutter_stage_get_default ()) * x)/100)
#define CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE(a, x) \
((clutter_actor_get_widthu (clutter_actor_get_parent (a)) * x)/100)
#define CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE(a, x) \
((clutter_actor_get_heightu (clutter_actor_get_parent (a)) * x)/100)
#define CLUTTER_UNITS_FROM_MM(x) \
CLUTTER_UNITS_FROM_FLOAT(((x*clutter_stage_get_resolution (clutter_stage_get_default ())) / 25.4))
#define CLUTTER_UNITS_FROM_MMX(x) \
CFX_DIV(CFX_MUL(x,clutter_stage_get_resolutionx(clutter_stage_get_default())),0x196666)
#define CLUTTER_UNITS_FROM_POINTS(x) \
CLUTTER_UNITS_FROM_FLOAT(((x*clutter_stage_get_resolution(clutter_stage_get_default()))/72.0))
#define CLUTTER_UNITS_FROM_POINTSX(x) \
(CFX_MUL(x,clutter_stage_get_resolutionx(clutter_stage_get_default()))/72)
G_END_DECLS
#endif /* _HAVE_CLUTTER_UNITS_H */

View File

@ -1,3 +1,7 @@
2007-11-28 Tomas Frydrych <tf@openedhand.com>
* clutter-sections.txt: added new CLUTTER_UNITS_FROM_* macros.
2007-11-28 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-sections.txt: Documentation fixes.
@ -169,7 +173,7 @@
2007-07-28 Emmanuele Bassi <ebasso@openedhand.com>
* clutter-sections.txt: Add new ClutterBehaviourEllipse
* clutter-sections.txt: Add new ClutterBehaviourEllipse
and ClutterStage API.
2007-07-26 Emmanuele Bassi <ebassi@openedhand.com>
@ -181,7 +185,7 @@
* Makefile.am:
* clutter-animation.sgml:
* clutter-docs.sgml:
An initial shot at some general animation documentation.
An initial shot at some general animation documentation.
Needs some love.
2007-07-25 Emmanuele Bassi <ebassi@openedhand.com>
@ -285,7 +289,7 @@
* tmpl/clutter-behaviour-bspline.sgml:
* tmpl/clutter-behaviour-ellipse.sgml:
Updated templates.
2007-05-31 Neil J Patel <njp@o-hand.com>
* clutter-docs.sgml:
@ -297,12 +301,12 @@
* tmpl/clutter-behaviour-ellipse.sgml:
Updated template.
2007-05-31 Tomas Frydrych <tf@openedhand.com>
* clutter.types:
Added clutter_vertices_get_type.
2007-05-30 Tomas Frydrych <tf@openedhand.com>
* clutter.types:
@ -312,11 +316,11 @@
* tmpl/clutter-actor.sgml:
* tmpl/clutter-media.sgml:
Updated templates.
2007-05-22 Tomas Frydrych <tf@openedhand.com>
* clutter-sections.txt:
* clutter-docs.sgml:
* clutter-docs.sgml:
* tmpl/clutter-units.sgml:
Added clutter-units.
@ -325,7 +329,7 @@
* tmpl/clutter-media.sgml:
* tmpl/clutter-behaviour-ellipse.sgml:
Updated templates.
2007-05-17 Emmanuele Bassi <ebassi@openedhand.com>
* Makefile.am: Ignore the sdl backend.
@ -383,7 +387,7 @@
* clutter-docs.sgml: added clutter-fixed
* tmpl/clutter-fixed.sgml: added intro to fixed point math
2007-01-18 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-sections.txt: Remove old cruft.

View File

@ -40,6 +40,14 @@ CLUTTER_UNITS_FROM_PANGO_UNIT
CLUTTER_UNITS_TO_PANGO_UNIT
CLUTTER_UNITS_TMP_FROM_DEVICE
CLUTTER_UNITS_TMP_TO_DEVICE
CLUTTER_UNITS_FROM_STAGE_WIDTH_PERCENTAGE
CLUTTER_UNITS_FROM_STAGE_HEIGHT_PERCENTAGE
CLUTTER_UNITS_FROM_PARENT_WIDTH_PERCENTAGE
CLUTTER_UNITS_FROM_PARENT_HEIGHT_PERCENTAGE
CLUTTER_UNITS_FROM_MM
CLUTTER_UNITS_FROM_MMX
CLUTTER_UNITS_FROM_POINTS
CLUTTER_UNITS_FROM_POINTSX
</SECTION>
<SECTION>