Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2003:
[Freeciv-Dev] Re: (PR#7079) Remove unneeded options from clients
Home

[Freeciv-Dev] Re: (PR#7079) Remove unneeded options from clients

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jordi@xxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7079) Remove unneeded options from clients
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Mon, 15 Dec 2003 09:28:30 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7079 >

On Fri, Dec 12, 2003 at 01:10:34PM -0800, Michael Kirzinger wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7079 >
> 
> > [jordi@xxxxxxxxxxxxxx - Wed Dec 10 17:17:00 2003]:
> > 
> > The GTK client has a few options like these:
> > 
> > 
> >   GEN_BOOL_OPTION(meta_accelerators,        N_("Use Alt/Meta for
> > accelerators (GTK+ only)")),
> >   GEN_BOOL_OPTION(map_scrollbars,           N_("Show Map Scrollbars
> > (GTK+ only)")),
> >   GEN_BOOL_OPTION(dialogs_on_top,           N_("Keep dialogs on top
> > (GTK+ 2.0 only)")),
> > 
> > 
> > This probably clutters sdl/xaw/whatever clients for no reason. I
> > suggested just ifdef'ing around the stuff, but vasc said it's better
> > to
> > do it in some other way (I admit ifdefing all the stuff would have
> > been
> > ugly).
> > 
> > Once the options are shown only in the respective clients, they'd look
> > better, just showing "Keep dialogs on top", "Show Map Scrollbars",
> > etc.
> 
> One way this could be done is to add a int inside the client_option
> struct which identifies what clients the option is for.  Each client
> could be assigned a bit in the int.  If it is set, the option applies to
> that client, if not, the client can ignore it.
> 
> Pros of this method is that it is fairly easy to implement and makes
> little changes to existing code.
> 
> Cons would be that the size of the client_option structure would be
> increased, and also that all options would be present in the compiled
> code for all clients (which is how it is now).
> 
> The attached patch implements this method (in all clients) of only
> displaying options in the clients they apply to.
> 
> This makes it possible to add more client-specific options (such as
> resolution/fullscreen for SDL client) without cluttering up the options
> menus in other clients.

+#define OCF_NONE               0
+#define OCF_GTK                        (1<<0)
+#define OCF_GTK2               (1<<1)
+#define OCF_MUI                        (1<<2)
+#define OCF_SDL                        (1<<3)
+#define OCF_WIN32              (1<<4)
+#define OCF_XAW                        (1<<5)
+#define OCF_ALL                        0xff

Either an enum (with "1<<n"s) or better a classical enum and usage of
of bitvector (common/shared.h: BV_*).

The question still stands for me: do we really want this?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "These download files are in Microsoft Word 6.0 format. After
  unzipping, these files can be viewed in any text editor, including
  all versions of Microsoft Word, WordPad, and Microsoft Word Viewer."
    -- http://www.microsoft.com/hwdev/pc99.htm




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