diff --git a/docs/signals.txt b/docs/signals.txt index ba2b148f..51aa4792 100644 --- a/docs/signals.txt +++ b/docs/signals.txt @@ -9,7 +9,6 @@ core "gui exit" "gui dialog", char *type, char *text "send command", char *command, SERVER_REC, WI_ITEM_REC - "print text stripped", WINDOW_REC, SERVER_REC, char *channel, int level, char *text * Provides signals: @@ -254,8 +253,8 @@ keyboard.c: "keyinfo destroyed", KEYINFO_REC printtext.c: - "print text", WINDOW_REC, SERVER_REC, char *channel, int level, char *text - "print text stripped", WINDOW_REC, SERVER_REC, char *channel, int level, char *text + "print text", TEXT_DEST_REC *dest, char *text + "print text stripped", TEXT_DEST_REC *dest, char *text themes.c: "theme created", THEME_REC 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 } };