Commit a233c683 authored by Mike Engber's avatar Mike Engber
Browse files

Add the MetafileFactory to the main object factory.


	* libnautilus-extensions/nautilus-metafile-factory.c:
	(nautilus_metafile_factory_new), (free_factory_instance),
	(nautilus_metafile_factory_get_instance):
	* libnautilus-extensions/nautilus-metafile-factory.h:
	* src/Nautilus_shell.oaf.in:
	* src/nautilus-application.c: (manufactures), (create_object),
	(nautilus_application_startup):
	* src/nautilus-application.h:
	Add the MetafileFactory to the main object factory.
parent e115f75c
2001-02-05 Michael Engber <engber@eazel.com>
reviewed by: <delete if not using a buddy>
* libnautilus-extensions/nautilus-metafile-factory.c:
(nautilus_metafile_factory_new), (free_factory_instance),
(nautilus_metafile_factory_get_instance):
* libnautilus-extensions/nautilus-metafile-factory.h:
* src/Nautilus_shell.oaf.in:
* src/nautilus-application.c: (manufactures), (create_object),
(nautilus_application_startup):
* src/nautilus-application.h:
Add the MetafileFactory to the main object factory.
2001-02-05 Rebecca Schulman <rebecka@eazel.com>
reviewed by: Maciej Stachowiak <mjs@eazel.com>
......
......@@ -110,14 +110,35 @@ destroy (GtkObject *object)
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
}
NautilusMetafileFactory *
nautilus_meta_file_factory_new (void)
static NautilusMetafileFactory *
nautilus_metafile_factory_new (void)
{
NautilusMetafileFactory *metafile_factory;
metafile_factory = NAUTILUS_METAFILE_FACTORY (gtk_object_new (NAUTILUS_TYPE_METAFILE_FACTORY, NULL));
return metafile_factory;
}
static NautilusMetafileFactory *the_factory;
static void
free_factory_instance (void)
{
bonobo_object_unref (BONOBO_OBJECT (the_factory));
}
NautilusMetafileFactory *
nautilus_metafile_factory_get_instance (void)
{
if (the_factory == NULL) {
the_factory = nautilus_metafile_factory_new ();
g_atexit (free_factory_instance);
}
bonobo_object_ref (BONOBO_OBJECT (the_factory));
return the_factory;
}
static Nautilus_Metafile
corba_open (PortableServer_Servant servant,
const Nautilus_URI directory,
......
......@@ -44,6 +44,6 @@ typedef struct {
GtkType nautilus_metafile_factory_get_type (void);
NautilusMetafileFactory *nautilus_meta_file_factory_new (void);
NautilusMetafileFactory *nautilus_metafile_factory_get_instance (void);
#endif /* NAUTILUS_METAFILE_FACTORY_H */
......@@ -110,14 +110,35 @@ destroy (GtkObject *object)
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
}
NautilusMetafileFactory *
nautilus_meta_file_factory_new (void)
static NautilusMetafileFactory *
nautilus_metafile_factory_new (void)
{
NautilusMetafileFactory *metafile_factory;
metafile_factory = NAUTILUS_METAFILE_FACTORY (gtk_object_new (NAUTILUS_TYPE_METAFILE_FACTORY, NULL));
return metafile_factory;
}
static NautilusMetafileFactory *the_factory;
static void
free_factory_instance (void)
{
bonobo_object_unref (BONOBO_OBJECT (the_factory));
}
NautilusMetafileFactory *
nautilus_metafile_factory_get_instance (void)
{
if (the_factory == NULL) {
the_factory = nautilus_metafile_factory_new ();
g_atexit (free_factory_instance);
}
bonobo_object_ref (BONOBO_OBJECT (the_factory));
return the_factory;
}
static Nautilus_Metafile
corba_open (PortableServer_Servant servant,
const Nautilus_URI directory,
......
......@@ -44,6 +44,6 @@ typedef struct {
GtkType nautilus_metafile_factory_get_type (void);
NautilusMetafileFactory *nautilus_meta_file_factory_new (void);
NautilusMetafileFactory *nautilus_metafile_factory_get_instance (void);
#endif /* NAUTILUS_METAFILE_FACTORY_H */
......@@ -82,4 +82,13 @@
<oaf_attribute name="description" type="string" _value="Nautilus shell operations that can be done from subsequent command-line invocations"/>
</oaf_server>
<oaf_server iid="OAFIID:nautilus_metafile_factory:bc318c01-4106-4622-8d6c-b419ec89e4c6" type="factory" location="OAFIID:nautilus_factory:bd1e1862-92d7-4391-963e-37583f0daef3">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/Unknown:1.0"/>
<item value="IDL:Nautilus/MetafileFactory:1.0"/>
</oaf_attribute>
<oaf_attribute name="name" type="string" _value="Nautilus metafile factory"/>
<oaf_attribute name="description" type="string" _value="Produces metafile objects for accessing Nautilus metadata"/>
</oaf_server>
</oaf_info>
......@@ -82,4 +82,13 @@
<oaf_attribute name="description" type="string" _value="Nautilus shell operations that can be done from subsequent command-line invocations"/>
</oaf_server>
<oaf_server iid="OAFIID:nautilus_metafile_factory:bc318c01-4106-4622-8d6c-b419ec89e4c6" type="factory" location="OAFIID:nautilus_factory:bd1e1862-92d7-4391-963e-37583f0daef3">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/Unknown:1.0"/>
<item value="IDL:Nautilus/MetafileFactory:1.0"/>
</oaf_attribute>
<oaf_attribute name="name" type="string" _value="Nautilus metafile factory"/>
<oaf_attribute name="description" type="string" _value="Produces metafile objects for accessing Nautilus metadata"/>
</oaf_server>
</oaf_info>
......@@ -55,13 +55,14 @@
#include <libnautilus-extensions/nautilus-string-list.h>
#include <libnautilus-extensions/nautilus-undo-manager.h>
#include <libnautilus-extensions/nautilus-volume-monitor.h>
#include <libnautilus-extensions/nautilus-metafile-factory.h>
#include <liboaf/liboaf.h>
#define FACTORY_IID "OAFIID:nautilus_factory:bd1e1862-92d7-4391-963e-37583f0daef3"
#define ICON_VIEW_IID "OAFIID:nautilus_file_manager_icon_view:42681b21-d5ca-4837-87d2-394d88ecc058"
#define LIST_VIEW_IID "OAFIID:nautilus_file_manager_list_view:521e489d-0662-4ad7-ac3a-832deabe111c"
#define FACTORY_IID "OAFIID:nautilus_factory:bd1e1862-92d7-4391-963e-37583f0daef3"
#define ICON_VIEW_IID "OAFIID:nautilus_file_manager_icon_view:42681b21-d5ca-4837-87d2-394d88ecc058"
#define LIST_VIEW_IID "OAFIID:nautilus_file_manager_list_view:521e489d-0662-4ad7-ac3a-832deabe111c"
#define SEARCH_LIST_VIEW_IID "OAFIID:nautilus_file_manager_search_list_view:b186e381-198e-43cf-9c46-60b6bb35db0b"
#define SHELL_IID "OAFIID:nautilus_shell:cd5183b2-3913-4b74-9b8e-10528b0de08d"
#define SHELL_IID "OAFIID:nautilus_shell:cd5183b2-3913-4b74-9b8e-10528b0de08d"
static CORBA_boolean manufactures (PortableServer_Servant servant,
const CORBA_char *iid,
......@@ -106,7 +107,8 @@ manufactures (PortableServer_Servant servant,
|| strcmp (iid, NAUTILUS_DESKTOP_ICON_VIEW_IID) == 0
|| strcmp (iid, LIST_VIEW_IID) == 0
|| strcmp (iid, SEARCH_LIST_VIEW_IID) == 0
|| strcmp (iid, SHELL_IID) == 0;
|| strcmp (iid, SHELL_IID) == 0
|| strcmp (iid, METAFILE_FACTORY_IID) == 0;
}
static CORBA_Object
......@@ -134,6 +136,8 @@ create_object (PortableServer_Servant servant,
} else if (strcmp (iid, SHELL_IID) == 0) {
application = NAUTILUS_APPLICATION (((BonoboObjectServant *) servant)->bonobo_object);
object = BONOBO_OBJECT (nautilus_shell_new (application));
} else if (strcmp (iid, METAFILE_FACTORY_IID) == 0) {
object = BONOBO_OBJECT (nautilus_metafile_factory_get_instance ());
} else {
return CORBA_OBJECT_NIL;
}
......@@ -398,7 +402,7 @@ nautilus_application_startup (NautilusApplication *application,
detailed_message = _("Nautilus can't be used now. "
"Rebooting the computer or installing "
"Nautilus again may fix the problem.\n\n"
"OAF couldn't locate the Nautilus_Shell.oaf file. "
"OAF couldn't locate the Nautilus_shell.oaf file. "
"One cause of this seems to be an LD_LIBRARY_PATH "
"that does not include the oaf library's directory. "
"Another possible cause would be bad install "
......
......@@ -31,6 +31,7 @@
#include <libnautilus-extensions/nautilus-undo-manager.h>
#define NAUTILUS_DESKTOP_ICON_VIEW_IID "OAFIID:nautilus_file_manager_desktop_icon_view:8d8121b1-0f1e-400b-bf0d-5b0f4555f5e1"
#define METAFILE_FACTORY_IID "OAFIID:nautilus_metafile_factory:bc318c01-4106-4622-8d6c-b419ec89e4c6"
#define NAUTILUS_TYPE_APPLICATION (nautilus_application_get_type ())
#define NAUTILUS_APPLICATION(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_APPLICATION, NautilusApplication))
......
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