Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

155 lines
5.6 KiB

  1. /****************************************************************************
  2. Metafile Import Filter; Interface
  3. *****************************************************************************
  4. This file contains the interface for the QuickDraw import filter
  5. that reads Mac pictures from disk and/or memory. In addition to the
  6. Aldus filter interface, it also supports a parameterized interface
  7. for Microsoft applications to control some conversion results.
  8. ****************************************************************************/
  9. /*--- Aldus-defined file access block ---*/
  10. typedef DWORD FILETYPE;
  11. typedef struct
  12. {
  13. unsigned slippery : 1; /* TRUE if file may disappear. */
  14. unsigned write : 1; /* TRUE if open for write. */
  15. unsigned unnamed : 1; /* TRUE if unnamed. */
  16. unsigned linked : 1; /* Linked to an FS FCB. */
  17. unsigned mark : 1; /* Generic mark bit. */
  18. FILETYPE fType; /* The file type. */
  19. #define IBMFNSIZE 124
  20. short handle; /* MS-DOS open file handle. */
  21. char fullName[IBMFNSIZE]; /* Device, path, file names. */
  22. DWORD filePos; /* Our current file posn. */
  23. } FILESPEC, FAR *LPFILESPEC;
  24. /*--- Preferences memory block ---*/
  25. typedef struct // "old" version 1 USERPREFS
  26. {
  27. char signature[6];
  28. WORD version;
  29. LPSTR sourceFilename;
  30. HANDLE sourceHandle;
  31. LPSTR destinationFilename;
  32. BYTE penPatternAction;
  33. BYTE nonSquarePenAction;
  34. BYTE penModeAction;
  35. BYTE textModeAction;
  36. BYTE charLock;
  37. BYTE nonRectRegionAction;
  38. BOOL PICTinComment;
  39. BOOL optimizePP;
  40. WORD lineClipWidthThreshold;
  41. WORD reserved[6];
  42. } USERPREFS_V1, FAR *LPUSERPREFS_V1;
  43. typedef struct // current version 3 USERPREFS
  44. {
  45. char signature[6];
  46. WORD version;
  47. WORD size;
  48. LPSTR sourceFilename;
  49. HANDLE sourceHandle;
  50. LPSTR destinationFilename;
  51. BYTE penPatternAction;
  52. BYTE nonSquarePenAction;
  53. BYTE penModeAction;
  54. BYTE textModeAction;
  55. BYTE nonRectRegionAction;
  56. BOOL optimizePP;
  57. BYTE noRLE; // new (split out from reserved[0] of version 2)
  58. BYTE reservedByte; // rest of first reserved word
  59. WORD reserved[5];
  60. } USERPREFS, FAR * LPUSERPREFS;
  61. /*********************** Exported Function Definitions **********************/
  62. #ifdef WIN32
  63. int WINAPI GetFilterInfo( short PM_Version, LPSTR lpIni,
  64. HANDLE FAR * lphPrefMem,
  65. HANDLE FAR * lphFileTypes );
  66. #else
  67. int FAR PASCAL GetFilterInfo( short PM_Version, LPSTR lpIni,
  68. HANDLE FAR * lphPrefMem,
  69. HANDLE FAR * lphFileTypes );
  70. #endif
  71. /* Returns information about this filter.
  72. Input parameters are PM_Version which is the filter interface version#
  73. and lpIni which is a copy of the win.ini entry
  74. Output parameters are lphPrefMem which is a handle to moveable global
  75. memory which will be allocated and initialized.
  76. lphFileTypes is a structure that contains the file types
  77. that this filter can import. (For MAC only)
  78. This routine should be called once, just before the filter is to be used
  79. the first time. */
  80. #ifdef WIN32
  81. void WINAPI GetFilterPref( HANDLE hInst, HANDLE hWnd, HANDLE hPrefMem, WORD wFlags );
  82. #else
  83. void FAR PASCAL GetFilterPref( HANDLE hInst, HANDLE hWnd, HANDLE hPrefMem, WORD wFlags );
  84. #endif
  85. /* Input parameters are hInst (in order to access resources), hWnd (to
  86. allow the DLL to display a dialog box), and hPrefMem (memory allocated
  87. in the GetFilterInfo() entry point). WFlags is currently unused, but
  88. should be set to 1 for Aldus' compatability */
  89. #ifdef WIN32
  90. short WINAPI ImportGR( HDC hdcPrint, LPFILESPEC lpFileSpec,
  91. PICTINFO FAR * lpPict, HANDLE hPrefMem );
  92. #else
  93. short FAR PASCAL ImportGR( HDC hdcPrint, LPFILESPEC lpFileSpec,
  94. PICTINFO FAR * lpPict, HANDLE hPrefMem );
  95. #endif
  96. /* Import the metafile in the file indicated by the lpFileSpec. The
  97. metafile generated will be returned in lpPict. */
  98. #ifdef WIN32
  99. short WINAPI ImportEmbeddedGr( HDC hdcPrint, LPFILESPEC lpFileSpec,
  100. PICTINFO FAR * lpPict, HANDLE hPrefMem,
  101. DWORD dwSize, LPSTR lpMetafileName );
  102. #else
  103. short FAR PASCAL ImportEmbeddedGr( HDC hdcPrint, LPFILESPEC lpFileSpec,
  104. PICTINFO FAR * lpPict, HANDLE hPrefMem,
  105. DWORD dwSize, LPSTR lpMetafileName );
  106. #endif
  107. /* Import the metafile in using the previously opened file handle in
  108. the structure field lpFileSpec->handle. Reading begins at offset
  109. lpFileSpect->filePos, and the convertor will NOT expect to find the
  110. 512 byte PICT header. The metafile generated will be returned in
  111. lpPict and can be specified via lpMetafileName (NIL = memory metafile,
  112. otherwise, fully qualified filename. */
  113. #ifdef WIN32
  114. short WINAPI QD2GDI( LPUSERPREFS lpPrefMem, PICTINFO FAR * lpPict );
  115. #else
  116. short FAR PASCAL QD2GDI( LPUSERPREFS lpPrefMem, PICTINFO FAR * lpPict );
  117. #endif
  118. /* Import the metafile as specified using the parameters supplied in the
  119. lpPrefMem. The metafile will be returned in lpPict. */
  120. #ifdef WIN32
  121. BOOL LibMain( HINSTANCE hInst, DWORD fdwReason, LPVOID lpvReserved);
  122. #else
  123. int FAR PASCAL LibMain( HANDLE hInst, WORD wDataSeg, WORD cbHeap,
  124. LPSTR lpszCmdline );
  125. #endif
  126. /* Needed to get an instance handle */
  127. #ifdef WIN32
  128. int WINAPI WEP( int nParameter );
  129. #else
  130. int FAR PASCAL WEP( int nParameter );
  131. #endif