📄 basehead.h
字号:
/***include file*/#include <iostream.h>#include <sys/types.h>#include <sys/stat.h>#include <sys/mman.h>#include <dirent.h>#include <unistd.h>#include <fcntl.h>#include <fnmatch.h>#include <errno.h>#include <ncurses.h>#include <panel.h>#include <menu.h>#include <form.h>/***color macro:COLOR_forecolor_backcolor*/#define COLOR_BLUE_WHITE 1#define COLOR_BLUE_YELLOW 2 #define COLOR_BLUE_BLACK 3#define COLOR_BLACK_WHITE 4 #define COLOR_BLACK_BLUE 5#define COLOR_BLACK_YELLOW 6 #define COLOR_BLACK_CYAN 7#define COLOR_BLACK_GREEN 8#define COLOR_CYAN_BLUE 9#define COLOR_CYAN_YELLOW 10#define COLOR_CYAN_GREEN 11#define COLOR_CYAN_RED 12#define COLOR_MAGENTA_RED 13#define COLOR_MAGENTA_GREEN 14#define COLOR_MAGENTA_BLUE 15#define COLOR_MAGENTA_YELLOW 16 #define COLOR_GREEN_WHITE 17#define COLOR_GREEN_YELLOW 18#define COLOR_GREEN_BLACK 19#define COLOR_GREEN_RED 20#define COLOR_WHITE_BLUE 21#define COLOR_WHITE_BLACK 22#define COLOR_WHITE_RED 23#define COLOR_WHITE_CYAN 24#define COLOR_YELLOW_BLUE 25#define COLOR_RED_BLUE 26#define COLOR_GREEN_BLUE 27#define SET_STYLE(win,i) wattron((win),COLOR_PAIR(i))#define CLOSE_STYLE(win,i) wattroff((win),COLOR_PAIR(i))/***menuid=(itemid+1)*10+(subitemid+1)*/#define MENU_FILE_NEW 11#define MENU_FILE_OPEN 12#define MENU_FILE_SAVE 13#define MENU_FILE_SAVEAS 14#define MENU_FILE_SHELL 15#define MENU_FILE_EXIT 16#define MENU_EDIT_CUT 21#define MENU_EDIT_COPY 22#define MENU_EDIT_PASTER 23#define MENU_EDIT_DEL 24#define MENU_EDIT_FIND 25#define MENU_EDIT_SELECTALL 26#define MENU_EDIT_REPLACE 27#define MENU_EDIT_SELECT 28#define MENU_EDIT_UNSELECT 29#define MENU_BOOKMARK_ADD 31#define MENU_BOOKMARK_DEL 32#define MENU_BOOKMARK_DELALL 33#define MENU_BOOKMARK_PREV 34#define MENU_BOOKMARK_NEXT 35#define MENU_CODE_INDENT 41#define MENU_CODE_AUTOMAKE 42#define MENU_CODE_AUTOCONF 43#define MENU_BUILD_BUILD 51#define MENU_BUILD_STRACE 52#define MENU_BUILD_DEBUG 53#define MENU_BUILD_STEPIN 54#define MENU_BUILD_STEPOUT 55#define MENU_BUILD_STEPOVER 56#define MENU_BUILD_WATCH 57#define MENU_BUILD_MEMORY 58#define MENU_SET_OPTION 61#define MENU_SET_CUSTOM 62#define MENU_SET_EDITOR 63#define MENU_SET_LANGUAGE 64#define MENU_SET_FORMAT 65#define MENU_SET_DIRECTORY 66#define MENU_SET_BACKGROUND 67#define MENU_HELP_ABOUT 71#define MENU_HELP_HELP 72/***base windows parameter*/#define BOOL int#define MAX_CHARS 80#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))#define MAX_COLS 256#define MAXFIELDLEN 100#define MAXMSGLEN 1024#define CODE_QUANTUM 256#define CODE_QSET (LINES-3)#define KEY_TAB 9#define KEY_INSERT 331#define KEY_SHIFTUP 65#define KEY_SHIFTDOWN 66#define KEY_SHIFTRIGHT 67#define KEY_SHIFTLEFT 68#define KEY_SPACE 32/***base dialog type*/#define NOTHINGDLG 0#define OKONLYDLG 1#define OKCANCELDLG 2#define YESNOCANCELDLG 3/***interface object*/#define TOP_MENU 1#define VSCROLL_NOBORDER 2#define VSCROLL_BORDER 3#define HSCROLL_NOBORDER 4#define HSCROLL_BORDER 5#define TEXT_CENTEREDITOR 6#define DIALOG_NORMAL 7#define DIALOG_FILENEW 8#define DIALOG_FILEOPEN 9#define DIALOG_FILESAVE 10#define DIALOG_FILESAVEAS 11#define DIALOG_FILEEXIT 12#define DIALOG_FILEMESSAGE 13#define DIALOG_EDITFIND 14#define DIALOG_EDITREPLACE 15#define DIALOG_EDITSELECT 16#define DIALOG_EDITUNSELECT 17#define DIALOG_EDITSELECTALL 18#define DIALOG_ERRORMESSAGE 19#define STATUS_INSERT 20#define STATUS_REPLACE 21#define TOOLS_INDENT 22#define TOOLS_AUTOMAKE 23#define TOOLS_AUTOCONF 24/***file operations status*/#define ZC_OK 0#define ZC_NA 1#define ZC_AC 2#define ZC_FF 3#define ZC_READ 1#define ZC_WRITE 2#define ZC_EXEC 4#define ZC_REG 1//regular file#define ZC_FIFO 2//pipe file#define ZC_BLK 3//block device file#define ZC_CHR 4//char device file#define ZC_SOCK 5//socket file#define ZC_LNK 6//link file#define ZC_DIR 7//directory/***key transport*/#define TRANSPORT_WIDTH 16#define NO_TRANSPORT 0#define UPDATE_CODEAREA 1#define FILE_DIALOG 2#define EDIT_DIALOG 4#define ACTIVE_TOPMENU 8#define ACTIVE_CODEAREA 16#define BLOCK_OPERATE 32#define UPDATE_STATUS 64//#define UPDATE_STATUS_INSERT 128//#define UPDATE_STATUS_REPLACE 256#define CODE_TOOLS 512//#define UPDATE_STATUS_LINE 1024#define SHOW_HELP_DIALOG 2048#define SHOW_ABOUT_DIALOG 4096#define REFRESH_ALLWINDOWS 8192#define EXIT_APPLICATION 16384/***kernel module used to indent,gcc,gdb...*/#define MODULE_PRIMNAME "/dev/maininfo"#define MODULE_SECONAME "/dev/backinfo"/***Error Message*/#define ERR_OPENDIR " Error occurs when changing the current directory! Please check the validity of pathname or permission."#define ERR_LISTFILE " Error occurs when listing files! Please check the validity of pathname or permission."#define ERR_OPENFILE " Error occurs when opening files! Please check the validity of filename or permission."#define ERR_WRITEFILE " Error occurs when writing files! Please check the validity of filename or permission."#define ERR_NOFILE ", the specfied file does not exist!"#define ERR_OVERRIDE " exists.Overwrite it?"#define ERR_CANNOTREAD "Have no enough permission to read file:"#define ERR_CANNOTWRITE "Have no enough permission to write file:"#define ERR_NORIGHT " Has no permission!"/***lex check*/#define MAXIDLEN 20 // length of identifiers#define NRW 36 // number of reserved wordschar* keyword[NRW + 1] ={ "", /* place holder */ "auto","break","case","char","const","continue","default","define","do","double","else","enum", "extern","float","for","goto","if","include","inline","int","long","register","return","short", "signed","sizeof","static","struct","switch","typedef","union","unsigned","void", "volatile","while","__asm__"};/***copy line direction*/#define COPY_LINES_DOWN 0#define COPY_LINES_UP 1enum symtype{ SYM_NULL, SYM_IDENTIFIER, SYM_NUMBER, SYM_PLUS, SYM_MINUS, SYM_TIMES, SYM_SLASH, SYM_ODD, SYM_EQU, SYM_NEQ, SYM_LES, SYM_LEQ, SYM_GTR, SYM_GEQ, SYM_LPAREN, SYM_RPAREN, SYM_COMMA, SYM_SEMICOLON, SYM_PERIOD, SYM_BECOMES, SYM_IF, SYM_WHILE, SYM_DO, SYM_CONST, SYM_VAR, SYM_FUNCTION, SYM_ELSE, SYM_LBRACKET, SYM_RBRACKET, SYM_SELFADD, SYM_SELFMINUS};/***message data union*/enum {BUTOK,BUTCANCEL,BUTYES,BUTNO,UNKNOW};enum {BLOCKCUT,BLOCKCOPY,BLOCKPASTE,BLOCKDEL,BLOCKUNSEL};union message{ struct RectMenu{int left;int top;int height;int width;} rectmenu; int row; int col; struct FileObj {char filename[MAXFIELDLEN];int type;} fileobj; struct SeleObj {int begline;int begcol;int endline;int endcol;} seleobj; struct StatObj {int type;} statusobj; struct ToolObj {int type;} toolobj; struct BlockOP {int type;} blockop; int vpos; int hpos;} msg;//end of file basehead.h
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -