enum _Edje_Message_Type
{
EDJE_MESSAGE_NONE = 0,
-
+
EDJE_MESSAGE_SIGNAL = 1, /* DONT USE THIS */
-
+
EDJE_MESSAGE_STRING = 2,
EDJE_MESSAGE_INT = 3,
EDJE_MESSAGE_FLOAT = 4,
-
+
EDJE_MESSAGE_STRING_SET = 5,
EDJE_MESSAGE_INT_SET = 6,
EDJE_MESSAGE_FLOAT_SET = 7,
-
+
EDJE_MESSAGE_STRING_INT = 8,
EDJE_MESSAGE_STRING_FLOAT = 9,
-
+
EDJE_MESSAGE_STRING_INT_SET = 10,
EDJE_MESSAGE_STRING_FLOAT_SET = 11
};
#ifdef __cplusplus
extern "C" {
#endif
-
+
/* edje_main.c */
EAPI int edje_init (void);
EAPI int edje_shutdown (void);
-
+
/* edje_program.c */
EAPI void edje_frametime_set (double t);
EAPI double edje_frametime_get (void);
-
+
/* edje_util.c */
EAPI void edje_freeze (void);
EAPI void edje_thaw (void);
EAPI void edje_fontset_append_set (char *fonts);
EAPI const char *edje_fontset_append_get (void);
-
+
/* edje_load.c */
EAPI Evas_List *edje_file_collection_list (const char *file);
EAPI void edje_file_collection_list_free (Evas_List *lst);
EAPI void edje_collection_cache_set (int count);
EAPI int edje_collection_cache_get (void);
EAPI void edje_collection_cache_flush (void);
-
-
+
+
/* edje_util.c */
EAPI void edje_color_class_set(const char *color_class, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3);
EAPI void edje_color_class_del(const char *color_class);
EAPI Evas_List * edje_color_class_list(void);
EAPI void edje_text_class_set(const char *text_class, const char *font, Evas_Font_Size size);
+ EAPI void edje_text_class_del(const char *text_class);
+ EAPI Evas_List * edje_text_class_list(void);
EAPI void edje_extern_object_min_size_set (Evas_Object *obj, Evas_Coord minw, Evas_Coord minh);
EAPI void edje_extern_object_max_size_set (Evas_Object *obj, Evas_Coord maxw, Evas_Coord maxh);
EAPI void edje_extern_object_aspect_set(Evas_Object *obj, Edje_Aspect_Control aspect, Evas_Coord aw, Evas_Coord ah);
-
+
/* edje_smart.c */
EAPI Evas_Object *edje_object_add (Evas *evas);
-
+
/* edje_util.c */
EAPI const char *edje_object_data_get (Evas_Object *obj, const char *key);
-
+
/* edje_load.c */
EAPI int edje_object_file_set (Evas_Object *obj, const char *file, const char *part);
EAPI void edje_object_file_get (Evas_Object *obj, const char **file, const char **part);
EAPI int edje_object_load_error_get (Evas_Object *obj);
-
+
/* edje_program.c */
EAPI void edje_object_signal_callback_add (Evas_Object *obj, const char *emission, const char *source, void (*func) (void *data, Evas_Object *obj, const char *emission, const char *source), void *data);
EAPI void *edje_object_signal_callback_del (Evas_Object *obj, const char *emission, const char *source, void (*func) (void *data, Evas_Object *obj, const char *emission, const char *source));
EAPI int edje_object_play_get (Evas_Object *obj);
EAPI void edje_object_animation_set (Evas_Object *obj, int on);
EAPI int edje_object_animation_get (Evas_Object *obj);
-
+
/* edje_util.c */
EAPI int edje_object_freeze (Evas_Object *obj);
EAPI int edje_object_thaw (Evas_Object *obj);
EAPI void edje_object_part_drag_page_get (Evas_Object *obj, const char *part, double *dx, double *dy);
EAPI void edje_object_part_drag_step (Evas_Object *obj, const char *part, double dx, double dy);
EAPI void edje_object_part_drag_page (Evas_Object *obj, const char *part, double dx, double dy);
-
+
/* edje_message_queue.c */
EAPI void edje_object_message_send (Evas_Object *obj, Edje_Message_Type type, int id, void *msg);
EAPI void edje_object_message_handler_set (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg), void *data);
EAPI void edje_object_message_signal_process (Evas_Object *obj);
-
+
EAPI void edje_message_signal_process (void);
-
+
#ifdef __cplusplus
}
#endif
};
static Evas_Bool _edje_color_class_list_foreach(Evas_Hash *hash, const char *key, void *data, void *fdata);
+static Evas_Bool _edje_text_class_list_foreach(Evas_Hash *hash, const char *key, void *data, void *fdata);
/************************** API Routines **************************/
edje_freeze(void)
{
Evas_List *l;
-
+
for (l = _edje_edjes; l; l = l->next)
edje_object_freeze((Evas_Object *)(l->data));
}
edje_thaw(void)
{
Evas_List *l;
-
+
for (l = _edje_edjes; l; l = l->next)
edje_object_thaw((Evas_Object *)(l->data));
}
{
Edje *ed;
Evas_List *l;
-
+
ed = _edje_fetch(obj);
if ((!ed) || (!key))
return NULL;
* @param b3 Shadow Blue value
* @param a3 Shadow Alpha value
*
- * Sets the color values for a process level color class. This will cause all
+ * Sets the color values for a process level color class. This will cause all
* edje parts in the current process that have the specified color class to
- * have their colors multiplied by these values. (Object level color classes
- * set by edje_object_color_class_set() will override the values set by this
+ * have their colors multiplied by these values. (Object level color classes
+ * set by edje_object_color_class_set() will override the values set by this
* function).
*
* The first color is the object, the second is the text outline, and the
* third is the text shadow. (Note that the second two only apply to text parts)
- */
+ */
EAPI void
edje_color_class_set(const char *color_class, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3)
{
if (b > 255) b = 255;
if (a < 0) a = 0;
if (a > 255) a = 255;
- if ((cc->r == r) && (cc->g == g) &&
+ if ((cc->r == r) && (cc->g == g) &&
(cc->b == b) && (cc->a == a) &&
(cc->r2 == r2) && (cc->g2 == g2) &&
(cc->b2 == b2) && (cc->a2 == a2) &&
cc = evas_hash_find(_edje_color_class_hash, color_class);
if (!cc) return;
- _edje_color_class_hash = evas_hash_del(_edje_color_class_hash, color_class, cc);
+ _edje_color_class_hash = evas_hash_del(_edje_color_class_hash, color_class, cc);
evas_stringshare_del(cc->name);
free(cc);
* @param b3 Shadow Blue value
* @param a3 Shadow Alpha value
*
- * Sets the color values for an object level color class. This will cause all
+ * Sets the color values for an object level color class. This will cause all
* edje parts in the specified object that have the specified color class to
- * have their colors multiplied by these values.
+ * have their colors multiplied by these values.
*
* The first color is the object, the second is the text outline, and the
* third is the text shadow. (Note that the second two only apply to text parts)
cc = l->data;
if ((cc->name) && (!strcmp(cc->name, color_class)))
{
- if ((cc->r == r) && (cc->g == g) &&
+ if ((cc->r == r) && (cc->g == g) &&
(cc->b == b) && (cc->a == a) &&
- (cc->r2 == r2) && (cc->g2 == g2) &&
+ (cc->r2 == r2) && (cc->g2 == g2) &&
(cc->b2 == b2) && (cc->a2 == a2) &&
- (cc->r3 == r3) && (cc->g3 == g3) &&
+ (cc->r3 == r3) && (cc->g3 == g3) &&
(cc->b3 == b3) && (cc->a3 == a3))
return;
cc->r = r;
* @param size The font size
*
* This sets updates all edje members which belong to this text class
- * with the new font attributes.
+ * with the new font attributes.
*/
EAPI void
edje_text_class_set(const char *text_class, const char *font, Evas_Font_Size size)
/* If the class found is the same just return */
if ((tc->size == size) && (tc->font) && (!strcmp(tc->font, font)))
return;
-
+
/* Update the class found */
evas_stringshare_del(tc->font);
tc->font = evas_stringshare_add(font);
}
}
+/**
+ * @param text_class
+ *
+ * Deletes any values at the process level for the specified text class.
+ */
+void
+edje_text_class_del(const char *text_class)
+{
+ Edje_Text_Class *tc;
+ Evas_List *members;
+
+ if (!text_class) return;
+
+ tc = evas_hash_find(_edje_text_class_hash, text_class);
+ if (!tc) return;
+
+ _edje_text_class_hash = evas_hash_del(_edje_text_class_hash, text_class, tc);
+ evas_stringshare_del(tc->name);
+ evas_stringshare_del(tc->font);
+ free(tc);
+
+ members = evas_hash_find(_edje_text_class_member_hash, text_class);
+ while (members)
+ {
+ Edje *ed;
+
+ ed = members->data;
+ ed->dirty = 1;
+ _edje_textblock_style_all_update(ed);
+ _edje_recalc(ed);
+ members = members->next;
+ }
+}
+
+/**
+ * Lists all text classes known about by the current process.
+ *
+ * @return A list of text class names (strings). These strings are stringshares and
+ * the list must be free()'d by the caller.
+ */
+Evas_List *
+edje_text_class_list(void)
+{
+ Edje_List_Foreach_Data *fdata;
+ Evas_List *list;
+
+ fdata = calloc(1, sizeof(Edje_List_Foreach_Data));
+ evas_hash_foreach(_edje_text_class_member_hash, _edje_text_class_list_foreach, fdata);
+
+ list = fdata->list;
+ free(fdata);
+
+ return list;
+}
+
+static Evas_Bool
+_edje_text_class_list_foreach(Evas_Hash *hash, const char *key, void *data, void *fdata)
+{
+ Edje_List_Foreach_Data *fd;
+
+ fd = fdata;
+ fd->list = evas_list_append(fd->list, evas_stringshare_add(key));
+ return 1;
+}
+
/** Sets Edje text class
* @param obj A valid Evas_Object handle
* @param text_class The text class name
if ((!ed) || (!text_class)) return;
if (size < 0.0) size = 0.0;
-
+
/* for each text_class in the edje */
for (l = ed->text_classes; l; l = l->next)
{
if ((tc->name) && (!strcmp(tc->name, text_class)))
{
/* Match and the same, return */
- if ((tc->font) && (font) &&
+ if ((tc->font) && (font) &&
(!strcmp(tc->font, font)) &&
(tc->size == size))
return;
/* No font but size is the same, return */
- if ((!tc->font) && (!font) &&
+ if ((!tc->font) && (!font) &&
(tc->size == size))
return;
/* Add to edje's text class list */
ed->text_classes = evas_list_append(ed->text_classes, tc);
ed->dirty = 1;
- _edje_textblock_style_all_update(ed);
+ _edje_textblock_style_all_update(ed);
_edje_recalc(ed);
}
Edje *ed;
Edje_Real_Part *rp;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part)) return 0;
rp = _edje_real_part_get(ed, (char *)part);
if (!rp) return 0;
Edje *ed;
Edje_Real_Part *rp;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part)) return NULL;
rp = _edje_real_part_get(ed, (char *)part);
if (!rp) return NULL;
{
Edje *ed;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if (!ed) return;
ed->text_change.func = func;
ed->text_change.data = data;
Edje *ed;
Edje_Real_Part *rp;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part)) return;
rp = _edje_real_part_get(ed, (char *)part);
if (!rp) return;
(rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return;
if ((!rp->text.text) && (!text))
return;
- if ((rp->text.text) && (text) &&
+ if ((rp->text.text) && (text) &&
(!strcmp(rp->text.text, text)))
return;
if (rp->text.text) evas_stringshare_del(rp->text.text);
Edje *ed;
Edje_Real_Part *rp;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part)) return NULL;
rp = _edje_real_part_get(ed, (char *)part);
if (!rp) return NULL;
Edje_Real_Part *rp;
char *type;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part)) return;
rp = _edje_real_part_get(ed, (char *)part);
if (!rp) return;
if (rp->swallowed_object)
{
evas_object_smart_member_del(rp->swallowed_object);
- evas_object_event_callback_del(rp->swallowed_object,
- EVAS_CALLBACK_FREE,
+ evas_object_event_callback_del(rp->swallowed_object,
+ EVAS_CALLBACK_FREE,
_edje_object_part_swallow_free_cb);
evas_object_clip_unset(rp->swallowed_object);
rp->swallowed_object = NULL;
else evas_object_clip_set(rp->swallowed_object, ed->clipper);
evas_object_stack_above(rp->swallowed_object, rp->object);
evas_object_event_callback_add(rp->swallowed_object,
- EVAS_CALLBACK_FREE,
+ EVAS_CALLBACK_FREE,
_edje_object_part_swallow_free_cb,
obj);
type = (char *)evas_object_type_get(obj_swallow);
rp->swallow_params.aspect.h = ah;
}
ed->dirty = 1;
- _edje_recalc(ed);
+ _edje_recalc(ed);
}
/** Set the object minimum size
edje_extern_object_min_size_set(Evas_Object *obj, Evas_Coord minw, Evas_Coord minh)
{
int mw, mh;
-
+
mw = minw;
mh = minh;
if (mw < 0) mw = 0;
edje_extern_object_max_size_set(Evas_Object *obj, Evas_Coord maxw, Evas_Coord maxh)
{
int mw, mh;
-
+
mw = maxw;
mh = maxh;
if (mw >= 0)
evas_object_data_set(obj, "\377 edje.maxw", (void *)mw);
else
- evas_object_data_del(obj, "\377 edje.maxw");
+ evas_object_data_del(obj, "\377 edje.maxw");
if (mh >= 0)
evas_object_data_set(obj, "\377 edje.maxh", (void *)mh);
else
if (mc > 0)
evas_object_data_set(obj, "\377 edje.aspm", (void *)mc);
else
- evas_object_data_del(obj, "\377 edje.aspm");
+ evas_object_data_del(obj, "\377 edje.aspm");
if (mw > 0)
evas_object_data_set(obj, "\377 edje.aspw", (void *)mw);
else
- evas_object_data_del(obj, "\377 edje.aspw");
+ evas_object_data_del(obj, "\377 edje.aspw");
if (mh > 0)
evas_object_data_set(obj, "\377 edje.asph", (void *)mh);
else
Edje *ed;
Evas_List *l;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!obj_swallow)) return;
for (l = ed->parts; l; l = l->next)
{
if (rp->swallowed_object == obj_swallow)
{
evas_object_smart_member_del(rp->swallowed_object);
- evas_object_event_callback_del(rp->swallowed_object,
- EVAS_CALLBACK_FREE,
+ evas_object_event_callback_del(rp->swallowed_object,
+ EVAS_CALLBACK_FREE,
_edje_object_part_swallow_free_cb);
evas_object_clip_unset(rp->swallowed_object);
rp->swallowed_object = NULL;
Edje *ed;
Edje_Real_Part *rp;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part)) return NULL;
rp = _edje_real_part_get(ed, (char *)part);
if (!rp) return NULL;
edje_object_size_min_get(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
{
Edje *ed;
-
+
ed = _edje_fetch(obj);
if ((!ed) || (!ed->collection))
{
edje_object_size_max_get(Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh)
{
Edje *ed;
-
+
ed = _edje_fetch(obj);
if ((!ed) || (!ed->collection))
{
{
Edje *ed;
int pf;
-
+
ed = _edje_fetch(obj);
if (!ed) return;
ed->dirty = 1;
edje_object_size_min_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
{
Edje *ed;
- Evas_Coord pw, ph;
+ Evas_Coord pw, ph;
int maxw, maxh;
int ok;
int reset_maxwh;
Edje_Real_Part *pep = NULL;
-
+
ed = _edje_fetch(obj);
if ((!ed) || (!ed->collection))
{
ed->calc_only = 1;
pw = ed->w;
ph = ed->h;
-
+
again:
ed->w = 0;
ed->h = 0;
-
+
maxw = 0;
maxh = 0;
-
+
ok = 1;
while (ok)
{
Edje_Real_Part *ep;
int w, h;
int didw;
-
+
ep = l->data;
w = ep->w - ep->req.w;
h = ep->h - ep->req.h;
}
ed->min.w = ed->w;
ed->min.h = ed->h;
-
+
if (minw) *minw = ed->min.w;
if (minh) *minh = ed->min.h;
-
+
ed->w = pw;
ed->h = ph;
ed->dirty = 1;
/** Returns the state of the Edje part
* @param obj A valid Evas_Objectart handle
* @param part The part name
- * @param val_ret
+ * @param val_ret
*
* @return The part state:\n
* "default" for the default state\n
Edje *ed;
Edje_Real_Part *rp;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part))
{
if (val_ret) *val_ret = 0;
{
Edje *ed;
Edje_Real_Part *rp;
-
- ed = _edje_fetch(obj);
+
+ ed = _edje_fetch(obj);
if ((!ed) || (!part))
{
return EDJE_DRAG_DIR_NONE;
Edje *ed;
Edje_Real_Part *rp;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part))
{
return;
rp->drag.val.x = dx;
rp->drag.val.y = dy;
_edje_dragable_pos_set(ed, rp, dx, dy);
- _edje_emit(ed, "drag,set", rp->part->name);
+ _edje_emit(ed, "drag,set", rp->part->name);
}
/** Get the dragable object location
Edje_Real_Part *rp;
double ddx, ddy;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part))
{
if (dx) *dx = 0;
Edje *ed;
Edje_Real_Part *rp;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part))
{
return;
Edje *ed;
Edje_Real_Part *rp;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part))
{
if (dw) *dw = 0;
if (dw) *dw = 0;
if (dh) *dh = 0;
return;
- }
+ }
if (dw) *dw = rp->drag.size.x;
if (dh) *dh = rp->drag.size.y;
}
Edje *ed;
Edje_Real_Part *rp;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part))
{
return;
Edje *ed;
Edje_Real_Part *rp;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part))
{
if (dx) *dx = 0;
Edje *ed;
Edje_Real_Part *rp;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part))
{
return;
Edje *ed;
Edje_Real_Part *rp;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part))
{
if (dx) *dx = 0;
Edje_Real_Part *rp;
double px, py;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part))
{
return;
rp->drag.val.y = CLAMP (rp->drag.val.y, 0.0, 1.0);
if ((px == rp->drag.val.x) && (py == rp->drag.val.y)) return;
_edje_dragable_pos_set(ed, rp, rp->drag.val.x, rp->drag.val.y);
- _edje_emit(ed, "drag,step", rp->part->name);
+ _edje_emit(ed, "drag,step", rp->part->name);
}
/** Pages x,y steps
Edje_Real_Part *rp;
double px, py;
- ed = _edje_fetch(obj);
+ ed = _edje_fetch(obj);
if ((!ed) || (!part))
{
return;
rp->drag.val.y = CLAMP (rp->drag.val.y, 0.0, 1.0);
if ((px == rp->drag.val.x) && (py == rp->drag.val.y)) return;
_edje_dragable_pos_set(ed, rp, rp->drag.val.x, rp->drag.val.y);
- _edje_emit(ed, "drag,page", rp->part->name);
+ _edje_emit(ed, "drag,page", rp->part->name);
}
if ((!ed) || (!color_class)) return NULL;
- /* first look through the object scope */
+ /* first look through the object scope */
for (l = ed->color_classes; l; l = l->next)
{
cc = l->data;
/* next look through the global scope */
cc = evas_hash_find(_edje_color_class_hash, color_class);
if (cc) return cc;
-
+
/* finally, look through the file scope */
for (l = ed->file->color_classes; l; l = l->next)
{
_edje_color_class_member_hash = NULL;
}
-static Evas_Bool color_class_hash_list_free(Evas_Hash *hash,
+static Evas_Bool color_class_hash_list_free(Evas_Hash *hash,
const char *key, void *data,
void *fdata)
{
cc = data;
if (cc->name) evas_stringshare_del(cc->name);
free(cc);
-
+
return 1;
}
{
Evas_List *tmp;
- if ((ep->default_desc) && (ep->default_desc->color_class))
+ if ((ep->default_desc) && (ep->default_desc->color_class))
_edje_color_class_member_del(ed, ep->default_desc->color_class);
for (tmp = ep->other_desc; tmp; tmp = tmp->next)
_edje_text_class_find(Edje *ed, const char *text_class)
{
Evas_List *l;
-
+
if ((!ed) || (!text_class)) return NULL;
for (l = ed->text_classes; l; l = l->next)
{
Evas_List *members;
if ((!ed) || (!text_class)) return;
-
+
/* Get members list */
members = evas_hash_find(_edje_text_class_member_hash, text_class);
/* Remove members list */
- if (members)
+ if (members)
_edje_text_class_member_hash = evas_hash_del(_edje_text_class_member_hash, text_class, members);
/* Update the member list */
members = evas_list_prepend(members, ed);
-
+
/* Add the member list back */
_edje_text_class_member_hash = evas_hash_add(_edje_text_class_member_hash, text_class, members);
}
if (!members) return;
_edje_text_class_member_hash = evas_hash_del(_edje_text_class_member_hash, text_class, members);
-
+
members = evas_list_remove(members, ed);
if (members) _edje_text_class_member_hash = evas_hash_add(_edje_text_class_member_hash, text_class, members);
}
_edje_text_class_member_hash = NULL;
}
-static Evas_Bool text_class_hash_list_free(Evas_Hash *hash,
+static Evas_Bool text_class_hash_list_free(Evas_Hash *hash,
const char *key, void *data,
void *fdata)
{
if (tc->name) evas_stringshare_del(tc->name);
if (tc->font) evas_stringshare_del(tc->font);
free(tc);
-
+
return 1;
}
{
Edje *ed;
char *type;
-
+
type = (char *)evas_object_type_get(obj);
if (!type) return NULL;
if (strcmp(type, "edje")) return NULL;
// printf("-------------########### OVER THAW\n");
ed->freeze = 0;
}
- if ((ed->freeze == 0) && (ed->recalc))
+ if ((ed->freeze == 0) && (ed->recalc))
{
// printf("thaw recalc\n");
_edje_recalc(ed);
_edje_object_part_swallow_free_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
Evas_Object *edje_obj;
-
+
edje_obj = data;
edje_object_part_unswallow(edje_obj, obj);
return;