home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c500 / 4.ddi / EDIT.WEX / EDIT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-28  |  2.8 KB  |  118 lines

  1. /*
  2.  *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3.  *%                                       %
  4.  *%    Copyright (C) 1991, by WATCOM Systems Inc. All rights reserved.    %
  5.  *%                                       %
  6.  *%     Permission is granted to anyone to use this example progam for       %
  7.  *%     any purpose on any computer system, subject to the following       %
  8.  *%    restrictions:                               %
  9.  *%                                       %
  10.  *%     1. This example is provided on an "as is" basis, without warranty. %
  11.  *%       You indemify, hold harmless and defend WATCOM from and against  %
  12.  *%       any claims or lawsuits, including attorney's, that arise or       %
  13.  *%       result from the use or distribution of the example.            %
  14.  *%                                       %
  15.  *%     2. You may not remove, alter or supress this notice from this       %
  16.  *%        example program or any modification thereof               %
  17.  *%                                       %
  18.  *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  19.  *
  20.  * EDIT.H
  21.  *
  22.  * definitions for the edit program
  23.  *
  24.  */
  25. #define MENU_ABOUT        1
  26. #define MENU_NEW        2
  27. #define MENU_OPEN        3
  28. #define MENU_SAVE        4
  29. #define MENU_SAVE_AS        5
  30. #define MENU_PRINT        6
  31. #define MENU_PRINT_SETUP    7
  32. #define MENU_CLEAR        8
  33. #define MENU_COPY        9
  34. #define MENU_CUT        10
  35. #define MENU_PASTE        11
  36. #define MENU_UNDO        12
  37. #define MENU_EXIT        13
  38. #define MENU_FONT_SELECT    14
  39.  
  40. #define    FONT_NAME        50
  41. #define    FONT_SIZE        51
  42. #define FONT_SAMPLE        52
  43.  
  44. #define EDIT_ID            100
  45. #define PRINT_TITLE        200
  46. #define PRINT_REST        201
  47.  
  48. #ifdef __WINDOWS_386__
  49. #define _EXPORT
  50. #define _FAR
  51. typedef void *ALLOCPTR;
  52. #define _strcmp    strcmp
  53. #define _memcpy    memcpy
  54. #define _strlen    strlen
  55. #else
  56. #define _EXPORT __export
  57. typedef void __far *ALLOCPTR;
  58. #define _FAR    __far
  59. #define _strcmp    _fstrcmp
  60. #define _strlen    _fstrlen
  61. #define _memcpy    _fmemcpy
  62. #endif
  63.  
  64.  
  65. #define EXTRA_DATA_OFFSET    0
  66. typedef struct {
  67. HWND     hwnd;        /* main window */
  68. HWND    editwnd;    /* edit window */
  69. HANDLE    inst;        /* instance handle */
  70. char    _FAR *filename;    /* current filename */
  71. BOOL    needs_saving;    /* indicates edit file has been saved */
  72. HFONT    font;
  73. } extra_data;
  74. typedef extra_data _FAR *LPEDATA;
  75.  
  76. typedef struct font_info {
  77. struct font_info _FAR *next;
  78. int    index;
  79. int    size_count;
  80. short    _FAR *sizes;
  81. char    name[32];
  82. char    charset;
  83. char    pitch_family;
  84. } font_info;
  85. typedef font_info _FAR *LPFINFO;
  86.  
  87.  
  88. typedef enum {
  89. PSUPP_NONE,
  90. PSUPP_CANPRINT,
  91. PSUPP_CANPRINTANDSET
  92. } psupp;
  93.  
  94. extern char EditTitle[];
  95. extern psupp PrinterSupport;
  96.  
  97. /*
  98.  * function prototypes
  99.  */
  100. /* efile.c */
  101. BOOL CheckFileSave( LPEDATA );
  102. BOOL FileSave( LPEDATA, BOOL );
  103. void FileEdit( LPEDATA, BOOL );
  104.  
  105. /* efont.c */
  106. void FontSelect( LPEDATA );
  107. void GetAllFonts( LPEDATA );
  108.  
  109. /* emem.c */
  110. ALLOCPTR MemAlloc( unsigned );
  111. ALLOCPTR MemRealloc( ALLOCPTR, unsigned );
  112. void MemFree( ALLOCPTR );
  113.  
  114. /* eprint.c */
  115. HDC PrinterDC( void );
  116. void GetPrinterSetup( HWND );
  117. BOOL Print( LPEDATA );
  118.