[Freeciv-Dev] Re: (PR#7123) Metaissue for FS
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=7123 >
On Fri, 2 Jan 2004, Raimar Falke wrote:
>
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7123 >
>
> On Thu, Jan 01, 2004 at 12:26:53PM -0800, Raimar Falke wrote:
> > > I think I found a nice model here which I will implement new year.
> > >
> > > You have a background image. You have a set of elements. Each element
> > > has a set of measures (x,y,width,height). Each element has depending
> > > on the type other attributes partly optional and partly not. There are
> > > general attributes like "tooltip", "halign", "valign".
> > >
> > > Extra attributes are:
> > > - label (static text): "text" and general text attributes
> > > - info (dynamic text): "id" and general text attributes
> > > - button: "id", "background", "text" and and general text attributes
> > > - ...
> > >
> > > The "id" attribute is used to connect the graphical element to the
> > > program code. So an info element for the main screen with the id
> > > "population" will show the total population of your empire. And a
> > > button in the connect screen with the id "connect" will call the
> > > connect function in the freeciv code.
>
> I have completed the theme engine for texts, infos, edits and
> buttons. I have changed connnectdlg.c (and made it fully functional
> again) and created a "connect.screen" file. The result is visiable at
> http://freeciv.org/~rfalke/fs3_pics/screen-0002.png.
>
> This theme engine really reduce seperates the data from the code and
> so reduces the amount of code drastically. While gui-fs doesn't
> implement the metaserver list and the authentication the numbers are
> promising:
>
> 200 594 5585 client/gui-fs/connectdlg.c
> 718 1818 23703 client/gui-gtk-2.0/connectdlg.c
> 683 1747 22869 client/gui-gtk/connectdlg.c
> 324 821 10174 client/gui-mui/connectdlg.c
> 1150 2958 33856 client/gui-sdl/connectdlg.c
> 159 510 4964 client/gui-stub/connectdlg.c
> 1231 2074 36212 client/gui-win32/connectdlg.c
> 583 1487 18508 client/gui-xaw/connectdlg.c
Nice comparison of apples to oranges. gui-fs doesn't have the layout
information, strings, etc, in the source code, neither does gui-xaw.
I bet if the gui-gtk-2.0 client used libglade it would have less lines of
code as well. :-)
But yeah, data/code separation is always a boon.
---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa
- [Freeciv-Dev] Re: (PR#7123) Metaissue for FS, Raimar Falke, 2004/01/01
- [Freeciv-Dev] Re: (PR#7123) Metaissue for FS, Raimar Falke, 2004/01/02
- [Freeciv-Dev] Re: Betr: Re: (PR#7123) Metaissue for FS, Raimar Falke, 2004/01/02
- [Freeciv-Dev] Re: (PR#7123) Metaissue for FS,
Vasco Alexandre da Silva Costa <=
- [Freeciv-Dev] Re: Betr: Re: (PR#7123) Metaissue for FS, Vasco Alexandre da Silva Costa, 2004/01/02
- [Freeciv-Dev] Re: Betr: Re: (PR#7123) Metaissue for FS, Raimar Falke, 2004/01/02
- [Freeciv-Dev] Re: Betr: Re: (PR#7123) Metaissue for FS, Raimar Falke, 2004/01/02
- [Freeciv-Dev] Re: Betr: Re: (PR#7123) Metaissue for FS, Raimar Falke, 2004/01/02
- [Freeciv-Dev] Re: Betr: Re: (PR#7123) Metaissue for FS, Vasco Alexandre da Silva Costa, 2004/01/02
|
|