Mercurial > pidgin.yaz
annotate src/gtkconv.h @ 10356:393750603513
[gaim-migrate @ 11573]
Removed conversation buttons.`
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 13 Dec 2004 03:04:07 +0000 |
parents | 53410b84336f |
children | 242b5482910e |
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 { | |
72 GtkWidget *menubar; | |
73 | |
5167 | 74 GtkWidget *view_log; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
75 |
9468 | 76 GtkWidget *send_file; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
77 GtkWidget *add_pounce; |
7887 | 78 GtkWidget *get_info; |
79 GtkWidget *warn; | |
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; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
94 |
4359 | 95 GtkWidget *send_as; |
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
96 |
4736 | 97 GtkWidget *typing_icon; |
4359 | 98 |
4630 | 99 GtkItemFactory *item_factory; |
100 | |
4359 | 101 } menu; |
102 | |
103 /* Tab dragging stuff. */ | |
104 gboolean in_drag; | |
105 gboolean in_predrag; | |
106 | |
107 gint drag_min_x, drag_max_x, drag_min_y, drag_max_y; | |
108 | |
109 gint drag_motion_signal; | |
110 gint drag_leave_signal; | |
111 }; | |
112 | |
113 /** | |
7820 | 114 * A GTK+ Instant Message pane. |
4359 | 115 */ |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
116 struct _GaimGtkImPane |
4359 | 117 { |
118 GtkWidget *block; | |
9468 | 119 GtkWidget *send_file; |
4359 | 120 GtkWidget *sep1; |
121 GtkWidget *sep2; | |
122 GtkWidget *check; | |
123 GtkWidget *progress; | |
124 | |
125 gboolean a_virgin; | |
126 | |
127 /* Buddy icon stuff */ | |
9885 | 128 GtkWidget *icon_container; |
4359 | 129 GtkWidget *icon; |
9687 | 130 gboolean show_icon; |
8189 | 131 gboolean animate; |
4359 | 132 GdkPixbufAnimation *anim; |
133 GdkPixbufAnimationIter *iter; | |
134 guint32 icon_timer; | |
135 }; | |
136 | |
137 /** | |
138 * GTK+ Chat panes. | |
139 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
140 struct _GaimGtkChatPane |
4359 | 141 { |
142 GtkWidget *count; | |
143 GtkWidget *list; | |
144 GtkWidget *topic_text; | |
145 }; | |
146 | |
147 /** | |
148 * A GTK+ conversation pane. | |
149 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
150 struct _GaimGtkConversation |
4359 | 151 { |
152 gboolean make_sound; | |
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
153 gboolean show_formatting_toolbar; |
9188 | 154 gboolean show_timestamps; |
4359 | 155 |
156 GtkTooltips *tooltips; | |
157 | |
158 GtkWidget *tab_cont; | |
159 GtkWidget *tabby; | |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
160 GtkWidget *menu_tabby; |
4359 | 161 |
162 GtkWidget *imhtml; | |
163 GtkTextBuffer *entry_buffer; | |
164 GtkWidget *entry; | |
165 | |
7930 | 166 GtkWidget *close; /* "x" on the tab */ |
6392
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
5908
diff
changeset
|
167 GtkWidget *icon; |
4359 | 168 GtkWidget *tab_label; |
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
169 GtkWidget *menu_icon; |
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
170 GtkWidget *menu_label; |
4359 | 171 GtkSizeGroup *sg; |
172 | |
9332 | 173 GtkWidget *lower_hbox; |
4359 | 174 |
8317 | 175 GtkWidget *toolbar; |
4359 | 176 |
177 struct | |
178 { | |
5106 | 179 GtkWidget *image; |
7295 | 180 GtkWidget *search; |
4359 | 181 |
182 } dialogs; | |
183 | |
184 union | |
185 { | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
186 GaimGtkImPane *im; |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
187 GaimGtkChatPane *chat; |
4359 | 188 |
189 } u; | |
190 }; | |
191 | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
192 /*@}*/ |
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
193 |
4359 | 194 /************************************************************************** |
195 * @name GTK+ Conversation API | |
196 **************************************************************************/ | |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
197 /*@{*/ |
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 /** |
4359 | 200 * Returns the UI operations structure for GTK windows. |
201 * | |
202 * @return The GTK window operations structure. | |
203 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
204 GaimConvWindowUiOps *gaim_gtk_conversations_get_win_ui_ops(void); |
4359 | 205 |
206 /** | |
207 * Returns the UI operations structure for GTK conversations. | |
208 * | |
209 * @return The GTK conversation operations structure. | |
210 */ | |
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
211 GaimConversationUiOps *gaim_gtk_conversations_get_conv_ui_ops(void); |
4359 | 212 |
213 /** | |
214 * Updates the buddy icon on a conversation. | |
215 * | |
216 * @param conv The conversation. | |
217 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
218 void gaim_gtkconv_update_buddy_icon(GaimConversation *conv); |
4359 | 219 |
220 /** | |
221 * Updates the tab positions on all conversation windows to reflect any | |
222 * changed preferences. | |
223 */ | |
224 void gaim_gtkconv_update_tabs(void); | |
225 | |
226 /** | |
227 * Updates conversation buttons by protocol. | |
228 * | |
229 * @param conv The conversation. | |
230 */ | |
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
231 void gaim_gtkconv_update_buttons_by_protocol(GaimConversation *conv); |
4359 | 232 |
233 /** | |
9759 | 234 * Creates a conversation button |
235 * | |
236 * @param icon The stock icon name. | |
237 * @param text The text for the button. | |
238 * @param tooltip The tooltip text. | |
239 * @param tooltips The group of tooltips. | |
240 * @param callback A function to call when the button is clicked. | |
241 * @param data Data to pass to the callback. | |
242 * | |
243 * @return The button | |
244 */ | |
245 GtkWidget *gaim_gtkconv_button_new(const char *icon, const char *text, | |
246 const char *tooltip, GtkTooltips *tooltips, | |
247 void *callback, void *data); | |
248 | |
249 /** | |
4359 | 250 * Returns the window at the specified X, Y location. |
251 * | |
252 * If the window is not a GTK+ window, @c NULL is returned. | |
253 * | |
254 * @param x The X coordinate. | |
255 * @param y The Y coordinate. | |
256 * | |
257 * @return The GTK+ window at the location, if it exists, or @c NULL otherwise. | |
258 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
259 GaimConvWindow *gaim_gtkwin_get_at_xy(int x, int y); |
4359 | 260 |
261 /** | |
262 * Returns the index of the tab at the specified X, Y location in a notebook. | |
263 * | |
264 * @param win The GTK+ window containing the notebook. | |
265 * @param x The X coordinate. | |
266 * @param y The Y coordinate. | |
267 * | |
268 * @return The index of the tab at the location. | |
269 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
270 int gaim_gtkconv_get_tab_at_xy(GaimConvWindow *win, int x, int y); |
4359 | 271 |
272 /** | |
273 * Returns the index of the destination tab at the | |
274 * specified X, Y location in a notebook. | |
275 * | |
276 * This is used for drag-and-drop functions when the tab at the index | |
277 * is a destination tab. | |
278 * | |
279 * @param win The GTK+ window containing the notebook. | |
280 * @param x The X coordinate. | |
281 * @param y The Y coordinate. | |
282 * | |
283 * @return The index of the tab at the location. | |
284 */ | |
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
285 int gaim_gtkconv_get_dest_tab_at_xy(GaimConvWindow *win, int x, int y); |
4359 | 286 |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
287 /*@}*/ |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
288 |
8582
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 /** @name GTK+ Conversations Subsystem */ |
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 /*@{*/ |
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 * Returns the gtk conversations subsystem handle. |
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 * @return The conversations subsystem handle. |
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 void *gaim_gtk_conversations_get_handle(void); |
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 /** |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
302 * Initializes the GTK+ conversations subsystem. |
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 void gaim_gtk_conversations_init(void); |
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 /** |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
307 * Uninitialized the GTK+ conversation subsystem. |
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 void gaim_gtk_conversations_uninit(void); |
d7c85220c685
[gaim-migrate @ 9332]
Christian Hammond <chipx86@chipx86.com>
parents:
8317
diff
changeset
|
310 |
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 |
9713 | 313 #endif /* _GAIM_GTKCONVERSATION_H_ */ |