Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2006:
[Freeciv-Dev] (PR#7123) Metaissue for FS
Home

[Freeciv-Dev] (PR#7123) Metaissue for FS

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: i-freeciv-lists@xxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#7123) Metaissue for FS
From: "Christian Prochaska" <cp.ml.freeciv.dev@xxxxxxxxxxxxxx>
Date: Sun, 7 May 2006 14:48:01 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=7123 >

> [per - Do 04. Mai. 2006, 06:43:54]:
> 
> On Sun, 30 Apr 2006, Christian Prochaska wrote:
> > I'd like to improve the ftwl client a bit, but I'm not very familiar
> > with it yet and don't have a clue where to start. What do you think
> > should/could be done next?
> 
> It needs a roadmap for where it should be going.

In my opinion it should become a highly customizable (free themeable)
and portable (should run at least on a Pocket PC, too) client. That's
basically what it was meant for from the beginning, isn't it? Scripting
support for the GUI layout would be nice, but at the moment I wouldn't
know how to implement it. But we could start to think about some
concepts now. We would still need an I/O-backend and a widget set, so I
think improving the current code wouldn't be a waste, even if it turns
out that many parts of the client would need to be rewritten to make
scripting work.

> In my opinion, I think 
> the best way forward would be to just port it to Cairo, and forget the 
> idea of having our own pixel-blitting code in there. The widget code also 
> is in desperate need of documentation.
> 
>    - Per
> 

Here's a patch for the cairo integration. It renames some existing files
and creates some new ones:

be_common_32.[ch] (renamed from be_common_24.[ch])
be_common_cairo32.[ch]

-> all drawing operations that manipulate the image buffers are in this
file. The 'cairo32' file uses cairo for drawing. It uses the same kind
of image buffer that is used in be_common_32.c, mainly because the text
renderer isn't ported to cairo yet and also the SDL backend needs to
have access to the pixel data, but perhaps the buffers can be replaced
with cairo surfaces in the future.

be_sdl_pixels_32.c: (renamed from be_sdl_pixels.c)
be_sdl_pixels_cairo32.c

-> the SDL graphics backend which blits the image buffers to the screen.
The 'cairo32' file uses modified values for rmask and bmask, because
cairo writes to the image buffers in ARGB32 format.

be_x11_ximage_32.c (renamed from be_x11_ximage.c)
be_x11_cairo32.c

-> the X11 backend. The 'cairo32' file uses an xlib cairo surface for
blitting to the screen.


In my opinion the possibility to choose between different drawing
modules is a nice thing, so I think we should keep it as long as it
doesn't make other things too complicated. Of course we can make one of
them default, which is the cairo module with this patch. It can be
changed in Makefile.am:

# cairo
BACKEND_X11_FILES=$(ALL_BACKEND_X11_CAIRO32_FILES)
BACKEND_SDL_FILES=$(ALL_BACKEND_SDL_CAIRO32_FILES)

# own drawing code
BACKEND_X11_FILES=$(ALL_BACKEND_X11_FILES)
BACKEND_SDL_FILES=$(ALL_BACKEND_SDL_FILES)

but should probably be a configure option or perhaps a fallback decision
if the cairo libraries aren't found. I haven't figured out yet how to
create a configure check for the cairo libraries, so you need to pass
some flags to the configure script to make everything compile:

CFLAGS=`pkg-config --cflags cairo` LIBS=`pkg-config --libs cairo`
./configure --enable-client=ftwl --enable-ftwl=sdl|x11

Attachment: gui-ftwl_cairo-2006-05-07.diff.gz
Description: application/gzip


[Prev in Thread] Current Thread [Next in Thread]