libpurple/roomlist.h

branch
soc.2013.gobjectification
changeset 34931
6ea8ce77ec34
parent 32787
7072f190d6ad
child 34942
e1783e620a85
child 36690
45425605f156
--- a/libpurple/roomlist.h	Fri Sep 06 18:19:42 2013 +0530
+++ b/libpurple/roomlist.h	Fri Sep 06 20:02:37 2013 +0530
@@ -27,9 +27,26 @@
 #ifndef _PURPLE_ROOMLIST_H_
 #define _PURPLE_ROOMLIST_H_
 
+#define PURPLE_TYPE_ROOMLIST             (purple_roomlist_get_type())
+#define PURPLE_ROOMLIST(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_ROOMLIST, PurpleRoomlist))
+#define PURPLE_ROOMLIST_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_ROOMLIST, PurpleRoomlistClass))
+#define PURPLE_IS_ROOMLIST(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_ROOMLIST))
+#define PURPLE_IS_ROOMLIST_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_ROOMLIST))
+#define PURPLE_ROOMLIST_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_ROOMLIST, PurpleRoomlistClass))
+
+/** @copydoc _PurpleRoomlist */
 typedef struct _PurpleRoomlist PurpleRoomlist;
+/** @copydoc _PurpleRoomlistClass */
+typedef struct _PurpleRoomlistClass PurpleRoomlistClass;
+
+#define PURPLE_TYPE_ROOMLIST_ROOM        (purple_roomlist_room_get_gtype())
+
 typedef struct _PurpleRoomlistRoom PurpleRoomlistRoom;
+
+#define PURPLE_TYPE_ROOMLIST_FIELD       (purple_roomlist_field_get_gtype())
+
 typedef struct _PurpleRoomlistField PurpleRoomlistField;
+
 /** @copydoc _PurpleRoomlistUiOps */
 typedef struct _PurpleRoomlistUiOps PurpleRoomlistUiOps;
 
@@ -38,7 +55,7 @@
  *
  * These are ORable flags.
  */
-typedef enum
+typedef enum /*< flags >*/
 {
 	PURPLE_ROOMLIST_ROOMTYPE_CATEGORY = 0x01, /**< It's a category, but not a room you can join. */
 	PURPLE_ROOMLIST_ROOMTYPE_ROOM = 0x02      /**< It's a room, like the kind you can join. */
@@ -80,6 +97,29 @@
 	void (*_purple_reserved4)(void);
 };
 
+/**
+ * Represents a list of rooms for a given connection on a given protocol.
+ */
+struct _PurpleRoomlist {
+	/*< private >*/
+	GObject gparent;
+
+	/** The UI data associated with this room list. This is a convenience
+	 *  field provided to the UIs -- it is not used by the libpurple core.
+	 */
+	gpointer ui_data;
+};
+
+/** Base class for all #PurpleRoomlist's */
+struct _PurpleRoomlistClass {
+	/*< private >*/
+	GObjectClass parent_class;
+
+	void (*_purple_reserved1)(void);
+	void (*_purple_reserved2)(void);
+	void (*_purple_reserved3)(void);
+	void (*_purple_reserved4)(void);
+};
 
 G_BEGIN_DECLS
 
@@ -89,6 +129,11 @@
 /*@{*/
 
 /**
+ * Returns the GType for the Room List object.
+ */
+GType purple_roomlist_get_type(void);
+
+/**
  * This is used to get the room list on an account, asking the UI
  * to pop up a dialog with the specified account already selected,
  * and pretend the user clicked the get list button.
@@ -102,31 +147,12 @@
 /**
  * Returns a newly created room list object.
  *
- * It has an initial reference count of 1.
- *
  * @param account The account that's listing rooms.
  * @return The new room list handle.
  */
 PurpleRoomlist *purple_roomlist_new(PurpleAccount *account);
 
 /**
- * Increases the reference count on the room list.
- *
- * @param list The object to ref.
- */
-void purple_roomlist_ref(PurpleRoomlist *list);
-
-/**
- * Decreases the reference count on the room list.
- *
- * The room list will be destroyed when this reaches 0.
- *
- * @param list The room list object to unref and possibly
- *             destroy.
- */
-void purple_roomlist_unref(PurpleRoomlist *list);
-
-/**
  * Retrieve the PurpleAccount that was given when the room list was
  * created.
  *
@@ -264,6 +290,11 @@
 /*@{*/
 
 /**
+ * Returns the GType for the PurpleRoomlistRoom boxed structure.
+ */
+GType purple_roomlist_room_get_gtype(void);
+
+/**
  * Creates a new room, to be added to the list.
  *
  * @param type The type of room.
@@ -346,6 +377,11 @@
 /*@{*/
 
 /**
+ * Returns the GType for the PurpleRoomlistField boxed structure.
+ */
+GType purple_roomlist_field_get_gtype(void);
+
+/**
  * Creates a new field.
  *
  * @param type   The type of the field.

mercurial