Commit 3f2b83b1 authored by Darin Adler's avatar Darin Adler

Moved to make clear that popt must build first.

	* HACKING: Moved to make clear that popt must build first.

	* RENAMING: Added some new file renamings.

	* src/nautilus-zoomable-frame-svr.c:
	* src/nautilus.h: [removed]
	* src/ntl-app.c:
	* src/ntl-main.c:
	* src/ntl-meta-view.c:
	* src/ntl-types.h: [removed]
	* src/ntl-uri-map.c:
	* src/ntl-view-bonobo-control.c:
	* src/ntl-view-bonobo-subdoc.c:
	* src/ntl-view-frame-svr.c:
	* src/ntl-view-nautilus.c:
	* src/ntl-view-private.h:
	* src/ntl-view.c:
	* src/ntl-window-msgs.c:
	* src/ntl-window-state.c:
	* src/ntl-window.c:
	Got rid of "nautilus.h" and "ntl-types.h".

	* libnautilus/nautilus-undo-context.c:
	(impl_Nautilus_Undo_Context__destroy),
	(impl_Nautilus_Undo_Context__create),
	(impl_Nautilus_Undo_Context__get_undo_manager),
	(nautilus_undo_context_new), (nautilus_undo_context_initialize),
	(destroy):
	* libnautilus/nautilus-undo-manager.c:
	(impl_Nautilus_Undo_Manager__destroy),
	(impl_Nautilus_Undo_Manager__create),
	(impl_Nautilus_Undo_Manager__append),
	(impl_Nautilus_Undo_Manager__forget),
	(impl_Nautilus_Undo_Manager__undo), (nautilus_undo_manager_new),
	(nautilus_undo_manager_initialize),
	(nautilus_undo_manager_initialize_class),
	(nautilus_undo_manager_undo), (nautilus_undo_manager_redo),
	(nautilus_undo_manager_add_transaction),
	(nautilus_undo_manager_unregister_object),
	(nautilus_undo_manager_can_undo), (nautilus_undo_manager_can_redo),
	(destroy), (nautilus_undo_manager_enable_redo),
	(nautilus_undo_manager_set_queue_depth), (free_undo_manager_list):
	Various code cleanups. Specifically, get rid of unused
	bonobo_object and rename gtk_object to bonobo_object.
	Get rid of some yucky function pointer casts.

	* src/ntl-app.c: (nautilus_app_init):
	Got rid of bogus extra ref.

	* libnautilus-extensions/nautilus-program-chooser.c:
	(nautilus_program_chooser_new): Reindent part just to annoy John.
	* libnautilus-extensions/nautilus-program-choosing.c:
	(nautilus_launch_application): Newline at end of file (ugh).

	* src/ntl-index-panel.c: (add_command_buttons): Format tweaking.
parent 0409c262
2000-05-24 Darin Adler <darin@eazel.com>
* HACKING: Moved to make clear that popt must build first.
* RENAMING: Added some new file renamings.
* src/nautilus-zoomable-frame-svr.c:
* src/nautilus.h: [removed]
* src/ntl-app.c:
* src/ntl-main.c:
* src/ntl-meta-view.c:
* src/ntl-types.h: [removed]
* src/ntl-uri-map.c:
* src/ntl-view-bonobo-control.c:
* src/ntl-view-bonobo-subdoc.c:
* src/ntl-view-frame-svr.c:
* src/ntl-view-nautilus.c:
* src/ntl-view-private.h:
* src/ntl-view.c:
* src/ntl-window-msgs.c:
* src/ntl-window-state.c:
* src/ntl-window.c:
Got rid of "nautilus.h" and "ntl-types.h".
* libnautilus/nautilus-undo-context.c:
(impl_Nautilus_Undo_Context__destroy),
(impl_Nautilus_Undo_Context__create),
(impl_Nautilus_Undo_Context__get_undo_manager),
(nautilus_undo_context_new), (nautilus_undo_context_initialize),
(destroy):
* libnautilus/nautilus-undo-manager.c:
(impl_Nautilus_Undo_Manager__destroy),
(impl_Nautilus_Undo_Manager__create),
(impl_Nautilus_Undo_Manager__append),
(impl_Nautilus_Undo_Manager__forget),
(impl_Nautilus_Undo_Manager__undo), (nautilus_undo_manager_new),
(nautilus_undo_manager_initialize),
(nautilus_undo_manager_initialize_class),
(nautilus_undo_manager_undo), (nautilus_undo_manager_redo),
(nautilus_undo_manager_add_transaction),
(nautilus_undo_manager_unregister_object),
(nautilus_undo_manager_can_undo), (nautilus_undo_manager_can_redo),
(destroy), (nautilus_undo_manager_enable_redo),
(nautilus_undo_manager_set_queue_depth), (free_undo_manager_list):
Various code cleanups. Specifically, get rid of unused
bonobo_object and rename gtk_object to bonobo_object.
Get rid of some yucky function pointer casts.
* src/ntl-app.c: (nautilus_app_init):
Got rid of bogus extra ref.
* libnautilus-extensions/nautilus-program-chooser.c:
(nautilus_program_chooser_new): Reindent part just to annoy John.
* libnautilus-extensions/nautilus-program-choosing.c:
(nautilus_launch_application): Newline at end of file (ugh).
* src/ntl-index-panel.c: (add_command_buttons): Format tweaking.
2000-05-24 Eskil Heyn Olsen <eskil@eazel.om>
* configure.in:
......@@ -25,9 +83,8 @@
2000-05-24 J Shane Culpepper <pepper@eazel.com>
*nautilus-installer/nautilus-installer.c
*nautilus-installer/Makefile
* nautilus-installer/nautilus-installer.c:
* nautilus-installer/Makefile:
Removed the duplicate helixcode files from the installer. Temporarily
added 4 duplicate functions to the installer until I get libtrilobite
statically linked in.
......@@ -102,22 +159,22 @@
* libnautilus/nautilus-undo-context.c:
(impl_Nautilus_Undo_Context__get_undo_manager):
Added call to CORBA_Object_duplicate(). This
fixed an explosive bug.
Added call to CORBA_Object_duplicate(). This fixed an explosive
bug.
* libnautilus/nautilus-undo-manager.c:
* libnautilus/nautilus-undo-manager.h:
(nautilus_undo_manager_stash_global_undo),
(nautilus_undo_manager_get_global_undo):
New functions to save application global instance of Nautilus_Undo_Manager
New functions to save application global instance of
Nautilus_Undo_Manager
* src/ntl-app.c: (nautilus_app_init):
Add call to nautilus_undo_manager_stash_global_undo.
* src/ntl-view.c:
(nautilus_view_frame_load_client):
Coonected Nautilus_Undo_Context interface to view frame.
Connected Nautilus_Undo_Context interface to view frame.
2000-05-23 Ramiro Estrugo <ramiro@eazel.com>
......
......@@ -16,6 +16,7 @@ Nautilus currently requires the following modules from GNOME CVS
module branch configure options
------ ------ -----------------
popt: <need 1.5, but not from GNOME CVS, see below>
glib: glib-1-2
gtk+: gtk-1-2
imlib: HEAD
......@@ -34,7 +35,6 @@ Nautilus currently requires the following modules from GNOME CVS
gtkhtml: HEAD
eog: HEAD --enable-oaf=yes
xpdf: HEAD
popt: <need 1.5, but not from GNOME CVS, see below>
Other modules for Red Hat users:
......
We put plans for renaming in here so we can think about them for a while.
Note that when we rename a class, it usually involves renaming some files too.
---
We put plans for renaming in here so we can think about them for a
while. Note that when we rename a class, it usually involves renaming
some functions and files too.
----------
file names
----------
components/history/ntl-history-view.c -> components/history/nautilus-history-view.c
components/notes/ntl-notes.c -> components/notes/nautilus-notes.c
libnautilus/nautilus-content-view-frame.c -> libnautilus/nautilus-content-view.c
libnautilus/nautilus-content-view-frame.h -> libnautilus/nautilus-content-view.h
libnautilus/nautilus-meta-view-frame.c -> libnautilus/nautilus-meta-view.c
libnautilus/nautilus-meta-view-frame.h -> libnautilus/nautilus-meta-view.h
libnautilus/nautilus-view-frame.c -> libnautilus/nautilus-view.c
libnautilus/nautilus-view-frame.h -> libnautilus/nautilus-view.h
src/nautilus-index-tabs.c -> src/nautilus-sidebar-tabs.c
src/nautilus-index-tabs.h -> src/nautilus-sidebar-tabs.h
src/nautilus-index-title.c -> src/nautilus-sidebar-title.c
src/nautilus-index-title.h -> src/nautilus-sidebar-title.h
src/nautilus-zoomable-frame-svr.c -> src/nautilus-zoomable-frame-corba.c
src/ntl-app.c -> src/nautilus-application.c
src/ntl-app.h -> src/nautilus-application.h
src/ntl-content-view.c -> src/nautilus-content-view-frame.c
src/ntl-content-view.h -> src/nautilus-content-view-frame.h
src/ntl-index-panel.c -> src/nautilus-sidebar.c
src/ntl-index-panel.h -> src/nautilus-sidebar.h
src/ntl-main.c -> src/nautilus-main.c
src/ntl-meta-view.c -> src/nautilus-meta-view-frame.c
src/ntl-meta-view.h -> src/nautilus-meta-view-frame.h
src/ntl-miniicon.c -> libnautilus-extensions/nautilus-mini-icon.c
src/ntl-miniicon.h -> libnautilus-extensions/nautilus-mini-icon.h
src/ntl-uri-map.c -> src/nautilus-applicable-views.c
src/ntl-uri-map.h -> src/nautilus-applicable-views.h
src/ntl-view-bonobo-control.c -> src/nautilus-view-frame-bonobo-control.c
src/ntl-view-bonobo-subdoc.c -> src/nautilus-view-frame-bonobo-embeddable.c
src/ntl-view-frame-svr.c -> src/nautilus-view-frame-corba.c
src/ntl-view-nautilus.c -> src/nautilus-view-frame-nautilus-view.c
src/ntl-view-private.h -> src/nautilus-view-frame-private.h
src/ntl-view.c -> src/nautilus-view-frame.c
src/ntl-view.h -> src/nautilus-view-frame.h
src/ntl-window-msgs.c -> src/nautilus-window-manage-views.c
src/ntl-window-msgs.h -> src/nautilus-window-manage-views.h
src/ntl-window-private.h -> src/nautilus-window-private.h
src/ntl-window-state.c -> src/nautilus-window-state.c
src/ntl-window-state.h -> src/nautilus-window-state.h
src/ntl-window.c -> src/nautilus-window.c
src/ntl-window.h -> src/nautilus-window.h
libnautilus/nautilus-content-view-frame.c -> libnautilus/nautilus-content-view.c
libnautilus/nautilus-content-view-frame.h -> libnautilus/nautilus-content-view.h
libnautilus/nautilus-meta-view-frame.c -> libnautilus/nautilus-meta-view.c
libnautilus/nautilus-meta-view-frame.h -> libnautilus/nautilus-meta-view.h
libnautilus/nautilus-view-frame.c -> libnautilus/nautilus-view.c
libnautilus/nautilus-view-frame.h -> libnautilus/nautilus-view.h
src/ntl-view-nautilus.c -> src/nautilus-view-frame-nautilus-view.c
src/ntl-index-panel.c -> nautilus-sidebar.c
src/ntl-index-panel.h -> nautilus-sidebar.h
src/ntl-miniicon.c -> libnautilus-extensions/nautilus-mini-icon.c
src/ntl-miniicon.h -> libnautilus-extensions/nautilus-mini-icon.h
src/ntl-types.h -> (delete this file)
src/ntl-uri-map.c -> nautilus-applicable-views.c
src/ntl-uri-map.h -> nautilus-applicable-views.h
src/ntl-window-msgs.c -> nautilus-window-manage-views.c
src/ntl-window-msgs.h -> nautilus-window-manage-views.h
ntl* -> nautilus*
GtkScrollFrame -> NautilusScrollFrame
*_cb -> *_callback
components/html/ntl-web-browser.c -> ?
components/websearch/ntl-web-search.c -> ?
----------------------------
classes and other data types
----------------------------
*IndexPanel* -> *Sidebar*
*MetaView* -> *SidebarPanel*
GtkScrollFrame -> NautilusScrollFrame
NavigationRequestInfo -> NavigationRequest
NavigationInfo -> Location
SelectionInfo -> Selection
SelectionRequestInfo -> SelectionRequest
StatusRequestInfo -> Status (or StatusRequest)
--------------
function names
--------------
*_cb -> *_callback
......@@ -48,18 +48,18 @@ nautilus_program_chooser_new (NautilusProgramChooserType type,
file_name = nautilus_file_get_name (file);
switch (type) {
case NAUTILUS_PROGRAM_CHOOSER_APPLICATIONS:
title = _("Nautilus: Choose an application");
prompt = g_strdup_printf (_("Choose an application with which to open \"%s\"\n\n(Doesn't do anything yet)"), file_name);
break;
case NAUTILUS_PROGRAM_CHOOSER_COMPONENTS:
default:
title = _("Nautilus: Choose a viewer");
prompt = g_strdup_printf (_("Choose a viewer with which to display \"%s\"\n\n(Doesn't do anything yet)"), file_name);
break;
case NAUTILUS_PROGRAM_CHOOSER_APPLICATIONS:
title = _("Nautilus: Choose an application");
prompt = g_strdup_printf (_("Choose an application with which to open \"%s\"\n\n(Doesn't do anything yet)"), file_name);
break;
case NAUTILUS_PROGRAM_CHOOSER_COMPONENTS:
default:
title = _("Nautilus: Choose a viewer");
prompt = g_strdup_printf (_("Choose a viewer with which to display \"%s\"\n\n(Doesn't do anything yet)"), file_name);
break;
}
g_free (file_name);
window = gnome_dialog_new (title,
GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL,
......@@ -77,4 +77,4 @@ nautilus_program_chooser_new (NautilusProgramChooserType type,
gnome_dialog_set_close (GNOME_DIALOG (window), TRUE);
return GNOME_DIALOG (window);
}
\ No newline at end of file
}
......@@ -190,4 +190,4 @@ nautilus_launch_application (const char *command_string, const char *uri)
execlp (command_string, command_string, uri_parameter, NULL);
exit (0);
}
}
\ No newline at end of file
}
......@@ -36,30 +36,27 @@
typedef struct {
POA_Nautilus_Undo_Context servant;
gpointer bonobo_object;
NautilusUndoContext *gtk_object;
NautilusUndoContext *bonobo_object;
} impl_POA_Nautilus_Undo_Context;
/* GtkObject */
static void nautilus_undo_context_initialize_class (NautilusUndoContextClass *class);
static void nautilus_undo_context_initialize (NautilusUndoContext *item);
static void destroy (GtkObject *object);
static void nautilus_undo_context_initialize_class (NautilusUndoContextClass *class);
static void nautilus_undo_context_initialize (NautilusUndoContext *item);
static void destroy (GtkObject *object);
/* CORBA/Bonobo */
static Nautilus_Undo_Manager impl_Nautilus_Undo_Context__get_undo_manager (impl_POA_Nautilus_Undo_Context *servant,
CORBA_Environment *ev);
static Nautilus_Undo_Manager impl_Nautilus_Undo_Context__get_undo_manager (PortableServer_Servant servant,
CORBA_Environment *ev);
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusUndoContext, nautilus_undo_context, BONOBO_OBJECT_TYPE)
POA_Nautilus_Undo_Context__epv libnautilus_Nautilus_Undo_Context_epv =
{
NULL, /* _private */
(gpointer) &impl_Nautilus_Undo_Context__get_undo_manager,
NULL, /* _private */
&impl_Nautilus_Undo_Context__get_undo_manager,
};
static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
static PortableServer_ServantBase__epv base_epv;
static POA_Nautilus_Undo_Context__vepv impl_Nautilus_Undo_Context_vepv =
{
&base_epv,
......@@ -74,17 +71,20 @@ impl_Nautilus_Undo_Context__destroy (BonoboObject *obj, impl_POA_Nautilus_Undo_C
CORBA_Environment ev;
void (*servant_destroy_func) (PortableServer_Servant servant, CORBA_Environment *ev);
CORBA_exception_init(&ev);
CORBA_exception_init (&ev);
servant_destroy_func = NAUTILUS_UNDO_CONTEXT_CLASS
(GTK_OBJECT (servant->bonobo_object)->klass)->servant_destroy_func;
servant_destroy_func = NAUTILUS_UNDO_CONTEXT_CLASS (GTK_OBJECT (servant->gtk_object)->klass)->servant_destroy_func;
objid = PortableServer_POA_servant_to_id (bonobo_poa (), servant, &ev);
PortableServer_POA_deactivate_object (bonobo_poa (), objid, &ev);
CORBA_free (objid);
obj->servant = NULL;
servant_destroy_func ((PortableServer_Servant) servant, &ev);
(* servant_destroy_func) ((PortableServer_Servant) servant, &ev);
g_free (servant);
CORBA_exception_free(&ev);
CORBA_exception_free (&ev);
}
static Nautilus_Undo_Context
......@@ -93,39 +93,39 @@ impl_Nautilus_Undo_Context__create (NautilusUndoContext *context, CORBA_Environm
Nautilus_Undo_Context retval;
impl_POA_Nautilus_Undo_Context *servant;
void (*servant_init_func) (PortableServer_Servant servant, CORBA_Environment *ev);
NautilusUndoContextClass *context_class;
NautilusUndoContextClass *context_class = NAUTILUS_UNDO_CONTEXT_CLASS (GTK_OBJECT (context)->klass);
context_class = NAUTILUS_UNDO_CONTEXT_CLASS (GTK_OBJECT (context)->klass);
servant_init_func = context_class->servant_init_func;
servant = g_new0 (impl_POA_Nautilus_Undo_Context, 1);
servant->servant.vepv = context_class->vepv;
if (!servant->servant.vepv->Bonobo_Unknown_epv) {
if (servant->servant.vepv->Bonobo_Unknown_epv == NULL) {
servant->servant.vepv->Bonobo_Unknown_epv = bonobo_object_get_epv ();
}
servant_init_func ((PortableServer_Servant) servant, ev);
(* servant_init_func) ((PortableServer_Servant) servant, ev);
servant->gtk_object = context;
servant->bonobo_object = context;
retval = bonobo_object_activate_servant (BONOBO_OBJECT (context), servant);
gtk_signal_connect (GTK_OBJECT (context), "destroy", GTK_SIGNAL_FUNC (impl_Nautilus_Undo_Context__destroy), servant);
gtk_signal_connect (GTK_OBJECT (context), "destroy",
GTK_SIGNAL_FUNC (impl_Nautilus_Undo_Context__destroy),
servant);
return retval;
}
static Nautilus_Undo_Manager
impl_Nautilus_Undo_Context__get_undo_manager (impl_POA_Nautilus_Undo_Context *servant,
impl_Nautilus_Undo_Context__get_undo_manager (PortableServer_Servant servant,
CORBA_Environment *ev)
{
NautilusUndoContext *context;
g_assert (NAUTILUS_IS_UNDO_CONTEXT (servant->gtk_object));
context = NAUTILUS_UNDO_CONTEXT (servant->gtk_object);
context = ((impl_POA_Nautilus_Undo_Context *) servant)->bonobo_object;
CORBA_Object_duplicate (servant->gtk_object->undo_manager, ev);
return servant->gtk_object->undo_manager;
g_assert (NAUTILUS_IS_UNDO_CONTEXT (context));
return CORBA_Object_duplicate (context->undo_manager, ev);
}
/* nautilus_undo_manager_new */
......@@ -135,27 +135,24 @@ nautilus_undo_context_new (Nautilus_Undo_Manager undo_manager)
NautilusUndoContext *context;
context = gtk_type_new (nautilus_undo_context_get_type ());
context->undo_manager = undo_manager;
return context;
}
/* Object initialization function for the NautilusUndoContext */
static void
nautilus_undo_context_initialize (NautilusUndoContext *context)
{
CORBA_Environment ev;
CORBA_exception_init(&ev);
CORBA_exception_init (&ev);
bonobo_object_construct (BONOBO_OBJECT (context), impl_Nautilus_Undo_Context__create (context, &ev));
bonobo_object_construct (BONOBO_OBJECT (context),
impl_Nautilus_Undo_Context__create (context, &ev));
CORBA_exception_free(&ev);
CORBA_exception_free (&ev);
}
/* Class initialization function for the NautilusUndoManager. */
static void
nautilus_undo_context_initialize_class (NautilusUndoContextClass *klass)
......@@ -177,8 +174,6 @@ destroy (GtkObject *object)
{
NautilusUndoContext *context;
g_return_if_fail (NAUTILUS_IS_UNDO_CONTEXT (object));
context = NAUTILUS_UNDO_CONTEXT (object);
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
......
......@@ -43,54 +43,48 @@
Nautilus_Undo_Manager global_undo_manager;
enum {
UNDO_TRANSACTION_OCCURED,
UNDO_TRANSACTION_OCCURRED,
LAST_SIGNAL
};
static guint signals[LAST_SIGNAL];
typedef struct {
POA_Nautilus_Undo_Manager servant;
gpointer bonobo_object;
NautilusUndoManager *gtk_object;
NautilusUndoManager *bonobo_object;
} impl_POA_Nautilus_Undo_Manager;
/* GtkObject */
static void nautilus_undo_manager_initialize_class (NautilusUndoManagerClass *class);
static void nautilus_undo_manager_initialize (NautilusUndoManager *item);
static void destroy (GtkObject *object);
static void free_undo_manager_list (GList *list);
static GList *prune_undo_manager_list (GList *list, int items);
static void nautilus_undo_manager_initialize_class (NautilusUndoManagerClass *class);
static void nautilus_undo_manager_initialize (NautilusUndoManager *item);
static void destroy (GtkObject *object);
static void free_undo_manager_list (GList *list);
static GList *prune_undo_manager_list (GList *list,
int items);
/* CORBA/Bonobo */
static void impl_Nautilus_Undo_Manager__append (impl_POA_Nautilus_Undo_Manager *servant,
const Nautilus_Undo_Transaction transaction,
CORBA_Environment *ev);
static void impl_Nautilus_Undo_Manager__forget (impl_POA_Nautilus_Undo_Manager *servant,
const Nautilus_Undo_Transaction transaction,
CORBA_Environment *ev);
static void impl_Nautilus_Undo_Manager__undo (impl_POA_Nautilus_Undo_Manager *servant,
CORBA_Environment *ev);
static void nautilus_undo_manager_add_transaction (NautilusUndoManager *manager,
Nautilus_Undo_Transaction transaction);
static void nautilus_undo_manager_undo (NautilusUndoManager *manager);
static void impl_Nautilus_Undo_Manager__append (PortableServer_Servant servant,
const Nautilus_Undo_Transaction transaction,
CORBA_Environment *ev);
static void impl_Nautilus_Undo_Manager__forget (PortableServer_Servant servant,
const Nautilus_Undo_Transaction transaction,
CORBA_Environment *ev);
static void impl_Nautilus_Undo_Manager__undo (PortableServer_Servant servant,
CORBA_Environment *ev);
static void nautilus_undo_manager_add_transaction (NautilusUndoManager *manager,
Nautilus_Undo_Transaction transaction);
static void nautilus_undo_manager_undo (NautilusUndoManager *manager);
NAUTILUS_DEFINE_CLASS_BOILERPLATE(NautilusUndoManager, nautilus_undo_manager, BONOBO_OBJECT_TYPE)
POA_Nautilus_Undo_Manager__epv libnautilus_Nautilus_Undo_Manager_epv =
{
NULL, /* _private */
(gpointer) &impl_Nautilus_Undo_Manager__append,
(gpointer) &impl_Nautilus_Undo_Manager__forget,
(gpointer) &impl_Nautilus_Undo_Manager__undo,
&impl_Nautilus_Undo_Manager__append,
&impl_Nautilus_Undo_Manager__forget,
&impl_Nautilus_Undo_Manager__undo,
};
static PortableServer_ServantBase__epv base_epv = { NULL, NULL, NULL };
static PortableServer_ServantBase__epv base_epv;
static POA_Nautilus_Undo_Manager__vepv impl_Nautilus_Undo_Manager_vepv =
{
&base_epv,
......@@ -98,17 +92,16 @@ static POA_Nautilus_Undo_Manager__vepv impl_Nautilus_Undo_Manager_vepv =
&libnautilus_Nautilus_Undo_Manager_epv
};
static void
impl_Nautilus_Undo_Manager__destroy(BonoboObject *obj, impl_POA_Nautilus_Undo_Manager *servant)
impl_Nautilus_Undo_Manager__destroy (BonoboObject *obj, impl_POA_Nautilus_Undo_Manager *servant)
{
PortableServer_ObjectId *objid;
CORBA_Environment ev;
void (*servant_destroy_func) (PortableServer_Servant servant, CORBA_Environment *ev);
CORBA_exception_init(&ev);
CORBA_exception_init (&ev);
servant_destroy_func = NAUTILUS_UNDO_MANAGER_CLASS (GTK_OBJECT (servant->gtk_object)->klass)->servant_destroy_func;
servant_destroy_func = NAUTILUS_UNDO_MANAGER_CLASS (GTK_OBJECT (servant->bonobo_object)->klass)->servant_destroy_func;
objid = PortableServer_POA_servant_to_id (bonobo_poa (), servant, &ev);
PortableServer_POA_deactivate_object (bonobo_poa (), objid, &ev);
CORBA_free (objid);
......@@ -116,7 +109,7 @@ impl_Nautilus_Undo_Manager__destroy(BonoboObject *obj, impl_POA_Nautilus_Undo_Ma
servant_destroy_func ((PortableServer_Servant) servant, &ev);
g_free (servant);
CORBA_exception_free(&ev);
CORBA_exception_free (&ev);
}
static Nautilus_Undo_Manager
......@@ -135,7 +128,7 @@ impl_Nautilus_Undo_Manager__create (NautilusUndoManager *manager, CORBA_Environm
servant->servant.vepv->Bonobo_Unknown_epv = bonobo_object_get_epv ();
servant_init_func ((PortableServer_Servant) servant, ev);
servant->gtk_object = manager;
servant->bonobo_object = manager;
retval = bonobo_object_activate_servant (BONOBO_OBJECT (manager), servant);
......@@ -144,62 +137,58 @@ impl_Nautilus_Undo_Manager__create (NautilusUndoManager *manager, CORBA_Environm
return retval;
}
static void
impl_Nautilus_Undo_Manager__append (impl_POA_Nautilus_Undo_Manager *servant,
impl_Nautilus_Undo_Manager__append (PortableServer_Servant servant,
const Nautilus_Undo_Transaction undo_transaction,
CORBA_Environment *ev)
{
NautilusUndoManager *manager;
g_assert (NAUTILUS_IS_UNDO_MANAGER (servant->gtk_object));
manager = NAUTILUS_UNDO_MANAGER (servant->gtk_object);
manager = ((impl_POA_Nautilus_Undo_Manager *) servant)->bonobo_object;
g_assert (NAUTILUS_IS_UNDO_MANAGER (manager));
Nautilus_Undo_Transaction_ref (undo_transaction, ev);
nautilus_undo_manager_add_transaction (manager, undo_transaction);
}
static void
impl_Nautilus_Undo_Manager__forget (impl_POA_Nautilus_Undo_Manager *servant,
impl_Nautilus_Undo_Manager__forget (PortableServer_Servant servant,
const Nautilus_Undo_Transaction transaction,
CORBA_Environment *ev)
{
NautilusUndoManager *manager;
g_assert (NAUTILUS_IS_UNDO_MANAGER (servant->gtk_object));
manager = NAUTILUS_UNDO_MANAGER (servant->gtk_object);
manager = ((impl_POA_Nautilus_Undo_Manager *) servant)->bonobo_object;
g_assert (NAUTILUS_IS_UNDO_MANAGER (manager));
/* FIXME: Need to implement this. */
}
static void
impl_Nautilus_Undo_Manager__undo (impl_POA_Nautilus_Undo_Manager *servant, CORBA_Environment *ev)
impl_Nautilus_Undo_Manager__undo (PortableServer_Servant servant,
CORBA_Environment *ev)
{
NautilusUndoManager *manager;
g_assert (NAUTILUS_IS_UNDO_MANAGER (servant->gtk_object));
manager = NAUTILUS_UNDO_MANAGER (servant->gtk_object);
manager = ((impl_POA_Nautilus_Undo_Manager *) servant)->bonobo_object;
g_assert (NAUTILUS_IS_UNDO_MANAGER (manager));
nautilus_undo_manager_undo (manager);
}
/* nautilus_undo_manager_new */
NautilusUndoManager *
nautilus_undo_manager_new (void)
{
NautilusUndoManager *manager;
manager = gtk_type_new (nautilus_undo_manager_get_type ());
return manager;
return gtk_type_new (nautilus_undo_manager_get_type ());
}
/* Object initialization function for the NautilusUndoManager */
static void
nautilus_undo_manager_initialize (NautilusUndoManager *manager)
{
CORBA_Environment ev;
CORBA_exception_init(&ev);
CORBA_Environment ev;
CORBA_exception_init (&ev);
manager->details = g_new0 (NautilusUndoManagerDetails, 1);
......@@ -214,8 +203,8 @@ nautilus_undo_manager_initialize (NautilusUndoManager *manager)
manager->details->queue_depth = 1;
bonobo_object_construct (BONOBO_OBJECT (manager), impl_Nautilus_Undo_Manager__create (manager, &ev));
CORBA_exception_free(&ev);
CORBA_exception_free (&ev);
}
......@@ -234,7 +223,7 @@ nautilus_undo_manager_initialize_class (NautilusUndoManagerClass *klass)
klass->vepv = &impl_Nautilus_Undo_Manager_vepv;
/* Setup signals */
signals[UNDO_TRANSACTION_OCCURED]
signals[UNDO_TRANSACTION_OCCURRED]
= gtk_signal_new ("undo_transaction_occurred",
GTK_RUN_LAST,
object_class->type,
......@@ -246,8 +235,6 @@ nautilus_undo_manager_initialize_class (NautilusUndoManagerClass *klass)
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
/* nautilus_undo_manager_undo_last_transaction */
static void
nautilus_undo_manager_undo (NautilusUndoManager *manager)
{
......@@ -255,7 +242,7 @@ nautilus_undo_manager_undo (NautilusUndoManager *manager)
CORBA_Object undo_transaction;
CORBA_Environment ev;
CORBA_exception_init(&ev);
CORBA_exception_init (&ev);
/* Verify we have a transaction to be undone */
if (manager->details->undo_list == NULL) {
......@@ -282,22 +269,22 @@ nautilus_undo_manager_undo (NautilusUndoManager *manager)
}
/* Fire off signal informing that an undo transaction has occurred */
gtk_signal_emit (GTK_OBJECT (manager), signals[UNDO_TRANSACTION_OCCURED]);
gtk_signal_emit (GTK_OBJECT (manager),
signals[UNDO_TRANSACTION_OCCURRED]);
CORBA_exception_free(&ev);
CORBA_exception_free (&ev);
}
#if 0
/* nautilus_undo_manager_redo_last_undone_transaction */
static void
static void
nautilus_undo_manager_redo (NautilusUndoManager *manager)
{
{
GList *list;
CORBA_Object redo_transaction;
CORBA_Object undo_transaction;
CORBA_Environment ev;
CORBA_exception_init(&ev);
CORBA_exception_init (&ev);
/* Are we allowing redo operations? */
if (manager->details->enable_redo) {
......@@ -323,21 +310,21 @@ nautilus_undo_manager_redo (NautilusUndoManager *manager)
Nautilus_Undo_Transaction_ref (undo_transaction, &ev);
nautilus_undo_manager_add_transaction (manager, undo_transaction);
CORBA_exception_free(&ev);
CORBA_exception_free (&ev);
}
#endif
/* nautilus_undo_manager_add_undo_transaction */
static void
nautilus_undo_manager_add_transaction (NautilusUndoManager *manager, Nautilus_Undo_Transaction transaction)
nautilus_undo_manager_add_transaction (NautilusUndoManager *manager,
Nautilus_Undo_Transaction transaction)
{
int length;
g_return_if_fail (transaction != NULL);
g_return_if_fail (NAUTILUS_IS_UNDO_MANAGER (manager));
g_return_if_fail (transaction != CORBA_OBJECT_NIL);
/* Check and see if we are over our queue limit */
length = g_list_length (manager->details->undo_list);
if (length >= manager->details->queue_depth) {
manager->details->undo_list = prune_undo_manager_list
(manager->details->undo_list,
......@@ -348,7 +335,8 @@ nautilus_undo_manager_add_transaction (NautilusUndoManager *manager, Nautilus_Un
manager->details->undo_list = g_list_append (manager->details->undo_list, transaction);
/* Fire off signal informing that an undo transaction has occurred */
gtk_signal_emit (GTK_OBJECT (manager), signals[UNDO_TRANSACTION_OCCURED]);
gtk_signal_emit (GTK_OBJECT (manager),
signals[UNDO_TRANSACTION_OCCURRED]);
}
/* nautilus_undo_manager_unregister_object
......@@ -356,7 +344,6 @@ nautilus_undo_manager_add_transaction (NautilusUndoManager *manager, Nautilus_Un
* Remove any transaction with object as target from
* the undo and redo queues
*/
gboolean
nautilus_undo_manager_unregister_object (GtkObject *object)
{
......@@ -366,10 +353,10 @@ nautilus_undo_manager_unregister_object (GtkObject *object)
GList *list;
int index, length;
Nautilus_Undo_Transaction transaction;
*/
CORBA_Environment ev;