Thu, 07 Apr 2005 14:55:02 +0000
[gaim-migrate @ 12431]
" The following log snippets should explain it: " --rlaager
(20:24:00) rlaager: Regarding the signal handling
conversation the other day... I've written a patch to stop
calling signal handlers and return as soon as we find one
signal handler that returns TRUE to indicate that it's
handled the signal. Is this the right approach?
(20:24:22) Ethan Blanton (Paco-Paco): the trouble is that it's
documented to behave exactly the way it does
(20:24:31) Ethan Blanton (Paco-Paco): so changing it is
notbackwards compatible
(20:24:31) rlaager: I'm talking for HEAD.
(20:24:41) Ethan Blanton (Paco-Paco): oh, I think that's a
good approach, yes
(20:24:53) rlaager: The way I've described is how I
*expected* it to work, having not read the documentation.
(20:25:09) Ethan Blanton (Paco-Paco): I'm convinced
(20:27:04) Stu Tomlinson (nosnilmot): rlaager: this, I
assume, breaks the generic-ness of signals, by assuming
that any that return values return booleans?
(20:27:26) Ethan Blanton (Paco-Paco): please break it
(20:27:33) Ethan Blanton (Paco-Paco): we already have
out-parameters
(20:27:42) rlaager: nosnilmot: from what I can see, the
return type is handled as a (void *)... so I'm checking that
ret_value != NULL
(20:27:57) rlaager: nosnilmot: that's the correct way to do it,
right?
...
(20:29:01) Ethan Blanton (Paco-Paco): allowing a
meaningful return value is an over-engineering
(20:30:07) rlaager: even after this patch, you should be able
to return meaningful return values
(20:30:15) rlaager: it'll just short-circuit on the first handler
that does
committer: Luke Schierer <lschiere@pidgin.im>
| 8713 | 1 | /** |
| 2 | * @file pluginpref.h Plugin Preferences API | |
| 3 | * @ingroup core | |
| 4 | * | |
| 5 | * gaim | |
| 6 | * | |
| 7 | * Gaim is the legal property of its developers, whose names are too numerous | |
| 8 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 9 | * source distribution. | |
| 10 | * | |
| 11 | * This program is free software; you can redistribute it and/or modify | |
| 12 | * it under the terms of the GNU General Public License as published by | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 20 | * | |
| 21 | * You should have received a copy of the GNU General Public License | |
| 22 | * along with this program; if not, write to the Free Software | |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | * | |
| 25 | */ | |
|
9713
bb37562302a1
[gaim-migrate @ 10574]
Mark Doliner <markdoliner@pidgin.im>
parents:
9529
diff
changeset
|
26 | #ifndef _GAIM_PLUGINPREF_H_ |
|
bb37562302a1
[gaim-migrate @ 10574]
Mark Doliner <markdoliner@pidgin.im>
parents:
9529
diff
changeset
|
27 | #define _GAIM_PLUGINPREF_H_ |
| 8713 | 28 | |
| 29 | typedef struct _GaimPluginPrefFrame GaimPluginPrefFrame; | |
| 30 | typedef struct _GaimPluginPref GaimPluginPref; | |
| 31 | ||
| 32 | typedef enum { | |
| 33 | GAIM_PLUGIN_PREF_NONE, | |
|
9529
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
9000
diff
changeset
|
34 | GAIM_PLUGIN_PREF_CHOICE, |
|
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
9000
diff
changeset
|
35 | GAIM_PLUGIN_PREF_INFO, /**< no-value label */ |
| 8713 | 36 | } GaimPluginPrefType; |
| 37 | ||
| 38 | #include <glib.h> | |
| 39 | #include "prefs.h" | |
| 40 | ||
| 41 | #ifdef __cplusplus | |
| 42 | extern "C" { | |
| 43 | #endif | |
| 44 | ||
| 45 | /**************************************************************************/ | |
| 46 | /** @name Plugin Preference API */ | |
| 47 | /**************************************************************************/ | |
| 48 | /*@{*/ | |
| 49 | ||
| 50 | /** | |
| 51 | * Create a new plugin preference frame | |
| 52 | * | |
| 53 | * @return a new GaimPluginPrefFrame | |
| 54 | */ | |
| 55 | GaimPluginPrefFrame *gaim_plugin_pref_frame_new(); | |
| 56 | ||
| 57 | /** | |
| 58 | * Destroy a plugin preference frame | |
| 59 | * | |
| 60 | * @param frame The plugin frame to destroy | |
| 61 | */ | |
| 62 | void gaim_plugin_pref_frame_destroy(GaimPluginPrefFrame *frame); | |
| 63 | ||
| 64 | /** | |
| 65 | * Adds a plugin preference to a plugin preference frame | |
| 66 | * | |
| 67 | * @param frame The plugin frame to add the preference to | |
| 68 | * @param pref The preference to add to the frame | |
| 69 | */ | |
| 70 | void gaim_plugin_pref_frame_add(GaimPluginPrefFrame *frame, GaimPluginPref *pref); | |
| 71 | ||
| 72 | /** | |
| 73 | * Get the plugin preferences from a plugin preference frame | |
| 74 | * | |
| 75 | * @param frame The plugin frame to get the plugin preferences from | |
| 76 | * @return a GList of plugin preferences | |
| 77 | */ | |
| 78 | GList *gaim_plugin_pref_frame_get_prefs(GaimPluginPrefFrame *frame); | |
|
10414
6b10b76933e1
[gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents:
9939
diff
changeset
|
79 | |
| 8713 | 80 | /** |
| 81 | * Create a new plugin preference | |
| 82 | * | |
| 83 | * @return a new GaimPluginPref | |
| 84 | */ | |
| 85 | GaimPluginPref *gaim_plugin_pref_new(); | |
| 86 | ||
| 87 | /** | |
| 88 | * Create a new plugin preference with name | |
| 89 | * | |
| 90 | * @param name The name of the pref | |
| 91 | * @return a new GaimPluginPref | |
| 92 | */ | |
| 93 | GaimPluginPref *gaim_plugin_pref_new_with_name(char *name); | |
| 94 | ||
| 95 | /** | |
| 96 | * Create a new plugin preference with label | |
| 97 | * | |
| 98 | * @param label The label to be displayed | |
| 99 | * @return a new GaimPluginPref | |
| 100 | */ | |
| 101 | GaimPluginPref *gaim_plugin_pref_new_with_label(char *label); | |
| 102 | ||
| 103 | /** | |
| 104 | * Create a new plugin preference with name and label | |
| 105 | * | |
| 106 | * @param name The name of the pref | |
| 107 | * @param label The label to be displayed | |
| 108 | * @return a new GaimPluginPref | |
| 109 | */ | |
| 110 | GaimPluginPref *gaim_plugin_pref_new_with_name_and_label(char *name, char *label); | |
| 111 | ||
| 112 | /** | |
| 113 | * Destroy a plugin preference | |
| 114 | * | |
| 115 | * @param pref The preference to destroy | |
| 116 | */ | |
| 117 | void gaim_plugin_pref_destroy(GaimPluginPref *pref); | |
| 118 | ||
| 119 | /** | |
| 120 | * Set a plugin pref name | |
| 121 | * | |
| 122 | * @param pref The plugin pref | |
| 123 | * @param name The name of the pref | |
| 124 | */ | |
| 125 | void gaim_plugin_pref_set_name(GaimPluginPref *pref, char *name); | |
| 126 | ||
| 127 | /** | |
| 128 | * Get a plugin pref name | |
| 129 | * | |
| 130 | * @param pref The plugin pref | |
| 131 | * @return The name of the pref | |
| 132 | */ | |
| 133 | char *gaim_plugin_pref_get_name(GaimPluginPref *pref); | |
| 134 | ||
| 135 | /** | |
| 136 | * Set a plugin pref label | |
| 137 | * | |
| 138 | * @param pref The plugin pref | |
| 139 | * @param label The label for the plugin pref | |
| 140 | */ | |
| 141 | void gaim_plugin_pref_set_label(GaimPluginPref *pref, char *label); | |
| 142 | ||
| 143 | /** | |
| 144 | * Get a plugin pref label | |
| 145 | * | |
| 146 | * @param pref The plugin pref | |
| 147 | * @return The label for the plugin pref | |
| 148 | */ | |
| 149 | char *gaim_plugin_pref_get_label(GaimPluginPref *pref); | |
| 150 | ||
| 151 | /** | |
| 152 | * Set the bounds for an integer pref | |
| 153 | * | |
| 154 | * @param pref The plugin pref | |
| 155 | * @param min The min value | |
| 156 | * @param max The max value | |
| 157 | */ | |
| 158 | void gaim_plugin_pref_set_bounds(GaimPluginPref *pref, int min, int max); | |
| 159 | ||
| 160 | /** | |
| 161 | * Get the bounds for an integer pref | |
| 162 | * | |
| 163 | * @param pref The plugin pref | |
| 164 | * @param min The min value | |
| 165 | * @param max The max value | |
| 166 | */ | |
| 167 | void gaim_plugin_pref_get_bounds(GaimPluginPref *pref, int *min, int *max); | |
| 168 | ||
| 169 | /** | |
| 170 | * Set the type of a plugin pref | |
| 171 | * | |
| 172 | * @param pref The plugin pref | |
| 173 | * @param type The type | |
| 174 | */ | |
| 175 | void gaim_plugin_pref_set_type(GaimPluginPref *pref, GaimPluginPrefType type); | |
| 176 | ||
| 177 | /** | |
| 178 | * Get the type of a plugin pref | |
| 179 | * | |
| 180 | * @param pref The plugin pref | |
| 181 | * @return The type | |
| 182 | */ | |
| 183 | GaimPluginPrefType gaim_plugin_pref_get_type(GaimPluginPref *pref); | |
| 184 | ||
| 185 | /** | |
| 186 | * Set the choices for a choices plugin pref | |
| 187 | * | |
| 188 | * @param pref The plugin pref | |
| 189 | * @param label The label for the choice | |
| 190 | * @param choice A gpointer of the choice | |
| 191 | */ | |
| 192 | void gaim_plugin_pref_add_choice(GaimPluginPref *pref, char *label, gpointer choice); | |
| 193 | ||
| 194 | /** | |
| 195 | * Get the choices for a choices plugin pref | |
| 196 | * | |
| 197 | * @param pref The plugin pref | |
| 198 | * @return GList of the choices | |
| 199 | */ | |
| 200 | GList *gaim_plugin_pref_get_choices(GaimPluginPref *pref); | |
| 201 | ||
| 202 | /** | |
| 203 | * Set the max length for a string plugin pref | |
| 204 | * | |
| 9000 | 205 | * @param pref The plugin pref |
| 206 | * @param max_length The max length of the string | |
| 8713 | 207 | */ |
| 208 | void gaim_plugin_pref_set_max_length(GaimPluginPref *pref, unsigned int max_length); | |
| 209 | ||
| 210 | /** | |
| 211 | * Get the max length for a string plugin pref | |
| 212 | * | |
| 213 | * @param pref The plugin pref | |
| 214 | * @return the max length | |
| 215 | */ | |
| 216 | unsigned int gaim_plugin_pref_get_max_length(GaimPluginPref *pref); | |
| 217 | ||
| 9841 | 218 | /** |
| 219 | * Sets the masking of a string plugin pref | |
| 220 | * | |
| 9939 | 221 | * @param pref The plugin pref |
| 222 | * @param mask The value to set | |
| 9841 | 223 | */ |
| 224 | void gaim_plugin_pref_set_masked(GaimPluginPref *pref, gboolean mask); | |
| 225 | ||
| 226 | /** | |
| 227 | * Gets the masking of a string plugin pref | |
| 228 | * | |
| 229 | * @param pref The plugin pref | |
| 230 | * @return The masking | |
| 231 | */ | |
| 232 | gboolean gaim_plugin_pref_get_masked(GaimPluginPref *pref); | |
| 233 | ||
| 8713 | 234 | /*@}*/ |
| 235 | ||
| 236 | #ifdef __cplusplus | |
| 237 | } | |
| 238 | #endif | |
| 239 | ||
|
9713
bb37562302a1
[gaim-migrate @ 10574]
Mark Doliner <markdoliner@pidgin.im>
parents:
9529
diff
changeset
|
240 | #endif /* _GAIM_PLUGINPREF_H_ */ |