home *** CD-ROM | disk | FTP | other *** search
/ BUG 15 / BUGCD1998_06.ISO / aplic / felixcad / fcaddata.z / FDT_HOOK.H < prev    next >
C/C++ Source or Header  |  1997-11-13  |  4KB  |  120 lines

  1. /****************************************************************************
  2.                 (C) FELIX Computer Aided Technologies GmbH 1995-96
  3.  
  4. Module:         Hook functions: data types, structures and functions
  5. File:           fdt_hook.h
  6. Author:         R. Nuernberger
  7. Created:        Oct. 18, 1994
  8. Changed:
  9. ****************************************************************************/
  10.  
  11. /* Data types / Prototypes for FDT */
  12.  
  13. /* Byte Alignment 2 */
  14. #pragma pack(2)
  15.  
  16. #ifdef _WIN32
  17. #define FDT_DLLEXPORT __declspec(dllexport)
  18. #define EXPORT
  19. #else
  20. #define FDT_DLLEXPORT
  21. #define EXPORT        __far __pascal __export
  22. #endif
  23.  
  24. typedef struct fdt_Vport_Ext_Info_Tag {
  25.  HWND       hWnd;                 /* Window Handle */
  26.  HDC        hDc;                  /* Device Context Handle of the window */
  27.  fdt_matrix MatWcsToVcs;          /* Transformation matrix WCS to VCS */
  28.  fdt_matrix MatVcsToWcs;          /* Transformation matrix VCS to WCS */
  29.  fdt_point  VportMin;             /* min. X- and Y-Koordinate of the VPORT */
  30.  fdt_point  VportMax;             /* max. X- and Y-Koordinate of the VPORT */
  31.  int        WinWidth;             /* Width of the window in Pixel */
  32.  int        WinHeight;            /* Height of the window in Pixel */
  33.  HPALETTE   hPalette;             /* Handle color palette (for 256 colors only, otherwise NULL) */
  34. } fdt_VPORT_EXT_INFO;
  35.  
  36. /* Reason parameters for Redraw-Hook-Function */
  37. #define RH_REGEN_VPORT   0
  38. #define RH_REDRAW_VPORT  1
  39. #define RH_CLOSE_VPORT   2
  40. #define RH_OPEN_VPORT    3
  41. #define RH_REGEN_VWPENT  4
  42. #define RH_REDRAW_VWPENT 5
  43. #define RH_HIDE_VWPENT   6
  44.  
  45. /* Data type defintions for the print data structure PRINTREC */
  46. #define PR_REQ_INIT     0
  47. #define PR_REQ_POINT    1
  48. #define PR_REQ_LINE     2
  49. #define PR_REQ_AREA     3
  50. #define PR_REQ_END      4
  51. #define PR_REQ_VIEWPENT 5
  52.  
  53. /* Data type defintions for angels of rotation on printing */
  54. #define PR_ROT_0        0
  55. #define PR_ROT_90       1
  56. #define PR_ROT_180      2
  57. #define PR_ROT_270      3
  58.  
  59. #ifndef FDT_KERNEL
  60.  
  61. /* Data types for printing (in device units) */
  62.  
  63. typedef struct P_POINT{     // Pixel point
  64.     POINT   Pnt;
  65. }P_POINT;
  66.  
  67. typedef struct P_LINE{      // Line
  68.     POINT   Pnt1;
  69.     POINT   Pnt2;
  70. }P_LINE;
  71.  
  72. typedef struct P_FILL_AREA{ // Filled area
  73.     short   nPnts;
  74.     POINT   *Pnts;
  75. }P_FILL_AREA;
  76.  
  77. typedef struct {          // Data structure for Print-Callback-Function
  78.     char         Type;    // Data type
  79.     short        nColor;  // FCAD color index
  80.     union {
  81.     P_LINE       Line;
  82.     P_POINT      Point;
  83.     P_FILL_AREA  FillArea;
  84.     } Data;
  85. }PRINTREC;
  86.  
  87. #endif
  88.  
  89. typedef struct fdt_Print_Ext_Info_Tag{
  90.     fdt_real        LowLeCorn[2];      // Lower left corner of area to be printed (in VCS)
  91.     fdt_real        UppRiCorn[2];      // Upper right corner of area to be printed (in VCS)
  92.     short           DevWidth;          // Width of the print area in device units
  93.     short           DevHeight;         // Height of the print area in device units
  94. }PRINT_EXT_INFO;
  95.  
  96. #ifdef _WIN32
  97. FDT_DLLEXPORT typedef int (WINAPI * PRINTHOOKPROC)(PRINTREC *);
  98. FDT_DLLEXPORT typedef int (WINAPI * REDRAWHOOKPROC)(short, short, short, short);
  99. #else
  100. typedef int (EXPORT * PRINTHOOKPROC)(PRINTREC *);
  101. typedef int (EXPORT * REDRAWHOOKPROC)(short, short, short, short);
  102. #endif
  103.  
  104. FDT_DLLEXPORT int    EXPORT fdt_SetRedrawHook(REDRAWHOOKPROC);
  105. FDT_DLLEXPORT void   EXPORT fdt_DelRedrawHook(void);  
  106. FDT_DLLEXPORT int    EXPORT fdt_GetVportExtInfo(short, short, fdt_VPORT_EXT_INFO *);
  107.  
  108. FDT_DLLEXPORT short  EXPORT fdt_SetPrintHook(PRINTHOOKPROC PrintHook);
  109. FDT_DLLEXPORT void   EXPORT fdt_DelPrintHook(void);
  110. FDT_DLLEXPORT int    EXPORT fdt_CallPrintCallBack(PRINTREC * PrintRec);
  111. FDT_DLLEXPORT int    EXPORT fdt_GetPrintExtInfo(PRINT_EXT_INFO *PrintExtInfo);
  112.  
  113. FDT_DLLEXPORT int    EXPORT fdt_Vcs2PrinterPnt(fdt_real, fdt_real, int *, int *);
  114. FDT_DLLEXPORT int    EXPORT fdt_GetLastViewportEntId(void);
  115.  
  116. /* Reset Byte Alignment 2 */
  117. #pragma pack()
  118.  
  119. /* end of file */
  120.