comparison src/gtkconv.c @ 7538:357eb1c39b72

[gaim-migrate @ 8151] Robot101 made a nice patch (which I modified just slightly) to put our gtkspell attachment function that we use all throughout gaim into a utility function, which handles error checking and only does anything if gtkspell support is compiled in. It lets us remove a lot of #ifdef USE_GTKSPELL from places, and doesn't change any functionality. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 17 Nov 2003 06:48:01 +0000
parents b7b1d416ff44
children cdfdbabd3266
comparison
equal deleted inserted replaced
7537:083427fd8ba8 7538:357eb1c39b72
25 # include <X11/Xlib.h> 25 # include <X11/Xlib.h>
26 #endif 26 #endif
27 27
28 #ifdef USE_GTKSPELL 28 #ifdef USE_GTKSPELL
29 # include <gtkspell/gtkspell.h> 29 # include <gtkspell/gtkspell.h>
30 # ifdef _WIN32
31 # include "wspell.h"
32 # endif
30 #endif 33 #endif
31 34
32 #include <gdk/gdkkeysyms.h> 35 #include <gdk/gdkkeysyms.h>
33 #include <locale.h> 36 #include <locale.h>
34 37
55 58
56 #include "ui.h" 59 #include "ui.h"
57 60
58 /* XXX */ 61 /* XXX */
59 #include "gaim.h" 62 #include "gaim.h"
60
61 #ifdef _WIN32
62 # include "wspell.h"
63 #endif
64 63
65 #define AUTO_RESPONSE "&lt;AUTO-REPLY&gt; : " 64 #define AUTO_RESPONSE "&lt;AUTO-REPLY&gt; : "
66 65
67 static char nick_colors[][8] = { 66 static char nick_colors[][8] = {
68 "#ba55d3", /* Medium Orchid */ 67 "#ba55d3", /* Medium Orchid */
3650 g_signal_connect_after(G_OBJECT(gtkconv->entry), "button_press_event", 3649 g_signal_connect_after(G_OBJECT(gtkconv->entry), "button_press_event",
3651 G_CALLBACK(entry_stop_rclick_cb), NULL); 3650 G_CALLBACK(entry_stop_rclick_cb), NULL);
3652 g_signal_connect(G_OBJECT(gtkconv->entry), "key_press_event", 3651 g_signal_connect(G_OBJECT(gtkconv->entry), "key_press_event",
3653 G_CALLBACK(entry_key_pressed_cb_2), conv); 3652 G_CALLBACK(entry_key_pressed_cb_2), conv);
3654 3653
3655 #ifdef USE_GTKSPELL
3656 if (gaim_prefs_get_bool("/gaim/gtk/conversations/spellcheck")) 3654 if (gaim_prefs_get_bool("/gaim/gtk/conversations/spellcheck"))
3657 gtkspell_new_attach(GTK_TEXT_VIEW(gtkconv->entry), NULL, NULL); 3655 gaim_gtk_setup_gtkspell(GTK_TEXT_VIEW(gtkconv->entry));
3658 #endif
3659 3656
3660 gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(gtkconv->entry)); 3657 gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(gtkconv->entry));
3661 gtk_widget_show(gtkconv->entry); 3658 gtk_widget_show(gtkconv->entry);
3662 3659
3663 /* Setup the bottom button box. */ 3660 /* Setup the bottom button box. */
3755 g_signal_connect(G_OBJECT(gtkconv->entry_buffer), "insert_text", 3752 g_signal_connect(G_OBJECT(gtkconv->entry_buffer), "insert_text",
3756 G_CALLBACK(insert_text_cb), conv); 3753 G_CALLBACK(insert_text_cb), conv);
3757 g_signal_connect(G_OBJECT(gtkconv->entry_buffer), "delete_range", 3754 g_signal_connect(G_OBJECT(gtkconv->entry_buffer), "delete_range",
3758 G_CALLBACK(delete_text_cb), conv); 3755 G_CALLBACK(delete_text_cb), conv);
3759 3756
3760 #ifdef USE_GTKSPELL
3761 if (gaim_prefs_get_bool("/gaim/gtk/conversations/spellcheck")) 3757 if (gaim_prefs_get_bool("/gaim/gtk/conversations/spellcheck"))
3762 gtkspell_new_attach(GTK_TEXT_VIEW(gtkconv->entry), NULL, NULL); 3758 gaim_gtk_setup_gtkspell(GTK_TEXT_VIEW(gtkconv->entry));
3763 #endif
3764 3759
3765 gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(gtkconv->entry)); 3760 gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(gtkconv->entry));
3766 gtk_widget_show(gtkconv->entry); 3761 gtk_widget_show(gtkconv->entry);
3767 3762
3768 gtkconv->bbox = gtk_hbox_new(FALSE, 5); 3763 gtkconv->bbox = gtk_hbox_new(FALSE, 5);
5893 continue; 5888 continue;
5894 5889
5895 gtkconv = GAIM_GTK_CONVERSATION(conv); 5890 gtkconv = GAIM_GTK_CONVERSATION(conv);
5896 5891
5897 if (value) 5892 if (value)
5898 gtkspell_new_attach(GTK_TEXT_VIEW(gtkconv->entry), NULL, NULL); 5893 gaim_gtk_setup_gtkspell(GTK_TEXT_VIEW(gtkconv->entry));
5899 else { 5894 else {
5900 spell = gtkspell_get_from_text_view(GTK_TEXT_VIEW(gtkconv->entry)); 5895 spell = gtkspell_get_from_text_view(GTK_TEXT_VIEW(gtkconv->entry));
5901 gtkspell_detach(spell); 5896 gtkspell_detach(spell);
5902 } 5897 }
5903 } 5898 }