[clutter/wip/apocalypses/apocalypse-3: 15/35] content: Make get_preferred_size() public
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/wip/apocalypses/apocalypse-3: 15/35] content: Make get_preferred_size() public
- Date: Thu, 15 Mar 2012 18:05:56 +0000 (UTC)
commit c51fbe5695bd1fbfb95e60678360325a7880d181
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Thu Mar 8 14:05:48 2012 +0000
content: Make get_preferred_size() public
clutter/clutter-actor.c | 9 ++++++---
clutter/clutter-content-private.h | 4 ----
clutter/clutter-content.c | 14 +++++++++-----
clutter/clutter-content.h | 3 +++
4 files changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index c4df67a..acbae95 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -3205,6 +3205,9 @@ clutter_actor_paint_node (ClutterActor *actor,
{
ClutterActorPrivate *priv = actor->priv;
+ if (root == NULL)
+ return FALSE;
+
if (priv->bg_color_set &&
!clutter_color_equal (&priv->bg_color, CLUTTER_COLOR_Transparent))
{
@@ -17614,9 +17617,9 @@ clutter_actor_get_content_box (ClutterActor *self,
/* if the content does not have a preferred size then there is
* no point in computing the content box
*/
- if (!_clutter_content_get_preferred_size (priv->content,
- &content_w,
- &content_h))
+ if (!clutter_content_get_preferred_size (priv->content,
+ &content_w,
+ &content_h))
return;
clutter_actor_box_get_size (&priv->allocation, &alloc_w, &alloc_h);
diff --git a/clutter/clutter-content-private.h b/clutter/clutter-content-private.h
index 56c3f78..009ae41 100644
--- a/clutter/clutter-content-private.h
+++ b/clutter/clutter-content-private.h
@@ -29,10 +29,6 @@
G_BEGIN_DECLS
-gboolean _clutter_content_get_preferred_size (ClutterContent *content,
- gfloat *width,
- gfloat *height);
-
void _clutter_content_attached (ClutterContent *content,
ClutterActor *actor);
void _clutter_content_detached (ClutterContent *content,
diff --git a/clutter/clutter-content.c b/clutter/clutter-content.c
index 04942a3..c404620 100644
--- a/clutter/clutter-content.c
+++ b/clutter/clutter-content.c
@@ -275,8 +275,8 @@ _clutter_content_paint_content (ClutterContent *content,
CLUTTER_CONTENT_GET_IFACE (content)->paint_content (content, actor, node);
}
-/*< private >
- * _clutter_content_get_preferred_size:
+/**
+ * clutter_content_get_preferred_size:
* @content: a #ClutterContent
* @width: (out): return location for the natural width of the content
* @height: (out): return location for the natural height of the content
@@ -289,12 +289,16 @@ _clutter_content_paint_content (ClutterContent *content,
*
* Return value: %TRUE if the content has a preferred size, and %FALSE
* otherwise
+ *
+ * Since: 1.10
*/
gboolean
-_clutter_content_get_preferred_size (ClutterContent *content,
- gfloat *width,
- gfloat *height)
+clutter_content_get_preferred_size (ClutterContent *content,
+ gfloat *width,
+ gfloat *height)
{
+ g_return_val_if_fail (CLUTTER_IS_CONTENT (content), FALSE);
+
return CLUTTER_CONTENT_GET_IFACE (content)->get_preferred_size (content,
width,
height);
diff --git a/clutter/clutter-content.h b/clutter/clutter-content.h
index 2a5b01e..e329f3f 100644
--- a/clutter/clutter-content.h
+++ b/clutter/clutter-content.h
@@ -90,6 +90,9 @@ struct _ClutterContentIface
GType clutter_content_get_type (void) G_GNUC_CONST;
+gboolean clutter_content_get_preferred_size (ClutterContent *content,
+ gfloat *width,
+ gfloat *height);
void clutter_content_invalidate (ClutterContent *content);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]