dlls: Add wing32 dll
Dmitry Timoshkov
dmitry at codeweavers.com
Thu Feb 22 04:43:58 CST 2007
Hello,
this implementation is based on dlls/gdi32/wing.c.
Changelog:
dlls: Add wing32 dll.
---
configure.ac | 1 +
dlls/wing32/Makefile.in | 13 ++++
dlls/wing32/wing32.c | 143 +++++++++++++++++++++++++++++++++++++++++++++++
dlls/wing32/wing32.spec | 11 ++++
4 files changed, 168 insertions(+), 0 deletions(-)
create mode 100644 dlls/wing32/Makefile.in
create mode 100644 dlls/wing32/wing32.c
create mode 100644 dlls/wing32/wing32.spec
diff --git a/configure.ac b/configure.ac
index 4edaa20..9e545ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1771,6 +1771,7 @@ dlls/wineoss.drv/Makefile
dlls/wineps.drv/Makefile
dlls/winequartz.drv/Makefile
dlls/winex11.drv/Makefile
+dlls/wing32/Makefile
dlls/wininet/Makefile
dlls/wininet/tests/Makefile
dlls/winmm/Makefile
diff --git a/dlls/wing32/Makefile.in b/dlls/wing32/Makefile.in
new file mode 100644
index 0000000..de26d3e
--- /dev/null
+++ b/dlls/wing32/Makefile.in
@@ -0,0 +1,13 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR = @srcdir@
+VPATH = @srcdir@
+MODULE = wing32.dll
+IMPORTLIB = libwing32.$(IMPLIBEXT)
+IMPORTS = user32 gdi32 kernel32
+
+C_SRCS = wing32.c
+
+ at MAKE_DLL_RULES@
+
+ at DEPENDENCIES@ # everything below this line is overwritten by make depend
diff --git a/dlls/wing32/wing32.c b/dlls/wing32/wing32.c
new file mode 100644
index 0000000..3c6d3d9
--- /dev/null
+++ b/dlls/wing32/wing32.c
@@ -0,0 +1,143 @@
+/*
+ * WinG support
+ *
+ * Copyright 2007 Dmitry Timoshkov
+ *
+ * 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 <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+
+/***********************************************************************
+ * WinGCreateDC (WING32.@)
+ */
+HDC WINAPI WinGCreateDC( void )
+{
+ return CreateCompatibleDC( 0 );
+}
+
+/***********************************************************************
+ * WinGRecommendDIBFormat (WING32.@)
+ */
+BOOL WINAPI WinGRecommendDIBFormat( BITMAPINFO *bmi )
+{
+ if (!bmi) return FALSE;
+
+ bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ bmi->bmiHeader.biWidth = 320;
+ bmi->bmiHeader.biHeight = -1;
+ bmi->bmiHeader.biPlanes = 1;
+ bmi->bmiHeader.biBitCount = 8;
+ bmi->bmiHeader.biCompression = BI_RGB;
+ bmi->bmiHeader.biSizeImage = 0;
+ bmi->bmiHeader.biXPelsPerMeter = 0;
+ bmi->bmiHeader.biYPelsPerMeter = 0;
+ bmi->bmiHeader.biClrUsed = 0;
+ bmi->bmiHeader.biClrImportant = 0;
+
+ return TRUE;
+}
+
+/***********************************************************************
+ * WinGCreateBitmap (WING32.@)
+ */
+HBITMAP WINAPI WinGCreateBitmap( HDC hdc, BITMAPINFO *bmi, void **bits )
+{
+ return CreateDIBSection( hdc, bmi, 0, bits, 0, 0 );
+}
+
+/***********************************************************************
+ * WinGGetDIBPointer (WING32.@)
+ */
+void * WINAPI WinGGetDIBPointer( HBITMAP hbmp, BITMAPINFO *bmi )
+{
+ DIBSECTION ds;
+
+ if (GetObjectW( hbmp, sizeof(ds), &ds ) == sizeof(ds))
+ {
+ memcpy( &bmi->bmiHeader, &ds.dsBmih, sizeof(*bmi) );
+ return ds.dsBm.bmBits;
+ }
+ return NULL;
+}
+
+/***********************************************************************
+ * WinGSetDIBColorTable (WING32.@)
+ */
+UINT WINAPI WinGSetDIBColorTable( HDC hdc, UINT start, UINT end, RGBQUAD *colors )
+{
+ return SetDIBColorTable( hdc, start, end, colors );
+}
+
+/***********************************************************************
+ * WinGGetDIBColorTable (WING32.@)
+ */
+UINT WINAPI WinGGetDIBColorTable( HDC hdc, UINT start, UINT end, RGBQUAD *colors )
+{
+ return GetDIBColorTable( hdc, start, end, colors );
+}
+
+/***********************************************************************
+ * WinGCreateHalfTonePalette (WING32.@)
+ */
+HPALETTE WINAPI WinGCreateHalfTonePalette( void )
+{
+ HDC hdc;
+ HPALETTE hpal;
+
+ hdc = GetDC( 0 );
+ hpal = CreateHalftonePalette( hdc );
+ ReleaseDC( 0, hdc );
+
+ return hpal;
+}
+
+/***********************************************************************
+ * WinGCreateHalfToneBrush (WING32.@)
+ */
+HBRUSH WINAPI WinGCreateHalfToneBrush( HDC hdc, COLORREF color, INT type )
+{
+ return CreateSolidBrush( color );
+}
+
+/***********************************************************************
+ * WinGStretchBlt (WING32.@)
+ */
+BOOL WINAPI WinGStretchBlt( HDC hdcDst, INT xDst, INT yDst, INT widthDst, INT heightDst,
+ HDC hdcSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc )
+{
+ INT old_blt_mode;
+ BOOL ret;
+
+ old_blt_mode = SetStretchBltMode( hdcDst, COLORONCOLOR );
+ ret = StretchBlt( hdcDst, xDst, yDst, widthDst, heightDst,
+ hdcSrc, xSrc, ySrc, widthSrc, heightSrc, SRCCOPY );
+ SetStretchBltMode( hdcDst, old_blt_mode );
+ return ret;
+}
+
+/***********************************************************************
+ * WinGBitBlt (WING32.@)
+ */
+BOOL WINAPI WinGBitBlt( HDC hdcDst, INT xDst, INT yDst, INT width,
+ INT height, HDC hdcSrc, INT xSrc, INT ySrc )
+{
+ return BitBlt( hdcDst, xDst, yDst, width, height, hdcSrc, xSrc, ySrc, SRCCOPY );
+}
diff --git a/dlls/wing32/wing32.spec b/dlls/wing32/wing32.spec
new file mode 100644
index 0000000..38b3e64
--- /dev/null
+++ b/dlls/wing32/wing32.spec
@@ -0,0 +1,11 @@
+@ stdcall WinGBitBlt(long long long long long long long long) WinGBitBlt
+@ stdcall WinGCreateBitmap(long ptr ptr) WinGCreateBitmap
+@ stdcall WinGCreateDC() WinGCreateDC
+@ stdcall WinGCreateHalfToneBrush(long long long) WinGCreateHalfToneBrush
+@ stdcall WinGCreateHalfTonePalette() WinGCreateHalfTonePalette
+@ stdcall WinGGetDIBColorTable(long long long ptr) WinGGetDIBColorTable
+@ stdcall WinGGetDIBPointer(long ptr) WinGGetDIBPointer
+@ stdcall WinGRecommendDIBFormat(ptr) WinGRecommendDIBFormat
+@ stdcall WinGSetDIBColorTable(long long long ptr) WinGSetDIBColorTable
+@ stdcall WinGStretchBlt(long long long long long long long long long long) WinGStretchBlt
+
\ No newline at end of file
--
1.5.0
More information about the wine-patches
mailing list