andres wrote: >> EAPI unsigned char ******* >> edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object >> *obj_swallow) { >> Edje *ed; >> Edje_Real_Part *rp; >> >> ed = _edje_fetch(obj); >> if ((!ed) || (!part)) return 0; ***** >> rp = _edje_real_part_recursive_get(ed, (char *)part); >> if (!rp) return 0; ****** >> if (rp->part->type != EDJE_PART_TYPE_SWALLOW) return 0; *********** >> _edje_real_part_swallow(rp, obj_swallow); >> return 1; ****** >> } >> >> then you can use: >> if (!edje_object_part_swallow(...)) >> printf("ERROR"); >> >> It's not a 100% safe check but I think it fit your need. >> Dave > > After I was talked into my senses at the IRC channel, I decided to drop the > enforced-theme-spec-file. Then I began to browse through the Edje api to see > where it could use a little more verbosity. Only edje_object_part_text_set() > is in the same situation. > You will probably find several functions in EFL that are in this same situation.
> So while having edje_object_part_swallow() (or text_set) return something > is > a good idea, it does not tell the application developer what actually went > wrong. Well, with a little digging, and some EFL knowledge they can find out what went wrong :) Implementing an Error system in the same manner than > edje_object_file_set seems like an overkill to me. > Yea > Thats why I think a function to check the part type is a better approach to > this problem. This way applications can be more verbose about the reasons for > failure, easing theme development. I see no harm in adding an API function to check part type. Certainly less overhead than having a spec-file type system. dh ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel