[Kazehakase-cvs] kazehakase-svn [2926] * src/kz-embed-prefs.[ch]: New files of interfaces definition for

Back to archive index

svnno****@sourc***** svnno****@sourc*****
Wed Mar 21 06:42:26 JST 2007


Revision: 2926
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=kazehakase&view=rev&rev=2926
Author:   ikezoe
Date:     2007-03-21 06:42:26 +0900 (Wed, 21 Mar 2007)

Log Message:
-----------
* src/kz-embed-prefs.[ch]: New files of interfaces definition for
embed preferences.

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/src/Makefile.am

Added Paths:
-----------
    kazehakase/trunk/src/kz-embed-prefs.c
    kazehakase/trunk/src/kz-embed-prefs.h

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2007-03-20 14:42:30 UTC (rev 2925)
+++ kazehakase/trunk/ChangeLog	2007-03-20 21:42:26 UTC (rev 2926)
@@ -1,3 +1,8 @@
+2007-03-21  Hiroyuki Ikezoe  <poinc****@ikezo*****>
+
+	* src/kz-embed-prefs.[ch]: New files of interfaces definition for
+	embed preferences.
+
 2007-03-20  Kouhei Sutou  <kou****@cozmi*****>
 
 	* src/kz-ext.c: fixed a unbelievable bug.

Modified: kazehakase/trunk/src/Makefile.am
===================================================================
--- kazehakase/trunk/src/Makefile.am	2007-03-20 14:42:30 UTC (rev 2925)
+++ kazehakase/trunk/src/Makefile.am	2007-03-20 21:42:26 UTC (rev 2926)
@@ -72,6 +72,7 @@
 	kz-embed.h \
 	kz-embed-event.h \
 	kz-embed-module-impl.h \
+	kz-embed-prefs.h \
 	kz-gesture.h \
 	kz-tab-label.h \
 	kz-icons.h \
@@ -113,6 +114,7 @@
 	kz-embed.c \
 	kz-embed-module.c \
 	kz-embed-event.c \
+	kz-embed-prefs.c \
 	kz-gesture.c \
 	kz-tab-label.c \
 	kz-icons.c \

Added: kazehakase/trunk/src/kz-embed-prefs.c
===================================================================
--- kazehakase/trunk/src/kz-embed-prefs.c	2007-03-20 14:42:30 UTC (rev 2925)
+++ kazehakase/trunk/src/kz-embed-prefs.c	2007-03-20 21:42:26 UTC (rev 2926)
@@ -0,0 +1,160 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  Copyright (C) 2007 Hiroyuki Ikezoe
+ *
+ *  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, 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 copyED 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.
+ */
+
+#include "kz-embed-prefs.h"
+#include "kz-marshalers.h"
+
+
+static void kz_embed_prefs_base_init (gpointer g_class);
+
+GType
+kz_embed_prefs_get_type (void)
+{
+	static GType type = 0;
+	if (!type)
+	{
+		static const GTypeInfo info = {
+			sizeof (KzEmbedPrefsIFace),
+			kz_embed_prefs_base_init, /* base_init :*/
+			NULL,                     /* base_finalize */
+			NULL,                     /* class_init */
+			NULL,                     /* class_finalize */
+			NULL,                     /* class_data */
+			0,
+			0,                        /* n_preallocs */
+			NULL,                     /* instance_init */
+		};
+		type = g_type_register_static(G_TYPE_INTERFACE, "KzEmbedPrefs",
+					      &info, 0);
+		g_type_interface_add_prerequisite(type,
+						  G_TYPE_OBJECT);
+	}
+	return type;
+}
+
+static void
+kz_embed_prefs_base_init (gpointer g_class)
+{
+	static gboolean initialized = FALSE;
+
+	if (initialized) return;
+
+	initialized = TRUE;
+}
+
+gboolean
+kz_embed_prefs_init (KzEmbedPrefs *embed_prefs)
+{
+	KZ_EMBED_PREFS_GET_IFACE(embed_prefs)->init();
+}
+
+void
+kz_embed_prefs_set_profile (KzEmbedPrefs *embed_prefs, KzProfile *profile)
+{
+	KZ_EMBED_PREFS_GET_IFACE(embed_prefs)->set_profile(profile);
+}
+
+void
+kz_embed_prefs_get_string (KzEmbedPrefs *embed_prefs,
+			   const gchar *preference_name,
+			   gchar **value)
+{
+	KZ_EMBED_PREFS_GET_IFACE(embed_prefs)->get_string(preference_name, value);
+}
+
+gboolean
+kz_embed_prefs_get_int (KzEmbedPrefs *embed_prefs,
+			const gchar *preference_name,
+			gint *value)
+{
+	KZ_EMBED_PREFS_GET_IFACE(embed_prefs)->get_int(preference_name, value);
+}
+
+gboolean
+kz_embed_prefs_get_boolean (KzEmbedPrefs *embed_prefs,
+			    const gchar *preference_name,
+			    gboolean *value)
+{
+	KZ_EMBED_PREFS_GET_IFACE(embed_prefs)->get_boolean(preference_name, value);
+}
+
+gboolean
+kz_embed_prefs_set_string (KzEmbedPrefs *embed_prefs,
+			   const gchar *preference_name,
+			   const gchar *new_value)
+{
+	KZ_EMBED_PREFS_GET_IFACE(embed_prefs)->set_string(preference_name, new_value);
+}
+
+gboolean
+kz_embed_prefs_set_boolean (KzEmbedPrefs *embed_prefs,
+			    const gchar *preference_name,
+			    gboolean new_value)
+{
+	KZ_EMBED_PREFS_GET_IFACE(embed_prefs)->set_boolean(preference_name, new_value);
+}
+
+gboolean
+kz_embed_prefs_set_int (KzEmbedPrefs *embed_prefs,
+			const gchar *preference_name, 
+			gint new_value)
+{
+	KZ_EMBED_PREFS_GET_IFACE(embed_prefs)->set_int(preference_name, new_value);
+}
+
+gboolean
+kz_embed_prefs_get_font_list (KzEmbedPrefs *embed_prefs,
+			      const gchar *lang_group,
+			      const gchar *font_type,
+			      GList      **font_list,
+			      GList      **all_font_list,
+			      gchar      **default_font)
+{
+	KZ_EMBED_PREFS_GET_IFACE(embed_prefs)->get_font_list(lang_group,
+							     font_type,
+							     font_list,
+							     all_font_list,
+							     default_font);
+}
+
+gboolean
+kz_embed_prefs_get_passwords (KzEmbedPrefs *embed_prefs, GList **passwords)
+{
+	KZ_EMBED_PREFS_GET_IFACE(embed_prefs)->get_passwords(passwords);
+}
+
+gboolean
+kz_embed_prefs_remove_passwords (KzEmbedPrefs *embed_prefs, GList *passwords)
+{
+	KZ_EMBED_PREFS_GET_IFACE(embed_prefs)->remove_passwords(passwords);
+}
+
+void
+kz_embed_prefs_set_proxy (KzEmbedPrefs *embed_prefs, KzProxyItem *item)
+{
+	KZ_EMBED_PREFS_GET_IFACE(embed_prefs)->set_proxy(item);
+}
+
+void
+kz_embed_prefs_set_use_proxy (KzEmbedPrefs *embed_prefs, gboolean use)
+{
+	KZ_EMBED_PREFS_GET_IFACE(embed_prefs)->set_use_proxy(use);
+}
+

Added: kazehakase/trunk/src/kz-embed-prefs.h
===================================================================
--- kazehakase/trunk/src/kz-embed-prefs.h	2007-03-20 14:42:30 UTC (rev 2925)
+++ kazehakase/trunk/src/kz-embed-prefs.h	2007-03-20 21:42:26 UTC (rev 2926)
@@ -0,0 +1,97 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
+/*
+ *  Copyright (C) 2007 Hiroyuki Ikezoe
+ *
+ *  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, 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 copyED 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.
+ */
+
+#include <gtk/gtk.h>
+#include "kazehakase.h"
+#include "kz-profile.h"
+#include "kz-proxy-item.h"
+
+#ifndef __KZ_EMBED_PREFS_H__
+#define __KZ_EMBED_PREFS_H__
+
+G_BEGIN_DECLS
+
+#define KZ_TYPE_EMBED_PREFS		(kz_embed_prefs_get_type())
+#define KZ_EMBED_PREFS(o)		(G_TYPE_CHECK_INSTANCE_CAST((o), KZ_TYPE_EMBED_PREFS, KzEmbedPrefs))
+#define KZ_IS_EMBED_PREFS(o)		(G_TYPE_CHECK_INSTANCE_TYPE((o), KZ_TYPE_EMBED_PREFS))
+#define KZ_EMBED_PREFS_GET_IFACE(o)	(G_TYPE_INSTANCE_GET_INTERFACE((o), KZ_TYPE_EMBED_PREFS, KzEmbedPrefsIFace))
+
+typedef struct _KzEmbedPrefs      KzEmbedPrefs;
+typedef struct _KzEmbedPrefsIFace KzEmbedPrefsIFace;
+
+struct _KzEmbedPrefsIFace {
+	GTypeInterface g_iface;
+
+	gboolean 	(*init)            (void);
+	void     	(*set_profile)     (KzProfile *profile);
+	void		(*get_string)      (const gchar  *preference_name,
+						  gchar       **value);
+	gboolean 	(*get_int)         (const gchar  *preference_name,
+					    gint         *value);
+	gboolean 	(*get_boolean)     (const gchar  *preference_name,
+					    gboolean    *value);
+	gboolean 	(*set_string)	   (const gchar  *preference_name,
+					    const gchar  *new_value);
+	gboolean 	(*set_boolean)     (const gchar  *preference_name,
+					    gboolean     new_boolean_value);
+	gboolean 	(*set_int)         (const gchar  *preference_name,
+					    gint          new_int_value);
+
+	gboolean 	(*get_font_list)   (const gchar  *lang_group,
+					    const gchar  *font_type,
+					    GList       **font_list,
+					    GList       **all_font_list,
+					    gchar       **default_font);
+
+	gboolean  	(*get_passwords)       (GList **passwords);
+	gboolean  	(*remove_passwords)    (GList *passwords);
+	void     	(*set_proxy)           (KzProxyItem *item);
+	void     	(*set_use_proxy)       (gboolean use);
+};
+
+GType		kz_embed_prefs_get_type		(void) G_GNUC_CONST;
+
+gboolean 	kz_embed_prefs_init		(KzEmbedPrefs *embed_prefs);
+void     	kz_embed_prefs_set_profile	(KzEmbedPrefs *embed_prefs, KzProfile *profile);
+void		kz_embed_prefs_get_string	(KzEmbedPrefs *embed_prefs, const gchar  *preference_name,
+						 gchar       **value);
+gboolean 	kz_embed_prefs_get_int		(KzEmbedPrefs *embed_prefs, const gchar  *preference_name,
+						 gint         *value);
+gboolean 	kz_embed_prefs_get_boolean	(KzEmbedPrefs *embed_prefs, const gchar  *preference_name,
+						 gboolean     *value);
+gboolean 	kz_embed_prefs_set_string	(KzEmbedPrefs *embed_prefs, const gchar  *preference_name,
+						 const gchar  *new_value);
+gboolean 	kz_embed_prefs_set_boolean	(KzEmbedPrefs *embed_prefs, const gchar  *preference_name,
+						 gboolean      new_boolean_value);
+gboolean 	kz_embed_prefs_set_int		(KzEmbedPrefs *embed_prefs, const gchar  *preference_name,
+						 gint          new_int_value);
+gboolean 	kz_embed_prefs_get_font_list	(KzEmbedPrefs *embed_prefs, const gchar  *lang_group,
+						 const gchar  *font_type,
+						 GList      **font_list,
+						 GList      **all_font_list,
+						 gchar       **default_font);
+
+gboolean  	kz_embed_prefs_get_passwords       (KzEmbedPrefs *embed_prefs, GList **passwords);
+gboolean  	kz_embed_prefs_remove_passwords    (KzEmbedPrefs *embed_prefs, GList *passwords);
+void     	kz_embed_prefs_set_proxy           (KzEmbedPrefs *embed_prefs, KzProxyItem *item);
+void     	kz_embed_prefs_set_use_proxy       (KzEmbedPrefs *embed_prefs, gboolean use);
+G_END_DECLS
+
+#endif /* __KZ_EMBED_PREFS_H__ */





More information about the Kazehakase-cvs mailing list
Back to archive index