Mercurial > pidgin
comparison libpurple/request.c @ 21074:5908daa7dfe3
propagate from branch 'im.pidgin.pidgin' (head 584deef31dde531d5eb5786f3f0a24d55128e8dd)
to branch 'org.maemo.garage.pidgin.pidgin.dialog-transience' (head abd196aa0518c9c5ade0bf2c3a1d5bbafc726028)
author | Gabriel Schulhof <nix@go-nix.ca> |
---|---|
date | Sat, 06 Oct 2007 22:27:01 +0000 |
parents | bd1426679f36 |
children | 8c9aad9479c0 0b67d509a305 |
comparison
equal
deleted
inserted
replaced
20799:f296be2a1039 | 21074:5908daa7dfe3 |
---|---|
1140 const char *ok_text, GCallback ok_cb, | 1140 const char *ok_text, GCallback ok_cb, |
1141 const char *cancel_text, GCallback cancel_cb, | 1141 const char *cancel_text, GCallback cancel_cb, |
1142 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1142 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1143 void *user_data) | 1143 void *user_data) |
1144 { | 1144 { |
1145 return purple_request_input_with_hint( | |
1146 handle, title, primary, secondary, default_value, multiline, masked, hint, ok_text, ok_cb, | |
1147 cancel_text, cancel_cb, account, who, conv, "blist", user_data); | |
1148 } | |
1149 | |
1150 void * | |
1151 purple_request_input_with_hint(void *handle, const char *title, const char *primary, | |
1152 const char *secondary, const char *default_value, | |
1153 gboolean multiline, gboolean masked, gchar *hint, | |
1154 const char *ok_text, GCallback ok_cb, | |
1155 const char *cancel_text, GCallback cancel_cb, | |
1156 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1157 const char *ui_hint, void *user_data) | |
1158 { | |
1145 PurpleRequestUiOps *ops; | 1159 PurpleRequestUiOps *ops; |
1146 | 1160 |
1147 g_return_val_if_fail(ok_text != NULL, NULL); | 1161 g_return_val_if_fail(ok_text != NULL, NULL); |
1148 g_return_val_if_fail(ok_cb != NULL, NULL); | 1162 g_return_val_if_fail(ok_cb != NULL, NULL); |
1149 | 1163 |
1159 default_value, | 1173 default_value, |
1160 multiline, masked, hint, | 1174 multiline, masked, hint, |
1161 ok_text, ok_cb, | 1175 ok_text, ok_cb, |
1162 cancel_text, cancel_cb, | 1176 cancel_text, cancel_cb, |
1163 account, who, conv, | 1177 account, who, conv, |
1164 user_data); | 1178 ui_hint, user_data); |
1165 | 1179 |
1166 handles = g_list_append(handles, info); | 1180 handles = g_list_append(handles, info); |
1167 | 1181 |
1168 return info->ui_handle; | 1182 return info->ui_handle; |
1169 } | 1183 } |
1184 | 1198 |
1185 g_return_val_if_fail(ok_text != NULL, NULL); | 1199 g_return_val_if_fail(ok_text != NULL, NULL); |
1186 g_return_val_if_fail(ok_cb != NULL, NULL); | 1200 g_return_val_if_fail(ok_cb != NULL, NULL); |
1187 | 1201 |
1188 va_start(args, user_data); | 1202 va_start(args, user_data); |
1189 ui_handle = purple_request_choice_varg(handle, title, primary, secondary, | 1203 ui_handle = purple_request_choice_varg_with_hint(handle, title, primary, secondary, |
1190 default_value, ok_text, ok_cb, | 1204 default_value, ok_text, ok_cb, |
1191 cancel_text, cancel_cb, | 1205 cancel_text, cancel_cb, |
1192 account, who, conv, user_data, args); | 1206 account, who, conv, "blist", user_data, args); |
1207 va_end(args); | |
1208 | |
1209 return ui_handle; | |
1210 } | |
1211 | |
1212 void * | |
1213 purple_request_choice_with_hint(void *handle, const char *title, const char *primary, | |
1214 const char *secondary, int default_value, | |
1215 const char *ok_text, GCallback ok_cb, | |
1216 const char *cancel_text, GCallback cancel_cb, | |
1217 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1218 const char *ui_hint, void *user_data, ...) | |
1219 { | |
1220 void *ui_handle; | |
1221 va_list args; | |
1222 | |
1223 g_return_val_if_fail(ok_text != NULL, NULL); | |
1224 g_return_val_if_fail(ok_cb != NULL, NULL); | |
1225 | |
1226 va_start(args, user_data); | |
1227 ui_handle = purple_request_choice_varg_with_hint(handle, title, primary, secondary, | |
1228 default_value, ok_text, ok_cb, | |
1229 cancel_text, cancel_cb, | |
1230 account, who, conv, ui_hint, user_data, args); | |
1193 va_end(args); | 1231 va_end(args); |
1194 | 1232 |
1195 return ui_handle; | 1233 return ui_handle; |
1196 } | 1234 } |
1197 | 1235 |
1201 int default_value, | 1239 int default_value, |
1202 const char *ok_text, GCallback ok_cb, | 1240 const char *ok_text, GCallback ok_cb, |
1203 const char *cancel_text, GCallback cancel_cb, | 1241 const char *cancel_text, GCallback cancel_cb, |
1204 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1242 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1205 void *user_data, va_list choices) | 1243 void *user_data, va_list choices) |
1244 { | |
1245 return purple_request_choice_varg_with_hint( | |
1246 handle, title, primary, secondary, default_value, ok_text, ok_cb, | |
1247 cancel_text, cancel_cb, account, who, conv, "blist", user_data, choices); | |
1248 } | |
1249 | |
1250 void * | |
1251 purple_request_choice_varg_with_hint(void *handle, const char *title, | |
1252 const char *primary, const char *secondary, | |
1253 int default_value, | |
1254 const char *ok_text, GCallback ok_cb, | |
1255 const char *cancel_text, GCallback cancel_cb, | |
1256 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1257 const char *ui_hint, void *user_data, va_list choices) | |
1206 { | 1258 { |
1207 PurpleRequestUiOps *ops; | 1259 PurpleRequestUiOps *ops; |
1208 | 1260 |
1209 g_return_val_if_fail(ok_text != NULL, NULL); | 1261 g_return_val_if_fail(ok_text != NULL, NULL); |
1210 g_return_val_if_fail(ok_cb != NULL, NULL); | 1262 g_return_val_if_fail(ok_cb != NULL, NULL); |
1220 info->ui_handle = ops->request_choice(title, primary, secondary, | 1272 info->ui_handle = ops->request_choice(title, primary, secondary, |
1221 default_value, | 1273 default_value, |
1222 ok_text, ok_cb, | 1274 ok_text, ok_cb, |
1223 cancel_text, cancel_cb, | 1275 cancel_text, cancel_cb, |
1224 account, who, conv, | 1276 account, who, conv, |
1225 user_data, choices); | 1277 ui_hint, user_data, choices); |
1226 | 1278 |
1227 handles = g_list_append(handles, info); | 1279 handles = g_list_append(handles, info); |
1228 | 1280 |
1229 return info->ui_handle; | 1281 return info->ui_handle; |
1230 } | 1282 } |
1242 va_list args; | 1294 va_list args; |
1243 | 1295 |
1244 g_return_val_if_fail(action_count > 0, NULL); | 1296 g_return_val_if_fail(action_count > 0, NULL); |
1245 | 1297 |
1246 va_start(args, action_count); | 1298 va_start(args, action_count); |
1247 ui_handle = purple_request_action_varg(handle, title, primary, secondary, | 1299 ui_handle = purple_request_action_varg_with_hint(handle, title, primary, secondary, |
1248 default_action, account, who, conv, | 1300 default_action, account, who, conv, |
1249 user_data, action_count, args); | 1301 "blist", user_data, action_count, args); |
1302 va_end(args); | |
1303 | |
1304 return ui_handle; | |
1305 } | |
1306 | |
1307 void * | |
1308 purple_request_action_with_hint(void *handle, const char *title, const char *primary, | |
1309 const char *secondary, int default_action, | |
1310 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1311 const char *ui_hint, void *user_data, size_t action_count, ...) | |
1312 { | |
1313 void *ui_handle; | |
1314 va_list args; | |
1315 | |
1316 g_return_val_if_fail(action_count > 0, NULL); | |
1317 | |
1318 va_start(args, action_count); | |
1319 ui_handle = purple_request_action_varg_with_hint(handle, title, primary, secondary, | |
1320 default_action, account, who, conv, | |
1321 ui_hint, user_data, action_count, args); | |
1250 va_end(args); | 1322 va_end(args); |
1251 | 1323 |
1252 return ui_handle; | 1324 return ui_handle; |
1253 } | 1325 } |
1254 | 1326 |
1255 void * | 1327 void * |
1256 purple_request_action_varg(void *handle, const char *title, | 1328 purple_request_action_varg(void *handle, const char *title, |
1257 const char *primary, const char *secondary, | 1329 const char *primary, const char *secondary, |
1258 int default_action, | 1330 int default_action, |
1259 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1331 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1260 void *user_data, size_t action_count, va_list actions) | 1332 void *user_data, size_t action_count, va_list actions) |
1333 { | |
1334 return purple_request_action_varg_with_hint( | |
1335 handle, title, primary, secondary, default_action, account, who, conv, | |
1336 "blist", user_data, action_count, actions); | |
1337 } | |
1338 | |
1339 void * | |
1340 purple_request_action_varg_with_hint(void *handle, const char *title, | |
1341 const char *primary, const char *secondary, | |
1342 int default_action, | |
1343 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1344 const char *ui_hint, void *user_data, size_t action_count, va_list actions) | |
1261 { | 1345 { |
1262 PurpleRequestUiOps *ops; | 1346 PurpleRequestUiOps *ops; |
1263 | 1347 |
1264 g_return_val_if_fail(action_count > 0, NULL); | 1348 g_return_val_if_fail(action_count > 0, NULL); |
1265 | 1349 |
1271 info = g_new0(PurpleRequestInfo, 1); | 1355 info = g_new0(PurpleRequestInfo, 1); |
1272 info->type = PURPLE_REQUEST_ACTION; | 1356 info->type = PURPLE_REQUEST_ACTION; |
1273 info->handle = handle; | 1357 info->handle = handle; |
1274 info->ui_handle = ops->request_action(title, primary, secondary, | 1358 info->ui_handle = ops->request_action(title, primary, secondary, |
1275 default_action, account, who, conv, | 1359 default_action, account, who, conv, |
1276 user_data, action_count, actions); | 1360 ui_hint, user_data, action_count, actions); |
1277 | 1361 |
1278 handles = g_list_append(handles, info); | 1362 handles = g_list_append(handles, info); |
1279 | 1363 |
1280 return info->ui_handle; | 1364 return info->ui_handle; |
1281 } | 1365 } |
1288 const char *secondary, PurpleRequestFields *fields, | 1372 const char *secondary, PurpleRequestFields *fields, |
1289 const char *ok_text, GCallback ok_cb, | 1373 const char *ok_text, GCallback ok_cb, |
1290 const char *cancel_text, GCallback cancel_cb, | 1374 const char *cancel_text, GCallback cancel_cb, |
1291 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1375 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1292 void *user_data) | 1376 void *user_data) |
1377 { | |
1378 return purple_request_fields_with_hint( | |
1379 handle, title, primary, secondary, fields, ok_text, ok_cb, | |
1380 cancel_text, cancel_cb, account, who, conv, "blist", user_data); | |
1381 } | |
1382 | |
1383 void * | |
1384 purple_request_fields_with_hint(void *handle, const char *title, const char *primary, | |
1385 const char *secondary, PurpleRequestFields *fields, | |
1386 const char *ok_text, GCallback ok_cb, | |
1387 const char *cancel_text, GCallback cancel_cb, | |
1388 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1389 const char *ui_hint, void *user_data) | |
1293 { | 1390 { |
1294 PurpleRequestUiOps *ops; | 1391 PurpleRequestUiOps *ops; |
1295 | 1392 |
1296 g_return_val_if_fail(fields != NULL, NULL); | 1393 g_return_val_if_fail(fields != NULL, NULL); |
1297 g_return_val_if_fail(ok_text != NULL, NULL); | 1394 g_return_val_if_fail(ok_text != NULL, NULL); |
1307 info->handle = handle; | 1404 info->handle = handle; |
1308 info->ui_handle = ops->request_fields(title, primary, secondary, | 1405 info->ui_handle = ops->request_fields(title, primary, secondary, |
1309 fields, ok_text, ok_cb, | 1406 fields, ok_text, ok_cb, |
1310 cancel_text, cancel_cb, | 1407 cancel_text, cancel_cb, |
1311 account, who, conv, | 1408 account, who, conv, |
1312 user_data); | 1409 ui_hint, user_data); |
1313 | 1410 |
1314 handles = g_list_append(handles, info); | 1411 handles = g_list_append(handles, info); |
1315 | 1412 |
1316 return info->ui_handle; | 1413 return info->ui_handle; |
1317 } | 1414 } |
1324 gboolean savedialog, | 1421 gboolean savedialog, |
1325 GCallback ok_cb, GCallback cancel_cb, | 1422 GCallback ok_cb, GCallback cancel_cb, |
1326 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1423 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1327 void *user_data) | 1424 void *user_data) |
1328 { | 1425 { |
1426 return purple_request_file_with_hint( | |
1427 handle, title, filename, savedialog, ok_cb, cancel_cb, account, who, conv, "blist", user_data); | |
1428 } | |
1429 | |
1430 void * | |
1431 purple_request_file_with_hint(void *handle, const char *title, const char *filename, | |
1432 gboolean savedialog, | |
1433 GCallback ok_cb, GCallback cancel_cb, | |
1434 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1435 const char *ui_hint, void *user_data) | |
1436 { | |
1329 PurpleRequestUiOps *ops; | 1437 PurpleRequestUiOps *ops; |
1330 | 1438 |
1331 ops = purple_request_get_ui_ops(); | 1439 ops = purple_request_get_ui_ops(); |
1332 | 1440 |
1333 if (ops != NULL && ops->request_file != NULL) { | 1441 if (ops != NULL && ops->request_file != NULL) { |
1336 info = g_new0(PurpleRequestInfo, 1); | 1444 info = g_new0(PurpleRequestInfo, 1); |
1337 info->type = PURPLE_REQUEST_FILE; | 1445 info->type = PURPLE_REQUEST_FILE; |
1338 info->handle = handle; | 1446 info->handle = handle; |
1339 info->ui_handle = ops->request_file(title, filename, savedialog, | 1447 info->ui_handle = ops->request_file(title, filename, savedialog, |
1340 ok_cb, cancel_cb, | 1448 ok_cb, cancel_cb, |
1341 account, who, conv, user_data); | 1449 account, who, conv, ui_hint, user_data); |
1342 handles = g_list_append(handles, info); | 1450 handles = g_list_append(handles, info); |
1343 return info->ui_handle; | 1451 return info->ui_handle; |
1344 } | 1452 } |
1345 | 1453 |
1346 return NULL; | 1454 return NULL; |
1349 void * | 1457 void * |
1350 purple_request_folder(void *handle, const char *title, const char *dirname, | 1458 purple_request_folder(void *handle, const char *title, const char *dirname, |
1351 GCallback ok_cb, GCallback cancel_cb, | 1459 GCallback ok_cb, GCallback cancel_cb, |
1352 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1460 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1353 void *user_data) | 1461 void *user_data) |
1462 { | |
1463 return purple_request_folder_with_hint( | |
1464 handle, title, dirname, ok_cb, cancel_cb, account, who, conv, "blist", user_data); | |
1465 } | |
1466 | |
1467 void * | |
1468 purple_request_folder_with_hint(void *handle, const char *title, const char *dirname, | |
1469 GCallback ok_cb, GCallback cancel_cb, | |
1470 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1471 const char *ui_hint, void *user_data) | |
1354 { | 1472 { |
1355 PurpleRequestUiOps *ops; | 1473 PurpleRequestUiOps *ops; |
1356 | 1474 |
1357 ops = purple_request_get_ui_ops(); | 1475 ops = purple_request_get_ui_ops(); |
1358 | 1476 |
1363 info->type = PURPLE_REQUEST_FOLDER; | 1481 info->type = PURPLE_REQUEST_FOLDER; |
1364 info->handle = handle; | 1482 info->handle = handle; |
1365 info->ui_handle = ops->request_folder(title, dirname, | 1483 info->ui_handle = ops->request_folder(title, dirname, |
1366 ok_cb, cancel_cb, | 1484 ok_cb, cancel_cb, |
1367 account, who, conv, | 1485 account, who, conv, |
1368 user_data); | 1486 ui_hint, user_data); |
1369 handles = g_list_append(handles, info); | 1487 handles = g_list_append(handles, info); |
1370 return info->ui_handle; | 1488 return info->ui_handle; |
1371 } | 1489 } |
1372 | 1490 |
1373 return NULL; | 1491 return NULL; |