#define GET_PD_OR_RETURN(RET) \
Edje *ed; \
Edje_Edit *eed; \
+ Edje_Real_Part *rp; \
Edje_Part_Description_Common *pd; \
if (!evas_object_smart_type_check_ptr(obj, _edje_edit_type)) \
return RET; \
eed = evas_object_smart_data_get(obj); \
if (!eed) return RET; \
ed = (Edje *)eed; \
+ rp = _edje_real_part_get(ed, part); \
+ if (!rp) return RET; \
pd = _edje_part_description_find_byname(eed, part, state, value); \
if (!pd) return RET;
GET_PD_OR_RETURN();
+ if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
+ (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
+ {
+ if (r) *r = 0;
+ if (g) *g = 0;
+ if (b) *b = 0;
+ if (a) *a = 0;
+ return;
+ }
+
txt = (Edje_Part_Description_Text*) pd;
if (r) *r = txt->text.color3.r;
GET_PD_OR_RETURN();
+ if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
+ (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
+ return;
+
txt = (Edje_Part_Description_Text*) pd;
if (r > -1 && r < 256) txt->text.color3.r = r;
Edje_Part_Description_Image *img; \
\
GET_PD_OR_RETURN(0); \
+ \
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE) \
+ return 0; \
\
img = (Edje_Part_Description_Image*) pd; \
\
Edje_Part_Description_Image *img; \
\
GET_PD_OR_RETURN(); \
+ \
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE) \
+ return; \
\
img = (Edje_Part_Description_Image*) pd; \
\
Edje_Part_Description_Image *img; \
\
GET_PD_OR_RETURN(0); \
+ \
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE) \
+ return 0; \
\
img = (Edje_Part_Description_Image*) pd; \
\
Edje_Part_Description_Image *img; \
\
GET_PD_OR_RETURN(); \
+ \
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE) \
+ return; \
\
img = (Edje_Part_Description_Image*) pd; \
\
GET_PD_OR_RETURN(NULL);
+ if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
+ return NULL;
+
external = (Edje_Part_Description_External *) pd;
return external->external_params;
GET_PD_OR_RETURN(EINA_FALSE);
+ if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
+ return EINA_FALSE;
+
external = (Edje_Part_Description_External *) pd;
EINA_LIST_FOREACH(external->external_params, l, p)
GET_PD_OR_RETURN(EINA_FALSE);
+ if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
+ {
+ if (val) *val = 0;
+ return EINA_FALSE;
+ }
+
external = (Edje_Part_Description_External *) pd;
EINA_LIST_FOREACH(external->external_params, l, p)
GET_PD_OR_RETURN(EINA_FALSE);
+ if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
+ {
+ if (val) *val = 0;
+ return EINA_FALSE;
+ }
+
external = (Edje_Part_Description_External *) pd;
EINA_LIST_FOREACH(external->external_params, l, p)
GET_PD_OR_RETURN(EINA_FALSE);
+ if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
+ {
+ if (val) *val = 0;
+ return EINA_FALSE;
+ }
+
external = (Edje_Part_Description_External *) pd;
EINA_LIST_FOREACH(external->external_params, l, p)
GET_PD_OR_RETURN(EINA_FALSE);
+ if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
+ {
+ if (val) *val = NULL;
+ return EINA_FALSE;
+ }
+
external = (Edje_Part_Description_External *) pd;
EINA_LIST_FOREACH(external->external_params, l, p)
GET_PD_OR_RETURN(EINA_FALSE);
+ if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
+ {
+ if (val) *val = NULL;
+ return EINA_FALSE;
+ }
+
external = (Edje_Part_Description_External *) pd;
EINA_LIST_FOREACH(external->external_params, l, p)
Eina_List *l;
Edje_Part_Description_External *external;
Edje_External_Param *p = NULL, old_p = { 0, 0, 0, 0, 0 };
- Edje_Real_Part *rp;
int found = 0;
GET_PD_OR_RETURN(EINA_FALSE);
- external = (Edje_Part_Description_External *) pd;
+ if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
+ return EINA_FALSE;
- rp = _edje_real_part_get(ed, part);
+ external = (Edje_Part_Description_External *) pd;
va_start(ap, type);
GET_PD_OR_RETURN(NULL);
+ if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
+ (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
+ return NULL;
+
txt = (Edje_Part_Description_Text *) pd;
//printf("GET TEXT of state: %s\n", state);
if (!text) return;
+ if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
+ (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
+ return;
+
txt = (Edje_Part_Description_Text *) pd;
_edje_if_string_free(ed, txt->text.text);
GET_PD_OR_RETURN(-1);
+ if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
+ (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
+ return -1;
+
txt = (Edje_Part_Description_Text *) pd;
//printf("GET TEXT_SIZE of state: %s [%d]\n", state, pd->text.size);
return txt->text.size;
if (size < 0) return;
+ if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
+ (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
+ return;
+
txt = (Edje_Part_Description_Text *) pd;
txt->text.size = size;
\
GET_PD_OR_RETURN(0); \
\
+ if ((rp->part->type != EDJE_PART_TYPE_TEXT) && \
+ (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) \
+ return 0; \
+ \
txt = (Edje_Part_Description_Text *) pd; \
return TO_DOUBLE(txt->text.Value); \
} \
\
GET_PD_OR_RETURN(); \
\
+ if ((rp->part->type != EDJE_PART_TYPE_TEXT) && \
+ (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) \
+ return; \
+ \
txt = (Edje_Part_Description_Text *) pd; \
txt->text.Value = FROM_DOUBLE(v); \
edje_object_calc_force(obj); \
Edje_Part_Description_Text *txt; \
\
GET_PD_OR_RETURN(EINA_FALSE); \
+ \
+ if ((rp->part->type != EDJE_PART_TYPE_TEXT) && \
+ (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) \
+ return EINA_FALSE; \
\
txt = (Edje_Part_Description_Text *) pd; \
return txt->text.fit_##Value; \
Edje_Part_Description_Text *txt; \
\
GET_PD_OR_RETURN(); \
+ \
+ if ((rp->part->type != EDJE_PART_TYPE_TEXT) && \
+ (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) \
+ return; \
\
txt = (Edje_Part_Description_Text *) pd; \
txt->text.fit_##Value = fit ? 1 : 0; \
GET_PD_OR_RETURN(NULL);
- //printf("GET FONT of state: %s [%s]\n", state, pd->text.font);
+ if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
+ (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
+ return NULL;
+
txt = (Edje_Part_Description_Text*) pd;
if (!txt->text.font) return NULL;
GET_PD_OR_RETURN();
- //printf("SET FONT of state: %s [%s]\n", state, font);
+ if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
+ (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
+ return;
+
txt = (Edje_Part_Description_Text*) pd;
_edje_if_string_free(ed, txt->text.font);
GET_PD_OR_RETURN(NULL);
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE)
+ return NULL;
+
img = (Edje_Part_Description_Image *) pd;
image = (char *)_edje_image_name_find(obj, img->image.id);
if (!image) return;
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE)
+ return;
+
id = _edje_image_id_find(obj, image);
//printf("SET IMAGE for %s [%s]\n", state, image);
GET_PD_OR_RETURN(NULL);
- //printf("GET TWEEN LIST for %s\n", state);
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE)
+ return NULL;
img = (Edje_Part_Description_Image *) pd;
GET_PD_OR_RETURN(EINA_FALSE);
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE)
+ return EINA_FALSE;
+
id = _edje_image_id_find(obj, tween);
if (id < EINA_FALSE) return 0;
GET_PD_OR_RETURN(EINA_FALSE);
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE)
+ return EINA_FALSE;
+
img = (Edje_Part_Description_Image *) pd;
if (!img->image.tweens_count) return EINA_FALSE;
GET_PD_OR_RETURN();
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE)
+ {
+ if (l) *l = 0;
+ if (r) *r = 0;
+ if (t) *t = 0;
+ if (b) *b = 0;
+ return;
+ }
+
img = (Edje_Part_Description_Image *) pd;
//printf("GET IMAGE_BORDER of state '%s'\n", state);
GET_PD_OR_RETURN();
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE)
+ return;
+
img = (Edje_Part_Description_Image *) pd;
//printf("SET IMAGE_BORDER of state '%s'\n", state);
GET_PD_OR_RETURN(0);
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE)
+ return 0;
+
img = (Edje_Part_Description_Image *) pd;
if (img->image.border.no_fill == 0) return 1;
GET_PD_OR_RETURN();
+ if (rp->part->type != EDJE_PART_TYPE_IMAGE)
+ return;
+
img = (Edje_Part_Description_Image *) pd;
if (fill == 0) img->image.border.no_fill = 1;
_edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *state, double value, Eina_Strbuf *buf)
{
Eina_List *l, *ll;
- Edje_Real_Part *rp;
Eina_Bool ret = EINA_TRUE;
GET_PD_OR_RETURN(EINA_FALSE);
- rp = _edje_real_part_get(ed, part);
- if (!rp) return EINA_FALSE;
-
BUF_APPENDF(I4"description { state: \"%s\" %g;\n", pd->state.name, pd->state.value);
//TODO Support inherit