mirror of
https://github.com/irssi/irssi.git
synced 2024-09-01 04:14:16 -04:00
add LINE_INFO_META_REC to Perl
This commit is contained in:
parent
6a52b5ac07
commit
1602b506a6
@ -52,12 +52,13 @@ while (<>) {
|
|||||||
CLIENT_REC => 'Irssi::Irc::Client',
|
CLIENT_REC => 'Irssi::Irc::Client',
|
||||||
|
|
||||||
# fe-common
|
# fe-common
|
||||||
THEME_REC => 'Irssi::UI::Theme',
|
THEME_REC => 'Irssi::UI::Theme',
|
||||||
KEYINFO_REC => 'Irssi::UI::Keyinfo',
|
KEYINFO_REC => 'Irssi::UI::Keyinfo',
|
||||||
PROCESS_REC => 'Irssi::UI::Process',
|
PROCESS_REC => 'Irssi::UI::Process',
|
||||||
TEXT_DEST_REC => 'Irssi::UI::TextDest',
|
TEXT_DEST_REC => 'Irssi::UI::TextDest',
|
||||||
WINDOW_REC => 'Irssi::UI::Window',
|
LINE_INFO_META_REC => 'Irssi::UI::LineInfoMeta',
|
||||||
WI_ITEM_REC => 'iobject',
|
WINDOW_REC => 'Irssi::UI::Window',
|
||||||
|
WI_ITEM_REC => 'iobject',
|
||||||
|
|
||||||
# fe-text
|
# fe-text
|
||||||
TEXTBUFFER_VIEW_REC => 'Irssi::TextUI::TextBufferView',
|
TEXTBUFFER_VIEW_REC => 'Irssi::TextUI::TextBufferView',
|
||||||
|
@ -101,30 +101,10 @@ PPCODE:
|
|||||||
}
|
}
|
||||||
XPUSHs(sv_2mortal(newRV_noinc((SV *) hv)));
|
XPUSHs(sv_2mortal(newRV_noinc((SV *) hv)));
|
||||||
|
|
||||||
void
|
Irssi::UI::LineInfoMeta
|
||||||
textbuffer_line_get_meta(line)
|
textbuffer_line_get_meta(line)
|
||||||
Irssi::TextUI::Line line
|
Irssi::TextUI::Line line
|
||||||
PREINIT:
|
CODE:
|
||||||
HV *hv;
|
RETVAL = line->line->info.meta;
|
||||||
LINE_REC *l;
|
OUTPUT:
|
||||||
LINE_INFO_META_REC *m;
|
RETVAL
|
||||||
GHashTableIter iter;
|
|
||||||
char *key;
|
|
||||||
char *val;
|
|
||||||
PPCODE:
|
|
||||||
hv = newHV();
|
|
||||||
l = line->line;
|
|
||||||
if (l->info.meta != NULL) {
|
|
||||||
m = l->info.meta;
|
|
||||||
if (m->hash != NULL) {
|
|
||||||
g_hash_table_iter_init(&iter, m->hash);
|
|
||||||
while (
|
|
||||||
g_hash_table_iter_next(&iter, (gpointer *) &key, (gpointer *) &val)) {
|
|
||||||
(void) hv_store(hv, key, strlen(key), new_pv(val), 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (m->server_time) {
|
|
||||||
(void) hv_store(hv, "server_time", 11, newSViv(m->server_time), 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
XPUSHs(sv_2mortal(newRV_noinc((SV *) hv)));
|
|
||||||
|
@ -64,6 +64,26 @@ 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);
|
(void) hv_store(hv, "hilight_color", 13, new_pv(dest->hilight_color), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void perl_line_info_meta_fill_hash(HV *hv, LINE_INFO_META_REC *meta)
|
||||||
|
{
|
||||||
|
GHashTableIter iter;
|
||||||
|
char *key;
|
||||||
|
char *val;
|
||||||
|
|
||||||
|
if (meta != NULL) {
|
||||||
|
if (meta->hash != NULL) {
|
||||||
|
g_hash_table_iter_init(&iter, meta->hash);
|
||||||
|
while (
|
||||||
|
g_hash_table_iter_next(&iter, (gpointer *) &key, (gpointer *) &val)) {
|
||||||
|
(void) hv_store(hv, key, strlen(key), new_pv(val), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (meta->server_time) {
|
||||||
|
(void) hv_store(hv, "server_time", 11, newSViv(meta->server_time), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void perl_exec_fill_hash(HV *hv, EXEC_WI_REC *item)
|
static void perl_exec_fill_hash(HV *hv, EXEC_WI_REC *item)
|
||||||
{
|
{
|
||||||
g_return_if_fail(hv != NULL);
|
g_return_if_fail(hv != NULL);
|
||||||
@ -81,6 +101,7 @@ static PLAIN_OBJECT_INIT_REC fe_plains[] = {
|
|||||||
{ "Irssi::UI::Process", (PERL_OBJECT_FUNC) perl_process_fill_hash },
|
{ "Irssi::UI::Process", (PERL_OBJECT_FUNC) perl_process_fill_hash },
|
||||||
{ "Irssi::UI::Window", (PERL_OBJECT_FUNC) perl_window_fill_hash },
|
{ "Irssi::UI::Window", (PERL_OBJECT_FUNC) perl_window_fill_hash },
|
||||||
{ "Irssi::UI::TextDest", (PERL_OBJECT_FUNC) perl_text_dest_fill_hash },
|
{ "Irssi::UI::TextDest", (PERL_OBJECT_FUNC) perl_text_dest_fill_hash },
|
||||||
|
{ "Irssi::UI::LineInfoMeta", (PERL_OBJECT_FUNC) perl_line_info_meta_fill_hash },
|
||||||
|
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
@ -12,3 +12,4 @@ typedef WINDOW_REC *Irssi__UI__Window;
|
|||||||
typedef TEXT_DEST_REC *Irssi__UI__TextDest;
|
typedef TEXT_DEST_REC *Irssi__UI__TextDest;
|
||||||
typedef THEME_REC *Irssi__UI__Theme;
|
typedef THEME_REC *Irssi__UI__Theme;
|
||||||
typedef KEYINFO_REC *Irssi__UI__Keyinfo;
|
typedef KEYINFO_REC *Irssi__UI__Keyinfo;
|
||||||
|
typedef LINE_INFO_META_REC *Irssi__UI__LineInfoMeta;
|
||||||
|
@ -3,6 +3,7 @@ Irssi::UI::Theme T_PlainObj
|
|||||||
Irssi::UI::Window T_PlainObj
|
Irssi::UI::Window T_PlainObj
|
||||||
Irssi::UI::Keyinfo T_PlainObj
|
Irssi::UI::Keyinfo T_PlainObj
|
||||||
Irssi::UI::TextDest T_PlainObj
|
Irssi::UI::TextDest T_PlainObj
|
||||||
|
Irssi::UI::LineInfoMeta T_PlainObj
|
||||||
|
|
||||||
INPUT
|
INPUT
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user