Commit ae4d6027 authored by Dave Camp's avatar Dave Camp Committed by Dave Camp

Renamed from nautilus_get_modified_bonobo_zoomable_epv and changed to

2002-01-04  Dave Camp  <dave@ximian.com>

	* components/adapter/nautilus-zoomable-proxy.c
	(nautilus_zoomable_prozy_init_epv): Renamed from
	nautilus_get_modified_bonobo_zoomable_epv and changed to
	initialize a passed in epv rather than allocating a new one.
	(nautilus_zoomable_proxy_destroy):
	(nautilus_zoomable_proxy_finalize):
	(nautilus_zoomable_proxy_class_init):
	(nautilus_zoomable_proxy_get):
	(nautilus_zoomable_proxy_get_type): Derive from BonoboObject rather
	than BonoboZoomable, as this object fully implements the Zoomable
	interface.

	* components/adapter/nautilus-adapter.c (nautilus_adapter_new):
	Replaced gtk_signal_connect_object with g_signal_connect_swapped,
	cast callbacks to G_CALLBACK, and use a weak reference rather than
	a "destroy" handler.
	(nautilus_adapter_activate_callback): Pass NULL as the opt_ev
	parameter to bonobo_control_get_remote_ui_container().

	* components/adapter/nautilus-adapter-stream-load-strategy.c
	(nautilus_adapter_stream_load_strategy_load_location): The
	bonobo-stream-vfs code was moved to the VFS moniker in gnome-vfs,
	so use it here.

	* components/adapter/nautilus-adapter-load-strategy.c
	(nautilus_adapter_load_strategy_class_init): replaced
	eel_marshal_VOID__DOUBLE with g_cclosure_marshal_VOID__DOUBLE.
	(nautilus_adapter_load_strategy_get): Disabled the progressive
	data sink code using GNOME2_CONVERSION_COMPLETE.

	* components/adapter/nautilus-adapter-factory-server.c (nautilus_adapter_factory_server_class_init):
	(nautilus_adapter_factory_server_init):
	(nautilus_adapter_factory_server_finalize):
	(adapter_object_destroyed):
	(impl_Nautilus_ComponentAdapterFactory_create_adapter):
	(nautilus_adapter_factory_server_get_type): Changed to the new
	style of deriving from BonoboObject.
	(impl_Nautilus_ComponentAdapterFactory_create_adapter): Use a weak
	reference to the adapter view rather than connecting to "destroy".

	* components/adapter/nautilus-adapter-embed-strategy.c (nautilus_adapter_embed_strategy_class_init): Fixed the argument type lists for the
	activate and open_location signals.
	(nautilus_adapter_embed_strategy_get): Disable use of the embeddable
	embed strategy using GNOME2_CONVERSION_COMPLETE.

	* components/adapter/nautilus-adapter-control-embed-strategy.c
	(nautilus_adapter_control_embed_strategy_new): Pass NULL for the
	opt_ev parameter of bonobo_control_frame_bind_to_control().

	* components/adapter/main.c (main): Replaced initialization
	functions with bonobo_ui_init, and put an #ifdef
	GNOME2_CONVERSION_COMPLETE around
	gnome_client_disable_master_connect().
	(adapter_factory_make_object): Use a weak reference rather than a
	destroy signal handler.
	(adapter_factory_object_weak_notify): Moved here from
	adapter_factory_object_destroy, use bonobo_main_quit() rather than
	gtk_main_quit().

	* components/adapter/Makefile.am: Removed
	nautilus-adapter-progressive-load-strategy.[ch], and moved
	nautilus-adapter-embeddable-embed-strategy.[ch] out of the build,
	removed bonobo-stream-vfs.[ch] replaced
	NAUTILUS_PRIVATE_CFLAGS/LIBS with COMPONENT_CFLAGS/LIBS.

	* src/nautilus-component-adapter-factory.c: Removed
	no-longer-necessary #if GNOME2_CONVERSION_COMPLETE lines.
	(activate_factory): Replaced BonoboObjectClient code with a call to
	bonobo_get_object().
parent 4ef5d92e
2002-01-04 Dave Camp <dave@ximian.com>
* components/adapter/nautilus-zoomable-proxy.c
(nautilus_zoomable_prozy_init_epv): Renamed from
nautilus_get_modified_bonobo_zoomable_epv and changed to
initialize a passed in epv rather than allocating a new one.
(nautilus_zoomable_proxy_destroy):
(nautilus_zoomable_proxy_finalize):
(nautilus_zoomable_proxy_class_init):
(nautilus_zoomable_proxy_get):
(nautilus_zoomable_proxy_get_type): Derive from BonoboObject rather
than BonoboZoomable, as this object fully implements the Zoomable
interface.
* components/adapter/nautilus-adapter.c (nautilus_adapter_new):
Replaced gtk_signal_connect_object with g_signal_connect_swapped,
cast callbacks to G_CALLBACK, and use a weak reference rather than
a "destroy" handler.
(nautilus_adapter_activate_callback): Pass NULL as the opt_ev
parameter to bonobo_control_get_remote_ui_container().
* components/adapter/nautilus-adapter-stream-load-strategy.c
(nautilus_adapter_stream_load_strategy_load_location): The
bonobo-stream-vfs code was moved to the VFS moniker in gnome-vfs,
so use it here.
* components/adapter/nautilus-adapter-load-strategy.c
(nautilus_adapter_load_strategy_class_init): replaced
eel_marshal_VOID__DOUBLE with g_cclosure_marshal_VOID__DOUBLE.
(nautilus_adapter_load_strategy_get): Disabled the progressive
data sink code using GNOME2_CONVERSION_COMPLETE.
* components/adapter/nautilus-adapter-factory-server.c (nautilus_adapter_factory_server_class_init):
(nautilus_adapter_factory_server_init):
(nautilus_adapter_factory_server_finalize):
(adapter_object_destroyed):
(impl_Nautilus_ComponentAdapterFactory_create_adapter):
(nautilus_adapter_factory_server_get_type): Changed to the new
style of deriving from BonoboObject.
(impl_Nautilus_ComponentAdapterFactory_create_adapter): Use a weak
reference to the adapter view rather than connecting to "destroy".
* components/adapter/nautilus-adapter-embed-strategy.c (nautilus_adapter_embed_strategy_class_init): Fixed the argument type lists for the
activate and open_location signals.
(nautilus_adapter_embed_strategy_get): Disable use of the embeddable
embed strategy using GNOME2_CONVERSION_COMPLETE.
* components/adapter/nautilus-adapter-control-embed-strategy.c
(nautilus_adapter_control_embed_strategy_new): Pass NULL for the
opt_ev parameter of bonobo_control_frame_bind_to_control().
* components/adapter/main.c (main): Replaced initialization
functions with bonobo_ui_init, and put an #ifdef
GNOME2_CONVERSION_COMPLETE around
gnome_client_disable_master_connect().
(adapter_factory_make_object): Use a weak reference rather than a
destroy signal handler.
(adapter_factory_object_weak_notify): Moved here from
adapter_factory_object_destroy, use bonobo_main_quit() rather than
gtk_main_quit().
* components/adapter/Makefile.am: Removed
nautilus-adapter-progressive-load-strategy.[ch], and moved
nautilus-adapter-embeddable-embed-strategy.[ch] out of the build,
removed bonobo-stream-vfs.[ch] replaced
NAUTILUS_PRIVATE_CFLAGS/LIBS with COMPONENT_CFLAGS/LIBS.
* src/nautilus-component-adapter-factory.c: Removed
no-longer-necessary #if GNOME2_CONVERSION_COMPLETE lines.
(activate_factory): Replaced BonoboObjectClient code with a call to
bonobo_get_object().
2002-01-04 Frederic Crozat <fcrozat@mandrakesoft.com>
* configure.in: Add esound cflags to CORE_CFLAGS,
......
NULL=
SUBDIRS = \
adapter \
history \
image-viewer \
music \
......@@ -12,7 +13,6 @@ SUBDIRS = \
$(NULL)
XXX=
adapter \
hardware \
loser \
text \
......
......@@ -4,7 +4,7 @@ INCLUDES = \
-DG_LOG_DOMAIN=\"Nautilus-Adapter\" \
-DICON_DIR=\"$(datadir)/pixmaps/nautilus\" \
-I$(top_srcdir) \
$(NAUTILUS_PRIVATE_CFLAGS) \
$(COMPONENT_CFLAGS) \
$(NULL)
serverdir = $(libdir)/bonobo/servers
......@@ -22,15 +22,11 @@ bin_PROGRAMS = \
nautilus_adapter_SOURCES = \
main.c \
bonobo-stream-vfs.c \
bonobo-stream-vfs.h \
nautilus-adapter-control-embed-strategy.c \
nautilus-adapter-control-embed-strategy.h \
nautilus-adapter-embed-strategy-private.h \
nautilus-adapter-embed-strategy.c \
nautilus-adapter-embed-strategy.h \
nautilus-adapter-embeddable-embed-strategy.c \
nautilus-adapter-embeddable-embed-strategy.h \
nautilus-adapter-factory-server.c \
nautilus-adapter-factory-server.h \
nautilus-adapter-file-load-strategy.c \
......@@ -38,8 +34,6 @@ nautilus_adapter_SOURCES = \
nautilus-adapter-load-strategy.c \
nautilus-adapter-load-strategy.h \
nautilus-adapter-load-strategy.h \
nautilus-adapter-progressive-load-strategy.c \
nautilus-adapter-progressive-load-strategy.h \
nautilus-adapter-stream-load-strategy.c \
nautilus-adapter-stream-load-strategy.h \
nautilus-zoomable-proxy.c \
......@@ -48,11 +42,15 @@ nautilus_adapter_SOURCES = \
nautilus-adapter.h \
$(NULL)
XXX = \
nautilus-adapter-embeddable-embed-strategy.c \
nautilus-adapter-embeddable-embed-strategy.h \
$(NULL)
nautilus_adapter_LDADD = \
$(top_builddir)/libnautilus/libnautilus.la \
$(top_builddir)/libnautilus-adapter/libnautilus-adapter.la \
$(NAUTILUS_PRIVATE_LIBS) \
$(COMPONENT_LIBS) \
$(NULL)
EXTRA_DIST = $(server_in_files) $(server_DATA)
......@@ -29,8 +29,9 @@
#include <libgnome/gnome-init.h> /* must come before liboaf.h */
#include "nautilus-adapter-factory-server.h"
#include <bonobo/bonobo-generic-factory.h>
#include <bonobo/bonobo-main.h>
#include <bonobo/bonobo-ui-main.h>
#include <bonobo/bonobo-generic-factory.h>
#include <gtk/gtkmain.h>
#include <gtk/gtksignal.h>
#include <libgnomevfs/gnome-vfs-init.h>
......@@ -38,19 +39,19 @@
#include <bonobo-activation/bonobo-activation.h>
#include <stdlib.h>
#include <string.h>
#define META_FACTORY_IID "OAFIID:nautilus_adapter_factory_generic_factory:8e62e106-807d-4d37-b14a-00dc82ecf88f"
#define FACTORY_OBJECT_IID "OAFIID:nautilus_adapter_factory:fd24ecfc-0a6e-47ab-bc53-69d7487c6ad4"
static int object_count = 0;
static void
adapter_factory_object_destroyed (GtkObject *object)
adapter_factory_object_weak_notify (gpointer data, GObject *object)
{
g_assert (GTK_IS_OBJECT (object));
object_count--;
if (object_count <= 0) {
gtk_main_quit ();
bonobo_main_quit ();
}
}
......@@ -78,8 +79,9 @@ adapter_factory_make_object (BonoboGenericFactory *factory,
* when there are no more objects outstanding.
*/
object_count++;
g_signal_connect (adapter, "destroy",
adapter_factory_object_destroyed, NULL);
g_object_weak_ref (G_OBJECT (adapter),
adapter_factory_object_weak_notify,
NULL);
return BONOBO_OBJECT (adapter);
}
......@@ -87,7 +89,6 @@ adapter_factory_make_object (BonoboGenericFactory *factory,
int
main (int argc, char *argv[])
{
CORBA_ORB orb;
BonoboGenericFactory *factory;
char *registration_id;
......@@ -95,24 +96,20 @@ main (int argc, char *argv[])
eel_make_warnings_and_criticals_stop_in_debugger ();
}
#ifdef GNOME2_CONVERSION_COMPLETE
/* Disable session manager connection */
gnome_client_disable_master_connection ();
#endif
gnomelib_register_popt_table (bonobo_activation_popt_options, bonobo_activation_get_popt_table_name ());
orb = bonobo_activation_init (argc, argv);
/* Initialize libraries. */
gnome_init ("nautilus-adapter", VERSION,
argc, argv);
g_thread_init (NULL);
gnome_vfs_init ();
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
if (!bonobo_ui_init ("nautilus-adapter", VERSION, &argc, argv)) {
g_error (_("bonobo_ui_init() failed."));
}
/* Create the factory. */
registration_id = bonobo_activation_make_registration_id (META_FACTORY_IID, g_getenv ("DISPLAY"));
factory = bonobo_generic_factory_new_multi (registration_id, adapter_factory_make_object, NULL);
factory = bonobo_generic_factory_new (registration_id, adapter_factory_make_object, NULL);
g_free (registration_id);
......
......@@ -38,6 +38,7 @@
#include <gtk/gtksignal.h>
#include <eel/eel-gtk-macros.h>
#include <bonobo/bonobo-control.h>
#include <bonobo/bonobo-control-frame.h>
struct NautilusAdapterControlEmbedStrategyDetails {
......@@ -162,7 +163,7 @@ nautilus_adapter_control_embed_strategy_new (Bonobo_Control control,
strategy->details->control_frame = bonobo_control_frame_new (ui_container);
bonobo_control_frame_bind_to_control (strategy->details->control_frame, control);
bonobo_control_frame_bind_to_control (strategy->details->control_frame, control, NULL);
strategy->details->widget = bonobo_control_frame_get_widget (strategy->details->control_frame);
......
......@@ -72,7 +72,7 @@ nautilus_adapter_embed_strategy_class_init (NautilusAdapterEmbedStrategyClass *k
G_STRUCT_OFFSET (NautilusAdapterEmbedStrategyClass, activate),
NULL, NULL,
gtk_marshal_VOID__POINTER,
G_TYPE_POINTER, 0);
G_TYPE_NONE, 1, G_TYPE_POINTER);
signals[DEACTIVATE] =
g_signal_new ("deactivate",
G_TYPE_FROM_CLASS (object_class),
......@@ -88,7 +88,7 @@ nautilus_adapter_embed_strategy_class_init (NautilusAdapterEmbedStrategyClass *k
G_STRUCT_OFFSET (NautilusAdapterEmbedStrategyClass, open_location),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_STRING, 0);
G_TYPE_NONE, 1, G_TYPE_STRING);
EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, nautilus_adapter_embed_strategy, get_widget);
EEL_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, nautilus_adapter_embed_strategy, get_zoomable);
......@@ -103,7 +103,9 @@ NautilusAdapterEmbedStrategy *
nautilus_adapter_embed_strategy_get (Bonobo_Unknown component)
{
Bonobo_Control control;
#if GNOME2_CONVERSION_COMPLETE
Bonobo_Embeddable embeddable;
#endif
CORBA_Environment ev;
NautilusAdapterEmbedStrategy *strategy;
......@@ -119,6 +121,7 @@ nautilus_adapter_embed_strategy_get (Bonobo_Unknown component)
bonobo_object_release_unref (control, NULL);
}
#if GNOME2_CONVERSION_COMPLETE
if (strategy != NULL) {
embeddable = Bonobo_Unknown_queryInterface
(component, "IDL:Bonobo/Embeddable:1.0", &ev);
......@@ -128,6 +131,7 @@ nautilus_adapter_embed_strategy_get (Bonobo_Unknown component)
bonobo_object_release_unref (embeddable, NULL);
}
}
#endif
CORBA_exception_free (&ev);
......
......@@ -44,34 +44,27 @@ impl_Nautilus_ComponentAdapterFactory_create_adapter (PortableServer_Servant
const Bonobo_Unknown component,
CORBA_Environment *ev);
static void
impl_Nautilus_ComponentAdapterFactory__destroy (BonoboObject *object,
PortableServer_Servant servant);
static Nautilus_ComponentAdapterFactory
impl_Nautilus_ComponentAdapterFactory__create (NautilusAdapterFactoryServer *bonobo_object,
CORBA_Environment *ev);
static void nautilus_adapter_factory_server_class_init (NautilusAdapterFactoryServerClass *klass);
static void nautilus_adapter_factory_server_init (NautilusAdapterFactoryServer *server);
static void nautilus_adapter_factory_server_destroy (GtkObject *object);
static void nautilus_adapter_factory_server_finalize (GObject *object);
static BonoboObjectClass *parent_class;
EEL_CLASS_BOILERPLATE (NautilusAdapterFactoryServer,
nautilus_adapter_factory_server,
BONOBO_OBJECT_TYPE)
static void
nautilus_adapter_factory_server_class_init (NautilusAdapterFactoryServerClass *klass)
{
GtkObjectClass *object_class;
GObjectClass *object_class;
POA_Nautilus_ComponentAdapterFactory__epv *epv = &klass->epv;
g_assert (NAUTILUS_IS_ADAPTER_FACTORY_SERVER_CLASS (klass));
object_class = GTK_OBJECT_CLASS (klass);
object_class->destroy = nautilus_adapter_factory_server_destroy;
parent_class = g_type_class_peek_parent (klass);
epv->create_adapter = impl_Nautilus_ComponentAdapterFactory_create_adapter;
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = nautilus_adapter_factory_server_finalize;
}
static void
......@@ -83,21 +76,18 @@ nautilus_adapter_factory_server_init (NautilusAdapterFactoryServer *server)
g_assert (NAUTILUS_IS_ADAPTER_FACTORY_SERVER (server));
bonobo_object_construct
(BONOBO_OBJECT (server),
impl_Nautilus_ComponentAdapterFactory__create (server, &ev));
CORBA_exception_free (&ev);
}
static void
nautilus_adapter_factory_server_destroy (GtkObject *object)
nautilus_adapter_factory_server_finalize (GObject *object)
{
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
static void
adapter_object_destroyed (GtkObject *adapter, NautilusAdapterFactoryServer *server)
adapter_object_weak_notify (gpointer server,
GObject *adapter)
{
bonobo_object_unref (BONOBO_OBJECT (server));
}
......@@ -108,65 +98,55 @@ impl_Nautilus_ComponentAdapterFactory_create_adapter (PortableServer_Servant se
const Bonobo_Unknown component,
CORBA_Environment *ev)
{
impl_POA_Nautilus_ComponentAdapterFactory *factory_servant;
NautilusAdapterFactoryServer *factory_servant;
NautilusAdapter *adapter;
NautilusView *adapter_view;
factory_servant = (impl_POA_Nautilus_ComponentAdapterFactory *) servant;
factory_servant = NAUTILUS_ADAPTER_FACTORY_SERVER (bonobo_object (servant));
adapter = nautilus_adapter_new (component);
if (adapter == NULL) {
return CORBA_OBJECT_NIL;
} else {
bonobo_object_ref (BONOBO_OBJECT (factory_servant->bonobo_object));
bonobo_object_ref (BONOBO_OBJECT (factory_servant));
adapter_view = nautilus_adapter_get_nautilus_view (adapter);
g_object_weak_ref (G_OBJECT (adapter_view),
adapter_object_weak_notify,
factory_servant);
g_signal_connect (adapter_view, "destroy",
adapter_object_destroyed, factory_servant->bonobo_object);
return CORBA_Object_duplicate
(bonobo_object_corba_objref (BONOBO_OBJECT (adapter_view)), ev);
return CORBA_Object_duplicate (BONOBO_OBJREF (adapter_view),
ev);
}
}
static void
impl_Nautilus_ComponentAdapterFactory__destroy (BonoboObject *object,
PortableServer_Servant servant)
GType
nautilus_adapter_factory_server_get_type (void)
{
PortableServer_ObjectId *object_id;
CORBA_Environment ev;
CORBA_exception_init (&ev);
static GType type = 0;
object_id = PortableServer_POA_servant_to_id (bonobo_poa (), servant, &ev);
PortableServer_POA_deactivate_object (bonobo_poa (), object_id, &ev);
CORBA_free (object_id);
object->servant = NULL;
if (!type) {
GTypeInfo info = {
sizeof (NautilusAdapterFactoryServerClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc)nautilus_adapter_factory_server_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (NautilusAdapterFactoryServer),
0, /* n_preallocs */
(GInstanceInitFunc)nautilus_adapter_factory_server_init
};
type = bonobo_type_unique
(BONOBO_OBJECT_TYPE,
POA_Nautilus_ComponentAdapterFactory__init, NULL,
G_STRUCT_OFFSET (NautilusAdapterFactoryServerClass,
epv),
&info, "NautilusAdapterFactoryServer");
}
POA_Nautilus_ComponentAdapterFactory__fini (servant, &ev);
g_free (servant);
CORBA_exception_free (&ev);
return type;
}
static Nautilus_ComponentAdapterFactory
impl_Nautilus_ComponentAdapterFactory__create (NautilusAdapterFactoryServer *bonobo_object,
CORBA_Environment *ev)
{
impl_POA_Nautilus_ComponentAdapterFactory *servant;
impl_Nautilus_ComponentAdapterFactory_vepv.Bonobo_Unknown_epv = nautilus_bonobo_object_get_epv ();
servant = g_new0 (impl_POA_Nautilus_ComponentAdapterFactory, 1);
servant->servant.vepv = &impl_Nautilus_ComponentAdapterFactory_vepv;
POA_Nautilus_ComponentAdapterFactory__init ((PortableServer_Servant) servant, ev);
g_signal_connect (bonobo_object, "destroy",
G_CALLBACK (impl_Nautilus_ComponentAdapterFactory__destroy), servant);
servant->bonobo_object = bonobo_object;
return bonobo_object_activate_servant (BONOBO_OBJECT (bonobo_object), servant);
}
......@@ -28,14 +28,15 @@
#ifndef NAUTILUS_ADAPTER_FACTORY_SERVER_H
#define NAUTILUS_ADAPTER_FACTORY_SERVER_H
#include <libnautilus-adapter/nautilus-adapter-factory.h>
#include <gtk/gtklabel.h>
#include <libnautilus/nautilus-view.h>
#define NAUTILUS_TYPE_ADAPTER_FACTORY_SERVER (nautilus_adapter_factory_server_get_type ())
#define NAUTILUS_ADAPTER_FACTORY_SERVER(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_ADAPTER_FACTORY_SERVER, NautilusAdapterFactoryServer))
#define NAUTILUS_ADAPTER_FACTORY_SERVER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_ADAPTER_FACTORY_SERVER, NautilusAdapterFactoryServerClass))
#define NAUTILUS_IS_ADAPTER_FACTORY_SERVER(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_ADAPTER_FACTORY_SERVER))
#define NAUTILUS_IS_ADAPTER_FACTORY_SERVER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_ADAPTER_FACTORY_SERVER))
#define NAUTILUS_ADAPTER_FACTORY_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_ADAPTER_FACTORY_SERVER, NautilusAdapterFactoryServer))
#define NAUTILUS_ADAPTER_FACTORY_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_ADAPTER_FACTORY_SERVER, NautilusAdapterFactoryServerClass))
#define NAUTILUS_IS_ADAPTER_FACTORY_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_ADAPTER_FACTORY_SERVER))
#define NAUTILUS_IS_ADAPTER_FACTORY_SERVER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_ADAPTER_FACTORY_SERVER))
typedef struct {
BonoboObject parent;
......@@ -43,10 +44,12 @@ typedef struct {
typedef struct {
BonoboObjectClass parent;
POA_Nautilus_ComponentAdapterFactory__epv epv;
} NautilusAdapterFactoryServerClass;
/* GtkObject support */
GtkType nautilus_adapter_factory_server_get_type (void);
/* GObject support */
GType nautilus_adapter_factory_server_get_type (void);
#endif /* NAUTILUS_ADAPTER_FACTORY_SERVER_H */
......@@ -33,7 +33,9 @@
#include "nautilus-adapter-load-strategy.h"
#include "nautilus-adapter-stream-load-strategy.h"
#include "nautilus-adapter-file-load-strategy.h"
#if GNOME2_CONVERSION_COMPLETE
#include "nautilus-adapter-progressive-load-strategy.h"
#endif
#include <gtk/gtkobject.h>
#include <eel/eel-gtk-macros.h>
......@@ -89,7 +91,7 @@ nautilus_adapter_load_strategy_class_init (NautilusAdapterLoadStrategyClass *kla
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusAdapterLoadStrategyClass, report_load_progress),
NULL, NULL,
eel_marshal_VOID__DOUBLE,
g_cclosure_marshal_VOID__DOUBLE,
G_TYPE_NONE, 1, G_TYPE_DOUBLE);
signals[REPORT_LOAD_COMPLETE] =
g_signal_new ("report_load_complete",
......@@ -133,11 +135,14 @@ nautilus_adapter_load_strategy_get (Bonobo_Unknown component)
{
Bonobo_PersistStream persist_stream;
Bonobo_PersistFile persist_file;
#if GNOME2_CONVERSION_COMPLETE
Bonobo_ProgressiveDataSink progressive_data_sink;
#endif
CORBA_Environment ev;
CORBA_exception_init (&ev);
#if GNOME2_CONVERSION_COMPLETE
progressive_data_sink = Bonobo_Unknown_queryInterface (component,
"IDL:Bonobo/ProgressiveDataSink:1.0", &ev);
......@@ -148,7 +153,7 @@ nautilus_adapter_load_strategy_get (Bonobo_Unknown component)
return nautilus_adapter_progressive_load_strategy_new (progressive_data_sink);
}
#endif
persist_stream = Bonobo_Unknown_queryInterface (component,
"IDL:Bonobo/PersistStream:1.0", &ev);
......
......@@ -31,8 +31,10 @@
#include <config.h>
#include "nautilus-adapter-stream-load-strategy.h"
#include "bonobo-stream-vfs.h"
#include <bonobo/bonobo-stream.h>
#include <bonobo/bonobo-moniker-util.h>
#include <bonobo/bonobo-exception.h>
#include <gtk/gtkobject.h>
#include <eel/eel-gtk-macros.h>
#include <libnautilus/nautilus-view.h>
......@@ -117,8 +119,9 @@ nautilus_adapter_stream_load_strategy_load_location (NautilusAdapterLoadStrategy
const char *uri)
{
NautilusAdapterStreamLoadStrategy *strategy;
BonoboStream *stream;
Bonobo_Stream stream;
CORBA_Environment ev;
char *moniker_str;
strategy = NAUTILUS_ADAPTER_STREAM_LOAD_STRATEGY (abstract_strategy);
g_object_ref (strategy);
......@@ -127,9 +130,11 @@ nautilus_adapter_stream_load_strategy_load_location (NautilusAdapterLoadStrategy
nautilus_adapter_load_strategy_report_load_underway (abstract_strategy);
stream = bonobo_stream_vfs_open (uri, Bonobo_Storage_READ);
moniker_str = g_strconcat ("vfs:", uri, NULL);
stream = bonobo_get_object (moniker_str, "IDL:Bonobo/Stream:1.0", &ev);
g_free (moniker_str);
if (stream == NULL) {
if (BONOBO_EX (&ev) || CORBA_Object_is_nil (stream, &ev)) {
nautilus_adapter_load_strategy_report_load_failed (abstract_strategy);
} else {
/* FIXME bugzilla.gnome.org 41248:
......@@ -143,11 +148,11 @@ nautilus_adapter_stream_load_strategy_load_location (NautilusAdapterLoadStrategy
Bonobo_PersistStream_load
(strategy->details->persist_stream,
bonobo_object_corba_objref (BONOBO_OBJECT (stream)),
stream,
"", /* MIME type of stream */
&ev);
bonobo_object_unref (BONOBO_OBJECT (stream));
bonobo_object_release_unref (stream, &ev);
if (ev._major == CORBA_NO_EXCEPTION) {
nautilus_adapter_load_strategy_report_load_complete (abstract_strategy);
......
......@@ -33,7 +33,6 @@
#include "nautilus-adapter-load-strategy.h"
#include <bonobo/bonobo-control.h>
#include <bonobo/bonobo-item-container.h>
#include <bonobo/bonobo-view-frame.h>
#include <eel/eel-generous-bin.h>
#include <eel/eel-gtk-macros.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
......@@ -152,11 +151,8 @@ nautilus_adapter_new (Bonobo_Unknown component)
control = bonobo_control_new (bin);
adapter->details->nautilus_view = nautilus_view_new_from_bonobo_control (control);
g_signal_connect_closure (
G_OBJECT (adapter->details->nautilus_view),
"destroy", g_cclosure_new_swap (
G_CALLBACK (g_object_unref),
G_OBJECT (adapter), NULL), 0);
g_object_weak_ref (G_OBJECT (adapter->details->nautilus_view),
(GWeakNotify)g_object_unref, adapter);
/* Get the class to handle embedding this kind of component. */
adapter->details->embed_strategy = nautilus_adapter_embed_strategy_get (component);
......@@ -175,7 +171,8 @@ nautilus_adapter_new (Bonobo_Unknown component)
adapter);
g_signal_connect (adapter->details->embed_strategy, "open_location",
nautilus_adapter_open_location_callback, adapter);
G_CALLBACK (nautilus_adapter_open_location_callback),
adapter);
/* Get the class to handle loading this kind of component. */
......@@ -187,25 +184,25 @@ nautilus_adapter_new (Bonobo_Unknown component)
/* hook up load strategy signals */
adapter->details->report_load_underway_id =
gtk_signal_connect_object (GTK_OBJECT (adapter->details->load_strategy),
"report_load_underway",
nautilus_adapter_load_underway_callback,
GTK_OBJECT (adapter));
g_signal_connect_swapped (GTK_OBJECT (adapter->details->load_strategy),
"report_load_underway",
G_CALLBACK (nautilus_adapter_load_underway_callback),
GTK_OBJECT (adapter));
adapter->details->report_load_progress_id =
gtk_signal_connect_object (GTK_OBJECT (adapter->details->load_strategy),
"report_load_progress",
nautilus_adapter_load_progress_callback,
GTK_OBJECT (adapter));
g_signal_connect_swapped (GTK_OBJECT (adapter->details->load_strategy),
"report_load_progress",
G_CALLBACK (nautilus_adapter_load_progress_callback),
GTK_OBJECT (adapter));
adapter->details->report_load_complete_id =
gtk_signal_connect_object (GTK_OBJECT (adapter->details->load_strategy),
"report_load_complete",
nautilus_adapter_load_complete_callback,
GTK_OBJECT (adapter));
g_signal_connect_swapped (GTK_OBJECT (adapter->details->load_strategy),
"report_load_complete",
G_CALLBACK (nautilus_adapter_load_complete_callback),
GTK_OBJECT (adapter));
adapter->details->report_load_failed_id =
gtk_signal_connect_object (GTK_OBJECT (adapter->details->load_strategy),
"report_load_failed",
nautilus_adapter_load_failed_callback,
GTK_OBJECT (adapter));
g_signal_connect_swapped (GTK_OBJECT (adapter->details->load_strategy),
"report_load_failed",
G_CALLBACK (nautilus_adapter_load_failed_callback),
GTK_OBJECT (adapter));
/* complete the embedding */
gtk_container_add (GTK_CONTAINER (bin),
......@@ -213,13 +210,13 @@ nautilus_adapter_new (Bonobo_Unknown component)
/* hook up view signals. */
g_signal_connect (adapter->details->nautilus_view,
"load_location",
nautilus_adapter_load_location_callback,
adapter);
"load_location",
G_CALLBACK (nautilus_adapter_load_location_callback),
adapter);
g_signal_connect (adapter->details->nautilus_view,
"stop_loading",
nautilus_adapter_stop_loading_callback,
adapter);
"stop_loading",
G_CALLBACK (nautilus_adapter_stop_loading_callback),
adapter);
return adapter;
}
......@@ -271,7 +268,7 @@ nautilus_adapter_activate_callback (BonoboControl *control,
if (state) {
Bonobo_UIContainer corba_container;
corba_container = bonobo_control_get_remote_ui_container (control);
corba_container = bonobo_control_get_remote_ui_container (control, NULL);
nautilus_adapter_embed_strategy_activate (adapter->details->embed_strategy,
corba_container);
} else
......
......@@ -27,21 +27,12 @@
#undef ZOOMABLE_DEBUG
static BonoboZoomableClass *nautilus_zoomable_proxy_parent_class;
static NautilusZoomableProxyClass *nautilus_zoomable_proxy_class;
static BonoboObjectClass *nautilus_zoomable_proxy_parent_class;
struct _NautilusZoomableProxyPrivate {
Bonobo_Zoomable remote_zoomable;
};
typedef struct {
POA_Bonobo_Zoomable servant;
NautilusZoomableProxy *gtk_object;
} impl_POA_Bonobo_Zoomable;
static POA_Bonobo_Zoomable__vepv nautilus_zoomable_proxy_vepv;
static inline NautilusZoomableProxy *
nautilus_zoomable_proxy_from_servant (PortableServer_Servant servant)
{
......@@ -195,13 +186,9 @@ impl_Nautilus_ZoomableProxy_setFrame (PortableServer_Servant servant,
}
static POA_Bonobo_Zoomable__epv *
nautilus_get_modified_bonobo_zoomable_epv (void)
static void
nautilus_zoomable_proxy_init_epv (POA_Bonobo_Zoomable__epv *epv)
{
POA_Bonobo_Zoomable__epv *epv;
epv = g_new0 (POA_Bonobo_Zoomable__epv, 1);
epv->_get_level = impl_Nautilus_ZoomableProxy__get_level;
epv->_get_minLevel = impl_Nautilus_ZoomableProxy__get_minLevel;
epv->_get_maxLevel = impl_Nautilus_ZoomableProxy__get_maxLevel;
......@@ -218,21 +205,10 @@ nautilus_get_modified_bonobo_zoomable_epv (void)
epv->setLevel = impl_Nautilus_ZoomableProxy_setLevel;
epv->setFrame = impl_Nautilus_ZoomableProxy_setFrame;
return epv;
}
static void
init_zoomable_proxy_corba_class (void)
{
/* The VEPV */
nautilus_zoomable_proxy_vepv.Bonobo_Unknown_epv = bonobo_object_get_epv ();