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