Changeset 123 for Include/api_gdi.sbp


Ignore:
Timestamp:
Mar 1, 2007, 12:31:13 AM (18 years ago)
Author:
イグトランス (egtra)
Message:

(拡張)メタファイル関数(全部)・構造体(一部)、BITMAPV4HEADERとそれに関連する型などの宣言

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/api_gdi.sbp

    r121 r123  
    99Const GDI_ERROR =     &HFFFFFFFF
    1010
     11TypeDef BCHAR = TBYTE
    1112
    1213Type _System_DeclareHandle_HPALETTE:unused As DWord:End Type
    1314TypeDef HPALETTE = *_System_DeclareHandle_HPALETTE
    14 
    1515
    1616' Point/Rectangle/Size struct
     
    3030    cx As Long
    3131    cy As Long
     32End Type
     33
     34' Metafile and EnhancedMetafile
     35Type EMR
     36    iType As DWord
     37    nSize As DWord
    3238End Type
    3339
     
    4349TypeDef PMETAHEADER = *METAHEADER
    4450
     51Type ENHMETAHEADER
     52    iType As DWord
     53    nSize As DWord
     54    rclBounds As RECT
     55    rclFrame As RECT
     56    dSignature As DWord
     57    nVersion As DWord
     58    nBytes As DWord
     59    nRecords As DWord
     60    nHandles As Word
     61    sReserved As Word
     62    nDescription As DWord
     63    offDescription As DWord
     64    nPalEntries As DWord
     65    szlDevice As SIZE
     66    szlMillimeters As SIZE
     67    cbPixelFormat As DWord
     68    offPixelFormat As DWord
     69    bOpenGL As DWord
     70'#if WINVER >= 0x0500
     71    'szlMicrometers As SIZE
     72'#endif
     73End Type
     74TypeDef PENHMETAHEADER = *ENHMETAHEADER
     75
     76Type HANDLETABLE
     77    objectHandle[ELM(1)] As HGDIOBJ
     78End Type
     79
     80Type METARECORD
     81    rdSize As DWord
     82    rdFunction As Word
     83    rdParm[ELM(1)] As Word
     84End Type
     85
     86Type ENHMETARECORD
     87    iType As DWord
     88    nSize As DWord
     89    dParm[ELM(1)] As DWord
     90End Type
     91
     92Type METAFILEPICT
     93    mm As Long
     94    xExt As Long
     95    yExt As Long
     96    hMF As HMETAFILE
     97End Type
     98
     99TypeDef ENHMFENUMPROC = *Function(hdc As HDC, ByRef HTable As HANDLETABLE, ByRef EMFR As ENHMETARECORD, nObj As Long, lpData As LPARAM) As Long
     100TypeDef MFENUMPROC = *Function(hdc As HDC, ByRef HTable As HANDLETABLE, ByRef MFR As METARECORD, nObj As Long, lpClientData As LPARAM)
     101
     102
     103' RGB Color
    45104Const RGB(r, g, b) = ((r) As Long) Or (((g) As Long) <<8) Or (((b) As Long) <<16)
     105Const PALETTERGB(r, g, b) = (&h02000000 Or RGB(r,g,b))
     106Const PALETTEINDEX(i) = ((&h01000000 Or (i) As Word As DWord) As COLORREF)
     107
    46108Const GetRValue(rgb) = (rgb And &hff)
    47109Const GetGValue(rgb) = ((rgb >> 8) And &hff)
     
    54116    rgbReserved As Byte
    55117End Type
     118
     119Type Align(1) RGBTRIPLE
     120    rgbtBlue As Byte
     121    rgbtGreen As Byte
     122    rgbtRed As Byte
     123End Type
     124
     125' CMYK Color
     126Const GetKValue(cmyk) = ((cmyk) As Byte)
     127Const GetYValue(cmyk) = (((cmyk) >> 8) As Byte)
     128Const GetMValue(cmyk) = (((cmyk) >> 16) As Byte)
     129Const GetCValue(cmyk) = (((cmyk) >> 24) As Byte)
     130
     131Const CMYK(c, m, y, k) = (( _
     132    ((k) As Byte) Or _
     133    ((y) As Byte As Word << 8) Or _
     134    ((m) As Byte As DWord << 16) Or _
     135    ((c) As Byte As DWord << 24)) As COLORREF)
     136
     137' ICM Color
     138TypeDef FXPT16DOT16 = Long
     139TypeDef FXPT2DOT30 = Long
     140
     141TypeDef LCSCSTYPE = Long
     142TypeDef LCSGAMUTMATCH = Long
     143
     144Type LOGCOLORSPACEA
     145    lcsSignature As DWord
     146    lcsVersion As DWord
     147    lcsSize As DWord
     148    lcsCSType As LCSCSTYPE
     149    lcsIntent As LCSGAMUTMATCH
     150    lcsEndpoints As CIEXYZTRIPLE
     151    lcsGammaRed As DWord
     152    lcsGammaGreen As DWord
     153    lcsGammaBlue As DWord
     154    lcsFilename[MAX_PATH] As SByte
     155End Type
     156Type LOGCOLORSPACEW
     157    lcsSignature As DWord
     158    lcsVersion As DWord
     159    lcsSize As DWord
     160    lcsCSType As LCSCSTYPE
     161    lcsIntent As LCSGAMUTMATCH
     162    lcsEndpoints As CIEXYZTRIPLE
     163    lcsGammaRed As DWord
     164    lcsGammaGreen As DWord
     165    lcsGammaBlue As DWord
     166    lcsFilename[ELM(MAX_PATH)] As WCHAR
     167End Type
     168#ifdef UNICODE
     169TypeDef LOGCOLORSPACE = LOGCOLORSPACEW
     170#else
     171TypeDef LOGCOLORSPACE = LOGCOLORSPACEA
     172#endif
     173
     174Type CIEXYZ
     175    ciexyzX As FXPT2DOT30
     176    ciexyzY As FXPT2DOT30
     177    ciexyzZ As FXPT2DOT30
     178End Type
     179
     180Type CIEXYZTRIPLE
     181    ciexyzRed As CIEXYZ
     182    ciexyzGreen As CIEXYZ
     183    ciexyzBlue As CIEXYZ
     184End Type
     185
    56186
    57187
     
    101231End Type
    102232
     233Type BITMAPCOREHEADER
     234    bcSize As DWord
     235    bcWidth As Word
     236    bcHeight As Word
     237    bcPlanes As Word
     238    bcBitCount As Word
     239End Type
     240
     241Type BITMAPCOREINFO
     242    bmciHeader As BITMAPCOREHEADER
     243    bmciColors[ELM(1)] As RGBTRIPLE
     244End Type
    103245
    104246' structures for defining DIBs
     
    109251Const BI_JPEG =      4
    110252Const BI_PNG =       5
     253
    111254Type BITMAPINFOHEADER
    112255    biSize As DWord
     
    122265    biClrImportant As DWord
    123266End Type
     267
    124268Type BITMAPINFO
    125269    bmiHeader As BITMAPINFOHEADER
    126     bmpColors[255] As RGBQUAD
     270    bmiColors[ELM(1)] As RGBQUAD '以前はbmpColors[255] As RGBQUADだったことに注意
    127271End Type
    128272
     
    137281End Type
    138282
     283Type BITMAPV4HEADER
     284    bV4Size As DWord
     285    bV4Width As Long
     286    bV4Height As Long
     287    bV4Planes As Word
     288    bV4BitCount As Word
     289    bV4V4Compression As DWord
     290    bV4SizeImage As DWord
     291    bV4XPelsPerMeter As Long
     292    bV4YPelsPerMeter As Long
     293    bV4ClrUsed As DWord
     294    bV4ClrImportant As DWord
     295    bV4RedMask As DWord
     296    bV4GreenMask As DWord
     297    bV4BlueMask As DWord
     298    bV4AlphaMask As DWord
     299    bV4CSType As DWord
     300    bV4Endpoints As CIEXYZTRIPLE
     301    bV4GammaRed As DWord
     302    bV4GammaGreen As DWord
     303    bV4GammaBlue As DWord
     304End Type
    139305
    140306' Region flags
     
    327493Declare Function CancelDC Lib "gdi32" (hdc As HDC) As BOOL
    328494Declare Function Chord Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long, nXRadial1 As Long, nYRadial1 As Long, nXRadial2 As Long, nYRadial2 As Long) As BOOL
     495Declare Function CloseEnhMetaFile Lib "gdi32" (hdc As HDC) As HENHMETAFILE
    329496Declare Function CloseFigure Lib "gdi32" (hdc As HDC) As BOOL
     497Declare Function CloseMetaFile Lib "gdi32" (hdc As HDC) As HMETAFILE
    330498
    331499Const RGN_AND =  1
     
    335503Const RGN_COPY = 5
    336504Declare Function CombineRgn Lib "gdi32" (hrgnDest As HRGN, hrgnSrc1 As HRGN, hrgnSrc2 As HRGN, fnCombineMode As Long) As Long
    337 
     505Declare Function CopyEnhMetaFile Lib "gdi32" Alias "CopyEnhMetaFileA" (hemfSrc As HENHMETAFILE, pszFile As PCSTR) As HENHMETAFILE
     506Declare Function CopyMetaFile Lib "gdi32" Alias "CopyMetaFileA" (hmfSrc As HMETAFILE, pszFile As PCSTR) As HMETAFILE
    338507Declare Function CreateBitmap Lib "gdi32" (nWidth As Long, nHeight As Long, cPlanes As Long, cBitsPerPel As Long, lpvBits As VoidPtr) As HBITMAP
    339508Declare Function CreateBitmapIndirect Lib "gdi32" (ByRef lpbm As BITMAP) As HBITMAP
     
    376545Declare Function CreateEllipticRgn Lib "gdi32" (nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As HRGN
    377546Declare Function CreateEllipticRgnIndirect Lib "gdi32" (ByRef lpRect As RECT) As HRGN
     547Declare Function CreateEnhMetaFile Lib "gdi32" Alias "CreateEnhMetaFileA" (hdcRef As HDC, pFileName As PCTSTR, ByRef Rect As RECT, pDescription As PCTSTR) As HDC
     548Declare Function CreateMetaFile Lib "gdi32" Alias "CreateMetaFileA" (pFileName As PCTSTR) As HDC
    378549
    379550Const FW_DONTCARE =       0
     
    518689Declare Function CreateSolidBrush Lib "gdi32" (crColor As COLORREF) As HBRUSH
    519690Declare Function DeleteDC Lib "gdi32" (hdc As HDC) As BOOL
     691Declare Function DeleteEnhMetaFile Lib "gdi32" (hemf As HENHMETAFILE) As BOOL
     692Declare Function DeleteMetaFile Lib "gdi32" (hmf As HMETAFILE) As BOOL
    520693Declare Function DeleteObject Lib "gdi32" (hObject As HANDLE) As BOOL
    521694Declare Function DPtoLP Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, nCount As Long) As BOOL
     
    524697Declare Function EndPage Lib "gdi32" (hdc As HDC) As Long
    525698Declare Function EndPath Lib "gdi32" (hdc As HDC) As BOOL
     699Declare Function EnumEnhMetaFile Lib "gdi32" (hdc As HDC, hemf As HENHMETAFILE, pEnhMetaFunc As ENHMFENUMPROC, pData As VoidPtr, ByRef Rect As RECT) As BOOL
     700Declare Function EnumMetaFile Lib "gdi32" (hdc As HDC, hmf As HMETAFILE, pMetaFunc As MFENUMPROC, lParam As LPARAM) As BOOL
    526701Declare Function EqualRgn Lib "gdi32" (hSrcRgn1 As HRGN, hSrcRgn2 As HRGN) As BOOL
    527702Declare Function ExcludeClipRect Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
     
    552727Declare Function FillRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, hBrush As HBRUSH) As Long
    553728Declare Function FrameRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, hBrush As HBRUSH, nWidth As Long, nHeight As Long) As Long
    554 Declare Function GetBitmapBits Lib "gdi32" (hbmp As HBITMAP,  cbBuffer As Long, lpvBits As VoidPtr) As Long
     729Declare Function GdiComment Lib "gdi32" (hdc As HDC, cbSize As DWord, lpData As *Byte) As BOOL
     730Declare Function GetBitmapBits Lib "gdi32" (hbmp As HBITMAP, cbBuffer As Long, lpvBits As VoidPtr) As Long
    555731Declare Function GetBkColor Lib "gdi32" (hdc As HDC) As DWord
    556732Declare Function GetBkMode Lib "gdi32" (hdc As HDC) As Long
     
    682858
    683859Declare Function GetDIBits Lib "gdi32" (hdc As HDC, hbmp As HBITMAP, uStartScan As DWord, cScanLines As DWord, lpvBits As VoidPtr, ByRef lpbi As BITMAPINFO, uUsage As DWord) As Long
     860Declare Function GetEnhMetaFile Lib "gdi32" Alias "GetEnhMetaFileA" (pszMetaFile As PCSTR) As HENHMETAFILE
     861Declare Function GetEnhMetaFileBits Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, pbBuffer As *Byte) As DWord
     862Declare Function GetEnhMetaFileDescription Lib "gdi32" Alias "GetEnhMetaFileDescriptionA" (hemf As HENHMETAFILE, cbBuffer As DWord, pszDescription As PTSTR) As DWord
     863Declare Function GetEnhMetaFileHeader Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, ByRef emh As ENHMETAHEADER) As DWord
     864Declare Function GetEnhMetaFilePaletteEntries Lib "gdi32" (hemf As HENHMETAFILE, cEntries As DWord, ByRef pe As PALETTEENTRY) As DWord
    684865
    685866Const MM_TEXT =           1
     
    692873Const MM_ANISOTROPIC =    8
    693874Declare Function GetMapMode Lib "gdi32" (hdc As HDC) As Long
    694 
     875Declare Function GetMetaFileBitsEx Lib "gdi32" (hmf As HMETAFILE, nSize As DWord, pvData As VoidPtr) As DWord
    695876Declare Function GetMiterLimit Lib "gdi32" (hdc As HDC, peLimit As SinglePtr) As Long
    696877Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (hgdiobj As HANDLE, cbBuffer As Long, ByRef lpvObject As Any) As Long
     
    781962Declare Function GetWindowExtEx Lib "gdi32" (hdc As HDC, ByRef lpSize As SIZE) As Long
    782963Declare Function GetWindowOrgEx Lib "gdi32" (hdc As HDC, ByRef lpPoint As POINTAPI) As Long
     964Declare Function GetWinMetaFileBits Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, pbBuffer As *Byte, fnMapMode As Long, hdcRef As HDC) As DWord
    783965Declare Function IntersectClipRect Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
    784966Declare Function InvertRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
     
    794976Declare Function PathToRegion Lib "gdi32" (hdc As HDC) As HRGN
    795977Declare Function Pie Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long, nXRadial1 As Long, nYRadial1 As Long, nXRadial2 As Long, nYRadial2 As Long) As Long
     978Declare Function PlayEnhMetaFile Lib "gdi32" (hdc As HDC, hemf As HENHMETAFILE, ByRef Rect As RECT) As Long
     979Declare Function PlayEnhMetaFileRecord Lib "gdi32" (hdc As HDC, ByRef Handletable As HANDLETABLE, ByRef EnhMetaRecord As ENHMETARECORD, nHandles As DWord) As BOOL
     980Declare Function PlayMetaFile Lib "gdi32" (hdc As HDC, hmf As HMETAFILE) As BOOL
     981Declare Function PlayMetaFileRecord Lib "gdi32" (hdc As HDC, ByRef Handletable As HANDLETABLE, ByRef MetaRecord As METARECORD, nHandles As DWord) As BOOL
    796982Declare Function PlgBlt Lib "gdi32" (hdcDest As HDC, ByRef lpPoint As POINTAPI, hdcSrc As HDC, nXSrc As Long, nYSrc As Long, nWidth As Long, nHeight As Long, hbmMask As HBITMAP, xMask As Long, yMask As Long) As Long
    797983Declare Function PolyBezier Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
     
    8241010Declare Function SetBrushOrgEx Lib "gdi32" (hdc As HDC, nXOrg As Long, nYOrg As Long, ByRef lppt As POINTAPI) As Long
    8251011Declare Function SetDIBits Lib "gdi32" (hdc As HDC, hbmp As HBITMAP, uStartScan As DWord, cScanLines As DWord, lpvBits As VoidPtr, ByRef lpbmi As BITMAPINFO, fuColorUse As DWord) As Long
     1012Declare Function SetEnhMetaFileBits Lib "gdi32" (cbBuffer As DWord, pData As *Byte) As HENHMETAFILE
    8261013Declare Function SetMapMode Lib "gdi32" (hdc As HDC, fnMapMode As Long) As Long
     1014Declare Function SetMetaFileBitsEx Lib "gdi32" (nSize As DWord, pData As *Byte) As HMETAFILE
    8271015Declare Function SetMiterLimit Lib "gdi32" (hdc As HDC, eNewLimit As Single, peOldLimit As SinglePtr) As Long
    8281016Declare Function SetPixel Lib "gdi32" (hdc As HDC, x As Long, y As Long, crColor As DWord) As DWord
     
    8471035Declare Function SetWindowExtEx Lib "gdi32" (hdc As HDC, nXExtent As Long, nYExtent As Long, ByRef lpSize As SIZE) As Long
    8481036Declare Function SetWindowOrgEx Lib "gdi32" (hdc As HDC, x As Long, y As Long, ByRef lpPoint As POINTAPI) As Long
     1037Declare Function SetWinMetaFileBits Lib "gdi32" (cbBuffer As DWord, pbBuffer As *Byte, hdcRef As HDC, ByRef mfp As METAFILEPICT) As HENHMETAFILE
    8491038Declare Function StartDoc Lib "gdi32" Alias "StartDocA" (hdc As HDC, ByRef ref_di As DOCINFO) As Long
    8501039Declare Function StartPage Lib "gdi32" (hdc As HDC) As Long
Note: See TracChangeset for help on using the changeset viewer.