⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tdecfg.h

📁 C++游戏开发书籍的实例非常适合初学但又又想往游戏开发方面发展的人学习哦
💻 H
📖 第 1 页 / 共 2 页
字号:
/*
 * the config utility now finds the offsets for the editor structures.
 */

/*
 * defines for the inline assembler.
 */
#if defined( __MSC__ )
   #define  ASSEMBLE   _asm
#else
   #define  ASSEMBLE   asm
#endif


#define TRUE            1
#define FALSE           0

#define OK              0
#define ERROR           (-1)


#define MAX_KEYS        256
#define AVAIL_KEYS      233


#define MAX_TWO_KEYS    128   /* number of two key-combos allowed by TDE  */
#define STROKE_LIMIT    1024


#define NUM_FUNC        139

#define NUM_COLORS      14

#define NUM_MODES       23

/*
 * mode indexes
 */
#define Ins              0
#define Ind              1
#define PTAB             2
#define LTAB             3
#define Smart            4
#define Write_Z          5
#define Crlf             6
#define Trim             7
#define Eol              8
#define WW               9
#define Left            10
#define Para            11
#define Right           12
#define Size            13
#define Backup          14
#define Ruler           15
#define Date            16
#define Time            17
#define Initcase        18
#define InflateTabs     19
#define Match           20
#define Ignore          21
#define JustRM          22



#define EXIST           0

#define VIDEO_INT       0x10

#define VGA             3
#define EGA             2
#define CGA             1
#define MDA             0

#define NORMAL          7
#define COLOR_ATTR      31
#define MONO_ATTR       112


#define ESC             27
#define LEFT            (75 | 0x100)
#define RIGHT           (77 | 0x100)
#define UP              (72 | 0x100)
#define DOWN            (80 | 0x100)
#define RTURN           13
#define PGUP            (73 | 0x100)
#define PGDN            (81 | 0x100)
#define F1              (59 | 0x100)
#define F2              (60 | 0x100)
#define F3              (61 | 0x100)
#define F5              (63 | 0x100)
#define F6              (64 | 0x100)
#define F7              (65 | 0x100)
#define F8              (66 | 0x100)
#define F10             (68 | 0x100)


#define U_LEFT          218
#define U_RIGHT         191
#define VER_LINE        179
#define HOR_LINE        196
#define L_LEFT          192
#define L_RIGHT         217

#define SAVE            0
#define RESTORE         1


/*
 * Save the underlying text of the screen in a structure.  We need to know
 * the column and row to begin saving the text.  Since we are doing an
 * optimal save and restore, we don't know how much memory to allocate to
 * the save buffer.  If we use a pointer, then we can dynamically allocate as
 * much or as little memory as we need.  Finally, we need a window pointer
 * to point to the next item on the stack.
 */
typedef struct win {
   int x;
   int y;
   int *buf;
   struct win *n;
} WINDOW;


/*
 * Structure to store the row and column of a string.
 */
struct screen {
   unsigned int   row;
   unsigned int   col;
   unsigned char *text;
};


/*
 * video adapter stuff.
 */
struct vcfg {
   int color;
   int rescan;
   int mode;
   int overscan;
   int adapter;
   int attr;
   int far *videomem;
};


typedef struct {
   char sig[8];                 /* signature, so we can find struct in .exe */
   int  clr[2][NUM_COLORS];     /* one array for mono and another for color */
} COLORS;


/*
 * When we display a pop-up or pull-down window, we need to know a few things
 * about the window and the text to display in the window.
 */
typedef struct {
   int dply_col;        /* offset into window to begin displaying help list */
   int dply_row;        /* dito */
   int line_length;     /* the length of the help line in the window */
   int avail_lines;     /* number of lines in the window available for list */
   int v_row;           /* virtual row of cursor in window */
   int select;          /* item currently selected in help list */
   int num_entries;     /* total number of items in help list */
   int ulft_col;        /* absolute upper left column of window */
   int ulft_row;        /* absolute upper left row of window */
   int total_col;       /* total number of columns in window */
   int total_row;       /* total number of rows in window */
} HELP_WINDOW;


/*
 * structure for list of available keys.   See default.h for more info.
 */
typedef struct {
   char *key;           /* key name */
   int  key_index;      /* offset into key structure in tde.exe file */
   unsigned char func_index;     /* function of key */
} KEY_DEFS;


/*
 * structure for list of available keys.   See default.h for more info.
 */
typedef struct {
   char *key;           /* key name */
   int  key_index;      /* offset into key structure in tde.exe file */
} CONFIG_DEFS;


/*
 * From the source code of tde.
 */
typedef struct {
  int key;      /* key assinged to this node, which may be text or function */
  int next;     /* pointer to next node in macro def */
} STROKES;

/*
 * structure for the macro buffer.
 */
typedef struct {
   char sig[8];                         /* signature, easy to find in .exe */
   int  first_stroke[MAX_KEYS];         /* pointer to first key in macro */
   STROKES strokes[STROKE_LIMIT];       /* buffer to hold key strokes */
} MACRO;



/*
 * "mode_infos" contain the editor mode variables.  The configuration
 *  utility modifies this structure to custimize the start-up tde
 *  configuration
 */
typedef struct {
   char sig[8];                 /* signature, so we can find struct in .exe */
   int  color_scheme;           /* color to start out with */
   int  sync;                   /* sync the cursor movement command? */
   int  sync_sem;               /* sync the cursor movement command? */
   int  record;                 /* are we recording keystrokes? */
   int  insert;                 /* in insert mode? */
   int  indent;                 /* in auto-indent mode? */
   int  ptab_size;              /* physical tab stops */
   int  ltab_size;              /* logical tab stops */
   int  smart_tab;              /* smart tab mode on or off? */
   int  inflate_tabs;           /* inflate tabs?  T or F */
   int  search_case;            /* consider case? IGNORE or MATCH */
   int  enh_kbd;                /* type of keyboard */
   int  cursor_size;            /* insert cursor big or small? */
   char *eof;                   /* message to display at end of file */
   int  control_z;              /* write ^Z - t or f */
   int  crlf;                   /* <cr><lf> toggle CRLF or LF */
   int  trailing;               /* remove trailing space? T or F */
   int  show_eol;               /* show lf at eol? T or F */
   int  word_wrap;              /* in word wrap mode? */
   int  left_margin;            /* left margin */
   int  parg_margin;            /* column for 1st word in paragraph */
   int  right_margin;           /* right margin */
   int  right_justify;          /* boolean, justify right margin?  T or F */
   int  format_sem;             /* format semaphore */
   int  undo_max;               /* max number of lines in undo stack */
   int  do_backups;             /* create backup or ".bak" files? T or F */
   int  ruler;                  /* show ruler at top of window? T or F */
   int  date_style;             /* date style for date and time stamp */
   int  time_style;             /* time style for date and time stamp */
} MODE_INFO;


typedef struct {
   unsigned char ignore[256];
   unsigned char match[256];
} SORT_ORDER;


/*
 * structure for two key combos
 */
typedef struct {
   int parent_key;
   int child_key;
   int func;
} TWO_KEY_TYPE;


typedef struct {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -