gtkblist.h
Go to the documentation of this file.
/* pidgin
*
* Pidgin is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#ifndef _PIDGINBLIST_H_
#define _PIDGINBLIST_H_
typedef struct _PidginBuddyList PidginBuddyList;
enum {
STATUS_ICON_COLUMN,
STATUS_ICON_VISIBLE_COLUMN,
NAME_COLUMN,
IDLE_COLUMN,
IDLE_VISIBLE_COLUMN,
BUDDY_ICON_COLUMN,
BUDDY_ICON_VISIBLE_COLUMN,
NODE_COLUMN,
BGCOLOR_COLUMN,
GROUP_EXPANDER_COLUMN,
GROUP_EXPANDER_VISIBLE_COLUMN,
CONTACT_EXPANDER_COLUMN,
CONTACT_EXPANDER_VISIBLE_COLUMN,
EMBLEM_COLUMN,
EMBLEM_VISIBLE_COLUMN,
PROTOCOL_ICON_COLUMN,
PROTOCOL_ICON_VISIBLE_COLUMN,
BLIST_COLUMNS
};
typedef enum {
PIDGIN_STATUS_ICON_LARGE,
PIDGIN_STATUS_ICON_SMALL
} PidginStatusIconSize;
#include "pidgin.h"
#include "blist.h"
#include "gtkblist-theme.h"
/**************************************************************************
* @name Structures
**************************************************************************/
struct _PidginBuddyList {
GtkWidget *window;
GtkWidget *notebook;
GtkWidget *main_vbox;
GtkWidget *vbox;
GtkWidget *treeview;
GtkTreeStore *treemodel;
GtkTreeViewColumn *text_column;
GtkCellRenderer *text_rend;
GtkItemFactory *ift;
GtkWidget *menutray;
GtkWidget *menutrayicon;
GHashTable *connection_errors;
guint refresh_timer;
guint timeout;
guint drag_timeout;
GdkRectangle tip_rect;
GdkRectangle contact_rect;
PurpleBlistNode *mouseover_contact;
GtkWidget *tipwindow;
GList *tooltipdata;
PurpleBlistNode *selected_node;
GdkCursor *hand_cursor;
GdkCursor *arrow_cursor;
GtkWidget *scrollbook;
GtkWidget *headline_hbox;
GtkWidget *headline_label;
GtkWidget *headline_image;
GdkPixbuf *headline_close;
GCallback headline_callback;
gpointer headline_data;
GDestroyNotify headline_destroy;
gboolean changing_style;
GtkWidget *error_buttons;
GtkWidget *statusbox;
GdkPixbuf *empty_avatar;
gpointer priv;
};
#define PIDGIN_BLIST(list) ((PidginBuddyList *)purple_blist_get_ui_data())
#define PIDGIN_IS_PIDGIN_BLIST(list) \
(purple_blist_get_ui_ops() == pidgin_blist_get_ui_ops())
/**************************************************************************
* @name GTK+ Buddy List API
**************************************************************************/
void *pidgin_blist_get_handle(void);
void pidgin_blist_init(void);
void pidgin_blist_uninit(void);
PurpleBlistUiOps *pidgin_blist_get_ui_ops(void);
PidginBuddyList *pidgin_blist_get_default_gtk_blist(void);
void pidgin_blist_make_buddy_menu(GtkWidget *menu, PurpleBuddy *buddy, gboolean sub);
void pidgin_blist_refresh(PurpleBuddyList *list);
void pidgin_blist_update_columns(void);
void pidgin_blist_update_refresh_timeout(void);
GdkPixbuf *
pidgin_blist_get_emblem(PurpleBlistNode *node);
GdkPixbuf *pidgin_blist_get_status_icon(PurpleBlistNode *node,
PidginStatusIconSize size);
gboolean pidgin_blist_node_is_contact_expanded(PurpleBlistNode *node);
void pidgin_blist_toggle_visibility(void);
void pidgin_blist_visibility_manager_add(void);
void pidgin_blist_visibility_manager_remove(void);
void pidgin_blist_add_alert(GtkWidget *widget);
void pidgin_blist_set_theme(PidginBlistTheme *theme);
PidginBlistTheme *pidgin_blist_get_theme(void);
/**************************************************************************
* @name GTK+ Buddy List sorting functions
**************************************************************************/
typedef void (*pidgin_blist_sort_function)(PurpleBlistNode *new, PurpleBuddyList *blist, GtkTreeIter group, GtkTreeIter *cur, GtkTreeIter *iter);
GList *pidgin_blist_get_sort_methods(void);
struct pidgin_blist_sort_method {
char *id;
char *name;
pidgin_blist_sort_function func;
};
typedef struct pidgin_blist_sort_method PidginBlistSortMethod;
void pidgin_blist_sort_method_reg(const char *id, const char *name, pidgin_blist_sort_function func);
void pidgin_blist_sort_method_unreg(const char *id);
void pidgin_blist_sort_method_set(const char *id);
void pidgin_blist_setup_sort_methods(void);
void pidgin_blist_update_accounts_menu(void);
void pidgin_blist_update_plugin_actions(void);
void pidgin_blist_update_sort_methods(void);
gboolean pidgin_blist_joinchat_is_showable(void);
void pidgin_blist_joinchat_show(void);
void pidgin_append_blist_node_privacy_menu(GtkWidget *menu, PurpleBlistNode *node);
void pidgin_append_blist_node_proto_menu (GtkWidget *menu, PurpleConnection *gc, PurpleBlistNode *node);
void pidgin_append_blist_node_extended_menu(GtkWidget *menu, PurpleBlistNode *node);
void pidgin_blist_update_account_error_state(PurpleAccount *account, const char *message);
void pidgin_blist_set_headline(const char *text, GdkPixbuf *pixbuf, GCallback callback, gpointer user_data,
GDestroyNotify destroy);
gchar *pidgin_blist_get_name_markup(PurpleBuddy *buddy, gboolean selected, gboolean aliased);
void pidgin_blist_draw_tooltip(PurpleBlistNode *node, GtkWidget *widget);
void pidgin_blist_tooltip_destroy(void);
#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_sort_method_unreg
void pidgin_blist_sort_method_unreg(const char *id)
Unregisters a buddy list sorting method.
pidgin_blist_get_emblem
GdkPixbuf * pidgin_blist_get_emblem(PurpleBlistNode *node)
Returns the blist emblem.
pidgin_blist_visibility_manager_add
void pidgin_blist_visibility_manager_add(void)
Increases the reference count of visibility managers.
pidgin_blist_get_default_gtk_blist
PidginBuddyList * pidgin_blist_get_default_gtk_blist(void)
Returns the default gtk buddy list.
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_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_add_alert
void pidgin_blist_add_alert(GtkWidget *widget)
Adds a mini-alert to the blist scrollbook.
pidgin_blist_get_handle
void * pidgin_blist_get_handle(void)
Get the handle for the GTK+ blist system.
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_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_get_ui_ops
PurpleBlistUiOps * pidgin_blist_get_ui_ops(void)
Returns the UI operations structure for the buddy list.
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_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_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_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_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_get_status_icon
GdkPixbuf * pidgin_blist_get_status_icon(PurpleBlistNode *node, PidginStatusIconSize size)
Useful for the buddy ticker.
pidgin_blist_get_theme
PidginBlistTheme * pidgin_blist_get_theme(void)
Gets Pidgin's current buddy list theme.
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...
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