diff options
author | Timo Sirainen <cras@irssi.org> | 2001-11-25 15:27:47 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-11-25 15:27:47 +0000 |
commit | 7ae96f540dc6ec0def541d97def9585155fc8dce (patch) | |
tree | d50a74ddf7a2ce5747b52fa03dbaa84c73e38c5b /src | |
parent | 8fd09aa09fb547e2c96e127ff3622a495b3a29ab (diff) | |
download | irssi-7ae96f540dc6ec0def541d97def9585155fc8dce.zip |
Added printtext_string_window(), Irssi::UI::Window::print() uses it also
now.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2141 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/printtext.c | 22 | ||||
-rw-r--r-- | src/fe-common/core/printtext.h | 1 | ||||
-rw-r--r-- | src/perl/ui/Window.xs | 2 |
3 files changed, 24 insertions, 1 deletions
diff --git a/src/fe-common/core/printtext.c b/src/fe-common/core/printtext.c index 3c38fd9b..b5e7dbd8 100644 --- a/src/fe-common/core/printtext.c +++ b/src/fe-common/core/printtext.c @@ -334,6 +334,28 @@ void printtext_string(void *server, const char *target, int level, const char *t g_free(str); } +/* Like printtext_window(), but don't handle %s etc. */ +void printtext_string_window(WINDOW_REC *window, int level, const char *text) +{ + TEXT_DEST_REC dest; + char *str; + + g_return_if_fail(text != NULL); + + format_create_dest(&dest, NULL, NULL, level, + window != NULL ? window : active_win); + + if (!sending_print_starting) { + sending_print_starting = TRUE; + signal_emit_id(signal_print_starting, 1, dest); + sending_print_starting = FALSE; + } + + str = printtext_expand_formats(text, &dest.flags); + print_line(&dest, str); + g_free(str); +} + void printtext_window(WINDOW_REC *window, int level, const char *text, ...) { TEXT_DEST_REC dest; diff --git a/src/fe-common/core/printtext.h b/src/fe-common/core/printtext.h index 656ca412..a29085ec 100644 --- a/src/fe-common/core/printtext.h +++ b/src/fe-common/core/printtext.h @@ -12,6 +12,7 @@ void printformat_module_window_args(const char *module, WINDOW_REC *window, int void printtext(void *server, const char *target, int level, const char *text, ...); void printtext_string(void *server, const char *target, int level, const char *text); +void printtext_string_window(WINDOW_REC *window, int level, const char *text); void printtext_window(WINDOW_REC *window, int level, const char *text, ...); void printtext_multiline(void *server, const char *target, int level, const char *format, const char *text); void printtext_dest(TEXT_DEST_REC *dest, const char *text, ...); diff --git a/src/perl/ui/Window.xs b/src/perl/ui/Window.xs index b40cd464..f5e61c0e 100644 --- a/src/perl/ui/Window.xs +++ b/src/perl/ui/Window.xs @@ -159,7 +159,7 @@ print(window, str, level=MSGLEVEL_CLIENTNOTICE) char *str int level; CODE: - printtext_window(window, level, str); + printtext_string_window(window, level, str); void command(window, cmd) |