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