mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Irssi::printformat() called printformat_window() to print the text which
lost server/target information. Added printtext_dest() function which it uses now. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1642 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
088358ca61
commit
40ffd87ded
@ -274,7 +274,7 @@ static char *printtext_expand_formats(const char *str, int *flags)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void printtext_dest(TEXT_DEST_REC *dest, const char *text, va_list va)
|
static void printtext_dest_args(TEXT_DEST_REC *dest, const char *text, va_list va)
|
||||||
{
|
{
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
@ -289,6 +289,15 @@ void printtext_dest(TEXT_DEST_REC *dest, const char *text, va_list va)
|
|||||||
g_free(str);
|
g_free(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void printtext_dest(TEXT_DEST_REC *dest, const char *text, ...)
|
||||||
|
{
|
||||||
|
va_list va;
|
||||||
|
|
||||||
|
va_start(va, text);
|
||||||
|
printtext_dest_args(dest, text, va);
|
||||||
|
va_end(va);
|
||||||
|
}
|
||||||
|
|
||||||
/* Write text to target - convert color codes */
|
/* Write text to target - convert color codes */
|
||||||
void printtext(void *server, const char *target, int level, const char *text, ...)
|
void printtext(void *server, const char *target, int level, const char *text, ...)
|
||||||
{
|
{
|
||||||
@ -300,7 +309,7 @@ void printtext(void *server, const char *target, int level, const char *text, ..
|
|||||||
format_create_dest(&dest, server, target, level, NULL);
|
format_create_dest(&dest, server, target, level, NULL);
|
||||||
|
|
||||||
va_start(va, text);
|
va_start(va, text);
|
||||||
printtext_dest(&dest, text, va);
|
printtext_dest_args(&dest, text, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,7 +345,7 @@ void printtext_window(WINDOW_REC *window, int level, const char *text, ...)
|
|||||||
window != NULL ? window : active_win);
|
window != NULL ? window : active_win);
|
||||||
|
|
||||||
va_start(va, text);
|
va_start(va, text);
|
||||||
printtext_dest(&dest, text, va);
|
printtext_dest_args(&dest, text, va);
|
||||||
va_end(va);
|
va_end(va);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define __PRINTTEXT_H
|
#define __PRINTTEXT_H
|
||||||
|
|
||||||
#include "fe-windows.h"
|
#include "fe-windows.h"
|
||||||
|
#include "formats.h"
|
||||||
|
|
||||||
void printformat_module(const char *module, void *server, const char *target, int level, int formatnum, ...);
|
void printformat_module(const char *module, void *server, const char *target, int level, int formatnum, ...);
|
||||||
void printformat_module_window(const char *module, WINDOW_REC *window, int level, int formatnum, ...);
|
void printformat_module_window(const char *module, WINDOW_REC *window, int level, int formatnum, ...);
|
||||||
@ -13,6 +14,7 @@ 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(void *server, const char *target, int level, const char *text);
|
||||||
void printtext_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_multiline(void *server, const char *target, int level, const char *format, const char *text);
|
||||||
|
void printtext_dest(TEXT_DEST_REC *dest, const char *text, ...);
|
||||||
|
|
||||||
/* only GUI should call these - used for printing text to somewhere else
|
/* only GUI should call these - used for printing text to somewhere else
|
||||||
than windows */
|
than windows */
|
||||||
|
@ -70,7 +70,7 @@ void printformat_perl(TEXT_DEST_REC *dest, char *format, char **arglist)
|
|||||||
&dest, GINT_TO_POINTER(formatnum), arglist);
|
&dest, GINT_TO_POINTER(formatnum), arglist);
|
||||||
|
|
||||||
str = format_get_text_theme_charargs(theme, module, dest, formatnum, arglist);
|
str = format_get_text_theme_charargs(theme, module, dest, formatnum, arglist);
|
||||||
if (*str != '\0') printtext_window(dest->window, dest->level, "%s", str);
|
if (*str != '\0') printtext_dest(dest, "%s", str);
|
||||||
g_free(str);
|
g_free(str);
|
||||||
g_free(module);
|
g_free(module);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user