| blist.h | | blist.h | |
| | | | |
| skipping to change at line 78 | | skipping to change at line 78 | |
| #define PURPLE_BUDDY_IS_ONLINE(b) \ | | #define PURPLE_BUDDY_IS_ONLINE(b) \ | |
| ((b) != NULL && purple_account_is_connected(purple_buddy_get_account
(b)) && \ | | ((b) != NULL && purple_account_is_connected(purple_buddy_get_account
(b)) && \ | |
| purple_presence_is_online(purple_buddy_get_presence(b))) | | purple_presence_is_online(purple_buddy_get_presence(b))) | |
| | | | |
| typedef enum | | typedef enum | |
| { | | { | |
| PURPLE_BLIST_NODE_FLAG_NO_SAVE = 1 << 0 /**< node should not be
saved with the buddy list */ | | PURPLE_BLIST_NODE_FLAG_NO_SAVE = 1 << 0 /**< node should not be
saved with the buddy list */ | |
| | | | |
| } PurpleBlistNodeFlags; | | } PurpleBlistNodeFlags; | |
| | | | |
|
| | | /** | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | #define PURPLE_BLIST_NODE(obj) ((PurpleBlistNode *)(obj)) | |
| | | | |
| #define PURPLE_BLIST_NODE_HAS_FLAG(b, f) (purple_blist_node_get_flags((Purp
leBlistNode*)(b)) & (f)) | | #define PURPLE_BLIST_NODE_HAS_FLAG(b, f) (purple_blist_node_get_flags((Purp
leBlistNode*)(b)) & (f)) | |
| #define PURPLE_BLIST_NODE_SHOULD_SAVE(b) (! PURPLE_BLIST_NODE_HAS_FLAG(b, P
URPLE_BLIST_NODE_FLAG_NO_SAVE)) | | #define PURPLE_BLIST_NODE_SHOULD_SAVE(b) (! PURPLE_BLIST_NODE_HAS_FLAG(b, P
URPLE_BLIST_NODE_FLAG_NO_SAVE)) | |
| | | | |
| #define PURPLE_BLIST_NODE_NAME(n) (purple_blist_node_get_type(n) == PURPLE_
BLIST_CHAT_NODE ? purple_chat_get_name((PurpleChat*)n) : \ | | #define PURPLE_BLIST_NODE_NAME(n) (purple_blist_node_get_type(n) == PURPLE_
BLIST_CHAT_NODE ? purple_chat_get_name((PurpleChat*)n) : \ | |
| purple_blist_node_get_type(n) == PURPLE
_BLIST_BUDDY_NODE ? purple_buddy_get_name((PurpleBuddy*)n) : NULL) | | purple_blist_node_get_type(n) == PURPLE
_BLIST_BUDDY_NODE ? purple_buddy_get_name((PurpleBuddy*)n) : NULL) | |
| | | | |
|
| | | /** | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | #define PURPLE_GROUP(obj) ((PurpleGroup *)(obj)) | |
| | | | |
| | | /** | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | #define PURPLE_CONTACT(obj) ((PurpleContact *)(obj)) | |
| | | | |
| | | /** | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | #define PURPLE_BUDDY(obj) ((PurpleBuddy *)(obj)) | |
| | | | |
| | | /** | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | #define PURPLE_CHAT(obj) ((PurpleChat *)(obj)) | |
| | | | |
| #include "account.h" | | #include "account.h" | |
| #include "buddyicon.h" | | #include "buddyicon.h" | |
| #include "status.h" | | #include "status.h" | |
| | | | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /* Data Structures *
/ | | /* Data Structures *
/ | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| | | | |
| #if !(defined PURPLE_HIDE_STRUCTS) || (defined _PURPLE_BLIST_C_) | | #if !(defined PURPLE_HIDE_STRUCTS) || (defined _PURPLE_BLIST_C_) | |
| | | | |
| /** | | /** | |
| * A Buddy list node. This can represent a group, a buddy, or anything els
e. | | * A Buddy list node. This can represent a group, a buddy, or anything els
e. | |
|
| * This is a base class for struct buddy and struct group and for anything | | * This is a base class for PurpleBuddy, PurpleContact, PurpleGroup, and fo | |
| * else that wants to put itself in the buddy list. */ | | r | |
| | | * anything else that wants to put itself in the buddy list. */ | |
| struct _PurpleBlistNode { | | struct _PurpleBlistNode { | |
| PurpleBlistNodeType type; /**< The type of node this is
*/ | | PurpleBlistNodeType type; /**< The type of node this is
*/ | |
| PurpleBlistNode *prev; /**< The sibling before this b
uddy. */ | | PurpleBlistNode *prev; /**< The sibling before this b
uddy. */ | |
| PurpleBlistNode *next; /**< The sibling after this bu
ddy. */ | | PurpleBlistNode *next; /**< The sibling after this bu
ddy. */ | |
| PurpleBlistNode *parent; /**< The parent of this node
*/ | | PurpleBlistNode *parent; /**< The parent of this node
*/ | |
| PurpleBlistNode *child; /**< The child of this node
*/ | | PurpleBlistNode *child; /**< The child of this node
*/ | |
| GHashTable *settings; /**< per-node settings
*/ | | GHashTable *settings; /**< per-node settings
*/ | |
| void *ui_data; /**< The UI can put data here.
*/ | | void *ui_data; /**< The UI can put data here.
*/ | |
| PurpleBlistNodeFlags flags; /**< The buddy flags
*/ | | PurpleBlistNodeFlags flags; /**< The buddy flags
*/ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * A buddy. This contains everything Purple will ever need to know about s
omeone on the buddy list. Everything. | | * A buddy. This contains everything Purple will ever need to know about s
omeone on the buddy list. Everything. | |
| */ | | */ | |
| struct _PurpleBuddy { | | struct _PurpleBuddy { | |
| PurpleBlistNode node; /**< The node that this bu
ddy inherits from */ | | PurpleBlistNode node; /**< The node that this bu
ddy inherits from */ | |
|
| char *name; /**< The screenname of the b
uddy. */ | | char *name; /**< The name of the buddy.
*/ | |
| char *alias; /**< The user-set alias of t
he buddy */ | | char *alias; /**< The user-set alias of t
he buddy */ | |
| char *server_alias; /**< The server-specified al
ias of the buddy. (i.e. MSN "Friendly Names") */ | | char *server_alias; /**< The server-specified al
ias of the buddy. (i.e. MSN "Friendly Names") */ | |
| void *proto_data; /**< This allows the prpl to
associate whatever data it wants with a buddy */ | | void *proto_data; /**< This allows the prpl to
associate whatever data it wants with a buddy */ | |
| PurpleBuddyIcon *icon; /**< The buddy icon. */ | | PurpleBuddyIcon *icon; /**< The buddy icon. */ | |
| PurpleAccount *account; /**< the acc
ount this buddy belongs to */ | | PurpleAccount *account; /**< the acc
ount this buddy belongs to */ | |
| PurplePresence *presence; | | PurplePresence *presence; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * A contact. This contains everything Purple will ever need to know about
a contact. | | * A contact. This contains everything Purple will ever need to know about
a contact. | |
| | | | |
| skipping to change at line 158 | | skipping to change at line 183 | |
| * A chat. This contains everything Purple needs to put a chat room in the | | * A chat. This contains everything Purple needs to put a chat room in the | |
| * buddy list. | | * buddy list. | |
| */ | | */ | |
| struct _PurpleChat { | | struct _PurpleChat { | |
| PurpleBlistNode node; /**< The node that this chat inherits fro
m */ | | PurpleBlistNode node; /**< The node that this chat inherits fro
m */ | |
| char *alias; /**< The display name of this chat. */ | | char *alias; /**< The display name of this chat. */ | |
| GHashTable *components; /**< the stuff the protocol needs to know t
o join the chat */ | | GHashTable *components; /**< the stuff the protocol needs to know t
o join the chat */ | |
| PurpleAccount *account; /**< The account this chat is attached to */ | | PurpleAccount *account; /**< The account this chat is attached to */ | |
| }; | | }; | |
| | | | |
|
| #endif /* PURPLE_HIDE_STRUCTS && PURPLE_BLIST_STRUCTS */ | | | |
| | | | |
| /** | | /** | |
| * The Buddy List | | * The Buddy List | |
| */ | | */ | |
| struct _PurpleBuddyList { | | struct _PurpleBuddyList { | |
| PurpleBlistNode *root; /**< The first node in the buddy lis
t */ | | PurpleBlistNode *root; /**< The first node in the buddy lis
t */ | |
| GHashTable *buddies; /**< Every buddy in this list */ | | GHashTable *buddies; /**< Every buddy in this list */ | |
| void *ui_data; /**< UI-specific data. */ | | void *ui_data; /**< UI-specific data. */ | |
| }; | | }; | |
| | | | |
|
| | | #endif /* PURPLE_HIDE_STRUCTS && PURPLE_BLIST_STRUCTS */ | |
| | | | |
| /** | | /** | |
| * Buddy list UI operations. | | * Buddy list UI operations. | |
| * | | * | |
| * Any UI representing a buddy list must assign a filled-out PurpleBlistUiO
ps | | * Any UI representing a buddy list must assign a filled-out PurpleBlistUiO
ps | |
| * structure to the buddy list core. | | * structure to the buddy list core. | |
| */ | | */ | |
| struct _PurpleBlistUiOps | | struct _PurpleBlistUiOps | |
| { | | { | |
| void (*new_list)(PurpleBuddyList *list); /**< Sets UI-specific data
on a buddy list. */ | | void (*new_list)(PurpleBuddyList *list); /**< Sets UI-specific data
on a buddy list. */ | |
| void (*new_node)(PurpleBlistNode *node); /**< Sets UI-specific data
on a node. */ | | void (*new_node)(PurpleBlistNode *node); /**< Sets UI-specific data
on a node. */ | |
| void (*show)(PurpleBuddyList *list); /**< The core will call thi
s when it's finished doing its core stuff */ | | void (*show)(PurpleBuddyList *list); /**< The core will call thi
s when it's finished doing its core stuff */ | |
| void (*update)(PurpleBuddyList *list, | | void (*update)(PurpleBuddyList *list, | |
| PurpleBlistNode *node); /**< This will update a
node in the buddy list. */ | | PurpleBlistNode *node); /**< This will update a
node in the buddy list. */ | |
| void (*remove)(PurpleBuddyList *list, | | void (*remove)(PurpleBuddyList *list, | |
| PurpleBlistNode *node); /**< This removes a nod
e from the list */ | | PurpleBlistNode *node); /**< This removes a nod
e from the list */ | |
|
| void (*destroy)(PurpleBuddyList *list); /**< When the list gets des
troyed, this gets called to destroy the UI. */ | | void (*destroy)(PurpleBuddyList *list); /**< When the list is destr
oyed, this is called to destroy the UI. */ | |
| void (*set_visible)(PurpleBuddyList *list, | | void (*set_visible)(PurpleBuddyList *list, | |
| gboolean show); /**< Hides or unhides
the buddy list */ | | gboolean show); /**< Hides or unhides
the buddy list */ | |
| void (*request_add_buddy)(PurpleAccount *account, const char *userna
me, | | void (*request_add_buddy)(PurpleAccount *account, const char *userna
me, | |
| const char *group,
const char *alias); | | const char *group,
const char *alias); | |
| void (*request_add_chat)(PurpleAccount *account, PurpleGroup *group, | | void (*request_add_chat)(PurpleAccount *account, PurpleGroup *group, | |
| const char *alias,
const char *name); | | const char *alias,
const char *name); | |
| void (*request_add_group)(void); | | void (*request_add_group)(void); | |
| | | | |
|
| | | /** | |
| | | * This is called when a node has been modified and should be saved. | |
| | | * | |
| | | * Implementation of this UI op is OPTIONAL. If not implemented, it | |
| | | will | |
| | | * be set to a fallback function that saves data to blist.xml like i | |
| | | n | |
| | | * previous libpurple versions. | |
| | | * | |
| | | * @attrib node The node which has been modified. | |
| | | * | |
| | | * @since 2.6.0. | |
| | | */ | |
| | | void (*save_node)(PurpleBlistNode *node); | |
| | | | |
| | | /** | |
| | | * Called when a node is about to be removed from the buddy list. | |
| | | * The UI op should update the relevant data structures to remove th | |
| | | is | |
| | | * node (for example, removing a buddy from the group this node is i | |
| | | n). | |
| | | * | |
| | | * Implementation of this UI op is OPTIONAL. If not implemented, it | |
| | | will | |
| | | * be set to a fallback function that saves data to blist.xml like i | |
| | | n | |
| | | * previous libpurple versions. | |
| | | * | |
| | | * @attrib node The node which has been modified. | |
| | | * @since 2.6.0. | |
| | | */ | |
| | | void (*remove_node)(PurpleBlistNode *node); | |
| | | | |
| | | /** | |
| | | * Called to save all the data for an account. If the UI sets this, | |
| | | * the callback must save the privacy and buddy list data for an acc | |
| | | ount. | |
| | | * If the account is NULL, save the data for all accounts. | |
| | | * | |
| | | * Implementation of this UI op is OPTIONAL. If not implemented, it | |
| | | will | |
| | | * be set to a fallback function that saves data to blist.xml like i | |
| | | n | |
| | | * previous libpurple versions. | |
| | | * | |
| | | * @attrib account The account whose data to save. If NULL, save al | |
| | | l data | |
| | | * for all accounts. | |
| | | * @since 2.6.0. | |
| | | */ | |
| | | void (*save_account)(PurpleAccount *account); | |
| | | | |
| void (*_purple_reserved1)(void); | | void (*_purple_reserved1)(void); | |
|
| void (*_purple_reserved2)(void); | | | |
| void (*_purple_reserved3)(void); | | | |
| void (*_purple_reserved4)(void); | | | |
| }; | | }; | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /** @name Buddy List API *
/ | | /** @name Buddy List API *
/ | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** | | /** | |
| * Creates a new buddy list | | * Creates a new buddy list | |
| * | | * | |
| * @return The new buddy list. | | * @return The new buddy list. | |
|
| | | * @deprecated In 3.0.0, this will be handled by purple_blist_init() | |
| */ | | */ | |
| PurpleBuddyList *purple_blist_new(void); | | PurpleBuddyList *purple_blist_new(void); | |
| | | | |
| /** | | /** | |
| * Sets the main buddy list. | | * Sets the main buddy list. | |
| * | | * | |
| * @param blist The buddy list you want to use. | | * @param blist The buddy list you want to use. | |
|
| | | * @deprecated In 3.0.0, this will be handled by purple_blist_init() | |
| */ | | */ | |
| void purple_set_blist(PurpleBuddyList *blist); | | void purple_set_blist(PurpleBuddyList *blist); | |
| | | | |
| /** | | /** | |
| * Returns the main buddy list. | | * Returns the main buddy list. | |
| * | | * | |
| * @return The main buddy list. | | * @return The main buddy list. | |
| */ | | */ | |
| PurpleBuddyList *purple_get_blist(void); | | PurpleBuddyList *purple_get_blist(void); | |
| | | | |
| /** | | /** | |
| * Returns the root node of the main buddy list. | | * Returns the root node of the main buddy list. | |
| * | | * | |
| * @return The root node. | | * @return The root node. | |
| */ | | */ | |
| PurpleBlistNode *purple_blist_get_root(void); | | PurpleBlistNode *purple_blist_get_root(void); | |
| | | | |
| /** | | /** | |
|
| | | * Returns a list of every buddy in the list. Use of this function is | |
| | | * discouraged if you do not actually need every buddy in the list. Use | |
| | | * purple_find_buddies instead. | |
| | | * | |
| | | * @return A list of every buddy in the list. Caller is responsible for | |
| | | * freeing the list. | |
| | | * | |
| | | * @see purple_find_buddies | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | GSList *purple_blist_get_buddies(void); | |
| | | | |
| | | /** | |
| | | * Returns the UI data for the list. | |
| | | * | |
| | | * @return The UI data for the list. | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | gpointer purple_blist_get_ui_data(void); | |
| | | | |
| | | /** | |
| | | * Sets the UI data for the list. | |
| | | * | |
| | | * @param ui_data The UI data for the list. | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | void purple_blist_set_ui_data(gpointer ui_data); | |
| | | | |
| | | /** | |
| * Returns the next node of a given node. This function is to be used to it
erate | | * Returns the next node of a given node. This function is to be used to it
erate | |
| * over the tree returned by purple_get_blist. | | * over the tree returned by purple_get_blist. | |
| * | | * | |
| * @param node A node. | | * @param node A node. | |
| * @param offline Whether to include nodes for offline accounts | | * @param offline Whether to include nodes for offline accounts | |
| * @return The next node | | * @return The next node | |
| * @see purple_blist_node_get_parent | | * @see purple_blist_node_get_parent | |
| * @see purple_blist_node_get_first_child | | * @see purple_blist_node_get_first_child | |
| * @see purple_blist_node_get_sibling_next | | * @see purple_blist_node_get_sibling_next | |
| * @see purple_blist_node_get_sibling_prev | | * @see purple_blist_node_get_sibling_prev | |
| | | | |
| skipping to change at line 303 | | skipping to change at line 400 | |
| * @return The sibling node. | | * @return The sibling node. | |
| * @since 2.4.0 | | * @since 2.4.0 | |
| * @see purple_blist_node_get_parent | | * @see purple_blist_node_get_parent | |
| * @see purple_blist_node_get_first_child | | * @see purple_blist_node_get_first_child | |
| * @see purple_blist_node_get_sibling_next | | * @see purple_blist_node_get_sibling_next | |
| * @see purple_blist_node_next | | * @see purple_blist_node_next | |
| */ | | */ | |
| PurpleBlistNode *purple_blist_node_get_sibling_prev(PurpleBlistNode *node); | | PurpleBlistNode *purple_blist_node_get_sibling_prev(PurpleBlistNode *node); | |
| | | | |
| /** | | /** | |
|
| | | * Returns the UI data of a given node. | |
| | | * | |
| | | * @param node The node. | |
| | | * @return The UI data. | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | gpointer purple_blist_node_get_ui_data(const PurpleBlistNode *node); | |
| | | | |
| | | /** | |
| | | * Sets the UI data of a given node. | |
| | | * | |
| | | * @param node The node. | |
| | | * @param ui_data The UI data. | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | void purple_blist_node_set_ui_data(PurpleBlistNode *node, gpointer ui_data) | |
| | | ; | |
| | | | |
| | | /** | |
| * Shows the buddy list, creating a new one if necessary. | | * Shows the buddy list, creating a new one if necessary. | |
| */ | | */ | |
| void purple_blist_show(void); | | void purple_blist_show(void); | |
| | | | |
| /** | | /** | |
| * Destroys the buddy list window. | | * Destroys the buddy list window. | |
|
| | | * | |
| | | * @deprecated The UI is responsible for cleaning up the | |
| | | * PurpleBuddyList->ui_data. purple_blist_uninit() will free th | |
| | | e | |
| | | * PurpleBuddyList* itself. | |
| */ | | */ | |
| void purple_blist_destroy(void); | | void purple_blist_destroy(void); | |
| | | | |
| /** | | /** | |
| * Hides or unhides the buddy list. | | * Hides or unhides the buddy list. | |
| * | | * | |
| * @param show Whether or not to show the buddy list | | * @param show Whether or not to show the buddy list | |
| */ | | */ | |
| void purple_blist_set_visible(gboolean show); | | void purple_blist_set_visible(gboolean show); | |
| | | | |
| /** | | /** | |
| * Updates a buddy's status. | | * Updates a buddy's status. | |
| * | | * | |
|
| | | * This should only be called from within Purple. | |
| | | * | |
| * @param buddy The buddy whose status has changed. | | * @param buddy The buddy whose status has changed. | |
| * @param old_status The status from which we are changing. | | * @param old_status The status from which we are changing. | |
| */ | | */ | |
| void purple_blist_update_buddy_status(PurpleBuddy *buddy, PurpleStatus *old
_status); | | void purple_blist_update_buddy_status(PurpleBuddy *buddy, PurpleStatus *old
_status); | |
| | | | |
| /** | | /** | |
| * Updates a node's custom icon. | | * Updates a node's custom icon. | |
| * | | * | |
| * @param node The PurpleBlistNode whose custom icon has changed. | | * @param node The PurpleBlistNode whose custom icon has changed. | |
|
| | | * | |
| * @since 2.5.0 | | * @since 2.5.0 | |
| */ | | */ | |
| void purple_blist_update_node_icon(PurpleBlistNode *node); | | void purple_blist_update_node_icon(PurpleBlistNode *node); | |
| | | | |
| #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_) | | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_) | |
| /** | | /** | |
| * Updates a buddy's icon. | | * Updates a buddy's icon. | |
| * | | * | |
| * @param buddy The buddy whose buddy icon has changed | | * @param buddy The buddy whose buddy icon has changed | |
| * @deprecated Use purple_blist_update_node_icon() instead. | | * @deprecated Use purple_blist_update_node_icon() instead. | |
| | | | |
| skipping to change at line 407 | | skipping to change at line 530 | |
| * @param account The account this chat will get added to | | * @param account The account this chat will get added to | |
| * @param alias The alias of the new chat | | * @param alias The alias of the new chat | |
| * @param components The info the prpl needs to join the chat. The | | * @param components The info the prpl needs to join the chat. The | |
| * hash function should be g_str_hash() and the | | * hash function should be g_str_hash() and the | |
| * equal function should be g_str_equal(). | | * equal function should be g_str_equal(). | |
| * @return A newly allocated chat | | * @return A newly allocated chat | |
| */ | | */ | |
| PurpleChat *purple_chat_new(PurpleAccount *account, const char *alias, GHas
hTable *components); | | PurpleChat *purple_chat_new(PurpleAccount *account, const char *alias, GHas
hTable *components); | |
| | | | |
| /** | | /** | |
|
| | | * Destroys a chat | |
| | | * | |
| | | * @param chat The chat to destroy | |
| | | */ | |
| | | void purple_chat_destroy(PurpleChat *chat); | |
| | | | |
| | | /** | |
| * Adds a new chat to the buddy list. | | * Adds a new chat to the buddy list. | |
| * | | * | |
| * The chat will be inserted right after node or appended to the end | | * The chat will be inserted right after node or appended to the end | |
| * of group if node is NULL. If both are NULL, the buddy will be added to | | * of group if node is NULL. If both are NULL, the buddy will be added to | |
| * the "Chats" group. | | * the "Chats" group. | |
| * | | * | |
| * @param chat The new chat who gets added | | * @param chat The new chat who gets added | |
| * @param group The group to add the new chat to. | | * @param group The group to add the new chat to. | |
| * @param node The insertion point | | * @param node The insertion point | |
| */ | | */ | |
| void purple_blist_add_chat(PurpleChat *chat, PurpleGroup *group, PurpleBlis
tNode *node); | | void purple_blist_add_chat(PurpleChat *chat, PurpleGroup *group, PurpleBlis
tNode *node); | |
| | | | |
| /** | | /** | |
|
| * Creates a new buddy | | * Creates a new buddy. | |
| | | * | |
| | | * This function only creates the PurpleBuddy. Use purple_blist_add_buddy | |
| | | * to add the buddy to the list and purple_account_add_buddy to sync up | |
| | | * with the server. | |
| * | | * | |
| * @param account The account this buddy will get added to | | * @param account The account this buddy will get added to | |
|
| * @param screenname The screenname of the new buddy | | * @param name The name of the new buddy | |
| * @param alias The alias of the new buddy (or NULL if unaliased) | | * @param alias The alias of the new buddy (or NULL if unaliased) | |
| * @return A newly allocated buddy | | * @return A newly allocated buddy | |
|
| | | * | |
| | | * @see purple_account_add_buddy | |
| | | * @see purple_blist_add_buddy | |
| */ | | */ | |
|
| PurpleBuddy *purple_buddy_new(PurpleAccount *account, const char *screennam | | PurpleBuddy *purple_buddy_new(PurpleAccount *account, const char *name, con | |
| e, const char *alias); | | st char *alias); | |
| | | | |
| | | /** | |
| | | * Destroys a buddy | |
| | | * | |
| | | * @param buddy The buddy to destroy | |
| | | */ | |
| | | void purple_buddy_destroy(PurpleBuddy *buddy); | |
| | | | |
| /** | | /** | |
| * Sets a buddy's icon. | | * Sets a buddy's icon. | |
| * | | * | |
| * This should only be called from within Purple. You probably want to | | * This should only be called from within Purple. You probably want to | |
| * call purple_buddy_icon_set_data(). | | * call purple_buddy_icon_set_data(). | |
| * | | * | |
| * @param buddy The buddy. | | * @param buddy The buddy. | |
| * @param icon The buddy icon. | | * @param icon The buddy icon. | |
| * | | * | |
| | | | |
| skipping to change at line 470 | | skipping to change at line 614 | |
| /** | | /** | |
| * Returns a buddy's icon. | | * Returns a buddy's icon. | |
| * | | * | |
| * @param buddy The buddy. | | * @param buddy The buddy. | |
| * | | * | |
| * @return The buddy icon. | | * @return The buddy icon. | |
| */ | | */ | |
| PurpleBuddyIcon *purple_buddy_get_icon(const PurpleBuddy *buddy); | | PurpleBuddyIcon *purple_buddy_get_icon(const PurpleBuddy *buddy); | |
| | | | |
| /** | | /** | |
|
| | | * Returns a buddy's protocol-specific data. | |
| | | * | |
| | | * This should only be called from the associated prpl. | |
| | | * | |
| | | * @param buddy The buddy. | |
| | | * @return The protocol data. | |
| | | * | |
| | | * @see purple_buddy_set_protocol_data() | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | gpointer purple_buddy_get_protocol_data(const PurpleBuddy *buddy); | |
| | | | |
| | | /** | |
| | | * Sets a buddy's protocol-specific data. | |
| | | * | |
| | | * This should only be called from the associated prpl. | |
| | | * | |
| | | * @param buddy The buddy. | |
| | | * @param data The data. | |
| | | * | |
| | | * @see purple_buddy_get_protocol_data() | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | void purple_buddy_set_protocol_data(PurpleBuddy *buddy, gpointer data); | |
| | | | |
| | | /** | |
| * Returns a buddy's contact. | | * Returns a buddy's contact. | |
| * | | * | |
| * @param buddy The buddy. | | * @param buddy The buddy. | |
| * | | * | |
| * @return The buddy's contact. | | * @return The buddy's contact. | |
| */ | | */ | |
| PurpleContact *purple_buddy_get_contact(PurpleBuddy *buddy); | | PurpleContact *purple_buddy_get_contact(PurpleBuddy *buddy); | |
| | | | |
| /** | | /** | |
| * Returns a buddy's presence. | | * Returns a buddy's presence. | |
| | | | |
| skipping to change at line 498 | | skipping to change at line 668 | |
| * Adds a new buddy to the buddy list. | | * Adds a new buddy to the buddy list. | |
| * | | * | |
| * The buddy will be inserted right after node or prepended to the | | * The buddy will be inserted right after node or prepended to the | |
| * group if node is NULL. If both are NULL, the buddy will be added to | | * group if node is NULL. If both are NULL, the buddy will be added to | |
| * the "Buddies" group. | | * the "Buddies" group. | |
| * | | * | |
| * @param buddy The new buddy who gets added | | * @param buddy The new buddy who gets added | |
| * @param contact The optional contact to place the buddy in. | | * @param contact The optional contact to place the buddy in. | |
| * @param group The group to add the new buddy to. | | * @param group The group to add the new buddy to. | |
| * @param node The insertion point. Pass in NULL to add the node as | | * @param node The insertion point. Pass in NULL to add the node as | |
|
| * the last child in the given group. | | * the first child in the given group. | |
| */ | | */ | |
| void purple_blist_add_buddy(PurpleBuddy *buddy, PurpleContact *contact, Pur
pleGroup *group, PurpleBlistNode *node); | | void purple_blist_add_buddy(PurpleBuddy *buddy, PurpleContact *contact, Pur
pleGroup *group, PurpleBlistNode *node); | |
| | | | |
| /** | | /** | |
| * Creates a new group | | * Creates a new group | |
| * | | * | |
| * You can't have more than one group with the same name. Sorry. If you p
ass | | * You can't have more than one group with the same name. Sorry. If you p
ass | |
|
| * this the * name of a group that already exists, it will return that grou
p. | | * this the name of a group that already exists, it will return that group. | |
| * | | * | |
| * @param name The name of the new group | | * @param name The name of the new group | |
| * @return A new group struct | | * @return A new group struct | |
| */ | | */ | |
| PurpleGroup *purple_group_new(const char *name); | | PurpleGroup *purple_group_new(const char *name); | |
| | | | |
| /** | | /** | |
|
| | | * Destroys a group | |
| | | * | |
| | | * @param group The group to destroy | |
| | | */ | |
| | | void purple_group_destroy(PurpleGroup *group); | |
| | | | |
| | | /** | |
| * Adds a new group to the buddy list. | | * Adds a new group to the buddy list. | |
| * | | * | |
| * The new group will be inserted after insert or prepended to the list if | | * The new group will be inserted after insert or prepended to the list if | |
| * node is NULL. | | * node is NULL. | |
| * | | * | |
| * @param group The group | | * @param group The group | |
| * @param node The insertion point | | * @param node The insertion point | |
| */ | | */ | |
| void purple_blist_add_group(PurpleGroup *group, PurpleBlistNode *node); | | void purple_blist_add_group(PurpleGroup *group, PurpleBlistNode *node); | |
| | | | |
| /** | | /** | |
| * Creates a new contact | | * Creates a new contact | |
| * | | * | |
| * @return A new contact struct | | * @return A new contact struct | |
| */ | | */ | |
| PurpleContact *purple_contact_new(void); | | PurpleContact *purple_contact_new(void); | |
| | | | |
| /** | | /** | |
|
| | | * Destroys a contact | |
| | | * | |
| | | * @param contact The contact to destroy | |
| | | */ | |
| | | void purple_contact_destroy(PurpleContact *contact); | |
| | | | |
| | | /** | |
| * Adds a new contact to the buddy list. | | * Adds a new contact to the buddy list. | |
| * | | * | |
| * The new contact will be inserted after insert or prepended to the list i
f | | * The new contact will be inserted after insert or prepended to the list i
f | |
| * node is NULL. | | * node is NULL. | |
| * | | * | |
| * @param contact The contact | | * @param contact The contact | |
| * @param group The group to add the contact to | | * @param group The group to add the contact to | |
| * @param node The insertion point | | * @param node The insertion point | |
| */ | | */ | |
| void purple_blist_add_contact(PurpleContact *contact, PurpleGroup *group, P
urpleBlistNode *node); | | void purple_blist_add_contact(PurpleContact *contact, PurpleGroup *group, P
urpleBlistNode *node); | |
| | | | |
| skipping to change at line 601 | | skipping to change at line 785 | |
| /** | | /** | |
| * Invalidates the priority buddy so that the next call to | | * Invalidates the priority buddy so that the next call to | |
| * purple_contact_get_priority_buddy recomputes it. | | * purple_contact_get_priority_buddy recomputes it. | |
| * | | * | |
| * @param contact The contact | | * @param contact The contact | |
| */ | | */ | |
| void purple_contact_invalidate_priority_buddy(PurpleContact *contact); | | void purple_contact_invalidate_priority_buddy(PurpleContact *contact); | |
| | | | |
| /** | | /** | |
| * Removes a buddy from the buddy list and frees the memory allocated to it
. | | * Removes a buddy from the buddy list and frees the memory allocated to it
. | |
|
| * This doesn't actually try to remove the buddy from the server list, nor | | * This doesn't actually try to remove the buddy from the server list. | |
| does | | | |
| * it clean up the prpl_data. | | | |
| * | | * | |
| * @param buddy The buddy to be removed | | * @param buddy The buddy to be removed | |
|
| | | * | |
| | | * @see purple_account_remove_buddy | |
| */ | | */ | |
| void purple_blist_remove_buddy(PurpleBuddy *buddy); | | void purple_blist_remove_buddy(PurpleBuddy *buddy); | |
| | | | |
| /** | | /** | |
| * Removes a contact, and any buddies it contains, and frees the memory | | * Removes a contact, and any buddies it contains, and frees the memory | |
|
| * allocated to it. | | * allocated to it. This calls purple_blist_remove_buddy and therefore | |
| | | * doesn't remove the buddies from the server list. | |
| * | | * | |
| * @param contact The contact to be removed | | * @param contact The contact to be removed | |
|
| | | * | |
| | | * @see purple_blist_remove_buddy | |
| */ | | */ | |
| void purple_blist_remove_contact(PurpleContact *contact); | | void purple_blist_remove_contact(PurpleContact *contact); | |
| | | | |
| /** | | /** | |
| * Removes a chat from the buddy list and frees the memory allocated to it. | | * Removes a chat from the buddy list and frees the memory allocated to it. | |
| * | | * | |
| * @param chat The chat to be removed | | * @param chat The chat to be removed | |
| */ | | */ | |
| void purple_blist_remove_chat(PurpleChat *chat); | | void purple_blist_remove_chat(PurpleChat *chat); | |
| | | | |
| | | | |
| skipping to change at line 659 | | skipping to change at line 847 | |
| * Returns the correct name to display for a buddy, taking the contact alia
s | | * Returns the correct name to display for a buddy, taking the contact alia
s | |
| * into account. In order of precedence: the buddy's alias; the buddy's | | * into account. In order of precedence: the buddy's alias; the buddy's | |
| * contact alias; the buddy's server alias; the buddy's user name. | | * contact alias; the buddy's server alias; the buddy's user name. | |
| * | | * | |
| * @param buddy The buddy whose name will be returned | | * @param buddy The buddy whose name will be returned | |
| * @return The appropriate name or alias, or NULL. | | * @return The appropriate name or alias, or NULL. | |
| * | | * | |
| */ | | */ | |
| const char *purple_buddy_get_contact_alias(PurpleBuddy *buddy); | | const char *purple_buddy_get_contact_alias(PurpleBuddy *buddy); | |
| | | | |
|
| | | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_) | |
| /** | | /** | |
| * Returns the correct alias for this user, ignoring server aliases. Used | | * Returns the correct alias for this user, ignoring server aliases. Used | |
| * when a user-recognizable name is required. In order: buddy's alias; bud
dy's | | * when a user-recognizable name is required. In order: buddy's alias; bud
dy's | |
| * contact alias; buddy's user name. | | * contact alias; buddy's user name. | |
| * | | * | |
| * @param buddy The buddy whose alias will be returned. | | * @param buddy The buddy whose alias will be returned. | |
| * @return The appropriate name or alias. | | * @return The appropriate name or alias. | |
|
| | | * @deprecated Try purple_buddy_get_alias(), if server aliases are okay. | |
| */ | | */ | |
| const char *purple_buddy_get_local_alias(PurpleBuddy *buddy); | | const char *purple_buddy_get_local_alias(PurpleBuddy *buddy); | |
|
| | | #endif | |
| | | | |
| /** | | /** | |
| * Returns the correct name to display for a buddy. In order of precedence: | | * Returns the correct name to display for a buddy. In order of precedence: | |
| * the buddy's alias; the buddy's server alias; the buddy's contact alias; | | * the buddy's alias; the buddy's server alias; the buddy's contact alias; | |
| * the buddy's user name. | | * the buddy's user name. | |
| * | | * | |
| * @param buddy The buddy whose name will be returned. | | * @param buddy The buddy whose name will be returned. | |
| * @return The appropriate name or alias, or NULL | | * @return The appropriate name or alias, or NULL | |
| */ | | */ | |
| const char *purple_buddy_get_alias(PurpleBuddy *buddy); | | const char *purple_buddy_get_alias(PurpleBuddy *buddy); | |
| | | | |
| /** | | /** | |
|
| | | * Returns the local alias for the buddy, or @c NULL if none exists. | |
| | | * | |
| | | * @param buddy The buddy | |
| | | * @return The local alias for the buddy | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | const char *purple_buddy_get_local_buddy_alias(PurpleBuddy *buddy); | |
| | | | |
| | | /** | |
| * Returns the correct name to display for a blist chat. | | * Returns the correct name to display for a blist chat. | |
| * | | * | |
| * @param chat The chat whose name will be returned. | | * @param chat The chat whose name will be returned. | |
| * @return The alias (if set), or first component value. | | * @return The alias (if set), or first component value. | |
| */ | | */ | |
| const char *purple_chat_get_name(PurpleChat *chat); | | const char *purple_chat_get_name(PurpleChat *chat); | |
| | | | |
| /** | | /** | |
|
| * Finds the buddy struct given a screenname and an account | | * Finds the buddy struct given a name and an account | |
| * | | * | |
| * @param account The account this buddy belongs to | | * @param account The account this buddy belongs to | |
|
| * @param name The buddy's screenname | | * @param name The buddy's name | |
| * @return The buddy or NULL if the buddy does not exist | | * @return The buddy or NULL if the buddy does not exist | |
| */ | | */ | |
| PurpleBuddy *purple_find_buddy(PurpleAccount *account, const char *name); | | PurpleBuddy *purple_find_buddy(PurpleAccount *account, const char *name); | |
| | | | |
| /** | | /** | |
|
| * Finds the buddy struct given a screenname, an account, and a group | | * Finds the buddy struct given a name, an account, and a group | |
| * | | * | |
| * @param account The account this buddy belongs to | | * @param account The account this buddy belongs to | |
|
| * @param name The buddy's screenname | | * @param name The buddy's name | |
| * @param group The group to look in | | * @param group The group to look in | |
| * @return The buddy or NULL if the buddy does not exist in the grou
p | | * @return The buddy or NULL if the buddy does not exist in the grou
p | |
| */ | | */ | |
| PurpleBuddy *purple_find_buddy_in_group(PurpleAccount *account, const char
*name, | | PurpleBuddy *purple_find_buddy_in_group(PurpleAccount *account, const char
*name, | |
| PurpleGroup *group); | | PurpleGroup *group); | |
| | | | |
| /** | | /** | |
|
| * Finds all PurpleBuddy structs given a screenname and an account | | * Finds all PurpleBuddy structs given a name and an account | |
| * | | * | |
| * @param account The account this buddy belongs to | | * @param account The account this buddy belongs to | |
|
| * @param name The buddy's screenname (or NULL to return all buddies in
the account) | | * @param name The buddy's name (or NULL to return all buddies for the a
ccount) | |
| * | | * | |
| * @return A GSList of buddies (which must be freed), or NULL if the
buddy doesn't exist | | * @return A GSList of buddies (which must be freed), or NULL if the
buddy doesn't exist | |
| */ | | */ | |
| GSList *purple_find_buddies(PurpleAccount *account, const char *name); | | GSList *purple_find_buddies(PurpleAccount *account, const char *name); | |
| | | | |
| /** | | /** | |
| * Finds a group by name | | * Finds a group by name | |
| * | | * | |
| * @param name The group's name | | * @param name The group's name | |
| * @return The group or NULL if the group does not exist | | * @return The group or NULL if the group does not exist | |
| | | | |
| skipping to change at line 750 | | skipping to change at line 951 | |
| * @return The parent group, or @c NULL if the chat is not in a group. | | * @return The parent group, or @c NULL if the chat is not in a group. | |
| */ | | */ | |
| PurpleGroup *purple_chat_get_group(PurpleChat *chat); | | PurpleGroup *purple_chat_get_group(PurpleChat *chat); | |
| | | | |
| /** | | /** | |
| * Returns the account the chat belongs to. | | * Returns the account the chat belongs to. | |
| * | | * | |
| * @param chat The chat. | | * @param chat The chat. | |
| * | | * | |
| * @return The account the chat belongs to. | | * @return The account the chat belongs to. | |
|
| | | * | |
| * @since 2.4.0 | | * @since 2.4.0 | |
| */ | | */ | |
| PurpleAccount *purple_chat_get_account(PurpleChat *chat); | | PurpleAccount *purple_chat_get_account(PurpleChat *chat); | |
| | | | |
| /** | | /** | |
| * Get a hashtable containing information about a chat. | | * Get a hashtable containing information about a chat. | |
| * | | * | |
| * @param chat The chat. | | * @param chat The chat. | |
| * | | * | |
| * @constreturn The hashtable. | | * @constreturn The hashtable. | |
|
| | | * | |
| * @since 2.4.0 | | * @since 2.4.0 | |
| */ | | */ | |
| GHashTable *purple_chat_get_components(PurpleChat *chat); | | GHashTable *purple_chat_get_components(PurpleChat *chat); | |
| | | | |
| /** | | /** | |
| * Returns the group of which the buddy is a member. | | * Returns the group of which the buddy is a member. | |
| * | | * | |
| * @param buddy The buddy | | * @param buddy The buddy | |
| * @return The group or NULL if the buddy is not in a group | | * @return The group or NULL if the buddy is not in a group | |
| */ | | */ | |
| | | | |
| skipping to change at line 802 | | skipping to change at line 1005 | |
| /** | | /** | |
| * Returns the name of a group. | | * Returns the name of a group. | |
| * | | * | |
| * @param group The group. | | * @param group The group. | |
| * | | * | |
| * @return The name of the group. | | * @return The name of the group. | |
| */ | | */ | |
| const char *purple_group_get_name(PurpleGroup *group); | | const char *purple_group_get_name(PurpleGroup *group); | |
| | | | |
| /** | | /** | |
|
| * Called when an account gets signed on. Tells the UI to update all the | | * Called when an account connects. Tells the UI to update all the | |
| * buddies. | | * buddies. | |
| * | | * | |
| * @param account The account | | * @param account The account | |
| */ | | */ | |
| void purple_blist_add_account(PurpleAccount *account); | | void purple_blist_add_account(PurpleAccount *account); | |
| | | | |
| /** | | /** | |
|
| * Called when an account gets signed off. Sets the presence of all the bu
ddies to 0 | | * Called when an account disconnects. Sets the presence of all the buddie
s to 0 | |
| * and tells the UI to update them. | | * and tells the UI to update them. | |
| * | | * | |
| * @param account The account | | * @param account The account | |
| */ | | */ | |
| void purple_blist_remove_account(PurpleAccount *account); | | void purple_blist_remove_account(PurpleAccount *account); | |
| | | | |
| /** | | /** | |
| * Determines the total size of a group | | * Determines the total size of a group | |
| * | | * | |
| * @param group The group | | * @param group The group | |
| | | | |
| skipping to change at line 975 | | skipping to change at line 1178 | |
| * @return The flags on the node. This is a bitmask. | | * @return The flags on the node. This is a bitmask. | |
| */ | | */ | |
| PurpleBlistNodeFlags purple_blist_node_get_flags(PurpleBlistNode *node); | | PurpleBlistNodeFlags purple_blist_node_get_flags(PurpleBlistNode *node); | |
| | | | |
| /** | | /** | |
| * Get the type of a given node. | | * Get the type of a given node. | |
| * | | * | |
| * @param node The node. | | * @param node The node. | |
| * | | * | |
| * @return The type of the node. | | * @return The type of the node. | |
|
| | | * | |
| * @since 2.1.0 | | * @since 2.1.0 | |
| */ | | */ | |
| PurpleBlistNodeType purple_blist_node_get_type(PurpleBlistNode *node); | | PurpleBlistNodeType purple_blist_node_get_type(PurpleBlistNode *node); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /** | | /** | |
| * Retrieves the extended menu items for a buddy list node. | | * Retrieves the extended menu items for a buddy list node. | |
| * @param n The blist node for which to obtain the extended menu items. | | * @param n The blist node for which to obtain the extended menu items. | |
| * @return A list of PurpleMenuAction items, as harvested by the | | * @return A list of PurpleMenuAction items, as harvested by the | |
| | | | |
End of changes. 45 change blocks. |
| 27 lines changed or deleted | | 243 lines changed or added | |
|
| connection.h | | connection.h | |
| | | | |
| skipping to change at line 59 | | skipping to change at line 59 | |
| } PurpleConnectionFlags; | | } PurpleConnectionFlags; | |
| | | | |
| typedef enum | | typedef enum | |
| { | | { | |
| PURPLE_DISCONNECTED = 0, /**< Disconnected. */ | | PURPLE_DISCONNECTED = 0, /**< Disconnected. */ | |
| PURPLE_CONNECTED, /**< Connected. */ | | PURPLE_CONNECTED, /**< Connected. */ | |
| PURPLE_CONNECTING /**< Connecting. */ | | PURPLE_CONNECTING /**< Connecting. */ | |
| | | | |
| } PurpleConnectionState; | | } PurpleConnectionState; | |
| | | | |
|
| /** Possible errors that can cause a connection to be closed. | | /** | |
| | | * Possible errors that can cause a connection to be closed. | |
| | | * | |
| * @since 2.3.0 | | * @since 2.3.0 | |
| */ | | */ | |
| typedef enum | | typedef enum | |
| { | | { | |
| /** There was an error sending or receiving on the network socket, o
r | | /** There was an error sending or receiving on the network socket, o
r | |
| * there was some protocol error (such as the server sending malfor
med | | * there was some protocol error (such as the server sending malfor
med | |
| * data). | | * data). | |
| */ | | */ | |
| PURPLE_CONNECTION_ERROR_NETWORK_ERROR = 0, | | PURPLE_CONNECTION_ERROR_NETWORK_ERROR = 0, | |
| /** The username supplied was not valid. */ | | /** The username supplied was not valid. */ | |
| PURPLE_CONNECTION_ERROR_INVALID_USERNAME = 1, | | PURPLE_CONNECTION_ERROR_INVALID_USERNAME = 1, | |
| /** The username, password or some other credential was incorrect.
Use | | /** The username, password or some other credential was incorrect.
Use | |
| * #PURPLE_CONNECTION_ERROR_INVALID_USERNAME instead if the usernam
e | | * #PURPLE_CONNECTION_ERROR_INVALID_USERNAME instead if the usernam
e | |
|
| * is known to be invalid. | | * is known to be invalid. | |
| */ | | */ | |
| PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED = 2, | | PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED = 2, | |
| /** libpurple doesn't speak any of the authentication methods the | | /** libpurple doesn't speak any of the authentication methods the | |
| * server offered. | | * server offered. | |
| */ | | */ | |
| PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE = 3, | | PURPLE_CONNECTION_ERROR_AUTHENTICATION_IMPOSSIBLE = 3, | |
| /** libpurple was built without SSL support, and the connection need
s | | /** libpurple was built without SSL support, and the connection need
s | |
| * SSL. | | * SSL. | |
| */ | | */ | |
| PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT = 4, | | PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT = 4, | |
| | | | |
| skipping to change at line 95 | | skipping to change at line 97 | |
| * server does not support encryption but an account option was set
to | | * server does not support encryption but an account option was set
to | |
| * require it. | | * require it. | |
| */ | | */ | |
| PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR = 5, | | PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR = 5, | |
| /** Someone is already connected to the server using the name you ar
e | | /** Someone is already connected to the server using the name you ar
e | |
| * trying to connect with. | | * trying to connect with. | |
| */ | | */ | |
| PURPLE_CONNECTION_ERROR_NAME_IN_USE = 6, | | PURPLE_CONNECTION_ERROR_NAME_IN_USE = 6, | |
| | | | |
| /** The username/server/other preference for the account isn't valid
. | | /** The username/server/other preference for the account isn't valid
. | |
|
| * For instance, on IRC the screen name cannot contain white space. | | * For instance, on IRC the username cannot contain white space. | |
| * This reason should not be used for incorrect passwords etc: use | | * This reason should not be used for incorrect passwords etc: use | |
| * #PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED for that. | | * #PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED for that. | |
| * | | * | |
| * @todo This reason really shouldn't be necessary. Usernames and | | * @todo This reason really shouldn't be necessary. Usernames and | |
| * other account preferences should be validated when the | | * other account preferences should be validated when the | |
| * account is created. | | * account is created. | |
| */ | | */ | |
| PURPLE_CONNECTION_ERROR_INVALID_SETTINGS = 7, | | PURPLE_CONNECTION_ERROR_INVALID_SETTINGS = 7, | |
| | | | |
| /** The server did not provide a SSL certificate. */ | | /** The server did not provide a SSL certificate. */ | |
| | | | |
| skipping to change at line 151 | | skipping to change at line 153 | |
| char *description; | | char *description; | |
| } PurpleConnectionErrorInfo; | | } PurpleConnectionErrorInfo; | |
| | | | |
| #include <time.h> | | #include <time.h> | |
| | | | |
| #include "account.h" | | #include "account.h" | |
| #include "plugin.h" | | #include "plugin.h" | |
| #include "status.h" | | #include "status.h" | |
| #include "sslconn.h" | | #include "sslconn.h" | |
| | | | |
|
| /** Connection UI operations. Used to notify the user of changes to | | /** | |
| * connections, such as being disconnected, and to respond to the | | * Connection UI operations. Used to notify the user of changes to | |
| * underlying network connection appearing and disappearing. UIs should | | * connections, such as being disconnected, and to respond to the | |
| * call #purple_connections_set_ui_ops() with an instance of this struct. | | * underlying network connection appearing and disappearing. UIs should | |
| | | * call #purple_connections_set_ui_ops() with an instance of this struct. | |
| * | | * | |
|
| * @see @ref ui-ops | | * @see @ref ui-ops | |
| */ | | */ | |
| typedef struct | | typedef struct | |
| { | | { | |
|
| /** When an account is connecting, this operation is called to notif | | /** | |
| y | | * When an account is connecting, this operation is called to notify | |
| * the UI of what is happening, as well as which @a step out of @a | | * the UI of what is happening, as well as which @a step out of @a | |
| * step_count has been reached (which might be displayed as a progr | | * step_count has been reached (which might be displayed as a progre | |
| ess | | ss | |
| * bar). | | * bar). | |
| * @see #purple_connection_update_progress | | * @see #purple_connection_update_progress | |
| */ | | */ | |
| void (*connect_progress)(PurpleConnection *gc, | | void (*connect_progress)(PurpleConnection *gc, | |
| const char *text, | | const char *text, | |
| size_t step, | | size_t step, | |
| size_t step_count); | | size_t step_count); | |
| | | | |
|
| /** Called when a connection is established (just before the | | /** | |
| * @ref signed-on signal). | | * Called when a connection is established (just before the | |
| | | * @ref signed-on signal). | |
| */ | | */ | |
| void (*connected)(PurpleConnection *gc); | | void (*connected)(PurpleConnection *gc); | |
|
| /** Called when a connection is ended (between the @ref signing-off | | | |
| * and @ref signed-off signals). | | /** | |
| | | * Called when a connection is ended (between the @ref signing-off | |
| | | * and @ref signed-off signals). | |
| */ | | */ | |
| void (*disconnected)(PurpleConnection *gc); | | void (*disconnected)(PurpleConnection *gc); | |
| | | | |
|
| /** Used to display connection-specific notices. (Pidgin's Gtk user | | /** | |
| * interface implements this as a no-op; #purple_connection_notice( | | * Used to display connection-specific notices. (Pidgin's Gtk user | |
| ), | | * interface implements this as a no-op; #purple_connection_notice() | |
| * which uses this operation, is not used by any of the protocols | | , | |
| * shipped with libpurple.) | | * which uses this operation, is not used by any of the protocols | |
| | | * shipped with libpurple.) | |
| */ | | */ | |
| void (*notice)(PurpleConnection *gc, const char *text); | | void (*notice)(PurpleConnection *gc, const char *text); | |
| | | | |
|
| /** Called when an error causes a connection to be disconnected. | | /** | |
| * Called before #disconnected. | | * Called when an error causes a connection to be disconnected. | |
| * @param text a localized error message. | | * Called before #disconnected. | |
| * @see #purple_connection_error | | * @param text a localized error message. | |
| * @deprecated in favour of | | * @see #purple_connection_error | |
| * #PurpleConnectionUiOps.report_disconnect_reason. | | * @deprecated in favour of | |
| | | * #PurpleConnectionUiOps.report_disconnect_reason. | |
| */ | | */ | |
| void (*report_disconnect)(PurpleConnection *gc, const char *text); | | void (*report_disconnect)(PurpleConnection *gc, const char *text); | |
| | | | |
|
| /** Called when libpurple discovers that the computer's network | | /** | |
| * connection is active. On Linux, this uses Network Manager if | | * Called when libpurple discovers that the computer's network | |
| * available; on Windows, it uses Win32's network change notificati | | * connection is active. On Linux, this uses Network Manager if | |
| on | | * available; on Windows, it uses Win32's network change notificatio | |
| * infrastructure. | | n | |
| | | * infrastructure. | |
| */ | | */ | |
| void (*network_connected)(void); | | void (*network_connected)(void); | |
|
| /** Called when libpurple discovers that the computer's network | | | |
| * connection has gone away. | | /** | |
| | | * Called when libpurple discovers that the computer's network | |
| | | * connection has gone away. | |
| */ | | */ | |
| void (*network_disconnected)(void); | | void (*network_disconnected)(void); | |
| | | | |
|
| /** Called when an error causes a connection to be disconnected. | | /** | |
| | | * Called when an error causes a connection to be disconnected. | |
| * Called before #disconnected. This op is intended to replace | | * Called before #disconnected. This op is intended to replace | |
| * #report_disconnect. If both are implemented, this will be calle
d | | * #report_disconnect. If both are implemented, this will be calle
d | |
| * first; however, there's no real reason to implement both. | | * first; however, there's no real reason to implement both. | |
|
| | | * | |
| * @param reason why the connection ended, if known, or | | * @param reason why the connection ended, if known, or | |
| * #PURPLE_CONNECTION_ERROR_OTHER_ERROR, if not. | | * #PURPLE_CONNECTION_ERROR_OTHER_ERROR, if not. | |
| * @param text a localized message describing the disconnection | | * @param text a localized message describing the disconnection | |
| * in more detail to the user. | | * in more detail to the user. | |
| * @see #purple_connection_error_reason | | * @see #purple_connection_error_reason | |
|
| | | * | |
| * @since 2.3.0 | | * @since 2.3.0 | |
| */ | | */ | |
| void (*report_disconnect_reason)(PurpleConnection *gc, | | void (*report_disconnect_reason)(PurpleConnection *gc, | |
| PurpleConnectionError reason, | | PurpleConnectionError reason, | |
| const char *text); | | const char *text); | |
| | | | |
| void (*_purple_reserved1)(void); | | void (*_purple_reserved1)(void); | |
| void (*_purple_reserved2)(void); | | void (*_purple_reserved2)(void); | |
| void (*_purple_reserved3)(void); | | void (*_purple_reserved3)(void); | |
| } PurpleConnectionUiOps; | | } PurpleConnectionUiOps; | |
| | | | |
| skipping to change at line 356 | | skipping to change at line 371 | |
| | | | |
| /** | | /** | |
| * Sets the connection's displayed name. | | * Sets the connection's displayed name. | |
| * | | * | |
| * @param gc The connection. | | * @param gc The connection. | |
| * @param name The displayed name. | | * @param name The displayed name. | |
| */ | | */ | |
| void purple_connection_set_display_name(PurpleConnection *gc, const char *n
ame); | | void purple_connection_set_display_name(PurpleConnection *gc, const char *n
ame); | |
| | | | |
| /** | | /** | |
|
| | | * Sets the protocol data for a connection. | |
| | | * | |
| | | * @param connection The PurpleConnection. | |
| | | * @param proto_data The protocol data to set for the connection. | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | void purple_connection_set_protocol_data(PurpleConnection *connection, void | |
| | | *proto_data); | |
| | | | |
| | | /** | |
| * Returns the connection state. | | * Returns the connection state. | |
| * | | * | |
| * @param gc The connection. | | * @param gc The connection. | |
| * | | * | |
| * @return The connection state. | | * @return The connection state. | |
| */ | | */ | |
| PurpleConnectionState purple_connection_get_state(const PurpleConnection *g
c); | | PurpleConnectionState purple_connection_get_state(const PurpleConnection *g
c); | |
| | | | |
| /** | | /** | |
| * Returns TRUE if the account is connected, otherwise returns FALSE. | | * Returns TRUE if the account is connected, otherwise returns FALSE. | |
| | | | |
| skipping to change at line 387 | | skipping to change at line 412 | |
| * @return The connection's account. | | * @return The connection's account. | |
| */ | | */ | |
| PurpleAccount *purple_connection_get_account(const PurpleConnection *gc); | | PurpleAccount *purple_connection_get_account(const PurpleConnection *gc); | |
| | | | |
| /** | | /** | |
| * Returns the protocol plugin managing a connection. | | * Returns the protocol plugin managing a connection. | |
| * | | * | |
| * @param gc The connection. | | * @param gc The connection. | |
| * | | * | |
| * @return The protocol plugin. | | * @return The protocol plugin. | |
|
| | | * | |
| * @since 2.4.0 | | * @since 2.4.0 | |
| */ | | */ | |
| PurplePlugin * purple_connection_get_prpl(const PurpleConnection *gc); | | PurplePlugin * purple_connection_get_prpl(const PurpleConnection *gc); | |
| | | | |
| /** | | /** | |
| * Returns the connection's password. | | * Returns the connection's password. | |
| * | | * | |
| * @param gc The connection. | | * @param gc The connection. | |
| * | | * | |
| * @return The connection's password. | | * @return The connection's password. | |
| | | | |
| skipping to change at line 410 | | skipping to change at line 436 | |
| /** | | /** | |
| * Returns the connection's displayed name. | | * Returns the connection's displayed name. | |
| * | | * | |
| * @param gc The connection. | | * @param gc The connection. | |
| * | | * | |
| * @return The connection's displayed name. | | * @return The connection's displayed name. | |
| */ | | */ | |
| const char *purple_connection_get_display_name(const PurpleConnection *gc); | | const char *purple_connection_get_display_name(const PurpleConnection *gc); | |
| | | | |
| /** | | /** | |
|
| | | * Gets the protocol data from a connection. | |
| | | * | |
| | | * @param connection The PurpleConnection. | |
| | | * | |
| | | * @return The protocol data for the connection. | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | void *purple_connection_get_protocol_data(const PurpleConnection *connectio | |
| | | n); | |
| | | | |
| | | /** | |
| * Updates the connection progress. | | * Updates the connection progress. | |
| * | | * | |
| * @param gc The connection. | | * @param gc The connection. | |
| * @param text Information on the current step. | | * @param text Information on the current step. | |
| * @param step The current step. | | * @param step The current step. | |
| * @param count The total number of steps. | | * @param count The total number of steps. | |
| */ | | */ | |
| void purple_connection_update_progress(PurpleConnection *gc, const char *te
xt, | | void purple_connection_update_progress(PurpleConnection *gc, const char *te
xt, | |
| siz
e_t step, size_t count); | | siz
e_t step, size_t count); | |
| | | | |
| | | | |
| skipping to change at line 452 | | skipping to change at line 489 | |
| | | | |
| /** | | /** | |
| * Closes a connection with an error and a human-readable description of th
e | | * Closes a connection with an error and a human-readable description of th
e | |
| * error. It also sets @c gc->wants_to_die to the value of | | * error. It also sets @c gc->wants_to_die to the value of | |
| * #purple_connection_error_is_fatal(@a reason), mainly for | | * #purple_connection_error_is_fatal(@a reason), mainly for | |
| * backwards-compatibility. | | * backwards-compatibility. | |
| * | | * | |
| * @param gc the connection which is closing. | | * @param gc the connection which is closing. | |
| * @param reason why the connection is closing. | | * @param reason why the connection is closing. | |
| * @param description a non-@c NULL localized description of the error. | | * @param description a non-@c NULL localized description of the error. | |
|
| | | * | |
| * @since 2.3.0 | | * @since 2.3.0 | |
| */ | | */ | |
| void | | void | |
| purple_connection_error_reason (PurpleConnection *gc, | | purple_connection_error_reason (PurpleConnection *gc, | |
| PurpleConnectionError reason, | | PurpleConnectionError reason, | |
| const char *description); | | const char *description); | |
| | | | |
| /** | | /** | |
| * Closes a connection due to an SSL error; this is basically a shortcut to | | * Closes a connection due to an SSL error; this is basically a shortcut to | |
| * turning the #PurpleSslErrorType into a #PurpleConnectionError and a | | * turning the #PurpleSslErrorType into a #PurpleConnectionError and a | |
| * human-readable string and then calling purple_connection_error_reason(). | | * human-readable string and then calling purple_connection_error_reason(). | |
|
| | | * | |
| * @since 2.3.0 | | * @since 2.3.0 | |
| */ | | */ | |
| void | | void | |
| purple_connection_ssl_error (PurpleConnection *gc, | | purple_connection_ssl_error (PurpleConnection *gc, | |
| PurpleSslErrorType ssl_error); | | PurpleSslErrorType ssl_error); | |
| | | | |
| /** | | /** | |
| * Reports whether a disconnection reason is fatal (in which case the accou
nt | | * Reports whether a disconnection reason is fatal (in which case the accou
nt | |
| * should probably not be automatically reconnected) or transient (so | | * should probably not be automatically reconnected) or transient (so | |
| * auto-reconnection is a good idea). | | * auto-reconnection is a good idea). | |
| | | | |
| skipping to change at line 486 | | skipping to change at line 525 | |
| * is @c FALSE. On the other hand, | | * is @c FALSE. On the other hand, | |
| * #PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED probably indicates a | | * #PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED probably indicates a | |
| * misconfiguration of the account which needs the user to go fix it up, so | | * misconfiguration of the account which needs the user to go fix it up, so | |
| * <tt> purple_connection_error_is_fatal | | * <tt> purple_connection_error_is_fatal | |
| * (PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED)</tt> is @c TRUE. | | * (PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED)</tt> is @c TRUE. | |
| * | | * | |
| * (This function is meant to replace checking PurpleConnection.wants_to_di
e.) | | * (This function is meant to replace checking PurpleConnection.wants_to_di
e.) | |
| * | | * | |
| * @return @c TRUE if the account should not be automatically reconnected,
and | | * @return @c TRUE if the account should not be automatically reconnected,
and | |
| * @c FALSE otherwise. | | * @c FALSE otherwise. | |
|
| | | * | |
| * @since 2.3.0 | | * @since 2.3.0 | |
| */ | | */ | |
| gboolean | | gboolean | |
| purple_connection_error_is_fatal (PurpleConnectionError reason); | | purple_connection_error_is_fatal (PurpleConnectionError reason); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /** @name Connections API *
/ | | /** @name Connections API *
/ | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| | | | |
| skipping to change at line 522 | | skipping to change at line 562 | |
| * Returns a list of all connections in the process of connecting. | | * Returns a list of all connections in the process of connecting. | |
| * | | * | |
| * @constreturn A list of connecting connections. | | * @constreturn A list of connecting connections. | |
| */ | | */ | |
| GList *purple_connections_get_connecting(void); | | GList *purple_connections_get_connecting(void); | |
| | | | |
| /** | | /** | |
| * Checks if gc is still a valid pointer to a gc. | | * Checks if gc is still a valid pointer to a gc. | |
| * | | * | |
| * @return @c TRUE if gc is valid. | | * @return @c TRUE if gc is valid. | |
|
| | | * | |
| | | * @deprecated Do not use this. Instead, cancel your asynchronous request | |
| | | * when the PurpleConnection is destroyed. | |
| */ | | */ | |
| /* | | /* | |
| * TODO: Eventually this bad boy will be removed, because it is | | * TODO: Eventually this bad boy will be removed, because it is | |
| * a gross fix for a crashy problem. | | * a gross fix for a crashy problem. | |
| */ | | */ | |
| #define PURPLE_CONNECTION_IS_VALID(gc) (g_list_find(purple_connections_get_
all(), (gc)) != NULL) | | #define PURPLE_CONNECTION_IS_VALID(gc) (g_list_find(purple_connections_get_
all(), (gc)) != NULL) | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| | | | |
End of changes. 22 change blocks. |
| 38 lines changed or deleted | | 82 lines changed or added | |
|
| dbus-types.h | | dbus-types.h | |
| | | | |
| skipping to change at line 45 | | skipping to change at line 45 | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleDesktopItem) | | PURPLE_DBUS_DECLARE_TYPE(PurpleDesktopItem) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleEventLoopUiOps) | | PURPLE_DBUS_DECLARE_TYPE(PurpleEventLoopUiOps) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleXfer) | | PURPLE_DBUS_DECLARE_TYPE(PurpleXfer) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleXferUiOps) | | PURPLE_DBUS_DECLARE_TYPE(PurpleXferUiOps) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleIdleUiOps) | | PURPLE_DBUS_DECLARE_TYPE(PurpleIdleUiOps) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleStoredImage) | | PURPLE_DBUS_DECLARE_TYPE(PurpleStoredImage) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleLog) | | PURPLE_DBUS_DECLARE_TYPE(PurpleLog) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleLogLogger) | | PURPLE_DBUS_DECLARE_TYPE(PurpleLogLogger) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleLogCommonLoggerData) | | PURPLE_DBUS_DECLARE_TYPE(PurpleLogCommonLoggerData) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleLogSet) | | PURPLE_DBUS_DECLARE_TYPE(PurpleLogSet) | |
|
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleMedia) | |
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleMediaCandidate) | |
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleMediaCodec) | |
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleMediaElementInfo) | |
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleMediaElementInfoClass) | |
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleMediaManager) | |
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleMediaManagerClass) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleMimeDocument) | | PURPLE_DBUS_DECLARE_TYPE(PurpleMimeDocument) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleMimePart) | | PURPLE_DBUS_DECLARE_TYPE(PurpleMimePart) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleNetworkListenData) | | PURPLE_DBUS_DECLARE_TYPE(PurpleNetworkListenData) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleNotifyUserInfoEntry) | | PURPLE_DBUS_DECLARE_TYPE(PurpleNotifyUserInfoEntry) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleNotifyUserInfo) | | PURPLE_DBUS_DECLARE_TYPE(PurpleNotifyUserInfo) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleNotifySearchResults) | | PURPLE_DBUS_DECLARE_TYPE(PurpleNotifySearchResults) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleNotifySearchColumn) | | PURPLE_DBUS_DECLARE_TYPE(PurpleNotifySearchColumn) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleNotifySearchButton) | | PURPLE_DBUS_DECLARE_TYPE(PurpleNotifySearchButton) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleNotifyUiOps) | | PURPLE_DBUS_DECLARE_TYPE(PurpleNotifyUiOps) | |
| PURPLE_DBUS_DECLARE_TYPE(PurplePlugin) | | PURPLE_DBUS_DECLARE_TYPE(PurplePlugin) | |
| | | | |
| skipping to change at line 68 | | skipping to change at line 75 | |
| PURPLE_DBUS_DECLARE_TYPE(PurplePluginAction) | | PURPLE_DBUS_DECLARE_TYPE(PurplePluginAction) | |
| PURPLE_DBUS_DECLARE_TYPE(PurplePluginPrefFrame) | | PURPLE_DBUS_DECLARE_TYPE(PurplePluginPrefFrame) | |
| PURPLE_DBUS_DECLARE_TYPE(PurplePluginPref) | | PURPLE_DBUS_DECLARE_TYPE(PurplePluginPref) | |
| PURPLE_DBUS_DECLARE_TYPE(PurplePounce) | | PURPLE_DBUS_DECLARE_TYPE(PurplePounce) | |
| PURPLE_DBUS_DECLARE_TYPE(PurplePrivacyUiOps) | | PURPLE_DBUS_DECLARE_TYPE(PurplePrivacyUiOps) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleProxyInfo) | | PURPLE_DBUS_DECLARE_TYPE(PurpleProxyInfo) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleProxyConnectData) | | PURPLE_DBUS_DECLARE_TYPE(PurpleProxyConnectData) | |
| PURPLE_DBUS_DECLARE_TYPE(PurplePluginProtocolInfo) | | PURPLE_DBUS_DECLARE_TYPE(PurplePluginProtocolInfo) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleAttentionType) | | PURPLE_DBUS_DECLARE_TYPE(PurpleAttentionType) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleBuddyIconSpec) | | PURPLE_DBUS_DECLARE_TYPE(PurpleBuddyIconSpec) | |
|
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleRequestField) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleRequestFields) | | PURPLE_DBUS_DECLARE_TYPE(PurpleRequestFields) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleRequestFieldGroup) | | PURPLE_DBUS_DECLARE_TYPE(PurpleRequestFieldGroup) | |
|
| PURPLE_DBUS_DECLARE_TYPE(PurpleRequestField) | | | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleRequestUiOps) | | PURPLE_DBUS_DECLARE_TYPE(PurpleRequestUiOps) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleRoomlist) | | PURPLE_DBUS_DECLARE_TYPE(PurpleRoomlist) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleRoomlistRoom) | | PURPLE_DBUS_DECLARE_TYPE(PurpleRoomlistRoom) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleRoomlistField) | | PURPLE_DBUS_DECLARE_TYPE(PurpleRoomlistField) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleRoomlistUiOps) | | PURPLE_DBUS_DECLARE_TYPE(PurpleRoomlistUiOps) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleSavedStatus) | | PURPLE_DBUS_DECLARE_TYPE(PurpleSavedStatus) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleSavedStatusSub) | | PURPLE_DBUS_DECLARE_TYPE(PurpleSavedStatusSub) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleSmiley) | | PURPLE_DBUS_DECLARE_TYPE(PurpleSmiley) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleSmileyClass) | | PURPLE_DBUS_DECLARE_TYPE(PurpleSmileyClass) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleDnsQueryData) | | PURPLE_DBUS_DECLARE_TYPE(PurpleDnsQueryData) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleDnsQueryUiOps) | | PURPLE_DBUS_DECLARE_TYPE(PurpleDnsQueryUiOps) | |
|
| PURPLE_DBUS_DECLARE_TYPE(PurpleSrvResponse) | | | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleSrvQueryData) | | PURPLE_DBUS_DECLARE_TYPE(PurpleSrvQueryData) | |
|
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleSrvResponse) | |
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleTxtResponse) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleStatusType) | | PURPLE_DBUS_DECLARE_TYPE(PurpleStatusType) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleStatusAttr) | | PURPLE_DBUS_DECLARE_TYPE(PurpleStatusAttr) | |
| PURPLE_DBUS_DECLARE_TYPE(PurplePresence) | | PURPLE_DBUS_DECLARE_TYPE(PurplePresence) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleStatus) | | PURPLE_DBUS_DECLARE_TYPE(PurpleStatus) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleStringref) | | PURPLE_DBUS_DECLARE_TYPE(PurpleStringref) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleStunNatDiscovery) | | PURPLE_DBUS_DECLARE_TYPE(PurpleStunNatDiscovery) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleSoundUiOps) | | PURPLE_DBUS_DECLARE_TYPE(PurpleSoundUiOps) | |
|
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleSoundTheme) | |
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleSoundThemeClass) | |
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleSoundThemeLoader) | |
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleSoundThemeLoaderClass) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleSslConnection) | | PURPLE_DBUS_DECLARE_TYPE(PurpleSslConnection) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleSslOps) | | PURPLE_DBUS_DECLARE_TYPE(PurpleSslOps) | |
|
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleTheme) | |
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleThemeClass) | |
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleThemeLoader) | |
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleThemeLoaderClass) | |
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleThemeManager) | |
| | | PURPLE_DBUS_DECLARE_TYPE(PurpleThemeManagerClass) | |
| PURPLE_DBUS_DECLARE_TYPE(UPnPMappingAddRemove) | | PURPLE_DBUS_DECLARE_TYPE(UPnPMappingAddRemove) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleUtilFetchUrlData) | | PURPLE_DBUS_DECLARE_TYPE(PurpleUtilFetchUrlData) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleMenuAction) | | PURPLE_DBUS_DECLARE_TYPE(PurpleMenuAction) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleKeyValuePair) | | PURPLE_DBUS_DECLARE_TYPE(PurpleKeyValuePair) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleValue) | | PURPLE_DBUS_DECLARE_TYPE(PurpleValue) | |
| PURPLE_DBUS_DECLARE_TYPE(xmlnode) | | PURPLE_DBUS_DECLARE_TYPE(xmlnode) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleWhiteboardPrplOps) | | PURPLE_DBUS_DECLARE_TYPE(PurpleWhiteboardPrplOps) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleWhiteboard) | | PURPLE_DBUS_DECLARE_TYPE(PurpleWhiteboard) | |
| PURPLE_DBUS_DECLARE_TYPE(PurpleWhiteboardUiOps) | | PURPLE_DBUS_DECLARE_TYPE(PurpleWhiteboardUiOps) | |
| | | | |
End of changes. 7 change blocks. |
| 2 lines changed or deleted | | 20 lines changed or added | |
|
| gtkimhtml.h | | gtkimhtml.h | |
| | | | |
| skipping to change at line 29 | | skipping to change at line 29 | |
| * GNU General Public License for more details. | | * GNU General Public License for more details. | |
| * | | * | |
| * You should have received a copy of the GNU General Public License | | * You should have received a copy of the GNU General Public License | |
| * along with this program; if not, write to the Free Software | | * along with this program; if not, write to the Free Software | |
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-130
1 USA | | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-130
1 USA | |
| */ | | */ | |
| #ifndef _PIDGINIMHTML_H_ | | #ifndef _PIDGINIMHTML_H_ | |
| #define _PIDGINIMHTML_H_ | | #define _PIDGINIMHTML_H_ | |
| | | | |
| #include <gdk/gdk.h> | | #include <gdk/gdk.h> | |
|
| #include <gtk/gtktextview.h> | | #include <gtk/gtk.h> | |
| #include <gtk/gtktooltips.h> | | | |
| #include <gtk/gtkimage.h> | | | |
| #include "gtksourceundomanager.h" | | #include "gtksourceundomanager.h" | |
| | | | |
| #include "connection.h" | | #include "connection.h" | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /************************************************************************** | | /************************************************************************** | |
| * @name Structures | | * @name Structures | |
| **************************************************************************
/ | | **************************************************************************
/ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
|
| #define GTK_TYPE_IMHTML (gtk_imhtml_get_type ()) | | #define GTK_TYPE_IMHTML (gtk_imhtml_get_type()) | |
| #define GTK_IMHTML(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_IMHTML, | | #define GTK_IMHTML(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_T | |
| GtkIMHtml)) | | YPE_IMHTML, GtkIMHtml)) | |
| #define GTK_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE | | #define GTK_IMHTML_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TY | |
| _IMHTML, GtkIMHtmlClass)) | | PE_IMHTML, GtkIMHtmlClass)) | |
| #define GTK_IS_IMHTML(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_IMHTML) | | #define GTK_IS_IMHTML(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_T | |
| ) | | YPE_IMHTML)) | |
| #define GTK_IS_IMHTML_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE | | #define GTK_IS_IMHTML_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TY | |
| _IMHTML)) | | PE_IMHTML)) | |
| #define GTK_IMHTML_SCALABLE(obj) ((GtkIMHtmlScalable *)obj) | | #define GTK_IMHTML_SCALABLE(obj) ((GtkIMHtmlScalable *)obj) | |
|
| #define GTK_IMHTML_ANIMATION(obj) ((GtkIMHtmlAnimation *)obj) | | #define GTK_IMHTML_ANIMATION(obj) ((GtkIMHtmlAnimation *)obj) | |
| | | | |
| typedef struct _GtkIMHtml GtkIMHtml; | | typedef struct _GtkIMHtml GtkIMHtml; | |
| typedef struct _GtkIMHtmlClass GtkIMHtmlClass; | | typedef struct _GtkIMHtmlClass GtkIMHtmlClass; | |
| typedef struct _GtkIMHtmlFontDetail GtkIMHtmlFontDetail; /* The five
elements contained in a FONT tag */ | | typedef struct _GtkIMHtmlFontDetail GtkIMHtmlFontDetail; /* The five
elements contained in a FONT tag */ | |
| typedef struct _GtkSmileyTree GtkSmileyTree; | | typedef struct _GtkSmileyTree GtkSmileyTree; | |
| typedef struct _GtkIMHtmlSmiley GtkIMHtmlSmiley; | | typedef struct _GtkIMHtmlSmiley GtkIMHtmlSmiley; | |
| typedef struct _GtkIMHtmlScalable GtkIMHtmlScalable; | | typedef struct _GtkIMHtmlScalable GtkIMHtmlScalable; | |
| typedef struct _GtkIMHtmlImage GtkIMHtmlImage; | | typedef struct _GtkIMHtmlImage GtkIMHtmlImage; | |
| typedef struct _GtkIMHtmlAnimation GtkIMHtmlAnimation; | | typedef struct _GtkIMHtmlAnimation GtkIMHtmlAnimation; | |
| typedef struct _GtkIMHtmlHr GtkIMHtmlHr; | | typedef struct _GtkIMHtmlHr GtkIMHtmlHr; | |
| typedef struct _GtkIMHtmlFuncs GtkIMHtmlFuncs; | | typedef struct _GtkIMHtmlFuncs GtkIMHtmlFuncs; | |
| | | | |
|
| | | /** | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | typedef struct _GtkIMHtmlLink GtkIMHtmlLink; | |
| | | | |
| typedef enum { | | typedef enum { | |
| GTK_IMHTML_BOLD = 1 << 0, | | GTK_IMHTML_BOLD = 1 << 0, | |
| GTK_IMHTML_ITALIC = 1 << 1, | | GTK_IMHTML_ITALIC = 1 << 1, | |
| GTK_IMHTML_UNDERLINE = 1 << 2, | | GTK_IMHTML_UNDERLINE = 1 << 2, | |
| GTK_IMHTML_GROW = 1 << 3, | | GTK_IMHTML_GROW = 1 << 3, | |
| GTK_IMHTML_SHRINK = 1 << 4, | | GTK_IMHTML_SHRINK = 1 << 4, | |
| GTK_IMHTML_FACE = 1 << 5, | | GTK_IMHTML_FACE = 1 << 5, | |
| GTK_IMHTML_FORECOLOR = 1 << 6, | | GTK_IMHTML_FORECOLOR = 1 << 6, | |
| GTK_IMHTML_BACKCOLOR = 1 << 7, | | GTK_IMHTML_BACKCOLOR = 1 << 7, | |
| GTK_IMHTML_BACKGROUND = 1 << 8, | | GTK_IMHTML_BACKGROUND = 1 << 8, | |
| | | | |
| skipping to change at line 159 | | skipping to change at line 162 | |
| GtkTextViewClass parent_class; | | GtkTextViewClass parent_class; | |
| | | | |
| void (*url_clicked)(GtkIMHtml *, const gchar *); | | void (*url_clicked)(GtkIMHtml *, const gchar *); | |
| void (*buttons_update)(GtkIMHtml *, GtkIMHtmlButtons); | | void (*buttons_update)(GtkIMHtml *, GtkIMHtmlButtons); | |
| void (*toggle_format)(GtkIMHtml *, GtkIMHtmlButtons); | | void (*toggle_format)(GtkIMHtml *, GtkIMHtmlButtons); | |
| void (*clear_format)(GtkIMHtml *); | | void (*clear_format)(GtkIMHtml *); | |
| void (*update_format)(GtkIMHtml *); | | void (*update_format)(GtkIMHtml *); | |
| gboolean (*message_send)(GtkIMHtml *); | | gboolean (*message_send)(GtkIMHtml *); | |
| void (*undo)(GtkIMHtml *); | | void (*undo)(GtkIMHtml *); | |
| void (*redo)(GtkIMHtml *); | | void (*redo)(GtkIMHtml *); | |
|
| | | GList *protocols; /* List of GtkIMHtmlProtocol's */ | |
| }; | | }; | |
| | | | |
| struct _GtkIMHtmlFontDetail { | | struct _GtkIMHtmlFontDetail { | |
| gushort size; | | gushort size; | |
| gchar *face; | | gchar *face; | |
| gchar *fore; | | gchar *fore; | |
| gchar *back; | | gchar *back; | |
| gchar *bg; | | gchar *bg; | |
| gchar *sml; | | gchar *sml; | |
| gboolean underline; | | gboolean underline; | |
| | | | |
| skipping to change at line 187 | | skipping to change at line 191 | |
| | | | |
| struct _GtkIMHtmlSmiley { | | struct _GtkIMHtmlSmiley { | |
| gchar *smile; | | gchar *smile; | |
| gchar *file; | | gchar *file; | |
| GdkPixbufAnimation *icon; | | GdkPixbufAnimation *icon; | |
| gboolean hidden; | | gboolean hidden; | |
| GdkPixbufLoader *loader; | | GdkPixbufLoader *loader; | |
| GSList *anchors; | | GSList *anchors; | |
| GtkIMHtmlSmileyFlags flags; | | GtkIMHtmlSmileyFlags flags; | |
| GtkIMHtml *imhtml; | | GtkIMHtml *imhtml; | |
|
| | | gpointer data; /** @Since 2.6.0 */ | |
| | | gsize datasize; /** @Since 2.6.0 */ | |
| }; | | }; | |
| | | | |
| struct _GtkIMHtmlScalable { | | struct _GtkIMHtmlScalable { | |
| void (*scale)(struct _GtkIMHtmlScalable *, int, int); | | void (*scale)(struct _GtkIMHtmlScalable *, int, int); | |
| void (*add_to)(struct _GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter
*); | | void (*add_to)(struct _GtkIMHtmlScalable *, GtkIMHtml *, GtkTextIter
*); | |
| void (*free)(struct _GtkIMHtmlScalable *); | | void (*free)(struct _GtkIMHtmlScalable *); | |
| }; | | }; | |
| | | | |
| struct _GtkIMHtmlImage { | | struct _GtkIMHtmlImage { | |
| GtkIMHtmlScalable scalable; | | GtkIMHtmlScalable scalable; | |
| | | | |
| skipping to change at line 887 | | skipping to change at line 893 | |
| void gtk_imhtml_smiley_reload(GtkIMHtmlSmiley *smiley); | | void gtk_imhtml_smiley_reload(GtkIMHtmlSmiley *smiley); | |
| | | | |
| /** | | /** | |
| * Destroy a GtkIMHtmlSmiley. | | * Destroy a GtkIMHtmlSmiley. | |
| * | | * | |
| * @param smiley The smiley to destroy | | * @param smiley The smiley to destroy | |
| * | | * | |
| * @since 2.5.0 | | * @since 2.5.0 | |
| */ | | */ | |
| void gtk_imhtml_smiley_destroy(GtkIMHtmlSmiley *smiley); | | void gtk_imhtml_smiley_destroy(GtkIMHtmlSmiley *smiley); | |
|
| | | | |
| | | /** | |
| | | * Register a protocol with the GtkIMHtml widget. Registering a protocol wo | |
| | | uld | |
| | | * allow certain text to be clickable. | |
| | | * | |
| | | * @param name The name of the protocol (e.g. http://) | |
| | | * @param activate The callback to trigger when the protocol text is click | |
| | | ed. | |
| | | * Removes any current protocol definition if @c NULL. The | |
| | | * callback should return @c TRUE if the link was activate | |
| | | d | |
| | | * properly, @c FALSE otherwise. | |
| | | * @param context_menu The callback to trigger when the context menu is po | |
| | | pped | |
| | | * up on the protocol text. The callback should return | |
| | | * @c TRUE if the request for context menu was process | |
| | | ed | |
| | | * successfully, @c FALSE otherwise. | |
| | | * | |
| | | * @return @c TRUE if the protocol was successfully registered (or unregis | |
| | | tered, when #activate is @c NULL) | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | gboolean gtk_imhtml_class_register_protocol(const char *name, | |
| | | gboolean (*activate)(GtkIMHtml *imhtml, GtkIMHtmlLink *link) | |
| | | , | |
| | | gboolean (*context_menu)(GtkIMHtml *imhtml, GtkIMHtmlLink *l | |
| | | ink, GtkWidget *menu)); | |
| | | | |
| | | /** | |
| | | * Get the URL associated with a link. This should be used by the IMHtml pr | |
| | | otocol-callbacks. | |
| | | * | |
| | | * @param link The GtkIMHtmlLink object sent to the callback functions | |
| | | * | |
| | | * @return The URL | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | const char *gtk_imhtml_link_get_url(GtkIMHtmlLink *link); | |
| | | | |
| | | /** | |
| | | * Get the GtkTextTag object (if any) associated with a particular link. | |
| | | * | |
| | | * @param link The GtkIMHtmlLink object sent to the callback functions | |
| | | * | |
| | | * @return The GtkTextTag object, or @c NULL | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | const GtkTextTag *gtk_imhtml_link_get_text_tag(GtkIMHtmlLink *link); | |
| | | | |
| | | /** | |
| | | * Activates a GtkIMHtmlLink object. This triggers the 'url-clicked' signal | |
| | | , marks the | |
| | | * link as visited (when possible). | |
| | | * | |
| | | * @param link The GtkIMHtmlLink object sent to the callback functions | |
| | | * | |
| | | * @return @c TRUE if 'url-clicked' signal was emitted, @c FALSE otherwise | |
| | | . | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | gboolean gtk_imhtml_link_activate(GtkIMHtmlLink *link); | |
| | | | |
| | | /** | |
| | | * By default this widget intercepts presses of the "return" key and | |
| | | * emits the "message_send" signal instead. If you don't want this | |
| | | * behavior, and you want the standard GtkTextView behavior of | |
| | | * inserting a newline into the buffer, then call this function. | |
| | | * | |
| | | * @param imhtml The GtkIMHtml where you want the "return" key to add | |
| | | * newline and not emit the "message_send" signal. | |
| | | */ | |
| | | void gtk_imhtml_set_return_inserts_newline(GtkIMHtml *imhtml); | |
| | | | |
| | | /** | |
| | | * By default this widget populates the PRIMARY clipboard with any selected | |
| | | * text (as you would expect). For scenarios (e.g. select-on-focus) where | |
| | | this | |
| | | * would be problematic, this function can disable the PRIMARY population. | |
| | | * | |
| | | * @param imhtml The GtkIMHtml to enable/disable populating PRIMARY | |
| | | * @param populate enable/disable PRIMARY population | |
| | | */ | |
| | | void gtk_imhtml_set_populate_primary_clipboard(GtkIMHtml *imhtml, gboolean | |
| | | populate); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* _PIDGINIMHTML_H_ */ | | #endif /* _PIDGINIMHTML_H_ */ | |
| | | | |
End of changes. 7 change blocks. |
| 13 lines changed or deleted | | 110 lines changed or added | |
|
| gtkutils.h | | gtkutils.h | |
| | | | |
| skipping to change at line 231 | | skipping to change at line 231 | |
| * | | * | |
| * @return The newly created menu item. | | * @return The newly created menu item. | |
| */ | | */ | |
| GtkWidget *pidgin_new_item(GtkWidget *menu, const char *str); | | GtkWidget *pidgin_new_item(GtkWidget *menu, const char *str); | |
| | | | |
| /** | | /** | |
| * Creates a check menu item. | | * Creates a check menu item. | |
| * | | * | |
| * @param menu The menu to which to append the check menu item. | | * @param menu The menu to which to append the check menu item. | |
| * @param str The title to use for the newly created menu item. | | * @param str The title to use for the newly created menu item. | |
|
| * @param sf A function to call when the menu item is activated. | | * @param cb A function to call when the menu item is activated. | |
| * @param data Data to pass to the signal function. | | * @param data Data to pass to the signal function. | |
| * @param checked The initial state of the check item | | * @param checked The initial state of the check item | |
| * | | * | |
| * @return The newly created menu item. | | * @return The newly created menu item. | |
| */ | | */ | |
| GtkWidget *pidgin_new_check_item(GtkWidget *menu, const char *str, | | GtkWidget *pidgin_new_check_item(GtkWidget *menu, const char *str, | |
|
| GtkSignalFunc sf, gpointer data, gboolean checked); | | GCallback cb, gpointer data, gboolean checked); | |
| | | | |
| /** | | /** | |
| * Creates a menu item. | | * Creates a menu item. | |
| * | | * | |
| * @param menu The menu to which to append the menu item. | | * @param menu The menu to which to append the menu item. | |
| * @param str The title for the menu item. | | * @param str The title for the menu item. | |
| * @param icon An icon to place to the left of the menu item, | | * @param icon An icon to place to the left of the menu item, | |
| * or @c NULL for no icon. | | * or @c NULL for no icon. | |
|
| * @param sf A function to call when the menu item is activated. | | * @param cb A function to call when the menu item is activated. | |
| * @param data Data to pass to the signal function. | | * @param data Data to pass to the signal function. | |
| * @param accel_key Something. | | * @param accel_key Something. | |
| * @param accel_mods Something. | | * @param accel_mods Something. | |
| * @param mod Something. | | * @param mod Something. | |
| * | | * | |
| * @return The newly created menu item. | | * @return The newly created menu item. | |
| */ | | */ | |
| GtkWidget *pidgin_new_item_from_stock(GtkWidget *menu, const char *str, | | GtkWidget *pidgin_new_item_from_stock(GtkWidget *menu, const char *str, | |
|
| cons
t char *icon, GtkSignalFunc sf, | | cons
t char *icon, GCallback cb, | |
| gpoi
nter data, guint accel_key, | | gpoi
nter data, guint accel_key, | |
| guin
t accel_mods, char *mod); | | guin
t accel_mods, char *mod); | |
| | | | |
| /** | | /** | |
| * Creates a button with the specified text and stock icon. | | * Creates a button with the specified text and stock icon. | |
| * | | * | |
| * @param text The text for the button. | | * @param text The text for the button. | |
| * @param icon The stock icon name. | | * @param icon The stock icon name. | |
| * @param style The orientation of the button. | | * @param style The orientation of the button. | |
| * | | * | |
| | | | |
| skipping to change at line 353 | | skipping to change at line 353 | |
| * pidgin_account_option_menu_new. | | * pidgin_account_option_menu_new. | |
| * @param account The PurpleAccount to select. | | * @param account The PurpleAccount to select. | |
| */ | | */ | |
| void pidgin_account_option_menu_set_selected(GtkWidget *optmenu, PurpleAcco
unt *account); | | void pidgin_account_option_menu_set_selected(GtkWidget *optmenu, PurpleAcco
unt *account); | |
| | | | |
| /** | | /** | |
| * Add autocompletion of screenames to an entry, supporting a filtering fun
ction. | | * Add autocompletion of screenames to an entry, supporting a filtering fun
ction. | |
| * | | * | |
| * @param entry The GtkEntry on which to setup autocomplete. | | * @param entry The GtkEntry on which to setup autocomplete. | |
| * @param optmenu A menu for accounts, returned by gaim_gtk_account_opt
ion_menu_new(). | | * @param optmenu A menu for accounts, returned by gaim_gtk_account_opt
ion_menu_new(). | |
|
| * If @a optmenu is not @c NULL, it'll be updated when a
screenname is chosen | | * If @a optmenu is not @c NULL, it'll be updated when a
username is chosen | |
| * from the autocomplete list. | | * from the autocomplete list. | |
| * @param filter_func A function for checking if an autocomplete entry | | * @param filter_func A function for checking if an autocomplete entry | |
| * should be shown. This can be @c NULL. | | * should be shown. This can be @c NULL. | |
| * @param user_data The data to be passed to the filter_func function. | | * @param user_data The data to be passed to the filter_func function. | |
| */ | | */ | |
| void pidgin_setup_screenname_autocomplete_with_filter(GtkWidget *entry, Gtk
Widget *optmenu, PidginFilterBuddyCompletionEntryFunc filter_func, gpointer
user_data); | | void pidgin_setup_screenname_autocomplete_with_filter(GtkWidget *entry, Gtk
Widget *optmenu, PidginFilterBuddyCompletionEntryFunc filter_func, gpointer
user_data); | |
| | | | |
| /** | | /** | |
|
| * The default filter function for screenname autocomplete. | | * The default filter function for username autocomplete. | |
| * | | * | |
| * @param completion_entry The completion entry to filter. | | * @param completion_entry The completion entry to filter. | |
| * @param all_accounts If this is @c FALSE, only the autocompletion entrie
s | | * @param all_accounts If this is @c FALSE, only the autocompletion entrie
s | |
| * which belong to an online account will be filter
ed. | | * which belong to an online account will be filter
ed. | |
| * @return Returns @c TRUE if the autocompletion entry is filtered. | | * @return Returns @c TRUE if the autocompletion entry is filtered. | |
| */ | | */ | |
| gboolean pidgin_screenname_autocomplete_default_filter(const PidginBuddyCom
pletionEntry *completion_entry, gpointer all_accounts); | | gboolean pidgin_screenname_autocomplete_default_filter(const PidginBuddyCom
pletionEntry *completion_entry, gpointer all_accounts); | |
| | | | |
| /** | | /** | |
| * Add autocompletion of screenames to an entry. | | * Add autocompletion of screenames to an entry. | |
| * | | * | |
| * @deprecated | | * @deprecated | |
| * For new code, use the equivalent: | | * For new code, use the equivalent: | |
| * #pidgin_setup_screenname_autocomplete_with_filter(@a entry, @a optmenu
, | | * #pidgin_setup_screenname_autocomplete_with_filter(@a entry, @a optmenu
, | |
| * #pidgin_screenname_autocomplete_default_filter, <tt>GINT_TO_POINTER(@a | | * #pidgin_screenname_autocomplete_default_filter, <tt>GINT_TO_POINTER(@a | |
| * all)</tt>) | | * all)</tt>) | |
| * | | * | |
| * @param entry The GtkEntry on which to setup autocomplete. | | * @param entry The GtkEntry on which to setup autocomplete. | |
| * @param optmenu A menu for accounts, returned by | | * @param optmenu A menu for accounts, returned by | |
| * pidgin_account_option_menu_new(). If @a optmenu is not
@c | | * pidgin_account_option_menu_new(). If @a optmenu is not
@c | |
|
| * NULL, it'll be updated when a screenname is chosen from
the | | * NULL, it'll be updated when a username is chosen from t
he | |
| * autocomplete list. | | * autocomplete list. | |
|
| * @param all Whether to include screennames from disconnected accoun
ts. | | * @param all Whether to include usernames from disconnected accounts
. | |
| */ | | */ | |
| void pidgin_setup_screenname_autocomplete(GtkWidget *entry, GtkWidget *optm
enu, gboolean all); | | void pidgin_setup_screenname_autocomplete(GtkWidget *entry, GtkWidget *optm
enu, gboolean all); | |
| | | | |
| /** | | /** | |
| * Check if the given path is a directory or not. If it is, then modify | | * 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. | | * the given GtkFileSelection dialog so that it displays the given path. | |
| * If the given path is not a directory, then do nothing. | | * If the given path is not a directory, then do nothing. | |
| * | | * | |
| * @param path The path entered in the file selection window by the user
. | | * @param path The path entered in the file selection window by the user
. | |
| * @param filesel The file selection window. | | * @param filesel The file selection window. | |
| | | | |
| skipping to change at line 568 | | skipping to change at line 568 | |
| * Creates a status icon for a given primitve | | * Creates a status icon for a given primitve | |
| * | | * | |
| * @param primitive The status primitive | | * @param primitive The status primitive | |
| * @param w The widget to render this | | * @param w The widget to render this | |
| * @param size The icon size to render at | | * @param size The icon size to render at | |
| * @return A GdkPixbuf, created from stock | | * @return A GdkPixbuf, created from stock | |
| */ | | */ | |
| GdkPixbuf * pidgin_create_status_icon(PurpleStatusPrimitive primitive, GtkW
idget *w, const char *size); | | GdkPixbuf * pidgin_create_status_icon(PurpleStatusPrimitive primitive, GtkW
idget *w, const char *size); | |
| | | | |
| /** | | /** | |
|
| | | * Returns an appropriate stock-id for a status primitive. | |
| | | * | |
| | | * @param prim The status primitive | |
| | | * | |
| | | * @return The stock-id | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | const char *pidgin_stock_id_from_status_primitive(PurpleStatusPrimitive pri | |
| | | m); | |
| | | | |
| | | /** | |
| | | * Returns an appropriate stock-id for a PurplePresence. | |
| | | * | |
| | | * @param presence The presence. | |
| | | * | |
| | | * @return The stock-id | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | const char *pidgin_stock_id_from_presence(PurplePresence *presence); | |
| | | | |
| | | /** | |
| * Append a PurpleMenuAction to a menu. | | * Append a PurpleMenuAction to a menu. | |
| * | | * | |
| * @param menu The menu to append to. | | * @param menu The menu to append to. | |
| * @param act The PurpleMenuAction to append. | | * @param act The PurpleMenuAction to append. | |
| * @param gobject The object to be passed to the action callback. | | * @param gobject The object to be passed to the action callback. | |
| * | | * | |
| * @return The menuitem added. | | * @return The menuitem added. | |
| */ | | */ | |
| GtkWidget *pidgin_append_menu_action(GtkWidget *menu, PurpleMenuAction *act
, | | GtkWidget *pidgin_append_menu_action(GtkWidget *menu, PurpleMenuAction *act
, | |
| gpointer gobject); | | gpointer gobject); | |
| | | | |
| skipping to change at line 789 | | skipping to change at line 811 | |
| * | | * | |
| * @since 2.2.0 | | * @since 2.2.0 | |
| */ | | */ | |
| void pidgin_text_combo_box_entry_set_text(GtkWidget *widget, const char *te
xt); | | void pidgin_text_combo_box_entry_set_text(GtkWidget *widget, const char *te
xt); | |
| | | | |
| /** | | /** | |
| * Automatically make a window transient to a suitable parent window. | | * Automatically make a window transient to a suitable parent window. | |
| * | | * | |
| * @param window The window to make transient. | | * @param window The window to make transient. | |
| * | | * | |
|
| * @return Whether the window was made transient or not. | | * @return Whether the window was made transient or not. | |
| | | * | |
| * @since 2.4.0 | | * @since 2.4.0 | |
| */ | | */ | |
| gboolean pidgin_auto_parent_window(GtkWidget *window); | | gboolean pidgin_auto_parent_window(GtkWidget *window); | |
| | | | |
| /** | | /** | |
| * Add a labelled widget to a GtkVBox | | * Add a labelled widget to a GtkVBox | |
| * | | * | |
| * @param vbox The GtkVBox to add the widget to. | | * @param vbox The GtkVBox to add the widget to. | |
| * @param widget_label The label to give the widget, can be @c NULL. | | * @param widget_label The label to give the widget, can be @c NULL. | |
| * @param sg The GtkSizeGroup to add the label to, can be @c NULL
. | | * @param sg The GtkSizeGroup to add the label to, can be @c NULL
. | |
| | | | |
| skipping to change at line 815 | | skipping to change at line 838 | |
| * @since 2.4.0 | | * @since 2.4.0 | |
| */ | | */ | |
| GtkWidget *pidgin_add_widget_to_vbox(GtkBox *vbox, const char *widget_label
, GtkSizeGroup *sg, GtkWidget *widget, gboolean expand, GtkWidget **p_label
); | | GtkWidget *pidgin_add_widget_to_vbox(GtkBox *vbox, const char *widget_label
, GtkSizeGroup *sg, GtkWidget *widget, gboolean expand, GtkWidget **p_label
); | |
| | | | |
| /** | | /** | |
| * Create a GdkPixbuf from a PurpleStoredImage. | | * Create a GdkPixbuf from a PurpleStoredImage. | |
| * | | * | |
| * @param image A PurpleStoredImage. | | * @param image A PurpleStoredImage. | |
| * | | * | |
| * @return A GdkPixbuf created from the stored image. | | * @return A GdkPixbuf created from the stored image. | |
|
| | | * | |
| * @since 2.5.0 | | * @since 2.5.0 | |
| */ | | */ | |
|
| GdkPixbuf * pidgin_pixbuf_from_imgstore(PurpleStoredImage *image); | | GdkPixbuf *pidgin_pixbuf_from_imgstore(PurpleStoredImage *image); | |
| | | | |
| | | /** | |
| | | * Initialize some utility functions. | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | void pidgin_utils_init(void); | |
| | | | |
| | | /** | |
| | | * Uninitialize some utility functions. | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | void pidgin_utils_uninit(void); | |
| | | | |
| #endif /* _PIDGINUTILS_H_ */ | | #endif /* _PIDGINUTILS_H_ */ | |
| | | | |
End of changes. 12 change blocks. |
| 10 lines changed or deleted | | 49 lines changed or added | |
|
| prpl.h | | prpl.h | |
| | | | |
| skipping to change at line 67 | | skipping to change at line 67 | |
| #define NO_BUDDY_ICONS {NULL, 0, 0, 0, 0, 0, 0} | | #define NO_BUDDY_ICONS {NULL, 0, 0, 0, 0, 0, 0} | |
| | | | |
| #ifdef HAVE_UNISTD_H | | #ifdef HAVE_UNISTD_H | |
| #include <unistd.h> | | #include <unistd.h> | |
| #endif | | #endif | |
| | | | |
| #include "blist.h" | | #include "blist.h" | |
| #include "conversation.h" | | #include "conversation.h" | |
| #include "ft.h" | | #include "ft.h" | |
| #include "imgstore.h" | | #include "imgstore.h" | |
|
| | | #include "media.h" | |
| #include "notify.h" | | #include "notify.h" | |
| #include "proxy.h" | | #include "proxy.h" | |
| #include "plugin.h" | | #include "plugin.h" | |
| #include "roomlist.h" | | #include "roomlist.h" | |
| #include "status.h" | | #include "status.h" | |
| #include "whiteboard.h" | | #include "whiteboard.h" | |
| | | | |
| /** @copydoc PurpleBuddyIconSpec */ | | /** @copydoc PurpleBuddyIconSpec */ | |
| struct _PurpleBuddyIconSpec { | | struct _PurpleBuddyIconSpec { | |
| /** This is a comma-delimited list of image formats or @c NULL if ic
ons | | /** This is a comma-delimited list of image formats or @c NULL if ic
ons | |
| | | | |
| skipping to change at line 126 | | skipping to change at line 127 | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Protocol options | | * Protocol options | |
| * | | * | |
| * These should all be stuff that some plugins can do and others can't. | | * These should all be stuff that some plugins can do and others can't. | |
| */ | | */ | |
| typedef enum | | typedef enum | |
| { | | { | |
| /** | | /** | |
|
| * Use a unique name, not an alias, for chat rooms. | | * User names are unique to a chat and are not shared between rooms. | |
| * | | * | |
|
| * XMPP lets you choose what name you want for chat. | | * XMPP lets you choose what name you want in chats, so it shouldn't | |
| * So it shouldn't be pulling the alias for when you're in chat; | | * be pulling the aliases from the buddy list for the chat list; | |
| * it gets annoying. | | * it gets annoying. | |
| */ | | */ | |
| OPT_PROTO_UNIQUE_CHATNAME = 0x00000004, | | OPT_PROTO_UNIQUE_CHATNAME = 0x00000004, | |
| | | | |
| /** | | /** | |
| * Chat rooms have topics. | | * Chat rooms have topics. | |
| * | | * | |
| * IRC and XMPP support this. | | * IRC and XMPP support this. | |
| */ | | */ | |
| OPT_PROTO_CHAT_TOPIC = 0x00000008, | | OPT_PROTO_CHAT_TOPIC = 0x00000008, | |
| | | | |
| skipping to change at line 179 | | skipping to change at line 180 | |
| OPT_PROTO_PASSWORD_OPTIONAL = 0x00000080, | | OPT_PROTO_PASSWORD_OPTIONAL = 0x00000080, | |
| | | | |
| /** | | /** | |
| * Allows font size to be specified in sane point size | | * Allows font size to be specified in sane point size | |
| * | | * | |
| * Probably just XMPP and Y!M | | * Probably just XMPP and Y!M | |
| */ | | */ | |
| OPT_PROTO_USE_POINTSIZE = 0x00000100, | | OPT_PROTO_USE_POINTSIZE = 0x00000100, | |
| | | | |
| /** | | /** | |
|
| * Set the Register button active when screenname is not given. | | * Set the Register button active even when the username has not | |
| | | * been specified. | |
| * | | * | |
|
| * Gadu-Gadu doesn't need a screenname to register new account. | | * Gadu-Gadu doesn't need a username to register new account (becaus | |
| | | e | |
| | | * usernames are assigned by the server). | |
| */ | | */ | |
| OPT_PROTO_REGISTER_NOSCREENNAME = 0x00000200, | | OPT_PROTO_REGISTER_NOSCREENNAME = 0x00000200, | |
| | | | |
| /** | | /** | |
| * Indicates that slash commands are native to this protocol. | | * Indicates that slash commands are native to this protocol. | |
| * Used as a hint that unknown commands should not be sent as messag
es. | | * Used as a hint that unknown commands should not be sent as messag
es. | |
| * @since 2.1.0 | | * @since 2.1.0 | |
| */ | | */ | |
| OPT_PROTO_SLASH_COMMANDS_NATIVE = 0x00000400 | | OPT_PROTO_SLASH_COMMANDS_NATIVE = 0x00000400 | |
| | | | |
| | | | |
| skipping to change at line 295 | | skipping to change at line 298 | |
| /** | | /** | |
| * Should arrange for purple_notify_userinfo() to be called with | | * Should arrange for purple_notify_userinfo() to be called with | |
| * @a who's user info. | | * @a who's user info. | |
| */ | | */ | |
| void (*get_info)(PurpleConnection *, const char *who); | | void (*get_info)(PurpleConnection *, const char *who); | |
| void (*set_status)(PurpleAccount *account, PurpleStatus *status); | | void (*set_status)(PurpleAccount *account, PurpleStatus *status); | |
| | | | |
| void (*set_idle)(PurpleConnection *, int idletime); | | void (*set_idle)(PurpleConnection *, int idletime); | |
| void (*change_passwd)(PurpleConnection *, const char *old_pass, | | void (*change_passwd)(PurpleConnection *, const char *old_pass, | |
| const char *new_pass); | | const char *new_pass); | |
|
| | | /** | |
| | | * Add a buddy to a group on the server. | |
| | | * | |
| | | * This PRPL function may be called in situations in which the buddy | |
| | | is | |
| | | * already in the specified group. If the protocol supports | |
| | | * authorization and the user is not already authorized to see the | |
| | | * status of \a buddy, \a add_buddy should request authorization. | |
| | | */ | |
| void (*add_buddy)(PurpleConnection *, PurpleBuddy *buddy, PurpleGrou
p *group); | | void (*add_buddy)(PurpleConnection *, PurpleBuddy *buddy, PurpleGrou
p *group); | |
| void (*add_buddies)(PurpleConnection *, GList *buddies, GList *group
s); | | void (*add_buddies)(PurpleConnection *, GList *buddies, GList *group
s); | |
| void (*remove_buddy)(PurpleConnection *, PurpleBuddy *buddy, PurpleG
roup *group); | | void (*remove_buddy)(PurpleConnection *, PurpleBuddy *buddy, PurpleG
roup *group); | |
| void (*remove_buddies)(PurpleConnection *, GList *buddies, GList *gr
oups); | | void (*remove_buddies)(PurpleConnection *, GList *buddies, GList *gr
oups); | |
| void (*add_permit)(PurpleConnection *, const char *name); | | void (*add_permit)(PurpleConnection *, const char *name); | |
| void (*add_deny)(PurpleConnection *, const char *name); | | void (*add_deny)(PurpleConnection *, const char *name); | |
| void (*rem_permit)(PurpleConnection *, const char *name); | | void (*rem_permit)(PurpleConnection *, const char *name); | |
| void (*rem_deny)(PurpleConnection *, const char *name); | | void (*rem_deny)(PurpleConnection *, const char *name); | |
| void (*set_permit_deny)(PurpleConnection *); | | void (*set_permit_deny)(PurpleConnection *); | |
| void (*join_chat)(PurpleConnection *, GHashTable *components); | | void (*join_chat)(PurpleConnection *, GHashTable *components); | |
| | | | |
| skipping to change at line 450 | | skipping to change at line 461 | |
| /** This allows protocols to specify additional strings to be used f
or | | /** This allows protocols to specify additional strings to be used f
or | |
| * various purposes. The idea is to stuff a bunch of strings in thi
s hash | | * various purposes. The idea is to stuff a bunch of strings in thi
s hash | |
| * table instead of expanding the struct for every addition. This h
ash | | * table instead of expanding the struct for every addition. This h
ash | |
| * table is allocated every call and MUST be unrefed by the caller. | | * table is allocated every call and MUST be unrefed by the caller. | |
| * | | * | |
| * @param account The account to specify. This can be NULL. | | * @param account The account to specify. This can be NULL. | |
| * @return The protocol's string hash table. The hash table should b
e | | * @return The protocol's string hash table. The hash table should b
e | |
| * destroyed by the caller when it's no longer needed. | | * destroyed by the caller when it's no longer needed. | |
| */ | | */ | |
| GHashTable *(*get_account_text_table)(PurpleAccount *account); | | GHashTable *(*get_account_text_table)(PurpleAccount *account); | |
|
| | | | |
| | | /** | |
| | | * Initiate a media session with the given contact. | |
| | | * | |
| | | * @param account The account to initiate the media session on. | |
| | | * @param who The remote user to initiate the session with. | |
| | | * @param type The type of media session to initiate. | |
| | | * @return TRUE if the call succeeded else FALSE. (Doesn't imply the | |
| | | media session or stream will be successfully created) | |
| | | */ | |
| | | gboolean (*initiate_media)(PurpleAccount *account, const char *who, | |
| | | PurpleMediaSessionType type); | |
| | | | |
| | | /** | |
| | | * Checks to see if the given contact supports the given type of med | |
| | | ia session. | |
| | | * | |
| | | * @param account The account the contact is on. | |
| | | * @param who The remote user to check for media capability with. | |
| | | * @return The media caps the contact supports. | |
| | | */ | |
| | | PurpleMediaCaps (*get_media_caps)(PurpleAccount *account, | |
| | | const char *who); | |
| }; | | }; | |
| | | | |
| #define PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl, member) \ | | #define PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl, member) \ | |
| (((G_STRUCT_OFFSET(PurplePluginProtocolInfo, member) < G_STRUCT_OFFS
ET(PurplePluginProtocolInfo, struct_size)) \ | | (((G_STRUCT_OFFSET(PurplePluginProtocolInfo, member) < G_STRUCT_OFFS
ET(PurplePluginProtocolInfo, struct_size)) \ | |
| || (G_STRUCT_OFFSET(PurplePluginProtocolInfo, member) < prpl->stru
ct_size)) && \ | | || (G_STRUCT_OFFSET(PurplePluginProtocolInfo, member) < prpl->stru
ct_size)) && \ | |
| prpl->member != NULL) | | prpl->member != NULL) | |
| | | | |
| #define PURPLE_IS_PROTOCOL_PLUGIN(plugin) \ | | #define PURPLE_IS_PROTOCOL_PLUGIN(plugin) \ | |
| ((plugin)->info->type == PURPLE_PLUGIN_PROTOCOL) | | ((plugin)->info->type == PURPLE_PLUGIN_PROTOCOL) | |
| | | | |
| | | | |
| skipping to change at line 594 | | skipping to change at line 626 | |
| const char *purple_attention_type_get_unlocalized_name(const PurpleAttentio
nType *type); | | const char *purple_attention_type_get_unlocalized_name(const PurpleAttentio
nType *type); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /** @name Protocol Plugin API *
/ | | /** @name Protocol Plugin API *
/ | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** | | /** | |
|
| * Notifies Purple that an account's idle state and time have changed. | | * Notifies Purple that our account's idle state and time have changed. | |
| * | | * | |
| * This is meant to be called from protocol plugins. | | * This is meant to be called from protocol plugins. | |
| * | | * | |
| * @param account The account. | | * @param account The account. | |
| * @param idle The user's idle state. | | * @param idle The user's idle state. | |
| * @param idle_time The user's idle time. | | * @param idle_time The user's idle time. | |
| */ | | */ | |
| void purple_prpl_got_account_idle(PurpleAccount *account, gboolean idle, | | void purple_prpl_got_account_idle(PurpleAccount *account, gboolean idle, | |
| time_t idle_
time); | | time_t idle_
time); | |
| | | | |
| /** | | /** | |
|
| * Notifies Purple of an account's log-in time. | | * Notifies Purple of our account's log-in time. | |
| * | | * | |
| * This is meant to be called from protocol plugins. | | * This is meant to be called from protocol plugins. | |
| * | | * | |
| * @param account The account the user is on. | | * @param account The account the user is on. | |
| * @param login_time The user's log-in time. | | * @param login_time The user's log-in time. | |
| */ | | */ | |
| void purple_prpl_got_account_login_time(PurpleAccount *account, time_t logi
n_time); | | void purple_prpl_got_account_login_time(PurpleAccount *account, time_t logi
n_time); | |
| | | | |
| /** | | /** | |
|
| * Notifies Purple that an account's status has changed. | | * Notifies Purple that our account's status has changed. | |
| * | | * | |
| * This is meant to be called from protocol plugins. | | * This is meant to be called from protocol plugins. | |
| * | | * | |
| * @param account The account the user is on. | | * @param account The account the user is on. | |
| * @param status_id The status ID. | | * @param status_id The status ID. | |
| * @param ... A NULL-terminated list of attribute IDs and values, | | * @param ... A NULL-terminated list of attribute IDs and values, | |
| * beginning with the value for @a attr_id. | | * beginning with the value for @a attr_id. | |
| */ | | */ | |
| void purple_prpl_got_account_status(PurpleAccount *account, | | void purple_prpl_got_account_status(PurpleAccount *account, | |
| const char
*status_id, ...) G_GNUC_NULL_TERMINATED; | | const char
*status_id, ...) G_GNUC_NULL_TERMINATED; | |
| | | | |
| skipping to change at line 627 | | skipping to change at line 659 | |
| * | | * | |
| * This is meant to be called from protocol plugins. | | * This is meant to be called from protocol plugins. | |
| * | | * | |
| * @param account The account the user is on. | | * @param account The account the user is on. | |
| * @param status_id The status ID. | | * @param status_id The status ID. | |
| * @param ... A NULL-terminated list of attribute IDs and values, | | * @param ... A NULL-terminated list of attribute IDs and values, | |
| * beginning with the value for @a attr_id. | | * beginning with the value for @a attr_id. | |
| */ | | */ | |
| void purple_prpl_got_account_status(PurpleAccount *account, | | void purple_prpl_got_account_status(PurpleAccount *account, | |
| const char
*status_id, ...) G_GNUC_NULL_TERMINATED; | | const char
*status_id, ...) G_GNUC_NULL_TERMINATED; | |
|
| | | | |
| /** | | /** | |
|
| * Notifies Purple that a user's idle state and time have changed. | | * Notifies Purple that our account's actions have changed. This is only | |
| | | * called after the initial connection. Emits the account-actions-changed | |
| | | * signal. | |
| | | * | |
| | | * This is meant to be called from protocol plugins. | |
| | | * | |
| | | * @param account The account. | |
| | | * | |
| | | * @see account-actions-changed | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | void purple_prpl_got_account_actions(PurpleAccount *account); | |
| | | | |
| | | /** | |
| | | * Notifies Purple that a buddy's idle state and time have changed. | |
| * | | * | |
| * This is meant to be called from protocol plugins. | | * This is meant to be called from protocol plugins. | |
| * | | * | |
| * @param account The account the user is on. | | * @param account The account the user is on. | |
|
| * @param name The screen name of the user. | | * @param name The name of the buddy. | |
| * @param idle The user's idle state. | | * @param idle The user's idle state. | |
| * @param idle_time The user's idle time. This is the time at | | * @param idle_time The user's idle time. This is the time at | |
| * which the user became idle, in seconds since | | * which the user became idle, in seconds since | |
| * the epoch. If the PRPL does not know this value | | * the epoch. If the PRPL does not know this value | |
| * then it should pass 0. | | * then it should pass 0. | |
| */ | | */ | |
| void purple_prpl_got_user_idle(PurpleAccount *account, const char *name, | | void purple_prpl_got_user_idle(PurpleAccount *account, const char *name, | |
| gboolean idle, time
_t idle_time); | | gboolean idle, time
_t idle_time); | |
| | | | |
| /** | | /** | |
|
| * Notifies Purple of a user's log-in time. | | * Notifies Purple of a buddy's log-in time. | |
| * | | * | |
| * This is meant to be called from protocol plugins. | | * This is meant to be called from protocol plugins. | |
| * | | * | |
| * @param account The account the user is on. | | * @param account The account the user is on. | |
|
| * @param name The screen name of the user. | | * @param name The name of the buddy. | |
| * @param login_time The user's log-in time. | | * @param login_time The user's log-in time. | |
| */ | | */ | |
| void purple_prpl_got_user_login_time(PurpleAccount *account, const char *na
me, | | void purple_prpl_got_user_login_time(PurpleAccount *account, const char *na
me, | |
| time_t lo
gin_time); | | time_t lo
gin_time); | |
| | | | |
| /** | | /** | |
|
| * Notifies Purple that a user's status has been activated. | | * Notifies Purple that a buddy's status has been activated. | |
| * | | * | |
| * This is meant to be called from protocol plugins. | | * This is meant to be called from protocol plugins. | |
| * | | * | |
| * @param account The account the user is on. | | * @param account The account the user is on. | |
|
| * @param name The screen name of the user. | | * @param name The name of the buddy. | |
| * @param status_id The status ID. | | * @param status_id The status ID. | |
| * @param ... A NULL-terminated list of attribute IDs and values, | | * @param ... A NULL-terminated list of attribute IDs and values, | |
| * beginning with the value for @a attr_id. | | * beginning with the value for @a attr_id. | |
| */ | | */ | |
| void purple_prpl_got_user_status(PurpleAccount *account, const char *name, | | void purple_prpl_got_user_status(PurpleAccount *account, const char *name, | |
| const char *statu
s_id, ...) G_GNUC_NULL_TERMINATED; | | const char *statu
s_id, ...) G_GNUC_NULL_TERMINATED; | |
| | | | |
| /** | | /** | |
|
| * Notifies libpurple that a user's status has been deactivated | | * Notifies libpurple that a buddy's status has been deactivated | |
| * | | * | |
| * This is meant to be called from protocol plugins. | | * This is meant to be called from protocol plugins. | |
| * | | * | |
| * @param account The account the user is on. | | * @param account The account the user is on. | |
|
| * @param name The screen name of the user. | | * @param name The name of the buddy. | |
| * @param status_id The status ID. | | * @param status_id The status ID. | |
| */ | | */ | |
| void purple_prpl_got_user_status_deactive(PurpleAccount *account, const cha
r *name, | | void purple_prpl_got_user_status_deactive(PurpleAccount *account, const cha
r *name, | |
| const char *status_id); | | const char *status_id); | |
| | | | |
| /** | | /** | |
|
| * Informs the server that an account's status changed. | | * Informs the server that our account's status changed. | |
| * | | * | |
| * @param account The account the user is on. | | * @param account The account the user is on. | |
| * @param old_status The previous status. | | * @param old_status The previous status. | |
| * @param new_status The status that was activated, or deactivated | | * @param new_status The status that was activated, or deactivated | |
| * (in the case of independent statuses). | | * (in the case of independent statuses). | |
| */ | | */ | |
| void purple_prpl_change_account_status(PurpleAccount *account, | | void purple_prpl_change_account_status(PurpleAccount *account, | |
| Pur
pleStatus *old_status, | | Pur
pleStatus *old_status, | |
| Pur
pleStatus *new_status); | | Pur
pleStatus *new_status); | |
| | | | |
| /** | | /** | |
| * Retrieves the list of stock status types from a prpl. | | * Retrieves the list of stock status types from a prpl. | |
| * | | * | |
| * @param account The account the user is on. | | * @param account The account the user is on. | |
| * @param presence The presence for which we're going to get statuses | | * @param presence The presence for which we're going to get statuses | |
| * | | * | |
| * @return List of statuses | | * @return List of statuses | |
| */ | | */ | |
| GList *purple_prpl_get_statuses(PurpleAccount *account, PurplePresence *pre
sence); | | GList *purple_prpl_get_statuses(PurpleAccount *account, PurplePresence *pre
sence); | |
| | | | |
|
| /** Send an attention request message. | | /** | |
| | | * Send an attention request message. | |
| * | | * | |
| * @param gc The connection to send the message on. | | * @param gc The connection to send the message on. | |
| * @param who Whose attention to request. | | * @param who Whose attention to request. | |
| * @param type_code An index into the prpl's attention_types list determini
ng the type | | * @param type_code An index into the prpl's attention_types list determini
ng the type | |
|
| * of the attention request command to send. 0 if prpl only defines one | | * of the attention request command to send. 0 if prpl only defines | |
| * (for example, Yahoo and MSN), but some protocols define more (MySpac | | one | |
| eIM). | | * (for example, Yahoo and MSN), but some protocols define more (MyS | |
| | | paceIM). | |
| * | | * | |
| * Note that you can't send arbitrary PurpleAttentionType's, because there
is | | * Note that you can't send arbitrary PurpleAttentionType's, because there
is | |
| * only a fixed set of attention commands. | | * only a fixed set of attention commands. | |
|
| | | * | |
| * @since 2.5.0 | | * @since 2.5.0 | |
| */ | | */ | |
| void purple_prpl_send_attention(PurpleConnection *gc, const char *who, guin
t type_code); | | void purple_prpl_send_attention(PurpleConnection *gc, const char *who, guin
t type_code); | |
| | | | |
|
| /** Process an incoming attention message. | | /** | |
| | | * Process an incoming attention message. | |
| * | | * | |
| * @param gc The connection that received the attention message. | | * @param gc The connection that received the attention message. | |
| * @param who Who requested your attention. | | * @param who Who requested your attention. | |
| * @param type_code An index into the prpl's attention_types list determini
ng the type | | * @param type_code An index into the prpl's attention_types list determini
ng the type | |
|
| * of the attention request command to send. | | * of the attention request command to send. | |
| | | * | |
| * @since 2.5.0 | | * @since 2.5.0 | |
| */ | | */ | |
| void purple_prpl_got_attention(PurpleConnection *gc, const char *who, guint
type_code); | | void purple_prpl_got_attention(PurpleConnection *gc, const char *who, guint
type_code); | |
| | | | |
|
| /** Process an incoming attention message in a chat. | | /** | |
| | | * Process an incoming attention message in a chat. | |
| * | | * | |
| * @param gc The connection that received the attention message. | | * @param gc The connection that received the attention message. | |
| * @param id The chat id. | | * @param id The chat id. | |
| * @param who Who requested your attention. | | * @param who Who requested your attention. | |
| * @param type_code An index into the prpl's attention_types list determini
ng the type | | * @param type_code An index into the prpl's attention_types list determini
ng the type | |
|
| * of the attention request command to send. | | * of the attention request command to send. | |
| | | * | |
| * @since 2.5.0 | | * @since 2.5.0 | |
| */ | | */ | |
| void purple_prpl_got_attention_in_chat(PurpleConnection *gc, int id, const
char *who, guint type_code); | | void purple_prpl_got_attention_in_chat(PurpleConnection *gc, int id, const
char *who, guint type_code); | |
| | | | |
|
| | | /** | |
| | | * Determines if the contact supports the given media session type. | |
| | | * | |
| | | * @param account The account the user is on. | |
| | | * @param who The name of the contact to check capabilities for. | |
| | | * | |
| | | * @return The media caps the contact supports. | |
| | | */ | |
| | | PurpleMediaCaps purple_prpl_get_media_caps(PurpleAccount *account, | |
| | | const char *who); | |
| | | | |
| | | /** | |
| | | * Initiates a media session with the given contact. | |
| | | * | |
| | | * @param account The account the user is on. | |
| | | * @param who The name of the contact to start a session with. | |
| | | * @param type The type of media session to start. | |
| | | * | |
| | | * @return TRUE if the call succeeded else FALSE. (Doesn't imply the media | |
| | | session or stream will be successfully created) | |
| | | */ | |
| | | gboolean purple_prpl_initiate_media(PurpleAccount *account, | |
| | | const char *who, | |
| | | PurpleMediaSessionType type); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /** @name Protocol Plugin Subsystem API *
/ | | /** @name Protocol Plugin Subsystem API *
/ | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** | | /** | |
| * Finds a protocol plugin structure of the specified type. | | * Finds a protocol plugin structure of the specified type. | |
| * | | * | |
| | | | |
End of changes. 28 change blocks. |
| 25 lines changed or deleted | | 108 lines changed or added | |
|
| smiley.h | | smiley.h | |
| | | | |
| skipping to change at line 64 | | skipping to change at line 64 | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /** @name Custom Smiley API *
/ | | /** @name Custom Smiley API *
/ | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** | | /** | |
|
| * GObject foo. | | * GObject-fu. | |
| * @internal. | | * @internal. | |
| */ | | */ | |
| GType purple_smiley_get_type(void); | | GType purple_smiley_get_type(void); | |
| | | | |
| /** | | /** | |
|
| * Creates a new custom smiley structure and populates it. | | * Creates a new custom smiley from a PurpleStoredImage. | |
| * | | * | |
|
| * If a custom smiley with the informed shortcut already exist, it | | * If a custom smiley with the given shortcut already exists, it | |
| * will be automaticaly returned. | | * will be automaticaly returned. | |
| * | | * | |
| * @param img The image associated with the smiley. | | * @param img The image associated with the smiley. | |
|
| * @param shortcut The custom smiley associated shortcut. | | * @param shortcut The associated shortcut (e.g. "(homer)"). | |
| * | | * | |
|
| * @return The custom smiley structure filled up. | | * @return The custom smiley. | |
| */ | | */ | |
| PurpleSmiley * | | PurpleSmiley * | |
| purple_smiley_new(PurpleStoredImage *img, const char *shortcut); | | purple_smiley_new(PurpleStoredImage *img, const char *shortcut); | |
| | | | |
| /** | | /** | |
|
| * Creates a new custom smiley structure and populates it. | | * Creates a new custom smiley, reading the image data from a file. | |
| * | | | |
| * The data is retrieved from an already existent file. | | | |
| * | | * | |
|
| * If a custom smiley with the informed shortcut already exist, it | | * If a custom smiley with the given shortcut already exists, it | |
| * will be automaticaly returned. | | * will be automaticaly returned. | |
| * | | * | |
|
| * @param shortcut The custom smiley associated shortcut. | | * @param shortcut The associated shortcut (e.g. "(homer)"). | |
| * @param filepath The image file to be imported to a | | * @param filepath The image file. | |
| * new custom smiley. | | | |
| * | | * | |
|
| * @return The custom smiley structure filled up. | | * @return The custom smiley. | |
| */ | | */ | |
| PurpleSmiley * | | PurpleSmiley * | |
| purple_smiley_new_from_file(const char *shortcut, const char *filepath); | | purple_smiley_new_from_file(const char *shortcut, const char *filepath); | |
| | | | |
| /** | | /** | |
|
| * Destroy the custom smiley and release the associated resources. | | * Destroys the custom smiley and release the associated resources. | |
| * | | * | |
| * @param smiley The custom smiley. | | * @param smiley The custom smiley. | |
| */ | | */ | |
| void | | void | |
| purple_smiley_delete(PurpleSmiley *smiley); | | purple_smiley_delete(PurpleSmiley *smiley); | |
| | | | |
| /** | | /** | |
| * Changes the custom smiley's shortcut. | | * Changes the custom smiley's shortcut. | |
| * | | * | |
| * @param smiley The custom smiley. | | * @param smiley The custom smiley. | |
|
| * @param shortcut The custom smiley associated shortcut. | | * @param shortcut The new shortcut. A custom smiley with this shortcut | |
| | | * cannot already be in use. | |
| * | | * | |
|
| * @return TRUE whether the shortcut is not associated with another | | * @return TRUE if the shortcut was changed. FALSE otherwise. | |
| * custom smiley and the parameters are valid. FALSE otherwise. | | | |
| */ | | */ | |
| gboolean | | gboolean | |
| purple_smiley_set_shortcut(PurpleSmiley *smiley, const char *shortcut); | | purple_smiley_set_shortcut(PurpleSmiley *smiley, const char *shortcut); | |
| | | | |
| /** | | /** | |
|
| * Changes the custom smiley's data. | | * Changes the custom smiley's image data. | |
| * | | | |
| * When the filename controling is made outside this API, the param | | | |
| * #keepfilename must be TRUE. | | | |
| * Otherwise, the file and filename will be regenerated, and the | | | |
| * old one will be removed. | | | |
| * | | * | |
| * @param smiley The custom smiley. | | * @param smiley The custom smiley. | |
|
| * @param smiley_data The custom smiley data. | | * @param smiley_data The custom smiley data, which the smiley code | |
| * @param smiley_data_len The custom smiley data length. | | * takes ownership of and will free. | |
| | | * @param smiley_data_len The length of the data in @a smiley_data. | |
| */ | | */ | |
| void | | void | |
| purple_smiley_set_data(PurpleSmiley *smiley, guchar *smiley_data, | | purple_smiley_set_data(PurpleSmiley *smiley, guchar *smiley_data, | |
| size_t smiley_data_len); | | size_t smiley_data_len); | |
| | | | |
| /** | | /** | |
|
| * Returns the custom smiley's associated shortcut. | | * Returns the custom smiley's associated shortcut (e.g. "(homer)"). | |
| * | | * | |
| * @param smiley The custom smiley. | | * @param smiley The custom smiley. | |
| * | | * | |
| * @return The shortcut. | | * @return The shortcut. | |
| */ | | */ | |
| const char *purple_smiley_get_shortcut(const PurpleSmiley *smiley); | | const char *purple_smiley_get_shortcut(const PurpleSmiley *smiley); | |
| | | | |
| /** | | /** | |
| * Returns the custom smiley data's checksum. | | * Returns the custom smiley data's checksum. | |
| * | | * | |
| * @param smiley The custom smiley. | | * @param smiley The custom smiley. | |
| * | | * | |
| * @return The checksum. | | * @return The checksum. | |
| */ | | */ | |
| const char *purple_smiley_get_checksum(const PurpleSmiley *smiley); | | const char *purple_smiley_get_checksum(const PurpleSmiley *smiley); | |
| | | | |
| /** | | /** | |
| * Returns the PurpleStoredImage with the reference counter incremented. | | * Returns the PurpleStoredImage with the reference counter incremented. | |
| * | | * | |
| * The returned PurpleStoredImage reference counter must be decremented | | * The returned PurpleStoredImage reference counter must be decremented | |
|
| * after use. | | * when the caller is done using it. | |
| * | | * | |
| * @param smiley The custom smiley. | | * @param smiley The custom smiley. | |
| * | | * | |
|
| * @return A PurpleStoredImage reference. | | * @return A PurpleStoredImage. | |
| */ | | */ | |
| PurpleStoredImage *purple_smiley_get_stored_image(const PurpleSmiley *smile
y); | | PurpleStoredImage *purple_smiley_get_stored_image(const PurpleSmiley *smile
y); | |
| | | | |
| /** | | /** | |
| * Returns the custom smiley's data. | | * Returns the custom smiley's data. | |
| * | | * | |
| * @param smiley The custom smiley. | | * @param smiley The custom smiley. | |
|
| * @param len If not @c NULL, the length of the icon data returned | | * @param len If not @c NULL, the length of the image data returned | |
| * will be set in the location pointed to by this. | | * will be set in the location pointed to by this. | |
| * | | * | |
| * @return A pointer to the custom smiley data. | | * @return A pointer to the custom smiley data. | |
| */ | | */ | |
| gconstpointer purple_smiley_get_data(const PurpleSmiley *smiley, size_t *le
n); | | gconstpointer purple_smiley_get_data(const PurpleSmiley *smiley, size_t *le
n); | |
| | | | |
| /** | | /** | |
| * Returns an extension corresponding to the custom smiley's file type. | | * Returns an extension corresponding to the custom smiley's file type. | |
| * | | * | |
| * @param smiley The custom smiley. | | * @param smiley The custom smiley. | |
| | | | |
| skipping to change at line 197 | | skipping to change at line 190 | |
| /** | | /** | |
| * Returns a full path to an custom smiley. | | * Returns a full path to an custom smiley. | |
| * | | * | |
| * If the custom smiley has data and the file exists in the cache, this | | * If the custom smiley has data and the file exists in the cache, this | |
| * will return a full path to the cached file. | | * will return a full path to the cached file. | |
| * | | * | |
| * In general, it is not appropriate to be poking in the file cached | | * In general, it is not appropriate to be poking in the file cached | |
| * directly. If you find yourself wanting to use this function, think | | * directly. If you find yourself wanting to use this function, think | |
| * very long and hard about it, and then don't. | | * very long and hard about it, and then don't. | |
| * | | * | |
|
| | | * Think some more. | |
| | | * | |
| * @param smiley The custom smiley. | | * @param smiley The custom smiley. | |
| * | | * | |
| * @return A full path to the file, or @c NULL under various conditions. | | * @return A full path to the file, or @c NULL under various conditions. | |
| * The caller should use #g_free to free the returned string. | | * The caller should use #g_free to free the returned string. | |
| */ | | */ | |
| char *purple_smiley_get_full_path(PurpleSmiley *smiley); | | char *purple_smiley_get_full_path(PurpleSmiley *smiley); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /** @name Custom Smiley Subsystem API *
/ | | /** @name Custom Smiley Subsystem API *
/ | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** | | /** | |
|
| * Returns a list of all custom smileys. The caller should free the list. | | * Returns a list of all custom smileys. The caller is responsible for free | |
| | | ing | |
| | | * the list. | |
| * | | * | |
| * @return A list of all custom smileys. | | * @return A list of all custom smileys. | |
| */ | | */ | |
| GList * | | GList * | |
| purple_smileys_get_all(void); | | purple_smileys_get_all(void); | |
| | | | |
| /** | | /** | |
|
| * Returns the custom smiley given it's shortcut. | | * Returns a custom smiley given its shortcut. | |
| * | | * | |
| * @param shortcut The custom smiley's shortcut. | | * @param shortcut The custom smiley's shortcut. | |
| * | | * | |
|
| * @return The custom smiley (with a reference for the caller) if found, | | * @return The custom smiley if found, or @c NULL if not found. | |
| * or @c NULL if not found. | | | |
| */ | | */ | |
| PurpleSmiley * | | PurpleSmiley * | |
| purple_smileys_find_by_shortcut(const char *shortcut); | | purple_smileys_find_by_shortcut(const char *shortcut); | |
| | | | |
| /** | | /** | |
|
| * Returns the custom smiley given it's checksum. | | * Returns a custom smiley given its checksum. | |
| * | | * | |
| * @param checksum The custom smiley's checksum. | | * @param checksum The custom smiley's checksum. | |
| * | | * | |
|
| * @return The custom smiley (with a reference for the caller) if found, | | * @return The custom smiley if found, or @c NULL if not found. | |
| * or @c NULL if not found. | | | |
| */ | | */ | |
| PurpleSmiley * | | PurpleSmiley * | |
| purple_smileys_find_by_checksum(const char *checksum); | | purple_smileys_find_by_checksum(const char *checksum); | |
| | | | |
| /** | | /** | |
| * Returns the directory used to store custom smiley cached files. | | * Returns the directory used to store custom smiley cached files. | |
| * | | * | |
|
| * The default directory is PURPLEDIR/smileys, unless otherwise specified | | * The default directory is PURPLEDIR/custom_smiley. | |
| * by purple_buddy_icons_set_cache_dir(). | | | |
| * | | * | |
|
| * @return The directory to store custom smyles cached files to. | | * @return The directory in which to store custom smileys cached files. | |
| */ | | */ | |
| const char *purple_smileys_get_storing_dir(void); | | const char *purple_smileys_get_storing_dir(void); | |
| | | | |
| /** | | /** | |
| * Initializes the custom smiley subsystem. | | * Initializes the custom smiley subsystem. | |
| */ | | */ | |
| void purple_smileys_init(void); | | void purple_smileys_init(void); | |
| | | | |
| /** | | /** | |
| * Uninitializes the custom smiley subsystem. | | * Uninitializes the custom smiley subsystem. | |
| | | | |
End of changes. 26 change blocks. |
| 39 lines changed or deleted | | 33 lines changed or added | |
|
| status.h | | status.h | |
| | | | |
| skipping to change at line 53 | | skipping to change at line 53 | |
| * one of your AIM buddies has set himself as "away." You have a | | * one of your AIM buddies has set himself as "away." You have a | |
| * PurpleBuddy node for this person in your buddy list. Purple wants | | * PurpleBuddy node for this person in your buddy list. Purple wants | |
| * to mark this buddy as "away," so it creates a new PurpleStatus. | | * to mark this buddy as "away," so it creates a new PurpleStatus. | |
| * The PurpleStatus has its PurpleStatusType set to the "away" state | | * The PurpleStatus has its PurpleStatusType set to the "away" state | |
| * for the oscar PRPL. The PurpleStatus also contains the buddy's | | * for the oscar PRPL. The PurpleStatus also contains the buddy's | |
| * away message. PurpleStatuses are sometimes saved, depending on | | * away message. PurpleStatuses are sometimes saved, depending on | |
| * the context. The current PurpleStatuses associated with each of | | * the context. The current PurpleStatuses associated with each of | |
| * your accounts are saved so that the next time you start Purple, | | * your accounts are saved so that the next time you start Purple, | |
| * your accounts will be set to their last known statuses. There | | * your accounts will be set to their last known statuses. There | |
| * is also a list of saved statuses that are written to the | | * is also a list of saved statuses that are written to the | |
|
| * status.xml file. Also, each PurpleStatus has a "savable" boolean. | | * status.xml file. Also, each PurpleStatus has a "saveable" boolean. | |
| * If "savable" is set to FALSE then the status is NEVER saved. | | * If "saveable" is set to FALSE then the status is NEVER saved. | |
| * All PurpleStatuses should be inside a PurplePresence. | | * All PurpleStatuses should be inside a PurplePresence. | |
| * | | * | |
| * | | * | |
|
| * A PurpleStatus is either "indepedent" or "exclusive." | | * A PurpleStatus is either "independent" or "exclusive." | |
| * Independent statuses can be active or inactive and it doesn't | | * Independent statuses can be active or inactive and they don't | |
| * affect anything else. However, you can only have one exclusive | | * affect anything else. However, you can only have one exclusive | |
|
| * status per PurplePresence. If you activate one exlusive status, | | * status per PurplePresence. If you activate one exclusive status, | |
| * then the previous exclusive status is automatically deactivated. | | * then the previous exclusive status is automatically deactivated. | |
| * | | * | |
| * A PurplePresence is like a collection of PurpleStatuses (plus some | | * A PurplePresence is like a collection of PurpleStatuses (plus some | |
| * other random info). For any buddy, or for any one of your accounts, | | * other random info). For any buddy, or for any one of your accounts, | |
|
| * or for any person you're chatting with, you may know various | | * or for any person with which you're chatting, you may know various | |
| * amounts of information. This information is all contained in | | * amounts of information. This information is all contained in | |
| * one PurplePresence. If one of your buddies is away and idle, | | * one PurplePresence. If one of your buddies is away and idle, | |
| * then the presence contains the PurpleStatus for their awayness, | | * then the presence contains the PurpleStatus for their awayness, | |
| * and it contains their current idle time. PurplePresences are | | * and it contains their current idle time. PurplePresences are | |
|
| * never saved to disk. The information they contain is only relevent | | * never saved to disk. The information they contain is only relevant | |
| * for the current PurpleSession. | | * for the current PurpleSession. | |
| */ | | */ | |
| | | | |
| typedef struct _PurpleStatusType PurpleStatusType; | | typedef struct _PurpleStatusType PurpleStatusType; | |
| typedef struct _PurpleStatusAttr PurpleStatusAttr; | | typedef struct _PurpleStatusAttr PurpleStatusAttr; | |
| typedef struct _PurplePresence PurplePresence; | | typedef struct _PurplePresence PurplePresence; | |
| typedef struct _PurpleStatus PurpleStatus; | | typedef struct _PurpleStatus PurpleStatus; | |
| | | | |
| /** | | /** | |
| * A context for a presence. | | * A context for a presence. | |
| * | | * | |
|
| * The context indicates what the presence applies to. | | * The context indicates to what the presence applies. | |
| */ | | */ | |
| typedef enum | | typedef enum | |
| { | | { | |
| PURPLE_PRESENCE_CONTEXT_UNSET = 0, | | PURPLE_PRESENCE_CONTEXT_UNSET = 0, | |
| PURPLE_PRESENCE_CONTEXT_ACCOUNT, | | PURPLE_PRESENCE_CONTEXT_ACCOUNT, | |
| PURPLE_PRESENCE_CONTEXT_CONV, | | PURPLE_PRESENCE_CONTEXT_CONV, | |
| PURPLE_PRESENCE_CONTEXT_BUDDY | | PURPLE_PRESENCE_CONTEXT_BUDDY | |
| | | | |
| } PurplePresenceContext; | | } PurplePresenceContext; | |
| | | | |
| | | | |
| skipping to change at line 137 | | skipping to change at line 137 | |
| #define PURPLE_TUNE_TIME "tune_time" | | #define PURPLE_TUNE_TIME "tune_time" | |
| #define PURPLE_TUNE_YEAR "tune_year" | | #define PURPLE_TUNE_YEAR "tune_year" | |
| #define PURPLE_TUNE_URL "tune_url" | | #define PURPLE_TUNE_URL "tune_url" | |
| #define PURPLE_TUNE_FULL "tune_full" | | #define PURPLE_TUNE_FULL "tune_full" | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
|
| /** @name PurpleStatusPrimitive API
*/ | | /** @name PurpleStatusPrimitive API *
/ | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** | | /** | |
| * Lookup the id of a primitive status type based on the type. This | | * Lookup the id of a primitive status type based on the type. This | |
| * ID is a unique plain-text name of the status, without spaces. | | * ID is a unique plain-text name of the status, without spaces. | |
| * | | * | |
| * @param type A primitive status type. | | * @param type A primitive status type. | |
| * | | * | |
| * @return The unique ID for this type. | | * @return The unique ID for this type. | |
| | | | |
| skipping to change at line 175 | | skipping to change at line 175 | |
| * | | * | |
| * @param id The unique ID of a primitive status type. | | * @param id The unique ID of a primitive status type. | |
| * | | * | |
| * @return The PurpleStatusPrimitive value. | | * @return The PurpleStatusPrimitive value. | |
| */ | | */ | |
| PurpleStatusPrimitive purple_primitive_get_type_from_id(const char *id); | | PurpleStatusPrimitive purple_primitive_get_type_from_id(const char *id); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
|
| /** @name PurpleStatusType API
*/ | | /** @name PurpleStatusType API *
/ | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** | | /** | |
| * Creates a new status type. | | * Creates a new status type. | |
| * | | * | |
| * @param primitive The primitive status type. | | * @param primitive The primitive status type. | |
| * @param id The ID of the status type, or @c NULL to use the id
of | | * @param id The ID of the status type, or @c NULL to use the id
of | |
| * the primitive status type. | | * the primitive status type. | |
| * @param name The name presented to the user, or @c NULL to use t
he | | * @param name The name presented to the user, or @c NULL to use t
he | |
| | | | |
| skipping to change at line 255 | | skipping to change at line 255 | |
|
const char *attr_name, | |
const char *attr_name, | |
|
PurpleValue *attr_value, ...) G_GNUC_NULL_TERMINATED; | |
PurpleValue *attr_value, ...) G_GNUC_NULL_TERMINATED; | |
| | | | |
| /** | | /** | |
| * Destroys a status type. | | * Destroys a status type. | |
| * | | * | |
| * @param status_type The status type to destroy. | | * @param status_type The status type to destroy. | |
| */ | | */ | |
| void purple_status_type_destroy(PurpleStatusType *status_type); | | void purple_status_type_destroy(PurpleStatusType *status_type); | |
| | | | |
|
| | | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_STATUS_C_) | |
| /** | | /** | |
| * Sets a status type's primary attribute. | | * Sets a status type's primary attribute. | |
| * | | * | |
| * The value for the primary attribute is used as the description for | | * The value for the primary attribute is used as the description for | |
| * the particular status type. An example is an away message. The message | | * the particular status type. An example is an away message. The message | |
| * would be the primary attribute. | | * would be the primary attribute. | |
| * | | * | |
| * @param status_type The status type. | | * @param status_type The status type. | |
| * @param attr_id The ID of the primary attribute. | | * @param attr_id The ID of the primary attribute. | |
|
| | | * | |
| | | * @deprecated This function isn't used and should be removed in 3.0.0. | |
| */ | | */ | |
| void purple_status_type_set_primary_attr(PurpleStatusType *status_type, | | void purple_status_type_set_primary_attr(PurpleStatusType *status_type, | |
| c
onst char *attr_id); | | c
onst char *attr_id); | |
|
| | | #endif | |
| | | | |
|
| | | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_STATUS_C_) | |
| /** | | /** | |
| * Adds an attribute to a status type. | | * Adds an attribute to a status type. | |
| * | | * | |
| * @param status_type The status type to add the attribute to. | | * @param status_type The status type to add the attribute to. | |
| * @param id The ID of the attribute. | | * @param id The ID of the attribute. | |
| * @param name The name presented to the user. | | * @param name The name presented to the user. | |
| * @param value The value type of this attribute. | | * @param value The value type of this attribute. | |
|
| | | * | |
| | | * @deprecated This function isn't needed and should be removed in 3.0.0. | |
| | | * Status type attributes should be set when the status type | |
| | | * is created, in the call to purple_status_type_new_with_attrs | |
| | | . | |
| */ | | */ | |
| void purple_status_type_add_attr(PurpleStatusType *status_type, const char
*id, | | void purple_status_type_add_attr(PurpleStatusType *status_type, const char
*id, | |
| const char *name,
PurpleValue *value); | | const char *name,
PurpleValue *value); | |
|
| | | #endif | |
| | | | |
|
| | | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_STATUS_C_) | |
| /** | | /** | |
| * Adds multiple attributes to a status type. | | * Adds multiple attributes to a status type. | |
| * | | * | |
| * @param status_type The status type to add the attribute to. | | * @param status_type The status type to add the attribute to. | |
| * @param id The ID of the first attribute. | | * @param id The ID of the first attribute. | |
| * @param name The description of the first attribute. | | * @param name The description of the first attribute. | |
| * @param value The value type of the first attribute attribute. | | * @param value The value type of the first attribute attribute. | |
| * @param ... Additional attribute information. | | * @param ... Additional attribute information. | |
|
| | | * | |
| | | * @deprecated This function isn't needed and should be removed in 3.0.0. | |
| | | * Status type attributes should be set when the status type | |
| | | * is created, in the call to purple_status_type_new_with_attrs | |
| | | . | |
| */ | | */ | |
| void purple_status_type_add_attrs(PurpleStatusType *status_type, const char
*id, | | void purple_status_type_add_attrs(PurpleStatusType *status_type, const char
*id, | |
| const char *
name, PurpleValue *value, ...) G_GNUC_NULL_TERMINATED; | | const char *
name, PurpleValue *value, ...) G_GNUC_NULL_TERMINATED; | |
|
| | | #endif | |
| | | | |
|
| | | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_STATUS_C_) | |
| /** | | /** | |
| * Adds multiple attributes to a status type using a va_list. | | * Adds multiple attributes to a status type using a va_list. | |
| * | | * | |
| * @param status_type The status type to add the attribute to. | | * @param status_type The status type to add the attribute to. | |
| * @param args The va_list of attributes. | | * @param args The va_list of attributes. | |
|
| | | * | |
| | | * @deprecated This function isn't needed and should be removed in 3.0.0. | |
| | | * Status type attributes should be set when the status type | |
| | | * is created, in the call to purple_status_type_new_with_attrs | |
| | | . | |
| */ | | */ | |
| void purple_status_type_add_attrs_vargs(PurpleStatusType *status_type, | | void purple_status_type_add_attrs_vargs(PurpleStatusType *status_type, | |
| va
_list args); | | va
_list args); | |
|
| | | #endif | |
| | | | |
| /** | | /** | |
| * Returns the primitive type of a status type. | | * Returns the primitive type of a status type. | |
| * | | * | |
| * @param status_type The status type. | | * @param status_type The status type. | |
| * | | * | |
| * @return The primitive type of the status type. | | * @return The primitive type of the status type. | |
| */ | | */ | |
| PurpleStatusPrimitive purple_status_type_get_primitive( | | PurpleStatusPrimitive purple_status_type_get_primitive( | |
| const PurpleStatusType *status_type); | | const PurpleStatusType *status_type); | |
| | | | |
| skipping to change at line 381 | | skipping to change at line 403 | |
| * Returns whether or not a status type is available. | | * Returns whether or not a status type is available. | |
| * | | * | |
| * Available status types are online and possibly invisible, but not away. | | * Available status types are online and possibly invisible, but not away. | |
| * | | * | |
| * @param status_type The status type. | | * @param status_type The status type. | |
| * | | * | |
| * @return TRUE if the status is available, or FALSE otherwise. | | * @return TRUE if the status is available, or FALSE otherwise. | |
| */ | | */ | |
| gboolean purple_status_type_is_available(const PurpleStatusType *status_typ
e); | | gboolean purple_status_type_is_available(const PurpleStatusType *status_typ
e); | |
| | | | |
|
| | | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_STATUS_C_) | |
| /** | | /** | |
| * Returns a status type's primary attribute ID. | | * Returns a status type's primary attribute ID. | |
| * | | * | |
| * @param type The status type. | | * @param type The status type. | |
| * | | * | |
| * @return The primary attribute's ID. | | * @return The primary attribute's ID. | |
|
| | | * | |
| | | * @deprecated This function isn't used and should be removed in 3.0.0. | |
| */ | | */ | |
| const char *purple_status_type_get_primary_attr(const PurpleStatusType *typ
e); | | const char *purple_status_type_get_primary_attr(const PurpleStatusType *typ
e); | |
|
| | | #endif | |
| | | | |
| /** | | /** | |
| * Returns the attribute with the specified ID. | | * Returns the attribute with the specified ID. | |
| * | | * | |
| * @param status_type The status type containing the attribute. | | * @param status_type The status type containing the attribute. | |
| * @param id The ID of the desired attribute. | | * @param id The ID of the desired attribute. | |
| * | | * | |
| * @return The attribute, if found. NULL otherwise. | | * @return The attribute, if found. NULL otherwise. | |
| */ | | */ | |
| PurpleStatusAttr *purple_status_type_get_attr(const PurpleStatusType *statu
s_type, | | PurpleStatusAttr *purple_status_type_get_attr(const PurpleStatusType *statu
s_type, | |
| | | | |
| skipping to change at line 540 | | skipping to change at line 566 | |
| * @param status The status. | | * @param status The status. | |
| * @param active The active state. | | * @param active The active state. | |
| * @param attrs A list of attributes to set on the status. This list is | | * @param attrs A list of attributes to set on the status. This list is | |
| * composed of key/value pairs, where each key is a valid | | * composed of key/value pairs, where each key is a valid | |
| * attribute name for this PurpleStatusType. The list is | | * attribute name for this PurpleStatusType. The list is | |
| * not modified or freed by this function. | | * not modified or freed by this function. | |
| */ | | */ | |
| void purple_status_set_active_with_attrs_list(PurpleStatus *status, gboolea
n active, | | void purple_status_set_active_with_attrs_list(PurpleStatus *status, gboolea
n active, | |
|
GList *attrs); | |
GList *attrs); | |
| | | | |
|
| | | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_STATUS_C_) | |
| /** | | /** | |
| * Sets the boolean value of an attribute in a status with the specified ID
. | | * Sets the boolean value of an attribute in a status with the specified ID
. | |
| * | | * | |
| * @param status The status. | | * @param status The status. | |
| * @param id The attribute ID. | | * @param id The attribute ID. | |
| * @param value The boolean value. | | * @param value The boolean value. | |
|
| | | * | |
| | | * @deprecated This function is only used by status.c and should be made | |
| | | * static in 3.0.0. | |
| */ | | */ | |
| void purple_status_set_attr_boolean(PurpleStatus *status, const char *id, | | void purple_status_set_attr_boolean(PurpleStatus *status, const char *id, | |
| gboolean v
alue); | | gboolean v
alue); | |
|
| | | #endif | |
| | | | |
|
| | | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_STATUS_C_) | |
| /** | | /** | |
| * Sets the integer value of an attribute in a status with the specified ID
. | | * Sets the integer value of an attribute in a status with the specified ID
. | |
| * | | * | |
| * @param status The status. | | * @param status The status. | |
| * @param id The attribute ID. | | * @param id The attribute ID. | |
| * @param value The integer value. | | * @param value The integer value. | |
|
| | | * | |
| | | * @deprecated This function is only used by status.c and should be made | |
| | | * static in 3.0.0. | |
| */ | | */ | |
| void purple_status_set_attr_int(PurpleStatus *status, const char *id, | | void purple_status_set_attr_int(PurpleStatus *status, const char *id, | |
| int value); | | int value); | |
|
| | | #endif | |
| | | | |
|
| | | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_STATUS_C_) | |
| /** | | /** | |
| * Sets the string value of an attribute in a status with the specified ID. | | * Sets the string value of an attribute in a status with the specified ID. | |
| * | | * | |
| * @param status The status. | | * @param status The status. | |
| * @param id The attribute ID. | | * @param id The attribute ID. | |
| * @param value The string value. | | * @param value The string value. | |
|
| | | * | |
| | | * @deprecated This function is only used by status.c and should be made | |
| | | * static in 3.0.0. | |
| */ | | */ | |
| void purple_status_set_attr_string(PurpleStatus *status, const char *id, | | void purple_status_set_attr_string(PurpleStatus *status, const char *id, | |
| const char
*value); | | const char
*value); | |
|
| | | #endif | |
| | | | |
| /** | | /** | |
| * Returns the status's type. | | * Returns the status's type. | |
| * | | * | |
| * @param status The status. | | * @param status The status. | |
| * | | * | |
| * @return The status's type. | | * @return The status's type. | |
| */ | | */ | |
| PurpleStatusType *purple_status_get_type(const PurpleStatus *status); | | PurpleStatusType *purple_status_get_type(const PurpleStatus *status); | |
| | | | |
| | | | |
| skipping to change at line 776 | | skipping to change at line 817 | |
| /** | | /** | |
| * Destroys a presence. | | * Destroys a presence. | |
| * | | * | |
| * All statuses added to this list will be destroyed along with | | * All statuses added to this list will be destroyed along with | |
| * the presence. | | * the presence. | |
| * | | * | |
| * @param presence The presence to destroy. | | * @param presence The presence to destroy. | |
| */ | | */ | |
| void purple_presence_destroy(PurplePresence *presence); | | void purple_presence_destroy(PurplePresence *presence); | |
| | | | |
|
| | | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_STATUS_C_) | |
| /** | | /** | |
| * Adds a status to a presence. | | * Adds a status to a presence. | |
| * | | * | |
| * @param presence The presence. | | * @param presence The presence. | |
| * @param status The status to add. | | * @param status The status to add. | |
|
| | | * | |
| | | * @deprecated This function is only used by purple_presence_add_list, | |
| | | * and both should be removed in 3.0.0. | |
| */ | | */ | |
| void purple_presence_add_status(PurplePresence *presence, PurpleStatus *sta
tus); | | void purple_presence_add_status(PurplePresence *presence, PurpleStatus *sta
tus); | |
|
| | | #endif | |
| | | | |
|
| | | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_STATUS_C_) | |
| /** | | /** | |
| * Adds a list of statuses to the presence. | | * Adds a list of statuses to the presence. | |
| * | | * | |
| * @param presence The presence. | | * @param presence The presence. | |
| * @param source_list The source list of statuses to add, which is not | | * @param source_list The source list of statuses to add, which is not | |
| * modified or freed by this function. | | * modified or freed by this function. | |
|
| | | * | |
| | | * @deprecated This function isn't used and should be removed in 3.0.0. | |
| */ | | */ | |
| void purple_presence_add_list(PurplePresence *presence, GList *source_list)
; | | void purple_presence_add_list(PurplePresence *presence, GList *source_list)
; | |
|
| | | #endif | |
| | | | |
| /** | | /** | |
| * Sets the active state of a status in a presence. | | * Sets the active state of a status in a presence. | |
| * | | * | |
| * Only independent statuses can be set unactive. Normal statuses can only | | * Only independent statuses can be set unactive. Normal statuses can only | |
| * be set active, so if you wish to disable a status, set another | | * be set active, so if you wish to disable a status, set another | |
| * non-independent status to active, or use purple_presence_switch_status()
. | | * non-independent status to active, or use purple_presence_switch_status()
. | |
| * | | * | |
| * @param presence The presence. | | * @param presence The presence. | |
| * @param status_id The ID of the status. | | * @param status_id The ID of the status. | |
| | | | |
End of changes. 38 change blocks. |
| 10 lines changed or deleted | | 63 lines changed or added | |
|
| util.h | | util.h | |
| | | | |
| skipping to change at line 34 | | skipping to change at line 34 | |
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-130
1 USA | | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-130
1 USA | |
| * | | * | |
| * @todo Rename the functions so that they live somewhere in the purple | | * @todo Rename the functions so that they live somewhere in the purple | |
| * namespace. | | * namespace. | |
| */ | | */ | |
| #ifndef _PURPLE_UTIL_H_ | | #ifndef _PURPLE_UTIL_H_ | |
| #define _PURPLE_UTIL_H_ | | #define _PURPLE_UTIL_H_ | |
| | | | |
| #include <stdio.h> | | #include <stdio.h> | |
| | | | |
|
| | | typedef struct _PurpleUtilFetchUrlData PurpleUtilFetchUrlData; | |
| | | typedef struct _PurpleMenuAction PurpleMenuAction; | |
| | | typedef struct _PurpleKeyValuePair PurpleKeyValuePair; | |
| | | | |
| #include "account.h" | | #include "account.h" | |
| #include "xmlnode.h" | | #include "xmlnode.h" | |
| #include "notify.h" | | #include "notify.h" | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
|
| typedef struct _PurpleUtilFetchUrlData PurpleUtilFetchUrlData; | | struct _PurpleMenuAction | |
| | | | |
| typedef struct _PurpleMenuAction | | | |
| { | | { | |
| char *label; | | char *label; | |
| PurpleCallback callback; | | PurpleCallback callback; | |
| gpointer data; | | gpointer data; | |
| GList *children; | | GList *children; | |
|
| } PurpleMenuAction; | | }; | |
| | | | |
| typedef char *(*PurpleInfoFieldFormatCallback)(const char *field, size_t le
n); | | typedef char *(*PurpleInfoFieldFormatCallback)(const char *field, size_t le
n); | |
| | | | |
| /** | | /** | |
| * A key-value pair. | | * A key-value pair. | |
| * | | * | |
| * This is used by, among other things, purple_gtk_combo* functions to pass
in a | | * This is used by, among other things, purple_gtk_combo* functions to pass
in a | |
| * list of key-value pairs so it can display a user-friendly value. | | * list of key-value pairs so it can display a user-friendly value. | |
| */ | | */ | |
|
| typedef struct _PurpleKeyValuePair | | struct _PurpleKeyValuePair | |
| { | | { | |
| gchar *key; | | gchar *key; | |
| void *value; | | void *value; | |
| | | | |
|
| } PurpleKeyValuePair; | | }; | |
| | | | |
| /** | | /** | |
| * Creates a new PurpleMenuAction. | | * Creates a new PurpleMenuAction. | |
| * | | * | |
| * @param label The text label to display for this action. | | * @param label The text label to display for this action. | |
| * @param callback The function to be called when the action is used on | | * @param callback The function to be called when the action is used on | |
| * the selected item. | | * the selected item. | |
| * @param data Additional data to be passed to the callback. | | * @param data Additional data to be passed to the callback. | |
| * @param children A GList of PurpleMenuActions to be added as a submenu | | * @param children A GList of PurpleMenuActions to be added as a submenu | |
| * of the action. | | * of the action. | |
| | | | |
| skipping to change at line 412 | | skipping to change at line 414 | |
| struct tm *tm, long *tz_off, const char **rest); | | struct tm *tm, long *tz_off, const char **rest); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /** @name Markup Functions *
/ | | /** @name Markup Functions *
/ | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** | | /** | |
|
| | | * Escapes special characters in a plain-text string so they display | |
| | | * correctly as HTML. For example, & is replaced with & and < is | |
| | | * replaced with < | |
| | | * | |
| | | * This is exactly the same as g_markup_escape_text(), except that it | |
| | | * does not change ' to ' because ' is not a valid HTML 4 entity, | |
| | | * and is displayed literally in IE7. | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | gchar *purple_markup_escape_text(const gchar *text, gssize length); | |
| | | | |
| | | /** | |
| * Finds an HTML tag matching the given name. | | * Finds an HTML tag matching the given name. | |
| * | | * | |
| * This locates an HTML tag's start and end, and stores its attributes | | * This locates an HTML tag's start and end, and stores its attributes | |
| * in a GData hash table. The names of the attributes are lower-cased | | * in a GData hash table. The names of the attributes are lower-cased | |
| * in the hash table, and the name of the tag is case insensitive. | | * in the hash table, and the name of the tag is case insensitive. | |
| * | | * | |
| * @param needle The name of the tag | | * @param needle The name of the tag | |
| * @param haystack The null-delimited string to search in | | * @param haystack The null-delimited string to search in | |
| * @param start A pointer to the start of the tag if found | | * @param start A pointer to the start of the tag if found | |
| * @param end A pointer to the end of the tag if found | | * @param end A pointer to the end of the tag if found | |
| | | | |
| skipping to change at line 493 | | skipping to change at line 508 | |
| * | | * | |
| * @param str The string to linkify. | | * @param str The string to linkify. | |
| * | | * | |
| * @return The new string with all URIs surrounded in standard | | * @return The new string with all URIs surrounded in standard | |
| * HTML <a href="whatever"></a> tags. You must g_free this | | * HTML <a href="whatever"></a> tags. You must g_free this | |
| * string when finished with it. | | * string when finished with it. | |
| */ | | */ | |
| char *purple_markup_linkify(const char *str); | | char *purple_markup_linkify(const char *str); | |
| | | | |
| /** | | /** | |
|
| * Unescapes HTML entities to their literal characters. | | * Unescapes HTML entities to their literal characters. Also translates | |
| | | * "<br>" to "\n". | |
| * For example "&" is replaced by '&' and so on. | | * For example "&" is replaced by '&' and so on. | |
| * Actually only "&", """, "<" and ">" are currently | | * Actually only "&", """, "<" and ">" are currently | |
| * supported. | | * supported. | |
| * | | * | |
| * @param html The string in which to unescape any HTML entities | | * @param html The string in which to unescape any HTML entities | |
| * | | * | |
| * @return The text with HTML entities literalized. You must g_free | | * @return The text with HTML entities literalized. You must g_free | |
| * this string when finished with it. | | * this string when finished with it. | |
| */ | | */ | |
| char *purple_unescape_html(const char *html); | | char *purple_unescape_html(const char *html); | |
| | | | |
| skipping to change at line 575 | | skipping to change at line 591 | |
| * On error or if the requested property was not found, the function return
s | | * On error or if the requested property was not found, the function return
s | |
| * @c NULL. | | * @c NULL. | |
| * | | * | |
| * @param style A string containing the inline CSS text. | | * @param style A string containing the inline CSS text. | |
| * @param opt The requested CSS property. | | * @param opt The requested CSS property. | |
| * | | * | |
| * @return The value of the requested CSS property. | | * @return The value of the requested CSS property. | |
| */ | | */ | |
| char * purple_markup_get_css_property(const gchar *style, const gchar *opt)
; | | char * purple_markup_get_css_property(const gchar *style, const gchar *opt)
; | |
| | | | |
|
| | | /** | |
| | | * Check if the given HTML contains RTL text. | |
| | | * | |
| | | * @param html The HTML text. | |
| | | * | |
| | | * @return TRUE if the text contains RTL text, FALSE otherwise. | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | gboolean purple_markup_is_rtl(const char *html); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /** @name Path/Filename Functions *
/ | | /** @name Path/Filename Functions *
/ | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** | | /** | |
| * Returns the user's home directory. | | * Returns the user's home directory. | |
| * | | * | |
| | | | |
| skipping to change at line 771 | | skipping to change at line 798 | |
| char *purple_fd_get_ip(int fd); | | char *purple_fd_get_ip(int fd); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /** @name String Functions *
/ | | /** @name String Functions *
/ | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** | | /** | |
|
| | | * Tests two strings for equality. | |
| | | * | |
| | | * Unlike strcmp(), this function will not crash if one or both of the | |
| | | * strings are @c NULL. | |
| | | * | |
| | | * @param left A string | |
| | | * @param right A string to compare with left | |
| | | * | |
| | | * @return @c TRUE if the strings are the same, else @c FALSE. | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | gboolean purple_strequal(const gchar *left, const gchar *right); | |
| | | | |
| | | /** | |
| * Normalizes a string, so that it is suitable for comparison. | | * Normalizes a string, so that it is suitable for comparison. | |
| * | | * | |
| * The returned string will point to a static buffer, so if the | | * The returned string will point to a static buffer, so if the | |
| * string is intended to be kept long-term, you <i>must</i> | | * string is intended to be kept long-term, you <i>must</i> | |
| * g_strdup() it. Also, calling normalize() twice in the same line | | * g_strdup() it. Also, calling normalize() twice in the same line | |
| * will lead to problems. | | * will lead to problems. | |
| * | | * | |
| * @param account The account the string belongs to, or NULL if you do | | * @param account The account the string belongs to, or NULL if you do | |
| * not know the account. If you use NULL, the string | | * not know the account. If you use NULL, the string | |
| * will still be normalized, but if the PRPL uses a | | * will still be normalized, but if the PRPL uses a | |
| | | | |
| skipping to change at line 1077 | | skipping to change at line 1119 | |
| * partial URL. | | * partial URL. | |
| * @param user_agent The user agent field to use, or NULL. | | * @param user_agent The user agent field to use, or NULL. | |
| * @param http11 TRUE if HTTP/1.1 should be used to download the file. | | * @param http11 TRUE if HTTP/1.1 should be used to download the file. | |
| * @param request A HTTP request to send to the server instead of the | | * @param request A HTTP request to send to the server instead of the | |
| * standard GET | | * standard GET | |
| * @param include_headers | | * @param include_headers | |
| * If TRUE, include the HTTP headers in the response. | | * If TRUE, include the HTTP headers in the response. | |
| * @param max_len The maximum number of bytes to retrieve (-1 for unlimi
ted) | | * @param max_len The maximum number of bytes to retrieve (-1 for unlimi
ted) | |
| * @param callback The callback function. | | * @param callback The callback function. | |
| * @param data The user data to pass to the callback function. | | * @param data The user data to pass to the callback function. | |
|
| * @deprecated In 3.0.0, we'll rename this to "purple_util_fetch_url_
request" and get rid of the old one | | * @deprecated In 3.0.0, this will go away. | |
| */ | | */ | |
| PurpleUtilFetchUrlData *purple_util_fetch_url_request_len(const gchar *url, | | PurpleUtilFetchUrlData *purple_util_fetch_url_request_len(const gchar *url, | |
| gboolean full, const gchar *user_agent, gboolean http11, | | gboolean full, const gchar *user_agent, gboolean http11, | |
| const gchar *request, gboolean include_headers, gssize max_l
en, | | const gchar *request, gboolean include_headers, gssize max_l
en, | |
| PurpleUtilFetchUrlCallback callback, gpointer data); | | PurpleUtilFetchUrlCallback callback, gpointer data); | |
| | | | |
| /** | | /** | |
|
| | | * Fetches the data from a URL, and passes it to a callback function. | |
| | | * | |
| | | * @param account The account for which the request is needed, or NULL. | |
| | | * @param url The URL. | |
| | | * @param full TRUE if this is the full URL, or FALSE if it's a | |
| | | * partial URL. | |
| | | * @param user_agent The user agent field to use, or NULL. | |
| | | * @param http11 TRUE if HTTP/1.1 should be used to download the file. | |
| | | * @param request A HTTP request to send to the server instead of the | |
| | | * standard GET | |
| | | * @param include_headers | |
| | | * If TRUE, include the HTTP headers in the response. | |
| | | * @param max_len The maximum number of bytes to retrieve (-1 for unlimi | |
| | | ted) | |
| | | * @param callback The callback function. | |
| | | * @param data The user data to pass to the callback function. | |
| | | * @deprecated In 3.0.0, we'll rename this to "purple_util_fetch_url_ | |
| | | request" and get rid of the old one | |
| | | */ | |
| | | PurpleUtilFetchUrlData *purple_util_fetch_url_request_len_with_account( | |
| | | PurpleAccount *account, const gchar *url, | |
| | | gboolean full, const gchar *user_agent, gboolean http11, | |
| | | const gchar *request, gboolean include_headers, gssize max_l | |
| | | en, | |
| | | PurpleUtilFetchUrlCallback callback, gpointer data); | |
| | | | |
| | | /** | |
| * Cancel a pending URL request started with either | | * Cancel a pending URL request started with either | |
| * purple_util_fetch_url_request() or purple_util_fetch_url(). | | * purple_util_fetch_url_request() or purple_util_fetch_url(). | |
| * | | * | |
| * @param url_data The data returned when you initiated the URL fetch. | | * @param url_data The data returned when you initiated the URL fetch. | |
| */ | | */ | |
| void purple_util_fetch_url_cancel(PurpleUtilFetchUrlData *url_data); | | void purple_util_fetch_url_cancel(PurpleUtilFetchUrlData *url_data); | |
| | | | |
| /** | | /** | |
| * Decodes a URL into a plain string. | | * Decodes a URL into a plain string. | |
| * | | * | |
| | | | |
| skipping to change at line 1129 | | skipping to change at line 1195 | |
| * @return True if the email address is syntactically correct. | | * @return True if the email address is syntactically correct. | |
| */ | | */ | |
| gboolean purple_email_is_valid(const char *address); | | gboolean purple_email_is_valid(const char *address); | |
| | | | |
| /** | | /** | |
| * Checks if the given IP address is a syntactically valid IPv4 address. | | * Checks if the given IP address is a syntactically valid IPv4 address. | |
| * | | * | |
| * @param ip The IP address to validate. | | * @param ip The IP address to validate. | |
| * | | * | |
| * @return True if the IP address is syntactically correct. | | * @return True if the IP address is syntactically correct. | |
|
| | | * @deprecated This function will be replaced with one that validates | |
| | | * as either IPv4 or IPv6 in 3.0.0. If you don't want this, | |
| | | * behavior, use one of the more specific functions. | |
| */ | | */ | |
| gboolean purple_ip_address_is_valid(const char *ip); | | gboolean purple_ip_address_is_valid(const char *ip); | |
| | | | |
| /** | | /** | |
|
| | | * Checks if the given IP address is a syntactically valid IPv4 address. | |
| | | * | |
| | | * @param ip The IP address to validate. | |
| | | * | |
| | | * @return True if the IP address is syntactically correct. | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | gboolean purple_ipv4_address_is_valid(const char *ip); | |
| | | | |
| | | /** | |
| | | * Checks if the given IP address is a syntactically valid IPv6 address. | |
| | | * | |
| | | * @param ip The IP address to validate. | |
| | | * | |
| | | * @return True if the IP address is syntactically correct. | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | gboolean purple_ipv6_address_is_valid(const char *ip); | |
| | | | |
| | | /** | |
| * This function extracts a list of URIs from the a "text/uri-list" | | * This function extracts a list of URIs from the a "text/uri-list" | |
| * string. It was "borrowed" from gnome_uri_list_extract_uris | | * string. It was "borrowed" from gnome_uri_list_extract_uris | |
| * | | * | |
| * @param uri_list An uri-list in the standard format. | | * @param uri_list An uri-list in the standard format. | |
| * | | * | |
| * @return A GList containing strings allocated with g_malloc | | * @return A GList containing strings allocated with g_malloc | |
| * that have been splitted from uri-list. | | * that have been splitted from uri-list. | |
| */ | | */ | |
| GList *purple_uri_list_extract_uris(const gchar *uri_list); | | GList *purple_uri_list_extract_uris(const gchar *uri_list); | |
| | | | |
| | | | |
| skipping to change at line 1187 | | skipping to change at line 1276 | |
| * invalid characters with a filler character (currently hardcoded to | | * invalid characters with a filler character (currently hardcoded to | |
| * '?'). | | * '?'). | |
| * | | * | |
| * @param str The source string. | | * @param str The source string. | |
| * | | * | |
| * @return A valid UTF-8 string. | | * @return A valid UTF-8 string. | |
| */ | | */ | |
| gchar *purple_utf8_salvage(const char *str); | | gchar *purple_utf8_salvage(const char *str); | |
| | | | |
| /** | | /** | |
|
| | | * Removes unprintable characters from a UTF-8 string. These characters | |
| | | * (in particular low-ASCII characters) are invalid in XML 1.0 and thus | |
| | | * are not allowed in XMPP and are rejected by libxml2 by default. This | |
| | | * function uses g_unichar_isprint to determine what characters should | |
| | | * be stripped. The returned string must be freed by the caller. | |
| | | * | |
| | | * @param str A valid UTF-8 string. | |
| | | * | |
| | | * @return A newly allocated UTF-8 string without the unprintable character | |
| | | s. | |
| | | * @since 2.6.0 | |
| | | * | |
| | | * @see g_unichar_isprint | |
| | | */ | |
| | | gchar *purple_utf8_strip_unprintables(const gchar *str); | |
| | | | |
| | | /** | |
| * Return the UTF-8 version of gai_strerror(). It calls gai_strerror() | | * Return the UTF-8 version of gai_strerror(). It calls gai_strerror() | |
| * then converts the result to UTF-8. This function is analogous to | | * then converts the result to UTF-8. This function is analogous to | |
| * g_strerror(). | | * g_strerror(). | |
| * | | * | |
| * @param errnum The error code. | | * @param errnum The error code. | |
| * | | * | |
| * @return The UTF-8 error message. | | * @return The UTF-8 error message. | |
| * @since 2.4.0 | | * @since 2.4.0 | |
| */ | | */ | |
| G_CONST_RETURN gchar *purple_gai_strerror(gint errnum); | | G_CONST_RETURN gchar *purple_gai_strerror(gint errnum); | |
| | | | |
End of changes. 14 change blocks. |
| 8 lines changed or deleted | | 117 lines changed or added | |
|
| xmlnode.h | | xmlnode.h | |
| | | | |
| skipping to change at line 29 | | skipping to change at line 29 | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| * GNU General Public License for more details. | | * GNU General Public License for more details. | |
| * | | * | |
| * You should have received a copy of the GNU General Public License | | * You should have received a copy of the GNU General Public License | |
| * along with this program; if not, write to the Free Software | | * along with this program; if not, write to the Free Software | |
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-130
1 USA | | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-130
1 USA | |
| */ | | */ | |
| #ifndef _PURPLE_XMLNODE_H_ | | #ifndef _PURPLE_XMLNODE_H_ | |
| #define _PURPLE_XMLNODE_H_ | | #define _PURPLE_XMLNODE_H_ | |
| | | | |
|
| | | #include <glib.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * The valid types for an xmlnode | | * The valid types for an xmlnode | |
| */ | | */ | |
| typedef enum _XMLNodeType | | typedef enum _XMLNodeType | |
| { | | { | |
| XMLNODE_TYPE_TAG, /**< Just a tag */ | | XMLNODE_TYPE_TAG, /**< Just a tag */ | |
| | | | |
| skipping to change at line 54 | | skipping to change at line 56 | |
| * An xmlnode. | | * An xmlnode. | |
| */ | | */ | |
| typedef struct _xmlnode xmlnode; | | typedef struct _xmlnode xmlnode; | |
| struct _xmlnode | | struct _xmlnode | |
| { | | { | |
| char *name; /**< The name of the node. */ | | char *name; /**< The name of the node. */ | |
| char *xmlns; /**< The namespace of the node */ | | char *xmlns; /**< The namespace of the node */ | |
| XMLNodeType type; /**< The type of the node. */ | | XMLNodeType type; /**< The type of the node. */ | |
| char *data; /**< The data for the node. */ | | char *data; /**< The data for the node. */ | |
| size_t data_sz; /**< The size of the data. */ | | size_t data_sz; /**< The size of the data. */ | |
|
| struct _xmlnode *parent; /**< The parent node or @c NULL.*/ | | xmlnode *parent; /**< The parent node or @c NULL.*/ | |
| struct _xmlnode *child; /**< The child node or @c NULL.*/ | | xmlnode *child; /**< The child node or @c NULL.*/ | |
| struct _xmlnode *lastchild; /**< The last child node or @c NULL. | | xmlnode *lastchild; /**< The last child node or @c NULL.*/ | |
| */ | | xmlnode *next; /**< The next node or @c NULL. */ | |
| struct _xmlnode *next; /**< The next node or @c NULL. */ | | | |
| char *prefix; /**< The namespace prefix if any. */ | | char *prefix; /**< The namespace prefix if any. */ | |
| GHashTable *namespace_map; /**< The namespace map. */ | | GHashTable *namespace_map; /**< The namespace map. */ | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * Creates a new xmlnode. | | * Creates a new xmlnode. | |
| * | | * | |
| * @param name The name of the node. | | * @param name The name of the node. | |
| * | | * | |
| * @return The new node. | | * @return The new node. | |
| | | | |
| skipping to change at line 137 | | skipping to change at line 139 | |
| void xmlnode_insert_data(xmlnode *node, const char *data, gssize size); | | void xmlnode_insert_data(xmlnode *node, const char *data, gssize size); | |
| | | | |
| /** | | /** | |
| * Gets (escaped) data from a node. | | * Gets (escaped) data from a node. | |
| * | | * | |
| * @param node The node to get data from. | | * @param node The node to get data from. | |
| * | | * | |
| * @return The data from the node or NULL. This data is in raw escaped form
at. | | * @return The data from the node or NULL. This data is in raw escaped form
at. | |
| * You must g_free this string when finished using it. | | * You must g_free this string when finished using it. | |
| */ | | */ | |
|
| char *xmlnode_get_data(xmlnode *node); | | char *xmlnode_get_data(const xmlnode *node); | |
| | | | |
| /** | | /** | |
| * Gets unescaped data from a node. | | * Gets unescaped data from a node. | |
| * | | * | |
| * @param node The node to get data from. | | * @param node The node to get data from. | |
| * | | * | |
| * @return The data from the node, in unescaped form. You must g_free | | * @return The data from the node, in unescaped form. You must g_free | |
| * this string when finished using it. | | * this string when finished using it. | |
| */ | | */ | |
|
| char *xmlnode_get_data_unescaped(xmlnode *node); | | char *xmlnode_get_data_unescaped(const xmlnode *node); | |
| | | | |
| /** | | /** | |
| * Sets an attribute for a node. | | * Sets an attribute for a node. | |
| * | | * | |
| * @param node The node to set an attribute for. | | * @param node The node to set an attribute for. | |
| * @param attr The name of the attribute. | | * @param attr The name of the attribute. | |
| * @param value The value of the attribute. | | * @param value The value of the attribute. | |
| */ | | */ | |
| void xmlnode_set_attrib(xmlnode *node, const char *attr, const char *value)
; | | void xmlnode_set_attrib(xmlnode *node, const char *attr, const char *value)
; | |
| | | | |
|
| | | #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_XMLNODE_C_) | |
| /** | | /** | |
| * Sets a prefixed attribute for a node | | * Sets a prefixed attribute for a node | |
| * | | * | |
| * @param node The node to set an attribute for. | | * @param node The node to set an attribute for. | |
| * @param attr The name of the attribute to set | | * @param attr The name of the attribute to set | |
| * @param prefix The prefix of the attribute to ste | | * @param prefix The prefix of the attribute to ste | |
| * @param value The value of the attribute | | * @param value The value of the attribute | |
|
| | | * | |
| | | * @deprecated Use xmlnode_set_attrib_full instead. | |
| */ | | */ | |
| void xmlnode_set_attrib_with_prefix(xmlnode *node, const char *attr, const
char *prefix, const char *value); | | void xmlnode_set_attrib_with_prefix(xmlnode *node, const char *attr, const
char *prefix, const char *value); | |
| | | | |
| /** | | /** | |
| * Sets a namespaced attribute for a node | | * Sets a namespaced attribute for a node | |
| * | | * | |
| * @param node The node to set an attribute for. | | * @param node The node to set an attribute for. | |
| * @param attr The name of the attribute to set | | * @param attr The name of the attribute to set | |
| * @param xmlns The namespace of the attribute to ste | | * @param xmlns The namespace of the attribute to ste | |
| * @param value The value of the attribute | | * @param value The value of the attribute | |
|
| | | * | |
| | | * @deprecated Use xmlnode_set_attrib_full instead. | |
| */ | | */ | |
| void xmlnode_set_attrib_with_namespace(xmlnode *node, const char *attr, con
st char *xmlns, const char *value); | | void xmlnode_set_attrib_with_namespace(xmlnode *node, const char *attr, con
st char *xmlns, const char *value); | |
|
| | | #endif /* PURPLE_DISABLE_DEPRECATED */ | |
| | | | |
| | | /** | |
| | | * Sets a namespaced attribute for a node | |
| | | * | |
| | | * @param node The node to set an attribute for. | |
| | | * @param attr The name of the attribute to set | |
| | | * @param xmlns The namespace of the attribute to ste | |
| | | * @param prefix The prefix of the attribute to ste | |
| | | * @param value The value of the attribute | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | void xmlnode_set_attrib_full(xmlnode *node, const char *attr, const char *x | |
| | | mlns, | |
| | | const char *prefix, const char *value); | |
| | | | |
| /** | | /** | |
| * Gets an attribute from a node. | | * Gets an attribute from a node. | |
| * | | * | |
| * @param node The node to get an attribute from. | | * @param node The node to get an attribute from. | |
| * @param attr The attribute to get. | | * @param attr The attribute to get. | |
| * | | * | |
| * @return The value of the attribute. | | * @return The value of the attribute. | |
| */ | | */ | |
| const char *xmlnode_get_attrib(xmlnode *node, const char *attr); | | const char *xmlnode_get_attrib(xmlnode *node, const char *attr); | |
| | | | |
| skipping to change at line 249 | | skipping to change at line 271 | |
| | | | |
| /** | | /** | |
| * Returns the prefix of a node | | * Returns the prefix of a node | |
| * | | * | |
| * @param node The node to get the prefix from | | * @param node The node to get the prefix from | |
| * @return The prefix of this node | | * @return The prefix of this node | |
| */ | | */ | |
| const char *xmlnode_get_prefix(const xmlnode *node); | | const char *xmlnode_get_prefix(const xmlnode *node); | |
| | | | |
| /** | | /** | |
|
| | | * Gets the parent node. | |
| | | * | |
| | | * @param child The child node. | |
| | | * | |
| | | * @return The parent or NULL. | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | xmlnode *xmlnode_get_parent(const xmlnode *child); | |
| | | | |
| | | /** | |
| * Returns the node in a string of xml. | | * Returns the node in a string of xml. | |
| * | | * | |
| * @param node The starting node to output. | | * @param node The starting node to output. | |
| * @param len Address for the size of the string. | | * @param len Address for the size of the string. | |
| * | | * | |
| * @return The node represented as a string. You must | | * @return The node represented as a string. You must | |
| * g_free this string when finished using it. | | * g_free this string when finished using it. | |
| */ | | */ | |
| char *xmlnode_to_str(const xmlnode *node, int *len); | | char *xmlnode_to_str(const xmlnode *node, int *len); | |
| | | | |
| | | | |
| skipping to change at line 300 | | skipping to change at line 333 | |
| */ | | */ | |
| xmlnode *xmlnode_copy(const xmlnode *src); | | xmlnode *xmlnode_copy(const xmlnode *src); | |
| | | | |
| /** | | /** | |
| * Frees a node and all of its children. | | * Frees a node and all of its children. | |
| * | | * | |
| * @param node The node to free. | | * @param node The node to free. | |
| */ | | */ | |
| void xmlnode_free(xmlnode *node); | | void xmlnode_free(xmlnode *node); | |
| | | | |
|
| | | /** | |
| | | * Creates a node from a XML File. Calling this on the | |
| | | * root node of an XML document will parse the entire document | |
| | | * into a tree of nodes, and return the xmlnode of the root. | |
| | | * | |
| | | * @param dir The directory where the file is located | |
| | | * @param filename The filename | |
| | | * @param description A description of the file being parsed. Displayed to | |
| | | * the user if the file cannot be read. | |
| | | * @param process The subsystem that is calling xmlnode_from_file. Used as | |
| | | * the category for debugging. | |
| | | * | |
| | | * @return The new node or NULL if an error occurred. | |
| | | * | |
| | | * @since 2.6.0 | |
| | | */ | |
| | | xmlnode *xmlnode_from_file(const char *dir, const char *filename, | |
| | | const char *description, const char *process); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* _PURPLE_XMLNODE_H_ */ | | #endif /* _PURPLE_XMLNODE_H_ */ | |
| | | | |
End of changes. 10 change blocks. |
| 7 lines changed or deleted | | 59 lines changed or added | |
|