* @{
*/
-typedef enum _Edje_Text_Effect
-{
#define EDJE_TEXT_EFFECT_MASK_BASIC 0xf
#define EDJE_TEXT_EFFECT_BASIC_SET(x, s) \
do { x = ((x) & ~EDJE_TEXT_EFFECT_MASK_BASIC) | (s); } while (0)
+
+#define EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION (0x7 << 4)
+#define EDJE_TEXT_EFFECT_SHADOW_DIRECTION_SET(x, s) \
+ do { x = ((x) & ~EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION) | (s); } while (0)
+
+typedef enum _Edje_Text_Effect
+{
EDJE_TEXT_EFFECT_NONE = 0,
EDJE_TEXT_EFFECT_PLAIN = 1,
EDJE_TEXT_EFFECT_OUTLINE = 2,
EDJE_TEXT_EFFECT_LAST = 11,
-#define EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION (0x7 << 4)
-#define EDJE_TEXT_EFFECT_SHADOW_DIRECTION_SET(x, s) \
- do { x = ((x) & ~EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION) | (s); } while (0)
EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM_RIGHT = (0x0 << 4),
EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM = (0x1 << 4),
EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM_LEFT = (0x2 << 4),
EAPI Edje_Text_Effect edje_edit_part_effect_get(Evas_Object *obj, const char *part);
/** Set the effect for a given part.
+ * Effects and shadow directions can be combined.
+ *
+ * For effect and shadow direction list please look at Edje Part Text ref page.
*
* @param obj Object being edited.
* @param part Part to set the effect to. Only makes sense on type TEXT.
* @param effect Effect to set for the part.
+ *
+ * @see Edje_Part_Text
*/
-EAPI void edje_edit_part_effect_set(Evas_Object *obj, const char *part, Edje_Text_Effect effect);
+EAPI Eina_Bool edje_edit_part_effect_set(Evas_Object *obj, const char *part, Edje_Text_Effect effect);
/** Get the current selected state in part.
*
* @param state State in which the font is set.
* @param value Value of the state.
* @param font The font name to use.
+ *
+ * @return EINA_TRUE if successful, EINA_FALSE - otherwise.
*/
-EAPI void edje_edit_state_font_set(Evas_Object *obj, const char *part, const char *state, double value, const char *font);
+EAPI Eina_Bool edje_edit_state_font_set(Evas_Object *obj, const char *part, const char *state, double value, const char *font);
/** Get the text size of a part state
*
*/
EAPI const char * edje_edit_state_font_get(Evas_Object *obj, const char *part, const char *state, double value);
-/** Set font name for a given part state.
- *
- * @param obj Object being edited.
- * @param part Part that contain state.
- * @param state The name of the state to set the name of the font that will be used (not including the state value).
- * @param value The state value.
- * @param font The name of the font to use in the given part state.
- */
-EAPI void edje_edit_state_font_set(Evas_Object *obj, const char *part, const char *state, double value, const char *font);
-
-
//@}
/******************************************************************************/
/************************** IMAGES API ************************************/
return eina_stringshare_add(edje_string_get(&txt->text.font));
}
-EAPI void
+EAPI Eina_Bool
edje_edit_state_font_set(Evas_Object *obj, const char *part, const char *state, double value, const char *font)
{
Edje_Part_Description_Text *txt;
- GET_PD_OR_RETURN();
+ if ((!obj) || (!part) || (!state))
+ return EINA_FALSE;
+ GET_PD_OR_RETURN(EINA_FALSE);
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
(rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
- return;
+ return EINA_FALSE;
txt = (Edje_Part_Description_Text*) pd;
txt->text.font.id = 0;
edje_object_calc_force(obj);
+ return EINA_TRUE;
}
EAPI Edje_Text_Effect
return rp->part->effect;
}
-EAPI void
+EAPI Eina_Bool
edje_edit_part_effect_set(Evas_Object *obj, const char *part, Edje_Text_Effect effect)
{
- GET_RP_OR_RETURN();
+ if ((!obj) || (!part)) return EINA_FALSE;
+ GET_RP_OR_RETURN(EINA_FALSE);
- //printf("SET EFFECT of part: %s [%d]\n", part, effect);
+ if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
+ (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
+ return EINA_FALSE;
rp->part->effect = effect;
edje_object_calc_force(obj);
+ return EINA_TRUE;
}
/****************/