Mercurial > pidgin.yaz
annotate src/gtkconv.h @ 4398:a8249a5250b6
[gaim-migrate @ 4667]
Made use of the new GAIM_IS_GTK_WINDOW() and GAIM_IS_GTK_CONVERSATION()
macros.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Wed, 22 Jan 2003 23:46:59 +0000 |
parents | bdab2840ef4c |
children | 31834b4598eb |
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 | |
56 } menu; | |
57 | |
58 /* Tab dragging stuff. */ | |
59 gboolean in_drag; | |
60 gboolean in_predrag; | |
61 | |
62 gint drag_min_x, drag_max_x, drag_min_y, drag_max_y; | |
63 | |
64 gint drag_motion_signal; | |
65 gint drag_leave_signal; | |
66 }; | |
67 | |
68 /** | |
69 * GTK+ Instant Message panes. | |
70 */ | |
71 struct gaim_gtk_im_pane | |
72 { | |
73 GtkWidget *warn; | |
74 GtkWidget *block; | |
75 GtkWidget *add; | |
76 GtkWidget *sep1; | |
77 GtkWidget *sep2; | |
78 GtkWidget *check; | |
79 GtkWidget *progress; | |
80 | |
81 gboolean a_virgin; | |
82 | |
83 /* Buddy icon stuff */ | |
84 GtkWidget *icon; | |
85 GdkPixbufAnimation *anim; | |
86 GdkPixbufAnimationIter *iter; | |
87 guint32 icon_timer; | |
88 GtkWidget *save_icon; | |
89 }; | |
90 | |
91 /** | |
92 * GTK+ Chat panes. | |
93 */ | |
94 struct gaim_gtk_chat_pane | |
95 { | |
96 GtkWidget *count; | |
97 GtkWidget *list; | |
98 GtkWidget *whisper; | |
99 GtkWidget *invite; | |
100 GtkWidget *topic_text; | |
101 }; | |
102 | |
103 /** | |
104 * A GTK+ conversation pane. | |
105 */ | |
106 struct gaim_gtk_conversation | |
107 { | |
108 gboolean make_sound; | |
109 gboolean has_font; | |
110 gboolean has_fg; | |
111 gboolean has_bg; | |
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) \ |
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
180 (gaim_window_get_ops(win) == gaim_get_gtk_window_ops()) |
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) \ |
4385
bdab2840ef4c
[gaim-migrate @ 4651]
Christian Hammond <chipx86@chipx86.com>
parents:
4384
diff
changeset
|
183 (gaim_conversation_get_ops(conv) == gaim_get_gtk_conversation_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 */ | |
193 struct gaim_window_ops *gaim_get_gtk_window_ops(void); | |
194 | |
195 /** | |
196 * Returns the UI operations structure for GTK conversations. | |
197 * | |
198 * @return The GTK conversation operations structure. | |
199 */ | |
200 struct gaim_conversation_ops *gaim_get_gtk_conversation_ops(void); | |
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 /** | |
232 * Updates the buddy icon on a conversation. | |
233 * | |
234 * @param conv The conversation. | |
235 */ | |
236 void gaim_gtkconv_update_buddy_icon(struct gaim_conversation *conv); | |
237 | |
238 /** | |
239 * Hides buddy icons on all conversations. | |
240 */ | |
241 void gaim_gtkconv_hide_buddy_icons(void); | |
242 | |
243 /** | |
244 * Enables or disables animation on all conversations, based off | |
245 * preferences. | |
246 */ | |
247 void gaim_gtkconv_set_anim(void); | |
248 | |
249 /** | |
250 * Updates the font buttons on all conversations to reflect any changed | |
251 * preferences. | |
252 */ | |
253 void gaim_gtkconv_update_font_buttons(void); | |
254 | |
255 /** | |
256 * Updates the tab positions on all conversation windows to reflect any | |
257 * changed preferences. | |
258 */ | |
259 void gaim_gtkconv_update_tabs(void); | |
260 | |
261 /** | |
262 * Updates the button style on chat windows to reflect any | |
263 * changed preferences. | |
264 */ | |
265 void gaim_gtkconv_update_chat_button_style(); | |
266 | |
267 /** | |
268 * Updates the button style on IM windows to reflect any | |
269 * changed preferences. | |
270 */ | |
271 void gaim_gtkconv_update_im_button_style(); | |
272 | |
273 /** | |
274 * Updates conversation buttons by protocol. | |
275 * | |
276 * @param conv The conversation. | |
277 */ | |
278 void gaim_gtkconv_update_buttons_by_protocol(struct gaim_conversation *conv); | |
279 | |
280 /** | |
281 * Returns the window at the specified X, Y location. | |
282 * | |
283 * If the window is not a GTK+ window, @c NULL is returned. | |
284 * | |
285 * @param x The X coordinate. | |
286 * @param y The Y coordinate. | |
287 * | |
288 * @return The GTK+ window at the location, if it exists, or @c NULL otherwise. | |
289 */ | |
290 struct gaim_window *gaim_gtkwin_get_at_xy(int x, int y); | |
291 | |
292 /** | |
293 * Returns the index of the tab at the specified X, Y location in a notebook. | |
294 * | |
295 * @param win The GTK+ window containing the notebook. | |
296 * @param x The X coordinate. | |
297 * @param y The Y coordinate. | |
298 * | |
299 * @return The index of the tab at the location. | |
300 */ | |
301 int gaim_gtkconv_get_tab_at_xy(struct gaim_window *win, int x, int y); | |
302 | |
303 /** | |
304 * Returns the index of the destination tab at the | |
305 * specified X, Y location in a notebook. | |
306 * | |
307 * This is used for drag-and-drop functions when the tab at the index | |
308 * is a destination tab. | |
309 * | |
310 * @param win The GTK+ window containing the notebook. | |
311 * @param x The X coordinate. | |
312 * @param y The Y coordinate. | |
313 * | |
314 * @return The index of the tab at the location. | |
315 */ | |
316 int gaim_gtkconv_get_dest_tab_at_xy(struct gaim_window *win, int x, int y); | |
317 | |
318 #endif /* _GAIM_GTK_CONVERSATION_H_ */ |