1 /*
2  * DSFML - The Simple and Fast Multimedia Library for D
3  *
4  * Copyright (c) 2013 - 2018 Jeremy DeHaan (dehaan.jeremiah@gmail.com)
5  *
6  * This software is provided 'as-is', without any express or implied warranty.
7  * In no event will the authors be held liable for any damages arising from the
8  * use of this software.
9  *
10  * Permission is granted to anyone to use this software for any purpose,
11  * including commercial applications, and to alter it and redistribute it
12  * freely, subject to the following restrictions:
13  *
14  * 1. The origin of this software must not be misrepresented; you must not claim
15  * that you wrote the original software. If you use this software in a product,
16  * an acknowledgment in the product documentation would be appreciated but is
17  * not required.
18  *
19  * 2. Altered source versions must be plainly marked as such, and must not be
20  * misrepresented as being the original software.
21  *
22  * 3. This notice may not be removed or altered from any source distribution
23  *
24  *
25  * DSFML is based on SFML (Copyright Laurent Gomila)
26  */
27 
28 /**
29  * Define a low-level window handle type, specific to each platform.
30  *
31  * $(TABLE
32  * $(TR $(TH Platform) $(TH Type))
33  * $(TR $(TD Windows) $(TD `HWND`))
34  * $(TR $(TD Linux/FreeBSD) $(TD `Window`))
35  * $(TR $(TD Mac OS X)
36  * $(TD either `NSWindow*` or `NSView*`, disguised as `void*`)))
37  * $(LF)
38  *
39  * $(PARA $(B Mac OS X Specification)
40  *
41  * On Mac OS X, a $(WINDOW_LINK) can be created either from an existing
42  * `NSWindow*` or an `NSView*`. When the window is created from a window, DSFML
43  * will use its content view as the OpenGL area. `Window.getSystemHandle()` will
44  * return the handle that was used to create the window,
45  * which is a `NSWindow*` by default.)
46  */
47 module dsfml.window.windowhandle;
48 
49 
50 //TODO: Make the Windows Window Handle the right type?
51 //(ie, a HWND from std.c.windows.windows?
52 version(Windows)
53 {
54 	//import std.c.windows.windows;
55 	struct HWND__;
56 	alias HWND__* WindowHandle;
57 }
58 version(OSX)
59 {
60 	import core.stdc.config;
61 	alias c_ulong WindowHandle;
62 }
63 version(linux)
64 {
65 	alias void* WindowHandle;
66 }