Mercurial > pidgin.yaz
annotate src/gtkconv.h @ 11415:66fe476474ec
[gaim-migrate @ 13652]
update this slightly
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Thu, 01 Sep 2005 20:48:29 +0000 |
parents | 65658ff2deb8 |
children | 201617d49573 |
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 */ | |
9713 | 25 #ifndef _GAIM_GTKCONVERSATION_H_ |
26 #define _GAIM_GTKCONVERSATION_H_ | |
4359 | 27 |
10008 | 28 typedef struct _GaimGtkWindow GaimGtkWindow; |
29 typedef struct _GaimGtkImPane GaimGtkImPane; | |
30 typedef struct _GaimGtkChatPane GaimGtkChatPane; | |
31 typedef struct _GaimGtkConversation GaimGtkConversation; | |
9709 | 32 |
9498 | 33 enum { |
34 CHAT_USERS_ICON_COLUMN, | |
35 CHAT_USERS_NAME_COLUMN, | |
9554 | 36 CHAT_USERS_FLAGS_COLUMN, |
9498 | 37 CHAT_USERS_COLUMNS |
38 }; | |
39 | |
10008 | 40 #define GAIM_GTK_WINDOW(win) \ |
41 ((GaimGtkWindow *)(win)->ui_data) | |
42 | |
43 #define GAIM_GTK_CONVERSATION(conv) \ | |
44 ((GaimGtkConversation *)(conv)->ui_data) | |
45 | |
46 #define GAIM_IS_GTK_WINDOW(win) \ | |
47 (gaim_conv_window_get_ui_ops(win) == gaim_gtk_conversations_get_win_ui_ops()) | |
48 | |
49 #define GAIM_IS_GTK_CONVERSATION(conv) \ | |
50 (gaim_conversation_get_ui_ops(conv) == \ | |
51 gaim_gtk_conversations_get_conv_ui_ops()) | |
52 | |
53 #include "gtkgaim.h" | |
54 #include "conversation.h" | |
55 | |
4359 | 56 /************************************************************************** |
57 * @name Structures | |
58 **************************************************************************/ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
59 /*@{*/ |
4359 | 60 |
61 /** | |
62 * A GTK+ representation of a graphical window containing one or more | |
63 * conversations. | |
64 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
65 struct _GaimGtkWindow |
4359 | 66 { |
67 GtkWidget *window; /**< The window. */ | |
68 GtkWidget *notebook; /**< The notebook of conversations. */ | |
69 | |
70 struct | |
71 { | |
10359 | 72 GtkWidget *menubox; |
4359 | 73 GtkWidget *menubar; |
74 | |
5167 | 75 GtkWidget *view_log; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
76 |
9468 | 77 GtkWidget *send_file; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
78 GtkWidget *add_pounce; |
7887 | 79 GtkWidget *get_info; |
80 GtkWidget *invite; | |
81 | |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
82 GtkWidget *alias; |
7887 | 83 GtkWidget *block; |
84 GtkWidget *add; | |
85 GtkWidget *remove; | |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
86 |
7859 | 87 GtkWidget *insert_link; |
88 GtkWidget *insert_image; | |
89 | |
4359 | 90 GtkWidget *logging; |
91 GtkWidget *sounds; | |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
92 GtkWidget *show_formatting_toolbar; |
9188 | 93 GtkWidget *show_timestamps; |
10456 | 94 GtkWidget *show_icon; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
95 |
4359 | 96 GtkWidget *send_as; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
97 |
4736 | 98 GtkWidget *typing_icon; |
4359 | 99 |
4630 | 100 GtkItemFactory *item_factory; |
101 | |
4359 | 102 } menu; |
103 | |
104 /* Tab dragging stuff. */ | |
105 gboolean in_drag; | |
106 gboolean in_predrag; | |
107 | |
11279
ed5302df41b0
[gaim-migrate @ 13474]
Luke Schierer <lschiere@pidgin.im>
parents:
11257
diff
changeset
|
108 gint drag_tab; |
ed5302df41b0
[gaim-migrate @ 13474]
Luke Schierer <lschiere@pidgin.im>
parents:
11257
diff
changeset
|
109 |
4359 | 110 gint drag_min_x, drag_max_x, drag_min_y, drag_max_y; |
111 | |
112 gint drag_motion_signal; | |
113 gint drag_leave_signal; | |
114 }; | |
115 | |
116 /** | |
7820 | 117 * A GTK+ Instant Message pane. |
4359 | 118 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
119 struct _GaimGtkImPane |
4359 | 120 { |
121 GtkWidget *block; | |
9468 | 122 GtkWidget *send_file; |
4359 | 123 GtkWidget *sep1; |
124 GtkWidget *sep2; | |
125 GtkWidget *check; | |
126 GtkWidget *progress; | |
127 | |
128 gboolean a_virgin; | |
129 | |
130 /* Buddy icon stuff */ | |
9885 | 131 GtkWidget *icon_container; |
4359 | 132 GtkWidget *icon; |
9687 | 133 gboolean show_icon; |
8189 | 134 gboolean animate; |
4359 | 135 GdkPixbufAnimation *anim; |
136 GdkPixbufAnimationIter *iter; | |
137 guint32 icon_timer; | |
138 }; | |
139 | |
140 /** | |
141 * GTK+ Chat panes. | |
142 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
143 struct _GaimGtkChatPane |
4359 | 144 { |
145 GtkWidget *count; | |
146 GtkWidget *list; | |
147 GtkWidget *topic_text; | |
10500 | 148 GtkWidget *userlist_im; |
149 GtkWidget *userlist_ignore; | |
150 GtkWidget *userlist_info; | |
4359 | 151 }; |
152 | |
153 /** | |
154 * A GTK+ conversation pane. | |
155 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
156 struct _GaimGtkConversation |
4359 | 157 { |
10810 | 158 GaimConversation *active_conv; |
159 GList *convs; | |
160 | |
4359 | 161 gboolean make_sound; |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
162 gboolean show_formatting_toolbar; |
9188 | 163 gboolean show_timestamps; |
4359 | 164 |
165 GtkTooltips *tooltips; | |
166 | |
167 GtkWidget *tab_cont; | |
168 GtkWidget *tabby; | |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
169 GtkWidget *menu_tabby; |
4359 | 170 |
171 GtkWidget *imhtml; | |
172 GtkTextBuffer *entry_buffer; | |
173 GtkWidget *entry; | |
174 | |
7930 | 175 GtkWidget *close; /* "x" on the tab */ |
6392
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
5908
diff
changeset
|
176 GtkWidget *icon; |
4359 | 177 GtkWidget *tab_label; |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
178 GtkWidget *menu_icon; |
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
179 GtkWidget *menu_label; |
4359 | 180 GtkSizeGroup *sg; |
181 | |
9332 | 182 GtkWidget *lower_hbox; |
4359 | 183 |
8317 | 184 GtkWidget *toolbar; |
4359 | 185 |
186 struct | |
187 { | |
5106 | 188 GtkWidget *image; |
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 | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
201 /*@}*/ |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
202 |
4359 | 203 /************************************************************************** |
204 * @name GTK+ Conversation API | |
205 **************************************************************************/ | |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
206 /*@{*/ |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
207 |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
208 /** |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10810
diff
changeset
|
209 * Returns the UI operations structure for GTK+ windows. |
4359 | 210 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10810
diff
changeset
|
211 * @return The GTK+ window operations structure. |
4359 | 212 */ |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
213 GaimConvWindowUiOps *gaim_gtk_conversations_get_win_ui_ops(void); |
4359 | 214 |
215 /** | |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10810
diff
changeset
|
216 * Returns the UI operations structure for GTK+ conversations. |
4359 | 217 * |
10814
364a2ef907ae
[gaim-migrate @ 12468]
Luke Schierer <lschiere@pidgin.im>
parents:
10810
diff
changeset
|
218 * @return The GTK+ conversation operations structure. |
4359 | 219 */ |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
220 GaimConversationUiOps *gaim_gtk_conversations_get_conv_ui_ops(void); |
4359 | 221 |
222 /** | |
223 * Updates the buddy icon on a conversation. | |
224 * | |
225 * @param conv The conversation. | |
226 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
227 void gaim_gtkconv_update_buddy_icon(GaimConversation *conv); |
4359 | 228 |
229 /** | |
230 * Updates the tab positions on all conversation windows to reflect any | |
231 * changed preferences. | |
232 */ | |
233 void gaim_gtkconv_update_tabs(void); | |
234 | |
235 /** | |
236 * Updates conversation buttons by protocol. | |
237 * | |
238 * @param conv The conversation. | |
239 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
240 void gaim_gtkconv_update_buttons_by_protocol(GaimConversation *conv); |
4359 | 241 |
242 /** | |
243 * Returns the window at the specified X, Y location. | |
244 * | |
245 * If the window is not a GTK+ window, @c NULL is returned. | |
246 * | |
247 * @param x The X coordinate. | |
248 * @param y The Y coordinate. | |
249 * | |
250 * @return The GTK+ window at the location, if it exists, or @c NULL otherwise. | |
251 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
252 GaimConvWindow *gaim_gtkwin_get_at_xy(int x, int y); |
4359 | 253 |
254 /** | |
255 * Returns the index of the tab at the specified X, Y location in a notebook. | |
256 * | |
257 * @param win The GTK+ window containing the notebook. | |
258 * @param x The X coordinate. | |
259 * @param y The Y coordinate. | |
260 * | |
261 * @return The index of the tab at the location. | |
262 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
263 int gaim_gtkconv_get_tab_at_xy(GaimConvWindow *win, int x, int y); |
4359 | 264 |
10827 | 265 GaimGtkConversation *gaim_gtk_get_gtkconv_at_index(const GaimConvWindow *win, int index); |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
266 /*@}*/ |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
267 |
8582
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
268 /**************************************************************************/ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
269 /** @name GTK+ Conversations Subsystem */ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
270 /**************************************************************************/ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
271 /*@{*/ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
272 |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
273 /** |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
274 * Returns the gtk conversations subsystem handle. |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
275 * |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
276 * @return The conversations subsystem handle. |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
277 */ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
278 void *gaim_gtk_conversations_get_handle(void); |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
279 |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
280 /** |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
281 * Initializes the GTK+ conversations subsystem. |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
282 */ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
283 void gaim_gtk_conversations_init(void); |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
284 |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
285 /** |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
286 * Uninitialized the GTK+ conversation subsystem. |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
287 */ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
288 void gaim_gtk_conversations_uninit(void); |
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 |
9713 | 292 #endif /* _GAIM_GTKCONVERSATION_H_ */ |