diff options
author | Timo Sirainen <cras@irssi.org> | 2002-12-28 15:25:10 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-12-28 15:25:10 +0000 |
commit | 9c18cb00e7d096e46f5853f802724da4c59c2857 (patch) | |
tree | 4d84b3c326e93b9a0d097e3ce47e24a2771858f7 /src/perl/ui | |
parent | 3a1ceaf3d08ace2b81cf0c3418e5720638847360 (diff) | |
download | irssi-9c18cb00e7d096e46f5853f802724da4c59c2857.zip |
Added support to define new default abstracts at runtime.
Irssi::abstracts_register([key => value, ...]);
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3079 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/perl/ui')
-rw-r--r-- | src/perl/ui/Themes.xs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/perl/ui/Themes.xs b/src/perl/ui/Themes.xs index 7f1c5277..8aa30410 100644 --- a/src/perl/ui/Themes.xs +++ b/src/perl/ui/Themes.xs @@ -136,6 +136,31 @@ CODE: printformat_perl(&dest, format, arglist); +void +abstracts_register(SV *abstracts) +PREINIT: + AV *av; + char *key, *value; + int i, len; +CODE: + if (!SvROK(abstracts)) + croak("abstracts is not a reference to list"); + av = (AV *) SvRV(abstracts); + len = av_len(av)+1; + if (len == 0 || (len & 1) != 0) + croak("abstracts list is invalid - not divisible by 2 (%d)", len); + + for (i = 0; i < len; i++) { + key = SvPV(*av_fetch(av, i, 0), PL_na); i++; + value = SvPV(*av_fetch(av, i, 0), PL_na); + + theme_set_default_abstract(key, value); + } + themes_reload(); + +void +themes_reload() + #******************************* MODULE = Irssi::UI::Themes PACKAGE = Irssi::Server #******************************* |