[monkey-bubble: 146/753] Moved this function here; it was previously in gnome-program.c, but



commit 9c1317f7defe9a6dce6df77a7b812fa31d36d082
Author: Martin Baulig <baulig suse de>
Date:   Sun Apr 15 16:44:58 2001 +0000

    Moved this function here; it was previously in gnome-program.c, but
    
    2001-04-15  Martin Baulig  <baulig suse de>
    
    	* libgnome-init.c (gnome_program_get_gconf_client): Moved this function
    	here; it was previously in gnome-program.c, but gnome-program.c is now
    	in libgnomebase and thus cannot use gconf anymore.
    
    	* libgnome-init.h: New public header file.
    	(GNOME_PARAM_GCONF_CLIENT): Moved this #define here.
    	(gnome_program_get_gconf_client): Provide external declaration.
    	(gnome_oaf_module_info, gnome_gconf_module_info, gnome_vfs_module_info,
    	libgnome_module_info): Moved external declarations here from libgnome.h.
    
    	* libgnome.h: #include <libgnome/libgnome-init.h>.

 libgnome/ChangeLog    |   14 ++++++++++++++
 libgnome/Makefile.am  |    1 +
 libgnome/gnome-init.c |   19 +++++++++++++++++++
 libgnome/gnome-init.h |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 libgnome/libgnome.h   |    5 +----
 5 files changed, 83 insertions(+), 4 deletions(-)
---
diff --git a/libgnome/ChangeLog b/libgnome/ChangeLog
index 6b0ec7d..c95af4e 100644
--- a/libgnome/ChangeLog
+++ b/libgnome/ChangeLog
@@ -1,5 +1,19 @@
 2001-04-15  Martin Baulig  <baulig suse de>
 
+	* libgnome-init.c (gnome_program_get_gconf_client): Moved this function
+	here; it was previously in gnome-program.c, but gnome-program.c is now
+	in libgnomebase and thus cannot use gconf anymore.
+
+	* libgnome-init.h: New public header file.
+	(GNOME_PARAM_GCONF_CLIENT): Moved this #define here.
+	(gnome_program_get_gconf_client): Provide external declaration.
+	(gnome_oaf_module_info, gnome_gconf_module_info, gnome_vfs_module_info,
+	libgnome_module_info): Moved external declarations here from libgnome.h.
+
+	* libgnome.h: #include <libgnome/libgnome-init.h>.
+
+2001-04-15  Martin Baulig  <baulig suse de>
+
 	* libgnome-2.0.pc.in: Depend on libgnomebase-2.
 
 2001-04-15  Martin Baulig  <baulig suse de>
diff --git a/libgnome/Makefile.am b/libgnome/Makefile.am
index 926554f..7715ccc 100644
--- a/libgnome/Makefile.am
+++ b/libgnome/Makefile.am
@@ -63,6 +63,7 @@ libgnome_headers = \
 	gnome-url.h		\
 	gnome-util.h   		\
 	gnome-paper.h		\
+	libgnome-init.h		\
 	libgnome.h
 
 libgnomeinclude_HEADERS = \
diff --git a/libgnome/gnome-init.c b/libgnome/gnome-init.c
index 62907ab..deda01d 100644
--- a/libgnome/gnome-init.c
+++ b/libgnome/gnome-init.c
@@ -39,6 +39,8 @@
 #include <gconf/gconf-client.h>
 extern struct poptOption gconf_options[];
 
+#include <libgnome/libgnome-init.h>
+
 #include "libgnomeP.h"
 #include <errno.h>
 
@@ -91,6 +93,23 @@ typedef struct {
     GConfClient *client;
 } GnomeProgramPrivate_gnome_gconf;
 
+GConfClient *
+gnome_program_get_gconf_client (GnomeProgram *program)
+{
+    GValue value = { 0, };
+    GConfClient *retval = NULL;
+
+    g_return_val_if_fail (program != NULL, NULL);
+    g_return_val_if_fail (GNOME_IS_PROGRAM (program), NULL);
+
+    g_value_init (&value, GCONF_TYPE_CLIENT);
+    g_object_get_property (G_OBJECT (program), GNOME_PARAM_GCONF_CLIENT, &value);
+    retval = (GConfClient *) g_value_dup_object (&value);
+    g_value_unset (&value);
+
+    return retval;
+}
+
 static gchar *
 gnome_gconf_get_gnome_libs_settings_relative (const gchar *subkey)
 {
diff --git a/libgnome/gnome-init.h b/libgnome/gnome-init.h
new file mode 100644
index 0000000..e5c1746
--- /dev/null
+++ b/libgnome/gnome-init.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
+ * All rights reserved.
+ *
+ * This file is part of the Gnome Library.
+ *
+ * The Gnome Library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * The Gnome Library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with the Gnome Library; see the file COPYING.LIB.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+/*
+  @NOTATION@
+ */
+
+#ifndef LIBGNOMEINIT_H
+#define LIBGNOMEINIT_H
+
+#include <libgnomebase/gnome-defs.h>
+#include <libgnomebase/gnome-program.h>
+
+#include <gconf/gconf-client.h>
+
+BEGIN_GNOME_DECLS
+
+GConfClient *
+gnome_program_get_gconf_client (GnomeProgram *program);
+
+#define GNOME_PARAM_GCONF_CLIENT "gconf-client"
+
+extern GnomeModuleInfo gnome_oaf_module_info;
+extern GnomeModuleInfo gnome_gconf_module_info;
+extern GnomeModuleInfo gnome_vfs_module_info;
+extern GnomeModuleInfo libgnome_module_info;
+
+END_GNOME_DECLS
+
+#endif /* LIBGNOMEINIT_H */
diff --git a/libgnome/libgnome.h b/libgnome/libgnome.h
index c4a2aab..3b64c94 100644
--- a/libgnome/libgnome.h
+++ b/libgnome/libgnome.h
@@ -40,10 +40,7 @@
 #include <libgnome/gnome-url.h>
 #include <libgnome/gnome-ditem.h>
 
-extern GnomeModuleInfo gnome_oaf_module_info;
-extern GnomeModuleInfo gnome_gconf_module_info;
-extern GnomeModuleInfo gnome_vfs_module_info;
-extern GnomeModuleInfo libgnome_module_info;
+#include <libgnome/libgnome-init.h>
 
 #ifdef COMPAT_1_0
 #include <compat/1.0/libgnome/libgnome-compat-1.0.h>



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