diff options
author | Ailin Nemui <ailin@esf51.localdomain> | 2014-08-22 13:48:17 +0200 |
---|---|---|
committer | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2015-12-09 12:05:48 +0100 |
commit | 3532fc46719ebbcfe83b5814f93ac9cb58eea220 (patch) | |
tree | 076b6b6d446479e406a12e5977e8c786814e2cdf /src/perl/ui | |
parent | 229c600e9963452689669a8466b1c7f49912125e (diff) | |
download | irssi-3532fc46719ebbcfe83b5814f93ac9cb58eea220.zip |
Add bindings for exec-type window items to Perl
These bindings were missing and resulted in non-hash non-undef active
entries when an interactive process is executing.
Diffstat (limited to 'src/perl/ui')
-rw-r--r-- | src/perl/ui/UI.xs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/perl/ui/UI.xs b/src/perl/ui/UI.xs index 9db57e98..5ac3da4e 100644 --- a/src/perl/ui/UI.xs +++ b/src/perl/ui/UI.xs @@ -64,6 +64,19 @@ static void perl_text_dest_fill_hash(HV *hv, TEXT_DEST_REC *dest) (void) hv_store(hv, "hilight_color", 13, new_pv(dest->hilight_color), 0); } +static void perl_exec_fill_hash(HV *hv, EXEC_WI_REC *item) +{ + g_return_if_fail(hv != NULL); + g_return_if_fail(item != NULL); + + perl_window_item_fill_hash(hv, (WI_ITEM_REC *) item); + /* we don't bless to Process here to avoid infinite recursion + in the simplistic script binding */ + if (item->process != NULL) { + (void) hv_store(hv, "process_id", 10, newSViv(item->process->id), 0); + } +} + static PLAIN_OBJECT_INIT_REC fe_plains[] = { { "Irssi::UI::Process", (PERL_OBJECT_FUNC) perl_process_fill_hash }, { "Irssi::UI::Window", (PERL_OBJECT_FUNC) perl_window_fill_hash }, @@ -94,6 +107,10 @@ CODE: initialized = TRUE; irssi_add_plains(fe_plains); + /* window items: fe-exec */ + irssi_add_object(module_get_uniq_id_str("WINDOW ITEM TYPE", "EXEC"), + 0, "Irssi::UI::Exec", + (PERL_OBJECT_FUNC) perl_exec_fill_hash); perl_themes_init(); void |