comparison src/gtkconv.c @ 5872:059d95c67cda

[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! committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 14 Jun 2003 23:21:02 +0000
parents 52d5fad43950
children cc7870e1e3b3
comparison
equal deleted inserted replaced
5871:508adf90fbb9 5872:059d95c67cda
1 /* 1 /**
2 * gaim 2 * @file gtkconv.h GTK+ Conversation API
3 * @ingroup gtkui
3 * 4 *
4 * Copyright (C) 2002-2003, Christian Hammond <chipx86@gnupdate.org> 5 * Copyright (C) 2002-2003 Christian Hammond <chipx86@gnupdate.org>
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or 9 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version. 10 * (at your option) any later version.
16 * You should have received a copy of the GNU General Public License 17 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * 20 *
20 */ 21 */
21 #ifdef HAVE_CONFIG_H 22 #include "internal.h"
22 #include <config.h> 23
24 #ifndef _WIN32
25 # include <X11/Xlib.h>
23 #endif 26 #endif
24 #include <string.h> 27
25 #ifndef _WIN32
26 #include <sys/time.h>
27 #include <unistd.h>
28 #include <gdk/gdkx.h>
29 #include <X11/Xlib.h>
30 #endif /*_WIN32*/
31 #include <sys/types.h>
32 #include <sys/stat.h>
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include <errno.h>
36 #include <ctype.h>
37 #include <gtk/gtk.h>
38 #ifdef USE_GTKSPELL 28 #ifdef USE_GTKSPELL
39 #include <gtkspell/gtkspell.h> 29 # include <gtkspell/gtkspell.h>
40 #endif 30 #endif
31
41 #include <gdk/gdkkeysyms.h> 32 #include <gdk/gdkkeysyms.h>
42 #include "prpl.h" 33
43 #include "gtkimhtml.h" 34 #include "debug.h"
44 #include "dnd-hints.h" 35 #include "log.h"
45 #include "sound.h" 36 #include "multi.h"
46 #include "gtkblist.h"
47 #include "notify.h" 37 #include "notify.h"
48 #include "prefs.h" 38 #include "prefs.h"
39 #include "prpl.h"
40 #include "sound.h"
41 #include "util.h"
42
43 #include "dnd-hints.h"
44 #include "gtkblist.h"
49 #include "gtkconv.h" 45 #include "gtkconv.h"
46 #include "gtkimhtml.h"
47 #include "gtkutils.h"
48 #include "stock.h"
49
50 #include "ui.h"
51
52 /* XXX */
50 #include "gaim.h" 53 #include "gaim.h"
51 #include "ui.h"
52 #include "debug.h"
53 #include "multi.h"
54 54
55 #ifdef _WIN32 55 #ifdef _WIN32
56 #include "win32dep.h" 56 # include "wspell.h"
57 #include "wspell.h"
58 #endif 57 #endif
58
59 #define AUTO_RESPONSE "&lt;AUTO-REPLY&gt; : "
59 60
60 static char nick_colors[][8] = { 61 static char nick_colors[][8] = {
61 "#ba55d3", /* Medium Orchid */ 62 "#ba55d3", /* Medium Orchid */
62 "#ee82ee", /* Violet */ 63 "#ee82ee", /* Violet */
63 "#c715b4", /* Medium Violet Red */ 64 "#c715b4", /* Medium Violet Red */
1323 gaim_im_stop_type_again_timeout(im); 1324 gaim_im_stop_type_again_timeout(im);
1324 1325
1325 /* XXX The (char *) should go away! Somebody add consts to stuff! */ 1326 /* XXX The (char *) should go away! Somebody add consts to stuff! */
1326 serv_send_typing(gaim_conversation_get_gc(conv), 1327 serv_send_typing(gaim_conversation_get_gc(conv),
1327 (char *)gaim_conversation_get_name(conv), 1328 (char *)gaim_conversation_get_name(conv),
1328 NOT_TYPING); 1329 GAIM_NOT_TYPING);
1329 } 1330 }
1330 else { 1331 else {
1331 /* We're deleting, but not all of it, so it counts as typing. */ 1332 /* We're deleting, but not all of it, so it counts as typing. */
1332 got_typing_keypress(conv, FALSE); 1333 got_typing_keypress(conv, FALSE);
1333 } 1334 }
1934 { 1935 {
1935 GaimIm *im; 1936 GaimIm *im;
1936 1937
1937 /* 1938 /*
1938 * We know we got something, so we at least have to make sure we don't 1939 * We know we got something, so we at least have to make sure we don't
1939 * send TYPED any time soon. 1940 * send GAIM_TYPED any time soon.
1940 */ 1941 */
1941 1942
1942 im = GAIM_IM(conv); 1943 im = GAIM_IM(conv);
1943 1944
1944 if (gaim_im_get_type_again_timeout(im)) 1945 if (gaim_im_get_type_again_timeout(im))
1949 if (first || (gaim_im_get_type_again(im) != 0 && 1950 if (first || (gaim_im_get_type_again(im) != 0 &&
1950 time(NULL) > gaim_im_get_type_again(im))) { 1951 time(NULL) > gaim_im_get_type_again(im))) {
1951 1952
1952 int timeout = serv_send_typing(gaim_conversation_get_gc(conv), 1953 int timeout = serv_send_typing(gaim_conversation_get_gc(conv),
1953 (char *)gaim_conversation_get_name(conv), 1954 (char *)gaim_conversation_get_name(conv),
1954 TYPING); 1955 GAIM_TYPING);
1955 1956
1956 if (timeout) 1957 if (timeout)
1957 gaim_im_set_type_again(im, time(NULL) + timeout); 1958 gaim_im_set_type_again(im, time(NULL) + timeout);
1958 else 1959 else
1959 gaim_im_set_type_again(im, 0); 1960 gaim_im_set_type_again(im, 0);
1974 1975
1975 if(gtkwin->menu.typing_icon) { 1976 if(gtkwin->menu.typing_icon) {
1976 gtk_widget_destroy(gtkwin->menu.typing_icon); 1977 gtk_widget_destroy(gtkwin->menu.typing_icon);
1977 gtkwin->menu.typing_icon = NULL; 1978 gtkwin->menu.typing_icon = NULL;
1978 } 1979 }
1979 if(im && gaim_im_get_typing_state(im) == TYPING) { 1980 if(im && gaim_im_get_typing_state(im) == GAIM_TYPING) {
1980 gtkwin->menu.typing_icon = gtk_image_menu_item_new(); 1981 gtkwin->menu.typing_icon = gtk_image_menu_item_new();
1981 gtk_image_menu_item_set_image( 1982 gtk_image_menu_item_set_image(
1982 GTK_IMAGE_MENU_ITEM(gtkwin->menu.typing_icon), 1983 GTK_IMAGE_MENU_ITEM(gtkwin->menu.typing_icon),
1983 gtk_image_new_from_stock(GAIM_STOCK_TYPING, 1984 gtk_image_new_from_stock(GAIM_STOCK_TYPING,
1984 GTK_ICON_SIZE_MENU)); 1985 GTK_ICON_SIZE_MENU));
1985 gtk_tooltips_set_tip(gtkconv->tooltips, gtkwin->menu.typing_icon, 1986 gtk_tooltips_set_tip(gtkconv->tooltips, gtkwin->menu.typing_icon,
1986 _("User is typing..."), NULL); 1987 _("User is typing..."), NULL);
1987 } else if(im && gaim_im_get_typing_state(im) == TYPED) { 1988 } else if(im && gaim_im_get_typing_state(im) == GAIM_TYPED) {
1988 gtkwin->menu.typing_icon = gtk_image_menu_item_new(); 1989 gtkwin->menu.typing_icon = gtk_image_menu_item_new();
1989 gtk_image_menu_item_set_image( 1990 gtk_image_menu_item_set_image(
1990 GTK_IMAGE_MENU_ITEM(gtkwin->menu.typing_icon), 1991 GTK_IMAGE_MENU_ITEM(gtkwin->menu.typing_icon),
1991 gtk_image_new_from_stock(GAIM_STOCK_TYPED, 1992 gtk_image_new_from_stock(GAIM_STOCK_TYPED,
1992 GTK_ICON_SIZE_MENU)); 1993 GTK_ICON_SIZE_MENU));
4454 4455
4455 pango_font_description_free(style->font_desc); 4456 pango_font_description_free(style->font_desc);
4456 style->font_desc = pango_font_description_copy( 4457 style->font_desc = pango_font_description_copy(
4457 gtk_widget_get_style(gtkconv->tab_label)->font_desc); 4458 gtk_widget_get_style(gtkconv->tab_label)->font_desc);
4458 4459
4459 if (im != NULL && gaim_im_get_typing_state(im) == TYPING) { 4460 if (im != NULL && gaim_im_get_typing_state(im) == GAIM_TYPING) {
4460 style->fg[GTK_STATE_NORMAL].red = 0x4646; 4461 style->fg[GTK_STATE_NORMAL].red = 0x4646;
4461 style->fg[GTK_STATE_NORMAL].green = 0xA0A0; 4462 style->fg[GTK_STATE_NORMAL].green = 0xA0A0;
4462 style->fg[GTK_STATE_NORMAL].blue = 0x4646; 4463 style->fg[GTK_STATE_NORMAL].blue = 0x4646;
4463 style->fg[GTK_STATE_ACTIVE] = style->fg[GTK_STATE_NORMAL]; 4464 style->fg[GTK_STATE_ACTIVE] = style->fg[GTK_STATE_NORMAL];
4464 } 4465 }
4465 else if (im != NULL && gaim_im_get_typing_state(im) == TYPED) { 4466 else if (im != NULL && gaim_im_get_typing_state(im) == GAIM_TYPED) {
4466 style->fg[GTK_STATE_NORMAL].red = 0xD1D1; 4467 style->fg[GTK_STATE_NORMAL].red = 0xD1D1;
4467 style->fg[GTK_STATE_NORMAL].green = 0x9494; 4468 style->fg[GTK_STATE_NORMAL].green = 0x9494;
4468 style->fg[GTK_STATE_NORMAL].blue = 0x0C0C; 4469 style->fg[GTK_STATE_NORMAL].blue = 0x0C0C;
4469 style->fg[GTK_STATE_ACTIVE] = style->fg[GTK_STATE_NORMAL]; 4470 style->fg[GTK_STATE_ACTIVE] = style->fg[GTK_STATE_NORMAL];
4470 } 4471 }