Mercurial > pidgin.yaz
comparison src/gtkutils.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 | 53c86d59f20b |
children | 2823111061ba |
comparison
equal
deleted
inserted
replaced
7537:083427fd8ba8 | 7538:357eb1c39b72 |
---|---|
28 # ifdef small | 28 # ifdef small |
29 # undef small | 29 # undef small |
30 # endif | 30 # endif |
31 #endif /*_WIN32*/ | 31 #endif /*_WIN32*/ |
32 | 32 |
33 #ifdef USE_GTKSPELL | |
34 # include <gtkspell/gtkspell.h> | |
35 # ifdef _WIN32 | |
36 # include "wspell.h" | |
37 # endif | |
38 #endif | |
39 | |
33 #include <gdk/gdkkeysyms.h> | 40 #include <gdk/gdkkeysyms.h> |
34 | 41 |
35 #include "debug.h" | 42 #include "debug.h" |
36 #include "imgstore.h" | 43 #include "imgstore.h" |
37 #include "notify.h" | 44 #include "notify.h" |
42 | 49 |
43 #include "gtkconv.h" | 50 #include "gtkconv.h" |
44 #include "gtkimhtml.h" | 51 #include "gtkimhtml.h" |
45 #include "gtkutils.h" | 52 #include "gtkutils.h" |
46 #include "ui.h" | 53 #include "ui.h" |
47 | |
48 #ifdef _WIN32 | |
49 #include "wspell.h" | |
50 #endif | |
51 | 54 |
52 guint accels_save_timer = 0; | 55 guint accels_save_timer = 0; |
53 | 56 |
54 static void | 57 static void |
55 url_clicked_cb(GtkWidget *w, const char *uri) | 58 url_clicked_cb(GtkWidget *w, const char *uri) |
1027 | 1030 |
1028 g_free(tmp); | 1031 g_free(tmp); |
1029 return buf; | 1032 return buf; |
1030 } | 1033 } |
1031 | 1034 |
1032 void gaim_gtk_find_images(const char *message, GSList **list) { | 1035 void |
1036 gaim_gtk_find_images(const char *message, GSList **list) | |
1037 { | |
1033 GData *attribs; | 1038 GData *attribs; |
1034 const char *tmp, *start, *end; | 1039 const char *tmp, *start, *end; |
1035 | 1040 |
1036 tmp = message; | 1041 tmp = message; |
1037 while (gaim_markup_find_tag("img", tmp, &start, &end, &attribs)) { | 1042 while (gaim_markup_find_tag("img", tmp, &start, &end, &attribs)) { |
1079 gdk_pixbuf_loader_close(loader, NULL); | 1084 gdk_pixbuf_loader_close(loader, NULL); |
1080 } | 1085 } |
1081 } | 1086 } |
1082 | 1087 |
1083 void | 1088 void |
1089 gaim_gtk_setup_gtkspell(GtkTextView *textview) | |
1090 { | |
1091 #ifdef USE_GTKSPELL | |
1092 GError *error = NULL; | |
1093 char *locale = NULL; | |
1094 | |
1095 g_return_if_fail(textview != NULL); | |
1096 g_return_if_fail(GTK_IS_TEXT_VIEW(textview)); | |
1097 | |
1098 if (gtkspell_new_attach(textview, locale, &error) == NULL && error) | |
1099 { | |
1100 gaim_debug_warning("gtkspell", "Failed to setup GtkSpell: %s\n", | |
1101 error->message); | |
1102 g_error_free(error); | |
1103 } | |
1104 #endif /* USE_GTKSPELL */ | |
1105 } | |
1106 | |
1107 void | |
1084 gaim_gtk_save_accels_cb(GtkAccelGroup *accel_group, guint arg1, | 1108 gaim_gtk_save_accels_cb(GtkAccelGroup *accel_group, guint arg1, |
1085 GdkModifierType arg2, GClosure *arg3, | 1109 GdkModifierType arg2, GClosure *arg3, |
1086 gpointer data) | 1110 gpointer data) |
1087 { | 1111 { |
1088 gaim_debug(GAIM_DEBUG_MISC, "accels", "accel changed, scheduling save.\n"); | 1112 gaim_debug(GAIM_DEBUG_MISC, "accels", "accel changed, scheduling save.\n"); |