pidgin/gtkutils.h

changeset 15884
4de1981757fc
parent 15799
ba7af742a0d1
child 15931
716b5fac1895
equal deleted inserted replaced
15883:969b74a3e27a 15884:4de1981757fc
1 /** 1 /**
2 * @file gtkutils.h GTK+ utility functions 2 * @file gtkutils.h GTK+ utility functions
3 * @ingroup gtkui 3 * @ingroup gtkui
4 * 4 *
5 * gaim 5 * purple
6 * 6 *
7 * Pidgin is the legal property of its developers, whose names are too numerous 7 * Pidgin 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 8 * to list here. Please refer to the COPYRIGHT file distributed with this
9 * source distribution. 9 * source distribution.
10 * 10 *
232 * be shown. This can be NULL. 232 * be shown. This can be NULL.
233 * @param user_data Data to pass to the callback function. 233 * @param user_data Data to pass to the callback function.
234 * 234 *
235 * @return The drop-down option menu. 235 * @return The drop-down option menu.
236 */ 236 */
237 GtkWidget *pidgin_account_option_menu_new(GaimAccount *default_account, 237 GtkWidget *pidgin_account_option_menu_new(PurpleAccount *default_account,
238 gboolean show_all, GCallback cb, 238 gboolean show_all, GCallback cb,
239 GaimFilterAccountFunc filter_func, gpointer user_data); 239 PurpleFilterAccountFunc filter_func, gpointer user_data);
240 240
241 /** 241 /**
242 * Gets the currently selected account from an account drop down box. 242 * Gets the currently selected account from an account drop down box.
243 * 243 *
244 * @param optmenu The GtkOptionMenu created by 244 * @param optmenu The GtkOptionMenu created by
245 * pidgin_account_option_menu_new. 245 * pidgin_account_option_menu_new.
246 * @return Returns the GaimAccount that is currently selected. 246 * @return Returns the PurpleAccount that is currently selected.
247 */ 247 */
248 GaimAccount *pidgin_account_option_menu_get_selected(GtkWidget *optmenu); 248 PurpleAccount *pidgin_account_option_menu_get_selected(GtkWidget *optmenu);
249 249
250 /** 250 /**
251 * Sets the currently selected account for an account drop down box. 251 * Sets the currently selected account for an account drop down box.
252 * 252 *
253 * @param optmenu The GtkOptionMenu created by 253 * @param optmenu The GtkOptionMenu created by
254 * pidgin_account_option_menu_new. 254 * pidgin_account_option_menu_new.
255 * @param account The GaimAccount to select. 255 * @param account The PurpleAccount to select.
256 */ 256 */
257 void pidgin_account_option_menu_set_selected(GtkWidget *optmenu, GaimAccount *account); 257 void pidgin_account_option_menu_set_selected(GtkWidget *optmenu, PurpleAccount *account);
258 258
259 /** 259 /**
260 * Add autocompletion of screenames to an entry. 260 * Add autocompletion of screenames to an entry.
261 * 261 *
262 * @param entry The GtkEntry on which to setup autocomplete. 262 * @param entry The GtkEntry on which to setup autocomplete.
321 * 321 *
322 * @return TRUE if the message was parsed for the minimum necessary data. 322 * @return TRUE if the message was parsed for the minimum necessary data.
323 * FALSE otherwise. 323 * FALSE otherwise.
324 */ 324 */
325 gboolean pidgin_parse_x_im_contact(const char *msg, gboolean all_accounts, 325 gboolean pidgin_parse_x_im_contact(const char *msg, gboolean all_accounts,
326 GaimAccount **ret_account, 326 PurpleAccount **ret_account,
327 char **ret_protocol, char **ret_username, 327 char **ret_protocol, char **ret_username,
328 char **ret_alias); 328 char **ret_alias);
329 329
330 /** 330 /**
331 * Sets an ATK name for a given widget. Also sets the labelled-by 331 * Sets an ATK name for a given widget. Also sets the labelled-by
362 * 362 *
363 * @param sd GtkSelectionData for managing drag'n'drop 363 * @param sd GtkSelectionData for managing drag'n'drop
364 * @param account Account to be used (may be NULL if conv is not NULL) 364 * @param account Account to be used (may be NULL if conv is not NULL)
365 * @param who Buddy name (may be NULL if conv is not NULL) 365 * @param who Buddy name (may be NULL if conv is not NULL)
366 */ 366 */
367 void pidgin_dnd_file_manage(GtkSelectionData *sd, GaimAccount *account, const char *who); 367 void pidgin_dnd_file_manage(GtkSelectionData *sd, PurpleAccount *account, const char *who);
368 368
369 /** 369 /**
370 * Convenience wrapper for gaim_buddy_icon_get_scale_size 370 * Convenience wrapper for purple_buddy_icon_get_scale_size
371 */ 371 */
372 void pidgin_buddy_icon_get_scale_size(GdkPixbuf *buf, GaimBuddyIconSpec *spec, GaimIconScaleRules rules, int *width, int *height); 372 void pidgin_buddy_icon_get_scale_size(GdkPixbuf *buf, PurpleBuddyIconSpec *spec, PurpleIconScaleRules rules, int *width, int *height);
373 373
374 /** 374 /**
375 * Returns the base image to represent the account, based on 375 * Returns the base image to represent the account, based on
376 * the currently selected theme. 376 * the currently selected theme.
377 * 377 *
383 * the file could not be opened, there was no loader 383 * the file could not be opened, there was no loader
384 * for the file's format, there was not enough memory 384 * for the file's format, there was not enough memory
385 * to allocate the image buffer, or the image file 385 * to allocate the image buffer, or the image file
386 * contained invalid data. 386 * contained invalid data.
387 */ 387 */
388 GdkPixbuf *pidgin_create_prpl_icon(GaimAccount *account, PidginPrplIconSize size); 388 GdkPixbuf *pidgin_create_prpl_icon(PurpleAccount *account, PidginPrplIconSize size);
389 389
390 /** 390 /**
391 * Creates a status icon for a given primitve 391 * Creates a status icon for a given primitve
392 * 392 *
393 * @param primitive The status primitive 393 * @param primitive The status primitive
394 * @param w The widget to render this 394 * @param w The widget to render this
395 * @param size The icon size to render at 395 * @param size The icon size to render at
396 * @retrun A GdkPixbuf, created from stock 396 * @retrun A GdkPixbuf, created from stock
397 */ 397 */
398 GdkPixbuf * pidgin_create_status_icon(GaimStatusPrimitive primitive, GtkWidget *w, const char *size); 398 GdkPixbuf * pidgin_create_status_icon(PurpleStatusPrimitive primitive, GtkWidget *w, const char *size);
399 399
400 400
401 /** 401 /**
402 * Append a GaimMenuAction to a menu. 402 * Append a PurpleMenuAction to a menu.
403 * 403 *
404 * @param menu The menu to append to. 404 * @param menu The menu to append to.
405 * @param act The GaimMenuAction to append. 405 * @param act The PurpleMenuAction to append.
406 * @param gobject The object to be passed to the action callback. 406 * @param gobject The object to be passed to the action callback.
407 */ 407 */
408 void pidgin_append_menu_action(GtkWidget *menu, GaimMenuAction *act, 408 void pidgin_append_menu_action(GtkWidget *menu, PurpleMenuAction *act,
409 gpointer gobject); 409 gpointer gobject);
410 410
411 /** 411 /**
412 * Sets the mouse pointer for a GtkWidget. 412 * Sets the mouse pointer for a GtkWidget.
413 * 413 *
447 * 447 *
448 * @param plugin The prpl to conver the icon 448 * @param plugin The prpl to conver the icon
449 * @param path The path of a buddy icon to convert 449 * @param path The path of a buddy icon to convert
450 * @return The name of a new buddy icon 450 * @return The name of a new buddy icon
451 */ 451 */
452 char* pidgin_convert_buddy_icon(GaimPlugin *plugin, const char *path); 452 char* pidgin_convert_buddy_icon(PurplePlugin *plugin, const char *path);
453 453
454 #if !GTK_CHECK_VERSION(2,6,0) 454 #if !GTK_CHECK_VERSION(2,6,0)
455 /** 455 /**
456 * Creates a new pixbuf by loading an image from a file. The image will 456 * Creates a new pixbuf by loading an image from a file. The image will
457 * be scaled to fit in the requested size, optionally preserving the image's 457 * be scaled to fit in the requested size, optionally preserving the image's
468 * @param account The account the user belongs to. 468 * @param account The account the user belongs to.
469 * @param who The name of the user. 469 * @param who The name of the user.
470 * @param filename The path of the custom icon. If this is @c NULL, then any 470 * @param filename The path of the custom icon. If this is @c NULL, then any
471 * previously set custom buddy icon for the user is removed. 471 * previously set custom buddy icon for the user is removed.
472 */ 472 */
473 void pidgin_set_custom_buddy_icon(GaimAccount *account, const char *who, const char *filename); 473 void pidgin_set_custom_buddy_icon(PurpleAccount *account, const char *who, const char *filename);
474 474
475 /** 475 /**
476 * Converts "->" and "<-" in strings to Unicode arrow characters, for use in referencing 476 * Converts "->" and "<-" in strings to Unicode arrow characters, for use in referencing
477 * menu items. 477 * menu items.
478 * 478 *
488 * @param primary The primary text 488 * @param primary The primary text
489 * @param secondary The secondary text 489 * @param secondary The secondary text
490 * @param user_data Data to pass to the callbacks 490 * @param user_data Data to pass to the callbacks
491 * @param ... a NULL-terminated list of button labels and callbacks 491 * @param ... a NULL-terminated list of button labels and callbacks
492 */ 492 */
493 void *pidgin_make_mini_dialog(GaimConnection *handle, const char* stock_id, 493 void *pidgin_make_mini_dialog(PurpleConnection *handle, const char* stock_id,
494 const char *primary, const char *secondary, 494 const char *primary, const char *secondary,
495 void *user_data, ...); 495 void *user_data, ...);
496 496
497 /** 497 /**
498 * This is a callback function to be used for Ctrl+F searching in treeviews. 498 * This is a callback function to be used for Ctrl+F searching in treeviews.

mercurial