1 /* This file Copyright 1992 by Clifford A. Adams */
2 /* sadisp.c
3  *
4  * display stuff
5  */
6 
7 #include "EXTERN.h"
8 #include "common.h"
9 #ifdef SCAN_ART
10 #include "hash.h"
11 #include "cache.h"
12 /* for absfirst declaration */
13 #include "bits.h"
14 /* for mailcall */
15 #include "ng.h"
16 /* for ngname */
17 #include "trn.h"
18 #include "term.h"
19 #include "util.h"
20 #include "scanart.h"
21 #include "samain.h"
22 #include "sadesc.h"
23 #include "samisc.h"
24 #include "sathread.h"	/* for fold mode flag */
25 #ifdef SCORE
26 #include "score.h"
27 #endif
28 #include "scan.h"
29 #include "sdisp.h"
30 #include "color.h"
31 #include "INTERN.h"
32 #include "sadisp.h"
33 
34 void
sa_refresh_top()35 sa_refresh_top()
36 {
37     color_object(COLOR_SCORE, 1);
38     printf("%s |",ngname);
39 /* # of articles might be optional later */
40     printf(" %d",sa_number_arts());
41 
42     if (sa_mode_read_elig)
43 	printf(" unread+read");
44     else
45 	printf(" unread");
46     if (sa_mode_zoom)
47 	printf(" zoom");
48     if (sa_mode_fold)
49 	printf(" Fold");
50     if (sa_follow)
51 	printf(" follow");
52     color_pop();	/* of COLOR_SCORE */
53     erase_eol();
54     printf("\n") FLUSH;
55 }
56 
57 void
sa_refresh_bot()58 sa_refresh_bot()
59 {
60     char* s;
61 
62     color_object(COLOR_SCORE, 1);
63     s_mail_and_place();
64     printf("(");
65     switch (sa_mode_order) {
66       case 1:
67 	s = "arrival";
68 	break;
69 #ifdef SCORE
70       case 2:
71 	if (score_newfirst)
72 	    s = "score (new>old)";
73 	else
74 	    s = "score (old>new)";
75 	break;
76 #endif
77       default:
78 	s = "unknown";
79 	break;
80     }
81     printf("%s order",s);
82 #ifdef SCORE
83     printf(", %d%% scored",sc_percent_scored());
84 #endif
85     printf(")");
86     color_pop();	/* of COLOR_SCORE */
87     fflush(stdout);
88 }
89 
90 /* set up various screen dimensions */
91 void
sa_set_screen()92 sa_set_screen()
93 {
94     /* One size fits all for now. */
95     /* these things here because they may vary by screen size later */
96     s_top_lines = 1;
97     s_bot_lines = 1;
98     s_status_cols = 3;
99     s_cursor_cols = 2;
100 
101     if (s_itemnum)
102 	s_itemnum_cols = 3;
103     else
104 	s_itemnum_cols = 0;
105 
106     /* (scr_width-1) keeps last character blank. */
107     s_desc_cols = (scr_width-1) -s_status_cols -s_cursor_cols -s_itemnum_cols;
108 }
109 #endif /* SCAN */
110