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