On Thu, 28 Jul 2011 23:47:27 +0200 Andreas Volz <li...@brachttal.net> said:

> Am Fri, 29 Jul 2011 00:12:30 +0300 schrieb Tom Hacohen:
> 
> > On 28/07/11 23:52, Andreas Volz wrote:
> > > Am Thu, 28 Jul 2011 20:17:03 +0900 schrieb Carsten Haitzler (The
> > > Rasterman):
> > > 
> > > I found it while playing with the clock theme
> > > (trunk/THEMES/darkness/modules/clock.edc)
> > > 
> > > See here my changes as minimal example:
> > > 
> > >    #if PROFILE == HIGH
> > >             x
> > >             buf[0] = 0;
> > >             if (v < 10) {snprintf(buf, 10, "0%i", v);}
> > >             else        {snprintf(buf, 10, "%i", v);}
> > >             set_state(PART:"seconds", buf, 0.0);
> > >    #endif
> > > 
> > > 
> > > This #if ends always in "true". You see it because edje fails (the
> > > "x") not interesting if -DPROFILE=HIGH or anything else or nothing.
> > > 
> > >    #if PROFILE != HIGH
> > >             x
> > >             buf[0] = 0;
> > >             if (v < 10) {snprintf(buf, 10, "0%i", v);}
> > >             else        {snprintf(buf, 10, "%i", v);}
> > >             set_state(PART:"seconds", buf, 0.0);
> > >    #endif
> > > 
> > > This #if ends always in "false". Also not depending on -DPROFILE.
> > > 
> > > These are at least my experiments.
> > 
> > Should that even work? I tried with "cpp" and it doesn't work unless I
> > #define HIGH 24324234 (some number).
> > and then doing -DPROFILE=HIGH works as expected.
> > 
> > To me, that's the expected result, to be honest, I was surprised cpp
> > didn't fail with #if PROFILE == HIGH without defining what they expand
> > to, because they should just expand to:
> > #if ==
> > which is bad.
> > 
> > Anyhow, I think it's better to just do: -DPROFILE_HIGH and check if
> > that's defined using #ifdef or #if defined().
> > 
> > Maybe I'm missing something, dunno, but from what I know, and from
> > what I've just tested with both epp and cpp, you are just using
> > macros wrong.
> 
> Hm, as I said before. I had problems with clock module from darkness
> theme:
> 
> if E17_PROFILE != HIRES_PDA && E17_PROFILE != LOWRES_PDA &&
> E17_PROFILE != MEDIUMRES_PDA
> 
> I tried various combinations. From my eyes defining some *_PDA doesn't
> currently switch the timer to 10 sec. But I think this is what the
> author liked. Then this is also wrong. But are you sure?
> 
> regards
>       Andreas

edje uses epp now. its older and simpler than gcc's cpp. its a very very very
old cpp from gcc. it works with numbers, but not enums, as tasn said - #define
HIRES_PDA to numbers.. literally. it ONLY every worked this way. look at the
Makefile of e17's theme. it literally doesd define these to numbers to make it
work:

 -DLOWRES_PDA=1 -DMEDIUMRES_PDA=2 -DHIRES_PDA=3 -DSLOW_PC=4 -DMEDIUM_PC=5
-DFAST_PC=6 -DE17_PROFILE=SLOW_PC

(defined in the @EDJE_DEF@ replace).


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    ras...@rasterman.com


------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to