Skip to content

Commit

Permalink
Base support of skins.
Browse files Browse the repository at this point in the history
Signed-off-by: Slava Zanko <[email protected]>
  • Loading branch information
slavaz committed Sep 18, 2009
1 parent 4882666 commit 981fe00
Show file tree
Hide file tree
Showing 54 changed files with 1,295 additions and 507 deletions.
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -556,12 +556,14 @@ contrib/dist/pkginfo
contrib/dist/prototype
misc/Makefile
misc/skins/Makefile
misc/mc.ext
src/Makefile
src/filehighlight/Makefile
src/mcconfig/Makefile
src/search/Makefile
src/skin/Makefile
src/tty/Makefile
src/viewer/Makefile
Expand Down
2 changes: 1 addition & 1 deletion edit/editcmd_dialogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "../src/global.h"

#include "../src/tty/tty.h"
#include "../src/tty/color.h" /* INPUT_COLOR */
#include "../src/skin/skin.h" /* INPUT_COLOR */
#include "../src/tty/key.h"

#include "../src/search/search.h"
Expand Down
2 changes: 1 addition & 1 deletion edit/editdraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#define MAX_LINE_LEN 1024

#include "../src/tty/tty.h" /* tty_printf() */
#include "../src/tty/color.h"
#include "../src/skin/skin.h"
#include "../src/tty/key.h" /* is_idle() */

#include "../src/widget.h" /* buttonbar_redraw() */
Expand Down
4 changes: 2 additions & 2 deletions edit/syntax.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

#include "../src/search/search.h" /* search engine */

#include "../src/tty/color.h"
#include "../src/skin/skin.h"

#include "edit-impl.h"
#include "edit-widget.h"
Expand Down Expand Up @@ -504,7 +504,7 @@ void edit_get_syntax_color (WEdit * edit, long byte_index, int *color)
option_syntax_highlighting && tty_use_colors ()) {
translate_rule_to_color (edit, edit_get_rule (edit, byte_index), color);
} else {
*color = tty_use_colors () ? EDITOR_NORMAL_COLOR_INDEX : 0;
*color = tty_use_colors () ? mc_skin_color_get("editor", "_default_") : 0;
}
}

Expand Down
2 changes: 2 additions & 0 deletions misc/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Process this file with automake to create Makefile.in.

SUBDIRS = skins

LIBFILES_OUT = mc.ext

noinst_DATA = xterm.ad
Expand Down
17 changes: 0 additions & 17 deletions misc/filehighlight.ini
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
[filehighlight]
directory=white;
executable=brightgreen;
stalelink=brightred;
symlink=lightgray;
device=brightmagenta;
special=black;
core=red;

temp=gray;
archive=brightmagenta;
doc=brown;
source=cyan;
media=green;
graph=brightcyan;
database=brightred;

[executable]
type=FILE_EXE

Expand Down
6 changes: 6 additions & 0 deletions misc/skins/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
skindir = $(pkgdatadir)/skins

skin_DATA = \
default.ini \
far.ini

77 changes: 77 additions & 0 deletions misc/skins/default.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[skin]
description=Standart skin

[Lines]
lefttop=┌
righttop=┐
centertop=─
centerbottom=─
leftbottom=└
rightbottom=┘
leftmiddle=├
rightmiddle=┤
centermiddle=┼
horiz=─
vert=│
thinhoriz=─
thinvert=│

[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
gauge=white;black
input=black;cyan

[dialog]
_default_=black;lightgray;A_REVERSE
focus=black;cyan;A_BOLD
hotnormal=blue;lightgray
hotfocus=blue;cyan

[filehighlight]
directory=white;
executable=brightgreen;
symlink=lightgray;
stalelink=brightred;
device=brightmagenta;
special=black;
core=red;
temp=gray;
archive=brightmagenta;
hidden=black;
doc=brown;
source=cyan;
media=green;
graph=brightcyan;
database=brightred;

[menu]
_default_=white;cyan
entry=white;cyan;A_REVERSE
hot=yellow;cyan
selected=white;black;A_BOLD
hotselected=yellow;black

[help]
_default_=black;lightgray;A_REVERSE
italic=red;lightgray;A_REVERSE
bold=blue;lightgray;A_REVERSE
link=black;cyan
slink=yellow;blue;A_BOLD

[editor]
bold=yellow;blue;A_BOLD
marked=black;cyan;A_REVERSE
whitespace=brightblue;blue
linestate=white;cyan

[viewer]
underline=brightred;blue;A_UNDERLINE

[error]
_default_=white;red;A_BOLD
hotnormal=yellow;red
hotfocus=yellow;lightgray
77 changes: 77 additions & 0 deletions misc/skins/far.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[skin]
description=Far-like skin

[Lines]
lefttop=╔
righttop=╗
centertop=╤
centerbottom=╧
leftbottom=╚
rightbottom=╝
leftmiddle=╟
rightmiddle=╢
centermiddle=┼
horiz=═
vert=║
thinhoriz=─
thinvert=│

[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
gauge=white;black
input=black;cyan

[dialog]
_default_=black;lightgray;A_REVERSE
focus=black;cyan;A_BOLD
hotnormal=blue;lightgray
hotfocus=blue;cyan

[filehighlight]
directory=white;
executable=brightgreen;
symlink=lightgray;
stalelink=brightred;
device=brightmagenta;
special=black;
core=red;
temp=gray;
archive=brightmagenta;
hidden=black;
doc=brown;
source=cyan;
media=green;
graph=brightcyan;
database=brightred;

[menu]
_default_=white;cyan
entry=white;cyan;A_REVERSE
hot=yellow;cyan
selected=white;black;A_BOLD
hotselected=yellow;black

[help]
_default_=black;lightgray;A_REVERSE
italic=red;lightgray;A_REVERSE
bold=blue;lightgray;A_REVERSE
link=black;cyan
slink=yellow;blue;A_BOLD

[editor]
bold=yellow;blue;A_BOLD
marked=black;cyan;A_REVERSE
whitespace=brightblue;blue
linestate=white;cyan

[viewer]
underline=brightred;blue;A_UNDERLINE

[error]
_default_=white;red;A_BOLD
hotnormal=yellow;red
hotfocus=yellow;lightgray
5 changes: 3 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SUBDIRS = mcconfig search tty viewer filehighlight
SUBDIRS = mcconfig search tty viewer filehighlight skin

AM_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) $(PCRE_CFLAGS)

Expand Down Expand Up @@ -44,8 +44,9 @@ SEARCHLIB = search/libsearch.la
TTYLIB = tty/libmctty.la
VIEWERLIB = viewer/libmcviewer.la
FILEHIGHLIGHTLIB=filehighlight/libmcfilehighlight.la
SKINLIB = skin/libmcskin.la

mc_LDADD = $(EDITLIB) $(VFSLIB) $(FILEHIGHLIGHTLIB) \
mc_LDADD = $(EDITLIB) $(VFSLIB) $(FILEHIGHLIGHTLIB) $(SKINLIB) \
$(MCCONFIGLIB) $(SEARCHLIB) $(TTYLIB) $(VIEWERLIB) \
$(INTLLIBS) $(MCLIBS) $(SLANGLIB) $(LIBICONV) $(GLIB_LIBS)

Expand Down
2 changes: 1 addition & 1 deletion src/achown.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#include "../src/tty/tty.h"
#include "../src/tty/key.h" /* XCTRL and ALT macros */
#include "../src/tty/color.h"
#include "../src/skin/skin.h"

#include "dialog.h"
#include "widget.h"
Expand Down
10 changes: 10 additions & 0 deletions src/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ gboolean mc_args__disable_colors = FALSE;
/* Force colors, only used by Slang */
gboolean mc_args__force_colors = FALSE;

/* Show in specified skin */
char *mc_args__skin = NULL;

char *mc_args__last_wd_file = NULL;

/* when enabled NETCODE, use folowing file as logfile */
Expand Down Expand Up @@ -246,6 +249,13 @@ static const GOptionEntry argument_color_table[] = {
"<string>"
},

{
"skin", 'S', ARGS_COLOR_OPTIONS, G_OPTION_ARG_STRING,
&mc_args__skin,
N_("Show mc with specified skin"),
"<string>"
},

{NULL}
};
#undef ARGS_COLOR_OPTIONS
Expand Down
1 change: 1 addition & 0 deletions src/args.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ extern gboolean mc_args__slow_terminal;
extern gboolean mc_args__ugly_line_drawing;
extern gboolean mc_args__disable_colors;
extern gboolean mc_args__force_colors;
extern char *mc_args__skin;
extern gboolean mc_args__version;
extern char *mc_args__last_wd_file;
extern char *mc_args__netfs_logfile;
Expand Down
2 changes: 1 addition & 1 deletion src/boxes.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "global.h"

#include "../src/tty/tty.h"
#include "../src/tty/color.h" /* INPUT_COLOR */
#include "../src/skin/skin.h" /* INPUT_COLOR */
#include "../src/tty/key.h" /* XCTRL and ALT macros */

#include "../src/mcconfig/mcconfig.h" /* Load/save user formats */
Expand Down
2 changes: 1 addition & 1 deletion src/chmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "global.h"

#include "../src/tty/tty.h"
#include "../src/tty/color.h"
#include "../src/skin/skin.h"

#include "dialog.h" /* add_widget() */
#include "widget.h" /* NORMAL_BUTTON */
Expand Down
2 changes: 1 addition & 1 deletion src/chown.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "global.h"

#include "../src/tty/tty.h"
#include "../src/tty/color.h"
#include "../src/skin/skin.h"

#include "dialog.h"
#include "widget.h"
Expand Down
2 changes: 1 addition & 1 deletion src/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include "user.h" /* expand_format */
#include "subshell.h" /* SUBSHELL_EXIT */
#include "tree.h" /* for tree_chdir */
#include "../src/tty/color.h" /* DEFAULT_COLOR */
#include "../src/skin/skin.h" /* DEFAULT_COLOR */
#include "execute.h" /* shell_execute */
#include "../src/strescape.h"

Expand Down
2 changes: 1 addition & 1 deletion src/cons.handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "global.h"

#include "../src/tty/tty.h"
#include "../src/tty/color.h" /* tty_set_normal_attrs */
#include "../src/skin/skin.h" /* tty_set_normal_attrs */
#include "../src/tty/win.h"

#include "cons.saver.h"
Expand Down
2 changes: 1 addition & 1 deletion src/dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "global.h"

#include "../src/tty/tty.h"
#include "../src/tty/color.h"
#include "../src/skin/skin.h"
#include "../src/tty/mouse.h"
#include "../src/tty/key.h"

Expand Down
3 changes: 1 addition & 2 deletions src/filehighlight/get-color.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include "../src/global.h"
#include "../src/util.h"
#include "../src/tty/color.h"
#include "../src/skin/skin.h"
#include "../src/filehighlight/fhl.h"
#include "internal.h"

Expand Down Expand Up @@ -225,7 +225,6 @@ mc_fhl_get_color (mc_fhl_t * fhl, file_entry * fe)
mc_fhl_filter_t *mc_filter;
int ret;


if (fhl == NULL)
return NORMAL_COLOR;

Expand Down
Loading

0 comments on commit 981fe00

Please sign in to comment.