changeset 7976:8e5a21b1efa6

[gaim-migrate @ 8653] Daniel (not David) Atallah sent me this, which is useful for the plugin writing folk committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 03 Jan 2004 06:25:24 +0000
parents 2311532f9036
children f82aa9301ed5
files src/gtkprefs.c src/gtkprefs.h
diffstat 2 files changed, 57 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkprefs.c	Sat Jan 03 06:22:54 2004 +0000
+++ b/src/gtkprefs.c	Sat Jan 03 06:25:24 2004 +0000
@@ -84,15 +84,6 @@
 static GtkTreeIter *prefs_notebook_add_page(const char*, GdkPixbuf*,
 											GtkWidget*, GtkTreeIter*,
 											GtkTreeIter*, int);
-static GtkWidget *prefs_checkbox(const char *, const char *, GtkWidget *);
-static GtkWidget *prefs_labeled_spin_button(GtkWidget *, const gchar *,
-											char *key, int, int,
-											GtkSizeGroup *);
-static GtkWidget *prefs_dropdown(GtkWidget *, const gchar *, GaimPrefType type,
-								 const char *, ...);
-static GtkWidget *prefs_dropdown_from_list(GtkWidget *, const gchar *,
-										   GaimPrefType type,
-										   const char *, GList *); 
 static GtkWidget *show_color_pref(GtkWidget *, gboolean);
 static void delete_prefs(GtkWidget *, void *);
 static void update_plugin_list(void *data);
@@ -110,7 +101,7 @@
 	gaim_prefs_set_int(key, value);
 }
 
-static GtkWidget *
+GtkWidget *
 prefs_labeled_spin_button(GtkWidget *box, const gchar *title, char *key,
 						 int min, int max, GtkSizeGroup *sg)
 {
@@ -180,7 +171,7 @@
 	}
 }
 
-static GtkWidget *
+GtkWidget *
 prefs_dropdown_from_list(GtkWidget *box, const gchar *title, GaimPrefType type,
 						 const char *key, GList *menuitems)
 {
@@ -265,7 +256,7 @@
 	return label;
 }
 
-static GtkWidget *
+GtkWidget *
 prefs_dropdown(GtkWidget *box, const gchar *title, GaimPrefType type,
 			   const char *key, ...)
 {
@@ -2489,7 +2480,7 @@
 		gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)));
 }
 
-static GtkWidget *
+GtkWidget *
 prefs_checkbox(const char *text, const char *key, GtkWidget *page)
 {
 	GtkWidget *button;
--- a/src/gtkprefs.h	Sat Jan 03 06:22:54 2004 +0000
+++ b/src/gtkprefs.h	Sat Jan 03 06:25:24 2004 +0000
@@ -23,6 +23,7 @@
  */
 #ifndef _GAIM_GTK_PREFS_H_
 #define _GAIM_GTK_PREFS_H_
+#include "prefs.h"
 
 /* XXX These should go. */
 extern GtkListStore *prefs_away_store;
@@ -51,4 +52,56 @@
 void apply_color_dlg(GtkWidget *, gpointer);
 void destroy_colorsel(GtkWidget *, gpointer);
 
+/**
+ * Add a new checkbox for a boolean preference
+ *
+ * @param title The text to be displayed as the checkbox label
+ * @param key   The key of the gaim bool pref that will be represented by the checkbox
+ * @param page  The page to which the new checkbox will be added
+ */
+GtkWidget *prefs_checkbox(const char *title, const char *key,
+                         GtkWidget *page);
+
+/**
+ * Add a new spin button representing an int preference
+ *
+ * @param page  The page to which the spin button will be added
+ * @param title The text to be displayed as the spin button label
+ * @param key   The key of the gaim int pref that will be represented by the spin button
+ * @param min   The minimum value of the spin button
+ * @param max   The maximum value of the spin button
+ * @param sg    If not NULL, the size group to which the spin button will be added
+ */
+GtkWidget *prefs_labeled_spin_button(GtkWidget *page, 
+                                    const gchar *title,
+                                    char *key, int min, int max,
+                                    GtkSizeGroup *sg);
+
+/**
+ * Add a new dropdown representing a preference of the specified type
+ *
+ * @param page  The page to which the spin button will be added
+ * @param title The text to be displayed as the spin button label
+ * @param type  The type of preference to be stored in the generated dropdown
+ * @param key   The key of the gaim int pref that will be represented by the spin button
+ * @param ...   The choices to be added to the dropdown
+ */
+GtkWidget *prefs_dropdown(GtkWidget *page, const gchar *title,
+                         GaimPrefType type,
+                         const char *key, ...);
+
+/**
+ * Add a new dropdown representing a preference of the specified type
+ *
+ * @param page      The page to which the spin button will be added
+ * @param title     The text to be displayed as the spin button label
+ * @param type      The type of preference to be stored in the generated dropdown
+ * @param key       The key of the gaim int pref that will be represented by the spin button
+ * @param menuitems The choices to be added to the dropdown
+ */
+GtkWidget *prefs_dropdown_from_list(GtkWidget *page,
+                                   const gchar * title,
+                                   GaimPrefType type, const char *key,
+                                   GList *menuitems); 
+
 #endif /* _GAIM_GTK_PREFS_H_ */