Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a4835dce
Commit
a4835dce
authored
Aug 24, 2010
by
Damjan Jovanovic
Committed by
Alexandre Julliard
Aug 24, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Add a stubbed ICNS encoder.
parent
71a49ebf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
285 additions
and
0 deletions
+285
-0
Makefile.in
dlls/windowscodecs/Makefile.in
+1
-0
clsfactory.c
dlls/windowscodecs/clsfactory.c
+1
-0
icnsformat.c
dlls/windowscodecs/icnsformat.c
+271
-0
regsvr.c
dlls/windowscodecs/regsvr.c
+9
-0
wincodecs_private.h
dlls/windowscodecs/wincodecs_private.h
+3
-0
No files found.
dlls/windowscodecs/Makefile.in
View file @
a4835dce
...
...
@@ -14,6 +14,7 @@ C_SRCS = \
converter.c
\
fliprotate.c
\
gifformat.c
\
icnsformat.c
\
icoformat.c
\
imgfactory.c
\
info.c
\
...
...
dlls/windowscodecs/clsfactory.c
View file @
a4835dce
...
...
@@ -51,6 +51,7 @@ static classinfo wic_classes[] = {
{
&
CLSID_WICIcoDecoder
,
IcoDecoder_CreateInstance
},
{
&
CLSID_WICJpegDecoder
,
JpegDecoder_CreateInstance
},
{
&
CLSID_WICTiffDecoder
,
TiffDecoder_CreateInstance
},
{
&
CLSID_WICIcnsEncoder
,
IcnsEncoder_CreateInstance
},
{
&
CLSID_WICDefaultFormatConverter
,
FormatConverter_CreateInstance
},
{
0
}};
...
...
dlls/windowscodecs/icnsformat.c
0 → 100644
View file @
a4835dce
/*
* Copyright 2010 Damjan Jovanovic
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#ifdef HAVE_ICNS_H
#include <icns.h>
#endif
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "wincodec.h"
#include "wincodecs_private.h"
#include "wine/debug.h"
#include "wine/library.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wincodecs
);
#ifdef SONAME_LIBICNS
static
void
*
libicns_handle
;
#define MAKE_FUNCPTR(f) static typeof(f) * p##f
MAKE_FUNCPTR
(
icns_create_family
);
MAKE_FUNCPTR
(
icns_export_family_data
);
MAKE_FUNCPTR
(
icns_free_image
);
MAKE_FUNCPTR
(
icns_get_mask_type_for_icon_type
);
MAKE_FUNCPTR
(
icns_get_type_from_image_info
);
MAKE_FUNCPTR
(
icns_init_image_for_type
);
MAKE_FUNCPTR
(
icns_new_element_from_image
);
MAKE_FUNCPTR
(
icns_set_element_in_family
);
#undef MAKE_FUNCPTR
static
void
*
load_libicns
(
void
)
{
if
((
libicns_handle
=
wine_dlopen
(
SONAME_LIBICNS
,
RTLD_NOW
,
NULL
,
0
))
!=
NULL
)
{
#define LOAD_FUNCPTR(f) \
if((p##f = wine_dlsym(libicns_handle, #f, NULL, 0)) == NULL) { \
libicns_handle = NULL; \
return NULL; \
}
LOAD_FUNCPTR
(
icns_create_family
);
LOAD_FUNCPTR
(
icns_export_family_data
);
LOAD_FUNCPTR
(
icns_free_image
);
LOAD_FUNCPTR
(
icns_get_mask_type_for_icon_type
);
LOAD_FUNCPTR
(
icns_get_type_from_image_info
);
LOAD_FUNCPTR
(
icns_init_image_for_type
);
LOAD_FUNCPTR
(
icns_new_element_from_image
);
LOAD_FUNCPTR
(
icns_set_element_in_family
);
#undef LOAD_FUNCPTR
}
return
libicns_handle
;
}
typedef
struct
IcnsEncoder
{
const
IWICBitmapEncoderVtbl
*
lpVtbl
;
LONG
ref
;
IStream
*
stream
;
CRITICAL_SECTION
lock
;
}
IcnsEncoder
;
static
HRESULT
WINAPI
IcnsEncoder_QueryInterface
(
IWICBitmapEncoder
*
iface
,
REFIID
iid
,
void
**
ppv
)
{
IcnsEncoder
*
This
=
(
IcnsEncoder
*
)
iface
;
TRACE
(
"(%p,%s,%p)
\n
"
,
iface
,
debugstr_guid
(
iid
),
ppv
);
if
(
!
ppv
)
return
E_INVALIDARG
;
if
(
IsEqualIID
(
&
IID_IUnknown
,
iid
)
||
IsEqualIID
(
&
IID_IWICBitmapEncoder
,
iid
))
{
*
ppv
=
This
;
}
else
{
*
ppv
=
NULL
;
return
E_NOINTERFACE
;
}
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
static
ULONG
WINAPI
IcnsEncoder_AddRef
(
IWICBitmapEncoder
*
iface
)
{
IcnsEncoder
*
This
=
(
IcnsEncoder
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
IcnsEncoder_Release
(
IWICBitmapEncoder
*
iface
)
{
IcnsEncoder
*
This
=
(
IcnsEncoder
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
if
(
ref
==
0
)
{
This
->
lock
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
lock
);
if
(
This
->
stream
)
IStream_Release
(
This
->
stream
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
}
static
HRESULT
WINAPI
IcnsEncoder_Initialize
(
IWICBitmapEncoder
*
iface
,
IStream
*
pIStream
,
WICBitmapEncoderCacheOption
cacheOption
)
{
IcnsEncoder
*
This
=
(
IcnsEncoder
*
)
iface
;
TRACE
(
"(%p,%p,%u)
\n
"
,
iface
,
pIStream
,
cacheOption
);
EnterCriticalSection
(
&
This
->
lock
);
IStream_AddRef
(
pIStream
);
This
->
stream
=
pIStream
;
LeaveCriticalSection
(
&
This
->
lock
);
return
S_OK
;
}
static
HRESULT
WINAPI
IcnsEncoder_GetContainerFormat
(
IWICBitmapEncoder
*
iface
,
GUID
*
pguidContainerFormat
)
{
FIXME
(
"(%p,%s): stub
\n
"
,
iface
,
debugstr_guid
(
pguidContainerFormat
));
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
IcnsEncoder_GetEncoderInfo
(
IWICBitmapEncoder
*
iface
,
IWICBitmapEncoderInfo
**
ppIEncoderInfo
)
{
FIXME
(
"(%p,%p): stub
\n
"
,
iface
,
ppIEncoderInfo
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
IcnsEncoder_SetColorContexts
(
IWICBitmapEncoder
*
iface
,
UINT
cCount
,
IWICColorContext
**
ppIColorContext
)
{
FIXME
(
"(%p,%u,%p): stub
\n
"
,
iface
,
cCount
,
ppIColorContext
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
IcnsEncoder_SetPalette
(
IWICBitmapEncoder
*
iface
,
IWICPalette
*
pIPalette
)
{
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pIPalette
);
return
WINCODEC_ERR_UNSUPPORTEDOPERATION
;
}
static
HRESULT
WINAPI
IcnsEncoder_SetThumbnail
(
IWICBitmapEncoder
*
iface
,
IWICBitmapSource
*
pIThumbnail
)
{
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pIThumbnail
);
return
WINCODEC_ERR_UNSUPPORTEDOPERATION
;
}
static
HRESULT
WINAPI
IcnsEncoder_SetPreview
(
IWICBitmapEncoder
*
iface
,
IWICBitmapSource
*
pIPreview
)
{
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pIPreview
);
return
WINCODEC_ERR_UNSUPPORTEDOPERATION
;
}
static
HRESULT
WINAPI
IcnsEncoder_CreateNewFrame
(
IWICBitmapEncoder
*
iface
,
IWICBitmapFrameEncode
**
ppIFrameEncode
,
IPropertyBag2
**
ppIEncoderOptions
)
{
FIXME
(
"(%p,%p,%p): stub
\n
"
,
iface
,
ppIFrameEncode
,
ppIEncoderOptions
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
IcnsEncoder_Commit
(
IWICBitmapEncoder
*
iface
)
{
FIXME
(
"(%p): stub
\n
"
,
iface
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
IcnsEncoder_GetMetadataQueryWriter
(
IWICBitmapEncoder
*
iface
,
IWICMetadataQueryWriter
**
ppIMetadataQueryWriter
)
{
FIXME
(
"(%p,%p): stub
\n
"
,
iface
,
ppIMetadataQueryWriter
);
return
E_NOTIMPL
;
}
static
const
IWICBitmapEncoderVtbl
IcnsEncoder_Vtbl
=
{
IcnsEncoder_QueryInterface
,
IcnsEncoder_AddRef
,
IcnsEncoder_Release
,
IcnsEncoder_Initialize
,
IcnsEncoder_GetContainerFormat
,
IcnsEncoder_GetEncoderInfo
,
IcnsEncoder_SetColorContexts
,
IcnsEncoder_SetPalette
,
IcnsEncoder_SetThumbnail
,
IcnsEncoder_SetPreview
,
IcnsEncoder_CreateNewFrame
,
IcnsEncoder_Commit
,
IcnsEncoder_GetMetadataQueryWriter
};
HRESULT
IcnsEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
{
IcnsEncoder
*
This
;
HRESULT
ret
;
TRACE
(
"(%p,%s,%p)
\n
"
,
pUnkOuter
,
debugstr_guid
(
iid
),
ppv
);
*
ppv
=
NULL
;
if
(
pUnkOuter
)
return
CLASS_E_NOAGGREGATION
;
if
(
!
libicns_handle
&&
!
load_libicns
())
{
ERR
(
"Failed writing ICNS because unable to find %s
\n
"
,
SONAME_LIBICNS
);
return
E_FAIL
;
}
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
IcnsEncoder
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
lpVtbl
=
&
IcnsEncoder_Vtbl
;
This
->
ref
=
1
;
This
->
stream
=
NULL
;
InitializeCriticalSection
(
&
This
->
lock
);
This
->
lock
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": IcnsEncoder.lock"
);
ret
=
IUnknown_QueryInterface
((
IUnknown
*
)
This
,
iid
,
ppv
);
IUnknown_Release
((
IUnknown
*
)
This
);
return
ret
;
}
#else
/* !HAVE_ICNS_H */
HRESULT
IcnsEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
)
{
ERR
(
"Trying to save ICNS picture, but ICNS support is not compiled in.
\n
"
);
return
E_FAIL
;
}
#endif
dlls/windowscodecs/regsvr.c
View file @
a4835dce
...
...
@@ -36,6 +36,8 @@
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wincodecs_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
wincodecs
);
/***********************************************************************
...
...
@@ -777,6 +779,13 @@ static struct regsvr_coclass const coclass_list[] = {
"windowscodecs.dll"
,
"Both"
},
{
&
CLSID_WICIcnsEncoder
,
"WIC ICNS Encoder"
,
NULL
,
"windowscodecs.dll"
,
"Both"
},
{
&
CLSID_WICDefaultFormatConverter
,
"WIC Default Format Converter"
,
NULL
,
...
...
dlls/windowscodecs/wincodecs_private.h
View file @
a4835dce
...
...
@@ -19,6 +19,8 @@
#ifndef WINCODECS_PRIVATE_H
#define WINCODECS_PRIVATE_H
DEFINE_GUID
(
CLSID_WICIcnsEncoder
,
0x312fb6f1
,
0xb767
,
0x409d
,
0x8a
,
0x6d
,
0x0f
,
0xc1
,
0x54
,
0xd4
,
0xf0
,
0x5c
);
extern
HRESULT
FormatConverter_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppv
);
extern
HRESULT
ImagingFactory_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppv
);
extern
HRESULT
BmpDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
riid
,
void
**
ppv
);
...
...
@@ -29,6 +31,7 @@ extern HRESULT GifDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID riid, void*
extern
HRESULT
IcoDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
JpegDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
TiffDecoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
IcnsEncoder_CreateInstance
(
IUnknown
*
pUnkOuter
,
REFIID
iid
,
void
**
ppv
);
extern
HRESULT
FlipRotator_Create
(
IWICBitmapFlipRotator
**
fliprotator
);
extern
HRESULT
PaletteImpl_Create
(
IWICPalette
**
palette
);
...
...
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