Mercurial > pidgin
annotate src/gtkconv.h @ 9735:23b0478670ff
[gaim-migrate @ 10596]
With regards to Eric S. Johansson
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Tue, 10 Aug 2004 12:56:21 +0000 |
parents | 78022bad9367 |
children | b64ee81c7bcb |
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 |
9718 | 28 #include "gtkinternal.h" |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
29 |
9718 | 30 #include "conversation.h" |
9709 | 31 |
9498 | 32 enum { |
33 CHAT_USERS_ICON_COLUMN, | |
34 CHAT_USERS_NAME_COLUMN, | |
9554 | 35 CHAT_USERS_FLAGS_COLUMN, |
9498 | 36 CHAT_USERS_COLUMNS |
37 }; | |
38 | |
4359 | 39 /************************************************************************** |
40 * @name Structures | |
41 **************************************************************************/ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
42 /*@{*/ |
4359 | 43 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
44 typedef struct _GaimGtkWindow GaimGtkWindow; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
45 typedef struct _GaimGtkImPane GaimGtkImPane; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
46 typedef struct _GaimGtkChatPane GaimGtkChatPane; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
47 typedef struct _GaimGtkConversation GaimGtkConversation; |
4359 | 48 |
49 /** | |
50 * A GTK+ representation of a graphical window containing one or more | |
51 * conversations. | |
52 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
53 struct _GaimGtkWindow |
4359 | 54 { |
55 GtkWidget *window; /**< The window. */ | |
56 GtkWidget *notebook; /**< The notebook of conversations. */ | |
57 | |
58 struct | |
59 { | |
60 GtkWidget *menubar; | |
61 | |
5167 | 62 GtkWidget *view_log; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
63 |
9468 | 64 GtkWidget *send_file; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
65 GtkWidget *add_pounce; |
7887 | 66 GtkWidget *get_info; |
67 GtkWidget *warn; | |
68 GtkWidget *invite; | |
69 | |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
70 GtkWidget *alias; |
7887 | 71 GtkWidget *block; |
72 GtkWidget *add; | |
73 GtkWidget *remove; | |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
74 |
7859 | 75 GtkWidget *insert_link; |
76 GtkWidget *insert_image; | |
77 | |
4359 | 78 GtkWidget *logging; |
79 GtkWidget *sounds; | |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
80 GtkWidget *show_formatting_toolbar; |
9188 | 81 GtkWidget *show_timestamps; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
82 |
4359 | 83 GtkWidget *send_as; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
84 |
4736 | 85 GtkWidget *typing_icon; |
4359 | 86 |
4630 | 87 GtkItemFactory *item_factory; |
88 | |
4359 | 89 } menu; |
90 | |
91 /* Tab dragging stuff. */ | |
92 gboolean in_drag; | |
93 gboolean in_predrag; | |
94 | |
95 gint drag_min_x, drag_max_x, drag_min_y, drag_max_y; | |
96 | |
97 gint drag_motion_signal; | |
98 gint drag_leave_signal; | |
99 }; | |
100 | |
101 /** | |
7820 | 102 * A GTK+ Instant Message pane. |
4359 | 103 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
104 struct _GaimGtkImPane |
4359 | 105 { |
106 GtkWidget *warn; | |
107 GtkWidget *block; | |
9468 | 108 GtkWidget *send_file; |
4359 | 109 GtkWidget *sep1; |
110 GtkWidget *sep2; | |
111 GtkWidget *check; | |
112 GtkWidget *progress; | |
113 | |
114 gboolean a_virgin; | |
115 | |
116 /* Buddy icon stuff */ | |
117 GtkWidget *icon; | |
9687 | 118 gboolean show_icon; |
8189 | 119 gboolean animate; |
4359 | 120 GdkPixbufAnimation *anim; |
121 GdkPixbufAnimationIter *iter; | |
122 guint32 icon_timer; | |
123 }; | |
124 | |
125 /** | |
126 * GTK+ Chat panes. | |
127 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
128 struct _GaimGtkChatPane |
4359 | 129 { |
130 GtkWidget *count; | |
131 GtkWidget *list; | |
132 GtkWidget *invite; | |
133 GtkWidget *topic_text; | |
7996
334ab1319406
[gaim-migrate @ 8673]
Christian Hammond <chipx86@chipx86.com>
parents:
7930
diff
changeset
|
134 GtkWidget *sep; |
4359 | 135 }; |
136 | |
137 /** | |
138 * A GTK+ conversation pane. | |
139 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
140 struct _GaimGtkConversation |
4359 | 141 { |
142 gboolean make_sound; | |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
143 gboolean show_formatting_toolbar; |
9188 | 144 gboolean show_timestamps; |
4359 | 145 |
146 GtkTooltips *tooltips; | |
147 | |
148 GtkWidget *tab_cont; | |
149 GtkWidget *tabby; | |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
150 GtkWidget *menu_tabby; |
4359 | 151 |
152 GtkWidget *imhtml; | |
153 GtkTextBuffer *entry_buffer; | |
154 GtkWidget *entry; | |
155 | |
7930 | 156 GtkWidget *add; |
157 GtkWidget *remove; | |
4359 | 158 GtkWidget *info; |
7930 | 159 GtkWidget *send; |
160 GtkWidget *close; /* "x" on the tab */ | |
6392
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
5908
diff
changeset
|
161 GtkWidget *icon; |
4359 | 162 GtkWidget *tab_label; |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
163 GtkWidget *menu_icon; |
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
164 GtkWidget *menu_label; |
4359 | 165 GtkSizeGroup *sg; |
166 | |
167 GtkWidget *bbox; | |
168 GtkWidget *sw; | |
9332 | 169 GtkWidget *lower_hbox; |
4359 | 170 |
8317 | 171 GtkWidget *toolbar; |
4359 | 172 |
173 struct | |
174 { | |
5106 | 175 GtkWidget *image; |
7295 | 176 GtkWidget *search; |
4359 | 177 |
178 } dialogs; | |
179 | |
180 union | |
181 { | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
182 GaimGtkImPane *im; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
183 GaimGtkChatPane *chat; |
4359 | 184 |
185 } u; | |
186 }; | |
187 | |
188 #define GAIM_GTK_WINDOW(win) \ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
189 ((GaimGtkWindow *)(win)->ui_data) |
4359 | 190 |
191 #define GAIM_GTK_CONVERSATION(conv) \ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
192 ((GaimGtkConversation *)(conv)->ui_data) |
4359 | 193 |
4384
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
194 #define GAIM_IS_GTK_WINDOW(win) \ |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
195 (gaim_conv_window_get_ui_ops(win) == gaim_gtk_conversations_get_win_ui_ops()) |
4384
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
196 |
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
197 #define GAIM_IS_GTK_CONVERSATION(conv) \ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
198 (gaim_conversation_get_ui_ops(conv) == \ |
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
199 gaim_gtk_conversations_get_conv_ui_ops()) |
4359 | 200 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
201 /*@}*/ |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
202 |
4359 | 203 /************************************************************************** |
204 * @name GTK+ Conversation API | |
205 **************************************************************************/ | |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
206 /*@{*/ |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
207 |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
208 /** |
4359 | 209 * Returns the UI operations structure for GTK windows. |
210 * | |
211 * @return The GTK window operations structure. | |
212 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
213 GaimConvWindowUiOps *gaim_gtk_conversations_get_win_ui_ops(void); |
4359 | 214 |
215 /** | |
216 * Returns the UI operations structure for GTK conversations. | |
217 * | |
218 * @return The GTK conversation operations structure. | |
219 */ | |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
220 GaimConversationUiOps *gaim_gtk_conversations_get_conv_ui_ops(void); |
4359 | 221 |
222 /** | |
223 * Updates the buddy icon on a conversation. | |
224 * | |
225 * @param conv The conversation. | |
226 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
227 void gaim_gtkconv_update_buddy_icon(GaimConversation *conv); |
4359 | 228 |
229 /** | |
230 * Updates the tab positions on all conversation windows to reflect any | |
231 * changed preferences. | |
232 */ | |
233 void gaim_gtkconv_update_tabs(void); | |
234 | |
235 /** | |
236 * Updates the button style on chat windows to reflect any | |
237 * changed preferences. | |
238 */ | |
239 void gaim_gtkconv_update_chat_button_style(); | |
240 | |
241 /** | |
242 * Updates the button style on IM windows to reflect any | |
243 * changed preferences. | |
244 */ | |
245 void gaim_gtkconv_update_im_button_style(); | |
246 | |
247 /** | |
248 * Updates conversation buttons by protocol. | |
249 * | |
250 * @param conv The conversation. | |
251 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
252 void gaim_gtkconv_update_buttons_by_protocol(GaimConversation *conv); |
4359 | 253 |
254 /** | |
255 * Returns the window at the specified X, Y location. | |
256 * | |
257 * If the window is not a GTK+ window, @c NULL is returned. | |
258 * | |
259 * @param x The X coordinate. | |
260 * @param y The Y coordinate. | |
261 * | |
262 * @return The GTK+ window at the location, if it exists, or @c NULL otherwise. | |
263 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
264 GaimConvWindow *gaim_gtkwin_get_at_xy(int x, int y); |
4359 | 265 |
266 /** | |
267 * Returns the index of the tab at the specified X, Y location in a notebook. | |
268 * | |
269 * @param win The GTK+ window containing the notebook. | |
270 * @param x The X coordinate. | |
271 * @param y The Y coordinate. | |
272 * | |
273 * @return The index of the tab at the location. | |
274 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
275 int gaim_gtkconv_get_tab_at_xy(GaimConvWindow *win, int x, int y); |
4359 | 276 |
277 /** | |
278 * Returns the index of the destination tab at the | |
279 * specified X, Y location in a notebook. | |
280 * | |
281 * This is used for drag-and-drop functions when the tab at the index | |
282 * is a destination tab. | |
283 * | |
284 * @param win The GTK+ window containing the notebook. | |
285 * @param x The X coordinate. | |
286 * @param y The Y coordinate. | |
287 * | |
288 * @return The index of the tab at the location. | |
289 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
290 int gaim_gtkconv_get_dest_tab_at_xy(GaimConvWindow *win, int x, int y); |
4359 | 291 |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
292 /*@}*/ |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
293 |
8582
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 /** @name GTK+ Conversations Subsystem */ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
296 /**************************************************************************/ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
297 /*@{*/ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
298 |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
299 /** |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
300 * Returns the gtk conversations subsystem handle. |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
301 * |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
302 * @return The conversations subsystem handle. |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
303 */ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
304 void *gaim_gtk_conversations_get_handle(void); |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
305 |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
306 /** |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
307 * Initializes the GTK+ conversations subsystem. |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
308 */ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
309 void gaim_gtk_conversations_init(void); |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
310 |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
311 /** |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
312 * Uninitialized the GTK+ conversation subsystem. |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
313 */ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
314 void gaim_gtk_conversations_uninit(void); |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
315 |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
316 /*@}*/ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
317 |
9713 | 318 #endif /* _GAIM_GTKCONVERSATION_H_ */ |