mirror of
https://github.com/irssi/irssi.git
synced 2024-10-27 05:20:20 -04:00
Didn't I already commit these? .. added format_get_text(),
gui_printtext_after(), last_line_insert() and fixed a few memleaks. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2040 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
93d69f50ee
commit
00423151f9
@ -111,6 +111,43 @@ gui_printtext(xpos, ypos, str)
|
||||
int ypos
|
||||
char *str
|
||||
|
||||
MODULE = Irssi::TextUI PACKAGE = Irssi::UI::Window
|
||||
|
||||
void
|
||||
gui_printtext_after(window, prev, level, str)
|
||||
Irssi::UI::Window window
|
||||
Irssi::TextUI::Line prev
|
||||
int level
|
||||
char *str
|
||||
PREINIT:
|
||||
TEXT_DEST_REC dest;
|
||||
CODE:
|
||||
format_create_dest(&dest, NULL, NULL, level, window);
|
||||
gui_printtext_after(&dest, prev, str);
|
||||
|
||||
Irssi::TextUI::Line
|
||||
last_line_insert(window)
|
||||
Irssi::UI::Window window
|
||||
CODE:
|
||||
RETVAL = WINDOW_GUI(window)->insert_after;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
MODULE = Irssi::TextUI PACKAGE = Irssi::UI::Server
|
||||
|
||||
void
|
||||
gui_printtext_after(server, target, prev, level, str)
|
||||
Irssi::Server server
|
||||
char *target
|
||||
Irssi::TextUI::Line prev
|
||||
int level
|
||||
char *str
|
||||
PREINIT:
|
||||
TEXT_DEST_REC dest;
|
||||
CODE:
|
||||
format_create_dest(&dest, server, target, level, NULL);
|
||||
gui_printtext_after(&dest, prev, str);
|
||||
|
||||
BOOT:
|
||||
irssi_boot(TextUI__Statusbar);
|
||||
irssi_boot(TextUI__TextBuffer);
|
||||
|
28
src/perl/ui/Formats.xs
Normal file
28
src/perl/ui/Formats.xs
Normal file
@ -0,0 +1,28 @@
|
||||
#include "module.h"
|
||||
|
||||
MODULE = Irssi::UI::Formats PACKAGE = Irssi::UI::Window
|
||||
PROTOTYPES: ENABLE
|
||||
|
||||
void
|
||||
format_get_text(window, module, server, target, formatnum, ...)
|
||||
Irssi::UI::Window window
|
||||
char *module
|
||||
Irssi::Server server
|
||||
char *target
|
||||
int formatnum
|
||||
PREINIT:
|
||||
char **charargs;
|
||||
char *ret;
|
||||
int n;
|
||||
STRLEN n_a;
|
||||
PPCODE:
|
||||
charargs = g_new0(char *, items-5+1);
|
||||
charargs[items-5] = NULL;
|
||||
for (n = 5; n < items; n++) {
|
||||
charargs[n-5] = (char *)SvPV(ST(n), n_a);
|
||||
}
|
||||
ret = format_get_text(module, window, server, target, formatnum, charargs);
|
||||
g_free(charargs);
|
||||
|
||||
XPUSHs(sv_2mortal(new_pv(ret)));
|
||||
g_free_not_null(ret);
|
@ -207,17 +207,19 @@ CODE:
|
||||
MODULE = Irssi::UI::Themes PACKAGE = Irssi::UI::Theme PREFIX = theme_
|
||||
#*******************************
|
||||
|
||||
char *
|
||||
void
|
||||
theme_format_expand(theme, format, flags=0)
|
||||
Irssi::UI::Theme theme
|
||||
char *format
|
||||
int flags
|
||||
CODE:
|
||||
PREINIT:
|
||||
char *ret;
|
||||
PPCODE:
|
||||
if (flags == 0) {
|
||||
RETVAL = theme_format_expand(theme, format);
|
||||
ret = theme_format_expand(theme, format);
|
||||
} else {
|
||||
RETVAL = theme_format_expand_data(theme, (const char **) &format, 'n', 'n',
|
||||
NULL, NULL, EXPAND_FLAG_ROOT | flags);
|
||||
ret = theme_format_expand_data(theme, (const char **) &format, 'n', 'n',
|
||||
NULL, NULL, EXPAND_FLAG_ROOT | flags);
|
||||
}
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
XPUSHs(sv_2mortal(new_pv(ret)));
|
||||
g_free_not_null(ret);
|
||||
|
@ -87,5 +87,6 @@ CODE:
|
||||
perl_themes_deinit();
|
||||
|
||||
BOOT:
|
||||
irssi_boot(UI__Formats);
|
||||
irssi_boot(UI__Themes);
|
||||
irssi_boot(UI__Window);
|
||||
|
Loading…
Reference in New Issue
Block a user