Mercurial > pidgin.yaz
annotate src/gtkconv.h @ 7641:a80010831ff8
[gaim-migrate @ 8283]
0.74
committer: Tailor Script <tailor@pidgin.im>
author | Herman Bloggs <hermanator12002@yahoo.com> |
---|---|
date | Wed, 26 Nov 2003 16:33:40 +0000 |
parents | 994b2d782711 |
children | 6db061321ec4 |
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 * | |
5872
059d95c67cda
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
7 * Copyright (C) 2002-2003 Christian Hammond <chipx86@gnupdate.org> |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
8 * |
4359 | 9 * This program is free software; you can redistribute it and/or modify |
10 * it under the terms of the GNU General Public License as published by | |
11 * the Free Software Foundation; either version 2 of the License, or | |
12 * (at your option) any later version. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
20 * along with this program; if not, write to the Free Software | |
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 */ | |
23 | |
24 #ifndef _GAIM_GTK_CONVERSATION_H_ | |
25 #define _GAIM_GTK_CONVERSATION_H_ | |
26 | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
27 #include "conversation.h" |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
28 |
4359 | 29 /************************************************************************** |
30 * @name Structures | |
31 **************************************************************************/ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
32 /*@{*/ |
4359 | 33 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
34 typedef struct _GaimGtkWindow GaimGtkWindow; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
35 typedef struct _GaimGtkImPane GaimGtkImPane; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
36 typedef struct _GaimGtkChatPane GaimGtkChatPane; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
37 typedef struct _GaimGtkConversation GaimGtkConversation; |
4359 | 38 |
39 /** | |
40 * A GTK+ representation of a graphical window containing one or more | |
41 * conversations. | |
42 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
43 struct _GaimGtkWindow |
4359 | 44 { |
45 GtkWidget *window; /**< The window. */ | |
46 GtkWidget *notebook; /**< The notebook of conversations. */ | |
47 | |
48 struct | |
49 { | |
50 GtkWidget *menubar; | |
51 | |
5167 | 52 GtkWidget *view_log; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
53 |
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
54 GtkWidget *add_pounce; |
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
55 GtkWidget *alias; |
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
56 GtkWidget *get_info; |
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
57 GtkWidget *invite; |
7619
994b2d782711
[gaim-migrate @ 8243]
Christian Hammond <chipx86@chipx86.com>
parents:
7326
diff
changeset
|
58 GtkWidget *sendfile; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
59 |
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
60 GtkWidget *warn; |
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
61 GtkWidget *block; |
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
62 GtkWidget *add; |
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
63 GtkWidget *remove; |
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
64 |
4359 | 65 GtkWidget *insert_link; |
66 GtkWidget *insert_image; | |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
67 |
4359 | 68 GtkWidget *logging; |
69 GtkWidget *sounds; | |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
70 GtkWidget *show_formatting_toolbar; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
71 |
4359 | 72 GtkWidget *send_as; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
73 |
4736 | 74 GtkWidget *typing_icon; |
4359 | 75 |
4630 | 76 GtkItemFactory *item_factory; |
77 | |
4359 | 78 } menu; |
79 | |
80 /* Tab dragging stuff. */ | |
81 gboolean in_drag; | |
82 gboolean in_predrag; | |
83 | |
84 gint drag_min_x, drag_max_x, drag_min_y, drag_max_y; | |
85 | |
86 gint drag_motion_signal; | |
87 gint drag_leave_signal; | |
88 }; | |
89 | |
90 /** | |
91 * GTK+ Instant Message panes. | |
92 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
93 struct _GaimGtkImPane |
4359 | 94 { |
95 GtkWidget *warn; | |
96 GtkWidget *block; | |
97 GtkWidget *add; | |
98 GtkWidget *sep1; | |
99 GtkWidget *sep2; | |
100 GtkWidget *check; | |
101 GtkWidget *progress; | |
102 | |
103 gboolean a_virgin; | |
104 | |
105 /* Buddy icon stuff */ | |
106 GtkWidget *icon; | |
107 GdkPixbufAnimation *anim; | |
108 GdkPixbufAnimationIter *iter; | |
109 guint32 icon_timer; | |
110 GtkWidget *save_icon; | |
111 }; | |
112 | |
113 /** | |
114 * GTK+ Chat panes. | |
115 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
116 struct _GaimGtkChatPane |
4359 | 117 { |
118 GtkWidget *count; | |
119 GtkWidget *list; | |
120 GtkWidget *whisper; | |
121 GtkWidget *invite; | |
122 GtkWidget *topic_text; | |
123 }; | |
124 | |
125 /** | |
126 * A GTK+ conversation pane. | |
127 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
128 struct _GaimGtkConversation |
4359 | 129 { |
130 gboolean make_sound; | |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
131 gboolean show_formatting_toolbar; |
4359 | 132 gboolean has_font; |
133 char fontface[128]; | |
134 GdkColor fg_color; | |
135 GdkColor bg_color; | |
136 | |
137 GtkTooltips *tooltips; | |
138 | |
139 GtkWidget *tab_cont; | |
140 GtkWidget *tabby; | |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
141 GtkWidget *menu_tabby; |
4359 | 142 |
143 GtkWidget *imhtml; | |
144 GtkTextBuffer *entry_buffer; | |
145 GtkWidget *entry; | |
146 | |
147 GtkWidget *send; | |
148 GtkWidget *info; | |
149 GtkWidget *close; | |
6392
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
5908
diff
changeset
|
150 GtkWidget *icon; |
4359 | 151 GtkWidget *tab_label; |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
152 GtkWidget *menu_icon; |
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
153 GtkWidget *menu_label; |
4359 | 154 GtkSizeGroup *sg; |
155 | |
156 GtkWidget *bbox; | |
157 GtkWidget *sw; | |
158 | |
159 struct | |
160 { | |
161 GtkWidget *toolbar; | |
4685 | 162 |
4359 | 163 GtkWidget *bold; |
164 GtkWidget *italic; | |
165 GtkWidget *underline; | |
166 | |
5049 | 167 GtkWidget *larger_size; |
4359 | 168 GtkWidget *normal_size; |
5049 | 169 GtkWidget *smaller_size; |
4359 | 170 |
4685 | 171 GtkWidget *font; |
4359 | 172 GtkWidget *fgcolor; |
173 GtkWidget *bgcolor; | |
174 | |
175 GtkWidget *image; | |
176 GtkWidget *link; | |
177 GtkWidget *smiley; | |
178 GtkWidget *log; | |
4685 | 179 |
4359 | 180 } toolbar; |
181 | |
182 struct | |
183 { | |
184 GtkWidget *fg_color; | |
185 GtkWidget *bg_color; | |
186 GtkWidget *font; | |
187 GtkWidget *smiley; | |
188 GtkWidget *link; | |
5106 | 189 GtkWidget *image; |
4359 | 190 GtkWidget *log; |
7295 | 191 GtkWidget *search; |
4359 | 192 |
193 } dialogs; | |
194 | |
195 union | |
196 { | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
197 GaimGtkImPane *im; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
198 GaimGtkChatPane *chat; |
4359 | 199 |
200 } u; | |
201 }; | |
202 | |
203 #define GAIM_GTK_WINDOW(win) \ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
204 ((GaimGtkWindow *)(win)->ui_data) |
4359 | 205 |
206 #define GAIM_GTK_CONVERSATION(conv) \ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
207 ((GaimGtkConversation *)(conv)->ui_data) |
4359 | 208 |
4384
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
209 #define GAIM_IS_GTK_WINDOW(win) \ |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
210 (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
|
211 |
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
212 #define GAIM_IS_GTK_CONVERSATION(conv) \ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
213 (gaim_conversation_get_ui_ops(conv) == \ |
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
214 gaim_gtk_conversations_get_conv_ui_ops()) |
4359 | 215 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
216 /*@}*/ |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
217 |
4359 | 218 /************************************************************************** |
219 * @name GTK+ Conversation API | |
220 **************************************************************************/ | |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
221 /*@{*/ |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
222 |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
223 /** |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
224 * Initializes the GTK+ conversation system. |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
225 */ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
226 void gaim_gtk_conversations_init(void); |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
227 |
4359 | 228 /** |
229 * Returns the UI operations structure for GTK windows. | |
230 * | |
231 * @return The GTK window operations structure. | |
232 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
233 GaimConvWindowUiOps *gaim_gtk_conversations_get_win_ui_ops(void); |
4359 | 234 |
235 /** | |
236 * Returns the UI operations structure for GTK conversations. | |
237 * | |
238 * @return The GTK conversation operations structure. | |
239 */ | |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
240 GaimConversationUiOps *gaim_gtk_conversations_get_conv_ui_ops(void); |
4359 | 241 |
242 /** | |
243 * Updates the buddy icon on a conversation. | |
244 * | |
245 * @param conv The conversation. | |
246 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
247 void gaim_gtkconv_update_buddy_icon(GaimConversation *conv); |
4359 | 248 |
249 /** | |
250 * Updates the font buttons on all conversations to reflect any changed | |
251 * preferences. | |
252 */ | |
253 void gaim_gtkconv_update_font_buttons(void); | |
254 | |
255 /** | |
4421 | 256 * Updates the font colors of each conversation to the new colors |
257 * chosen in the prefs dialog. | |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
258 * |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
259 * @param conv The conversation to update. |
4421 | 260 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
261 void gaim_gtkconv_update_font_colors(GaimConversation *conv); |
4421 | 262 |
263 /** | |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
264 * Updates the font faces of each conversation to the new font |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
265 * face chosen in the prefs dialog. |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
266 * |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
267 * @param conv The conversation to update. |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
268 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
269 void gaim_gtkconv_update_font_face(GaimConversation *conv); |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
270 |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
271 /** |
4359 | 272 * Updates the tab positions on all conversation windows to reflect any |
273 * changed preferences. | |
274 */ | |
275 void gaim_gtkconv_update_tabs(void); | |
276 | |
277 /** | |
278 * Updates the button style on chat windows to reflect any | |
279 * changed preferences. | |
280 */ | |
281 void gaim_gtkconv_update_chat_button_style(); | |
282 | |
283 /** | |
284 * Updates the button style on IM windows to reflect any | |
285 * changed preferences. | |
286 */ | |
287 void gaim_gtkconv_update_im_button_style(); | |
288 | |
289 /** | |
290 * Updates conversation buttons by protocol. | |
291 * | |
292 * @param conv The conversation. | |
293 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
294 void gaim_gtkconv_update_buttons_by_protocol(GaimConversation *conv); |
4359 | 295 |
296 /** | |
297 * Returns the window at the specified X, Y location. | |
298 * | |
299 * If the window is not a GTK+ window, @c NULL is returned. | |
300 * | |
301 * @param x The X coordinate. | |
302 * @param y The Y coordinate. | |
303 * | |
304 * @return The GTK+ window at the location, if it exists, or @c NULL otherwise. | |
305 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
306 GaimConvWindow *gaim_gtkwin_get_at_xy(int x, int y); |
4359 | 307 |
308 /** | |
309 * Returns the index of the tab at the specified X, Y location in a notebook. | |
310 * | |
311 * @param win The GTK+ window containing the notebook. | |
312 * @param x The X coordinate. | |
313 * @param y The Y coordinate. | |
314 * | |
315 * @return The index of the tab at the location. | |
316 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
317 int gaim_gtkconv_get_tab_at_xy(GaimConvWindow *win, int x, int y); |
4359 | 318 |
319 /** | |
320 * Returns the index of the destination tab at the | |
321 * specified X, Y location in a notebook. | |
322 * | |
323 * This is used for drag-and-drop functions when the tab at the index | |
324 * is a destination tab. | |
325 * | |
326 * @param win The GTK+ window containing the notebook. | |
327 * @param x The X coordinate. | |
328 * @param y The Y coordinate. | |
329 * | |
330 * @return The index of the tab at the location. | |
331 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
332 int gaim_gtkconv_get_dest_tab_at_xy(GaimConvWindow *win, int x, int y); |
4359 | 333 |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
334 /*@}*/ |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
335 |
4359 | 336 #endif /* _GAIM_GTK_CONVERSATION_H_ */ |