Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.sbin / pcvt / fed / fed.h
1 /*
2  * Copyright (c) 1992, 1993, 1994 by Hellmuth Michaelis
3  *
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  * 3. All advertising materials mentioning features or use of this software
15  *    must display the following acknowledgement:
16  *    This product includes software developed by Hellmuth Michaelis.
17  * 4. The name of the developer may not be used to endorse or promote
18  *    products derived from this software without specific prior written
19  *    permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND ANY EXPRESS OR
22  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24  * IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  *      fed.h, 3.00, last edit-date: [Sun Jan  2 20:10:31 1994]
33  */
34
35 #include <ncurses.h>
36 #include <stdlib.h>
37 #include <string.h>
38 #include <unistd.h>
39
40 #ifdef FED
41
42 int ch_height;
43 int ch_width;
44
45 int curchar;
46
47 WINDOW *ch_win;
48 WINDOW *set_win;
49 WINDOW *cmd_win;
50
51 #else
52
53 extern int ch_height;           /* current fontfile character dimensions */
54 extern int ch_width;
55
56 extern int curchar;             /* character being edited */
57
58 extern WINDOW *ch_win;          /* windows */
59 extern WINDOW *set_win;
60 extern WINDOW *cmd_win;
61
62 #endif
63
64 #define FONTCHARS       256     /* no of chars in a fontfile */
65
66 #define WHITE ('.')
67 #define BLACK ('*')
68
69 #define K_UP    0x10    /* ^P */
70 #define K_DOWN  0x0e    /* ^N */
71 #define K_RIGHT 0x06    /* ^F */
72 #define K_LEFT  0x02    /* ^B */
73
74 #define WINROW  3
75 #define CMDCOL  3
76 #define CHCOL   20
77 #define SETCOL  41
78 #define WSIZE   16
79 #define CMDSIZE 12
80 #define WBORDER 1
81
82 /* fonts */
83
84 #define WIDTH8          8       /* 8 bits wide font                   */
85 #define WIDTH16         16      /* 16 bits wide font                  */
86
87 #define FONT8X8         2048    /* filesize for 8x8 font              */
88 #define HEIGHT8X8       8       /* 8 scan lines char cell height      */
89
90 #define FONT8X10        2560    /* filesize for 8x10 font             */
91 #define HEIGHT8X10      10      /* 10 scan lines char cell height     */
92
93 #define FONT8X14        3584    /* filesize for 8x14 font             */
94 #define HEIGHT8X14      14      /* 14 scan lines char cell height     */
95 #define WIDTH8X14       8       /* 8 bits wide font                   */
96
97 #define FONT8X16        4096    /* filesize for 8x16 font             */
98 #define HEIGHT8X16      16      /* 16 scan lines char cell height     */
99
100 #define FONT16X16       8192    /* filesize for 16x16 font            */
101 #define HEIGHT16X16     16      /* 16 scan lines char cell height     */
102
103
104 void edit_mode ( void );
105 int edit ( void );
106 void normal_ch ( int r, int c );
107 void chg_pt ( int r, int c );
108 void invert ( void );
109 void setchr ( char type );
110 void setrow ( char type );
111 void setcol ( char type );
112 void main ( int argc, char *argv[] );
113 void readfont ( char *filename );
114 void dis_cmd ( char *strg );
115 void clr_cmd ( void );
116 void save_ch ( void );
117 void move_ch ( int src, int dest );
118 void xchg_ch ( int src, int dest );
119 void display ( int no );
120 void sel_mode ( void );
121 int selectc ( void );
122 void normal_set ( int r, int c );
123 int sel_dest ( void );
124 void normal_uset ( int r, int c );
125 void writefont( void );
126
127 /* ------------------------------ EOF ----------------------------------- */