[gcompris-devel] Question about the colorblind support

Sérgio Durigan Júnior sergiosdj at gmail.com
Mon Nov 30 22:27:19 UTC 2009


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 :-).

While implementing the feature, I decided that it would be good to
make something that could be used by any activity of Gcompris,
including those that will eventually appear.  So I began to
investigate how I could do that, and as I said in one of my e-mails to
this list, I based the work on the gnome-mag software.  Well, the
thing is:  for Gcompris to be able to correctly modify its interface
in order to handle colorblindness, I have to work with an object
called GdkPixbuf.  This object is used everywhere on Gcompris, so I
found myself in trouble...  I started to look for some callback or
some abstraction where I could implement the colorblind code only
once, but still didn't find anything.  After some thought, I came up
with three possible solutions for that:

1) Gcompris uses GooCanvas, and maintains a copy of it inside its own
repository.  This way, I could implement something on GooCanvas
(instead of Gcompris), and try to make it be available for every
activity.  This sounds like the easiest solution, but I still have to
investigate and see if it's feasible.

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.

3) I could create a specific function to apply the colorblind filter
into a GdkPixbuf, and then call this function on every place that uses
an object of this type.  There's a bad thing about this option,
however:  every new code that uses GdkPixbuf would have to call the
colorblind function, otherwise it wouldn't have the feature.

So, now I have to decide between those.  Bruno, am I thinking right
here?  Are those the correct options?  Do you see some other way to
accomplish this?

Suggestions are welcome, as always.

Regards,

Sérgio.




More information about the Gcompris-devel mailing list