Mercurial > pidgin
annotate src/gtkconv.h @ 11574:a9c4e139645f
[gaim-migrate @ 13843]
"due" to an error, not "do" to an error :)
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Wed, 28 Sep 2005 04:05:56 +0000 |
parents | f8443218b7fe |
children | 9b3833da6840 |
rev | line source |
---|---|
4359 | 1 /** |
2 * @file gtkconv.h GTK+ Conversation API | |
5034
4691c5936c01
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
4736
diff
changeset
|
3 * @ingroup gtkui |
4359 | 4 * |
5 * gaim | |
6 * | |
8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
10 * |
4359 | 11 * This program is free software; you can redistribute it and/or modify |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
9713 | 25 #ifndef _GAIM_GTKCONVERSATION_H_ |
26 #define _GAIM_GTKCONVERSATION_H_ | |
4359 | 27 |
10008 | 28 typedef struct _GaimGtkWindow GaimGtkWindow; |
29 typedef struct _GaimGtkImPane GaimGtkImPane; | |
30 typedef struct _GaimGtkChatPane GaimGtkChatPane; | |
31 typedef struct _GaimGtkConversation GaimGtkConversation; | |
9709 | 32 |
9498 | 33 enum { |
34 CHAT_USERS_ICON_COLUMN, | |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11280
diff
changeset
|
35 CHAT_USERS_ALIAS_COLUMN, |
9498 | 36 CHAT_USERS_NAME_COLUMN, |
9554 | 37 CHAT_USERS_FLAGS_COLUMN, |
11454
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11280
diff
changeset
|
38 CHAT_USERS_COLOR_COLUMN, |
201617d49573
[gaim-migrate @ 13693]
Richard Laager <rlaager@wiktel.com>
parents:
11280
diff
changeset
|
39 CHAT_USERS_BUDDY_COLUMN, |
9498 | 40 CHAT_USERS_COLUMNS |
41 }; | |
42 | |
10008 | 43 #define GAIM_GTK_WINDOW(win) \ |
44 ((GaimGtkWindow *)(win)->ui_data) | |
45 | |
46 #define GAIM_GTK_CONVERSATION(conv) \ | |
47 ((GaimGtkConversation *)(conv)->ui_data) | |
48 | |
49 #define GAIM_IS_GTK_WINDOW(win) \ | |
50 (gaim_conv_window_get_ui_ops(win) == gaim_gtk_conversations_get_win_ui_ops()) | |
51 | |
52 #define GAIM_IS_GTK_CONVERSATION(conv) \ | |
53 (gaim_conversation_get_ui_ops(conv) == \ | |
54 gaim_gtk_conversations_get_conv_ui_ops()) | |
55 | |
56 #include "gtkgaim.h" | |
57 #include "conversation.h" | |
58 | |
4359 | 59 /************************************************************************** |
60 * @name Structures | |
61 **************************************************************************/ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
62 /*@{*/ |
4359 | 63 |
64 /** | |
65 * A GTK+ representation of a graphical window containing one or more | |
66 * conversations. | |
67 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
68 struct _GaimGtkWindow |
4359 | 69 { |
70 GtkWidget *window; /**< The window. */ | |
71 GtkWidget *notebook; /**< The notebook of conversations. */ | |
72 | |
73 struct | |
74 { | |
75 GtkWidget *menubar; | |
76 | |
5167 | 77 GtkWidget *view_log; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
78 |
9468 | 79 GtkWidget *send_file; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
80 GtkWidget *add_pounce; |
7887 | 81 GtkWidget *get_info; |
82 GtkWidget *invite; | |
83 | |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
84 GtkWidget *alias; |
7887 | 85 GtkWidget *block; |
86 GtkWidget *add; | |
87 GtkWidget *remove; | |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
88 |
7859 | 89 GtkWidget *insert_link; |
90 GtkWidget *insert_image; | |
91 | |
4359 | 92 GtkWidget *logging; |
93 GtkWidget *sounds; | |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
94 GtkWidget *show_formatting_toolbar; |
9188 | 95 GtkWidget *show_timestamps; |
10456 | 96 GtkWidget *show_icon; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
97 |
4359 | 98 GtkWidget *send_as; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
99 |
11554
f8443218b7fe
[gaim-migrate @ 13814]
Gary Kramlich <grim@reaperworld.com>
parents:
11454
diff
changeset
|
100 GtkWidget *tray; |
f8443218b7fe
[gaim-migrate @ 13814]
Gary Kramlich <grim@reaperworld.com>
parents:
11454
diff
changeset
|
101 |
4736 | 102 GtkWidget *typing_icon; |
4359 | 103 |
4630 | 104 GtkItemFactory *item_factory; |
105 | |
4359 | 106 } menu; |
107 | |
108 /* Tab dragging stuff. */ | |
109 gboolean in_drag; | |
110 gboolean in_predrag; | |
111 | |
11279
ed5302df41b0
[gaim-migrate @ 13474]
Luke Schierer <lschiere@pidgin.im>
parents:
11257
diff
changeset
|
112 gint drag_tab; |
ed5302df41b0
[gaim-migrate @ 13474]
Luke Schierer <lschiere@pidgin.im>
parents:
11257
diff
changeset
|
113 |
4359 | 114 gint drag_min_x, drag_max_x, drag_min_y, drag_max_y; |
115 | |
116 gint drag_motion_signal; | |
117 gint drag_leave_signal; | |
118 }; | |
119 | |
120 /** | |
7820 | 121 * A GTK+ Instant Message pane. |
4359 | 122 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
123 struct _GaimGtkImPane |
4359 | 124 { |
125 GtkWidget *block; | |
9468 | 126 GtkWidget *send_file; |
4359 | 127 GtkWidget *sep1; |
128 GtkWidget *sep2; | |
129 GtkWidget *check; | |
130 GtkWidget *progress; | |
131 | |
132 gboolean a_virgin; | |
133 | |
134 /* Buddy icon stuff */ | |
9885 | 135 GtkWidget *icon_container; |
4359 | 136 GtkWidget *icon; |
9687 | 137 gboolean show_icon; |
8189 | 138 gboolean animate; |
4359 | 139 GdkPixbufAnimation *anim; |
140 GdkPixbufAnimationIter *iter; | |
141 guint32 icon_timer; | |
142 }; | |
143 | |
144 /** | |
145 * GTK+ Chat panes. | |
146 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
147 struct _GaimGtkChatPane |
4359 | 148 { |
149 GtkWidget *count; | |
150 GtkWidget *list; | |
151 GtkWidget *topic_text; | |
10500 | 152 GtkWidget *userlist_im; |
153 GtkWidget *userlist_ignore; | |
154 GtkWidget *userlist_info; | |
4359 | 155 }; |
156 | |
157 /** | |
158 * A GTK+ conversation pane. | |
159 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
160 struct _GaimGtkConversation |
4359 | 161 { |
10810 | 162 GaimConversation *active_conv; |
163 GList *convs; | |
164 | |
4359 | 165 gboolean make_sound; |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
166 gboolean show_formatting_toolbar; |
9188 | 167 gboolean show_timestamps; |
4359 | 168 |
169 GtkTooltips *tooltips; | |
170 | |
171 GtkWidget *tab_cont; | |
172 GtkWidget *tabby; | |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
173 GtkWidget *menu_tabby; |
4359 | 174 |
175 GtkWidget *imhtml; | |
176 GtkTextBuffer *entry_buffer; | |
177 GtkWidget *entry; | |
178 | |
7930 | 179 GtkWidget *close; /* "x" on the tab */ |
6392
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
5908
diff
changeset
|
180 GtkWidget *icon; |
4359 | 181 GtkWidget *tab_label; |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
182 GtkWidget *menu_icon; |
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
183 GtkWidget *menu_label; |
4359 | 184 GtkSizeGroup *sg; |
185 | |
9332 | 186 GtkWidget *lower_hbox; |
4359 | 187 |
8317 | 188 GtkWidget *toolbar; |
4359 | 189 |
190 struct | |
191 { | |
5106 | 192 GtkWidget *image; |
7295 | 193 GtkWidget *search; |
4359 | 194 |
195 } dialogs; | |
196 | |
197 union | |
198 { | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
199 GaimGtkImPane *im; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
200 GaimGtkChatPane *chat; |
4359 | 201 |
202 } u; | |
203 }; | |
204 | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
205 /*@}*/ |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
206 |
4359 | 207 /************************************************************************** |
208 * @name GTK+ Conversation API | |
209 **************************************************************************/ | |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
210 /*@{*/ |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
211 |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
212 /** |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10810
diff
changeset
|
213 * Returns the UI operations structure for GTK+ windows. |
4359 | 214 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10810
diff
changeset
|
215 * @return The GTK+ window operations structure. |
4359 | 216 */ |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
217 GaimConvWindowUiOps *gaim_gtk_conversations_get_win_ui_ops(void); |
4359 | 218 |
219 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10810
diff
changeset
|
220 * Returns the UI operations structure for GTK+ conversations. |
4359 | 221 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10810
diff
changeset
|
222 * @return The GTK+ conversation operations structure. |
4359 | 223 */ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
224 GaimConversationUiOps *gaim_gtk_conversations_get_conv_ui_ops(void); |
4359 | 225 |
226 /** | |
227 * Updates the buddy icon on a conversation. | |
228 * | |
229 * @param conv The conversation. | |
230 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
231 void gaim_gtkconv_update_buddy_icon(GaimConversation *conv); |
4359 | 232 |
233 /** | |
234 * Updates the tab positions on all conversation windows to reflect any | |
235 * changed preferences. | |
236 */ | |
237 void gaim_gtkconv_update_tabs(void); | |
238 | |
239 /** | |
240 * Updates conversation buttons by protocol. | |
241 * | |
242 * @param conv The conversation. | |
243 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
244 void gaim_gtkconv_update_buttons_by_protocol(GaimConversation *conv); |
4359 | 245 |
246 /** | |
247 * Returns the window at the specified X, Y location. | |
248 * | |
249 * If the window is not a GTK+ window, @c NULL is returned. | |
250 * | |
251 * @param x The X coordinate. | |
252 * @param y The Y coordinate. | |
253 * | |
254 * @return The GTK+ window at the location, if it exists, or @c NULL otherwise. | |
255 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
256 GaimConvWindow *gaim_gtkwin_get_at_xy(int x, int y); |
4359 | 257 |
258 /** | |
259 * Returns the index of the tab at the specified X, Y location in a notebook. | |
260 * | |
261 * @param win The GTK+ window containing the notebook. | |
262 * @param x The X coordinate. | |
263 * @param y The Y coordinate. | |
264 * | |
265 * @return The index of the tab at the location. | |
266 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
267 int gaim_gtkconv_get_tab_at_xy(GaimConvWindow *win, int x, int y); |
4359 | 268 |
10827 | 269 GaimGtkConversation *gaim_gtk_get_gtkconv_at_index(const GaimConvWindow *win, int index); |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
270 /*@}*/ |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
271 |
8582
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
272 /**************************************************************************/ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
273 /** @name GTK+ Conversations Subsystem */ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
274 /**************************************************************************/ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
275 /*@{*/ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
276 |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
277 /** |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
278 * Returns the gtk conversations subsystem handle. |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
279 * |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
280 * @return The conversations subsystem handle. |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
281 */ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
282 void *gaim_gtk_conversations_get_handle(void); |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
283 |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
284 /** |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
285 * Initializes the GTK+ conversations subsystem. |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
286 */ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
287 void gaim_gtk_conversations_init(void); |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
288 |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
289 /** |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
290 * Uninitialized the GTK+ conversation subsystem. |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
291 */ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
292 void gaim_gtk_conversations_uninit(void); |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
293 |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
294 /*@}*/ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
295 |
9713 | 296 #endif /* _GAIM_GTKCONVERSATION_H_ */ |