Mercurial > pidgin
annotate src/gtkconv.h @ 7904:9b478c6e0bfa
[gaim-migrate @ 8564]
Added support for invisible fields.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sun, 21 Dec 2003 08:57:56 +0000 |
parents | 4b43a3f9de73 |
children | 68f70cf074d0 |
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; |
7887 | 55 GtkWidget *get_info; |
56 GtkWidget *warn; | |
57 GtkWidget *invite; | |
58 | |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
59 GtkWidget *alias; |
7887 | 60 GtkWidget *block; |
61 GtkWidget *add; | |
62 GtkWidget *remove; | |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
63 |
7859 | 64 GtkWidget *insert_link; |
65 GtkWidget *insert_image; | |
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 /** | |
7820 | 90 * A GTK+ Instant Message pane. |
4359 | 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 *invite; | |
120 GtkWidget *topic_text; | |
121 }; | |
122 | |
123 /** | |
124 * A GTK+ conversation pane. | |
125 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
126 struct _GaimGtkConversation |
4359 | 127 { |
128 gboolean make_sound; | |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
129 gboolean show_formatting_toolbar; |
4359 | 130 gboolean has_font; |
131 char fontface[128]; | |
132 GdkColor fg_color; | |
133 GdkColor bg_color; | |
134 | |
135 GtkTooltips *tooltips; | |
136 | |
137 GtkWidget *tab_cont; | |
138 GtkWidget *tabby; | |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
139 GtkWidget *menu_tabby; |
4359 | 140 |
141 GtkWidget *imhtml; | |
142 GtkTextBuffer *entry_buffer; | |
143 GtkWidget *entry; | |
144 | |
145 GtkWidget *send; | |
146 GtkWidget *info; | |
147 GtkWidget *close; | |
6392
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
5908
diff
changeset
|
148 GtkWidget *icon; |
4359 | 149 GtkWidget *tab_label; |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
150 GtkWidget *menu_icon; |
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
151 GtkWidget *menu_label; |
4359 | 152 GtkSizeGroup *sg; |
153 | |
154 GtkWidget *bbox; | |
155 GtkWidget *sw; | |
156 | |
157 struct | |
158 { | |
159 GtkWidget *toolbar; | |
4685 | 160 |
4359 | 161 GtkWidget *bold; |
162 GtkWidget *italic; | |
163 GtkWidget *underline; | |
164 | |
5049 | 165 GtkWidget *larger_size; |
4359 | 166 GtkWidget *normal_size; |
5049 | 167 GtkWidget *smaller_size; |
4359 | 168 |
4685 | 169 GtkWidget *font; |
4359 | 170 GtkWidget *fgcolor; |
171 GtkWidget *bgcolor; | |
172 | |
173 GtkWidget *image; | |
174 GtkWidget *link; | |
175 GtkWidget *smiley; | |
176 GtkWidget *log; | |
4685 | 177 |
4359 | 178 } toolbar; |
179 | |
180 struct | |
181 { | |
182 GtkWidget *fg_color; | |
183 GtkWidget *bg_color; | |
184 GtkWidget *font; | |
185 GtkWidget *smiley; | |
186 GtkWidget *link; | |
5106 | 187 GtkWidget *image; |
4359 | 188 GtkWidget *log; |
7295 | 189 GtkWidget *search; |
4359 | 190 |
191 } dialogs; | |
192 | |
193 union | |
194 { | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
195 GaimGtkImPane *im; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
196 GaimGtkChatPane *chat; |
4359 | 197 |
198 } u; | |
199 }; | |
200 | |
201 #define GAIM_GTK_WINDOW(win) \ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
202 ((GaimGtkWindow *)(win)->ui_data) |
4359 | 203 |
204 #define GAIM_GTK_CONVERSATION(conv) \ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
205 ((GaimGtkConversation *)(conv)->ui_data) |
4359 | 206 |
4384
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
207 #define GAIM_IS_GTK_WINDOW(win) \ |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
208 (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
|
209 |
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
210 #define GAIM_IS_GTK_CONVERSATION(conv) \ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
211 (gaim_conversation_get_ui_ops(conv) == \ |
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
212 gaim_gtk_conversations_get_conv_ui_ops()) |
4359 | 213 |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
214 /*@}*/ |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
215 |
4359 | 216 /************************************************************************** |
217 * @name GTK+ Conversation API | |
218 **************************************************************************/ | |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
219 /*@{*/ |
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 * Initializes the GTK+ conversation system. |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
223 */ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
224 void gaim_gtk_conversations_init(void); |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
225 |
4359 | 226 /** |
227 * Returns the UI operations structure for GTK windows. | |
228 * | |
229 * @return The GTK window operations structure. | |
230 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
231 GaimConvWindowUiOps *gaim_gtk_conversations_get_win_ui_ops(void); |
4359 | 232 |
233 /** | |
234 * Returns the UI operations structure for GTK conversations. | |
235 * | |
236 * @return The GTK conversation operations structure. | |
237 */ | |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
238 GaimConversationUiOps *gaim_gtk_conversations_get_conv_ui_ops(void); |
4359 | 239 |
240 /** | |
241 * Updates the buddy icon on a conversation. | |
242 * | |
243 * @param conv The conversation. | |
244 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
245 void gaim_gtkconv_update_buddy_icon(GaimConversation *conv); |
4359 | 246 |
247 /** | |
248 * Updates the font buttons on all conversations to reflect any changed | |
249 * preferences. | |
250 */ | |
251 void gaim_gtkconv_update_font_buttons(void); | |
252 | |
253 /** | |
4421 | 254 * Updates the font colors of each conversation to the new colors |
255 * chosen in the prefs dialog. | |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
256 * |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
257 * @param conv The conversation to update. |
4421 | 258 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
259 void gaim_gtkconv_update_font_colors(GaimConversation *conv); |
4421 | 260 |
261 /** | |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
262 * Updates the font faces of each conversation to the new font |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
263 * face chosen in the prefs dialog. |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
264 * |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
265 * @param conv The conversation to update. |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
266 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
267 void gaim_gtkconv_update_font_face(GaimConversation *conv); |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
268 |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
269 /** |
4359 | 270 * Updates the tab positions on all conversation windows to reflect any |
271 * changed preferences. | |
272 */ | |
273 void gaim_gtkconv_update_tabs(void); | |
274 | |
275 /** | |
276 * Updates the button style on chat windows to reflect any | |
277 * changed preferences. | |
278 */ | |
279 void gaim_gtkconv_update_chat_button_style(); | |
280 | |
281 /** | |
282 * Updates the button style on IM windows to reflect any | |
283 * changed preferences. | |
284 */ | |
285 void gaim_gtkconv_update_im_button_style(); | |
286 | |
287 /** | |
288 * Updates conversation buttons by protocol. | |
289 * | |
290 * @param conv The conversation. | |
291 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
292 void gaim_gtkconv_update_buttons_by_protocol(GaimConversation *conv); |
4359 | 293 |
294 /** | |
295 * Returns the window at the specified X, Y location. | |
296 * | |
297 * If the window is not a GTK+ window, @c NULL is returned. | |
298 * | |
299 * @param x The X coordinate. | |
300 * @param y The Y coordinate. | |
301 * | |
302 * @return The GTK+ window at the location, if it exists, or @c NULL otherwise. | |
303 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
304 GaimConvWindow *gaim_gtkwin_get_at_xy(int x, int y); |
4359 | 305 |
306 /** | |
307 * Returns the index of the tab at the specified X, Y location in a notebook. | |
308 * | |
309 * @param win The GTK+ window containing the notebook. | |
310 * @param x The X coordinate. | |
311 * @param y The Y coordinate. | |
312 * | |
313 * @return The index of the tab at the location. | |
314 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
315 int gaim_gtkconv_get_tab_at_xy(GaimConvWindow *win, int x, int y); |
4359 | 316 |
317 /** | |
318 * Returns the index of the destination tab at the | |
319 * specified X, Y location in a notebook. | |
320 * | |
321 * This is used for drag-and-drop functions when the tab at the index | |
322 * is a destination tab. | |
323 * | |
324 * @param win The GTK+ window containing the notebook. | |
325 * @param x The X coordinate. | |
326 * @param y The Y coordinate. | |
327 * | |
328 * @return The index of the tab at the location. | |
329 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
330 int gaim_gtkconv_get_dest_tab_at_xy(GaimConvWindow *win, int x, int y); |
4359 | 331 |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
332 /*@}*/ |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
333 |
4359 | 334 #endif /* _GAIM_GTK_CONVERSATION_H_ */ |