summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-04-26 15:43:09 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-04-26 15:43:09 +0000
commit64c8feeede901aa22311aafa6e7ef87d5073f3ad (patch)
treee9df31246d5ad8a1768cfeda5f0761a00d843807 /src
parent33738b682c0390fb528b26cabcb71984a41a0edb (diff)
downloadirssi-64c8feeede901aa22311aafa6e7ef87d5073f3ad.zip
%# now toggles monospace font on/off. fe-text doesn't care about it, but
gtk/kde UI does. By default, all lists are printed using monospace fonts. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2718 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/fe-common/core/formats.c11
-rw-r--r--src/fe-common/core/formats.h2
-rw-r--r--src/fe-common/core/module-formats.c62
-rw-r--r--src/fe-common/irc/module-formats.c12
-rw-r--r--src/fe-text/module-formats.c18
-rw-r--r--src/perl/module-formats.c4
6 files changed, 59 insertions, 50 deletions
diff --git a/src/fe-common/core/formats.c b/src/fe-common/core/formats.c
index 2a0faa38..99f12ce4 100644
--- a/src/fe-common/core/formats.c
+++ b/src/fe-common/core/formats.c
@@ -169,6 +169,10 @@ int format_expand_styles(GString *out, const char **format, int *flags)
g_string_append_c(out, 4);
g_string_append_c(out, FORMAT_STYLE_CLRTOEOL);
break;
+ case '#':
+ g_string_append_c(out, 4);
+ g_string_append_c(out, FORMAT_STYLE_MONOSPACE);
+ break;
case '[':
/* code */
format_expand_code(format, out, flags);
@@ -997,6 +1001,9 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text)
case FORMAT_STYLE_REVERSE:
flags ^= GUI_PRINT_FLAG_REVERSE;
break;
+ case FORMAT_STYLE_MONOSPACE:
+ flags ^= GUI_PRINT_FLAG_MONOSPACE;
+ break;
case FORMAT_STYLE_INDENT:
flags |= GUI_PRINT_FLAG_INDENT;
break;
@@ -1015,7 +1022,7 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text)
case FORMAT_STYLE_DEFAULTS:
fgcolor = theme->default_color;
bgcolor = -1;
- flags &= GUI_PRINT_FLAG_INDENT;
+ flags &= GUI_PRINT_FLAG_INDENT|GUI_PRINT_FLAG_MONOSPACE;
break;
case FORMAT_STYLE_CLRTOEOL:
break;
@@ -1056,7 +1063,7 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text)
/* remove all styling */
fgcolor = theme->default_color;
bgcolor = -1;
- flags &= GUI_PRINT_FLAG_INDENT;
+ flags &= GUI_PRINT_FLAG_INDENT|GUI_PRINT_FLAG_MONOSPACE;
break;
case 22:
/* reverse */
diff --git a/src/fe-common/core/formats.h b/src/fe-common/core/formats.h
index 531a4613..7dbdd904 100644
--- a/src/fe-common/core/formats.h
+++ b/src/fe-common/core/formats.h
@@ -13,6 +13,7 @@
#define GUI_PRINT_FLAG_INDENT_FUNC 0x0040
#define GUI_PRINT_FLAG_NEWLINE 0x0080
#define GUI_PRINT_FLAG_CLRTOEOL 0x0100
+#define GUI_PRINT_FLAG_MONOSPACE 0x0200
#define MAX_FORMAT_PARAMS 10
#define DEFAULT_FORMAT_ARGLIST_SIZE 200
@@ -131,6 +132,7 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text);
#define FORMAT_STYLE_INDENT_FUNC (0x06 + FORMAT_STYLE_SPECIAL)
#define FORMAT_STYLE_DEFAULTS (0x07 + FORMAT_STYLE_SPECIAL)
#define FORMAT_STYLE_CLRTOEOL (0x08 + FORMAT_STYLE_SPECIAL)
+#define FORMAT_STYLE_MONOSPACE (0x09 + FORMAT_STYLE_SPECIAL)
int format_expand_styles(GString *out, const char **format, int *flags);
void formats_init(void);
diff --git a/src/fe-common/core/module-formats.c b/src/fe-common/core/module-formats.c
index da84d5df..fd1617b3 100644
--- a/src/fe-common/core/module-formats.c
+++ b/src/fe-common/core/module-formats.c
@@ -42,28 +42,28 @@ FORMAT_REC fecommon_core_formats[] = {
{ "window_set_immortal", "Window is now immortal", 0 },
{ "window_unset_immortal", "Window isn't immortal anymore", 0 },
{ "window_immortal_error", "Window is immortal, if you really want to close it, say /WINDOW IMMORTAL OFF", 0 },
- { "windowlist_header", "Ref Name Active item Server Level", 0 },
- { "windowlist_line", "$[3]0 %|$[20]1 $[15]2 $[15]3 $4", 5, { 1, 0, 0, 0, 0 } },
+ { "windowlist_header", "%#Ref Name Active item Server Level", 0 },
+ { "windowlist_line", "%#$[3]0 %|$[20]1 $[15]2 $[15]3 $4", 5, { 1, 0, 0, 0, 0 } },
{ "windowlist_footer", "", 0 },
{ "windows_layout_saved", "Layout of windows is now remembered next time you start irssi", 0 },
{ "windows_layout_reset", "Layout of windows reset to defaults", 0 },
{ "window_info_header", "", 0 },
{ "window_info_footer", "", 0 },
- { "window_info_refnum", "Window : {hilight #$0}", 1, { 1 } },
- { "window_info_refnum_sticky", "Window : {hilight #$0 (sticky)}", 1, { 1 } },
- { "window_info_name", "Name : $0", 1, { 0 } },
- { "window_info_history", "History : $0", 1, { 0 } },
- { "window_info_immortal", "Immortal: yes", 0 },
- { "window_info_size", "Size : $0x$1", 2, { 1, 1 } },
- { "window_info_level", "Level : $0", 1, { 0 } },
- { "window_info_server", "Server : $0", 1, { 0 } },
- { "window_info_server_sticky", "Server : $0 (sticky)", 1, { 0 } },
- { "window_info_theme", "Theme : $0$1", 2, { 0, 0 } },
- { "window_info_bound_items_header", "Bounds : {hilight Name Server tag}", 0 },
- { "window_info_bound_item", " : $[!30]0 $[!15]1 $2", 3, { 0, 0, 0 } },
+ { "window_info_refnum", "%#Window : {hilight #$0}", 1, { 1 } },
+ { "window_info_refnum_sticky", "%#Window : {hilight #$0 (sticky)}", 1, { 1 } },
+ { "window_info_name", "%#Name : $0", 1, { 0 } },
+ { "window_info_history", "%#History : $0", 1, { 0 } },
+ { "window_info_immortal", "%#Immortal: yes", 0 },
+ { "window_info_size", "%#Size : $0x$1", 2, { 1, 1 } },
+ { "window_info_level", "%#Level : $0", 1, { 0 } },
+ { "window_info_server", "%#Server : $0", 1, { 0 } },
+ { "window_info_server_sticky", "%#Server : $0 (sticky)", 1, { 0 } },
+ { "window_info_theme", "%#Theme : $0$1", 2, { 0, 0 } },
+ { "window_info_bound_items_header", "%#Bounds : {hilight Name Server tag}", 0 },
+ { "window_info_bound_item", "%# : $[!30]0 $[!15]1 $2", 3, { 0, 0, 0 } },
{ "window_info_bound_items_footer", "", 0 },
- { "window_info_items_header", "Items : {hilight Name Server tag}", 0 },
- { "window_info_item", " $[7]0: $[!30]1 $2", 3, { 0, 0, 0 } },
+ { "window_info_items_header", "%#Items : {hilight Name Server tag}", 0 },
+ { "window_info_item", "%# $[7]0: $[!30]1 $2", 3, { 0, 0, 0 } },
{ "window_info_items_footer", "", 0 },
/* ---- */
@@ -108,19 +108,19 @@ FORMAT_REC fecommon_core_formats[] = {
{ "not_in_channels", "You are not on any channels", 0 },
{ "current_channel", "Current channel {channel $0}", 1, { 0 } },
{ "names", "{names_users Users {names_channel $0}}", 6, { 0, 1, 1, 1, 1, 1 } },
- { "names_prefix", "{names_prefix $0}", 1, { 0 } },
+ { "names_prefix", "%#{names_prefix $0}", 1, { 0 } },
{ "names_nick_op", "{names_nick_op $0 $1}", 2, { 0, 0 } },
{ "names_nick_halfop", "{names_nick_halfop $0 $1}", 2, { 0, 0 } },
{ "names_nick_voice", "{names_nick_voice $0 $1}", 2, { 0, 0 } },
{ "names_nick", "{names_nick $0 $1}", 2, { 0, 0 } },
{ "endofnames", "{channel $0}: Total of {hilight $1} nicks {comment {hilight $2} ops, {hilight $3} halfops, {hilight $4} voices, {hilight $5} normal}", 6, { 0, 1, 1, 1, 1, 1 } },
- { "chanlist_header", "You are on the following channels:", 0 },
- { "chanlist_line", "{channel $[-10]0} %|+$1 ($2): $3", 4, { 0, 0, 0, 0 } },
+ { "chanlist_header", "%#You are on the following channels:", 0 },
+ { "chanlist_line", "%#{channel $[-10]0} %|+$1 ($2): $3", 4, { 0, 0, 0, 0 } },
{ "chansetup_not_found", "Channel {channel $0} not found", 2, { 0, 0 } },
{ "chansetup_added", "Channel {channel $0} saved", 2, { 0, 0 } },
{ "chansetup_removed", "Channel {channel $0} removed", 2, { 0, 0 } },
- { "chansetup_header", "Channel Network Password Settings", 0 },
- { "chansetup_line", "{channel $[15]0} %|$[10]1 $[10]2 $3", 4, { 0, 0, 0, 0 } },
+ { "chansetup_header", "%#Channel Network Password Settings", 0 },
+ { "chansetup_line", "%#{channel $[15]0} %|$[10]1 $[10]2 $3", 4, { 0, 0, 0, 0 } },
{ "chansetup_footer", "", 0 },
/* ---- */
@@ -152,8 +152,8 @@ FORMAT_REC fecommon_core_formats[] = {
/* ---- */
{ NULL, "Highlighting", 0 },
- { "hilight_header", "Highlights:", 0 },
- { "hilight_line", "$[-4]0 $1 $2 $3$4$5", 7, { 1, 0, 0, 0, 0, 0, 0 } },
+ { "hilight_header", "%#Highlights:", 0 },
+ { "hilight_line", "%#$[-4]0 $1 $2 $3$4$5", 7, { 1, 0, 0, 0, 0, 0, 0 } },
{ "hilight_footer", "", 0 },
{ "hilight_not_found", "Highlight not found: $0", 1, { 0 } },
{ "hilight_removed", "Highlight removed: $0", 1, { 0 } },
@@ -164,8 +164,8 @@ FORMAT_REC fecommon_core_formats[] = {
{ "alias_added", "Alias $0 added", 1, { 0 } },
{ "alias_removed", "Alias $0 removed", 1, { 0 } },
{ "alias_not_found", "No such alias: $0", 1, { 0 } },
- { "aliaslist_header", "Aliases:", 0 },
- { "aliaslist_line", "$[10]0 $1", 2, { 0, 0 } },
+ { "aliaslist_header", "%#Aliases:", 0 },
+ { "aliaslist_line", "%#$[10]0 $1", 2, { 0, 0 } },
{ "aliaslist_footer", "", 0 },
/* ---- */
@@ -178,8 +178,8 @@ FORMAT_REC fecommon_core_formats[] = {
{ "log_not_open", "Log file {hilight $0} not open", 1, { 0 } },
{ "log_started", "Started logging to file {hilight $0}", 1, { 0 } },
{ "log_stopped", "Stopped logging to file {hilight $0}", 1, { 0 } },
- { "log_list_header", "Logs:", 0 },
- { "log_list", "$0 $1: $2 $3$4", 5, { 1, 0, 0, 0, 0, 0 } },
+ { "log_list_header", "%#Logs:", 0 },
+ { "log_list", "%#$0 $1: $2 $3$4", 5, { 1, 0, 0, 0, 0, 0 } },
{ "log_list_footer", "", 0 },
{ "windowlog_file", "Window LOGFILE set to $0", 1, { 0 } },
{ "windowlog_file_logging", "Can't change window's logfile while log is on", 0 },
@@ -189,8 +189,8 @@ FORMAT_REC fecommon_core_formats[] = {
/* ---- */
{ NULL, "Modules", 0 },
- { "module_header", "Module Type Submodules", 0, },
- { "module_line", "$[!20]0 $[7]1 $2", 3, { 0, 0, 0 } },
+ { "module_header", "%#Module Type Submodules", 0, },
+ { "module_line", "%#$[!20]0 $[7]1 $2", 3, { 0, 0, 0 } },
{ "module_footer", "", 0, },
{ "module_already_loaded", "Module {hilight $0/$1} already loaded", 2, { 0, 0 } },
{ "module_not_loaded", "Module {hilight $0/$1} is not loaded", 2, { 0, 0 } },
@@ -237,8 +237,8 @@ FORMAT_REC fecommon_core_formats[] = {
{ "unignored", "Unignored {nick $0}", 1, { 0 } },
{ "ignore_not_found", "{nick $0} is not being ignored", 1, { 0 } },
{ "ignore_no_ignores", "There are no ignores", 0 },
- { "ignore_header", "Ignorance List:", 0 },
- { "ignore_line", "$[-4]0 $1: $2 $3 $4", 4, { 1, 0, 0, 0 } },
+ { "ignore_header", "%#Ignorance List:", 0 },
+ { "ignore_line", "%#$[-4]0 $1: $2 $3 $4", 4, { 1, 0, 0, 0 } },
{ "ignore_footer", "", 0 },
/* ---- */
diff --git a/src/fe-common/irc/module-formats.c b/src/fe-common/irc/module-formats.c
index dbfadd68..7f5384f3 100644
--- a/src/fe-common/irc/module-formats.c
+++ b/src/fe-common/irc/module-formats.c
@@ -32,17 +32,17 @@ FORMAT_REC fecommon_irc_formats[] = {
{ "netsplit_join", "{netjoin Netsplit} over, joins: $0", 1, { 0 } },
{ "netsplit_join_more", "{netjoin Netsplit} over, joins: $0 (+$1 more)", 2, { 0, 1 } },
{ "no_netsplits", "There are no net splits", 0 },
- { "netsplits_header", "Nick Channel Server Splitted server", 0 },
- { "netsplits_line", "$[9]0 $[10]1 $[20]2 $3", 4, { 0, 0, 0, 0 } },
+ { "netsplits_header", "%#Nick Channel Server Splitted server", 0 },
+ { "netsplits_line", "%#$[9]0 $[10]1 $[20]2 $3", 4, { 0, 0, 0, 0 } },
{ "netsplits_footer", "", 0 },
{ "ircnet_added", "Ircnet $0 saved", 1, { 0 } },
{ "ircnet_removed", "Ircnet $0 removed", 1, { 0 } },
{ "ircnet_not_found", "Ircnet $0 not found", 1, { 0 } },
- { "ircnet_header", "Ircnets:", 0 },
- { "ircnet_line", "$0: $1", 2, { 0, 0 } },
+ { "ircnet_header", "%#Ircnets:", 0 },
+ { "ircnet_line", "%#$0: $1", 2, { 0, 0 } },
{ "ircnet_footer", "", 0 },
- { "setupserver_header", "Server Port Network Settings", 0 },
- { "setupserver_line", "%|$[!20]0 $[5]1 $[10]2 $3", 4, { 0, 1, 0, 0 } },
+ { "setupserver_header", "%#Server Port Network Settings", 0 },
+ { "setupserver_line", "%#%|$[!20]0 $[5]1 $[10]2 $3", 4, { 0, 1, 0, 0 } },
{ "setupserver_footer", "", 0 },
/* ---- */
diff --git a/src/fe-text/module-formats.c b/src/fe-text/module-formats.c
index f236d900..5a9b668e 100644
--- a/src/fe-text/module-formats.c
+++ b/src/fe-text/module-formats.c
@@ -53,17 +53,17 @@ FORMAT_REC gui_text_formats[] =
/* ---- */
{ NULL, "Statusbars", 0 },
- { "statusbar_list_header", "Name Type Placement Position Visible", 0 },
+ { "statusbar_list_header", "%#Name Type Placement Position Visible", 0 },
{ "statusbar_list_footer", "", 0 },
- { "statusbar_list", "$[30]0 $[6]1 $[9]2 $[8]3 $4", 5, { 0, 0, 0, 1, 0 } },
- { "statusbar_info_name", "Statusbar: {hilight $0}", 1, { 0 } },
- { "statusbar_info_type", "Type : $0", 1, { 0 } },
- { "statusbar_info_placement", "Placement: $0", 1, { 0 } },
- { "statusbar_info_position", "Position : $0", 1, { 1 } },
- { "statusbar_info_visible", "Visible : $0", 1, { 0 } },
- { "statusbar_info_item_header", "Items : Name Priority Alignment", 0 },
+ { "statusbar_list", "%#$[30]0 $[6]1 $[9]2 $[8]3 $4", 5, { 0, 0, 0, 1, 0 } },
+ { "statusbar_info_name", "%#Statusbar: {hilight $0}", 1, { 0 } },
+ { "statusbar_info_type", "%#Type : $0", 1, { 0 } },
+ { "statusbar_info_placement", "%#Placement: $0", 1, { 0 } },
+ { "statusbar_info_position", "%#Position : $0", 1, { 1 } },
+ { "statusbar_info_visible", "%#Visible : $0", 1, { 0 } },
+ { "statusbar_info_item_header", "%#Items : Name Priority Alignment", 0 },
{ "statusbar_info_item_footer", "", 0 },
- { "statusbar_info_item_name", " : $[35]0 $[9]1 $2", 3, { 0, 1, 0 } },
+ { "statusbar_info_item_name", "%# : $[35]0 $[9]1 $2", 3, { 0, 1, 0 } },
{ "statusbar_not_found", "Statusbar doesn't exist: $0", 1, { 0 } },
{ "statusbar_not_found", "Statusbar doesn't exist: $0", 1, { 0 } },
{ "statusbar_item_not_found", "Statusbar item doesn't exist: $0", 1, { 0 } },
diff --git a/src/perl/module-formats.c b/src/perl/module-formats.c
index 5c2e1c66..8840e437 100644
--- a/src/perl/module-formats.c
+++ b/src/perl/module-formats.c
@@ -32,8 +32,8 @@ FORMAT_REC feperl_formats[] = {
{ "script_loaded", "Loaded script {hilight $0}", 2, { 0, 0 } },
{ "script_unloaded", "Unloaded script {hilight $0}", 1, { 0 } },
{ "no_scripts_loaded", "No scripts are loaded", 0 },
- { "script_list_header", "Loaded scripts:", 0 },
- { "script_list_line", "$[!15]0 $1", 2, { 0, 0 } },
+ { "script_list_header", "%#Loaded scripts:", 0 },
+ { "script_list_line", "%#$[!15]0 $1", 2, { 0, 0 } },
{ "script_list_footer", "", 0 },
{ "script_error", "{error Error in script {hilight $0}:}", 1, { 0 } },