Browse Source

Added capability to draw single or double lines.

Fixed tty_print_alt_char() to draw single or double vertical
or horizintal lines.
Added argument to tty_print_one_hline() and tty_print_one_vline()
functions to draw single or double lines.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Andrew Borodin 15 years ago
parent
commit
9a145a88ce
7 changed files with 18 additions and 18 deletions
  1. 2 2
      lib/tty/tty-ncurses.c
  2. 2 2
      lib/tty/tty-slang.c
  3. 4 4
      lib/tty/tty.c
  4. 2 2
      lib/tty/tty.h
  5. 4 4
      src/screen.c
  6. 1 1
      src/viewer/hex.c
  7. 3 3
      src/widget.c

+ 2 - 2
lib/tty/tty-ncurses.c

@@ -343,9 +343,9 @@ void
 tty_print_alt_char (int c, gboolean single)
 tty_print_alt_char (int c, gboolean single)
 {
 {
     if ((chtype) c == ACS_VLINE)
     if ((chtype) c == ACS_VLINE)
-        c = mc_tty_ugly_frm[MC_TTY_FRM_thinvert];
+        c = mc_tty_ugly_frm[single ? MC_TTY_FRM_thinvert: MC_TTY_FRM_vert];
     else if ((chtype) c == ACS_HLINE)
     else if ((chtype) c == ACS_HLINE)
-        c = mc_tty_ugly_frm[MC_TTY_FRM_thinhoriz];
+        c = mc_tty_ugly_frm[single ? MC_TTY_FRM_thinhoriz : MC_TTY_FRM_horiz];
     else if ((chtype) c == ACS_LTEE)
     else if ((chtype) c == ACS_LTEE)
         c = mc_tty_ugly_frm[single ? MC_TTY_FRM_grpleftmiddle : MC_TTY_FRM_leftmiddle];
         c = mc_tty_ugly_frm[single ? MC_TTY_FRM_grpleftmiddle : MC_TTY_FRM_leftmiddle];
     else if ((chtype) c == ACS_RTEE)
     else if ((chtype) c == ACS_RTEE)

+ 2 - 2
lib/tty/tty-slang.c

@@ -503,10 +503,10 @@ tty_print_alt_char (int c, gboolean single)
        : SLsmg_write_char ((unsigned int) y)
        : SLsmg_write_char ((unsigned int) y)
     switch (c) {
     switch (c) {
     case ACS_VLINE:
     case ACS_VLINE:
-        DRAW (c, mc_tty_ugly_frm[MC_TTY_FRM_thinvert]);
+        DRAW (c, mc_tty_ugly_frm[single ? MC_TTY_FRM_thinvert : MC_TTY_FRM_vert]);
         break;
         break;
     case ACS_HLINE:
     case ACS_HLINE:
-        DRAW (c, mc_tty_ugly_frm[MC_TTY_FRM_thinhoriz]);
+        DRAW (c, mc_tty_ugly_frm[single ?  MC_TTY_FRM_thinhoriz : MC_TTY_FRM_horiz]);
         break;
         break;
     case ACS_LTEE:
     case ACS_LTEE:
         DRAW (c, mc_tty_ugly_frm[single ? MC_TTY_FRM_grpleftmiddle : MC_TTY_FRM_leftmiddle]);
         DRAW (c, mc_tty_ugly_frm[single ? MC_TTY_FRM_grpleftmiddle : MC_TTY_FRM_leftmiddle]);

+ 4 - 4
lib/tty/tty.c

@@ -126,15 +126,15 @@ tty_got_interrupt (void)
 }
 }
 
 
 void
 void
-tty_print_one_hline (void)
+tty_print_one_hline (gboolean single)
 {
 {
-    tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_thinhoriz], FALSE);
+    tty_print_alt_char (ACS_HLINE, single);
 }
 }
 
 
 void
 void
-tty_print_one_vline (void)
+tty_print_one_vline (gboolean single)
 {
 {
-    tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_thinvert], FALSE);
+    tty_print_alt_char (ACS_VLINE, single);
 }
 }
 
 
 void
 void

+ 2 - 2
lib/tty/tty.h

@@ -71,8 +71,8 @@ extern void tty_print_anychar (int c);
 extern void tty_print_string (const char *s);
 extern void tty_print_string (const char *s);
 extern void tty_printf (const char *s, ...);
 extern void tty_printf (const char *s, ...);
 
 
-extern void tty_print_one_vline (void);
-extern void tty_print_one_hline (void);
+extern void tty_print_one_vline (gboolean single);
+extern void tty_print_one_hline (gboolean single);
 extern void tty_draw_hline (int y, int x, int ch, int len);
 extern void tty_draw_hline (int y, int x, int ch, int len);
 extern void tty_draw_vline (int y, int x, int ch, int len);
 extern void tty_draw_vline (int y, int x, int ch, int len);
 extern void tty_draw_box (int y, int x, int rows, int cols);
 extern void tty_draw_box (int y, int x, int rows, int cols);

+ 4 - 4
src/screen.c

@@ -747,7 +747,7 @@ format_file (char *dest, int limit, WPanel * panel, int file_index, int width, i
                 tty_setcolor (SELECTED_COLOR);
                 tty_setcolor (SELECTED_COLOR);
             else
             else
                 tty_setcolor (NORMAL_COLOR);
                 tty_setcolor (NORMAL_COLOR);
-            tty_print_one_vline ();
+            tty_print_one_vline (TRUE);
             length++;
             length++;
         }
         }
     }
     }
@@ -803,7 +803,7 @@ repaint_file (WPanel * panel, int file_index, int mv, int attr, int isstatus)
         else
         else
         {
         {
             tty_setcolor (NORMAL_COLOR);
             tty_setcolor (NORMAL_COLOR);
-            tty_print_one_vline ();
+            tty_print_one_vline (TRUE);
         }
         }
     }
     }
 }
 }
@@ -1515,7 +1515,7 @@ paint_frame (WPanel * panel)
         if (side)
         if (side)
         {
         {
             tty_setcolor (NORMAL_COLOR);
             tty_setcolor (NORMAL_COLOR);
-            tty_print_one_vline ();
+            tty_print_one_vline (TRUE);
             width = panel->widget.cols - panel->widget.cols / 2 - 1;
             width = panel->widget.cols - panel->widget.cols / 2 - 1;
         }
         }
         else if (panel->split)
         else if (panel->split)
@@ -1551,7 +1551,7 @@ paint_frame (WPanel * panel)
             else
             else
             {
             {
                 tty_setcolor (NORMAL_COLOR);
                 tty_setcolor (NORMAL_COLOR);
-                tty_print_one_vline ();
+                tty_print_one_vline (TRUE);
                 width--;
                 width--;
             }
             }
         }
         }

+ 1 - 1
src/viewer/hex.c

@@ -199,7 +199,7 @@ mcview_display_hex (mcview_t * view)
                 {
                 {
                     if (view->data_area.width >= 80 && col < width)
                     if (view->data_area.width >= 80 && col < width)
                     {
                     {
-                        tty_print_one_vline ();
+                        tty_print_one_vline (TRUE);
                         col += 1;
                         col += 1;
                     }
                     }
                     if (col < width)
                     if (col < width)

+ 3 - 3
src/widget.c

@@ -2254,14 +2254,14 @@ listbox_drawscroll (WListbox * l)
     /* Are we at the top? */
     /* Are we at the top? */
     widget_move (&l->widget, 0, l->widget.cols);
     widget_move (&l->widget, 0, l->widget.cols);
     if (l->top == 0)
     if (l->top == 0)
-        tty_print_one_vline ();
+        tty_print_one_vline (TRUE);
     else
     else
         tty_print_char ('^');
         tty_print_char ('^');
 
 
     /* Are we at the bottom? */
     /* Are we at the bottom? */
     widget_move (&l->widget, max_line, l->widget.cols);
     widget_move (&l->widget, max_line, l->widget.cols);
     if ((l->top + l->widget.lines == l->count) || (l->widget.lines >= l->count))
     if ((l->top + l->widget.lines == l->count) || (l->widget.lines >= l->count))
-        tty_print_one_vline ();
+        tty_print_one_vline (TRUE);
     else
     else
         tty_print_char ('v');
         tty_print_char ('v');
 
 
@@ -2273,7 +2273,7 @@ listbox_drawscroll (WListbox * l)
     {
     {
         widget_move (&l->widget, i, l->widget.cols);
         widget_move (&l->widget, i, l->widget.cols);
         if (i != line)
         if (i != line)
-            tty_print_one_vline ();
+            tty_print_one_vline (TRUE);
         else
         else
             tty_print_char ('*');
             tty_print_char ('*');
     }
     }