1 /*
2 * Copyright (c) 1994 by Xerox Corporation. All rights reserved.
3 *
4 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
5 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
6 *
7 * Permission is hereby granted to use or copy this program
8 * for any purpose, provided the above notices are retained on all copies.
9 * Permission to modify the code and to distribute modified code is granted,
10 * provided the above notices are retained, and a notice that the code was
11 * modified is included with the above copyright notice.
12 */
13 14 #ifndef DE_WIN_H
15 #define DE_WIN_H
16 17 #include "de_cmds.h"
18 19 #define OTHER_FLAG 0x100
20 #define EDIT_CMD_FLAG 0x200
21 #define REPEAT_FLAG 0x400
22 23 #define CHAR_CMD(i) ((i) & (0xff))
24 25 /* `MENU`: `DE` */
26 #define IDM_FILESAVE (EDIT_CMD_FLAG + WRITE)
27 #define IDM_FILEEXIT (OTHER_FLAG + 1)
28 #define IDM_HELPABOUT (OTHER_FLAG + 2)
29 #define IDM_HELPCONTENTS (OTHER_FLAG + 3)
30 31 #define IDM_EDITPDOWN (REPEAT_FLAG + EDIT_CMD_FLAG + DOWN)
32 #define IDM_EDITPUP (REPEAT_FLAG + EDIT_CMD_FLAG + UP)
33 #define IDM_EDITUNDO (EDIT_CMD_FLAG + UNDO)
34 #define IDM_EDITLOCATE (EDIT_CMD_FLAG + LOCATE)
35 #define IDM_EDITDOWN (EDIT_CMD_FLAG + DOWN)
36 #define IDM_EDITUP (EDIT_CMD_FLAG + UP)
37 #define IDM_EDITLEFT (EDIT_CMD_FLAG + LEFT)
38 #define IDM_EDITRIGHT (EDIT_CMD_FLAG + RIGHT)
39 #define IDM_EDITBS (EDIT_CMD_FLAG + BS)
40 #define IDM_EDITDEL (EDIT_CMD_FLAG + DEL)
41 #define IDM_EDITREPEAT (EDIT_CMD_FLAG + REPEAT)
42 #define IDM_EDITTOP (EDIT_CMD_FLAG + TOP)
43 44 /* Screen dimensions. Maintained by `de_win.c` file. */
45 extern int LINES;
46 extern int COLS;
47 48 /* File being edited. */
49 extern char *arg_file_name;
50 51 /* The following calls are from `de_win.c` file to `de.c` one. */
52 53 /* Get the contents (`CORD`) of `i`-th screen line. Relies on `COLS`. */
54 const void *retrieve_screen_line(int i);
55 56 /*
57 * Change the current position to the given column (`x`) and row (`y`).
58 * Upper left of window is (0,0).
59 */
60 void set_position(int x, int y);
61 62 /* The following calls are from `de.c` file to `de_win.c` one. */
63 64 /*
65 * Physically move the cursor on the display, so that it appears at
66 * given `column` and row (`line`).
67 */
68 void move_cursor(int column, int line);
69 70 /* Invalidate given row (`line`) on the screen. */
71 void invalidate_line(int line);
72 73 /* Display error message. */
74 void de_error(const char *s);
75 76 #endif /* DE_WIN_H */
77