Browse Source

Base support of skins.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Slava Zanko 15 years ago
parent
commit
981fe001d1
10 changed files with 171 additions and 23 deletions
  1. 2 0
      configure.ac
  2. 1 1
      edit/editcmd_dialogs.c
  3. 1 1
      edit/editdraw.c
  4. 2 2
      edit/syntax.c
  5. 2 0
      misc/Makefile.am
  6. 0 17
      misc/filehighlight.ini
  7. 6 0
      misc/skins/Makefile.am
  8. 77 0
      misc/skins/default.ini
  9. 77 0
      misc/skins/far.ini
  10. 3 2
      src/Makefile.am

+ 2 - 0
configure.ac

@@ -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
 

+ 1 - 1
edit/editcmd_dialogs.c

@@ -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"

+ 1 - 1
edit/editdraw.c

@@ -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() */

+ 2 - 2
edit/syntax.c

@@ -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"
@@ -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;
     }
 }
 

+ 2 - 0
misc/Makefile.am

@@ -1,5 +1,7 @@
 ## Process this file with automake to create Makefile.in.
 
+SUBDIRS = skins
+
 LIBFILES_OUT = mc.ext
 
 noinst_DATA = xterm.ad

+ 0 - 17
misc/filehighlight.ini

@@ -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
 

+ 6 - 0
misc/skins/Makefile.am

@@ -0,0 +1,6 @@
+skindir = $(pkgdatadir)/skins
+
+skin_DATA = \
+	default.ini \
+	far.ini
+

+ 77 - 0
misc/skins/default.ini

@@ -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 - 0
misc/skins/far.ini

@@ -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

+ 3 - 2
src/Makefile.am

@@ -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)
 
@@ -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)
 

Some files were not shown because too many files changed in this diff