pluginpref.xs
来自「Linux下的多协议即时通讯程序源代码」· XS 代码 · 共 172 行
XS
172 行
#include "module.h"MODULE = Purple::PluginPref PACKAGE = Purple::PluginPref::Frame PREFIX = purple_plugin_pref_frame_PROTOTYPES: ENABLEBOOT:{ HV *string_format_stash = gv_stashpv("Purple::String::Format::Type", 1); HV *plugin_pref_stash = gv_stashpv("Purple::PluginPref::Type", 1); static const constiv *civ, string_format_const_iv[] = {#define const_iv(name) {#name, (IV)PURPLE_STRING_FORMAT_TYPE_##name} const_iv(NONE), const_iv(MULTILINE), const_iv(HTML), }; static const constiv plugin_pref_const_iv[] = {#undef const_iv#define const_iv(name) {#name, (IV)PURPLE_PLUGIN_PREF_##name} const_iv(NONE), const_iv(CHOICE), const_iv(INFO), const_iv(STRING_FORMAT), }; for (civ = string_format_const_iv + sizeof(string_format_const_iv) / sizeof(string_format_const_iv[0]); civ-- > string_format_const_iv; ) newCONSTSUB(string_format_stash, (char *)civ->name, newSViv(civ->iv)); for (civ = plugin_pref_const_iv + sizeof(plugin_pref_const_iv) / sizeof(plugin_pref_const_iv[0]); civ-- > plugin_pref_const_iv; ) newCONSTSUB(plugin_pref_stash, (char *)civ->name, newSViv(civ->iv));}voidpurple_plugin_pref_frame_add(frame, pref) Purple::PluginPref::Frame frame Purple::PluginPref prefvoidpurple_plugin_pref_frame_destroy(frame) Purple::PluginPref::Frame framevoidpurple_plugin_pref_frame_get_prefs(frame) Purple::PluginPref::Frame framePREINIT: GList *l;PPCODE: for (l = purple_plugin_pref_frame_get_prefs(frame); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::PluginPref"))); }Purple::PluginPref::Framepurple_plugin_pref_frame_new(class) C_ARGS: /* void */MODULE = Purple::PluginPref PACKAGE = Purple::PluginPref PREFIX = purple_plugin_pref_PROTOTYPES: ENABLEvoidpurple_plugin_pref_add_choice(pref, label, choice) Purple::PluginPref pref const char *label# Do the appropriate conversion based on the perl type specified.# Currently only Strings and Ints will work. gpointer choice = (SvPOKp($arg) ? SvPV($arg, PL_na) : (SvIOKp($arg) ? GINT_TO_POINTER(SvIV($arg)) : NULL));voidpurple_plugin_pref_destroy(pref) Purple::PluginPref prefvoidpurple_plugin_pref_get_bounds(pref, min, max) Purple::PluginPref pref int *min int *maxvoidpurple_plugin_pref_get_choices(pref) Purple::PluginPref prefPREINIT: GList *l;PPCODE: for (l = purple_plugin_pref_get_choices(pref); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::ListItem"))); }const char *purple_plugin_pref_get_label(pref) Purple::PluginPref prefgbooleanpurple_plugin_pref_get_masked(pref) Purple::PluginPref prefunsigned intpurple_plugin_pref_get_max_length(pref) Purple::PluginPref prefconst char *purple_plugin_pref_get_name(pref) Purple::PluginPref prefPurple::PluginPrefTypepurple_plugin_pref_get_type(pref) Purple::PluginPref prefPurple::PluginPrefpurple_plugin_pref_new(class) C_ARGS: /* void */Purple::PluginPrefpurple_plugin_pref_new_with_label(class, label) const char *label C_ARGS: labelPurple::PluginPrefpurple_plugin_pref_new_with_name(class, name) const char *name C_ARGS: namePurple::PluginPrefpurple_plugin_pref_new_with_name_and_label(class, name, label) const char *name const char *label C_ARGS: name, labelvoidpurple_plugin_pref_set_bounds(pref, min, max) Purple::PluginPref pref int min int maxvoidpurple_plugin_pref_set_label(pref, label) Purple::PluginPref pref const char *labelvoidpurple_plugin_pref_set_masked(pref, mask) Purple::PluginPref pref gboolean maskvoidpurple_plugin_pref_set_max_length(pref, max_length) Purple::PluginPref pref unsigned int max_lengthvoidpurple_plugin_pref_set_name(pref, name) Purple::PluginPref pref const char *namevoidpurple_plugin_pref_set_type(pref, type) Purple::PluginPref pref Purple::PluginPrefType typePREINIT: PurplePluginPrefType gpp_type;CODE: gpp_type = PURPLE_PLUGIN_PREF_NONE; if (type == 1) { gpp_type = PURPLE_PLUGIN_PREF_CHOICE; } else if (type == 2) { gpp_type = PURPLE_PLUGIN_PREF_INFO; } purple_plugin_pref_set_type(pref, gpp_type);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?