From f88b0d4b14e098cd2ef6000407ae01ba96bda7ac Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Tue, 24 Oct 2000 18:31:48 +0000 Subject: [PATCH] New file. This is the patch you need to apply to the core EOG to get my 2000-10-24 Martin Baulig * martin-eog-core.patch: New file. This is the patch you need to apply to the core EOG to get my new component work. --- bonobo/ChangeLog | 5 + bonobo/martin-eog-core.patch | 853 +++++++++++++++++++++++++++++++++++ 2 files changed, 858 insertions(+) create mode 100644 bonobo/martin-eog-core.patch diff --git a/bonobo/ChangeLog b/bonobo/ChangeLog index ddc2b3d0..e8958f94 100644 --- a/bonobo/ChangeLog +++ b/bonobo/ChangeLog @@ -1,3 +1,8 @@ +2000-10-24 Martin Baulig + + * martin-eog-core.patch: New file. This is the patch you + need to apply to the core EOG to get my new component work. + 2000-10-15 Martin Baulig * eog-image-viewer-ui.xml: New file. diff --git a/bonobo/martin-eog-core.patch b/bonobo/martin-eog-core.patch new file mode 100644 index 00000000..38230928 --- /dev/null +++ b/bonobo/martin-eog-core.patch @@ -0,0 +1,853 @@ +? bonobo/martin-eog-component.patch +? bonobo/martin-eog-core.patch +? src/libeog.la +Index: bonobo/ChangeLog +=================================================================== +RCS file: /cvs/gnome/eog/bonobo/ChangeLog,v +retrieving revision 1.3 +diff -u -u -p -r1.3 ChangeLog +--- bonobo/ChangeLog 2000/10/20 14:27:53 1.3 ++++ bonobo/ChangeLog 2000/10/24 18:24:55 +@@ -1,3 +1,11 @@ ++2000-10-15 Martin Baulig ++ ++ * eog-image-viewer-ui.xml: New file. ++ ++ * eog-image-viewer.c: ++ - more work on the zoomable interface. ++ - added UI file and menu where you can set preferences. ++ + 2000-10-20 Michael Meeks + + * bonobo-image-generic.c: credit where due. +Index: bonobo/Makefile.am +=================================================================== +RCS file: /cvs/gnome/eog/bonobo/Makefile.am,v +retrieving revision 1.7 +diff -u -u -p -r1.7 Makefile.am +--- bonobo/Makefile.am 2000/07/06 11:56:21 1.7 ++++ bonobo/Makefile.am 2000/10/24 18:24:55 +@@ -12,18 +12,26 @@ else + OBJECT_DIRECTORY_LIBS = $(GNOMEGNORBA_LIBS) + endif + +-bin_PROGRAMS = bonobo-image-generic ++bin_PROGRAMS = bonobo-image-generic eog-image-viewer-component + + bonobo_image_generic_SOURCES = \ + bonobo-image-generic.c \ + io-png.c \ + io-png.h + ++eog_image_viewer_component_SOURCES = \ ++ image-viewer-component.c \ ++ eog-image-viewer.c \ ++ eog-image-viewer.h ++ + INCLUDES = \ + -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ ++ -DDATADIR=\""$(datadir)"\" \ + -I$(srcdir) -I$(top_srcdir) \ ++ -I$(top_srcdir)/src \ + -I. \ + -I$(includedir) \ ++ $(GCONF_CFLAGS) \ + $(GNOME_INCLUDEDIR) \ + $(EXTRA_BONOBO_CFLAGS) \ + $(GNOME_CFLAGS) +@@ -35,14 +43,26 @@ bonobo_image_generic_LDADD = \ + $(INTLLIBS) \ + $(PRINT_LIBS) \ + $(EXTRA_BONOBO_LIBS) ++ ++eog_image_viewer_component_LDADD = \ ++ $(GNOME_LIBS) \ ++ $(GNOME_LIBDIR) \ ++ $(OBJECT_DIRECTORY_LIBS) \ ++ $(INTLLIBS) \ ++ $(PRINT_LIBS) \ ++ $(EXTRA_BONOBO_LIBS) \ ++ ../src/libeog.la ++ + endif + + gnorbadir = $(sysconfdir)/CORBA/servers + oafdir = $(datadir)/oaf + ++uidir = $(datadir)/gnome/ui ++ui_DATA = eog-image-viewer-ui.xml + + GOAD_FILES = image-generic.gnorba +-OAF_FILES = image-generic.oafinfo ++OAF_FILES = image-generic.oafinfo image-viewer-component.oafinfo + + if BONOBO + if USING_OAF +Index: src/.cvsignore +=================================================================== +RCS file: /cvs/gnome/eog/src/.cvsignore,v +retrieving revision 1.3 +diff -u -u -p -r1.3 .cvsignore +--- src/.cvsignore 2000/02/12 01:29:05 1.3 ++++ src/.cvsignore 2000/10/24 18:24:55 +@@ -4,3 +4,4 @@ testicon + .deps + .libs + eog ++*.lo +Index: src/ChangeLog +=================================================================== +RCS file: /cvs/gnome/eog/src/ChangeLog,v +retrieving revision 1.86 +diff -u -u -p -r1.86 ChangeLog +--- src/ChangeLog 2000/09/21 23:19:26 1.86 ++++ src/ChangeLog 2000/10/24 18:24:56 +@@ -1,3 +1,25 @@ ++2000-10-09 Martin Baulig ++ ++ * Makefile.am: Create a non-installed libeog.la and move ++ gtkscrollframe.[ch], image-view.[ch], image.[ch], uta.[ch], ++ cursors.[ch], ui-image.[ch] and zoom.[ch] into this library. ++ ++ * gconf.[ch]: New files. ++ (image_view_add_gconf_client): This function adds the GConf stuff to ++ an ImageView widget. ++ ++ * image-view.c (ImageViewPrivate): Removed the `client' and all ++ `*_notify_id' fields. ++ (image_view_get_arg, image_view_set_arg): Added the GtkArg stuff. ++ (image_view): Removed all GConf stuff. ++ (image_view_get_full_screen_zoom, image_view_get_full_screen_zoom): ++ New global functions. ++ ++ * full-screen.c (full_screen_init): Call image_view_add_gconf_client(). ++ * window.c (window_construct): Likewise. ++ ++ * image.c (image_load_pixbuf): New global function. ++ + 2000-09-21 Federico Mena Quintero + + * image-view.c: Changes for the new GConf API. +Index: src/Makefile.am +=================================================================== +RCS file: /cvs/gnome/eog/src/Makefile.am,v +retrieving revision 1.23 +diff -u -u -p -r1.23 Makefile.am +--- src/Makefile.am 2000/07/13 05:03:49 1.23 ++++ src/Makefile.am 2000/10/24 18:24:57 +@@ -10,21 +10,35 @@ INCLUDES = \ + -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ + -DG_LOG_DOMAIN=\"eog\" + ++noinst_LTLIBRARIES = libeog.la ++ ++libeog_la_SOURCES = \ ++ gtkscrollframe.c \ ++ gtkscrollframe.h \ ++ image-view.c \ ++ image-view.h \ ++ image.h \ ++ image.c \ ++ uta.c \ ++ uta.h \ ++ cursors.c \ ++ cursors.h \ ++ ui-image.c \ ++ ui-image.h \ ++ zoom.c \ ++ zoom.h ++ ++libeog_la_LIBADD = \ ++ $(EXTRA_GNOME_LIBS) \ ++ $(INTLLIBS) ++ + eog_SOURCES = \ + commands.c \ + commands.h \ +- cursors.c \ +- cursors.h \ + e-dialog-widgets.c \ + e-dialog-widgets.h \ + full-screen.c \ + full-screen.h \ +- gtkscrollframe.c \ +- gtkscrollframe.h \ +- image.h \ +- image.c \ +- image-view.c \ +- image-view.h \ + main.c \ + preferences.c \ + preferences.h \ +@@ -32,16 +46,11 @@ eog_SOURCES = \ + stock.h \ + tb-image.c \ + tb-image.h \ +- ui-image.c \ +- ui-image.h \ +- uta.c \ +- uta.h \ + util.c \ + util.h \ ++ gconf.c \ + window.c \ +- window.h \ +- zoom.c \ +- zoom.h ++ window.h + + testicon_SOURCES = \ + gnome-icon-item-factory.c \ +@@ -67,7 +76,8 @@ testicon_SOURCES = \ + eog_LDADD = \ + $(EXTRA_GNOME_LIBS) \ + $(INTLLIBS) \ +- $(GCONF_LIBS) ++ $(GCONF_LIBS) \ ++ libeog.la + + testicon_LDADD = \ + $(EXTRA_GNOME_LIBS) \ +Index: src/full-screen.c +=================================================================== +RCS file: /cvs/gnome/eog/src/full-screen.c,v +retrieving revision 1.12 +diff -u -u -p -r1.12 full-screen.c +--- src/full-screen.c 2000/09/21 23:19:26 1.12 ++++ src/full-screen.c 2000/10/24 18:24:57 +@@ -25,6 +25,7 @@ + #include "full-screen.h" + #include "image-view.h" + #include "ui-image.h" ++#include "gconf.h" + + /* Private part of the FullScreen structure */ + struct _FullScreenPrivate { +@@ -148,6 +149,7 @@ static void + full_screen_init (FullScreen *fs) + { + FullScreenPrivate *priv; ++ ImageView *view; + + priv = g_new0 (FullScreenPrivate, 1); + fs->priv = priv; +@@ -178,6 +180,9 @@ full_screen_init (FullScreen *fs) + gtk_widget_set_uposition (GTK_WIDGET (fs), 0, 0); + + priv->ui = ui_image_new (); ++ view = IMAGE_VIEW (ui_image_get_image_view (UI_IMAGE (priv->ui))); ++ image_view_add_gconf_client (view, priv->client); ++ + gtk_container_add (GTK_CONTAINER (fs), priv->ui); + + gtk_scroll_frame_set_policy (GTK_SCROLL_FRAME (priv->ui), priv->sb_policy, priv->sb_policy); +Index: src/gconf.c +=================================================================== +RCS file: gconf.c +diff -N gconf.c +--- /dev/null Tue May 5 16:32:27 1998 ++++ gconf.c Tue Oct 24 14:24:57 2000 +@@ -0,0 +1,171 @@ ++/* Eye of Gnome image viewer - main window widget ++ * ++ * Copyright (C) 2000 The Free Software Foundation ++ * 2000 SuSE GmbH ++ * ++ * Authors: Federico Mena-Quintero ++ * Martin Baulig ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ++ */ ++ ++#include ++#include ++#include "gconf.h" ++ ++typedef struct _ImageViewGConfData ImageViewGConfData; ++ ++/* Private part of the ImageView structure */ ++struct _ImageViewGConfData { ++ /* GConf client for monitoring changes to the preferences */ ++ GConfClient *client; ++ ++ /* GConf client notify IDs */ ++ guint interp_type_notify_id; ++ guint check_type_notify_id; ++ guint check_size_notify_id; ++ guint dither_notify_id; ++ guint scroll_notify_id; ++}; ++ ++/* Handler for changes on the interp_type value */ ++static void ++interp_type_changed_cb (GConfClient *client, guint notify_id, GConfEntry *entry, gpointer data) ++{ ++ image_view_set_interp_type (IMAGE_VIEW (data), gconf_value_get_int (entry->value)); ++} ++ ++/* Handler for changes on the check_type value */ ++static void ++check_type_changed_cb (GConfClient *client, guint notify_id, GConfEntry *entry, gpointer data) ++{ ++ image_view_set_check_type (IMAGE_VIEW (data), gconf_value_get_int (entry->value)); ++} ++ ++/* Handler for changes on the check_size value */ ++static void ++check_size_changed_cb (GConfClient *client, guint notify_id, GConfEntry *entry, gpointer data) ++{ ++ image_view_set_check_size (IMAGE_VIEW (data), gconf_value_get_int (entry->value)); ++} ++ ++/* Handler for changes on the dither value */ ++static void ++dither_changed_cb (GConfClient *client, guint notify_id, GConfEntry *entry, gpointer data) ++{ ++ image_view_set_dither (IMAGE_VIEW (data), gconf_value_get_int (entry->value)); ++} ++ ++/* Handler for changes on the scroll value */ ++static void ++scroll_changed_cb (GConfClient *client, guint notify_id, GConfEntry *entry, gpointer data) ++{ ++ image_view_set_scroll (IMAGE_VIEW (data), gconf_value_get_int (entry->value)); ++} ++ ++/* Destroy the GConf stuff */ ++static void ++image_view_destroy_gconf_data (gpointer object) ++{ ++ ImageViewGConfData *priv; ++ ++ g_return_if_fail (object != NULL); ++ g_return_if_fail (IS_IMAGE_VIEW (object)); ++ ++ priv = gtk_object_get_data (GTK_OBJECT (object), "image_view:gconf_data"); ++ ++ /* Remove notification handlers */ ++ ++ gconf_client_notify_remove (priv->client, priv->interp_type_notify_id); ++ gconf_client_notify_remove (priv->client, priv->check_type_notify_id); ++ gconf_client_notify_remove (priv->client, priv->check_size_notify_id); ++ gconf_client_notify_remove (priv->client, priv->dither_notify_id); ++ gconf_client_notify_remove (priv->client, priv->scroll_notify_id); ++ ++ priv->interp_type_notify_id = 0; ++ priv->check_type_notify_id = 0; ++ priv->check_size_notify_id = 0; ++ priv->dither_notify_id = 0; ++ priv->scroll_notify_id = 0; ++ ++ gconf_client_remove_dir (priv->client, "/apps/eog", NULL); ++ ++ gtk_object_unref (GTK_OBJECT (priv->client)); ++ ++ g_free (priv); ++} ++ ++void ++image_view_add_gconf_client (ImageView *image_view, GConfClient *client) ++{ ++ ImageViewGConfData *priv; ++ ++ g_return_if_fail (image_view != NULL); ++ g_return_if_fail (IS_IMAGE_VIEW (image_view)); ++ g_return_if_fail (client != NULL); ++ g_return_if_fail (GCONF_IS_CLIENT (client)); ++ ++ g_assert (gtk_object_get_data (GTK_OBJECT (image_view), ++ "image_view:gconf_data") == NULL); ++ ++ priv = g_new0 (ImageViewGConfData, 1); ++ ++ /* Add the GConf client and notification handlers */ ++ ++ gtk_object_ref (GTK_OBJECT (client)); ++ priv->client = client; ++ ++ gconf_client_add_dir (priv->client, "/apps/eog", ++ GCONF_CLIENT_PRELOAD_RECURSIVE, NULL); ++ ++ priv->interp_type_notify_id = gconf_client_notify_add ( ++ priv->client, "/apps/eog/view/interp_type", ++ interp_type_changed_cb, image_view, ++ NULL, NULL); ++ priv->check_type_notify_id = gconf_client_notify_add ( ++ priv->client, "/apps/eog/view/check_type", ++ check_type_changed_cb, image_view, ++ NULL, NULL); ++ priv->check_size_notify_id = gconf_client_notify_add ( ++ priv->client, "/apps/eog/view/check_size", ++ check_size_changed_cb, image_view, ++ NULL, NULL); ++ priv->dither_notify_id = gconf_client_notify_add ( ++ priv->client, "/apps/eog/view/dither", ++ dither_changed_cb, image_view, ++ NULL, NULL); ++ priv->scroll_notify_id = gconf_client_notify_add ( ++ priv->client, "/apps/eog/view/scroll", ++ scroll_changed_cb, image_view, ++ NULL, NULL); ++ ++ /* Set the default values */ ++ ++ image_view_set_interp_type (image_view, ++ gconf_client_get_int (priv->client, "/apps/eog/view/interp_type", NULL)); ++ image_view_set_check_type (image_view, ++ gconf_client_get_int (priv->client, "/apps/eog/view/check_type", NULL)); ++ image_view_set_check_size (image_view, ++ gconf_client_get_int (priv->client, "/apps/eog/view/check_size", NULL)); ++ image_view_set_dither (image_view, ++ gconf_client_get_int (priv->client, "/apps/eog/view/dither", NULL)); ++ image_view_set_scroll (image_view, ++ gconf_client_get_int (priv->client, "/apps/eog/view/scroll", NULL)); ++ image_view_set_full_screen_zoom (image_view, ++ gconf_client_get_int (priv->client, "/apps/eog/full_screen/zoom", NULL)); ++ ++ gtk_object_set_data_full (GTK_OBJECT (image_view), "image_view:gconf_data", ++ priv, image_view_destroy_gconf_data); ++} +Index: src/gconf.h +=================================================================== +RCS file: gconf.h +diff -N gconf.h +--- /dev/null Tue May 5 16:32:27 1998 ++++ gconf.h Tue Oct 24 14:24:57 2000 +@@ -0,0 +1,33 @@ ++/* Eye of Gnome image viewer - preferences ++ * ++ * Copyright (C) 2000 The Free Software Foundation ++ * 2000 SuSE GmbH ++ * ++ * Authors: Federico Mena-Quintero ++ * Arik Devens ++ * Martin Baulig ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ++ */ ++ ++#ifndef GCONF_H ++#define GCONF_H ++ ++#include "image-view.h" ++#include ++ ++void image_view_add_gconf_client (ImageView *image_view, GConfClient *client); ++ ++#endif +Index: src/image-view.c +=================================================================== +RCS file: /cvs/gnome/eog/src/image-view.c,v +retrieving revision 1.35 +diff -u -u -p -r1.35 image-view.c +--- src/image-view.c 2000/09/21 23:19:26 1.35 ++++ src/image-view.c 2000/10/24 18:24:59 +@@ -25,7 +25,6 @@ + #include + #include + #include +-#include + #include "cursors.h" + #include "image-view.h" + #include "uta.h" +@@ -106,16 +105,6 @@ struct _ImageViewPrivate { + /* Scroll type */ + ScrollType scroll; + +- /* GConf client for monitoring changes to the preferences */ +- GConfClient *client; +- +- /* GConf client notify IDs */ +- guint interp_type_notify_id; +- guint check_type_notify_id; +- guint check_size_notify_id; +- guint dither_notify_id; +- guint scroll_notify_id; +- + /* Whether the image is being dragged */ + guint dragging : 1; + +@@ -129,6 +118,17 @@ enum { + LAST_SIGNAL + }; + ++enum { ++ ARG_0, ++ ARG_INTERP_TYPE, ++ ARG_CHECK_TYPE, ++ ARG_CHECK_SIZE, ++ ARG_DITHER, ++ ARG_SCROLL, ++ ARG_FULL_SCREEN_ZOOM ++}; ++ ++ + static void image_view_class_init (ImageViewClass *class); + static void image_view_init (ImageView *view); + static void image_view_destroy (GtkObject *object); +@@ -145,6 +145,9 @@ static gint image_view_button_release (G + static gint image_view_motion (GtkWidget *widget, GdkEventMotion *event); + static gint image_view_expose (GtkWidget *widget, GdkEventExpose *event); + static gint image_view_key_press (GtkWidget *widget, GdkEventKey *event); ++static void image_view_get_arg (GtkObject* obj, GtkArg* arg, guint arg_id); ++static void image_view_set_arg (GtkObject* obj, GtkArg* arg, guint arg_id); ++ + + static void image_view_set_scroll_adjustments (GtkWidget *widget, + GtkAdjustment *hadj, GtkAdjustment *vadj); +@@ -234,41 +237,70 @@ image_view_class_init (ImageViewClass *c + widget_class->motion_notify_event = image_view_motion; + widget_class->expose_event = image_view_expose; + widget_class->key_press_event = image_view_key_press; +-} + +-/* Handler for changes on the interp_type value */ +-static void +-interp_type_changed_cb (GConfClient *client, guint notify_id, GConfEntry *entry, gpointer data) +-{ +- image_view_set_interp_type (IMAGE_VIEW (data), gconf_value_get_int (entry->value)); ++ object_class->get_arg = image_view_get_arg; ++ object_class->set_arg = image_view_set_arg; + } + +-/* Handler for changes on the check_type value */ + static void +-check_type_changed_cb (GConfClient *client, guint notify_id, GConfEntry *entry, gpointer data) ++image_view_get_arg (GtkObject* obj, GtkArg* arg, guint arg_id) + { +- image_view_set_check_type (IMAGE_VIEW (data), gconf_value_get_int (entry->value)); +-} ++ ImageView *image_view = IMAGE_VIEW (obj); ++ ImageViewPrivate *priv = image_view->priv; + +-/* Handler for changes on the check_size value */ +-static void +-check_size_changed_cb (GConfClient *client, guint notify_id, GConfEntry *entry, gpointer data) +-{ +- image_view_set_check_size (IMAGE_VIEW (data), gconf_value_get_int (entry->value)); ++ switch (arg_id) { ++ case ARG_INTERP_TYPE: ++ GTK_VALUE_INT(*arg) = priv->interp_type; ++ break; ++ case ARG_CHECK_TYPE: ++ GTK_VALUE_INT(*arg) = priv->check_type; ++ break; ++ case ARG_CHECK_SIZE: ++ GTK_VALUE_INT(*arg) = priv->check_size; ++ break; ++ case ARG_DITHER: ++ GTK_VALUE_INT(*arg) = priv->dither; ++ break; ++ case ARG_SCROLL: ++ GTK_VALUE_INT(*arg) = priv->scroll; ++ break; ++ case ARG_FULL_SCREEN_ZOOM: ++ GTK_VALUE_INT(*arg) = priv->full_screen_zoom; ++ break; ++ default: ++ g_warning ("unknown arg id `%d'", arg_id); ++ break; ++ } + } + +-/* Handler for changes on the dither value */ + static void +-dither_changed_cb (GConfClient *client, guint notify_id, GConfEntry *entry, gpointer data) ++image_view_set_arg (GtkObject* obj, GtkArg* arg, guint arg_id) + { +- image_view_set_dither (IMAGE_VIEW (data), gconf_value_get_int (entry->value)); +-} ++ ImageView *image_view = IMAGE_VIEW (obj); + +-/* Handler for changes on the scroll value */ +-static void +-scroll_changed_cb (GConfClient *client, guint notify_id, GConfEntry *entry, gpointer data) +-{ +- image_view_set_scroll (IMAGE_VIEW (data), gconf_value_get_int (entry->value)); ++ switch (arg_id) { ++ case ARG_INTERP_TYPE: ++ image_view_set_interp_type (image_view, GTK_VALUE_INT(*arg)); ++ break; ++ case ARG_CHECK_TYPE: ++ image_view_set_check_type (image_view, GTK_VALUE_INT(*arg)); ++ break; ++ case ARG_CHECK_SIZE: ++ image_view_set_check_size (image_view, GTK_VALUE_INT(*arg)); ++ break; ++ case ARG_DITHER: ++ image_view_set_dither (image_view, GTK_VALUE_INT(*arg)); ++ break; ++ case ARG_SCROLL: ++ image_view_set_scroll (image_view, GTK_VALUE_INT(*arg)); ++ break; ++ case ARG_FULL_SCREEN_ZOOM: ++ image_view_set_full_screen_zoom (image_view, GTK_VALUE_INT(*arg)); ++ break; ++ default: ++ g_warning ("unknown arg id `%d'", arg_id); ++ break; ++ } + } + + /* Object initialization function for the image view */ +@@ -284,55 +316,6 @@ image_view_init (ImageView *view) + GTK_WIDGET_SET_FLAGS (view, GTK_CAN_FOCUS); + + priv->zoom = 1.0; +- +- /* Add the GConf client and notification handlers */ +- +- priv->client = gconf_client_get_default (); +- +- gconf_client_add_dir (priv->client, "/apps/eog", +- GCONF_CLIENT_PRELOAD_RECURSIVE, NULL); +- +- priv->interp_type_notify_id = gconf_client_notify_add ( +- priv->client, "/apps/eog/view/interp_type", +- interp_type_changed_cb, view, +- NULL, NULL); +- priv->check_type_notify_id = gconf_client_notify_add ( +- priv->client, "/apps/eog/view/check_type", +- check_type_changed_cb, view, +- NULL, NULL); +- priv->check_size_notify_id = gconf_client_notify_add ( +- priv->client, "/apps/eog/view/check_size", +- check_size_changed_cb, view, +- NULL, NULL); +- priv->dither_notify_id = gconf_client_notify_add ( +- priv->client, "/apps/eog/view/dither", +- dither_changed_cb, view, +- NULL, NULL); +- priv->scroll_notify_id = gconf_client_notify_add ( +- priv->client, "/apps/eog/view/scroll", +- scroll_changed_cb, view, +- NULL, NULL); +- +- /* Get the default values */ +- +- priv->interp_type = gconf_client_get_int ( +- priv->client, "/apps/eog/view/interp_type", +- NULL); +- priv->check_type = gconf_client_get_int ( +- priv->client, "/apps/eog/view/check_type", +- NULL); +- priv->check_size = gconf_client_get_int ( +- priv->client, "/apps/eog/view/check_size", +- NULL); +- priv->dither = gconf_client_get_int ( +- priv->client, "/apps/eog/view/dither", +- NULL); +- priv->scroll = gconf_client_get_int ( +- priv->client, "/apps/eog/view/scroll", +- NULL); +- priv->full_screen_zoom = gconf_client_get_int ( +- priv->client, "/apps/eog/full_screen/zoom", +- NULL); + } + + /* Frees the dirty region uta and removes the idle handler */ +@@ -378,22 +361,6 @@ image_view_destroy (GtkObject *object) + gtk_signal_disconnect_by_data (GTK_OBJECT (priv->hadj), view); + gtk_signal_disconnect_by_data (GTK_OBJECT (priv->vadj), view); + +- /* Remove notification handlers */ +- +- gconf_client_notify_remove (priv->client, priv->interp_type_notify_id); +- gconf_client_notify_remove (priv->client, priv->check_type_notify_id); +- gconf_client_notify_remove (priv->client, priv->check_size_notify_id); +- gconf_client_notify_remove (priv->client, priv->dither_notify_id); +- gconf_client_notify_remove (priv->client, priv->scroll_notify_id); +- +- priv->interp_type_notify_id = 0; +- priv->check_type_notify_id = 0; +- priv->check_size_notify_id = 0; +- priv->dither_notify_id = 0; +- priv->scroll_notify_id = 0; +- +- gconf_client_remove_dir (priv->client, "/apps/eog", NULL); +- + /* Clean up */ + + remove_dirty_region (view); +@@ -426,9 +393,6 @@ image_view_finalize (GtkObject *object) + gtk_object_unref (GTK_OBJECT (priv->vadj)); + priv->vadj = NULL; + +- gtk_object_unref (GTK_OBJECT (priv->client)); +- priv->client = NULL; +- + g_free (priv); + view->priv = NULL; + +@@ -1942,4 +1906,48 @@ image_view_get_scroll (ImageView *view) + + priv = view->priv; + return priv->scroll; ++} ++ ++/** ++ * image_view_set_full_screen_zoom: ++ * @view: An image view. ++ * @full_screen_zoom: Full screen zooming type. ++ * ++ * Sets the full screen zooming type on an image view. ++ **/ ++void ++image_view_set_full_screen_zoom (ImageView *view, FullScreenZoom full_screen_zoom) ++{ ++ ImageViewPrivate *priv; ++ ++ g_return_if_fail (view != NULL); ++ g_return_if_fail (IS_IMAGE_VIEW (view)); ++ ++ priv = view->priv; ++ ++ if (priv->full_screen_zoom == full_screen_zoom) ++ return; ++ ++ priv->full_screen_zoom = full_screen_zoom; ++ redraw_all (view); ++} ++ ++/** ++ * image_view_get_full_screen_zoom: ++ * @view: An image view. ++ * ++ * Queries the full_screen_zooming type of an image view. ++ * ++ * Return value: full screen zooming type. ++ **/ ++FullScreenZoom ++image_view_get_full_screen_zoom (ImageView *view) ++{ ++ ImageViewPrivate *priv; ++ ++ g_return_val_if_fail (view != NULL, FULL_SCREEN_ZOOM_1); ++ g_return_val_if_fail (IS_IMAGE_VIEW (view), FULL_SCREEN_ZOOM_1); ++ ++ priv = view->priv; ++ return priv->full_screen_zoom; + } +Index: src/image-view.h +=================================================================== +RCS file: /cvs/gnome/eog/src/image-view.h,v +retrieving revision 1.9 +diff -u -u -p -r1.9 image-view.h +--- src/image-view.h 2000/09/03 03:55:10 1.9 ++++ src/image-view.h 2000/10/24 18:24:59 +@@ -87,6 +87,9 @@ GdkRgbDither image_view_get_dither (Imag + void image_view_set_scroll (ImageView *view, ScrollType scroll); + ScrollType image_view_get_scroll (ImageView *view); + ++void image_view_set_full_screen_zoom (ImageView *view, FullScreenZoom full_screen_zoom); ++FullScreenZoom image_view_get_full_screen_zoom (ImageView *view); ++ + END_GNOME_DECLS + + #endif +Index: src/image.c +=================================================================== +RCS file: /cvs/gnome/eog/src/image.c,v +retrieving revision 1.7 +diff -u -u -p -r1.7 image.c +--- src/image.c 2000/08/16 20:42:08 1.7 ++++ src/image.c 2000/10/24 18:24:59 +@@ -131,3 +131,28 @@ image_load (Image *image, const char *fi + + return (image->pixbuf != NULL); + } ++ ++/** ++ * image_load_pixbuf: ++ * @image: An image structure. ++ * @pixbuf: #GdkPixbuf with the rendered image. ++ * ++ * Loads an image from a #GdkPixbuf. ++ * ++ **/ ++void ++image_load_pixbuf (Image *image, GdkPixbuf *pixbuf) ++{ ++ g_return_if_fail (image != NULL); ++ g_return_if_fail (pixbuf != NULL); ++ ++ if (image->pixbuf) ++ gdk_pixbuf_unref (image->pixbuf); ++ ++ gdk_pixbuf_ref (pixbuf); ++ image->pixbuf = pixbuf; ++ ++ if (image->filename) ++ g_free (image->filename); ++ image->filename = NULL; ++} +Index: src/image.h +=================================================================== +RCS file: /cvs/gnome/eog/src/image.h,v +retrieving revision 1.8 +diff -u -u -p -r1.8 image.h +--- src/image.h 2000/08/16 20:42:08 1.8 ++++ src/image.h 2000/10/24 18:24:59 +@@ -46,6 +46,7 @@ void image_ref (Image *image); + void image_unref (Image *image); + + gboolean image_load (Image *image, const char *filename); ++void image_load_pixbuf (Image *image, GdkPixbuf *pixbuf); + + + +Index: src/window.c +=================================================================== +RCS file: /cvs/gnome/eog/src/window.c,v +retrieving revision 1.41 +diff -u -u -p -r1.41 window.c +--- src/window.c 2000/09/21 23:19:26 1.41 ++++ src/window.c 2000/10/24 18:24:59 +@@ -31,6 +31,7 @@ + #include "util.h" + #include "window.h" + #include "zoom.h" ++#include "gconf.h" + + /* Default size for windows */ + +@@ -550,6 +551,7 @@ set_drag_dest (Window *window) + GDK_ACTION_COPY); + } + ++ + /** + * window_construct: + * @window: A window widget. +@@ -582,6 +584,7 @@ window_construct (Window *window) + gtk_widget_show (priv->ui); + + view = IMAGE_VIEW (ui_image_get_image_view (UI_IMAGE (priv->ui))); ++ image_view_add_gconf_client (view, priv->client); + + gtk_widget_grab_focus (GTK_WIDGET (view)); +