Re: GAL patch for GNOME 2



First of all, if any of this is just to make it more gnome2 like, I'd
really rather not do that.  I really want to keep the patch as simple as
is physically possible to make merges easier.

However:

If some of these are necessary, for instance, getting rid of
GTK_OBJECT_DESTROYED or GtkType, I'd really much prefer to do it with a
#define so that the diff is a single character and back merge the
changes to the 1.0 branch.  For example, here's the new lines from
e-util.h that I just wrote:


#if 1
#  include <libgnomeui/gnome-defs.h>
#  include <libgnomeui/gnome-stock.h>
#  define E_OBJECT_CLASS_ADD_SIGNALS(oc,sigs,last) \
	gtk_object_class_add_signals (oc, sigs, last)
#  define E_OBJECT_CLASS_TYPE(oc) (oc)->type
#  define E_GTK_TYPE GtkType
#  define E_OBJECT_CHECK_DESTROYED(o) (!GTK_OBJECT_DESTROYED ((o)))
#  define E_BEGIN_DECLS BEGIN_GNOME_DECLS
#  define E_END_DECLS END_GNOME_DECLS
#  define E_STOCK_BUTTON_OK GNOME_STOCK_BUTTON_OK
#  define E_STOCK_BUTTON_CANCEL GNOME_STOCK_BUTTON_CANCEL
#else
#  include <glib.h>
#  include <gtk.h>
#  define E_OBJECT_CLASS_ADD_SIGNALS(oc,sigs,last)
#  define E_OBJECT_CLASS_TYPE(oc) G_TYPE_FROM_CLASS (oc)
#  define E_GTK_TYPE guint
#  define E_OBJECT_CHECK_DESTROYED(o) (G_IS_OBJECT ((o)))
#  define E_BEGIN_DECLS G_BEGIN_DECLS
#  define E_END_DECLS G_END_DECLS
#  define E_STOCK_BUTTON_OK GTK_STOCK_OK
#  define E_STOCK_BUTTON_CANCEL GTK_STOCK_CANCEL
#endif

That's the gnome1 version of gal.  For gnome2, you just change the #if. 
This would allow us to have a much smaller patch, and whenever changes
happen in the 1.0 branch, merging them up would be much much easier.

I don't know enough about the combo boxes to comment on that code. 
Jody?

Comments on specific bits follow.

Thanks,
   Chris

On Sun, 2001-12-09 at 06:19, Chris Phelps wrote:

> --- gal/configure.in	Thu Oct  4 19:18:51 2001
> +++ gal2/configure.in	Sun Dec  9 00:08:46 2001
> @@ -1,13 +1,8 @@
>  AC_INIT(README)
>  AM_CONFIG_HEADER(config.h)
> -AM_INIT_AUTOMAKE(gal2,0.13.99.0)
> +AM_INIT_AUTOMAKE(gal2,1.107.0)

I need to think about version numbers a lot more, but please don't put
this in.

> -GAL_CURRENT=14
> +GAL_CURRENT=20

This either.

> @@ -413,9 +413,9 @@
>  
>  		if (canvas->pick_event.type == GDK_ENTER_NOTIFY) {
> -			x = canvas->pick_event.crossing.x + DISPLAY_X1 (canvas) - canvas->zoom_xofs;
> -			y = canvas->pick_event.crossing.y + DISPLAY_Y1 (canvas) - canvas->zoom_yofs;
> +			x = canvas->pick_event.crossing.x + canvas->scroll_x1 - canvas->zoom_xofs;
> +			y = canvas->pick_event.crossing.y + canvas->scroll_y1 - canvas->zoom_yofs;
>  		} else {
> -			x = canvas->pick_event.motion.x + DISPLAY_X1 (canvas) - canvas->zoom_xofs;
> -			y = canvas->pick_event.motion.y + DISPLAY_Y1 (canvas) - canvas->zoom_yofs;
> +			x = canvas->pick_event.motion.x + canvas->scroll_x1 - canvas->zoom_xofs;
> +			y = canvas->pick_event.motion.y + canvas->scroll_y1 - canvas->zoom_yofs;
>  		}
>  

Could you just define DISPLAY_X1 and DISPLAY_X2 as appropriate so the
diff is again, only 2 lines instead of 4?

> diff -r -u2 gal/gal/widgets/e-popup-menu.c gal2/gal/widgets/e-popup-menu.c
> --- gal/gal/widgets/e-popup-menu.c	Thu Oct  4 19:19:00 2001
> +++ gal2/gal/widgets/e-popup-menu.c	Sat Dec  8 23:22:35 2001
> @@ -15,6 +15,4 @@
>  #include <gtk/gtksignal.h>
>  #include <gtk/gtkimagemenuitem.h>
> -#include <libgnomeui/gtkpixmapmenuitem.h>
> -#include <libgnomeui/gnome-stock.h>
>  
>  #include "e-popup-menu.h"
> @@ -64,42 +62,4 @@
>  
>  	gtk_widget_show_all (GTK_WIDGET (item));
> -
> -#warning Horribly hacked ?
> -#if 0	
> -		GtkWidget *pixmap = gnome_stock_pixmap_widget (item, pixname);
> -
> -		gtk_widget_show (pixmap);
> -		gtk_pixmap_menu_item_set_pixmap (
> -			GTK_PIXMAP_MENU_ITEM (item), pixmap);
> -
> -	/*
> -	 * Ugh.  This needs to go into Gtk+
> -	 */
> -	label = gtk_accel_label_new ("");
> -	label_accel = gtk_label_parse_uline (GTK_LABEL (label), name);
> -	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
> -	gtk_widget_show (label);
> -	
> -	item = pixname ? gtk_pixmap_menu_item_new () : gtk_menu_item_new ();
> -	gtk_container_add (GTK_CONTAINER (item), label);
> -	
> -	if (label_accel != GDK_VoidSymbol){
> -		gtk_widget_add_accelerator (
> -			item,
> -			"activate_item",
> -			gtk_menu_get_accel_group (GTK_MENU (menu)),
> -			label_accel, 0,
> -			GTK_ACCEL_LOCKED);
> -	}
> -
> -	if (pixname){
> -		GtkWidget *pixmap = gnome_stock_pixmap_widget (item, pixname);
> -
> -		gtk_widget_show (pixmap);
> -		gtk_pixmap_menu_item_set_pixmap (
> -			GTK_PIXMAP_MENU_ITEM (item), pixmap);
> -	}
> -#endif
> -
>  	return item;
>  }

If the code in this function is still a hack, this #if shouldn't be
removed so that it will still be around as a reference of what needs to
be done.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]