summaryrefslogtreecommitdiffstats
path: root/lib/skin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/skin.h39
-rw-r--r--lib/skin/Makefile.in2
-rw-r--r--lib/skin/colors-old.c3
-rw-r--r--lib/skin/colors.c52
-rw-r--r--lib/skin/common.c12
-rw-r--r--lib/skin/hc-skins.c2
-rw-r--r--lib/skin/ini-file.c2
-rw-r--r--lib/skin/internal.h8
-rw-r--r--lib/skin/lines.c54
9 files changed, 82 insertions, 92 deletions
diff --git a/lib/skin.h b/lib/skin.h
index 024e0c5..099c364 100644
--- a/lib/skin.h
+++ b/lib/skin.h
@@ -87,28 +87,29 @@
* Last is defined to view color.
*/
#define EDITOR_NORMAL_COLOR mc_skin_color__cache[49]
-#define EDITOR_BOLD_COLOR mc_skin_color__cache[50]
-#define EDITOR_MARKED_COLOR mc_skin_color__cache[51]
-#define EDITOR_WHITESPACE_COLOR mc_skin_color__cache[52]
-#define EDITOR_RIGHT_MARGIN_COLOR mc_skin_color__cache[53]
-#define EDITOR_BACKGROUND mc_skin_color__cache[54]
-#define EDITOR_FRAME mc_skin_color__cache[55]
-#define EDITOR_FRAME_ACTIVE mc_skin_color__cache[56]
-#define EDITOR_FRAME_DRAG mc_skin_color__cache[57]
+#define EDITOR_NONPRINTABLE_COLOR mc_skin_color__cache[50]
+#define EDITOR_BOLD_COLOR mc_skin_color__cache[51]
+#define EDITOR_MARKED_COLOR mc_skin_color__cache[52]
+#define EDITOR_WHITESPACE_COLOR mc_skin_color__cache[53]
+#define EDITOR_RIGHT_MARGIN_COLOR mc_skin_color__cache[54]
+#define EDITOR_BACKGROUND mc_skin_color__cache[55]
+#define EDITOR_FRAME mc_skin_color__cache[56]
+#define EDITOR_FRAME_ACTIVE mc_skin_color__cache[57]
+#define EDITOR_FRAME_DRAG mc_skin_color__cache[58]
/* color of left 8 char status per line */
-#define LINE_STATE_COLOR mc_skin_color__cache[58]
-#define BOOK_MARK_COLOR mc_skin_color__cache[59]
-#define BOOK_MARK_FOUND_COLOR mc_skin_color__cache[60]
+#define LINE_STATE_COLOR mc_skin_color__cache[59]
+#define BOOK_MARK_COLOR mc_skin_color__cache[60]
+#define BOOK_MARK_FOUND_COLOR mc_skin_color__cache[61]
/* Diff colors */
-#define DFF_ADD_COLOR mc_skin_color__cache[61]
-#define DFF_CHG_COLOR mc_skin_color__cache[62]
-#define DFF_CHH_COLOR mc_skin_color__cache[63]
-#define DFF_CHD_COLOR mc_skin_color__cache[64]
-#define DFF_DEL_COLOR mc_skin_color__cache[65]
-#define DFF_ERROR_COLOR mc_skin_color__cache[66]
-
-#define MC_SKIN_COLOR_CACHE_COUNT 67
+#define DFF_ADD_COLOR mc_skin_color__cache[62]
+#define DFF_CHG_COLOR mc_skin_color__cache[63]
+#define DFF_CHH_COLOR mc_skin_color__cache[64]
+#define DFF_CHD_COLOR mc_skin_color__cache[65]
+#define DFF_DEL_COLOR mc_skin_color__cache[66]
+#define DFF_ERROR_COLOR mc_skin_color__cache[67]
+
+#define MC_SKIN_COLOR_CACHE_COUNT 68
/*** enums ***************************************************************************************/
diff --git a/lib/skin/Makefile.in b/lib/skin/Makefile.in
index 62f642b..f7ce1d0 100644
--- a/lib/skin/Makefile.in
+++ b/lib/skin/Makefile.in
@@ -134,7 +134,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-sfs.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-ftp.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-sftp.m4 \
- $(top_srcdir)/m4.include/vfs/mc-vfs-fish.m4 \
+ $(top_srcdir)/m4.include/vfs/mc-vfs-shell.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-undelfs.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-tarfs.m4 \
$(top_srcdir)/m4.include/vfs/mc-vfs-cpiofs.m4 \
diff --git a/lib/skin/colors-old.c b/lib/skin/colors-old.c
index 628b2aa..3430cd6 100644
--- a/lib/skin/colors-old.c
+++ b/lib/skin/colors-old.c
@@ -2,7 +2,7 @@
Skins engine.
Work with colors - backward compatibility
- Copyright (C) 2009-2023
+ Copyright (C) 2009-2024
Free Software Foundation, Inc.
Written by:
@@ -69,6 +69,7 @@ static const mc_skin_colors_old_t old_colors[] = {
{"editframedrag", "editor", "editframedrag"},
{"editlinestate", "editor", "editlinestate"},
{"editmarked", "editor", "editmarked"},
+ {"editnonprintable", "editor", "editnonprintable"},
{"editnormal", "editor", "_default_"},
{"editwhitespace", "editor", "editwhitespace"},
{"errdhotfocus", "error", "errdhotfocus"},
diff --git a/lib/skin/colors.c b/lib/skin/colors.c
index 87e9442..688866e 100644
--- a/lib/skin/colors.c
+++ b/lib/skin/colors.c
@@ -2,7 +2,7 @@
Skins engine.
Work with colors
- Copyright (C) 2009-2023
+ Copyright (C) 2009-2024
Free Software Foundation, Inc.
Written by:
@@ -49,11 +49,11 @@ int mc_skin_color__cache[MC_SKIN_COLOR_CACHE_COUNT];
/*** file scope functions ************************************************************************/
/* --------------------------------------------------------------------------------------------- */
-static mc_skin_color_t *
+static tty_color_pair_t *
mc_skin_color_get_from_hash (mc_skin_t * mc_skin, const gchar * group, const gchar * key)
{
gchar kname[BUF_TINY];
- mc_skin_color_t *mc_skin_color;
+ tty_color_pair_t *mc_skin_color;
if (group == NULL || key == NULL)
return NULL;
@@ -62,7 +62,7 @@ mc_skin_color_get_from_hash (mc_skin_t * mc_skin, const gchar * group, const gch
mc_skin = &mc_skin__default;
g_snprintf (kname, sizeof (kname), "%s.%s", group, key);
- mc_skin_color = (mc_skin_color_t *) g_hash_table_lookup (mc_skin->colors, (gpointer) kname);
+ mc_skin_color = (tty_color_pair_t *) g_hash_table_lookup (mc_skin->colors, (gpointer) kname);
return mc_skin_color;
}
@@ -89,7 +89,7 @@ mc_skin_color_remove_from_hash (mc_skin_t * mc_skin, const gchar * group, const
static void
mc_skin_color_add_to_hash (mc_skin_t * mc_skin, const gchar * group, const gchar * key,
- mc_skin_color_t * mc_skin_color)
+ tty_color_pair_t * mc_skin_color)
{
gchar *kname;
@@ -105,10 +105,10 @@ mc_skin_color_add_to_hash (mc_skin_t * mc_skin, const gchar * group, const gchar
/* --------------------------------------------------------------------------------------------- */
-static mc_skin_color_t *
+static tty_color_pair_t *
mc_skin_color_get_with_defaults (const gchar * group, const gchar * name)
{
- mc_skin_color_t *mc_skin_color;
+ tty_color_pair_t *mc_skin_color;
mc_skin_color = mc_skin_color_get_from_hash (NULL, group, name);
if (mc_skin_color != NULL)
@@ -179,12 +179,12 @@ mc_skin_color_look_up_alias (mc_skin_t * mc_skin, gchar * str)
/* --------------------------------------------------------------------------------------------- */
-static mc_skin_color_t *
+static tty_color_pair_t *
mc_skin_color_get_from_ini_file (mc_skin_t * mc_skin, const gchar * group, const gchar * key)
{
gsize items_count;
gchar **values;
- mc_skin_color_t *mc_skin_color, *tmp;
+ tty_color_pair_t *mc_skin_color, *tmp;
values = mc_config_get_string_list (mc_skin->config, group, key, &items_count);
if (values == NULL || values[0] == NULL)
@@ -193,7 +193,7 @@ mc_skin_color_get_from_ini_file (mc_skin_t * mc_skin, const gchar * group, const
return NULL;
}
- mc_skin_color = g_try_new0 (mc_skin_color_t, 1);
+ mc_skin_color = g_try_new0 (tty_color_pair_t, 1);
if (mc_skin_color == NULL)
{
g_strfreev (values);
@@ -201,21 +201,19 @@ mc_skin_color_get_from_ini_file (mc_skin_t * mc_skin, const gchar * group, const
}
tmp = mc_skin_color_get_with_defaults (group, "_default_");
- mc_skin_color->fgcolor = (items_count > 0 && values[0][0]) ?
+ mc_skin_color->fg = (items_count > 0 && values[0][0]) ?
mc_skin_color_look_up_alias (mc_skin, g_strstrip (g_strdup (values[0]))) :
- (tmp != NULL) ? g_strdup (tmp->fgcolor) : NULL;
- mc_skin_color->bgcolor = (items_count > 1 && values[1][0]) ?
+ (tmp != NULL) ? g_strdup (tmp->fg) : NULL;
+ mc_skin_color->bg = (items_count > 1 && values[1][0]) ?
mc_skin_color_look_up_alias (mc_skin, g_strstrip (g_strdup (values[1]))) :
- (tmp != NULL) ? g_strdup (tmp->bgcolor) : NULL;
+ (tmp != NULL) ? g_strdup (tmp->bg) : NULL;
mc_skin_color->attrs = (items_count > 2 && values[2][0]) ?
mc_skin_color_look_up_alias (mc_skin, g_strstrip (g_strdup (values[2]))) :
(tmp != NULL) ? g_strdup (tmp->attrs) : NULL;
g_strfreev (values);
- mc_skin_color->pair_index =
- tty_try_alloc_color_pair2 (mc_skin_color->fgcolor, mc_skin_color->bgcolor,
- mc_skin_color->attrs, FALSE);
+ mc_skin_color->pair_index = tty_try_alloc_color_pair (mc_skin_color, FALSE);
return mc_skin_color;
}
@@ -225,16 +223,15 @@ mc_skin_color_get_from_ini_file (mc_skin_t * mc_skin, const gchar * group, const
static void
mc_skin_color_set_default_for_terminal (mc_skin_t * mc_skin)
{
- mc_skin_color_t *mc_skin_color;
- mc_skin_color = g_try_new0 (mc_skin_color_t, 1);
+ tty_color_pair_t *mc_skin_color;
+
+ mc_skin_color = g_try_new0 (tty_color_pair_t, 1);
if (mc_skin_color != NULL)
{
- mc_skin_color->fgcolor = g_strdup ("default");
- mc_skin_color->bgcolor = g_strdup ("default");
+ mc_skin_color->fg = g_strdup ("default");
+ mc_skin_color->bg = g_strdup ("default");
mc_skin_color->attrs = NULL;
- mc_skin_color->pair_index =
- tty_try_alloc_color_pair2 (mc_skin_color->fgcolor, mc_skin_color->bgcolor,
- mc_skin_color->attrs, FALSE);
+ mc_skin_color->pair_index = tty_try_alloc_color_pair (mc_skin_color, FALSE);
mc_skin_color_add_to_hash (mc_skin, "skin", "terminal_default_color", mc_skin_color);
}
}
@@ -305,6 +302,7 @@ mc_skin_color_cache_init (void)
EDITOR_BOLD_COLOR = mc_skin_color_get ("editor", "editbold");
EDITOR_MARKED_COLOR = mc_skin_color_get ("editor", "editmarked");
EDITOR_WHITESPACE_COLOR = mc_skin_color_get ("editor", "editwhitespace");
+ EDITOR_NONPRINTABLE_COLOR = mc_skin_color_get ("editor", "editnonprintable");
EDITOR_RIGHT_MARGIN_COLOR = mc_skin_color_get ("editor", "editrightmargin");
LINE_STATE_COLOR = mc_skin_color_get ("editor", "editlinestate");
EDITOR_BACKGROUND = mc_skin_color_get ("editor", "editbg");
@@ -363,7 +361,7 @@ mc_skin_color_parse_ini_file (mc_skin_t * mc_skin)
gboolean ret = FALSE;
gsize items_count;
gchar **groups, **orig_groups;
- mc_skin_color_t *mc_skin_color;
+ tty_color_pair_t *mc_skin_color;
mc_skin_color_check_bw_mode (mc_skin);
@@ -377,7 +375,7 @@ mc_skin_color_parse_ini_file (mc_skin_t * mc_skin)
if (mc_skin_color == NULL)
goto ret;
- tty_color_set_defaults (mc_skin_color->fgcolor, mc_skin_color->bgcolor, mc_skin_color->attrs);
+ tty_color_set_defaults (mc_skin_color);
mc_skin_color_add_to_hash (mc_skin, "core", "_default_", mc_skin_color);
for (groups = orig_groups; *groups != NULL; groups++)
@@ -412,7 +410,7 @@ mc_skin_color_parse_ini_file (mc_skin_t * mc_skin)
int
mc_skin_color_get (const gchar * group, const gchar * name)
{
- mc_skin_color_t *mc_skin_color;
+ tty_color_pair_t *mc_skin_color;
mc_skin_color = mc_skin_color_get_with_defaults (group, name);
diff --git a/lib/skin/common.c b/lib/skin/common.c
index 85790f2..e94977c 100644
--- a/lib/skin/common.c
+++ b/lib/skin/common.c
@@ -2,7 +2,7 @@
Skins engine.
Interface functions
- Copyright (C) 2009-2023
+ Copyright (C) 2009-2024
Free Software Foundation, Inc.
Written by:
@@ -54,9 +54,10 @@ static gboolean mc_skin_is_init = FALSE;
static void
mc_skin_hash_destroy_value (gpointer data)
{
- mc_skin_color_t *mc_skin_color = (mc_skin_color_t *) data;
- g_free (mc_skin_color->fgcolor);
- g_free (mc_skin_color->bgcolor);
+ tty_color_pair_t *mc_skin_color = (tty_color_pair_t *) data;
+
+ g_free (mc_skin_color->fg);
+ g_free (mc_skin_color->bg);
g_free (mc_skin_color->attrs);
g_free (mc_skin_color);
}
@@ -180,8 +181,7 @@ mc_skin_init (const gchar * skin_override, GError ** mcerror)
void
mc_skin_deinit (void)
{
- tty_color_free_all_tmp ();
- tty_color_free_all_non_tmp ();
+ tty_color_free_all ();
MC_PTR_FREE (mc_skin__default.name);
g_hash_table_destroy (mc_skin__default.colors);
diff --git a/lib/skin/hc-skins.c b/lib/skin/hc-skins.c
index 95ac73d..1a13dec 100644
--- a/lib/skin/hc-skins.c
+++ b/lib/skin/hc-skins.c
@@ -2,7 +2,7 @@
Skins engine.
Set of hardcoded skins
- Copyright (C) 2009-2023
+ Copyright (C) 2009-2024
Free Software Foundation, Inc.
Written by:
diff --git a/lib/skin/ini-file.c b/lib/skin/ini-file.c
index 6d92435..24d7c25 100644
--- a/lib/skin/ini-file.c
+++ b/lib/skin/ini-file.c
@@ -2,7 +2,7 @@
Skins engine.
Reading and parse ini-files
- Copyright (C) 2009-2023
+ Copyright (C) 2009-2024
Free Software Foundation, Inc.
Written by:
diff --git a/lib/skin/internal.h b/lib/skin/internal.h
index 8b468db..6bc0a23 100644
--- a/lib/skin/internal.h
+++ b/lib/skin/internal.h
@@ -10,14 +10,6 @@
/*** structures declarations (and typedefs of structures)*****************************************/
-typedef struct mc_skin_color_struct
-{
- gchar *fgcolor;
- gchar *bgcolor;
- gchar *attrs;
- int pair_index;
-} mc_skin_color_t;
-
/*** global variables defined in .c file *********************************************************/
/*** declarations of public functions ************************************************************/
diff --git a/lib/skin/lines.c b/lib/skin/lines.c
index 90cc028..436f555 100644
--- a/lib/skin/lines.c
+++ b/lib/skin/lines.c
@@ -2,7 +2,7 @@
Skins engine.
Work with line draving chars.
- Copyright (C) 2009-2023
+ Copyright (C) 2009-2024
Free Software Foundation, Inc.
Written by:
@@ -68,33 +68,31 @@ mc_skin_lines_parse_ini_file (mc_skin_t * mc_skin)
mc_skin_hardcoded_space_lines (mc_skin);
else if (mc_global.tty.ugly_line_drawing)
mc_skin_hardcoded_ugly_lines (mc_skin);
- else
- {
- /* single lines */
- mc_tty_frm[MC_TTY_FRM_VERT] = mc_skin_lines_load_frm (mc_skin, "vert");
- mc_tty_frm[MC_TTY_FRM_HORIZ] = mc_skin_lines_load_frm (mc_skin, "horiz");
- mc_tty_frm[MC_TTY_FRM_LEFTTOP] = mc_skin_lines_load_frm (mc_skin, "lefttop");
- mc_tty_frm[MC_TTY_FRM_RIGHTTOP] = mc_skin_lines_load_frm (mc_skin, "righttop");
- mc_tty_frm[MC_TTY_FRM_LEFTBOTTOM] = mc_skin_lines_load_frm (mc_skin, "leftbottom");
- mc_tty_frm[MC_TTY_FRM_RIGHTBOTTOM] = mc_skin_lines_load_frm (mc_skin, "rightbottom");
- mc_tty_frm[MC_TTY_FRM_TOPMIDDLE] = mc_skin_lines_load_frm (mc_skin, "topmiddle");
- mc_tty_frm[MC_TTY_FRM_BOTTOMMIDDLE] = mc_skin_lines_load_frm (mc_skin, "bottommiddle");
- mc_tty_frm[MC_TTY_FRM_LEFTMIDDLE] = mc_skin_lines_load_frm (mc_skin, "leftmiddle");
- mc_tty_frm[MC_TTY_FRM_RIGHTMIDDLE] = mc_skin_lines_load_frm (mc_skin, "rightmiddle");
- mc_tty_frm[MC_TTY_FRM_CROSS] = mc_skin_lines_load_frm (mc_skin, "cross");
-
- /* double lines */
- mc_tty_frm[MC_TTY_FRM_DVERT] = mc_skin_lines_load_frm (mc_skin, "dvert");
- mc_tty_frm[MC_TTY_FRM_DHORIZ] = mc_skin_lines_load_frm (mc_skin, "dhoriz");
- mc_tty_frm[MC_TTY_FRM_DLEFTTOP] = mc_skin_lines_load_frm (mc_skin, "dlefttop");
- mc_tty_frm[MC_TTY_FRM_DRIGHTTOP] = mc_skin_lines_load_frm (mc_skin, "drighttop");
- mc_tty_frm[MC_TTY_FRM_DLEFTBOTTOM] = mc_skin_lines_load_frm (mc_skin, "dleftbottom");
- mc_tty_frm[MC_TTY_FRM_DRIGHTBOTTOM] = mc_skin_lines_load_frm (mc_skin, "drightbottom");
- mc_tty_frm[MC_TTY_FRM_DTOPMIDDLE] = mc_skin_lines_load_frm (mc_skin, "dtopmiddle");
- mc_tty_frm[MC_TTY_FRM_DBOTTOMMIDDLE] = mc_skin_lines_load_frm (mc_skin, "dbottommiddle");
- mc_tty_frm[MC_TTY_FRM_DLEFTMIDDLE] = mc_skin_lines_load_frm (mc_skin, "dleftmiddle");
- mc_tty_frm[MC_TTY_FRM_DRIGHTMIDDLE] = mc_skin_lines_load_frm (mc_skin, "drightmiddle");
- }
+
+ /* single lines */
+ mc_tty_frm[MC_TTY_FRM_VERT] = mc_skin_lines_load_frm (mc_skin, "vert");
+ mc_tty_frm[MC_TTY_FRM_HORIZ] = mc_skin_lines_load_frm (mc_skin, "horiz");
+ mc_tty_frm[MC_TTY_FRM_LEFTTOP] = mc_skin_lines_load_frm (mc_skin, "lefttop");
+ mc_tty_frm[MC_TTY_FRM_RIGHTTOP] = mc_skin_lines_load_frm (mc_skin, "righttop");
+ mc_tty_frm[MC_TTY_FRM_LEFTBOTTOM] = mc_skin_lines_load_frm (mc_skin, "leftbottom");
+ mc_tty_frm[MC_TTY_FRM_RIGHTBOTTOM] = mc_skin_lines_load_frm (mc_skin, "rightbottom");
+ mc_tty_frm[MC_TTY_FRM_TOPMIDDLE] = mc_skin_lines_load_frm (mc_skin, "topmiddle");
+ mc_tty_frm[MC_TTY_FRM_BOTTOMMIDDLE] = mc_skin_lines_load_frm (mc_skin, "bottommiddle");
+ mc_tty_frm[MC_TTY_FRM_LEFTMIDDLE] = mc_skin_lines_load_frm (mc_skin, "leftmiddle");
+ mc_tty_frm[MC_TTY_FRM_RIGHTMIDDLE] = mc_skin_lines_load_frm (mc_skin, "rightmiddle");
+ mc_tty_frm[MC_TTY_FRM_CROSS] = mc_skin_lines_load_frm (mc_skin, "cross");
+
+ /* double lines */
+ mc_tty_frm[MC_TTY_FRM_DVERT] = mc_skin_lines_load_frm (mc_skin, "dvert");
+ mc_tty_frm[MC_TTY_FRM_DHORIZ] = mc_skin_lines_load_frm (mc_skin, "dhoriz");
+ mc_tty_frm[MC_TTY_FRM_DLEFTTOP] = mc_skin_lines_load_frm (mc_skin, "dlefttop");
+ mc_tty_frm[MC_TTY_FRM_DRIGHTTOP] = mc_skin_lines_load_frm (mc_skin, "drighttop");
+ mc_tty_frm[MC_TTY_FRM_DLEFTBOTTOM] = mc_skin_lines_load_frm (mc_skin, "dleftbottom");
+ mc_tty_frm[MC_TTY_FRM_DRIGHTBOTTOM] = mc_skin_lines_load_frm (mc_skin, "drightbottom");
+ mc_tty_frm[MC_TTY_FRM_DTOPMIDDLE] = mc_skin_lines_load_frm (mc_skin, "dtopmiddle");
+ mc_tty_frm[MC_TTY_FRM_DBOTTOMMIDDLE] = mc_skin_lines_load_frm (mc_skin, "dbottommiddle");
+ mc_tty_frm[MC_TTY_FRM_DLEFTMIDDLE] = mc_skin_lines_load_frm (mc_skin, "dleftmiddle");
+ mc_tty_frm[MC_TTY_FRM_DRIGHTMIDDLE] = mc_skin_lines_load_frm (mc_skin, "drightmiddle");
}
/* --------------------------------------------------------------------------------------------- */