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 /* cord.h, de_cmds.h, and windows.h should be included before this. */ 15 16 # define OTHER_FLAG 0x100 17 # define EDIT_CMD_FLAG 0x200 18 # define REPEAT_FLAG 0x400 19 20 # define CHAR_CMD(i) ((i) & 0xff) 21 22 /* MENU: DE */ 23 #define IDM_FILESAVE (EDIT_CMD_FLAG + WRITE) 24 #define IDM_FILEEXIT (OTHER_FLAG + 1) 25 #define IDM_HELPABOUT (OTHER_FLAG + 2) 26 #define IDM_HELPCONTENTS (OTHER_FLAG + 3) 27 28 #define IDM_EDITPDOWN (REPEAT_FLAG + EDIT_CMD_FLAG + DOWN) 29 #define IDM_EDITPUP (REPEAT_FLAG + EDIT_CMD_FLAG + UP) 30 #define IDM_EDITUNDO (EDIT_CMD_FLAG + UNDO) 31 #define IDM_EDITLOCATE (EDIT_CMD_FLAG + LOCATE) 32 #define IDM_EDITDOWN (EDIT_CMD_FLAG + DOWN) 33 #define IDM_EDITUP (EDIT_CMD_FLAG + UP) 34 #define IDM_EDITLEFT (EDIT_CMD_FLAG + LEFT) 35 #define IDM_EDITRIGHT (EDIT_CMD_FLAG + RIGHT) 36 #define IDM_EDITBS (EDIT_CMD_FLAG + BS) 37 #define IDM_EDITDEL (EDIT_CMD_FLAG + DEL) 38 #define IDM_EDITREPEAT (EDIT_CMD_FLAG + REPEAT) 39 #define IDM_EDITTOP (EDIT_CMD_FLAG + TOP) 40 41 42 43 44 /* Windows UI stuff */ 45 46 LRESULT CALLBACK WndProc (HWND hwnd, UINT message, 47 WPARAM wParam, LPARAM lParam); 48 49 /* Screen dimensions. Maintained by de_win.c. */ 50 extern int LINES; 51 extern int COLS; 52 53 /* File being edited. */ 54 extern char * arg_file_name; 55 56 /* Current display position in file. Maintained by de.c */ 57 extern int dis_line; 58 extern int dis_col; 59 60 /* Current cursor position in file. */ 61 extern int line; 62 extern int col; 63 64 /* 65 * Calls from de_win.c to de.c 66 */ 67 68 CORD retrieve_screen_line(int i); 69 /* Get the contents of i'th screen line. */ 70 /* Relies on COLS. */ 71 72 void set_position(int x, int y); 73 /* Set column, row. Upper left of window = (0,0). */ 74 75 void do_command(int); 76 /* Execute an editor command. */ 77 /* Agument is a command character or one */ 78 /* of the IDM_ commands. */ 79 80 void generic_init(void); 81 /* OS independent initialization */ 82 83 84 /* 85 * Calls from de.c to de_win.c 86 */ 87 88 void move_cursor(int column, int line); 89 /* Physically move the cursor on the display, */ 90 /* so that it appears at */ 91 /* (column, line). */ 92 93 void invalidate_line(int line); 94 /* Invalidate line i on the screen. */ 95 96 void de_error(char *s); 97 /* Display error message. */ 98