Hi
I want to write conformance tests for gdiplus and that requires the use of c++. Even if I were to focus on the gdi+ flat api, the windows SDK headers for that have c++ code in them, also eventually when the gdi+ c++ wrappers are written on top of the flat api then we will need to be able to compile c++ in the wine environment. What do I have to do to be able to write these tests?
-Evan Stade
"Evan Stade" estade@gmail.com writes:
I want to write conformance tests for gdiplus and that requires the use of c++. Even if I were to focus on the gdi+ flat api, the windows SDK headers for that have c++ code in them, also eventually when the gdi+ c++ wrappers are written on top of the flat api then we will need to be able to compile c++ in the wine environment. What do I have to do to be able to write these tests?
I don't see any need to use C++ for that. All the exported APIs are callable from C code, and the corresponding headers are C compatible too.
On 5/26/07, Alexandre Julliard julliard@winehq.org wrote:
"Evan Stade" estade@gmail.com writes:
I want to write conformance tests for gdiplus and that requires the use
of
c++. Even if I were to focus on the gdi+ flat api, the windows SDK
headers
for that have c++ code in them, also eventually when the gdi+ c++
wrappers
are written on top of the flat api then we will need to be able to
compile
c++ in the wine environment. What do I have to do to be able to write
these
tests?
I don't see any need to use C++ for that. All the exported APIs are callable from C code, and the corresponding headers are C compatible too.
-- Alexandre Julliard julliard@winehq.org
Well the Platform SDK headers use C++. From gdiplus.h:
... namespace DllExports { #include "GdiplusFlat.h" }; ...
And if you try to just include GdiplusFlat.h (i.e . only using the gdi+ flat api), you have to include GdiplusGpStubs.h. From GdiplusGpStubs.h:
... class GpBrush {}; class GpTexture : public GpBrush {}; ...
So it would be impossible to compile any conformance test for gdi+ in C using the platform sdk headers. In my eyes it seems that there are 2 options: edit the platform sdk headers so that they are compatible with C code (change "class GpFoo {};" to "typedef void GpFoo") or use g++ to compile. Are you suggesting the former over the latter?
-Evan Stade
"Evan Stade" estade@gmail.com wrote:
Well the Platform SDK headers use C++. From gdiplus.h:
... namespace DllExports { #include "GdiplusFlat.h" }; ...
And if you try to just include GdiplusFlat.h (i.e . only using the gdi+ flat api), you have to include GdiplusGpStubs.h. From GdiplusGpStubs.h:
... class GpBrush {}; class GpTexture : public GpBrush {}; ...
So it would be impossible to compile any conformance test for gdi+ in C using the platform sdk headers. In my eyes it seems that there are 2 options: edit the platform sdk headers so that they are compatible with C code (change "class GpFoo {};" to "typedef void GpFoo") or use g++ to compile. Are you suggesting the former over the latter?
All you need are the API prototypes, and you can get those without including headers that use C++.
On 5/28/07, Dmitry Timoshkov dmitry@codeweavers.com wrote:
"Evan Stade" estade@gmail.com wrote:
Well the Platform SDK headers use C++. From gdiplus.h:
... namespace DllExports { #include "GdiplusFlat.h" }; ...
And if you try to just include GdiplusFlat.h (i.e . only using the gdi+
flat
api), you have to include GdiplusGpStubs.h. From GdiplusGpStubs.h:
... class GpBrush {}; class GpTexture : public GpBrush {}; ...
So it would be impossible to compile any conformance test for gdi+ in C using the platform sdk headers. In my eyes it seems that there are 2 options: edit the platform sdk headers so that they are compatible with
C
code (change "class GpFoo {};" to "typedef void GpFoo") or use g++ to compile. Are you suggesting the former over the latter?
All you need are the API prototypes, and you can get those without including headers that use C++.
-- Dmitry.
The API prototypes use types that are defined as C++ classes. For example, one prototype (from GdiPlusFlat.h) is
GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **cloneBrush);
And GpBrush is defined as
class GpBrush {};
"Evan Stade" estade@gmail.com wrote:
The API prototypes use types that are defined as C++ classes. For example, one prototype (from GdiPlusFlat.h) is
GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **cloneBrush);
And GpBrush is defined as
class GpBrush {};
Yes, Microsoft doesn't support calling GDI+ flat API from anything but C++ wrappers. But it shouldn't be too hard to construct an appropriate object in plain C that represents GpBrush for instance.
On Tuesday 29 May 2007 01:05:36 am Dmitry Timoshkov wrote:
Yes, Microsoft doesn't support calling GDI+ flat API from anything but C++ wrappers. But it shouldn't be too hard to construct an appropriate object in plain C that represents GpBrush for instance.
It depends if it's an actual C++ API (eg. exposing classes with non-virtual methods and member variables), or pure-virtual interfaces grabbed through a C API ala DirectX. If it's the former, it may not be possible to convert it all to C due to the name mangling and/or calling convention differences between Unix/GCC and Windows. For that, the only thing that may work is to make an actual cross-compiled Win32 DLL.
"Chris Robinson" chris.kcat@gmail.com wrote:
On Tuesday 29 May 2007 01:05:36 am Dmitry Timoshkov wrote:
Yes, Microsoft doesn't support calling GDI+ flat API from anything but C++ wrappers. But it shouldn't be too hard to construct an appropriate object in plain C that represents GpBrush for instance.
It depends if it's an actual C++ API (eg. exposing classes with non-virtual methods and member variables), or pure-virtual interfaces grabbed through a C API ala DirectX. If it's the former, it may not be possible to convert it all to C due to the name mangling and/or calling convention differences between Unix/GCC and Windows. For that, the only thing that may work is to make an actual cross-compiled Win32 DLL.
GpBrush is a pure implementation specific internal thing, as well as other "classes". So it's completely in an developer favour to put anything he likes to be there.
"Evan Stade" estade@gmail.com wrote:
I want to write conformance tests for gdiplus and that requires the use of c++. Even if I were to focus on the gdi+ flat api, the windows SDK headers for that have c++ code in them, also eventually when the gdi+ c++ wrappers are written on top of the flat api then we will need to be able to compile c++ in the wine environment. What do I have to do to be able to write these tests?
According to the Wine rules C++ is not acceptable for Wine code. Obviously you have 2 choices:
1. Cope with that fact like we do for OLE implementation/tests 2. Create a separate project for gdiplus