Commit 9ab32f9c authored by Darin Adler's avatar Darin Adler
Browse files

More changes to make Nautilus get closer to running.

	* libnautilus-private/nautilus-bonobo-extensions.h: Remove
	NAUTILUS_BONOBO_X_BOILERPLATE, superceded by EEL_DEFINE_
	BONOBO_BOILERPLATE

	* libnautilus-private/nautilus-directory-metafile-monitor.c:
	* libnautilus-private/nautilus-metafile.c:
	* libnautilus-private/nautilus-undo-context.c:
	* libnautilus/nautilus-undo-transaction.c:
	Same fixes Havoc did, formatted differently.

	* libnautilus-private/nautilus-undo-manager.c: (corba_append),
	(corba_forget), (corba_undo), (nautilus_undo_manager_new),
	(finalize), (nautilus_undo_manager_class_init):
	GtkObject -> GObject fixes. bonobo_object_from_servant fixes.

	* nautilus-clean.sh: Not sure if we still need this, but
	change gconfd-1 to gconfd-2 and oafd to bonobo-activation-server.

	* nautilus.spec.in: Some updates, not sure if they are right.

	* src/nautilus-application.c: (nautilus_application_new),
	(nautilus_application_finalize), (nautilus_application_class_init):
	GtkObject -> GObject fixes.

	* src/nautilus-main.c: (main): Use gnome_program_init.

	* src/Makefile.am: Define a bunch more stuff used by
	GNOME_PROGRAM_STANDARD_PROPERTIES.
parent 408dcac2
2001-11-01 Darin Adler <darin@bentspoon.com>
More changes to make Nautilus get closer to running.
* libnautilus-private/nautilus-bonobo-extensions.h: Remove
NAUTILUS_BONOBO_X_BOILERPLATE, superceded by EEL_DEFINE_
BONOBO_BOILERPLATE
* libnautilus-private/nautilus-directory-metafile-monitor.c:
* libnautilus-private/nautilus-metafile.c:
* libnautilus-private/nautilus-undo-context.c:
* libnautilus/nautilus-undo-transaction.c:
Same fixes Havoc did, formatted differently.
* libnautilus-private/nautilus-undo-manager.c: (corba_append),
(corba_forget), (corba_undo), (nautilus_undo_manager_new),
(finalize), (nautilus_undo_manager_class_init):
GtkObject -> GObject fixes. bonobo_object_from_servant fixes.
* nautilus-clean.sh: Not sure if we still need this, but
change gconfd-1 to gconfd-2 and oafd to bonobo-activation-server.
* nautilus.spec.in: Some updates, not sure if they are right.
* src/nautilus-application.c: (nautilus_application_new),
(nautilus_application_finalize), (nautilus_application_class_init):
GtkObject -> GObject fixes.
* src/nautilus-main.c: (main): Use gnome_program_init.
* src/Makefile.am: Define a bunch more stuff used by
GNOME_PROGRAM_STANDARD_PROPERTIES.
2001-11-01 Havoc Pennington <hp@pobox.com>
* src/nautilus-view-frame-corba.c: fix
......
......@@ -103,40 +103,4 @@ NautilusBonoboActivationHandle *nautilus_bonobo_activate_from_id
gpointer callback_data);
void nautilus_bonobo_activate_cancel (NautilusBonoboActivationHandle *handle);
/* This macro is a copy of BONOBO_X_TYPE_FUNC_FULL (from bonobo-xobject.h)
* with the addition of support for the parent_class which is defined by
* EEL_DEFINE_CLASS_BOILERPLATE and used by EEL_CALL_PARENT.
*
* Note: the argument order matches BONOBO_X_TYPE_FUNC_FULL which is different
* than EEL_DEFINE_CLASS_BOILERPLATE.
*/
#define NAUTILUS_BONOBO_X_BOILERPLATE(class_name, corba_name, parent, prefix) \
static gpointer parent_class; /* Nautilus change */ \
GtkType \
prefix##_get_type (void) \
{ \
GtkType ptype; \
static GtkType type = 0; \
\
if (type == 0) { \
static GtkTypeInfo info = { \
#class_name, \
sizeof (class_name), \
sizeof (class_name##Class), \
(GtkClassInitFunc)prefix##_class_init, \
(GtkObjectInitFunc)prefix##_init, \
NULL, NULL, (GtkClassInitFunc) NULL \
}; \
ptype = (parent); \
type = bonobo_x_type_unique (ptype, \
POA_##corba_name##__init, POA_##corba_name##__fini, \
GTK_STRUCT_OFFSET (class_name##Class, epv), \
&info); \
parent_class = gtk_type_class (ptype); /* Nautilus change */ \
} \
return type; \
}
#endif /* NAUTILUS_BONOBO_EXTENSIONS_H */
......@@ -46,7 +46,10 @@ static void corba_metafile_changed (PortableServer_Servant servant,
static void corba_metafile_ready (PortableServer_Servant servant,
CORBA_Environment *ev);
EEL_DEFINE_BONOBO_BOILERPLATE (NautilusMetafileMonitor, Nautilus_MetafileMonitor, nautilus_metafile_monitor, BONOBO_OBJECT_TYPE)
EEL_DEFINE_BONOBO_BOILERPLATE (NautilusMetafileMonitor,
Nautilus_MetafileMonitor,
nautilus_metafile_monitor,
BONOBO_OBJECT_TYPE)
static void
nautilus_metafile_monitor_class_init (NautilusMetafileMonitorClass *klass)
......
......@@ -156,7 +156,10 @@ static void async_read_cancel (NautilusMetafile *metafile);
static void nautilus_metafile_set_metafile_contents (NautilusMetafile *metafile,
xmlDocPtr metafile_contents);
EEL_DEFINE_BONOBO_BOILERPLATE (NautilusMetafile, Nautilus_Metafile, nautilus_metafile, BONOBO_OBJECT_TYPE)
EEL_DEFINE_BONOBO_BOILERPLATE (NautilusMetafile,
Nautilus_Metafile,
nautilus_metafile,
BONOBO_OBJECT_TYPE)
typedef struct MetafileReadState {
gboolean use_public_metafile;
......
......@@ -44,7 +44,10 @@ static void destroy (GtkOb
static Nautilus_Undo_Manager impl_Nautilus_Undo_Context__get_undo_manager (PortableServer_Servant servant,
CORBA_Environment *ev);
EEL_DEFINE_BONOBO_BOILERPLATE (NautilusUndoContext, Nautilus_Undo_Context, nautilus_undo_context, BONOBO_OBJECT_TYPE)
EEL_DEFINE_BONOBO_BOILERPLATE (NautilusUndoContext,
Nautilus_Undo_Context,
nautilus_undo_context,
BONOBO_OBJECT_TYPE)
static Nautilus_Undo_Manager
impl_Nautilus_Undo_Context__get_undo_manager (PortableServer_Servant servant,
......
......@@ -52,11 +52,6 @@ enum {
};
static guint signals[LAST_SIGNAL];
typedef struct {
POA_Nautilus_Undo_Manager servant;
NautilusUndoManager *bonobo_object;
} UndoManagerServant;
typedef struct {
#ifdef UIH
BonoboUIHandler *handler;
......@@ -69,9 +64,11 @@ typedef struct {
/* GtkObject */
static void nautilus_undo_manager_class_init (NautilusUndoManagerClass *class);
static void nautilus_undo_manager_init (NautilusUndoManager *item);
static void destroy (GtkObject *object);
EEL_DEFINE_BONOBO_BOILERPLATE (NautilusUndoManager, Nautilus_Undo_Manager, nautilus_undo_manager, BONOBO_OBJECT_TYPE)
EEL_DEFINE_BONOBO_BOILERPLATE (NautilusUndoManager,
Nautilus_Undo_Manager,
nautilus_undo_manager,
BONOBO_OBJECT_TYPE)
static void
release_transaction (NautilusUndoManager *manager)
......@@ -99,8 +96,7 @@ corba_append (PortableServer_Servant servant,
NautilusUndoManager *manager;
Nautilus_Undo_Transaction duplicate_transaction;
manager = ((UndoManagerServant *) servant)->bonobo_object;
g_assert (NAUTILUS_IS_UNDO_MANAGER (manager));
manager = NAUTILUS_UNDO_MANAGER (bonobo_object_from_servant (bonobo_object));
/* Check, complain, and ignore the passed-in transaction if we
* get more than one within a single undo operation. The single
......@@ -133,8 +129,7 @@ corba_forget (PortableServer_Servant servant,
{
NautilusUndoManager *manager;
manager = ((UndoManagerServant *) servant)->bonobo_object;
g_assert (NAUTILUS_IS_UNDO_MANAGER (manager));
manager = NAUTILUS_UNDO_MANAGER (bonobo_object_from_servant (bonobo_object));
/* Nothing to forget unless the item we are passed is the
* transaction we are currently holding.
......@@ -156,16 +151,14 @@ corba_undo (PortableServer_Servant servant,
{
NautilusUndoManager *manager;
manager = ((UndoManagerServant *) servant)->bonobo_object;
g_assert (NAUTILUS_IS_UNDO_MANAGER (manager));
manager = NAUTILUS_UNDO_MANAGER (bonobo_object_from_servant (bonobo_object));
nautilus_undo_manager_undo (manager);
}
NautilusUndoManager *
nautilus_undo_manager_new (void)
{
return NAUTILUS_UNDO_MANAGER (gtk_object_new (nautilus_undo_manager_get_type (), NULL));
return NAUTILUS_UNDO_MANAGER (g_object_new (nautilus_undo_manager_get_type (), NULL));
}
static void
......@@ -212,7 +205,7 @@ nautilus_undo_manager_undo (NautilusUndoManager *manager)
}
static void
destroy (GtkObject *object)
finalize (GObject *object)
{
NautilusUndoManager *manager;
......@@ -220,7 +213,7 @@ destroy (GtkObject *object)
release_transaction (manager);
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
void
......@@ -344,17 +337,13 @@ nautilus_undo_manager_set_up_bonobo_ui_handler_undo_item (NautilusUndoManager *m
#endif /* UIH */
static void
nautilus_undo_manager_class_init (NautilusUndoManagerClass *klass)
nautilus_undo_manager_class_init (NautilusUndoManagerClass *class)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (klass);
object_class->destroy = destroy;
G_OBJECT_CLASS (class)->finalize = finalize;
signals[CHANGED] = g_signal_new
("changed",
G_TYPE_FROM_CLASS (object_class),
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusUndoManagerClass,
changed),
......@@ -362,7 +351,7 @@ nautilus_undo_manager_class_init (NautilusUndoManagerClass *klass)
gtk_marshal_NONE__NONE,
G_TYPE_NONE, 0);
klass->epv.append = corba_append;
klass->epv.forget = corba_forget;
klass->epv.undo = corba_undo;
class->epv.append = corba_append;
class->epv.forget = corba_forget;
class->epv.undo = corba_undo;
}
......@@ -58,7 +58,10 @@ static void impl_Nautilus_Undo_Transaction__undo
static void undo_atom_list_free (GList *list);
static void undo_atom_list_undo_and_free (GList *list);
EEL_DEFINE_BONOBO_BOILERPLATE (NautilusUndoTransaction, Nautilus_Undo_Transaction, nautilus_undo_transaction, BONOBO_OBJECT_TYPE)
EEL_DEFINE_BONOBO_BOILERPLATE (NautilusUndoTransaction,
Nautilus_Undo_Transaction,
nautilus_undo_transaction,
BONOBO_OBJECT_TYPE)
static Nautilus_Undo_MenuItem *
impl_Nautilus_Undo_Transaction__get_undo_menu_item (PortableServer_Servant servant,
......
......@@ -81,7 +81,7 @@ trilobite-eazel-time-view \
if [ "$extreme" = "yes" ]
then
AUX_PROGS="gconfd-1 $AUX_PROGS oafd"
AUX_PROGS="gconfd-2 $AUX_PROGS bonobo-activation-server"
fi
unset FOUND_ANY
......@@ -111,7 +111,7 @@ for NAME in $AUX_PROGS; do
else
$killcmd "$NAME" > /dev/null 2>&1
fi
if [ "$NAME" = "gconfd-1" ]; then
if [ "$NAME" = "gconfd-2" ]; then
rm -f "$HOME/.gconfd/saved_state"
fi
fi
......
......@@ -160,13 +160,9 @@ scrollkeeper-update
%{_bindir}/nautilus-clean.sh
%{_bindir}/nautilus-verify-rpm.sh
%{_bindir}/nautilus-restore-settings-to-default.sh
%{_bindir}/gnome-db2html2
%{_bindir}/gnome-info2html2
%{_bindir}/gnome-man2html2
%{_bindir}/hyperbola
%{_bindir}/nautilus
%{_bindir}/nautilus-adapter
%{_bindir}/nautilus-content-loser
%{_bindir}/nautilus-error-dialog
%{_bindir}/nautilus-hardware-view
%{_bindir}/nautilus-history-view
......@@ -176,12 +172,8 @@ scrollkeeper-update
%{_bindir}/nautilus-news
%{_bindir}/nautilus-notes
%{_bindir}/nautilus-sample-content-view
%{_bindir}/nautilus-sidebar-loser
%{_bindir}/nautilus-text-view
%{_bindir}/nautilus-throbber
%{_bindir}/run-nautilus
%{_bindir}/nautilus-launcher-applet
%{_bindir}/nautilus-xml-migrate
%{_libdir}/libnautilus-adapter.so.0
%{_libdir}/libnautilus-adapter.so.0.0.0
%{_libdir}/libnautilus-private.so.0
......@@ -239,21 +231,19 @@ scrollkeeper-update
%{_datadir}/pixmaps/nautilus/throbber/*.png
%{_datadir}/pixmaps/nautilus/sierra/*.xml
%{_datadir}/pixmaps/nautilus/sierra/*.png
%{_datadir}/oaf/Nautilus_View_help.oaf
%{_datadir}/oaf/Nautilus_ComponentAdapterFactory_std.oaf
%{_datadir}/oaf/Nautilus_View_content-loser.oaf
%{_datadir}/oaf/Nautilus_View_hardware.oaf
%{_datadir}/oaf/Nautilus_View_history.oaf
%{_datadir}/oaf/Nautilus_View_image.oaf
%{_datadir}/oaf/Nautilus_View_music.oaf
%{_datadir}/oaf/Nautilus_View_news.oaf
%{_datadir}/oaf/Nautilus_View_notes.oaf
%{_datadir}/oaf/Nautilus_View_sample.oaf
%{_datadir}/oaf/Nautilus_View_sidebar-loser.oaf
%{_datadir}/oaf/Nautilus_View_text.oaf
%{_datadir}/oaf/Nautilus_View_tree.oaf
%{_datadir}/oaf/Nautilus_shell.oaf
%{_datadir}/oaf/Nautilus_Control_throbber.oaf
%{_datadir}/oaf/Nautilus_View_help.server
%{_datadir}/oaf/Nautilus_ComponentAdapterFactory_std.server
%{_datadir}/oaf/Nautilus_View_hardware.server
%{_datadir}/oaf/Nautilus_View_history.server
%{_datadir}/oaf/Nautilus_View_image.server
%{_datadir}/oaf/Nautilus_View_music.server
%{_datadir}/oaf/Nautilus_View_news.server
%{_datadir}/oaf/Nautilus_View_notes.server
%{_datadir}/oaf/Nautilus_View_sample.server
%{_datadir}/oaf/Nautilus_View_text.server
%{_datadir}/oaf/Nautilus_View_tree.server
%{_datadir}/oaf/Nautilus_shell.server
%{_datadir}/oaf/Nautilus_Control_throbber.server
# We put the idl files in the main package, not the devel package
# because the perl corba bindings can use the .idl files at run time.
......
......@@ -9,11 +9,14 @@ INCLUDES =\
-I$(top_srcdir)/cut-n-paste-code/widgets/e-paned \
-I$(top_srcdir)/cut-n-paste-code/widgets/gimphwrapbox \
$(NAUTILUS_SRC_CFLAGS) \
-DVERSION="\"$(VERSION)\"" \
-DDATADIR=\""$(datadir)"\" \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DLIBDIR=\""$(libdir)"\" \
-DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \
-DNAUTILUS_PIXMAPDIR=\""$(datadir)/pixmaps/nautilus"\" \
-DDATADIR=\""$(datadir)"\" \
-DPREFIX=\""$(prefix)"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DVERSION="\"$(VERSION)\"" \
$(NULL)
LDADD =\
......
......@@ -81,7 +81,6 @@ static GList *nautilus_application_window_list;
static void nautilus_application_init (NautilusApplication *application);
static void nautilus_application_class_init (NautilusApplicationClass *klass);
static void nautilus_application_destroy (GtkObject *object);
static gboolean confirm_ok_to_run_as_root (void);
static gboolean need_to_show_first_time_druid (void);
static void desktop_changed_callback (gpointer user_data);
......@@ -141,14 +140,6 @@ nautilus_application_get_window_list (void)
return nautilus_application_window_list;
}
static void
nautilus_application_class_init (NautilusApplicationClass *klass)
{
GTK_OBJECT_CLASS (klass)->destroy = nautilus_application_destroy;
BONOBO_GENERIC_FACTORY_CLASS (klass)->epv.createObject = create_object;
}
static void
nautilus_application_init (NautilusApplication *application)
{
......@@ -171,11 +162,11 @@ nautilus_application_init (NautilusApplication *application)
NautilusApplication *
nautilus_application_new (void)
{
return NAUTILUS_APPLICATION (gtk_object_new (nautilus_application_get_type (), NULL));
return NAUTILUS_APPLICATION (g_object_new (nautilus_application_get_type (), NULL));
}
static void
nautilus_application_destroy (GtkObject *object)
nautilus_application_finalize (GObject *object)
{
NautilusApplication *application;
......@@ -185,7 +176,7 @@ nautilus_application_destroy (GtkObject *object)
bonobo_object_unref (BONOBO_OBJECT (application->undo_manager));
EEL_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
EEL_CALL_PARENT (G_OBJECT_CLASS, finalize, (object));
}
static gboolean
......@@ -1085,3 +1076,11 @@ is_kdesktop_present (void)
return look_for_kdesktop_recursive (GDK_ROOT_WINDOW ());
}
static void
nautilus_application_class_init (NautilusApplicationClass *klass)
{
G_OBJECT_CLASS (klass)->finalize = nautilus_application_finalize;
BONOBO_GENERIC_FACTORY_CLASS (klass)->epv.createObject = create_object;
}
......@@ -45,6 +45,7 @@
#include <gtk/gtksignal.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-init.h>
#include <libgnomeui/gnome-ui-init.h>
#include <libgnomevfs/gnome-vfs-init.h>
#include <libnautilus-private/nautilus-directory-metafile.h>
#include <libnautilus-private/nautilus-global-preferences.h>
......@@ -139,8 +140,9 @@ main (int argc, char *argv[])
const char **args;
NautilusApplication *application;
char **argv_copy;
GnomeProgram *program;
GValue context_as_value = { 0 };
#if GNOME2_CONVERSION_COMPLETE
struct poptOption options[] = {
#ifndef NAUTILUS_OMIT_SELF_CHECK
{ "check", 'c', POPT_ARG_NONE, &perform_self_check, 0,
......@@ -158,7 +160,6 @@ main (int argc, char *argv[])
N_("Restart Nautilus."), NULL },
{ NULL, '\0', 0, NULL, 0, NULL, NULL }
};
#endif
/* Make criticals and warnings stop in the debugger if
* NAUTILUS_DEBUG is set. Unfortunately, this has to be done
......@@ -166,7 +167,7 @@ main (int argc, char *argv[])
*/
if (g_getenv ("NAUTILUS_DEBUG") != NULL) {
eel_make_warnings_and_criticals_stop_in_debugger
(G_LOG_DOMAIN, g_log_domain_glib,
(G_LOG_DOMAIN, g_log_domain_glib, g_log_domain_gruntime,
"Bonobo",
"Gdk",
"GnomeUI",
......@@ -189,8 +190,6 @@ main (int argc, char *argv[])
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
textdomain (PACKAGE);
#endif
/* Disable bug-buddy for now. */
eel_setenv ("GNOME_DISABLE_CRASH_DIALOG", "1", TRUE);
/* Get parameters. */
geometry = NULL;
......@@ -200,17 +199,25 @@ main (int argc, char *argv[])
perform_self_check = FALSE;
restart_shell = FALSE;
program = gnome_program_init ("nautilus", VERSION,
LIBGNOMEUI_MODULE, argc, argv,
GNOME_PROGRAM_STANDARD_PROPERTIES,
GNOME_PARAM_POPT_TABLE, options,
GNOME_PARAM_HUMAN_READABLE_NAME, _("Nautilus"),
NULL);
g_object_get_property (G_OBJECT (program),
GNOME_PARAM_POPT_CONTEXT,
g_value_init (&context_as_value, G_TYPE_POINTER));
popt_context = g_value_get_pointer (&context_as_value);
#if GNOME2_CONVERSION_COMPLETE
gnomelib_register_popt_table (bonobo_activation_popt_options,
bonobo_activation_get_popt_table_name ());
gnome_init_with_popt_table ("nautilus", VERSION,
argc, argv, options, 0,
&popt_context);
#else
popt_context = NULL;
#endif
eel_setenv ("DISPLAY", DisplayString (GDK_DISPLAY ()), TRUE);
gdk_rgb_init ();
/* Check for argument consistency. */
args = poptGetArgs (popt_context);
......@@ -237,15 +244,12 @@ main (int argc, char *argv[])
/* Initialize the services that we use. */
LIBXML_TEST_VERSION
g_atexit (xmlCleanupParser);
g_thread_init (NULL);
gnome_vfs_init ();
bonobo_init (&argc, argv);
if (g_getenv ("NAUTILUS_ENABLE_TEST_COMPONENTS") != NULL) {
bonobo_activation_set_test_components_enabled (TRUE);
}
gnome_vfs_init ();
bonobo_init (&argc, argv);
bonobo_activate (); /* do now since we need it before main loop */
/* Initialize preferences. This is needed so that proper
* defaults are available before any preference peeking
......@@ -258,7 +262,9 @@ main (int argc, char *argv[])
eel_preferences_set_is_invisible
(NAUTILUS_PREFERENCES_DESKTOP_IS_HOME_DIR, TRUE);
}
bonobo_activate (); /* do now since we need it before main loop */
/* Do either the self-check or the real work. */
if (perform_self_check) {
#ifndef NAUTILUS_OMIT_SELF_CHECK
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment