Skip to content

Commit

Permalink
Refactor WIC module to work with new com module (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
caffeinepills committed Oct 27, 2020
1 parent 0de2c9b commit 832fcf7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pyglet/image/codecs/wic.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
GUID_WICPixelFormat48bppBGR = com.GUID(0xe605a384, 0xb468, 0x46ce, 0xbb, 0x2e, 0x36, 0xf1, 0x80, 0xe6, 0x43, 0x13)


class IWICComponentInfo(com.IUnknown):
class IWICComponentInfo(com.pIUnknown):
_methods_ = [
('GetComponentType',
com.STDMETHOD()),
Expand All @@ -102,7 +102,7 @@ class IWICComponentInfo(com.IUnknown):
]


class IWICPixelFormatInfo(IWICComponentInfo, com.IUnknown):
class IWICPixelFormatInfo(IWICComponentInfo, com.pIUnknown):
_methods_ = [
('GetFormatGUID',
com.STDMETHOD(POINTER(com.GUID))),
Expand All @@ -117,7 +117,7 @@ class IWICPixelFormatInfo(IWICComponentInfo, com.IUnknown):
]


class IWICBitmapSource(com.IUnknown):
class IWICBitmapSource(com.pIUnknown):
_methods_ = [
('GetSize',
com.STDMETHOD(POINTER(UINT), POINTER(UINT))),
Expand All @@ -132,7 +132,7 @@ class IWICBitmapSource(com.IUnknown):
]


class IWICFormatConverter(IWICBitmapSource, com.IUnknown):
class IWICFormatConverter(IWICBitmapSource, com.pIUnknown):
_methods_ = [
('Initialize',
com.STDMETHOD(IWICBitmapSource, POINTER(REFWICPixelFormatGUID), WICBitmapDitherType, c_void_p, DOUBLE, WICBitmapPaletteType)),
Expand All @@ -141,7 +141,7 @@ class IWICFormatConverter(IWICBitmapSource, com.IUnknown):
]


class IWICMetadataQueryReader(com.IUnknown):
class IWICMetadataQueryReader(com.pIUnknown):
_methods_ = [
('GetContainerFormat',
com.STDMETHOD()),
Expand All @@ -154,7 +154,7 @@ class IWICMetadataQueryReader(com.IUnknown):
]


class IWICBitmapFrameDecode(IWICBitmapSource, com.IUnknown):
class IWICBitmapFrameDecode(IWICBitmapSource, com.pIUnknown):
_methods_ = [
('GetMetadataQueryReader',
com.STDMETHOD(POINTER(IWICMetadataQueryReader))),
Expand All @@ -165,14 +165,14 @@ class IWICBitmapFrameDecode(IWICBitmapSource, com.IUnknown):
]


class IWICBitmapFlipRotator(IWICBitmapSource, com.IUnknown):
class IWICBitmapFlipRotator(IWICBitmapSource, com.pIUnknown):
_methods_ = [
('Initialize',
com.STDMETHOD(IWICBitmapSource, WICBitmapTransformOptions)),
]


class IWICBitmap(IWICBitmapSource, com.IUnknown):
class IWICBitmap(IWICBitmapSource, com.pIUnknown):
_methods_ = [
('Lock',
com.STDMETHOD()),
Expand All @@ -183,7 +183,7 @@ class IWICBitmap(IWICBitmapSource, com.IUnknown):
]


class IWICBitmapDecoder(com.IUnknown):
class IWICBitmapDecoder(com.pIUnknown):
_methods_ = [
('QueryCapability',
com.STDMETHOD()),
Expand Down Expand Up @@ -226,7 +226,7 @@ class IWICImagingFactory(com.pIUnknown):
('CreateDecoderFromFilename',
com.STDMETHOD(LPCWSTR, com.GUID, DWORD, WICDecodeOptions, POINTER(IWICBitmapDecoder))),
('CreateDecoderFromStream',
com.STDMETHOD(com.IUnknown, c_void_p, WICDecodeOptions, POINTER(IWICBitmapDecoder))),
com.STDMETHOD(com.pIUnknown, c_void_p, WICDecodeOptions, POINTER(IWICBitmapDecoder))),
('CreateDecoderFromFileHandle',
com.STDMETHOD()),
('CreateComponentInfo',
Expand Down Expand Up @@ -307,7 +307,7 @@ def _load_bitmap_decoder(self, file, filename):
kernel32.GlobalUnlock(hglob)

# Create IStream for the HGLOBAL
stream = com.IUnknown()
stream = com.pIUnknown()
ole32.CreateStreamOnHGlobal(hglob, True, byref(stream))

# Load image from stream
Expand Down

0 comments on commit 832fcf7

Please sign in to comment.