Mercurial > pidgin.yaz
diff src/gtkstatusbox.h @ 11739:a25be0e70a67
[gaim-migrate @ 14030]
I changed the GtkStatusBox list stores to use an enum instead of a string
to identify the items in the GtkStatusBox. This feels a lot cleaner to me
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sun, 23 Oct 2005 06:46:07 +0000 |
parents | 992d49cf2b92 |
children | 082a2a9aa998 |
line wrap: on
line diff
--- a/src/gtkstatusbox.h Sun Oct 23 04:48:01 2005 +0000 +++ b/src/gtkstatusbox.h Sun Oct 23 06:46:07 2005 +0000 @@ -31,6 +31,7 @@ #include "gtkimhtml.h" #include "account.h" #include "savedstatuses.h" +#include "status.h" #include <gtk/gtktreemodel.h> #include <gtk/gtktreeview.h> #if !GTK_CHECK_VERSION(2,6,0) @@ -51,6 +52,24 @@ #define GTK_GAIM_IS_STATUS_BOX_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), GTK_GAIM_TYPE_STATUS_BOX)) #define GTK_GAIM_STATUS_BOX_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), GTK_GAIM_TYPE_STATUS_BOX, GtkGaimStatusBoxClass)) +/** + * This is a hidden field in the GtkStatusBox that identifies the + * item in the list store. The item could be a normal + * GaimStatusPrimitive, or it could be something special like the + * "Custom..." item, or "Saved..." or a GtkSeparator. + */ +typedef enum +{ + /* + * The first 0 through GAIM_STATUS_NUM_PRIMITIVES + * correspond to GaimStatusPrimitives. + */ + GTK_GAIM_STATUS_BOX_TYPE_SEPARATOR = GAIM_STATUS_NUM_PRIMITIVES, + GTK_GAIM_STATUS_BOX_TYPE_CUSTOM, + GTK_GAIM_STATUS_BOX_TYPE_SAVED, + GTK_GAIM_STATUS_BOX_NUM_TYPES +} GtkGaimStatusBoxItemType; + typedef struct _GtkGaimStatusBox GtkGaimStatusBox; typedef struct _GtkGaimStatusBoxClass GtkGaimStatusBoxClass; @@ -58,7 +77,16 @@ { GtkComboBox parent_instance; + /** + * This GtkListStore contains only one row--the currently selected status. + */ GtkListStore *store; + + /** + * This is the dropdown GtkListStore that contains the available statuses, + * plus some recently used statuses, plus the "Custom..." and "Saved..." + * options. + */ GtkListStore *dropdown_store; GaimAccount *account; @@ -108,7 +136,7 @@ GtkWidget *gtk_gaim_status_box_new_with_account (GaimAccount *); void -gtk_gaim_status_box_add(GtkGaimStatusBox *status_box, GdkPixbuf *pixbuf, const char *text, const char *sec_text, const char *edit); +gtk_gaim_status_box_add(GtkGaimStatusBox *status_box, GtkGaimStatusBoxItemType type, GdkPixbuf *pixbuf, const char *text, const char *sec_text); void gtk_gaim_status_box_add_separator(GtkGaimStatusBox *status_box); @@ -122,7 +150,7 @@ void gtk_gaim_status_box_pulse_connecting(GtkGaimStatusBox *status_box); -char *gtk_gaim_status_box_get_active_type(GtkGaimStatusBox *status_box); +GtkGaimStatusBoxItemType gtk_gaim_status_box_get_active_type(GtkGaimStatusBox *status_box); char *gtk_gaim_status_box_get_message(GtkGaimStatusBox *status_box);