2012-02-23 Cedric Bail
* Remove Software SDL engine.
+
+2012-01-23 Tom Hacohen (TAsn)
+
+ * Textblock: Replaced evas_object_textblock_style_user_set/get
+ with evas_object_textblock_style_user_push/peek/pop.
+ This is used to override the default style set for an evas object.
+ For example, this can be used to nicely change the font and size
+ in a text editor.
EAPI const Evas_Textblock_Style *evas_object_textblock_style_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
/**
- * Set the objects user style to ts.
+ * Push ts to the top of the user style stack.
+ *
+ * FIXME: API is solid but currently only supports 1 style in the stack.
*
* The user style overrides the corresponding elements of the regular style.
* This is the proper way to do theme overrides in code.
* @see evas_object_textblock_style_set
* @since 1.2.0
*/
-EAPI void evas_object_textblock_style_user_set(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
+EAPI void evas_object_textblock_style_user_push(Evas_Object *obj, Evas_Textblock_Style *ts) EINA_ARG_NONNULL(1);
/**
- * Return the user style of an object.
+ * Del the from the top of the user style stack.
+ *
+ * @param obj the object to get the style from.
+ * @see evas_object_textblock_style_get
+ * @since 1.2.0
+ */
+EAPI void evas_object_textblock_style_user_pop(Evas_Object *obj) EINA_ARG_NONNULL(1);
+
+/**
+ * Get (don't remove) the style at the top of the user style stack.
+ *
* @param obj the object to get the style from.
* @return the style of the object.
* @see evas_object_textblock_style_get
* @since 1.2.0
*/
-EAPI const Evas_Textblock_Style *evas_object_textblock_style_user_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
+EAPI const Evas_Textblock_Style *evas_object_textblock_style_user_peek(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
/**
* @brief Set the "replacement character" to use for the given textblock object.
}
EAPI void
-evas_object_textblock_style_user_set(Evas_Object *obj, Evas_Textblock_Style *ts)
+evas_object_textblock_style_user_push(Evas_Object *obj, Evas_Textblock_Style *ts)
{
TB_HEAD();
_textblock_style_generic_set(obj, ts, &(o->style_user));
}
EAPI const Evas_Textblock_Style *
-evas_object_textblock_style_user_get(const Evas_Object *obj)
+evas_object_textblock_style_user_peek(const Evas_Object *obj)
{
TB_HEAD_RETURN(NULL);
return o->style_user;
}
EAPI void
+evas_object_textblock_style_user_pop(Evas_Object *obj)
+{
+ TB_HEAD();
+ _textblock_style_generic_set(obj, NULL, &(o->style_user));
+}
+
+EAPI void
evas_object_textblock_replace_char_set(Evas_Object *obj, const char *ch)
{
TB_HEAD();
evas_object_textblock_clear(obj);
evas_object_textblock_style_set(obj, NULL);
- evas_object_textblock_style_user_set(obj, NULL);
+ while (evas_object_textblock_style_user_peek(obj))
+ {
+ evas_object_textblock_style_user_pop(obj);
+ }
o = (Evas_Object_Textblock *)(obj->object_data);
free(o->cursor);
while (o->cursors)
fail_if(!newst);
evas_textblock_style_set(newst,
"DEFAULT='left_margin=4 right_margin=4'");
- evas_object_textblock_style_user_set(tb, newst);
+ evas_object_textblock_style_user_push(tb, newst);
evas_object_textblock_size_formatted_get(tb, &w, &h);
evas_object_textblock_size_native_get(tb, &nw, &nh);