summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2002-01-24 21:52:34 +0000
committerDarin Adler <darin@src.gnome.org>2002-01-24 21:52:34 +0000
commit5db444dcb41a76284531525d6d414955c2a0232d (patch)
tree7a2ad259953ec7b9d21fffffb6b41150c334f750 /components
parent85f29cd7a728c97d9cbde48709d93bae0363a181 (diff)
downloadnautilus-5db444dcb41a76284531525d6d414955c2a0232d.tar.gz
GNOME2_CONVERSION_COMPLETE eradication campaign
* components/hardware/nautilus-hardware-view.c: (nautilus_hardware_view_init): Re-enable the property bag. * components/image-viewer/Makefile.am: Remove io-png.[ch]. * components/image-viewer/io-png.c: Remove. * components/image-viewer/io-png.h: Remove. * components/image-viewer/nautilus-image-view.c: (save_image_to_stream): Not implemented. * libnautilus-private/nautilus-directory-metafile.c: (nautilus_directory_register_metadata_monitor), (nautilus_directory_unregister_metadata_monitor): Wipe out some bonobo_object_corba_objref calls. * src/nautilus-window.h: Make the throbber private. * src/nautilus-window-private.h: Make the throbber private. Use a listener object now, not a listener ID. * src/nautilus-window-toolbars.c: (nautilus_window_initialize_toolbars): Move the throbber into details. * src/nautilus-window.c: (nautilus_window_constructed), (nautilus_window_unrealize): Use the new listener calls that use an object, not an ID. (nautilus_window_allow_stop): Move the throbber into details.
Diffstat (limited to 'components')
-rw-r--r--components/hardware/nautilus-hardware-view.c16
-rw-r--r--components/image-viewer/Makefile.am5
-rw-r--r--components/image-viewer/io-png.c126
-rw-r--r--components/image-viewer/io-png.h11
-rw-r--r--components/image-viewer/nautilus-image-view.c10
5 files changed, 9 insertions, 159 deletions
diff --git a/components/hardware/nautilus-hardware-view.c b/components/hardware/nautilus-hardware-view.c
index d26685818..a6c19466b 100644
--- a/components/hardware/nautilus-hardware-view.c
+++ b/components/hardware/nautilus-hardware-view.c
@@ -153,16 +153,15 @@ static void
nautilus_hardware_view_init (NautilusHardwareView *hardware_view)
{
EelBackground *background;
+
hardware_view->details = g_new0 (NautilusHardwareViewDetails, 1);
hardware_view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (hardware_view));
g_signal_connect (hardware_view->details->nautilus_view,
- "load_location",
- G_CALLBACK (hardware_view_load_location_callback),
- hardware_view);
-
- hardware_view->details->form = NULL;
+ "load_location",
+ G_CALLBACK (hardware_view_load_location_callback),
+ hardware_view);
background = eel_get_widget_background (GTK_WIDGET (hardware_view));
eel_background_set_color (background, HARDWARE_DEFAULT_BACKGROUND_COLOR);
@@ -173,14 +172,13 @@ nautilus_hardware_view_init (NautilusHardwareView *hardware_view)
hardware_dnd_target_table, G_N_ELEMENTS (hardware_dnd_target_table), GDK_ACTION_COPY);
/* allocate a property bag to specify the name of the icon for this component */
- hardware_view->details->property_bag = bonobo_property_bag_new (get_bonobo_properties, set_bonobo_properties, hardware_view);
-#ifdef GNOME2_CONVERSION_COMPLETE
- bonobo_control_set_properties (nautilus_view_get_bonobo_control (hardware_view->details->nautilus_view), hardware_view->details->property_bag);
-#endif
+ hardware_view->details->property_bag = bonobo_property_bag_new (get_bonobo_properties, set_bonobo_properties, hardware_view);
bonobo_property_bag_add (hardware_view->details->property_bag, "icon_name", ICON_NAME, BONOBO_ARG_STRING, NULL,
_("name of icon for the hardware view"), 0);
bonobo_property_bag_add (hardware_view->details->property_bag, "summary_info", COMPONENT_INFO, BONOBO_ARG_STRING, NULL,
_("summary of hardware info"), 0);
+ bonobo_control_set_properties (nautilus_view_get_bonobo_control (hardware_view->details->nautilus_view),
+ BONOBO_OBJREF (hardware_view->details->property_bag), NULL);
/* add the timer task to update the uptime */
hardware_view->details->timer_task = gtk_timeout_add (60000, update_uptime_text, hardware_view);
diff --git a/components/image-viewer/Makefile.am b/components/image-viewer/Makefile.am
index 2a65c6c9d..17457f5f2 100644
--- a/components/image-viewer/Makefile.am
+++ b/components/image-viewer/Makefile.am
@@ -2,10 +2,7 @@ NULL =
bin_PROGRAMS = nautilus-image-view
-nautilus_image_view_SOURCES = \
- nautilus-image-view.c \
- io-png.c \
- io-png.h
+nautilus_image_view_SOURCES = nautilus-image-view.c
INCLUDES = \
-I$(top_srcdir) \
diff --git a/components/image-viewer/io-png.c b/components/image-viewer/io-png.c
deleted file mode 100644
index aa492fd40..000000000
--- a/components/image-viewer/io-png.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * io-png.c by David Welton <davidw@linuxcare.com>. Most of the code
- * borrowed from Imlib, Bonobo Stream API by Michael Meeks <mmeeks@gnu.org>
- */
-
-#include <config.h>
-#include "io-png.h"
-
-#include <bonobo/bonobo-stream-client.h>
-#include <png.h>
-
-typedef struct {
- Bonobo_Stream stream;
- CORBA_Environment *ev;
-} BStreamData;
-
-#ifdef GNOME2_CONVERSION_COMPLETE
-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");
-}
-#endif
-
-void
-image_save (Bonobo_Stream stream, GdkPixbuf *pixbuf,
- CORBA_Environment *ev)
-{
- g_warning ("Save image unimplemented");
-#ifdef GNOME2_CONVERSION_COMPLETE
- /* Use Eog */
-
- png_structp png_ptr;
- png_infop info_ptr;
- guint8 *ptr;
- int x, y, j;
- png_bytep row_ptr;
- volatile png_bytep data = NULL;
- png_color_8 sig_bit;
- int w, h, rowstride;
- int has_alpha;
- int bpc;
- BStreamData sdata;
-
- bpc = gdk_pixbuf_get_bits_per_sample (pixbuf);
- w = gdk_pixbuf_get_width (pixbuf);
- h = gdk_pixbuf_get_height (pixbuf);
- rowstride = gdk_pixbuf_get_rowstride (pixbuf);
- has_alpha = gdk_pixbuf_get_has_alpha (pixbuf);
-
- png_ptr = png_create_write_struct (PNG_LIBPNG_VER_STRING,
- NULL, NULL, NULL);
- if (!png_ptr)
- goto png_err;
-
- sdata.stream = stream;
- sdata.ev = ev;
- png_set_write_fn (png_ptr, &sdata, png_write_data_fn, png_flush_fn);
-
- info_ptr = png_create_info_struct (png_ptr);
- if (!info_ptr ||
- setjmp (png_ptr->jmpbuf)) {
- png_destroy_write_struct (&png_ptr, (png_infopp) NULL);
- goto png_err;
- }
-
- if (has_alpha) {
- png_set_IHDR (png_ptr, info_ptr, w, h, bpc,
- PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE,
- PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
-#ifdef WORDS_BIGENDIAN
- png_set_swap_alpha (png_ptr);
-#else
- png_set_bgr (png_ptr);
-#endif
- } else {
- png_set_IHDR (png_ptr, info_ptr, w, h, bpc,
- PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
- PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
- data = g_malloc (w * 3 * sizeof(char));
- }
- sig_bit.red = bpc;
- sig_bit.green = bpc;
- sig_bit.blue = bpc;
- sig_bit.alpha = bpc;
- 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);
-
- ptr = gdk_pixbuf_get_pixels (pixbuf);
- for (y = 0; y < h; y++) {
- if (has_alpha)
- row_ptr = (png_bytep)ptr;
- else {
- for (j = 0, x = 0; x < w; x++)
- memcpy (&(data [x * 3]), &(ptr [x * 3]), 3);
-
- row_ptr = (png_bytep)data;
- }
- png_write_rows (png_ptr, &row_ptr, 1);
- ptr += rowstride;
- }
- g_free (data);
- png_write_end (png_ptr, info_ptr);
- png_destroy_write_struct (&png_ptr, (png_infopp) NULL);
- return;
-
- png_err:
- g_free (data);
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_Bonobo_Stream_IOError, NULL);
-#endif
- return;
-}
diff --git a/components/image-viewer/io-png.h b/components/image-viewer/io-png.h
deleted file mode 100644
index 1d076d4db..000000000
--- a/components/image-viewer/io-png.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef IO_PNG_H
-#define IO_PNG_H
-
-#include <bonobo/Bonobo.h>
-#include <gdk-pixbuf/gdk-pixbuf.h>
-
-void image_save (Bonobo_Stream stream,
- GdkPixbuf *pixbuf,
- CORBA_Environment *ev);
-
-#endif /* IO_PNG_H */
diff --git a/components/image-viewer/nautilus-image-view.c b/components/image-viewer/nautilus-image-view.c
index 7e093c70b..2574f98e5 100644
--- a/components/image-viewer/nautilus-image-view.c
+++ b/components/image-viewer/nautilus-image-view.c
@@ -35,8 +35,6 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk-pixbuf/gdk-pixbuf-loader.h>
-#include "io-png.h"
-
#define LOAD_BUFFER_SIZE 65536
/*
@@ -449,13 +447,7 @@ save_image_to_stream (BonoboPersistStream *ps, Bonobo_Stream stream,
Bonobo_Persist_ContentType type, void *data,
CORBA_Environment *ev)
{
- bonobo_object_data_t *bod = data;
-
- if (bod->pixbuf == NULL) {
- return;
- }
-
- image_save (stream, bod->pixbuf, ev);
+ g_warning ("save not implemented");
}
/*