Moved a bunch of definitions from gdi.h into a new gdi_private.h to
make sure we don't use them outside of gdi32.
diff --git a/objects/bitmap.c b/objects/bitmap.c
index 8d36f48..7ced4f7 100644
--- a/objects/bitmap.c
+++ b/objects/bitmap.c
@@ -23,10 +23,11 @@
#include <string.h>
#include "wine/winbase16.h"
+#include "wine/winuser16.h"
#include "gdi.h"
#include "bitmap.h"
+#include "gdi_private.h"
#include "wine/debug.h"
-#include "wine/winuser16.h"
WINE_DEFAULT_DEBUG_CHANNEL(bitmap);
diff --git a/objects/brush.c b/objects/brush.c
index cc308de..d9ec0bc 100644
--- a/objects/brush.c
+++ b/objects/brush.c
@@ -29,6 +29,7 @@
#include "wine/wingdi16.h"
#include "bitmap.h"
#include "wownt32.h"
+#include "gdi_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(gdi);
diff --git a/objects/clipping.c b/objects/clipping.c
index 11fd7bb..de15845 100644
--- a/objects/clipping.c
+++ b/objects/clipping.c
@@ -26,6 +26,7 @@
#include "wownt32.h"
#include "wine/winuser16.h"
#include "gdi.h"
+#include "gdi_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(clipping);
@@ -157,7 +158,8 @@
if(dc->funcs->pOffsetClipRgn)
ret = dc->funcs->pOffsetClipRgn( dc->physDev, x, y );
else if (dc->hClipRgn) {
- ret = OffsetRgn( dc->hClipRgn, XLSTODS(dc,x), YLSTODS(dc,y));
+ ret = OffsetRgn( dc->hClipRgn, MulDiv( x, dc->vportExtX, dc->wndExtX ),
+ MulDiv( y, dc->vportExtY, dc->wndExtY ) );
CLIPPING_UpdateGCRegion( dc );
}
GDI_ReleaseObj( hdc );
diff --git a/objects/dc.c b/objects/dc.c
index 99a576e..ebd8e8d 100644
--- a/objects/dc.c
+++ b/objects/dc.c
@@ -32,6 +32,7 @@
#include "wownt32.h"
#include "wine/winuser16.h"
#include "gdi.h"
+#include "gdi_private.h"
#include "wine/unicode.h"
#include "wine/debug.h"
diff --git a/objects/dcvalues.c b/objects/dcvalues.c
index 2516398..09bbdad 100644
--- a/objects/dcvalues.c
+++ b/objects/dcvalues.c
@@ -28,6 +28,7 @@
#include "wownt32.h"
#include "gdi.h"
+#include "gdi_private.h"
/***********************************************************************
diff --git a/objects/dib.c b/objects/dib.c
index 43239d8..7b4ba69 100644
--- a/objects/dib.c
+++ b/objects/dib.c
@@ -27,6 +27,7 @@
#include "bitmap.h"
#include "gdi.h"
#include "wownt32.h"
+#include "gdi_private.h"
#include "wine/debug.h"
#include "palette.h"
diff --git a/objects/enhmetafile.c b/objects/enhmetafile.c
index 6c5f76a..920bfbb 100644
--- a/objects/enhmetafile.c
+++ b/objects/enhmetafile.c
@@ -43,6 +43,7 @@
#include "winnls.h"
#include "winerror.h"
#include "gdi.h"
+#include "gdi_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(enhmetafile);
diff --git a/objects/font.c b/objects/font.c
index fba939b..78ecd43 100644
--- a/objects/font.c
+++ b/objects/font.c
@@ -33,12 +33,42 @@
#include "winnls.h"
#include "wownt32.h"
#include "gdi.h"
+#include "gdi_private.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(font);
WINE_DECLARE_DEBUG_CHANNEL(gdi);
+ /* Device -> World size conversion */
+
+/* Performs a device to world transformation on the specified width (which
+ * is in integer format).
+ */
+static inline INT INTERNAL_XDSTOWS(DC *dc, INT width)
+{
+ FLOAT floatWidth;
+
+ /* Perform operation with floating point */
+ floatWidth = (FLOAT)width * dc->xformVport2World.eM11;
+ /* Round to integers */
+ return GDI_ROUND(floatWidth);
+}
+
+/* Performs a device to world transformation on the specified size (which
+ * is in integer format).
+ */
+static inline INT INTERNAL_YDSTOWS(DC *dc, INT height)
+{
+ FLOAT floatHeight;
+
+ /* Perform operation with floating point */
+ floatHeight = (FLOAT)height * dc->xformVport2World.eM22;
+ /* Round to integers */
+ return GDI_ROUND(floatHeight);
+}
+
+
static HGDIOBJ FONT_SelectObject( HGDIOBJ handle, void *obj, HDC hdc );
static INT FONT_GetObject16( HGDIOBJ handle, void *obj, INT count, LPVOID buffer );
static INT FONT_GetObjectA( HGDIOBJ handle, void *obj, INT count, LPVOID buffer );
diff --git a/objects/gdiobj.c b/objects/gdiobj.c
index 7d3add3..d66afa0 100644
--- a/objects/gdiobj.c
+++ b/objects/gdiobj.c
@@ -35,12 +35,15 @@
#include "local.h"
#include "palette.h"
#include "gdi.h"
+#include "gdi_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(gdi);
#define HGDIOBJ_32(h16) ((HGDIOBJ)(ULONG_PTR)(h16))
+#define GDI_HEAP_SIZE 0xffe0
+
/***********************************************************************
* GDI stock objects
*/
diff --git a/objects/metafile.c b/objects/metafile.c
index 4e233a3..656bcd6 100644
--- a/objects/metafile.c
+++ b/objects/metafile.c
@@ -54,6 +54,7 @@
#include "wownt32.h"
#include "winreg.h"
#include "winternl.h"
+#include "gdi_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(metafile);
diff --git a/objects/palette.c b/objects/palette.c
index 02966cf..c21e912 100644
--- a/objects/palette.c
+++ b/objects/palette.c
@@ -33,6 +33,7 @@
#include "wownt32.h"
#include "wine/winuser16.h"
#include "gdi.h"
+#include "gdi_private.h"
#include "palette.h"
#include "wine/debug.h"
#include "winerror.h"
diff --git a/objects/pen.c b/objects/pen.c
index e6933b4..f15cc44 100644
--- a/objects/pen.c
+++ b/objects/pen.c
@@ -28,6 +28,7 @@
#include "wingdi.h"
#include "wine/wingdi16.h"
#include "gdi.h"
+#include "gdi_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(gdi);
diff --git a/objects/region.c b/objects/region.c
index e82db2a..336f58f 100644
--- a/objects/region.c
+++ b/objects/region.c
@@ -101,6 +101,7 @@
#include "winbase.h"
#include "wingdi.h"
#include "gdi.h"
+#include "gdi_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(region);
diff --git a/objects/text.c b/objects/text.c
index 3aa1bdf..e9c9aca 100644
--- a/objects/text.c
+++ b/objects/text.c
@@ -27,9 +27,10 @@
#include "wingdi.h"
#include "wine/winuser16.h"
#include "winerror.h"
-#include "gdi.h"
-#include "wine/debug.h"
#include "winnls.h"
+#include "gdi.h"
+#include "gdi_private.h"
+#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(text);