home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- FAR/NEAR SELECTION
- Although REW is compiled in the medium model, in the Borland environment
- it is linked with the large model libraries. The following variable
- defines the TERFAR constant accordingly. This constant is used for
- modifying certain library functions.
- *******************************************************************************/
- #if defined(__TURBOC__)
- #ifdef __DLL__
- #define REPFAR far
- #define REPDLL
- #else
- #define REPFAR
- #endif
- #define DllMain DllEntryPoint
- #else
- #ifdef _WINDLL
- #define REPDLL
- #endif
- #define REPFAR
- #endif
-
- /******************************************************************************
- WIN32 specific defines
- *******************************************************************************/
- #define REPNT
- #if defined (REP32)
- #undef huge
- #define huge
- #undef FreeProcInstance
- #define FreeProcInstance(x)
- #define COMMAND_ID(wp,lp) LOWORD(wp)
- #define CONTROL_ID(wp,lp) LOWORD(wp)
- #define NOTIFY_MSG(wp,lp) HIWORD(wp)
- #define SCROLL_MSG(wp,lp) LOWORD(wp)
- #define THUMB_POS(wp,lp) HIWORD(wp)
- #undef farmalloc
- #define farmalloc malloc
- #undef farrealloc
- #define farrealloc realloc
- #undef farfree
- #define farfree free
- #define _fstrtok strtok
- #define CATCHBUF jmp_buf
- #else
- #define COMMAND_ID(wp,lp) (wp)
- #define CONTROL_ID(wp,lp) (wp)
- #define NOTIFY_MSG(wp,lp) HIWORD(lp)
- #define SCROLL_MSG(wp,lp) (wp)
- #define THUMB_POS(wp,lp) LOWORD(lp)
- #define CCSTYLEFLAG DWORD
- #endif
-
- /******************************************************************************
- Constant Definitions
- *******************************************************************************/
-
- #define LOSHORT(l) ((short)(WORD)(l))
- #define HISHORT(l) ((short)(WORD)((DWORD)(l) >> 16))
-
- // Unit conversion macros
-
- #define UnitToPixX(x) (MulDiv(x,ResX,UNITS_PER_INCH))
- #define UnitToPixY(y) (MulDiv(y,ResY,UNITS_PER_INCH))
-
- #define PixToUnitX(x) (MulDiv(x,UNITS_PER_INCH,ResX))
- #define PixToUnitY(y) (MulDiv(y,UNITS_PER_INCH,ResY))
-
- #define MAX_LINES 300
- #define MAX_SCR_PAGES 2000
- #define MAX_TYPES 30
- #define MAX_POINTS 14
- #define MAX_FONTS 32
- #define MAX_OPTS 7
- #define LINE_WIDTH 300
- #define BUF_SIZE 16384
- #define CUR_FILE_FORMAT 3
-
- #define OLD_ITEM_SIZE 385
-
- #define TAB_CHAR_LEN 4
-
- #define DEFAULT_CFMT 0x0
-
- #define BOLD_WEIGHT 700
- #define NORM_WEIGHT 400
-
- #define UNIFORM 0xFFFF
-
- #define LEFT 0x0
- #define CENTER 0x1
-
- #define REDUCTION 2
-
- #define PAINT_MIN 1
- #define PAINT_LINE 2
- #define PAINT_ITEMS 2
- #define PAINT_WIN 3
- #define PAINT_PARTIAL_LINE 4
- #define PAINT_PARTIAL_WIN 5
-
- #define PAINT_DIRECT 1
- #define PAINT_MEM 2
-
- #define HOR_SCROLL_MIN 0
- #define HOR_SCROLL_MAX 100
- #define VER_SCROLL_MIN 0
- #define VER_SCROLL_MAX 100
-
- #define STATUS_ROW 100
-
- #define INFO_LEN 40
- #define USER_INFO_LEN 60
-
- #define DISP_FILE 3
- #define DISP_LINE 2
-
- #define SECTION_CHAR 205
- #define FIELD_CHAR 215
-
- #define MAX_FIELDS 500
- #define MAX_BREAK_FIELDS 9
- #define MAX_VALS 6
- #define MAX_DT_FORMATS 4
- #define MAX_DLGS 12
-
- // Section Constants
- #define MAX_SECTIONS 31
- #define SEC_HDR_PAGE 0
- #define SEC_HDR_REP 1
- #define SEC_HDR_LVL1 2
- #define SEC_HDR_LVL2 3
- #define SEC_HDR_LVL3 4
- #define SEC_HDR_LVL4 5
- #define SEC_HDR_LVL5 6
- #define SEC_HDR_LVL6 7
- #define SEC_HDR_LVL7 8
- #define SEC_HDR_LVL8 9
- #define SEC_HDR_LVL9 10
- #define SEC_DETAIL1 11
- #define SEC_DETAIL2 12
- #define SEC_DETAIL3 13
- #define SEC_DETAIL4 14
- #define SEC_DETAIL5 15
- #define SEC_DETAIL6 16
- #define SEC_DETAIL7 17
- #define SEC_DETAIL8 18
- #define SEC_DETAIL9 19
- #define SEC_FTR_LVL9 20
- #define SEC_FTR_LVL8 21
- #define SEC_FTR_LVL7 22
- #define SEC_FTR_LVL6 23
- #define SEC_FTR_LVL5 24
- #define SEC_FTR_LVL4 25
- #define SEC_FTR_LVL3 26
- #define SEC_FTR_LVL2 27
- #define SEC_FTR_LVL1 28
- #define SEC_FTR_REP 29
- #define SEC_FTR_PAGE 30
-
- #define DEF_SEC_HEIGHT 400
- #define DEF_PARA_BREAK 13
-
- #define EXP_PARM 0
- #define EXP_FOOTER 1
- #define EXP_OTHER 2
-
- // Systems Fields
- #define SYS_PAGE 0
- #define SYS_DATE 1
- #define SYS_TIME 2
- #define SYS_REC_COUNT 3
- #define SYS_PARA_BREAK 4
- #define MAX_SYS_FIELDS 5
-
- // Operation Constants
- #define FIRST_OP 501
-
- #define OP_LPARAN 501
- #define OP_RPARAN 502
-
- #define OP_PLUS 503
- #define OP_MINUS 504
- #define OP_MULT 505
- #define OP_DIV 506
-
- #define OP_EQU 507
- #define OP_NOT_EQU 508
- #define OP_NOT_EQU2 509
- #define OP_GT 510
- #define OP_LT 511
- #define OP_GTE 512
- #define OP_LTE 513
-
- #define OP_OR 514
- #define OP_AND 515
- #define OP_NOT 516
-
- #define OP_PART 517
- #define OP_COMMA 518
-
- #define OP_TOT_OF 519
- #define OP_AVE_OF 520
- #define OP_MAX_OF 521
- #define OP_MIN_OF 522
- #define OP_COUNT_OF 523
-
- #define OP_IF 524
- #define OP_THEN 525
- #define OP_ELSE 526
-
- #define OP_LEN 527
- #define OP_UPPER 528
- #define OP_LOWER 529
- #define OP_TRIM 530
- #define OP_WORD 531
- #define OP_CHAR 532
- #define OP_MIN 533
- #define OP_MAX 534
- #define OP_INT 535
- #define OP_ROUND 536
- #define OP_ABS 537
- #define OP_WEEKDAY 538
- #define OP_DAY 539
- #define OP_MONTH 540
- #define OP_YEAR 541
- #define OP_FIRST_CHARS 542
- #define OP_LAST_CHARS 543
- #define OP_TEXT 544
- #define LAST_OP 544
- #define MAX_OPS LAST_OP-FIRST_OP+1
-
- #define FIRST_TEMP_FIELD 700
- #define LAST_TEMP_FIELD 725
- #define MAX_TEMP_FIELDS LAST_TEMP_FIELD-FIRST_TEMP_FIELD+1
-
-
- #define SYM_NOP 1000
- #define FLD_DUMMY 1001
- #define END_OF_EXP 1002
-
- #define SFLAG_PAGE_BEF 0x1
- #define SFLAG_PAGE_AFT 0x2
- #define SFLAG_REPRINT 0x4
- #define SFLAG_TRIM_BEFORE 0x8
- #define SFLAG_TRIM_AFTER 0x10
-
- #define REP_PAUSED 0
- #define REP_RESUMED 1
- #define REP_ABORT 2
-
- #define IN_INIT 0
- #define IN_RECORDS 1
- #define IN_TOTALS 2
- #define IN_EXIT 3
-
- // maximum screen objects
- #define MAX_ITEMS 300
-
- // Screen object types
- #define GROUP 0x0
- #define LABEL 0x10
- #define FIELD 0x20
- #define SECTION 0x40
- #define PICT 0x80
- #define LINE 0x100
-
- // Screen object flags
- #define OFLAG_FILL 0x2
- #define OFLAG_HLEFT 0x4
- #define OFLAG_HRIGHT 0x8
- #define OFLAG_HCENTER 0x10
- #define OFLAG_VTOP 0x20
- #define OFLAG_VCENTER 0x40
- #define OFLAG_VBOTTOM 0x80
- #define OFLAG_SELECT_TOGGLE 0x100
-
- // Screen object outline selection
- #define OUTLINE_LEFT 0x1
- #define OUTLINE_RIGHT 0x2
- #define OUTLINE_TOP 0x4
- #define OUTLINE_BOT 0x8
-
- // Cursor sizing tab constants
- #define TAB_NORTH 0
- #define TAB_SOUTH 1
- #define TAB_EAST 2
- #define TAB_WEST 3
- #define TAB_NW 4
- #define TAB_NE 5
- #define TAB_SW 6
- #define TAB_SE 7
-
- // cursor rectangle dimensions
- #define DEF_RECT_WIDTH 300
- #define DEF_RECT_HEIGHT 50
-
- // Pull tabs
- #define MAX_TABS 8
- #define TAB_WIDTH 16
- #define TAB_HEIGHT 16
-
- // Ruler type
- #define RULER_OFF 0
- #define RULER_INCH 1
- #define RULER_CM 2
-
- // ruler marker lengths
- #define RULER_MARK1_LEN 40
- #define RULER_MARK2_LEN 30
- #define RULER_MARK3_LEN 20
-
- // description window dimensions
- #define DESC_MARGIN 15
- #define DESC_WIDTH 600
- #define DESC_HEIGHT 70
-
- // Description window types
- #define DESC_EDIT 1
- #define DESC_STATIC 2
-
- // index of the Arrange pop menu
- #define MENU_ARRANGE 7
-
- // line angle types
- #define ANGLE_HORZ 0
- #define ANGLE_VERT 1
- #define ANGLE_FDIAG 2
- #define ANGLE_BDIAG 3
-
- // option rectangle ids
- #define OPT_LABEL 0
- #define OPT_DATA 1
- #define OPT_CALC 2
- #define OPT_SYS 3
- #define OPT_DLG 4
- #define OPT_LINE 5
- #define OPT_FIELD 6
- #define OPT_LABEL 0
-
- #define OPT_LBL_LABEL "Label"
- #define OPT_LBL_DATA "Data"
- #define OPT_LBL_CALC "Calc"
- #define OPT_LBL_SYS "System"
- #define OPT_LBL_DLG "Dialog"
- #define OPT_LBL_LINE "Line"
- #define OPT_LBL_FIELD "Fields"
-
- #define ResetUintFlag(flags,flag) ((UINT)(flags)&(~((UINT)(flag))))
-