pidgin  2.13.0
About: Pidgin is a chat program (multi-protocol instant messaging client) which lets you log in to accounts on multiple chat networks simultaneously (old name "gaim").
  Fossies Dox: pidgin-2.13.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

gtkutils.h File Reference
#include "gtkconv.h"
#include "pidgin.h"
#include "prpl.h"
#include "util.h"
Include dependency graph for gtkutils.h:

Go to the source code of this file.

Data Structures

struct  PidginBuddyCompletionEntry
 

Typedefs

typedef gboolean(* PidginFilterBuddyCompletionEntryFunc) (const PidginBuddyCompletionEntry *completion_entry, gpointer user_data)
 
typedef void(* PidginUtilMiniDialogCallback) (gpointer user_data, GtkButton *)
 

Enumerations

enum  PidginButtonOrientation { PIDGIN_BUTTON_HORIZONTAL, PIDGIN_BUTTON_VERTICAL }
 
enum  PidginButtonStyle { PIDGIN_BUTTON_NONE = 0, PIDGIN_BUTTON_TEXT, PIDGIN_BUTTON_IMAGE, PIDGIN_BUTTON_TEXT_IMAGE }
 
enum  PidginPrplIconSize { PIDGIN_PRPL_ICON_SMALL, PIDGIN_PRPL_ICON_MEDIUM, PIDGIN_PRPL_ICON_LARGE }
 
enum  PidginBrowserPlace { PIDGIN_BROWSER_DEFAULT = 0, PIDGIN_BROWSER_CURRENT, PIDGIN_BROWSER_NEW_WINDOW, PIDGIN_BROWSER_NEW_TAB }
 

Functions

void pidgin_setup_imhtml (GtkWidget *imhtml)
 
GtkWidget * pidgin_create_imhtml (gboolean editable, GtkWidget **imhtml_ret, GtkWidget **toolbar_ret, GtkWidget **sw_ret)
 
GtkWidget * pidgin_create_small_button (GtkWidget *image)
 
GtkWidget * pidgin_create_window (const char *title, guint border_width, const char *role, gboolean resizable)
 
GtkWidget * pidgin_create_dialog (const char *title, guint border_width, const char *role, gboolean resizable)
 
GtkWidget * pidgin_dialog_get_vbox_with_properties (GtkDialog *dialog, gboolean homogeneous, gint spacing)
 
GtkWidget * pidgin_dialog_get_vbox (GtkDialog *dialog)
 
GtkWidget * pidgin_dialog_add_button (GtkDialog *dialog, const char *label, GCallback callback, gpointer callbackdata)
 
GtkWidget * pidgin_dialog_get_action_area (GtkDialog *dialog)
 
void pidgin_toggle_sensitive (GtkWidget *widget, GtkWidget *to_toggle)
 
void pidgin_set_sensitive_if_input (GtkWidget *entry, GtkWidget *dialog)
 
void pidgin_toggle_sensitive_array (GtkWidget *w, GPtrArray *data)
 
void pidgin_toggle_showhide (GtkWidget *widget, GtkWidget *to_toggle)
 
GtkWidget * pidgin_separator (GtkWidget *menu)
 
GtkWidget * pidgin_new_item (GtkWidget *menu, const char *str)
 
GtkWidget * pidgin_new_check_item (GtkWidget *menu, const char *str, GCallback cb, gpointer data, gboolean checked)
 
GtkWidget * pidgin_new_item_from_stock (GtkWidget *menu, const char *str, const char *icon, GCallback cb, gpointer data, guint accel_key, guint accel_mods, char *mod)
 
GtkWidget * pidgin_pixbuf_button_from_stock (const char *text, const char *icon, PidginButtonOrientation style)
 
GtkWidget * pidgin_pixbuf_toolbar_button_from_stock (const char *stock)
 
GtkWidget * pidgin_make_frame (GtkWidget *parent, const char *title)
 
GtkWidget * pidgin_protocol_option_menu_new (const char *id, GCallback cb, gpointer user_data)
 
const char * pidgin_protocol_option_menu_get_selected (GtkWidget *optmenu)
 
GtkWidget * pidgin_account_option_menu_new (PurpleAccount *default_account, gboolean show_all, GCallback cb, PurpleFilterAccountFunc filter_func, gpointer user_data)
 
PurpleAccountpidgin_account_option_menu_get_selected (GtkWidget *optmenu)
 
void pidgin_account_option_menu_set_selected (GtkWidget *optmenu, PurpleAccount *account)
 
void pidgin_setup_screenname_autocomplete_with_filter (GtkWidget *entry, GtkWidget *optmenu, PidginFilterBuddyCompletionEntryFunc filter_func, gpointer user_data)
 
gboolean pidgin_screenname_autocomplete_default_filter (const PidginBuddyCompletionEntry *completion_entry, gpointer all_accounts)
 
void pidgin_setup_screenname_autocomplete (GtkWidget *entry, GtkWidget *optmenu, gboolean all)
 
gboolean pidgin_check_if_dir (const char *path, GtkFileSelection *filesel)
 
void pidgin_setup_gtkspell (GtkTextView *textview)
 
void pidgin_save_accels_cb (GtkAccelGroup *accel_group, guint arg1, GdkModifierType arg2, GClosure *arg3, gpointer data)
 
gboolean pidgin_save_accels (gpointer data)
 
void pidgin_load_accels (void)
 
void pidgin_retrieve_user_info (PurpleConnection *conn, const char *name)
 
void pidgin_retrieve_user_info_in_chat (PurpleConnection *conn, const char *name, int chatid)
 
gboolean pidgin_parse_x_im_contact (const char *msg, gboolean all_accounts, PurpleAccount **ret_account, char **ret_protocol, char **ret_username, char **ret_alias)
 
void pidgin_set_accessible_label (GtkWidget *w, GtkWidget *l)
 
void pidgin_set_accessible_relations (GtkWidget *w, GtkWidget *l)
 
void pidgin_menu_position_func_helper (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer data)
 
void pidgin_treeview_popup_menu_position_func (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data)
 
void pidgin_dnd_file_manage (GtkSelectionData *sd, PurpleAccount *account, const char *who)
 
void pidgin_buddy_icon_get_scale_size (GdkPixbuf *buf, PurpleBuddyIconSpec *spec, PurpleIconScaleRules rules, int *width, int *height)
 
GdkPixbuf * pidgin_create_prpl_icon (PurpleAccount *account, PidginPrplIconSize size)
 
GdkPixbuf * pidgin_create_status_icon (PurpleStatusPrimitive primitive, GtkWidget *w, const char *size)
 
const char * pidgin_stock_id_from_status_primitive (PurpleStatusPrimitive prim)
 
const char * pidgin_stock_id_from_presence (PurplePresence *presence)
 
GtkWidget * pidgin_append_menu_action (GtkWidget *menu, PurpleMenuAction *act, gpointer gobject)
 
void pidgin_set_cursor (GtkWidget *widget, GdkCursorType cursor_type)
 
void pidgin_clear_cursor (GtkWidget *widget)
 
GtkWidget * pidgin_buddy_icon_chooser_new (GtkWindow *parent, void(*callback)(const char *, gpointer), gpointer data)
 
gpointer pidgin_convert_buddy_icon (PurplePlugin *plugin, const char *path, size_t *len)
 
void pidgin_set_custom_buddy_icon (PurpleAccount *account, const char *who, const char *filename)
 
char * pidgin_make_pretty_arrows (const char *str)
 
GtkWidget * pidgin_make_mini_dialog (PurpleConnection *handle, const char *stock_id, const char *primary, const char *secondary, void *user_data,...) G_GNUC_NULL_TERMINATED
 
GtkWidget * pidgin_make_mini_dialog_with_custom_icon (PurpleConnection *gc, GdkPixbuf *custom_icon, const char *primary, const char *secondary, void *user_data,...) G_GNUC_NULL_TERMINATED
 
gboolean pidgin_tree_view_search_equal_func (GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer data)
 
void pidgin_set_urgent (GtkWindow *window, gboolean urgent)
 
gboolean pidgin_gdk_pixbuf_is_opaque (GdkPixbuf *pixbuf)
 
void pidgin_gdk_pixbuf_make_round (GdkPixbuf *pixbuf)
 
const char * pidgin_get_dim_grey_string (GtkWidget *widget)
 
GtkWidget * pidgin_text_combo_box_entry_new (const char *default_item, GList *items)
 
const char * pidgin_text_combo_box_entry_get_text (GtkWidget *widget)
 
void pidgin_text_combo_box_entry_set_text (GtkWidget *widget, const char *text)
 
gboolean pidgin_auto_parent_window (GtkWidget *window)
 
GtkWidget * pidgin_add_widget_to_vbox (GtkBox *vbox, const char *widget_label, GtkSizeGroup *sg, GtkWidget *widget, gboolean expand, GtkWidget **p_label)
 
GdkPixbuf * pidgin_pixbuf_from_data (const guchar *buf, gsize count)
 
GdkPixbufAnimation * pidgin_pixbuf_anim_from_data (const guchar *buf, gsize count)
 
GdkPixbuf * pidgin_pixbuf_from_imgstore (PurpleStoredImage *image)
 
GdkPixbuf * pidgin_pixbuf_new_from_file (const char *filename)
 
GdkPixbuf * pidgin_pixbuf_new_from_file_at_size (const char *filename, int width, int height)
 
GdkPixbuf * pidgin_pixbuf_new_from_file_at_scale (const char *filename, int width, int height, gboolean preserve_aspect_ratio)
 
GtkWidget * pidgin_make_scrollable (GtkWidget *child, GtkPolicyType hscrollbar_policy, GtkPolicyType vscrollbar_policy, GtkShadowType shadow_type, int width, int height)
 
void pidgin_utils_init (void)
 
void pidgin_utils_uninit (void)
 

Detailed Description

GTK+ utility functions

Definition in file gtkutils.h.

Typedef Documentation

◆ PidginFilterBuddyCompletionEntryFunc

typedef gboolean(* PidginFilterBuddyCompletionEntryFunc) (const PidginBuddyCompletionEntry *completion_entry, gpointer user_data)

Definition at line 80 of file gtkutils.h.

◆ PidginUtilMiniDialogCallback

typedef void(* PidginUtilMiniDialogCallback) (gpointer user_data, GtkButton *)

The type of callbacks passed to pidgin_make_mini_dialog().

Definition at line 689 of file gtkutils.h.

Enumeration Type Documentation

◆ PidginBrowserPlace

Enumerator
PIDGIN_BROWSER_DEFAULT 
PIDGIN_BROWSER_CURRENT 
PIDGIN_BROWSER_NEW_WINDOW 
PIDGIN_BROWSER_NEW_TAB 

Definition at line 62 of file gtkutils.h.

◆ PidginButtonOrientation

Enumerator
PIDGIN_BUTTON_HORIZONTAL 
PIDGIN_BUTTON_VERTICAL 

Definition at line 38 of file gtkutils.h.

◆ PidginButtonStyle

Enumerator
PIDGIN_BUTTON_NONE 
PIDGIN_BUTTON_TEXT 
PIDGIN_BUTTON_IMAGE 
PIDGIN_BUTTON_TEXT_IMAGE 

Definition at line 45 of file gtkutils.h.

◆ PidginPrplIconSize

Enumerator
PIDGIN_PRPL_ICON_SMALL 
PIDGIN_PRPL_ICON_MEDIUM 
PIDGIN_PRPL_ICON_LARGE 

Definition at line 54 of file gtkutils.h.

Function Documentation

◆ pidgin_account_option_menu_get_selected()

PurpleAccount* pidgin_account_option_menu_get_selected ( GtkWidget *  optmenu)

Gets the currently selected account from an account drop down box.

Parameters
optmenuThe drop-down option menu created by pidgin_account_option_menu_new.
Returns
Returns the PurpleAccount that is currently selected.

Definition at line 753 of file gtkutils.c.

References aop_option_menu_get_selected(), and NULL.

Referenced by pidgin_blist_joinchat_show(), pidgin_disco_dialog_new(), pidgin_disco_signed_off_cb(), pidgin_roomlist_dialog_new_with_account(), privacy_dialog_new(), and reset_send_msg_entry().

Here is the caller graph for this function:

◆ pidgin_account_option_menu_new()

GtkWidget* pidgin_account_option_menu_new ( PurpleAccount default_account,
gboolean  show_all,
GCallback  cb,
PurpleFilterAccountFunc  filter_func,
gpointer  user_data 
)

Creates a drop-down option menu filled with accounts.

Parameters
default_accountThe account to select by default.
show_allWhether or not to show all accounts, or just active accounts.
cbThe callback to call when an account is selected.
filter_funcA function for checking if an account should be shown. This can be NULL.
user_dataData to pass to the callback function.
Returns
The drop-down option menu.

Definition at line 872 of file gtkutils.c.

References account_menu_added_removed_cb(), account_menu_destroyed_cb(), account_menu_sign_on_off_cb(), aop_option_menu_new(), create_account_menu(), NULL, purple_accounts_get_handle(), PURPLE_CALLBACK, purple_connections_get_handle(), and purple_signal_connect().

Referenced by create_account_field(), get_config_frame(), gevo_new_person_dialog_show(), make_blist_request_dialog(), pidgin_disco_dialog_new(), pidgin_pounce_editor_show(), pidgin_roomlist_dialog_new_with_account(), plugin_load(), and privacy_dialog_new().

Here is the caller graph for this function:

◆ pidgin_account_option_menu_set_selected()

void pidgin_account_option_menu_set_selected ( GtkWidget *  optmenu,
PurpleAccount account 
)

Sets the currently selected account for an account drop down box.

Parameters
optmenuThe GtkOptionMenu created by pidgin_account_option_menu_new.
accountThe PurpleAccount to select.

Definition at line 866 of file gtkutils.c.

References account, and aop_option_menu_select_by_data().

Referenced by pounce_dnd_recv().

Here is the caller graph for this function:

◆ pidgin_add_widget_to_vbox()

GtkWidget* pidgin_add_widget_to_vbox ( GtkBox *  vbox,
const char *  widget_label,
GtkSizeGroup *  sg,
GtkWidget *  widget,
gboolean  expand,
GtkWidget **  p_label 
)

Add a labelled widget to a GtkVBox

Parameters
vboxThe GtkVBox to add the widget to.
widget_labelThe label to give the widget, can be NULL.
sgThe GtkSizeGroup to add the label to, can be NULL.
widgetThe GtkWidget to add.
expandWhether to expand the widget horizontally.
p_labelPlace to store a pointer to the GtkLabel, or NULL if you don't care.
Returns
A GtkHBox already added to the GtkVBox containing the GtkLabel and the GtkWidget.
Since
2.4.0

Definition at line 2928 of file gtkutils.c.

References FALSE, label, NULL, pidgin_set_accessible_label(), TRUE, and widget.

Referenced by add_pref_box(), away_page(), browser_page(), conv_page(), create_details(), get_config_frame(), gevo_add_buddy_dialog_show(), make_blist_request_dialog(), make_string_pref(), network_page(), pidgin_blist_request_add_buddy(), pidgin_blist_request_add_chat(), pidgin_disco_dialog_new(), pidgin_prefs_dropdown_from_list(), pidgin_prefs_labeled_entry(), pidgin_prefs_labeled_password(), pidgin_prefs_labeled_spin_button(), pidgin_roomlist_dialog_new_with_account(), pidgin_status_editor_show(), privacy_dialog_new(), rebuild_chat_entries(), and sound_page().

Here is the caller graph for this function:

◆ pidgin_append_menu_action()

GtkWidget* pidgin_append_menu_action ( GtkWidget *  menu,
PurpleMenuAction act,
gpointer  gobject 
)

Append a PurpleMenuAction to a menu.

Parameters
menuThe menu to append to.
actThe PurpleMenuAction to append.
gobjectThe object to be passed to the action callback.
Returns
The menuitem added.

Definition at line 1813 of file gtkutils.c.

References act, FALSE, group, menu_action_cb(), NULL, pietray::path, pidgin_append_menu_action(), pidgin_separator(), and purple_menu_action_free().

Referenced by pidgin_append_blist_node_extended_menu(), pidgin_append_blist_node_proto_menu(), pidgin_append_menu_action(), and regenerate_plugins_items().

Here is the caller graph for this function:

◆ pidgin_auto_parent_window()

gboolean pidgin_auto_parent_window ( GtkWidget *  window)

Automatically make a window transient to a suitable parent window.

Parameters
windowThe window to make transient.
Returns
Whether the window was made transient or not.
Since
2.4.0

Definition at line 2961 of file gtkutils.c.

References data, FALSE, NULL, TRUE, value, widget, window, and _GntWidget::window.

Referenced by pidgin_notify_formatted(), pidgin_notify_message(), pidgin_notify_searchresults(), pidgin_plugin_dialog_show(), pidgin_request_action_with_icon(), pidgin_request_choice(), pidgin_request_fields(), pidgin_request_file(), pidgin_request_folder(), and pidgin_request_input().

Here is the caller graph for this function:

◆ pidgin_buddy_icon_chooser_new()

GtkWidget* pidgin_buddy_icon_chooser_new ( GtkWindow *  parent,
void(*)(const char *, gpointer)  callback,
gpointer  data 
)

Creates a File Selection widget for choosing a buddy icon

Parameters
parentThe parent window
callbackThe callback to call when the window is closed. If the user chose an icon, the char* argument will point to its path
dataData to pass to callback
Returns
The file dialog

Definition at line 2275 of file gtkutils.c.

References _(), _icon_chooser::callback, data, pietray::dialog, FALSE, icon_filesel_choose_cb(), icon_preview_change_cb(), NULL, PIDGIN_HIG_BOX_SPACE, PIDGIN_PREFS_ROOT, purple_prefs_get_path(), TRUE, and winpidgin_ensure_onscreen().

Referenced by change_stock_image(), choose_buddy_icon_cb(), icon_select_cb(), open_image_selector(), set_custom_icon_cb(), and set_node_custom_icon().

Here is the caller graph for this function:

◆ pidgin_buddy_icon_get_scale_size()

void pidgin_buddy_icon_get_scale_size ( GdkPixbuf *  buf,
PurpleBuddyIconSpec spec,
PurpleIconScaleRules  rules,
int width,
int height 
)

Convenience wrapper for purple_buddy_icon_get_scale_size

Definition at line 1703 of file gtkutils.c.

References NULL, purple_buddy_icon_get_scale_size(), and _PurpleBuddyIconSpec::scale_rules.

Referenced by set_dialog_icon().

Here is the caller graph for this function:

◆ pidgin_check_if_dir()

gboolean pidgin_check_if_dir ( const char *  path,
GtkFileSelection *  filesel 
)

Check if the given path is a directory or not. If it is, then modify the given GtkFileSelection dialog so that it displays the given path. If the given path is not a directory, then do nothing.

Parameters
pathThe path entered in the file selection window by the user.
fileselThe file selection window.
Returns
TRUE if given path is a directory, FALSE otherwise.
Deprecated:
Pidgin no longer uses GtkFileSelection internally. It has also been deprecated by GTK+. Use GtkFileChooser instead and ignore this function.

Definition at line 908 of file gtkutils.c.

References FALSE, filesel(), NULL, pietray::path, and TRUE.

◆ pidgin_clear_cursor()

void pidgin_clear_cursor ( GtkWidget *  widget)

Sets the mouse point for a GtkWidget back to that of its parent window.

If widget is NULL, this function simply returns.

If the window for widget is NULL, this function simply returns.

Note
The display is not flushed from this function.

Definition at line 2186 of file gtkutils.c.

References NULL, and widget.

Referenced by create_details(), file_yes_no_cb(), gtk_blist_menu_showlog_cb(), log_select_cb(), pidgin_blist_buddy_details_cb(), pidgin_blist_edit_mode_cb(), pidgin_blist_show_empty_groups_cb(), pidgin_blist_show_idle_time_cb(), pidgin_dialogs_log_cb(), plugin_toggled(), plugin_toggled_stage_two(), search_cb(), and sortmethod_act().

Here is the caller graph for this function:

◆ pidgin_convert_buddy_icon()

gpointer pidgin_convert_buddy_icon ( PurplePlugin plugin,
const char *  path,
size_t *  len 
)

Converts a buddy icon to the required size and format

Parameters
pluginThe prpl to convert the icon
pathThe path of a file to convert
lenIf not NULL, the length of the returned data will be set here.
Returns
The converted image data, or NULL if an error occurred.

Definition at line 2342 of file gtkutils.c.

References _(), error, _PurpleBuddyIconSpec::format, _PurplePluginProtocolInfo::icon_spec, _PurplePlugin::info, key, _PurpleBuddyIconSpec::max_filesize, _PurpleBuddyIconSpec::max_height, _PurpleBuddyIconSpec::max_width, _PurpleBuddyIconSpec::min_height, _PurpleBuddyIconSpec::min_width, _PurplePluginInfo::name, NULL, pietray::path, prpl_info, purple_buddy_icon_get_scale_size(), purple_debug_info(), purple_debug_warning(), PURPLE_ICON_SCALE_SEND, purple_notify_error, PURPLE_PLUGIN_PROTOCOL_INFO, purple_strequal(), _PurpleBuddyIconSpec::scale_rules, str_array_match(), and value.

Referenced by account_dnd_recv(), buddy_icon_set_cb(), icon_filesel_choose_cb(), and ok_account_prefs_cb().

Here is the caller graph for this function:

◆ pidgin_create_dialog()

GtkWidget* pidgin_create_dialog ( const char *  title,
guint  border_width,
const char *  role,
gboolean  resizable 
)

Creates a new dialog window

Parameters
titleThe window title, or NULL
border_widthThe window's desired border width
roleA string indicating what the window is responsible for doing, or NULL
resizableWhether the window should be resizable (TRUE) or not (FALSE)
Since
2.4.0

Definition at line 175 of file gtkutils.c.

References FALSE, NULL, and pidgin_window_init().

Referenced by edit_substatus(), insert_smiley_cb(), pidgin_account_dialog_show(), pidgin_accounts_window_show(), pidgin_blist_theme_edit(), pidgin_build_help_dialog(), pidgin_certmgr_show(), pidgin_disco_dialog_new(), pidgin_icon_theme_edit(), pidgin_pounces_manager_show(), pidgin_prefs_show(), pidgin_request_fields(), pidgin_roomlist_dialog_new_with_account(), pidgin_status_editor_show(), pidgin_status_window_show(), and privacy_dialog_new().

Here is the caller graph for this function:

◆ pidgin_create_imhtml()

GtkWidget* pidgin_create_imhtml ( gboolean  editable,
GtkWidget **  imhtml_ret,
GtkWidget **  toolbar_ret,
GtkWidget **  sw_ret 
)

Create an GtkIMHtml widget and associated GtkIMHtmlToolbar widget. This functions puts both widgets in a nice GtkFrame. They're separate by an attractive GtkSeparator.

Parameters
editableTRUE if this imhtml should be editable. If this is FALSE, then the toolbar will NOT be created. If this imthml should be read-only at first, but may become editable later, then pass in TRUE here and then manually call gtk_imhtml_set_editable() later.
imhtml_retA pointer to a pointer to a GtkWidget. This pointer will be set to the imhtml when this function exits.
toolbar_retA pointer to a pointer to a GtkWidget. If editable is TRUE then this will be set to the toolbar when this function exits. Otherwise this will be set to NULL.
sw_retThis will be filled with a pointer to the scrolled window widget which contains the imhtml.
Returns
The GtkFrame containing the toolbar and imhtml.

Definition at line 218 of file gtkutils.c.

References FALSE, GTK_IMHTML, GTK_IMHTML_ALL, GTK_IMHTML_IMAGE, gtk_imhtml_new(), gtk_imhtml_set_editable(), gtk_imhtml_set_format_functions(), GTK_IMHTMLTOOLBAR, gtk_imhtmltoolbar_associate_smileys(), gtk_imhtmltoolbar_attach(), gtk_imhtmltoolbar_new(), NULL, pidgin_make_scrollable(), PIDGIN_PREFS_ROOT, pidgin_setup_gtkspell(), pidgin_setup_imhtml(), purple_prefs_get_bool(), and TRUE.

Referenced by conv_page(), debug_window_new(), display_log_viewer(), edit_substatus(), make_string_pref(), pidgin_build_help_dialog(), pidgin_notify_formatted(), pidgin_pounce_editor_show(), pidgin_request_input(), pidgin_status_box_init(), pidgin_status_editor_show(), and setup_common_pane().

Here is the caller graph for this function:

◆ pidgin_create_prpl_icon()

GdkPixbuf* pidgin_create_prpl_icon ( PurpleAccount account,
PidginPrplIconSize  size 
)

Returns the base image to represent the account, based on the currently selected theme.

Parameters
accountThe account.
sizeThe size of the icon to return.
Returns
A newly-created pixbuf with a reference count of 1, or NULL if any of several error conditions occurred: the file could not be opened, there was no loader for the file's format, there was not enough memory to allocate the image buffer, or the image file contained invalid data.

Definition at line 1787 of file gtkutils.c.

References account, NULL, pidgin_create_prpl_icon_from_prpl(), purple_account_get_protocol_id(), and purple_find_prpl().

Referenced by add_ims(), add_pounce_to_treeview(), buddy_node(), create_account_menu(), create_buddy_menu(), create_sendto_item(), create_tip_for_account(), create_tip_for_node(), get_config_frame(), get_prpl_icon_list(), gevo_add_buddy_dialog_add_person(), pack_prpl_icon_start(), pidgin_accounts_request_authorization(), pidgin_blist_get_emblem(), pidgin_blist_update_accounts_menu(), pidgin_blist_update_chat(), pidgin_log_show(), pidgin_notify_add_mail(), pidgin_notify_pounce_add(), pidgin_notify_searchresults_new_rows(), pidgin_status_box_refresh(), pidgin_widget_decorate_account(), set_account(), signed_on_off_cb(), status_editor_set_account(), and update_tab_icon().

Here is the caller graph for this function:

◆ pidgin_create_small_button()

GtkWidget* pidgin_create_small_button ( GtkWidget *  image)

Creates a small button

Parameters
imageA button image.
Returns
A GtkButton created from the image.
Since
2.7.0

Definition at line 154 of file gtkutils.c.

References FALSE, and image.

Referenced by pidgin_blist_show(), pidgin_conv_setup_quickfind(), and pidgin_conv_window_add_gtkconv().

Here is the caller graph for this function:

◆ pidgin_create_status_icon()

GdkPixbuf* pidgin_create_status_icon ( PurpleStatusPrimitive  primitive,
GtkWidget *  w,
const char *  size 
)

Creates a status icon for a given primitve

Parameters
primitiveThe status primitive
wThe widget to render this
sizeThe icon size to render at
Returns
A GdkPixbuf, created from stock

Definition at line 1720 of file gtkutils.c.

References NULL, pidgin_stock_id_from_status_primitive(), and PIDGIN_STOCK_STATUS_AVAILABLE.

Referenced by new_menu_item_with_status_icon().

Here is the caller graph for this function:

◆ pidgin_create_window()

GtkWidget* pidgin_create_window ( const char *  title,
guint  border_width,
const char *  role,
gboolean  resizable 
)

Creates a new window

Parameters
titleThe window title, or NULL
border_widthThe window's desired border width
roleA string indicating what the window is responsible for doing, or NULL
resizableWhether the window should be resizable (TRUE) or not (FALSE)
Since
2.1.0

Definition at line 143 of file gtkutils.c.

References NULL, and pidgin_window_init().

Referenced by buddy_ticker_create_window(), create_console(), debug_window_new(), gevo_add_buddy_dialog_show(), gevo_associate_buddy_dialog_new(), gevo_new_person_dialog_show(), pidgin_blist_show(), pidgin_conv_window_new(), pidgin_whiteboard_create(), pidgin_xfer_dialog_new(), and show_config().

Here is the caller graph for this function:

◆ pidgin_dialog_add_button()

GtkWidget* pidgin_dialog_add_button ( GtkDialog *  dialog,
const char *  label,
GCallback  callback,
gpointer  callbackdata 
)

Add a button to a dialog created by pidgin_create_dialog.

Parameters
dialogThe dialog window
labelThe stock-id or the label for the button
callbackThe callback function for the button
callbackdataThe user data for the callback function
Returns
The created button.
Since
2.4.0

Definition at line 205 of file gtkutils.c.

References pietray::dialog, FALSE, label, and pidgin_dialog_get_action_area().

Referenced by edit_substatus(), pidgin_account_dialog_show(), pidgin_accounts_window_show(), pidgin_blist_theme_edit(), pidgin_build_help_dialog(), pidgin_certmgr_show(), pidgin_disco_dialog_new(), pidgin_icon_theme_edit(), pidgin_pounces_manager_show(), pidgin_prefs_show(), pidgin_request_fields(), pidgin_roomlist_dialog_new_with_account(), pidgin_status_editor_show(), pidgin_status_window_show(), and privacy_dialog_new().

Here is the caller graph for this function:

◆ pidgin_dialog_get_action_area()

GtkWidget* pidgin_dialog_get_action_area ( GtkDialog *  dialog)

Retrieves the action area (button box) from a pidgin dialog window

Parameters
dialogThe dialog window
Since
2.4.0

Definition at line 200 of file gtkutils.c.

References pietray::dialog.

Referenced by pidgin_dialog_add_button(), pidgin_disco_dialog_new(), pidgin_roomlist_dialog_new_with_account(), pidgin_status_editor_show(), pidgin_status_window_show(), and privacy_dialog_new().

Here is the caller graph for this function:

◆ pidgin_dialog_get_vbox()

GtkWidget* pidgin_dialog_get_vbox ( GtkDialog *  dialog)

Retrieves the main content box (vbox) from a pidgin dialog window

Parameters
dialogThe dialog window
Since
2.4.0

Definition at line 195 of file gtkutils.c.

References pietray::dialog.

Referenced by pidgin_request_fields().

Here is the caller graph for this function:

◆ pidgin_dialog_get_vbox_with_properties()

GtkWidget* pidgin_dialog_get_vbox_with_properties ( GtkDialog *  dialog,
gboolean  homogeneous,
gint  spacing 
)

Retrieves the main content box (vbox) from a pidgin dialog window

Parameters
dialogThe dialog window
homogeneousTRUE if all children are to be given equal space allotments.
spacingthe number of pixels to place by default between children
Since
2.4.0

Definition at line 187 of file gtkutils.c.

References pietray::dialog.

Referenced by edit_substatus(), insert_smiley_cb(), pidgin_account_dialog_show(), pidgin_accounts_window_show(), pidgin_blist_theme_edit(), pidgin_build_help_dialog(), pidgin_certmgr_show(), pidgin_disco_dialog_new(), pidgin_icon_theme_edit(), pidgin_pounces_manager_show(), pidgin_prefs_show(), pidgin_roomlist_dialog_new_with_account(), pidgin_status_editor_show(), pidgin_status_window_show(), and privacy_dialog_new().

Here is the caller graph for this function:

◆ pidgin_dnd_file_manage()

◆ pidgin_gdk_pixbuf_is_opaque()

gboolean pidgin_gdk_pixbuf_is_opaque ( GdkPixbuf *  pixbuf)

Returns TRUE if the GdkPixbuf is opaque, as determined by no alpha at any of the edge pixels.

Parameters
pixbufThe pixbug
Returns
TRUE if the pixbuf is opaque around the edges, FALSE otherwise

Definition at line 2781 of file gtkutils.c.

References FALSE, and TRUE.

Referenced by pidgin_blist_get_buddy_icon(), pidgin_blist_paint_tip(), pidgin_conv_update_buddy_icon(), pidgin_status_box_redisplay_buddy_icon(), and redraw_icon().

Here is the caller graph for this function:

◆ pidgin_gdk_pixbuf_make_round()

void pidgin_gdk_pixbuf_make_round ( GdkPixbuf *  pixbuf)

Rounds the corners of a 32x32 GdkPixbuf in place

Parameters
pixbufThe buddy icon to transform

Definition at line 2815 of file gtkutils.c.

Referenced by pidgin_blist_get_buddy_icon(), pidgin_conv_update_buddy_icon(), pidgin_status_box_redisplay_buddy_icon(), and redraw_icon().

Here is the caller graph for this function:

◆ pidgin_get_dim_grey_string()

const char* pidgin_get_dim_grey_string ( GtkWidget *  widget)

Returns an HTML-style color string for use as a dim grey string

Parameters
widgetThe widget to return dim grey for
Returns
The dim grey string

Definition at line 2856 of file gtkutils.c.

References snprintf, and widget.

Referenced by pidgin_conv_update_fields().

Here is the caller graph for this function:

◆ pidgin_load_accels()

void pidgin_load_accels ( void  )

Load menu accelerators

Definition at line 973 of file gtkutils.c.

References NULL, and purple_user_dir().

Referenced by pidgin_blist_show().

Here is the caller graph for this function:

◆ pidgin_make_frame()

GtkWidget* pidgin_make_frame ( GtkWidget *  parent,
const char *  title 
)

Creates a HIG preferences frame.

Parameters
parentThe widget to put the frame into.
titleThe title for the frame.
Returns
The vbox to put things into.

Definition at line 487 of file gtkutils.c.

References FALSE, label, NULL, PIDGIN_HIG_BOX_SPACE, and pidgin_set_accessible_label().

Referenced by add_login_options(), add_user_options(), away_page(), browser_page(), conv_page(), create_cap_prefs_ui(), get_config_frame(), get_plugin_frame(), interface_page(), keyboard_shortcuts(), logging_page(), network_page(), pidgin_blist_theme_edit(), pidgin_icon_theme_edit(), pidgin_plugin_pref_create_frame(), pidgin_pounce_editor_show(), pidgin_request_fields(), proxy_page(), purplerc_get_config_frame(), sound_page(), and theme_page().

Here is the caller graph for this function:

◆ pidgin_make_mini_dialog()

GtkWidget* pidgin_make_mini_dialog ( PurpleConnection handle,
const char *  stock_id,
const char *  primary,
const char *  secondary,
void user_data,
  ... 
)

Creates a PidginMiniDialog, tied to a PurpleConnection, suitable for embedding in the buddy list scrollbook with pidgin_blist_add_alert().

Parameters
handleThe PurpleConnection to which this mini-dialog refers, or NULL if it does not refer to a connection. If handle is supplied, the mini-dialog will be automatically removed and destroyed when the connection signs off.
stock_idThe ID of a stock image to use in the mini dialog.
primaryThe primary text
secondaryThe secondary text, or NULL for no description.
user_dataData to pass to the callbacks
...a NULL-terminated list of button labels (char *) and callbacks (PidginUtilMiniDialogCallback). user_data will be passed as the first argument. (Callbacks may lack a second argument, or be NULL to take no action when the corresponding button is pressed.) When a button is pressed, the callback (if any) will be called; when the callback returns the dialog will be destroyed.
Returns
A PidginMiniDialog, suitable for passing to pidgin_blist_add_alert().
See also
pidginstock.h

Definition at line 2650 of file gtkutils.c.

References INIT_AND_RETURN_MINI_DIALOG, and pidgin_mini_dialog_new().

Referenced by add_generic_error_dialog(), pidgin_accounts_notify_added(), pidgin_accounts_request_add(), and version_fetch_cb().

Here is the caller graph for this function:

◆ pidgin_make_mini_dialog_with_custom_icon()

GtkWidget* pidgin_make_mini_dialog_with_custom_icon ( PurpleConnection gc,
GdkPixbuf *  custom_icon,
const char *  primary,
const char *  secondary,
void user_data,
  ... 
)

Does exactly what pidgin_make_mini_dialog() does, except you can specify a custom icon for the dialog.

Definition at line 2662 of file gtkutils.c.

References INIT_AND_RETURN_MINI_DIALOG, and pidgin_mini_dialog_new_with_custom_icon().

Referenced by pidgin_accounts_request_authorization().

Here is the caller graph for this function:

◆ pidgin_make_pretty_arrows()

char* pidgin_make_pretty_arrows ( const char *  str)

Converts "->" and "<-" in strings to Unicode arrow characters, for use in referencing menu items.

Parameters
strThe text to convert
Returns
A newly allocated string with unicode arrow characters

Definition at line 2527 of file gtkutils.c.

References str.

Referenced by create_accounts_list(), and pidgin_blist_show().

Here is the caller graph for this function:

◆ pidgin_make_scrollable()

GtkWidget* pidgin_make_scrollable ( GtkWidget *  child,
GtkPolicyType  hscrollbar_policy,
GtkPolicyType  vscrollbar_policy,
GtkShadowType  shadow_type,
int  width,
int  height 
)

◆ pidgin_menu_position_func_helper()

void pidgin_menu_position_func_helper ( GtkMenu *  menu,
gint *  x,
gint *  y,
gboolean *  push_in,
gpointer  data 
)

A helper function for GtkMenuPositionFuncs. This ensures the menu will be kept on screen if possible.

Parameters
menuThe menu we are positioning.
xAddress of the gint representing the horizontal position where the menu shall be drawn. This is an output parameter.
yAddress of the gint representing the vertical position where the menu shall be drawn. This is an output parameter.
push_inThis is an output parameter?
dataNot used by this particular position function.
Since
2.1.0

Definition at line 1257 of file gtkutils.c.

References FALSE, and widget.

Referenced by gtk_imhtmltoolbar_popup_menu(), menu_position_func(), and pidgin_treeview_popup_menu_position_func().

Here is the caller graph for this function:

◆ pidgin_new_check_item()

GtkWidget* pidgin_new_check_item ( GtkWidget *  menu,
const char *  str,
GCallback  cb,
gpointer  data,
gboolean  checked 
)

Creates a check menu item.

Parameters
menuThe menu to which to append the check menu item.
strThe title to use for the newly created menu item.
cbA function to call when the menu item is activated.
dataData to pass to the signal function.
checkedThe initial state of the check item
Returns
The newly created menu item.

Definition at line 361 of file gtkutils.c.

References data, and str.

Referenced by create_chat_menu(), and icon_menu().

Here is the caller graph for this function:

◆ pidgin_new_item()

GtkWidget* pidgin_new_item ( GtkWidget *  menu,
const char *  str 
)

Creates a menu item.

Parameters
menuThe menu to which to append the menu item.
strThe title to use for the newly created menu item.
Returns
The newly created menu item.

Definition at line 338 of file gtkutils.c.

References label, pidgin_set_accessible_label(), and str.

Referenced by service_click_cb().

Here is the caller graph for this function:

◆ pidgin_new_item_from_stock()

GtkWidget* pidgin_new_item_from_stock ( GtkWidget *  menu,
const char *  str,
const char *  icon,
GCallback  cb,
gpointer  data,
guint  accel_key,
guint  accel_mods,
char *  mod 
)

Creates a menu item.

Parameters
menuThe menu to which to append the menu item.
strThe title for the menu item.
iconAn icon to place to the left of the menu item, or NULL for no icon.
cbA function to call when the menu item is activated.
dataData to pass to the signal function.
accel_keySomething.
accel_modsSomething.
modSomething.
Returns
The newly created menu item.

Definition at line 443 of file gtkutils.c.

References data, dbus-buddyicons-example::icon, image, NULL, PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL, and str.

Referenced by add_buddy_icon_menu_items(), create_buddy_menu(), create_chat_menu(), create_contact_menu(), create_group_menu(), docklet_menu(), docklet_status_submenu(), entry_popup_menu_cb(), icon_box_press_cb(), icon_menu(), pidgin_append_blist_node_move_to_menu(), pidgin_append_blist_node_privacy_menu(), pidgin_blist_make_buddy_menu(), room_click_cb(), and service_click_cb().

Here is the caller graph for this function:

◆ pidgin_parse_x_im_contact()

gboolean pidgin_parse_x_im_contact ( const char *  msg,
gboolean  all_accounts,
PurpleAccount **  ret_account,
char **  ret_protocol,
char **  ret_username,
char **  ret_alias 
)

Parses an application/x-im-contact MIME message and returns the data inside.

Parameters
msgThe MIME message.
all_accountsIf TRUE, check all compatible accounts, online or offline. If FALSE, check only online accounts.
ret_accountThe best guess at a compatible protocol, based on ret_protocol. If NULL, no account was found.
ret_protocolThe returned protocol type.
ret_usernameThe returned username.
ret_aliasThe returned alias.
Returns
TRUE if the message was parsed for the minimum necessary data. FALSE otherwise.

Definition at line 1023 of file gtkutils.c.

References account, FALSE, key, _PurplePluginProtocolInfo::list_icon, NULL, protocol, _PurpleConnection::prpl, prpl_info, purple_account_get_protocol_id(), purple_accounts_get_all(), purple_connection_get_account(), purple_connections_get_all(), PURPLE_PLUGIN_PROTOCOL_INFO, purple_plugins_find_with_id(), purple_strequal(), str, strchr(), TRUE, and value.

Referenced by conv_dnd_recv(), invite_dnd_recv(), pidgin_blist_drag_data_rcv_cb(), and pounce_dnd_recv().

Here is the caller graph for this function:

◆ pidgin_pixbuf_anim_from_data()

GdkPixbufAnimation* pidgin_pixbuf_anim_from_data ( const guchar *  buf,
gsize  count 
)

Create a GdkPixbufAnimation from a chunk of image data.

Parameters
bufThe raw binary image data.
countThe length of buf in bytes.
Returns
A GdkPixbufAnimation created from the image data, or NULL if there was an error parsing the data.
Since
2.9.0

Definition at line 3117 of file gtkutils.c.

References count, pidgin_pixbuf_from_data_helper(), and TRUE.

Referenced by gtk_imhtml_insert_image_at_iter(), and pidgin_conv_update_buddy_icon().

Here is the caller graph for this function:

◆ pidgin_pixbuf_button_from_stock()

GtkWidget* pidgin_pixbuf_button_from_stock ( const char *  text,
const char *  icon,
PidginButtonOrientation  style 
)

Creates a button with the specified text and stock icon.

Parameters
textThe text for the button.
iconThe stock icon name.
styleThe orientation of the button.
Returns
The button.

Definition at line 401 of file gtkutils.c.

References FALSE, dbus-buddyicons-example::icon, image, label, NULL, PIDGIN_BUTTON_HORIZONTAL, pidgin_set_accessible_label(), text, and TRUE.

Referenced by get_config_frame(), gevo_add_buddy_dialog_show(), gevo_associate_buddy_dialog_new(), pidgin_disco_dialog_new(), pidgin_roomlist_dialog_new_with_account(), pidgin_status_editor_show(), pidgin_status_window_show(), pidgin_theme_create_color_selector(), pidgin_theme_create_font_selector(), purplerc_make_fonts_vbox(), and purplerc_make_interface_vbox().

Here is the caller graph for this function:

◆ pidgin_pixbuf_from_data()

GdkPixbuf* pidgin_pixbuf_from_data ( const guchar *  buf,
gsize  count 
)

Create a GdkPixbuf from a chunk of image data.

Parameters
bufThe raw binary image data.
countThe length of buf in bytes.
Returns
A GdkPixbuf created from the image data, or NULL if there was an error parsing the data.
Since
2.9.0

Definition at line 3112 of file gtkutils.c.

References count, FALSE, and pidgin_pixbuf_from_data_helper().

Referenced by create_image_field(), pidgin_blist_get_buddy_icon(), pidgin_pixbuf_from_imgstore(), and pidgin_request_action_with_icon().

Here is the caller graph for this function:

◆ pidgin_pixbuf_from_imgstore()

GdkPixbuf* pidgin_pixbuf_from_imgstore ( PurpleStoredImage image)

Create a GdkPixbuf from a PurpleStoredImage.

Parameters
imageA PurpleStoredImage.
Returns
A GdkPixbuf created from the stored image.
Since
2.5.0

Definition at line 3122 of file gtkutils.c.

References image, pidgin_pixbuf_from_data(), purple_imgstore_get_data(), and purple_imgstore_get_size().

Referenced by pidgin_smiley_edit(), set_account(), set_dialog_icon(), and store_smiley_add().

Here is the caller graph for this function:

◆ pidgin_pixbuf_new_from_file()

GdkPixbuf* pidgin_pixbuf_new_from_file ( const char *  filename)

Helper function that calls gdk_pixbuf_new_from_file() and checks both the return code and the GError and returns NULL if either one failed.

The gdk-pixbuf documentation implies that it is sufficient to check the return value of gdk_pixbuf_new_from_file() to determine whether the image was able to be loaded. However, this is not the case with gdk-pixbuf 2.23.3 and probably many earlier versions. In some cases a GdkPixbuf object is returned that will cause some operations (like gdk_pixbuf_scale_simple()) to rapidly consume memory in an infinite loop.

This function shouldn't be necessary once Pidgin requires a version of gdk-pixbuf where the aforementioned bug is fixed. However, it might be nice to keep this function around for the debug message that it logs.

Parameters
filenameName of file to load, in the GLib file name encoding
Returns
The GdkPixbuf if successful. Otherwise NULL is returned and a warning is logged.
Since
2.9.0

◆ pidgin_pixbuf_new_from_file_at_scale()

GdkPixbuf* pidgin_pixbuf_new_from_file_at_scale ( const char *  filename,
int  width,
int  height,
gboolean  preserve_aspect_ratio 
)

Helper function that calls gdk_pixbuf_new_from_file_at_scale() and checks both the return code and the GError and returns NULL if either one failed.

The gdk-pixbuf documentation implies that it is sufficient to check the return value of gdk_pixbuf_new_from_file_at_scale() to determine whether the image was able to be loaded. However, this is not the case with gdk-pixbuf 2.23.3 and probably many earlier versions. In some cases a GdkPixbuf object is returned that will cause some operations (like gdk_pixbuf_scale_simple()) to rapidly consume memory in an infinite loop.

This function shouldn't be necessary once Pidgin requires a version of gdk-pixbuf where the aforementioned bug is fixed. However, it might be nice to keep this function around for the debug message that it logs.

Parameters
filenameName of file to load, in the GLib file name encoding
widthThe width the image should have or -1 to not constrain the width
heightThe height the image should have or -1 to not constrain the height
preserve_aspect_ratioTRUE to preserve the image's aspect ratio
Returns
The GdkPixbuf if successful. Otherwise NULL is returned and a warning is logged.
Since
2.9.0

Definition at line 3173 of file gtkutils.c.

References error, NULL, and purple_debug_warning().

Referenced by do_add_file_cb(), prefs_themes_refresh(), and prefs_themes_sort().

Here is the caller graph for this function:

◆ pidgin_pixbuf_new_from_file_at_size()

GdkPixbuf* pidgin_pixbuf_new_from_file_at_size ( const char *  filename,
int  width,
int  height 
)

Helper function that calls gdk_pixbuf_new_from_file_at_size() and checks both the return code and the GError and returns NULL if either one failed.

The gdk-pixbuf documentation implies that it is sufficient to check the return value of gdk_pixbuf_new_from_file_at_size() to determine whether the image was able to be loaded. However, this is not the case with gdk-pixbuf 2.23.3 and probably many earlier versions. In some cases a GdkPixbuf object is returned that will cause some operations (like gdk_pixbuf_scale_simple()) to rapidly consume memory in an infinite loop.

This function shouldn't be necessary once Pidgin requires a version of gdk-pixbuf where the aforementioned bug is fixed. However, it might be nice to keep this function around for the debug message that it logs.

Parameters
filenameName of file to load, in the GLib file name encoding
widthThe width the image should have or -1 to not constrain the width
heightThe height the image should have or -1 to not constrain the height
Returns
The GdkPixbuf if successful. Otherwise NULL is returned and a warning is logged.
Since
2.9.0

Definition at line 3150 of file gtkutils.c.

References error, NULL, and purple_debug_warning().

Referenced by icon_preview_change_cb(), and pidgin_xfer_add_thumbnail().

Here is the caller graph for this function:

◆ pidgin_pixbuf_toolbar_button_from_stock()

GtkWidget* pidgin_pixbuf_toolbar_button_from_stock ( const char *  stock)

Creates a toolbar button with the stock icon.

Parameters
stockThe stock icon name.
Returns
The button.

Definition at line 381 of file gtkutils.c.

References FALSE, dbus-buddyicons-example::icon, image, and PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL.

Referenced by gtk_imhtmltoolbar_create_old_buttons().

Here is the caller graph for this function:

◆ pidgin_protocol_option_menu_get_selected()

const char* pidgin_protocol_option_menu_get_selected ( GtkWidget *  optmenu)

Gets the currently selected protocol from a protocol drop down box.

Parameters
optmenuThe drop-down option menu created by pidgin_account_option_menu_new.
Returns
Returns the protocol ID that is currently selected.

Definition at line 747 of file gtkutils.c.

References aop_option_menu_get_selected(), and NULL.

◆ pidgin_protocol_option_menu_new()

GtkWidget* pidgin_protocol_option_menu_new ( const char *  id,
GCallback  cb,
gpointer  user_data 
)

Creates a drop-down option menu filled with protocols.

Parameters
idThe protocol to select by default.
cbThe callback to call when a protocol is selected.
user_dataData to pass to the callback function.
Returns
The drop-down option menu.

Definition at line 740 of file gtkutils.c.

References aop_option_menu_new(), and create_protocols_menu().

Referenced by add_login_options().

Here is the caller graph for this function:

◆ pidgin_retrieve_user_info()

void pidgin_retrieve_user_info ( PurpleConnection conn,
const char *  name 
)

Get information about a user. Show immediate feedback.

Parameters
connThe connection to get information from.
nameThe user to get information about.
Since
2.1.0

Definition at line 992 of file gtkutils.c.

References name, serv_get_info(), and show_retrieveing_info().

Referenced by get_user_info_cb(), gtk_blist_button_press_cb(), gtk_blist_key_press_cb(), gtk_blist_menu_info_cb(), info_cb(), pidgin_dialogs_info_cb(), and pidgin_retrieve_user_info_in_chat().

Here is the caller graph for this function:

◆ pidgin_retrieve_user_info_in_chat()

void pidgin_retrieve_user_info_in_chat ( PurpleConnection conn,
const char *  name,
int  chatid 
)

Get information about a user in a chat. Show immediate feedback.

Parameters
connThe connection to get information from.
nameThe user to get information about.
chatidThe chat id.
Since
2.1.0

Definition at line 998 of file gtkutils.c.

References _PurplePluginProtocolInfo::get_cb_info, _PurplePluginProtocolInfo::get_cb_real_name, name, NULL, pidgin_retrieve_user_info(), _PurpleConnection::prpl, prpl_info, PURPLE_PLUGIN_PROTOCOL_INFO, and show_retrieveing_info().

Referenced by chat_do_info().

Here is the caller graph for this function:

◆ pidgin_save_accels()

gboolean pidgin_save_accels ( gpointer  data)

Save menu accelerators

Definition at line 958 of file gtkutils.c.

References accels_save_timer, FALSE, NULL, purple_debug(), PURPLE_DEBUG_MISC, and purple_user_dir().

Referenced by pidgin_save_accels_cb().

Here is the caller graph for this function:

◆ pidgin_save_accels_cb()

void pidgin_save_accels_cb ( GtkAccelGroup *  accel_group,
guint  arg1,
GdkModifierType  arg2,
GClosure *  arg3,
gpointer  data 
)

Save menu accelerators callback

Definition at line 945 of file gtkutils.c.

References accels_save_timer, NULL, pidgin_save_accels(), purple_debug(), PURPLE_DEBUG_MISC, and purple_timeout_add_seconds().

Referenced by pidgin_blist_show(), and setup_menubar().

Here is the caller graph for this function:

◆ pidgin_screenname_autocomplete_default_filter()

gboolean pidgin_screenname_autocomplete_default_filter ( const PidginBuddyCompletionEntry completion_entry,
gpointer  all_accounts 
)

The default filter function for username autocomplete.

Parameters
completion_entryThe completion entry to filter.
all_accountsIf this is FALSE, only the autocompletion entries which belong to an online account will be filtered.
Returns
Returns TRUE if the autocompletion entry is filtered.

Definition at line 2154 of file gtkutils.c.

References _PurpleBuddy::account, _PurpleLogSet::account, PidginBuddyCompletionEntry::buddy, PidginBuddyCompletionEntry::entry, PidginBuddyCompletionEntry::is_buddy, PidginBuddyCompletionEntry::logged_buddy, NULL, and purple_account_is_connected().

Referenced by pidgin_pounce_editor_show(), pidgin_setup_screenname_autocomplete(), pidgin_setup_screenname_autocomplete_with_filter(), and setup_entry_field().

Here is the caller graph for this function:

◆ pidgin_separator()

GtkWidget* pidgin_separator ( GtkWidget *  menu)

◆ pidgin_set_accessible_label()

void pidgin_set_accessible_label ( GtkWidget *  w,
GtkWidget *  l 
)

Sets an ATK name for a given widget. Also sets the labelled-by and label-for ATK relationships.

Parameters
wThe widget that we want to name.
lA GtkLabel that we want to use as the ATK name for the widget.

Definition at line 1206 of file gtkutils.c.

References pidgin_set_accessible_relations().

Referenced by add_user_options(), aop_menu_item_new(), display_log_viewer(), pidgin_add_widget_to_vbox(), pidgin_make_frame(), pidgin_new_item(), pidgin_pixbuf_button_from_stock(), pidgin_pounce_editor_show(), pidgin_request_input(), pidgin_smiley_edit(), and proxy_page().

Here is the caller graph for this function:

◆ pidgin_set_accessible_relations()

void pidgin_set_accessible_relations ( GtkWidget *  w,
GtkWidget *  l 
)

Sets the labelled-by and label-for ATK relationships.

Parameters
wThe widget that we want to label.
lA GtkLabel that we want to use as the label for the widget.
Since
2.2.0

Definition at line 1226 of file gtkutils.c.

References label, and set().

Referenced by pidgin_set_accessible_label().

Here is the caller graph for this function:

◆ pidgin_set_cursor()

void pidgin_set_cursor ( GtkWidget *  widget,
GdkCursorType  cursor_type 
)

Sets the mouse pointer for a GtkWidget.

After setting the cursor, the display is flushed, so the change will take effect immediately.

If the window for widget is NULL, this function simply returns.

Parameters
widgetThe widget for which to set the mouse pointer
cursor_typeThe type of cursor to set

Definition at line 2171 of file gtkutils.c.

References NULL, and widget.

Referenced by generic_response_start(), gtk_blist_menu_showlog_cb(), log_select_cb(), pidgin_blist_buddy_details_cb(), pidgin_blist_edit_mode_cb(), pidgin_blist_show_empty_groups_cb(), pidgin_blist_show_idle_time_cb(), pidgin_dialogs_log_cb(), plugin_toggled(), plugin_toggled_stage_two(), search_cb(), sortmethod_act(), and website_button_motion_cb().

Here is the caller graph for this function:

◆ pidgin_set_custom_buddy_icon()

void pidgin_set_custom_buddy_icon ( PurpleAccount account,
const char *  who,
const char *  filename 
)

Set or unset a custom buddyicon for a user.

Parameters
accountThe account the user belongs to.
whoThe name of the user.
filenameThe path of the custom icon. If this is NULL, then any previously set custom buddy icon for the user is removed.
Deprecated:
See purple_buddy_icons_node_set_custom_icon_from_file()

Definition at line 2512 of file gtkutils.c.

References account, purple_buddy_get_contact(), purple_buddy_icons_node_set_custom_icon_from_file(), purple_debug_info(), and purple_find_buddy().

◆ pidgin_set_sensitive_if_input()

void pidgin_set_sensitive_if_input ( GtkWidget *  entry,
GtkWidget *  dialog 
)

Checks if text has been entered into a GtkTextEntry widget. If so, the GTK_RESPONSE_OK on the given dialog is set to TRUE. Otherwise GTK_RESPONSE_OK is set to FALSE.

Parameters
entryThe text entry widget.
dialogThe dialog containing the text entry widget.

Definition at line 278 of file gtkutils.c.

References pietray::dialog, and text.

Referenced by find_cb(), and pidgin_blist_request_add_buddy().

Here is the caller graph for this function:

◆ pidgin_set_urgent()

void pidgin_set_urgent ( GtkWindow *  window,
gboolean  urgent 
)

Sets or resets a window to 'urgent,' by setting the URGENT hint in X or blinking in the win32 taskbar

Parameters
windowThe window to draw attention to
urgentWhether to set the urgent hint or not

Definition at line 2542 of file gtkutils.c.

References window, and winpidgin_window_flash().

Referenced by blist_focus_cb(), handle_urgent(), mail_window_focus_cb(), pidgin_notify_emails(), reset_headline(), and set_urgent().

Here is the caller graph for this function:

◆ pidgin_setup_gtkspell()

void pidgin_setup_gtkspell ( GtkTextView *  textview)

Sets up GtkSpell for the given GtkTextView, reporting errors if encountered.

This does nothing if Pidgin is not compiled with GtkSpell support.

Parameters
textviewThe textview widget to setup spellchecking for.

Definition at line 926 of file gtkutils.c.

References error, gtkspell_new_attach, NULL, and purple_debug_warning().

Referenced by create_string_field(), pidgin_create_imhtml(), pidgin_request_input(), pidgin_status_box_init(), spellcheck_pref_cb(), and spellcheck_prefs_cb().

Here is the caller graph for this function:

◆ pidgin_setup_imhtml()

void pidgin_setup_imhtml ( GtkWidget *  imhtml)

Sets up a gtkimhtml widget, loads it with smileys, and sets the default signal handlers.

Parameters
imhtmlThe gtkimhtml widget to setup.

Definition at line 104 of file gtkutils.c.

References GTK_IMHTML, gtk_imhtml_set_funcs(), GTK_IS_IMHTML, gtkimhtml_cbs, NULL, PIDGIN_PREFS_ROOT, pidgin_themes_smiley_themeize(), purple_prefs_get_bool(), and purple_prefs_get_string().

Referenced by pidgin_create_imhtml().

Here is the caller graph for this function:

◆ pidgin_setup_screenname_autocomplete()

void pidgin_setup_screenname_autocomplete ( GtkWidget *  entry,
GtkWidget *  optmenu,
gboolean  all 
)

Add autocompletion of screenames to an entry.

Deprecated:
For new code, use the equivalent: pidgin_setup_screenname_autocomplete_with_filter(entry, optmenu, pidgin_screenname_autocomplete_default_filter, GINT_TO_POINTER(all))
Parameters
entryThe GtkEntry on which to setup autocomplete.
optmenuA menu for accounts, returned by pidgin_account_option_menu_new(). If optmenu is not NULL, it'll be updated when a username is chosen from the autocomplete list.
allWhether to include usernames from disconnected accounts.

Definition at line 2165 of file gtkutils.c.

References pidgin_screenname_autocomplete_default_filter(), and pidgin_setup_screenname_autocomplete_with_filter().

◆ pidgin_setup_screenname_autocomplete_with_filter()

void pidgin_setup_screenname_autocomplete_with_filter ( GtkWidget *  entry,
GtkWidget *  optmenu,
PidginFilterBuddyCompletionEntryFunc  filter_func,
gpointer  user_data 
)

Add autocompletion of screenames to an entry, supporting a filtering function.

Parameters
entryThe GtkEntry on which to setup autocomplete.
optmenuA menu for accounts, returned by pidgin_account_option_menu_new(). If optmenu is not NULL, it'll be updated when a username is chosen from the autocomplete list.
filter_funcA function for checking if an autocomplete entry should be shown. This can be NULL.
user_dataThe data to be passed to the filter_func function.

Definition at line 2093 of file gtkutils.c.

References add_completion_list(), buddyname_autocomplete_destroyed_cb(), buddyname_completion_match_func(), buddyname_completion_match_selected_cb(), data, NULL, pidgin_screenname_autocomplete_default_filter(), purple_accounts_get_handle(), PURPLE_CALLBACK, purple_connections_get_handle(), purple_signal_connect(), and repopulate_autocomplete().

Referenced by invite_cb(), pidgin_pounce_editor_show(), pidgin_setup_screenname_autocomplete(), and setup_entry_field().

Here is the caller graph for this function:

◆ pidgin_stock_id_from_presence()

const char* pidgin_stock_id_from_presence ( PurplePresence presence)

Returns an appropriate stock-id for a PurplePresence.

Parameters
presenceThe presence.
Returns
The stock-id
Since
2.6.0

Definition at line 1768 of file gtkutils.c.

References idle, NULL, purple_presence_get_active_status(), purple_presence_is_idle(), purple_status_get_type(), purple_status_type_get_primitive(), status, stock_id_from_status_primitive_idle(), and dbus-analyze-signals::type.

Referenced by buddy_ticker_set_pixmap().

Here is the caller graph for this function:

◆ pidgin_stock_id_from_status_primitive()

const char* pidgin_stock_id_from_status_primitive ( PurpleStatusPrimitive  prim)

Returns an appropriate stock-id for a status primitive.

Parameters
primThe status primitive
Returns
The stock-id
Since
2.6.0

Definition at line 1762 of file gtkutils.c.

References FALSE, and stock_id_from_status_primitive_idle().

Referenced by edit_substatus(), get_stock_icon_from_primitive(), pidgin_conv_get_icon_stock(), pidgin_create_status_icon(), pidgin_status_box_add(), pidgin_status_box_refresh(), pidgin_status_menu_add_primitive(), and pidgin_status_menu_update_iter().

Here is the caller graph for this function:

◆ pidgin_text_combo_box_entry_get_text()

const char* pidgin_text_combo_box_entry_get_text ( GtkWidget *  widget)

Retrieve the text from the entry of the simple text GtkComboBoxEntry equivalent

Parameters
widgetThe simple text GtkComboBoxEntry equivalent widget
Returns
The text in the widget's entry. It must not be freed
Since
2.2.0

Definition at line 2917 of file gtkutils.c.

References widget.

Referenced by add_buddy_cb(), add_cb(), add_chat_cb(), new_person_cb(), and select_buddy_cb().

Here is the caller graph for this function:

◆ pidgin_text_combo_box_entry_new()

GtkWidget* pidgin_text_combo_box_entry_new ( const char *  default_item,
GList *  items 
)

Create a simple text GtkComboBoxEntry equivalent

Parameters
default_itemInitial contents of GtkEntry
itemsGList containing strings to add to GtkComboBox
Returns
A newly created text GtkComboBox containing a GtkEntry child.
Since
2.2.0

Definition at line 2893 of file gtkutils.c.

References combo_box_changed_cb(), entry_key_pressed_cb(), NULL, and text.

Referenced by gevo_add_buddy_dialog_show(), gevo_new_person_dialog_show(), pidgin_blist_request_add_buddy(), and pidgin_blist_request_add_chat().

Here is the caller graph for this function:

◆ pidgin_text_combo_box_entry_set_text()

void pidgin_text_combo_box_entry_set_text ( GtkWidget *  widget,
const char *  text 
)

Set the text in the entry of the simple text GtkComboBoxEntry equivalent

Parameters
widgetThe simple text GtkComboBoxEntry equivalent widget
textThe text to set
Since
2.2.0

Definition at line 2922 of file gtkutils.c.

References text, and widget.

◆ pidgin_toggle_sensitive()

void pidgin_toggle_sensitive ( GtkWidget *  widget,
GtkWidget *  to_toggle 
)

Toggles the sensitivity of a widget.

Parameters
widgetNULL. Used for signal handlers.
to_toggleThe widget to toggle.

Definition at line 286 of file gtkutils.c.

References NULL.

Referenced by away_page(), conv_page(), get_config_frame(), network_page(), pidgin_pounce_editor_show(), purplerc_make_fonts_vbox(), purplerc_make_interface_vbox(), and purplerc_make_misc_vbox().

Here is the caller graph for this function:

◆ pidgin_toggle_sensitive_array()

void pidgin_toggle_sensitive_array ( GtkWidget *  w,
GPtrArray *  data 
)

Toggles the sensitivity of all widgets in a pointer array.

Parameters
wNULL. Used for signal handlers.
dataThe array containing the widgets to toggle.

Definition at line 299 of file gtkutils.c.

References data, and NULL.

Referenced by pidgin_pounce_editor_show().

Here is the caller graph for this function:

◆ pidgin_toggle_showhide()

void pidgin_toggle_showhide ( GtkWidget *  widget,
GtkWidget *  to_toggle 
)

Toggles the visibility of a widget.

Parameters
widgetNULL. Used for signal handlers.
to_toggleThe widget to toggle.

Definition at line 317 of file gtkutils.c.

References NULL.

◆ pidgin_tree_view_search_equal_func()

gboolean pidgin_tree_view_search_equal_func ( GtkTreeModel *  model,
gint  column,
const gchar *  key,
GtkTreeIter *  iter,
gpointer  data 
)

This is a callback function to be used for Ctrl+F searching in treeviews. Sample Use: gtk_tree_view_set_search_equal_func(treeview, pidgin_tree_view_search_equal_func, search_data, search_data_destroy_cb);

Definition at line 2688 of file gtkutils.c.

References FALSE, key, model, NULL, purple_markup_strip_html(), purple_notify_info, purple_str_has_prefix(), and TRUE.

Referenced by pidgin_blist_search_equal_func(), pidgin_create_notification_dialog(), pidgin_plugin_dialog_show(), and pidgin_status_box_init().

Here is the caller graph for this function:

◆ pidgin_treeview_popup_menu_position_func()

void pidgin_treeview_popup_menu_position_func ( GtkMenu *  menu,
gint *  x,
gint *  y,
gboolean *  push_in,
gpointer  user_data 
)

A valid GtkMenuPositionFunc. This is used to determine where to draw context menus when the menu is activated with the keyboard (shift+F10). If the menu is activated with the mouse, then you should just use GTK's built-in position function, because it does a better job of positioning the menu.

Parameters
menuThe menu we are positioning.
xAddress of the gint representing the horizontal position where the menu shall be drawn. This is an output parameter.
yAddress of the gint representing the vertical position where the menu shall be drawn. This is an output parameter.
push_inThis is an output parameter?
user_dataNot used by this particular position function.

Definition at line 1407 of file gtkutils.c.

References data, pietray::path, pidgin_menu_position_func_helper(), tv, and widget.

Referenced by gtkconv_chat_popup_menu_cb(), log_popup_menu_cb(), and pidgin_blist_popup_menu_cb().

Here is the caller graph for this function:

◆ pidgin_utils_init()

void pidgin_utils_init ( void  )

◆ pidgin_utils_uninit()

void pidgin_utils_uninit ( void  )

Uninitialize some utility functions.

Since
2.6.0

Definition at line 3656 of file gtkutils.c.

References gtk_imhtml_class_register_protocol(), NULL, and registered_url_handlers.

Referenced by pidgin_quit().

Here is the caller graph for this function: