* is already configured using the appropriate font map, resolution
* and font options.
*
- * The returned #PangoContext will be updated each time the options
- * stored by the default #ClutterBackend change.
+ * Unlike clutter_actor_create_pango_context(), this context is owend
+ * by the #ClutterActor and it will be updated each time the options
+ * stored by the #ClutterBackend change.
*
* You can use the returned #PangoContext to create a #PangoLayout
* and render text using cogl_pango_render_layout() to reuse the
return priv->pango_context;
ctx = CLUTTER_CONTEXT ();
- priv->pango_context = _clutter_context_create_pango_context (ctx);
+ priv->pango_context = _clutter_context_get_pango_context (ctx);
g_object_ref (priv->pango_context);
return priv->pango_context;
}
+
+/**
+ * clutter_actor_create_pango_context:
+ * @self: a #ClutterActor
+ *
+ * Creates a #PangoContext for the given actor. The #PangoContext
+ * is already configured using the appropriate font map, resolution
+ * and font options.
+ *
+ * See also clutter_actor_get_pango_context().
+ *
+ * Return value: the newly created #PangoContext. Use g_object_ref()
+ * on the returned value to deallocate its resources
+ *
+ * Since: 1.0
+ */
+PangoContext *
+clutter_actor_create_pango_context (ClutterActor *self)
+{
+ ClutterMainContext *ctx;
+ PangoContext *retval;
+
+ g_return_val_if_fail (CLUTTER_IS_ACTOR (self), NULL);
+
+ ctx = CLUTTER_CONTEXT ();
+ retval = _clutter_context_create_pango_context (ctx);
+
+ return retval;
+}
guint8 opacity);
guint8 clutter_actor_get_opacity (ClutterActor *self);
guint8 clutter_actor_get_paint_opacity (ClutterActor *self);
+gboolean clutter_actor_get_paint_visibility (ClutterActor *self);
+
void clutter_actor_set_name (ClutterActor *self,
const gchar *name);
gboolean clutter_actor_is_scaled (ClutterActor *self);
gboolean clutter_actor_should_pick_paint (ClutterActor *self);
-void clutter_actor_box_get_from_vertices (ClutterVertex vtx[4],
- ClutterActorBox *box);
-
-void clutter_actor_get_abs_allocation_vertices (ClutterActor *self,
- ClutterVertex verts[4]);
+void clutter_actor_box_get_from_vertices (ClutterVertex vtx[4],
+ ClutterActorBox *box);
-void clutter_actor_apply_transform_to_point (ClutterActor *self,
- const ClutterVertex *point,
- ClutterVertex *vertex);
-void clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
- ClutterActor *ancestor,
- const ClutterVertex *point,
- ClutterVertex *vertex);
+void clutter_actor_get_abs_allocation_vertices (ClutterActor *self,
+ ClutterVertex verts[4]);
-gboolean clutter_actor_get_paint_visibility (ClutterActor *self);
+void clutter_actor_apply_transform_to_point (ClutterActor *self,
+ const ClutterVertex *point,
+ ClutterVertex *vertex);
+void clutter_actor_apply_relative_transform_to_point (ClutterActor *self,
+ ClutterActor *ancestor,
+ const ClutterVertex *point,
+ ClutterVertex *vertex);
-void clutter_actor_grab_key_focus (ClutterActor *self);
+void clutter_actor_grab_key_focus (ClutterActor *self);
-PangoContext *clutter_actor_get_pango_context (ClutterActor *self);
+PangoContext *clutter_actor_get_pango_context (ClutterActor *self);
+PangoContext *clutter_actor_create_pango_context (ClutterActor *self);
G_END_DECLS