[monkey-bubble: 692/753] Merged the rest of my stuff from gnome-core/gnome-desktop + a lot of
- From: Sven Herzberg <herzi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [monkey-bubble: 692/753] Merged the rest of my stuff from gnome-core/gnome-desktop + a lot of
- Date: Wed, 14 Jul 2010 22:53:51 +0000 (UTC)
commit 6a06c6e25b7baceac6969e7eb8ff9a25ba806f7c
Author: Martin Baulig <baulig suse de>
Date: Tue Aug 28 22:13:18 2001 +0000
Merged the rest of my stuff from gnome-core/gnome-desktop + a lot of
2001-08-29 Martin Baulig <baulig suse de>
* bonobo-config-ditem.[ch]: Merged the rest of my stuff
from gnome-core/gnome-desktop + a lot of uncommitted changes
which were already sitting in my local tree for a few days.
* Foo.idl, foo-dist.desktop, foo-dist.xml: New files. This is
only used for the tests and not installed.
monikers/ChangeLog | 11 +++-
monikers/Foo.idl | 46 +++++++++++++++++
monikers/Makefile.am-50588 | 31 ++++++++++--
monikers/foo-dist.desktop | 59 ++++++++++++++++++++++
monikers/foo-dist.xml | 12 +++++
monikers/test-ditem.c | 118 +++++++++++++++++++++++++++++++++++++-------
6 files changed, 250 insertions(+), 27 deletions(-)
---
diff --git a/monikers/ChangeLog b/monikers/ChangeLog
index 496a018..873f500 100644
--- a/monikers/ChangeLog
+++ b/monikers/ChangeLog
@@ -1,6 +1,11 @@
-MARTIN! Please read your email, there is some mail from Anders about this
-reverting you should read and respond to before going further.
- -George
+2001-08-29 Martin Baulig <baulig suse de>
+
+ * bonobo-config-ditem.[ch]: Merged the rest of my stuff
+ from gnome-core/gnome-desktop + a lot of uncommitted changes
+ which were already sitting in my local tree for a few days.
+
+ * Foo.idl, foo-dist.desktop, foo-dist.xml: New files. This is
+ only used for the tests and not installed.
2001-08-28 Martin Baulig <baulig suse de>
diff --git a/monikers/Foo.idl b/monikers/Foo.idl
new file mode 100644
index 0000000..e6a460c
--- /dev/null
+++ b/monikers/Foo.idl
@@ -0,0 +1,46 @@
+#include <Gnome.idl>
+
+module Foo {
+
+ module Test {
+
+ struct Simple {
+ GNOME::LocalizedStringList Ignore;
+ short a;
+ long b;
+ };
+
+ };
+
+ module Desktop {
+
+ enum EntryType {
+ ENTRY_TYPE_UNKNOWN,
+ ENTRY_TYPE_APPLICATION,
+ ENTRY_TYPE_URL,
+ ENTRY_TYPE_LINK,
+ ENTRY_TYPE_FSDEVICE,
+ ENTRY_TYPE_MIMETYPE,
+ ENTRY_TYPE_DIRECTORY,
+ ENTRY_TYPE_SERVICE,
+ ENTRY_TYPE_SERVICETYPE,
+ ENTRY_TYPE_PANEL_APPLET,
+ ENTRY_TYPE_SEPARATOR
+ };
+
+ struct Entry {
+ GNOME::Encoding Encoding;
+ GNOME::LocalizedStringList Name;
+ GNOME::LocalizedStringList Comment;
+ string Icon;
+ string Exec;
+ string TryExec;
+ string URL;
+ GNOME::stringlist SortOrder;
+ GNOME::ExtraAttributes Attributes;
+ EntryType Type;
+ boolean Terminal;
+ };
+
+ };
+};
diff --git a/monikers/Makefile.am-50588 b/monikers/Makefile.am-50588
index 01472f7..c07f2a6 100644
--- a/monikers/Makefile.am-50588
+++ b/monikers/Makefile.am-50588
@@ -12,11 +12,23 @@ INCLUDES = \
-DLIBGNOME_LOCALEDIR=\""$(gnomelocaledir)"\" \
-DLIBGNOME_SYSCONFDIR=\""$(sysconfdir)"\" \
-DVERSION=\""$(VERSION)"\" \
+ -DMONIKER_SRCDIR=\""$(MONIKER_SRCDIR)"\" \
-DG_LOG_DOMAIN=\"GnomeMonikers\"
EXTRA_DIST = \
Bonobo_Moniker_ditem.server.in
+CORBA_SRCLIST = \
+ Foo-stubs.c Foo-skels.c Foo-common.c Foo.h
+
+# try to make these get cleaned properly
+CLEANFILES += $(CORBA_SRCLIST)
+
+$(CORBA_SRCLIST): $(srcdir)/Foo.idl $(ORBIT_IDL)
+ $(ORBIT_IDL) -I $(BONOBO_IDLDIR) -I $(top_srcdir)/idl $(srcdir)/Foo.idl
+
+BUILT_SOURCES = $(CORBA_SRCLIST)
+
Bonobo_Moniker_ditem.server.in: Bonobo_Moniker_ditem.server.in.in
sed -e "s|\ MONIKER_BINDIR\@|$(bindir)|" $< > $@
@@ -32,9 +44,7 @@ server_DATA = Bonobo_Moniker_ditem.server
bonobo_moniker_ditem_SOURCES = \
bonobo-moniker-ditem.c \
bonobo-config-ditem.c \
- bonobo-config-ditem.h \
- bonobo-config-ditem-utils.c \
- bonobo-config-ditem-utils.h
+ bonobo-config-ditem.h
bonobo_moniker_ditem_LDADD = \
../libgnome/libgnome-2.la \
@@ -45,13 +55,24 @@ bonobo_moniker_ditem_LDADD = \
noinst_PROGRAMS = test-ditem
test_ditem_SOURCES = \
+ $(CORBA_SRCLIST) \
bonobo-config-ditem.c \
bonobo-config-ditem.h \
- bonobo-config-ditem-utils.c \
- bonobo-config-ditem-utils.h \
test-ditem.c
test_ditem_LDADD = \
../libgnome/libgnome-2.la \
$(MONIKER_LIBS)
+foo.xml: foo-dist.xml
+ -rm -f foo.xml
+ cp $< $@
+
+foo.desktop: foo-dist.desktop
+ -rm -f foo.desktop
+ cp $< $@
+
+CLEANFILES += foo.xml foo.desktop
+
+test-ditem: foo.xml foo.desktop
+
diff --git a/monikers/foo-dist.desktop b/monikers/foo-dist.desktop
new file mode 100644
index 0000000..b0695e8
--- /dev/null
+++ b/monikers/foo-dist.desktop
@@ -0,0 +1,59 @@
+[Desktop Entry]
+Name=Panel
+Name[cs]=Panel
+Name[da]=Panel
+Name[de]=Panel
+Name[el]=Ôáìðëþ
+Name[es]=Panel
+Name[fi]=Paneeli
+Name[fr]=Tableau de bord
+Name[ga]=Painéal
+Name[gl]=Panel
+Name[it]=Pannello
+Name[ja]=¥Ñ¥Í¥ë
+Name[lt]=Skydelis
+Name[nn]=Panel
+Name[no]=Panel
+Name[pl]=Panel
+Name[pt_BR]=Painel
+Name[ro]=Panel
+Name[sk]=Panel
+Name[sl]=Pult
+Name[sv]=Panel
+Name[tr]=Panel
+Name[uk]=ðÁÎÅÌØ
+Name[wa]=Scriftôr
+Name[zh_TW.Big5]=±ªO
+Comment=Global panel properties
+Comment[cs]=Globální vlastnosti panelu
+Comment[da]=Globale panelegenskaber
+Comment[de]=Globale Eigenschaften des Panels festlegen
+Comment[el]=ÊáèïëéêÝò ñõèìßóåéò ôáìðëþ
+Comment[es]=Propiedades globales del panel
+Comment[fi]=Paneelin yleiset asetukset
+Comment[fr]=Propriétés globales du tableau de bord
+Comment[ga]=Cumraigh Painéal
+Comment[gl]=Propiedades globais do panel
+Comment[it]=Configurazione globalel del pannello
+Comment[ja]=¥Ñ¥Í¥ëÁ´È̤ÎÀßÄê
+Comment[lt]=Bendros skydeliø savybës
+Comment[no]=Globale eigeskaper for panelet
+Comment[no]=Globale egenskaper for panelet
+Comment[pl]=Konfiguracja panelu GNOME
+Comment[pt_BR]=Propriedades globais do painel
+Comment[ro]=Proprietãþi globale ale panelului
+Comment[sk]=Globálne vlastnosti panelu
+Comment[sl]=Globalne lastnosti pulta
+Comment[sv]=Globala panelegenskaper
+Comment[tr]=Panellerin genel ayarlarý
+Comment[uk]=çÌÏÂÁÌØΦ ×ÌÁÓÔÉ×ÏÓÔ¦ ÐÁÎÅ̦
+Comment[wa]=Prôpietés globåles do scriftôr
+Comment[zh_TW.Big5]=¾ãÅ鱪O³]©w¤º®e
+Exec=gnome-panel-properties-capplet
+Icon=gnome-panel.png
+Terminal=0
+Type=Application
+
+[Simple]
+a=28
+b=59234
diff --git a/monikers/foo-dist.xml b/monikers/foo-dist.xml
new file mode 100644
index 0000000..b5eb4f9
--- /dev/null
+++ b/monikers/foo-dist.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<bonobo-config>
+ <section path="URL Handlers">
+ <entry name="default-show" type="string" value="konqueror"/>
+ </section>
+ <section path="/Gnome/Applications">
+ <entry name="Terminal" type="string" value="konsole -e"/>
+ </section>
+ <section path="Foo">
+ <entry name="Test" type="long" value="0"/>
+ </section>
+</bonobo-config>
diff --git a/monikers/test-ditem.c b/monikers/test-ditem.c
index 6607ca1..e1a0c2f 100644
--- a/monikers/test-ditem.c
+++ b/monikers/test-ditem.c
@@ -5,8 +5,30 @@
#include <stdlib.h>
#include "bonobo-config-ditem.h"
+#include "Foo.h"
-#if 0
+#define USE_BUILTIN_MONIKER 1
+
+static void G_GNUC_UNUSED
+boot_ditem (Bonobo_ConfigDatabase db)
+{
+ BonoboArg *arg;
+ CORBA_Environment ev;
+
+ arg = bonobo_arg_new (TC_Foo_Desktop_Entry);
+ bonobo_pbclient_set_value (db, "/Desktop Entry", arg, NULL);
+ bonobo_arg_release (arg);
+
+ arg = bonobo_arg_new (TC_Foo_Test_Simple);
+ bonobo_pbclient_set_value (db, "/Simple", arg, NULL);
+ bonobo_arg_release (arg);
+
+ CORBA_exception_init (&ev);
+ Bonobo_ConfigDatabase_sync (db, &ev);
+ CORBA_exception_free (&ev);
+}
+
+#ifdef USE_BUILTIN_MONIKER
static void
test_builtin (void)
{
@@ -16,22 +38,31 @@ test_builtin (void)
BonoboArg *value;
gchar *string;
- db = bonobo_config_ditem_new ("/tmp/test.desktop");
- g_assert (db != CORBA_OBJECT_NIL);
-
CORBA_exception_init (&ev);
- parent_db = bonobo_get_object ("xmldb:/tmp/foo.xmldb", "Bonobo/ConfigDatabase", &ev);
+ parent_db = bonobo_get_object ("xmldb:" MONIKER_SRCDIR "/foo.xml", "Bonobo/ConfigDatabase", &ev);
g_assert (!BONOBO_EX (&ev) && parent_db != CORBA_OBJECT_NIL);
CORBA_exception_free (&ev);
- CORBA_exception_init (&ev);
- Bonobo_ConfigDatabase_addDatabase (db, parent_db, "",
- Bonobo_ConfigDatabase_DEFAULT, &ev);
- g_assert (!BONOBO_EX (&ev));
- CORBA_exception_free (&ev);
+ db = bonobo_config_ditem_new (MONIKER_SRCDIR "/foo.desktop", parent_db, &ev);
+ g_assert (!BONOBO_EX (&ev) && db != CORBA_OBJECT_NIL);
}
#endif
+static void
+print_simple (Foo_Test_Simple *simple)
+{
+ g_message (G_STRLOC ": %p => %u - %lu", simple,
+ (unsigned) simple->a, (unsigned long) simple->b);
+}
+
+static void
+print_ditem (Foo_Desktop_Entry *entry)
+{
+ g_message (G_STRLOC ": %p", entry);
+
+ g_message (G_STRLOC ": |%s| - |%s| - |%s|", entry->Exec, entry->Icon, entry->URL);
+}
+
int
main (int argc, char **argv)
{
@@ -53,21 +84,23 @@ main (int argc, char **argv)
bonobo_activate ();
- // test_builtin ();
-
-#if 1
- db = bonobo_config_ditem_new ("/tmp/test.desktop");
-#else
CORBA_exception_init (&ev);
- db = bonobo_get_object ("ditem:/tmp/test.desktop", "Bonobo/ConfigDatabase", &ev);
+ default_db = bonobo_get_object ("xmldb:" MONIKER_SRCDIR "/foo.xml", "Bonobo/ConfigDatabase", &ev);
g_assert (!BONOBO_EX (&ev));
CORBA_exception_free (&ev);
-#endif
+
+#ifdef USE_BUILTIN_MONIKER
+ test_builtin ();
CORBA_exception_init (&ev);
- default_db = bonobo_get_object ("xmldb:/tmp/foo.xml", "Bonobo/ConfigDatabase", &ev);
+ db = bonobo_config_ditem_new (MONIKER_SRCDIR "/foo.desktop", default_db, &ev);
+ g_assert (!BONOBO_EX (&ev));
+#else
+ CORBA_exception_init (&ev);
+ db = bonobo_get_object ("ditem:" MONIKER_SRCDIR "/foo.desktop", "Bonobo/ConfigDatabase", &ev);
g_assert (!BONOBO_EX (&ev));
CORBA_exception_free (&ev);
+#endif
g_assert (db != NULL);
g_assert (default_db != NULL);
@@ -77,6 +110,8 @@ main (int argc, char **argv)
Bonobo_ConfigDatabase_DEFAULT, &ev);
g_assert (!BONOBO_EX (&ev));
+ boot_ditem (default_db);
+
dirlist = Bonobo_ConfigDatabase_getDirs (db, "", &ev);
g_assert (!BONOBO_EX (&ev));
@@ -109,7 +144,7 @@ main (int argc, char **argv)
CORBA_exception_init (&ev);
value = bonobo_pbclient_get_value (db, "/Foo/Test", TC_CORBA_long, &ev);
if (value) {
- printf ("got value as long %d\n", BONOBO_ARG_GET_LONG (value));
+ printf ("got value as long %d\n", BONOBO_ARG_GET_LONG (value));
BONOBO_ARG_SET_LONG (value, 512);
bonobo_pbclient_set_value (db, "/Foo/Test", value, &ev);
}
@@ -154,10 +189,55 @@ main (int argc, char **argv)
g_message (G_STRLOC ": |%s|", string);
bonobo_pbclient_set_string (db, "/Desktop Entry/URL", "http://www.gnome.org/", NULL);
+ CORBA_exception_init (&ev);
+ value = bonobo_pbclient_get_value (db, "/Simple", TC_Foo_Test_Simple, &ev);
+ g_message (G_STRLOC ": %p", value);
+ if (value) {
+ Foo_Test_Simple simple;
+
+ printf ("got value as Foo::Test::Simple\n");
+
+ simple = BONOBO_ARG_GET_GENERAL (value, TC_Foo_Test_Simple, Foo_Test_Simple, NULL);
+
+ print_simple (&simple);
+ }
+
+ CORBA_exception_free (&ev);
+
CORBA_exception_init (&ev);
Bonobo_ConfigDatabase_sync (db, &ev);
g_assert (!BONOBO_EX (&ev));
CORBA_exception_free (&ev);
+ CORBA_exception_init (&ev);
+ value = bonobo_pbclient_get_value (db, "/Simple", TC_Foo_Test_Simple, &ev);
+ g_message (G_STRLOC ": %p", value);
+ if (value) {
+ Foo_Test_Simple simple;
+
+ printf ("got value as Foo::Test::Simple\n");
+
+ simple = BONOBO_ARG_GET_GENERAL (value, TC_Foo_Test_Simple, Foo_Test_Simple, NULL);
+
+ print_simple (&simple);
+ }
+
+ CORBA_exception_free (&ev);
+
+ CORBA_exception_init (&ev);
+ value = bonobo_pbclient_get_value (db, "/Desktop Entry", TC_Foo_Desktop_Entry, &ev);
+ g_message (G_STRLOC ": %p", value);
+ if (value) {
+ Foo_Desktop_Entry entry;
+
+ printf ("got value as Foo::Desktop::Entry\n");
+
+ entry = BONOBO_ARG_GET_GENERAL (value, TC_Foo_Desktop_Entry, Foo_Desktop_Entry, NULL);
+
+ print_ditem (&entry);
+ }
+
+ CORBA_exception_free (&ev);
+
exit (0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]