Mercurial > pidgin
comparison libpurple/request.c @ 16439:08db93bbd798
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
| author | Evan Schoenberg <evan.s@dreskin.net> |
|---|---|
| date | Thu, 26 Apr 2007 12:25:49 +0000 |
| parents | 32c366eeeb99 |
| children | ab6d2763b8d8 |
comparison
equal
deleted
inserted
replaced
| 16435:a46a0362dc34 | 16439:08db93bbd798 |
|---|---|
| 1133 purple_request_input(void *handle, const char *title, const char *primary, | 1133 purple_request_input(void *handle, const char *title, const char *primary, |
| 1134 const char *secondary, const char *default_value, | 1134 const char *secondary, const char *default_value, |
| 1135 gboolean multiline, gboolean masked, gchar *hint, | 1135 gboolean multiline, gboolean masked, gchar *hint, |
| 1136 const char *ok_text, GCallback ok_cb, | 1136 const char *ok_text, GCallback ok_cb, |
| 1137 const char *cancel_text, GCallback cancel_cb, | 1137 const char *cancel_text, GCallback cancel_cb, |
| 1138 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
| 1138 void *user_data) | 1139 void *user_data) |
| 1139 { | 1140 { |
| 1140 PurpleRequestUiOps *ops; | 1141 PurpleRequestUiOps *ops; |
| 1141 | 1142 |
| 1142 g_return_val_if_fail(ok_text != NULL, NULL); | 1143 g_return_val_if_fail(ok_text != NULL, NULL); |
| 1153 info->ui_handle = ops->request_input(title, primary, secondary, | 1154 info->ui_handle = ops->request_input(title, primary, secondary, |
| 1154 default_value, | 1155 default_value, |
| 1155 multiline, masked, hint, | 1156 multiline, masked, hint, |
| 1156 ok_text, ok_cb, | 1157 ok_text, ok_cb, |
| 1157 cancel_text, cancel_cb, | 1158 cancel_text, cancel_cb, |
| 1159 account, who, conv, | |
| 1158 user_data); | 1160 user_data); |
| 1159 | 1161 |
| 1160 handles = g_list_append(handles, info); | 1162 handles = g_list_append(handles, info); |
| 1161 | 1163 |
| 1162 return info->ui_handle; | 1164 return info->ui_handle; |
| 1168 void * | 1170 void * |
| 1169 purple_request_choice(void *handle, const char *title, const char *primary, | 1171 purple_request_choice(void *handle, const char *title, const char *primary, |
| 1170 const char *secondary, unsigned int default_value, | 1172 const char *secondary, unsigned int default_value, |
| 1171 const char *ok_text, GCallback ok_cb, | 1173 const char *ok_text, GCallback ok_cb, |
| 1172 const char *cancel_text, GCallback cancel_cb, | 1174 const char *cancel_text, GCallback cancel_cb, |
| 1175 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
| 1173 void *user_data, ...) | 1176 void *user_data, ...) |
| 1174 { | 1177 { |
| 1175 void *ui_handle; | 1178 void *ui_handle; |
| 1176 va_list args; | 1179 va_list args; |
| 1177 | 1180 |
| 1179 g_return_val_if_fail(ok_cb != NULL, NULL); | 1182 g_return_val_if_fail(ok_cb != NULL, NULL); |
| 1180 | 1183 |
| 1181 va_start(args, user_data); | 1184 va_start(args, user_data); |
| 1182 ui_handle = purple_request_choice_varg(handle, title, primary, secondary, | 1185 ui_handle = purple_request_choice_varg(handle, title, primary, secondary, |
| 1183 default_value, ok_text, ok_cb, | 1186 default_value, ok_text, ok_cb, |
| 1184 cancel_text, cancel_cb, user_data, args); | 1187 cancel_text, cancel_cb, |
| 1188 account, who, conv, user_data, args); | |
| 1185 va_end(args); | 1189 va_end(args); |
| 1186 | 1190 |
| 1187 return ui_handle; | 1191 return ui_handle; |
| 1188 } | 1192 } |
| 1189 | 1193 |
| 1191 purple_request_choice_varg(void *handle, const char *title, | 1195 purple_request_choice_varg(void *handle, const char *title, |
| 1192 const char *primary, const char *secondary, | 1196 const char *primary, const char *secondary, |
| 1193 unsigned int default_value, | 1197 unsigned int default_value, |
| 1194 const char *ok_text, GCallback ok_cb, | 1198 const char *ok_text, GCallback ok_cb, |
| 1195 const char *cancel_text, GCallback cancel_cb, | 1199 const char *cancel_text, GCallback cancel_cb, |
| 1200 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
| 1196 void *user_data, va_list choices) | 1201 void *user_data, va_list choices) |
| 1197 { | 1202 { |
| 1198 PurpleRequestUiOps *ops; | 1203 PurpleRequestUiOps *ops; |
| 1199 | 1204 |
| 1200 g_return_val_if_fail(ok_text != NULL, NULL); | 1205 g_return_val_if_fail(ok_text != NULL, NULL); |
| 1210 info->handle = handle; | 1215 info->handle = handle; |
| 1211 info->ui_handle = ops->request_choice(title, primary, secondary, | 1216 info->ui_handle = ops->request_choice(title, primary, secondary, |
| 1212 default_value, | 1217 default_value, |
| 1213 ok_text, ok_cb, | 1218 ok_text, ok_cb, |
| 1214 cancel_text, cancel_cb, | 1219 cancel_text, cancel_cb, |
| 1220 account, who, conv, | |
| 1215 user_data, choices); | 1221 user_data, choices); |
| 1216 | 1222 |
| 1217 handles = g_list_append(handles, info); | 1223 handles = g_list_append(handles, info); |
| 1218 | 1224 |
| 1219 return info->ui_handle; | 1225 return info->ui_handle; |
| 1223 } | 1229 } |
| 1224 | 1230 |
| 1225 void * | 1231 void * |
| 1226 purple_request_action(void *handle, const char *title, const char *primary, | 1232 purple_request_action(void *handle, const char *title, const char *primary, |
| 1227 const char *secondary, unsigned int default_action, | 1233 const char *secondary, unsigned int default_action, |
| 1234 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
| 1228 void *user_data, size_t action_count, ...) | 1235 void *user_data, size_t action_count, ...) |
| 1229 { | 1236 { |
| 1230 void *ui_handle; | 1237 void *ui_handle; |
| 1231 va_list args; | 1238 va_list args; |
| 1232 | 1239 |
| 1233 g_return_val_if_fail(action_count > 0, NULL); | 1240 g_return_val_if_fail(action_count > 0, NULL); |
| 1234 | 1241 |
| 1235 va_start(args, action_count); | 1242 va_start(args, action_count); |
| 1236 ui_handle = purple_request_action_varg(handle, title, primary, secondary, | 1243 ui_handle = purple_request_action_varg(handle, title, primary, secondary, |
| 1237 default_action, user_data, | 1244 default_action, account, who, conv, |
| 1238 action_count, args); | 1245 user_data, action_count, args); |
| 1239 va_end(args); | 1246 va_end(args); |
| 1240 | 1247 |
| 1241 return ui_handle; | 1248 return ui_handle; |
| 1242 } | 1249 } |
| 1243 | 1250 |
| 1244 void * | 1251 void * |
| 1245 purple_request_action_varg(void *handle, const char *title, | 1252 purple_request_action_varg(void *handle, const char *title, |
| 1246 const char *primary, const char *secondary, | 1253 const char *primary, const char *secondary, |
| 1247 unsigned int default_action, void *user_data, | 1254 unsigned int default_action, |
| 1248 size_t action_count, va_list actions) | 1255 PurpleAccount *account, const char *who, PurpleConversation *conv, |
| 1256 void *user_data, size_t action_count, va_list actions) | |
| 1249 { | 1257 { |
| 1250 PurpleRequestUiOps *ops; | 1258 PurpleRequestUiOps *ops; |
| 1251 | 1259 |
| 1252 g_return_val_if_fail(action_count > 0, NULL); | 1260 g_return_val_if_fail(action_count > 0, NULL); |
| 1253 | 1261 |
| 1258 | 1266 |
| 1259 info = g_new0(PurpleRequestInfo, 1); | 1267 info = g_new0(PurpleRequestInfo, 1); |
| 1260 info->type = PURPLE_REQUEST_ACTION; | 1268 info->type = PURPLE_REQUEST_ACTION; |
| 1261 info->handle = handle; | 1269 info->handle = handle; |
| 1262 info->ui_handle = ops->request_action(title, primary, secondary, | 1270 info->ui_handle = ops->request_action(title, primary, secondary, |
| 1263 default_action, user_data, | 1271 default_action, account, who, conv, |
| 1264 action_count, actions); | 1272 user_data, action_count, actions); |
| 1265 | 1273 |
| 1266 handles = g_list_append(handles, info); | 1274 handles = g_list_append(handles, info); |
| 1267 | 1275 |
| 1268 return info->ui_handle; | 1276 return info->ui_handle; |
| 1269 } | 1277 } |
| 1274 void * | 1282 void * |
| 1275 purple_request_fields(void *handle, const char *title, const char *primary, | 1283 purple_request_fields(void *handle, const char *title, const char *primary, |
| 1276 const char *secondary, PurpleRequestFields *fields, | 1284 const char *secondary, PurpleRequestFields *fields, |
| 1277 const char *ok_text, GCallback ok_cb, | 1285 const char *ok_text, GCallback ok_cb, |
| 1278 const char *cancel_text, GCallback cancel_cb, | 1286 const char *cancel_text, GCallback cancel_cb, |
| 1287 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
| 1279 void *user_data) | 1288 void *user_data) |
| 1280 { | 1289 { |
| 1281 PurpleRequestUiOps *ops; | 1290 PurpleRequestUiOps *ops; |
| 1282 | 1291 |
| 1283 g_return_val_if_fail(fields != NULL, NULL); | 1292 g_return_val_if_fail(fields != NULL, NULL); |
| 1293 info->type = PURPLE_REQUEST_FIELDS; | 1302 info->type = PURPLE_REQUEST_FIELDS; |
| 1294 info->handle = handle; | 1303 info->handle = handle; |
| 1295 info->ui_handle = ops->request_fields(title, primary, secondary, | 1304 info->ui_handle = ops->request_fields(title, primary, secondary, |
| 1296 fields, ok_text, ok_cb, | 1305 fields, ok_text, ok_cb, |
| 1297 cancel_text, cancel_cb, | 1306 cancel_text, cancel_cb, |
| 1307 account, who, conv, | |
| 1298 user_data); | 1308 user_data); |
| 1299 | 1309 |
| 1300 handles = g_list_append(handles, info); | 1310 handles = g_list_append(handles, info); |
| 1301 | 1311 |
| 1302 return info->ui_handle; | 1312 return info->ui_handle; |
| 1306 } | 1316 } |
| 1307 | 1317 |
| 1308 void * | 1318 void * |
| 1309 purple_request_file(void *handle, const char *title, const char *filename, | 1319 purple_request_file(void *handle, const char *title, const char *filename, |
| 1310 gboolean savedialog, | 1320 gboolean savedialog, |
| 1311 GCallback ok_cb, GCallback cancel_cb, void *user_data) | 1321 GCallback ok_cb, GCallback cancel_cb, |
| 1322 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
| 1323 void *user_data) | |
| 1312 { | 1324 { |
| 1313 PurpleRequestUiOps *ops; | 1325 PurpleRequestUiOps *ops; |
| 1314 | 1326 |
| 1315 ops = purple_request_get_ui_ops(); | 1327 ops = purple_request_get_ui_ops(); |
| 1316 | 1328 |
| 1319 | 1331 |
| 1320 info = g_new0(PurpleRequestInfo, 1); | 1332 info = g_new0(PurpleRequestInfo, 1); |
| 1321 info->type = PURPLE_REQUEST_FILE; | 1333 info->type = PURPLE_REQUEST_FILE; |
| 1322 info->handle = handle; | 1334 info->handle = handle; |
| 1323 info->ui_handle = ops->request_file(title, filename, savedialog, | 1335 info->ui_handle = ops->request_file(title, filename, savedialog, |
| 1324 ok_cb, cancel_cb, user_data); | 1336 ok_cb, cancel_cb, |
| 1337 account, who, conv, user_data); | |
| 1325 handles = g_list_append(handles, info); | 1338 handles = g_list_append(handles, info); |
| 1326 return info->ui_handle; | 1339 return info->ui_handle; |
| 1327 } | 1340 } |
| 1328 | 1341 |
| 1329 return NULL; | 1342 return NULL; |
| 1330 } | 1343 } |
| 1331 | 1344 |
| 1332 void * | 1345 void * |
| 1333 purple_request_folder(void *handle, const char *title, const char *dirname, | 1346 purple_request_folder(void *handle, const char *title, const char *dirname, |
| 1334 GCallback ok_cb, GCallback cancel_cb, void *user_data) | 1347 GCallback ok_cb, GCallback cancel_cb, |
| 1348 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
| 1349 void *user_data) | |
| 1335 { | 1350 { |
| 1336 PurpleRequestUiOps *ops; | 1351 PurpleRequestUiOps *ops; |
| 1337 | 1352 |
| 1338 ops = purple_request_get_ui_ops(); | 1353 ops = purple_request_get_ui_ops(); |
| 1339 | 1354 |
| 1342 | 1357 |
| 1343 info = g_new0(PurpleRequestInfo, 1); | 1358 info = g_new0(PurpleRequestInfo, 1); |
| 1344 info->type = PURPLE_REQUEST_FOLDER; | 1359 info->type = PURPLE_REQUEST_FOLDER; |
| 1345 info->handle = handle; | 1360 info->handle = handle; |
| 1346 info->ui_handle = ops->request_folder(title, dirname, | 1361 info->ui_handle = ops->request_folder(title, dirname, |
| 1347 ok_cb, cancel_cb, user_data); | 1362 ok_cb, cancel_cb, |
| 1363 account, who, conv, | |
| 1364 user_data); | |
| 1348 handles = g_list_append(handles, info); | 1365 handles = g_list_append(handles, info); |
| 1349 return info->ui_handle; | 1366 return info->ui_handle; |
| 1350 } | 1367 } |
| 1351 | 1368 |
| 1352 return NULL; | 1369 return NULL; |
