[monkey-bubble: 382/753] This is a "ditem" moniker for bonobo-config which can read and write



commit 91c13ee9f50340bd5258d63c8b5430f7b6969692
Author: Martin Baulig <baulig suse de>
Date:   Tue Jun 5 12:15:35 2001 +0000

    This is a "ditem" moniker for bonobo-config which can read and write
    
    2001-06-05  Martin Baulig  <baulig suse de>
    
    	This is a "ditem" moniker for bonobo-config which can read
    	and write .desktop files from GNOME 1.4 and KDE.

 monikers/.cvsignore                  |    8 ++
 monikers/Bonobo_Moniker_ditem.oaf.in |  154 ++++++++++++++++++++++++++++++++++
 monikers/ChangeLog                   |    5 +
 monikers/test-ditem.c                |  117 ++++++++++++++++++++++++++
 4 files changed, 284 insertions(+), 0 deletions(-)
---
diff --git a/monikers/.cvsignore b/monikers/.cvsignore
new file mode 100644
index 0000000..50d22b5
--- /dev/null
+++ b/monikers/.cvsignore
@@ -0,0 +1,8 @@
+Makefile.in
+Makefile
+.deps
+.libs
+*.la
+*.lo
+*.oaf
+test-ditem
diff --git a/monikers/Bonobo_Moniker_ditem.oaf.in b/monikers/Bonobo_Moniker_ditem.oaf.in
new file mode 100644
index 0000000..195c084
--- /dev/null
+++ b/monikers/Bonobo_Moniker_ditem.oaf.in
@@ -0,0 +1,154 @@
+<oaf_info>
+
+<oaf_server iid="OAFIID:Bonobo_Moniker_ditem_Factory" type="shlib" location="@MONIKER_LIBDIR@/libmoniker_ditem.so">
+	<oaf_attribute name="repo_ids" type="stringv">
+		<item value="IDL:GNOME/GenericFactory:1.0"/>
+	</oaf_attribute>
+
+	<oaf_attribute name="name" type="string" value="Ditemuration Moniker factory"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:Bonobo_Moniker_ditem" type="factory"
+	location="OAFIID:Bonobo_Moniker_ditem_Factory">
+	<oaf_attribute name="repo_ids" type="stringv">
+		<item value="IDL:Bonobo/Moniker:1.0"/>
+		<item value="IDL:Bonobo/Unknown:1.0"/>
+	</oaf_attribute>
+	<oaf_attribute name="name" type="string" value="Ditemuration Moniker"/>
+	<oaf_attribute name="bonobo:moniker" type="stringv">
+		<item value="ditem:"/>
+	</oaf_attribute>
+</oaf_server>
+
+<oaf_server iid="OAFIID:Bonobo_PropertyEditor_short" type="factory"
+	location="OAFIID:Bonobo_Moniker_ditem_Factory">
+	<oaf_attribute name="repo_ids" type="stringv">
+		<item value="IDL:Bonobo/PropertyEditor:1.0"/>
+		<item value="IDL:Bonobo/Control:1.0"/>
+		<item value="IDL:Bonobo/Unknown:1.0"/>
+	</oaf_attribute>
+	<oaf_attribute name="name" type="string" value="PropertyEditor short"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:Bonobo_PropertyEditor_ushort" type="factory"
+	location="OAFIID:Bonobo_Moniker_ditem_Factory">
+	<oaf_attribute name="repo_ids" type="stringv">
+		<item value="IDL:Bonobo/PropertyEditor:1.0"/>
+		<item value="IDL:Bonobo/Control:1.0"/>
+		<item value="IDL:Bonobo/Unknown:1.0"/>
+	</oaf_attribute>
+	<oaf_attribute name="name" type="string" value="PropertyEditor ushort"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:Bonobo_PropertyEditor_long" type="factory"
+	location="OAFIID:Bonobo_Moniker_ditem_Factory">
+	<oaf_attribute name="repo_ids" type="stringv">
+		<item value="IDL:Bonobo/PropertyEditor:1.0"/>
+		<item value="IDL:Bonobo/Control:1.0"/>
+		<item value="IDL:Bonobo/Unknown:1.0"/>
+	</oaf_attribute>
+	<oaf_attribute name="name" type="string" value="PropertyEditor long"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:Bonobo_PropertyEditor_ulong" type="factory"
+	location="OAFIID:Bonobo_Moniker_ditem_Factory">
+	<oaf_attribute name="repo_ids" type="stringv">
+		<item value="IDL:Bonobo/PropertyEditor:1.0"/>
+		<item value="IDL:Bonobo/Control:1.0"/>
+		<item value="IDL:Bonobo/Unknown:1.0"/>
+	</oaf_attribute>
+	<oaf_attribute name="name" type="string" value="PropertyEditor ulong"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:Bonobo_PropertyEditor_float" type="factory"
+	location="OAFIID:Bonobo_Moniker_ditem_Factory">
+	<oaf_attribute name="repo_ids" type="stringv">
+		<item value="IDL:Bonobo/PropertyEditor:1.0"/>
+		<item value="IDL:Bonobo/Control:1.0"/>
+		<item value="IDL:Bonobo/Unknown:1.0"/>
+	</oaf_attribute>
+	<oaf_attribute name="name" type="string" value="PropertyEditor float"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:Bonobo_PropertyEditor_double" type="factory"
+	location="OAFIID:Bonobo_Moniker_ditem_Factory">
+	<oaf_attribute name="repo_ids" type="stringv">
+		<item value="IDL:Bonobo/PropertyEditor:1.0"/>
+		<item value="IDL:Bonobo/Control:1.0"/>
+		<item value="IDL:Bonobo/Unknown:1.0"/>
+	</oaf_attribute>
+	<oaf_attribute name="name" type="string" value="PropertyEditor double"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:Bonobo_PropertyEditor_string" type="factory"
+	location="OAFIID:Bonobo_Moniker_ditem_Factory">
+	<oaf_attribute name="repo_ids" type="stringv">
+		<item value="IDL:Bonobo/PropertyEditor:1.0"/>
+		<item value="IDL:Bonobo/Control:1.0"/>
+		<item value="IDL:Bonobo/Unknown:1.0"/>
+	</oaf_attribute>
+	<oaf_attribute name="name" type="string" value="PropertyEditor string"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:Bonobo_PropertyEditor_boolean" type="factory"
+	location="OAFIID:Bonobo_Moniker_ditem_Factory">
+	<oaf_attribute name="repo_ids" type="stringv">
+		<item value="IDL:Bonobo/PropertyEditor:1.0"/>
+		<item value="IDL:Bonobo/Control:1.0"/>
+		<item value="IDL:Bonobo/Unknown:1.0"/>
+	</oaf_attribute>
+	<oaf_attribute name="name" type="string" value="PropertyEditor boolean"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:Bonobo_PropertyEditor_enum" type="factory"
+	location="OAFIID:Bonobo_Moniker_ditem_Factory">
+	<oaf_attribute name="repo_ids" type="stringv">
+		<item value="IDL:Bonobo/PropertyEditor:1.0"/>
+		<item value="IDL:Bonobo/Control:1.0"/>
+		<item value="IDL:Bonobo/Unknown:1.0"/>
+	</oaf_attribute>
+	<oaf_attribute name="name" type="string" value="PropertyEditor enum"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:Bonobo_PropertyEditor_struct" type="factory"
+	location="OAFIID:Bonobo_Moniker_ditem_Factory">
+	<oaf_attribute name="repo_ids" type="stringv">
+		<item value="IDL:Bonobo/PropertyEditor:1.0"/>
+		<item value="IDL:Bonobo/Control:1.0"/>
+		<item value="IDL:Bonobo/Unknown:1.0"/>
+	</oaf_attribute>
+	<oaf_attribute name="name" type="string" value="PropertyEditor struct"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:Bonobo_PropertyEditor_sequence" type="factory"
+	location="OAFIID:Bonobo_Moniker_ditem_Factory">
+	<oaf_attribute name="repo_ids" type="stringv">
+		<item value="IDL:Bonobo/PropertyEditor:1.0"/>
+		<item value="IDL:Bonobo/Control:1.0"/>
+		<item value="IDL:Bonobo/Unknown:1.0"/>
+	</oaf_attribute>
+	<oaf_attribute name="name" type="string" value="PropertyEditor sequence"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:Bonobo_PropertyEditor_default" type="factory"
+	location="OAFIID:Bonobo_Moniker_ditem_Factory">
+	<oaf_attribute name="repo_ids" type="stringv">
+		<item value="IDL:Bonobo/PropertyEditor:1.0"/>
+		<item value="IDL:Bonobo/Control:1.0"/>
+		<item value="IDL:Bonobo/Unknown:1.0"/>
+	</oaf_attribute>
+	<oaf_attribute name="name" type="string" value="PropertyEditor default"/>
+</oaf_server>
+
+<oaf_server iid="OAFIID:Bonobo_PropertyEditor_IDL:Bonobo/FileName:1.0" 
+	type="factory" location="OAFIID:Bonobo_Moniker_ditem_Factory">
+	<oaf_attribute name="repo_ids" type="stringv">
+		<item value="IDL:Bonobo/PropertyEditor:1.0"/>
+		<item value="IDL:Bonobo/Control:1.0"/>
+		<item value="IDL:Bonobo/Unknown:1.0"/>
+	</oaf_attribute>
+	<oaf_attribute name="name" type="string" value="PropertyEditor for file
+	names"/>
+</oaf_server>
+
+</oaf_info>
diff --git a/monikers/ChangeLog b/monikers/ChangeLog
new file mode 100644
index 0000000..5416fb9
--- /dev/null
+++ b/monikers/ChangeLog
@@ -0,0 +1,5 @@
+2001-06-05  Martin Baulig  <baulig suse de>
+
+	This is a "ditem" moniker for bonobo-config which can read
+	and write .desktop files from GNOME 1.4 and KDE.
+
diff --git a/monikers/test-ditem.c b/monikers/test-ditem.c
new file mode 100644
index 0000000..ac504e7
--- /dev/null
+++ b/monikers/test-ditem.c
@@ -0,0 +1,117 @@
+#include <libbonobo.h>
+
+#include "bonobo-config-ditem.h"
+
+int
+main (int argc, char **argv)
+{
+	Bonobo_ConfigDatabase db = NULL;
+        CORBA_Environment  ev;
+	CORBA_any *value;
+
+        CORBA_exception_init (&ev);
+
+	if (bonobo_init (&argc, argv) == FALSE)
+		g_error ("Cannot init bonobo");
+
+	db = bonobo_config_ditem_new ("/tmp/t.desktop");
+
+	g_assert (db != NULL);
+
+	value = bonobo_pbclient_get_value (db, "/test", TC_long, &ev);
+
+	if (value) {
+		printf ("got value %d\n", BONOBO_ARG_GET_LONG (value));
+	}
+        CORBA_exception_init (&ev);
+
+	value = bonobo_pbclient_get_value (db, "/storagetype",
+					   TC_Bonobo_StorageType, &ev);
+	if (value) {
+		printf ("got value\n");
+	}
+        CORBA_exception_init (&ev);
+
+	value = bonobo_arg_new (TC_long);
+	BONOBO_ARG_SET_LONG (value, 5);
+	
+	Bonobo_ConfigDatabase_setValue (db, "/test", value, &ev);
+	g_assert (!BONOBO_EX (&ev));
+
+	Bonobo_ConfigDatabase_setValue (db, "/test/level2", value, &ev);
+	g_assert (!BONOBO_EX (&ev));
+
+	Bonobo_ConfigDatabase_setValue (db, "/test/level21", value, &ev);
+	g_assert (!BONOBO_EX (&ev));
+
+	Bonobo_ConfigDatabase_setValue (db, "/test/level3/level3", value, &ev);
+	g_assert (!BONOBO_EX (&ev));
+
+	Bonobo_ConfigDatabase_setValue (db, "/bonobo/test1", value, &ev);
+	g_assert (!BONOBO_EX (&ev));
+
+	value = bonobo_arg_new (TC_Bonobo_StorageType);
+	
+	Bonobo_ConfigDatabase_setValue (db, "/storagetype", value, &ev);
+	g_assert (!BONOBO_EX (&ev));
+
+	value = bonobo_arg_new (TC_string);
+	BONOBO_ARG_SET_STRING (value, "a simple test");
+	Bonobo_ConfigDatabase_setValue (db, "a/b/c/d", value, &ev);
+	g_assert (!BONOBO_EX (&ev));
+
+	Bonobo_ConfigDatabase_removeDir (db, "/", &ev);
+	g_assert (!BONOBO_EX (&ev));
+
+	value = bonobo_arg_new (TC_long);
+	BONOBO_ARG_SET_LONG (value, 5);
+	
+	Bonobo_ConfigDatabase_setValue (db, "/test", value, &ev);
+	g_assert (!BONOBO_EX (&ev));
+
+	Bonobo_ConfigDatabase_setValue (db, "/test/level2", value, &ev);
+	g_assert (!BONOBO_EX (&ev));
+
+	Bonobo_ConfigDatabase_setValue (db, "/test/level21", value, &ev);
+	g_assert (!BONOBO_EX (&ev));
+
+	Bonobo_ConfigDatabase_setValue (db, "/test/level3/level3", value, &ev);
+	g_assert (!BONOBO_EX (&ev));
+
+
+	value = bonobo_arg_new (TC_Bonobo_StorageType);
+	Bonobo_ConfigDatabase_setValue (db, "/storagetype", value, &ev);
+	g_assert (!BONOBO_EX (&ev));
+
+	Bonobo_ConfigDatabase_sync (db, &ev);
+	g_assert (!BONOBO_EX (&ev));
+
+
+	/*
+	{
+		BonoboConfigBag     *config_bag;
+		Bonobo_Unknown       bag, v;
+		char *name;
+
+		config_bag = bonobo_config_bag_new (db, "/bonobo");
+
+		g_assert (config_bag);
+
+		bag = BONOBO_OBJREF (config_bag);
+
+		prop =Bonobo_PropertyBag_getPropertyByName (bag, "test1", &ev);
+		g_assert (!BONOBO_EX (&ev));
+	    
+	
+		printf("TEST3\n");
+		name = Bonobo_Property_getName (prop, &ev);
+		printf("TEST3e %s\n", name);
+		g_assert (!BONOBO_EX (&ev));
+
+
+	}
+	*/
+		
+
+	exit (0);
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]