Re: [Eiffelws-list] EWS
Status: Beta
Brought to you by:
trixx
|
From: Daniel F M. <dmo...@ar...> - 2006-10-18 20:44:53
|
On Sat, 2006-10-07 at 13:50 +0200, Raphael Mack wrote:
> I played a bit with driver-fb, and succeeded displaying a bitmap button.
>
> One bigger task will be the implementation of an image library
> respectively wrappers for existing libs. Does anyone know about some
> efforts for this? Would an eiffel-imaging library be appropriate to
> provide some classes for color and images, like
I know imageMagick provides a lot of imaging functionality, and there
are several libraries for this embedded in some other places (some for
SDL, others like GDK-pixbuf).
> deferred class IMAGE
> feature
> width, height: INTEGER is deferred end
> pixel (x, y: INTEGER): COLOR is deferred end
> as_pixel_image: PIXEL_IMAGE is deferred end
> end
>
> class PIXEL_IMAGE inherit IMAGE
> pixels: NATIVE_ARRAY[COLOR]
> end
>
> expanded class COLOR
> feature
> red, green, blue, alpha: INTEGER_8
> end
>
> Then wrappers can provide subclasses e. g. PNG_IMAGE which wrap the
> images loaded by the lib or convert it to a PIXEL_IMAGE.
>
> What do you think?
It would be cool, but doing this in Eiffel is probably reinventing the
wheel.
> I don't understand the internals of input handling redrawing and the
> eventloop completely. I had problems, that the screen was not drawn
> until the first event occured, for now I just generated artificial mouse
> moves.
It is somewhat copied from GTK. Please let me know if I can help with
it...
> In the end I'd like to have a bunch of INPUT_DEVICEs, with each having a
> file descriptor and the eventloop should do a select syscall to wait for
> input on any of these (and something equivalent on non-unix boxes). I
> didn't study the LOOP_STACK in se's lib in detail, but it seems to do
> exactly that...
You should plug that into the "wait_event" method of the display. If you
redefine correctly wait_event and poll_event, you should not need any
special loop handling
Otherwise, it is a bug :)
Regards,
D.
--
"Why program by hand in five days what you can spend five years of your
life automating."
-- Terrence Parr, ANTLR author
|