pidgin: gtkblist.h Source File

pidgin 2.14.4

Loading...
Searching...
No Matches
gtkblist.h
Go to the documentation of this file.
1
7/* pidgin
8 *
9 * Pidgin is the legal property of its developers, whose names are too numerous
10 * to list here. Please refer to the COPYRIGHT file distributed with this
11 * source distribution.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
26 */
27#ifndef _PIDGINBLIST_H_
28#define _PIDGINBLIST_H_
29
31 typedef struct _PidginBuddyList PidginBuddyList;
32
33enum {
34 STATUS_ICON_COLUMN,
35 STATUS_ICON_VISIBLE_COLUMN,
36 NAME_COLUMN,
37 IDLE_COLUMN,
38 IDLE_VISIBLE_COLUMN,
39 BUDDY_ICON_COLUMN,
40 BUDDY_ICON_VISIBLE_COLUMN,
41 NODE_COLUMN,
42 BGCOLOR_COLUMN,
43 GROUP_EXPANDER_COLUMN,
44 GROUP_EXPANDER_VISIBLE_COLUMN,
45 CONTACT_EXPANDER_COLUMN,
46 CONTACT_EXPANDER_VISIBLE_COLUMN,
47 EMBLEM_COLUMN,
48 EMBLEM_VISIBLE_COLUMN,
49 PROTOCOL_ICON_COLUMN,
50 PROTOCOL_ICON_VISIBLE_COLUMN,
51 BLIST_COLUMNS
52
53};
54
55typedef enum {
56 PIDGIN_STATUS_ICON_LARGE,
57 PIDGIN_STATUS_ICON_SMALL
58
59} PidginStatusIconSize;
60
61#include "pidgin.h"
62#include "blist.h"
63#include "gtkblist-theme.h"
64
65/**************************************************************************
66 * @name Structures
67 **************************************************************************/
71 struct _PidginBuddyList {
72 GtkWidget *window;
73 GtkWidget *notebook;
75 GtkWidget *main_vbox;
76 GtkWidget *vbox;
79 GtkWidget *treeview;
80 GtkTreeStore *treemodel;
81 GtkTreeViewColumn *text_column;
83 GtkCellRenderer *text_rend;
84
85 GtkItemFactory *ift;
86 GtkWidget *menutray;
87 GtkWidget *menutrayicon;
96 GHashTable *connection_errors;
97
98 guint refresh_timer;
100 guint timeout;
101 guint drag_timeout;
102 GdkRectangle tip_rect;
105 GdkRectangle contact_rect;
108 PurpleBlistNode *mouseover_contact;
110 GtkWidget *tipwindow;
111 GList *tooltipdata;
113 PurpleBlistNode *selected_node;
115 GdkCursor *hand_cursor;
116 GdkCursor *arrow_cursor;
118 GtkWidget *scrollbook;
119 GtkWidget *headline_hbox;
120 GtkWidget *headline_label;
121 GtkWidget *headline_image;
122 GdkPixbuf *headline_close;
123 GCallback headline_callback;
124 gpointer headline_data;
125 GDestroyNotify headline_destroy;
126 gboolean changing_style;
128 GtkWidget *error_buttons;
129 GtkWidget *statusbox;
130 GdkPixbuf *empty_avatar;
132 gpointer priv;
133};
134
135#define PIDGIN_BLIST(list) ((PidginBuddyList *)purple_blist_get_ui_data())
136#define PIDGIN_IS_PIDGIN_BLIST(list) \
137 (purple_blist_get_ui_ops() == pidgin_blist_get_ui_ops())
138
139/**************************************************************************
140 * @name GTK+ Buddy List API
141 **************************************************************************/
142
148 void *pidgin_blist_get_handle(void);
149
153 void pidgin_blist_init(void);
154
158 void pidgin_blist_uninit(void);
159
165 PurpleBlistUiOps *pidgin_blist_get_ui_ops(void);
166
176 PidginBuddyList *pidgin_blist_get_default_gtk_blist(void);
177
185 void pidgin_blist_make_buddy_menu(GtkWidget *menu, PurpleBuddy *buddy, gboolean sub);
186
193 void pidgin_blist_refresh(PurpleBuddyList *list);
194
195void pidgin_blist_update_columns(void);
196void pidgin_blist_update_refresh_timeout(void);
197
208GdkPixbuf *
209pidgin_blist_get_emblem(PurpleBlistNode *node);
210
214GdkPixbuf *pidgin_blist_get_status_icon(PurpleBlistNode *node,
215 PidginStatusIconSize size);
216
226gboolean pidgin_blist_node_is_contact_expanded(PurpleBlistNode *node);
227
233 void pidgin_blist_toggle_visibility(void);
234
243 void pidgin_blist_visibility_manager_add(void);
244
249 void pidgin_blist_visibility_manager_remove(void);
250
256 void pidgin_blist_add_alert(GtkWidget *widget);
257
265 void pidgin_blist_set_theme(PidginBlistTheme *theme);
266
274 PidginBlistTheme *pidgin_blist_get_theme(void);
275
276/**************************************************************************
277 * @name GTK+ Buddy List sorting functions
278 **************************************************************************/
279
280typedef void (*pidgin_blist_sort_function)(PurpleBlistNode *new, PurpleBuddyList *blist, GtkTreeIter group, GtkTreeIter *cur, GtkTreeIter *iter);
281
287GList *pidgin_blist_get_sort_methods(void);
288
289 struct pidgin_blist_sort_method {
290 char *id;
291 char *name;
292 pidgin_blist_sort_function func;
293};
294
295typedef struct pidgin_blist_sort_method PidginBlistSortMethod;
296
305 void pidgin_blist_sort_method_reg(const char *id, const char *name, pidgin_blist_sort_function func);
306
312 void pidgin_blist_sort_method_unreg(const char *id);
313
319 void pidgin_blist_sort_method_set(const char *id);
320
324 void pidgin_blist_setup_sort_methods(void);
325
329 void pidgin_blist_update_accounts_menu(void);
330
334 void pidgin_blist_update_plugin_actions(void);
335
339 void pidgin_blist_update_sort_methods(void);
340
347gboolean pidgin_blist_joinchat_is_showable(void);
348
352 void pidgin_blist_joinchat_show(void);
353
358 void pidgin_append_blist_node_privacy_menu(GtkWidget *menu, PurpleBlistNode *node);
359
364 void pidgin_append_blist_node_proto_menu (GtkWidget *menu, PurpleConnection *gc, PurpleBlistNode *node);
365
370 void pidgin_append_blist_node_extended_menu(GtkWidget *menu, PurpleBlistNode *node);
371
384 void pidgin_blist_update_account_error_state(PurpleAccount *account, const char *message);
385
398 void pidgin_blist_set_headline(const char *text, GdkPixbuf *pixbuf, GCallback callback, gpointer user_data,
399 GDestroyNotify destroy);
400
411gchar *pidgin_blist_get_name_markup(PurpleBuddy *buddy, gboolean selected, gboolean aliased);
412
424 void pidgin_blist_draw_tooltip(PurpleBlistNode *node, GtkWidget *widget);
425
431 void pidgin_blist_tooltip_destroy(void);
432
433
434#endif /* _PIDGINBLIST_H_ */
blist.h
Buddy List API.
gtkblist-theme.h
GTK+ Buddy List Theme API.
pidgin_blist_init
void pidgin_blist_init(void)
Initializes the GTK+ blist system.
pidgin_append_blist_node_proto_menu
void pidgin_append_blist_node_proto_menu(GtkWidget *menu, PurpleConnection *gc, PurpleBlistNode *node)
Appends the protocol specific menu items for a PurpleBlistNode TODO: Rename these.
pidgin_blist_get_status_icon
GdkPixbuf * pidgin_blist_get_status_icon(PurpleBlistNode *node, PidginStatusIconSize size)
Useful for the buddy ticker.
pidgin_blist_sort_method_unreg
void pidgin_blist_sort_method_unreg(const char *id)
Unregisters a buddy list sorting method.
pidgin_blist_visibility_manager_add
void pidgin_blist_visibility_manager_add(void)
Increases the reference count of visibility managers.
pidgin_blist_draw_tooltip
void pidgin_blist_draw_tooltip(PurpleBlistNode *node, GtkWidget *widget)
Creates the Buddy List tooltip at the current pointer location for the given buddy list node.
pidgin_blist_sort_method_set
void pidgin_blist_sort_method_set(const char *id)
Sets a buddy list sorting method.
pidgin_blist_update_plugin_actions
void pidgin_blist_update_plugin_actions(void)
Updates the plugin actions menu on the GTK+ buddy list window.
pidgin_blist_get_name_markup
gchar * pidgin_blist_get_name_markup(PurpleBuddy *buddy, gboolean selected, gboolean aliased)
Returns a buddy's Pango markup appropriate for setting in a GtkCellRenderer.
pidgin_blist_make_buddy_menu
void pidgin_blist_make_buddy_menu(GtkWidget *menu, PurpleBuddy *buddy, gboolean sub)
Populates a menu with the items shown on the buddy list for a buddy.
pidgin_blist_get_emblem
GdkPixbuf * pidgin_blist_get_emblem(PurpleBlistNode *node)
Returns the blist emblem.
pidgin_blist_add_alert
void pidgin_blist_add_alert(GtkWidget *widget)
Adds a mini-alert to the blist scrollbook.
pidgin_blist_get_theme
PidginBlistTheme * pidgin_blist_get_theme(void)
Gets Pidgin's current buddy list theme.
pidgin_blist_visibility_manager_remove
void pidgin_blist_visibility_manager_remove(void)
Decreases the reference count of visibility managers.
pidgin_blist_sort_method_reg
void pidgin_blist_sort_method_reg(const char *id, const char *name, pidgin_blist_sort_function func)
Registers a buddy list sorting method.
pidgin_blist_get_handle
void * pidgin_blist_get_handle(void)
Get the handle for the GTK+ blist system.
pidgin_append_blist_node_extended_menu
void pidgin_append_blist_node_extended_menu(GtkWidget *menu, PurpleBlistNode *node)
Appends the extended menu items for a PurpleBlistNode TODO: Rename these.
pidgin_append_blist_node_privacy_menu
void pidgin_append_blist_node_privacy_menu(GtkWidget *menu, PurpleBlistNode *node)
Appends the privacy menu items for a PurpleBlistNode TODO: Rename these.
pidgin_blist_joinchat_is_showable
gboolean pidgin_blist_joinchat_is_showable(void)
Determines if showing the join chat dialog is a valid action.
pidgin_blist_set_theme
void pidgin_blist_set_theme(PidginBlistTheme *theme)
Sets the current theme for Pidgin to use.
pidgin_blist_tooltip_destroy
void pidgin_blist_tooltip_destroy(void)
Destroys the current (if any) Buddy List tooltip.
pidgin_blist_get_ui_ops
PurpleBlistUiOps * pidgin_blist_get_ui_ops(void)
Returns the UI operations structure for the buddy list.
pidgin_blist_get_sort_methods
GList * pidgin_blist_get_sort_methods(void)
Gets the current list of sort methods.
pidgin_blist_refresh
void pidgin_blist_refresh(PurpleBuddyList *list)
Refreshes all the nodes of the buddy list.
pidgin_blist_get_default_gtk_blist
PidginBuddyList * pidgin_blist_get_default_gtk_blist(void)
Returns the default gtk buddy list.
pidgin_blist_update_sort_methods
void pidgin_blist_update_sort_methods(void)
Updates the Sorting menu on the GTK+ buddy list window.
pidgin_blist_toggle_visibility
void pidgin_blist_toggle_visibility(void)
Intelligently toggles the visibility of the buddy list.
pidgin_blist_update_account_error_state
void pidgin_blist_update_account_error_state(PurpleAccount *account, const char *message)
Was used by the connection API to tell the blist if an account has a connection error or no longer ha...
pidgin_blist_set_headline
void pidgin_blist_set_headline(const char *text, GdkPixbuf *pixbuf, GCallback callback, gpointer user_data, GDestroyNotify destroy)
Sets a headline notification.
pidgin_blist_uninit
void pidgin_blist_uninit(void)
Uninitializes the GTK+ blist system.
pidgin_blist_joinchat_show
void pidgin_blist_joinchat_show(void)
Shows the join chat dialog.
pidgin_blist_update_accounts_menu
void pidgin_blist_update_accounts_menu(void)
Updates the accounts menu on the GTK+ buddy list window.
pidgin_blist_node_is_contact_expanded
gboolean pidgin_blist_node_is_contact_expanded(PurpleBlistNode *node)
Returns a boolean indicating if node is part of an expanded contact.
pidgin_blist_setup_sort_methods
void pidgin_blist_setup_sort_methods(void)
Sets up the programs default sort methods.
pidgin.h
UI definitions and includes.
_PidginBlistTheme
Definition: gtkblist-theme.h:52
_PidginBuddyList
Like, everything you need to know about the gtk buddy list.
Definition: gtkblist.h:71
_PidginBuddyList::headline_destroy
GDestroyNotify headline_destroy
Callback to use for destroying the headline-data.
Definition: gtkblist.h:125
_PidginBuddyList::headline_image
GtkWidget * headline_image
Image for headline notifications.
Definition: gtkblist.h:121
_PidginBuddyList::contact_rect
GdkRectangle contact_rect
This is the bounding rectangle of the contact node and its children.
Definition: gtkblist.h:105
_PidginBuddyList::main_vbox
GtkWidget * main_vbox
This vbox contains the menu and notebook.
Definition: gtkblist.h:75
_PidginBuddyList::treeview
GtkWidget * treeview
It's a treeview... d'uh.
Definition: gtkblist.h:79
_PidginBuddyList::tipwindow
GtkWidget * tipwindow
The window used by the tooltip.
Definition: gtkblist.h:110
_PidginBuddyList::headline_label
GtkWidget * headline_label
Label for headline notifications.
Definition: gtkblist.h:120
_PidginBuddyList::tip_rect
GdkRectangle tip_rect
This is the bounding rectangle of the cell we're currently hovering over.
Definition: gtkblist.h:102
_PidginBuddyList::tooltipdata
GList * tooltipdata
The data for each "chunk" of the tooltip.
Definition: gtkblist.h:111
_PidginBuddyList::connection_errors
GHashTable * connection_errors
Caches connection error messages; keys are PurpleAccount and values are non-NULL const char *s contai...
Definition: gtkblist.h:96
_PidginBuddyList::menutrayicon
GtkWidget * menutrayicon
The menu tray icon.
Definition: gtkblist.h:87
_PidginBuddyList::treemodel
GtkTreeStore * treemodel
This is the treemodel.
Definition: gtkblist.h:80
_PidginBuddyList::vbox
GtkWidget * vbox
This is the vbox that everything important gets packed into.
Definition: gtkblist.h:76
_PidginBuddyList::drag_timeout
guint drag_timeout
The timeout for expanding contacts on drags.
Definition: gtkblist.h:101
_PidginBuddyList::timeout
guint timeout
The timeout for the tooltip.
Definition: gtkblist.h:100
_PidginBuddyList::text_column
GtkTreeViewColumn * text_column
Column.
Definition: gtkblist.h:81
_PidginBuddyList::headline_close
GdkPixbuf * headline_close
Definition: gtkblist.h:122
_PidginBuddyList::error_buttons
GtkWidget * error_buttons
Box containing the connection error buttons.
Definition: gtkblist.h:128
_PidginBuddyList::changing_style
gboolean changing_style
True when changing GTK+ theme style.
Definition: gtkblist.h:126
_PidginBuddyList::mouseover_contact
PurpleBlistNode * mouseover_contact
This is the contact currently mouse-over expanded.
Definition: gtkblist.h:108
_PidginBuddyList::arrow_cursor
GdkCursor * arrow_cursor
Arrow cursor.
Definition: gtkblist.h:116
_PidginBuddyList::headline_hbox
GtkWidget * headline_hbox
Hbox for headline notification.
Definition: gtkblist.h:119
_PidginBuddyList::empty_avatar
GdkPixbuf * empty_avatar
A 32x32 transparent pixbuf.
Definition: gtkblist.h:130
_PidginBuddyList::scrollbook
GtkWidget * scrollbook
Scrollbook for alerts.
Definition: gtkblist.h:118
_PidginBuddyList::headline_callback
GCallback headline_callback
Callback for headline notifications.
Definition: gtkblist.h:123
_PidginBuddyList::notebook
GtkWidget * notebook
The notebook that switches between the real buddy list and the helpful instructions page.
Definition: gtkblist.h:73
_PidginBuddyList::headline_data
gpointer headline_data
User data for headline notifications.
Definition: gtkblist.h:124
_PidginBuddyList::selected_node
PurpleBlistNode * selected_node
The currently selected node.
Definition: gtkblist.h:113
_PidginBuddyList::hand_cursor
GdkCursor * hand_cursor
Hand cursor.
Definition: gtkblist.h:115
_PidginBuddyList::priv
gpointer priv
Pointer to opaque private data.
Definition: gtkblist.h:132
_PidginBuddyList::menutray
GtkWidget * menutray
The menu tray widget.
Definition: gtkblist.h:86
_PidginBuddyList::refresh_timer
guint refresh_timer
The timer for refreshing every 30 seconds.
Definition: gtkblist.h:98
_PidginBuddyList::statusbox
GtkWidget * statusbox
The status selector dropdown.
Definition: gtkblist.h:129
_PurpleAccount
Structure representing an account.
Definition: account.h:170
_PurpleBlistNode
A Buddy list node.
Definition: blist.h:126
_PurpleBlistUiOps
Buddy list UI operations.
Definition: blist.h:206
_PurpleBuddyList
The Buddy List.
Definition: blist.h:191
_PurpleBuddy
A buddy.
Definition: blist.h:140
_PurpleConnection
Definition: connection.h:246
pidgin_blist_sort_method
Definition: gtkblist.h:289