Mercurial > pidgin
annotate src/gtkconv.h @ 5674:2d86a5fa6fef
[gaim-migrate @ 6092]
More conversation preferences have callbacks now. We're almost there.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Mon, 02 Jun 2003 19:55:59 +0000 |
parents | 62f57ec16f29 |
children | dae79aefac8d |
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 | |
5167 | 49 GtkWidget *view_log; |
4359 | 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; | |
5106 | 165 GtkWidget *image; |
4359 | 166 GtkWidget *log; |
167 | |
168 } dialogs; | |
169 | |
170 union | |
171 { | |
172 struct gaim_gtk_im_pane *im; | |
173 struct gaim_gtk_chat_pane *chat; | |
174 | |
175 } u; | |
176 }; | |
177 | |
178 #define GAIM_GTK_WINDOW(win) \ | |
179 ((struct gaim_gtk_window *)(win)->ui_data) | |
180 | |
181 #define GAIM_GTK_CONVERSATION(conv) \ | |
182 ((struct gaim_gtk_conversation *)(conv)->ui_data) | |
183 | |
4384
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
184 #define GAIM_IS_GTK_WINDOW(win) \ |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4445
diff
changeset
|
185 (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
|
186 |
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
187 #define GAIM_IS_GTK_CONVERSATION(conv) \ |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4445
diff
changeset
|
188 (gaim_conversation_get_ui_ops(conv) == gaim_get_gtk_conversation_ui_ops()) |
4359 | 189 |
190 /************************************************************************** | |
191 * @name GTK+ Conversation API | |
192 **************************************************************************/ | |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
193 /*@{*/ |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
194 |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
195 /** |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
196 * Initializes the GTK+ conversation system. |
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 void gaim_gtk_conversation_init(void); |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
199 |
4359 | 200 /** |
201 * Returns the UI operations structure for GTK windows. | |
202 * | |
203 * @return The GTK window operations structure. | |
204 */ | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4445
diff
changeset
|
205 struct gaim_window_ui_ops *gaim_get_gtk_window_ui_ops(void); |
4359 | 206 |
207 /** | |
208 * Returns the UI operations structure for GTK conversations. | |
209 * | |
210 * @return The GTK conversation operations structure. | |
211 */ | |
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4445
diff
changeset
|
212 struct gaim_conversation_ui_ops *gaim_get_gtk_conversation_ui_ops(void); |
4359 | 213 |
214 /** | |
215 * Updates the buddy icon on a conversation. | |
216 * | |
217 * @param conv The conversation. | |
218 */ | |
219 void gaim_gtkconv_update_buddy_icon(struct gaim_conversation *conv); | |
220 | |
221 /** | |
222 * Updates the font buttons on all conversations to reflect any changed | |
223 * preferences. | |
224 */ | |
225 void gaim_gtkconv_update_font_buttons(void); | |
226 | |
227 /** | |
4421 | 228 * Updates the font colors of each conversation to the new colors |
229 * chosen in the prefs dialog. | |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
230 * |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
231 * @param conv The conversation to update. |
4421 | 232 */ |
233 void gaim_gtkconv_update_font_colors(struct gaim_conversation *conv); | |
234 | |
235 /** | |
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
236 * Updates the font faces of each conversation to the new font |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
237 * face chosen in the prefs dialog. |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
238 * |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
239 * @param conv The conversation to update. |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
240 */ |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
241 void gaim_gtkconv_update_font_face(struct gaim_conversation *conv); |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
242 |
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
243 /** |
4359 | 244 * Updates the tab positions on all conversation windows to reflect any |
245 * changed preferences. | |
246 */ | |
247 void gaim_gtkconv_update_tabs(void); | |
248 | |
249 /** | |
250 * Updates the button style on chat windows to reflect any | |
251 * changed preferences. | |
252 */ | |
253 void gaim_gtkconv_update_chat_button_style(); | |
254 | |
255 /** | |
256 * Updates the button style on IM windows to reflect any | |
257 * changed preferences. | |
258 */ | |
259 void gaim_gtkconv_update_im_button_style(); | |
260 | |
261 /** | |
262 * Updates conversation buttons by protocol. | |
263 * | |
264 * @param conv The conversation. | |
265 */ | |
266 void gaim_gtkconv_update_buttons_by_protocol(struct gaim_conversation *conv); | |
267 | |
268 /** | |
269 * Returns the window at the specified X, Y location. | |
270 * | |
271 * If the window is not a GTK+ window, @c NULL is returned. | |
272 * | |
273 * @param x The X coordinate. | |
274 * @param y The Y coordinate. | |
275 * | |
276 * @return The GTK+ window at the location, if it exists, or @c NULL otherwise. | |
277 */ | |
278 struct gaim_window *gaim_gtkwin_get_at_xy(int x, int y); | |
279 | |
280 /** | |
281 * Returns the index of the tab at the specified X, Y location in a notebook. | |
282 * | |
283 * @param win The GTK+ window containing the notebook. | |
284 * @param x The X coordinate. | |
285 * @param y The Y coordinate. | |
286 * | |
287 * @return The index of the tab at the location. | |
288 */ | |
289 int gaim_gtkconv_get_tab_at_xy(struct gaim_window *win, int x, int y); | |
290 | |
291 /** | |
292 * Returns the index of the destination tab at the | |
293 * specified X, Y location in a notebook. | |
294 * | |
295 * This is used for drag-and-drop functions when the tab at the index | |
296 * is a destination tab. | |
297 * | |
298 * @param win The GTK+ window containing the notebook. | |
299 * @param x The X coordinate. | |
300 * @param y The Y coordinate. | |
301 * | |
302 * @return The index of the tab at the location. | |
303 */ | |
304 int gaim_gtkconv_get_dest_tab_at_xy(struct gaim_window *win, int x, int y); | |
305 | |
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
306 /*@}*/ |
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
307 |
4359 | 308 #endif /* _GAIM_GTK_CONVERSATION_H_ */ |