diff -crN ./eog/configure.in /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/configure.in
*** ./eog/configure.in	Tue Sep  9 06:06:42 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/configure.in	Thu Oct 16 15:11:46 2003
***************
*** 29,35 ****
  AC_ISC_POSIX
  AC_HEADER_STDC
  AC_ARG_PROGRAM
! AC_PROG_RANLIB
  
  dnl ================= translation =============================================
  
--- 29,35 ----
  AC_ISC_POSIX
  AC_HEADER_STDC
  AC_ARG_PROGRAM
! AM_PROG_LIBTOOL
  
  dnl ================= translation =============================================
  
diff -crN ./eog/help/C/Makefile.am /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/help/C/Makefile.am
*** ./eog/help/C/Makefile.am	Sun Jul 13 18:38:32 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/help/C/Makefile.am	Thu Oct 16 15:11:53 2003
***************
*** 1,4 ****
! figdir = figures
  docname = eog
  lang = C
  omffile = eog-C.omf
--- 1,5 ----
! figs = \
! 	figures/eog_start_window.png
  docname = eog
  lang = C
  omffile = eog-C.omf
diff -crN ./eog/libeog/eog-image.h /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/libeog/eog-image.h
*** ./eog/libeog/eog-image.h	Sat Jun 21 09:15:05 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/libeog/eog-image.h	Thu Nov 13 10:06:07 2003
***************
*** 29,35 ****
  	EOG_IMAGE_ERROR_SAVE_NOT_LOCAL,
  	EOG_IMAGE_ERROR_NOT_LOADED,
  	EOG_IMAGE_ERROR_VFS,
! 	EOG_IMAGE_ERROR_UNKNOWN,
  } EogImageError;
  
  #define EOG_IMAGE_ERROR eog_image_error_quark ()
--- 29,35 ----
  	EOG_IMAGE_ERROR_SAVE_NOT_LOCAL,
  	EOG_IMAGE_ERROR_NOT_LOADED,
  	EOG_IMAGE_ERROR_VFS,
! 	EOG_IMAGE_ERROR_UNKNOWN
  } EogImageError;
  
  #define EOG_IMAGE_ERROR eog_image_error_quark ()
diff -crN ./eog/libeog/eog-scroll-view.c /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/libeog/eog-scroll-view.c
*** ./eog/libeog/eog-scroll-view.c	Mon Sep  8 20:11:10 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/libeog/eog-scroll-view.c	Thu Nov 13 10:06:23 2003
***************
*** 45,51 ****
  typedef enum {
  	PROGRESSIVE_NONE,	/* We are not loading an image or it is already loaded */
  	PROGRESSIVE_LOADING,	/* An image is being loaded */
! 	PROGRESSIVE_POLISHING,	/* We have finished loading an image but have not scaled it with interpolation */
  } ProgressiveState;
  
  /* Signal IDs */
--- 45,51 ----
  typedef enum {
  	PROGRESSIVE_NONE,	/* We are not loading an image or it is already loaded */
  	PROGRESSIVE_LOADING,	/* An image is being loaded */
! 	PROGRESSIVE_POLISHING	/* We have finished loading an image but have not scaled it with interpolation */
  } ProgressiveState;
  
  /* Signal IDs */
diff -crN ./eog/omf-install/Makefile.am /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/omf-install/Makefile.am
*** ./eog/omf-install/Makefile.am	Thu Jan  1 01:00:00 1970
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/omf-install/Makefile.am	Tue Jul  8 12:40:29 2003
***************
*** 0 ****
--- 1,34 ----
+ # 
+ # Modify the definition of $omf_dest_dir, replacing "gdp-example1" with
+ # the name of your package.
+ # 
+ # No other modifications should be necessary.
+ #
+ # Note that you must configure your package with --localstatedir=/var/lib
+ # so that the scrollkeeper-update command below will update the database
+ # in the standard scrollkeeper directory.
+ #
+ # If it is impossible to configure with --localstatedir=/var/lib, then
+ # modify the definition of scrollkeeper_localstate_dir so that
+ # it points to the correct location. Note that you must still use 
+ # $(localstatedir) in this or when people build RPMs it will update
+ # the real database on their system instead of the one under RPM_BUILD_ROOT.
+ 
+ omf_dest_dir=$(datadir)/omf/eog
+ scrollkeeper_localstate_dir = $(localstatedir)/scrollkeeper
+ 
+ install-data-local:
+ 	$(mkinstalldirs) $(DESTDIR)$(omf_dest_dir)
+ 	-for file in $(srcdir)/*.omf; do \
+ 		basefile=`basename $$file`; \
+ 		$(INSTALL_DATA) $(srcdir)/$$basefile $(DESTDIR)$(omf_dest_dir); \
+ 	done
+ 	-scrollkeeper-update -p $(scrollkeeper_localstate_dir) 
+ 
+ uninstall-local:
+ 	-for file in $(srcdir)/*.omf; do \
+ 		basefile=`basename $$file`; \
+ 		rm -f $(omf_dest_dir)/$$basefile; \
+         done
+ 	-rmdir $(omf_dest_dir)
+ 	-scrollkeeper-update -p $(scrollkeeper_localstate_dir) 
diff -crN ./eog/shell/eog-window.h /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/shell/eog-window.h
*** ./eog/shell/eog-window.h	Tue Feb 25 06:10:41 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/shell/eog-window.h	Thu Nov 13 10:06:38 2003
***************
*** 41,47 ****
  	EOG_WINDOW_ERROR_CONTROL_NOT_FOUND,
  	EOG_WINDOW_ERROR_NO_PERSIST_FILE_INTERFACE,
  	EOG_WINDOW_ERROR_IO,
! 	EOG_WINDOW_ERROR_UNKNOWN,
  } EogWindowError;
  #define EOG_WINDOW_ERROR eog_window_error_quark ()
  
--- 41,47 ----
  	EOG_WINDOW_ERROR_CONTROL_NOT_FOUND,
  	EOG_WINDOW_ERROR_NO_PERSIST_FILE_INTERFACE,
  	EOG_WINDOW_ERROR_IO,
! 	EOG_WINDOW_ERROR_UNKNOWN
  } EogWindowError;
  #define EOG_WINDOW_ERROR eog_window_error_quark ()
  
diff -crN ./eog/viewer/eog-control.c /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/viewer/eog-control.c
*** ./eog/viewer/eog-control.c	Thu Jan  1 01:00:00 1970
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/viewer/eog-control.c	Tue Jul  8 12:22:54 2003
***************
*** 0 ****
--- 1,522 ----
+ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+ /**
+  * eog-control.c
+  *
+  * Authors:
+  *   Martin Baulig (baulig@suse.de)
+  *   Jens Finke (jens@gnome.org)
+  *
+  * Copyright 2000 SuSE GmbH.
+  * Copyright 2001-2002 The Free Software Foundation
+  */
+ #include <config.h>
+ #include <stdio.h>
+ #include <math.h>
+ #include <gtk/gtksignal.h>
+ #include <gtk/gtkmarshal.h>
+ #include <gtk/gtktypeutils.h>
+ #include <gtk/gtkscrolledwindow.h>
+ 
+ #include <gnome.h>
+ 
+ #include "libeog/ui-image.h"
+ #include "libeog/image-view.h"
+ #include <eog-control.h>
+ 
+ /* defined in bonobo-control-internal.h, but not installed ! */
+ 
+ BonoboPlug * bonobo_control_get_plug (BonoboControl *control);
+ 
+ /* See plug_size_allocate_cb() below */
+ #define BROKEN_SIZE_ALLOCATIONS 3
+ 
+ struct _EogControlPrivate {
+ 	EogImageView       *image_view;
+ 
+ 	BonoboZoomable     *zoomable;
+ 	gboolean            has_zoomable_frame;
+ 
+ 	/* See plug_size_allocate_cb() below */
+ 	int size_allocations_remaining_until_we_get_it_right;
+ };
+ 
+ static GObjectClass *eog_control_parent_class;
+ 
+ static void
+ eog_control_destroy (BonoboObject *object)
+ {
+ 	g_return_if_fail (object != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (object));
+ 
+ 	if (getenv ("DEBUG_EOG"))
+ 		g_message ("Destroying EogControl...");
+ 
+ 	BONOBO_OBJECT_CLASS (eog_control_parent_class)->destroy (object);
+ }
+ 
+ static void
+ eog_control_finalize (GObject *object)
+ {
+ 	EogControl *control;
+ 
+ 	g_return_if_fail (object != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (object));
+ 
+ 	control = EOG_CONTROL (object);
+ 
+ 	g_free (control->priv);
+ 
+ 	G_OBJECT_CLASS (eog_control_parent_class)->finalize (object);
+ }
+ 
+ static void
+ zoomable_set_frame_cb (BonoboZoomable *zoomable, EogControl *control)
+ {
+ 	g_return_if_fail (control != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (control));
+ 
+ 	control->priv->has_zoomable_frame = TRUE;
+ }
+ 
+ static void
+ zoomable_set_zoom_level_cb (BonoboZoomable *zoomable, CORBA_float new_zoom_level,
+ 			    EogControl *control)
+ {
+ 	EogControlPrivate *priv;
+ 	double zoomx, zoomy;
+ 
+ 	g_return_if_fail (control != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (control));
+ 
+ 	priv = control->priv;
+ 
+ 	eog_image_view_set_zoom_factor (priv->image_view, new_zoom_level);
+ 
+ 	eog_image_view_get_zoom_factor (priv->image_view, &zoomx, &zoomy);
+ 	bonobo_zoomable_report_zoom_level_changed (zoomable, 
+ 						   sqrt (zoomx * zoomy),
+ 						   NULL);
+ }
+ 
+ static float preferred_zoom_levels[] = {
+ 	1.0 / 100, 1.0 / 50, 1.0 / 20,
+ 	1.0 / 10.0, 1.0 / 5.0, 1.0 / 3.0, 1.0 / 2.0, 1.0 / 1.5, 
+         1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0,
+         11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0
+ };
+ static const gchar *preferred_zoom_level_names[] = {
+ 	"1:100", "1:50", "1:20", "1:10", "1:5", "1:3", "1:2", "2:3",
+ 	"1:1", "2:1", "3:1", "4:1", "5:1", "6:1", "7:1",
+ 	"8:1", "9:1", "10:1", "11:1", "12:1", "13:1", "14:1", "15:1",
+ 	"16:1", "17:1", "18:1", "19:1", "20:1"
+ };
+ 
+ static const gint n_zoom_levels = (sizeof (preferred_zoom_levels) / sizeof (float));
+ 
+ static double
+ zoom_level_from_index (int index)
+ {
+ 	if (index >= 0 && index < n_zoom_levels)
+ 		return preferred_zoom_levels [index];
+ 	else
+ 		return 1.0;
+ }
+ 
+ static void
+ zoomable_zoom_in_cb (BonoboZoomable *zoomable, EogControl *control)
+ {
+ 	double zoomx, zoomy;
+ 	double zoom_level;
+ 	double new_zoom_level;
+ 	int index;
+ 	int i;
+ 
+ 	g_return_if_fail (control != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (control));
+ 
+ 	eog_image_view_get_zoom_factor (control->priv->image_view, &zoomx, &zoomy);
+ 	zoom_level = sqrt (zoomx * zoomy);
+ 	index = -1;
+ 
+ 	/* find next greater zoom level index */
+ 	for (i = 0; i < n_zoom_levels; i++) {
+ 		if (preferred_zoom_levels [i] > zoom_level) {
+ 			index = i;
+ 			break;
+ 		}
+ 	}
+ 
+ 	if (index == -1) return;
+ 
+ 	new_zoom_level = zoom_level_from_index (index);
+ 
+ 	g_signal_emit_by_name (G_OBJECT (zoomable), "set_zoom_level",
+ 			       new_zoom_level);
+ }
+ 
+ static void
+ zoomable_zoom_out_cb (BonoboZoomable *zoomable, EogControl *control)
+ {
+ 	double zoomx, zoomy;
+ 	double zoom_level;
+ 	double new_zoom_level;
+ 	int index, i;
+ 
+ 	g_return_if_fail (control != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (control));
+ 
+ 	eog_image_view_get_zoom_factor (control->priv->image_view, &zoomx, &zoomy);
+ 	zoom_level = sqrt (zoomx * zoomy);
+ 	index = -1;
+ 	
+ 	/* find next lower zoom level index */
+ 	for (i = n_zoom_levels - 1; i >= 0; i--) {
+ 		if (preferred_zoom_levels [i] < zoom_level) {
+ 			index = i;
+ 			break;
+ 		}
+ 	}
+ 	if (index == -1)
+ 		return;
+ 
+ 	new_zoom_level = zoom_level_from_index (index);
+ 
+ 	g_signal_emit_by_name (G_OBJECT (zoomable), "set_zoom_level",
+ 			       new_zoom_level);
+ }
+ 
+ static void
+ zoomable_zoom_to_fit_cb (BonoboZoomable *zoomable, EogControl *control)
+ {
+ 	double zoomx, zoomy;
+ 	double new_zoom_level;
+ 
+ 	g_return_if_fail (control != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (control));
+ 
+ 	eog_image_view_zoom_to_fit (control->priv->image_view, TRUE);
+ 	eog_image_view_get_zoom_factor (control->priv->image_view, &zoomx, &zoomy);
+ 	new_zoom_level = sqrt (zoomx * zoomy);
+ 
+ 	g_signal_emit_by_name (G_OBJECT (zoomable), "set_zoom_level",
+ 			       new_zoom_level);
+ }
+ 
+ static void
+ zoomable_zoom_to_default_cb (BonoboZoomable *zoomable, EogControl *control)
+ {
+ 	g_return_if_fail (control != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (control));
+ 
+ 	g_signal_emit_by_name (G_OBJECT (zoomable), "set_zoom_level", 1.0);
+ }
+ 
+ static void
+ verb_ZoomIn_cb (BonoboUIComponent *uic, gpointer user_data, const char *cname)
+ {
+ 	EogControl *control;
+ 
+ 	g_return_if_fail (user_data != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (user_data));
+ 
+ 	control = EOG_CONTROL (user_data);
+ 
+ 	g_signal_emit_by_name (G_OBJECT (control->priv->zoomable),
+ 			       "zoom_in");
+ }
+ 
+ static void
+ verb_ZoomOut_cb (BonoboUIComponent *uic, gpointer user_data, const char *cname)
+ {
+ 	EogControl *control;
+ 
+ 	g_return_if_fail (user_data != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (user_data));
+ 
+ 	control = EOG_CONTROL (user_data);
+ 
+ 	g_signal_emit_by_name (G_OBJECT (control->priv->zoomable),
+ 			       "zoom_out");
+ }
+ 
+ static void
+ verb_ZoomToDefault_cb (BonoboUIComponent *uic, gpointer user_data,
+ 		       const char *cname)
+ {
+ 	EogControl *control;
+ 
+ 	g_return_if_fail (user_data != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (user_data));
+ 
+ 	control = EOG_CONTROL (user_data);
+ 
+ 	g_signal_emit_by_name (G_OBJECT (control->priv->zoomable),
+ 			       "zoom_to_default");
+ }
+ 
+ static void
+ verb_ZoomToFit_cb (BonoboUIComponent *uic, gpointer user_data,
+ 		   const char *cname)
+ {
+ 	EogControl *control;
+ 
+ 	g_return_if_fail (user_data != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (user_data));
+ 
+ 	control = EOG_CONTROL (user_data);
+ 
+ 	g_signal_emit_by_name (G_OBJECT (control->priv->zoomable),
+ 			       "zoom_to_fit");
+ }
+ 
+ static BonoboUIVerb eog_control_verbs[] = {
+ 	BONOBO_UI_VERB ("ZoomIn",        verb_ZoomIn_cb),
+ 	BONOBO_UI_VERB ("ZoomOut",       verb_ZoomOut_cb),
+ 	BONOBO_UI_VERB ("ZoomToDefault", verb_ZoomToDefault_cb),
+ 	BONOBO_UI_VERB ("ZoomToFit",     verb_ZoomToFit_cb),
+ 	BONOBO_UI_VERB_END
+ };
+ 
+ static void
+ eog_control_create_ui (EogControl *control)
+ {
+ 	BonoboUIComponent *uic;
+ 
+ 	g_return_if_fail (control != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (control));
+ 
+ 	uic = bonobo_control_get_ui_component (BONOBO_CONTROL (control));
+ 
+ 	bonobo_ui_util_set_ui (uic, DATADIR, "eog-image-view-ctrl-ui.xml", "EOG", NULL);
+ 
+ 	bonobo_ui_component_add_verb_list_with_data (uic, eog_control_verbs,
+ 						     control);
+ }
+ 
+ static void
+ eog_control_set_ui_container (EogControl *control,
+ 			      Bonobo_UIContainer ui_container)
+ {
+ 	BonoboUIComponent *uic;
+ 	
+ 	g_return_if_fail (control != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (control));
+ 	g_return_if_fail (ui_container != CORBA_OBJECT_NIL);
+ 
+ 	eog_image_view_set_ui_container (control->priv->image_view,
+ 					 ui_container);
+ 
+ 	uic = bonobo_control_get_ui_component (BONOBO_CONTROL (control));
+ 	bonobo_ui_component_set_container (uic, ui_container, NULL);
+ 
+ 	if (!control->priv->has_zoomable_frame)
+ 		eog_control_create_ui (control);
+ }
+ 
+ static void
+ eog_control_unset_ui_container (EogControl *control)
+ {
+ 	BonoboUIComponent *uic;
+ 
+ 	g_return_if_fail (control != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (control));
+ 
+ 	eog_image_view_unset_ui_container (control->priv->image_view);
+ 
+ 	uic = bonobo_control_get_ui_component (BONOBO_CONTROL (control));
+ 	bonobo_ui_component_unset_container (uic, NULL);
+ }
+ 
+ static void
+ eog_control_activate (BonoboControl *object, gboolean state)
+ {
+ 	EogControl *control;
+ 
+ 	g_return_if_fail (object != NULL);
+ 	g_return_if_fail (EOG_IS_CONTROL (object));
+ 
+ 	control = EOG_CONTROL (object);
+ 
+ 	if (state) {
+ 		Bonobo_UIContainer ui_container;
+ 
+ 		ui_container = bonobo_control_get_remote_ui_container (BONOBO_CONTROL (control), NULL);
+ 		if (ui_container != CORBA_OBJECT_NIL) {
+ 			eog_control_set_ui_container (control, ui_container);
+ 			bonobo_object_release_unref (ui_container, NULL);
+ 		}
+ 	} else
+ 		eog_control_unset_ui_container (control);
+ 
+ 	if (BONOBO_CONTROL_CLASS (eog_control_parent_class)->activate)
+ 		BONOBO_CONTROL_CLASS (eog_control_parent_class)->activate (object, state);
+ }
+ 
+ static void
+ eog_control_class_init (EogControl *klass)
+ {
+ 	GObjectClass *gobject_class = (GObjectClass *)klass;
+ 	BonoboObjectClass *bonobo_object_class = (BonoboObjectClass *)klass;
+ 	BonoboControlClass *control_class = (BonoboControlClass *)klass;
+ 
+ 	eog_control_parent_class = g_type_class_peek_parent (klass);
+ 
+ 	bonobo_object_class->destroy = eog_control_destroy;
+ 	gobject_class->finalize = eog_control_finalize;
+ 	control_class->activate = eog_control_activate;
+ }
+ 
+ static void
+ eog_control_init (EogControl *control)
+ {
+ 	EogControlPrivate *priv;
+ 
+ 	priv = g_new0 (EogControlPrivate, 1);
+ 	control->priv = priv;
+ 
+ 	priv->size_allocations_remaining_until_we_get_it_right = BROKEN_SIZE_ALLOCATIONS;
+ }
+ 
+ BONOBO_TYPE_FUNC (EogControl, BONOBO_TYPE_CONTROL, eog_control);
+ 
+ /* FIXME: This is a horrible hack.  The plug in the control gets size_allocated
+  * *three* times, sometimes more, before the user can actually interact with it.
+  * So we count this number of allocations and manually fit-to-window when we hit
+  * the limit.  This needs to be tracked down in GTK+ and Bonobo, but it is a total
+  * bitch to fix.
+  */
+ static void
+ plug_size_allocate_cb (GtkWidget *widget, GtkAllocation *allocation, gpointer data)
+ {
+ 	EogControl *control;
+ 	EogControlPrivate *priv;
+ 
+ 	control = EOG_CONTROL (data);
+ 	priv = control->priv;
+ 
+ 	if (priv->size_allocations_remaining_until_we_get_it_right == 0)
+ 		return;
+ 
+ 	priv->size_allocations_remaining_until_we_get_it_right--;
+ 	if (priv->size_allocations_remaining_until_we_get_it_right == 0)
+ 		eog_image_view_zoom_to_fit (priv->image_view, TRUE);
+ }
+ 
+ /* Callback used when the image view's zoom factor changes */
+ static void
+ zoom_changed_cb (ImageView *view, gpointer data)
+ {
+ 	EogControl *control;
+ 	EogControlPrivate *priv;
+ 	double zoomx, zoomy;
+ 
+ 	control = EOG_CONTROL (data);
+ 	priv = control->priv;
+ 
+ 	eog_image_view_get_zoom_factor (priv->image_view, &zoomx, &zoomy);
+ 	bonobo_zoomable_report_zoom_level_changed (priv->zoomable, sqrt (zoomx * zoomy), NULL);
+ }
+ 
+ EogControl *
+ eog_control_construct (EogControl    *control,
+ 		       EogImage      *image)
+ {
+ 	GtkWidget             *widget;
+ 	BonoboPropertyBag     *pb;
+ 	EogControlPrivate     *priv;
+ 	BonoboPlug            *plug;
+ 	ImageView             *image_view;
+ 	
+ 	g_return_val_if_fail (image != NULL, NULL);
+ 	g_return_val_if_fail (control != NULL, NULL);
+ 	g_return_val_if_fail (EOG_IS_IMAGE (image), NULL);
+ 	g_return_val_if_fail (EOG_IS_CONTROL (control), NULL);
+ 
+ 	priv = control->priv;
+ 
+ 	if (!eog_image_add_interfaces (image, BONOBO_OBJECT (control)))
+ 		return NULL;
+ 
+ 	/* Create the image-view */
+ 	priv->image_view = eog_image_view_new (image, FALSE, FALSE);
+ 	if (!priv->image_view) {
+ 		bonobo_object_unref (BONOBO_OBJECT (control));
+ 		return NULL;
+ 	}
+ 	widget = eog_image_view_get_widget (priv->image_view);
+ 	image_view = IMAGE_VIEW (ui_image_get_image_view (UI_IMAGE (widget)));
+ 
+ 	bonobo_control_construct (BONOBO_CONTROL (control), widget);
+ 
+ 	g_signal_connect (image_view, "zoom_changed",
+ 			  G_CALLBACK (zoom_changed_cb), control);
+ 
+ 	plug = bonobo_control_get_plug (BONOBO_CONTROL (control));
+ 	g_signal_connect (plug, "size_allocate",
+ 			  G_CALLBACK (plug_size_allocate_cb), control);
+ 	
+ 	bonobo_object_add_interface (BONOBO_OBJECT (control),
+ 				     BONOBO_OBJECT (priv->image_view));
+ 
+ 	/* Interface Bonobo::Zoomable */
+ 	control->priv->zoomable = bonobo_zoomable_new ();
+ 
+ 	g_signal_connect (G_OBJECT (priv->zoomable),
+ 			  "set_frame",
+ 			  G_CALLBACK (zoomable_set_frame_cb),
+ 			  control);
+ 	g_signal_connect (G_OBJECT (priv->zoomable),
+ 			  "set_zoom_level",
+ 			  G_CALLBACK (zoomable_set_zoom_level_cb),
+ 			  control);
+ 	g_signal_connect (G_OBJECT (priv->zoomable),
+ 			  "zoom_in",
+ 			  G_CALLBACK (zoomable_zoom_in_cb),
+ 			  control);
+ 	g_signal_connect (G_OBJECT (priv->zoomable),
+ 			  "zoom_out",
+ 			  G_CALLBACK (zoomable_zoom_out_cb),
+ 			  control);
+ 	g_signal_connect (G_OBJECT (priv->zoomable),
+ 			  "zoom_to_fit",
+ 			  G_CALLBACK (zoomable_zoom_to_fit_cb),
+ 			  control);
+ 	g_signal_connect (G_OBJECT (priv->zoomable),
+ 			  "zoom_to_default",
+ 			  G_CALLBACK (zoomable_zoom_to_default_cb),
+ 			  control);
+ 
+ 	bonobo_zoomable_set_parameters_full (priv->zoomable,
+ 					     1.0,
+ 					     preferred_zoom_levels [0],
+ 					     preferred_zoom_levels [n_zoom_levels-1],
+ 					     TRUE, TRUE, TRUE,
+ 					     preferred_zoom_levels,
+ 					     preferred_zoom_level_names,
+ 					     n_zoom_levels);
+ 	bonobo_object_add_interface (BONOBO_OBJECT (control),
+ 				     BONOBO_OBJECT (priv->zoomable));
+ 
+ 	pb = eog_image_view_get_property_bag (priv->image_view);
+ 	bonobo_control_set_properties (BONOBO_CONTROL (control), 
+ 				       BONOBO_OBJREF (pb), 
+ 				       NULL);
+ 
+ 	return control;
+ }
+ 
+ EogControl *
+ eog_control_new (EogImage *image)
+ {
+ 	EogControl *control;
+ 	
+ 	g_return_val_if_fail (image != NULL, NULL);
+ 	g_return_val_if_fail (EOG_IS_IMAGE (image), NULL);
+ 
+ 	if (getenv ("DEBUG_EOG"))
+ 		g_message ("Creating EogControl...");
+ 
+ 	control = g_object_new (EOG_CONTROL_TYPE, NULL);
+ 
+ 	return eog_control_construct (control, image);
+ }
diff -crN ./eog/viewer/eog-image-io.c /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/viewer/eog-image-io.c
*** ./eog/viewer/eog-image-io.c	Thu Jan  1 01:00:00 1970
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/viewer/eog-image-io.c	Tue Jul  8 12:22:43 2003
***************
*** 0 ****
--- 1,649 ----
+ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+  *
+  * eog-image-io.c - Image loading/saving for EogImage.
+  *
+  * Authors:
+  *   Iain Holmes (ih@csd.abdn.ac.uk)
+  *   Michael Zucchi (zucchi@zedzone.mmc.com.au)
+  *   Federico Mena-Quintero (federico@gimp.org)
+  *   Michael Fulbright (drmike@redhat.com)
+  *   Martin Baulig (baulig@suse.de)
+  *
+  * Please refer to the individual image saving sections for information
+  * about their authors and copyright.
+  *
+  * Copyright 1999-2000, Iain Holmes <ih@csd.abdn.ac.uk>
+  * Copyright 1999, Michael Zucchi
+  * Copyright 1999, The Free Software Foundation
+  * Copyright 2000, SuSE GmbH.
+  */
+ 
+ #include <config.h>
+ #include <math.h>
+ #include <gnome.h> /* Include this before png.h, or see lots of shadowed
+ 		      variable warnings */
+ #include <stdio.h>
+ #include <string.h>
+ #ifdef HAVE_XPM
+ #include <X11/xpm.h>
+ #endif
+ #include <gdk-pixbuf/gdk-pixbuf.h>
+ 
+ #include <bonobo.h>
+ 
+ #include <eog-image-io.h>
+ 
+ /* =======================================================================
+  * Start XPM code.
+  *
+  * Based on:
+  *   gnome-icon-edit/src/io.c
+  *
+  * Authors:
+  *   Iain Holmes (ih@csd.abdn.ac.uk)
+  *
+  * Copyright 1999-2000, Iain Holmes <ih@csd.abdn.ac.uk>
+  *
+  * =======================================================================
+  */
+ 
+ /* Based on code from the GIMP */
+ 
+ #ifdef HAVE_XPM
+ 
+ int cpp;
+ static const char linenoise [] =
+ " .+@#$%&*=-;>,')!~{]^/(_:<[}|1234567890abcdefghijklmnopqrstuvwxyz\
+ ABCDEFGHIJKLMNOPQRSTUVWXYZ`";
+ 
+ typedef struct
+ {
+ 	guchar r;
+ 	guchar g;
+ 	guchar b;
+ } rgbkey;
+ 
+ static guint
+ rgbhash (rgbkey *c)
+ {
+ 	return ((guint)c->r) ^ ((guint)c->g) ^ ((guint)c->b);
+ }
+ 
+ static guint
+ compare (rgbkey *c1,
+ 	 rgbkey *c2)
+ {
+ 	return (c1->r == c2->r)&&(c1->g ==c2->g)&&(c1->b == c2->b);
+ }
+ 
+ static void
+ set_XpmImage (XpmColor *array,
+ 	      guint ie_index,
+ 	      gchar *colorstring)
+ {
+ 	gchar *p;
+ 	int i, charnum, indtemp;
+ 
+ 	indtemp = ie_index;
+ 	array[ie_index].string = p = g_new (gchar, cpp+1);
+ 
+ 	/*convert the index number to base sizeof(linenoise)-1 */
+ 	for(i=0; i<cpp; ++i) {
+ 		charnum = indtemp%(sizeof(linenoise)-1);
+ 		indtemp = indtemp / (sizeof (linenoise)-1);
+ 		*p++=linenoise[charnum];
+ 	}
+ 
+ 	*p = '\0'; /* C and its stupid null-terminated strings...*/
+ 
+ 	array[ie_index].symbolic = NULL;
+ 	array[ie_index].m_color = NULL;
+ 	array[ie_index].g4_color = NULL;
+ 	array[ie_index].c_color = NULL;
+ 	array[ie_index].g_color = colorstring;
+ }
+ 
+ static void
+ create_colormap_from_hash (gpointer gkey,
+ 			   gpointer value,
+ 			   gpointer user_data)
+ {
+ 	rgbkey *key = gkey;
+ 	char *string = g_new (char, 8);
+ 
+ 	sprintf (string, "#%02X%02X%02X", (int)key->r, (int)key->g, (int)key->b);
+ 	set_XpmImage(user_data, *((int *) value), string);
+ }
+ 
+ static void
+ free_hash_table (gpointer key,
+ 		 gpointer value,
+ 		 gpointer user_data)
+ {
+ 	/* Free the rgbkey */
+ 	g_free (key);
+ 	/* Free the gint indexno */
+ 	g_free (value);
+ }
+ 
+ gboolean
+ eog_image_save_xpm (EogImage *eog_image, Bonobo_Stream stream,
+ 		    CORBA_Environment *ev)
+ {
+ 	gint width, height, has_alpha, rowstride;
+ 	gint ncolors = 1;
+ 	gint *indexno;
+ 	XpmColor *colormap;
+ 	XpmImage *image;
+ 	guint *ibuff;
+ 	guchar *pixels, *row;
+ 
+ 	GHashTable *hash = NULL;
+ 	int retval, x, y;
+ 	char *data;
+ 
+ 	GdkPixbuf *pixbuf;
+ 
+ 	g_return_val_if_fail (eog_image != NULL, FALSE);
+ 	g_return_val_if_fail (EOG_IS_IMAGE (eog_image), FALSE);
+ 	g_return_val_if_fail (stream != CORBA_OBJECT_NIL, FALSE);
+ 	g_return_val_if_fail (ev != NULL, FALSE);
+ 
+ 	pixbuf = eog_image_get_pixbuf (eog_image);
+ 	if (!pixbuf)
+ 		return FALSE;
+ 
+ 	has_alpha = gdk_pixbuf_get_has_alpha (pixbuf);
+ 	width = gdk_pixbuf_get_width (pixbuf);
+ 	height = gdk_pixbuf_get_height (pixbuf);
+ 	pixels = gdk_pixbuf_get_pixels (pixbuf);
+ 	rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+ 
+ 	ibuff = g_new (guint, width*height);
+ 	hash = g_hash_table_new ((GHashFunc)rgbhash, (GCompareFunc) compare);
+ 
+ 	for (y = 0; y < height; y++) {
+ 		guint *idata = ibuff + (y * width);
+ 		row = pixels + (y * rowstride);
+ 
+ 		for (x = 0; x < width; x++) {
+ 			rgbkey *key = g_new (rgbkey, 1);
+ 			guchar a;
+ 
+ 			key->r = *(row++);
+ 			key->g = *(row++);
+ 			key->b = *(row++);
+ 			a = has_alpha ? *(row++) : 255;
+ 
+ 			if (a < 127)
+ 				*(idata++) = 0;
+ 			else {
+ 				indexno = g_hash_table_lookup (hash, key);
+ 				if (!indexno) {
+ 					indexno = g_new (int, 1);
+ 					*indexno = ncolors++;
+ 					g_hash_table_insert (hash, key, indexno);
+ 					key = g_new (rgbkey, 1);
+ 				}
+ 				*(idata++) = *indexno;
+ 			}
+ 		}
+ 	}
+ 
+ 	colormap = g_new (XpmColor, ncolors);
+ 	cpp = (double)1.0 + (double)log (ncolors) / (double)log (sizeof (linenoise) - 1.0);
+ 
+ 	set_XpmImage (colormap, 0, "None");
+ 
+ 	g_hash_table_foreach (hash, create_colormap_from_hash, colormap);
+ 
+ 	image = g_new (XpmImage, 1);
+ 
+ 	image->width = width;
+ 	image->height = height;
+ 	image->ncolors = ncolors;
+ 	image->cpp = cpp;
+ 	image->colorTable = colormap;
+ 	image->data = ibuff;
+ 
+ 	retval = XpmCreateBufferFromXpmImage (&data, image, NULL);
+ 	if (!retval)
+ 	    bonobo_stream_client_write (stream, data, strlen (data)+1, ev);
+ 	XpmFree (data);
+ 
+ 	g_free (ibuff);
+ 	g_hash_table_foreach (hash, free_hash_table, NULL);
+ 	g_hash_table_destroy (hash);
+ 
+ 	g_object_unref (pixbuf);
+ 
+ 	return retval == 0;
+ }
+ 
+ #else /* don't HAVE_XPM */
+ 
+ gboolean
+ eog_image_save_xpm (EogImage *eog_image, Bonobo_Stream stream,
+ 		    CORBA_Environment *ev)
+ {
+ 	g_return_val_if_fail (eog_image != NULL, FALSE);
+ 	g_return_val_if_fail (EOG_IS_IMAGE (eog_image), FALSE);
+ 	g_return_val_if_fail (stream != CORBA_OBJECT_NIL, FALSE);
+ 	g_return_val_if_fail (ev != NULL, FALSE);
+ 
+ 	CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
+ 			     ex_Bonobo_Persist_WrongDataType, NULL);
+ 
+ 	return FALSE;
+ }
+ 
+ #endif /* don't HAVE_XPM */
+ 
+ /*** End of stuff from GIMP */
+ 
+ /* =======================================================================
+  * Start PNG code.
+  *
+  * Based on:
+  *   gnome-icon-edit/src/io.c
+  *
+  * Authors:
+  *   Iain Holmes (ih@csd.abdn.ac.uk)
+  *   David Welton (davidw@linuxcare.com)
+  *   Michael Meeks (mmeeks@gnu.org)
+  *
+  * Copyright 1999-2000, Iain Holmes <ih@csd.abdn.ac.uk>
+  *
+  * =======================================================================
+  */
+ 
+ #ifdef HAVE_PNG
+ 
+ #include <png.h>
+ 
+ typedef struct {
+         Bonobo_Stream      stream;
+         CORBA_Environment *ev;
+ } BStreamData;
+ 
+ static void
+ png_write_data_fn (png_structp png_ptr, png_bytep data, png_size_t len)
+ {
+ 	BStreamData *sd = png_get_io_ptr (png_ptr);
+ 
+ 	if (sd->ev->_major != CORBA_NO_EXCEPTION)
+ 		return;
+ 
+ 	bonobo_stream_client_write (sd->stream, data, len, sd->ev);
+ }
+ 
+ static void
+ png_flush_fn (png_structp png_ptr)
+ {
+ 	g_warning ("Flush nothing");
+ }
+ 
+ gboolean
+ eog_image_save_png (EogImage *eog_image, Bonobo_Stream stream,
+ 		    CORBA_Environment *ev)
+ {
+ 	gint width, height, depth, rowstride;
+ 	guchar *pixels;
+ 	GdkPixbuf *pixbuf;
+ 	png_structp png_ptr;
+ 	png_infop info_ptr;
+ 	png_bytep row_ptr;
+ 	png_color_8 sig_bit;
+ 	png_text text;
+ 	int y;
+ 	int bpc, has_alpha;
+ 	BStreamData sdata;
+ 
+ 	g_return_val_if_fail (eog_image != NULL, FALSE);
+ 	g_return_val_if_fail (EOG_IS_IMAGE (eog_image), FALSE);
+ 	g_return_val_if_fail (stream != CORBA_OBJECT_NIL, FALSE);
+ 	g_return_val_if_fail (ev != NULL, FALSE);
+ 
+ 	pixbuf = eog_image_get_pixbuf (eog_image);
+ 	if (!pixbuf)
+ 		return FALSE;
+ 
+ 	/* no image data? abort */
+ 	pixels = gdk_pixbuf_get_pixels (pixbuf);
+ 	if (!pixels) {
+ 		g_object_unref (pixbuf);
+ 		return FALSE;
+ 	}
+ 
+ 	png_ptr = png_create_write_struct (PNG_LIBPNG_VER_STRING,
+ 					   NULL, NULL, NULL);
+ 	if (!png_ptr) {
+ 		g_object_unref (pixbuf);
+ 		return FALSE;
+ 	}
+ 
+ 	info_ptr = png_create_info_struct (png_ptr);
+ 	if (!info_ptr) {
+ 		g_object_unref (pixbuf);
+ 		return FALSE;
+ 	}
+ 
+ 	if (setjmp (png_ptr->jmpbuf)) {
+ 		png_destroy_write_struct (&png_ptr, &info_ptr);
+ 		g_object_unref (pixbuf);
+ 		return FALSE;
+ 	}
+ 
+ 	sdata.stream = stream;
+ 	sdata.ev     = ev;
+ 	png_set_write_fn (png_ptr, &sdata, png_write_data_fn, png_flush_fn);
+ 
+ 	bpc = gdk_pixbuf_get_bits_per_sample (pixbuf);
+ 	width = gdk_pixbuf_get_width (pixbuf);
+ 	height = gdk_pixbuf_get_height (pixbuf);
+ 	depth = gdk_pixbuf_get_bits_per_sample (pixbuf);
+ 	rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+ 	has_alpha = gdk_pixbuf_get_has_alpha (pixbuf);
+ 
+ 	if (has_alpha)
+ 		png_set_IHDR (png_ptr, info_ptr, width, height, bpc,
+ 			      PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE,
+ 			      PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
+ 	else
+ 		png_set_IHDR (png_ptr, info_ptr, width, height, bpc,
+ 			      PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
+ 			      PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
+ 
+ 	sig_bit.red = bpc;
+ 	sig_bit.green = bpc;
+ 	sig_bit.blue = bpc;
+ 	sig_bit.alpha = bpc;
+ 
+ 	/* Some text to go with the png image. */
+ 	text.key = "Software";
+ 	text.text = "Eye of Gnome";
+ 	text.compression = PNG_TEXT_COMPRESSION_NONE;
+ 
+ 	png_set_text    (png_ptr, info_ptr, &text, 1);
+ 	png_set_sBIT    (png_ptr, info_ptr, &sig_bit);
+ 	png_write_info  (png_ptr, info_ptr);
+ 	png_set_shift   (png_ptr, &sig_bit);
+ 	png_set_packing (png_ptr);
+ 
+ 	for (y = 0; y < height; y++) {
+ 		row_ptr = (png_bytep) (pixels + y * rowstride);
+ 		png_write_rows (png_ptr, &row_ptr, 1);
+ 	}
+ 
+ 	png_write_end (png_ptr, info_ptr);
+ 	png_destroy_write_struct (&png_ptr, (png_infopp) NULL);
+ 
+ 	g_object_unref (pixbuf);
+ 
+ 	return TRUE;
+ }
+ 
+ #else /* don't HAVE_PNG */
+ 
+ gboolean
+ eog_image_save_png (EogImage *eog_image, Bonobo_Stream stream,
+ 		    CORBA_Environment *ev)
+ {
+ 	g_return_val_if_fail (eog_image != NULL, FALSE);
+ 	g_return_val_if_fail (EOG_IS_IMAGE (eog_image), FALSE);
+ 	g_return_val_if_fail (stream != CORBA_OBJECT_NIL, FALSE);
+ 	g_return_val_if_fail (ev != NULL, FALSE);
+ 
+ 	CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
+ 			     ex_Bonobo_Persist_WrongDataType, NULL);
+ 
+ 	return FALSE;
+ }
+ 
+ #endif /* don't HAVE_PNG */
+ 
+ /* =======================================================================
+  * Start JPEG code.
+  *
+  * Based on:
+  *   gtk+/gdk-pixbuf/io-png.c
+  *
+  * Authors:
+  *   Michael Zucchi (zucchi@zedzone.mmc.com.au)
+  *   Federico Mena-Quintero (federico@gimp.org)
+  *   Michael Fulbright (drmike@redhat.com)
+  *   Martin Baulig (baulig@suse.de)
+  *
+  * Copyright 1999, Michael Zucchi
+  * Copyright 1999, The Free Software Foundation
+  * Copyright 2000, SuSE GmbH
+  *
+  * =======================================================================
+  */
+ 
+ #ifdef HAVE_JPEG
+ 
+ /* Workaround broken libjpeg defining these that may
+  * collide w/ the ones in config.h
+  */
+ #undef HAVE_STDDEF_H
+ #undef HAVE_STDLIB_H
+ #include <jpeglib.h>
+ 
+ /* we are a "destination manager" as far as libjpeg is concerned */
+ #define JPEG_PROG_BUF_SIZE 4096
+ 
+ typedef struct {
+ 	struct jpeg_destination_mgr pub;   /* public fields */
+ 
+ 	JOCTET *buffer_start;
+ 
+ 	Bonobo_Stream stream;
+         CORBA_Environment *ev;
+ } my_dest_mgr;
+ 
+ typedef my_dest_mgr * my_dest_ptr;
+ 
+ static void
+ init_destination (j_compress_ptr cinfo)
+ {
+ 	my_dest_mgr *dest = (my_dest_ptr) cinfo->dest;
+ 
+ 	dest->buffer_start = g_malloc0 (JPEG_PROG_BUF_SIZE+1);
+ 
+ 	dest->pub.next_output_byte = dest->buffer_start;
+ 	dest->pub.free_in_buffer = JPEG_PROG_BUF_SIZE;
+ }
+ 
+ static boolean
+ empty_output_buffer (j_compress_ptr cinfo)
+ {
+ 	my_dest_mgr *dest = (my_dest_ptr) cinfo->dest;
+ 
+ 	if (dest->ev->_major != CORBA_NO_EXCEPTION) {
+ 		jpeg_abort_compress (cinfo);
+ 		return FALSE;
+ 	}
+ 
+ 	bonobo_stream_client_write (dest->stream,
+ 				    dest->buffer_start, JPEG_PROG_BUF_SIZE,
+ 				    dest->ev);
+ 
+ 	if (dest->ev->_major != CORBA_NO_EXCEPTION) {
+ 		jpeg_abort_compress (cinfo);
+ 		return FALSE;
+ 	}
+ 
+ 	dest->pub.next_output_byte = dest->buffer_start;
+ 	dest->pub.free_in_buffer = JPEG_PROG_BUF_SIZE;
+ 
+ 	return TRUE;
+ }
+ 
+ static void
+ term_destination (j_compress_ptr cinfo)
+ {
+ 	my_dest_mgr *dest = (my_dest_ptr) cinfo->dest;
+ 
+ 	if (dest->ev->_major != CORBA_NO_EXCEPTION) {
+ 		jpeg_abort_compress (cinfo);
+ 		return;
+ 	}
+ 
+ 	bonobo_stream_client_write (dest->stream, dest->buffer_start,
+ 				    JPEG_PROG_BUF_SIZE -
+ 				    dest->pub.free_in_buffer,
+ 				    dest->ev);
+ 
+ 	if (dest->ev->_major != CORBA_NO_EXCEPTION) {
+ 		jpeg_abort_compress (cinfo);
+ 		return;
+ 	}
+ }
+ 
+ /* error handler data */
+ struct error_handler_data {
+ 	struct jpeg_error_mgr pub;
+ 	sigjmp_buf setjmp_buffer;
+ };
+ 
+ static void
+ fatal_error_handler (j_common_ptr cinfo)
+ {
+ 	struct error_handler_data *errmgr;
+ 
+ 	errmgr = (struct error_handler_data *) cinfo->err;
+ 
+ 	siglongjmp (errmgr->setjmp_buffer, 1);
+ 
+         g_assert_not_reached ();
+ }
+ 
+ static void
+ output_message_handler (j_common_ptr cinfo)
+ {
+   /* This method keeps libjpeg from dumping crap to stderr */
+ 
+   /* do nothing */
+ }
+ 
+ gboolean
+ eog_image_save_jpeg (EogImage *eog_image, Bonobo_Stream stream,
+ 		     CORBA_Environment *ev)
+ {
+ 	struct jpeg_compress_struct cinfo;
+ 	guchar *buf = NULL;
+ 	guchar *ptr;
+ 	guchar *pixels = NULL;
+ 	JSAMPROW *jbuf;
+ 	int y = 0;
+ 	int quality = 100; /* default; must be between 0 and 100 */
+ 	int i, j;
+ 	int w, h = 0;
+ 	int rowstride = 0;
+ 	struct error_handler_data jerr;
+ 	GdkPixbuf *pixbuf;
+ 	my_dest_mgr *dest;
+ 
+ 	g_return_val_if_fail (eog_image != NULL, FALSE);
+ 	g_return_val_if_fail (EOG_IS_IMAGE (eog_image), FALSE);
+ 	g_return_val_if_fail (stream != CORBA_OBJECT_NIL, FALSE);
+ 	g_return_val_if_fail (ev != NULL, FALSE);
+ 
+ 	pixbuf = eog_image_get_pixbuf (eog_image);
+ 	if (pixbuf == NULL)
+ 		return FALSE;
+ 
+ 	rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+ 
+ 	w = gdk_pixbuf_get_width (pixbuf);
+ 	h = gdk_pixbuf_get_height (pixbuf);
+ 
+ 	/* no image data? abort */
+ 	pixels = gdk_pixbuf_get_pixels (pixbuf);
+ 	if (pixels == NULL) {
+ 		g_object_unref (pixbuf);
+ 		return FALSE;
+ 	}
+ 
+ 	/* allocate a small buffer to convert image data */
+ 	buf = g_malloc (w * 3 * sizeof (guchar));
+ 
+ 	/* setup compress params */
+ 	jpeg_create_compress (&cinfo);
+ 	cinfo.image_width      = w;
+ 	cinfo.image_height     = h;
+ 	cinfo.input_components = 3;
+ 	cinfo.in_color_space   = JCS_RGB;
+ 
+ 	/* set up our destination manager */
+ 	cinfo.dest = (struct jpeg_destination_mgr *) g_new0 (my_dest_mgr, 1);
+ 	dest = (my_dest_ptr) cinfo.dest;
+ 
+ 	dest->pub.init_destination = init_destination;
+ 	dest->pub.empty_output_buffer = empty_output_buffer;
+ 	dest->pub.term_destination = term_destination;
+ 
+ 	dest->stream = stream;
+ 	dest->ev = ev;
+ 
+ 	/* set up error handling */
+ 	jerr.pub.error_exit = fatal_error_handler;
+ 	jerr.pub.output_message = output_message_handler;
+ 
+ 	cinfo.err = jpeg_std_error (&(jerr.pub));
+ 	if (sigsetjmp (jerr.setjmp_buffer, 1)) {
+ 		jpeg_destroy_compress (&cinfo);
+ 		g_object_unref (pixbuf);
+ 		g_free (dest->buffer_start);
+ 		g_free (dest);
+ 		free (buf);
+ 		return FALSE;
+ 	}
+ 
+ 	/* set up jepg compression parameters */
+ 	jpeg_set_defaults (&cinfo);
+ 	jpeg_set_quality (&cinfo, quality, TRUE);
+ 	jpeg_start_compress (&cinfo, TRUE);
+ 	/* get the start pointer */
+ 	ptr = pixels;
+ 	/* go one scanline at a time... and save */
+ 	i = 0;
+ 	while (cinfo.next_scanline < cinfo.image_height) {
+ 		/* convert scanline from ARGB to RGB packed */
+ 		for (j = 0; j < w; j++)
+ 			memcpy (&(buf[j*3]), &(ptr[i*rowstride + j*3]), 3);
+ 
+ 		/* write scanline */
+ 		jbuf = (JSAMPROW *)(&buf);
+ 		jpeg_write_scanlines (&cinfo, jbuf, 1);
+ 		i++;
+ 		y++;
+ 	}
+ 
+ 	/* finish off */
+ 	jpeg_finish_compress (&cinfo);
+ 	g_object_unref (pixbuf);
+ 	free (buf);
+ 
+ 	return TRUE;
+ }
+ 
+ #else /* don't HAVE_JPEG */
+ 
+ gboolean
+ eog_image_save_jpeg (EogImage *eog_image, Bonobo_Stream stream,
+ 		     CORBA_Environment *ev)
+ {
+ 	g_return_val_if_fail (eog_image != NULL, FALSE);
+ 	g_return_val_if_fail (EOG_IS_IMAGE (eog_image), FALSE);
+ 	g_return_val_if_fail (stream != CORBA_OBJECT_NIL, FALSE);
+ 	g_return_val_if_fail (ev != NULL, FALSE);
+ 
+ 	CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
+ 			     ex_Bonobo_Persist_WrongDataType, NULL);
+ 
+ 	return FALSE;
+ }
+ 
+ #endif /* don't HAVE_JPEG */
diff -crN ./eog/xmldocs.make /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/xmldocs.make
*** ./eog/xmldocs.make	Thu Jan  1 01:00:00 1970
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./eog/xmldocs.make	Tue Jul  8 12:22:01 2003
***************
*** 0 ****
--- 1,88 ----
+ # To use this template:
+ #     1) Define: figs, docname, lang, omffile, entities although figs, 
+ #        omffile, and entities may be empty in your Makefile.am which 
+ #        will "include" this one 
+ #     2) Figures must go under figures/ and be in PNG format
+ #     3) You should only have one document per directory 
+ #
+ #        Note that this makefile forces the directory name under
+ #        $prefix/share/gnome/help/ to be the same as the XML filename
+ #        of the document.  This is required by GNOME. eg:
+ #        $prefix/share/gnome/help/fish_applet/C/fish_applet.xml
+ #                                 ^^^^^^^^^^^   ^^^^^^^^^^^
+ # Definitions:
+ #   figs         A list of screenshots which will be included in EXTRA_DIST
+ #                Note that these should reside in figures/ and should be .png
+ #                files, or you will have to make modifications below.
+ #   docname      This is the name of the XML file: <docname>.xml
+ #   lang         This is the document locale
+ #   omffile      This is the name of the OMF file.  Convention is to name
+ #                it <docname>-<locale>.omf.
+ #   entities     This is a list of XML entities which must be installed 
+ #                with the main XML file and included in EXTRA_DIST. 
+ # eg:
+ #   figs = \
+ #          figures/fig1.png            \
+ #          figures/fig2.png
+ #   docname = scrollkeeper-manual
+ #   lang = C
+ #   omffile=scrollkeeper-manual-C.omf
+ #   entities = fdl.xml
+ #   include $(top_srcdir)/help/xmldocs.make
+ #   dist-hook: app-dist-hook
+ #
+ 
+ docdir = $(datadir)/gnome/help/$(docname)/$(lang)
+ 
+ xml_files = $(entities) $(docname).xml
+ 
+ omf_dir=$(top_srcdir)/omf-install
+ 
+ EXTRA_DIST = $(xml_files) $(omffile) $(figs)
+ 
+ CLEANFILES = omf_timestamp
+ 
+ all: omf
+ 
+ omf: omf_timestamp
+ 
+ omf_timestamp: $(omffile)
+ 	-for file in $(omffile); do \
+ 	  scrollkeeper-preinstall $(docdir)/`awk 'BEGIN {RS = ">" } /identifier/ {print $$0}' $(srcdir)/$${file} | awk 'BEGIN {FS="\""} /url/ {print $$2}'` $(srcdir)/$${file} $(omf_dir)/$${file}; \
+ 	done
+ 	touch omf_timestamp
+ 
+ $(docname).xml: $(entities)
+ 	-ourdir=`pwd`;  \
+         cd $(srcdir);   \
+         cp $(entities) $$ourdir
+ 
+ app-dist-hook: 
+ 	-$(mkinstalldirs) $(distdir)/figures
+ 	-if [ -e topic.dat ]; then \
+ 		cp $(srcdir)/topic.dat $(distdir); \
+ 	 fi
+ 
+ install-data-am: omf
+ 	-$(mkinstalldirs) $(DESTDIR)$(docdir)/figures
+ 	-for file in $(xml_files); do \
+ 	  cp $(srcdir)/$$file $(DESTDIR)$(docdir); \
+ 	done
+ 	-for file in $(srcdir)/figures/*.png; do \
+ 	  basefile=`echo $$file | sed -e  's,^.*/,,'`; \
+ 	  $(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/figures/$$basefile; \
+ 	done
+ 	-if [ -e $(srcdir)/topic.dat ]; then \
+ 		$(INSTALL_DATA) $(srcdir)/topic.dat $(DESTDIR)$(docdir); \
+ 	 fi
+ 
+ uninstall-local:
+ 	-for file in $(srcdir)/figures/*.png; do \
+ 	  basefile=`echo $$file | sed -e  's,^.*/,,'`; \
+ 	  rm -f $(docdir)/figures/$$basefile; \
+ 	done
+ 	-for file in $(xml_files); do \
+ 	  rm -f $(DESTDIR)$(docdir)/$$file; \
+ 	done
+ 	-rmdir $(DESTDIR)$(docdir)/figures
+ 	-rmdir $(DESTDIR)$(docdir)
