Mercurial > pidgin
annotate src/gtkconv.h @ 4677:24657a33e9e5
[gaim-migrate @ 4988]
this was stupid
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sat, 08 Mar 2003 17:46:17 +0000 |
parents | 5cdfd20daa07 |
children | 794cc8ec1166 |
rev | line source |
---|---|
4359 | 1 /** |
2 * @file gtkconv.h GTK+ Conversation API | |
3 * | |
4 * gaim | |
5 * | |
6 * Copyright (C) 2002-2003, Christian Hammond <chipx86@gnupdate.org> | |
7 * | |
8 * This program is free software; you can redistribute it and/or modify | |
9 * it under the terms of the GNU General Public License as published by | |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License | |
19 * along with this program; if not, write to the Free Software | |
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
21 * | |
22 */ | |
23 | |
24 #ifndef _GAIM_GTK_CONVERSATION_H_ | |
25 #define _GAIM_GTK_CONVERSATION_H_ | |
26 | |
27 /************************************************************************** | |
28 * @name Structures | |
29 **************************************************************************/ | |
30 | |
31 struct gaim_gtk_window; | |
32 struct gaim_gtk_conversation; | |
33 struct gaim_gtk_im_pane; | |
34 struct gaim_gtk_chat_pane; | |
35 | |
36 /** | |
37 * A GTK+ representation of a graphical window containing one or more | |
38 * conversations. | |
39 */ | |
40 struct gaim_gtk_window | |
41 { | |
42 GtkWidget *window; /**< The window. */ | |
43 GtkWidget *notebook; /**< The notebook of conversations. */ | |
44 | |
45 struct | |
46 { | |
47 GtkWidget *menubar; | |
48 | |
49 GtkWidget *view_history; | |
50 GtkWidget *insert_link; | |
51 GtkWidget *insert_image; | |
52 GtkWidget *logging; | |
53 GtkWidget *sounds; | |
54 GtkWidget *send_as; | |
55 | |
4630 | 56 GtkItemFactory *item_factory; |
57 | |
4359 | 58 } menu; |
59 | |
60 /* Tab dragging stuff. */ | |
61 gboolean in_drag; | |
62 gboolean in_predrag; | |
63 | |
64 gint drag_min_x, drag_max_x, drag_min_y, drag_max_y; | |
65 | |
66 gint drag_motion_signal; | |
67 gint drag_leave_signal; | |
68 }; | |
69 | |
70 /** | |
71 * GTK+ Instant Message panes. | |
72 */ | |
73 struct gaim_gtk_im_pane | |
74 { | |
75 GtkWidget *warn; | |
76 GtkWidget *block; | |
77 GtkWidget *add; | |
78 GtkWidget *sep1; | |
79 GtkWidget *sep2; | |
80 GtkWidget *check; | |
81 GtkWidget *progress; | |
82 | |
83 gboolean a_virgin; | |
84 | |
85 /* Buddy icon stuff */ | |
86 GtkWidget *icon; | |
87 GdkPixbufAnimation *anim; | |
88 GdkPixbufAnimationIter *iter; | |
89 guint32 icon_timer; | |
90 GtkWidget *save_icon; | |
91 }; | |
92 | |
93 /** | |
94 * GTK+ Chat panes. | |
95 */ | |
96 struct gaim_gtk_chat_pane | |
97 { | |
98 GtkWidget *count; | |
99 GtkWidget *list; | |
100 GtkWidget *whisper; | |
101 GtkWidget *invite; | |
102 GtkWidget *topic_text; | |
103 }; | |
104 | |
105 /** | |
106 * A GTK+ conversation pane. | |
107 */ | |
108 struct gaim_gtk_conversation | |
109 { | |
110 gboolean make_sound; | |
111 gboolean has_font; | |
112 char fontface[128]; | |
113 GdkColor fg_color; | |
114 GdkColor bg_color; | |
115 | |
116 GtkTooltips *tooltips; | |
117 | |
118 GtkWidget *tab_cont; | |
119 GtkWidget *tabby; | |
120 | |
121 GtkWidget *imhtml; | |
122 GtkTextBuffer *entry_buffer; | |
123 GtkWidget *entry; | |
124 | |
125 GtkWidget *send; | |
126 GtkWidget *info; | |
127 GtkWidget *close; | |
128 GtkWidget *tab_label; | |
129 GtkSizeGroup *sg; | |
130 | |
131 GtkWidget *bbox; | |
132 GtkWidget *sw; | |
133 | |
134 struct | |
135 { | |
136 GtkWidget *toolbar; | |
137 | |
138 GtkWidget *bold; | |
139 GtkWidget *italic; | |
140 GtkWidget *underline; | |
141 | |
142 GtkWidget *normal_size; | |
143 | |
144 GtkWidget *fgcolor; | |
145 GtkWidget *bgcolor; | |
146 | |
147 GtkWidget *image; | |
148 GtkWidget *link; | |
149 GtkWidget *smiley; | |
150 GtkWidget *log; | |
151 | |
152 } toolbar; | |
153 | |
154 struct | |
155 { | |
156 GtkWidget *fg_color; | |
157 GtkWidget *bg_color; | |
158 GtkWidget *font; | |
159 GtkWidget *smiley; | |
160 GtkWidget *link; | |
161 GtkWidget *log; | |
162 | |
163 } dialogs; | |
164 | |
165 union | |
166 { | |
167 struct gaim_gtk_im_pane *im; | |
168 struct gaim_gtk_chat_pane *chat; | |
169 | |
170 } u; | |
171 }; | |
172 | |
173 #define GAIM_GTK_WINDOW(win) \ | |
174 ((struct gaim_gtk_window *)(win)->ui_data) | |
175 | |
176 #define GAIM_GTK_CONVERSATION(conv) \ | |
177 ((struct gaim_gtk_conversation *)(conv)->ui_data) | |
178 | |
4384
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
179 #define GAIM_IS_GTK_WINDOW(win) \ |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4445
diff
changeset
|
180 (gaim_window_get_ui_ops(win) == gaim_get_gtk_window_ui_ops()) |
4384
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
181 |
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
182 #define GAIM_IS_GTK_CONVERSATION(conv) \ |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4445
diff
changeset
|
183 (gaim_conversation_get_ui_ops(conv) == gaim_get_gtk_conversation_ui_ops()) |
4359 | 184 |
185 /************************************************************************** | |
186 * @name GTK+ Conversation API | |
187 **************************************************************************/ | |
188 /** | |
189 * Returns the UI operations structure for GTK windows. | |
190 * | |
191 * @return The GTK window operations structure. | |
192 */ | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4445
diff
changeset
|
193 struct gaim_window_ui_ops *gaim_get_gtk_window_ui_ops(void); |
4359 | 194 |
195 /** | |
196 * Returns the UI operations structure for GTK conversations. | |
197 * | |
198 * @return The GTK conversation operations structure. | |
199 */ | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4445
diff
changeset
|
200 struct gaim_conversation_ui_ops *gaim_get_gtk_conversation_ui_ops(void); |
4359 | 201 |
202 /** | |
203 * Sets a lock on the update state. | |
204 * | |
205 * @param lock The lock state. | |
206 */ | |
207 void gaim_gtk_set_state_lock(gboolean lock); | |
208 | |
209 /** | |
210 * Returns the lock state. | |
211 * | |
212 * @return The lock state. | |
213 */ | |
214 gboolean gaim_gtk_is_state_locked(void); | |
215 | |
216 /** | |
217 * Toggles the display of smileys. | |
218 */ | |
219 void gaim_gtkconv_toggle_smileys(void); | |
220 | |
221 /** | |
222 * Toggles the display of timestamps. | |
223 */ | |
224 void gaim_gtkconv_toggle_timestamps(void); | |
225 | |
226 /** | |
227 * Toggles spell checking. | |
228 */ | |
229 void gaim_gtkconv_toggle_spellchk(void); | |
230 | |
231 /** | |
4445 | 232 * Toggles the presence of close buttons on tabs |
233 */ | |
234 void gaim_gtkconv_toggle_close_buttons(void); | |
235 | |
236 /** | |
4359 | 237 * Updates the buddy icon on a conversation. |
238 * | |
239 * @param conv The conversation. | |
240 */ | |
241 void gaim_gtkconv_update_buddy_icon(struct gaim_conversation *conv); | |
242 | |
243 /** | |
244 * Hides buddy icons on all conversations. | |
245 */ | |
246 void gaim_gtkconv_hide_buddy_icons(void); | |
247 | |
248 /** | |
249 * Enables or disables animation on all conversations, based off | |
250 * preferences. | |
251 */ | |
252 void gaim_gtkconv_set_anim(void); | |
253 | |
254 /** | |
255 * Updates the font buttons on all conversations to reflect any changed | |
256 * preferences. | |
257 */ | |
258 void gaim_gtkconv_update_font_buttons(void); | |
259 | |
260 /** | |
4421 | 261 * Updates the font colors of each conversation to the new colors |
262 * chosen in the prefs dialog. | |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
263 * |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
264 * @param conv The conversation to update. |
4421 | 265 */ |
266 void gaim_gtkconv_update_font_colors(struct gaim_conversation *conv); | |
267 | |
268 /** | |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
269 * Updates the font faces of each conversation to the new font |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
270 * face chosen in the prefs dialog. |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
271 * |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
272 * @param conv The conversation to update. |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
273 */ |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
274 void gaim_gtkconv_update_font_face(struct gaim_conversation *conv); |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
275 |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
276 /** |
4359 | 277 * Updates the tab positions on all conversation windows to reflect any |
278 * changed preferences. | |
279 */ | |
280 void gaim_gtkconv_update_tabs(void); | |
281 | |
282 /** | |
283 * Updates the button style on chat windows to reflect any | |
284 * changed preferences. | |
285 */ | |
286 void gaim_gtkconv_update_chat_button_style(); | |
287 | |
288 /** | |
289 * Updates the button style on IM windows to reflect any | |
290 * changed preferences. | |
291 */ | |
292 void gaim_gtkconv_update_im_button_style(); | |
293 | |
294 /** | |
295 * Updates conversation buttons by protocol. | |
296 * | |
297 * @param conv The conversation. | |
298 */ | |
299 void gaim_gtkconv_update_buttons_by_protocol(struct gaim_conversation *conv); | |
300 | |
301 /** | |
302 * Returns the window at the specified X, Y location. | |
303 * | |
304 * If the window is not a GTK+ window, @c NULL is returned. | |
305 * | |
306 * @param x The X coordinate. | |
307 * @param y The Y coordinate. | |
308 * | |
309 * @return The GTK+ window at the location, if it exists, or @c NULL otherwise. | |
310 */ | |
311 struct gaim_window *gaim_gtkwin_get_at_xy(int x, int y); | |
312 | |
313 /** | |
314 * Returns the index of the tab at the specified X, Y location in a notebook. | |
315 * | |
316 * @param win The GTK+ window containing the notebook. | |
317 * @param x The X coordinate. | |
318 * @param y The Y coordinate. | |
319 * | |
320 * @return The index of the tab at the location. | |
321 */ | |
322 int gaim_gtkconv_get_tab_at_xy(struct gaim_window *win, int x, int y); | |
323 | |
324 /** | |
325 * Returns the index of the destination tab at the | |
326 * specified X, Y location in a notebook. | |
327 * | |
328 * This is used for drag-and-drop functions when the tab at the index | |
329 * is a destination tab. | |
330 * | |
331 * @param win The GTK+ window containing the notebook. | |
332 * @param x The X coordinate. | |
333 * @param y The Y coordinate. | |
334 * | |
335 * @return The index of the tab at the location. | |
336 */ | |
337 int gaim_gtkconv_get_dest_tab_at_xy(struct gaim_window *win, int x, int y); | |
338 | |
339 #endif /* _GAIM_GTK_CONVERSATION_H_ */ |