Mercurial > pidgin.yaz
annotate src/gtkconv.h @ 10359:242b5482910e
[gaim-migrate @ 11577]
leak & compile warning fixes, and death-to-extra-typing-notification-pixels
from Gary.
I noticed we were installing core header files twice, so now we don't.
committer: Tailor Script <tailor@pidgin.im>
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Mon, 13 Dec 2004 14:58:33 +0000 |
parents | 393750603513 |
children | d23802800eeb |
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 *warn; | |
81 GtkWidget *invite; | |
82 | |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
83 GtkWidget *alias; |
7887 | 84 GtkWidget *block; |
85 GtkWidget *add; | |
86 GtkWidget *remove; | |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
87 |
7859 | 88 GtkWidget *insert_link; |
89 GtkWidget *insert_image; | |
90 | |
4359 | 91 GtkWidget *logging; |
92 GtkWidget *sounds; | |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
93 GtkWidget *show_formatting_toolbar; |
9188 | 94 GtkWidget *show_timestamps; |
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 | |
108 gint drag_min_x, drag_max_x, drag_min_y, drag_max_y; | |
109 | |
110 gint drag_motion_signal; | |
111 gint drag_leave_signal; | |
112 }; | |
113 | |
114 /** | |
7820 | 115 * A GTK+ Instant Message pane. |
4359 | 116 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
117 struct _GaimGtkImPane |
4359 | 118 { |
119 GtkWidget *block; | |
9468 | 120 GtkWidget *send_file; |
4359 | 121 GtkWidget *sep1; |
122 GtkWidget *sep2; | |
123 GtkWidget *check; | |
124 GtkWidget *progress; | |
125 | |
126 gboolean a_virgin; | |
127 | |
128 /* Buddy icon stuff */ | |
9885 | 129 GtkWidget *icon_container; |
4359 | 130 GtkWidget *icon; |
9687 | 131 gboolean show_icon; |
8189 | 132 gboolean animate; |
4359 | 133 GdkPixbufAnimation *anim; |
134 GdkPixbufAnimationIter *iter; | |
135 guint32 icon_timer; | |
136 }; | |
137 | |
138 /** | |
139 * GTK+ Chat panes. | |
140 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
141 struct _GaimGtkChatPane |
4359 | 142 { |
143 GtkWidget *count; | |
144 GtkWidget *list; | |
145 GtkWidget *topic_text; | |
146 }; | |
147 | |
148 /** | |
149 * A GTK+ conversation pane. | |
150 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
151 struct _GaimGtkConversation |
4359 | 152 { |
153 gboolean make_sound; | |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
154 gboolean show_formatting_toolbar; |
9188 | 155 gboolean show_timestamps; |
4359 | 156 |
157 GtkTooltips *tooltips; | |
158 | |
159 GtkWidget *tab_cont; | |
160 GtkWidget *tabby; | |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
161 GtkWidget *menu_tabby; |
4359 | 162 |
163 GtkWidget *imhtml; | |
164 GtkTextBuffer *entry_buffer; | |
165 GtkWidget *entry; | |
166 | |
7930 | 167 GtkWidget *close; /* "x" on the tab */ |
6392
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
5908
diff
changeset
|
168 GtkWidget *icon; |
4359 | 169 GtkWidget *tab_label; |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
170 GtkWidget *menu_icon; |
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
171 GtkWidget *menu_label; |
4359 | 172 GtkSizeGroup *sg; |
173 | |
9332 | 174 GtkWidget *lower_hbox; |
4359 | 175 |
8317 | 176 GtkWidget *toolbar; |
4359 | 177 |
178 struct | |
179 { | |
5106 | 180 GtkWidget *image; |
7295 | 181 GtkWidget *search; |
4359 | 182 |
183 } dialogs; | |
184 | |
185 union | |
186 { | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
187 GaimGtkImPane *im; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
188 GaimGtkChatPane *chat; |
4359 | 189 |
190 } u; | |
191 }; | |
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 conversation buttons by protocol. | |
229 * | |
230 * @param conv The conversation. | |
231 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
232 void gaim_gtkconv_update_buttons_by_protocol(GaimConversation *conv); |
4359 | 233 |
234 /** | |
9759 | 235 * Creates a conversation button |
236 * | |
237 * @param icon The stock icon name. | |
238 * @param text The text for the button. | |
239 * @param tooltip The tooltip text. | |
240 * @param tooltips The group of tooltips. | |
241 * @param callback A function to call when the button is clicked. | |
242 * @param data Data to pass to the callback. | |
243 * | |
244 * @return The button | |
245 */ | |
246 GtkWidget *gaim_gtkconv_button_new(const char *icon, const char *text, | |
247 const char *tooltip, GtkTooltips *tooltips, | |
248 void *callback, void *data); | |
249 | |
250 /** | |
4359 | 251 * Returns the window at the specified X, Y location. |
252 * | |
253 * If the window is not a GTK+ window, @c NULL is returned. | |
254 * | |
255 * @param x The X coordinate. | |
256 * @param y The Y coordinate. | |
257 * | |
258 * @return The GTK+ window at the location, if it exists, or @c NULL otherwise. | |
259 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
260 GaimConvWindow *gaim_gtkwin_get_at_xy(int x, int y); |
4359 | 261 |
262 /** | |
263 * Returns the index of the tab at the specified X, Y location in a notebook. | |
264 * | |
265 * @param win The GTK+ window containing the notebook. | |
266 * @param x The X coordinate. | |
267 * @param y The Y coordinate. | |
268 * | |
269 * @return The index of the tab at the location. | |
270 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
271 int gaim_gtkconv_get_tab_at_xy(GaimConvWindow *win, int x, int y); |
4359 | 272 |
273 /** | |
274 * Returns the index of the destination tab at the | |
275 * specified X, Y location in a notebook. | |
276 * | |
277 * This is used for drag-and-drop functions when the tab at the index | |
278 * is a destination tab. | |
279 * | |
280 * @param win The GTK+ window containing the notebook. | |
281 * @param x The X coordinate. | |
282 * @param y The Y coordinate. | |
283 * | |
284 * @return The index of the tab at the location. | |
285 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
286 int gaim_gtkconv_get_dest_tab_at_xy(GaimConvWindow *win, int x, int y); |
4359 | 287 |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
288 /*@}*/ |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
289 |
8582
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 /** @name GTK+ Conversations Subsystem */ |
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 /*@{*/ |
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 * Returns the gtk conversations subsystem handle. |
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 * @return The 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 void *gaim_gtk_conversations_get_handle(void); |
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 /** |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
303 * Initializes the GTK+ conversations subsystem. |
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 void gaim_gtk_conversations_init(void); |
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 /** |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
308 * Uninitialized the GTK+ conversation subsystem. |
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 void gaim_gtk_conversations_uninit(void); |
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 /*@}*/ |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
313 |
9713 | 314 #endif /* _GAIM_GTKCONVERSATION_H_ */ |