On Sun, 15 Jan 2006 11:36:09 +1000 David Seikel <[EMAIL PROTECTED]> babbled:

> On Sat, 14 Jan 2006 18:12:35 +0900 Carsten Haitzler (The Rasterman)
> <[EMAIL PROTECTED]> wrote:
> 
> > actually - it's not all 3rd part moduels doing things right.
> > 
> > a moduels should
> > 1. look for its image/graphics/theme data in the current theme - just
> > like all the core modules do. 2. they shoudl check RETURNS from this
> > - and if it fails to find a theme specified design, then it shoudl
> > fall back to a .edj shipped with the module.
> > 
> > the core moduels don't do #2 because they dont need to. they will
> > always fall back to data provided by the default theme, and so they
> > don't need to, BUT all other moduels should/MUST do this.
> > 
> > this allows a theme to proivde gfx for any/all/whatever moduels it
> > wants. it allows users to specify using different themes for
> > different moduels as the theme config interface already allows, it
> > provides for theme gfx fallback abilities to fall back levels until
> > somethng is found. it also provides a built-in .edj theme the moduel
> > ships with as a default if no theme provides it.
> 
> So is this correct?
> 
> 
> static const char *_emu_module_edje = NULL;
> 
> EAPI int
> e_modapi_info(E_Module *m)
> {
>    char buf[4096];
> 
>    snprintf(buf, sizeof(buf), "%s/module_edje.edj",
>       e_module_dir_get(m));
>    _emu_module_edje = evas_stringshare_add(buf);
> 
>    if (_emu_module_edje)
>       {
>          m->edje_icon_file = strdup(_emu_module_edje);
>          if (m->edje_icon_file)
>             {
>                snprintf(buf, sizeof(buf), "icon");
>                m->edje_icon_key = strdup(buf);
>             }
>       }
> 
>    return 1;
> }
> 
> void
> _emu_gadget_face_theme_set(E_Gadget_Face *face, char *category, char
> *file, char *group)
> {
>    Evas_Object *o;
>    if(!face) return;
> 
>    o = edje_object_add(face->evas);
>    face->main_obj = o;
>    if (!e_theme_edje_object_set(o, category, group))
>       edje_object_file_set(o, file, group);
>    evas_object_show(o);
> }

yes - much better . the above code is the key. check return from
e_theme_edje_object_set - if it fails, it couldnt find anything - so set a
fallback by hand :)

-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    [EMAIL PROTECTED]
裸好多
Tokyo, Japan (東京 日本)


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to