[gcompris-devel] Question about the colorblind support

Bill Bogstad bogstad at pobox.com
Tue Dec 1 04:15:06 UTC 2009


2009/11/30 Sérgio Durigan Júnior <sergiosdj at gmail.com>:
> Hello,
>
> This is not the status of the colorblind work (yet).  I would like to
> share some thoughts about the implementation, and if possible, have my
> question answered :-).
>
>....
> 2) I could implement the "abstraction" that I mentioned earlier, i.e.,
> implement a function that would be called by every function that wants
> to render something on the screen.  I would then have to modify every
> place on the code that renders something in order to use the
> abstraction.

This MIGHT be easier then you think (at least for any C code).   You
might be able to get away with using C preprocessor macros to redefine
all of the current function calls to call  new versions of the
function (with different names) which you implement  to handle
colorblind processing and then call the original functions as
appropriate.  If you put the macros into something like gcompris.h,
you might not have to touch the original source files at all.
Alternatively a single #include at the top of each file could handle
this.   This method is often used when programming in C to 'wrap'
functions in order to add error checking/preprocessing of
arguments/etc. Of course, this will only help with C code.   I'm not
sure how you would handle things written in Python.

Bill Bogstad




More information about the Gcompris-devel mailing list