Mercurial > pidgin.yaz
annotate src/gtkconv.h @ 7615:310013ee693e
[gaim-migrate @ 8239]
plug a small leak
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sun, 23 Nov 2003 22:53:34 +0000 |
parents | 00a9ab26d607 |
children | 994b2d782711 |
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; |
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
58 |
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
59 GtkWidget *warn; |
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
60 GtkWidget *block; |
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
61 GtkWidget *add; |
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
62 GtkWidget *remove; |
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
63 |
4359 | 64 GtkWidget *insert_link; |
65 GtkWidget *insert_image; | |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
66 |
4359 | 67 GtkWidget *logging; |
68 GtkWidget *sounds; | |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
69 GtkWidget *show_formatting_toolbar; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
70 |
4359 | 71 GtkWidget *send_as; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
72 |
4736 | 73 GtkWidget *typing_icon; |
4359 | 74 |
4630 | 75 GtkItemFactory *item_factory; |
76 | |
4359 | 77 } menu; |
78 | |
79 /* Tab dragging stuff. */ | |
80 gboolean in_drag; | |
81 gboolean in_predrag; | |
82 | |
83 gint drag_min_x, drag_max_x, drag_min_y, drag_max_y; | |
84 | |
85 gint drag_motion_signal; | |
86 gint drag_leave_signal; | |
87 }; | |
88 | |
89 /** | |
90 * GTK+ Instant Message panes. | |
91 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
92 struct _GaimGtkImPane |
4359 | 93 { |
94 GtkWidget *warn; | |
95 GtkWidget *block; | |
96 GtkWidget *add; | |
97 GtkWidget *sep1; | |
98 GtkWidget *sep2; | |
99 GtkWidget *check; | |
100 GtkWidget *progress; | |
101 | |
102 gboolean a_virgin; | |
103 | |
104 /* Buddy icon stuff */ | |
105 GtkWidget *icon; | |
106 GdkPixbufAnimation *anim; | |
107 GdkPixbufAnimationIter *iter; | |
108 guint32 icon_timer; | |
109 GtkWidget *save_icon; | |
110 }; | |
111 | |
112 /** | |
113 * GTK+ Chat panes. | |
114 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
115 struct _GaimGtkChatPane |
4359 | 116 { |
117 GtkWidget *count; | |
118 GtkWidget *list; | |
119 GtkWidget *whisper; | |
120 GtkWidget *invite; | |
121 GtkWidget *topic_text; | |
122 }; | |
123 | |
124 /** | |
125 * A GTK+ conversation pane. | |
126 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
127 struct _GaimGtkConversation |
4359 | 128 { |
129 gboolean make_sound; | |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
130 gboolean show_formatting_toolbar; |
4359 | 131 gboolean has_font; |
132 char fontface[128]; | |
133 GdkColor fg_color; | |
134 GdkColor bg_color; | |
135 | |
136 GtkTooltips *tooltips; | |
137 | |
138 GtkWidget *tab_cont; | |
139 GtkWidget *tabby; | |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
140 GtkWidget *menu_tabby; |
4359 | 141 |
142 GtkWidget *imhtml; | |
143 GtkTextBuffer *entry_buffer; | |
144 GtkWidget *entry; | |
145 | |
146 GtkWidget *send; | |
147 GtkWidget *info; | |
148 GtkWidget *close; | |
6392
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
5908
diff
changeset
|
149 GtkWidget *icon; |
4359 | 150 GtkWidget *tab_label; |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
151 GtkWidget *menu_icon; |
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
152 GtkWidget *menu_label; |
4359 | 153 GtkSizeGroup *sg; |
154 | |
155 GtkWidget *bbox; | |
156 GtkWidget *sw; | |
157 | |
158 struct | |
159 { | |
160 GtkWidget *toolbar; | |
4685 | 161 |
4359 | 162 GtkWidget *bold; |
163 GtkWidget *italic; | |
164 GtkWidget *underline; | |
165 | |
5049 | 166 GtkWidget *larger_size; |
4359 | 167 GtkWidget *normal_size; |
5049 | 168 GtkWidget *smaller_size; |
4359 | 169 |
4685 | 170 GtkWidget *font; |
4359 | 171 GtkWidget *fgcolor; |
172 GtkWidget *bgcolor; | |
173 | |
174 GtkWidget *image; | |
175 GtkWidget *link; | |
176 GtkWidget *smiley; | |
177 GtkWidget *log; | |
4685 | 178 |
4359 | 179 } toolbar; |
180 | |
181 struct | |
182 { | |
183 GtkWidget *fg_color; | |
184 GtkWidget *bg_color; | |
185 GtkWidget *font; | |
186 GtkWidget *smiley; | |
187 GtkWidget *link; | |
5106 | 188 GtkWidget *image; |
4359 | 189 GtkWidget *log; |
7295 | 190 GtkWidget *search; |
4359 | 191 |
192 } dialogs; | |
193 | |
194 union | |
195 { | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
196 GaimGtkImPane *im; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
197 GaimGtkChatPane *chat; |
4359 | 198 |
199 } u; | |
200 }; | |
201 | |
202 #define GAIM_GTK_WINDOW(win) \ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
203 ((GaimGtkWindow *)(win)->ui_data) |
4359 | 204 |
205 #define GAIM_GTK_CONVERSATION(conv) \ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
206 ((GaimGtkConversation *)(conv)->ui_data) |
4359 | 207 |
4384
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
208 #define GAIM_IS_GTK_WINDOW(win) \ |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
209 (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
|
210 |
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
211 #define GAIM_IS_GTK_CONVERSATION(conv) \ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
212 (gaim_conversation_get_ui_ops(conv) == \ |
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
213 gaim_gtk_conversations_get_conv_ui_ops()) |
4359 | 214 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
215 /*@}*/ |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
216 |
4359 | 217 /************************************************************************** |
218 * @name GTK+ Conversation API | |
219 **************************************************************************/ | |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
220 /*@{*/ |
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 * Initializes the GTK+ conversation system. |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
224 */ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
225 void gaim_gtk_conversations_init(void); |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
226 |
4359 | 227 /** |
228 * Returns the UI operations structure for GTK windows. | |
229 * | |
230 * @return The GTK window operations structure. | |
231 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
232 GaimConvWindowUiOps *gaim_gtk_conversations_get_win_ui_ops(void); |
4359 | 233 |
234 /** | |
235 * Returns the UI operations structure for GTK conversations. | |
236 * | |
237 * @return The GTK conversation operations structure. | |
238 */ | |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
239 GaimConversationUiOps *gaim_gtk_conversations_get_conv_ui_ops(void); |
4359 | 240 |
241 /** | |
242 * Updates the buddy icon on a conversation. | |
243 * | |
244 * @param conv The conversation. | |
245 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
246 void gaim_gtkconv_update_buddy_icon(GaimConversation *conv); |
4359 | 247 |
248 /** | |
249 * Updates the font buttons on all conversations to reflect any changed | |
250 * preferences. | |
251 */ | |
252 void gaim_gtkconv_update_font_buttons(void); | |
253 | |
254 /** | |
4421 | 255 * Updates the font colors of each conversation to the new colors |
256 * chosen in the prefs dialog. | |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
257 * |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
258 * @param conv The conversation to update. |
4421 | 259 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
260 void gaim_gtkconv_update_font_colors(GaimConversation *conv); |
4421 | 261 |
262 /** | |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
263 * Updates the font faces of each conversation to the new font |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
264 * face chosen in the prefs dialog. |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
265 * |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
266 * @param conv The conversation to update. |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
267 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
268 void gaim_gtkconv_update_font_face(GaimConversation *conv); |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
269 |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
270 /** |
4359 | 271 * Updates the tab positions on all conversation windows to reflect any |
272 * changed preferences. | |
273 */ | |
274 void gaim_gtkconv_update_tabs(void); | |
275 | |
276 /** | |
277 * Updates the button style on chat windows to reflect any | |
278 * changed preferences. | |
279 */ | |
280 void gaim_gtkconv_update_chat_button_style(); | |
281 | |
282 /** | |
283 * Updates the button style on IM windows to reflect any | |
284 * changed preferences. | |
285 */ | |
286 void gaim_gtkconv_update_im_button_style(); | |
287 | |
288 /** | |
289 * Updates conversation buttons by protocol. | |
290 * | |
291 * @param conv The conversation. | |
292 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
293 void gaim_gtkconv_update_buttons_by_protocol(GaimConversation *conv); |
4359 | 294 |
295 /** | |
296 * Returns the window at the specified X, Y location. | |
297 * | |
298 * If the window is not a GTK+ window, @c NULL is returned. | |
299 * | |
300 * @param x The X coordinate. | |
301 * @param y The Y coordinate. | |
302 * | |
303 * @return The GTK+ window at the location, if it exists, or @c NULL otherwise. | |
304 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
305 GaimConvWindow *gaim_gtkwin_get_at_xy(int x, int y); |
4359 | 306 |
307 /** | |
308 * Returns the index of the tab at the specified X, Y location in a notebook. | |
309 * | |
310 * @param win The GTK+ window containing the notebook. | |
311 * @param x The X coordinate. | |
312 * @param y The Y coordinate. | |
313 * | |
314 * @return The index of the tab at the location. | |
315 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
316 int gaim_gtkconv_get_tab_at_xy(GaimConvWindow *win, int x, int y); |
4359 | 317 |
318 /** | |
319 * Returns the index of the destination tab at the | |
320 * specified X, Y location in a notebook. | |
321 * | |
322 * This is used for drag-and-drop functions when the tab at the index | |
323 * is a destination tab. | |
324 * | |
325 * @param win The GTK+ window containing the notebook. | |
326 * @param x The X coordinate. | |
327 * @param y The Y coordinate. | |
328 * | |
329 * @return The index of the tab at the location. | |
330 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
331 int gaim_gtkconv_get_dest_tab_at_xy(GaimConvWindow *win, int x, int y); |
4359 | 332 |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
333 /*@}*/ |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
334 |
4359 | 335 #endif /* _GAIM_GTK_CONVERSATION_H_ */ |