// Scintilla source code edit control /** @file PlatWin.h ** Implementation of platform facilities on Windows. **/ // Copyright 1998-2011 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef PLATWIN_H #define PLATWIN_H namespace Scintilla { extern void Platform_Initialise(void *hInstance); extern void Platform_Finalise(bool fromDllMain); constexpr RECT RectFromPRectangle(PRectangle prc) noexcept { RECT rc = { static_cast(prc.left), static_cast(prc.top), static_cast(prc.right), static_cast(prc.bottom) }; return rc; } constexpr POINT POINTFromPoint(Point pt) noexcept { return POINT{ static_cast(pt.x), static_cast(pt.y) }; } constexpr Point PointFromPOINT(POINT pt) noexcept { return Point::FromInts(pt.x, pt.y); } constexpr HWND HwndFromWindowID(WindowID wid) noexcept { return static_cast(wid); } inline HWND HwndFromWindow(const Window &w) noexcept { return HwndFromWindowID(w.GetID()); } void *PointerFromWindow(HWND hWnd) noexcept; void SetWindowPointer(HWND hWnd, void *ptr) noexcept; #if defined(USE_D2D) extern bool LoadD2D(); extern ID2D1Factory *pD2DFactory; extern IDWriteFactory *pIDWriteFactory; #endif } #endif