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