From 57388691205fa075c9a55949408f5b6301e1eaf0 Mon Sep 17 00:00:00 2001
From: nickysn <nickysn@gmail.com>
Date: Sat, 12 Sep 2015 12:46:45 +0000
Subject: [PATCH] + added the win16api brush gdi functions

git-svn-id: trunk@31617 -
---
 rtl/win16/win31.pp      |  3 +++
 rtl/win16/winprocsh.inc | 14 ++++++++++++
 rtl/win16/wintypes.inc  | 47 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 64 insertions(+)

diff --git a/rtl/win16/win31.pp b/rtl/win16/win31.pp
index 7693823b26..6fac0da56d 100644
--- a/rtl/win16/win31.pp
+++ b/rtl/win16/win31.pp
@@ -258,6 +258,9 @@ function GetViewportOrgEx(hdc: HDC; lpPoint: LPPOINT): BOOL; external 'GDI';
 function OffsetViewportOrgEx(hdc: HDC; nX, nY: SmallInt; lpPoint: LPPOINT): BOOL; external 'GDI';
 function ScaleViewportExtEx(hdc: HDC; nXnum, nXdenom, nYnum, nYdenom: SmallInt; lpSize: LPSIZE): BOOL; external 'GDI';
 
+{ Brush support }
+function GetBrushOrgEx(hDC: HDC; lpPoint: LPPOINT): BOOL; external 'GDI';
+
 implementation
 
 end.
diff --git a/rtl/win16/winprocsh.inc b/rtl/win16/winprocsh.inc
index fd99242880..89e2a82940 100644
--- a/rtl/win16/winprocsh.inc
+++ b/rtl/win16/winprocsh.inc
@@ -378,3 +378,17 @@ function CreatePenIndirect(lplgpn: LPLOGPEN): HPEN; external 'GDI';
 {$ifdef VAR_PARAMS_ARE_FAR}
 function CreatePenIndirect(var lgpn: LOGPEN): HPEN; external 'GDI';
 {$endif}
+
+{ Brush support }
+
+function CreateSolidBrush(clrref: COLORREF): HBRUSH; external 'GDI';
+function CreateHatchBrush(fnStyle: SmallInt; clrref: COLORREF): HBRUSH; external 'GDI';
+function CreatePatternBrush(hbmp: HBITMAP): HBRUSH; external 'GDI';
+function CreateDIBPatternBrush(hglbDIBPacked: HGLOBAL; fnColorSpec: UINT): HBRUSH; external 'GDI';
+function CreateBrushIndirect(lplb: LPLOGBRUSH): HBRUSH; external 'GDI';
+{$ifdef VAR_PARAMS_ARE_FAR}
+function CreateBrushIndirect(var lb: LOGBRUSH): HBRUSH; external 'GDI';
+{$endif}
+
+function SetBrushOrg(hdc: HDC; nXOrg, nYOrg: SmallInt): DWORD; external 'GDI';
+function GetBrushOrg(hdc: HDC): DWORD; external 'GDI';
diff --git a/rtl/win16/wintypes.inc b/rtl/win16/wintypes.inc
index 5bf5f7d752..5bf57fce22 100644
--- a/rtl/win16/wintypes.inc
+++ b/rtl/win16/wintypes.inc
@@ -569,3 +569,50 @@ const
   WHITE_PEN = 6;
   BLACK_PEN = 7;
   NULL_PEN  = 8;
+
+{ Brush support }
+
+{ Brush Styles }
+  BS_SOLID      = 0;
+  BS_NULL       = 1;
+  BS_HOLLOW     = BS_NULL;
+  BS_HATCHED    = 2;
+  BS_PATTERN    = 3;
+  BS_INDEXED    = 4;
+  BS_DIBPATTERN = 5;
+
+{ Hatch Styles }
+  HS_HORIZONTAL = 0;
+  HS_VERTICAL   = 1;
+  HS_FDIAGONAL  = 2;
+  HS_BDIAGONAL  = 3;
+  HS_CROSS      = 4;
+  HS_DIAGCROSS  = 5;
+
+{ Logical Brush (or Pattern) }
+type
+  PLOGBRUSH = ^LOGBRUSH;
+  NPLOGBRUSH = ^LOGBRUSH; near;
+  LPLOGBRUSH = ^LOGBRUSH; far;
+  LOGBRUSH = record
+    lbStyle: UINT;
+    lbColor: COLORREF;
+    lbHatch: SmallInt;
+  end;
+  TLogBrush = LOGBRUSH;
+
+  PPATTERN = ^PATTERN;
+  NPPATTERN = ^PATTERN; near;
+  LPPATTERN = ^PATTERN; far;
+  PATTERN = LOGBRUSH;
+  TPattern = PATTERN;
+
+{ Stock brushes for use with GetStockObject() }
+const
+  WHITE_BRUSH  = 0;
+  LTGRAY_BRUSH = 1;
+  GRAY_BRUSH   = 2;
+  DKGRAY_BRUSH = 3;
+  BLACK_BRUSH  = 4;
+  NULL_BRUSH   = 5;
+  HOLLOW_BRUSH = NULL_BRUSH;