Sun, 02 Feb 2014 00:22:57 +0530
Merged gtkdoc-conversion branch
| 15231 | 1 | /* |
| 2 | * Conversation Colors | |
| 3 | * Copyright (C) 2006 | |
| 4 | * | |
| 5 | * This program is free software; you can redistribute it and/or | |
| 6 | * modify it under the terms of the GNU General Public License as | |
| 7 | * published by the Free Software Foundation; either version 2 of the | |
| 8 | * License, or (at your option) any later version. | |
| 9 | * | |
| 10 | * This program is distributed in the hope that it will be useful, but | |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | * General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU General Public License | |
| 16 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16749
diff
changeset
|
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
16749
diff
changeset
|
18 | * 02111-1301, USA. |
| 15231 | 19 | */ |
| 20 | #include "internal.h" | |
| 21 | ||
| 22 | #define PLUGIN_ID "gtk-plugin_pack-convcolors" | |
|
15418
bf287f742a5a
[gaim-migrate @ 18149]
Luke Schierer <lschiere@pidgin.im>
parents:
15231
diff
changeset
|
23 | #define PLUGIN_NAME N_("Conversation Colors") |
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
24 | #define PLUGIN_CATEGORY N_("User interface") |
|
25633
feee0c7e503f
Fix some more mis-identified plugins, like 3b3526a0...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22178
diff
changeset
|
25 | #define PLUGIN_STATIC_NAME ConversationColors |
|
15418
bf287f742a5a
[gaim-migrate @ 18149]
Luke Schierer <lschiere@pidgin.im>
parents:
15231
diff
changeset
|
26 | #define PLUGIN_SUMMARY N_("Customize colors in the conversation window") |
|
bf287f742a5a
[gaim-migrate @ 18149]
Luke Schierer <lschiere@pidgin.im>
parents:
15231
diff
changeset
|
27 | #define PLUGIN_DESCRIPTION N_("Customize colors in the conversation window") |
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
28 | #define PLUGIN_AUTHORS {"Sadrul H Chowdhury <sadrul@users.sourceforge.net>", NULL} |
| 15231 | 29 | |
| 30 | /* System headers */ | |
| 31 | #include <gdk/gdk.h> | |
| 32 | #include <glib.h> | |
| 33 | #include <gtk/gtk.h> | |
| 34 | ||
| 15884 | 35 | /* Purple headers */ |
| 15231 | 36 | #include <gtkplugin.h> |
| 37 | #include <version.h> | |
| 38 | ||
| 39 | #include <conversation.h> | |
| 40 | #include <gtkconv.h> | |
| 41 | #include <gtkprefs.h> | |
| 42 | #include <gtkutils.h> | |
| 43 | ||
| 44 | #define PREF_PREFIX "/plugins/gtk/" PLUGIN_ID | |
| 45 | #define PREF_IGNORE PREF_PREFIX "/ignore_incoming" | |
| 46 | #define PREF_CHATS PREF_PREFIX "/chats" | |
| 47 | #define PREF_IMS PREF_PREFIX "/ims" | |
| 48 | ||
| 49 | #define PREF_SEND PREF_PREFIX "/send" | |
| 50 | #define PREF_SEND_C PREF_SEND "/color" | |
| 51 | #define PREF_SEND_F PREF_SEND "/format" | |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
52 | #define PREF_SEND_E PREF_SEND "/enabled" |
| 15231 | 53 | |
| 54 | #define PREF_RECV PREF_PREFIX "/recv" | |
| 55 | #define PREF_RECV_C PREF_RECV "/color" | |
| 56 | #define PREF_RECV_F PREF_RECV "/format" | |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
57 | #define PREF_RECV_E PREF_RECV "/enabled" |
| 15231 | 58 | |
| 59 | #define PREF_SYSTEM PREF_PREFIX "/system" | |
| 60 | #define PREF_SYSTEM_C PREF_SYSTEM "/color" | |
| 61 | #define PREF_SYSTEM_F PREF_SYSTEM "/format" | |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
62 | #define PREF_SYSTEM_E PREF_SYSTEM "/enabled" |
| 15231 | 63 | |
| 64 | #define PREF_ERROR PREF_PREFIX "/error" | |
| 65 | #define PREF_ERROR_C PREF_ERROR "/color" | |
| 66 | #define PREF_ERROR_F PREF_ERROR "/format" | |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
67 | #define PREF_ERROR_E PREF_ERROR "/enabled" |
| 15231 | 68 | |
| 69 | #define PREF_NICK PREF_PREFIX "/nick" | |
| 70 | #define PREF_NICK_C PREF_NICK "/color" | |
| 71 | #define PREF_NICK_F PREF_NICK "/format" | |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
72 | #define PREF_NICK_E PREF_NICK "/enabled" |
| 15231 | 73 | |
| 74 | enum | |
| 75 | { | |
| 76 | FONT_BOLD = 1 << 0, | |
| 77 | FONT_ITALIC = 1 << 1, | |
| 78 | FONT_UNDERLINE = 1 << 2 | |
| 79 | }; | |
| 80 | ||
|
22178
02521e1b838e
Prpls seem to be sending '\n' (or '\r\n') for newlines, instead of '<br>' to the core. Fixes #4545.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21789
diff
changeset
|
81 | static struct |
| 15231 | 82 | { |
| 15884 | 83 | PurpleMessageFlags flag; |
| 15231 | 84 | char *prefix; |
| 85 | const char *text; | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30010
diff
changeset
|
86 | } formats[] = |
| 15231 | 87 | { |
| 15884 | 88 | {PURPLE_MESSAGE_ERROR, PREF_ERROR, N_("Error Messages")}, |
| 89 | {PURPLE_MESSAGE_NICK, PREF_NICK, N_("Highlighted Messages")}, | |
| 90 | {PURPLE_MESSAGE_SYSTEM, PREF_SYSTEM, N_("System Messages")}, | |
| 91 | {PURPLE_MESSAGE_SEND, PREF_SEND, N_("Sent Messages")}, | |
| 92 | {PURPLE_MESSAGE_RECV, PREF_RECV, N_("Received Messages")}, | |
| 15231 | 93 | {0, NULL, NULL} |
| 94 | }; | |
| 95 | ||
| 96 | static gboolean | |
| 15884 | 97 | displaying_msg(PurpleAccount *account, const char *who, char **displaying, |
| 98 | PurpleConversation *conv, PurpleMessageFlags flags) | |
| 15231 | 99 | { |
| 100 | int i; | |
| 101 | char tmp[128], *t; | |
| 102 | gboolean bold, italic, underline; | |
| 103 | int f; | |
| 104 | const char *color; | |
|
27234
82035475de62
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25633
diff
changeset
|
105 | gboolean rtl = FALSE; |
| 15231 | 106 | |
| 107 | for (i = 0; formats[i].prefix; i++) | |
| 108 | if (flags & formats[i].flag) | |
| 109 | break; | |
| 110 | ||
| 111 | if (!formats[i].prefix) | |
| 112 | return FALSE; | |
| 113 | ||
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
114 | g_snprintf(tmp, sizeof(tmp), "%s/enabled", formats[i].prefix); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
115 | |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
116 | if (!purple_prefs_get_bool(tmp) || |
|
34660
68c776e3436e
Refactored pidgin plugins to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
33683
diff
changeset
|
117 | (PURPLE_IS_IM_CONVERSATION(conv) && !purple_prefs_get_bool(PREF_IMS)) || |
|
68c776e3436e
Refactored pidgin plugins to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
33683
diff
changeset
|
118 | (PURPLE_IS_CHAT_CONVERSATION(conv) && !purple_prefs_get_bool(PREF_CHATS))) |
| 15231 | 119 | return FALSE; |
| 120 | ||
| 121 | g_snprintf(tmp, sizeof(tmp), "%s/color", formats[i].prefix); | |
| 15884 | 122 | color = purple_prefs_get_string(tmp); |
| 15231 | 123 | |
| 124 | g_snprintf(tmp, sizeof(tmp), "%s/format", formats[i].prefix); | |
| 15884 | 125 | f = purple_prefs_get_int(tmp); |
| 15231 | 126 | bold = (f & FONT_BOLD); |
| 127 | italic = (f & FONT_ITALIC); | |
| 128 | underline = (f & FONT_UNDERLINE); | |
|
27234
82035475de62
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25633
diff
changeset
|
129 | rtl = purple_markup_is_rtl(*displaying); |
| 15231 | 130 | |
| 15884 | 131 | if (purple_prefs_get_bool(PREF_IGNORE)) |
| 15231 | 132 | { |
|
22178
02521e1b838e
Prpls seem to be sending '\n' (or '\r\n') for newlines, instead of '<br>' to the core. Fixes #4545.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21789
diff
changeset
|
133 | /* This seems to be necessary, especially for received messages. */ |
|
02521e1b838e
Prpls seem to be sending '\n' (or '\r\n') for newlines, instead of '<br>' to the core. Fixes #4545.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21789
diff
changeset
|
134 | t = *displaying; |
|
02521e1b838e
Prpls seem to be sending '\n' (or '\r\n') for newlines, instead of '<br>' to the core. Fixes #4545.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21789
diff
changeset
|
135 | *displaying = purple_strreplace(t, "\n", "<br>"); |
|
02521e1b838e
Prpls seem to be sending '\n' (or '\r\n') for newlines, instead of '<br>' to the core. Fixes #4545.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21789
diff
changeset
|
136 | g_free(t); |
|
02521e1b838e
Prpls seem to be sending '\n' (or '\r\n') for newlines, instead of '<br>' to the core. Fixes #4545.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21789
diff
changeset
|
137 | |
| 15231 | 138 | t = *displaying; |
| 15884 | 139 | *displaying = purple_markup_strip_html(t); |
| 15231 | 140 | g_free(t); |
|
15488
d3de0d1f569d
Fix bug #1645435. Thanks to Dennis Ristuccia (more commonly known as EvilDennisR) for helping me find the bug.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15481
diff
changeset
|
141 | |
|
d3de0d1f569d
Fix bug #1645435. Thanks to Dennis Ristuccia (more commonly known as EvilDennisR) for helping me find the bug.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15481
diff
changeset
|
142 | t = *displaying; |
|
d3de0d1f569d
Fix bug #1645435. Thanks to Dennis Ristuccia (more commonly known as EvilDennisR) for helping me find the bug.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15481
diff
changeset
|
143 | *displaying = g_markup_escape_text(t, -1); |
|
d3de0d1f569d
Fix bug #1645435. Thanks to Dennis Ristuccia (more commonly known as EvilDennisR) for helping me find the bug.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15481
diff
changeset
|
144 | g_free(t); |
|
d3de0d1f569d
Fix bug #1645435. Thanks to Dennis Ristuccia (more commonly known as EvilDennisR) for helping me find the bug.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15481
diff
changeset
|
145 | |
|
15481
6e9da7b5bd5c
Fix convcolors to not unlinkify the links.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
146 | /* Restore the links */ |
|
6e9da7b5bd5c
Fix convcolors to not unlinkify the links.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
147 | t = *displaying; |
| 15884 | 148 | *displaying = purple_markup_linkify(t); |
|
15481
6e9da7b5bd5c
Fix convcolors to not unlinkify the links.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15435
diff
changeset
|
149 | g_free(t); |
| 15231 | 150 | } |
| 151 | ||
| 152 | if (color && *color) | |
| 153 | { | |
| 154 | t = *displaying; | |
| 155 | *displaying = g_strdup_printf("<FONT COLOR=\"%s\">%s</FONT>", color, t); | |
| 156 | g_free(t); | |
| 157 | } | |
| 158 | ||
| 159 | t = *displaying; | |
|
27234
82035475de62
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25633
diff
changeset
|
160 | *displaying = g_strdup_printf("%s%s%s%s%s%s%s%s%s", |
| 15231 | 161 | bold ? "<B>" : "</B>", |
| 162 | italic ? "<I>" : "</I>", | |
| 163 | underline ? "<U>" : "</U>", | |
|
27234
82035475de62
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25633
diff
changeset
|
164 | rtl ? "<SPAN style=\"direction:rtl;text-align:right;\">" : "", |
|
82035475de62
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25633
diff
changeset
|
165 | t, |
|
82035475de62
Add a utlity function purple_markup_is_rtl
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
25633
diff
changeset
|
166 | rtl ? "</SPAN>" : "", |
| 15231 | 167 | bold ? "</B>" : "<B>", |
| 168 | italic ? "</I>" : "<I>", | |
| 169 | underline ? "</U>" : "<U>" | |
| 170 | ); | |
| 171 | g_free(t); | |
| 172 | ||
| 173 | return FALSE; | |
| 174 | } | |
| 175 | ||
| 15884 | 176 | /* Ripped from PurpleRC */ |
| 15231 | 177 | static void |
| 178 | color_response(GtkDialog *color_dialog, gint response, const char *data) | |
| 179 | { | |
| 180 | if (response == GTK_RESPONSE_OK) | |
| 181 | { | |
|
30010
2b3e5bbd0492
Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27234
diff
changeset
|
182 | GtkWidget *colorsel = |
|
2b3e5bbd0492
Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27234
diff
changeset
|
183 | gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog)); |
| 15231 | 184 | GdkColor color; |
| 185 | char colorstr[8]; | |
| 186 | char tmp[128]; | |
| 187 | ||
| 188 | gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(colorsel), &color); | |
| 189 | ||
| 190 | g_snprintf(colorstr, sizeof(colorstr), "#%02X%02X%02X", | |
| 191 | color.red/256, color.green/256, color.blue/256); | |
| 192 | ||
| 193 | g_snprintf(tmp, sizeof(tmp), "%s/color", data); | |
| 194 | ||
| 15884 | 195 | purple_prefs_set_string(tmp, colorstr); |
| 15231 | 196 | } |
| 197 | ||
| 198 | gtk_widget_destroy(GTK_WIDGET(color_dialog)); | |
| 199 | } | |
| 200 | ||
| 201 | static void | |
| 202 | set_color(GtkWidget *widget, const char *data) | |
| 203 | { | |
| 204 | GtkWidget *color_dialog = NULL; | |
| 205 | GdkColor color; | |
| 206 | char title[128]; | |
| 207 | char tmp[128]; | |
| 208 | ||
| 209 | g_snprintf(title, sizeof(title), _("Select Color for %s"), _(data)); | |
| 210 | color_dialog = gtk_color_selection_dialog_new(title); | |
| 211 | g_signal_connect(G_OBJECT(color_dialog), "response", | |
| 212 | G_CALLBACK(color_response), (gpointer)data); | |
| 213 | ||
| 214 | g_snprintf(tmp, sizeof(tmp), "%s/color", data); | |
| 15884 | 215 | if (gdk_color_parse(purple_prefs_get_string(tmp), &color)) |
| 15231 | 216 | { |
|
30010
2b3e5bbd0492
Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27234
diff
changeset
|
217 | gtk_color_selection_set_current_color(GTK_COLOR_SELECTION( |
|
2b3e5bbd0492
Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27234
diff
changeset
|
218 | gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog))), |
|
2b3e5bbd0492
Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27234
diff
changeset
|
219 | &color); |
| 15231 | 220 | } |
| 221 | ||
| 222 | gtk_window_present(GTK_WINDOW(color_dialog)); | |
| 223 | } | |
| 224 | ||
| 225 | static void | |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
226 | toggle_enabled(GtkWidget *widget, gpointer data) |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
227 | { |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
228 | const char *prefix = (char *)data; |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
229 | gboolean e; |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
230 | char tmp[128]; |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
231 | |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
232 | g_snprintf(tmp, sizeof(tmp), "%s/enabled", prefix); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
233 | e = purple_prefs_get_bool(tmp); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
234 | purple_prefs_set_bool(tmp, !e); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
235 | } |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
236 | |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
237 | static void |
| 15231 | 238 | toggle_something(const char *prefix, int format) |
| 239 | { | |
| 240 | int f; | |
| 241 | char tmp[128]; | |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
242 | |
| 15231 | 243 | g_snprintf(tmp, sizeof(tmp), "%s/format", prefix); |
| 15884 | 244 | f = purple_prefs_get_int(tmp); |
| 15231 | 245 | f ^= format; |
| 15884 | 246 | purple_prefs_set_int(tmp, f); |
| 15231 | 247 | } |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
248 | |
| 15231 | 249 | static void |
| 250 | toggle_bold(GtkWidget *widget, gpointer data) | |
| 251 | { | |
| 252 | toggle_something(data, FONT_BOLD); | |
| 253 | } | |
| 254 | ||
| 255 | static void | |
| 256 | toggle_italic(GtkWidget *widget, gpointer data) | |
| 257 | { | |
| 258 | toggle_something(data, FONT_ITALIC); | |
| 259 | } | |
| 260 | ||
| 261 | static void | |
| 262 | toggle_underline(GtkWidget *widget, gpointer data) | |
| 263 | { | |
| 264 | toggle_something(data, FONT_UNDERLINE); | |
| 265 | } | |
| 266 | ||
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
267 | static void |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
268 | enable_toggled(const char *name, PurplePrefType type, gconstpointer val, gpointer data) |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
269 | { |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
270 | GtkWidget *widget = (GtkWidget *)data; |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
271 | |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
272 | gtk_widget_set_sensitive(widget, GPOINTER_TO_INT(val)); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
273 | } |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
274 | |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
275 | static void |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32438
diff
changeset
|
276 | disconnect_prefs_callbacks(GtkAdjustment *object, gpointer data) |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
277 | { |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
278 | PurplePlugin *plugin = (PurplePlugin *)data; |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
279 | |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
280 | purple_prefs_disconnect_by_handle(plugin); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
281 | } |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
282 | |
| 15231 | 283 | static GtkWidget * |
| 15884 | 284 | get_config_frame(PurplePlugin *plugin) |
| 15231 | 285 | { |
| 286 | GtkWidget *ret; | |
| 287 | GtkWidget *frame; | |
| 288 | int i; | |
| 289 | ||
| 15882 | 290 | ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE); |
| 291 | gtk_container_set_border_width(GTK_CONTAINER(ret), PIDGIN_HIG_BORDER); | |
| 15231 | 292 | |
| 293 | for (i = 0; formats[i].prefix; i++) | |
| 294 | { | |
| 295 | char tmp[128]; | |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
296 | char tmp2[128]; |
| 15231 | 297 | int f; |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
298 | gboolean e; |
| 15231 | 299 | GtkWidget *vbox, *hbox, *button; |
| 300 | ||
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
301 | g_snprintf(tmp2, sizeof(tmp2), "%s/enabled", formats[i].prefix); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
302 | e = purple_prefs_get_bool(tmp2); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
303 | |
| 15231 | 304 | g_snprintf(tmp, sizeof(tmp), "%s/format", formats[i].prefix); |
| 15884 | 305 | f = purple_prefs_get_int(tmp); |
| 15231 | 306 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15488
diff
changeset
|
307 | frame = pidgin_make_frame(ret, _(formats[i].text)); |
| 15882 | 308 | vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 15231 | 309 | gtk_box_pack_start(GTK_BOX(frame), vbox, FALSE, FALSE, 0); |
| 310 | ||
| 15882 | 311 | hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 15231 | 312 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
| 313 | ||
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
314 | button = gtk_check_button_new_with_label(_("Enabled")); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
315 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
316 | if (e) |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
317 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
318 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(toggle_enabled), |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
319 | formats[i].prefix); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
320 | |
| 15568 | 321 | button = pidgin_pixbuf_button_from_stock(" Color", GTK_STOCK_SELECT_COLOR, |
| 322 | PIDGIN_BUTTON_HORIZONTAL); | |
| 15231 | 323 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
| 324 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(set_color), | |
| 325 | formats[i].prefix); | |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
326 | gtk_widget_set_sensitive(button, e); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
327 | purple_prefs_connect_callback(plugin, tmp2, enable_toggled, button); |
| 15231 | 328 | |
| 329 | button = gtk_check_button_new_with_label(_("Bold")); | |
| 330 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 331 | if (f & FONT_BOLD) | |
| 332 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); | |
| 333 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(toggle_bold), | |
| 334 | formats[i].prefix); | |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
335 | gtk_widget_set_sensitive(button, e); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
336 | purple_prefs_connect_callback(plugin, tmp2, enable_toggled, button); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
337 | |
| 15231 | 338 | button = gtk_check_button_new_with_label(_("Italic")); |
| 339 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 340 | if (f & FONT_ITALIC) | |
| 341 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); | |
| 342 | g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(toggle_italic), | |
| 343 | formats[i].prefix); | |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
344 | gtk_widget_set_sensitive(button, e); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
345 | purple_prefs_connect_callback(plugin, tmp2, enable_toggled, button); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
346 | |
| 15231 | 347 | button = gtk_check_button_new_with_label(_("Underline")); |
| 348 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); | |
| 349 | if (f & FONT_UNDERLINE) | |
| 350 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), TRUE); | |
| 351 | g_signal_connect(G_OBJECT(button), "clicked", | |
| 352 | G_CALLBACK(toggle_underline), formats[i].prefix); | |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
353 | gtk_widget_set_sensitive(button, e); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
354 | purple_prefs_connect_callback(plugin, tmp2, enable_toggled, button); |
| 15231 | 355 | } |
| 356 | ||
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32438
diff
changeset
|
357 | g_signal_connect(G_OBJECT(ret), "destroy", G_CALLBACK(disconnect_prefs_callbacks), plugin); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15488
diff
changeset
|
358 | frame = pidgin_make_frame(ret, _("General")); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15488
diff
changeset
|
359 | pidgin_prefs_checkbox(_("Ignore incoming format"), PREF_IGNORE, frame); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15488
diff
changeset
|
360 | pidgin_prefs_checkbox(_("Apply in Chats"), PREF_CHATS, frame); |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15488
diff
changeset
|
361 | pidgin_prefs_checkbox(_("Apply in IMs"), PREF_IMS, frame); |
| 15231 | 362 | |
| 363 | gtk_widget_show_all(ret); | |
| 364 | return ret; | |
| 365 | } | |
| 366 | ||
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
367 | static PidginPluginInfo * |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
368 | plugin_query(GError **error) |
| 15231 | 369 | { |
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
370 | const gchar * const authors[] = PLUGIN_AUTHORS; |
| 15231 | 371 | |
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
372 | return pidgin_plugin_info_new( |
|
36935
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
373 | "id", PLUGIN_ID, |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
374 | "name", PLUGIN_NAME, |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
375 | "version", DISPLAY_VERSION, |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
376 | "category", PLUGIN_CATEGORY, |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
377 | "summary", PLUGIN_SUMMARY, |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
378 | "description", PLUGIN_DESCRIPTION, |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
379 | "authors", authors, |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
380 | "website", PURPLE_WEBSITE, |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
381 | "abi-version", PURPLE_ABI_VERSION, |
|
5384600e613c
Made finch and pidgin pref property names shorter: "gnt-pref-frame-cb" and "gtk-config-frame-cb"
Ankit Vani <a@nevitus.org>
parents:
36934
diff
changeset
|
382 | "gtk-config-frame-cb", get_config_frame, |
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
383 | NULL |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
384 | ); |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
385 | } |
| 15231 | 386 | |
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
387 | static gboolean |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
388 | plugin_load(PurplePlugin *plugin, GError **error) |
| 15231 | 389 | { |
| 15884 | 390 | purple_prefs_add_none(PREF_PREFIX); |
| 15231 | 391 | |
| 15884 | 392 | purple_prefs_add_bool(PREF_IGNORE, TRUE); |
| 393 | purple_prefs_add_bool(PREF_CHATS, TRUE); | |
| 394 | purple_prefs_add_bool(PREF_IMS, TRUE); | |
| 15231 | 395 | |
| 15884 | 396 | purple_prefs_add_none(PREF_SEND); |
| 397 | purple_prefs_add_none(PREF_RECV); | |
| 398 | purple_prefs_add_none(PREF_SYSTEM); | |
| 399 | purple_prefs_add_none(PREF_ERROR); | |
| 400 | purple_prefs_add_none(PREF_NICK); | |
| 15231 | 401 | |
| 15884 | 402 | purple_prefs_add_string(PREF_SEND_C, "#909090"); |
| 403 | purple_prefs_add_string(PREF_RECV_C, "#000000"); | |
| 404 | purple_prefs_add_string(PREF_SYSTEM_C, "#50a050"); | |
| 405 | purple_prefs_add_string(PREF_ERROR_C, "#ff0000"); | |
| 406 | purple_prefs_add_string(PREF_NICK_C, "#0000dd"); | |
| 15231 | 407 | |
| 15884 | 408 | purple_prefs_add_int(PREF_SEND_F, 0); |
| 409 | purple_prefs_add_int(PREF_RECV_F, 0); | |
| 410 | purple_prefs_add_int(PREF_SYSTEM_F, FONT_ITALIC); | |
| 411 | purple_prefs_add_int(PREF_ERROR_F, FONT_BOLD | FONT_UNDERLINE); | |
| 412 | purple_prefs_add_int(PREF_NICK_F, FONT_BOLD); | |
|
21789
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
413 | |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
414 | purple_prefs_add_bool(PREF_SEND_E, TRUE); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
415 | purple_prefs_add_bool(PREF_RECV_E, TRUE); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
416 | purple_prefs_add_bool(PREF_SYSTEM_E, TRUE); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
417 | purple_prefs_add_bool(PREF_ERROR_E, TRUE); |
|
1ba3811fdba4
Add an option per message type to enable (/disable) the overriding of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20288
diff
changeset
|
418 | purple_prefs_add_bool(PREF_NICK_E, TRUE); |
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
419 | |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
420 | purple_signal_connect(pidgin_conversations_get_handle(), |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
421 | "displaying-im-msg", plugin, |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
422 | PURPLE_CALLBACK(displaying_msg), NULL); |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
423 | purple_signal_connect(pidgin_conversations_get_handle(), |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
424 | "displaying-chat-msg", plugin, |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
425 | PURPLE_CALLBACK(displaying_msg), NULL); |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
426 | return TRUE; |
| 15231 | 427 | } |
| 428 | ||
|
36755
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
429 | static gboolean |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
430 | plugin_unload(PurplePlugin *plugin, GError **error) |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
431 | { |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
432 | return TRUE; |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
433 | } |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
434 | |
|
4826ec4c6ac5
More pidgin plugins to new API
Ankit Vani <a@nevitus.org>
parents:
34660
diff
changeset
|
435 | PURPLE_PLUGIN_INIT(PLUGIN_STATIC_NAME, plugin_query, plugin_load, plugin_unload); |