libxfcegui4 dialogs

Jasper Huijsmans jasper at moongroup.com
Wed Mar 12 14:56:26 CET 2003


On Wed, 12 Mar 2003 14:04:50 +0100
Benedikt Meurer <Benedikt.Meurer at unix-ag.uni-siegen.de> wrote:

> On Wed, 12, Mar 2003, Jasper Huijsmans wrote:
> 
> > On Wed, 12 Mar 2003 13:07:53 +0100
> > Benedikt Meurer <Benedikt.Meurer at unix-ag.uni-siegen.de> wrote:
> > 
> > > Hello Jasper,
> > > 
> > > I'd like to replace the show_{error,info,warning} functions in
> > > libxfcegui4 with the following functions:
> > > [...]
> 
> > If it's only convenience for having to do a g_strdup_printf() before
> > the dialog I think it's overkill, if it's more sophisticated with
> > error numbers and such, I think it won't help us much since many of
> > the error's in xfce4 come from gtk and are encapsulated by a GError
> > * anyway.
> 
> Good point. I think you're right. So the functions should be something
> like that:
> 
> 	xfce_err(const GError *, const gchar *, ...)
> 	and so on...
> 

Well, I think that's not really necessary. Just use gerror->messsage.
You could do it and allow it to be NULL, but I don't think it buys you
much.

> > I'm not pricipally against it, it's just that I want to make sure we
> > keep things as simple as possible. Basically, what I'm saying is I'd
> > only like to add stuff that solves a problem now, or makes things
> > easier now, or reduces duplication or something. I don't want to
> > have things that may be very useful in the future or the equivalent
> > of the Java class library incorporated with xfce ;-)(ok, so that's a
> > tiny bit over the top :-))
> 
> The functions themselve are quite simple: the functions without the
> 'v' simply call the corresponding 'v'-functions. The 'v'-functions
> format the string and call a static popup_message()-function.
> 

Right, so the v-functions are just implementation details, not part of
the exported API. That's better.

How would the x and non-x versions be used then (/me is ignorant,
please enlighten me)?

> Its intended to reduce redundant code all over the Xfce modules (now
> :), and to make life a bit easier, since this really safes a call to
> g_strdup_printf() which in turn has really a large overhead for simple
> string formating.
> 
> The xfce_*() functions will use a static message buffer to reduce the
> g_strdup overhead (and therefore unneccessary memory fragmentation).
> 

hmm, there was some talk about this earlier, where people said they
preferred dynamic memory allocation. I am not qualified to comment on
this, though.

	Jasper



More information about the Xfce4-dev mailing list