Ticket #2489: colors of bold and selected text in viewer cannot be set in the command...
[pantumic.git] / lib / skin / lines.c
blobda043ab6b83a222fcae83973c53c07986eaa9fd1
1 /*
2 Skins engine.
3 Work with line draving chars.
5 Copyright (C) 2009 The Free Software Foundation, Inc.
7 Written by:
8 Slava Zanko <slavazanko@gmail.com>, 2009.
10 This file is part of the Midnight Commander.
12 The Midnight Commander is free software; you can redistribute it
13 and/or modify it under the terms of the GNU General Public License as
14 published by the Free Software Foundation; either version 2 of the
15 License, or (at your option) any later version.
17 The Midnight Commander is distributed in the hope that it will be
18 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
19 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
25 MA 02110-1301, USA.
28 #include <config.h>
29 #include <stdlib.h>
31 #include "internal.h"
32 #include "lib/tty/tty.h"
34 #include "src/args.h"
36 /*** global variables ****************************************************************************/
38 /*** file scope macro definitions ****************************************************************/
40 /*** file scope type declarations ****************************************************************/
42 /*** file scope variables ************************************************************************/
44 /*** file scope functions ************************************************************************/
46 static int
47 mc_skin_lines_load_frm (mc_skin_t * mc_skin, const char *name)
49 int ret;
50 char *frm_val = NULL;
51 frm_val = mc_config_get_string_raw (mc_skin->config, "Lines", name, " ");
52 ret = mc_tty_normalize_lines_char (frm_val);
54 g_free (frm_val);
56 #if 0
57 switch (ret)
59 case 0x80:
60 ret = ACS_HLINE;
61 break;
62 case 0x81:
63 ret = ACS_VLINE;
64 break;
65 case 0x82:
66 ret = ACS_ULCORNER;
67 break;
68 case 0x83:
69 ret = ACS_URCORNER;
70 break;
71 case 0x84:
72 ret = ACS_LLCORNER;
73 break;
74 case 0x85:
75 ret = ACS_LRCORNER;
76 break;
77 case 0x86:
78 ret = ACS_LTEE;
79 break;
80 case 0x87:
81 ret = ACS_RTEE;
82 break;
83 case 0x8a:
84 ret = ACS_PLUS;
85 break;
86 default:
87 break;
89 #endif
91 return ret;
94 /* --------------------------------------------------------------------------------------------- */
95 /*** public functions ****************************************************************************/
96 /* --------------------------------------------------------------------------------------------- */
98 void
99 mc_skin_lines_parse_ini_file (mc_skin_t * mc_skin)
101 if (mc_args__slow_terminal)
102 mc_skin_hardcoded_space_lines (mc_skin);
103 else if (mc_args__ugly_line_drawing)
104 mc_skin_hardcoded_ugly_lines (mc_skin);
106 /* single lines */
107 mc_tty_frm[MC_TTY_FRM_VERT] = mc_skin_lines_load_frm (mc_skin, "vert");
108 mc_tty_frm[MC_TTY_FRM_HORIZ] = mc_skin_lines_load_frm (mc_skin, "horiz");
109 mc_tty_frm[MC_TTY_FRM_LEFTTOP] = mc_skin_lines_load_frm (mc_skin, "lefttop");
110 mc_tty_frm[MC_TTY_FRM_RIGHTTOP] = mc_skin_lines_load_frm (mc_skin, "righttop");
111 mc_tty_frm[MC_TTY_FRM_LEFTBOTTOM] = mc_skin_lines_load_frm (mc_skin, "leftbottom");
112 mc_tty_frm[MC_TTY_FRM_RIGHTBOTTOM] = mc_skin_lines_load_frm (mc_skin, "rightbottom");
113 mc_tty_frm[MC_TTY_FRM_TOPMIDDLE] = mc_skin_lines_load_frm (mc_skin, "topmiddle");
114 mc_tty_frm[MC_TTY_FRM_BOTTOMMIDDLE] = mc_skin_lines_load_frm (mc_skin, "bottommiddle");
115 mc_tty_frm[MC_TTY_FRM_LEFTMIDDLE] = mc_skin_lines_load_frm (mc_skin, "leftmiddle");
116 mc_tty_frm[MC_TTY_FRM_RIGHTMIDDLE] = mc_skin_lines_load_frm (mc_skin, "rightmiddle");
117 mc_tty_frm[MC_TTY_FRM_CROSS] = mc_skin_lines_load_frm (mc_skin, "cross");
119 /* double lines */
120 mc_tty_frm[MC_TTY_FRM_DVERT] = mc_skin_lines_load_frm (mc_skin, "dvert");
121 mc_tty_frm[MC_TTY_FRM_DHORIZ] = mc_skin_lines_load_frm (mc_skin, "dhoriz");
122 mc_tty_frm[MC_TTY_FRM_DLEFTTOP] = mc_skin_lines_load_frm (mc_skin, "dlefttop");
123 mc_tty_frm[MC_TTY_FRM_DRIGHTTOP] = mc_skin_lines_load_frm (mc_skin, "drighttop");
124 mc_tty_frm[MC_TTY_FRM_DLEFTBOTTOM] = mc_skin_lines_load_frm (mc_skin, "dleftbottom");
125 mc_tty_frm[MC_TTY_FRM_DRIGHTBOTTOM] = mc_skin_lines_load_frm (mc_skin, "drightbottom");
126 mc_tty_frm[MC_TTY_FRM_DTOPMIDDLE] = mc_skin_lines_load_frm (mc_skin, "dtopmiddle");
127 mc_tty_frm[MC_TTY_FRM_DBOTTOMMIDDLE] = mc_skin_lines_load_frm (mc_skin, "dbottommiddle");
128 mc_tty_frm[MC_TTY_FRM_DLEFTMIDDLE] = mc_skin_lines_load_frm (mc_skin, "dleftmiddle");
129 mc_tty_frm[MC_TTY_FRM_DRIGHTMIDDLE] = mc_skin_lines_load_frm (mc_skin, "drightmiddle");
132 /* --------------------------------------------------------------------------------------------- */