diff src/list.h @ 4695:4bdd9a5fd026

[gaim-migrate @ 5006] This may very well have issues, but it's a slightly better core/ui split, removing global variables and fixing some GTK+ runtime errors and a couple segfaults. It's some progress. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 10 Mar 2003 18:16:29 +0000
parents 0a35ec3585ef
children ac7ca2bd6d4f
line wrap: on
line diff
--- a/src/list.h	Mon Mar 10 16:39:46 2003 +0000
+++ b/src/list.h	Mon Mar 10 18:16:29 2003 +0000
@@ -37,8 +37,8 @@
 	GAIM_BLIST_OTHER_NODE,
 };
 
-#define GAIM_BLIST_NODE_IS_BUDDY(n) (n->type == GAIM_BLIST_BUDDY_NODE)
-#define GAIM_BLIST_NODE_IS_GROUP(n) (n->type == GAIM_BLIST_GROUP_NODE)
+#define GAIM_BLIST_NODE_IS_BUDDY(n) ((n)->type == GAIM_BLIST_BUDDY_NODE)
+#define GAIM_BLIST_NODE_IS_GROUP(n) ((n)->type == GAIM_BLIST_GROUP_NODE)
 
 /**************************************************************************/
 /* Data Structures                                                        */
@@ -93,6 +93,8 @@
 struct gaim_buddy_list {
 	GaimBlistNode *root;                    /**< The first node in the buddy list */
 	struct gaim_blist_ui_ops *ui_ops;       /**< The UI operations for the buddy list */
+
+	void *ui_data;                          /**< UI-specific data. */
 };
 
 /**
@@ -103,6 +105,8 @@
  */
 struct gaim_blist_ui_ops
 {
+	void (*new_list)(struct gaim_buddy_list *list); /**< Sets UI-specific data on a buddy list. */
+	void (*new_node)(GaimBlistNode *node);      /**< Sets UI-specific data on a node. */
 	void (*show)(struct gaim_buddy_list *list);     /**< The core will call this when its finished doing it's core stuff */
 	void (*update)(struct gaim_buddy_list *list, 
 		       GaimBlistNode *node);            /**< This will update a node in the buddy list. */
@@ -115,12 +119,6 @@
 }; 
 
 /**************************************************************************/
-/* Globals                                                                */
-/**************************************************************************/
-extern struct gaim_buddy_list *gaimbuddylist;      /**< A global for the core buddy list. */
-
-
-/**************************************************************************/
 /** @name Buddy List API                                                  */
 /**************************************************************************/
 /*@{*/
@@ -130,6 +128,19 @@
  */
 struct gaim_buddy_list *gaim_blist_new();
 
+/**
+ * Sets the main buddy list.
+ *
+ * @return The main buddy list.
+ */
+void gaim_set_blist(struct gaim_buddy_list *blist);
+
+/**
+ * Returns the main buddy list.
+ *
+ * @return The main buddy list.
+ */
+struct gaim_buddy_list *gaim_get_blist(void);
 
 /**
  * Shows the buddy list, creating a new one if necessary.
@@ -402,6 +413,13 @@
  */
 void gaim_set_blist_ui_ops(struct gaim_blist_ui_ops *ops);
 
+/**
+ * Returns the UI operations structure to be used for the buddy list.
+ *
+ * @return The UI operations structure.
+ */
+struct gaim_blist_ui_ops *gaim_get_blist_ui_ops(void);
+
 /*@}*/
 
 #endif /* _LIST_H_ */