On Mon, April 05, 2010, Johann Haarhoff wrote:

> 1) I put #ifdef NEW_LOOK/ #ifdef OLD_LOOK things all over the code. This 
> makes it possible to select the look at compile time, but the code will be 
> ugly.

Yes, and - what is worse - unmaintainable.

> 3) We make WINGs "themeable" so that either look can be applied at runtime. 
> I have not yet looked at the implications of this, but maybe it is not so 
> much work as it seems.

This would be the optimal solution. However I can understand
your concerns on additional effort to get there. One could
probably take a look at how other theming engines work and then
see if something can be taken from there.

Alexey wrote:

> 1) is good enough and in future can be turned into 3).  I think.

As stated above I would not call 1) good enough. If starting
with 3) right away is unrealistic one can adopt a more software
engineering oriented approach:

 - identify the code fragments which would differ
 - instead of #ifdef'ing them out, try to think of
   an API which would provide the code needed
 - write the look-and-feel dependent code as a library
   which can be selected at compile time (e.g. select
   the source file(s) by an autoconf option etc.)
 - think about it for a while, there may be other parts 
   which might go into such a library

At a later stage one could rewrite such a library so that
switching look and feel could be provided at runtime without
(ideally) having to modify the rest of the code again.

Cheers,

M'bert

-- 
----------- / http://herbert.the-little-red-haired-girl.org / -------------
=+= 
WE ARE THE BORG - RESISTANCE IS VOLTAGE DIVIDED BY CURRENT!


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.info.

Reply via email to