home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / gfx / superview-lib-9.12.lha / SuperView-Lib / Programmers / PCQ-Pascal / include / SV / superview / superview.i next >
Text File  |  1994-12-28  |  13KB  |  371 lines

  1. {  superview/superview.i            }
  2. {  Version    : 7.1                 }
  3. {  Date       : 16.07.1994          }
  4. {  Written by : Andreas R. Kleinert }
  5. {  PCQ - Konvertierung by Andreas Neumann }
  6.  
  7.  
  8. {  *************************************************** }
  9. {  *                                                 * }
  10. {  * Version Defines                                 * }
  11. {  *                                                 * }
  12. {  *************************************************** }
  13.  
  14. CONST
  15.     SVLIB_VERSION   =   7;
  16.  
  17.  
  18. {  *************************************************** }
  19. {  *                                                 * }
  20. {  * Includes                                        * }
  21. {  *                                                 * }
  22. {  *************************************************** }
  23.  
  24. { PCQ : für OS_VER }
  25. {$I "Include:exec/Execbase.i"}
  26.  
  27. {$I "Include:libraries/dos.i" }
  28.  
  29. {$I "Include:Utils/Stringlib.i" }
  30.  
  31. {$I "Include:sv/SuperView/SVInfo.i" }
  32.  
  33.  
  34. {  *************************************************** }
  35. {  *                                                 * }
  36. {  * Custom Defines                                  * }
  37. {  *                                                 * }
  38. {  *************************************************** }
  39.  
  40.  
  41. CONST
  42.     N   =   NIL;
  43.  
  44.  
  45. {  *************************************************** }
  46. {  *                                                 * }
  47. {  * MACROs for Version-Tests                        * }
  48. {  *                                                 * }
  49. {  *************************************************** }
  50.  
  51.  
  52. FUNCTION LibVer (x : LibraryPtr) : Short;
  53.  
  54. BEGIN
  55.  LibVer:=x^.lib_version;
  56. END;
  57.  
  58. FUNCTION OS_VER : Short;
  59.  
  60. VAR EBase   :   ExecBasePtr;
  61.  
  62. FUNCTION GetEBase : Address;
  63.  
  64. BEGIN
  65. {$A
  66.         move.l  $4,d0
  67. }
  68. END;
  69.  
  70. BEGIN
  71.  EBase:=GetEBase;
  72.  IF EBase<>NIL THEN
  73.   OS_VER:=LibVer (Adr(EBase^.LibNode));
  74. END;
  75.  
  76.  
  77. {  *************************************************** }
  78. {  *                                                 * }
  79. {  * DEFINES                                         * }
  80. {  *                                                 * }
  81. {  *************************************************** }
  82.  
  83.  
  84. {  Possible FileTypes }
  85.  
  86. CONST
  87.     SV_FILETYPE_NONE    :   INTEGER = 0;
  88.     SV_FILETYPE_UNKNOWN :   INTEGER = SV_FILETYPE_NONE;
  89.     SV_FILETYPE_ILLEGAL :   INTEGER = $FFFFFFFF;
  90.  
  91.     SV_FILETYPE_ILBM    :   INTEGER =   1;      { IFF-ILBM, any derivat }
  92.     SV_FILETYPE_ACBM    :   INTEGER =   2;      { IFF-ACBM, any derivat }
  93.     SV_FILETYPE_DATATYPE :  INTEGER =   3;      { V39-Datatype-Object   }
  94.  
  95.     {
  96.         up to here  : Constant codes for IFF-ILBM, IFF-ACBM and DataTypes
  97.                       (constant for compatibility reasons).
  98.         above these : External, user defined FileSubTypes
  99.                       (defined EACH TIME NEW at Library's startup-time).
  100.     }
  101.  
  102.  
  103. {  Possible SubTypes of FileTypes }
  104.  
  105.     SV_SUBTYPE_NONE     :   INTEGER =   0;
  106.     SV_SUBTYPE_UNKNOWN  :   INTEGER =   SV_SUBTYPE_NONE;
  107.     SV_SUBTYPE_ILLEGAL  :   INTEGER =   $FFFFFFFF;
  108.  
  109.     SV_SUBTYPE_ILBM     :   INTEGER =   1;      { Is IFF-ILBM              }
  110.     SV_SUBTYPE_ILBM_01  :   INTEGER =   2;      { Is IFF-ILBM, CmpByteRun1 }
  111.     SV_SUBTYPE_ACBM     :   INTEGER =   3;      { Is IFF-ACBM              }
  112.     SV_SUBTYPE_DATATYPE :   INTEGER =   4;      { Is V39-DataType-Object   }
  113.  
  114.     {
  115.         up to here  : Constant codes for IFF-ILBM, IFF-ACBM and DataTypes
  116.                       (constant for compatibility reasons).
  117.         above these : External, user defined FileSubTypes
  118.                       (defined EACH TIME NEW at Library's startup-time).
  119.     }
  120.  
  121.  
  122. { Possible Input and Output mediums }
  123.  
  124.     AKO_MEDIUM_NONE     :   INTEGER =   0;          { means : DEFAULT       }
  125.     AKO_MEDIUM_ILLEGAL  :   INTEGER =   $FFFFFFFF;
  126.  
  127.     AKO_MEDIUM_DISK     :   INTEGER =   1;          { Read and Write media  }
  128.     AKO_MEDIUM_CLIP     :   INTEGER =   2;
  129.  
  130.     { not any medium might be supported by any SVObject }
  131.  
  132.  
  133. {  *************************************************** }
  134. {  *                                                 * }
  135. {  * Function Error Codes                            * }
  136. {  *                                                 * }
  137. {  *************************************************** }
  138.  
  139.     SVERR_MAX_ERROR_TEXT_LENGTH :   INTEGER =   80;     { plus Null-Byte }
  140.  
  141.     SVERR_NO_ERROR              :   INTEGER =   0;
  142.     SVERR_INTERNAL_ERROR        :   INTEGER =   $FFFFFFFF;
  143.  
  144.     SVERR_UNKNOWN_FILE_FORMAT   :   INTEGER =   1;
  145.     SVERR_FILE_NOT_FOUND        :   INTEGER =   2;
  146.     SVERR_NO_MEMORY             :   INTEGER =   3;
  147.     SVERR_IFFPARSE_ERROR        :   INTEGER =   4;
  148.     SVERR_NO_CLIPBOARD          :   INTEGER =   5;
  149.     SVERR_NO_SCREEN             :   INTEGER =   6;
  150.     SVERR_NO_FILE               :   INTEGER =   7;
  151.     SVERR_NO_HANDLE             :   INTEGER =   8;
  152.     SVERR_NO_DATA               :   INTEGER =   9;
  153.     SVERR_GOT_NO_WINDOW         :   INTEGER =   10;
  154.     SVERR_GOT_NO_SCREEN         :   INTEGER =   11;
  155.     SVERR_NO_INFORMATION        :   INTEGER =   12;
  156.     SVERR_ILLEGAL_ACCESS        :   INTEGER =   13;
  157.     SVERR_DECODE_ERROR          :   INTEGER =   14;
  158.     SVERR_UNKNOWN_PARAMETERS    :   INTEGER =   15;
  159.     SVERR_ACTION_NOT_SUPPORTED  :   INTEGER =   16;
  160.     SVERR_VERSION_CONFLICT      :   INTEGER =   17;
  161.     SVERR_NO_DRIVER_AVAILABLE   :   INTEGER =   18;
  162.  
  163.         {  Each new Library-Subversion may contain new Codes above
  164.            the last one of these.
  165.            So do not interpret the codes directly, but use
  166.            SVL_GetErrorString().
  167.            Maybe, newer Codes will not be listed up here.
  168.         }
  169.  
  170. TYPE
  171.     SV_GfxBuffer    =   RECORD
  172.  {  All pointers (e.g. svgfx_Buffer) have to be and are AllocVec()'ed.
  173.  
  174.     If you did not allocate SV_GfxBuffers by yourself, you must
  175.     neither free them nor do write-accesses to them.
  176.  
  177.     If you allocated them by yourself, you also have to free them
  178.     by yourself - if no one else is still accessing them.
  179.  }
  180.  
  181.         svgfx_Version   :   INTEGER;        { structure version, see below  }
  182.  
  183.         svgfx_BufferType :  INTEGER;        { Data organization, see below  }
  184.  
  185.         svgfx_Width     :   INTEGER;        { Graphic's Width               }
  186.         svgfx_Height    :   INTEGER;        { Graphic's Height              }
  187.         svgfx_ColorDepth :  INTEGER;        { Graphic's ColorDepth          }
  188.         svgfx_ViewMode32 :  INTEGER;        { if NULL, best ScreenMode is
  189.                                               suggested
  190.                                               (results in LowRes, if not
  191.                                               changed).                     }
  192.  
  193.         svgfx_Colors    :   ARRAY [1..256] OF ARRAY [1..3] OF BYTE; { For ColorDepth <= 8 : 3-Byte RGB entries  }
  194.  
  195. {
  196. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  197. begin of "case-dependent" entries
  198. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  199.  
  200.     ONLY if svgfx_BufferType == SVGFX_BUFFERTYPE_BITPLANE, else NULL.
  201.  
  202.     svgfx_BytesPerLine :
  203.  
  204.        size of one row
  205.        of a plane in Bytes
  206.      = Bytes per Row            : (( [width] +7)>>3)
  207.        Number of Rows per Plane : [height]
  208.        Number of Planes         : [depth]
  209.  
  210.  }
  211.  
  212.     svgfx_BytesPerLine  :   INTEGER; { see above }
  213.     svgfx_PixelBits     :   INTEGER; { see below }
  214.  
  215. {
  216.     ONLY if svgfx_BufferType == SVGFX_BUFFERTYPE_ONEPLANE, else NULL.
  217.  
  218.     svgfx_PixelBits    :
  219.  
  220.        Bits Per Pixel
  221.        (8, 16, 24, ...)
  222.     => Bytes per Row            : (svgfx_PixelBits>>3) * [width]
  223.        Number of Rows per Plane : [height]
  224.        Number of Planes         : ONE
  225.  
  226. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  227. end of "case-dependent" entries
  228. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  229.  }
  230.  
  231.  
  232.     svgfx_Buffer    :   ADDRESS; { any kind of memory (no chip ram needed)  }
  233.     svgfx_BufferSize :  INTEGER; { if you want to copy it ...               }
  234.  
  235.  
  236.  { size of structure may grow in future versions : Check svgfx_Version ! }
  237.  
  238.                         END;
  239.    SV_GfxBufferPtr = ^SV_GfxBuffer;
  240.  
  241.  
  242. CONST
  243.     SVGFX_VERSION   =   1;
  244.  
  245.     SVGFX_BUFFERTYPE_BITPLANE   =   1;  { Amiga-like BitPlanes          }
  246.     SVGFX_BUFFERTYPE_ONEPLANE   =   2;  { single Byte-/Word-/24 Bit-Plane }
  247.  
  248. {  there may be more types in the future }
  249. {  (at