1 // =================================
  2 // Copyright (c) 2025 Seppo Laakko
  3 // Distributed under the MIT license
  4 // =================================
  5 
  6 using System;
  7 
  8 namespace System.Windows
  9 {
 10     public const int CW_USEDEFAULT = cast<int>(2147483648u);
 11 
 12     public enum ShowCommand : int
 13     {
 14         SW_HIDE = 0, 
 15         SW_SHOWNORMAL = 1, 
 16         SW_SHOWMINIMIZED = 2, 
 17         SW_MAXIMIZE = 3, 
 18         SW_SHOWNOACTIVATE = 4, 
 19         SW_SHOW = 5, 
 20         SW_MINIMIZE = 6, 
 21         SW_SHOWMINNOACTIVE = 7, 
 22         SW_SHOWNA = 8, 
 23         SW_RESTORE = 9, 
 24         SW_SHOWDEFAULT = 10, 
 25         SW_FORCEMINIMIZE = 11
 26     }
 27 
 28     public enum SystemColor : int
 29     {
 30         COLOR_3DDKSHADOW = 21, 
 31         COLOR_3DFACE = 15, 
 32         COLOR_3DHIGHLIGHT = 20, 
 33         COLOR_3DHILIGHT = 20, 
 34         COLOR_3DLIGHT = 22, 
 35         COLOR_3DSHADOW = 16, 
 36         COLOR_ACTIVEBORDER = 10, 
 37         COLOR_ACTIVECAPTION = 2, 
 38         COLOR_APPWORKSPACE = 12, 
 39         COLOR_BACKGROUND = 1, 
 40         COLOR_BTNFACE = 15, 
 41         COLOR_BTNHIGHLIGHT = 20, 
 42         COLOR_BTNHILIGHT = 20, 
 43         COLOR_BTNSHADOW = 16, 
 44         COLOR_BTNTEXT = 18, 
 45         COLOR_CAPTIONTEXT = 9, 
 46         COLOR_DESKTOP = 1, 
 47         COLOR_GRADIENTACTIVECAPTION = 27, 
 48         COLOR_GRADIENTINACTIVECAPTION = 28, 
 49         COLOR_GRAYTEXT = 17, 
 50         COLOR_HIGHLIGHT = 13, 
 51         COLOR_HIGHLIGHTTEXT = 14, 
 52         COLOR_HOTLIGHT = 26, 
 53         COLOR_INACTIVEBORDER = 11, 
 54         COLOR_INACTIVECAPTION = 3, 
 55         COLOR_INACTIVECAPTIONTEXT = 19, 
 56         COLOR_INFOBK = 24, 
 57         COLOR_INFOTEXT = 23, 
 58         COLOR_MENU = 4, 
 59         COLOR_MENUHILIGHT = 29, 
 60         COLOR_MENUBAR = 30, 
 61         COLOR_MENUTEXT = 7, 
 62         COLOR_SCROLLBAR = 0, 
 63         COLOR_WINDOW = 5, 
 64         COLOR_WINDOWFRAME = 6, 
 65         COLOR_WINDOWTEXT = 8
 66     }
 67 
 68     public enum WindowClassStyle : uint
 69     {
 70         CS_DEFAULT = 0u, 
 71         CS_VREDRAW = 1u, 
 72         CS_HREDRAW = 2u, 
 73         CS_DBLCLKS = 8u, 
 74         CS_OWNDC = 32u, 
 75         CS_CLASSDC = 64u, 
 76         CS_PARENTDC = 128u, 
 77         CS_NOCLOSE = 512u, 
 78         CS_SAVEBITS = 2048u, 
 79         CS_BYTEALIGNCLIENT = 4096u, 
 80         CS_BYTEALIGNWINDOW = 8192u, 
 81         CS_GLOBALCLASS = 16384u, 
 82         CS_DROPSHADOW = 131072u
 83     }
 84 
 85     public enum WindowStyle : long
 86     {
 87         WS_BORDER = 8388608, 
 88         WS_CAPTION = 12582912, 
 89         WS_CHILD = 1073741824, 
 90         WS_CHILDWINDOW = 1073741824, 
 91         WS_CLIPCHILDREN = 33554432, 
 92         WS_CLIPSIBLINGS = 67108864, 
 93         WS_DISABLED = 134217728, 
 94         WS_DLGFRAME = 4194304, 
 95         WS_GROUP = 131072, 
 96         WS_HSCROLL = 1048576, 
 97         WS_ICONIC = 536870912, 
 98         WS_MAXIMIZE = 16777216, 
 99         WS_MAXIMIZEBOX = 65536, 
100         WS_MINIMIZE = 536870912, 
101         WS_MINIMIZEBOX = 131072, 
102         WS_OVERLAPPED = 0, 
103         WS_POPUP = 2147483648u, 
104         WS_SIZEBOX = 262144, 
105         WS_SYSMENU = 524288, 
106         WS_TABSTOP = 65536, 
107         WS_THICKFRAME = 262144, 
108         WS_TILED = 0, 
109         WS_VISIBLE = 268435456, 
110         WS_VSCROLL = 2097152, 
111         WS_POPUPWINDOW = (WS_POPUP | WS_BORDER | WS_SYSMENU), 
112         WS_OVERLAPPEDWINDOW = (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX), 
113         WS_TILEDWINDOW = WS_OVERLAPPEDWINDOW
114     }
115 
116     public enum ExtendedWindowStyle : long
117     {
118         WS_EX_DEFAULT = 0, 
119         WS_EX_ACCEPTFILES = 16, 
120         WS_EX_APPWINDOW = 262144, 
121         WS_EX_CLIENTEDGE = 512, 
122         WS_EX_COMPOSITED = 33554432, 
123         WS_EX_CONTEXTHELP = 1024, 
124         WS_EX_CONTROLPARENT = 65536, 
125         WS_EX_DLGMODALFRAME = 1, 
126         WS_EX_LAYERED = 524288, 
127         WS_EX_LAYOUTRTL = 4194304, 
128         WS_EX_LEFT = 0, 
129         WS_EX_LEFTSCROLLBAR = 16384, 
130         WS_EX_LTRREADING = 0, 
131         WS_EX_MDICHILD = 64, 
132         WS_EX_NOACTIVATE = 134217728, 
133         WS_EX_NOINHERITLAYOUT = 1048576, 
134         WS_EX_NOPARENTNOTIFY = 4, 
135         WS_EX_NOREDIRECTIONBITMAP = 2097152, 
136         WS_EX_RIGHT = 4096, 
137         WS_EX_RIGHTSCROLLBAR = 0, 
138         WS_EX_RTLREADING = 8192, 
139         WS_EX_STATICEDGE = 131072, 
140         WS_EX_TOOLWINDOW = 128u, 
141         WS_EX_TOPMOST = 8, 
142         WS_EX_TRANSPARENT = 32, 
143         WS_EX_WINDOWEDGE = 256, 
144         WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST), 
145         WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE)
146     }
147 
148     public class WinRect
149     {
150         public WinRect() : left(0), top(0), right(0), bottom(0)
151         {
152         }
153         public WinRect(int left_, int top_, int right_, int bottom_) : left(left_), top(top_), right(right_), bottom(bottom_)
154         {
155         }
156         public int left;
157         public int top;
158         public int right;
159         public int bottom;
160     }
161 
162     public enum WindowState : sbyte
163     {
164         normal, minimized, maximized
165     }
166 
167     public enum DialogResult : int
168     {
169         none = 0, ok = 1, cancel = 2, abort = 3, retry = 4, ignore = 5, yes = 6, no = 7
170     }
171 
172     public string ToString(DialogResult dialogResult)
173     {
174         switch (dialogResult)
175         {
176             case DialogResult.none: return "DialogResult.none";
177             case DialogResult.ok: return "DialogResult.ok";
178             case DialogResult.cancel: return "DialogResult.cancel";
179             case DialogResult.abort: return "DialogResult.abort";
180             case DialogResult.retry: return "DialogResult.retry";
181             case DialogResult.ignore: return "DialogResult.ignore";
182             case DialogResult.yes: return "DialogResult.yes";
183             case DialogResult.no: return "DialogResult.no";
184         }
185         return string();
186     }
187 
188     public enum Anchors : sbyte
189     {
190         none = 0, top = 1 << 0, bottom = 1 << 1, left = 1 << 2, right = 1 << 3
191     }
192 
193     public enum Dock : sbyte
194     {
195         none = 0, top = 1, bottom = 2, left = 3, right = 4, fill = 5
196     }
197 
198     public class Padding
199     {
200         public Padding() : left(0), top(0), right(0), bottom(0)
201         {
202         }
203         public Padding(int left_, int top_, int right_, int bottom_) : left(left_), top(top_), right(right_), bottom(bottom_)
204         {
205         }
206         public inline int Vertical() const
207         {
208             return top + bottom;
209         }
210         public inline int Horizontal() const
211         {
212             return left + right;
213         }
214         public int left;
215         public int top;
216         public int right;
217         public int bottom;
218     }
219 
220     public bool operator==(const Padding& left, const Padding& right)
221     {
222         return left.left == right.left && left.top == right.top && left.right == right.right && left.bottom == right.bottom;
223     }
224 
225     public class PaddingF
226     {
227         public PaddingF() : left(0), top(0), right(0), bottom(0)
228         {
229         }
230         public PaddingF(float left_, float top_, float right_, float bottom_) : left(left_), top(top_), right(right_), bottom(bottom_)
231         {
232         }
233         public float Vertical() const { return top + bottom; }
234         public float Horizontal() const { return left + right; }
235         public float left;
236         public float top;
237         public float right;
238         public float bottom;
239     }
240 
241     public bool operator==(const PaddingF& left, const PaddingF& right)
242     {
243         return left.left == right.left && left.top == right.top && left.right == right.right && left.bottom == right.bottom;
244     }