Sat, 14 Jun 2003 23:21:02 +0000
[gaim-migrate @ 6304]
The legendary Header File Cleanup! Files now only include what they need.
This should reduce the number of files that must recompile when a header
file changes. It's a lot nicer. Trust me on it. I also added a couple new
header files. I hope I didn't break TOO much!
| 4359 | 1 | /** |
| 2 | * @file gtkconv.h GTK+ Conversation API | |
|
5034
077678f7b048
[gaim-migrate @ 5377]
Christian Hammond <chipx86@chipx86.com>
parents:
4736
diff
changeset
|
3 | * @ingroup gtkui |
| 4359 | 4 | * |
| 5 | * gaim | |
| 6 | * | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5676
diff
changeset
|
7 | * Copyright (C) 2002-2003 Christian Hammond <chipx86@gnupdate.org> |
| 4359 | 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 | ||
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
27 | #include "conversation.h" |
|
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
28 | |
| 4359 | 29 | /************************************************************************** |
| 30 | * @name Structures | |
| 31 | **************************************************************************/ | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
32 | /*@{*/ |
| 4359 | 33 | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
34 | typedef struct _GaimGtkWindow GaimGtkWindow; |
|
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
35 | typedef struct _GaimGtkImPane GaimGtkImPane; |
|
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
36 | typedef struct _GaimGtkChatPane GaimGtkChatPane; |
|
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
37 | typedef struct _GaimGtkConversation GaimGtkConversation; |
| 4359 | 38 | |
| 39 | /** | |
| 40 | * A GTK+ representation of a graphical window containing one or more | |
| 41 | * conversations. | |
| 42 | */ | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
43 | struct _GaimGtkWindow |
| 4359 | 44 | { |
| 45 | GtkWidget *window; /**< The window. */ | |
| 46 | GtkWidget *notebook; /**< The notebook of conversations. */ | |
| 47 | ||
| 48 | struct | |
| 49 | { | |
| 50 | GtkWidget *menubar; | |
| 51 | ||
|
5167
e6674b684b55
[gaim-migrate @ 5531]
Mark Doliner <markdoliner@pidgin.im>
parents:
5106
diff
changeset
|
52 | GtkWidget *view_log; |
| 4359 | 53 | GtkWidget *insert_link; |
| 54 | GtkWidget *insert_image; | |
| 55 | GtkWidget *logging; | |
| 56 | GtkWidget *sounds; | |
| 57 | GtkWidget *send_as; | |
| 4736 | 58 | GtkWidget *typing_icon; |
| 4359 | 59 | |
| 4630 | 60 | GtkItemFactory *item_factory; |
| 61 | ||
| 4359 | 62 | } menu; |
| 63 | ||
| 64 | /* Tab dragging stuff. */ | |
| 65 | gboolean in_drag; | |
| 66 | gboolean in_predrag; | |
| 67 | ||
| 68 | gint drag_min_x, drag_max_x, drag_min_y, drag_max_y; | |
| 69 | ||
| 70 | gint drag_motion_signal; | |
| 71 | gint drag_leave_signal; | |
| 72 | }; | |
| 73 | ||
| 74 | /** | |
| 75 | * GTK+ Instant Message panes. | |
| 76 | */ | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
77 | struct _GaimGtkImPane |
| 4359 | 78 | { |
| 79 | GtkWidget *warn; | |
| 80 | GtkWidget *block; | |
| 81 | GtkWidget *add; | |
| 82 | GtkWidget *sep1; | |
| 83 | GtkWidget *sep2; | |
| 84 | GtkWidget *check; | |
| 85 | GtkWidget *progress; | |
| 86 | ||
| 87 | gboolean a_virgin; | |
| 88 | ||
| 89 | /* Buddy icon stuff */ | |
| 90 | GtkWidget *icon; | |
| 91 | GdkPixbufAnimation *anim; | |
| 92 | GdkPixbufAnimationIter *iter; | |
| 93 | guint32 icon_timer; | |
| 94 | GtkWidget *save_icon; | |
| 95 | }; | |
| 96 | ||
| 97 | /** | |
| 98 | * GTK+ Chat panes. | |
| 99 | */ | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
100 | struct _GaimGtkChatPane |
| 4359 | 101 | { |
| 102 | GtkWidget *count; | |
| 103 | GtkWidget *list; | |
| 104 | GtkWidget *whisper; | |
| 105 | GtkWidget *invite; | |
| 106 | GtkWidget *topic_text; | |
| 107 | }; | |
| 108 | ||
| 109 | /** | |
| 110 | * A GTK+ conversation pane. | |
| 111 | */ | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
112 | struct _GaimGtkConversation |
| 4359 | 113 | { |
| 114 | gboolean make_sound; | |
| 115 | gboolean has_font; | |
| 116 | char fontface[128]; | |
| 117 | GdkColor fg_color; | |
| 118 | GdkColor bg_color; | |
| 119 | ||
| 120 | GtkTooltips *tooltips; | |
| 121 | ||
| 122 | GtkWidget *tab_cont; | |
| 123 | GtkWidget *tabby; | |
| 124 | ||
| 125 | GtkWidget *imhtml; | |
| 126 | GtkTextBuffer *entry_buffer; | |
| 127 | GtkWidget *entry; | |
| 128 | ||
| 129 | GtkWidget *send; | |
| 130 | GtkWidget *info; | |
| 131 | GtkWidget *close; | |
| 132 | GtkWidget *tab_label; | |
| 133 | GtkSizeGroup *sg; | |
| 134 | ||
| 135 | GtkWidget *bbox; | |
| 136 | GtkWidget *sw; | |
| 137 | ||
| 138 | struct | |
| 139 | { | |
| 140 | GtkWidget *toolbar; | |
| 4685 | 141 | |
| 4359 | 142 | GtkWidget *bold; |
| 143 | GtkWidget *italic; | |
| 144 | GtkWidget *underline; | |
| 145 | ||
| 5049 | 146 | GtkWidget *larger_size; |
| 4359 | 147 | GtkWidget *normal_size; |
| 5049 | 148 | GtkWidget *smaller_size; |
| 4359 | 149 | |
| 4685 | 150 | GtkWidget *font; |
| 4359 | 151 | GtkWidget *fgcolor; |
| 152 | GtkWidget *bgcolor; | |
| 153 | ||
| 154 | GtkWidget *image; | |
| 155 | GtkWidget *link; | |
| 156 | GtkWidget *smiley; | |
| 157 | GtkWidget *log; | |
| 4685 | 158 | |
| 4359 | 159 | } toolbar; |
| 160 | ||
| 161 | struct | |
| 162 | { | |
| 163 | GtkWidget *fg_color; | |
| 164 | GtkWidget *bg_color; | |
| 165 | GtkWidget *font; | |
| 166 | GtkWidget *smiley; | |
| 167 | GtkWidget *link; | |
| 5106 | 168 | GtkWidget *image; |
| 4359 | 169 | GtkWidget *log; |
| 170 | ||
| 171 | } dialogs; | |
| 172 | ||
| 173 | union | |
| 174 | { | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
175 | GaimGtkImPane *im; |
|
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
176 | GaimGtkChatPane *chat; |
| 4359 | 177 | |
| 178 | } u; | |
| 179 | }; | |
| 180 | ||
| 181 | #define GAIM_GTK_WINDOW(win) \ | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
182 | ((GaimGtkWindow *)(win)->ui_data) |
| 4359 | 183 | |
| 184 | #define GAIM_GTK_CONVERSATION(conv) \ | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
185 | ((GaimGtkConversation *)(conv)->ui_data) |
| 4359 | 186 | |
|
4384
32592d368209
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
187 | #define GAIM_IS_GTK_WINDOW(win) \ |
|
4465
43184ae252ed
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4445
diff
changeset
|
188 | (gaim_window_get_ui_ops(win) == gaim_get_gtk_window_ui_ops()) |
|
4384
32592d368209
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
189 | |
|
32592d368209
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
190 | #define GAIM_IS_GTK_CONVERSATION(conv) \ |
|
4465
43184ae252ed
[gaim-migrate @ 4740]
Christian Hammond <chipx86@chipx86.com>
parents:
4445
diff
changeset
|
191 | (gaim_conversation_get_ui_ops(conv) == gaim_get_gtk_conversation_ui_ops()) |
| 4359 | 192 | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
193 | /*@}*/ |
|
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
194 | |
| 4359 | 195 | /************************************************************************** |
| 196 | * @name GTK+ Conversation API | |
| 197 | **************************************************************************/ | |
|
5673
47f654fb5134
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
198 | /*@{*/ |
|
47f654fb5134
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
199 | |
|
47f654fb5134
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
200 | /** |
|
47f654fb5134
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
201 | * Initializes the GTK+ conversation system. |
|
47f654fb5134
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
202 | */ |
|
47f654fb5134
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
203 | void gaim_gtk_conversation_init(void); |
|
47f654fb5134
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
204 | |
| 4359 | 205 | /** |
| 206 | * Returns the UI operations structure for GTK windows. | |
| 207 | * | |
| 208 | * @return The GTK window operations structure. | |
| 209 | */ | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
210 | GaimWindowUiOps *gaim_get_gtk_window_ui_ops(void); |
| 4359 | 211 | |
| 212 | /** | |
| 213 | * Returns the UI operations structure for GTK conversations. | |
| 214 | * | |
| 215 | * @return The GTK conversation operations structure. | |
| 216 | */ | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
217 | GaimConversationUiOps *gaim_get_gtk_conversation_ui_ops(void); |
| 4359 | 218 | |
| 219 | /** | |
| 220 | * Updates the buddy icon on a conversation. | |
| 221 | * | |
| 222 | * @param conv The conversation. | |
| 223 | */ | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
224 | void gaim_gtkconv_update_buddy_icon(GaimConversation *conv); |
| 4359 | 225 | |
| 226 | /** | |
| 227 | * Updates the font buttons on all conversations to reflect any changed | |
| 228 | * preferences. | |
| 229 | */ | |
| 230 | void gaim_gtkconv_update_font_buttons(void); | |
| 231 | ||
| 232 | /** | |
| 4421 | 233 | * Updates the font colors of each conversation to the new colors |
| 234 | * chosen in the prefs dialog. | |
|
4438
9beaf48335fc
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
235 | * |
|
9beaf48335fc
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
236 | * @param conv The conversation to update. |
| 4421 | 237 | */ |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
238 | void gaim_gtkconv_update_font_colors(GaimConversation *conv); |
| 4421 | 239 | |
| 240 | /** | |
|
4438
9beaf48335fc
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
241 | * Updates the font faces of each conversation to the new font |
|
9beaf48335fc
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
242 | * face chosen in the prefs dialog. |
|
9beaf48335fc
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
243 | * |
|
9beaf48335fc
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
244 | * @param conv The conversation to update. |
|
9beaf48335fc
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
245 | */ |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
246 | void gaim_gtkconv_update_font_face(GaimConversation *conv); |
|
4438
9beaf48335fc
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
247 | |
|
9beaf48335fc
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
248 | /** |
| 4359 | 249 | * Updates the tab positions on all conversation windows to reflect any |
| 250 | * changed preferences. | |
| 251 | */ | |
| 252 | void gaim_gtkconv_update_tabs(void); | |
| 253 | ||
| 254 | /** | |
| 255 | * Updates the button style on chat windows to reflect any | |
| 256 | * changed preferences. | |
| 257 | */ | |
| 258 | void gaim_gtkconv_update_chat_button_style(); | |
| 259 | ||
| 260 | /** | |
| 261 | * Updates the button style on IM windows to reflect any | |
| 262 | * changed preferences. | |
| 263 | */ | |
| 264 | void gaim_gtkconv_update_im_button_style(); | |
| 265 | ||
| 266 | /** | |
| 267 | * Updates conversation buttons by protocol. | |
| 268 | * | |
| 269 | * @param conv The conversation. | |
| 270 | */ | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
271 | void gaim_gtkconv_update_buttons_by_protocol(GaimConversation *conv); |
| 4359 | 272 | |
| 273 | /** | |
| 274 | * Returns the window at the specified X, Y location. | |
| 275 | * | |
| 276 | * If the window is not a GTK+ window, @c NULL is returned. | |
| 277 | * | |
| 278 | * @param x The X coordinate. | |
| 279 | * @param y The Y coordinate. | |
| 280 | * | |
| 281 | * @return The GTK+ window at the location, if it exists, or @c NULL otherwise. | |
| 282 | */ | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
283 | GaimWindow *gaim_gtkwin_get_at_xy(int x, int y); |
| 4359 | 284 | |
| 285 | /** | |
| 286 | * Returns the index of the tab at the specified X, Y location in a notebook. | |
| 287 | * | |
| 288 | * @param win The GTK+ window containing the notebook. | |
| 289 | * @param x The X coordinate. | |
| 290 | * @param y The Y coordinate. | |
| 291 | * | |
| 292 | * @return The index of the tab at the location. | |
| 293 | */ | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
294 | int gaim_gtkconv_get_tab_at_xy(GaimWindow *win, int x, int y); |
| 4359 | 295 | |
| 296 | /** | |
| 297 | * Returns the index of the destination tab at the | |
| 298 | * specified X, Y location in a notebook. | |
| 299 | * | |
| 300 | * This is used for drag-and-drop functions when the tab at the index | |
| 301 | * is a destination tab. | |
| 302 | * | |
| 303 | * @param win The GTK+ window containing the notebook. | |
| 304 | * @param x The X coordinate. | |
| 305 | * @param y The Y coordinate. | |
| 306 | * | |
| 307 | * @return The index of the tab at the location. | |
| 308 | */ | |
|
5676
d3c2fdaf4821
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
309 | int gaim_gtkconv_get_dest_tab_at_xy(GaimWindow *win, int x, int y); |
| 4359 | 310 | |
|
5673
47f654fb5134
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
311 | /*@}*/ |
|
47f654fb5134
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
312 | |
| 4359 | 313 | #endif /* _GAIM_GTK_CONVERSATION_H_ */ |