Fri, 27 Jun 2008 00:01:41 +0000
Make pidgin_blist_toggle_visibility() hide the buddy list when it is
partially obscured but has the focus. This ensures we do something
reasonable if the buddy list is obscured by an "always on top" window.
Fixes #5145.
| 10643 | 1 | /* |
| 2 | * @file gtkstatusbox.c GTK+ Status Selection Widget | |
|
16254
eeb2bba4dc94
Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@pidgin.im>
parents:
15931
diff
changeset
|
3 | * @ingroup pidgin |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | /* pidgin |
| 10643 | 7 | * |
| 15572 | 8 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 10643 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
| 11 | * | |
| 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. | |
| 16 | * | |
| 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. | |
| 21 | * | |
| 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 | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16538
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 10643 | 25 | */ |
| 26 | ||
| 27 | ||
| 15577 | 28 | #ifndef __PIDGIN_STATUS_BOX_H__ |
| 29 | #define __PIDGIN_STATUS_BOX_H__ | |
| 10643 | 30 | |
| 31 | #include <gtk/gtk.h> | |
| 32 | #include "gtkimhtml.h" | |
| 11499 | 33 | #include "account.h" |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16376
diff
changeset
|
34 | #include "imgstore.h" |
|
11677
89c2ab8d2ebf
[gaim-migrate @ 13963]
Mark Doliner <markdoliner@pidgin.im>
parents:
11638
diff
changeset
|
35 | #include "savedstatuses.h" |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
36 | #include "status.h" |
| 10643 | 37 | #include <gtk/gtktreemodel.h> |
| 38 | #include <gtk/gtktreeview.h> | |
| 39 | ||
| 40 | G_BEGIN_DECLS | |
| 41 | ||
| 15577 | 42 | #define PIDGIN_TYPE_STATUS_BOX (pidgin_status_box_get_type ()) |
| 43 | #define PIDGIN_STATUS_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PIDGIN_TYPE_STATUS_BOX, PidginStatusBox)) | |
| 44 | #define PIDGIN_STATUS_BOX_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), PIDGIN_TYPE_STATUS_BOX, PidginStatusBoxClass)) | |
| 45 | #define PIDGIN_IS_STATUS_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PIDGIN_TYPE_STATUS_BOX)) | |
| 46 | #define PIDGIN_IS_STATUS_BOX_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), PIDGIN_TYPE_STATUS_BOX)) | |
| 47 | #define PIDGIN_STATUS_BOX_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), PIDGIN_TYPE_STATUS_BOX, PidginStatusBoxClass)) | |
| 10643 | 48 | |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
49 | /** |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
50 | * This is a hidden field in the GtkStatusBox that identifies the |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
51 | * item in the list store. The item could be a normal |
| 15884 | 52 | * PurpleStatusPrimitive, or it could be something special like the |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
53 | * "Custom..." item, or "Saved..." or a GtkSeparator. |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
54 | */ |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
55 | typedef enum |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
56 | { |
| 15577 | 57 | PIDGIN_STATUS_BOX_TYPE_SEPARATOR, |
| 58 | PIDGIN_STATUS_BOX_TYPE_PRIMITIVE, | |
| 59 | PIDGIN_STATUS_BOX_TYPE_POPULAR, | |
|
16376
04b7b529b7b0
Saved icon for saved statuses in statusbox
Sean Egan <seanegan@pidgin.im>
parents:
16254
diff
changeset
|
60 | PIDGIN_STATUS_BOX_TYPE_SAVED_POPULAR, |
| 15577 | 61 | PIDGIN_STATUS_BOX_TYPE_CUSTOM, |
| 62 | PIDGIN_STATUS_BOX_TYPE_SAVED, | |
| 63 | PIDGIN_STATUS_BOX_NUM_TYPES | |
| 64 | } PidginStatusBoxItemType; | |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
65 | |
| 15577 | 66 | typedef struct _PidginStatusBox PidginStatusBox; |
| 67 | typedef struct _PidginStatusBoxClass PidginStatusBoxClass; | |
| 10643 | 68 | |
| 15577 | 69 | struct _PidginStatusBox |
| 10643 | 70 | { |
| 15141 | 71 | GtkContainer parent_instance; |
| 10643 | 72 | |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
73 | /** |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
74 | * This GtkListStore contains only one row--the currently selected status. |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
75 | */ |
| 10643 | 76 | GtkListStore *store; |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
77 | |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
78 | /** |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
79 | * This is the dropdown GtkListStore that contains the available statuses, |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
80 | * plus some recently used statuses, plus the "Custom..." and "Saved..." |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
81 | * options. |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11738
diff
changeset
|
82 | */ |
| 10643 | 83 | GtkListStore *dropdown_store; |
| 84 | ||
| 15884 | 85 | PurpleAccount *account; |
| 11499 | 86 | |
|
14725
39980ddc0b9a
[gaim-migrate @ 17409]
Daniel Atallah <datallah@pidgin.im>
parents:
14253
diff
changeset
|
87 | /* This will be non-NULL and contain a sample account |
|
39980ddc0b9a
[gaim-migrate @ 17409]
Daniel Atallah <datallah@pidgin.im>
parents:
14253
diff
changeset
|
88 | * when all enabled accounts use the same statuses */ |
| 15884 | 89 | PurpleAccount *token_status_account; |
|
14725
39980ddc0b9a
[gaim-migrate @ 17409]
Daniel Atallah <datallah@pidgin.im>
parents:
14253
diff
changeset
|
90 | |
| 10643 | 91 | GtkWidget *vbox, *sw; |
| 92 | GtkWidget *imhtml; | |
| 14195 | 93 | |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16376
diff
changeset
|
94 | PurpleStoredImage *buddy_icon_img; |
|
14203
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
95 | GdkPixbuf *buddy_icon; |
|
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
96 | GdkPixbuf *buddy_icon_hover; |
| 14195 | 97 | GtkWidget *buddy_icon_sel; |
|
14203
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
98 | GtkWidget *icon; |
| 14195 | 99 | GtkWidget *icon_box; |
|
15079
835ed45157ce
[gaim-migrate @ 17799]
Daniel Atallah <datallah@pidgin.im>
parents:
14865
diff
changeset
|
100 | GtkWidget *icon_box_menu; |
| 14195 | 101 | GdkCursor *hand_cursor; |
| 102 | GdkCursor *arrow_cursor; | |
| 15474 | 103 | int icon_size; |
| 104 | gboolean icon_opaque; | |
| 14195 | 105 | |
| 10643 | 106 | gboolean imhtml_visible; |
| 107 | ||
| 108 | GtkWidget *cell_view; | |
| 109 | GtkCellRenderer *icon_rend; | |
| 110 | GtkCellRenderer *text_rend; | |
| 111 | ||
| 112 | GdkPixbuf *error_pixbuf; | |
| 113 | int connecting_index; | |
|
15736
90e6102420f0
throbber for a connecting icon
Sean Egan <seanegan@pidgin.im>
parents:
15730
diff
changeset
|
114 | GdkPixbuf *connecting_pixbufs[9]; |
| 10643 | 115 | int typing_index; |
| 15730 | 116 | GdkPixbuf *typing_pixbufs[6]; |
| 10643 | 117 | |
| 14767 | 118 | gboolean network_available; |
| 10643 | 119 | gboolean connecting; |
|
13124
1750c1be8e81
[gaim-migrate @ 15485]
Mark Doliner <markdoliner@pidgin.im>
parents:
13123
diff
changeset
|
120 | guint typing; |
| 10643 | 121 | |
| 122 | GtkTreeIter iter; | |
| 123 | char *error; | |
| 11960 | 124 | |
|
13122
85136c011157
[gaim-migrate @ 15483]
Mark Doliner <markdoliner@pidgin.im>
parents:
12779
diff
changeset
|
125 | /* |
|
85136c011157
[gaim-migrate @ 15483]
Mark Doliner <markdoliner@pidgin.im>
parents:
12779
diff
changeset
|
126 | * These widgets are made for renderin' |
|
85136c011157
[gaim-migrate @ 15483]
Mark Doliner <markdoliner@pidgin.im>
parents:
12779
diff
changeset
|
127 | * That's just what they'll do |
|
85136c011157
[gaim-migrate @ 15483]
Mark Doliner <markdoliner@pidgin.im>
parents:
12779
diff
changeset
|
128 | * One of these days these widgets |
|
85136c011157
[gaim-migrate @ 15483]
Mark Doliner <markdoliner@pidgin.im>
parents:
12779
diff
changeset
|
129 | * Are gonna render all over you |
|
85136c011157
[gaim-migrate @ 15483]
Mark Doliner <markdoliner@pidgin.im>
parents:
12779
diff
changeset
|
130 | */ |
| 12262 | 131 | GtkWidget *hbox; |
| 132 | GtkWidget *toggle_button; | |
| 133 | GtkWidget *vsep; | |
| 134 | GtkWidget *arrow; | |
| 15141 | 135 | |
| 136 | GtkWidget *popup_window; | |
| 137 | GtkWidget *popup_frame; | |
| 138 | GtkWidget *scrolled_window; | |
| 139 | GtkWidget *cell_view_frame; | |
| 140 | GtkTreeViewColumn *column; | |
| 141 | GtkWidget *tree_view; | |
| 142 | gboolean popup_in_progress; | |
| 143 | GtkTreeRowReference *active_row; | |
| 10643 | 144 | }; |
| 145 | ||
| 15577 | 146 | struct _PidginStatusBoxClass |
| 10643 | 147 | { |
| 15141 | 148 | GtkContainerClass parent_class; |
| 10643 | 149 | |
|
14203
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
150 | /* signals */ |
|
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
151 | void (* changed) (GtkComboBox *combo_box); |
| 10643 | 152 | |
|
14203
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
153 | /* Padding for future expansion */ |
|
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
154 | void (*_gtk_reserved0) (void); |
|
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
155 | void (*_gtk_reserved1) (void); |
|
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
156 | void (*_gtk_reserved2) (void); |
|
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
157 | void (*_gtk_reserved3) (void); |
| 10643 | 158 | }; |
| 159 | ||
| 160 | ||
| 15577 | 161 | GType pidgin_status_box_get_type (void) G_GNUC_CONST; |
| 162 | GtkWidget *pidgin_status_box_new (void); | |
| 15884 | 163 | GtkWidget *pidgin_status_box_new_with_account (PurpleAccount *); |
| 10643 | 164 | |
| 165 | void | |
| 15577 | 166 | pidgin_status_box_add(PidginStatusBox *status_box, PidginStatusBoxItemType type, GdkPixbuf *pixbuf, const char *text, const char *sec_text, gpointer data); |
| 10643 | 167 | |
| 168 | void | |
| 15577 | 169 | pidgin_status_box_add_separator(PidginStatusBox *status_box); |
|
11738
207d5519a4d0
[gaim-migrate @ 14029]
Mark Doliner <markdoliner@pidgin.im>
parents:
11732
diff
changeset
|
170 | |
|
207d5519a4d0
[gaim-migrate @ 14029]
Mark Doliner <markdoliner@pidgin.im>
parents:
11732
diff
changeset
|
171 | void |
| 15577 | 172 | pidgin_status_box_set_network_available(PidginStatusBox *status_box, gboolean available); |
| 14767 | 173 | |
| 174 | void | |
| 15577 | 175 | pidgin_status_box_set_connecting(PidginStatusBox *status_box, gboolean connecting); |
| 10643 | 176 | |
| 177 | void | |
| 15577 | 178 | pidgin_status_box_pulse_connecting(PidginStatusBox *status_box); |
| 10643 | 179 | |
| 14195 | 180 | void |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16376
diff
changeset
|
181 | pidgin_status_box_set_buddy_icon(PidginStatusBox *status_box, PurpleStoredImage *img); |
| 14195 | 182 | |
| 15577 | 183 | char *pidgin_status_box_get_message(PidginStatusBox *status_box); |
| 10649 | 184 | |
| 10643 | 185 | G_END_DECLS |
| 186 | ||
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15474
diff
changeset
|
187 | #endif /* __GTK_PIDGIN_STATUS_COMBO_BOX_H__ */ |