Mercurial > pidgin
annotate src/gtkconv.h @ 5232:2d58a9a46292
[gaim-migrate @ 5602]
Fix a problem with people without perl. Er, FOR people without perl. We
can't do anything to fix them.
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Sat, 26 Apr 2003 19:46:34 +0000 |
| parents | d9073c83a8a0 |
| children | 62f57ec16f29 |
| 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 **************************************************************************/ | |
| 193 /** | |
| 194 * Returns the UI operations structure for GTK windows. | |
| 195 * | |
| 196 * @return The GTK window operations structure. | |
| 197 */ | |
|
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4445
diff
changeset
|
198 struct gaim_window_ui_ops *gaim_get_gtk_window_ui_ops(void); |
| 4359 | 199 |
| 200 /** | |
| 201 * Returns the UI operations structure for GTK conversations. | |
| 202 * | |
| 203 * @return The GTK conversation operations structure. | |
| 204 */ | |
|
4465
6e37eb000b7a
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4445
diff
changeset
|
205 struct gaim_conversation_ui_ops *gaim_get_gtk_conversation_ui_ops(void); |
| 4359 | 206 |
| 207 /** | |
| 208 * Toggles the display of smileys. | |
| 209 */ | |
| 210 void gaim_gtkconv_toggle_smileys(void); | |
| 211 | |
| 212 /** | |
| 213 * Toggles the display of timestamps. | |
| 214 */ | |
| 215 void gaim_gtkconv_toggle_timestamps(void); | |
| 216 | |
| 217 /** | |
| 218 * Toggles spell checking. | |
| 219 */ | |
| 220 void gaim_gtkconv_toggle_spellchk(void); | |
| 221 | |
| 222 /** | |
| 4445 | 223 * Toggles the presence of close buttons on tabs |
| 224 */ | |
| 225 void gaim_gtkconv_toggle_close_buttons(void); | |
| 226 | |
| 227 /** | |
| 4359 | 228 * Updates the buddy icon on a conversation. |
| 229 * | |
| 230 * @param conv The conversation. | |
| 231 */ | |
| 232 void gaim_gtkconv_update_buddy_icon(struct gaim_conversation *conv); | |
| 233 | |
| 234 /** | |
| 235 * Hides buddy icons on all conversations. | |
| 236 */ | |
| 237 void gaim_gtkconv_hide_buddy_icons(void); | |
| 238 | |
| 239 /** | |
| 240 * Enables or disables animation on all conversations, based off | |
| 241 * preferences. | |
| 242 */ | |
| 243 void gaim_gtkconv_set_anim(void); | |
| 244 | |
| 245 /** | |
| 246 * Updates the font buttons on all conversations to reflect any changed | |
| 247 * preferences. | |
| 248 */ | |
| 249 void gaim_gtkconv_update_font_buttons(void); | |
| 250 | |
| 251 /** | |
| 4421 | 252 * Updates the font colors of each conversation to the new colors |
| 253 * chosen in the prefs dialog. | |
|
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
254 * |
|
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
255 * @param conv The conversation to update. |
| 4421 | 256 */ |
| 257 void gaim_gtkconv_update_font_colors(struct gaim_conversation *conv); | |
| 258 | |
| 259 /** | |
|
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
260 * Updates the font faces of each conversation to the new font |
|
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
261 * face chosen in the prefs dialog. |
|
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
262 * |
|
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
263 * @param conv The conversation to update. |
|
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
264 */ |
|
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
265 void gaim_gtkconv_update_font_face(struct gaim_conversation *conv); |
|
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
266 |
|
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
267 /** |
| 4359 | 268 * Updates the tab positions on all conversation windows to reflect any |
| 269 * changed preferences. | |
| 270 */ | |
| 271 void gaim_gtkconv_update_tabs(void); | |
| 272 | |
| 273 /** | |
| 274 * Updates the button style on chat windows to reflect any | |
| 275 * changed preferences. | |
| 276 */ | |
| 277 void gaim_gtkconv_update_chat_button_style(); | |
| 278 | |
| 279 /** | |
| 280 * Updates the button style on IM windows to reflect any | |
| 281 * changed preferences. | |
| 282 */ | |
| 283 void gaim_gtkconv_update_im_button_style(); | |
| 284 | |
| 285 /** | |
| 286 * Updates conversation buttons by protocol. | |
| 287 * | |
| 288 * @param conv The conversation. | |
| 289 */ | |
| 290 void gaim_gtkconv_update_buttons_by_protocol(struct gaim_conversation *conv); | |
| 291 | |
| 292 /** | |
| 293 * Returns the window at the specified X, Y location. | |
| 294 * | |
| 295 * If the window is not a GTK+ window, @c NULL is returned. | |
| 296 * | |
| 297 * @param x The X coordinate. | |
| 298 * @param y The Y coordinate. | |
| 299 * | |
| 300 * @return The GTK+ window at the location, if it exists, or @c NULL otherwise. | |
| 301 */ | |
| 302 struct gaim_window *gaim_gtkwin_get_at_xy(int x, int y); | |
| 303 | |
| 304 /** | |
| 305 * Returns the index of the tab at the specified X, Y location in a notebook. | |
| 306 * | |
| 307 * @param win The GTK+ window containing the notebook. | |
| 308 * @param x The X coordinate. | |
| 309 * @param y The Y coordinate. | |
| 310 * | |
| 311 * @return The index of the tab at the location. | |
| 312 */ | |
| 313 int gaim_gtkconv_get_tab_at_xy(struct gaim_window *win, int x, int y); | |
| 314 | |
| 315 /** | |
| 316 * Returns the index of the destination tab at the | |
| 317 * specified X, Y location in a notebook. | |
| 318 * | |
| 319 * This is used for drag-and-drop functions when the tab at the index | |
| 320 * is a destination tab. | |
| 321 * | |
| 322 * @param win The GTK+ window containing the notebook. | |
| 323 * @param x The X coordinate. | |
| 324 * @param y The Y coordinate. | |
| 325 * | |
| 326 * @return The index of the tab at the location. | |
| 327 */ | |
| 328 int gaim_gtkconv_get_dest_tab_at_xy(struct gaim_window *win, int x, int y); | |
| 329 | |
| 330 #endif /* _GAIM_GTK_CONVERSATION_H_ */ |
