20BEGIN_IGRAPHICS_NAMESPACE
33 void SetWinModuleHandle(
void* pInstance)
override { mHInstance = (HINSTANCE) pInstance; }
34 void* GetWinModuleHandle()
override {
return mHInstance; }
36 void ForceEndUserEdit()
override;
37 float GetPlatformWindowScale()
const override {
return GetScreenScale(); }
39 void PlatformResize(
bool parentHasResized)
override;
42 void DrawResize()
override;
45 void CheckTabletInput(UINT msg);
46 void DestroyEditWindow();
48 void HideMouseCursor(
bool hide,
bool lock)
override;
49 void MoveMouseCursor(
float x,
float y)
override;
50 ECursor SetMouseCursor(ECursor cursorType)
override;
52 void GetMouseLocation(
float& x,
float&y)
const override;
54 EMsgBoxResult ShowMessageBox(
const char* str,
const char* title, EMsgBoxType type, IMsgBoxCompletionHandlerFunc completionHandler)
override;
56 void* OpenWindow(
void* pParent)
override;
57 void CloseWindow()
override;
58 bool WindowIsOpen()
override {
return (mPlugWnd); }
60 void UpdateTooltips()
override {}
62 bool RevealPathInExplorerOrFinder(WDL_String& path,
bool select)
override;
63 void PromptForFile(WDL_String& fileName, WDL_String& path, EFileAction action,
const char* ext, IFileDialogCompletionHandlerFunc completionHandler)
override;
64 void PromptForDirectory(WDL_String& dir, IFileDialogCompletionHandlerFunc completionHandler)
override;
65 bool PromptForColor(
IColor& color,
const char* str, IColorPickerHandlerFunc func)
override;
68 HMENU CreateMenu(
IPopupMenu& menu,
long* pOffsetIdx);
70 bool OpenURL(
const char* url,
const char* msgWindowTitle,
const char* confirmMsg,
const char* errMsgOnFailure)
override;
72 void* GetWindow()
override {
return mPlugWnd; }
74 const char* GetPlatformAPIStr()
override {
return "win32"; };
76 bool GetTextFromClipboard(WDL_String& str)
override;
77 bool SetTextInClipboard(
const char* str)
override;
78 bool SetFilePathInClipboard(
const char* path)
override;
80 bool InitiateExternalFileDragDrop(
const char* path,
const IRECT& iconBounds)
override;
82 bool PlatformSupportsMultiTouch()
const override;
84 static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
85 static LRESULT CALLBACK ParamEditProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
86 static BOOL CALLBACK FindMainWindow(HWND hWnd, LPARAM lParam);
92 void CreatePlatformTextEntry(
int paramIdx,
const IText& text,
const IRECT& bounds,
int length,
const char* str)
override;
94 void SetTooltip(
const char* tooltip);
99 IRECT GetWindowRECT();
105 void OnDisplayTimer(
int vBlankCount = 0);
116 PlatformFontPtr LoadPlatformFont(
const char* fontID,
const char* fileNameOrResID)
override;
117 PlatformFontPtr LoadPlatformFont(
const char* fontID,
const char* fontName, ETextStyle style)
override;
118 PlatformFontPtr LoadPlatformFont(
const char* fontID,
void* pData,
int dataSize)
override;
119 void CachePlatformFont(
const char* fontID,
const PlatformFontPtr& font)
override;
121 inline IMouseInfo GetMouseInfo(LPARAM lParam, WPARAM wParam);
122 inline IMouseInfo GetMouseInfoDeltas(
float& dX,
float& dY, LPARAM lParam, WPARAM wParam);
123 bool MouseCursorIsLocked();
126 void CreateGLContext();
127 void DestroyGLContext();
128 void ActivateGLContext()
override;
129 void DeactivateGLContext()
override;
130 HGLRC mHGLRC =
nullptr;
131 HGLRC mStartHGLRC =
nullptr;
132 HDC mStartHDC =
nullptr;
135 HINSTANCE mHInstance =
nullptr;
136 HWND mPlugWnd =
nullptr;
137 HWND mParamEditWnd =
nullptr;
138 HWND mTooltipWnd =
nullptr;
139 HWND mParentWnd =
nullptr;
140 HWND mMainWnd =
nullptr;
141 WNDPROC mDefEditProc =
nullptr;
142 HFONT mEditFont =
nullptr;
145 void StartVBlankThread(HWND hWnd);
146 void StopVBlankThread();
149 HWND mVBlankWindow = 0;
150 volatile bool mVBlankShutdown =
false;
151 HANDLE mVBlankThread = INVALID_HANDLE_VALUE;
152 volatile DWORD mVBlankCount = 0;
153 int mVBlankSkipUntil = 0;
154 bool mVSYNCEnabled =
false;
156 const IParam* mEditParam =
nullptr;
160 EParamEditMsg mParamEditMsg = kNone;
161 bool mShowingTooltip =
false;
162 float mHiddenCursorX = 0.f;
163 float mHiddenCursorY = 0.f;
164 int mTooltipIdx = -1;
166 WDL_String mMainWndClassName;
168 static StaticStorage<InstalledFont> sPlatformFontCache;
169 static StaticStorage<HFontHolder> sHFontCache;
171 std::unordered_map<ITouchID, IMouseInfo> mDeltaCapture;
174END_IGRAPHICS_NAMESPACE
Used for choosing a drawing backend.
An editor delegate base class for a SOMETHING that uses IGraphics for it's UI.
IGraphics platform class for Windows.
Used to group mouse coordinates with mouse modifier information.
Used to manage color data, independent of draw class/platform.
Used to manage a rectangular area, independent of draw class/platform.
IText is used to manage font and text/text entry style for a piece of text on the UI,...