Browse Source

tty_print_char() function is used instead of addch() one.

Modified tty_print_char() function for S-Lang library to use it
instead of addch().
Andrew Borodin 16 years ago
parent
commit
fe1adb5f27
10 changed files with 35 additions and 40 deletions
  1. 1 1
      edit/editdraw.c
  2. 5 5
      src/achown.c
  3. 1 1
      src/chmod.c
  4. 2 2
      src/cons.handler.c
  5. 1 1
      src/find.c
  6. 2 2
      src/help.c
  7. 2 2
      src/layout.c
  8. 1 1
      src/menu.c
  9. 8 13
      src/screen.c
  10. 12 12
      src/tree.c

+ 1 - 1
edit/editdraw.c

@@ -341,7 +341,7 @@ print_to_widget (WEdit *edit, long row, int start_col, int start_col_real,
             }
             tty_print_string ((char *) str);
         } else {
-            addch(textchar);
+            tty_print_char (textchar);
         }
 	p++;
     }

+ 5 - 5
src/achown.c

@@ -189,28 +189,28 @@ static void print_flags (void)
 
     for (i = 0; i < 3; i++){
 	dlg_move (ch_dlg, BY+1, 9+i);
-	addch (ch_flags [i]);
+	tty_print_char (ch_flags [i]);
     }
     
     for (i = 0; i < 3; i++){
 	dlg_move (ch_dlg, BY + 1, 17 + i);
-	addch (ch_flags [i+3]);
+	tty_print_char (ch_flags [i+3]);
     }
     
     for (i = 0; i < 3; i++){
 	dlg_move (ch_dlg, BY + 1, 25 + i);
-	addch (ch_flags [i+6]);
+	tty_print_char (ch_flags [i+6]);
     }
 
     update_permissions ();
 
     for (i = 0; i < 15; i++){
 	dlg_move (ch_dlg, BY+1, 35+i);
-	addch (ch_flags[9]);
+	tty_print_char (ch_flags[9]);
     }
     for (i = 0; i < 15; i++){
 	dlg_move (ch_dlg, BY + 1, 53 + i);
-	addch (ch_flags[10]);
+	tty_print_char (ch_flags[10]);
     }
 }
 

+ 1 - 1
src/chmod.c

@@ -117,7 +117,7 @@ static void chmod_toggle_select (Dlg_head *h, int Id)
     check_perm[Id].selected ^= 1;
 
     dlg_move (h, PY + PERMISSIONS - Id, PX + 1);
-    addch ((check_perm[Id].selected) ? '*' : ' ');
+    tty_print_char ((check_perm[Id].selected) ? '*' : ' ');
     dlg_move (h, PY + PERMISSIONS - Id, PX + 3);
 }
 

+ 2 - 2
src/cons.handler.c

@@ -86,7 +86,7 @@ show_console_contents_linux (int starty, unsigned char begin_line,
 	if ((i % COLS) == 0)
 	    tty_gotoyx (starty + (i / COLS), 0);
 	read (pipefd2[0], &message, 1);
-	addch (message);
+	tty_print_char (message);
     }
 
     /* Read the value of the console_flag */
@@ -335,7 +335,7 @@ show_console_contents_freebsd (int starty, unsigned char begin_line,
 	tty_gotoyx (starty + line - begin_line, 0);
         for (col = 0; col < min (COLS, screen_info.mv_csz); col++) {
 	    c = screen_shot.buf[line * screen_info.mv_csz + col] & 0xFF;
-	    addch (c);
+	    tty_print_char (c);
 	}
     }
 }

+ 1 - 1
src/find.c

@@ -895,7 +895,7 @@ do_search (struct Dlg_head *h)
 	    pos = (pos + 1) % 4;
 	    tty_setcolor (DLG_NORMALC (h));
 	    dlg_move (h, FIND2_Y - 7, FIND2_X - 4);
-	    addch (rotating_dash [pos]);
+	    tty_print_char (rotating_dash [pos]);
 	    tty_refresh ();
 	}
     } else

+ 2 - 2
src/help.c

@@ -428,10 +428,10 @@ static void help_show (Dlg_head *h, const char *paint_start)
 		dlg_move (h, line+2, col+2);
 		if (acs){
 		    if (c == ' ' || c == '.')
-			addch (c);
+			tty_print_char (c);
 		    else
 #ifndef HAVE_SLANG
-			addch (acs_map [c]);
+			tty_print_char (acs_map [c]);
 #else
 			SLsmg_draw_object (h->y + line + 2, h->x + col + 2, c);
 #endif

+ 2 - 2
src/layout.c

@@ -301,7 +301,7 @@ layout_callback (struct Dlg_head *h, dlg_msg_t msg, int parm)
 	tty_setcolor (COLOR_HOT_NORMAL);
 	update_split ();
 	dlg_move (h, 6, 13);
-	addch ('=');
+	tty_print_char ('=');
 	if (console_flag){
 	    if (old_output_lines != _output_lines){
 		old_output_lines = _output_lines;
@@ -818,7 +818,7 @@ void rotate_dash (void)
 	pos = 0;
     tty_gotoyx (0, COLS - 1);
     tty_setcolor (NORMAL_COLOR);
-    addch (rotating_dash [pos]);
+    tty_print_char (rotating_dash [pos]);
     tty_refresh ();
     pos++;
 }

+ 1 - 1
src/menu.c

@@ -103,7 +103,7 @@ static void menubar_paint_idx (WMenu *menubar, int idx, int color)
         /* menu text */
         tty_setcolor (color);
         widget_move (&menubar->widget, y, x);
-        addch ((unsigned char) entry->first_letter);
+        tty_print_char ((unsigned char) entry->first_letter);
         hline (' ', menubar->max_entry_len + 1); /* clear line */
         tty_print_string (entry->text.start);
 

+ 8 - 13
src/screen.c

@@ -160,7 +160,7 @@ add_permission_string (char *dest, int width, file_entry *fe, int attr, int colo
         } else
             tty_setcolor (color);
 
-	addch (dest[i]);
+	tty_print_char (dest[i]);
     }
 }
 
@@ -571,11 +571,8 @@ format_file (char *dest, int limit, WPanel *panel, int file_index, int width, in
 	}
     }
 
-    if (length < width){
-	int still = width - length;
-	while (still--)
-	    addch (' ');
-    }
+    if (length < width)
+	hline (' ', width - length);
 }
 
 static void
@@ -616,7 +613,7 @@ repaint_file (WPanel *panel, int file_index, int mv, int attr, int isstatus)
 
     if (!isstatus && panel->split){
 	if (second_column)
-	    addch (' ');
+	    tty_print_char (' ');
 	else {
 	    tty_setcolor (NORMAL_COLOR);
 	    tty_print_one_vline ();
@@ -796,8 +793,6 @@ show_free_space (WPanel *panel)
 static void
 show_dir (WPanel *panel)
 {
-    int len;
-
     set_colors (panel);
     draw_double_box (panel->widget.parent,
 		     panel->widget.y, panel->widget.x,
@@ -816,10 +811,10 @@ show_dir (WPanel *panel)
 
     widget_move (&panel->widget, 0, 3);
 
-    addch (' ');
-    len = min (max (panel->widget.cols - 9, 0), panel->widget.cols); 
-    tty_print_string (str_term_trim (strip_home_and_password (panel->cwd), len));
-    addch (' ');
+    tty_printf (" %s ",
+		str_term_trim (strip_home_and_password (panel->cwd),
+				min (max (panel->widget.cols - 9, 0),
+					panel->widget.cols)));
 
     widget_move (&panel->widget, 0, 1);
     tty_print_string ("<");

+ 12 - 12
src/tree.c

@@ -183,11 +183,11 @@ static void tree_show_mini_info (WTree *tree, int tree_lines, int tree_cols)
 	/* Show search string */
 	tty_setcolor (TREE_NORMALC (h));
 	tty_setcolor (DLG_FOCUSC (h));
-	addch (PATH_SEP);
+	tty_print_char (PATH_SEP);
 
 	tty_print_string (str_fit_to_term (tree->search_buffer, 
 		tree_cols - 2, J_LEFT_FIT));
-	addch (' ');
+	tty_print_char (' ');
 	tty_setcolor (DLG_FOCUSC (h));
     } else {
 	/* Show full name of selected directory */
@@ -287,19 +287,19 @@ static void show_tree (WTree *tree)
 	    for (j = 0; j < current->sublevel - topsublevel - 1; j++){
 		if (tree_cols - 8 - 3 * j < 9)
 		    break;
-		addch (' ');
+		tty_print_char (' ');
 		if (current->submask & (1 << (j + topsublevel + 1)))
-		    addch (ACS_VLINE);
+		    tty_print_char (ACS_VLINE);
 		else
-		    addch (' ');
-		addch (' ');
+		    tty_print_char (' ');
+		tty_print_char (' ');
 	    }
-	    addch (' '); j++;
+	    tty_print_char (' '); j++;
 	    if (!current->next || !(current->next->submask & (1 << current->sublevel)))
-		addch (ACS_LLCORNER);
+		tty_print_char (ACS_LLCORNER);
 	    else
-		addch (ACS_LTEE);
-	    addch (ACS_HLINE);
+		tty_print_char (ACS_LTEE);
+	    tty_print_char (ACS_HLINE);
 	    noacs ();
 
 	    if (tree->active && current == tree->selected_ptr) {
@@ -311,11 +311,11 @@ static void show_tree (WTree *tree)
 	    }
 
 	    /* Show sub-name */
-	    addch (' ');
+	    tty_print_char (' ');
 	    tty_print_string (str_fit_to_term (current->subname, 
 		    tree_cols - 2 - 4 - 3 * j, J_LEFT_FIT));
 	}
-	addch (' ');
+	tty_print_char (' ');
 
 	/* Return to normal color */
 	tty_setcolor (TREE_NORMALC (h));

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