' ########################################################################################
' Microsoft Windows
' File: IImgCtx.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_IImgCtx_PBI)
#DEFINE PBX_IImgCtx_PBI
%EQUATE `IIMGCTX_INC = 1
#INCLUDE ONCE "Core/Windows.inc"
$CLSID_IImgCtx = GUID$("{3050F3D6-98B5-11CF-BB82-00AA00BDCE0B}")
$IID_IImgCtx = GUID$("{3050F3D7-98B5-11CF-BB82-00AA00BDCE0B}")
%EQUATE `IMGCHG_SIZE = &H0001
%EQUATE `IMGCHG_VIEW = &H0002
%EQUATE `IMGCHG_COMPLETE = &H0004
%EQUATE `IMGCHG_ANIMATE = &H0008
%EQUATE `IMGCHG_MASK = &H000F
%EQUATE `IMGLOAD_NOTLOADED = &H00100000 ' // Image has not yet been loaded
%EQUATE `IMGLOAD_LOADING = &H00200000 ' // Image in the process of being loaded
%EQUATE `IMGLOAD_STOPPED = &H00400000 ' // Imaged aborted
%EQUATE `IMGLOAD_ERROR = &H00800000 ' // Error loading image
%EQUATE `IMGLOAD_COMPLETE = &H01000000 ' // Image loaded
%EQUATE `IMGLOAD_MASK = &H01F00000
%EQUATE `IMGBITS_NONE = &H02000000
%EQUATE `IMGBITS_PARTIAL = &H04000000
%EQUATE `IMGBITS_TOTAL = &H08000000
%EQUATE `IMGBITS_MASK = &H0E000000
%EQUATE `IMGANIM_ANIMATED = &H10000000
%EQUATE `IMGANIM_MASK = &H10000000
%EQUATE `IMGTRANS_OPAQUE = &H20000000
%EQUATE `IMGTRANS_MASK = &H20000000
%EQUATE `DWN_COLORMODE = &H0000003F ' // Explicit color mode requested
%EQUATE `DWN_DOWNLOADONLY = &H00000040 ' // Download data only, don't decode
%EQUATE `DWN_FORCEDITHER = &H00000080 ' // Override automatic dithering
%EQUATE `DWN_RAWIMAGE = &H00000100 ' // Disable dithering
%EQUATE `DWN_MIRRORIMAGE = &H00000200 ' // Mirror the image
' ========================================================================================
' Callback function prototype
' ========================================================================================
'typedef void (CALLBACK *PFNIMGCTXCALLBACK)(void *, void *);
'SUB FNIMGCTXCALLBACK (BYVAL AS DWORD, BYVAL AS DWORD)
' ########################################################################################
' Interface name = IImgCtx
' IID = {3050F3D7-98B5-11CF-BB82-00AA00BDCE0B}
' Inherited interface = IUnknown
' ########################################################################################
INTERFACE IImgCtx $IID_IImgCtx
 INHERIT IUnknown
 ' =====================================================================================
 METHOD Load ( ' VTable offset = 12
 BYREF pszUrl AS WSTRINGZ
 , BYVAL dwFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SelectChanges ( ' VTable offset = 16
 BYVAL ulChgOn AS DWORD
 , BYVAL ulChgOff AS DWORD
 , BYVAL fSignal AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SetCallback ( ' VTable offset = 20
 BYVAL pfn AS DWORD
 , BYVAL pvPrivateData AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Disconnect ( ' VTable offset = 24
 ) AS LONG
 ' =====================================================================================
 METHOD GetUpdateRects ( ' VTable offset = 28
 BYREF prc AS RECT
 , BYREF prcImg AS RECT
 , BYREF pcrc AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetStateInfo ( ' VTable offset = 32
 BYREF pulState AS DWORD
 , BYREF psize AS SIZE
 , BYVAL fClearChanges AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetPalette ( ' VTable offset = 36
 BYREF phpa AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Draw ( ' VTable offset = 40
 BYVAL hdc AS DWORD
 , BYREF prcBounds AS RECT
 ) AS LONG
 ' =====================================================================================
 METHOD Tile ( ' VTable offset = 44
 BYVAL hdc AS DWORD
 , BYREF pptBackOrg AS POINT
 , BYREF prcClip AS RECT
 , BYREF psize AS SIZE
 ) AS LONG
 ' =====================================================================================
 METHOD StretchBlt ( ' VTable offset = 48
 BYVAL hdc AS DWORD
 , BYVAL dstX AS LONG
 , BYVAL dstY AS LONG
 , BYVAL dstXE AS LONG
 , BYVAL dstYE AS LONG
 , BYVAL srcX AS LONG
 , BYVAL srcY AS LONG
 , BYVAL srcXE AS LONG
 , BYVAL srcYE AS LONG
 , BYVAL dwROP AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF
