libxfce4ui

Brian J. Tarricone bjt23 at cornell.edu
Mon Dec 17 22:32:47 CET 2007


Nick Schermer wrote:

> Started with some basic functions. I'm not really sure
> xfce_gdk_{display,screen}_get_fullname belong in the library since
> they are only used in xfce4-session (and I can hardly imagine some
> other apps need them). So maybe it's better to move them.

Agreed; they make sense for the session manager, but I'd think 
gdk_screen_make_display_name() should be sufficient for other apps, and 
only really needed for passing display names to dbus so other apps can 
launch things on the proper screen.

> Also added a XfceFrame, because it's more flexible then the old
> solution and the amout of code is minimal.

I feel like XfceFrame is exactly the sort of cruft we want to get rid 
of.  The xfce_create_framebox() helper was created (recently!) because 
XfceFramebox was broken.  Essentially:

GtkWidget *vbox, *align, *lbl;
vbox = gtk_vbox_new(FALSE, 6);
lbl = gtk_label_new_with_markup("<span weight='bold'>Foo</span>");
gtk_container_add(GTK_CONTAINER(vbox), lbl);
align = gtk_alignment_new(0.5, 0.5, 1.0, 1.0);
g_object_set(align, "left-padding", 12, NULL);
gtk_container_add(GTK_CONTAINER(vbox), align);

Is it really necessary to have an extra widget for that?  If 
xfce_create_framebox() is doing much more than that, it shouldn't be. 
As you said, it's easy to add stuff later if we find we need it; hard to 
remove the pointless stuff if it's really pointless.

Moving on:  the dialogs stuff.  Where did xfce_message_dialog() go?  The 
four replacement functions are completely insufficient, and 
xfce_message_dialog{,_new,_valist}() are exactly what we need.  Those 
other four can be convenience functions that just use 
xfce_message_dialog(), though I want all of these to be able to take 
both primary and secondary text arguments.  IMO they're otherwise 
useless and encourage people to make dialogs that have poor usability.

Gtk extensions: 2 gripes I've had in the past about 
xfce_gtk_label_new_small(): 1) the function name doesn't tell you what 
it does (oh, it makes the label italic too, what?), 2) it's too limited. 
  Let's do something like:

typedef enum
{
     XFCE_PANGO_SIZE_XX_SMALL = -3,
     XFCE_PANGO_SIZE_X_SMALL = -2,
     XFCE_PANGO_SIZE_SMALL = -1,
     XFCE_PANGO_SIZE_NORMAL = 0,
     XFCE_PANGO_SIZE_LARGE = 1,
     XFCE_PANGO_SIZE_X_LARGE = 2,
     XFCE_PANGO_SIZE_XX_LARGE = 3,

     XFCE_PANGO_SIZE_SMALLER = -100,
     XFCE_PANGO_SIZE_LARGER = 100,
} XfcePangoSize;

GtkWidget *
xfce_gtk_label_new_custom(const gchar *label,
                           XfcePangoSize size,
                           PangoStyle style,
                           PangoWeight weight);

... and if we want to attempt to enforce a consistent look for certain 
types of labels, we can have helper functions (or just lame macro 
defines) that make use of it; e.g.:

GtkWidget *
xfce_gtk_slider_label_new(const gchar *label)
{
     return xfce_gtk_label_new_custom(label, XFCE_PANGO_SIZE_SMALL,
                                      PANGO_STYLE_ITALIC,
                                      PANGO_WEIGHT_NORMAL);
}

... or just not bother and let everyone use the flexible function directly.

Also, note that xfce_gtk_window_center_on_monitor_with_pointer() might 
be kinda broken API-wise with xrandr 1.2's multiple pointer support... 
though we may just not care given that's by far an uncommon setup.

Anyhow: we have the opportunity to really start from scratch here. 
Let's make sure everything that goes in is as clean as possible and is 
targeted for maximum usefulness.

	-brian



More information about the Xfce4-dev mailing list