diff --git a/misc/skins/default.ini b/misc/skins/default.ini index c8087b691..04f40afb7 100644 --- a/misc/skins/default.ini +++ b/misc/skins/default.ini @@ -18,16 +18,15 @@ [core] _default_=lightgray;blue - selected=black;cyan;A_REVERSE - marked=yellow;blue;A_BOLD - markselect=yellow;cyan; A_REVERSE|A_BOLD - reverse=black;lightgray;A_REVERSE + selected=black;cyan + marked=yellow;blue + markselect=yellow;cyan; gauge=white;black input=black;cyan [dialog] - _default_=black;lightgray;A_REVERSE - focus=black;cyan;A_BOLD + _default_=black;lightgray + focus=black;cyan hotnormal=blue;lightgray hotfocus=blue;cyan @@ -50,28 +49,28 @@ [menu] _default_=white;cyan - entry=white;cyan;A_REVERSE + entry=white;cyan hot=yellow;cyan - selected=white;black;A_BOLD + selected=white;black hotselected=yellow;black [help] - _default_=black;lightgray;A_REVERSE - italic=red;lightgray;A_REVERSE - bold=blue;lightgray;A_REVERSE + _default_=black;lightgray + italic=red;lightgray + bold=blue;lightgray link=black;cyan - slink=yellow;blue;A_BOLD + slink=yellow;blue [editor] - bold=yellow;blue;A_BOLD - marked=black;cyan;A_REVERSE + bold=yellow;blue + marked=black;cyan whitespace=brightblue;blue linestate=white;cyan [viewer] - underline=brightred;blue;A_UNDERLINE + underline=brightred;blue [error] - _default_=white;red;A_BOLD + _default_=white;red hotnormal=yellow;red hotfocus=yellow;lightgray diff --git a/misc/skins/far.ini b/misc/skins/far.ini index c5e77d369..3f338ca01 100644 --- a/misc/skins/far.ini +++ b/misc/skins/far.ini @@ -18,16 +18,15 @@ [core] _default_=lightgray;blue - selected=black;cyan;A_REVERSE - marked=yellow;blue;A_BOLD - markselect=yellow;cyan; A_REVERSE|A_BOLD - reverse=black;lightgray;A_REVERSE + selected=black;cyan + marked=yellow;blue + markselect=yellow;cyan; gauge=white;black input=black;cyan [dialog] - _default_=black;lightgray;A_REVERSE - focus=black;cyan;A_BOLD + _default_=black;lightgray + focus=black;cyan hotnormal=blue;lightgray hotfocus=blue;cyan @@ -50,28 +49,28 @@ [menu] _default_=white;cyan - entry=white;cyan;A_REVERSE + entry=white;cyan hot=yellow;cyan - selected=white;black;A_BOLD + selected=white;black hotselected=yellow;black [help] - _default_=black;lightgray;A_REVERSE - italic=red;lightgray;A_REVERSE - bold=blue;lightgray;A_REVERSE + _default_=black;lightgray + italic=red;lightgray + bold=blue;lightgray link=black;cyan - slink=yellow;blue;A_BOLD + slink=yellow;blue [editor] - bold=yellow;blue;A_BOLD - marked=black;cyan;A_REVERSE + bold=yellow;blue + marked=black;cyan whitespace=brightblue;blue linestate=white;cyan [viewer] - underline=brightred;blue;A_UNDERLINE + underline=brightred;blue [error] - _default_=white;red;A_BOLD + _default_=white;red hotnormal=yellow;red hotfocus=yellow;lightgray diff --git a/src/skin/Makefile.am b/src/skin/Makefile.am index f58cd20d8..c54261fb3 100644 --- a/src/skin/Makefile.am +++ b/src/skin/Makefile.am @@ -4,6 +4,7 @@ libmcskin_la_SOURCES = \ colors.c \ colors-old.c \ common.c \ + hc-skins.c \ ini-file.c \ skin.h \ internal.h diff --git a/src/skin/common.c b/src/skin/common.c index 8376c837d..1fb7cbead 100644 --- a/src/skin/common.c +++ b/src/skin/common.c @@ -52,6 +52,7 @@ static gboolean mc_skin_is_init = FALSE; static void mc_skin_hash_destroy_key (gpointer data) { + g_free(data); } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/skin/hc-skins.c b/src/skin/hc-skins.c new file mode 100644 index 000000000..dd7a9a8f5 --- /dev/null +++ b/src/skin/hc-skins.c @@ -0,0 +1,115 @@ +/* + Skins engine. + Set of hardcoded skins + + Copyright (C) 2009 The Free Software Foundation, Inc. + + Written by: + Slava Zanko , 2009. + + This file is part of the Midnight Commander. + + The Midnight Commander is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The Midnight Commander is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + */ + +#include +#include "../src/global.h" + +#include "skin.h" +#include "internal.h" + + +/*** global variables ****************************************************************************/ + +/*** file scope macro definitions ****************************************************************/ + +#define set_lines(x,y) mc_config_set_string(mc_skin->config, "Lines", x, y) + +/*** file scope type declarations ****************************************************************/ + +/*** file scope variables ************************************************************************/ + +/*** file scope functions ************************************************************************/ +/* --------------------------------------------------------------------------------------------- */ + +/* --------------------------------------------------------------------------------------------- */ +/*** public functions ****************************************************************************/ +/* --------------------------------------------------------------------------------------------- */ + +void +mc_skin_hardcoded_blackwhite_colors(mc_skin_t *mc_skin) +{ + mc_config_set_string(mc_skin->config, "core", "_default_", "default;default"); + mc_config_set_string(mc_skin->config, "core", "selected", "A_REVERSE"); + mc_config_set_string(mc_skin->config, "core", "marked", "A_BOLD"); + mc_config_set_string(mc_skin->config, "core", "markselect", "A_BOLD_REVERSE"); + mc_config_set_string(mc_skin->config, "core", "reverse", "A_REVERSE"); + mc_config_set_string(mc_skin->config, "dialog", "_default_", "A_REVERSE"); + mc_config_set_string(mc_skin->config, "dialog", "focus", "A_BOLD"); + mc_config_set_string(mc_skin->config, "menu", "entry", "A_REVERSE"); + mc_config_set_string(mc_skin->config, "menu", "selected", "A_BOLD"); + mc_config_set_string(mc_skin->config, "help", "_default_", "A_REVERSE"); + mc_config_set_string(mc_skin->config, "help", "italic", "A_REVERSE"); + mc_config_set_string(mc_skin->config, "help", "bold", "A_REVERSE"); + mc_config_set_string(mc_skin->config, "help", "slink", "A_BOLD"); + mc_config_set_string(mc_skin->config, "editor", "bold", "A_BOLD"); + mc_config_set_string(mc_skin->config, "editor", "marked", "A_REVERSE"); + mc_config_set_string(mc_skin->config, "viewer", "underline", "A_UNDERLINE"); + mc_config_set_string(mc_skin->config, "error", "_default_", "A_BOLD"); + +} + +/* --------------------------------------------------------------------------------------------- */ + +void +mc_skin_hardcoded_space_lines(mc_skin_t *mc_skin) +{ + set_lines("lefttop", " "); + set_lines("righttop", " "); + set_lines("centertop", " "); + set_lines("centerbottom", " "); + set_lines("leftbottom", " "); + set_lines("rightbottom", " "); + set_lines("leftmiddle", " "); + set_lines("rightmiddle", " "); + set_lines("centermiddle", " "); + set_lines("horiz", " "); + set_lines("vert", " "); + set_lines("thinhoriz", " "); + set_lines("thinvert", " "); +} + +/* --------------------------------------------------------------------------------------------- */ + +void +mc_skin_hardcoded_ugly_lines(mc_skin_t *mc_skin) +{ + set_lines("lefttop", "+"); + set_lines("righttop", "+"); + set_lines("centertop", "-"); + set_lines("centerbottom", "-"); + set_lines("leftbottom", "+"); + set_lines("rightbottom", "+"); + set_lines("leftmiddle", "|"); + set_lines("rightmiddle", "|"); + set_lines("centermiddle", "+"); + set_lines("horiz", "-"); + set_lines("vert", "-"); + set_lines("thinhoriz", "-"); + set_lines("thinvert", "|"); +} + +/* --------------------------------------------------------------------------------------------- */ diff --git a/src/skin/ini-file.c b/src/skin/ini-file.c index d3bea02fa..b54e5d4d9 100644 --- a/src/skin/ini-file.c +++ b/src/skin/ini-file.c @@ -135,22 +135,8 @@ mc_skin_set_hardcoded_skin(mc_skin_t *mc_skin) mc_config_set_string(mc_skin->config, "skin", "description", "hardcoded skin"); -#define set_lines(x,y) mc_config_set_string(mc_skin->config, "Lines", x, y) - set_lines("lefttop", "+"); - set_lines("righttop", "+"); - set_lines("centertop", "-"); - set_lines("centerbottom", "-"); - set_lines("leftbottom", "+"); - set_lines("rightbottom", "+"); - set_lines("leftmiddle", "|"); - set_lines("rightmiddle", "|"); - set_lines("centermiddle", "+"); - set_lines("horiz", "-"); - set_lines("vert", "-"); - set_lines("thinhoriz", "-"); - set_lines("thinvert", "|"); -#undef set_lines - mc_config_set_string(mc_skin->config, "core", "_default_", "white;black;"); + mc_skin_hardcoded_ugly_lines(mc_skin); + mc_skin_hardcoded_blackwhite_colors(mc_skin); } /* --------------------------------------------------------------------------------------------- */ diff --git a/src/skin/internal.h b/src/skin/internal.h index 5012ae4a4..f2b14d664 100644 --- a/src/skin/internal.h +++ b/src/skin/internal.h @@ -28,4 +28,9 @@ void mc_skin_set_hardcoded_skin(mc_skin_t *); gboolean mc_skin_ini_file_parce_colors(mc_skin_t *); + +void mc_skin_hardcoded_ugly_lines(mc_skin_t *); +void mc_skin_hardcoded_space_lines(mc_skin_t *); +void mc_skin_hardcoded_blackwhite_colors(mc_skin_t *); + #endif diff --git a/src/tty/color.c b/src/tty/color.c index ac2693749..0199b6426 100644 --- a/src/tty/color.c +++ b/src/tty/color.c @@ -62,6 +62,7 @@ static int mc_tty_color__count = 0; static void mc_tty_color_hash_destroy_key (gpointer data) { + g_free(data); } /* --------------------------------------------------------------------------------------------- */