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