Isn't the XfceColorButton typdef and type macro wrong

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Sat Sep 3 14:30:52 CEST 2005


Brian J. Tarricone wrote:
> Benedikt Meurer wrote:
> 
>>>Brian J. Tarricone wrote:
>>>
>>>
>>>>Jeff Franks wrote:
>>>>
>>>>
>>>>
>>>>>>Brain,
>>>>>>
>>>>>>Aren't the XfceColorButton typdef and 'get_type' macro wrong. Shouldn't
>>>>>>
>>>>>>#define XFCE_TYPE_COLOR_BUTTON  (gtk_button_get_type())
>>>>>>typedef GtkButton XfceColorButton;
>>>>>>typedef GtkButtonClass XfceColorButtonClass;
>>>>>>
>>>>>>actually be:
>>>>>>
>>>>>>#define XFCE_TYPE_COLOR_BUTTON  (gtk_color_button_get_type())
>>>>>>typedef GtkColorButton XfceColorButton;
>>>>>>typedef GtkColorButtonClass XfceColorButtonClass;
>>>>
>>>>
>>>>Nope.  The whole point of XfceColorButton was to work with gtk 2.2,
>>>>which doesn't have GtkColorButton.  I also didn't want to force
>>>>recompiles if people change their gtk version from underneath
>>>>libxfcegui4.  It's kinda ugly, yes, because it makes XfceColorButton not
>>>>a real widget.  At any rate, it's deprecated and you don't need to bind it.
>>>
>>>
>>>I'd suggest to define XFCE_TYPE_COLOR_BUTTON to
>>>xfce_color_button_get_type () and implement xfce_color_button_get_type
>>>() like this:
>>>
>>>GType
>>>xfce_color_button_get_type (void)
>>>{
>>>  return gtk_color_button_get_type ();
>>>}
>>>
>>>This way you maintain full source and binary compatibility. And while
>>>you are at it, you can ditch the Gtk2.2 compat code from the
>>>implementation and turn all xfce_color_button_* () calls into proxies.
> 
> Why bother?  No one should be using XfceColorButton anymore.  Seems like
> a waste of time to me, but if someone else wants to do it, feel free.

The define allows to maintain compatiblity when upgrading and it's
really a trivial change, which doesn't take much time.

The cleanup, well ok, that's probably a waste of time.

> 	-b

Benedikt



More information about the Xfce4-dev mailing list