Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
43130843
Commit
43130843
authored
Nov 29, 2010
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Nov 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Use an iface instead of a vtbl pointer in PaletteImpl.
parent
e97fb503
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
12 deletions
+17
-12
palette.c
dlls/windowscodecs/palette.c
+17
-12
No files found.
dlls/windowscodecs/palette.c
View file @
43130843
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wincodecs
);
WINE_DEFAULT_DEBUG_CHANNEL
(
wincodecs
);
typedef
struct
{
typedef
struct
{
const
IWICPaletteVtbl
*
lpIWICPaletteVtbl
;
IWICPalette
IWICPalette_iface
;
LONG
ref
;
LONG
ref
;
UINT
count
;
UINT
count
;
WICColor
*
colors
;
WICColor
*
colors
;
...
@@ -43,10 +43,15 @@ typedef struct {
...
@@ -43,10 +43,15 @@ typedef struct {
CRITICAL_SECTION
lock
;
/* must be held when count, colors, or type is accessed */
CRITICAL_SECTION
lock
;
/* must be held when count, colors, or type is accessed */
}
PaletteImpl
;
}
PaletteImpl
;
static
inline
PaletteImpl
*
impl_from_IWICPalette
(
IWICPalette
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
PaletteImpl
,
IWICPalette_iface
);
}
static
HRESULT
WINAPI
PaletteImpl_QueryInterface
(
IWICPalette
*
iface
,
REFIID
iid
,
static
HRESULT
WINAPI
PaletteImpl_QueryInterface
(
IWICPalette
*
iface
,
REFIID
iid
,
void
**
ppv
)
void
**
ppv
)
{
{
PaletteImpl
*
This
=
(
PaletteImpl
*
)
iface
;
PaletteImpl
*
This
=
impl_from_IWICPalette
(
iface
)
;
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_guid
(
iid
),
ppv
);
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_guid
(
iid
),
ppv
);
if
(
!
ppv
)
return
E_INVALIDARG
;
if
(
!
ppv
)
return
E_INVALIDARG
;
...
@@ -67,7 +72,7 @@ static HRESULT WINAPI PaletteImpl_QueryInterface(IWICPalette *iface, REFIID iid,
...
@@ -67,7 +72,7 @@ static HRESULT WINAPI PaletteImpl_QueryInterface(IWICPalette *iface, REFIID iid,
static
ULONG
WINAPI
PaletteImpl_AddRef
(
IWICPalette
*
iface
)
static
ULONG
WINAPI
PaletteImpl_AddRef
(
IWICPalette
*
iface
)
{
{
PaletteImpl
*
This
=
(
PaletteImpl
*
)
iface
;
PaletteImpl
*
This
=
impl_from_IWICPalette
(
iface
)
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
@@ -77,7 +82,7 @@ static ULONG WINAPI PaletteImpl_AddRef(IWICPalette *iface)
...
@@ -77,7 +82,7 @@ static ULONG WINAPI PaletteImpl_AddRef(IWICPalette *iface)
static
ULONG
WINAPI
PaletteImpl_Release
(
IWICPalette
*
iface
)
static
ULONG
WINAPI
PaletteImpl_Release
(
IWICPalette
*
iface
)
{
{
PaletteImpl
*
This
=
(
PaletteImpl
*
)
iface
;
PaletteImpl
*
This
=
impl_from_IWICPalette
(
iface
)
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
...
@@ -103,7 +108,7 @@ static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface,
...
@@ -103,7 +108,7 @@ static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface,
static
HRESULT
WINAPI
PaletteImpl_InitializeCustom
(
IWICPalette
*
iface
,
static
HRESULT
WINAPI
PaletteImpl_InitializeCustom
(
IWICPalette
*
iface
,
WICColor
*
pColors
,
UINT
colorCount
)
WICColor
*
pColors
,
UINT
colorCount
)
{
{
PaletteImpl
*
This
=
(
PaletteImpl
*
)
iface
;
PaletteImpl
*
This
=
impl_from_IWICPalette
(
iface
)
;
WICColor
*
new_colors
;
WICColor
*
new_colors
;
TRACE
(
"(%p,%p,%u)
\n
"
,
iface
,
pColors
,
colorCount
);
TRACE
(
"(%p,%p,%u)
\n
"
,
iface
,
pColors
,
colorCount
);
...
@@ -147,7 +152,7 @@ static HRESULT WINAPI PaletteImpl_InitializeFromPalette(IWICPalette *iface,
...
@@ -147,7 +152,7 @@ static HRESULT WINAPI PaletteImpl_InitializeFromPalette(IWICPalette *iface,
static
HRESULT
WINAPI
PaletteImpl_GetType
(
IWICPalette
*
iface
,
static
HRESULT
WINAPI
PaletteImpl_GetType
(
IWICPalette
*
iface
,
WICBitmapPaletteType
*
pePaletteType
)
WICBitmapPaletteType
*
pePaletteType
)
{
{
PaletteImpl
*
This
=
(
PaletteImpl
*
)
iface
;
PaletteImpl
*
This
=
impl_from_IWICPalette
(
iface
)
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pePaletteType
);
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pePaletteType
);
...
@@ -162,7 +167,7 @@ static HRESULT WINAPI PaletteImpl_GetType(IWICPalette *iface,
...
@@ -162,7 +167,7 @@ static HRESULT WINAPI PaletteImpl_GetType(IWICPalette *iface,
static
HRESULT
WINAPI
PaletteImpl_GetColorCount
(
IWICPalette
*
iface
,
UINT
*
pcCount
)
static
HRESULT
WINAPI
PaletteImpl_GetColorCount
(
IWICPalette
*
iface
,
UINT
*
pcCount
)
{
{
PaletteImpl
*
This
=
(
PaletteImpl
*
)
iface
;
PaletteImpl
*
This
=
impl_from_IWICPalette
(
iface
)
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pcCount
);
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pcCount
);
...
@@ -178,7 +183,7 @@ static HRESULT WINAPI PaletteImpl_GetColorCount(IWICPalette *iface, UINT *pcCoun
...
@@ -178,7 +183,7 @@ static HRESULT WINAPI PaletteImpl_GetColorCount(IWICPalette *iface, UINT *pcCoun
static
HRESULT
WINAPI
PaletteImpl_GetColors
(
IWICPalette
*
iface
,
UINT
colorCount
,
static
HRESULT
WINAPI
PaletteImpl_GetColors
(
IWICPalette
*
iface
,
UINT
colorCount
,
WICColor
*
pColors
,
UINT
*
pcActualColors
)
WICColor
*
pColors
,
UINT
*
pcActualColors
)
{
{
PaletteImpl
*
This
=
(
PaletteImpl
*
)
iface
;
PaletteImpl
*
This
=
impl_from_IWICPalette
(
iface
)
;
TRACE
(
"(%p,%i,%p,%p)
\n
"
,
iface
,
colorCount
,
pColors
,
pcActualColors
);
TRACE
(
"(%p,%i,%p,%p)
\n
"
,
iface
,
colorCount
,
pColors
,
pcActualColors
);
...
@@ -199,7 +204,7 @@ static HRESULT WINAPI PaletteImpl_GetColors(IWICPalette *iface, UINT colorCount,
...
@@ -199,7 +204,7 @@ static HRESULT WINAPI PaletteImpl_GetColors(IWICPalette *iface, UINT colorCount,
static
HRESULT
WINAPI
PaletteImpl_IsBlackWhite
(
IWICPalette
*
iface
,
BOOL
*
pfIsBlackWhite
)
static
HRESULT
WINAPI
PaletteImpl_IsBlackWhite
(
IWICPalette
*
iface
,
BOOL
*
pfIsBlackWhite
)
{
{
PaletteImpl
*
This
=
(
PaletteImpl
*
)
iface
;
PaletteImpl
*
This
=
impl_from_IWICPalette
(
iface
)
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pfIsBlackWhite
);
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pfIsBlackWhite
);
...
@@ -217,7 +222,7 @@ static HRESULT WINAPI PaletteImpl_IsBlackWhite(IWICPalette *iface, BOOL *pfIsBla
...
@@ -217,7 +222,7 @@ static HRESULT WINAPI PaletteImpl_IsBlackWhite(IWICPalette *iface, BOOL *pfIsBla
static
HRESULT
WINAPI
PaletteImpl_IsGrayscale
(
IWICPalette
*
iface
,
BOOL
*
pfIsGrayscale
)
static
HRESULT
WINAPI
PaletteImpl_IsGrayscale
(
IWICPalette
*
iface
,
BOOL
*
pfIsGrayscale
)
{
{
PaletteImpl
*
This
=
(
PaletteImpl
*
)
iface
;
PaletteImpl
*
This
=
impl_from_IWICPalette
(
iface
)
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pfIsGrayscale
);
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pfIsGrayscale
);
...
@@ -242,7 +247,7 @@ static HRESULT WINAPI PaletteImpl_IsGrayscale(IWICPalette *iface, BOOL *pfIsGray
...
@@ -242,7 +247,7 @@ static HRESULT WINAPI PaletteImpl_IsGrayscale(IWICPalette *iface, BOOL *pfIsGray
static
HRESULT
WINAPI
PaletteImpl_HasAlpha
(
IWICPalette
*
iface
,
BOOL
*
pfHasAlpha
)
static
HRESULT
WINAPI
PaletteImpl_HasAlpha
(
IWICPalette
*
iface
,
BOOL
*
pfHasAlpha
)
{
{
PaletteImpl
*
This
=
(
PaletteImpl
*
)
iface
;
PaletteImpl
*
This
=
impl_from_IWICPalette
(
iface
)
;
int
i
;
int
i
;
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pfHasAlpha
);
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pfHasAlpha
);
...
@@ -286,7 +291,7 @@ HRESULT PaletteImpl_Create(IWICPalette **palette)
...
@@ -286,7 +291,7 @@ HRESULT PaletteImpl_Create(IWICPalette **palette)
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PaletteImpl
));
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PaletteImpl
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
lpIWICPalette
Vtbl
=
&
PaletteImpl_Vtbl
;
This
->
IWICPalette_iface
.
lp
Vtbl
=
&
PaletteImpl_Vtbl
;
This
->
ref
=
1
;
This
->
ref
=
1
;
This
->
count
=
0
;
This
->
count
=
0
;
This
->
colors
=
NULL
;
This
->
colors
=
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment