Removed Added Added

* components/tree/Makefile.am:
	* components/tree/libmain.c: (tree_shlib_object_destroyed),
	(tree_shlib_make_object):
	* components/tree/main.c: (tree_exe_object_destroyed),
	(tree_exe_make_object), (main):
	* components/tree/nautilus-tree-view-iids.h:
	* components/tree/nautilus-tree-view.oafinfo: Removed
	* components/tree/nautilus-tree-view.oafinfo.exe: Added
	* components/tree/nautilus-tree-view.oafinfo.shlib: Added
	* configure.in:

	Added capability to build the tree view as either a shared library
	server or an executable server, as part of the plan to fix
	1647. However, using the shlib component causes massive
	instability in both the tree view and nautilus in general. I am
	leaving the executable component the default until I fix this.
This commit is contained in:
Maciej Stachowiak 2000-08-25 09:44:47 +00:00
parent aad9b52262
commit 711f91c997
11 changed files with 283 additions and 19 deletions

View file

@ -1,3 +1,22 @@
2000-08-25 Maciej Stachowiak <mjs@eazel.com>
* components/tree/Makefile.am:
* components/tree/libmain.c: (tree_shlib_object_destroyed),
(tree_shlib_make_object):
* components/tree/main.c: (tree_exe_object_destroyed),
(tree_exe_make_object), (main):
* components/tree/nautilus-tree-view-iids.h:
* components/tree/nautilus-tree-view.oafinfo: Removed
* components/tree/nautilus-tree-view.oafinfo.exe: Added
* components/tree/nautilus-tree-view.oafinfo.shlib: Added
* configure.in:
Added capability to build the tree view as either a shared library
server or an executable server, as part of the plan to fix
1647. However, using the shlib component causes massive
instability in both the tree view and nautilus in general. I am
leaving the executable component the default until I fix this.
Fri Aug 25 02:17:17 2000 George Lebl <jirka@5z.com>
* cut-n-paste-code/widgets/nautilus-druid/Makefile.am,

View file

@ -17,14 +17,7 @@ INCLUDES = \
oafdir = $(datadir)/oaf
oaf_DATA = \
nautilus-tree-view.oafinfo
bin_PROGRAMS = \
nautilus-tree-view
nautilus_tree_view_SOURCES = \
TREE_VIEW_COMMON_SOURCES = \
nautilus-tree-view.h \
nautilus-tree-view.c \
nautilus-tree-model.h \
@ -34,9 +27,38 @@ nautilus_tree_view_SOURCES = \
nautilus-tree-node.c \
nautilus-tree-expansion-state.h \
nautilus-tree-expansion-state.c \
$(NULL)
if TREE_VIEW_EXE_SERVER
OAFINFO_FILE = nautilus-tree-view.oafinfo.exe
bin_PROGRAMS = \
nautilus-tree-view
nautilus_tree_view_SOURCES = \
$(TREE_VIEW_COMMON_SOURCES) \
main.c \
$(NULL)
else
OAFINFO_FILE = nautilus-tree-view.oafinfo.shlib
lib_LTLIBRARIES = \
libnautilus-tree-view.la
libnautilus_tree_view_la_SOURCES = \
$(TREE_VIEW_COMMON_SOURCES) \
libmain.c \
$(NULL)
endif
nautilus_tree_view_LDADD = \
$(top_builddir)/libnautilus/libnautilus.la \
$(top_builddir)/libnautilus-extensions/libnautilus-extensions.la \
@ -47,4 +69,16 @@ nautilus_tree_view_LDADD = \
$(OAF_LIBS) \
$(NULL)
EXTRA_DIST = $(oaf_DATA)
EXTRA_DIST = nautilus-tree-view.oafinfo.shlib nautilus-tree-view.oafinfo.exe
install-data-hook: $(oaf_DATA)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(oafdir)
$(INSTALL_DATA) $(srcdir)/$(OAFINFO_FILE) $(DESTDIR)$(oafdir)/nautilus-tree-view.oafinfo
uninstall-local:
@$(NORMAL_UNINSTALL)
rm -f $(DESTDIR)$(oafdir)/nautilus-tree-view.oafinfo;

View file

@ -0,0 +1,14 @@
<oaf_info>
<oaf_server iid="OAFIID:nautilus_tree_view:2d826a6e-1669-4a45-94b8-23d65d22802d" type="shlib" location="libnautilus-tree-view.so">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/Unknown:1.0"/>
<item value="IDL:Bonobo/Control:1.0"/>
<item value="IDL:Nautilus/View:1.0"/>
</oaf_attribute>
<oaf_attribute name="name" type="string" value="Nautilus Tree view"/>
<oaf_attribute name="description" type="string" value="Nautilus Tree sidebar panel"/>
<oaf_attribute name="nautilus:sidebar_panel_name" type="string" value="Tree"/>
</oaf_server>
</oaf_info>

View file

@ -0,0 +1,14 @@
<oaf_info>
<oaf_server iid="OAFIID:nautilus_tree_view:2d826a6e-1669-4a45-94b8-23d65d22802d" type="shlib" location="libnautilus-tree-view.so">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/Unknown:1.0"/>
<item value="IDL:Bonobo/Control:1.0"/>
<item value="IDL:Nautilus/View:1.0"/>
</oaf_attribute>
<oaf_attribute name="name" type="string" value="Nautilus Tree view"/>
<oaf_attribute name="description" type="string" value="Nautilus Tree sidebar panel"/>
<oaf_attribute name="nautilus:sidebar_panel_name" type="string" value="Tree"/>
</oaf_server>
</oaf_info>

View file

@ -0,0 +1,14 @@
<oaf_info>
<oaf_server iid="OAFIID:nautilus_tree_view:2d826a6e-1669-4a45-94b8-23d65d22802d" type="shlib" location="libnautilus-tree-view.so">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/Unknown:1.0"/>
<item value="IDL:Bonobo/Control:1.0"/>
<item value="IDL:Nautilus/View:1.0"/>
</oaf_attribute>
<oaf_attribute name="name" type="string" value="Nautilus Tree view"/>
<oaf_attribute name="description" type="string" value="Nautilus Tree sidebar panel"/>
<oaf_attribute name="nautilus:sidebar_panel_name" type="string" value="Tree"/>
</oaf_server>
</oaf_info>

90
components/tree/libmain.c Normal file
View file

@ -0,0 +1,90 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
* Copyright (C) 2000 Eazel, Inc
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: Maciej Stachowiak
*/
/* libmain.c - object activation infrastructure for shared library
version of tree view. */
#include <config.h>
#include "nautilus-tree-view.h"
#include "nautilus-tree-view-iids.h"
#include <liboaf/liboaf.h>
#include <bonobo.h>
static void
tree_shlib_object_destroyed (GtkObject *object)
{
oaf_plugin_unuse (gtk_object_get_user_data (object));
}
static CORBA_Object
tree_shlib_make_object (PortableServer_POA poa,
const char *iid,
gpointer impl_ptr,
CORBA_Environment *ev)
{
NautilusTreeView *view;
NautilusView *nautilus_view;
if (strcmp (iid, TREE_VIEW_IID) != 0) {
return CORBA_OBJECT_NIL;
}
view = NAUTILUS_TREE_VIEW (gtk_object_new (NAUTILUS_TYPE_TREE_VIEW, NULL));
gtk_signal_connect (GTK_OBJECT (view), "destroy", tree_shlib_object_destroyed, NULL);
gtk_object_set_user_data (GTK_OBJECT (view), impl_ptr);
oaf_plugin_use (poa, impl_ptr);
nautilus_view = nautilus_tree_view_get_nautilus_view (view);
return CORBA_Object_duplicate (bonobo_object_corba_objref
(BONOBO_OBJECT (nautilus_view)), ev);
}
static const OAFPluginObject tree_plugin_list[] = {
{
TREE_VIEW_IID,
tree_shlib_make_object
},
{
NULL
}
};
const OAFPlugin OAF_Plugin_info = {
tree_plugin_list,
"Nautilus Tree Sidebar Panel"
};

View file

@ -28,6 +28,8 @@
#include "nautilus-tree-view.h"
#include "nautilus-tree-view-iids.h"
#include <libnautilus-extensions/nautilus-debug.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-init.h>
@ -38,8 +40,9 @@
static int object_count = 0;
static void
tree_object_destroyed (GtkObject *object)
tree_exe_object_destroyed (GtkObject *object)
{
object_count--;
if (object_count <= 0) {
@ -48,14 +51,14 @@ tree_object_destroyed (GtkObject *object)
}
static BonoboObject *
tree_make_object (BonoboGenericFactory *factory,
const char *iid,
void *closure)
tree_exe_make_object (BonoboGenericFactory *factory,
const char *iid,
void *closure)
{
NautilusTreeView *view;
NautilusView *nautilus_view;
if (strcmp (iid, "OAFIID:nautilus_tree_view:2d826a6e-1669-4a45-94b8-23d65d22802d")) {
if (strcmp (iid, TREE_VIEW_IID)) {
return NULL;
}
@ -65,11 +68,14 @@ tree_make_object (BonoboGenericFactory *factory,
nautilus_view = nautilus_tree_view_get_nautilus_view (view);
gtk_signal_connect (GTK_OBJECT (view), "destroy", tree_object_destroyed, NULL);
gtk_signal_connect (GTK_OBJECT (view), "destroy", tree_exe_object_destroyed, NULL);
return BONOBO_OBJECT (nautilus_view);
}
int
main (int argc, char *argv[])
{
@ -105,8 +111,8 @@ main (int argc, char *argv[])
bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
factory = bonobo_generic_factory_new_multi
("OAFIID:nautilus_tree_view_factory:79f93d13-d404-4ef6-8de2-b8a0045a96ab",
tree_make_object, NULL);
(TREE_VIEW_FACTORY_IID,
tree_exe_make_object, NULL);
do {
bonobo_main ();

View file

@ -0,0 +1,35 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
* Copyright (C) 2000 Eazel, Inc
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: Maciej Stachowiak <mjs@eazel.com>
*/
/* nautilus-tree-view-iids.h - IIDs for tree view */
#ifndef NAUTILUS_TREE_VIEW_IIDS_H
#define NAUTILUS_TREE_VIEW_IIDS_H
#define TREE_VIEW_IID "OAFIID:nautilus_tree_view:2d826a6e-1669-4a45-94b8-23d65d22802d"
#define TREE_VIEW_FACTORY_IID "OAFIID:nautilus_tree_view_factory:79f93d13-d404-4ef6-8de2-b8a0045a96ab"
#endif /* NAUTILUS_TREE_VIEW_IIDS_H */

View file

@ -14,7 +14,7 @@
<item value="IDL:Bonobo/Control:1.0"/>
<item value="IDL:Nautilus/View:1.0"/>
</oaf_attribute>
<oaf_attribute name="name" type="string" value="Nautilus Tample view"/>
<oaf_attribute name="name" type="string" value="Nautilus Tree view"/>
<oaf_attribute name="description" type="string" value="Nautilus Tree sidebar panel"/>
<oaf_attribute name="nautilus:sidebar_panel_name" type="string" value="Tree"/>
</oaf_server>

View file

@ -0,0 +1,14 @@
<oaf_info>
<oaf_server iid="OAFIID:nautilus_tree_view:2d826a6e-1669-4a45-94b8-23d65d22802d" type="shlib" location="libnautilus-tree-view.so">
<oaf_attribute name="repo_ids" type="stringv">
<item value="IDL:Bonobo/Unknown:1.0"/>
<item value="IDL:Bonobo/Control:1.0"/>
<item value="IDL:Nautilus/View:1.0"/>
</oaf_attribute>
<oaf_attribute name="name" type="string" value="Nautilus Tree view"/>
<oaf_attribute name="description" type="string" value="Nautilus Tree sidebar panel"/>
<oaf_attribute name="nautilus:sidebar_panel_name" type="string" value="Tree"/>
</oaf_server>
</oaf_info>

View file

@ -24,10 +24,23 @@ AC_ISC_POSIX
dnl ORBit
AM_PATH_ORBIT
dnl Tree view build as executable
TREE_VIEW_EXE_SERVER=1
AC_ARG_ENABLE(enable-tree-view-exe-server,
[ --enable-tree-view-exe-server Build tree as executable component instead of shlib],
TREE_VIEW_EXE_SERVER="$enableval",
TREE_VIEW_EXE_SERVER=1)
AM_CONDITIONAL(TREE_VIEW_EXE_SERVER, test "x$TREE_VIEW_EXE_SERVER" = "x1")
dnl
EAZEL_SERVICES=
AC_ARG_ENABLE(eazel-services,
[--enable-eazel-services Eazel services],
[ --enable-eazel-services Eazel services],
EAZEL_SERVICES=1
AC_DEFINE(EAZEL_SERVICES))
@ -550,6 +563,17 @@ echo "
Eazel services : NO"
;;
esac
dnl <= Tree view as exe or shlib =>
case "X$TREE_VIEW_EXE_SERVER" in
X1)
echo "
Tree View : Executable"
;;
*)
echo "
Tree View : Shared Library"
;;
esac
echo "=>"
dnl <= End of configuration summary =>