From 014c07d71c44e2a1432ec3577f39212277123bb4 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 20 Apr 2001 19:24:20 +0000 Subject: Added TEXT_DEST_REC to perl, fixed "print text..." signal declarations. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1453 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/perl/common/module.h | 1 + src/perl/common/typemap | 1 + src/perl/get-signals.pl | 1 + src/perl/perl-fe.c | 15 +++++++++++++++ 4 files changed, 18 insertions(+) (limited to 'src') diff --git a/src/perl/common/module.h b/src/perl/common/module.h index e355ac8a..11a60fe7 100644 --- a/src/perl/common/module.h +++ b/src/perl/common/module.h @@ -53,3 +53,4 @@ typedef THEME_REC *Irssi__Theme; typedef KEYINFO_REC *Irssi__Keyinfo; typedef WINDOW_REC *Irssi__Window; typedef WI_ITEM_REC *Irssi__Windowitem; +typedef TEXT_DEST_REC *Irssi__TextDest; diff --git a/src/perl/common/typemap b/src/perl/common/typemap index 5be3bcd0..f2432f17 100644 --- a/src/perl/common/typemap +++ b/src/perl/common/typemap @@ -16,6 +16,7 @@ Irssi::Theme T_PlainObj Irssi::Keyinfo T_PlainObj Irssi::Window T_PlainObj Irssi::Windowitem T_IrssiObj +Irssi::TextDest T_PlainObj INPUT diff --git a/src/perl/get-signals.pl b/src/perl/get-signals.pl index 56a5753a..b995ba9d 100755 --- a/src/perl/get-signals.pl +++ b/src/perl/get-signals.pl @@ -44,6 +44,7 @@ while () { s/THEME_REC[^,]*/Irssi::Theme/g; s/KEYINFO_REC[^,]*/Irssi::Keyinfo/g; s/PROCESS_REC[^,]*/Irssi::Process/g; + s/TEXT_DEST_REC[^,]*/Irssi::TextDest/g; s/WINDOW_REC[^,]*/Irssi::Window/g; s/WI_ITEM_REC[^,]*/iobject/g; diff --git a/src/perl/perl-fe.c b/src/perl/perl-fe.c index 4594fd75..6aca6262 100644 --- a/src/perl/perl-fe.c +++ b/src/perl/perl-fe.c @@ -64,6 +64,20 @@ static void perl_window_fill_hash(HV *hv, WINDOW_REC *window) hv_store(hv, "last_line", 9, newSViv(window->last_line), 0); } +static void perl_text_dest_fill_hash(HV *hv, TEXT_DEST_REC *dest) +{ + HV *stash; + + stash = gv_stashpv("Irssi::Window", 0); + hv_store(hv, "window", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(dest->window))), stash), 0); + hv_store(hv, "server", 6, irssi_bless(dest->server), 0); + hv_store(hv, "target", 6, new_pv(dest->target), 0); + hv_store(hv, "level", 5, newSViv(dest->level), 0); + + hv_store(hv, "hilight_priority", 16, newSViv(dest->hilight_priority), 0); + hv_store(hv, "hilight_color", 13, new_pv(dest->hilight_color), 0); +} + void printformat_perl(TEXT_DEST_REC *dest, char *format, char **arglist) { THEME_REC *theme; @@ -126,6 +140,7 @@ void fe_perl_init(void) static PLAIN_OBJECT_INIT_REC fe_plains[] = { { "Irssi::Process", (PERL_OBJECT_FUNC) perl_process_fill_hash }, { "Irssi::Window", (PERL_OBJECT_FUNC) perl_window_fill_hash }, + { "Irssi::TextDest", (PERL_OBJECT_FUNC) perl_text_dest_fill_hash }, { NULL, NULL } }; -- cgit v1.2.3