Mercurial > pidgin
annotate src/gtkconv.h @ 8189:b75fa309b2c6
[gaim-migrate @ 8910]
A patch from MBG (chromakode) to make icons not animate when they've
not being viewed. So only the icon on the active conversation in a
window should be animating itself.
His patch was 99 lines and mine is 648... I'm not really sure how that
happened, but I think it's for the best.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Sat, 31 Jan 2004 00:33:18 +0000 |
| parents | fa6395637e2c |
| children | 84ec38c3efcc |
| 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 * | |
| 8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
| 8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 9 * source distribution. | |
|
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
10 * |
| 4359 | 11 * This program is free software; you can redistribute it and/or modify |
| 12 * it under the terms of the GNU General Public License as published by | |
| 13 * the Free Software Foundation; either version 2 of the License, or | |
| 14 * (at your option) any later version. | |
| 15 * | |
| 16 * This program is distributed in the hope that it will be useful, | |
| 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 * GNU General Public License for more details. | |
| 20 * | |
| 21 * You should have received a copy of the GNU General Public License | |
| 22 * along with this program; if not, write to the Free Software | |
| 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 */ | |
| 25 | |
| 26 #ifndef _GAIM_GTK_CONVERSATION_H_ | |
| 27 #define _GAIM_GTK_CONVERSATION_H_ | |
| 28 | |
|
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
29 #include "conversation.h" |
|
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
30 |
| 4359 | 31 /************************************************************************** |
| 32 * @name Structures | |
| 33 **************************************************************************/ | |
|
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
34 /*@{*/ |
| 4359 | 35 |
|
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
36 typedef struct _GaimGtkWindow GaimGtkWindow; |
|
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
37 typedef struct _GaimGtkImPane GaimGtkImPane; |
|
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
38 typedef struct _GaimGtkChatPane GaimGtkChatPane; |
|
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
39 typedef struct _GaimGtkConversation GaimGtkConversation; |
| 4359 | 40 |
| 41 /** | |
| 42 * A GTK+ representation of a graphical window containing one or more | |
| 43 * conversations. | |
| 44 */ | |
|
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
45 struct _GaimGtkWindow |
| 4359 | 46 { |
| 47 GtkWidget *window; /**< The window. */ | |
| 48 GtkWidget *notebook; /**< The notebook of conversations. */ | |
| 49 | |
| 50 struct | |
| 51 { | |
| 52 GtkWidget *menubar; | |
| 53 | |
| 5167 | 54 GtkWidget *view_log; |
|
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
55 |
|
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
56 GtkWidget *add_pounce; |
| 7887 | 57 GtkWidget *get_info; |
| 58 GtkWidget *warn; | |
| 59 GtkWidget *invite; | |
| 60 | |
|
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
61 GtkWidget *alias; |
| 7887 | 62 GtkWidget *block; |
| 63 GtkWidget *add; | |
| 64 GtkWidget *remove; | |
|
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
65 |
| 7859 | 66 GtkWidget *insert_link; |
| 67 GtkWidget *insert_image; | |
| 68 | |
| 4359 | 69 GtkWidget *logging; |
| 70 GtkWidget *sounds; | |
|
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
71 GtkWidget *show_formatting_toolbar; |
|
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
72 |
| 4359 | 73 GtkWidget *send_as; |
|
5908
ed8a9a3bf7e2
[gaim-migrate @ 6340]
Christian Hammond <chipx86@chipx86.com>
parents:
5872
diff
changeset
|
74 |
| 4736 | 75 GtkWidget *typing_icon; |
| 4359 | 76 |
| 4630 | 77 GtkItemFactory *item_factory; |
| 78 | |
| 4359 | 79 } menu; |
| 80 | |
| 81 /* Tab dragging stuff. */ | |
| 82 gboolean in_drag; | |
| 83 gboolean in_predrag; | |
| 84 | |
| 85 gint drag_min_x, drag_max_x, drag_min_y, drag_max_y; | |
| 86 | |
| 87 gint drag_motion_signal; | |
| 88 gint drag_leave_signal; | |
| 89 }; | |
| 90 | |
| 91 /** | |
| 7820 | 92 * A GTK+ Instant Message pane. |
| 4359 | 93 */ |
|
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
94 struct _GaimGtkImPane |
| 4359 | 95 { |
| 96 GtkWidget *warn; | |
| 97 GtkWidget *block; | |
| 98 GtkWidget *sep1; | |
| 99 GtkWidget *sep2; | |
| 100 GtkWidget *check; | |
| 101 GtkWidget *progress; | |
| 102 | |
| 103 gboolean a_virgin; | |
| 104 | |
| 105 /* Buddy icon stuff */ | |
| 106 GtkWidget *icon; | |
| 8189 | 107 gboolean animate; |
| 4359 | 108 GdkPixbufAnimation *anim; |
| 109 GdkPixbufAnimationIter *iter; | |
| 110 guint32 icon_timer; | |
| 111 GtkWidget *save_icon; | |
| 112 }; | |
| 113 | |
| 114 /** | |
| 115 * GTK+ Chat panes. | |
| 116 */ | |
|
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
117 struct _GaimGtkChatPane |
| 4359 | 118 { |
| 119 GtkWidget *count; | |
| 120 GtkWidget *list; | |
| 121 GtkWidget *invite; | |
| 122 GtkWidget *topic_text; | |
|
7996
334ab1319406
[gaim-migrate @ 8673]
Christian Hammond <chipx86@chipx86.com>
parents:
7930
diff
changeset
|
123 GtkWidget *sep; |
| 4359 | 124 }; |
| 125 | |
| 126 /** | |
| 127 * A GTK+ conversation pane. | |
| 128 */ | |
|
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
129 struct _GaimGtkConversation |
| 4359 | 130 { |
| 131 gboolean make_sound; | |
|
7326
00a9ab26d607
[gaim-migrate @ 7912]
Christian Hammond <chipx86@chipx86.com>
parents:
7295
diff
changeset
|
132 gboolean show_formatting_toolbar; |
| 4359 | 133 gboolean has_font; |
| 134 char fontface[128]; | |
| 135 GdkColor fg_color; | |
| 136 GdkColor bg_color; | |
| 137 | |
| 138 GtkTooltips *tooltips; | |
| 139 | |
| 140 GtkWidget *tab_cont; | |
| 141 GtkWidget *tabby; | |
|
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
142 GtkWidget *menu_tabby; |
| 4359 | 143 |
| 144 GtkWidget *imhtml; | |
| 145 GtkTextBuffer *entry_buffer; | |
| 146 GtkWidget *entry; | |
| 147 | |
| 7930 | 148 GtkWidget *add; |
| 149 GtkWidget *remove; | |
| 4359 | 150 GtkWidget *info; |
| 7930 | 151 GtkWidget *send; |
| 152 GtkWidget *close; /* "x" on the tab */ | |
|
6392
e9974608b319
[gaim-migrate @ 6897]
Christian Hammond <chipx86@chipx86.com>
parents:
5908
diff
changeset
|
153 GtkWidget *icon; |
| 4359 | 154 GtkWidget *tab_label; |
|
6771
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
155 GtkWidget *menu_icon; |
|
8eebba08b44b
[gaim-migrate @ 7308]
Christian Hammond <chipx86@chipx86.com>
parents:
6392
diff
changeset
|
156 GtkWidget *menu_label; |
| 4359 | 157 GtkSizeGroup *sg; |
| 158 | |
| 159 GtkWidget *bbox; | |
| 160 GtkWidget *sw; | |
| 161 | |
| 162 struct | |
| 163 { | |
| 164 GtkWidget *toolbar; | |
| 4685 | 165 |
| 4359 | 166 GtkWidget *bold; |
| 167 GtkWidget *italic; | |
| 168 GtkWidget *underline; | |
| 169 | |
| 5049 | 170 GtkWidget *larger_size; |
| 4359 | 171 GtkWidget *normal_size; |
| 5049 | 172 GtkWidget *smaller_size; |
| 4359 | 173 |
| 4685 | 174 GtkWidget *font; |
| 4359 | 175 GtkWidget *fgcolor; |
| 176 GtkWidget *bgcolor; | |
| 177 | |
| 178 GtkWidget *image; | |
| 179 GtkWidget *link; | |
| 180 GtkWidget *smiley; | |
| 181 GtkWidget *log; | |
| 4685 | 182 |
| 4359 | 183 } toolbar; |
| 184 | |
| 185 struct | |
| 186 { | |
| 187 GtkWidget *fg_color; | |
| 188 GtkWidget *bg_color; | |
| 189 GtkWidget *font; | |
| 190 GtkWidget *smiley; | |
| 191 GtkWidget *link; | |
| 5106 | 192 GtkWidget *image; |
| 4359 | 193 GtkWidget *log; |
| 7295 | 194 GtkWidget *search; |
| 4359 | 195 |
| 196 } dialogs; | |
| 197 | |
| 198 union | |
| 199 { | |
|
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
200 GaimGtkImPane *im; |
|
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
201 GaimGtkChatPane *chat; |
| 4359 | 202 |
| 203 } u; | |
| 204 }; | |
| 205 | |
| 206 #define GAIM_GTK_WINDOW(win) \ | |
|
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
207 ((GaimGtkWindow *)(win)->ui_data) |
| 4359 | 208 |
| 209 #define GAIM_GTK_CONVERSATION(conv) \ | |
|
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
210 ((GaimGtkConversation *)(conv)->ui_data) |
| 4359 | 211 |
|
4384
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
212 #define GAIM_IS_GTK_WINDOW(win) \ |
|
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
213 (gaim_conv_window_get_ui_ops(win) == gaim_gtk_conversations_get_win_ui_ops()) |
|
4384
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
214 |
|
8f633419c837
[gaim-migrate @ 4650]
Christian Hammond <chipx86@chipx86.com>
parents:
4359
diff
changeset
|
215 #define GAIM_IS_GTK_CONVERSATION(conv) \ |
|
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
216 (gaim_conversation_get_ui_ops(conv) == \ |
|
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
217 gaim_gtk_conversations_get_conv_ui_ops()) |
| 4359 | 218 |
|
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
219 /*@}*/ |
|
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
220 |
| 4359 | 221 /************************************************************************** |
| 222 * @name GTK+ Conversation API | |
| 223 **************************************************************************/ | |
|
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
224 /*@{*/ |
|
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
225 |
|
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
226 /** |
|
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
227 * Initializes the GTK+ conversation system. |
|
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
228 */ |
|
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
229 void gaim_gtk_conversations_init(void); |
|
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
230 |
| 4359 | 231 /** |
| 232 * Returns the UI operations structure for GTK windows. | |
| 233 * | |
| 234 * @return The GTK window operations structure. | |
| 235 */ | |
|
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
236 GaimConvWindowUiOps *gaim_gtk_conversations_get_win_ui_ops(void); |
| 4359 | 237 |
| 238 /** | |
| 239 * Returns the UI operations structure for GTK conversations. | |
| 240 * | |
| 241 * @return The GTK conversation operations structure. | |
| 242 */ | |
|
7035
feb3d21a7794
[gaim-migrate @ 7598]
Christian Hammond <chipx86@chipx86.com>
parents:
6771
diff
changeset
|
243 GaimConversationUiOps *gaim_gtk_conversations_get_conv_ui_ops(void); |
| 4359 | 244 |
| 245 /** | |
| 246 * Updates the buddy icon on a conversation. | |
| 247 * | |
| 248 * @param conv The conversation. | |
| 249 */ | |
|
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
250 void gaim_gtkconv_update_buddy_icon(GaimConversation *conv); |
| 4359 | 251 |
| 252 /** | |
| 253 * Updates the font buttons on all conversations to reflect any changed | |
| 254 * preferences. | |
| 255 */ | |
| 256 void gaim_gtkconv_update_font_buttons(void); | |
| 257 | |
| 258 /** | |
| 4421 | 259 * Updates the font colors of each conversation to the new colors |
| 260 * chosen in the prefs dialog. | |
|
4438
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. |
| 4421 | 263 */ |
|
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
264 void gaim_gtkconv_update_font_colors(GaimConversation *conv); |
| 4421 | 265 |
| 266 /** | |
|
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
267 * Updates the font faces of each conversation to the new font |
|
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
268 * face chosen in the prefs dialog. |
|
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
269 * |
|
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
270 * @param conv The conversation to update. |
|
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
271 */ |
|
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
272 void gaim_gtkconv_update_font_face(GaimConversation *conv); |
|
4438
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
273 |
|
2054d8429925
[gaim-migrate @ 4713]
Christian Hammond <chipx86@chipx86.com>
parents:
4421
diff
changeset
|
274 /** |
| 4359 | 275 * Updates the tab positions on all conversation windows to reflect any |
| 276 * changed preferences. | |
| 277 */ | |
| 278 void gaim_gtkconv_update_tabs(void); | |
| 279 | |
| 280 /** | |
| 281 * Updates the button style on chat windows to reflect any | |
| 282 * changed preferences. | |
| 283 */ | |
| 284 void gaim_gtkconv_update_chat_button_style(); | |
| 285 | |
| 286 /** | |
| 287 * Updates the button style on IM windows to reflect any | |
| 288 * changed preferences. | |
| 289 */ | |
| 290 void gaim_gtkconv_update_im_button_style(); | |
| 291 | |
| 292 /** | |
| 293 * Updates conversation buttons by protocol. | |
| 294 * | |
| 295 * @param conv The conversation. | |
| 296 */ | |
|
5676
dae79aefac8d
[gaim-migrate @ 6094]
Christian Hammond <chipx86@chipx86.com>
parents:
5674
diff
changeset
|
297 void gaim_gtkconv_update_buttons_by_protocol(GaimConversation *conv); |
| 4359 | 298 |
| 299 /** | |
| 300 * Returns the window at the specified X, Y location. | |
| 301 * | |
| 302 * If the window is not a GTK+ window, @c NULL is returned. | |
| 303 * | |
| 304 * @param x The X coordinate. | |
| 305 * @param y The Y coordinate. | |
| 306 * | |
| 307 * @return The GTK+ window at the location, if it exists, or @c NULL otherwise. | |
| 308 */ | |
|
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
309 GaimConvWindow *gaim_gtkwin_get_at_xy(int x, int y); |
| 4359 | 310 |
| 311 /** | |
| 312 * Returns the index of the tab at the specified X, Y location in a notebook. | |
| 313 * | |
| 314 * @param win The GTK+ window containing the notebook. | |
| 315 * @param x The X coordinate. | |
| 316 * @param y The Y coordinate. | |
| 317 * | |
| 318 * @return The index of the tab at the location. | |
| 319 */ | |
|
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
320 int gaim_gtkconv_get_tab_at_xy(GaimConvWindow *win, int x, int y); |
| 4359 | 321 |
| 322 /** | |
| 323 * Returns the index of the destination tab at the | |
| 324 * specified X, Y location in a notebook. | |
| 325 * | |
| 326 * This is used for drag-and-drop functions when the tab at the index | |
| 327 * is a destination tab. | |
| 328 * | |
| 329 * @param win The GTK+ window containing the notebook. | |
| 330 * @param x The X coordinate. | |
| 331 * @param y The Y coordinate. | |
| 332 * | |
| 333 * @return The index of the tab at the location. | |
| 334 */ | |
|
7118
bf630f7dfdcd
[gaim-migrate @ 7685]
Christian Hammond <chipx86@chipx86.com>
parents:
7035
diff
changeset
|
335 int gaim_gtkconv_get_dest_tab_at_xy(GaimConvWindow *win, int x, int y); |
| 4359 | 336 |
|
5673
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
337 /*@}*/ |
|
62f57ec16f29
[gaim-migrate @ 6091]
Christian Hammond <chipx86@chipx86.com>
parents:
5167
diff
changeset
|
338 |
| 4359 | 339 #endif /* _GAIM_GTK_CONVERSATION_H_ */ |
