2 * @file gtkstatusbox.c GTK+ Status Selection Widget
8 * Pidgin is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
28 #ifndef __PIDGIN_STATUS_BOX_H__
29 #define __PIDGIN_STATUS_BOX_H__
32 #include "gtkimhtml.h"
35 #include "savedstatuses.h"
40 #define PIDGIN_TYPE_STATUS_BOX (pidgin_status_box_get_type ())
41 #define PIDGIN_STATUS_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PIDGIN_TYPE_STATUS_BOX, PidginStatusBox))
42 #define PIDGIN_STATUS_BOX_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), PIDGIN_TYPE_STATUS_BOX, PidginStatusBoxClass))
43 #define PIDGIN_IS_STATUS_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PIDGIN_TYPE_STATUS_BOX))
44 #define PIDGIN_IS_STATUS_BOX_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), PIDGIN_TYPE_STATUS_BOX))
45 #define PIDGIN_STATUS_BOX_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), PIDGIN_TYPE_STATUS_BOX, PidginStatusBoxClass))
48 * This is a hidden field in the GtkStatusBox that identifies the
49 * item in the list store. The item could be a normal
50 * PurpleStatusPrimitive, or it could be something special like the
51 * "Custom..." item, or "Saved..." or a GtkSeparator.
55 PIDGIN_STATUS_BOX_TYPE_SEPARATOR
,
56 PIDGIN_STATUS_BOX_TYPE_PRIMITIVE
,
57 PIDGIN_STATUS_BOX_TYPE_POPULAR
,
58 PIDGIN_STATUS_BOX_TYPE_SAVED_POPULAR
,
59 PIDGIN_STATUS_BOX_TYPE_CUSTOM
,
60 PIDGIN_STATUS_BOX_TYPE_SAVED
,
61 PIDGIN_STATUS_BOX_NUM_TYPES
62 } PidginStatusBoxItemType
;
64 typedef struct _PidginStatusBox PidginStatusBox
;
65 typedef struct _PidginStatusBoxClass PidginStatusBoxClass
;
67 struct _PidginStatusBox
69 GtkContainer parent_instance
;
72 * This GtkListStore contains only one row--the currently selected status.
77 * This is the dropdown GtkListStore that contains the available statuses,
78 * plus some recently used statuses, plus the "Custom..." and "Saved..."
81 GtkListStore
*dropdown_store
;
83 PurpleAccount
*account
;
85 /* This will be non-NULL and contain a sample account
86 * when all enabled accounts use the same statuses */
87 PurpleAccount
*token_status_account
;
92 PurpleStoredImage
*buddy_icon_img
;
93 GdkPixbuf
*buddy_icon
;
94 GdkPixbuf
*buddy_icon_hover
;
95 GtkWidget
*buddy_icon_sel
;
98 GtkWidget
*icon_box_menu
;
99 GdkCursor
*hand_cursor
;
100 GdkCursor
*arrow_cursor
;
102 gboolean icon_opaque
;
104 gboolean imhtml_visible
;
106 GtkWidget
*cell_view
;
107 GtkCellRenderer
*icon_rend
;
108 GtkCellRenderer
*text_rend
;
110 GdkPixbuf
*error_pixbuf
;
111 int connecting_index
;
112 GdkPixbuf
*connecting_pixbufs
[9];
114 GdkPixbuf
*typing_pixbufs
[6];
116 gboolean network_available
;
124 * These widgets are made for renderin'
125 * That's just what they'll do
126 * One of these days these widgets
127 * Are gonna render all over you
130 GtkWidget
*toggle_button
;
134 GtkWidget
*popup_window
;
135 GtkWidget
*popup_frame
;
136 GtkWidget
*scrolled_window
;
137 GtkWidget
*cell_view_frame
;
138 GtkTreeViewColumn
*column
;
139 GtkWidget
*tree_view
;
140 gboolean popup_in_progress
;
141 GtkTreeRowReference
*active_row
;
144 struct _PidginStatusBoxClass
146 GtkContainerClass parent_class
;
149 void (* changed
) (GtkComboBox
*combo_box
);
151 /* Padding for future expansion */
152 void (*_gtk_reserved0
) (void);
153 void (*_gtk_reserved1
) (void);
154 void (*_gtk_reserved2
) (void);
155 void (*_gtk_reserved3
) (void);
159 GType
pidgin_status_box_get_type (void) G_GNUC_CONST
;
160 GtkWidget
*pidgin_status_box_new (void);
161 GtkWidget
*pidgin_status_box_new_with_account (PurpleAccount
*);
164 pidgin_status_box_add(PidginStatusBox
*status_box
, PidginStatusBoxItemType type
, GdkPixbuf
*pixbuf
, const char *text
, const char *sec_text
, gpointer data
);
167 pidgin_status_box_add_separator(PidginStatusBox
*status_box
);
170 pidgin_status_box_set_network_available(PidginStatusBox
*status_box
, gboolean available
);
173 pidgin_status_box_set_connecting(PidginStatusBox
*status_box
, gboolean connecting
);
176 pidgin_status_box_pulse_connecting(PidginStatusBox
*status_box
);
179 pidgin_status_box_set_buddy_icon(PidginStatusBox
*status_box
, PurpleStoredImage
*img
);
181 char *pidgin_status_box_get_message(PidginStatusBox
*status_box
);
185 #endif /* __GTK_PIDGIN_STATUS_COMBO_BOX_H__ */