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