diff --git a/_i_bubble_control_8h_source.html b/_i_bubble_control_8h_source.html index 3eb64cb6..6a1e865a 100644 --- a/_i_bubble_control_8h_source.html +++ b/_i_bubble_control_8h_source.html @@ -414,7 +414,7 @@
IControl::SetActionFunction
IControl * SetActionFunction(IActionFunction actionFunc)
Set an Action Function for this control.
Definition: IControl.h:206
IControl::SetAnimation
void SetAnimation(IAnimationFunction func)
Set the animation function.
Definition: IControl.h:492
IGraphics
The lowest level base class of an IGraphics context.
Definition: IGraphics.h:86
-
IGraphics::ControlIsCaptured
bool ControlIsCaptured() const
Check to see if any control is captured.
Definition: IGraphics.h:1389
+
IGraphics::ControlIsCaptured
bool ControlIsCaptured() const
Check to see if any control is captured.
Definition: IGraphics.h:1395
IGraphics::PathFill
virtual void PathFill(const IPattern &pattern, const IFillOptions &options=IFillOptions(), const IBlend *pBlend=0)=0
Fill the current current path.
IGraphics::DrawText
void DrawText(const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=0)
Draw some text to the graphics context in a specific rectangle.
Definition: IGraphics.cpp:670
IGraphics::PathClose
virtual void PathClose()=0
Close the path that is being specified.
@@ -424,7 +424,7 @@
IGraphics::PathMoveTo
virtual void PathMoveTo(float x, float y)=0
Move the current point in the current path.
IGraphics::PathArc
virtual void PathArc(float cx, float cy, float r, float a1, float a2, EWinding winding=EWinding::CW)=0
Add an arc to the current path.
IGraphics::PathLineTo
virtual void PathLineTo(float x, float y)=0
Add a line to the current path from the current point to the specified location.
-
IGraphics::GetBounds
IRECT GetBounds() const
Returns an IRECT that represents the entire UI bounds This is useful for programatically arranging UI...
Definition: IGraphics.h:1188
+
IGraphics::GetBounds
IRECT GetBounds() const
Returns an IRECT that represents the entire UI bounds This is useful for programatically arranging UI...
Definition: IGraphics.h:1194
IGraphics::MeasureText
virtual float MeasureText(const IText &text, const char *str, IRECT &bounds) const
Measure the rectangular region that some text will occupy.
Definition: IGraphics.cpp:678
IStrokeOptions
Used to manage stroke behaviour for path based drawing back ends.
Definition: IGraphicsStructs.h:590
IBlend
Used to manage composite/blend operations, independent of draw class/platform.
Definition: IGraphicsStructs.h:544
diff --git a/_i_control_8cpp_source.html b/_i_control_8cpp_source.html index 91462ccb..e9b1bd7b 100644 --- a/_i_control_8cpp_source.html +++ b/_i_control_8cpp_source.html @@ -1335,9 +1335,9 @@
IGraphics::ReleaseMouseCapture
void ReleaseMouseCapture()
Used to tell the graphics context to stop tracking mouse interaction with a control.
Definition: IGraphics.cpp:1278
IGraphics::FillRect
virtual void FillRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill a rectangular region of the graphics context with a color.
Definition: IGraphics.cpp:2569
IGraphics::DrawLine
virtual void DrawLine(const IColor &color, float x1, float y1, float x2, float y2, const IBlend *pBlend=0, float thickness=1.f)
Draw a line to the graphics context.
Definition: IGraphics.cpp:2416
-
IGraphics::GetMouseDownPoint
void GetMouseDownPoint(float &x, float &y) const
Get the x, y position of the last mouse down message.
Definition: IGraphics.h:1587
+
IGraphics::GetMouseDownPoint
void GetMouseDownPoint(float &x, float &y) const
Get the x, y position of the last mouse down message.
Definition: IGraphics.h:1593
IGraphics::FillTriangle
virtual void FillTriangle(const IColor &color, float x1, float y1, float x2, float y2, float x3, float y3, const IBlend *pBlend=0)
Fill a triangle with a color.
Definition: IGraphics.cpp:2562
-
IGraphics::GetControlInTextEntry
IControl * GetControlInTextEntry()
Definition: IGraphics.h:1125
+
IGraphics::GetControlInTextEntry
IControl * GetControlInTextEntry()
Definition: IGraphics.h:1131
IGraphics::PromptUserInput
void PromptUserInput(IControl &control, const IRECT &bounds, int valIdx=0)
Prompt for user input either using a text entry or pop up menu.
Definition: IGraphics.cpp:622
IGraphics::HideMouseCursor
virtual void HideMouseCursor(bool hide=true, bool lock=true)=0
Call to hide/show the mouse cursor.
IGraphics::FillCircle
virtual void FillCircle(const IColor &color, float cx, float cy, float r, const IBlend *pBlend=0)
Fill a circle with a color.
Definition: IGraphics.cpp:2606
diff --git a/_i_control_8h_source.html b/_i_control_8h_source.html index 2c0cd1ed..02c1a625 100644 --- a/_i_control_8h_source.html +++ b/_i_control_8h_source.html @@ -2153,7 +2153,7 @@
IGraphics::DrawVerticalLine
void DrawVerticalLine(const IColor &color, const IRECT &bounds, float x, const IBlend *pBlend=0, float thickness=1.f)
Draw a vertical line, within a rectangular region of the graphics context.
Definition: IGraphics.cpp:787
IGraphics::DrawHorizontalLine
void DrawHorizontalLine(const IColor &color, const IRECT &bounds, float y, const IBlend *pBlend=0, float thickness=1.f)
Draw a horizontal line, within a rectangular region of the graphics context.
Definition: IGraphics.cpp:794
IGraphics::StartLayer
void StartLayer(IControl *pOwner, const IRECT &r, bool cacheable=false)
Create an IGraphics layer.
Definition: IGraphics.cpp:1977
-
IGraphics::GetControlTag
int GetControlTag(const IControl *pControl) const
Get the tag given to a control.
Definition: IGraphics.h:1372
+
IGraphics::GetControlTag
int GetControlTag(const IControl *pControl) const
Get the tag given to a control.
Definition: IGraphics.h:1378
IGraphics::DrawSVG
virtual void DrawSVG(const ISVG &svg, const IRECT &bounds, const IBlend *pBlend=0, const IColor *pStrokeColor=nullptr, const IColor *pFillColor=nullptr)
Draw an SVG image to the graphics context.
Definition: IGraphics.cpp:2784
IGraphics::DrawTriangle
virtual void DrawTriangle(const IColor &color, float x1, float y1, float x2, float y2, float x3, float y3, const IBlend *pBlend=0, float thickness=1.f)
Draw a triangle to the graphics context.
Definition: IGraphics.cpp:2490
IGraphics::FillCircle
virtual void FillCircle(const IColor &color, float cx, float cy, float r, const IBlend *pBlend=0)
Fill a circle with a color.
Definition: IGraphics.cpp:2606
diff --git a/_i_corner_resizer_control_8h_source.html b/_i_corner_resizer_control_8h_source.html index 49929330..7554bdd8 100644 --- a/_i_corner_resizer_control_8h_source.html +++ b/_i_corner_resizer_control_8h_source.html @@ -182,8 +182,8 @@
IGraphics::Resize
void Resize(int w, int h, float scale, bool needsPlatformResize=true)
Definition: IGraphics.cpp:90
IGraphics::SetMouseCursor
virtual ECursor SetMouseCursor(ECursor cursorType=ECursor::ARROW)
Sets the mouse cursor to one of ECursor (implementations should return the result of the base impleme...
Definition: IGraphics.h:828
IGraphics::FillTriangle
virtual void FillTriangle(const IColor &color, float x1, float y1, float x2, float y2, float x3, float y3, const IBlend *pBlend=0)
Fill a triangle with a color.
Definition: IGraphics.cpp:2562
-
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1095
-
IGraphics::GetBounds
IRECT GetBounds() const
Returns an IRECT that represents the entire UI bounds This is useful for programatically arranging UI...
Definition: IGraphics.h:1188
+
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1101
+
IGraphics::GetBounds
IRECT GetBounds() const
Returns an IRECT that represents the entire UI bounds This is useful for programatically arranging UI...
Definition: IGraphics.h:1194
IColor
Used to manage color data, independent of draw class/platform.
Definition: IGraphicsStructs.h:223
IMouseMod
Used to manage mouse modifiers i.e.
Definition: IGraphicsStructs.h:1685
IRECT
Used to manage a rectangular area, independent of draw class/platform.
Definition: IGraphicsStructs.h:749
diff --git a/_i_graphics_8cpp_source.html b/_i_graphics_8cpp_source.html index 2dddc17f..cc7d8d3c 100644 --- a/_i_graphics_8cpp_source.html +++ b/_i_graphics_8cpp_source.html @@ -3125,7 +3125,7 @@
IEditorDelegate::EditorResizeFromUI
virtual bool EditorResizeFromUI(int viewWidth, int viewHeight, bool needsPlatformResize)
If the editor changes UI dimensions, e.g.
Definition: IPlugEditorDelegate.h:261
IGEditorDelegate
An editor delegate base class for a SOMETHING that uses IGraphics for it's UI.
Definition: IGraphicsEditorDelegate.h:30
IGEditorDelegate::LayoutUI
virtual void LayoutUI(IGraphics *pGraphics)
Called to layout controls when the GUI is initially opened and again if the UI size changes.
Definition: IGraphicsEditorDelegate.h:68
-
IGraphics::ControlIsCaptured
bool ControlIsCaptured() const
Check to see if any control is captured.
Definition: IGraphics.h:1389
+
IGraphics::ControlIsCaptured
bool ControlIsCaptured() const
Check to see if any control is captured.
Definition: IGraphics.h:1395
IGraphics::EnableTooltips
void EnableTooltips(bool enable)
Definition: IGraphics.cpp:1527
IGraphics::DoMeasureText
virtual float DoMeasureText(const IText &text, const char *str, IRECT &bounds) const =0
IGraphics::Resize
void Resize(int w, int h, float scale, bool needsPlatformResize=true)
Definition: IGraphics.cpp:90
@@ -3140,12 +3140,12 @@
IGraphics::AttachPopupMenuControl
void AttachPopupMenuControl(const IText &text=DEFAULT_TEXT, const IRECT &bounds=IRECT())
Attach a control for pop-up menus, to override platform style menus.
Definition: IGraphics.cpp:356
IGraphics::DrawPoint
virtual void DrawPoint(const IColor &color, float x, float y, const IBlend *pBlend=0)
Fill a rectangle corresponding to a pixel on a 1:1 screen with a color.
Definition: IGraphics.cpp:2411
IGraphics::RemoveControl
void RemoveControl(int idx)
Remove a control at a particular index, (frees memory).
Definition: IGraphics.cpp:167
-
IGraphics::GetBundleID
virtual const char * GetBundleID() const
Get the bundle ID on macOS and iOS, returns emtpy string on other OSs.
Definition: IGraphics.h:962
+
IGraphics::GetBundleID
virtual const char * GetBundleID() const
Get the bundle ID on macOS and iOS, returns emtpy string on other OSs.
Definition: IGraphics.h:968
IGraphics::PathConvexPolygon
void PathConvexPolygon(float *x, float *y, int nPoints)
Add a convex polygon to the current path.
Definition: IGraphics.cpp:2695
IGraphics::PathFill
virtual void PathFill(const IPattern &pattern, const IFillOptions &options=IFillOptions(), const IBlend *pBlend=0)=0
Fill the current current path.
-
IGraphics::GetPlatformWindowScale
virtual float GetPlatformWindowScale() const
Returns a scaling factor for resizing parent windows via the host/plugin API.
Definition: IGraphics.h:1214
+
IGraphics::GetPlatformWindowScale
virtual float GetPlatformWindowScale() const
Returns a scaling factor for resizing parent windows via the host/plugin API.
Definition: IGraphics.h:1220
IGraphics::DrawText
void DrawText(const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=0)
Draw some text to the graphics context in a specific rectangle.
Definition: IGraphics.cpp:670
-
IGraphics::GetTotalScale
float GetTotalScale() const
Gets the combined draw and screen/display scaling factor.
Definition: IGraphics.h:1107
+
IGraphics::GetTotalScale
float GetTotalScale() const
Gets the combined draw and screen/display scaling factor.
Definition: IGraphics.h:1113
IGraphics::GetParamIdxForPTAutomation
int GetParamIdxForPTAutomation(float x, float y)
[AAX only] This can be called by the ProTools API class (e.g.
Definition: IGraphics.cpp:1382
IGraphics::CreatePopupMenu
void CreatePopupMenu(IControl &control, IPopupMenu &menu, const IRECT &bounds, int valIdx=0)
Shows a pop up/contextual menu in relation to a rectangular region of the graphics context.
Definition: IGraphics.cpp:1960
IGraphics::CreateTextEntry
void CreateTextEntry(IControl &control, const IText &text, const IRECT &bounds, const char *str="", int valIdx=0)
Create a text entry box.
Definition: IGraphics.cpp:1923
@@ -3155,7 +3155,7 @@
IGraphics::SetPTParameterHighlight
void SetPTParameterHighlight(int paramIdx, bool isHighlighted, int color)
[AAX only] See AAX_CEffectGUI::SetControlHighlightInfo()
Definition: IGraphics.cpp:1396
IGraphics::PathClose
virtual void PathClose()=0
Close the path that is being specified.
IGraphics::PathTransformTranslate
void PathTransformTranslate(float x, float y)
Apply a translation transform to the current path.
Definition: IGraphics.cpp:2730
-
IGraphics::ClearInTextEntryControl
void ClearInTextEntryControl()
Called when the text entry is dismissed, to reset mInTextEntry.
Definition: IGraphics.h:1128
+
IGraphics::ClearInTextEntryControl
void ClearInTextEntryControl()
Called when the text entry is dismissed, to reset mInTextEntry.
Definition: IGraphics.h:1134
IGraphics::DrawRadialLine
void DrawRadialLine(const IColor &color, float cx, float cy, float angle, float rMin, float rMax, const IBlend *pBlend=0, float thickness=1.f)
Draw a radial line to the graphics context, useful for pointers on dials.
Definition: IGraphics.cpp:811
IGraphics::PathRect
void PathRect(const IRECT &bounds)
Add a rectangle to the current path.
Definition: IGraphics.cpp:2635
IGraphics::RetainBitmap
virtual void RetainBitmap(const IBitmap &bitmap, const char *cacheName)
Adds an IBitmap to the cache/static storage.
Definition: IGraphics.cpp:1840
@@ -3176,13 +3176,13 @@
IGraphics::OnMouseOut
void OnMouseOut()
Called when the mouse leaves the graphics context.
Definition: IGraphics.cpp:1145
IGraphics::UpdatePeers
void UpdatePeers(IControl *pCaller, int callerValIdx)
This method is called after interacting with a control, so that any other controls linked to the same...
Definition: IGraphics.cpp:603
IGraphics::RemovePopupMenuControl
void RemovePopupMenuControl()
Remove the IGraphics popup menu, use platform popup menu if available.
Definition: IGraphics.cpp:365
-
IGraphics::GetBackingPixelScale
virtual float GetBackingPixelScale() const
Definition: IGraphics.h:1772
+
IGraphics::GetBackingPixelScale
virtual float GetBackingPixelScale() const
Definition: IGraphics.h:1778
IGraphics::DrawRotatedBitmap
virtual void DrawRotatedBitmap(const IBitmap &bitmap, float destCentreX, float destCentreY, double angle, const IBlend *pBlend=0)
Draw a bitmap (raster) image to the graphics context with rotation.
Definition: IGraphics.cpp:2399
IGraphics::OnKeyDown
bool OnKeyDown(float x, float y, const IKeyPress &key)
Definition: IGraphics.cpp:1230
IGraphics::AlphaChannel
virtual int AlphaChannel() const =0
IGraphics::AttachGestureRecognizerToRegion
void AttachGestureRecognizerToRegion(const IRECT &bounds, EGestureType type, IGestureFunc func)
Attach a gesture recognizer to a rectangular region of the GUI, i.e.
Definition: IGraphics.cpp:2386
-
IGraphics::MultiTouchEnabled
bool MultiTouchEnabled() const
Definition: IGraphics.h:1155
-
IGraphics::Width
int Width() const
Gets the width of the graphics context.
Definition: IGraphics.h:1075
+
IGraphics::MultiTouchEnabled
bool MultiTouchEnabled() const
Definition: IGraphics.h:1161
+
IGraphics::Width
int Width() const
Gets the width of the graphics context.
Definition: IGraphics.h:1081
IGraphics::EndFrame
virtual void EndFrame()
Called by some drawing API classes to finally blit the draw bitmap onto the screen or perform other c...
Definition: IGraphics.h:100
IGraphics::DisableControl
void DisableControl(int paramIdx, bool diable)
Disable or enable controls linked to a specific parameter.
Definition: IGraphics.cpp:483
IGraphics::SetControlBounds
void SetControlBounds(IControl *pControl, const IRECT &r)
Set a controls target and draw rect to r, redrawing the interface correctly.
Definition: IGraphics.cpp:228
@@ -3196,10 +3196,10 @@
IGraphics::PathTransformReset
void PathTransformReset(bool clearStates=false)
Reset the affine transform of the current path, to the default state.
Definition: IGraphics.cpp:2718
IGraphics::OnAppearanceChanged
void OnAppearanceChanged(EUIAppearance appearance)
Called by the platform class if the view changes to dark/light mode.
Definition: IGraphics.cpp:1514
IGraphics::CalculateTextRotation
void CalculateTextRotation(const IText &text, const IRECT &bounds, IRECT &rect, double &tx, double &ty) const
Definition: IGraphics.cpp:2235
-
IGraphics::IsInPlatformTextEntry
bool IsInPlatformTextEntry()
Definition: IGraphics.h:1122
+
IGraphics::IsInPlatformTextEntry
bool IsInPlatformTextEntry()
Definition: IGraphics.h:1128
IGraphics::PathStroke
virtual void PathStroke(const IPattern &pattern, float thickness, const IStrokeOptions &options=IStrokeOptions(), const IBlend *pBlend=0)=0
Stroke the current current path.
IGraphics::CheckLayer
bool CheckLayer(const ILayerPtr &layer)
Test to see if a layer needs drawing, for instance if the control's bounds were changed.
Definition: IGraphics.cpp:2032
-
IGraphics::WindowWidth
int WindowWidth() const
Gets the width of the graphics context including draw scaling.
Definition: IGraphics.h:1083
+
IGraphics::WindowWidth
int WindowWidth() const
Gets the width of the graphics context including draw scaling.
Definition: IGraphics.h:1089
IGraphics::Draw
void Draw(IRECTList &rects)
Called by the platform class indicating a number of rectangles in the UI that need to redraw.
Definition: IGraphics.cpp:938
IGraphics::SearchImageResource
EResourceLocation SearchImageResource(const char *fileName, const char *type, WDL_String &result, int targetScale, int &sourceScale)
Search for a bitmap image resource matching the target scale.
Definition: IGraphics.cpp:1876
IGraphics::GetControlWithParamIdx
IControl * GetControlWithParamIdx(int paramIdx)
Get the first control with a parameter index that matches paramIdx.
Definition: IGraphics.cpp:463
@@ -3213,9 +3213,9 @@
IGraphics::GetLastClickedParamForPTAutomation
int GetLastClickedParamForPTAutomation()
[AAX only]
Definition: IGraphics.cpp:1389
IGraphics::ForControlWithParam
void ForControlWithParam(int paramIdx, IControlFunction func)
For all standard controls in the main control stack that are linked to a specific parameter,...
Definition: IGraphics.cpp:488
IGraphics::AttachBubbleControl
void AttachBubbleControl(const IText &text=DEFAULT_TEXT)
Attach the default control to show text as a control changes.
Definition: IGraphics.cpp:344
-
IGraphics::GetResizerMode
EUIResizerMode GetResizerMode() const
Definition: IGraphics.h:1134
+
IGraphics::GetResizerMode
EUIResizerMode GetResizerMode() const
Definition: IGraphics.h:1140
IGraphics::FillRect
virtual void FillRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill a rectangular region of the graphics context with a color.
Definition: IGraphics.cpp:2569
-
IGraphics::GetRoundedScreenScale
int GetRoundedScreenScale() const
Gets the screen/display scaling factor, rounded up.
Definition: IGraphics.h:1103
+
IGraphics::GetRoundedScreenScale
int GetRoundedScreenScale() const
Gets the screen/display scaling factor, rounded up.
Definition: IGraphics.h:1109
IGraphics::SearchBitmapInCache
APIBitmap * SearchBitmapInCache(const char *fileName, int targetScale, int &sourceScale)
Search the static storage cache for a bitmap image resource matching the target scale.
Definition: IGraphics.cpp:1898
IGraphics::DrawLine
virtual void DrawLine(const IColor &color, float x1, float y1, float x2, float y2, const IBlend *pBlend=0, float thickness=1.f)
Draw a line to the graphics context.
Definition: IGraphics.cpp:2416
IGraphics::DrawArc
virtual void DrawArc(const IColor &color, float cx, float cy, float r, float a1, float a2, const IBlend *pBlend=0, float thickness=1.f)
Draw an arc to the graphics context.
Definition: IGraphics.cpp:2525
@@ -3230,7 +3230,7 @@
IGraphics::RemoveAllControls
void RemoveAllControls()
Removes all regular IControls from the control list, as well as special controls (frees memory).
Definition: IGraphics.cpp:194
IGraphics::DrawCircle
virtual void DrawCircle(const IColor &color, float cx, float cy, float r, const IBlend *pBlend=0, float thickness=1.f)
Draw a circle to the graphics context.
Definition: IGraphics.cpp:2532
IGraphics::OnMouseDown
void OnMouseDown(const std::vector< IMouseInfo > &points)
Called when the platform class sends mouse down events.
Definition: IGraphics.cpp:971
-
IGraphics::Height
int Height() const
Gets the height of the graphics context.
Definition: IGraphics.h:1079
+
IGraphics::Height
int Height() const
Gets the height of the graphics context.
Definition: IGraphics.h:1085
IGraphics::PathClipRegion
void PathClipRegion(const IRECT r=IRECT())
Clip the current path to a particular region.
Definition: IGraphics.cpp:2765
IGraphics::PathCircle
void PathCircle(float cx, float cy, float r)
Add a circle to the current path.
Definition: IGraphics.cpp:2688
IGraphics::PathRadialLine
void PathRadialLine(float cx, float cy, float angle, float rMin, float rMax)
Add a radial line to the current path.
Definition: IGraphics.cpp:818
@@ -3243,8 +3243,8 @@
IGraphics::ForAllControls
void ForAllControls(T method, Args... args)
For all controls, including the "special controls" call a method.
Definition: IGraphics.cpp:571
IGraphics::ClearGestureRegions
void ClearGestureRegions()
Remove all gesture recognizers linked to regions.
Definition: IGraphics.cpp:2393
IGraphics::SetControlValueAfterTextEdit
void SetControlValueAfterTextEdit(const char *str)
Called by the platform class after returning from a text entry in order to update a control with a ne...
Definition: IGraphics.cpp:235
-
IGraphics::GetWinModuleHandle
virtual void * GetWinModuleHandle()
Definition: IGraphics.h:920
-
IGraphics::NControls
int NControls() const
Definition: IGraphics.h:1431
+
IGraphics::GetWinModuleHandle
virtual void * GetWinModuleHandle()
Definition: IGraphics.h:926
+
IGraphics::NControls
int NControls() const
Definition: IGraphics.h:1437
IGraphics::UpdateLayer
virtual void UpdateLayer()
Implemented by a graphics backend to prepare for drawing to the layer at the top of the stack.
Definition: IGraphics.h:578
IGraphics::DrawData
virtual void DrawData(const IColor &color, const IRECT &bounds, float *normYPoints, int nPoints, float *normXPoints=nullptr, const IBlend *pBlend=0, float thickness=1.f, const IColor *pFillColor=nullptr)
Draw a line between a collection of normalized points.
Definition: IGraphics.cpp:2450
IGraphics::SetQwertyMidiKeyHandlerFunc
void SetQwertyMidiKeyHandlerFunc(std::function< void(const IMidiMsg &msg)> func=nullptr)
A helper to set the IGraphics KeyHandlerFunc in order to make an instrument playable via QWERTY keys.
Definition: IGraphics.cpp:2275
@@ -3254,7 +3254,7 @@
IGraphics::DrawGrid
virtual void DrawGrid(const IColor &color, const IRECT &bounds, float gridSizeH, float gridSizeV, const IBlend *pBlend=0, float thickness=1.f)
Draw a grid to the graphics context.
Definition: IGraphics.cpp:2424
IGraphics::SetAllControlsDirty
void SetAllControlsDirty()
Calls SetDirty() on every control.
Definition: IGraphics.cpp:582
IGraphics::ScaleBitmap
virtual IBitmap ScaleBitmap(const IBitmap &inBitmap, const char *cacheName, int targetScale)
Returns a new IBitmap, an integer scaled version of the input, and adds it to the cache.
Definition: IGraphics.cpp:1846
-
IGraphics::GetControlInTextEntry
IControl * GetControlInTextEntry()
Definition: IGraphics.h:1125
+
IGraphics::GetControlInTextEntry
IControl * GetControlInTextEntry()
Definition: IGraphics.h:1131
IGraphics::GetScaledBitmap
IBitmap GetScaledBitmap(IBitmap &inBitmap)
Get a version of the input bitmap from the cache that corresponds to the current screen scale For exa...
Definition: IGraphics.cpp:1520
IGraphics::AttachPanelBackground
void AttachPanelBackground(const IPattern &color)
Attach an IPanelControl as the lowest IControl in the control stack to fill the background with a sol...
Definition: IGraphics.cpp:294
IGraphics::FillConvexPolygon
virtual void FillConvexPolygon(const IColor &color, float *x, float *y, int nPoints, const IBlend *pBlend=0)
Fill a convex polygon with a color.
Definition: IGraphics.cpp:2590
@@ -3262,7 +3262,7 @@
IGraphics::StyleAllVectorControls
void StyleAllVectorControls(const IVStyle &style)
Helper method to style all of the controls which inherit IVectorBase.
Definition: IGraphics.cpp:1913
IGraphics::CreatePlatformPopupMenu
virtual IPopupMenu * CreatePlatformPopupMenu(IPopupMenu &menu, const IRECT bounds, bool &isAsync)=0
Calls the platform backend to create the platform popup menu.
IGraphics::RemoveControlWithTag
void RemoveControlWithTag(int ctrlTag)
Remove controls from the control list with a particular tag.
Definition: IGraphics.cpp:132
-
IGraphics::GetTouches
void GetTouches(IControl *pControl, std::vector< ITouchID > &touchesOnThisControl) const
Populate a vector with the touchIDs active on pControl.
Definition: IGraphics.h:1399
+
IGraphics::GetTouches
void GetTouches(IControl *pControl, std::vector< ITouchID > &touchesOnThisControl) const
Populate a vector with the touchIDs active on pControl.
Definition: IGraphics.h:1405
IGraphics::OnMouseWheel
void OnMouseWheel(float x, float y, const IMouseMod &mod, float delta)
Definition: IGraphics.cpp:1223
IGraphics::DrawVerticalLine
void DrawVerticalLine(const IColor &color, const IRECT &bounds, float x, const IBlend *pBlend=0, float thickness=1.f)
Draw a vertical line, within a rectangular region of the graphics context.
Definition: IGraphics.cpp:787
IGraphics::PathMoveTo
virtual void PathMoveTo(float x, float y)=0
Move the current point in the current path.
@@ -3271,7 +3271,7 @@
IGraphics::FlippedBitmap
virtual bool FlippedBitmap() const =0
IGraphics::PromptUserInput
void PromptUserInput(IControl &control, const IRECT &bounds, int valIdx=0)
Prompt for user input either using a text entry or pop up menu.
Definition: IGraphics.cpp:622
IGraphics::SetControlSize
void SetControlSize(IControl *pControl, float w, float h)
Resize a control, redrawing the interface correctly.
Definition: IGraphics.cpp:221
-
IGraphics::GetScreenScale
float GetScreenScale() const
Gets the screen/display scaling factor, e.g.
Definition: IGraphics.h:1099
+
IGraphics::GetScreenScale
float GetScreenScale() const
Gets the screen/display scaling factor, e.g.
Definition: IGraphics.h:1105
IGraphics::LoadAPIFont
virtual bool LoadAPIFont(const char *fontID, const PlatformFontPtr &font)=0
Drawing API method to load a font from a PlatformFontPtr, called internally.
IGraphics::OnDropMultiple
void OnDropMultiple(const std::vector< const char * > &paths, float x, float y)
Definition: IGraphics.cpp:1272
IGraphics::AssignParamNameToolTips
void AssignParamNameToolTips()
Call this method in order to create tool tips for every IControl that show the associated parameter's...
Definition: IGraphics.cpp:592
@@ -3284,22 +3284,22 @@
IGraphics::DoDrawText
virtual void DoDrawText(const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=nullptr)=0
IGraphics::PathTransformSave
void PathTransformSave()
Save the current affine transform of the current path.
Definition: IGraphics.cpp:2703
IGraphics::FillArc
virtual void FillArc(const IColor &color, float cx, float cy, float r, float a1, float a2, const IBlend *pBlend=0)
Fill an arc segment with a color.
Definition: IGraphics.cpp:2597
-
IGraphics::SetKeyHandlerFunc
void SetKeyHandlerFunc(IKeyHandlerFunc func)
Set a function that is called when key presses are not intercepted by any controls.
Definition: IGraphics.h:1200
+
IGraphics::SetKeyHandlerFunc
void SetKeyHandlerFunc(IKeyHandlerFunc func)
Set a function that is called when key presses are not intercepted by any controls.
Definition: IGraphics.h:1206
IGraphics::DrawDottedLine
virtual void DrawDottedLine(const IColor &color, float x1, float y1, float x2, float y2, const IBlend *pBlend=0, float thickness=1.f, float dashLen=2.f)
Draw a dotted line to the graphics context.
Definition: IGraphics.cpp:2479
IGraphics::RemoveTextEntryControl
void RemoveTextEntryControl()
Remove the IGraphics text entry, use platform text entry if available.
Definition: IGraphics.cpp:379
IGraphics::ShowFPSDisplay
void ShowFPSDisplay(bool enable)
Shows a control to display the frame rate of drawing.
Definition: IGraphics.cpp:429
IGraphics::PathLineTo
virtual void PathLineTo(float x, float y)=0
Add a line to the current path from the current point to the specified location.
IGraphics::DrawLineAcross
void DrawLineAcross(const IColor &color, const IRECT &bounds, EDirection dir, float pos, const IBlend *pBlend=0, float thickness=1.f)
Draw a horzional or vertical line, within a rectangular region of the graphics context.
Definition: IGraphics.cpp:779
-
IGraphics::GetSharedResourcesSubPath
const char * GetSharedResourcesSubPath() const
Gets the name of the shared resources subpath.
Definition: IGraphics.h:1630
+
IGraphics::GetSharedResourcesSubPath
const char * GetSharedResourcesSubPath() const
Gets the name of the shared resources subpath.
Definition: IGraphics.h:1636
IGraphics::PathTransformSkew
void PathTransformSkew(float xAngle, float yAngle)
Apply a skew transform to the current path.
Definition: IGraphics.cpp:2753
-
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1095
+
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1101
IGraphics::DrawFittedLayer
void DrawFittedLayer(const ILayerPtr &layer, const IRECT &bounds, const IBlend *pBlend)
Draw a layer to the main IGraphics context, fitting it to a rectangle that is different to the layer'...
Definition: IGraphics.cpp:2053
IGraphics::RemoveControls
void RemoveControls(int fromIdx)
Remove controls from the control list above a particular index, (frees memory).
Definition: IGraphics.cpp:139
IGraphics::AttachBackground
void AttachBackground(const char *fileName)
Attach an IBitmapControl as the lowest IControl in the control stack to be the background for the gra...
Definition: IGraphics.cpp:280
IGraphics::SetStrictDrawing
void SetStrictDrawing(bool strict)
Enables strict drawing mode.
Definition: IGraphics.cpp:965
IGraphics::OnGUIIdle
void OnGUIIdle()
This is an idle timer tick call on the GUI thread, only active if USE_IDLE_CALLS is defined.
Definition: IGraphics.cpp:1493
-
IGraphics::GetDelegate
IGEditorDelegate * GetDelegate()
Gets a pointer to the delegate class that handles communication to and from this graphics context.
Definition: IGraphics.h:1116
-
IGraphics::GetControl
IControl * GetControl(int idx)
Get the control at a certain index in the control stack.
Definition: IGraphics.h:1348
+
IGraphics::GetDelegate
IGEditorDelegate * GetDelegate()
Gets a pointer to the delegate class that handles communication to and from this graphics context.
Definition: IGraphics.h:1122
+
IGraphics::GetControl
IControl * GetControl(int idx)
Get the control at a certain index in the control stack.
Definition: IGraphics.h:1354
IGraphics::StartLayer
void StartLayer(IControl *pOwner, const IRECT &r, bool cacheable=false)
Create an IGraphics layer.
Definition: IGraphics.cpp:1977
IGraphics::OnGestureRecognized
void OnGestureRecognized(const IGestureInfo &info)
Called by platform class when a gesture is recognized.
Definition: IGraphics.cpp:2363
IGraphics::CachePlatformFont
virtual void CachePlatformFont(const char *fontID, const PlatformFontPtr &font)=0
Called to indicate that the platform should cache data about the platform font if needed.
@@ -3308,7 +3308,7 @@
IGraphics::ForStandardControlsFunc
void ForStandardControlsFunc(IControlFunction func)
For all standard controls in the main control stack perform a function.
Definition: IGraphics.cpp:534
IGraphics::DrawTriangle
virtual void DrawTriangle(const IColor &color, float x1, float y1, float x2, float y2, float x3, float y3, const IBlend *pBlend=0, float thickness=1.f)
Draw a triangle to the graphics context.
Definition: IGraphics.cpp:2490
IGraphics::PathCubicBezierTo
virtual void PathCubicBezierTo(float c1x, float c1y, float c2x, float c2y, float x2, float y2)=0
Add a cubic bezier to the current path from the current point to the specified location.
-
IGraphics::WindowHeight
int WindowHeight() const
Gets the height of the graphics context including draw scaling.
Definition: IGraphics.h:1087
+
IGraphics::WindowHeight
int WindowHeight() const
Gets the height of the graphics context including draw scaling.
Definition: IGraphics.h:1093
IGraphics::PathEllipse
void PathEllipse(const IRECT &bounds)
Add an ellipse to the current path, specifying the rectangular region.
Definition: IGraphics.cpp:2683
IGraphics::LoadBitmap
virtual IBitmap LoadBitmap(const char *fileNameOrResID, int nStates=1, bool framesAreHorizontal=false, int targetScale=0)
Load a bitmap image from disk or from windows resource.
Definition: IGraphics.cpp:1721
IGraphics::BeginFrame
virtual void BeginFrame()
Called at the beginning of drawing.
Definition: IGraphics.cpp:867
@@ -3318,7 +3318,7 @@
IGraphics::EndLayer
ILayerPtr EndLayer()
End an IGraphics layer.
Definition: IGraphics.cpp:2000
IGraphics::LoadResource
virtual WDL_TypedBuf< uint8_t > LoadResource(const char *fileNameOrResID, const char *fileType)
Load a resource from the file system, the bundle, or a Windows resource, and returns its data.
Definition: IGraphics.cpp:1666
IGraphics::OnDrop
void OnDrop(const char *str, float x, float y)
Definition: IGraphics.cpp:1266
-
IGraphics::GetBounds
IRECT GetBounds() const
Returns an IRECT that represents the entire UI bounds This is useful for programatically arranging UI...
Definition: IGraphics.h:1188
+
IGraphics::GetBounds
IRECT GetBounds() const
Returns an IRECT that represents the entire UI bounds This is useful for programatically arranging UI...
Definition: IGraphics.h:1194
IGraphics::AttachControl
IControl * AttachControl(IControl *pControl, int ctrlTag=kNoTag, const char *group="")
Attach an IControl to the graphics context and add it to the top of the control stack.
Definition: IGraphics.cpp:301
IGraphics::DrawBitmap
virtual void DrawBitmap(const IBitmap &bitmap, const IRECT &bounds, int srcX, int srcY, const IBlend *pBlend=0)=0
Draw a bitmap (raster) image to the graphics context.
IGraphics::MeasureText
virtual float MeasureText(const IText &text, const char *str, IRECT &bounds) const
Measure the rectangular region that some text will occupy.
Definition: IGraphics.cpp:678
diff --git a/_i_graphics_8h_source.html b/_i_graphics_8h_source.html index 30d8319f..6464a063 100644 --- a/_i_graphics_8h_source.html +++ b/_i_graphics_8h_source.html @@ -434,529 +434,531 @@
862
866 virtual bool SetFilePathInClipboard(const char* path) { return false; }
867
-
869 virtual void UpdateTooltips() = 0;
-
870
-
877 virtual EMsgBoxResult ShowMessageBox(const char* str, const char* caption, EMsgBoxType type, IMsgBoxCompletionHandlerFunc completionHandler = nullptr) = 0;
-
878
-
885 virtual void PromptForFile(WDL_String& fileName, WDL_String& path, EFileAction action = EFileAction::Open, const char* ext = "", IFileDialogCompletionHandlerFunc completionHandler = nullptr) = 0;
-
886
-
890 virtual void PromptForDirectory(WDL_String& dir, IFileDialogCompletionHandlerFunc completionHandler = nullptr) = 0;
-
891
-
897 virtual bool PromptForColor(IColor& color, const char* str = "", IColorPickerHandlerFunc func = nullptr) = 0;
-
898
-
905 virtual bool OpenURL(const char* url, const char* msgWindowTitle = 0, const char* confirmMsg = 0, const char* errMsgOnFailure = 0) = 0;
-
906
-
908 virtual const char* GetPlatformAPIStr() { return ""; }
-
909
-
913 virtual bool RevealPathInExplorerOrFinder(WDL_String& path, bool select = false) { return false; }
-
914
-
917 virtual void SetWinModuleHandle(void* pHinstance) {}
-
918
-
920 virtual void* GetWinModuleHandle() { return nullptr; }
-
921
-
925 void SetPlatformContext(void* pContext) { mPlatformContext = pContext; }
-
926
-
929 void* GetPlatformContext() { return mPlatformContext; }
-
930
-
934 virtual void ClientToScreen(float& x, float& y) {};
-
935
-
940 virtual PlatformFontPtr LoadPlatformFont(const char* fontID, const char* fileNameOrResID) = 0;
+
872 virtual bool InitiateExternalFileDragDrop(const char* path, const IRECT& iconBounds) { return false; };
+
873
+
875 virtual void UpdateTooltips() = 0;
+
876
+
883 virtual EMsgBoxResult ShowMessageBox(const char* str, const char* caption, EMsgBoxType type, IMsgBoxCompletionHandlerFunc completionHandler = nullptr) = 0;
+
884
+
891 virtual void PromptForFile(WDL_String& fileName, WDL_String& path, EFileAction action = EFileAction::Open, const char* ext = "", IFileDialogCompletionHandlerFunc completionHandler = nullptr) = 0;
+
892
+
896 virtual void PromptForDirectory(WDL_String& dir, IFileDialogCompletionHandlerFunc completionHandler = nullptr) = 0;
+
897
+
903 virtual bool PromptForColor(IColor& color, const char* str = "", IColorPickerHandlerFunc func = nullptr) = 0;
+
904
+
911 virtual bool OpenURL(const char* url, const char* msgWindowTitle = 0, const char* confirmMsg = 0, const char* errMsgOnFailure = 0) = 0;
+
912
+
914 virtual const char* GetPlatformAPIStr() { return ""; }
+
915
+
919 virtual bool RevealPathInExplorerOrFinder(WDL_String& path, bool select = false) { return false; }
+
920
+
923 virtual void SetWinModuleHandle(void* pHinstance) {}
+
924
+
926 virtual void* GetWinModuleHandle() { return nullptr; }
+
927
+
931 void SetPlatformContext(void* pContext) { mPlatformContext = pContext; }
+
932
+
935 void* GetPlatformContext() { return mPlatformContext; }
+
936
+
940 virtual void ClientToScreen(float& x, float& y) {};
941
-
947 virtual PlatformFontPtr LoadPlatformFont(const char* fontID, void* pData, int dataSize) = 0;
-
948
-
954 virtual PlatformFontPtr LoadPlatformFont(const char* fontID, const char* fontName, ETextStyle style) = 0;
-
955
-
959 virtual void CachePlatformFont(const char* fontID, const PlatformFontPtr& font) = 0;
-
960
-
962 virtual const char* GetBundleID() const { return ""; }
-
963
-
965 virtual const char* GetAppGroupID() const { return ""; }
+
946 virtual PlatformFontPtr LoadPlatformFont(const char* fontID, const char* fileNameOrResID) = 0;
+
947
+
953 virtual PlatformFontPtr LoadPlatformFont(const char* fontID, void* pData, int dataSize) = 0;
+
954
+
960 virtual PlatformFontPtr LoadPlatformFont(const char* fontID, const char* fontName, ETextStyle style) = 0;
+
961
+
965 virtual void CachePlatformFont(const char* fontID, const PlatformFontPtr& font) = 0;
966
-
967protected:
-
968 /* Implemented on Windows to store previously active GLContext and HDC for restoring, calls GetDC */
-
969 virtual void ActivateGLContext() {};
-
970
-
971 /* Implemented on Windows to restore previous GL context calls ReleaseDC */
-
972 virtual void DeactivateGLContext() {};
-
973
-
980 virtual void CreatePlatformTextEntry(int paramIdx, const IText& text, const IRECT& bounds, int length, const char* str) = 0;
-
981
-
987 virtual IPopupMenu* CreatePlatformPopupMenu(IPopupMenu& menu, const IRECT bounds, bool& isAsync) = 0;
-
988
-
989#pragma mark - Base implementation
-
990public:
-
991 IGraphics(IGEditorDelegate& dlg, int w, int h, int fps = DEFAULT_FPS, float scale = 1.);
-
992
-
993 virtual ~IGraphics();
-
994
-
995 IGraphics(const IGraphics&) = delete;
-
996 IGraphics& operator=(const IGraphics&) = delete;
-
997
-
1000 void SetScreenScale(float scale);
-
1001
-
1003 void SetTranslation(float x, float y) { mXTranslation = x; mYTranslation = y; }
-
1004
-
1008 bool IsDirty(IRECTList& rects);
-
1009
-
1012 void Draw(IRECTList& rects);
-
1013
-
1018 void PromptUserInput(IControl& control, const IRECT& bounds, int valIdx = 0);
+
968 virtual const char* GetBundleID() const { return ""; }
+
969
+
971 virtual const char* GetAppGroupID() const { return ""; }
+
972
+
973protected:
+
974 /* Implemented on Windows to store previously active GLContext and HDC for restoring, calls GetDC */
+
975 virtual void ActivateGLContext() {};
+
976
+
977 /* Implemented on Windows to restore previous GL context calls ReleaseDC */
+
978 virtual void DeactivateGLContext() {};
+
979
+
986 virtual void CreatePlatformTextEntry(int paramIdx, const IText& text, const IRECT& bounds, int length, const char* str) = 0;
+
987
+
993 virtual IPopupMenu* CreatePlatformPopupMenu(IPopupMenu& menu, const IRECT bounds, bool& isAsync) = 0;
+
994
+
995#pragma mark - Base implementation
+
996public:
+
997 IGraphics(IGEditorDelegate& dlg, int w, int h, int fps = DEFAULT_FPS, float scale = 1.);
+
998
+
999 virtual ~IGraphics();
+
1000
+
1001 IGraphics(const IGraphics&) = delete;
+
1002 IGraphics& operator=(const IGraphics&) = delete;
+
1003
+
1006 void SetScreenScale(float scale);
+
1007
+
1009 void SetTranslation(float x, float y) { mXTranslation = x; mYTranslation = y; }
+
1010
+
1014 bool IsDirty(IRECTList& rects);
+
1015
+
1018 void Draw(IRECTList& rects);
1019
-
1025 void CreatePopupMenu(IControl& control, IPopupMenu& menu, const IRECT& bounds, int valIdx = 0);
-
1026
-
1032 void CreatePopupMenu(IControl& control, IPopupMenu& menu, float x, float y, int valIdx = 0)
-
1033 {
-
1034 return CreatePopupMenu(control, menu, IRECT(x, y, x, y), valIdx);
-
1035 }
-
1036
-
1043 void CreateTextEntry(IControl& control, const IText& text, const IRECT& bounds, const char* str = "", int valIdx = 0);
-
1044
-
1047 void SetControlValueAfterTextEdit(const char* str);
-
1048
-
1051 void SetControlValueAfterPopupMenu(IPopupMenu* pMenu);
-
1052
-
1056 void SetScaleConstraints(float lo, float hi);
-
1057
-
1064 void Resize(int w, int h, float scale, bool needsPlatformResize = true);
-
1065
-
1068 void SetStrictDrawing(bool strict);
-
1069
-
1070 /* Enables layout on resize. This means IGEditorDelegate:LayoutUI() will be called when the GUI is resized */
-
1071 void SetLayoutOnResize(bool layoutOnResize);
-
1072
-
1075 int Width() const { return mWidth; }
-
1076
-
1079 int Height() const { return mHeight; }
-
1080
-
1083 int WindowWidth() const { return static_cast<int>(static_cast<float>(mWidth) * mDrawScale); }
-
1084
-
1087 int WindowHeight() const { return static_cast<int>(static_cast<float>(mHeight) * mDrawScale); }
-
1088
-
1091 int FPS() const { return mFPS; }
-
1092
-
1095 float GetDrawScale() const { return mDrawScale; }
-
1096
-
1099 float GetScreenScale() const { return mScreenScale; }
-
1100
-
1103 int GetRoundedScreenScale() const { return static_cast<int>(std::ceil(GetScreenScale())); }
-
1104
-
1107 float GetTotalScale() const { return mDrawScale * mScreenScale; }
-
1108
-
1112 IRECT GetPixelSnapped(IRECT &r) const { return r.GetPixelSnapped(GetBackingPixelScale()); }
-
1113
-
1116 IGEditorDelegate* GetDelegate() { return mDelegate; }
-
1117
-
1119 IPopupMenu& GetPromptMenu() { return mPromptPopupMenu; }
-
1120
-
1122 bool IsInPlatformTextEntry() { return mInTextEntry != nullptr && !mTextEntryControl; }
-
1123
-
1125 IControl* GetControlInTextEntry() { return mInTextEntry; }
+
1024 void PromptUserInput(IControl& control, const IRECT& bounds, int valIdx = 0);
+
1025
+
1031 void CreatePopupMenu(IControl& control, IPopupMenu& menu, const IRECT& bounds, int valIdx = 0);
+
1032
+
1038 void CreatePopupMenu(IControl& control, IPopupMenu& menu, float x, float y, int valIdx = 0)
+
1039 {
+
1040 return CreatePopupMenu(control, menu, IRECT(x, y, x, y), valIdx);
+
1041 }
+
1042
+
1049 void CreateTextEntry(IControl& control, const IText& text, const IRECT& bounds, const char* str = "", int valIdx = 0);
+
1050
+
1053 void SetControlValueAfterTextEdit(const char* str);
+
1054
+
1057 void SetControlValueAfterPopupMenu(IPopupMenu* pMenu);
+
1058
+
1062 void SetScaleConstraints(float lo, float hi);
+
1063
+
1070 void Resize(int w, int h, float scale, bool needsPlatformResize = true);
+
1071
+
1074 void SetStrictDrawing(bool strict);
+
1075
+
1076 /* Enables layout on resize. This means IGEditorDelegate:LayoutUI() will be called when the GUI is resized */
+
1077 void SetLayoutOnResize(bool layoutOnResize);
+
1078
+
1081 int Width() const { return mWidth; }
+
1082
+
1085 int Height() const { return mHeight; }
+
1086
+
1089 int WindowWidth() const { return static_cast<int>(static_cast<float>(mWidth) * mDrawScale); }
+
1090
+
1093 int WindowHeight() const { return static_cast<int>(static_cast<float>(mHeight) * mDrawScale); }
+
1094
+
1097 int FPS() const { return mFPS; }
+
1098
+
1101 float GetDrawScale() const { return mDrawScale; }
+
1102
+
1105 float GetScreenScale() const { return mScreenScale; }
+
1106
+
1109 int GetRoundedScreenScale() const { return static_cast<int>(std::ceil(GetScreenScale())); }
+
1110
+
1113 float GetTotalScale() const { return mDrawScale * mScreenScale; }
+
1114
+
1118 IRECT GetPixelSnapped(IRECT &r) const { return r.GetPixelSnapped(GetBackingPixelScale()); }
+
1119
+
1122 IGEditorDelegate* GetDelegate() { return mDelegate; }
+
1123
+
1125 IPopupMenu& GetPromptMenu() { return mPromptPopupMenu; }
1126
-
1128 void ClearInTextEntryControl() { mInTextEntry = nullptr; }
+
1128 bool IsInPlatformTextEntry() { return mInTextEntry != nullptr && !mTextEntryControl; }
1129
-
1131 inline bool TooltipsEnabled() const { return mEnableTooltips; }
+
1131 IControl* GetControlInTextEntry() { return mInTextEntry; }
1132
-
1134 EUIResizerMode GetResizerMode() const { return mGUISizeMode; }
-
1135
-
1137 bool GetResizingInProcess() const { return mResizingInProcess; }
-
1138
-
1141 bool EnableMultiTouch(bool enable)
-
1142 {
-
1143 if (PlatformSupportsMultiTouch())
-
1144 {
-
1145 mEnableMultiTouch = enable;
-
1146 return true;
-
1147 }
-
1148 else
-
1149 mEnableMultiTouch = false;
-
1150
-
1151 return false;
-
1152 }
-
1153
-
1155 bool MultiTouchEnabled() const { return mEnableMultiTouch; }
+
1134 void ClearInTextEntryControl() { mInTextEntry = nullptr; }
+
1135
+
1137 inline bool TooltipsEnabled() const { return mEnableTooltips; }
+
1138
+
1140 EUIResizerMode GetResizerMode() const { return mGUISizeMode; }
+
1141
+
1143 bool GetResizingInProcess() const { return mResizingInProcess; }
+
1144
+
1147 bool EnableMultiTouch(bool enable)
+
1148 {
+
1149 if (PlatformSupportsMultiTouch())
+
1150 {
+
1151 mEnableMultiTouch = enable;
+
1152 return true;
+
1153 }
+
1154 else
+
1155 mEnableMultiTouch = false;
1156
-
1158 virtual bool PlatformSupportsMultiTouch() const { return false; }
+
1157 return false;
+
1158 }
1159
-
1161 void EnableTooltips(bool enable);
-
1162
-
1164 void AssignParamNameToolTips();
+
1161 bool MultiTouchEnabled() const { return mEnableMultiTouch; }
+
1162
+
1164 virtual bool PlatformSupportsMultiTouch() const { return false; }
1165
-
1167 inline void ShowControlBounds(bool enable) { mShowControlBounds = enable; SetAllControlsDirty(); }
+
1167 void EnableTooltips(bool enable);
1168
-
1170 inline void ShowAreaDrawn(bool enable) { mShowAreaDrawn = enable; if(!enable) SetAllControlsDirty(); }
+
1170 void AssignParamNameToolTips();
1171
-
1173 bool ShowAreaDrawnEnabled() const { return mShowAreaDrawn; }
+
1173 inline void ShowControlBounds(bool enable) { mShowControlBounds = enable; SetAllControlsDirty(); }
1174
-
1176 bool ShowControlBoundsEnabled() const { return mShowControlBounds; }
+
1176 inline void ShowAreaDrawn(bool enable) { mShowAreaDrawn = enable; if(!enable) SetAllControlsDirty(); }
1177
-
1180 void EnableLiveEdit(bool enable);
-
1181
-
1183 bool LiveEditEnabled() const { return mLiveEdit != nullptr; }
-
1184
-
1188 IRECT GetBounds() const { return IRECT(0.f, 0.f, (float) Width(), (float) Height()); }
-
1189
-
1192 void SetDisplayTickFunc(IDisplayTickFunc func) { mDisplayTickFunc = func; }
-
1193
-
1196 void SetUIAppearanceChangedFunc(IUIAppearanceChangedFunc func) { mAppearanceChangedFunc = func; }
-
1197
-
1200 void SetKeyHandlerFunc(IKeyHandlerFunc func) { mKeyHandlerFunc = func; }
-
1201
-
1204 void SetQwertyMidiKeyHandlerFunc(std::function<void(const IMidiMsg& msg)> func = nullptr);
-
1205
-
1207 bool RespondsToGesture(float x, float y);
-
1208
-
1210 void OnGestureRecognized(const IGestureInfo& info);
-
1211
-
1214 virtual float GetPlatformWindowScale() const { return 1.f; }
-
1215
-
1216private:
-
1217
-
1219 virtual void PlatformResize(bool parentHasResized) {}
-
1220
-
1222 virtual void DrawResize() {}
+
1179 bool ShowAreaDrawnEnabled() const { return mShowAreaDrawn; }
+
1180
+
1182 bool ShowControlBoundsEnabled() const { return mShowControlBounds; }
+
1183
+
1186 void EnableLiveEdit(bool enable);
+
1187
+
1189 bool LiveEditEnabled() const { return mLiveEdit != nullptr; }
+
1190
+
1194 IRECT GetBounds() const { return IRECT(0.f, 0.f, (float) Width(), (float) Height()); }
+
1195
+
1198 void SetDisplayTickFunc(IDisplayTickFunc func) { mDisplayTickFunc = func; }
+
1199
+
1202 void SetUIAppearanceChangedFunc(IUIAppearanceChangedFunc func) { mAppearanceChangedFunc = func; }
+
1203
+
1206 void SetKeyHandlerFunc(IKeyHandlerFunc func) { mKeyHandlerFunc = func; }
+
1207
+
1210 void SetQwertyMidiKeyHandlerFunc(std::function<void(const IMidiMsg& msg)> func = nullptr);
+
1211
+
1213 bool RespondsToGesture(float x, float y);
+
1214
+
1216 void OnGestureRecognized(const IGestureInfo& info);
+
1217
+
1220 virtual float GetPlatformWindowScale() const { return 1.f; }
+
1221
+
1222private:
1223
-
1227 void Draw(const IRECT& bounds, float scale);
-
1228
-
1233 void DrawControl(IControl* pControl, const IRECT& bounds, float scale);
+
1225 virtual void PlatformResize(bool parentHasResized) {}
+
1226
+
1228 virtual void DrawResize() {}
+
1229
+
1233 void Draw(const IRECT& bounds, float scale);
1234
-
1241 void DoCreatePopupMenu(IControl& control, IPopupMenu& menu, const IRECT& bounds, int valIdx, bool isContext);
-
1242
-
1244 void StartDragResize() { mResizingInProcess = true; }
-
1245
-
1247 void EndDragResize();
-
1248
-
1249#pragma mark - Control management
-
1250public:
-
1253 void ForAllControlsFunc(IControlFunction func);
-
1254
-
1258 template<typename T, typename... Args>
-
1259 void ForAllControls(T method, Args... args);
+
1239 void DrawControl(IControl* pControl, const IRECT& bounds, float scale);
+
1240
+
1247 void DoCreatePopupMenu(IControl& control, IPopupMenu& menu, const IRECT& bounds, int valIdx, bool isContext);
+
1248
+
1250 void StartDragResize() { mResizingInProcess = true; }
+
1251
+
1253 void EndDragResize();
+
1254
+
1255#pragma mark - Control management
+
1256public:
+
1259 void ForAllControlsFunc(IControlFunction func);
1260
-
1263 void ForStandardControlsFunc(IControlFunction func);
-
1264
-
1269 template<typename T, typename... Args>
-
1270 void ForMatchingControls(T method, int paramIdx, Args... args);
-
1271
-
1275 void ForControlWithParam(int paramIdx, IControlFunction func);
-
1276
-
1280 void ForControlWithParam(const std::initializer_list<int>& params, IControlFunction func);
-
1281
-
1285 void ForControlInGroup(const char* group, IControlFunction func);
-
1286
-
1289 void AttachBackground(const char* fileName);
-
1290
-
1293 void AttachSVGBackground(const char* fileName);
-
1294
-
1297 void AttachPanelBackground(const IPattern& color);
-
1298
-
1301 void AttachCornerResizer(EUIResizerMode sizeMode = EUIResizerMode::Scale, bool layoutOnResize = false, const IColor& color = COLOR_TRANSLUCENT, const IColor& mouseOverColor = COLOR_BLACK, const IColor& dragColor = COLOR_BLACK, float size = 20.f);
-
1302
-
1306 void AttachCornerResizer(ICornerResizerControl* pControl, EUIResizerMode sizeMode = EUIResizerMode::Scale, bool layoutOnResize = false);
-
1307
-
1311 void AttachPopupMenuControl(const IText& text = DEFAULT_TEXT, const IRECT& bounds = IRECT());
-
1312
-
1314 void RemovePopupMenuControl();
-
1315
-
1317 void AttachTextEntryControl();
+
1264 template<typename T, typename... Args>
+
1265 void ForAllControls(T method, Args... args);
+
1266
+
1269 void ForStandardControlsFunc(IControlFunction func);
+
1270
+
1275 template<typename T, typename... Args>
+
1276 void ForMatchingControls(T method, int paramIdx, Args... args);
+
1277
+
1281 void ForControlWithParam(int paramIdx, IControlFunction func);
+
1282
+
1286 void ForControlWithParam(const std::initializer_list<int>& params, IControlFunction func);
+
1287
+
1291 void ForControlInGroup(const char* group, IControlFunction func);
+
1292
+
1295 void AttachBackground(const char* fileName);
+
1296
+
1299 void AttachSVGBackground(const char* fileName);
+
1300
+
1303 void AttachPanelBackground(const IPattern& color);
+
1304
+
1307 void AttachCornerResizer(EUIResizerMode sizeMode = EUIResizerMode::Scale, bool layoutOnResize = false, const IColor& color = COLOR_TRANSLUCENT, const IColor& mouseOverColor = COLOR_BLACK, const IColor& dragColor = COLOR_BLACK, float size = 20.f);
+
1308
+
1312 void AttachCornerResizer(ICornerResizerControl* pControl, EUIResizerMode sizeMode = EUIResizerMode::Scale, bool layoutOnResize = false);
+
1313
+
1317 void AttachPopupMenuControl(const IText& text = DEFAULT_TEXT, const IRECT& bounds = IRECT());
1318
-
1320 void RemoveTextEntryControl();
+
1320 void RemovePopupMenuControl();
1321
-
1323 void AttachBubbleControl(const IText& text = DEFAULT_TEXT);
-
1324
-
1326 void AttachBubbleControl(IBubbleControl* pControl);
+
1323 void AttachTextEntryControl();
+
1324
+
1326 void RemoveTextEntryControl();
1327
-
1328 /* Called by controls to display text in the bubble control */
-
1329 void ShowBubbleControl(IControl* pCaller, float x, float y, const char* str, EDirection dir = EDirection::Horizontal, IRECT minimumContentBounds = IRECT());
+
1329 void AttachBubbleControl(const IText& text = DEFAULT_TEXT);
1330
-
1333 void ShowFPSDisplay(bool enable);
-
1334
-
1336 bool ShowingFPSDisplay() { return mPerfDisplay != nullptr; }
-
1337
-
1343 IControl* AttachControl(IControl* pControl, int ctrlTag = kNoTag, const char* group = "");
-
1344
-
1348 IControl* GetControl(int idx) { return mControls.Get(idx); }
-
1349
-
1353 int GetControlIdx(IControl* pControl) const { return mControls.Find(pControl); }
-
1354
-
1358 int GetIdxOfTaggedControl(int ctrlTag) const
-
1359 {
-
1360 IControl* pControl = GetControlWithTag(ctrlTag);
-
1361 return pControl ? GetControlIdx(pControl) : -1;
-
1362 }
-
1363
-
1367 IControl* GetControlWithTag(int ctrlTag) const;
-
1368
-
1372 int GetControlTag(const IControl* pControl) const
-
1373 {
-
1374 for (auto itr = mCtrlTags.begin(); itr != mCtrlTags.end(); ++itr)
-
1375 {
-
1376 if (itr->second == pControl)
-
1377 return itr->first;
-
1378 }
-
1379
-
1380 return kNoTag;
-
1381 }
-
1382
-
1386 IControl* GetControlWithParamIdx(int paramIdx);
-
1387
-
1389 bool ControlIsCaptured() const { return mCapturedMap.size() > 0; }
-
1390
-
1393 bool ControlIsCaptured(IControl* pControl) const
-
1394 {
-
1395 return std::find_if(std::begin(mCapturedMap), std::end(mCapturedMap), [pControl](auto&& press) { return press.second == pControl; }) != mCapturedMap.end();
-
1396 }
-
1397
-
1399 void GetTouches(IControl* pControl, std::vector<ITouchID>& touchesOnThisControl) const
+
1332 void AttachBubbleControl(IBubbleControl* pControl);
+
1333
+
1334 /* Called by controls to display text in the bubble control */
+
1335 void ShowBubbleControl(IControl* pCaller, float x, float y, const char* str, EDirection dir = EDirection::Horizontal, IRECT minimumContentBounds = IRECT());
+
1336
+
1339 void ShowFPSDisplay(bool enable);
+
1340
+
1342 bool ShowingFPSDisplay() { return mPerfDisplay != nullptr; }
+
1343
+
1349 IControl* AttachControl(IControl* pControl, int ctrlTag = kNoTag, const char* group = "");
+
1350
+
1354 IControl* GetControl(int idx) { return mControls.Get(idx); }
+
1355
+
1359 int GetControlIdx(IControl* pControl) const { return mControls.Find(pControl); }
+
1360
+
1364 int GetIdxOfTaggedControl(int ctrlTag) const
+
1365 {
+
1366 IControl* pControl = GetControlWithTag(ctrlTag);
+
1367 return pControl ? GetControlIdx(pControl) : -1;
+
1368 }
+
1369
+
1373 IControl* GetControlWithTag(int ctrlTag) const;
+
1374
+
1378 int GetControlTag(const IControl* pControl) const
+
1379 {
+
1380 for (auto itr = mCtrlTags.begin(); itr != mCtrlTags.end(); ++itr)
+
1381 {
+
1382 if (itr->second == pControl)
+
1383 return itr->first;
+
1384 }
+
1385
+
1386 return kNoTag;
+
1387 }
+
1388
+
1392 IControl* GetControlWithParamIdx(int paramIdx);
+
1393
+
1395 bool ControlIsCaptured() const { return mCapturedMap.size() > 0; }
+
1396
+
1399 bool ControlIsCaptured(IControl* pControl) const
1400 {
-
1401 for (auto i = mCapturedMap.begin(), j = mCapturedMap.end(); i != j; ++i)
-
1402 if (i->second == pControl)
-
1403 touchesOnThisControl.push_back(i->first);
-
1404 }
-
1405
-
1406 /* Get the first control in the control list, the background */
-
1407 IControl* GetBackgroundControl() { return GetControl(0); }
-
1408
-
1410 IPopupMenuControl* GetPopupMenuControl() { return mPopupControl.get(); }
+
1401 return std::find_if(std::begin(mCapturedMap), std::end(mCapturedMap), [pControl](auto&& press) { return press.second == pControl; }) != mCapturedMap.end();
+
1402 }
+
1403
+
1405 void GetTouches(IControl* pControl, std::vector<ITouchID>& touchesOnThisControl) const
+
1406 {
+
1407 for (auto i = mCapturedMap.begin(), j = mCapturedMap.end(); i != j; ++i)
+
1408 if (i->second == pControl)
+
1409 touchesOnThisControl.push_back(i->first);
+
1410 }
1411
-
1413 ITextEntryControl* GetTextEntryControl() { return mTextEntryControl.get(); }
+
1412 /* Get the first control in the control list, the background */
+
1413 IControl* GetBackgroundControl() { return GetControl(0); }
1414
-
1416 IBubbleControl* GetBubbleControl(int i = 0) { return mBubbleControls.Get(i); }
+
1416 IPopupMenuControl* GetPopupMenuControl() { return mPopupControl.get(); }
1417
-
1419 int NBubbleControls() const { return mBubbleControls.GetSize(); }
+
1419 ITextEntryControl* GetTextEntryControl() { return mTextEntryControl.get(); }
1420
-
1423 void StyleAllVectorControls(const IVStyle& style);
-
1424
-
1428 void UpdatePeers(IControl* pCaller, int callerValIdx);
-
1429
-
1431 int NControls() const { return mControls.GetSize(); }
-
1432
-
1434 void RemoveControlWithTag(int ctrlTag);
+
1422 IBubbleControl* GetBubbleControl(int i = 0) { return mBubbleControls.Get(i); }
+
1423
+
1425 int NBubbleControls() const { return mBubbleControls.GetSize(); }
+
1426
+
1429 void StyleAllVectorControls(const IVStyle& style);
+
1430
+
1434 void UpdatePeers(IControl* pCaller, int callerValIdx);
1435
-
1437 void RemoveControls(int fromIdx);
+
1437 int NControls() const { return mControls.GetSize(); }
1438
-
1440 void RemoveControl(int idx);
+
1440 void RemoveControlWithTag(int ctrlTag);
1441
-
1443 void RemoveControl(IControl* pControl);
-
1444
-
1446 void RemoveAllControls();
+
1443 void RemoveControls(int fromIdx);
+
1444
+
1446 void RemoveControl(int idx);
1447
-
1451 void HideControl(int paramIdx, bool hide);
-
1452
-
1456 void DisableControl(int paramIdx, bool diable);
-
1457
-
1459 void SetAllControlsDirty();
-
1460
-
1462 void SetAllControlsClean();
-
1463
-
1468 void SetControlPosition(IControl* pControl, float x, float y);
-
1469
-
1474 void SetControlSize(IControl* pControl, float w, float h);
+
1449 void RemoveControl(IControl* pControl);
+
1450
+
1452 void RemoveAllControls();
+
1453
+
1457 void HideControl(int paramIdx, bool hide);
+
1458
+
1462 void DisableControl(int paramIdx, bool diable);
+
1463
+
1465 void SetAllControlsDirty();
+
1466
+
1468 void SetAllControlsClean();
+
1469
+
1474 void SetControlPosition(IControl* pControl, float x, float y);
1475
-
1479 void SetControlBounds(IControl* pControl, const IRECT& r);
-
1480
-
1481private:
-
1487 int GetMouseControlIdx(float x, float y, bool mouseOver = false);
-
1488
-
1496 IControl* GetMouseControl(float x, float y, bool capture, bool mouseOver = false, ITouchID touchID = 0);
-
1497
-
1498#pragma mark - Event handling
-
1499public:
-
1501 void OnMouseDown(const std::vector<IMouseInfo>& points);
-
1502
-
1504 void OnMouseUp(const std::vector<IMouseInfo>& points);
-
1505
-
1507 void OnMouseDrag(const std::vector<IMouseInfo>& points);
-
1508
-
1510 void OnTouchCancelled(const std::vector<IMouseInfo>& points);
+
1480 void SetControlSize(IControl* pControl, float w, float h);
+
1481
+
1485 void SetControlBounds(IControl* pControl, const IRECT& r);
+
1486
+
1487private:
+
1493 int GetMouseControlIdx(float x, float y, bool mouseOver = false);
+
1494
+
1502 IControl* GetMouseControl(float x, float y, bool capture, bool mouseOver = false, ITouchID touchID = 0);
+
1503
+
1504#pragma mark - Event handling
+
1505public:
+
1507 void OnMouseDown(const std::vector<IMouseInfo>& points);
+
1508
+
1510 void OnMouseUp(const std::vector<IMouseInfo>& points);
1511
-
1516 bool OnMouseDblClick(float x, float y, const IMouseMod& mod);
+
1513 void OnMouseDrag(const std::vector<IMouseInfo>& points);
+
1514
+
1516 void OnTouchCancelled(const std::vector<IMouseInfo>& points);
1517
-
1522 void OnMouseWheel(float x, float y, const IMouseMod& mod, float delta);
+
1522 bool OnMouseDblClick(float x, float y, const IMouseMod& mod);
1523
-
1528 bool OnKeyDown(float x, float y, const IKeyPress& key);
+
1528 void OnMouseWheel(float x, float y, const IMouseMod& mod, float delta);
1529
-
1534 bool OnKeyUp(float x, float y, const IKeyPress& key);
-
1535
-
1540 bool OnMouseOver(float x, float y, const IMouseMod& mod);
-
1541
-
1543 void OnMouseOut();
-
1544
-
1546 void OnSetCursor() { SetMouseCursor(mCursorType); }
+
1534 bool OnKeyDown(float x, float y, const IKeyPress& key);
+
1535
+
1540 bool OnKeyUp(float x, float y, const IKeyPress& key);
+
1541
+
1546 bool OnMouseOver(float x, float y, const IMouseMod& mod);
1547
-
1551 void OnDrop(const char* str, float x, float y);
-
1552
-
1556 void OnDropMultiple(const std::vector<const char*>& paths, float x, float y);
-
1557
-
1559 void OnGUIIdle();
-
1560
-
1562 void OnDragResize(float x, float y);
+
1549 void OnMouseOut();
+
1550
+
1552 void OnSetCursor() { SetMouseCursor(mCursorType); }
+
1553
+
1557 void OnDrop(const char* str, float x, float y);
+
1558
+
1562 void OnDropMultiple(const std::vector<const char*>& paths, float x, float y);
1563
-
1566 void OnAppearanceChanged(EUIAppearance appearance);
-
1567
-
1570 virtual EUIAppearance GetUIAppearance() const { return EUIAppearance::Light; }
-
1571
-
1573 void EnableMouseOver(bool enable) { mEnableMouseOver = enable; }
-
1574
-
1576 void ReleaseMouseCapture();
-
1577
-
1579 bool CanEnableMouseOver() const { return mEnableMouseOver; }
+
1565 void OnGUIIdle();
+
1566
+
1568 void OnDragResize(float x, float y);
+
1569
+
1572 void OnAppearanceChanged(EUIAppearance appearance);
+
1573
+
1576 virtual EUIAppearance GetUIAppearance() const { return EUIAppearance::Light; }
+
1577
+
1579 void EnableMouseOver(bool enable) { mEnableMouseOver = enable; }
1580
-
1582 inline int GetMouseOver() const { return mMouseOverIdx; }
+
1582 void ReleaseMouseCapture();
1583
-
1587 void GetMouseDownPoint(float& x, float&y) const { x = mMouseDownX; y = mMouseDownY; }
-
1588
-
1591 void SetTabletInput(bool tablet) { mTabletInput = tablet; }
-
1592#pragma mark - Plug-in API Specific
-
1593
-
1599 int GetParamIdxForPTAutomation(float x, float y);
-
1600
-
1603 int GetLastClickedParamForPTAutomation();
-
1604
-
1609 void SetPTParameterHighlight(int paramIdx, bool isHighlighted, int color);
+
1585 bool CanEnableMouseOver() const { return mEnableMouseOver; }
+
1586
+
1588 inline int GetMouseOver() const { return mMouseOverIdx; }
+
1589
+
1593 void GetMouseDownPoint(float& x, float&y) const { x = mMouseDownX; y = mMouseDownY; }
+
1594
+
1597 void SetTabletInput(bool tablet) { mTabletInput = tablet; }
+
1598#pragma mark - Plug-in API Specific
+
1599
+
1605 int GetParamIdxForPTAutomation(float x, float y);
+
1606
+
1609 int GetLastClickedParamForPTAutomation();
1610
-
1617 void PopupHostContextMenuForParam(int controlIdx, int paramIdx, float x, float y);
-
1618
-
1625 void PopupHostContextMenuForParam(IControl* pControl, int paramIdx, float x, float y);
-
1626
-
1627#pragma mark - Resource/File Loading
-
1628
-
1630 const char* GetSharedResourcesSubPath() const { return mSharedResourcesSubPath.Get(); }
-
1631
-
1633 void SetSharedResourcesSubPath(const char* sharedResourcesSubPath) { mSharedResourcesSubPath.Set(sharedResourcesSubPath); }
+
1615 void SetPTParameterHighlight(int paramIdx, bool isHighlighted, int color);
+
1616
+
1623 void PopupHostContextMenuForParam(int controlIdx, int paramIdx, float x, float y);
+
1624
+
1631 void PopupHostContextMenuForParam(IControl* pControl, int paramIdx, float x, float y);
+
1632
+
1633#pragma mark - Resource/File Loading
1634
-
1641 virtual IBitmap LoadBitmap(const char* fileNameOrResID, int nStates = 1, bool framesAreHorizontal = false, int targetScale = 0);
-
1642
-
1651 virtual IBitmap LoadBitmap(const char *name, const void* pData, int dataSize, int nStates = 1, bool framesAreHorizontal = false, int targetScale = 0);
-
1652
-
1656 virtual ISVG LoadSVG(const char* fileNameOrResID, const char* units = "px", float dpi = 72.f);
-
1657
-
1665 virtual ISVG LoadSVG(const char* name, const void* pData, int dataSize, const char* units = "px", float dpi = 72.f);
-
1666
-
1671 virtual WDL_TypedBuf<uint8_t> LoadResource(const char* fileNameOrResID, const char* fileType);
+
1636 const char* GetSharedResourcesSubPath() const { return mSharedResourcesSubPath.Get(); }
+
1637
+
1639 void SetSharedResourcesSubPath(const char* sharedResourcesSubPath) { mSharedResourcesSubPath.Set(sharedResourcesSubPath); }
+
1640
+
1647 virtual IBitmap LoadBitmap(const char* fileNameOrResID, int nStates = 1, bool framesAreHorizontal = false, int targetScale = 0);
+
1648
+
1657 virtual IBitmap LoadBitmap(const char *name, const void* pData, int dataSize, int nStates = 1, bool framesAreHorizontal = false, int targetScale = 0);
+
1658
+
1662 virtual ISVG LoadSVG(const char* fileNameOrResID, const char* units = "px", float dpi = 72.f);
+
1663
+
1671 virtual ISVG LoadSVG(const char* name, const void* pData, int dataSize, const char* units = "px", float dpi = 72.f);
1672
-
1675 virtual void AttachGestureRecognizer(EGestureType type);
-
1676
-
1681 void AttachGestureRecognizerToRegion(const IRECT& bounds, EGestureType type, IGestureFunc func);
+
1677 virtual WDL_TypedBuf<uint8_t> LoadResource(const char* fileNameOrResID, const char* fileType);
+
1678
+
1681 virtual void AttachGestureRecognizer(EGestureType type);
1682
-
1684 void ClearGestureRegions();
-
1685
-
1686protected:
-
1693 virtual APIBitmap* LoadAPIBitmap(const char* fileNameOrResID, int scale, EResourceLocation location, const char* ext) = 0;
-
1694
-
1701 virtual APIBitmap* LoadAPIBitmap(const char* name, const void* pData, int dataSize, int scale) = 0;
-
1702
-
1710 virtual APIBitmap* CreateAPIBitmap(int width, int height, float scale, double drawScale, bool cacheable = false) = 0;
-
1711
-
1716 virtual bool LoadAPIFont(const char* fontID, const PlatformFontPtr& font) = 0;
+
1687 void AttachGestureRecognizerToRegion(const IRECT& bounds, EGestureType type, IGestureFunc func);
+
1688
+
1690 void ClearGestureRegions();
+
1691
+
1692protected:
+
1699 virtual APIBitmap* LoadAPIBitmap(const char* fileNameOrResID, int scale, EResourceLocation location, const char* ext) = 0;
+
1700
+
1707 virtual APIBitmap* LoadAPIBitmap(const char* name, const void* pData, int dataSize, int scale) = 0;
+
1708
+
1716 virtual APIBitmap* CreateAPIBitmap(int width, int height, float scale, double drawScale, bool cacheable = false) = 0;
1717
-
1719 virtual bool AssetsLoaded() { return true; }
-
1720
-
1722 virtual int AlphaChannel() const = 0;
+
1722 virtual bool LoadAPIFont(const char* fontID, const PlatformFontPtr& font) = 0;
1723
-
1725 virtual bool FlippedBitmap() const = 0;
-
1726
-
1734 EResourceLocation SearchImageResource(const char* fileName, const char* type, WDL_String& result, int targetScale, int& sourceScale);
-
1735
-
1741 APIBitmap* SearchBitmapInCache(const char* fileName, int targetScale, int& sourceScale);
-
1742
-
1748 virtual float DoMeasureText(const IText& text, const char* str, IRECT& bounds) const = 0;
-
1749
-
1755 virtual void DoDrawText(const IText& text, const char* str, const IRECT& bounds, const IBlend* pBlend = nullptr) = 0;
-
1756
-
1761 void DoMeasureTextRotation(const IText& text, const IRECT& bounds, IRECT& rect) const;
-
1762
-
1769 void CalculateTextRotation(const IText& text, const IRECT& bounds, IRECT& rect, double& tx, double& ty) const;
-
1770
-
1772 virtual float GetBackingPixelScale() const { return GetScreenScale() * GetDrawScale(); };
-
1773
-
1774 IMatrix GetTransformMatrix() const { return mTransform; }
-
1775#pragma mark -
-
1776
-
1777private:
-
1778 void ClearMouseOver()
-
1779 {
-
1780 mMouseOver = nullptr;
-
1781 mMouseOverIdx = -1;
-
1782 }
-
1783
-
1784 WDL_PtrList<IControl> mControls;
-
1785 std::unordered_map<int, IControl*> mCtrlTags;
-
1786
-
1787 // Order (front-to-back) ToolTip / PopUp / TextEntry / LiveEdit / Corner / PerfDisplay
-
1788 std::unique_ptr<ICornerResizerControl> mCornerResizer;
-
1789 WDL_PtrList<IBubbleControl> mBubbleControls;
-
1790 std::unique_ptr<IPopupMenuControl> mPopupControl;
-
1791 std::unique_ptr<IFPSDisplayControl> mPerfDisplay;
-
1792 std::unique_ptr<ITextEntryControl> mTextEntryControl;
-
1793 std::unique_ptr<IControl> mLiveEdit;
-
1794
-
1795 IPopupMenu mPromptPopupMenu;
-
1796
-
1797 WDL_String mSharedResourcesSubPath;
-
1798
-
1799 ECursor mCursorType = ECursor::ARROW;
-
1800 int mWidth;
-
1801 int mHeight;
-
1802 int mFPS;
-
1803 float mScreenScale = 1.f; // the scaling of the display that the UI is currently on e.g. 2 for retina
-
1804 float mDrawScale = 1.f; // scale deviation from default width and height i.e stretching the UI by dragging bottom right hand corner
-
1805
-
1806 int mIdleTicks = 0;
-
1807
-
1808 std::vector<EGestureType> mRegisteredGestures; // All the types of gesture registered with the graphics context
-
1809 IRECTList mGestureRegions; // Rectangular regions linked to gestures (excluding IControls)
-
1810 std::unordered_map<int, IGestureFunc> mGestureRegionFuncs; // Map of gesture region index to gesture function
-
1811 std::unordered_map<ITouchID, IControl*> mCapturedMap; // associative array of touch ids to control pointers, the same control can be touched multiple times
-
1812 IControl* mMouseOver = nullptr;
-
1813 IControl* mInTextEntry = nullptr;
-
1814 IControl* mInPopupMenu = nullptr;
-
1815 void* mPlatformContext = nullptr;
-
1816 bool mIsContextMenu = false;
-
1817 int mTextEntryValIdx = kNoValIdx;
-
1818 int mPopupMenuValIdx = kNoValIdx;
-
1819 int mMouseOverIdx = -1;
-
1820 float mMouseDownX = -1.f;
-
1821 float mMouseDownY = -1.f;
-
1822 float mMinScale;
-
1823 float mMaxScale;
-
1824 int mLastClickedParam = kNoParameter;
-
1825 bool mEnableMouseOver = false;
-
1826 bool mStrict = false;
-
1827 bool mEnableTooltips = false;
-
1828 bool mShowControlBounds = false;
-
1829 bool mShowAreaDrawn = false;
-
1830 bool mResizingInProcess = false;
-
1831 bool mLayoutOnResize = false;
-
1832 bool mEnableMultiTouch = false;
-
1833 EUIResizerMode mGUISizeMode = EUIResizerMode::Scale;
-
1834 double mPrevTimestamp = 0.;
-
1835 IKeyHandlerFunc mKeyHandlerFunc = nullptr;
-
1836 IDisplayTickFunc mDisplayTickFunc = nullptr;
-
1837 IUIAppearanceChangedFunc mAppearanceChangedFunc = nullptr;
-
1838
-
1839protected:
-
1840 IGEditorDelegate* mDelegate;
-
1841 bool mCursorHidden = false;
-
1842 bool mCursorLock = false;
-
1843 bool mTabletInput = false;
-
1844 float mCursorX = -1.f;
-
1845 float mCursorY = -1.f;
-
1846 float mXTranslation = 0.f;
-
1847 float mYTranslation = 0.f;
-
1848
-
1849 friend class IGraphicsLiveEdit;
-
1850 friend class ICornerResizerControl;
-
1851 friend class ITextEntryControl;
-
1852
-
1853 std::stack<ILayer*> mLayers;
-
1854
-
1855 IRECT mClipRECT;
-
1856 IMatrix mTransform;
-
1857 std::stack<IMatrix> mTransformStates;
-
1858};
-
1859
-
1860END_IGRAPHICS_NAMESPACE
-
1861END_IPLUG_NAMESPACE
+
1725 virtual bool AssetsLoaded() { return true; }
+
1726
+
1728 virtual int AlphaChannel() const = 0;
+
1729
+
1731 virtual bool FlippedBitmap() const = 0;
+
1732
+
1740 EResourceLocation SearchImageResource(const char* fileName, const char* type, WDL_String& result, int targetScale, int& sourceScale);
+
1741
+
1747 APIBitmap* SearchBitmapInCache(const char* fileName, int targetScale, int& sourceScale);
+
1748
+
1754 virtual float DoMeasureText(const IText& text, const char* str, IRECT& bounds) const = 0;
+
1755
+
1761 virtual void DoDrawText(const IText& text, const char* str, const IRECT& bounds, const IBlend* pBlend = nullptr) = 0;
+
1762
+
1767 void DoMeasureTextRotation(const IText& text, const IRECT& bounds, IRECT& rect) const;
+
1768
+
1775 void CalculateTextRotation(const IText& text, const IRECT& bounds, IRECT& rect, double& tx, double& ty) const;
+
1776
+
1778 virtual float GetBackingPixelScale() const { return GetScreenScale() * GetDrawScale(); };
+
1779
+
1780 IMatrix GetTransformMatrix() const { return mTransform; }
+
1781#pragma mark -
+
1782
+
1783private:
+
1784 void ClearMouseOver()
+
1785 {
+
1786 mMouseOver = nullptr;
+
1787 mMouseOverIdx = -1;
+
1788 }
+
1789
+
1790 WDL_PtrList<IControl> mControls;
+
1791 std::unordered_map<int, IControl*> mCtrlTags;
+
1792
+
1793 // Order (front-to-back) ToolTip / PopUp / TextEntry / LiveEdit / Corner / PerfDisplay
+
1794 std::unique_ptr<ICornerResizerControl> mCornerResizer;
+
1795 WDL_PtrList<IBubbleControl> mBubbleControls;
+
1796 std::unique_ptr<IPopupMenuControl> mPopupControl;
+
1797 std::unique_ptr<IFPSDisplayControl> mPerfDisplay;
+
1798 std::unique_ptr<ITextEntryControl> mTextEntryControl;
+
1799 std::unique_ptr<IControl> mLiveEdit;
+
1800
+
1801 IPopupMenu mPromptPopupMenu;
+
1802
+
1803 WDL_String mSharedResourcesSubPath;
+
1804
+
1805 ECursor mCursorType = ECursor::ARROW;
+
1806 int mWidth;
+
1807 int mHeight;
+
1808 int mFPS;
+
1809 float mScreenScale = 1.f; // the scaling of the display that the UI is currently on e.g. 2 for retina
+
1810 float mDrawScale = 1.f; // scale deviation from default width and height i.e stretching the UI by dragging bottom right hand corner
+
1811
+
1812 int mIdleTicks = 0;
+
1813
+
1814 std::vector<EGestureType> mRegisteredGestures; // All the types of gesture registered with the graphics context
+
1815 IRECTList mGestureRegions; // Rectangular regions linked to gestures (excluding IControls)
+
1816 std::unordered_map<int, IGestureFunc> mGestureRegionFuncs; // Map of gesture region index to gesture function
+
1817 std::unordered_map<ITouchID, IControl*> mCapturedMap; // associative array of touch ids to control pointers, the same control can be touched multiple times
+
1818 IControl* mMouseOver = nullptr;
+
1819 IControl* mInTextEntry = nullptr;
+
1820 IControl* mInPopupMenu = nullptr;
+
1821 void* mPlatformContext = nullptr;
+
1822 bool mIsContextMenu = false;
+
1823 int mTextEntryValIdx = kNoValIdx;
+
1824 int mPopupMenuValIdx = kNoValIdx;
+
1825 int mMouseOverIdx = -1;
+
1826 float mMouseDownX = -1.f;
+
1827 float mMouseDownY = -1.f;
+
1828 float mMinScale;
+
1829 float mMaxScale;
+
1830 int mLastClickedParam = kNoParameter;
+
1831 bool mEnableMouseOver = false;
+
1832 bool mStrict = false;
+
1833 bool mEnableTooltips = false;
+
1834 bool mShowControlBounds = false;
+
1835 bool mShowAreaDrawn = false;
+
1836 bool mResizingInProcess = false;
+
1837 bool mLayoutOnResize = false;
+
1838 bool mEnableMultiTouch = false;
+
1839 EUIResizerMode mGUISizeMode = EUIResizerMode::Scale;
+
1840 double mPrevTimestamp = 0.;
+
1841 IKeyHandlerFunc mKeyHandlerFunc = nullptr;
+
1842 IDisplayTickFunc mDisplayTickFunc = nullptr;
+
1843 IUIAppearanceChangedFunc mAppearanceChangedFunc = nullptr;
+
1844
+
1845protected:
+
1846 IGEditorDelegate* mDelegate;
+
1847 bool mCursorHidden = false;
+
1848 bool mCursorLock = false;
+
1849 bool mTabletInput = false;
+
1850 float mCursorX = -1.f;
+
1851 float mCursorY = -1.f;
+
1852 float mXTranslation = 0.f;
+
1853 float mYTranslation = 0.f;
+
1854
+
1855 friend class IGraphicsLiveEdit;
+
1856 friend class ICornerResizerControl;
+
1857 friend class ITextEntryControl;
+
1858
+
1859 std::stack<ILayer*> mLayers;
+
1860
+
1861 IRECT mClipRECT;
+
1862 IMatrix mTransform;
+
1863 std::stack<IMatrix> mTransformStates;
+
1864};
+
1865
+
1866END_IGRAPHICS_NAMESPACE
+
1867END_IPLUG_NAMESPACE
IGraphicsEditorDelegate.h
IGraphicsPopupMenu.h
IPlugConstants.h
IPlug Constant definitions, Types, magic numbers.
@@ -970,16 +972,16 @@
IFPSDisplayControl
Performance display meter, based on code from NanoVG This is a special control that lives outside the...
Definition: IFPSDisplayControl.h:29
IGEditorDelegate
An editor delegate base class for a SOMETHING that uses IGraphics for it's UI.
Definition: IGraphicsEditorDelegate.h:30
IGraphics
The lowest level base class of an IGraphics context.
Definition: IGraphics.h:86
-
IGraphics::ControlIsCaptured
bool ControlIsCaptured() const
Check to see if any control is captured.
Definition: IGraphics.h:1389
+
IGraphics::ControlIsCaptured
bool ControlIsCaptured() const
Check to see if any control is captured.
Definition: IGraphics.h:1395
IGraphics::EnableTooltips
void EnableTooltips(bool enable)
Definition: IGraphics.cpp:1527
-
IGraphics::CreatePopupMenu
void CreatePopupMenu(IControl &control, IPopupMenu &menu, float x, float y, int valIdx=0)
Shows a pop up/contextual menu at point.
Definition: IGraphics.h:1032
+
IGraphics::CreatePopupMenu
void CreatePopupMenu(IControl &control, IPopupMenu &menu, float x, float y, int valIdx=0)
Shows a pop up/contextual menu at point.
Definition: IGraphics.h:1038
IGraphics::DoMeasureText
virtual float DoMeasureText(const IText &text, const char *str, IRECT &bounds) const =0
IGraphics::SetFilePathInClipboard
virtual bool SetFilePathInClipboard(const char *path)
Set a file path in the clipboard.
Definition: IGraphics.h:866
-
IGraphics::ClientToScreen
virtual void ClientToScreen(float &x, float &y)
Convert an x, y position in the view to screen coordinates.
Definition: IGraphics.h:934
+
IGraphics::ClientToScreen
virtual void ClientToScreen(float &x, float &y)
Convert an x, y position in the view to screen coordinates.
Definition: IGraphics.h:940
IGraphics::Resize
void Resize(int w, int h, float scale, bool needsPlatformResize=true)
Definition: IGraphics.cpp:90
IGraphics::DrawRotatedSVG
virtual void DrawRotatedSVG(const ISVG &svg, float destCentreX, float destCentreY, float width, float height, double angle, const IBlend *pBlend=0)
Draw an SVG image to the graphics context with rotation.
Definition: IGraphics.cpp:2797
IGraphics::DrawRect
virtual void DrawRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0, float thickness=1.f)
Draw a rectangle to the graphics context.
Definition: IGraphics.cpp:2497
-
IGraphics::PlatformSupportsMultiTouch
virtual bool PlatformSupportsMultiTouch() const
Definition: IGraphics.h:1158
+
IGraphics::PlatformSupportsMultiTouch
virtual bool PlatformSupportsMultiTouch() const
Definition: IGraphics.h:1164
IGraphics::FillEllipse
virtual void FillEllipse(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill an ellipse within a rectangular region of the graphics context.
Definition: IGraphics.cpp:2613
IGraphics::PopLayer
ILayer * PopLayer()
Pop a layer off the stack.
Definition: IGraphics.cpp:2014
IGraphics::DrawConvexPolygon
virtual void DrawConvexPolygon(const IColor &color, float *x, float *y, int nPoints, const IBlend *pBlend=0, float thickness=1.f)
Draw a convex polygon to the graphics context.
Definition: IGraphics.cpp:2518
@@ -991,18 +993,19 @@
IGraphics::AttachPopupMenuControl
void AttachPopupMenuControl(const IText &text=DEFAULT_TEXT, const IRECT &bounds=IRECT())
Attach a control for pop-up menus, to override platform style menus.
Definition: IGraphics.cpp:356
IGraphics::DrawPoint
virtual void DrawPoint(const IColor &color, float x, float y, const IBlend *pBlend=0)
Fill a rectangle corresponding to a pixel on a 1:1 screen with a color.
Definition: IGraphics.cpp:2411
IGraphics::RemoveControl
void RemoveControl(int idx)
Remove a control at a particular index, (frees memory).
Definition: IGraphics.cpp:167
-
IGraphics::GetBundleID
virtual const char * GetBundleID() const
Get the bundle ID on macOS and iOS, returns emtpy string on other OSs.
Definition: IGraphics.h:962
+
IGraphics::GetBundleID
virtual const char * GetBundleID() const
Get the bundle ID on macOS and iOS, returns emtpy string on other OSs.
Definition: IGraphics.h:968
IGraphics::PathConvexPolygon
void PathConvexPolygon(float *x, float *y, int nPoints)
Add a convex polygon to the current path.
Definition: IGraphics.cpp:2695
IGraphics::PathFill
virtual void PathFill(const IPattern &pattern, const IFillOptions &options=IFillOptions(), const IBlend *pBlend=0)=0
Fill the current current path.
-
IGraphics::SetTabletInput
void SetTabletInput(bool tablet)
Set by the platform class if the mouse input is coming from a tablet/stylus.
Definition: IGraphics.h:1591
-
IGraphics::GetPlatformWindowScale
virtual float GetPlatformWindowScale() const
Returns a scaling factor for resizing parent windows via the host/plugin API.
Definition: IGraphics.h:1214
+
IGraphics::SetTabletInput
void SetTabletInput(bool tablet)
Set by the platform class if the mouse input is coming from a tablet/stylus.
Definition: IGraphics.h:1597
+
IGraphics::GetPlatformWindowScale
virtual float GetPlatformWindowScale() const
Returns a scaling factor for resizing parent windows via the host/plugin API.
Definition: IGraphics.h:1220
IGraphics::DrawText
void DrawText(const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=0)
Draw some text to the graphics context in a specific rectangle.
Definition: IGraphics.cpp:670
-
IGraphics::GetTotalScale
float GetTotalScale() const
Gets the combined draw and screen/display scaling factor.
Definition: IGraphics.h:1107
+
IGraphics::GetTotalScale
float GetTotalScale() const
Gets the combined draw and screen/display scaling factor.
Definition: IGraphics.h:1113
IGraphics::GetParamIdxForPTAutomation
int GetParamIdxForPTAutomation(float x, float y)
[AAX only] This can be called by the ProTools API class (e.g.
Definition: IGraphics.cpp:1382
IGraphics::GetPoint
virtual IColor GetPoint(int x, int y)=0
Get the color at an X, Y location in the graphics context.
IGraphics::CreatePopupMenu
void CreatePopupMenu(IControl &control, IPopupMenu &menu, const IRECT &bounds, int valIdx=0)
Shows a pop up/contextual menu in relation to a rectangular region of the graphics context.
Definition: IGraphics.cpp:1960
IGraphics::CreateTextEntry
void CreateTextEntry(IControl &control, const IText &text, const IRECT &bounds, const char *str="", int valIdx=0)
Create a text entry box.
Definition: IGraphics.cpp:1923
IGraphics::PathClear
virtual void PathClear()=0
Clear the stack of path drawing commands.
+
IGraphics::InitiateExternalFileDragDrop
virtual bool InitiateExternalFileDragDrop(const char *path, const IRECT &iconBounds)
Initiate an drag-n-drop operation of an existing file, to be dropped outside of the current window.
Definition: IGraphics.h:872
IGraphics::MoveMouseCursor
virtual void MoveMouseCursor(float x, float y)=0
Force move the mouse cursor to a specific position.
IGraphics::GetDrawContext
virtual void * GetDrawContext()=0
Gets a void pointer to underlying drawing context, for the IGraphics backend See draw class implement...
IGraphics::LoadPlatformFont
virtual PlatformFontPtr LoadPlatformFont(const char *fontID, void *pData, int dataSize)=0
Load a font from data in memory.
@@ -1010,7 +1013,7 @@
IGraphics::SetPTParameterHighlight
void SetPTParameterHighlight(int paramIdx, bool isHighlighted, int color)
[AAX only] See AAX_CEffectGUI::SetControlHighlightInfo()
Definition: IGraphics.cpp:1396
IGraphics::PathClose
virtual void PathClose()=0
Close the path that is being specified.
IGraphics::PathTransformTranslate
void PathTransformTranslate(float x, float y)
Apply a translation transform to the current path.
Definition: IGraphics.cpp:2730
-
IGraphics::ClearInTextEntryControl
void ClearInTextEntryControl()
Called when the text entry is dismissed, to reset mInTextEntry.
Definition: IGraphics.h:1128
+
IGraphics::ClearInTextEntryControl
void ClearInTextEntryControl()
Called when the text entry is dismissed, to reset mInTextEntry.
Definition: IGraphics.h:1134
IGraphics::DrawRadialLine
void DrawRadialLine(const IColor &color, float cx, float cy, float angle, float rMin, float rMax, const IBlend *pBlend=0, float thickness=1.f)
Draw a radial line to the graphics context, useful for pointers on dials.
Definition: IGraphics.cpp:811
IGraphics::PathRect
void PathRect(const IRECT &bounds)
Add a rectangle to the current path.
Definition: IGraphics.cpp:2635
IGraphics::RetainBitmap
virtual void RetainBitmap(const IBitmap &bitmap, const char *cacheName)
Adds an IBitmap to the cache/static storage.
Definition: IGraphics.cpp:1840
@@ -1019,11 +1022,11 @@
IGraphics::AttachPlatformView
virtual void AttachPlatformView(const IRECT &r, void *pView)
Add an OS view as a sub-view, on top of the IGraphics view.
Definition: IGraphics.h:799
IGraphics::CreatePlatformTextEntry
virtual void CreatePlatformTextEntry(int paramIdx, const IText &text, const IRECT &bounds, int length, const char *str)=0
Creates a platform native text entry field.
IGraphics::ResumeLayer
void ResumeLayer(ILayerPtr &layer)
If a layer already exists, continue drawing to it.
Definition: IGraphics.cpp:1987
-
IGraphics::GetTextEntryControl
ITextEntryControl * GetTextEntryControl()
Definition: IGraphics.h:1413
+
IGraphics::GetTextEntryControl
ITextEntryControl * GetTextEntryControl()
Definition: IGraphics.h:1419
IGraphics::PathTransformMatrix
void PathTransformMatrix(const IMatrix &matrix)
Apply an arbitary affine transform matrix to the current path.
Definition: IGraphics.cpp:2759
IGraphics::DrawRotatedLayer
void DrawRotatedLayer(const ILayerPtr &layer, double angle)
Draw a layer to the main IGraphics context, with rotation.
Definition: IGraphics.cpp:2065
-
IGraphics::GetAppGroupID
virtual const char * GetAppGroupID() const
Get the app group ID on macOS and iOS, returns emtpy string on other OSs.
Definition: IGraphics.h:965
-
IGraphics::FPS
int FPS() const
Gets the drawing frame rate.
Definition: IGraphics.h:1091
+
IGraphics::GetAppGroupID
virtual const char * GetAppGroupID() const
Get the app group ID on macOS and iOS, returns emtpy string on other OSs.
Definition: IGraphics.h:971
+
IGraphics::FPS
int FPS() const
Gets the drawing frame rate.
Definition: IGraphics.h:1097
IGraphics::PathTransformScale
void PathTransformScale(float x, float y)
Apply a scale transform to the current path, with independant x, y scales.
Definition: IGraphics.cpp:2736
IGraphics::SetMouseCursor
virtual ECursor SetMouseCursor(ECursor cursorType=ECursor::ARROW)
Sets the mouse cursor to one of ECursor (implementations should return the result of the base impleme...
Definition: IGraphics.h:828
IGraphics::PathLine
void PathLine(float x1, float y1, float x2, float y2)
Add a line to the current path.
Definition: IGraphics.h:601
@@ -1034,21 +1037,21 @@
IGraphics::HidePlatformView
virtual void HidePlatformView(void *pView, bool hide)
Hide a previously attached platform view from the IGraphics view.
Definition: IGraphics.h:808
IGraphics::OnMouseDrag
void OnMouseDrag(const std::vector< IMouseInfo > &points)
Called when the platform class sends drag events.
Definition: IGraphics.cpp:1155
IGraphics::ReleaseBitmap
virtual void ReleaseBitmap(const IBitmap &bitmap)
Releases an IBitmap from the cache/static storage.
Definition: IGraphics.cpp:1834
-
IGraphics::ShowControlBounds
void ShowControlBounds(bool enable)
Definition: IGraphics.h:1167
+
IGraphics::ShowControlBounds
void ShowControlBounds(bool enable)
Definition: IGraphics.h:1173
IGraphics::DrawRoundRect
virtual void DrawRoundRect(const IColor &color, const IRECT &bounds, float cornerRadius=5.f, const IBlend *pBlend=0, float thickness=1.f)
Draw a rounded rectangle to the graphics context.
Definition: IGraphics.cpp:2504
-
IGraphics::SetUIAppearanceChangedFunc
void SetUIAppearanceChangedFunc(IUIAppearanceChangedFunc func)
Sets a function that is called when the OS appearance (light/dark mode) is changed.
Definition: IGraphics.h:1196
+
IGraphics::SetUIAppearanceChangedFunc
void SetUIAppearanceChangedFunc(IUIAppearanceChangedFunc func)
Sets a function that is called when the OS appearance (light/dark mode) is changed.
Definition: IGraphics.h:1202
IGraphics::OnMouseOut
void OnMouseOut()
Called when the mouse leaves the graphics context.
Definition: IGraphics.cpp:1145
IGraphics::UpdatePeers
void UpdatePeers(IControl *pCaller, int callerValIdx)
This method is called after interacting with a control, so that any other controls linked to the same...
Definition: IGraphics.cpp:603
IGraphics::RemovePopupMenuControl
void RemovePopupMenuControl()
Remove the IGraphics popup menu, use platform popup menu if available.
Definition: IGraphics.cpp:365
-
IGraphics::GetBackingPixelScale
virtual float GetBackingPixelScale() const
Definition: IGraphics.h:1772
+
IGraphics::GetBackingPixelScale
virtual float GetBackingPixelScale() const
Definition: IGraphics.h:1778
IGraphics::DrawRotatedBitmap
virtual void DrawRotatedBitmap(const IBitmap &bitmap, float destCentreX, float destCentreY, double angle, const IBlend *pBlend=0)
Draw a bitmap (raster) image to the graphics context with rotation.
Definition: IGraphics.cpp:2399
IGraphics::OnKeyDown
bool OnKeyDown(float x, float y, const IKeyPress &key)
Definition: IGraphics.cpp:1230
IGraphics::AlphaChannel
virtual int AlphaChannel() const =0
IGraphics::AttachGestureRecognizerToRegion
void AttachGestureRecognizerToRegion(const IRECT &bounds, EGestureType type, IGestureFunc func)
Attach a gesture recognizer to a rectangular region of the GUI, i.e.
Definition: IGraphics.cpp:2386
-
IGraphics::MultiTouchEnabled
bool MultiTouchEnabled() const
Definition: IGraphics.h:1155
+
IGraphics::MultiTouchEnabled
bool MultiTouchEnabled() const
Definition: IGraphics.h:1161
IGraphics::GetDrawingAPIStr
virtual const char * GetDrawingAPIStr()=0
-
IGraphics::Width
int Width() const
Gets the width of the graphics context.
Definition: IGraphics.h:1075
-
IGraphics::SetWinModuleHandle
virtual void SetWinModuleHandle(void *pHinstance)
Used on Windows to set the HINSTANCE module handle, which allows graphics APIs to load resources from...
Definition: IGraphics.h:917
+
IGraphics::Width
int Width() const
Gets the width of the graphics context.
Definition: IGraphics.h:1081
+
IGraphics::SetWinModuleHandle
virtual void SetWinModuleHandle(void *pHinstance)
Used on Windows to set the HINSTANCE module handle, which allows graphics APIs to load resources from...
Definition: IGraphics.h:923
IGraphics::EndFrame
virtual void EndFrame()
Called by some drawing API classes to finally blit the draw bitmap onto the screen or perform other c...
Definition: IGraphics.h:100
IGraphics::DisableControl
void DisableControl(int paramIdx, bool diable)
Disable or enable controls linked to a specific parameter.
Definition: IGraphics.cpp:483
IGraphics::GetTextFromClipboard
virtual bool GetTextFromClipboard(WDL_String &str)=0
Get text from the clipboard.
@@ -1065,13 +1068,13 @@
IGraphics::OpenWindow
virtual void * OpenWindow(void *pParentWnd)=0
Open a new platform view for this graphics context.
IGraphics::PromptForDirectory
virtual void PromptForDirectory(WDL_String &dir, IFileDialogCompletionHandlerFunc completionHandler=nullptr)=0
Create a platform file prompt dialog to choose a directory path for opening/saving a directory.
IGraphics::CalculateTextRotation
void CalculateTextRotation(const IText &text, const IRECT &bounds, IRECT &rect, double &tx, double &ty) const
Definition: IGraphics.cpp:2235
-
IGraphics::IsInPlatformTextEntry
bool IsInPlatformTextEntry()
Definition: IGraphics.h:1122
-
IGraphics::SetTranslation
void SetTranslation(float x, float y)
Called by some platform IGraphics classes in order to translate the graphics context,...
Definition: IGraphics.h:1003
-
IGraphics::GetIdxOfTaggedControl
int GetIdxOfTaggedControl(int ctrlTag) const
Gets the index of a tagged control.
Definition: IGraphics.h:1358
-
IGraphics::AssetsLoaded
virtual bool AssetsLoaded()
Specialized in IGraphicsCanvas drawing backend.
Definition: IGraphics.h:1719
+
IGraphics::IsInPlatformTextEntry
bool IsInPlatformTextEntry()
Definition: IGraphics.h:1128
+
IGraphics::SetTranslation
void SetTranslation(float x, float y)
Called by some platform IGraphics classes in order to translate the graphics context,...
Definition: IGraphics.h:1009
+
IGraphics::GetIdxOfTaggedControl
int GetIdxOfTaggedControl(int ctrlTag) const
Gets the index of a tagged control.
Definition: IGraphics.h:1364
+
IGraphics::AssetsLoaded
virtual bool AssetsLoaded()
Specialized in IGraphicsCanvas drawing backend.
Definition: IGraphics.h:1725
IGraphics::PathStroke
virtual void PathStroke(const IPattern &pattern, float thickness, const IStrokeOptions &options=IStrokeOptions(), const IBlend *pBlend=0)=0
Stroke the current current path.
IGraphics::CheckLayer
bool CheckLayer(const ILayerPtr &layer)
Test to see if a layer needs drawing, for instance if the control's bounds were changed.
Definition: IGraphics.cpp:2032
-
IGraphics::WindowWidth
int WindowWidth() const
Gets the width of the graphics context including draw scaling.
Definition: IGraphics.h:1083
+
IGraphics::WindowWidth
int WindowWidth() const
Gets the width of the graphics context including draw scaling.
Definition: IGraphics.h:1089
IGraphics::Draw
void Draw(IRECTList &rects)
Called by the platform class indicating a number of rectangles in the UI that need to redraw.
Definition: IGraphics.cpp:938
IGraphics::SearchImageResource
EResourceLocation SearchImageResource(const char *fileName, const char *type, WDL_String &result, int targetScale, int &sourceScale)
Search for a bitmap image resource matching the target scale.
Definition: IGraphics.cpp:1876
IGraphics::GetControlWithParamIdx
IControl * GetControlWithParamIdx(int paramIdx)
Get the first control with a parameter index that matches paramIdx.
Definition: IGraphics.cpp:463
@@ -1083,20 +1086,20 @@
IGraphics::DrawLayer
void DrawLayer(const ILayerPtr &layer, const IBlend *pBlend=nullptr)
Draw a layer to the main IGraphics context.
Definition: IGraphics.cpp:2045
IGraphics::PushLayer
void PushLayer(ILayer *pLayer)
Push a layer on to the stack.
Definition: IGraphics.cpp:2005
IGraphics::ReleaseMouseCapture
void ReleaseMouseCapture()
Used to tell the graphics context to stop tracking mouse interaction with a control.
Definition: IGraphics.cpp:1278
-
IGraphics::GetPixelSnapped
IRECT GetPixelSnapped(IRECT &r) const
Gets the nearest backing pixel aligned rect to the input IRECT.
Definition: IGraphics.h:1112
+
IGraphics::GetPixelSnapped
IRECT GetPixelSnapped(IRECT &r) const
Gets the nearest backing pixel aligned rect to the input IRECT.
Definition: IGraphics.h:1118
IGraphics::GetLastClickedParamForPTAutomation
int GetLastClickedParamForPTAutomation()
[AAX only]
Definition: IGraphics.cpp:1389
IGraphics::ForControlWithParam
void ForControlWithParam(int paramIdx, IControlFunction func)
For all standard controls in the main control stack that are linked to a specific parameter,...
Definition: IGraphics.cpp:488
-
IGraphics::ShowAreaDrawnEnabled
bool ShowAreaDrawnEnabled() const
Definition: IGraphics.h:1173
+
IGraphics::ShowAreaDrawnEnabled
bool ShowAreaDrawnEnabled() const
Definition: IGraphics.h:1179
IGraphics::AttachBubbleControl
void AttachBubbleControl(const IText &text=DEFAULT_TEXT)
Attach the default control to show text as a control changes.
Definition: IGraphics.cpp:344
-
IGraphics::GetBubbleControl
IBubbleControl * GetBubbleControl(int i=0)
Definition: IGraphics.h:1416
-
IGraphics::GetResizerMode
EUIResizerMode GetResizerMode() const
Definition: IGraphics.h:1134
+
IGraphics::GetBubbleControl
IBubbleControl * GetBubbleControl(int i=0)
Definition: IGraphics.h:1422
+
IGraphics::GetResizerMode
EUIResizerMode GetResizerMode() const
Definition: IGraphics.h:1140
IGraphics::FillRect
virtual void FillRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill a rectangular region of the graphics context with a color.
Definition: IGraphics.cpp:2569
-
IGraphics::GetRoundedScreenScale
int GetRoundedScreenScale() const
Gets the screen/display scaling factor, rounded up.
Definition: IGraphics.h:1103
+
IGraphics::GetRoundedScreenScale
int GetRoundedScreenScale() const
Gets the screen/display scaling factor, rounded up.
Definition: IGraphics.h:1109
IGraphics::DrawFastDropShadow
virtual void DrawFastDropShadow(const IRECT &innerBounds, const IRECT &outerBounds, float xyDrop=5.f, float roundness=0.f, float blur=10.f, IBlend *pBlend=nullptr)
NanoVG only.
Definition: IGraphics.h:404
IGraphics::PromptForColor
virtual bool PromptForColor(IColor &color, const char *str="", IColorPickerHandlerFunc func=nullptr)=0
Create a platform color chooser dialog.
IGraphics::SearchBitmapInCache
APIBitmap * SearchBitmapInCache(const char *fileName, int targetScale, int &sourceScale)
Search the static storage cache for a bitmap image resource matching the target scale.
Definition: IGraphics.cpp:1898
-
IGraphics::GetPlatformContext
void * GetPlatformContext()
Get the platform level draw context - an HDC or CGContextRef.
Definition: IGraphics.h:929
-
IGraphics::RevealPathInExplorerOrFinder
virtual bool RevealPathInExplorerOrFinder(WDL_String &path, bool select=false)
Definition: IGraphics.h:913
+
IGraphics::GetPlatformContext
void * GetPlatformContext()
Get the platform level draw context - an HDC or CGContextRef.
Definition: IGraphics.h:935
+
IGraphics::RevealPathInExplorerOrFinder
virtual bool RevealPathInExplorerOrFinder(WDL_String &path, bool select=false)
Definition: IGraphics.h:919
IGraphics::DrawLine
virtual void DrawLine(const IColor &color, float x1, float y1, float x2, float y2, const IBlend *pBlend=0, float thickness=1.f)
Draw a line to the graphics context.
Definition: IGraphics.cpp:2416
IGraphics::DrawArc
virtual void DrawArc(const IColor &color, float cx, float cy, float r, float a1, float a2, const IBlend *pBlend=0, float thickness=1.f)
Draw an arc to the graphics context.
Definition: IGraphics.cpp:2525
IGraphics::OnTouchCancelled
void OnTouchCancelled(const std::vector< IMouseInfo > &points)
Called when the platform class sends touch cancel events.
Definition: IGraphics.cpp:1098
@@ -1105,22 +1108,22 @@
IGraphics::OnDragResize
void OnDragResize(float x, float y)
Called by ICornerResizerControl as the corner is dragged to resize.
Definition: IGraphics.cpp:1499
IGraphics::LoadPlatformFont
virtual PlatformFontPtr LoadPlatformFont(const char *fontID, const char *fileNameOrResID)=0
Load a font from disk or resource in a platform format.
IGraphics::ForAllControlsFunc
void ForAllControlsFunc(IControlFunction func)
For all controls, including the "special controls" call a method.
Definition: IGraphics.cpp:540
-
IGraphics::NBubbleControls
int NBubbleControls() const
Definition: IGraphics.h:1419
+
IGraphics::NBubbleControls
int NBubbleControls() const
Definition: IGraphics.h:1425
IGraphics::HideControl
void HideControl(int paramIdx, bool hide)
Hide controls linked to a specific parameter.
Definition: IGraphics.cpp:478
IGraphics::LoadFont
virtual bool LoadFont(const char *fontID, const char *fileNameOrResID)
Load a font to be used by the graphics context.
Definition: IGraphics.cpp:2176
-
IGraphics::SetDisplayTickFunc
void SetDisplayTickFunc(IDisplayTickFunc func)
Sets a function that is called at the frame rate, prior to checking for dirty controls.
Definition: IGraphics.h:1192
+
IGraphics::SetDisplayTickFunc
void SetDisplayTickFunc(IDisplayTickFunc func)
Sets a function that is called at the frame rate, prior to checking for dirty controls.
Definition: IGraphics.h:1198
IGraphics::BitmapExtSupported
virtual bool BitmapExtSupported(const char *ext)=0
Checks a file extension and reports whether this drawing API supports loading that extension.
IGraphics::RemoveAllControls
void RemoveAllControls()
Removes all regular IControls from the control list, as well as special controls (frees memory).
Definition: IGraphics.cpp:194
IGraphics::DrawCircle
virtual void DrawCircle(const IColor &color, float cx, float cy, float r, const IBlend *pBlend=0, float thickness=1.f)
Draw a circle to the graphics context.
Definition: IGraphics.cpp:2532
-
IGraphics::LiveEditEnabled
bool LiveEditEnabled() const
Definition: IGraphics.h:1183
+
IGraphics::LiveEditEnabled
bool LiveEditEnabled() const
Definition: IGraphics.h:1189
IGraphics::OnMouseDown
void OnMouseDown(const std::vector< IMouseInfo > &points)
Called when the platform class sends mouse down events.
Definition: IGraphics.cpp:971
-
IGraphics::GetMouseDownPoint
void GetMouseDownPoint(float &x, float &y) const
Get the x, y position of the last mouse down message.
Definition: IGraphics.h:1587
-
IGraphics::Height
int Height() const
Gets the height of the graphics context.
Definition: IGraphics.h:1079
+
IGraphics::GetMouseDownPoint
void GetMouseDownPoint(float &x, float &y) const
Get the x, y position of the last mouse down message.
Definition: IGraphics.h:1593
+
IGraphics::Height
int Height() const
Gets the height of the graphics context.
Definition: IGraphics.h:1085
IGraphics::PathClipRegion
void PathClipRegion(const IRECT r=IRECT())
Clip the current path to a particular region.
Definition: IGraphics.cpp:2765
IGraphics::PathCircle
void PathCircle(float cx, float cy, float r)
Add a circle to the current path.
Definition: IGraphics.cpp:2688
IGraphics::PathRadialLine
void PathRadialLine(float cx, float cy, float angle, float rMin, float rMax)
Add a radial line to the current path.
Definition: IGraphics.cpp:818
IGraphics::PathTransformRotate
void PathTransformRotate(float angle)
Apply a rotation transform to the current path.
Definition: IGraphics.cpp:2747
-
IGraphics::GetResizingInProcess
bool GetResizingInProcess() const
Definition: IGraphics.h:1137
+
IGraphics::GetResizingInProcess
bool GetResizingInProcess() const
Definition: IGraphics.h:1143
IGraphics::OnKeyUp
bool OnKeyUp(float x, float y, const IKeyPress &key)
Definition: IGraphics.cpp:1248
IGraphics::IsDirty
bool IsDirty(IRECTList &rects)
Called repeatedly at frame rate by the platform class to check what the graphics context says is dirt...
Definition: IGraphics.cpp:825
IGraphics::FillRoundRect
virtual void FillRoundRect(const IColor &color, const IRECT &bounds, float cornerRadius=5.f, const IBlend *pBlend=0)
Fill a rounded rectangle with a color.
Definition: IGraphics.cpp:2576
@@ -1130,11 +1133,11 @@
IGraphics::ForAllControls
void ForAllControls(T method, Args... args)
For all controls, including the "special controls" call a method.
Definition: IGraphics.cpp:571
IGraphics::ClearGestureRegions
void ClearGestureRegions()
Remove all gesture recognizers linked to regions.
Definition: IGraphics.cpp:2393
IGraphics::SetControlValueAfterTextEdit
void SetControlValueAfterTextEdit(const char *str)
Called by the platform class after returning from a text entry in order to update a control with a ne...
Definition: IGraphics.cpp:235
-
IGraphics::ControlIsCaptured
bool ControlIsCaptured(IControl *pControl) const
Check to see if the control is already captured.
Definition: IGraphics.h:1393
+
IGraphics::ControlIsCaptured
bool ControlIsCaptured(IControl *pControl) const
Check to see if the control is already captured.
Definition: IGraphics.h:1399
IGraphics::GetMouseLocation
virtual void GetMouseLocation(float &x, float &y) const =0
Get the x, y position of the mouse cursor.
IGraphics::DrawMultiLineText
virtual void DrawMultiLineText(const IText &text, const char *str, IRECT &bounds, const IBlend *pBlend=0)
Draw some multi-line text to the graphics context in a specific rectangle (NanoVG only)
Definition: IGraphics.h:363
-
IGraphics::GetWinModuleHandle
virtual void * GetWinModuleHandle()
Definition: IGraphics.h:920
-
IGraphics::NControls
int NControls() const
Definition: IGraphics.h:1431
+
IGraphics::GetWinModuleHandle
virtual void * GetWinModuleHandle()
Definition: IGraphics.h:926
+
IGraphics::NControls
int NControls() const
Definition: IGraphics.h:1437
IGraphics::UpdateLayer
virtual void UpdateLayer()
Implemented by a graphics backend to prepare for drawing to the layer at the top of the stack.
Definition: IGraphics.h:578
IGraphics::DrawData
virtual void DrawData(const IColor &color, const IRECT &bounds, float *normYPoints, int nPoints, float *normXPoints=nullptr, const IBlend *pBlend=0, float thickness=1.f, const IColor *pFillColor=nullptr)
Draw a line between a collection of normalized points.
Definition: IGraphics.cpp:2450
IGraphics::SetQwertyMidiKeyHandlerFunc
void SetQwertyMidiKeyHandlerFunc(std::function< void(const IMidiMsg &msg)> func=nullptr)
A helper to set the IGraphics KeyHandlerFunc in order to make an instrument playable via QWERTY keys.
Definition: IGraphics.cpp:2275
@@ -1142,11 +1145,11 @@
IGraphics::FillTriangle
virtual void FillTriangle(const IColor &color, float x1, float y1, float x2, float y2, float x3, float y3, const IBlend *pBlend=0)
Fill a triangle with a color.
Definition: IGraphics.cpp:2562
IGraphics::ApplyLayerDropShadow
void ApplyLayerDropShadow(ILayerPtr &layer, const IShadow &shadow)
Applies a drop shadow directly onto a layer.
Definition: IGraphics.cpp:2075
IGraphics::DrawGrid
virtual void DrawGrid(const IColor &color, const IRECT &bounds, float gridSizeH, float gridSizeV, const IBlend *pBlend=0, float thickness=1.f)
Draw a grid to the graphics context.
Definition: IGraphics.cpp:2424
-
IGraphics::SetSharedResourcesSubPath
void SetSharedResourcesSubPath(const char *sharedResourcesSubPath)
Sets the name of the shared resources subpath.
Definition: IGraphics.h:1633
-
IGraphics::GetMouseOver
int GetMouseOver() const
Definition: IGraphics.h:1582
+
IGraphics::SetSharedResourcesSubPath
void SetSharedResourcesSubPath(const char *sharedResourcesSubPath)
Sets the name of the shared resources subpath.
Definition: IGraphics.h:1639
+
IGraphics::GetMouseOver
int GetMouseOver() const
Definition: IGraphics.h:1588
IGraphics::SetAllControlsDirty
void SetAllControlsDirty()
Calls SetDirty() on every control.
Definition: IGraphics.cpp:582
IGraphics::ScaleBitmap
virtual IBitmap ScaleBitmap(const IBitmap &inBitmap, const char *cacheName, int targetScale)
Returns a new IBitmap, an integer scaled version of the input, and adds it to the cache.
Definition: IGraphics.cpp:1846
-
IGraphics::GetControlInTextEntry
IControl * GetControlInTextEntry()
Definition: IGraphics.h:1125
+
IGraphics::GetControlInTextEntry
IControl * GetControlInTextEntry()
Definition: IGraphics.h:1131
IGraphics::GetScaledBitmap
IBitmap GetScaledBitmap(IBitmap &inBitmap)
Get a version of the input bitmap from the cache that corresponds to the current screen scale For exa...
Definition: IGraphics.cpp:1520
IGraphics::AttachPanelBackground
void AttachPanelBackground(const IPattern &color)
Attach an IPanelControl as the lowest IControl in the control stack to fill the background with a sol...
Definition: IGraphics.cpp:294
IGraphics::FillConvexPolygon
virtual void FillConvexPolygon(const IColor &color, float *x, float *y, int nPoints, const IBlend *pBlend=0)
Fill a convex polygon with a color.
Definition: IGraphics.cpp:2590
@@ -1156,7 +1159,7 @@
IGraphics::CreatePlatformPopupMenu
virtual IPopupMenu * CreatePlatformPopupMenu(IPopupMenu &menu, const IRECT bounds, bool &isAsync)=0
Calls the platform backend to create the platform popup menu.
IGraphics::RemoveControlWithTag
void RemoveControlWithTag(int ctrlTag)
Remove controls from the control list with a particular tag.
Definition: IGraphics.cpp:132
IGraphics::RemovePlatformView
virtual void RemovePlatformView(void *pView)
Remove a previously attached platform view from the IGraphics view.
Definition: IGraphics.h:803
-
IGraphics::GetTouches
void GetTouches(IControl *pControl, std::vector< ITouchID > &touchesOnThisControl) const
Populate a vector with the touchIDs active on pControl.
Definition: IGraphics.h:1399
+
IGraphics::GetTouches
void GetTouches(IControl *pControl, std::vector< ITouchID > &touchesOnThisControl) const
Populate a vector with the touchIDs active on pControl.
Definition: IGraphics.h:1405
IGraphics::OnMouseWheel
void OnMouseWheel(float x, float y, const IMouseMod &mod, float delta)
Definition: IGraphics.cpp:1223
IGraphics::DrawVerticalLine
void DrawVerticalLine(const IColor &color, const IRECT &bounds, float x, const IBlend *pBlend=0, float thickness=1.f)
Draw a vertical line, within a rectangular region of the graphics context.
Definition: IGraphics.cpp:787
IGraphics::PathMoveTo
virtual void PathMoveTo(float x, float y)=0
Move the current point in the current path.
@@ -1164,14 +1167,14 @@
IGraphics::PopupHostContextMenuForParam
void PopupHostContextMenuForParam(int controlIdx, int paramIdx, float x, float y)
[VST3 primarily] In VST3 plug-ins this enable support for the IContextMenu interface,...
Definition: IGraphics.cpp:1488
IGraphics::FlippedBitmap
virtual bool FlippedBitmap() const =0
IGraphics::PromptUserInput
void PromptUserInput(IControl &control, const IRECT &bounds, int valIdx=0)
Prompt for user input either using a text entry or pop up menu.
Definition: IGraphics.cpp:622
-
IGraphics::GetPlatformAPIStr
virtual const char * GetPlatformAPIStr()
Definition: IGraphics.h:908
+
IGraphics::GetPlatformAPIStr
virtual const char * GetPlatformAPIStr()
Definition: IGraphics.h:914
IGraphics::SetControlSize
void SetControlSize(IControl *pControl, float w, float h)
Resize a control, redrawing the interface correctly.
Definition: IGraphics.cpp:221
-
IGraphics::GetScreenScale
float GetScreenScale() const
Gets the screen/display scaling factor, e.g.
Definition: IGraphics.h:1099
+
IGraphics::GetScreenScale
float GetScreenScale() const
Gets the screen/display scaling factor, e.g.
Definition: IGraphics.h:1105
IGraphics::LoadAPIFont
virtual bool LoadAPIFont(const char *fontID, const PlatformFontPtr &font)=0
Drawing API method to load a font from a PlatformFontPtr, called internally.
-
IGraphics::ShowControlBoundsEnabled
bool ShowControlBoundsEnabled() const
Definition: IGraphics.h:1176
+
IGraphics::ShowControlBoundsEnabled
bool ShowControlBoundsEnabled() const
Definition: IGraphics.h:1182
IGraphics::OnDropMultiple
void OnDropMultiple(const std::vector< const char * > &paths, float x, float y)
Definition: IGraphics.cpp:1272
IGraphics::AssignParamNameToolTips
void AssignParamNameToolTips()
Call this method in order to create tool tips for every IControl that show the associated parameter's...
Definition: IGraphics.cpp:592
-
IGraphics::EnableMultiTouch
bool EnableMultiTouch(bool enable)
Enable/disable multi touch, if platform supports it.
Definition: IGraphics.h:1141
+
IGraphics::EnableMultiTouch
bool EnableMultiTouch(bool enable)
Enable/disable multi touch, if platform supports it.
Definition: IGraphics.h:1147
IGraphics::LoadSVG
virtual ISVG LoadSVG(const char *fileNameOrResID, const char *units="px", float dpi=72.f)
Load an SVG from disk or from windows resource.
Definition: IGraphics.cpp:1620
IGraphics::LoadAPIBitmap
virtual APIBitmap * LoadAPIBitmap(const char *fileNameOrResID, int scale, EResourceLocation location, const char *ext)=0
Drawing API method to load a bitmap, called internally.
IGraphics::HideMouseCursor
virtual void HideMouseCursor(bool hide=true, bool lock=true)=0
Call to hide/show the mouse cursor.
@@ -1180,60 +1183,60 @@
IGraphics::DrawHorizontalLine
void DrawHorizontalLine(const IColor &color, const IRECT &bounds, float y, const IBlend *pBlend=0, float thickness=1.f)
Draw a horizontal line, within a rectangular region of the graphics context.
Definition: IGraphics.cpp:794
IGraphics::ForControlInGroup
void ForControlInGroup(const char *group, IControlFunction func)
For all standard controls in the main control stack that are linked to a group, execute a function.
Definition: IGraphics.cpp:519
IGraphics::DoDrawText
virtual void DoDrawText(const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=nullptr)=0
-
IGraphics::GetUIAppearance
virtual EUIAppearance GetUIAppearance() const
Get the UI Appearance (Light/Dark mode)
Definition: IGraphics.h:1570
+
IGraphics::GetUIAppearance
virtual EUIAppearance GetUIAppearance() const
Get the UI Appearance (Light/Dark mode)
Definition: IGraphics.h:1576
IGraphics::PathTransformSave
void PathTransformSave()
Save the current affine transform of the current path.
Definition: IGraphics.cpp:2703
IGraphics::FillArc
virtual void FillArc(const IColor &color, float cx, float cy, float r, float a1, float a2, const IBlend *pBlend=0)
Fill an arc segment with a color.
Definition: IGraphics.cpp:2597
-
IGraphics::GetPromptMenu
IPopupMenu & GetPromptMenu()
Definition: IGraphics.h:1119
-
IGraphics::SetKeyHandlerFunc
void SetKeyHandlerFunc(IKeyHandlerFunc func)
Set a function that is called when key presses are not intercepted by any controls.
Definition: IGraphics.h:1200
+
IGraphics::GetPromptMenu
IPopupMenu & GetPromptMenu()
Definition: IGraphics.h:1125
+
IGraphics::SetKeyHandlerFunc
void SetKeyHandlerFunc(IKeyHandlerFunc func)
Set a function that is called when key presses are not intercepted by any controls.
Definition: IGraphics.h:1206
IGraphics::DrawDottedLine
virtual void DrawDottedLine(const IColor &color, float x1, float y1, float x2, float y2, const IBlend *pBlend=0, float thickness=1.f, float dashLen=2.f)
Draw a dotted line to the graphics context.
Definition: IGraphics.cpp:2479
IGraphics::WindowIsOpen
virtual bool WindowIsOpen()
Definition: IGraphics.h:851
IGraphics::RemoveTextEntryControl
void RemoveTextEntryControl()
Remove the IGraphics text entry, use platform text entry if available.
Definition: IGraphics.cpp:379
IGraphics::ShowFPSDisplay
void ShowFPSDisplay(bool enable)
Shows a control to display the frame rate of drawing.
Definition: IGraphics.cpp:429
IGraphics::PathLineTo
virtual void PathLineTo(float x, float y)=0
Add a line to the current path from the current point to the specified location.
IGraphics::DrawLineAcross
void DrawLineAcross(const IColor &color, const IRECT &bounds, EDirection dir, float pos, const IBlend *pBlend=0, float thickness=1.f)
Draw a horzional or vertical line, within a rectangular region of the graphics context.
Definition: IGraphics.cpp:779
-
IGraphics::GetControlIdx
int GetControlIdx(IControl *pControl) const
Get the index of a particular IControl in the control stack.
Definition: IGraphics.h:1353
-
IGraphics::GetSharedResourcesSubPath
const char * GetSharedResourcesSubPath() const
Gets the name of the shared resources subpath.
Definition: IGraphics.h:1630
-
IGraphics::GetPopupMenuControl
IPopupMenuControl * GetPopupMenuControl()
Definition: IGraphics.h:1410
-
IGraphics::CanEnableMouseOver
bool CanEnableMouseOver() const
Definition: IGraphics.h:1579
+
IGraphics::GetControlIdx
int GetControlIdx(IControl *pControl) const
Get the index of a particular IControl in the control stack.
Definition: IGraphics.h:1359
+
IGraphics::GetSharedResourcesSubPath
const char * GetSharedResourcesSubPath() const
Gets the name of the shared resources subpath.
Definition: IGraphics.h:1636
+
IGraphics::GetPopupMenuControl
IPopupMenuControl * GetPopupMenuControl()
Definition: IGraphics.h:1416
+
IGraphics::CanEnableMouseOver
bool CanEnableMouseOver() const
Definition: IGraphics.h:1585
IGraphics::PathTransformSkew
void PathTransformSkew(float xAngle, float yAngle)
Apply a skew transform to the current path.
Definition: IGraphics.cpp:2753
-
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1095
+
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1101
IGraphics::DrawFittedLayer
void DrawFittedLayer(const ILayerPtr &layer, const IRECT &bounds, const IBlend *pBlend)
Draw a layer to the main IGraphics context, fitting it to a rectangle that is different to the layer'...
Definition: IGraphics.cpp:2053
IGraphics::RemoveControls
void RemoveControls(int fromIdx)
Remove controls from the control list above a particular index, (frees memory).
Definition: IGraphics.cpp:139
IGraphics::AttachBackground
void AttachBackground(const char *fileName)
Attach an IBitmapControl as the lowest IControl in the control stack to be the background for the gra...
Definition: IGraphics.cpp:280
IGraphics::SetStrictDrawing
void SetStrictDrawing(bool strict)
Enables strict drawing mode.
Definition: IGraphics.cpp:965
-
IGraphics::ShowingFPSDisplay
bool ShowingFPSDisplay()
Definition: IGraphics.h:1336
+
IGraphics::ShowingFPSDisplay
bool ShowingFPSDisplay()
Definition: IGraphics.h:1342
IGraphics::ForceEndUserEdit
virtual void ForceEndUserEdit()=0
Call to force end text entry (will cancel any half input text.
IGraphics::OnGUIIdle
void OnGUIIdle()
This is an idle timer tick call on the GUI thread, only active if USE_IDLE_CALLS is defined.
Definition: IGraphics.cpp:1493
IGraphics::ShowMessageBox
virtual EMsgBoxResult ShowMessageBox(const char *str, const char *caption, EMsgBoxType type, IMsgBoxCompletionHandlerFunc completionHandler=nullptr)=0
Pop up a modal platform message box dialog.
-
IGraphics::GetDelegate
IGEditorDelegate * GetDelegate()
Gets a pointer to the delegate class that handles communication to and from this graphics context.
Definition: IGraphics.h:1116
-
IGraphics::ShowAreaDrawn
void ShowAreaDrawn(bool enable)
Definition: IGraphics.h:1170
-
IGraphics::GetControl
IControl * GetControl(int idx)
Get the control at a certain index in the control stack.
Definition: IGraphics.h:1348
+
IGraphics::GetDelegate
IGEditorDelegate * GetDelegate()
Gets a pointer to the delegate class that handles communication to and from this graphics context.
Definition: IGraphics.h:1122
+
IGraphics::ShowAreaDrawn
void ShowAreaDrawn(bool enable)
Definition: IGraphics.h:1176
+
IGraphics::GetControl
IControl * GetControl(int idx)
Get the control at a certain index in the control stack.
Definition: IGraphics.h:1354
IGraphics::StartLayer
void StartLayer(IControl *pOwner, const IRECT &r, bool cacheable=false)
Create an IGraphics layer.
Definition: IGraphics.cpp:1977
-
IGraphics::GetControlTag
int GetControlTag(const IControl *pControl) const
Get the tag given to a control.
Definition: IGraphics.h:1372
+
IGraphics::GetControlTag
int GetControlTag(const IControl *pControl) const
Get the tag given to a control.
Definition: IGraphics.h:1378
IGraphics::OnGestureRecognized
void OnGestureRecognized(const IGestureInfo &info)
Called by platform class when a gesture is recognized.
Definition: IGraphics.cpp:2363
IGraphics::CachePlatformFont
virtual void CachePlatformFont(const char *fontID, const PlatformFontPtr &font)=0
Called to indicate that the platform should cache data about the platform font if needed.
IGraphics::OnMouseDblClick
bool OnMouseDblClick(float x, float y, const IMouseMod &mod)
Definition: IGraphics.cpp:1195
-
IGraphics::TooltipsEnabled
bool TooltipsEnabled() const
Definition: IGraphics.h:1131
+
IGraphics::TooltipsEnabled
bool TooltipsEnabled() const
Definition: IGraphics.h:1137
IGraphics::DrawSVG
virtual void DrawSVG(const ISVG &svg, const IRECT &bounds, const IBlend *pBlend=0, const IColor *pStrokeColor=nullptr, const IColor *pFillColor=nullptr)
Draw an SVG image to the graphics context.
Definition: IGraphics.cpp:2784
IGraphics::ForStandardControlsFunc
void ForStandardControlsFunc(IControlFunction func)
For all standard controls in the main control stack perform a function.
Definition: IGraphics.cpp:534
IGraphics::DrawTriangle
virtual void DrawTriangle(const IColor &color, float x1, float y1, float x2, float y2, float x3, float y3, const IBlend *pBlend=0, float thickness=1.f)
Draw a triangle to the graphics context.
Definition: IGraphics.cpp:2490
IGraphics::CloseWindow
virtual void CloseWindow()=0
Close the platform view for this graphics context.
IGraphics::PathCubicBezierTo
virtual void PathCubicBezierTo(float c1x, float c1y, float c2x, float c2y, float x2, float y2)=0
Add a cubic bezier to the current path from the current point to the specified location.
-
IGraphics::WindowHeight
int WindowHeight() const
Gets the height of the graphics context including draw scaling.
Definition: IGraphics.h:1087
+
IGraphics::WindowHeight
int WindowHeight() const
Gets the height of the graphics context including draw scaling.
Definition: IGraphics.h:1093
IGraphics::PathEllipse
void PathEllipse(const IRECT &bounds)
Add an ellipse to the current path, specifying the rectangular region.
Definition: IGraphics.cpp:2683
IGraphics::LoadBitmap
virtual IBitmap LoadBitmap(const char *fileNameOrResID, int nStates=1, bool framesAreHorizontal=false, int targetScale=0)
Load a bitmap image from disk or from windows resource.
Definition: IGraphics.cpp:1721
-
IGraphics::SetPlatformContext
void SetPlatformContext(void *pContext)
Set the platform draw context Used in order to set the platform level draw context - CGContextRef con...
Definition: IGraphics.h:925
+
IGraphics::SetPlatformContext
void SetPlatformContext(void *pContext)
Set the platform draw context Used in order to set the platform level draw context - CGContextRef con...
Definition: IGraphics.h:931
IGraphics::BeginFrame
virtual void BeginFrame()
Called at the beginning of drawing.
Definition: IGraphics.cpp:867
IGraphics::FillCircle
virtual void FillCircle(const IColor &color, float cx, float cy, float r, const IBlend *pBlend=0)
Fill a circle with a color.
Definition: IGraphics.cpp:2606
-
IGraphics::OnSetCursor
void OnSetCursor()
Called when the mouse enters the graphics context, to update the cursor to mCursorType.
Definition: IGraphics.h:1546
+
IGraphics::OnSetCursor
void OnSetCursor()
Called when the mouse enters the graphics context, to update the cursor to mCursorType.
Definition: IGraphics.h:1552
IGraphics::SetControlPosition
void SetControlPosition(IControl *pControl, float x, float y)
Reposition a control, redrawing the interface correctly.
Definition: IGraphics.cpp:214
IGraphics::SetScreenScale
void SetScreenScale(float scale)
Called by the platform IGraphics class when moving to a new screen to set DPI.
Definition: IGraphics.cpp:75
-
IGraphics::EnableMouseOver
void EnableMouseOver(bool enable)
Definition: IGraphics.h:1573
+
IGraphics::EnableMouseOver
void EnableMouseOver(bool enable)
Definition: IGraphics.h:1579
IGraphics::LoadAPIBitmap
virtual APIBitmap * LoadAPIBitmap(const char *name, const void *pData, int dataSize, int scale)=0
Drawing API method to load a bitmap from binary data, called internally.
IGraphics::EndLayer
ILayerPtr EndLayer()
End an IGraphics layer.
Definition: IGraphics.cpp:2000
IGraphics::LoadResource
virtual WDL_TypedBuf< uint8_t > LoadResource(const char *fileNameOrResID, const char *fileType)
Load a resource from the file system, the bundle, or a Windows resource, and returns its data.
Definition: IGraphics.cpp:1666
IGraphics::OnDrop
void OnDrop(const char *str, float x, float y)
Definition: IGraphics.cpp:1266
-
IGraphics::GetBounds
IRECT GetBounds() const
Returns an IRECT that represents the entire UI bounds This is useful for programatically arranging UI...
Definition: IGraphics.h:1188
+
IGraphics::GetBounds
IRECT GetBounds() const
Returns an IRECT that represents the entire UI bounds This is useful for programatically arranging UI...
Definition: IGraphics.h:1194
IGraphics::AttachControl
IControl * AttachControl(IControl *pControl, int ctrlTag=kNoTag, const char *group="")
Attach an IControl to the graphics context and add it to the top of the control stack.
Definition: IGraphics.cpp:301
IGraphics::DrawBitmap
virtual void DrawBitmap(const IBitmap &bitmap, const IRECT &bounds, int srcX, int srcY, const IBlend *pBlend=0)=0
Draw a bitmap (raster) image to the graphics context.
IGraphics::MeasureText
virtual float MeasureText(const IText &text, const char *str, IRECT &bounds) const
Measure the rectangular region that some text will occupy.
Definition: IGraphics.cpp:678
diff --git a/_i_graphics_canvas_8cpp_source.html b/_i_graphics_canvas_8cpp_source.html index 3ac21c11..20685096 100644 --- a/_i_graphics_canvas_8cpp_source.html +++ b/_i_graphics_canvas_8cpp_source.html @@ -698,7 +698,7 @@
IGraphicsCanvas::DrawBitmap
void DrawBitmap(const IBitmap &bitmap, const IRECT &bounds, int srcX, int srcY, const IBlend *pBlend) override
Draw a bitmap (raster) image to the graphics context.
Definition: IGraphicsCanvas.cpp:105
IGraphics
The lowest level base class of an IGraphics context.
Definition: IGraphics.h:86
IGraphics::PathRect
void PathRect(const IRECT &bounds)
Add a rectangle to the current path.
Definition: IGraphics.cpp:2635
-
IGraphics::GetBackingPixelScale
virtual float GetBackingPixelScale() const
Definition: IGraphics.h:1772
+
IGraphics::GetBackingPixelScale
virtual float GetBackingPixelScale() const
Definition: IGraphics.h:1778
IGraphics::DoMeasureTextRotation
void DoMeasureTextRotation(const IText &text, const IRECT &bounds, IRECT &rect) const
Definition: IGraphics.cpp:2227
IGraphics::PathTransformRestore
void PathTransformRestore()
Restore the affine transform of the current path, to the previously saved state.
Definition: IGraphics.cpp:2708
IGraphics::PathTransformSave
void PathTransformSave()
Save the current affine transform of the current path.
Definition: IGraphics.cpp:2703
diff --git a/_i_graphics_i_o_s__view_8h_source.html b/_i_graphics_i_o_s__view_8h_source.html index 23c38bef..db3153be 100644 --- a/_i_graphics_i_o_s__view_8h_source.html +++ b/_i_graphics_i_o_s__view_8h_source.html @@ -203,7 +203,7 @@
116
117@end
IGraphics
The lowest level base class of an IGraphics context.
Definition: IGraphics.h:86
-
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1095
+
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1101
IGraphicsIOS
IGraphics platform class for IOS.
Definition: IGraphicsIOS.h:25
IPopupMenu
A class for setting the contents of a pop up menu.
Definition: IGraphicsPopupMenu.h:40
IColor
Used to manage color data, independent of draw class/platform.
Definition: IGraphicsStructs.h:223
diff --git a/_i_graphics_live_edit_8h_source.html b/_i_graphics_live_edit_8h_source.html index e976ba88..951c71dc 100644 --- a/_i_graphics_live_edit_8h_source.html +++ b/_i_graphics_live_edit_8h_source.html @@ -432,18 +432,18 @@
IGraphics::SetMouseCursor
virtual ECursor SetMouseCursor(ECursor cursorType=ECursor::ARROW)
Sets the mouse cursor to one of ECursor (implementations should return the result of the base impleme...
Definition: IGraphics.h:828
IGraphics::DrawDottedRect
virtual void DrawDottedRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0, float thickness=1.f, float dashLen=2.f)
Draw a dotted rectangle to the graphics context.
Definition: IGraphics.cpp:2539
IGraphics::ReleaseMouseCapture
void ReleaseMouseCapture()
Used to tell the graphics context to stop tracking mouse interaction with a control.
Definition: IGraphics.cpp:1278
-
IGraphics::GetMouseDownPoint
void GetMouseDownPoint(float &x, float &y) const
Get the x, y position of the last mouse down message.
Definition: IGraphics.h:1587
-
IGraphics::NControls
int NControls() const
Definition: IGraphics.h:1431
+
IGraphics::GetMouseDownPoint
void GetMouseDownPoint(float &x, float &y) const
Get the x, y position of the last mouse down message.
Definition: IGraphics.h:1593
+
IGraphics::NControls
int NControls() const
Definition: IGraphics.h:1437
IGraphics::FillTriangle
virtual void FillTriangle(const IColor &color, float x1, float y1, float x2, float y2, float x3, float y3, const IBlend *pBlend=0)
Fill a triangle with a color.
Definition: IGraphics.cpp:2562
IGraphics::DrawGrid
virtual void DrawGrid(const IColor &color, const IRECT &bounds, float gridSizeH, float gridSizeV, const IBlend *pBlend=0, float thickness=1.f)
Draw a grid to the graphics context.
Definition: IGraphics.cpp:2424
IGraphics::SetAllControlsDirty
void SetAllControlsDirty()
Calls SetDirty() on every control.
Definition: IGraphics.cpp:582
IGraphics::SetControlSize
void SetControlSize(IControl *pControl, float w, float h)
Resize a control, redrawing the interface correctly.
Definition: IGraphics.cpp:221
-
IGraphics::GetControl
IControl * GetControl(int idx)
Get the control at a certain index in the control stack.
Definition: IGraphics.h:1348
+
IGraphics::GetControl
IControl * GetControl(int idx)
Get the control at a certain index in the control stack.
Definition: IGraphics.h:1354
IGraphics::ForStandardControlsFunc
void ForStandardControlsFunc(IControlFunction func)
For all standard controls in the main control stack perform a function.
Definition: IGraphics.cpp:534
IGraphics::DrawTriangle
virtual void DrawTriangle(const IColor &color, float x1, float y1, float x2, float y2, float x3, float y3, const IBlend *pBlend=0, float thickness=1.f)
Draw a triangle to the graphics context.
Definition: IGraphics.cpp:2490
IGraphics::SetControlPosition
void SetControlPosition(IControl *pControl, float x, float y)
Reposition a control, redrawing the interface correctly.
Definition: IGraphics.cpp:214
-
IGraphics::EnableMouseOver
void EnableMouseOver(bool enable)
Definition: IGraphics.h:1573
-
IGraphics::GetBounds
IRECT GetBounds() const
Returns an IRECT that represents the entire UI bounds This is useful for programatically arranging UI...
Definition: IGraphics.h:1188
+
IGraphics::EnableMouseOver
void EnableMouseOver(bool enable)
Definition: IGraphics.h:1579
+
IGraphics::GetBounds
IRECT GetBounds() const
Returns an IRECT that represents the entire UI bounds This is useful for programatically arranging UI...
Definition: IGraphics.h:1194
IGraphics::AttachControl
IControl * AttachControl(IControl *pControl, int ctrlTag=kNoTag, const char *group="")
Attach an IControl to the graphics context and add it to the top of the control stack.
Definition: IGraphics.cpp:301
IGraphicsLiveEdit
A control to enable live modification of control layout in an IGraphics context in debug builds This ...
Definition: IGraphicsLiveEdit.h:32
IGraphicsLiveEdit::OnResize
void OnResize() override
Called when IControl is constructed or resized using SetRect().
Definition: IGraphicsLiveEdit.h:294
diff --git a/_i_graphics_mac_8h_source.html b/_i_graphics_mac_8h_source.html index e538837e..088249f8 100644 --- a/_i_graphics_mac_8h_source.html +++ b/_i_graphics_mac_8h_source.html @@ -154,33 +154,35 @@
69 bool SetTextInClipboard(const char* str) override;
70 bool SetFilePathInClipboard(const char* path) override;
71
-
72 float MeasureText(const IText& text, const char* str, IRECT& bounds) const override;
+
72 bool InitiateExternalFileDragDrop(const char* path, const IRECT& iconBounds) override API_AVAILABLE(macos(10.13));
73
-
74 EUIAppearance GetUIAppearance() const override;
-
75protected:
-
76
-
77 IPopupMenu* CreatePlatformPopupMenu(IPopupMenu& menu, const IRECT bounds, bool& isAsync) override;
-
78 void CreatePlatformTextEntry(int paramIdx, const IText& text, const IRECT& bounds, int length, const char* str) override;
-
79private:
-
80 void PointToScreen(float& x, float& y) const;
-
81 void ScreenToPoint(float& x, float& y) const;
-
82
-
83 PlatformFontPtr LoadPlatformFont(const char* fontID, const char* fileNameOrResID) override;
-
84 PlatformFontPtr LoadPlatformFont(const char* fontID, const char* fontName, ETextStyle style) override;
-
85 PlatformFontPtr LoadPlatformFont(const char* fontID, void* pData, int dataSize) override;
-
86 void CachePlatformFont(const char* fontID, const PlatformFontPtr& font) override;
-
87
-
88 void RepositionCursor(CGPoint point);
-
89 void StoreCursorPosition();
-
90
-
91 void* mView = nullptr;
-
92 CGPoint mCursorLockPosition;
-
93 WDL_String mBundleID, mAppGroupID;
-
94 friend int GetMouseOver(IGraphicsMac* pGraphics);
-
95};
-
96
-
97END_IGRAPHICS_NAMESPACE
-
98END_IPLUG_NAMESPACE
+
74 float MeasureText(const IText& text, const char* str, IRECT& bounds) const override;
+
75
+
76 EUIAppearance GetUIAppearance() const override;
+
77protected:
+
78
+
79 IPopupMenu* CreatePlatformPopupMenu(IPopupMenu& menu, const IRECT bounds, bool& isAsync) override;
+
80 void CreatePlatformTextEntry(int paramIdx, const IText& text, const IRECT& bounds, int length, const char* str) override;
+
81private:
+
82 void PointToScreen(float& x, float& y) const;
+
83 void ScreenToPoint(float& x, float& y) const;
+
84
+
85 PlatformFontPtr LoadPlatformFont(const char* fontID, const char* fileNameOrResID) override;
+
86 PlatformFontPtr LoadPlatformFont(const char* fontID, const char* fontName, ETextStyle style) override;
+
87 PlatformFontPtr LoadPlatformFont(const char* fontID, void* pData, int dataSize) override;
+
88 void CachePlatformFont(const char* fontID, const PlatformFontPtr& font) override;
+
89
+
90 void RepositionCursor(CGPoint point);
+
91 void StoreCursorPosition();
+
92
+
93 void* mView = nullptr;
+
94 CGPoint mCursorLockPosition;
+
95 WDL_String mBundleID, mAppGroupID;
+
96 friend int GetMouseOver(IGraphicsMac* pGraphics);
+
97};
+
98
+
99END_IGRAPHICS_NAMESPACE
+
100END_IPLUG_NAMESPACE
IGraphics_select.h
Used for choosing a drawing backend.
IGEditorDelegate
An editor delegate base class for a SOMETHING that uses IGraphics for it's UI.
Definition: IGraphicsEditorDelegate.h:30
IGraphicsMac
IGraphics platform class for macOS.
Definition: IGraphicsMac.h:24
diff --git a/_i_graphics_mac_8mm_source.html b/_i_graphics_mac_8mm_source.html index b8508ed3..992725d8 100644 --- a/_i_graphics_mac_8mm_source.html +++ b/_i_graphics_mac_8mm_source.html @@ -749,27 +749,49 @@
662 return (bool)success;
663}
664
-
665EUIAppearance IGraphicsMac::GetUIAppearance() const
-
666{
-
667 if (@available(macOS 10.14, *)) {
-
668 if(mView)
-
669 {
-
670 IGRAPHICS_VIEW* pView = (IGRAPHICS_VIEW*) mView;
-
671 BOOL isDarkMode = [[[pView effectiveAppearance] name] isEqualToString: (NSAppearanceNameDarkAqua)];
-
672 return isDarkMode ? EUIAppearance::Dark : EUIAppearance::Light;
-
673 }
-
674 }
-
675
-
676 return EUIAppearance::Light;
-
677}
-
678
-
679#if defined IGRAPHICS_NANOVG
-
680 #include "IGraphicsNanoVG.cpp"
-
681#elif defined IGRAPHICS_SKIA
-
682 #include "IGraphicsSkia.cpp"
-
683#else
-
684 #error Either NO_IGRAPHICS or one and only one choice of graphics library must be defined!
-
685#endif
+
665bool IGraphicsMac::InitiateExternalFileDragDrop(const char* path, const IRECT& iconBounds)
+
666{
+
667 NSPasteboardItem* pasteboardItem = [[NSPasteboardItem alloc] init];
+
668 NSURL* fileURL = [NSURL fileURLWithPath: [NSString stringWithUTF8String: path]];
+
669 [pasteboardItem setString:fileURL.absoluteString forType:NSPasteboardTypeFileURL];
+
670
+
671 NSDraggingItem* draggingItem = [[NSDraggingItem alloc] initWithPasteboardWriter:pasteboardItem];
+
672 NSRect draggingFrame = ToNSRect(this, iconBounds);
+
673 NSImage* iconImage = [[NSWorkspace sharedWorkspace] iconForFile:fileURL.path];
+
674 [iconImage setSize:NSMakeSize(64, 64)];
+
675 [draggingItem setDraggingFrame:draggingFrame contents: iconImage];
+
676
+
677 IGRAPHICS_VIEW* view = (IGRAPHICS_VIEW*) mView;
+
678 NSDraggingSession* draggingSession = [view beginDraggingSessionWithItems:@[draggingItem] event:[NSApp currentEvent] source: view];
+
679 draggingSession.animatesToStartingPositionsOnCancelOrFail = YES;
+
680 draggingSession.draggingFormation = NSDraggingFormationNone;
+
681
+
682 ReleaseMouseCapture();
+
683
+
684 return true;
+
685}
+
686
+
687EUIAppearance IGraphicsMac::GetUIAppearance() const
+
688{
+
689 if (@available(macOS 10.14, *)) {
+
690 if(mView)
+
691 {
+
692 IGRAPHICS_VIEW* pView = (IGRAPHICS_VIEW*) mView;
+
693 BOOL isDarkMode = [[[pView effectiveAppearance] name] isEqualToString: (NSAppearanceNameDarkAqua)];
+
694 return isDarkMode ? EUIAppearance::Dark : EUIAppearance::Light;
+
695 }
+
696 }
+
697
+
698 return EUIAppearance::Light;
+
699}
+
700
+
701#if defined IGRAPHICS_NANOVG
+
702 #include "IGraphicsNanoVG.cpp"
+
703#elif defined IGRAPHICS_SKIA
+
704 #include "IGraphicsSkia.cpp"
+
705#else
+
706 #error Either NO_IGRAPHICS or one and only one choice of graphics library must be defined!
+
707#endif
IControl.h
This file contains the base IControl implementation, along with some base classes for specific types ...
IPopupMenuControl.h
IControl
The lowest level base class of an IGraphics control.
Definition: IControl.h:49
diff --git a/_i_graphics_mac__view_8h_source.html b/_i_graphics_mac__view_8h_source.html index cdb57ec0..32ba36a8 100644 --- a/_i_graphics_mac__view_8h_source.html +++ b/_i_graphics_mac__view_8h_source.html @@ -200,7 +200,7 @@
113#define VIEW_BASE NSView
114#endif
115
-
116@interface IGRAPHICS_VIEW : VIEW_BASE <NSTextFieldDelegate/*, WKScriptMessageHandler*/>
+
116@interface IGRAPHICS_VIEW : VIEW_BASE <NSTextFieldDelegate, NSDraggingSource/*, WKScriptMessageHandler*/>
117{
118 CVDisplayLinkRef mDisplayLink;
119 dispatch_source_t mDisplaySource;
@@ -261,12 +261,13 @@
174//drag-and-drop
175- (NSDragOperation) draggingEntered: (id <NSDraggingInfo>) sender;
176- (BOOL) performDragOperation: (id<NSDraggingInfo>) sender;
-
177//
-
178- (void) setMouseCursor: (ECursor) cursorType;
-
179@end
-
180
+
177- (NSDragOperation)draggingSession:(NSDraggingSession*) session sourceOperationMaskForDraggingContext:(NSDraggingContext)context;
+
178//
+
179- (void) setMouseCursor: (ECursor) cursorType;
+
180@end
+
181
IGraphics
The lowest level base class of an IGraphics context.
Definition: IGraphics.h:86
-
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1095
+
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1101
IGraphicsMac
IGraphics platform class for macOS.
Definition: IGraphicsMac.h:24
IPopupMenu
A class for setting the contents of a pop up menu.
Definition: IGraphicsPopupMenu.h:40
IRECTList
Used to manage a list of rectangular areas and optimize them for drawing to the screen.
Definition: IGraphicsStructs.h:1730
diff --git a/_i_graphics_mac__view_8mm_source.html b/_i_graphics_mac__view_8mm_source.html index 36122d3d..86834417 100644 --- a/_i_graphics_mac__view_8mm_source.html +++ b/_i_graphics_mac__view_8mm_source.html @@ -1372,54 +1372,59 @@
1285 return YES;
1286}
1287
-
1288#ifdef IGRAPHICS_METAL
-
1289- (void) frameDidChange:(NSNotification*) pNotification
-
1290{
-
1291 CGFloat scale = [[self window] backingScaleFactor];
+
1288- (NSDragOperation)draggingSession:(NSDraggingSession*) session sourceOperationMaskForDraggingContext:(NSDraggingContext)context
+
1289{
+
1290 return NSDragOperationCopy;
+
1291}
1292
-
1293 [(CAMetalLayer*)[self layer] setDrawableSize:CGSizeMake(self.frame.size.width * scale,
-
1294 self.frame.size.height * scale)];
-
1295}
-
1296#endif
+
1293#ifdef IGRAPHICS_METAL
+
1294- (void) frameDidChange:(NSNotification*) pNotification
+
1295{
+
1296 CGFloat scale = [[self window] backingScaleFactor];
1297
-
1298//- (void) windowResized: (NSNotification*) notification;
-
1299//{
-
1300// if(!mGraphics)
-
1301// return;
-
1302//
-
1303// NSSize windowSize = [[self window] frame].size;
-
1304// NSRect viewFrameInWindowCoords = [self convertRect: [self bounds] toView: nil];
-
1305//
-
1306// float width = windowSize.width - viewFrameInWindowCoords.origin.x;
-
1307// float height = windowSize.height - viewFrameInWindowCoords.origin.y;
-
1308//
-
1309// float scaleX = width / mGraphics->Width();
-
1310// float scaleY = height / mGraphics->Height();
-
1311//
-
1312// if(mGraphics->GetUIResizerMode() == EUIResizerMode::Scale)
-
1313// mGraphics->Resize(width, height, mGraphics->GetDrawScale());
-
1314// else // EUIResizerMode::Size
-
1315// mGraphics->Resize(mGraphics->Width(), mGraphics->Height(), Clip(std::min(scaleX, scaleY), 0.1f, 10.f));
-
1316//}
-
1317//
-
1318//- (void) windowFullscreened: (NSNotification*) pNotification;
-
1319//{
-
1320// NSSize windowSize = [[self window] frame].size;
-
1321// NSRect viewFrameInWindowCoords = [self convertRect: [self bounds] toView: nil];
+
1298 [(CAMetalLayer*)[self layer] setDrawableSize:CGSizeMake(self.frame.size.width * scale,
+
1299 self.frame.size.height * scale)];
+
1300}
+
1301#endif
+
1302
+
1303//- (void) windowResized: (NSNotification*) notification;
+
1304//{
+
1305// if(!mGraphics)
+
1306// return;
+
1307//
+
1308// NSSize windowSize = [[self window] frame].size;
+
1309// NSRect viewFrameInWindowCoords = [self convertRect: [self bounds] toView: nil];
+
1310//
+
1311// float width = windowSize.width - viewFrameInWindowCoords.origin.x;
+
1312// float height = windowSize.height - viewFrameInWindowCoords.origin.y;
+
1313//
+
1314// float scaleX = width / mGraphics->Width();
+
1315// float scaleY = height / mGraphics->Height();
+
1316//
+
1317// if(mGraphics->GetUIResizerMode() == EUIResizerMode::Scale)
+
1318// mGraphics->Resize(width, height, mGraphics->GetDrawScale());
+
1319// else // EUIResizerMode::Size
+
1320// mGraphics->Resize(mGraphics->Width(), mGraphics->Height(), Clip(std::min(scaleX, scaleY), 0.1f, 10.f));
+
1321//}
1322//
-
1323// float width = windowSize.width - viewFrameInWindowCoords.origin.x;
-
1324// float height = windowSize.height - viewFrameInWindowCoords.origin.y;
-
1325//
-
1326// float scaleX = width / mGraphics->Width();
-
1327// float scaleY = height / mGraphics->Height();
-
1328//
-
1329// if(mGraphics->GetUIResizerMode() == EUIResizerMode::Scale)
-
1330// mGraphics->Resize(width, height, mGraphics->GetDrawScale());
-
1331// else // EUIResizerMode::Size
-
1332// mGraphics->Resize(mGraphics->Width(), mGraphics->Height(), Clip(std::min(scaleX, scaleY), 0.1f, 10.f));
-
1333//}
-
1334
-
1335@end
+
1323//- (void) windowFullscreened: (NSNotification*) pNotification;
+
1324//{
+
1325// NSSize windowSize = [[self window] frame].size;
+
1326// NSRect viewFrameInWindowCoords = [self convertRect: [self bounds] toView: nil];
+
1327//
+
1328// float width = windowSize.width - viewFrameInWindowCoords.origin.x;
+
1329// float height = windowSize.height - viewFrameInWindowCoords.origin.y;
+
1330//
+
1331// float scaleX = width / mGraphics->Width();
+
1332// float scaleY = height / mGraphics->Height();
+
1333//
+
1334// if(mGraphics->GetUIResizerMode() == EUIResizerMode::Scale)
+
1335// mGraphics->Resize(width, height, mGraphics->GetDrawScale());
+
1336// else // EUIResizerMode::Size
+
1337// mGraphics->Resize(mGraphics->Width(), mGraphics->Height(), Clip(std::min(scaleX, scaleY), 0.1f, 10.f));
+
1338//}
+
1339
+
1340@end
IControl.h
This file contains the base IControl implementation, along with some base classes for specific types ...
IPlugLogger.h
IPlug logging a.k.a tracing functionality.
IPlugParameter.h
diff --git a/_i_graphics_nano_v_g_8cpp_source.html b/_i_graphics_nano_v_g_8cpp_source.html index 0e38cfd4..96ece81a 100644 --- a/_i_graphics_nano_v_g_8cpp_source.html +++ b/_i_graphics_nano_v_g_8cpp_source.html @@ -1096,19 +1096,19 @@
IGraphics::PopLayer
ILayer * PopLayer()
Pop a layer off the stack.
Definition: IGraphics.cpp:2014
IGraphics::PathTransformTranslate
void PathTransformTranslate(float x, float y)
Apply a translation transform to the current path.
Definition: IGraphics.cpp:2730
IGraphics::PathRect
void PathRect(const IRECT &bounds)
Add a rectangle to the current path.
Definition: IGraphics.cpp:2635
-
IGraphics::GetBackingPixelScale
virtual float GetBackingPixelScale() const
Definition: IGraphics.h:1772
+
IGraphics::GetBackingPixelScale
virtual float GetBackingPixelScale() const
Definition: IGraphics.h:1778
IGraphics::DoMeasureTextRotation
void DoMeasureTextRotation(const IText &text, const IRECT &bounds, IRECT &rect) const
Definition: IGraphics.cpp:2227
-
IGraphics::WindowWidth
int WindowWidth() const
Gets the width of the graphics context including draw scaling.
Definition: IGraphics.h:1083
+
IGraphics::WindowWidth
int WindowWidth() const
Gets the width of the graphics context including draw scaling.
Definition: IGraphics.h:1089
IGraphics::SearchImageResource
EResourceLocation SearchImageResource(const char *fileName, const char *type, WDL_String &result, int targetScale, int &sourceScale)
Search for a bitmap image resource matching the target scale.
Definition: IGraphics.cpp:1876
IGraphics::PathTransformRestore
void PathTransformRestore()
Restore the affine transform of the current path, to the previously saved state.
Definition: IGraphics.cpp:2708
IGraphics::PushLayer
void PushLayer(ILayer *pLayer)
Push a layer on to the stack.
Definition: IGraphics.cpp:2005
-
IGraphics::GetRoundedScreenScale
int GetRoundedScreenScale() const
Gets the screen/display scaling factor, rounded up.
Definition: IGraphics.h:1103
+
IGraphics::GetRoundedScreenScale
int GetRoundedScreenScale() const
Gets the screen/display scaling factor, rounded up.
Definition: IGraphics.h:1109
IGraphics::RemoveAllControls
void RemoveAllControls()
Removes all regular IControls from the control list, as well as special controls (frees memory).
Definition: IGraphics.cpp:194
-
IGraphics::GetWinModuleHandle
virtual void * GetWinModuleHandle()
Definition: IGraphics.h:920
-
IGraphics::GetScreenScale
float GetScreenScale() const
Gets the screen/display scaling factor, e.g.
Definition: IGraphics.h:1099
+
IGraphics::GetWinModuleHandle
virtual void * GetWinModuleHandle()
Definition: IGraphics.h:926
+
IGraphics::GetScreenScale
float GetScreenScale() const
Gets the screen/display scaling factor, e.g.
Definition: IGraphics.h:1105
IGraphics::PathTransformSave
void PathTransformSave()
Save the current affine transform of the current path.
Definition: IGraphics.cpp:2703
-
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1095
-
IGraphics::WindowHeight
int WindowHeight() const
Gets the height of the graphics context including draw scaling.
Definition: IGraphics.h:1087
+
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1101
+
IGraphics::WindowHeight
int WindowHeight() const
Gets the height of the graphics context including draw scaling.
Definition: IGraphics.h:1093
IGraphics::BeginFrame
virtual void BeginFrame()
Called at the beginning of drawing.
Definition: IGraphics.cpp:867
IGraphicsNanoVG::Bitmap
Definition: IGraphicsNanoVG.cpp:76
IGraphicsNanoVG
IGraphics draw class using NanoVG
Definition: IGraphicsNanoVG.h:82
diff --git a/_i_graphics_skia_8cpp_source.html b/_i_graphics_skia_8cpp_source.html index 17837dc7..ae935a3d 100644 --- a/_i_graphics_skia_8cpp_source.html +++ b/_i_graphics_skia_8cpp_source.html @@ -1066,23 +1066,23 @@
IGraphics::DrawRect
virtual void DrawRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0, float thickness=1.f)
Draw a rectangle to the graphics context.
Definition: IGraphics.cpp:2497
IGraphics::FillEllipse
virtual void FillEllipse(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill an ellipse within a rectangular region of the graphics context.
Definition: IGraphics.cpp:2613
IGraphics::DrawEllipse
virtual void DrawEllipse(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0, float thickness=1.f)
Draw an ellipse within a rectangular region of the graphics context.
Definition: IGraphics.cpp:2548
-
IGraphics::GetTotalScale
float GetTotalScale() const
Gets the combined draw and screen/display scaling factor.
Definition: IGraphics.h:1107
+
IGraphics::GetTotalScale
float GetTotalScale() const
Gets the combined draw and screen/display scaling factor.
Definition: IGraphics.h:1113
IGraphics::GetWindow
virtual void * GetWindow()=0
Get a pointer to the platform view e.g.
IGraphics::DrawRoundRect
virtual void DrawRoundRect(const IColor &color, const IRECT &bounds, float cornerRadius=5.f, const IBlend *pBlend=0, float thickness=1.f)
Draw a rounded rectangle to the graphics context.
Definition: IGraphics.cpp:2504
IGraphics::DoMeasureTextRotation
void DoMeasureTextRotation(const IText &text, const IRECT &bounds, IRECT &rect) const
Definition: IGraphics.cpp:2227
-
IGraphics::WindowWidth
int WindowWidth() const
Gets the width of the graphics context including draw scaling.
Definition: IGraphics.h:1083
+
IGraphics::WindowWidth
int WindowWidth() const
Gets the width of the graphics context including draw scaling.
Definition: IGraphics.h:1089
IGraphics::PathTransformRestore
void PathTransformRestore()
Restore the affine transform of the current path, to the previously saved state.
Definition: IGraphics.cpp:2708
IGraphics::FillRect
virtual void FillRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill a rectangular region of the graphics context with a color.
Definition: IGraphics.cpp:2569
-
IGraphics::GetPlatformContext
void * GetPlatformContext()
Get the platform level draw context - an HDC or CGContextRef.
Definition: IGraphics.h:929
+
IGraphics::GetPlatformContext
void * GetPlatformContext()
Get the platform level draw context - an HDC or CGContextRef.
Definition: IGraphics.h:935
IGraphics::DrawArc
virtual void DrawArc(const IColor &color, float cx, float cy, float r, float a1, float a2, const IBlend *pBlend=0, float thickness=1.f)
Draw an arc to the graphics context.
Definition: IGraphics.cpp:2525
IGraphics::RemoveAllControls
void RemoveAllControls()
Removes all regular IControls from the control list, as well as special controls (frees memory).
Definition: IGraphics.cpp:194
IGraphics::DrawCircle
virtual void DrawCircle(const IColor &color, float cx, float cy, float r, const IBlend *pBlend=0, float thickness=1.f)
Draw a circle to the graphics context.
Definition: IGraphics.cpp:2532
IGraphics::FillRoundRect
virtual void FillRoundRect(const IColor &color, const IRECT &bounds, float cornerRadius=5.f, const IBlend *pBlend=0)
Fill a rounded rectangle with a color.
Definition: IGraphics.cpp:2576
-
IGraphics::GetWinModuleHandle
virtual void * GetWinModuleHandle()
Definition: IGraphics.h:920
-
IGraphics::GetScreenScale
float GetScreenScale() const
Gets the screen/display scaling factor, e.g.
Definition: IGraphics.h:1099
+
IGraphics::GetWinModuleHandle
virtual void * GetWinModuleHandle()
Definition: IGraphics.h:926
+
IGraphics::GetScreenScale
float GetScreenScale() const
Gets the screen/display scaling factor, e.g.
Definition: IGraphics.h:1105
IGraphics::PathTransformSave
void PathTransformSave()
Save the current affine transform of the current path.
Definition: IGraphics.cpp:2703
IGraphics::FillArc
virtual void FillArc(const IColor &color, float cx, float cy, float r, float a1, float a2, const IBlend *pBlend=0)
Fill an arc segment with a color.
Definition: IGraphics.cpp:2597
-
IGraphics::WindowHeight
int WindowHeight() const
Gets the height of the graphics context including draw scaling.
Definition: IGraphics.h:1087
+
IGraphics::WindowHeight
int WindowHeight() const
Gets the height of the graphics context including draw scaling.
Definition: IGraphics.h:1093
IGraphics::BeginFrame
virtual void BeginFrame()
Called at the beginning of drawing.
Definition: IGraphics.cpp:867
IGraphics::FillCircle
virtual void FillCircle(const IColor &color, float cx, float cy, float r, const IBlend *pBlend=0)
Fill a circle with a color.
Definition: IGraphics.cpp:2606
IGraphicsSkia::Bitmap
Definition: IGraphicsSkia.cpp:54
diff --git a/_i_graphics_web_8cpp_source.html b/_i_graphics_web_8cpp_source.html index 69758920..742ac8ff 100644 --- a/_i_graphics_web_8cpp_source.html +++ b/_i_graphics_web_8cpp_source.html @@ -1021,7 +1021,7 @@
IGraphics::OnTouchCancelled
void OnTouchCancelled(const std::vector< IMouseInfo > &points)
Called when the platform class sends touch cancel events.
Definition: IGraphics.cpp:1098
IGraphics::OnMouseDown
void OnMouseDown(const std::vector< IMouseInfo > &points)
Called when the platform class sends mouse down events.
Definition: IGraphics.cpp:971
IGraphics::OnMouseWheel
void OnMouseWheel(float x, float y, const IMouseMod &mod, float delta)
Definition: IGraphics.cpp:1223
-
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1095
+
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1101
IGraphicsWeb::FileFont
Definition: IGraphicsWeb.cpp:56
IGraphicsWeb::MemoryFont
Definition: IGraphicsWeb.cpp:96
IGraphicsWeb
IGraphics platform class for the web.
Definition: IGraphicsWeb.h:44
diff --git a/_i_graphics_win_8cpp_source.html b/_i_graphics_win_8cpp_source.html index a044214b..a6af13f3 100644 --- a/_i_graphics_win_8cpp_source.html +++ b/_i_graphics_win_8cpp_source.html @@ -103,2306 +103,2333 @@
16
17#include "IPlugParameter.h"
18#include "IGraphicsWin.h"
-
19#include "IPopupMenuControl.h"
-
20#include "IPlugPaths.h"
-
21
-
22#include <wininet.h>
-
23#include <VersionHelpers.h>
-
24
-
25#if defined __clang__
-
26#undef CCSIZEOF_STRUCT
-
27#define CCSIZEOF_STRUCT(structname, member) (__builtin_offsetof(structname, member) + sizeof(((structname*)0)->member))
-
28#endif
-
29
-
30using namespace iplug;
-
31using namespace igraphics;
-
32
-
33#pragma warning(disable:4244) // Pointer size cast mismatch.
-
34#pragma warning(disable:4312) // Pointer size cast mismatch.
-
35#pragma warning(disable:4311) // Pointer size cast mismatch.
-
36
-
37static int nWndClassReg = 0;
-
38static wchar_t* wndClassName = L"IPlugWndClass";
-
39static double sFPS = 0.0;
-
40
-
41#define PARAM_EDIT_ID 99
-
42#define IPLUG_TIMER_ID 2
-
43
-
44#define TOOLTIPWND_MAXWIDTH 250
-
45
-
46#define WM_VBLANK (WM_USER+1)
-
47
-
48#ifdef IGRAPHICS_GL3
-
49typedef HGLRC(WINAPI* PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList);
-
50#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
-
51#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
-
52#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
-
53#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
-
54#endif
-
55
-
56#pragma mark - Private Classes and Structs
-
57
-
58// Fonts
-
59
-
60class IGraphicsWin::InstalledFont
-
61{
-
62public:
-
63 InstalledFont(void* data, int resSize)
-
64 : mFontHandle(nullptr)
-
65 {
-
66 if (data)
-
67 {
-
68 DWORD numFonts = 0;
-
69 mFontHandle = AddFontMemResourceEx(data, resSize, NULL, &numFonts);
-
70 }
-
71 }
-
72
-
73 ~InstalledFont()
-
74 {
-
75 if (IsValid())
-
76 RemoveFontMemResourceEx(mFontHandle);
-
77 }
-
78
-
79 InstalledFont(const InstalledFont&) = delete;
-
80 InstalledFont& operator=(const InstalledFont&) = delete;
-
81
-
82 bool IsValid() const { return mFontHandle; }
-
83
-
84private:
-
85 HANDLE mFontHandle;
-
86};
-
87
-
88struct IGraphicsWin::HFontHolder
-
89{
-
90 HFontHolder(HFONT hfont) : mHFont(nullptr)
-
91 {
-
92 LOGFONTW lFont = { 0 };
-
93 GetObjectW(hfont, sizeof(LOGFONTW), &lFont);
-
94 mHFont = CreateFontIndirectW(&lFont);
-
95 }
-
96
-
97 HFONT mHFont;
-
98};
-
99
-
100class IGraphicsWin::Font : public PlatformFont
-
101{
-
102public:
-
103 Font(HFONT font, const char* styleName, bool system)
-
104 : PlatformFont(system), mFont(font), mStyleName(styleName) {}
-
105 ~Font()
-
106 {
-
107 DeleteObject(mFont);
-
108 }
-
109
-
110 FontDescriptor GetDescriptor() override { return mFont; }
-
111 IFontDataPtr GetFontData() override;
-
112
-
113private:
-
114 HFONT mFont;
-
115 WDL_String mStyleName;
-
116};
-
117
-
118IFontDataPtr IGraphicsWin::Font::GetFontData()
-
119{
-
120 HDC hdc = CreateCompatibleDC(NULL);
-
121 IFontDataPtr fontData(new IFontData());
-
122
-
123 if (hdc != NULL)
-
124 {
-
125 SelectObject(hdc, mFont);
-
126 const size_t size = ::GetFontData(hdc, 0, 0, NULL, 0);
-
127
-
128 if (size != GDI_ERROR)
-
129 {
-
130 fontData = std::make_unique<IFontData>(size);
-
131
-
132 if (fontData->GetSize() == size)
-
133 {
-
134 size_t result = ::GetFontData(hdc, 0x66637474, 0, fontData->Get(), size);
-
135 if (result == GDI_ERROR)
-
136 result = ::GetFontData(hdc, 0, 0, fontData->Get(), size);
-
137 if (result == size)
-
138 fontData->SetFaceIdx(GetFaceIdx(fontData->Get(), fontData->GetSize(), mStyleName.Get()));
-
139 }
-
140 }
-
141
-
142 DeleteDC(hdc);
-
143 }
-
144
-
145 return fontData;
-
146}
-
147
-
148StaticStorage<IGraphicsWin::InstalledFont> IGraphicsWin::sPlatformFontCache;
-
149StaticStorage<IGraphicsWin::HFontHolder> IGraphicsWin::sHFontCache;
-
150
-
151#pragma mark - Mouse and tablet helpers
-
152
-
153extern float GetScaleForHWND(HWND hWnd);
-
154
-
155inline IMouseInfo IGraphicsWin::GetMouseInfo(LPARAM lParam, WPARAM wParam)
-
156{
-
157 IMouseInfo info;
-
158 const float scale = GetTotalScale();
-
159 info.x = mCursorX = GET_X_LPARAM(lParam) / scale;
-
160 info.y = mCursorY = GET_Y_LPARAM(lParam) / scale;
-
161 info.ms = IMouseMod((wParam & MK_LBUTTON), (wParam & MK_RBUTTON), (wParam & MK_SHIFT), (wParam & MK_CONTROL),
-
162#ifdef AAX_API
-
163 GetAsyncKeyState(VK_MENU) < 0
-
164#else
-
165 GetKeyState(VK_MENU) < 0
-
166#endif
-
167 );
-
168
-
169 return info;
-
170}
-
171
-
172void IGraphicsWin::CheckTabletInput(UINT msg)
-
173{
-
174 if ((msg == WM_LBUTTONDOWN) || (msg == WM_RBUTTONDOWN) || (msg == WM_MBUTTONDOWN) || (msg == WM_MOUSEMOVE)
-
175 || (msg == WM_RBUTTONDBLCLK) || (msg == WM_LBUTTONDBLCLK) || (msg == WM_MBUTTONDBLCLK)
-
176 || (msg == WM_RBUTTONUP) || (msg == WM_LBUTTONUP) || (msg == WM_MBUTTONUP)
-
177 || (msg == WM_MOUSEHOVER) || (msg == WM_MOUSELEAVE))
-
178 {
-
179 const LONG_PTR c_SIGNATURE_MASK = 0xFFFFFF00;
-
180 const LONG_PTR c_MOUSEEVENTF_FROMTOUCH = 0xFF515700;
-
181
-
182 LONG_PTR extraInfo = GetMessageExtraInfo();
-
183 SetTabletInput(((extraInfo & c_SIGNATURE_MASK) == c_MOUSEEVENTF_FROMTOUCH));
-
184 mCursorLock &= !mTabletInput;
-
185 }
-
186}
-
187
-
188void IGraphicsWin::DestroyEditWindow()
-
189{
-
190 if (mParamEditWnd)
-
191 {
-
192 SetWindowLongPtrW(mParamEditWnd, GWLP_WNDPROC, (LPARAM) mDefEditProc);
-
193 DestroyWindow(mParamEditWnd);
-
194 mParamEditWnd = nullptr;
-
195 mDefEditProc = nullptr;
-
196 DeleteObject(mEditFont);
-
197 mEditFont = nullptr;
-
198 }
-
199}
-
200
-
201void IGraphicsWin::OnDisplayTimer(int vBlankCount)
-
202{
-
203 // Check the message vblank with the current one to see if we are way behind. If so, then throw these away.
-
204 DWORD msgCount = vBlankCount;
-
205 DWORD curCount = mVBlankCount;
-
206
-
207 if (mVSYNCEnabled)
-
208 {
-
209 // skip until the actual vblank is at a certain number.
-
210 if (mVBlankSkipUntil != 0 && mVBlankSkipUntil > mVBlankCount)
-
211 {
-
212 return;
-
213 }
-
214
-
215 mVBlankSkipUntil = 0;
-
216
-
217 if (msgCount != curCount)
-
218 {
-
219 // we are late, just skip it until we can get a message soon after the vblank event.
-
220 // DBGMSG("vblank is late by %i frames. Skipping.", (mVBlankCount - msgCount));
-
221 return;
-
222 }
-
223 }
-
224
-
225 if (mParamEditWnd && mParamEditMsg != kNone)
-
226 {
-
227 switch (mParamEditMsg)
-
228 {
-
229 case kCommit:
-
230 {
-
231 WCHAR strWide[MAX_WIN32_PARAM_LEN];
-
232 SendMessageW(mParamEditWnd, WM_GETTEXT, MAX_WIN32_PARAM_LEN, (LPARAM) strWide);
-
233 SetControlValueAfterTextEdit(UTF16AsUTF8(strWide).Get());
-
234 DestroyEditWindow();
-
235 break;
-
236 }
-
237 case kCancel:
-
238 DestroyEditWindow();
-
239 ClearInTextEntryControl();
-
240 break;
-
241 }
-
242
-
243 mParamEditMsg = kNone;
-
244
-
245 return; // TODO: check this!
-
246 }
-
247
-
248 // TODO: move this... listen to the right messages in windows for screen resolution changes, etc.
-
249 if (!GetCapture()) // workaround Windows issues with window sizing during mouse move
-
250 {
-
251 float scale = GetScaleForHWND(mPlugWnd);
-
252 if (scale != GetScreenScale())
-
253 SetScreenScale(scale);
-
254 }
-
255
-
256 // TODO: this is far too aggressive for slow drawing animations and data changing. We need to
-
257 // gate the rate of updates to a certain percentage of the wall clock time.
-
258 IRECTList rects;
-
259 const float totalScale = GetTotalScale();
-
260 if (IsDirty(rects))
-
261 {
-
262 SetAllControlsClean();
-
263
-
264 for (int i = 0; i < rects.Size(); i++)
-
265 {
-
266 IRECT dirtyR = rects.Get(i);
-
267 dirtyR.Scale(totalScale);
-
268 dirtyR.PixelAlign();
-
269 RECT r = { (LONG)dirtyR.L, (LONG)dirtyR.T, (LONG)dirtyR.R, (LONG)dirtyR.B };
-
270 InvalidateRect(mPlugWnd, &r, FALSE);
-
271 }
-
272
-
273 if (mParamEditWnd)
-
274 {
-
275 IRECT notDirtyR = mEditRECT;
-
276 notDirtyR.Scale(totalScale);
-
277 notDirtyR.PixelAlign();
-
278 RECT r2 = { (LONG)notDirtyR.L, (LONG)notDirtyR.T, (LONG)notDirtyR.R, (LONG)notDirtyR.B };
-
279 ValidateRect(mPlugWnd, &r2); // make sure we dont redraw the edit box area
-
280 UpdateWindow(mPlugWnd);
-
281 mParamEditMsg = kUpdate;
-
282 }
-
283 else
-
284 {
-
285 // Force a redraw right now
-
286 UpdateWindow(mPlugWnd);
-
287
-
288 if (mVSYNCEnabled)
-
289 {
-
290 // Check and see if we are still in this frame.
-
291 curCount = mVBlankCount;
-
292 if (msgCount != curCount)
-
293 {
-
294 // we are late, skip the next vblank to give us a breather.
-
295 mVBlankSkipUntil = curCount+1;
-
296 //DBGMSG("vblank painting was late by %i frames.", (mVBlankSkipUntil - msgCount));
-
297 }
-
298 }
-
299 }
-
300 }
-
301 return;
-
302}
-
303
-
304// static
-
305LRESULT CALLBACK IGraphicsWin::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
-
306{
-
307 if (msg == WM_CREATE)
-
308 {
-
309 CREATESTRUCTW* lpcs = (CREATESTRUCTW *) lParam;
-
310 SetWindowLongPtrW(hWnd, GWLP_USERDATA, (LPARAM) lpcs->lpCreateParams);
-
311 IGraphicsWin* pGraphics = (IGraphicsWin*) GetWindowLongPtrW(hWnd, GWLP_USERDATA);
-
312
-
313 if (pGraphics->mVSYNCEnabled) // use VBLANK thread
-
314 {
-
315 assert((pGraphics->FPS() == 60) && "If you want to run at frame rates other than 60FPS");
-
316 pGraphics->StartVBlankThread(hWnd);
-
317 }
-
318 else // use WM_TIMER -- its best to get below 16ms because the windows time quanta is slightly above 15ms.
-
319 {
-
320 int mSec = static_cast<int>(std::floorf(1000.0f / (pGraphics->FPS())));
-
321 if (mSec < 20) mSec = 15;
-
322 SetTimer(hWnd, IPLUG_TIMER_ID, mSec, NULL);
-
323 }
-
324
-
325 SetFocus(hWnd); // gets scroll wheel working straight away
-
326 DragAcceptFiles(hWnd, true);
-
327 return 0;
-
328 }
-
329
-
330 IGraphicsWin* pGraphics = (IGraphicsWin*) GetWindowLongPtrW(hWnd, GWLP_USERDATA);
-
331
-
332 if (!pGraphics || hWnd != pGraphics->mPlugWnd)
-
333 {
-
334 return DefWindowProcW(hWnd, msg, wParam, lParam);
-
335 }
-
336
-
337 if (pGraphics->mParamEditWnd && pGraphics->mParamEditMsg == kEditing)
-
338 {
-
339 if (msg == WM_RBUTTONDOWN || (msg == WM_LBUTTONDOWN))
-
340 {
-
341 pGraphics->mParamEditMsg = kCancel;
-
342 return 0;
-
343 }
-
344 return DefWindowProcW(hWnd, msg, wParam, lParam);
-
345 }
-
346
-
347 auto IsTouchEvent = []() {
-
348 const LONG_PTR c_SIGNATURE_MASK = 0xFFFFFF00;
-
349 const LONG_PTR c_MOUSEEVENTF_FROMTOUCH = 0xFF515700;
-
350 LONG_PTR extraInfo = GetMessageExtraInfo();
-
351 return ((extraInfo & c_SIGNATURE_MASK) == c_MOUSEEVENTF_FROMTOUCH);
-
352 };
-
353
-
354 pGraphics->CheckTabletInput(msg);
-
355
-
356 switch (msg)
-
357 {
-
358 case WM_VBLANK:
-
359 pGraphics->OnDisplayTimer(wParam);
-
360 return 0;
-
361
-
362 case WM_TIMER:
-
363 if (wParam == IPLUG_TIMER_ID)
-
364 pGraphics->OnDisplayTimer(0);
-
365
-
366 return 0;
-
367
-
368 case WM_ERASEBKGND:
-
369 return 0;
-
370
-
371 case WM_RBUTTONDOWN:
-
372 case WM_LBUTTONDOWN:
-
373 case WM_MBUTTONDOWN:
-
374 {
-
375 if (IsTouchEvent())
-
376 return 0;
-
377
-
378 pGraphics->HideTooltip();
-
379 if (pGraphics->mParamEditWnd)
-
380 {
-
381 pGraphics->mParamEditMsg = kCommit;
-
382 return 0;
-
383 }
-
384 SetFocus(hWnd); // Added to get keyboard focus again when user clicks in window
-
385 SetCapture(hWnd);
-
386 IMouseInfo info = pGraphics->GetMouseInfo(lParam, wParam);
-
387 std::vector<IMouseInfo> list{ info };
-
388 pGraphics->OnMouseDown(list);
-
389 return 0;
-
390 }
-
391 case WM_SETCURSOR:
-
392 {
-
393 pGraphics->OnSetCursor();
-
394 return 0;
-
395 }
-
396 case WM_MOUSEMOVE:
-
397 {
-
398 if (IsTouchEvent())
-
399 return 0;
-
400
-
401 if (!(wParam & (MK_LBUTTON | MK_RBUTTON)))
-
402 {
-
403 IMouseInfo info = pGraphics->GetMouseInfo(lParam, wParam);
-
404 if (pGraphics->OnMouseOver(info.x, info.y, info.ms))
-
405 {
-
406 TRACKMOUSEEVENT eventTrack = { sizeof(TRACKMOUSEEVENT), TME_LEAVE, hWnd, HOVER_DEFAULT };
-
407 if (pGraphics->TooltipsEnabled())
-
408 {
-
409 int c = pGraphics->GetMouseOver();
-
410 if (c != pGraphics->mTooltipIdx)
-
411 {
-
412 if (c >= 0) eventTrack.dwFlags |= TME_HOVER;
-
413 pGraphics->mTooltipIdx = c;
-
414 pGraphics->HideTooltip();
-
415 }
-
416 }
-
417
-
418 TrackMouseEvent(&eventTrack);
-
419 }
-
420 }
-
421 else if (GetCapture() == hWnd && !pGraphics->IsInPlatformTextEntry())
-
422 {
-
423 float oldX = pGraphics->mCursorX;
-
424 float oldY = pGraphics->mCursorY;
-
425
-
426 IMouseInfo info = pGraphics->GetMouseInfo(lParam, wParam);
-
427
-
428 info.dX = info.x - oldX;
-
429 info.dY = info.y - oldY;
-
430
-
431 if (info.dX || info.dY)
-
432 {
-
433 std::vector<IMouseInfo> list{ info };
-
434 pGraphics->OnMouseDrag(list);
-
435
-
436 if (pGraphics->MouseCursorIsLocked())
-
437 {
-
438 const float x = pGraphics->mHiddenCursorX;
-
439 const float y = pGraphics->mHiddenCursorY;
-
440
-
441 pGraphics->MoveMouseCursor(x, y);
-
442 pGraphics->mHiddenCursorX = x;
-
443 pGraphics->mHiddenCursorY = y;
-
444 }
-
445 }
-
446 }
-
447
-
448 return 0;
-
449 }
-
450 case WM_MOUSEHOVER:
-
451 {
-
452 pGraphics->ShowTooltip();
-
453 return 0;
-
454 }
-
455 case WM_MOUSELEAVE:
-
456 {
-
457 pGraphics->HideTooltip();
-
458 pGraphics->OnMouseOut();
-
459 return 0;
-
460 }
-
461 case WM_LBUTTONUP:
-
462 case WM_RBUTTONUP:
-
463 {
-
464 ReleaseCapture();
-
465 IMouseInfo info = pGraphics->GetMouseInfo(lParam, wParam);
-
466 std::vector<IMouseInfo> list{ info };
-
467 pGraphics->OnMouseUp(list);
-
468 return 0;
-
469 }
-
470 case WM_LBUTTONDBLCLK:
-
471 case WM_RBUTTONDBLCLK:
-
472 {
-
473 if (IsTouchEvent())
-
474 return 0;
-
475
-
476 IMouseInfo info = pGraphics->GetMouseInfo(lParam, wParam);
-
477 if (pGraphics->OnMouseDblClick(info.x, info.y, info.ms))
-
478 {
-
479 SetCapture(hWnd);
-
480 }
-
481 return 0;
-
482 }
-
483 case WM_MOUSEWHEEL:
-
484 {
-
485 if (pGraphics->mParamEditWnd)
-
486 {
-
487 pGraphics->mParamEditMsg = kCancel;
-
488 return 0;
-
489 }
-
490 else
-
491 {
-
492 IMouseInfo info = pGraphics->GetMouseInfo(lParam, wParam);
-
493 float d = GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA;
-
494 const float scale = pGraphics->GetTotalScale();
-
495 RECT r;
-
496 GetWindowRect(hWnd, &r);
-
497 pGraphics->OnMouseWheel(info.x - (r.left / scale), info.y - (r.top / scale), info.ms, d);
-
498 return 0;
-
499 }
-
500 }
-
501 case WM_TOUCH:
-
502 {
-
503 UINT nTouches = LOWORD(wParam);
-
504
-
505 if (nTouches > 0)
-
506 {
-
507 WDL_TypedBuf<TOUCHINPUT> touches;
-
508 touches.Resize(nTouches);
-
509 HTOUCHINPUT hTouchInput = (HTOUCHINPUT) lParam;
-
510 std::vector<IMouseInfo> downlist;
-
511 std::vector<IMouseInfo> uplist;
-
512 std::vector<IMouseInfo> movelist;
-
513 const float scale = pGraphics->GetTotalScale();
-
514
-
515 GetTouchInputInfo(hTouchInput, nTouches, touches.Get(), sizeof(TOUCHINPUT));
-
516
-
517 for (int i = 0; i < nTouches; i++)
-
518 {
-
519 TOUCHINPUT* pTI = touches.Get() +i;
-
520
-
521 POINT pt;
-
522 pt.x = TOUCH_COORD_TO_PIXEL(pTI->x);
-
523 pt.y = TOUCH_COORD_TO_PIXEL(pTI->y);
-
524 ScreenToClient(pGraphics->mPlugWnd, &pt);
-
525
-
526 IMouseInfo info;
-
527 info.x = static_cast<float>(pt.x) / scale;
-
528 info.y = static_cast<float>(pt.y) / scale;
-
529 info.dX = 0.f;
-
530 info.dY = 0.f;
-
531 info.ms.touchRadius = 0;
-
532
-
533 if (pTI->dwMask & TOUCHINPUTMASKF_CONTACTAREA)
-
534 {
-
535 info.ms.touchRadius = pTI->cxContact;
-
536 }
-
537
-
538 info.ms.touchID = static_cast<ITouchID>(pTI->dwID);
-
539
-
540 if (pTI->dwFlags & TOUCHEVENTF_DOWN)
-
541 {
-
542 downlist.push_back(info);
-
543 pGraphics->mDeltaCapture.insert(std::make_pair(info.ms.touchID, info));
-
544 }
-
545 else if (pTI->dwFlags & TOUCHEVENTF_UP)
-
546 {
-
547 pGraphics->mDeltaCapture.erase(info.ms.touchID);
-
548 uplist.push_back(info);
-
549 }
-
550 else if (pTI->dwFlags & TOUCHEVENTF_MOVE)
-
551 {
-
552 IMouseInfo previous = pGraphics->mDeltaCapture.find(info.ms.touchID)->second;
-
553 info.dX = info.x - previous.x;
-
554 info.dY = info.y - previous.y;
-
555 movelist.push_back(info);
-
556 pGraphics->mDeltaCapture[info.ms.touchID] = info;
-
557 }
-
558 }
-
559
-
560 if (downlist.size())
-
561 pGraphics->OnMouseDown(downlist);
-
562
-
563 if (uplist.size())
-
564 pGraphics->OnMouseUp(uplist);
-
565
-
566 if (movelist.size())
-
567 pGraphics->OnMouseDrag(movelist);
-
568
-
569 CloseTouchInputHandle(hTouchInput);
-
570 }
-
571 return 0;
-
572 }
-
573 case WM_GETDLGCODE:
-
574 return DLGC_WANTALLKEYS;
-
575 case WM_KEYDOWN:
-
576 case WM_KEYUP:
-
577 {
-
578 POINT p;
-
579 GetCursorPos(&p);
-
580 ScreenToClient(hWnd, &p);
-
581
-
582 BYTE keyboardState[256] = {};
-
583 GetKeyboardState(keyboardState);
-
584 const int keyboardScanCode = (lParam >> 16) & 0x00ff;
-
585 WORD character = 0;
-
586 const int len = ToAscii(wParam, keyboardScanCode, keyboardState, &character, 0);
-
587 // TODO: should get unicode?
-
588 bool handle = false;
-
589
-
590 // send when len is 0 because wParam might be something like VK_LEFT or VK_HOME, etc.
-
591 if (len == 0 || len == 1)
-
592 {
-
593 char str[2];
-
594 str[0] = static_cast<char>(character);
-
595 str[1] = '\0';
-
596
-
597 IKeyPress keyPress{ str, static_cast<int>(wParam),
-
598 static_cast<bool>(GetKeyState(VK_SHIFT) & 0x8000),
-
599 static_cast<bool>(GetKeyState(VK_CONTROL) & 0x8000),
-
600 static_cast<bool>(GetKeyState(VK_MENU) & 0x8000) };
-
601
-
602 const float scale = pGraphics->GetTotalScale();
-
603
-
604 if (msg == WM_KEYDOWN)
-
605 handle = pGraphics->OnKeyDown(p.x / scale, p.y / scale, keyPress);
-
606 else
-
607 handle = pGraphics->OnKeyUp(p.x / scale, p.y / scale, keyPress);
-
608 }
-
609
-
610 if (!handle)
-
611 {
-
612 HWND rootHWnd = GetAncestor( hWnd, GA_ROOT);
-
613 SendMessageW(rootHWnd, msg, wParam, lParam);
-
614 return DefWindowProcW(hWnd, msg, wParam, lParam);
-
615 }
-
616 else
-
617 return 0;
-
618 }
-
619 case WM_PAINT:
-
620 {
-
621 const float scale = pGraphics->GetTotalScale();
-
622 auto addDrawRect = [pGraphics, scale](IRECTList& rects, RECT r) {
-
623 IRECT ir(r.left, r.top, r.right, r.bottom);
-
624 ir.Scale(1.f/scale);
-
625 ir.PixelAlign();
-
626 rects.Add(ir);
-
627 };
-
628
-
629 HRGN region = CreateRectRgn(0, 0, 0, 0);
-
630 int regionType = GetUpdateRgn(hWnd, region, FALSE);
-
631
-
632 if ((regionType == COMPLEXREGION) || (regionType == SIMPLEREGION))
-
633 {
-
634 IRECTList rects;
-
635 const int bufferSize = sizeof(RECT) * 64;
-
636 unsigned char stackBuffer[sizeof(RGNDATA) + bufferSize];
-
637 RGNDATA* regionData = (RGNDATA*)stackBuffer;
-
638
-
639 if (regionType == COMPLEXREGION && GetRegionData(region, bufferSize, regionData))
-
640 {
-
641 for (int i = 0; i < regionData->rdh.nCount; i++)
-
642 addDrawRect(rects, *(((RECT*)regionData->Buffer) + i));
-
643 }
-
644 else
-
645 {
-
646 RECT r;
-
647 GetRgnBox(region, &r);
-
648 addDrawRect(rects, r);
-
649 }
-
650
-
651#if defined IGRAPHICS_GL //|| IGRAPHICS_D2D
-
652 PAINTSTRUCT ps;
-
653 BeginPaint(hWnd, &ps);
-
654#endif
-
655
-
656#ifdef IGRAPHICS_GL
-
657 pGraphics->ActivateGLContext();
-
658#endif
-
659
-
660 pGraphics->Draw(rects);
-
661
-
662 #ifdef IGRAPHICS_GL
-
663 SwapBuffers((HDC) pGraphics->GetPlatformContext());
-
664 pGraphics->DeactivateGLContext();
-
665 #endif
-
666
-
667#if defined IGRAPHICS_GL || IGRAPHICS_D2D
-
668 EndPaint(hWnd, &ps);
-
669#endif
-
670 }
-
671
-
672 // For the D2D if we don't call endpaint, then you really need to call ValidateRect otherwise
-
673 // we are just going to get another WM_PAINT to handle. Bad! It also exibits the odd property
-
674 // that windows will be popped under the window.
-
675 ValidateRect(hWnd, 0);
-
676
-
677 DeleteObject(region);
-
678
-
679 return 0;
-
680 }
-
681
-
682 case WM_CTLCOLOREDIT:
-
683 {
-
684 if (!pGraphics->mParamEditWnd)
-
685 return 0;
-
686
-
687 const IText& text = pGraphics->mEditText;
-
688 HDC dc = (HDC) wParam;
-
689 SetBkColor(dc, RGB(text.mTextEntryBGColor.R, text.mTextEntryBGColor.G, text.mTextEntryBGColor.B));
-
690 SetTextColor(dc, RGB(text.mTextEntryFGColor.R, text.mTextEntryFGColor.G, text.mTextEntryFGColor.B));
-
691 SetBkMode(dc, OPAQUE);
-
692 SetDCBrushColor(dc, RGB(text.mTextEntryBGColor.R, text.mTextEntryBGColor.G, text.mTextEntryBGColor.B));
-
693 return (LRESULT)GetStockObject(DC_BRUSH);
-
694 }
-
695 case WM_DROPFILES:
-
696 {
-
697 HDROP hdrop = (HDROP) wParam;
-
698
-
699 int numDroppedFiles = DragQueryFileW(hdrop, -1, nullptr, 0);
-
700
-
701 std::vector<std::vector<char>> pathBuffers(numDroppedFiles, std::vector<char>(1025, 0));
-
702 std::vector<const char*> pathPtrs(numDroppedFiles);
-
703
-
704 for (int i = 0; i < numDroppedFiles; i++)
-
705 {
-
706 wchar_t pathBufferW[1025] = {'\0'};
-
707 DragQueryFileW(hdrop, i, pathBufferW, 1024);
-
708 strncpy(pathBuffers[i].data(), UTF16AsUTF8(pathBufferW).Get(), 1024);
-
709 pathPtrs[i] = pathBuffers[i].data();
-
710 }
-
711 POINT p;
-
712 DragQueryPoint(hdrop, &p);
-
713
-
714 const float scale = pGraphics->GetTotalScale();
-
715
-
716 if (numDroppedFiles==1)
-
717 {
-
718 pGraphics->OnDrop(&pathPtrs[0][0], p.x / scale, p.y / scale);
-
719 }
-
720 else
-
721 {
-
722 pGraphics->OnDropMultiple(pathPtrs, p.x / scale, p.y / scale);
-
723 }
-
724
-
725 return 0;
-
726 }
-
727 case WM_CLOSE:
-
728 {
-
729 pGraphics->CloseWindow();
-
730 return 0;
-
731 }
-
732 case WM_SETFOCUS:
-
733 {
-
734 return 0;
-
735 }
-
736 case WM_KILLFOCUS:
-
737 {
-
738 return 0;
-
739 }
-
740 }
-
741 return DefWindowProcW(hWnd, msg, wParam, lParam);
-
742}
-
743
-
744// static
-
745LRESULT CALLBACK IGraphicsWin::ParamEditProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
-
746{
-
747 IGraphicsWin* pGraphics = (IGraphicsWin*) GetWindowLongPtrW(GetParent(hWnd), GWLP_USERDATA);
-
748
-
749 if (pGraphics && pGraphics->mParamEditWnd && pGraphics->mParamEditWnd == hWnd)
-
750 {
-
751 pGraphics->HideTooltip();
-
752
-
753 switch (msg)
-
754 {
-
755 case WM_CHAR:
-
756 {
-
757 // limit to numbers for text entry on appropriate parameters
-
758 if (pGraphics->mEditParam)
-
759 {
-
760 char c = wParam;
-
761
-
762 if (c == 0x08) break; // backspace
-
763
-
764 switch (pGraphics->mEditParam->Type())
-
765 {
-
766 case IParam::kTypeEnum:
-
767 case IParam::kTypeInt:
-
768 case IParam::kTypeBool:
-
769 if (c >= '0' && c <= '9') break;
-
770 else if (c == '-') break;
-
771 else if (c == '+') break;
-
772 else return 0;
-
773 case IParam::kTypeDouble:
-
774 if (c >= '0' && c <= '9') break;
-
775 else if (c == '-') break;
-
776 else if (c == '+') break;
-
777 else if (c == '.') break;
-
778 else return 0;
-
779 default:
-
780 break;
-
781 }
-
782 }
-
783 break;
-
784 }
-
785 case WM_KEYDOWN:
-
786 {
-
787 if (wParam == VK_RETURN)
-
788 {
-
789 pGraphics->mParamEditMsg = kCommit;
-
790 return 0;
-
791 }
-
792 else if (wParam == VK_ESCAPE)
-
793 {
-
794 pGraphics->mParamEditMsg = kCancel;
-
795 return 0;
-
796 }
-
797 break;
-
798 }
-
799 case WM_SETFOCUS:
-
800 {
-
801 pGraphics->mParamEditMsg = kEditing;
-
802 break;
-
803 }
-
804 case WM_KILLFOCUS:
-
805 {
-
806 pGraphics->mParamEditMsg = kCommit;
-
807 break;
-
808 }
-
809 // handle WM_GETDLGCODE so that we can say that we want the return key message
-
810 // (normally single line edit boxes don't get sent return key messages)
-
811 case WM_GETDLGCODE:
-
812 {
-
813 LPARAM lres;
-
814 // find out if the original control wants it
-
815 lres = CallWindowProcW(pGraphics->mDefEditProc, hWnd, WM_GETDLGCODE, wParam, lParam);
-
816 // add in that we want it if it is a return keydown
-
817 if (lParam && ((MSG*)lParam)->message == WM_KEYDOWN && wParam == VK_RETURN)
-
818 {
-
819 lres |= DLGC_WANTMESSAGE;
-
820 }
-
821 return lres;
-
822 }
-
823 case WM_COMMAND:
-
824 {
-
825 switch HIWORD(wParam)
-
826 {
-
827 case CBN_SELCHANGE:
-
828 {
-
829 if (pGraphics->mParamEditWnd)
-
830 {
-
831 pGraphics->mParamEditMsg = kCommit;
-
832 return 0;
-
833 }
-
834 }
-
835
-
836 }
-
837 break; // Else let the default proc handle it.
-
838 }
-
839 }
-
840 return CallWindowProcW(pGraphics->mDefEditProc, hWnd, msg, wParam, lParam);
-
841 }
-
842 return DefWindowProcW(hWnd, msg, wParam, lParam);
-
843}
-
844
-
845IGraphicsWin::IGraphicsWin(IGEditorDelegate& dlg, int w, int h, int fps, float scale)
-
846 : IGRAPHICS_DRAW_CLASS(dlg, w, h, fps, scale)
-
847{
-
848 StaticStorage<InstalledFont>::Accessor fontStorage(sPlatformFontCache);
-
849 StaticStorage<HFontHolder>::Accessor hfontStorage(sHFontCache);
-
850 fontStorage.Retain();
-
851 hfontStorage.Retain();
-
852
-
853#ifndef IGRAPHICS_DISABLE_VSYNC
-
854 mVSYNCEnabled = IsWindows8OrGreater();
-
855#endif
-
856}
-
857
-
858IGraphicsWin::~IGraphicsWin()
-
859{
-
860 StaticStorage<InstalledFont>::Accessor fontStorage(sPlatformFontCache);
-
861 StaticStorage<HFontHolder>::Accessor hfontStorage(sHFontCache);
-
862 fontStorage.Release();
-
863 hfontStorage.Release();
-
864 DestroyEditWindow();
-
865 CloseWindow();
-
866}
-
867
-
868static void GetWindowSize(HWND pWnd, int* pW, int* pH)
-
869{
-
870 if (pWnd)
-
871 {
-
872 RECT r;
-
873 GetWindowRect(pWnd, &r);
-
874 *pW = r.right - r.left;
-
875 *pH = r.bottom - r.top;
-
876 }
-
877 else
-
878 {
-
879 *pW = *pH = 0;
-
880 }
-
881}
-
882
-
883static bool IsChildWindow(HWND pWnd)
-
884{
-
885 if (pWnd)
-
886 {
-
887 int style = GetWindowLongW(pWnd, GWL_STYLE);
-
888 int exStyle = GetWindowLongW(pWnd, GWL_EXSTYLE);
-
889 return ((style & WS_CHILD) && !(exStyle & WS_EX_MDICHILD));
-
890 }
-
891 return false;
-
892}
-
893
-
894void IGraphicsWin::ForceEndUserEdit()
-
895{
-
896 mParamEditMsg = kCancel;
-
897}
-
898
-
899static UINT SETPOS_FLAGS = SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE;
-
900
-
901void IGraphicsWin::PlatformResize(bool parentHasResized)
-
902{
-
903 if (WindowIsOpen())
-
904 {
-
905 HWND pParent = 0, pGrandparent = 0;
-
906 int dlgW = 0, dlgH = 0, parentW = 0, parentH = 0, grandparentW = 0, grandparentH = 0;
-
907 GetWindowSize(mPlugWnd, &dlgW, &dlgH);
-
908 int dw = (WindowWidth() * GetScreenScale()) - dlgW, dh = (WindowHeight()* GetScreenScale()) - dlgH;
-
909
-
910 if (IsChildWindow(mPlugWnd))
-
911 {
-
912 pParent = GetParent(mPlugWnd);
-
913 GetWindowSize(pParent, &parentW, &parentH);
-
914
-
915 if (IsChildWindow(pParent))
-
916 {
-
917 pGrandparent = GetParent(pParent);
-
918 GetWindowSize(pGrandparent, &grandparentW, &grandparentH);
-
919 }
-
920 }
-
921
-
922 if (!dw && !dh)
-
923 return;
-
924
-
925 SetWindowPos(mPlugWnd, 0, 0, 0, dlgW + dw, dlgH + dh, SETPOS_FLAGS);
-
926
-
927 if (pParent && !parentHasResized)
-
928 {
-
929 SetWindowPos(pParent, 0, 0, 0, parentW + dw, parentH + dh, SETPOS_FLAGS);
-
930 }
-
931
-
932 if (pGrandparent && !parentHasResized)
-
933 {
-
934 SetWindowPos(pGrandparent, 0, 0, 0, grandparentW + dw, grandparentH + dh, SETPOS_FLAGS);
-
935 }
-
936 }
-
937}
-
938
-
939#ifdef IGRAPHICS_GL
-
940void IGraphicsWin::DrawResize()
-
941{
-
942 ActivateGLContext();
-
943 IGRAPHICS_DRAW_CLASS::DrawResize();
-
944 DeactivateGLContext();
-
945}
-
946#endif
-
947
-
948void IGraphicsWin::HideMouseCursor(bool hide, bool lock)
-
949{
-
950 if (mCursorHidden == hide)
-
951 return;
-
952
-
953 if (hide)
-
954 {
-
955 mHiddenCursorX = mCursorX;
-
956 mHiddenCursorY = mCursorY;
-
957
-
958 ShowCursor(false);
-
959 mCursorHidden = true;
-
960 mCursorLock = lock && !mTabletInput;
-
961 }
-
962 else
-
963 {
-
964 if (mCursorLock)
-
965 MoveMouseCursor(mHiddenCursorX, mHiddenCursorY);
-
966
-
967 ShowCursor(true);
-
968 mCursorHidden = false;
-
969 mCursorLock = false;
-
970 }
-
971}
-
972
-
973void IGraphicsWin::MoveMouseCursor(float x, float y)
-
974{
-
975 if (mTabletInput)
-
976 return;
-
977
-
978 const float scale = GetTotalScale();
-
979
-
980 POINT p;
-
981 p.x = std::round(x * scale);
-
982 p.y = std::round(y * scale);
-
983
-
984 ::ClientToScreen(mPlugWnd, &p);
-
985
-
986 if (SetCursorPos(p.x, p.y))
-
987 {
-
988 GetCursorPos(&p);
-
989 ScreenToClient(mPlugWnd, &p);
-
990
-
991 mHiddenCursorX = mCursorX = p.x / scale;
-
992 mHiddenCursorY = mCursorY = p.y / scale;
-
993 }
-
994}
-
995
-
996ECursor IGraphicsWin::SetMouseCursor(ECursor cursorType)
-
997{
-
998 HCURSOR cursor;
-
999
-
1000 switch (cursorType)
-
1001 {
-
1002 case ECursor::ARROW: cursor = LoadCursor(NULL, IDC_ARROW); break;
-
1003 case ECursor::IBEAM: cursor = LoadCursor(NULL, IDC_IBEAM); break;
-
1004 case ECursor::WAIT: cursor = LoadCursor(NULL, IDC_WAIT); break;
-
1005 case ECursor::CROSS: cursor = LoadCursor(NULL, IDC_CROSS); break;
-
1006 case ECursor::UPARROW: cursor = LoadCursor(NULL, IDC_UPARROW); break;
-
1007 case ECursor::SIZENWSE: cursor = LoadCursor(NULL, IDC_SIZENWSE); break;
-
1008 case ECursor::SIZENESW: cursor = LoadCursor(NULL, IDC_SIZENESW); break;
-
1009 case ECursor::SIZEWE: cursor = LoadCursor(NULL, IDC_SIZEWE); break;
-
1010 case ECursor::SIZENS: cursor = LoadCursor(NULL, IDC_SIZENS); break;
-
1011 case ECursor::SIZEALL: cursor = LoadCursor(NULL, IDC_SIZEALL); break;
-
1012 case ECursor::INO: cursor = LoadCursor(NULL, IDC_NO); break;
-
1013 case ECursor::HAND: cursor = LoadCursor(NULL, IDC_HAND); break;
-
1014 case ECursor::APPSTARTING: cursor = LoadCursor(NULL, IDC_APPSTARTING); break;
-
1015 case ECursor::HELP: cursor = LoadCursor(NULL, IDC_HELP); break;
-
1016 default:
-
1017 cursor = LoadCursor(NULL, IDC_ARROW);
-
1018 }
-
1019
-
1020 SetCursor(cursor);
-
1021 return IGraphics::SetMouseCursor(cursorType);
-
1022}
-
1023
-
1024bool IGraphicsWin::MouseCursorIsLocked()
-
1025{
-
1026 return mCursorLock;
-
1027}
-
1028
-
1029void IGraphicsWin::GetMouseLocation(float& x, float&y) const
-
1030{
-
1031 POINT p;
-
1032 GetCursorPos(&p);
-
1033 ScreenToClient(mPlugWnd, &p);
-
1034
-
1035 const float scale = GetTotalScale();
-
1036
-
1037 x = p.x / scale;
-
1038 y = p.y / scale;
-
1039}
-
1040
-
1041#ifdef IGRAPHICS_GL
-
1042void IGraphicsWin::CreateGLContext()
-
1043{
-
1044 PIXELFORMATDESCRIPTOR pfd =
-
1045 {
-
1046 sizeof(PIXELFORMATDESCRIPTOR),
-
1047 1,
-
1048 PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, //Flags
-
1049 PFD_TYPE_RGBA, // The kind of framebuffer. RGBA or palette.
-
1050 32, // Colordepth of the framebuffer.
-
1051 0, 0, 0, 0, 0, 0,
-
1052 0,
+
19#include "IGraphicsWin_dnd.h"
+
20#include "IPopupMenuControl.h"
+
21#include "IPlugPaths.h"
+
22
+
23#include <wininet.h>
+
24#include <VersionHelpers.h>
+
25
+
26#if defined __clang__
+
27#undef CCSIZEOF_STRUCT
+
28#define CCSIZEOF_STRUCT(structname, member) (__builtin_offsetof(structname, member) + sizeof(((structname*)0)->member))
+
29#endif
+
30
+
31using namespace iplug;
+
32using namespace igraphics;
+
33
+
34#pragma warning(disable:4244) // Pointer size cast mismatch.
+
35#pragma warning(disable:4312) // Pointer size cast mismatch.
+
36#pragma warning(disable:4311) // Pointer size cast mismatch.
+
37
+
38static int nWndClassReg = 0;
+
39static wchar_t* wndClassName = L"IPlugWndClass";
+
40static double sFPS = 0.0;
+
41
+
42#define PARAM_EDIT_ID 99
+
43#define IPLUG_TIMER_ID 2
+
44
+
45#define TOOLTIPWND_MAXWIDTH 250
+
46
+
47#define WM_VBLANK (WM_USER+1)
+
48
+
49#ifdef IGRAPHICS_GL3
+
50typedef HGLRC(WINAPI* PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList);
+
51#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
+
52#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
+
53#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
+
54#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
+
55#endif
+
56
+
57#pragma mark - Private Classes and Structs
+
58
+
59// Fonts
+
60
+
61class IGraphicsWin::InstalledFont
+
62{
+
63public:
+
64 InstalledFont(void* data, int resSize)
+
65 : mFontHandle(nullptr)
+
66 {
+
67 if (data)
+
68 {
+
69 DWORD numFonts = 0;
+
70 mFontHandle = AddFontMemResourceEx(data, resSize, NULL, &numFonts);
+
71 }
+
72 }
+
73
+
74 ~InstalledFont()
+
75 {
+
76 if (IsValid())
+
77 RemoveFontMemResourceEx(mFontHandle);
+
78 }
+
79
+
80 InstalledFont(const InstalledFont&) = delete;
+
81 InstalledFont& operator=(const InstalledFont&) = delete;
+
82
+
83 bool IsValid() const { return mFontHandle; }
+
84
+
85private:
+
86 HANDLE mFontHandle;
+
87};
+
88
+
89struct IGraphicsWin::HFontHolder
+
90{
+
91 HFontHolder(HFONT hfont) : mHFont(nullptr)
+
92 {
+
93 LOGFONTW lFont = { 0 };
+
94 GetObjectW(hfont, sizeof(LOGFONTW), &lFont);
+
95 mHFont = CreateFontIndirectW(&lFont);
+
96 }
+
97
+
98 HFONT mHFont;
+
99};
+
100
+
101class IGraphicsWin::Font : public PlatformFont
+
102{
+
103public:
+
104 Font(HFONT font, const char* styleName, bool system)
+
105 : PlatformFont(system), mFont(font), mStyleName(styleName) {}
+
106 ~Font()
+
107 {
+
108 DeleteObject(mFont);
+
109 }
+
110
+
111 FontDescriptor GetDescriptor() override { return mFont; }
+
112 IFontDataPtr GetFontData() override;
+
113
+
114private:
+
115 HFONT mFont;
+
116 WDL_String mStyleName;
+
117};
+
118
+
119IFontDataPtr IGraphicsWin::Font::GetFontData()
+
120{
+
121 HDC hdc = CreateCompatibleDC(NULL);
+
122 IFontDataPtr fontData(new IFontData());
+
123
+
124 if (hdc != NULL)
+
125 {
+
126 SelectObject(hdc, mFont);
+
127 const size_t size = ::GetFontData(hdc, 0, 0, NULL, 0);
+
128
+
129 if (size != GDI_ERROR)
+
130 {
+
131 fontData = std::make_unique<IFontData>(size);
+
132
+
133 if (fontData->GetSize() == size)
+
134 {
+
135 size_t result = ::GetFontData(hdc, 0x66637474, 0, fontData->Get(), size);
+
136 if (result == GDI_ERROR)
+
137 result = ::GetFontData(hdc, 0, 0, fontData->Get(), size);
+
138 if (result == size)
+
139 fontData->SetFaceIdx(GetFaceIdx(fontData->Get(), fontData->GetSize(), mStyleName.Get()));
+
140 }
+
141 }
+
142
+
143 DeleteDC(hdc);
+
144 }
+
145
+
146 return fontData;
+
147}
+
148
+
149StaticStorage<IGraphicsWin::InstalledFont> IGraphicsWin::sPlatformFontCache;
+
150StaticStorage<IGraphicsWin::HFontHolder> IGraphicsWin::sHFontCache;
+
151
+
152#pragma mark - Mouse and tablet helpers
+
153
+
154extern float GetScaleForHWND(HWND hWnd);
+
155
+
156inline IMouseInfo IGraphicsWin::GetMouseInfo(LPARAM lParam, WPARAM wParam)
+
157{
+
158 IMouseInfo info;
+
159 const float scale = GetTotalScale();
+
160 info.x = mCursorX = GET_X_LPARAM(lParam) / scale;
+
161 info.y = mCursorY = GET_Y_LPARAM(lParam) / scale;
+
162 info.ms = IMouseMod((wParam & MK_LBUTTON), (wParam & MK_RBUTTON), (wParam & MK_SHIFT), (wParam & MK_CONTROL),
+
163#ifdef AAX_API
+
164 GetAsyncKeyState(VK_MENU) < 0
+
165#else
+
166 GetKeyState(VK_MENU) < 0
+
167#endif
+
168 );
+
169
+
170 return info;
+
171}
+
172
+
173void IGraphicsWin::CheckTabletInput(UINT msg)
+
174{
+
175 if ((msg == WM_LBUTTONDOWN) || (msg == WM_RBUTTONDOWN) || (msg == WM_MBUTTONDOWN) || (msg == WM_MOUSEMOVE)
+
176 || (msg == WM_RBUTTONDBLCLK) || (msg == WM_LBUTTONDBLCLK) || (msg == WM_MBUTTONDBLCLK)
+
177 || (msg == WM_RBUTTONUP) || (msg == WM_LBUTTONUP) || (msg == WM_MBUTTONUP)
+
178 || (msg == WM_MOUSEHOVER) || (msg == WM_MOUSELEAVE))
+
179 {
+
180 const LONG_PTR c_SIGNATURE_MASK = 0xFFFFFF00;
+
181 const LONG_PTR c_MOUSEEVENTF_FROMTOUCH = 0xFF515700;
+
182
+
183 LONG_PTR extraInfo = GetMessageExtraInfo();
+
184 SetTabletInput(((extraInfo & c_SIGNATURE_MASK) == c_MOUSEEVENTF_FROMTOUCH));
+
185 mCursorLock &= !mTabletInput;
+
186 }
+
187}
+
188
+
189void IGraphicsWin::DestroyEditWindow()
+
190{
+
191 if (mParamEditWnd)
+
192 {
+
193 SetWindowLongPtrW(mParamEditWnd, GWLP_WNDPROC, (LPARAM) mDefEditProc);
+
194 DestroyWindow(mParamEditWnd);
+
195 mParamEditWnd = nullptr;
+
196 mDefEditProc = nullptr;
+
197 DeleteObject(mEditFont);
+
198 mEditFont = nullptr;
+
199 }
+
200}
+
201
+
202void IGraphicsWin::OnDisplayTimer(int vBlankCount)
+
203{
+
204 // Check the message vblank with the current one to see if we are way behind. If so, then throw these away.
+
205 DWORD msgCount = vBlankCount;
+
206 DWORD curCount = mVBlankCount;
+
207
+
208 if (mVSYNCEnabled)
+
209 {
+
210 // skip until the actual vblank is at a certain number.
+
211 if (mVBlankSkipUntil != 0 && mVBlankSkipUntil > mVBlankCount)
+
212 {
+
213 return;
+
214 }
+
215
+
216 mVBlankSkipUntil = 0;
+
217
+
218 if (msgCount != curCount)
+
219 {
+
220 // we are late, just skip it until we can get a message soon after the vblank event.
+
221 // DBGMSG("vblank is late by %i frames. Skipping.", (mVBlankCount - msgCount));
+
222 return;
+
223 }
+
224 }
+
225
+
226 if (mParamEditWnd && mParamEditMsg != kNone)
+
227 {
+
228 switch (mParamEditMsg)
+
229 {
+
230 case kCommit:
+
231 {
+
232 WCHAR strWide[MAX_WIN32_PARAM_LEN];
+
233 SendMessageW(mParamEditWnd, WM_GETTEXT, MAX_WIN32_PARAM_LEN, (LPARAM) strWide);
+
234 SetControlValueAfterTextEdit(UTF16AsUTF8(strWide).Get());
+
235 DestroyEditWindow();
+
236 break;
+
237 }
+
238 case kCancel:
+
239 DestroyEditWindow();
+
240 ClearInTextEntryControl();
+
241 break;
+
242 }
+
243
+
244 mParamEditMsg = kNone;
+
245
+
246 return; // TODO: check this!
+
247 }
+
248
+
249 // TODO: move this... listen to the right messages in windows for screen resolution changes, etc.
+
250 if (!GetCapture()) // workaround Windows issues with window sizing during mouse move
+
251 {
+
252 float scale = GetScaleForHWND(mPlugWnd);
+
253 if (scale != GetScreenScale())
+
254 SetScreenScale(scale);
+
255 }
+
256
+
257 // TODO: this is far too aggressive for slow drawing animations and data changing. We need to
+
258 // gate the rate of updates to a certain percentage of the wall clock time.
+
259 IRECTList rects;
+
260 const float totalScale = GetTotalScale();
+
261 if (IsDirty(rects))
+
262 {
+
263 SetAllControlsClean();
+
264
+
265 for (int i = 0; i < rects.Size(); i++)
+
266 {
+
267 IRECT dirtyR = rects.Get(i);
+
268 dirtyR.Scale(totalScale);
+
269 dirtyR.PixelAlign();
+
270 RECT r = { (LONG)dirtyR.L, (LONG)dirtyR.T, (LONG)dirtyR.R, (LONG)dirtyR.B };
+
271 InvalidateRect(mPlugWnd, &r, FALSE);
+
272 }
+
273
+
274 if (mParamEditWnd)
+
275 {
+
276 IRECT notDirtyR = mEditRECT;
+
277 notDirtyR.Scale(totalScale);
+
278 notDirtyR.PixelAlign();
+
279 RECT r2 = { (LONG)notDirtyR.L, (LONG)notDirtyR.T, (LONG)notDirtyR.R, (LONG)notDirtyR.B };
+
280 ValidateRect(mPlugWnd, &r2); // make sure we dont redraw the edit box area
+
281 UpdateWindow(mPlugWnd);
+
282 mParamEditMsg = kUpdate;
+
283 }
+
284 else
+
285 {
+
286 // Force a redraw right now
+
287 UpdateWindow(mPlugWnd);
+
288
+
289 if (mVSYNCEnabled)
+
290 {
+
291 // Check and see if we are still in this frame.
+
292 curCount = mVBlankCount;
+
293 if (msgCount != curCount)
+
294 {
+
295 // we are late, skip the next vblank to give us a breather.
+
296 mVBlankSkipUntil = curCount+1;
+
297 //DBGMSG("vblank painting was late by %i frames.", (mVBlankSkipUntil - msgCount));
+
298 }
+
299 }
+
300 }
+
301 }
+
302 return;
+
303}
+
304
+
305// static
+
306LRESULT CALLBACK IGraphicsWin::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+
307{
+
308 if (msg == WM_CREATE)
+
309 {
+
310 CREATESTRUCTW* lpcs = (CREATESTRUCTW *) lParam;
+
311 SetWindowLongPtrW(hWnd, GWLP_USERDATA, (LPARAM) lpcs->lpCreateParams);
+
312 IGraphicsWin* pGraphics = (IGraphicsWin*) GetWindowLongPtrW(hWnd, GWLP_USERDATA);
+
313
+
314 if (pGraphics->mVSYNCEnabled) // use VBLANK thread
+
315 {
+
316 assert((pGraphics->FPS() == 60) && "If you want to run at frame rates other than 60FPS");
+
317 pGraphics->StartVBlankThread(hWnd);
+
318 }
+
319 else // use WM_TIMER -- its best to get below 16ms because the windows time quanta is slightly above 15ms.
+
320 {
+
321 int mSec = static_cast<int>(std::floorf(1000.0f / (pGraphics->FPS())));
+
322 if (mSec < 20) mSec = 15;
+
323 SetTimer(hWnd, IPLUG_TIMER_ID, mSec, NULL);
+
324 }
+
325
+
326 SetFocus(hWnd); // gets scroll wheel working straight away
+
327 DragAcceptFiles(hWnd, true);
+
328 return 0;
+
329 }
+
330
+
331 IGraphicsWin* pGraphics = (IGraphicsWin*) GetWindowLongPtrW(hWnd, GWLP_USERDATA);
+
332
+
333 if (!pGraphics || hWnd != pGraphics->mPlugWnd)
+
334 {
+
335 return DefWindowProcW(hWnd, msg, wParam, lParam);
+
336 }
+
337
+
338 if (pGraphics->mParamEditWnd && pGraphics->mParamEditMsg == kEditing)
+
339 {
+
340 if (msg == WM_RBUTTONDOWN || (msg == WM_LBUTTONDOWN))
+
341 {
+
342 pGraphics->mParamEditMsg = kCancel;
+
343 return 0;
+
344 }
+
345 return DefWindowProcW(hWnd, msg, wParam, lParam);
+
346 }
+
347
+
348 auto IsTouchEvent = []() {
+
349 const LONG_PTR c_SIGNATURE_MASK = 0xFFFFFF00;
+
350 const LONG_PTR c_MOUSEEVENTF_FROMTOUCH = 0xFF515700;
+
351 LONG_PTR extraInfo = GetMessageExtraInfo();
+
352 return ((extraInfo & c_SIGNATURE_MASK) == c_MOUSEEVENTF_FROMTOUCH);
+
353 };
+
354
+
355 pGraphics->CheckTabletInput(msg);
+
356
+
357 switch (msg)
+
358 {
+
359 case WM_VBLANK:
+
360 pGraphics->OnDisplayTimer(wParam);
+
361 return 0;
+
362
+
363 case WM_TIMER:
+
364 if (wParam == IPLUG_TIMER_ID)
+
365 pGraphics->OnDisplayTimer(0);
+
366
+
367 return 0;
+
368
+
369 case WM_ERASEBKGND:
+
370 return 0;
+
371
+
372 case WM_RBUTTONDOWN:
+
373 case WM_LBUTTONDOWN:
+
374 case WM_MBUTTONDOWN:
+
375 {
+
376 if (IsTouchEvent())
+
377 return 0;
+
378
+
379 pGraphics->HideTooltip();
+
380 if (pGraphics->mParamEditWnd)
+
381 {
+
382 pGraphics->mParamEditMsg = kCommit;
+
383 return 0;
+
384 }
+
385 SetFocus(hWnd); // Added to get keyboard focus again when user clicks in window
+
386 SetCapture(hWnd);
+
387 IMouseInfo info = pGraphics->GetMouseInfo(lParam, wParam);
+
388 std::vector<IMouseInfo> list{ info };
+
389 pGraphics->OnMouseDown(list);
+
390 return 0;
+
391 }
+
392 case WM_SETCURSOR:
+
393 {
+
394 pGraphics->OnSetCursor();
+
395 return 0;
+
396 }
+
397 case WM_MOUSEMOVE:
+
398 {
+
399 if (IsTouchEvent())
+
400 return 0;
+
401
+
402 if (!(wParam & (MK_LBUTTON | MK_RBUTTON)))
+
403 {
+
404 IMouseInfo info = pGraphics->GetMouseInfo(lParam, wParam);
+
405 if (pGraphics->OnMouseOver(info.x, info.y, info.ms))
+
406 {
+
407 TRACKMOUSEEVENT eventTrack = { sizeof(TRACKMOUSEEVENT), TME_LEAVE, hWnd, HOVER_DEFAULT };
+
408 if (pGraphics->TooltipsEnabled())
+
409 {
+
410 int c = pGraphics->GetMouseOver();
+
411 if (c != pGraphics->mTooltipIdx)
+
412 {
+
413 if (c >= 0) eventTrack.dwFlags |= TME_HOVER;
+
414 pGraphics->mTooltipIdx = c;
+
415 pGraphics->HideTooltip();
+
416 }
+
417 }
+
418
+
419 TrackMouseEvent(&eventTrack);
+
420 }
+
421 }
+
422 else if (GetCapture() == hWnd && !pGraphics->IsInPlatformTextEntry())
+
423 {
+
424 float oldX = pGraphics->mCursorX;
+
425 float oldY = pGraphics->mCursorY;
+
426
+
427 IMouseInfo info = pGraphics->GetMouseInfo(lParam, wParam);
+
428
+
429 info.dX = info.x - oldX;
+
430 info.dY = info.y - oldY;
+
431
+
432 if (info.dX || info.dY)
+
433 {
+
434 std::vector<IMouseInfo> list{ info };
+
435 pGraphics->OnMouseDrag(list);
+
436
+
437 if (pGraphics->MouseCursorIsLocked())
+
438 {
+
439 const float x = pGraphics->mHiddenCursorX;
+
440 const float y = pGraphics->mHiddenCursorY;
+
441
+
442 pGraphics->MoveMouseCursor(x, y);
+
443 pGraphics->mHiddenCursorX = x;
+
444 pGraphics->mHiddenCursorY = y;
+
445 }
+
446 }
+
447 }
+
448
+
449 return 0;
+
450 }
+
451 case WM_MOUSEHOVER:
+
452 {
+
453 pGraphics->ShowTooltip();
+
454 return 0;
+
455 }
+
456 case WM_MOUSELEAVE:
+
457 {
+
458 pGraphics->HideTooltip();
+
459 pGraphics->OnMouseOut();
+
460 return 0;
+
461 }
+
462 case WM_LBUTTONUP:
+
463 case WM_RBUTTONUP:
+
464 {
+
465 ReleaseCapture();
+
466 IMouseInfo info = pGraphics->GetMouseInfo(lParam, wParam);
+
467 std::vector<IMouseInfo> list{ info };
+
468 pGraphics->OnMouseUp(list);
+
469 return 0;
+
470 }
+
471 case WM_LBUTTONDBLCLK:
+
472 case WM_RBUTTONDBLCLK:
+
473 {
+
474 if (IsTouchEvent())
+
475 return 0;
+
476
+
477 IMouseInfo info = pGraphics->GetMouseInfo(lParam, wParam);
+
478 if (pGraphics->OnMouseDblClick(info.x, info.y, info.ms))
+
479 {
+
480 SetCapture(hWnd);
+
481 }
+
482 return 0;
+
483 }
+
484 case WM_MOUSEWHEEL:
+
485 {
+
486 if (pGraphics->mParamEditWnd)
+
487 {
+
488 pGraphics->mParamEditMsg = kCancel;
+
489 return 0;
+
490 }
+
491 else
+
492 {
+
493 IMouseInfo info = pGraphics->GetMouseInfo(lParam, wParam);
+
494 float d = GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA;
+
495 const float scale = pGraphics->GetTotalScale();
+
496 RECT r;
+
497 GetWindowRect(hWnd, &r);
+
498 pGraphics->OnMouseWheel(info.x - (r.left / scale), info.y - (r.top / scale), info.ms, d);
+
499 return 0;
+
500 }
+
501 }
+
502 case WM_TOUCH:
+
503 {
+
504 UINT nTouches = LOWORD(wParam);
+
505
+
506 if (nTouches > 0)
+
507 {
+
508 WDL_TypedBuf<TOUCHINPUT> touches;
+
509 touches.Resize(nTouches);
+
510 HTOUCHINPUT hTouchInput = (HTOUCHINPUT) lParam;
+
511 std::vector<IMouseInfo> downlist;
+
512 std::vector<IMouseInfo> uplist;
+
513 std::vector<IMouseInfo> movelist;
+
514 const float scale = pGraphics->GetTotalScale();
+
515
+
516 GetTouchInputInfo(hTouchInput, nTouches, touches.Get(), sizeof(TOUCHINPUT));
+
517
+
518 for (int i = 0; i < nTouches; i++)
+
519 {
+
520 TOUCHINPUT* pTI = touches.Get() +i;
+
521
+
522 POINT pt;
+
523 pt.x = TOUCH_COORD_TO_PIXEL(pTI->x);
+
524 pt.y = TOUCH_COORD_TO_PIXEL(pTI->y);
+
525 ScreenToClient(pGraphics->mPlugWnd, &pt);
+
526
+
527 IMouseInfo info;
+
528 info.x = static_cast<float>(pt.x) / scale;
+
529 info.y = static_cast<float>(pt.y) / scale;
+
530 info.dX = 0.f;
+
531 info.dY = 0.f;
+
532 info.ms.touchRadius = 0;
+
533
+
534 if (pTI->dwMask & TOUCHINPUTMASKF_CONTACTAREA)
+
535 {
+
536 info.ms.touchRadius = pTI->cxContact;
+
537 }
+
538
+
539 info.ms.touchID = static_cast<ITouchID>(pTI->dwID);
+
540
+
541 if (pTI->dwFlags & TOUCHEVENTF_DOWN)
+
542 {
+
543 downlist.push_back(info);
+
544 pGraphics->mDeltaCapture.insert(std::make_pair(info.ms.touchID, info));
+
545 }
+
546 else if (pTI->dwFlags & TOUCHEVENTF_UP)
+
547 {
+
548 pGraphics->mDeltaCapture.erase(info.ms.touchID);
+
549 uplist.push_back(info);
+
550 }
+
551 else if (pTI->dwFlags & TOUCHEVENTF_MOVE)
+
552 {
+
553 IMouseInfo previous = pGraphics->mDeltaCapture.find(info.ms.touchID)->second;
+
554 info.dX = info.x - previous.x;
+
555 info.dY = info.y - previous.y;
+
556 movelist.push_back(info);
+
557 pGraphics->mDeltaCapture[info.ms.touchID] = info;
+
558 }
+
559 }
+
560
+
561 if (downlist.size())
+
562 pGraphics->OnMouseDown(downlist);
+
563
+
564 if (uplist.size())
+
565 pGraphics->OnMouseUp(uplist);
+
566
+
567 if (movelist.size())
+
568 pGraphics->OnMouseDrag(movelist);
+
569
+
570 CloseTouchInputHandle(hTouchInput);
+
571 }
+
572 return 0;
+
573 }
+
574 case WM_GETDLGCODE:
+
575 return DLGC_WANTALLKEYS;
+
576 case WM_KEYDOWN:
+
577 case WM_KEYUP:
+
578 {
+
579 POINT p;
+
580 GetCursorPos(&p);
+
581 ScreenToClient(hWnd, &p);
+
582
+
583 BYTE keyboardState[256] = {};
+
584 GetKeyboardState(keyboardState);
+
585 const int keyboardScanCode = (lParam >> 16) & 0x00ff;
+
586 WORD character = 0;
+
587 const int len = ToAscii(wParam, keyboardScanCode, keyboardState, &character, 0);
+
588 // TODO: should get unicode?
+
589 bool handle = false;
+
590
+
591 // send when len is 0 because wParam might be something like VK_LEFT or VK_HOME, etc.
+
592 if (len == 0 || len == 1)
+
593 {
+
594 char str[2];
+
595 str[0] = static_cast<char>(character);
+
596 str[1] = '\0';
+
597
+
598 IKeyPress keyPress{ str, static_cast<int>(wParam),
+
599 static_cast<bool>(GetKeyState(VK_SHIFT) & 0x8000),
+
600 static_cast<bool>(GetKeyState(VK_CONTROL) & 0x8000),
+
601 static_cast<bool>(GetKeyState(VK_MENU) & 0x8000) };
+
602
+
603 const float scale = pGraphics->GetTotalScale();
+
604
+
605 if (msg == WM_KEYDOWN)
+
606 handle = pGraphics->OnKeyDown(p.x / scale, p.y / scale, keyPress);
+
607 else
+
608 handle = pGraphics->OnKeyUp(p.x / scale, p.y / scale, keyPress);
+
609 }
+
610
+
611 if (!handle)
+
612 {
+
613 HWND rootHWnd = GetAncestor( hWnd, GA_ROOT);
+
614 SendMessageW(rootHWnd, msg, wParam, lParam);
+
615 return DefWindowProcW(hWnd, msg, wParam, lParam);
+
616 }
+
617 else
+
618 return 0;
+
619 }
+
620 case WM_PAINT:
+
621 {
+
622 const float scale = pGraphics->GetTotalScale();
+
623 auto addDrawRect = [pGraphics, scale](IRECTList& rects, RECT r) {
+
624 IRECT ir(r.left, r.top, r.right, r.bottom);
+
625 ir.Scale(1.f/scale);
+
626 ir.PixelAlign();
+
627 rects.Add(ir);
+
628 };
+
629
+
630 HRGN region = CreateRectRgn(0, 0, 0, 0);
+
631 int regionType = GetUpdateRgn(hWnd, region, FALSE);
+
632
+
633 if ((regionType == COMPLEXREGION) || (regionType == SIMPLEREGION))
+
634 {
+
635 IRECTList rects;
+
636 const int bufferSize = sizeof(RECT) * 64;
+
637 unsigned char stackBuffer[sizeof(RGNDATA) + bufferSize];
+
638 RGNDATA* regionData = (RGNDATA*)stackBuffer;
+
639
+
640 if (regionType == COMPLEXREGION && GetRegionData(region, bufferSize, regionData))
+
641 {
+
642 for (int i = 0; i < regionData->rdh.nCount; i++)
+
643 addDrawRect(rects, *(((RECT*)regionData->Buffer) + i));
+
644 }
+
645 else
+
646 {
+
647 RECT r;
+
648 GetRgnBox(region, &r);
+
649 addDrawRect(rects, r);
+
650 }
+
651
+
652#if defined IGRAPHICS_GL //|| IGRAPHICS_D2D
+
653 PAINTSTRUCT ps;
+
654 BeginPaint(hWnd, &ps);
+
655#endif
+
656
+
657#ifdef IGRAPHICS_GL
+
658 pGraphics->ActivateGLContext();
+
659#endif
+
660
+
661 pGraphics->Draw(rects);
+
662
+
663 #ifdef IGRAPHICS_GL
+
664 SwapBuffers((HDC) pGraphics->GetPlatformContext());
+
665 pGraphics->DeactivateGLContext();
+
666 #endif
+
667
+
668#if defined IGRAPHICS_GL || IGRAPHICS_D2D
+
669 EndPaint(hWnd, &ps);
+
670#endif
+
671 }
+
672
+
673 // For the D2D if we don't call endpaint, then you really need to call ValidateRect otherwise
+
674 // we are just going to get another WM_PAINT to handle. Bad! It also exibits the odd property
+
675 // that windows will be popped under the window.
+
676 ValidateRect(hWnd, 0);
+
677
+
678 DeleteObject(region);
+
679
+
680 return 0;
+
681 }
+
682
+
683 case WM_CTLCOLOREDIT:
+
684 {
+
685 if (!pGraphics->mParamEditWnd)
+
686 return 0;
+
687
+
688 const IText& text = pGraphics->mEditText;
+
689 HDC dc = (HDC) wParam;
+
690 SetBkColor(dc, RGB(text.mTextEntryBGColor.R, text.mTextEntryBGColor.G, text.mTextEntryBGColor.B));
+
691 SetTextColor(dc, RGB(text.mTextEntryFGColor.R, text.mTextEntryFGColor.G, text.mTextEntryFGColor.B));
+
692 SetBkMode(dc, OPAQUE);
+
693 SetDCBrushColor(dc, RGB(text.mTextEntryBGColor.R, text.mTextEntryBGColor.G, text.mTextEntryBGColor.B));
+
694 return (LRESULT)GetStockObject(DC_BRUSH);
+
695 }
+
696 case WM_DROPFILES:
+
697 {
+
698 HDROP hdrop = (HDROP) wParam;
+
699
+
700 int numDroppedFiles = DragQueryFileW(hdrop, -1, nullptr, 0);
+
701
+
702 std::vector<std::vector<char>> pathBuffers(numDroppedFiles, std::vector<char>(1025, 0));
+
703 std::vector<const char*> pathPtrs(numDroppedFiles);
+
704
+
705 for (int i = 0; i < numDroppedFiles; i++)
+
706 {
+
707 wchar_t pathBufferW[1025] = {'\0'};
+
708 DragQueryFileW(hdrop, i, pathBufferW, 1024);
+
709 strncpy(pathBuffers[i].data(), UTF16AsUTF8(pathBufferW).Get(), 1024);
+
710 pathPtrs[i] = pathBuffers[i].data();
+
711 }
+
712 POINT p;
+
713 DragQueryPoint(hdrop, &p);
+
714
+
715 const float scale = pGraphics->GetTotalScale();
+
716
+
717 if (numDroppedFiles==1)
+
718 {
+
719 pGraphics->OnDrop(&pathPtrs[0][0], p.x / scale, p.y / scale);
+
720 }
+
721 else
+
722 {
+
723 pGraphics->OnDropMultiple(pathPtrs, p.x / scale, p.y / scale);
+
724 }
+
725
+
726 return 0;
+
727 }
+
728 case WM_CLOSE:
+
729 {
+
730 pGraphics->CloseWindow();
+
731 return 0;
+
732 }
+
733 case WM_SETFOCUS:
+
734 {
+
735 return 0;
+
736 }
+
737 case WM_KILLFOCUS:
+
738 {
+
739 return 0;
+
740 }
+
741 }
+
742 return DefWindowProcW(hWnd, msg, wParam, lParam);
+
743}
+
744
+
745// static
+
746LRESULT CALLBACK IGraphicsWin::ParamEditProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+
747{
+
748 IGraphicsWin* pGraphics = (IGraphicsWin*) GetWindowLongPtrW(GetParent(hWnd), GWLP_USERDATA);
+
749
+
750 if (pGraphics && pGraphics->mParamEditWnd && pGraphics->mParamEditWnd == hWnd)
+
751 {
+
752 pGraphics->HideTooltip();
+
753
+
754 switch (msg)
+
755 {
+
756 case WM_CHAR:
+
757 {
+
758 // limit to numbers for text entry on appropriate parameters
+
759 if (pGraphics->mEditParam)
+
760 {
+
761 char c = wParam;
+
762
+
763 if (c == 0x08) break; // backspace
+
764
+
765 switch (pGraphics->mEditParam->Type())
+
766 {
+
767 case IParam::kTypeEnum:
+
768 case IParam::kTypeInt:
+
769 case IParam::kTypeBool:
+
770 if (c >= '0' && c <= '9') break;
+
771 else if (c == '-') break;
+
772 else if (c == '+') break;
+
773 else return 0;
+
774 case IParam::kTypeDouble:
+
775 if (c >= '0' && c <= '9') break;
+
776 else if (c == '-') break;
+
777 else if (c == '+') break;
+
778 else if (c == '.') break;
+
779 else return 0;
+
780 default:
+
781 break;
+
782 }
+
783 }
+
784 break;
+
785 }
+
786 case WM_KEYDOWN:
+
787 {
+
788 if (wParam == VK_RETURN)
+
789 {
+
790 pGraphics->mParamEditMsg = kCommit;
+
791 return 0;
+
792 }
+
793 else if (wParam == VK_ESCAPE)
+
794 {
+
795 pGraphics->mParamEditMsg = kCancel;
+
796 return 0;
+
797 }
+
798 break;
+
799 }
+
800 case WM_SETFOCUS:
+
801 {
+
802 pGraphics->mParamEditMsg = kEditing;
+
803 break;
+
804 }
+
805 case WM_KILLFOCUS:
+
806 {
+
807 pGraphics->mParamEditMsg = kCommit;
+
808 break;
+
809 }
+
810 // handle WM_GETDLGCODE so that we can say that we want the return key message
+
811 // (normally single line edit boxes don't get sent return key messages)
+
812 case WM_GETDLGCODE:
+
813 {
+
814 LPARAM lres;
+
815 // find out if the original control wants it
+
816 lres = CallWindowProcW(pGraphics->mDefEditProc, hWnd, WM_GETDLGCODE, wParam, lParam);
+
817 // add in that we want it if it is a return keydown
+
818 if (lParam && ((MSG*)lParam)->message == WM_KEYDOWN && wParam == VK_RETURN)
+
819 {
+
820 lres |= DLGC_WANTMESSAGE;
+
821 }
+
822 return lres;
+
823 }
+
824 case WM_COMMAND:
+
825 {
+
826 switch HIWORD(wParam)
+
827 {
+
828 case CBN_SELCHANGE:
+
829 {
+
830 if (pGraphics->mParamEditWnd)
+
831 {
+
832 pGraphics->mParamEditMsg = kCommit;
+
833 return 0;
+
834 }
+
835 }
+
836
+
837 }
+
838 break; // Else let the default proc handle it.
+
839 }
+
840 }
+
841 return CallWindowProcW(pGraphics->mDefEditProc, hWnd, msg, wParam, lParam);
+
842 }
+
843 return DefWindowProcW(hWnd, msg, wParam, lParam);
+
844}
+
845
+
846IGraphicsWin::IGraphicsWin(IGEditorDelegate& dlg, int w, int h, int fps, float scale)
+
847 : IGRAPHICS_DRAW_CLASS(dlg, w, h, fps, scale)
+
848{
+
849 StaticStorage<InstalledFont>::Accessor fontStorage(sPlatformFontCache);
+
850 StaticStorage<HFontHolder>::Accessor hfontStorage(sHFontCache);
+
851 fontStorage.Retain();
+
852 hfontStorage.Retain();
+
853
+
854#ifndef IGRAPHICS_DISABLE_VSYNC
+
855 mVSYNCEnabled = IsWindows8OrGreater();
+
856#endif
+
857}
+
858
+
859IGraphicsWin::~IGraphicsWin()
+
860{
+
861 StaticStorage<InstalledFont>::Accessor fontStorage(sPlatformFontCache);
+
862 StaticStorage<HFontHolder>::Accessor hfontStorage(sHFontCache);
+
863 fontStorage.Release();
+
864 hfontStorage.Release();
+
865 DestroyEditWindow();
+
866 CloseWindow();
+
867}
+
868
+
869static void GetWindowSize(HWND pWnd, int* pW, int* pH)
+
870{
+
871 if (pWnd)
+
872 {
+
873 RECT r;
+
874 GetWindowRect(pWnd, &r);
+
875 *pW = r.right - r.left;
+
876 *pH = r.bottom - r.top;
+
877 }
+
878 else
+
879 {
+
880 *pW = *pH = 0;
+
881 }
+
882}
+
883
+
884static bool IsChildWindow(HWND pWnd)
+
885{
+
886 if (pWnd)
+
887 {
+
888 int style = GetWindowLongW(pWnd, GWL_STYLE);
+
889 int exStyle = GetWindowLongW(pWnd, GWL_EXSTYLE);
+
890 return ((style & WS_CHILD) && !(exStyle & WS_EX_MDICHILD));
+
891 }
+
892 return false;
+
893}
+
894
+
895void IGraphicsWin::ForceEndUserEdit()
+
896{
+
897 mParamEditMsg = kCancel;
+
898}
+
899
+
900static UINT SETPOS_FLAGS = SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE;
+
901
+
902void IGraphicsWin::PlatformResize(bool parentHasResized)
+
903{
+
904 if (WindowIsOpen())
+
905 {
+
906 HWND pParent = 0, pGrandparent = 0;
+
907 int dlgW = 0, dlgH = 0, parentW = 0, parentH = 0, grandparentW = 0, grandparentH = 0;
+
908 GetWindowSize(mPlugWnd, &dlgW, &dlgH);
+
909 int dw = (WindowWidth() * GetScreenScale()) - dlgW, dh = (WindowHeight()* GetScreenScale()) - dlgH;
+
910
+
911 if (IsChildWindow(mPlugWnd))
+
912 {
+
913 pParent = GetParent(mPlugWnd);
+
914 GetWindowSize(pParent, &parentW, &parentH);
+
915
+
916 if (IsChildWindow(pParent))
+
917 {
+
918 pGrandparent = GetParent(pParent);
+
919 GetWindowSize(pGrandparent, &grandparentW, &grandparentH);
+
920 }
+
921 }
+
922
+
923 if (!dw && !dh)
+
924 return;
+
925
+
926 SetWindowPos(mPlugWnd, 0, 0, 0, dlgW + dw, dlgH + dh, SETPOS_FLAGS);
+
927
+
928 if (pParent && !parentHasResized)
+
929 {
+
930 SetWindowPos(pParent, 0, 0, 0, parentW + dw, parentH + dh, SETPOS_FLAGS);
+
931 }
+
932
+
933 if (pGrandparent && !parentHasResized)
+
934 {
+
935 SetWindowPos(pGrandparent, 0, 0, 0, grandparentW + dw, grandparentH + dh, SETPOS_FLAGS);
+
936 }
+
937 }
+
938}
+
939
+
940#ifdef IGRAPHICS_GL
+
941void IGraphicsWin::DrawResize()
+
942{
+
943 ActivateGLContext();
+
944 IGRAPHICS_DRAW_CLASS::DrawResize();
+
945 DeactivateGLContext();
+
946}
+
947#endif
+
948
+
949void IGraphicsWin::HideMouseCursor(bool hide, bool lock)
+
950{
+
951 if (mCursorHidden == hide)
+
952 return;
+
953
+
954 if (hide)
+
955 {
+
956 mHiddenCursorX = mCursorX;
+
957 mHiddenCursorY = mCursorY;
+
958
+
959 ShowCursor(false);
+
960 mCursorHidden = true;
+
961 mCursorLock = lock && !mTabletInput;
+
962 }
+
963 else
+
964 {
+
965 if (mCursorLock)
+
966 MoveMouseCursor(mHiddenCursorX, mHiddenCursorY);
+
967
+
968 ShowCursor(true);
+
969 mCursorHidden = false;
+
970 mCursorLock = false;
+
971 }
+
972}
+
973
+
974void IGraphicsWin::MoveMouseCursor(float x, float y)
+
975{
+
976 if (mTabletInput)
+
977 return;
+
978
+
979 const float scale = GetTotalScale();
+
980
+
981 POINT p;
+
982 p.x = std::round(x * scale);
+
983 p.y = std::round(y * scale);
+
984
+
985 ::ClientToScreen(mPlugWnd, &p);
+
986
+
987 if (SetCursorPos(p.x, p.y))
+
988 {
+
989 GetCursorPos(&p);
+
990 ScreenToClient(mPlugWnd, &p);
+
991
+
992 mHiddenCursorX = mCursorX = p.x / scale;
+
993 mHiddenCursorY = mCursorY = p.y / scale;
+
994 }
+
995}
+
996
+
997ECursor IGraphicsWin::SetMouseCursor(ECursor cursorType)
+
998{
+
999 HCURSOR cursor;
+
1000
+
1001 switch (cursorType)
+
1002 {
+
1003 case ECursor::ARROW: cursor = LoadCursor(NULL, IDC_ARROW); break;
+
1004 case ECursor::IBEAM: cursor = LoadCursor(NULL, IDC_IBEAM); break;
+
1005 case ECursor::WAIT: cursor = LoadCursor(NULL, IDC_WAIT); break;
+
1006 case ECursor::CROSS: cursor = LoadCursor(NULL, IDC_CROSS); break;
+
1007 case ECursor::UPARROW: cursor = LoadCursor(NULL, IDC_UPARROW); break;
+
1008 case ECursor::SIZENWSE: cursor = LoadCursor(NULL, IDC_SIZENWSE); break;
+
1009 case ECursor::SIZENESW: cursor = LoadCursor(NULL, IDC_SIZENESW); break;
+
1010 case ECursor::SIZEWE: cursor = LoadCursor(NULL, IDC_SIZEWE); break;
+
1011 case ECursor::SIZENS: cursor = LoadCursor(NULL, IDC_SIZENS); break;
+
1012 case ECursor::SIZEALL: cursor = LoadCursor(NULL, IDC_SIZEALL); break;
+
1013 case ECursor::INO: cursor = LoadCursor(NULL, IDC_NO); break;
+
1014 case ECursor::HAND: cursor = LoadCursor(NULL, IDC_HAND); break;
+
1015 case ECursor::APPSTARTING: cursor = LoadCursor(NULL, IDC_APPSTARTING); break;
+
1016 case ECursor::HELP: cursor = LoadCursor(NULL, IDC_HELP); break;
+
1017 default:
+
1018 cursor = LoadCursor(NULL, IDC_ARROW);
+
1019 }
+
1020
+
1021 SetCursor(cursor);
+
1022 return IGraphics::SetMouseCursor(cursorType);
+
1023}
+
1024
+
1025bool IGraphicsWin::MouseCursorIsLocked()
+
1026{
+
1027 return mCursorLock;
+
1028}
+
1029
+
1030void IGraphicsWin::GetMouseLocation(float& x, float&y) const
+
1031{
+
1032 POINT p;
+
1033 GetCursorPos(&p);
+
1034 ScreenToClient(mPlugWnd, &p);
+
1035
+
1036 const float scale = GetTotalScale();
+
1037
+
1038 x = p.x / scale;
+
1039 y = p.y / scale;
+
1040}
+
1041
+
1042#ifdef IGRAPHICS_GL
+
1043void IGraphicsWin::CreateGLContext()
+
1044{
+
1045 PIXELFORMATDESCRIPTOR pfd =
+
1046 {
+
1047 sizeof(PIXELFORMATDESCRIPTOR),
+
1048 1,
+
1049 PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, //Flags
+
1050 PFD_TYPE_RGBA, // The kind of framebuffer. RGBA or palette.
+
1051 32, // Colordepth of the framebuffer.
+
1052 0, 0, 0, 0, 0, 0,
1053 0,
1054 0,
-
1055 0, 0, 0, 0,
-
1056 24, // Number of bits for the depthbuffer
-
1057 8, // Number of bits for the stencilbuffer
-
1058 0, // Number of Aux buffers in the framebuffer.
-
1059 PFD_MAIN_PLANE,
-
1060 0,
-
1061 0, 0, 0
-
1062 };
-
1063
-
1064 HDC dc = GetDC(mPlugWnd);
-
1065 int fmt = ChoosePixelFormat(dc, &pfd);
-
1066 SetPixelFormat(dc, fmt, &pfd);
-
1067 mHGLRC = wglCreateContext(dc);
-
1068 wglMakeCurrent(dc, mHGLRC);
-
1069
-
1070#ifdef IGRAPHICS_GL3
-
1071 // On windows we can't create a 3.3 context directly, since we need the wglCreateContextAttribsARB extension.
-
1072 // We load the extension, then re-create the context.
-
1073 auto wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC) wglGetProcAddress("wglCreateContextAttribsARB");
-
1074
-
1075 if (wglCreateContextAttribsARB)
-
1076 {
-
1077 wglDeleteContext(mHGLRC);
-
1078
-
1079 const int attribList[] = {
-
1080 WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
-
1081 WGL_CONTEXT_MINOR_VERSION_ARB, 3,
-
1082 WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
-
1083 0
-
1084 };
-
1085
-
1086 mHGLRC = wglCreateContextAttribsARB(dc, 0, attribList);
-
1087 wglMakeCurrent(dc, mHGLRC);
-
1088 }
-
1089
-
1090#endif
-
1091
-
1092 //TODO: return false if GL init fails?
-
1093 if (!gladLoadGL())
-
1094 DBGMSG("Error initializing glad");
-
1095
-
1096 glGetError();
-
1097
-
1098 ReleaseDC(mPlugWnd, dc);
-
1099}
-
1100
-
1101void IGraphicsWin::DestroyGLContext()
-
1102{
-
1103 wglMakeCurrent(NULL, NULL);
-
1104 wglDeleteContext(mHGLRC);
-
1105}
-
1106
-
1107void IGraphicsWin::ActivateGLContext()
-
1108{
-
1109 mStartHDC = wglGetCurrentDC();
-
1110 mStartHGLRC = wglGetCurrentContext();
-
1111 HDC dc = GetDC(mPlugWnd);
-
1112 wglMakeCurrent(dc, mHGLRC);
-
1113}
-
1114
-
1115void IGraphicsWin::DeactivateGLContext()
-
1116{
-
1117 ReleaseDC(mPlugWnd, (HDC) GetPlatformContext());
-
1118 wglMakeCurrent(mStartHDC, mStartHGLRC); // return current ctxt to start
-
1119}
-
1120#endif
-
1121
-
1122EMsgBoxResult IGraphicsWin::ShowMessageBox(const char* text, const char* caption, EMsgBoxType type, IMsgBoxCompletionHandlerFunc completionHandler)
-
1123{
-
1124 ReleaseMouseCapture();
-
1125
-
1126 EMsgBoxResult result = static_cast<EMsgBoxResult>(MessageBoxW(GetMainWnd(), UTF8AsUTF16(text).Get(), UTF8AsUTF16(caption).Get(), static_cast<int>(type)));
-
1127
-
1128 if (completionHandler)
-
1129 completionHandler(result);
-
1130
-
1131 return result;
-
1132}
-
1133
-
1134void* IGraphicsWin::OpenWindow(void* pParent)
-
1135{
-
1136 mParentWnd = (HWND) pParent;
-
1137 int screenScale = GetScaleForHWND(mParentWnd);
-
1138 int x = 0, y = 0, w = WindowWidth() * screenScale, h = WindowHeight() * screenScale;
-
1139
-
1140 if (mPlugWnd)
-
1141 {
-
1142 RECT pR, cR;
-
1143 GetWindowRect((HWND) pParent, &pR);
-
1144 GetWindowRect(mPlugWnd, &cR);
-
1145 CloseWindow();
-
1146 x = cR.left - pR.left;
-
1147 y = cR.top - pR.top;
-
1148 w = cR.right - cR.left;
-
1149 h = cR.bottom - cR.top;
-
1150 }
-
1151
-
1152 if (nWndClassReg++ == 0)
-
1153 {
-
1154 WNDCLASSW wndClass = { CS_DBLCLKS | CS_OWNDC, WndProc, 0, 0, mHInstance, 0, 0, 0, 0, wndClassName };
-
1155 RegisterClassW(&wndClass);
-
1156 }
-
1157
-
1158 mPlugWnd = CreateWindowW(wndClassName, L"IPlug", WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, x, y, w, h, mParentWnd, 0, mHInstance, this);
-
1159
-
1160 HDC dc = GetDC(mPlugWnd);
-
1161 SetPlatformContext(dc);
-
1162 ReleaseDC(mPlugWnd, dc);
-
1163
-
1164#ifdef IGRAPHICS_GL
-
1165 CreateGLContext();
-
1166#endif
-
1167
-
1168 OnViewInitialized((void*) dc);
-
1169
-
1170 SetScreenScale(screenScale); // resizes draw context
-
1171
-
1172 GetDelegate()->LayoutUI(this);
-
1173
-
1174 if (MultiTouchEnabled() && GetSystemMetrics(SM_DIGITIZER) & NID_MULTI_INPUT)
-
1175 {
-
1176 RegisterTouchWindow(mPlugWnd, 0);
-
1177 }
-
1178
-
1179 if (!mPlugWnd && --nWndClassReg == 0)
-
1180 {
-
1181 UnregisterClassW(wndClassName, mHInstance);
-
1182 }
-
1183 else
-
1184 {
-
1185 SetAllControlsDirty();
-
1186 }
-
1187
-
1188 if (mPlugWnd && TooltipsEnabled())
-
1189 {
-
1190 static const INITCOMMONCONTROLSEX iccex = { sizeof(INITCOMMONCONTROLSEX), ICC_TAB_CLASSES };
-
1191
-
1192 if (InitCommonControlsEx(&iccex))
-
1193 {
-
1194 mTooltipWnd = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | TTS_NOPREFIX | TTS_ALWAYSTIP,
-
1195 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, mPlugWnd, NULL, mHInstance, NULL);
-
1196 if (mTooltipWnd)
-
1197 {
-
1198 SetWindowPos(mTooltipWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
-
1199 TOOLINFOW ti = { TTTOOLINFOW_V2_SIZE, TTF_IDISHWND | TTF_SUBCLASS, mPlugWnd, (UINT_PTR) mPlugWnd, {0, 0, 0, 0}, NULL, NULL, 0, NULL };
-
1200 SendMessageW(mTooltipWnd, TTM_ADDTOOLW, 0, (LPARAM) &ti);
-
1201 SendMessageW(mTooltipWnd, TTM_SETMAXTIPWIDTH, 0, TOOLTIPWND_MAXWIDTH);
-
1202 }
-
1203 }
-
1204
-
1205 if (!mTooltipWnd)
-
1206 EnableTooltips(false);
-
1207
-
1208#ifdef IGRAPHICS_GL
-
1209 wglMakeCurrent(NULL, NULL);
-
1210#endif
-
1211 }
-
1212
-
1213 GetDelegate()->OnUIOpen();
-
1214
-
1215 return mPlugWnd;
-
1216}
-
1217
-
1218static void GetWndClassName(HWND hWnd, WDL_String* pStr)
-
1219{
-
1220 wchar_t cStrW[MAX_CLASSNAME_LEN] = {'\0'};
-
1221 GetClassNameW(hWnd, cStrW, MAX_CLASSNAME_LEN);
-
1222 pStr->Set(UTF16AsUTF8(cStrW).Get());
-
1223}
-
1224
-
1225BOOL CALLBACK IGraphicsWin::FindMainWindow(HWND hWnd, LPARAM lParam)
-
1226{
-
1227 IGraphicsWin* pGraphics = (IGraphicsWin*) lParam;
-
1228 if (pGraphics)
-
1229 {
-
1230 DWORD wPID;
-
1231 GetWindowThreadProcessId(hWnd, &wPID);
-
1232 WDL_String str;
-
1233 GetWndClassName(hWnd, &str);
-
1234 if (wPID == pGraphics->mPID && !strcmp(str.Get(), pGraphics->mMainWndClassName.Get()))
-
1235 {
-
1236 pGraphics->mMainWnd = hWnd;
-
1237 return FALSE; // Stop enumerating.
-
1238 }
-
1239 }
-
1240 return TRUE;
-
1241}
-
1242
-
1243HWND IGraphicsWin::GetMainWnd()
-
1244{
-
1245 if (!mMainWnd)
-
1246 {
-
1247 if (mParentWnd)
-
1248 {
-
1249 HWND parentWnd = mParentWnd;
-
1250 while (parentWnd)
-
1251 {
-
1252 mMainWnd = parentWnd;
-
1253 parentWnd = GetParent(mMainWnd);
-
1254 }
-
1255
-
1256 GetWndClassName(mMainWnd, &mMainWndClassName);
-
1257 }
-
1258 else if (CStringHasContents(mMainWndClassName.Get()))
-
1259 {
-
1260 mPID = GetCurrentProcessId();
-
1261 EnumWindows(FindMainWindow, (LPARAM) this);
-
1262 }
-
1263 }
-
1264 return mMainWnd;
-
1265}
-
1266
-
1267IRECT IGraphicsWin::GetWindowRECT()
-
1268{
-
1269 if (mPlugWnd)
-
1270 {
-
1271 RECT r;
-
1272 GetWindowRect(mPlugWnd, &r);
-
1273 r.right -= TOOLWIN_BORDER_W;
-
1274 r.bottom -= TOOLWIN_BORDER_H;
-
1275 return IRECT(r.left, r.top, r.right, r.bottom);
-
1276 }
-
1277 return IRECT();
-
1278}
-
1279
-
1280void IGraphicsWin::CloseWindow()
-
1281{
-
1282 if (mPlugWnd)
-
1283 {
-
1284 if (mVSYNCEnabled)
-
1285 StopVBlankThread();
-
1286 else
-
1287 KillTimer(mPlugWnd, IPLUG_TIMER_ID);
-
1288
-
1289#ifdef IGRAPHICS_GL
-
1290 ActivateGLContext();
-
1291#endif
-
1292
-
1293 OnViewDestroyed();
-
1294
-
1295#ifdef IGRAPHICS_GL
-
1296 DeactivateGLContext();
-
1297 DestroyGLContext();
-
1298#endif
-
1299
-
1300 SetPlatformContext(nullptr);
-
1301
-
1302 if (mTooltipWnd)
-
1303 {
-
1304 DestroyWindow(mTooltipWnd);
-
1305 mTooltipWnd = 0;
-
1306 mShowingTooltip = false;
-
1307 mTooltipIdx = -1;
-
1308 }
-
1309
-
1310 DestroyWindow(mPlugWnd);
-
1311 mPlugWnd = 0;
-
1312
-
1313 if (--nWndClassReg == 0)
-
1314 {
-
1315 UnregisterClassW(wndClassName, mHInstance);
-
1316 }
-
1317 }
-
1318}
-
1319
-
1320bool IGraphicsWin::PlatformSupportsMultiTouch() const
-
1321{
-
1322 return GetSystemMetrics(SM_DIGITIZER) & NID_MULTI_INPUT;
-
1323}
-
1324
-
1325IPopupMenu* IGraphicsWin::GetItemMenu(long idx, long& idxInMenu, long& offsetIdx, IPopupMenu& baseMenu)
-
1326{
-
1327 long oldIDx = offsetIdx;
-
1328 offsetIdx += baseMenu.NItems();
-
1329
-
1330 if (idx < offsetIdx)
-
1331 {
-
1332 idxInMenu = idx - oldIDx;
-
1333 return &baseMenu;
-
1334 }
-
1335
-
1336 IPopupMenu* pMenu = nullptr;
-
1337
-
1338 for (int i = 0; i< baseMenu.NItems(); i++)
-
1339 {
-
1340 IPopupMenu::Item* pMenuItem = baseMenu.GetItem(i);
-
1341 if (pMenuItem->GetSubmenu())
-
1342 {
-
1343 pMenu = GetItemMenu(idx, idxInMenu, offsetIdx, *pMenuItem->GetSubmenu());
-
1344
-
1345 if (pMenu)
-
1346 break;
-
1347 }
-
1348 }
-
1349
-
1350 return pMenu;
-
1351}
-
1352
-
1353HMENU IGraphicsWin::CreateMenu(IPopupMenu& menu, long* pOffsetIdx)
-
1354{
-
1355 HMENU hMenu = ::CreatePopupMenu();
-
1356
-
1357 WDL_String escapedText;
-
1358
-
1359 int flags = 0;
-
1360 long offset = *pOffsetIdx;
-
1361 long nItems = menu.NItems();
-
1362 *pOffsetIdx += nItems;
-
1363 long inc = 0;
-
1364
-
1365 for (int i = 0; i < nItems; i++)
-
1366 {
-
1367 IPopupMenu::Item* pMenuItem = menu.GetItem(i);
-
1368
-
1369 if (pMenuItem->GetIsSeparator())
-
1370 {
-
1371 AppendMenuW(hMenu, MF_SEPARATOR, 0, 0);
-
1372 }
-
1373 else
-
1374 {
-
1375 const char* str = pMenuItem->GetText();
-
1376 int maxlen = strlen(str) + menu.GetPrefix() ? 50 : 0;
-
1377 WDL_String entryText(str);
-
1378
-
1379 if (menu.GetPrefix())
-
1380 {
-
1381 switch (menu.GetPrefix())
-
1382 {
-
1383 case 1:
-
1384 {
-
1385 entryText.SetFormatted(maxlen, "%1d: %s", i+1, str); break;
-
1386 }
-
1387 case 2:
-
1388 {
-
1389 entryText.SetFormatted(maxlen, "%02d: %s", i+1, str); break;
-
1390 }
-
1391 case 3:
-
1392 {
-
1393 entryText.SetFormatted(maxlen, "%03d: %s", i+1, str); break;
-
1394 }
-
1395 }
-
1396 }
-
1397
-
1398 // Escape ampersands if present
-
1399
-
1400 if (strchr(entryText.Get(), '&'))
-
1401 {
-
1402 for (int c = 0; c < entryText.GetLength(); c++)
-
1403 if (entryText.Get()[c] == '&')
-
1404 entryText.Insert("&", c++);
-
1405 }
-
1406
-
1407 flags = MF_STRING;
-
1408 if (nItems < 160 && menu.NItemsPerColumn() > 0 && inc && !(inc % menu.NItemsPerColumn()))
-
1409 flags |= MF_MENUBARBREAK;
-
1410
-
1411 if (pMenuItem->GetEnabled())
-
1412 flags |= MF_ENABLED;
-
1413 else
-
1414 flags |= MF_GRAYED;
-
1415 if (pMenuItem->GetIsTitle())
-
1416 flags |= MF_DISABLED;
-
1417 if (pMenuItem->GetChecked())
-
1418 flags |= MF_CHECKED;
-
1419 else
-
1420 flags |= MF_UNCHECKED;
-
1421
-
1422 if (pMenuItem->GetSubmenu())
-
1423 {
-
1424 HMENU submenu = CreateMenu(*pMenuItem->GetSubmenu(), pOffsetIdx);
-
1425 if (submenu)
-
1426 {
-
1427 AppendMenuW(hMenu, flags|MF_POPUP, (UINT_PTR)submenu, UTF8AsUTF16(entryText).Get());
-
1428 }
-
1429 }
-
1430 else
-
1431 {
-
1432 AppendMenuW(hMenu, flags, offset + inc, UTF8AsUTF16(entryText).Get());
-
1433 }
-
1434 }
-
1435 inc++;
-
1436 }
-
1437
-
1438 return hMenu;
-
1439}
-
1440
-
1441IPopupMenu* IGraphicsWin::CreatePlatformPopupMenu(IPopupMenu& menu, const IRECT bounds, bool& isAsync)
-
1442{
-
1443 long offsetIdx = 0;
-
1444 HMENU hMenu = CreateMenu(menu, &offsetIdx);
-
1445
-
1446 if (hMenu)
-
1447 {
-
1448 IPopupMenu* result = nullptr;
-
1449
-
1450 POINT cPos;
-
1451 const float scale = GetTotalScale();
-
1452
-
1453 cPos.x = bounds.L * scale;
-
1454 cPos.y = bounds.B * scale;
-
1455
-
1456 ::ClientToScreen(mPlugWnd, &cPos);
-
1457
-
1458 if (TrackPopupMenu(hMenu, TPM_LEFTALIGN, cPos.x, cPos.y, 0, mPlugWnd, 0))
-
1459 {
-
1460 MSG msg;
-
1461 if (PeekMessage(&msg, mPlugWnd, WM_COMMAND, WM_COMMAND, PM_REMOVE))
-
1462 {
-
1463 if (HIWORD(msg.wParam) == 0)
-
1464 {
-
1465 long res = LOWORD(msg.wParam);
-
1466 if (res != -1)
-
1467 {
-
1468 long idx = 0;
-
1469 offsetIdx = 0;
-
1470 IPopupMenu* pReturnMenu = GetItemMenu(res, idx, offsetIdx, menu);
-
1471 if (pReturnMenu)
-
1472 {
-
1473 result = pReturnMenu;
-
1474 result->SetChosenItemIdx(idx);
-
1475
-
1476 //synchronous
-
1477 if (pReturnMenu && pReturnMenu->GetFunction())
-
1478 pReturnMenu->ExecFunction();
-
1479 }
-
1480 }
-
1481 }
-
1482 }
-
1483 }
-
1484 DestroyMenu(hMenu);
-
1485
-
1486 RECT r = { 0, 0, static_cast<LONG>(WindowWidth() * GetScreenScale()), static_cast<LONG>(WindowHeight() * GetScreenScale()) };
-
1487 InvalidateRect(mPlugWnd, &r, FALSE);
-
1488
-
1489 return result;
-
1490 }
-
1491
-
1492 return nullptr;
-
1493}
-
1494
-
1495void IGraphicsWin::CreatePlatformTextEntry(int paramIdx, const IText& text, const IRECT& bounds, int length, const char* str)
-
1496{
-
1497 if (mParamEditWnd)
-
1498 return;
-
1499
-
1500 DWORD editStyle;
-
1501
-
1502 switch (text.mAlign)
-
1503 {
-
1504 case EAlign::Near: editStyle = ES_LEFT; break;
-
1505 case EAlign::Far: editStyle = ES_RIGHT; break;
-
1506 case EAlign::Center:
-
1507 default: editStyle = ES_CENTER; break;
-
1508 }
-
1509
-
1510 const float scale = GetTotalScale();
-
1511 IRECT scaledBounds = bounds.GetScaled(scale);
-
1512
-
1513 mParamEditWnd = CreateWindowW(L"EDIT", UTF8AsUTF16(str).Get(), ES_AUTOHSCROLL /*only works for left aligned text*/ | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE | ES_MULTILINE | editStyle,
-
1514 scaledBounds.L, scaledBounds.T, scaledBounds.W()+1, scaledBounds.H()+1,
-
1515 mPlugWnd, (HMENU) PARAM_EDIT_ID, mHInstance, 0);
-
1516
-
1517 StaticStorage<HFontHolder>::Accessor hfontStorage(sHFontCache);
-
1518
-
1519 LOGFONTW lFont = { 0 };
-
1520 HFontHolder* hfontHolder = hfontStorage.Find(text.mFont);
-
1521 GetObjectW(hfontHolder->mHFont, sizeof(LOGFONTW), &lFont);
-
1522 lFont.lfHeight = text.mSize * scale;
-
1523 mEditFont = CreateFontIndirectW(&lFont);
-
1524
-
1525 assert(hfontHolder && "font not found - did you forget to load it?");
-
1526
-
1527 mEditParam = paramIdx > kNoParameter ? GetDelegate()->GetParam(paramIdx) : nullptr;
-
1528 mEditText = text;
-
1529 mEditRECT = bounds;
-
1530
-
1531 SendMessageW(mParamEditWnd, EM_LIMITTEXT, (WPARAM) length, 0);
-
1532 SendMessageW(mParamEditWnd, WM_SETFONT, (WPARAM) mEditFont, 0);
-
1533 SendMessageW(mParamEditWnd, EM_SETSEL, 0, -1);
-
1534
-
1535 if (text.mVAlign == EVAlign::Middle)
-
1536 {
-
1537 double size = text.mSize * scale;
-
1538 double offset = (scaledBounds.H() - size) / 2.0;
-
1539 RECT formatRect{0, (LONG) offset, (LONG) scaledBounds.W() + 1, (LONG) scaledBounds.H() + 1};
-
1540 SendMessageW(mParamEditWnd, EM_SETRECT, 0, (LPARAM) &formatRect);
-
1541 }
-
1542
-
1543 SetFocus(mParamEditWnd);
-
1544
-
1545 mDefEditProc = (WNDPROC) SetWindowLongPtrW(mParamEditWnd, GWLP_WNDPROC, (LONG_PTR) ParamEditProc);
-
1546 SetWindowLongPtrW(mParamEditWnd, GWLP_USERDATA, 0xdeadf00b);
-
1547}
-
1548
-
1549bool IGraphicsWin::RevealPathInExplorerOrFinder(WDL_String& path, bool select)
-
1550{
-
1551 bool success = false;
-
1552
-
1553 if (path.GetLength())
-
1554 {
-
1555 WCHAR winDir[IPLUG_WIN_MAX_WIDE_PATH];
-
1556 UINT len = GetSystemDirectoryW(winDir, IPLUG_WIN_MAX_WIDE_PATH);
-
1557
-
1558 if (len && !(len > MAX_PATH - 2))
-
1559 {
-
1560 winDir[len] = L'\\';
-
1561 winDir[++len] = L'\0';
-
1562
-
1563 WDL_String explorerParams;
-
1564
-
1565 if (select)
-
1566 explorerParams.Append("/select,");
-
1567
-
1568 explorerParams.Append("\"");
-
1569 explorerParams.Append(path.Get());
-
1570 explorerParams.Append("\\\"");
-
1571
-
1572 HINSTANCE result;
-
1573
-
1574 if ((result=::ShellExecuteW(NULL, L"open", L"explorer.exe", UTF8AsUTF16(explorerParams).Get(), winDir, SW_SHOWNORMAL)) <= (HINSTANCE) 32)
-
1575 success = true;
-
1576 }
-
1577 }
-
1578
-
1579 return success;
-
1580}
-
1581
-
1582void IGraphicsWin::PromptForFile(WDL_String& fileName, WDL_String& path, EFileAction action, const char* ext, IFileDialogCompletionHandlerFunc completionHandler)
-
1583{
-
1584 if (!WindowIsOpen())
-
1585 {
-
1586 fileName.Set("");
-
1587 return;
-
1588 }
-
1589
-
1590 wchar_t fileNameWide[_MAX_PATH];
-
1591
-
1592 UTF8ToUTF16(fileNameWide, fileName.Get(), _MAX_PATH);
-
1593
-
1594 //if (!path.GetLength())
-
1595 // DesktopPath(path);
-
1596
-
1597 UTF8AsUTF16 directoryWide(path);
-
1598
-
1599 OPENFILENAMEW ofn;
-
1600 memset(&ofn, 0, sizeof(OPENFILENAMEW));
-
1601
-
1602 ofn.lStructSize = sizeof(OPENFILENAMEW);
-
1603 ofn.hwndOwner = (HWND) GetWindow();
-
1604 ofn.lpstrFile = fileNameWide;
-
1605 ofn.nMaxFile = _MAX_PATH - 1;
-
1606 ofn.lpstrInitialDir = directoryWide.Get();
-
1607 ofn.Flags = OFN_PATHMUSTEXIST;
-
1608
-
1609 if (CStringHasContents(ext))
-
1610 {
-
1611 wchar_t extStr[256];
-
1612 wchar_t defExtStr[16];
-
1613 int i, p, n = strlen(ext);
-
1614 bool separator = true;
-
1615
-
1616 for (i = 0, p = 0; i < n; ++i)
-
1617 {
-
1618 if (separator)
-
1619 {
-
1620 if (p)
-
1621 extStr[p++] = ';';
-
1622
-
1623 separator = false;
-
1624 extStr[p++] = '*';
-
1625 extStr[p++] = '.';
-
1626 }
-
1627
-
1628 if (ext[i] == ' ')
-
1629 separator = true;
-
1630 else
-
1631 extStr[p++] = ext[i];
-
1632 }
-
1633 extStr[p++] = '\0';
-
1634
-
1635 wcscpy(&extStr[p], extStr);
-
1636 extStr[p + p] = '\0';
-
1637 ofn.lpstrFilter = extStr;
-
1638
-
1639 for (i = 0, p = 0; i < n && ext[i] != ' '; ++i)
-
1640 defExtStr[p++] = ext[i];
-
1641
-
1642 defExtStr[p++] = '\0';
-
1643 ofn.lpstrDefExt = defExtStr;
-
1644 }
-
1645
-
1646 bool rc = false;
-
1647
-
1648 switch (action)
-
1649 {
-
1650 case EFileAction::Save:
-
1651 ofn.Flags |= OFN_OVERWRITEPROMPT;
-
1652 rc = GetSaveFileNameW(&ofn);
-
1653 break;
-
1654 case EFileAction::Open:
-
1655 default:
-
1656 ofn.Flags |= OFN_FILEMUSTEXIST;
-
1657 rc = GetOpenFileNameW(&ofn);
-
1658 break;
-
1659 }
-
1660
-
1661 if (rc)
-
1662 {
-
1663 char drive[_MAX_DRIVE];
-
1664 char directoryOutCStr[_MAX_PATH];
-
1665
-
1666 UTF16AsUTF8 tempUTF8(ofn.lpstrFile);
-
1667
-
1668 if (_splitpath_s(tempUTF8.Get(), drive, sizeof(drive), directoryOutCStr, sizeof(directoryOutCStr), NULL, 0, NULL, 0) == 0)
-
1669 {
-
1670 path.Set(drive);
-
1671 path.Append(directoryOutCStr);
-
1672 }
-
1673
-
1674 fileName.Set(tempUTF8.Get());
-
1675 }
-
1676 else
-
1677 {
-
1678 fileName.Set("");
-
1679 }
-
1680
-
1681 // Async is not required on windows, but call the completion handler anyway
-
1682 if (completionHandler)
-
1683 {
-
1684 completionHandler(fileName, path);
-
1685 }
-
1686
-
1687 ReleaseMouseCapture();
-
1688}
-
1689
-
1690void IGraphicsWin::PromptForDirectory(WDL_String& dir, IFileDialogCompletionHandlerFunc completionHandler)
-
1691{
-
1692 BROWSEINFOW bi;
-
1693 memset(&bi, 0, sizeof(bi));
-
1694
-
1695 bi.ulFlags = BIF_USENEWUI;
-
1696 bi.hwndOwner = mPlugWnd;
-
1697 bi.lpszTitle = L"Choose a Directory";
-
1698
-
1699 // must call this if using BIF_USENEWUI
-
1700 ::OleInitialize(NULL);
-
1701 LPITEMIDLIST pIDL = ::SHBrowseForFolderW(&bi);
-
1702
-
1703 if (pIDL != NULL)
-
1704 {
-
1705 wchar_t buffer[_MAX_PATH] = {'\0'};
-
1706
-
1707 if (::SHGetPathFromIDListW(pIDL, buffer) != 0)
-
1708 {
-
1709 dir.Set(UTF16AsUTF8(buffer).Get());
-
1710 dir.Append("\\");
-
1711 }
-
1712
-
1713 // free the item id list
-
1714 CoTaskMemFree(pIDL);
-
1715 }
-
1716 else
-
1717 {
-
1718 dir.Set("");
-
1719 }
-
1720
-
1721 if (completionHandler)
-
1722 {
-
1723 WDL_String fileName; // not used
-
1724 completionHandler(fileName, dir);
-
1725 }
-
1726
-
1727 ReleaseMouseCapture();
-
1728
-
1729 ::OleUninitialize();
-
1730}
-
1731
-
1732static UINT_PTR CALLBACK CCHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
-
1733{
-
1734 if (uiMsg == WM_INITDIALOG && lParam)
-
1735 {
-
1736 CHOOSECOLORW* cc = (CHOOSECOLORW*) lParam;
-
1737 if (cc && cc->lCustData)
-
1738 {
-
1739 const wchar_t* strWide = (const wchar_t*) cc->lCustData;
-
1740 SetWindowTextW(hdlg, strWide);
-
1741 UINT uiSetRGB;
-
1742 uiSetRGB = RegisterWindowMessageW(SETRGBSTRINGW);
-
1743 SendMessageW(hdlg, uiSetRGB, 0, (LPARAM) cc->rgbResult);
-
1744 }
-
1745 }
-
1746 return 0;
-
1747}
-
1748
-
1749bool IGraphicsWin::PromptForColor(IColor& color, const char* prompt, IColorPickerHandlerFunc func)
-
1750{
-
1751 ReleaseMouseCapture();
-
1752
-
1753 if (!mPlugWnd)
-
1754 return false;
-
1755
-
1756 UTF8AsUTF16 promptWide(prompt);
-
1757
-
1758 const COLORREF w = RGB(255, 255, 255);
-
1759 static COLORREF customColorStorage[16] = { w, w, w, w, w, w, w, w, w, w, w, w, w, w, w, w };
-
1760
-
1761 CHOOSECOLORW cc;
-
1762 memset(&cc, 0, sizeof(CHOOSECOLORW));
-
1763 cc.lStructSize = sizeof(CHOOSECOLORW);
-
1764 cc.hwndOwner = mPlugWnd;
-
1765 cc.rgbResult = RGB(color.R, color.G, color.B);
-
1766 cc.lpCustColors = customColorStorage;
-
1767 cc.lCustData = (LPARAM) promptWide.Get();
-
1768 cc.lpfnHook = CCHookProc;
-
1769 cc.Flags = CC_RGBINIT | CC_ANYCOLOR | CC_FULLOPEN | CC_SOLIDCOLOR | CC_ENABLEHOOK;
-
1770
-
1771 if (ChooseColorW(&cc))
-
1772 {
-
1773 color.R = GetRValue(cc.rgbResult);
-
1774 color.G = GetGValue(cc.rgbResult);
-
1775 color.B = GetBValue(cc.rgbResult);
-
1776
-
1777 if (func)
-
1778 func(color);
-
1779
-
1780 return true;
-
1781 }
-
1782 return false;
-
1783}
-
1784
-
1785bool IGraphicsWin::OpenURL(const char* url, const char* msgWindowTitle, const char* confirmMsg, const char* errMsgOnFailure)
-
1786{
-
1787 if (confirmMsg && MessageBoxW(mPlugWnd, UTF8AsUTF16(confirmMsg).Get(), UTF8AsUTF16(msgWindowTitle).Get(), MB_YESNO) != IDYES)
-
1788 {
-
1789 return false;
-
1790 }
-
1791 DWORD inetStatus = 0;
-
1792 if (InternetGetConnectedState(&inetStatus, 0))
-
1793 {
-
1794 if (ShellExecuteW(mPlugWnd, L"open", UTF8AsUTF16(url).Get(), 0, 0, SW_SHOWNORMAL) > HINSTANCE(32))
-
1795 {
-
1796 return true;
-
1797 }
-
1798 }
-
1799 if (errMsgOnFailure)
-
1800 {
-
1801 MessageBoxW(mPlugWnd, UTF8AsUTF16(errMsgOnFailure).Get(), UTF8AsUTF16(msgWindowTitle).Get(), MB_OK);
-
1802 }
-
1803 return false;
-
1804}
-
1805
-
1806void IGraphicsWin::SetTooltip(const char* tooltip)
-
1807{
-
1808 UTF8AsUTF16 tipWide(tooltip);
-
1809 TOOLINFOW ti = { TTTOOLINFOW_V2_SIZE, 0, mPlugWnd, (UINT_PTR) mPlugWnd, {0, 0, 0, 0}, NULL, NULL, 0, NULL };
-
1810 ti.lpszText = const_cast<wchar_t*>(tipWide.Get());
-
1811 SendMessageW(mTooltipWnd, TTM_UPDATETIPTEXTW, 0, (LPARAM) &ti);
-
1812}
-
1813
-
1814void IGraphicsWin::ShowTooltip()
-
1815{
-
1816 if (mTooltipIdx > -1)
-
1817 {
-
1818 const char* tooltip = GetControl(mTooltipIdx)->GetTooltip();
-
1819 if (tooltip)
-
1820 {
-
1821 SetTooltip(tooltip);
-
1822 mShowingTooltip = true;
-
1823 }
-
1824 }
-
1825}
-
1826
-
1827void IGraphicsWin::HideTooltip()
-
1828{
-
1829 if (mShowingTooltip)
-
1830 {
-
1831 SetTooltip(NULL);
-
1832 mShowingTooltip = false;
-
1833 }
-
1834}
-
1835
-
1836bool IGraphicsWin::GetTextFromClipboard(WDL_String& str)
-
1837{
-
1838 bool result = false;
-
1839
-
1840 if (IsClipboardFormatAvailable(CF_UNICODETEXT))
-
1841 {
-
1842 if (OpenClipboard(0))
-
1843 {
-
1844 HGLOBAL hglb = GetClipboardData(CF_UNICODETEXT);
-
1845
-
1846 if (hglb)
-
1847 {
-
1848 WCHAR *origStr = (WCHAR*) GlobalLock(hglb);
-
1849
-
1850 if (origStr)
-
1851 {
-
1852 UTF16ToUTF8(str, origStr);
-
1853 GlobalUnlock(hglb);
-
1854 result = true;
-
1855 }
-
1856 }
-
1857 }
-
1858
-
1859 CloseClipboard();
-
1860 }
-
1861
-
1862 if (!result)
-
1863 str.Set("");
-
1864
-
1865 return result;
-
1866}
-
1867
-
1868bool IGraphicsWin::SetTextInClipboard(const char* str)
-
1869{
-
1870 if (!OpenClipboard(mMainWnd))
-
1871 return false;
-
1872
-
1873 EmptyClipboard();
-
1874
-
1875 bool result = true;
-
1876
-
1877 if (strlen(str))
-
1878 {
-
1879 // figure out how many characters we need for the wide version of this string
-
1880 const int lenWide = UTF8ToUTF16Len(str);
-
1881
-
1882 // allocate global memory object for the text
-
1883 HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, lenWide*sizeof(WCHAR));
-
1884 if (!hglbCopy)
-
1885 {
-
1886 CloseClipboard();
-
1887 return false;
-
1888 }
-
1889
-
1890 // lock the handle
-
1891 LPWSTR lpstrCopy = (LPWSTR) GlobalLock(hglbCopy);
-
1892
-
1893 if (lpstrCopy)
-
1894 {
-
1895 // copy the string into the buffer
-
1896 UTF8ToUTF16(lpstrCopy, str, lenWide);
-
1897 GlobalUnlock(hglbCopy);
-
1898
-
1899 // place the handle on the clipboard
-
1900 result = SetClipboardData(CF_UNICODETEXT, hglbCopy);
-
1901
-
1902 // free the handle if unsuccessful
-
1903 if (!result)
-
1904 GlobalFree(hglbCopy);
-
1905 }
-
1906 }
-
1907
-
1908 CloseClipboard();
-
1909
-
1910 return result;
-
1911}
-
1912
-
1913bool IGraphicsWin::SetFilePathInClipboard(const char* path)
-
1914{
-
1915 if (!OpenClipboard(mMainWnd))
-
1916 return false;
-
1917
-
1918 EmptyClipboard();
-
1919
-
1920 UTF8AsUTF16 pathWide(path);
-
1921
-
1922 // N.B. GHND ensures that the memory is zeroed
-
1923
-
1924 HGLOBAL hGlobal = GlobalAlloc(GHND, sizeof(DROPFILES) + (sizeof(wchar_t) * (pathWide.GetLength() + 1)));
-
1925
-
1926 if (!hGlobal)
-
1927 return false;
-
1928
-
1929 DROPFILES* pDropFiles = (DROPFILES*) GlobalLock(hGlobal);
-
1930 bool result = false;
-
1931
-
1932 if (pDropFiles)
-
1933 {
-
1934 // Populate the dropfile structure and copy the file path
-
1935
-
1936 pDropFiles->pFiles = sizeof(DROPFILES);
-
1937 pDropFiles->pt = { 0, 0 };
-
1938 pDropFiles->fNC = true;
-
1939 pDropFiles->fWide = true;
-
1940
-
1941 std::copy_n(pathWide.Get(), pathWide.GetLength(), reinterpret_cast<wchar_t*>(&pDropFiles[1]));
-
1942
-
1943 GlobalUnlock(hGlobal);
-
1944
-
1945 result = SetClipboardData(CF_HDROP, hGlobal);
-
1946 }
-
1947
-
1948 // free the handle if unsuccessful
-
1949 if (!result)
-
1950 GlobalFree(hGlobal);
-
1951
-
1952 CloseClipboard();
-
1953 return result;
-
1954}
-
1955
-
1956static HFONT GetHFont(const char* fontName, int weight, bool italic, bool underline, DWORD quality = DEFAULT_QUALITY, bool enumerate = false)
-
1957{
-
1958 HDC hdc = GetDC(NULL);
-
1959 HFONT font = nullptr;
-
1960 LOGFONTW lFont;
-
1961
-
1962 lFont.lfHeight = 0;
-
1963 lFont.lfWidth = 0;
-
1964 lFont.lfEscapement = 0;
-
1965 lFont.lfOrientation = 0;
-
1966 lFont.lfWeight = weight;
-
1967 lFont.lfItalic = italic;
-
1968 lFont.lfUnderline = underline;
-
1969 lFont.lfStrikeOut = false;
-
1970 lFont.lfCharSet = DEFAULT_CHARSET;
-
1971 lFont.lfOutPrecision = OUT_TT_PRECIS;
-
1972 lFont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
-
1973 lFont.lfQuality = quality;
-
1974 lFont.lfPitchAndFamily = DEFAULT_PITCH;
-
1975
-
1976 wcsncpy(lFont.lfFaceName, UTF8AsUTF16(fontName).Get(), LF_FACESIZE);
+
1055 0,
+
1056 0, 0, 0, 0,
+
1057 24, // Number of bits for the depthbuffer
+
1058 8, // Number of bits for the stencilbuffer
+
1059 0, // Number of Aux buffers in the framebuffer.
+
1060 PFD_MAIN_PLANE,
+
1061 0,
+
1062 0, 0, 0
+
1063 };
+
1064
+
1065 HDC dc = GetDC(mPlugWnd);
+
1066 int fmt = ChoosePixelFormat(dc, &pfd);
+
1067 SetPixelFormat(dc, fmt, &pfd);
+
1068 mHGLRC = wglCreateContext(dc);
+
1069 wglMakeCurrent(dc, mHGLRC);
+
1070
+
1071#ifdef IGRAPHICS_GL3
+
1072 // On windows we can't create a 3.3 context directly, since we need the wglCreateContextAttribsARB extension.
+
1073 // We load the extension, then re-create the context.
+
1074 auto wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC) wglGetProcAddress("wglCreateContextAttribsARB");
+
1075
+
1076 if (wglCreateContextAttribsARB)
+
1077 {
+
1078 wglDeleteContext(mHGLRC);
+
1079
+
1080 const int attribList[] = {
+
1081 WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
+
1082 WGL_CONTEXT_MINOR_VERSION_ARB, 3,
+
1083 WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
+
1084 0
+
1085 };
+
1086
+
1087 mHGLRC = wglCreateContextAttribsARB(dc, 0, attribList);
+
1088 wglMakeCurrent(dc, mHGLRC);
+
1089 }
+
1090
+
1091#endif
+
1092
+
1093 //TODO: return false if GL init fails?
+
1094 if (!gladLoadGL())
+
1095 DBGMSG("Error initializing glad");
+
1096
+
1097 glGetError();
+
1098
+
1099 ReleaseDC(mPlugWnd, dc);
+
1100}
+
1101
+
1102void IGraphicsWin::DestroyGLContext()
+
1103{
+
1104 wglMakeCurrent(NULL, NULL);
+
1105 wglDeleteContext(mHGLRC);
+
1106}
+
1107
+
1108void IGraphicsWin::ActivateGLContext()
+
1109{
+
1110 mStartHDC = wglGetCurrentDC();
+
1111 mStartHGLRC = wglGetCurrentContext();
+
1112 HDC dc = GetDC(mPlugWnd);
+
1113 wglMakeCurrent(dc, mHGLRC);
+
1114}
+
1115
+
1116void IGraphicsWin::DeactivateGLContext()
+
1117{
+
1118 ReleaseDC(mPlugWnd, (HDC) GetPlatformContext());
+
1119 wglMakeCurrent(mStartHDC, mStartHGLRC); // return current ctxt to start
+
1120}
+
1121#endif
+
1122
+
1123EMsgBoxResult IGraphicsWin::ShowMessageBox(const char* text, const char* caption, EMsgBoxType type, IMsgBoxCompletionHandlerFunc completionHandler)
+
1124{
+
1125 ReleaseMouseCapture();
+
1126
+
1127 EMsgBoxResult result = static_cast<EMsgBoxResult>(MessageBoxW(GetMainWnd(), UTF8AsUTF16(text).Get(), UTF8AsUTF16(caption).Get(), static_cast<int>(type)));
+
1128
+
1129 if (completionHandler)
+
1130 completionHandler(result);
+
1131
+
1132 return result;
+
1133}
+
1134
+
1135void* IGraphicsWin::OpenWindow(void* pParent)
+
1136{
+
1137 mParentWnd = (HWND) pParent;
+
1138 int screenScale = GetScaleForHWND(mParentWnd);
+
1139 int x = 0, y = 0, w = WindowWidth() * screenScale, h = WindowHeight() * screenScale;
+
1140
+
1141 if (mPlugWnd)
+
1142 {
+
1143 RECT pR, cR;
+
1144 GetWindowRect((HWND) pParent, &pR);
+
1145 GetWindowRect(mPlugWnd, &cR);
+
1146 CloseWindow();
+
1147 x = cR.left - pR.left;
+
1148 y = cR.top - pR.top;
+
1149 w = cR.right - cR.left;
+
1150 h = cR.bottom - cR.top;
+
1151 }
+
1152
+
1153 if (nWndClassReg++ == 0)
+
1154 {
+
1155 WNDCLASSW wndClass = { CS_DBLCLKS | CS_OWNDC, WndProc, 0, 0, mHInstance, 0, 0, 0, 0, wndClassName };
+
1156 RegisterClassW(&wndClass);
+
1157 }
+
1158
+
1159 mPlugWnd = CreateWindowW(wndClassName, L"IPlug", WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, x, y, w, h, mParentWnd, 0, mHInstance, this);
+
1160
+
1161 HDC dc = GetDC(mPlugWnd);
+
1162 SetPlatformContext(dc);
+
1163 ReleaseDC(mPlugWnd, dc);
+
1164
+
1165#ifdef IGRAPHICS_GL
+
1166 CreateGLContext();
+
1167#endif
+
1168
+
1169 OnViewInitialized((void*) dc);
+
1170
+
1171 SetScreenScale(screenScale); // resizes draw context
+
1172
+
1173 GetDelegate()->LayoutUI(this);
+
1174
+
1175 if (MultiTouchEnabled() && GetSystemMetrics(SM_DIGITIZER) & NID_MULTI_INPUT)
+
1176 {
+
1177 RegisterTouchWindow(mPlugWnd, 0);
+
1178 }
+
1179
+
1180 if (!mPlugWnd && --nWndClassReg == 0)
+
1181 {
+
1182 UnregisterClassW(wndClassName, mHInstance);
+
1183 }
+
1184 else
+
1185 {
+
1186 SetAllControlsDirty();
+
1187 }
+
1188
+
1189 if (mPlugWnd && TooltipsEnabled())
+
1190 {
+
1191 static const INITCOMMONCONTROLSEX iccex = { sizeof(INITCOMMONCONTROLSEX), ICC_TAB_CLASSES };
+
1192
+
1193 if (InitCommonControlsEx(&iccex))
+
1194 {
+
1195 mTooltipWnd = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | TTS_NOPREFIX | TTS_ALWAYSTIP,
+
1196 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, mPlugWnd, NULL, mHInstance, NULL);
+
1197 if (mTooltipWnd)
+
1198 {
+
1199 SetWindowPos(mTooltipWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+
1200 TOOLINFOW ti = { TTTOOLINFOW_V2_SIZE, TTF_IDISHWND | TTF_SUBCLASS, mPlugWnd, (UINT_PTR) mPlugWnd, {0, 0, 0, 0}, NULL, NULL, 0, NULL };
+
1201 SendMessageW(mTooltipWnd, TTM_ADDTOOLW, 0, (LPARAM) &ti);
+
1202 SendMessageW(mTooltipWnd, TTM_SETMAXTIPWIDTH, 0, TOOLTIPWND_MAXWIDTH);
+
1203 }
+
1204 }
+
1205
+
1206 if (!mTooltipWnd)
+
1207 EnableTooltips(false);
+
1208
+
1209#ifdef IGRAPHICS_GL
+
1210 wglMakeCurrent(NULL, NULL);
+
1211#endif
+
1212 }
+
1213
+
1214 GetDelegate()->OnUIOpen();
+
1215
+
1216 return mPlugWnd;
+
1217}
+
1218
+
1219static void GetWndClassName(HWND hWnd, WDL_String* pStr)
+
1220{
+
1221 wchar_t cStrW[MAX_CLASSNAME_LEN] = {'\0'};
+
1222 GetClassNameW(hWnd, cStrW, MAX_CLASSNAME_LEN);
+
1223 pStr->Set(UTF16AsUTF8(cStrW).Get());
+
1224}
+
1225
+
1226BOOL CALLBACK IGraphicsWin::FindMainWindow(HWND hWnd, LPARAM lParam)
+
1227{
+
1228 IGraphicsWin* pGraphics = (IGraphicsWin*) lParam;
+
1229 if (pGraphics)
+
1230 {
+
1231 DWORD wPID;
+
1232 GetWindowThreadProcessId(hWnd, &wPID);
+
1233 WDL_String str;
+
1234 GetWndClassName(hWnd, &str);
+
1235 if (wPID == pGraphics->mPID && !strcmp(str.Get(), pGraphics->mMainWndClassName.Get()))
+
1236 {
+
1237 pGraphics->mMainWnd = hWnd;
+
1238 return FALSE; // Stop enumerating.
+
1239 }
+
1240 }
+
1241 return TRUE;
+
1242}
+
1243
+
1244HWND IGraphicsWin::GetMainWnd()
+
1245{
+
1246 if (!mMainWnd)
+
1247 {
+
1248 if (mParentWnd)
+
1249 {
+
1250 HWND parentWnd = mParentWnd;
+
1251 while (parentWnd)
+
1252 {
+
1253 mMainWnd = parentWnd;
+
1254 parentWnd = GetParent(mMainWnd);
+
1255 }
+
1256
+
1257 GetWndClassName(mMainWnd, &mMainWndClassName);
+
1258 }
+
1259 else if (CStringHasContents(mMainWndClassName.Get()))
+
1260 {
+
1261 mPID = GetCurrentProcessId();
+
1262 EnumWindows(FindMainWindow, (LPARAM) this);
+
1263 }
+
1264 }
+
1265 return mMainWnd;
+
1266}
+
1267
+
1268IRECT IGraphicsWin::GetWindowRECT()
+
1269{
+
1270 if (mPlugWnd)
+
1271 {
+
1272 RECT r;
+
1273 GetWindowRect(mPlugWnd, &r);
+
1274 r.right -= TOOLWIN_BORDER_W;
+
1275 r.bottom -= TOOLWIN_BORDER_H;
+
1276 return IRECT(r.left, r.top, r.right, r.bottom);
+
1277 }
+
1278 return IRECT();
+
1279}
+
1280
+
1281void IGraphicsWin::CloseWindow()
+
1282{
+
1283 if (mPlugWnd)
+
1284 {
+
1285 if (mVSYNCEnabled)
+
1286 StopVBlankThread();
+
1287 else
+
1288 KillTimer(mPlugWnd, IPLUG_TIMER_ID);
+
1289
+
1290#ifdef IGRAPHICS_GL
+
1291 ActivateGLContext();
+
1292#endif
+
1293
+
1294 OnViewDestroyed();
+
1295
+
1296#ifdef IGRAPHICS_GL
+
1297 DeactivateGLContext();
+
1298 DestroyGLContext();
+
1299#endif
+
1300
+
1301 SetPlatformContext(nullptr);
+
1302
+
1303 if (mTooltipWnd)
+
1304 {
+
1305 DestroyWindow(mTooltipWnd);
+
1306 mTooltipWnd = 0;
+
1307 mShowingTooltip = false;
+
1308 mTooltipIdx = -1;
+
1309 }
+
1310
+
1311 DestroyWindow(mPlugWnd);
+
1312 mPlugWnd = 0;
+
1313
+
1314 if (--nWndClassReg == 0)
+
1315 {
+
1316 UnregisterClassW(wndClassName, mHInstance);
+
1317 }
+
1318 }
+
1319}
+
1320
+
1321bool IGraphicsWin::PlatformSupportsMultiTouch() const
+
1322{
+
1323 return GetSystemMetrics(SM_DIGITIZER) & NID_MULTI_INPUT;
+
1324}
+
1325
+
1326IPopupMenu* IGraphicsWin::GetItemMenu(long idx, long& idxInMenu, long& offsetIdx, IPopupMenu& baseMenu)
+
1327{
+
1328 long oldIDx = offsetIdx;
+
1329 offsetIdx += baseMenu.NItems();
+
1330
+
1331 if (idx < offsetIdx)
+
1332 {
+
1333 idxInMenu = idx - oldIDx;
+
1334 return &baseMenu;
+
1335 }
+
1336
+
1337 IPopupMenu* pMenu = nullptr;
+
1338
+
1339 for (int i = 0; i< baseMenu.NItems(); i++)
+
1340 {
+
1341 IPopupMenu::Item* pMenuItem = baseMenu.GetItem(i);
+
1342 if (pMenuItem->GetSubmenu())
+
1343 {
+
1344 pMenu = GetItemMenu(idx, idxInMenu, offsetIdx, *pMenuItem->GetSubmenu());
+
1345
+
1346 if (pMenu)
+
1347 break;
+
1348 }
+
1349 }
+
1350
+
1351 return pMenu;
+
1352}
+
1353
+
1354HMENU IGraphicsWin::CreateMenu(IPopupMenu& menu, long* pOffsetIdx)
+
1355{
+
1356 HMENU hMenu = ::CreatePopupMenu();
+
1357
+
1358 WDL_String escapedText;
+
1359
+
1360 int flags = 0;
+
1361 long offset = *pOffsetIdx;
+
1362 long nItems = menu.NItems();
+
1363 *pOffsetIdx += nItems;
+
1364 long inc = 0;
+
1365
+
1366 for (int i = 0; i < nItems; i++)
+
1367 {
+
1368 IPopupMenu::Item* pMenuItem = menu.GetItem(i);
+
1369
+
1370 if (pMenuItem->GetIsSeparator())
+
1371 {
+
1372 AppendMenuW(hMenu, MF_SEPARATOR, 0, 0);
+
1373 }
+
1374 else
+
1375 {
+
1376 const char* str = pMenuItem->GetText();
+
1377 int maxlen = strlen(str) + menu.GetPrefix() ? 50 : 0;
+
1378 WDL_String entryText(str);
+
1379
+
1380 if (menu.GetPrefix())
+
1381 {
+
1382 switch (menu.GetPrefix())
+
1383 {
+
1384 case 1:
+
1385 {
+
1386 entryText.SetFormatted(maxlen, "%1d: %s", i+1, str); break;
+
1387 }
+
1388 case 2:
+
1389 {
+
1390 entryText.SetFormatted(maxlen, "%02d: %s", i+1, str); break;
+
1391 }
+
1392 case 3:
+
1393 {
+
1394 entryText.SetFormatted(maxlen, "%03d: %s", i+1, str); break;
+
1395 }
+
1396 }
+
1397 }
+
1398
+
1399 // Escape ampersands if present
+
1400
+
1401 if (strchr(entryText.Get(), '&'))
+
1402 {
+
1403 for (int c = 0; c < entryText.GetLength(); c++)
+
1404 if (entryText.Get()[c] == '&')
+
1405 entryText.Insert("&", c++);
+
1406 }
+
1407
+
1408 flags = MF_STRING;
+
1409 if (nItems < 160 && menu.NItemsPerColumn() > 0 && inc && !(inc % menu.NItemsPerColumn()))
+
1410 flags |= MF_MENUBARBREAK;
+
1411
+
1412 if (pMenuItem->GetEnabled())
+
1413 flags |= MF_ENABLED;
+
1414 else
+
1415 flags |= MF_GRAYED;
+
1416 if (pMenuItem->GetIsTitle())
+
1417 flags |= MF_DISABLED;
+
1418 if (pMenuItem->GetChecked())
+
1419 flags |= MF_CHECKED;
+
1420 else
+
1421 flags |= MF_UNCHECKED;
+
1422
+
1423 if (pMenuItem->GetSubmenu())
+
1424 {
+
1425 HMENU submenu = CreateMenu(*pMenuItem->GetSubmenu(), pOffsetIdx);
+
1426 if (submenu)
+
1427 {
+
1428 AppendMenuW(hMenu, flags|MF_POPUP, (UINT_PTR)submenu, UTF8AsUTF16(entryText).Get());
+
1429 }
+
1430 }
+
1431 else
+
1432 {
+
1433 AppendMenuW(hMenu, flags, offset + inc, UTF8AsUTF16(entryText).Get());
+
1434 }
+
1435 }
+
1436 inc++;
+
1437 }
+
1438
+
1439 return hMenu;
+
1440}
+
1441
+
1442IPopupMenu* IGraphicsWin::CreatePlatformPopupMenu(IPopupMenu& menu, const IRECT bounds, bool& isAsync)
+
1443{
+
1444 long offsetIdx = 0;
+
1445 HMENU hMenu = CreateMenu(menu, &offsetIdx);
+
1446
+
1447 if (hMenu)
+
1448 {
+
1449 IPopupMenu* result = nullptr;
+
1450
+
1451 POINT cPos;
+
1452 const float scale = GetTotalScale();
+
1453
+
1454 cPos.x = bounds.L * scale;
+
1455 cPos.y = bounds.B * scale;
+
1456
+
1457 ::ClientToScreen(mPlugWnd, &cPos);
+
1458
+
1459 if (TrackPopupMenu(hMenu, TPM_LEFTALIGN, cPos.x, cPos.y, 0, mPlugWnd, 0))
+
1460 {
+
1461 MSG msg;
+
1462 if (PeekMessage(&msg, mPlugWnd, WM_COMMAND, WM_COMMAND, PM_REMOVE))
+
1463 {
+
1464 if (HIWORD(msg.wParam) == 0)
+
1465 {
+
1466 long res = LOWORD(msg.wParam);
+
1467 if (res != -1)
+
1468 {
+
1469 long idx = 0;
+
1470 offsetIdx = 0;
+
1471 IPopupMenu* pReturnMenu = GetItemMenu(res, idx, offsetIdx, menu);
+
1472 if (pReturnMenu)
+
1473 {
+
1474 result = pReturnMenu;
+
1475 result->SetChosenItemIdx(idx);
+
1476
+
1477 //synchronous
+
1478 if (pReturnMenu && pReturnMenu->GetFunction())
+
1479 pReturnMenu->ExecFunction();
+
1480 }
+
1481 }
+
1482 }
+
1483 }
+
1484 }
+
1485 DestroyMenu(hMenu);
+
1486
+
1487 RECT r = { 0, 0, static_cast<LONG>(WindowWidth() * GetScreenScale()), static_cast<LONG>(WindowHeight() * GetScreenScale()) };
+
1488 InvalidateRect(mPlugWnd, &r, FALSE);
+
1489
+
1490 return result;
+
1491 }
+
1492
+
1493 return nullptr;
+
1494}
+
1495
+
1496void IGraphicsWin::CreatePlatformTextEntry(int paramIdx, const IText& text, const IRECT& bounds, int length, const char* str)
+
1497{
+
1498 if (mParamEditWnd)
+
1499 return;
+
1500
+
1501 DWORD editStyle;
+
1502
+
1503 switch (text.mAlign)
+
1504 {
+
1505 case EAlign::Near: editStyle = ES_LEFT; break;
+
1506 case EAlign::Far: editStyle = ES_RIGHT; break;
+
1507 case EAlign::Center:
+
1508 default: editStyle = ES_CENTER; break;
+
1509 }
+
1510
+
1511 const float scale = GetTotalScale();
+
1512 IRECT scaledBounds = bounds.GetScaled(scale);
+
1513
+
1514 mParamEditWnd = CreateWindowW(L"EDIT", UTF8AsUTF16(str).Get(), ES_AUTOHSCROLL /*only works for left aligned text*/ | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE | ES_MULTILINE | editStyle,
+
1515 scaledBounds.L, scaledBounds.T, scaledBounds.W()+1, scaledBounds.H()+1,
+
1516 mPlugWnd, (HMENU) PARAM_EDIT_ID, mHInstance, 0);
+
1517
+
1518 StaticStorage<HFontHolder>::Accessor hfontStorage(sHFontCache);
+
1519
+
1520 LOGFONTW lFont = { 0 };
+
1521 HFontHolder* hfontHolder = hfontStorage.Find(text.mFont);
+
1522 GetObjectW(hfontHolder->mHFont, sizeof(LOGFONTW), &lFont);
+
1523 lFont.lfHeight = text.mSize * scale;
+
1524 mEditFont = CreateFontIndirectW(&lFont);
+
1525
+
1526 assert(hfontHolder && "font not found - did you forget to load it?");
+
1527
+
1528 mEditParam = paramIdx > kNoParameter ? GetDelegate()->GetParam(paramIdx) : nullptr;
+
1529 mEditText = text;
+
1530 mEditRECT = bounds;
+
1531
+
1532 SendMessageW(mParamEditWnd, EM_LIMITTEXT, (WPARAM) length, 0);
+
1533 SendMessageW(mParamEditWnd, WM_SETFONT, (WPARAM) mEditFont, 0);
+
1534 SendMessageW(mParamEditWnd, EM_SETSEL, 0, -1);
+
1535
+
1536 if (text.mVAlign == EVAlign::Middle)
+
1537 {
+
1538 double size = text.mSize * scale;
+
1539 double offset = (scaledBounds.H() - size) / 2.0;
+
1540 RECT formatRect{0, (LONG) offset, (LONG) scaledBounds.W() + 1, (LONG) scaledBounds.H() + 1};
+
1541 SendMessageW(mParamEditWnd, EM_SETRECT, 0, (LPARAM) &formatRect);
+
1542 }
+
1543
+
1544 SetFocus(mParamEditWnd);
+
1545
+
1546 mDefEditProc = (WNDPROC) SetWindowLongPtrW(mParamEditWnd, GWLP_WNDPROC, (LONG_PTR) ParamEditProc);
+
1547 SetWindowLongPtrW(mParamEditWnd, GWLP_USERDATA, 0xdeadf00b);
+
1548}
+
1549
+
1550bool IGraphicsWin::RevealPathInExplorerOrFinder(WDL_String& path, bool select)
+
1551{
+
1552 bool success = false;
+
1553
+
1554 if (path.GetLength())
+
1555 {
+
1556 WCHAR winDir[IPLUG_WIN_MAX_WIDE_PATH];
+
1557 UINT len = GetSystemDirectoryW(winDir, IPLUG_WIN_MAX_WIDE_PATH);
+
1558
+
1559 if (len && !(len > MAX_PATH - 2))
+
1560 {
+
1561 winDir[len] = L'\\';
+
1562 winDir[++len] = L'\0';
+
1563
+
1564 WDL_String explorerParams;
+
1565
+
1566 if (select)
+
1567 explorerParams.Append("/select,");
+
1568
+
1569 explorerParams.Append("\"");
+
1570 explorerParams.Append(path.Get());
+
1571 explorerParams.Append("\\\"");
+
1572
+
1573 HINSTANCE result;
+
1574
+
1575 if ((result=::ShellExecuteW(NULL, L"open", L"explorer.exe", UTF8AsUTF16(explorerParams).Get(), winDir, SW_SHOWNORMAL)) <= (HINSTANCE) 32)
+
1576 success = true;
+
1577 }
+
1578 }
+
1579
+
1580 return success;
+
1581}
+
1582
+
1583void IGraphicsWin::PromptForFile(WDL_String& fileName, WDL_String& path, EFileAction action, const char* ext, IFileDialogCompletionHandlerFunc completionHandler)
+
1584{
+
1585 if (!WindowIsOpen())
+
1586 {
+
1587 fileName.Set("");
+
1588 return;
+
1589 }
+
1590
+
1591 wchar_t fileNameWide[_MAX_PATH];
+
1592
+
1593 UTF8ToUTF16(fileNameWide, fileName.Get(), _MAX_PATH);
+
1594
+
1595 //if (!path.GetLength())
+
1596 // DesktopPath(path);
+
1597
+
1598 UTF8AsUTF16 directoryWide(path);
+
1599
+
1600 OPENFILENAMEW ofn;
+
1601 memset(&ofn, 0, sizeof(OPENFILENAMEW));
+
1602
+
1603 ofn.lStructSize = sizeof(OPENFILENAMEW);
+
1604 ofn.hwndOwner = (HWND) GetWindow();
+
1605 ofn.lpstrFile = fileNameWide;
+
1606 ofn.nMaxFile = _MAX_PATH - 1;
+
1607 ofn.lpstrInitialDir = directoryWide.Get();
+
1608 ofn.Flags = OFN_PATHMUSTEXIST;
+
1609
+
1610 if (CStringHasContents(ext))
+
1611 {
+
1612 wchar_t extStr[256];
+
1613 wchar_t defExtStr[16];
+
1614 int i, p, n = strlen(ext);
+
1615 bool separator = true;
+
1616
+
1617 for (i = 0, p = 0; i < n; ++i)
+
1618 {
+
1619 if (separator)
+
1620 {
+
1621 if (p)
+
1622 extStr[p++] = ';';
+
1623
+
1624 separator = false;
+
1625 extStr[p++] = '*';
+
1626 extStr[p++] = '.';
+
1627 }
+
1628
+
1629 if (ext[i] == ' ')
+
1630 separator = true;
+
1631 else
+
1632 extStr[p++] = ext[i];
+
1633 }
+
1634 extStr[p++] = '\0';
+
1635
+
1636 wcscpy(&extStr[p], extStr);
+
1637 extStr[p + p] = '\0';
+
1638 ofn.lpstrFilter = extStr;
+
1639
+
1640 for (i = 0, p = 0; i < n && ext[i] != ' '; ++i)
+
1641 defExtStr[p++] = ext[i];
+
1642
+
1643 defExtStr[p++] = '\0';
+
1644 ofn.lpstrDefExt = defExtStr;
+
1645 }
+
1646
+
1647 bool rc = false;
+
1648
+
1649 switch (action)
+
1650 {
+
1651 case EFileAction::Save:
+
1652 ofn.Flags |= OFN_OVERWRITEPROMPT;
+
1653 rc = GetSaveFileNameW(&ofn);
+
1654 break;
+
1655 case EFileAction::Open:
+
1656 default:
+
1657 ofn.Flags |= OFN_FILEMUSTEXIST;
+
1658 rc = GetOpenFileNameW(&ofn);
+
1659 break;
+
1660 }
+
1661
+
1662 if (rc)
+
1663 {
+
1664 char drive[_MAX_DRIVE];
+
1665 char directoryOutCStr[_MAX_PATH];
+
1666
+
1667 UTF16AsUTF8 tempUTF8(ofn.lpstrFile);
+
1668
+
1669 if (_splitpath_s(tempUTF8.Get(), drive, sizeof(drive), directoryOutCStr, sizeof(directoryOutCStr), NULL, 0, NULL, 0) == 0)
+
1670 {
+
1671 path.Set(drive);
+
1672 path.Append(directoryOutCStr);
+
1673 }
+
1674
+
1675 fileName.Set(tempUTF8.Get());
+
1676 }
+
1677 else
+
1678 {
+
1679 fileName.Set("");
+
1680 }
+
1681
+
1682 // Async is not required on windows, but call the completion handler anyway
+
1683 if (completionHandler)
+
1684 {
+
1685 completionHandler(fileName, path);
+
1686 }
+
1687
+
1688 ReleaseMouseCapture();
+
1689}
+
1690
+
1691void IGraphicsWin::PromptForDirectory(WDL_String& dir, IFileDialogCompletionHandlerFunc completionHandler)
+
1692{
+
1693 BROWSEINFOW bi;
+
1694 memset(&bi, 0, sizeof(bi));
+
1695
+
1696 bi.ulFlags = BIF_USENEWUI;
+
1697 bi.hwndOwner = mPlugWnd;
+
1698 bi.lpszTitle = L"Choose a Directory";
+
1699
+
1700 // must call this if using BIF_USENEWUI
+
1701 ::OleInitialize(NULL);
+
1702 LPITEMIDLIST pIDL = ::SHBrowseForFolderW(&bi);
+
1703
+
1704 if (pIDL != NULL)
+
1705 {
+
1706 wchar_t buffer[_MAX_PATH] = {'\0'};
+
1707
+
1708 if (::SHGetPathFromIDListW(pIDL, buffer) != 0)
+
1709 {
+
1710 dir.Set(UTF16AsUTF8(buffer).Get());
+
1711 dir.Append("\\");
+
1712 }
+
1713
+
1714 // free the item id list
+
1715 CoTaskMemFree(pIDL);
+
1716 }
+
1717 else
+
1718 {
+
1719 dir.Set("");
+
1720 }
+
1721
+
1722 if (completionHandler)
+
1723 {
+
1724 WDL_String fileName; // not used
+
1725 completionHandler(fileName, dir);
+
1726 }
+
1727
+
1728 ReleaseMouseCapture();
+
1729
+
1730 ::OleUninitialize();
+
1731}
+
1732
+
1733static UINT_PTR CALLBACK CCHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
+
1734{
+
1735 if (uiMsg == WM_INITDIALOG && lParam)
+
1736 {
+
1737 CHOOSECOLORW* cc = (CHOOSECOLORW*) lParam;
+
1738 if (cc && cc->lCustData)
+
1739 {
+
1740 const wchar_t* strWide = (const wchar_t*) cc->lCustData;
+
1741 SetWindowTextW(hdlg, strWide);
+
1742 UINT uiSetRGB;
+
1743 uiSetRGB = RegisterWindowMessageW(SETRGBSTRINGW);
+
1744 SendMessageW(hdlg, uiSetRGB, 0, (LPARAM) cc->rgbResult);
+
1745 }
+
1746 }
+
1747 return 0;
+
1748}
+
1749
+
1750bool IGraphicsWin::PromptForColor(IColor& color, const char* prompt, IColorPickerHandlerFunc func)
+
1751{
+
1752 ReleaseMouseCapture();
+
1753
+
1754 if (!mPlugWnd)
+
1755 return false;
+
1756
+
1757 UTF8AsUTF16 promptWide(prompt);
+
1758
+
1759 const COLORREF w = RGB(255, 255, 255);
+
1760 static COLORREF customColorStorage[16] = { w, w, w, w, w, w, w, w, w, w, w, w, w, w, w, w };
+
1761
+
1762 CHOOSECOLORW cc;
+
1763 memset(&cc, 0, sizeof(CHOOSECOLORW));
+
1764 cc.lStructSize = sizeof(CHOOSECOLORW);
+
1765 cc.hwndOwner = mPlugWnd;
+
1766 cc.rgbResult = RGB(color.R, color.G, color.B);
+
1767 cc.lpCustColors = customColorStorage;
+
1768 cc.lCustData = (LPARAM) promptWide.Get();
+
1769 cc.lpfnHook = CCHookProc;
+
1770 cc.Flags = CC_RGBINIT | CC_ANYCOLOR | CC_FULLOPEN | CC_SOLIDCOLOR | CC_ENABLEHOOK;
+
1771
+
1772 if (ChooseColorW(&cc))
+
1773 {
+
1774 color.R = GetRValue(cc.rgbResult);
+
1775 color.G = GetGValue(cc.rgbResult);
+
1776 color.B = GetBValue(cc.rgbResult);
+
1777
+
1778 if (func)
+
1779 func(color);
+
1780
+
1781 return true;
+
1782 }
+
1783 return false;
+
1784}
+
1785
+
1786bool IGraphicsWin::OpenURL(const char* url, const char* msgWindowTitle, const char* confirmMsg, const char* errMsgOnFailure)
+
1787{
+
1788 if (confirmMsg && MessageBoxW(mPlugWnd, UTF8AsUTF16(confirmMsg).Get(), UTF8AsUTF16(msgWindowTitle).Get(), MB_YESNO) != IDYES)
+
1789 {
+
1790 return false;
+
1791 }
+
1792 DWORD inetStatus = 0;
+
1793 if (InternetGetConnectedState(&inetStatus, 0))
+
1794 {
+
1795 if (ShellExecuteW(mPlugWnd, L"open", UTF8AsUTF16(url).Get(), 0, 0, SW_SHOWNORMAL) > HINSTANCE(32))
+
1796 {
+
1797 return true;
+
1798 }
+
1799 }
+
1800 if (errMsgOnFailure)
+
1801 {
+
1802 MessageBoxW(mPlugWnd, UTF8AsUTF16(errMsgOnFailure).Get(), UTF8AsUTF16(msgWindowTitle).Get(), MB_OK);
+
1803 }
+
1804 return false;
+
1805}
+
1806
+
1807void IGraphicsWin::SetTooltip(const char* tooltip)
+
1808{
+
1809 UTF8AsUTF16 tipWide(tooltip);
+
1810 TOOLINFOW ti = { TTTOOLINFOW_V2_SIZE, 0, mPlugWnd, (UINT_PTR) mPlugWnd, {0, 0, 0, 0}, NULL, NULL, 0, NULL };
+
1811 ti.lpszText = const_cast<wchar_t*>(tipWide.Get());
+
1812 SendMessageW(mTooltipWnd, TTM_UPDATETIPTEXTW, 0, (LPARAM) &ti);
+
1813}
+
1814
+
1815void IGraphicsWin::ShowTooltip()
+
1816{
+
1817 if (mTooltipIdx > -1)
+
1818 {
+
1819 const char* tooltip = GetControl(mTooltipIdx)->GetTooltip();
+
1820 if (tooltip)
+
1821 {
+
1822 SetTooltip(tooltip);
+
1823 mShowingTooltip = true;
+
1824 }
+
1825 }
+
1826}
+
1827
+
1828void IGraphicsWin::HideTooltip()
+
1829{
+
1830 if (mShowingTooltip)
+
1831 {
+
1832 SetTooltip(NULL);
+
1833 mShowingTooltip = false;
+
1834 }
+
1835}
+
1836
+
1837bool IGraphicsWin::GetTextFromClipboard(WDL_String& str)
+
1838{
+
1839 bool result = false;
+
1840
+
1841 if (IsClipboardFormatAvailable(CF_UNICODETEXT))
+
1842 {
+
1843 if (OpenClipboard(0))
+
1844 {
+
1845 HGLOBAL hglb = GetClipboardData(CF_UNICODETEXT);
+
1846
+
1847 if (hglb)
+
1848 {
+
1849 WCHAR *origStr = (WCHAR*) GlobalLock(hglb);
+
1850
+
1851 if (origStr)
+
1852 {
+
1853 UTF16ToUTF8(str, origStr);
+
1854 GlobalUnlock(hglb);
+
1855 result = true;
+
1856 }
+
1857 }
+
1858 }
+
1859
+
1860 CloseClipboard();
+
1861 }
+
1862
+
1863 if (!result)
+
1864 str.Set("");
+
1865
+
1866 return result;
+
1867}
+
1868
+
1869bool IGraphicsWin::SetTextInClipboard(const char* str)
+
1870{
+
1871 if (!OpenClipboard(mMainWnd))
+
1872 return false;
+
1873
+
1874 EmptyClipboard();
+
1875
+
1876 bool result = true;
+
1877
+
1878 if (strlen(str))
+
1879 {
+
1880 // figure out how many characters we need for the wide version of this string
+
1881 const int lenWide = UTF8ToUTF16Len(str);
+
1882
+
1883 // allocate global memory object for the text
+
1884 HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, lenWide*sizeof(WCHAR));
+
1885 if (!hglbCopy)
+
1886 {
+
1887 CloseClipboard();
+
1888 return false;
+
1889 }
+
1890
+
1891 // lock the handle
+
1892 LPWSTR lpstrCopy = (LPWSTR) GlobalLock(hglbCopy);
+
1893
+
1894 if (lpstrCopy)
+
1895 {
+
1896 // copy the string into the buffer
+
1897 UTF8ToUTF16(lpstrCopy, str, lenWide);
+
1898 GlobalUnlock(hglbCopy);
+
1899
+
1900 // place the handle on the clipboard
+
1901 result = SetClipboardData(CF_UNICODETEXT, hglbCopy);
+
1902
+
1903 // free the handle if unsuccessful
+
1904 if (!result)
+
1905 GlobalFree(hglbCopy);
+
1906 }
+
1907 }
+
1908
+
1909 CloseClipboard();
+
1910
+
1911 return result;
+
1912}
+
1913
+
1914bool IGraphicsWin::SetFilePathInClipboard(const char* path)
+
1915{
+
1916 if (!OpenClipboard(mMainWnd))
+
1917 return false;
+
1918
+
1919 EmptyClipboard();
+
1920
+
1921 UTF8AsUTF16 pathWide(path);
+
1922
+
1923 // N.B. GHND ensures that the memory is zeroed
+
1924
+
1925 HGLOBAL hGlobal = GlobalAlloc(GHND, sizeof(DROPFILES) + (sizeof(wchar_t) * (pathWide.GetLength() + 1)));
+
1926
+
1927 if (!hGlobal)
+
1928 return false;
+
1929
+
1930 DROPFILES* pDropFiles = (DROPFILES*) GlobalLock(hGlobal);
+
1931 bool result = false;
+
1932
+
1933 if (pDropFiles)
+
1934 {
+
1935 // Populate the dropfile structure and copy the file path
+
1936
+
1937 pDropFiles->pFiles = sizeof(DROPFILES);
+
1938 pDropFiles->pt = { 0, 0 };
+
1939 pDropFiles->fNC = true;
+
1940 pDropFiles->fWide = true;
+
1941
+
1942 std::copy_n(pathWide.Get(), pathWide.GetLength(), reinterpret_cast<wchar_t*>(&pDropFiles[1]));
+
1943
+
1944 GlobalUnlock(hGlobal);
+
1945
+
1946 result = SetClipboardData(CF_HDROP, hGlobal);
+
1947 }
+
1948
+
1949 // free the handle if unsuccessful
+
1950 if (!result)
+
1951 GlobalFree(hGlobal);
+
1952
+
1953 CloseClipboard();
+
1954 return result;
+
1955}
+
1956
+
1957bool IGraphicsWin::InitiateExternalFileDragDrop(const char* path, const IRECT& /*iconBounds*/)
+
1958{
+
1959 using namespace DragAndDropHelpers;
+
1960 OleInitialize(nullptr);
+
1961
+
1962 FORMATETC format = { CF_HDROP, nullptr, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
+
1963
+
1964 DataObject* dataObj = new DataObject(&format, path);
+
1965 DropSource* dropSource = new DropSource();
+
1966
+
1967 DWORD dropEffect;
+
1968 HRESULT ret = DoDragDrop(dataObj, dropSource, DROPEFFECT_COPY, &dropEffect);
+
1969 bool success = SUCCEEDED(ret);
+
1970
+
1971 dataObj->Release();
+
1972 dropSource->Release();
+
1973
+
1974 OleUninitialize();
+
1975
+
1976 ReleaseMouseCapture();
1977
-
1978 auto enumProc = [](const LOGFONTW* pLFont, const TEXTMETRICW* pTextMetric, DWORD FontType, LPARAM lParam)
-
1979 {
-
1980 return -1;
-
1981 };
-
1982
-
1983 if ((!enumerate || EnumFontFamiliesExW(hdc, &lFont, enumProc, NULL, 0) == -1))
-
1984 font = CreateFontIndirectW(&lFont);
-
1985
-
1986 if (font)
-
1987 {
-
1988 wchar_t selectedFontName[64] = {'\0'};
-
1989
-
1990 SelectFont(hdc, font);
-
1991 GetTextFaceW(hdc, 64, selectedFontName);
-
1992 if (strcmp(UTF16AsUTF8(selectedFontName).Get(), fontName))
-
1993 {
-
1994 DeleteObject(font);
-
1995 return nullptr;
-
1996 }
-
1997 }
-
1998
-
1999 ReleaseDC(NULL, hdc);
+
1978 return success;
+
1979}
+
1980
+
1981static HFONT GetHFont(const char* fontName, int weight, bool italic, bool underline, DWORD quality = DEFAULT_QUALITY, bool enumerate = false)
+
1982{
+
1983 HDC hdc = GetDC(NULL);
+
1984 HFONT font = nullptr;
+
1985 LOGFONTW lFont;
+
1986
+
1987 lFont.lfHeight = 0;
+
1988 lFont.lfWidth = 0;
+
1989 lFont.lfEscapement = 0;
+
1990 lFont.lfOrientation = 0;
+
1991 lFont.lfWeight = weight;
+
1992 lFont.lfItalic = italic;
+
1993 lFont.lfUnderline = underline;
+
1994 lFont.lfStrikeOut = false;
+
1995 lFont.lfCharSet = DEFAULT_CHARSET;
+
1996 lFont.lfOutPrecision = OUT_TT_PRECIS;
+
1997 lFont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
+
1998 lFont.lfQuality = quality;
+
1999 lFont.lfPitchAndFamily = DEFAULT_PITCH;
2000
-
2001 return font;
-
2002}
-
2003
-
2004PlatformFontPtr IGraphicsWin::LoadPlatformFont(const char* fontID, const char* fileNameOrResID)
-
2005{
-
2006 StaticStorage<InstalledFont>::Accessor fontStorage(sPlatformFontCache);
-
2007
-
2008 void* pFontMem = nullptr;
-
2009 int resSize = 0;
-
2010 WDL_String fullPath;
-
2011
-
2012 const EResourceLocation fontLocation = LocateResource(fileNameOrResID, "ttf", fullPath, GetBundleID(), GetWinModuleHandle(), nullptr);
-
2013
-
2014 if (fontLocation == kNotFound)
-
2015 return nullptr;
-
2016
-
2017 switch (fontLocation)
-
2018 {
-
2019 case kAbsolutePath:
-
2020 {
-
2021 HANDLE file = CreateFileW(UTF8AsUTF16(fullPath).Get(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
-
2022 PlatformFontPtr ret = nullptr;
-
2023 if (file)
-
2024 {
-
2025 HANDLE mapping = CreateFileMappingW(file, NULL, PAGE_READONLY, 0, 0, NULL);
-
2026 if (mapping)
-
2027 {
-
2028 resSize = (int) GetFileSize(file, nullptr);
-
2029 pFontMem = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0);
-
2030 ret = LoadPlatformFont(fontID, pFontMem, resSize);
-
2031 UnmapViewOfFile(pFontMem);
-
2032 CloseHandle(mapping);
-
2033 }
-
2034 CloseHandle(file);
-
2035 }
-
2036 return ret;
-
2037 }
-
2038 break;
-
2039 case kWinBinary:
-
2040 {
-
2041 pFontMem = const_cast<void *>(LoadWinResource(fullPath.Get(), "ttf", resSize, GetWinModuleHandle()));
-
2042 return LoadPlatformFont(fontID, pFontMem, resSize);
-
2043 }
-
2044 break;
-
2045 }
-
2046
-
2047 return nullptr;
-
2048}
-
2049
-
2050PlatformFontPtr IGraphicsWin::LoadPlatformFont(const char* fontID, const char* fontName, ETextStyle style)
-
2051{
-
2052 int weight = style == ETextStyle::Bold ? FW_BOLD : FW_REGULAR;
-
2053 bool italic = style == ETextStyle::Italic;
-
2054 bool underline = false;
-
2055 DWORD quality = DEFAULT_QUALITY;
-
2056
-
2057 HFONT font = GetHFont(fontName, weight, italic, underline, quality, true);
-
2058
-
2059 return PlatformFontPtr(font ? new Font(font, TextStyleString(style), true) : nullptr);
-
2060}
-
2061
-
2062PlatformFontPtr IGraphicsWin::LoadPlatformFont(const char* fontID, void* pData, int dataSize)
-
2063{
-
2064 StaticStorage<InstalledFont>::Accessor fontStorage(sPlatformFontCache);
-
2065
-
2066 std::unique_ptr<InstalledFont> pFont;
-
2067 void* pFontMem = pData;
-
2068 int resSize = dataSize;
-
2069
-
2070 pFont = std::make_unique<InstalledFont>(pFontMem, resSize);
+
2001 wcsncpy(lFont.lfFaceName, UTF8AsUTF16(fontName).Get(), LF_FACESIZE);
+
2002
+
2003 auto enumProc = [](const LOGFONTW* pLFont, const TEXTMETRICW* pTextMetric, DWORD FontType, LPARAM lParam)
+
2004 {
+
2005 return -1;
+
2006 };
+
2007
+
2008 if ((!enumerate || EnumFontFamiliesExW(hdc, &lFont, enumProc, NULL, 0) == -1))
+
2009 font = CreateFontIndirectW(&lFont);
+
2010
+
2011 if (font)
+
2012 {
+
2013 wchar_t selectedFontName[64] = {'\0'};
+
2014
+
2015 SelectFont(hdc, font);
+
2016 GetTextFaceW(hdc, 64, selectedFontName);
+
2017 if (strcmp(UTF16AsUTF8(selectedFontName).Get(), fontName))
+
2018 {
+
2019 DeleteObject(font);
+
2020 return nullptr;
+
2021 }
+
2022 }
+
2023
+
2024 ReleaseDC(NULL, hdc);
+
2025
+
2026 return font;
+
2027}
+
2028
+
2029PlatformFontPtr IGraphicsWin::LoadPlatformFont(const char* fontID, const char* fileNameOrResID)
+
2030{
+
2031 StaticStorage<InstalledFont>::Accessor fontStorage(sPlatformFontCache);
+
2032
+
2033 void* pFontMem = nullptr;
+
2034 int resSize = 0;
+
2035 WDL_String fullPath;
+
2036
+
2037 const EResourceLocation fontLocation = LocateResource(fileNameOrResID, "ttf", fullPath, GetBundleID(), GetWinModuleHandle(), nullptr);
+
2038
+
2039 if (fontLocation == kNotFound)
+
2040 return nullptr;
+
2041
+
2042 switch (fontLocation)
+
2043 {
+
2044 case kAbsolutePath:
+
2045 {
+
2046 HANDLE file = CreateFileW(UTF8AsUTF16(fullPath).Get(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+
2047 PlatformFontPtr ret = nullptr;
+
2048 if (file)
+
2049 {
+
2050 HANDLE mapping = CreateFileMappingW(file, NULL, PAGE_READONLY, 0, 0, NULL);
+
2051 if (mapping)
+
2052 {
+
2053 resSize = (int) GetFileSize(file, nullptr);
+
2054 pFontMem = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0);
+
2055 ret = LoadPlatformFont(fontID, pFontMem, resSize);
+
2056 UnmapViewOfFile(pFontMem);
+
2057 CloseHandle(mapping);
+
2058 }
+
2059 CloseHandle(file);
+
2060 }
+
2061 return ret;
+
2062 }
+
2063 break;
+
2064 case kWinBinary:
+
2065 {
+
2066 pFontMem = const_cast<void *>(LoadWinResource(fullPath.Get(), "ttf", resSize, GetWinModuleHandle()));
+
2067 return LoadPlatformFont(fontID, pFontMem, resSize);
+
2068 }
+
2069 break;
+
2070 }
2071
-
2072 if (pFontMem && pFont && pFont->IsValid())
-
2073 {
-
2074 IFontInfo fontInfo(pFontMem, resSize, 0);
-
2075 WDL_String family = fontInfo.GetFamily();
-
2076 int weight = fontInfo.IsBold() ? FW_BOLD : FW_REGULAR;
-
2077 bool italic = fontInfo.IsItalic();
-
2078 bool underline = fontInfo.IsUnderline();
-
2079
-
2080 HFONT font = GetHFont(family.Get(), weight, italic, underline);
+
2072 return nullptr;
+
2073}
+
2074
+
2075PlatformFontPtr IGraphicsWin::LoadPlatformFont(const char* fontID, const char* fontName, ETextStyle style)
+
2076{
+
2077 int weight = style == ETextStyle::Bold ? FW_BOLD : FW_REGULAR;
+
2078 bool italic = style == ETextStyle::Italic;
+
2079 bool underline = false;
+
2080 DWORD quality = DEFAULT_QUALITY;
2081
-
2082 if (font)
-
2083 {
-
2084 fontStorage.Add(pFont.release(), fontID);
-
2085 return PlatformFontPtr(new Font(font, "", false));
-
2086 }
-
2087 }
-
2088
-
2089 return nullptr;
-
2090}
-
2091
-
2092void IGraphicsWin::CachePlatformFont(const char* fontID, const PlatformFontPtr& font)
-
2093{
-
2094 StaticStorage<HFontHolder>::Accessor hfontStorage(sHFontCache);
-
2095
-
2096 HFONT hfont = font->GetDescriptor();
-
2097
-
2098 if (!hfontStorage.Find(fontID))
-
2099 hfontStorage.Add(new HFontHolder(hfont), fontID);
-
2100}
-
2101
-
2102DWORD WINAPI VBlankRun(LPVOID lpParam)
-
2103{
-
2104 IGraphicsWin* pGraphics = (IGraphicsWin*) lpParam;
-
2105 return pGraphics->OnVBlankRun();
-
2106}
-
2107
-
2108void IGraphicsWin::StartVBlankThread(HWND hWnd)
-
2109{
-
2110 mVBlankWindow = hWnd;
-
2111 mVBlankShutdown = false;
-
2112 DWORD threadId = 0;
-
2113 mVBlankThread = ::CreateThread(NULL, 0, VBlankRun, this, 0, &threadId);
-
2114}
-
2115
-
2116void IGraphicsWin::StopVBlankThread()
-
2117{
-
2118 if (mVBlankThread != INVALID_HANDLE_VALUE)
-
2119 {
-
2120 mVBlankShutdown = true;
-
2121 ::WaitForSingleObject(mVBlankThread, 10000);
-
2122 mVBlankThread = INVALID_HANDLE_VALUE;
-
2123 mVBlankWindow = 0;
-
2124 }
+
2082 HFONT font = GetHFont(fontName, weight, italic, underline, quality, true);
+
2083
+
2084 return PlatformFontPtr(font ? new Font(font, TextStyleString(style), true) : nullptr);
+
2085}
+
2086
+
2087PlatformFontPtr IGraphicsWin::LoadPlatformFont(const char* fontID, void* pData, int dataSize)
+
2088{
+
2089 StaticStorage<InstalledFont>::Accessor fontStorage(sPlatformFontCache);
+
2090
+
2091 std::unique_ptr<InstalledFont> pFont;
+
2092 void* pFontMem = pData;
+
2093 int resSize = dataSize;
+
2094
+
2095 pFont = std::make_unique<InstalledFont>(pFontMem, resSize);
+
2096
+
2097 if (pFontMem && pFont && pFont->IsValid())
+
2098 {
+
2099 IFontInfo fontInfo(pFontMem, resSize, 0);
+
2100 WDL_String family = fontInfo.GetFamily();
+
2101 int weight = fontInfo.IsBold() ? FW_BOLD : FW_REGULAR;
+
2102 bool italic = fontInfo.IsItalic();
+
2103 bool underline = fontInfo.IsUnderline();
+
2104
+
2105 HFONT font = GetHFont(family.Get(), weight, italic, underline);
+
2106
+
2107 if (font)
+
2108 {
+
2109 fontStorage.Add(pFont.release(), fontID);
+
2110 return PlatformFontPtr(new Font(font, "", false));
+
2111 }
+
2112 }
+
2113
+
2114 return nullptr;
+
2115}
+
2116
+
2117void IGraphicsWin::CachePlatformFont(const char* fontID, const PlatformFontPtr& font)
+
2118{
+
2119 StaticStorage<HFontHolder>::Accessor hfontStorage(sHFontCache);
+
2120
+
2121 HFONT hfont = font->GetDescriptor();
+
2122
+
2123 if (!hfontStorage.Find(fontID))
+
2124 hfontStorage.Add(new HFontHolder(hfont), fontID);
2125}
2126
-
2127// Nasty kernel level definitions for wait for vblank. Including the
-
2128// proper include file requires "d3dkmthk.h" from the driver development
-
2129// kit. Instead we define the minimum needed to call the three methods we need.
-
2130// and use LoadLibrary/GetProcAddress to accomplish the same thing.
-
2131// See https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/d3dkmthk/
-
2132//
-
2133// Heres another link (rant) with a lot of good information about vsync on firefox
-
2134// https://www.vsynctester.com/firefoxisbroken.html
-
2135// https://bugs.chromium.org/p/chromium/issues/detail?id=467617
-
2136
-
2137// structs to use
-
2138typedef UINT32 D3DKMT_HANDLE;
-
2139typedef UINT D3DDDI_VIDEO_PRESENT_SOURCE_ID;
+
2127DWORD WINAPI VBlankRun(LPVOID lpParam)
+
2128{
+
2129 IGraphicsWin* pGraphics = (IGraphicsWin*) lpParam;
+
2130 return pGraphics->OnVBlankRun();
+
2131}
+
2132
+
2133void IGraphicsWin::StartVBlankThread(HWND hWnd)
+
2134{
+
2135 mVBlankWindow = hWnd;
+
2136 mVBlankShutdown = false;
+
2137 DWORD threadId = 0;
+
2138 mVBlankThread = ::CreateThread(NULL, 0, VBlankRun, this, 0, &threadId);
+
2139}
2140
-
2141typedef struct _D3DKMT_OPENADAPTERFROMHDC
+
2141void IGraphicsWin::StopVBlankThread()
2142{
-
2143 HDC hDc;
-
2144 D3DKMT_HANDLE hAdapter;
-
2145 LUID AdapterLuid;
-
2146 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId;
-
2147} D3DKMT_OPENADAPTERFROMHDC;
-
2148
-
2149typedef struct _D3DKMT_CLOSEADAPTER
-
2150{
-
2151 D3DKMT_HANDLE hAdapter;
-
2152} D3DKMT_CLOSEADAPTER;
-
2153
-
2154typedef struct _D3DKMT_WAITFORVERTICALBLANKEVENT
-
2155{
-
2156 D3DKMT_HANDLE hAdapter;
-
2157 D3DKMT_HANDLE hDevice;
-
2158 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId;
-
2159} D3DKMT_WAITFORVERTICALBLANKEVENT;
-
2160
-
2161// entry points
-
2162typedef NTSTATUS(WINAPI* D3DKMTOpenAdapterFromHdc)(D3DKMT_OPENADAPTERFROMHDC* Arg1);
-
2163typedef NTSTATUS(WINAPI* D3DKMTCloseAdapter)(const D3DKMT_CLOSEADAPTER* Arg1);
-
2164typedef NTSTATUS(WINAPI* D3DKMTWaitForVerticalBlankEvent)(const D3DKMT_WAITFORVERTICALBLANKEVENT* Arg1);
+
2143 if (mVBlankThread != INVALID_HANDLE_VALUE)
+
2144 {
+
2145 mVBlankShutdown = true;
+
2146 ::WaitForSingleObject(mVBlankThread, 10000);
+
2147 mVBlankThread = INVALID_HANDLE_VALUE;
+
2148 mVBlankWindow = 0;
+
2149 }
+
2150}
+
2151
+
2152// Nasty kernel level definitions for wait for vblank. Including the
+
2153// proper include file requires "d3dkmthk.h" from the driver development
+
2154// kit. Instead we define the minimum needed to call the three methods we need.
+
2155// and use LoadLibrary/GetProcAddress to accomplish the same thing.
+
2156// See https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/d3dkmthk/
+
2157//
+
2158// Heres another link (rant) with a lot of good information about vsync on firefox
+
2159// https://www.vsynctester.com/firefoxisbroken.html
+
2160// https://bugs.chromium.org/p/chromium/issues/detail?id=467617
+
2161
+
2162// structs to use
+
2163typedef UINT32 D3DKMT_HANDLE;
+
2164typedef UINT D3DDDI_VIDEO_PRESENT_SOURCE_ID;
2165
-
2166DWORD IGraphicsWin::OnVBlankRun()
+
2166typedef struct _D3DKMT_OPENADAPTERFROMHDC
2167{
-
2168 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
-
2169
-
2170 // TODO: get expected vsync value. For now we will use a fallback
-
2171 // of 60Hz
-
2172 float rateFallback = 60.0f;
-
2173 int rateMS = (int)(1000.0f / rateFallback);
-
2174
-
2175 // We need to try to load the module and entry points to wait on v blank.
-
2176 // if anything fails, we try to gracefully fallback to sleeping for some
-
2177 // number of milliseconds.
-
2178 //
-
2179 // TODO: handle low power modes
-
2180
-
2181 D3DKMTOpenAdapterFromHdc pOpen = nullptr;
-
2182 D3DKMTCloseAdapter pClose = nullptr;
-
2183 D3DKMTWaitForVerticalBlankEvent pWait = nullptr;
-
2184 HINSTANCE hInst = LoadLibraryW(L"gdi32.dll");
+
2168 HDC hDc;
+
2169 D3DKMT_HANDLE hAdapter;
+
2170 LUID AdapterLuid;
+
2171 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId;
+
2172} D3DKMT_OPENADAPTERFROMHDC;
+
2173
+
2174typedef struct _D3DKMT_CLOSEADAPTER
+
2175{
+
2176 D3DKMT_HANDLE hAdapter;
+
2177} D3DKMT_CLOSEADAPTER;
+
2178
+
2179typedef struct _D3DKMT_WAITFORVERTICALBLANKEVENT
+
2180{
+
2181 D3DKMT_HANDLE hAdapter;
+
2182 D3DKMT_HANDLE hDevice;
+
2183 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId;
+
2184} D3DKMT_WAITFORVERTICALBLANKEVENT;
2185
-
2186 if (hInst != nullptr)
-
2187 {
-
2188 pOpen = (D3DKMTOpenAdapterFromHdc) GetProcAddress((HMODULE) hInst, "D3DKMTOpenAdapterFromHdc");
-
2189 pClose = (D3DKMTCloseAdapter) GetProcAddress((HMODULE) hInst, "D3DKMTCloseAdapter");
-
2190 pWait = (D3DKMTWaitForVerticalBlankEvent) GetProcAddress((HMODULE) hInst, "D3DKMTWaitForVerticalBlankEvent");
-
2191 }
-
2192
-
2193 // if we don't get bindings to the methods we will fallback
-
2194 // to a crummy sleep loop for now. This is really just a last
-
2195 // resort and not expected on modern hardware and Windows OS
-
2196 // installs.
-
2197 if (!pOpen || !pClose || !pWait)
-
2198 {
-
2199 while (mVBlankShutdown == false)
-
2200 {
-
2201 Sleep(rateMS);
-
2202 VBlankNotify();
-
2203 }
-
2204 }
-
2205 else
-
2206 {
-
2207 // we have a good set of functions to call. We need to keep
-
2208 // track of the adapter and reask for it if the device is lost.
-
2209 bool adapterIsOpen = false;
-
2210 DWORD adapterLastFailTime = 0;
-
2211 _D3DKMT_WAITFORVERTICALBLANKEVENT we = { 0 };
-
2212
-
2213 while (mVBlankShutdown == false)
-
2214 {
-
2215 if (!adapterIsOpen)
-
2216 {
-
2217 // reacquire the adapter (at most once a second).
-
2218 if (adapterLastFailTime < ::GetTickCount() - 1000)
-
2219 {
-
2220 // try to get adapter
-
2221 D3DKMT_OPENADAPTERFROMHDC openAdapterData = { 0 };
-
2222 HDC hDC = GetDC(mVBlankWindow);
-
2223 openAdapterData.hDc = hDC;
-
2224 NTSTATUS status = (*pOpen)(&openAdapterData);
-
2225 if (status == S_OK)
-
2226 {
-
2227 // success, setup wait request parameters.
-
2228 adapterLastFailTime = 0;
-
2229 adapterIsOpen = true;
-
2230 we.hAdapter = openAdapterData.hAdapter;
-
2231 we.hDevice = 0;
-
2232 we.VidPnSourceId = openAdapterData.VidPnSourceId;
-
2233 }
-
2234 else
-
2235 {
-
2236 // failed
-
2237 adapterLastFailTime = ::GetTickCount();
-
2238 }
-
2239 DeleteDC(hDC);
-
2240 }
-
2241 }
-
2242
-
2243 if (adapterIsOpen)
-
2244 {
-
2245 // Finally we can wait on VBlank
-
2246 NTSTATUS status = (*pWait)(&we);
-
2247 if (status != S_OK)
-
2248 {
-
2249 // failed, close now and try again on the next pass.
-
2250 _D3DKMT_CLOSEADAPTER ca;
-
2251 ca.hAdapter = we.hAdapter;
-
2252 (*pClose)(&ca);
-
2253 adapterIsOpen = false;
-
2254 }
-
2255 }
-
2256
-
2257 // Temporary fallback for lost adapter or failed call.
-
2258 if (!adapterIsOpen)
-
2259 {
-
2260 ::Sleep(rateMS);
-
2261 }
-
2262
-
2263 // notify logic
-
2264 VBlankNotify();
-
2265 }
-
2266
-
2267 // cleanup adapter before leaving
-
2268 if (adapterIsOpen)
-
2269 {
-
2270 _D3DKMT_CLOSEADAPTER ca;
-
2271 ca.hAdapter = we.hAdapter;
-
2272 (*pClose)(&ca);
-
2273 adapterIsOpen = false;
-
2274 }
-
2275 }
-
2276
-
2277 // release module resource
-
2278 if (hInst != nullptr)
-
2279 {
-
2280 FreeLibrary((HMODULE)hInst);
-
2281 hInst = nullptr;
-
2282 }
-
2283
-
2284 return 0;
-
2285}
-
2286
-
2287void IGraphicsWin::VBlankNotify()
-
2288{
-
2289 mVBlankCount++;
-
2290 ::PostMessageW(mVBlankWindow, WM_VBLANK, mVBlankCount, 0);
-
2291}
-
2292
-
2293#ifndef NO_IGRAPHICS
-
2294#if defined IGRAPHICS_SKIA
-
2295 #include "IGraphicsSkia.cpp"
-
2296 #ifdef IGRAPHICS_GL
-
2297 #include "glad.c"
-
2298 #endif
-
2299#elif defined IGRAPHICS_NANOVG
-
2300 #include "IGraphicsNanoVG.cpp"
-
2301#ifdef IGRAPHICS_FREETYPE
-
2302#define FONS_USE_FREETYPE
-
2303 #pragma comment(lib, "freetype.lib")
-
2304#endif
-
2305 #include "nanovg.c"
-
2306 #include "glad.c"
-
2307#else
-
2308 #error
-
2309#endif
-
2310#endif
+
2186// entry points
+
2187typedef NTSTATUS(WINAPI* D3DKMTOpenAdapterFromHdc)(D3DKMT_OPENADAPTERFROMHDC* Arg1);
+
2188typedef NTSTATUS(WINAPI* D3DKMTCloseAdapter)(const D3DKMT_CLOSEADAPTER* Arg1);
+
2189typedef NTSTATUS(WINAPI* D3DKMTWaitForVerticalBlankEvent)(const D3DKMT_WAITFORVERTICALBLANKEVENT* Arg1);
+
2190
+
2191DWORD IGraphicsWin::OnVBlankRun()
+
2192{
+
2193 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
+
2194
+
2195 // TODO: get expected vsync value. For now we will use a fallback
+
2196 // of 60Hz
+
2197 float rateFallback = 60.0f;
+
2198 int rateMS = (int)(1000.0f / rateFallback);
+
2199
+
2200 // We need to try to load the module and entry points to wait on v blank.
+
2201 // if anything fails, we try to gracefully fallback to sleeping for some
+
2202 // number of milliseconds.
+
2203 //
+
2204 // TODO: handle low power modes
+
2205
+
2206 D3DKMTOpenAdapterFromHdc pOpen = nullptr;
+
2207 D3DKMTCloseAdapter pClose = nullptr;
+
2208 D3DKMTWaitForVerticalBlankEvent pWait = nullptr;
+
2209 HINSTANCE hInst = LoadLibraryW(L"gdi32.dll");
+
2210
+
2211 if (hInst != nullptr)
+
2212 {
+
2213 pOpen = (D3DKMTOpenAdapterFromHdc) GetProcAddress((HMODULE) hInst, "D3DKMTOpenAdapterFromHdc");
+
2214 pClose = (D3DKMTCloseAdapter) GetProcAddress((HMODULE) hInst, "D3DKMTCloseAdapter");
+
2215 pWait = (D3DKMTWaitForVerticalBlankEvent) GetProcAddress((HMODULE) hInst, "D3DKMTWaitForVerticalBlankEvent");
+
2216 }
+
2217
+
2218 // if we don't get bindings to the methods we will fallback
+
2219 // to a crummy sleep loop for now. This is really just a last
+
2220 // resort and not expected on modern hardware and Windows OS
+
2221 // installs.
+
2222 if (!pOpen || !pClose || !pWait)
+
2223 {
+
2224 while (mVBlankShutdown == false)
+
2225 {
+
2226 Sleep(rateMS);
+
2227 VBlankNotify();
+
2228 }
+
2229 }
+
2230 else
+
2231 {
+
2232 // we have a good set of functions to call. We need to keep
+
2233 // track of the adapter and reask for it if the device is lost.
+
2234 bool adapterIsOpen = false;
+
2235 DWORD adapterLastFailTime = 0;
+
2236 _D3DKMT_WAITFORVERTICALBLANKEVENT we = { 0 };
+
2237
+
2238 while (mVBlankShutdown == false)
+
2239 {
+
2240 if (!adapterIsOpen)
+
2241 {
+
2242 // reacquire the adapter (at most once a second).
+
2243 if (adapterLastFailTime < ::GetTickCount() - 1000)
+
2244 {
+
2245 // try to get adapter
+
2246 D3DKMT_OPENADAPTERFROMHDC openAdapterData = { 0 };
+
2247 HDC hDC = GetDC(mVBlankWindow);
+
2248 openAdapterData.hDc = hDC;
+
2249 NTSTATUS status = (*pOpen)(&openAdapterData);
+
2250 if (status == S_OK)
+
2251 {
+
2252 // success, setup wait request parameters.
+
2253 adapterLastFailTime = 0;
+
2254 adapterIsOpen = true;
+
2255 we.hAdapter = openAdapterData.hAdapter;
+
2256 we.hDevice = 0;
+
2257 we.VidPnSourceId = openAdapterData.VidPnSourceId;
+
2258 }
+
2259 else
+
2260 {
+
2261 // failed
+
2262 adapterLastFailTime = ::GetTickCount();
+
2263 }
+
2264 DeleteDC(hDC);
+
2265 }
+
2266 }
+
2267
+
2268 if (adapterIsOpen)
+
2269 {
+
2270 // Finally we can wait on VBlank
+
2271 NTSTATUS status = (*pWait)(&we);
+
2272 if (status != S_OK)
+
2273 {
+
2274 // failed, close now and try again on the next pass.
+
2275 _D3DKMT_CLOSEADAPTER ca;
+
2276 ca.hAdapter = we.hAdapter;
+
2277 (*pClose)(&ca);
+
2278 adapterIsOpen = false;
+
2279 }
+
2280 }
+
2281
+
2282 // Temporary fallback for lost adapter or failed call.
+
2283 if (!adapterIsOpen)
+
2284 {
+
2285 ::Sleep(rateMS);
+
2286 }
+
2287
+
2288 // notify logic
+
2289 VBlankNotify();
+
2290 }
+
2291
+
2292 // cleanup adapter before leaving
+
2293 if (adapterIsOpen)
+
2294 {
+
2295 _D3DKMT_CLOSEADAPTER ca;
+
2296 ca.hAdapter = we.hAdapter;
+
2297 (*pClose)(&ca);
+
2298 adapterIsOpen = false;
+
2299 }
+
2300 }
+
2301
+
2302 // release module resource
+
2303 if (hInst != nullptr)
+
2304 {
+
2305 FreeLibrary((HMODULE)hInst);
+
2306 hInst = nullptr;
+
2307 }
+
2308
+
2309 return 0;
+
2310}
+
2311
+
2312void IGraphicsWin::VBlankNotify()
+
2313{
+
2314 mVBlankCount++;
+
2315 ::PostMessageW(mVBlankWindow, WM_VBLANK, mVBlankCount, 0);
+
2316}
+
2317
+
2318#ifndef NO_IGRAPHICS
+
2319#if defined IGRAPHICS_SKIA
+
2320 #include "IGraphicsSkia.cpp"
+
2321 #ifdef IGRAPHICS_GL
+
2322 #include "glad.c"
+
2323 #endif
+
2324#elif defined IGRAPHICS_NANOVG
+
2325 #include "IGraphicsNanoVG.cpp"
+
2326#ifdef IGRAPHICS_FREETYPE
+
2327#define FONS_USE_FREETYPE
+
2328 #pragma comment(lib, "freetype.lib")
+
2329#endif
+
2330 #include "nanovg.c"
+
2331 #include "glad.c"
+
2332#else
+
2333 #error
+
2334#endif
+
2335#endif
IPlugParameter.h
IPlugPaths.h
Common paths useful for plug-ins.
LoadWinResource
const void * LoadWinResource(const char *resID, const char *type, int &sizeInBytes, void *pHInstance)
Load a resource from the binary (windows only).
LocateResource
EResourceLocation LocateResource(const char *fileNameOrResID, const char *type, WDL_String &result, const char *bundleID, void *pHInstance, const char *sharedResourcesSubPath)
Find the absolute path of a resource based on it's file name (e.g.
IPopupMenuControl.h
+
DragAndDropHelpers::DataObject
Definition: IGraphicsWin_dnd.h:179
+
DragAndDropHelpers::DropSource
Definition: IGraphicsWin_dnd.h:21
IGEditorDelegate
An editor delegate base class for a SOMETHING that uses IGraphics for it's UI.
Definition: IGraphicsEditorDelegate.h:30
IGraphics::SetMouseCursor
virtual ECursor SetMouseCursor(ECursor cursorType=ECursor::ARROW)
Sets the mouse cursor to one of ECursor (implementations should return the result of the base impleme...
Definition: IGraphics.h:828
-
IGraphicsWin::InstalledFont
Definition: IGraphicsWin.cpp:61
+
IGraphicsWin::InstalledFont
Definition: IGraphicsWin.cpp:62
IGraphicsWin
IGraphics platform class for Windows.
Definition: IGraphicsWin.h:25
IParam::Type
EParamType Type() const
Get the parameter's type.
Definition: IPlugParameter.h:423
IPopupMenu::Item
A class to specify an item of a pop up menu.
Definition: IGraphicsPopupMenu.h:45
@@ -2413,7 +2440,7 @@
TextStyleString
static const char * TextStyleString(ETextStyle style)
Helper to get a CString based on ETextStyle.
Definition: IGraphicsStructs.h:648
IMouseInfo
Used to group mouse coordinates with mouse modifier information.
Definition: IGraphicsStructs.h:1710
IColor
Used to manage color data, independent of draw class/platform.
Definition: IGraphicsStructs.h:223
-
IGraphicsWin::HFontHolder
Definition: IGraphicsWin.cpp:89
+
IGraphicsWin::HFontHolder
Definition: IGraphicsWin.cpp:90
IKeyPress
Used for key press info, such as ASCII representation, virtual key (mapped to win32 codes) and modifi...
Definition: IPlugStructs.h:616
IMouseMod
Used to manage mouse modifiers i.e.
Definition: IGraphicsStructs.h:1685
IRECT
Used to manage a rectangular area, independent of draw class/platform.
Definition: IGraphicsStructs.h:749
diff --git a/_i_graphics_win_8h_source.html b/_i_graphics_win_8h_source.html index 9f761b28..4a868361 100644 --- a/_i_graphics_win_8h_source.html +++ b/_i_graphics_win_8h_source.html @@ -162,109 +162,111 @@
77 bool SetTextInClipboard(const char* str) override;
78 bool SetFilePathInClipboard(const char* path) override;
79
-
80 bool PlatformSupportsMultiTouch() const override;
+
80 bool InitiateExternalFileDragDrop(const char* path, const IRECT& iconBounds) override;
81
-
82 static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
-
83 static LRESULT CALLBACK ParamEditProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
-
84 static BOOL CALLBACK FindMainWindow(HWND hWnd, LPARAM lParam);
-
85
-
86 DWORD OnVBlankRun();
+
82 bool PlatformSupportsMultiTouch() const override;
+
83
+
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);
87
-
88protected:
-
89 IPopupMenu* CreatePlatformPopupMenu(IPopupMenu& menu, const IRECT bounds, bool& isAsync) override;
-
90 void CreatePlatformTextEntry(int paramIdx, const IText& text, const IRECT& bounds, int length, const char* str) override;
-
91
-
92 void SetTooltip(const char* tooltip);
-
93 void ShowTooltip();
-
94 void HideTooltip();
-
95
-
96 HWND GetMainWnd();
-
97 IRECT GetWindowRECT();
-
98
-
99private:
+
88 DWORD OnVBlankRun();
+
89
+
90protected:
+
91 IPopupMenu* CreatePlatformPopupMenu(IPopupMenu& menu, const IRECT bounds, bool& isAsync) override;
+
92 void CreatePlatformTextEntry(int paramIdx, const IText& text, const IRECT& bounds, int length, const char* str) override;
+
93
+
94 void SetTooltip(const char* tooltip);
+
95 void ShowTooltip();
+
96 void HideTooltip();
+
97
+
98 HWND GetMainWnd();
+
99 IRECT GetWindowRECT();
100
-
103 void OnDisplayTimer(int vBlankCount = 0);
-
104
-
105 enum EParamEditMsg
-
106 {
-
107 kNone,
-
108 kEditing,
-
109 kUpdate,
-
110 kCancel,
-
111 kCommit
-
112 };
-
113
-
114 PlatformFontPtr LoadPlatformFont(const char* fontID, const char* fileNameOrResID) override;
-
115 PlatformFontPtr LoadPlatformFont(const char* fontID, const char* fontName, ETextStyle style) override;
-
116 PlatformFontPtr LoadPlatformFont(const char* fontID, void* pData, int dataSize) override;
-
117 void CachePlatformFont(const char* fontID, const PlatformFontPtr& font) override;
-
118
-
119 inline IMouseInfo GetMouseInfo(LPARAM lParam, WPARAM wParam);
-
120 inline IMouseInfo GetMouseInfoDeltas(float& dX, float& dY, LPARAM lParam, WPARAM wParam);
-
121 bool MouseCursorIsLocked();
-
122
-
123#ifdef IGRAPHICS_GL
-
124 void CreateGLContext(); // OpenGL context management - TODO: RAII instead ?
-
125 void DestroyGLContext();
-
126 void ActivateGLContext() override;
-
127 void DeactivateGLContext() override;
-
128 HGLRC mHGLRC = nullptr;
-
129 HGLRC mStartHGLRC = nullptr;
-
130 HDC mStartHDC = nullptr;
-
131#endif
-
132
-
133 HINSTANCE mHInstance = nullptr;
-
134 HWND mPlugWnd = nullptr;
-
135 HWND mParamEditWnd = nullptr;
-
136 HWND mTooltipWnd = nullptr;
-
137 HWND mParentWnd = nullptr;
-
138 HWND mMainWnd = nullptr;
-
139 WNDPROC mDefEditProc = nullptr;
-
140 HFONT mEditFont = nullptr;
-
141 DWORD mPID = 0;
-
142
-
143 void StartVBlankThread(HWND hWnd);
-
144 void StopVBlankThread();
-
145 void VBlankNotify();
-
146
-
147 HWND mVBlankWindow = 0; // Window to post messages to for every vsync
-
148 volatile bool mVBlankShutdown = false; // Flag to indiciate that the vsync thread should shutdown
-
149 HANDLE mVBlankThread = INVALID_HANDLE_VALUE; //ID of thread.
-
150 volatile DWORD mVBlankCount = 0; // running count of vblank events since the start of the window.
-
151 int mVBlankSkipUntil = 0; // support for skipping vblank notification if the last callback took too long. This helps keep the message pump clear in the case of overload.
-
152 bool mVSYNCEnabled = false;
-
153
-
154 const IParam* mEditParam = nullptr;
-
155 IText mEditText;
-
156 IRECT mEditRECT;
-
157
-
158 EParamEditMsg mParamEditMsg = kNone;
-
159 bool mShowingTooltip = false;
-
160 float mHiddenCursorX = 0.f;
-
161 float mHiddenCursorY = 0.f;
-
162 int mTooltipIdx = -1;
-
163
-
164 WDL_String mMainWndClassName;
-
165
-
166 static StaticStorage<InstalledFont> sPlatformFontCache;
-
167 static StaticStorage<HFontHolder> sHFontCache;
-
168
-
169 std::unordered_map<ITouchID, IMouseInfo> mDeltaCapture; // associative array of touch id pointers to IMouseInfo structs, so that we can get deltas
-
170};
-
171
-
172END_IGRAPHICS_NAMESPACE
-
173END_IPLUG_NAMESPACE
-
174
-
175
+
101private:
+
102
+
105 void OnDisplayTimer(int vBlankCount = 0);
+
106
+
107 enum EParamEditMsg
+
108 {
+
109 kNone,
+
110 kEditing,
+
111 kUpdate,
+
112 kCancel,
+
113 kCommit
+
114 };
+
115
+
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;
+
120
+
121 inline IMouseInfo GetMouseInfo(LPARAM lParam, WPARAM wParam);
+
122 inline IMouseInfo GetMouseInfoDeltas(float& dX, float& dY, LPARAM lParam, WPARAM wParam);
+
123 bool MouseCursorIsLocked();
+
124
+
125#ifdef IGRAPHICS_GL
+
126 void CreateGLContext(); // OpenGL context management - TODO: RAII instead ?
+
127 void DestroyGLContext();
+
128 void ActivateGLContext() override;
+
129 void DeactivateGLContext() override;
+
130 HGLRC mHGLRC = nullptr;
+
131 HGLRC mStartHGLRC = nullptr;
+
132 HDC mStartHDC = nullptr;
+
133#endif
+
134
+
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;
+
143 DWORD mPID = 0;
+
144
+
145 void StartVBlankThread(HWND hWnd);
+
146 void StopVBlankThread();
+
147 void VBlankNotify();
+
148
+
149 HWND mVBlankWindow = 0; // Window to post messages to for every vsync
+
150 volatile bool mVBlankShutdown = false; // Flag to indiciate that the vsync thread should shutdown
+
151 HANDLE mVBlankThread = INVALID_HANDLE_VALUE; //ID of thread.
+
152 volatile DWORD mVBlankCount = 0; // running count of vblank events since the start of the window.
+
153 int mVBlankSkipUntil = 0; // support for skipping vblank notification if the last callback took too long. This helps keep the message pump clear in the case of overload.
+
154 bool mVSYNCEnabled = false;
+
155
+
156 const IParam* mEditParam = nullptr;
+
157 IText mEditText;
+
158 IRECT mEditRECT;
+
159
+
160 EParamEditMsg mParamEditMsg = kNone;
+
161 bool mShowingTooltip = false;
+
162 float mHiddenCursorX = 0.f;
+
163 float mHiddenCursorY = 0.f;
+
164 int mTooltipIdx = -1;
+
165
+
166 WDL_String mMainWndClassName;
+
167
+
168 static StaticStorage<InstalledFont> sPlatformFontCache;
+
169 static StaticStorage<HFontHolder> sHFontCache;
+
170
+
171 std::unordered_map<ITouchID, IMouseInfo> mDeltaCapture; // associative array of touch id pointers to IMouseInfo structs, so that we can get deltas
+
172};
+
173
+
174END_IGRAPHICS_NAMESPACE
+
175END_IPLUG_NAMESPACE
+
176
+
177
IGraphics_select.h
Used for choosing a drawing backend.
IGEditorDelegate
An editor delegate base class for a SOMETHING that uses IGraphics for it's UI.
Definition: IGraphicsEditorDelegate.h:30
-
IGraphicsWin::InstalledFont
Definition: IGraphicsWin.cpp:61
+
IGraphicsWin::InstalledFont
Definition: IGraphicsWin.cpp:62
IGraphicsWin
IGraphics platform class for Windows.
Definition: IGraphicsWin.h:25
IParam
IPlug's parameter class.
Definition: IPlugParameter.h:31
IPopupMenu
A class for setting the contents of a pop up menu.
Definition: IGraphicsPopupMenu.h:40
IMouseInfo
Used to group mouse coordinates with mouse modifier information.
Definition: IGraphicsStructs.h:1710
IColor
Used to manage color data, independent of draw class/platform.
Definition: IGraphicsStructs.h:223
-
IGraphicsWin::HFontHolder
Definition: IGraphicsWin.cpp:89
+
IGraphicsWin::HFontHolder
Definition: IGraphicsWin.cpp:90
IRECT
Used to manage a rectangular area, independent of draw class/platform.
Definition: IGraphicsStructs.h:749
IText
IText is used to manage font and text/text entry style for a piece of text on the UI,...
Definition: IGraphicsStructs.h:662
diff --git a/_i_graphics_win__dnd_8h_source.html b/_i_graphics_win__dnd_8h_source.html new file mode 100644 index 00000000..c8f97bf5 --- /dev/null +++ b/_i_graphics_win__dnd_8h_source.html @@ -0,0 +1,411 @@ + + + + + + + + +iPlug 2: IGraphicsWin_dnd.h Source File + + + + + + + + + + + + +
+
+ + + + + + +
+
iPlug2 - C++ Audio Plug-in Framework +
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
IGraphicsWin_dnd.h
+
+
+
1/*
+
2 ==============================================================================
+
3
+
4 This file is part of the iPlug 2 library. Copyright (C) the iPlug 2 developers.
+
5
+
6 See LICENSE.txt for more info.
+
7
+
8 ==============================================================================
+
9*/
+
10
+
11#pragma once
+
12
+
13#include "IPlugLogger.h"
+
14
+
15BEGIN_IPLUG_NAMESPACE
+
16BEGIN_IGRAPHICS_NAMESPACE
+
17
+
18namespace DragAndDropHelpers
+
19{
+
20class DropSource : public IDropSource
+
21{
+
22public:
+
23 DropSource() {}
+ +
25 {
+
26 assert(mRefCount == 0);
+
27 }
+
28
+
29 HRESULT STDMETHODCALLTYPE QueryInterface(REFIID refiid, void** resultHandle) override
+
30 {
+
31 if (refiid == IID_IDropSource)
+
32 {
+
33 *resultHandle = this;
+
34 AddRef();
+
35 return S_OK;
+
36 }
+
37 *resultHandle = nullptr;
+
38 return E_NOINTERFACE;
+
39 }
+
40
+
41 ULONG STDMETHODCALLTYPE AddRef () override { return ++mRefCount; }
+
42 ULONG STDMETHODCALLTYPE Release() override
+
43 {
+
44 int refCount = --mRefCount;
+
45 assert(refCount >= 0);
+
46 if (refCount <= 0)
+
47 {
+
48 delete this;
+
49 }
+
50 return refCount;
+
51 }
+
52
+
53 // IDropSource methods
+
54 HRESULT STDMETHODCALLTYPE QueryContinueDrag(BOOL escapeKeyPressed, DWORD grfKeyState) override
+
55 {
+
56 if (escapeKeyPressed == TRUE)
+
57 {
+
58 DBGMSG("DropSource: escapeKeyPressed, abort dnd\n");
+
59 return DRAGDROP_S_CANCEL;
+
60 }
+
61
+
62 if ((grfKeyState & MK_LBUTTON) == 0)
+
63 {
+
64 return DRAGDROP_S_DROP;
+
65 }
+
66 return S_OK;
+
67 }
+
68
+
69 HRESULT STDMETHODCALLTYPE GiveFeedback(DWORD /*dwEffect*/) override
+
70 {
+
71 return DRAGDROP_S_USEDEFAULTCURSORS;
+
72 }
+
73private:
+
74 int mRefCount = 1;
+
75};
+
76
+
77static void deepFormatCopy(FORMATETC& dest, const FORMATETC& source)
+
78{
+
79 dest = source;
+
80 if (source.ptd != nullptr)
+
81 {
+
82 dest.ptd = (DVTARGETDEVICE*) CoTaskMemAlloc (sizeof (DVTARGETDEVICE));
+
83 if (dest.ptd != nullptr)
+
84 {
+
85 *(dest.ptd) = *(source.ptd);
+
86 }
+
87 }
+
88}
+
89
+
90// Enum class, seems necessary for some reason
+
91struct EnumFORMATETC final : public IEnumFORMATETC
+
92{
+
93 EnumFORMATETC (const FORMATETC* f) : mFormatPtr (f) {}
+ +
95
+
96 ULONG STDMETHODCALLTYPE AddRef(void) { return ++mRefCount; }
+
97 ULONG STDMETHODCALLTYPE Release(void)
+
98 {
+
99 int refCount = --mRefCount;
+
100 assert(refCount >= 0);
+
101 if(refCount <= 0) {
+
102 delete this;
+
103 }
+
104 return refCount;
+
105 }
+
106
+
107 HRESULT STDMETHODCALLTYPE QueryInterface(REFIID refiid, void **resultHandle)
+
108 {
+
109 if (refiid == IID_IEnumFORMATETC)
+
110 {
+
111 AddRef();
+
112 *resultHandle = this;
+
113 return S_OK;
+
114 }
+
115 *resultHandle = nullptr;
+
116 return E_NOINTERFACE;
+
117 }
+
118
+
119 HRESULT Clone (IEnumFORMATETC** resultHandle) override
+
120 {
+
121 if (resultHandle == nullptr)
+
122 {
+
123 return E_POINTER;
+
124 }
+
125 EnumFORMATETC* copyObj = new EnumFORMATETC(mFormatPtr);
+
126 copyObj->mCounter = mCounter;
+
127 *resultHandle = copyObj;
+
128 return S_OK;
+
129 }
+
130
+
131 HRESULT Next (ULONG celt, FORMATETC *pFormat, ULONG* pceltFetched) override
+
132 {
+
133 if (pceltFetched != nullptr)
+
134 {
+
135 *pceltFetched = 0;
+
136 }
+
137 else if (celt != 1)
+
138 {
+
139 return S_FALSE;
+
140 }
+
141
+
142 if (mCounter == 0 && celt > 0 && pFormat != nullptr)
+
143 {
+
144 deepFormatCopy(pFormat[0], *mFormatPtr);
+
145 mCounter++;
+
146 if (pceltFetched != nullptr)
+
147 {
+
148 *pceltFetched = 1;
+
149 }
+
150 return S_OK;
+
151 }
+
152 return S_FALSE;
+
153 }
+
154
+
155 HRESULT Skip (ULONG celt) override
+
156 {
+
157 if (mCounter + (int) celt >= 1)
+
158 {
+
159 return S_FALSE;
+
160 }
+
161 mCounter += (int) celt;
+
162 return S_OK;
+
163 }
+
164
+
165 HRESULT Reset() override
+
166 {
+
167 mCounter = 0;
+
168 return S_OK;
+
169 }
+
170
+
171private:
+
172 int mRefCount = 1;
+
173 const FORMATETC* const mFormatPtr;
+
174 int mCounter = 0;
+
175};
+
176
+
177// Object that carries the DnD payload. TODO: also support text/string?
+
178class DataObject : public IDataObject
+
179{
+
180public:
+
181 DataObject(const FORMATETC* f, const char *filePath) : mFormatPtr (f)
+
182 {
+
183 mFilePath = filePath;
+
184 }
+
185
+
186 virtual ~DataObject()
+
187 {
+
188 assert(mRefCount == 0);
+
189 }
+
190
+
191 HRESULT STDMETHODCALLTYPE QueryInterface(REFIID refiid, void **resultHandle)
+
192 {
+
193 if (refiid == IID_IDataObject || refiid == IID_IUnknown)
+
194 { // note: it seems that IUnknown must be supported here, don't know why
+
195 AddRef();
+
196 *resultHandle=this;
+
197 return S_OK;
+
198 }
+
199 *resultHandle = NULL;
+
200 return E_NOINTERFACE;
+
201 }
+
202
+
203 ULONG STDMETHODCALLTYPE AddRef() { return ++mRefCount; }
+
204 ULONG STDMETHODCALLTYPE Release()
+
205 {
+
206 int refCount = --mRefCount;
+
207 assert(mRefCount>=0);
+
208 if (mRefCount<=0)
+
209 {
+
210 delete this;
+
211 }
+
212 return refCount;
+
213 }
+
214
+
215 bool acceptFormat(FORMATETC *f)
+
216 {
+
217 return (f->dwAspect & DVASPECT_CONTENT) && (f->tymed & TYMED_HGLOBAL) && (f->cfFormat == CF_HDROP);
+
218 }
+
219
+
220 HRESULT STDMETHODCALLTYPE GetData(FORMATETC *pFormat, STGMEDIUM *pMedium)
+
221 {
+
222 if (pFormat == nullptr)
+
223 {
+
224 return E_INVALIDARG;
+
225 }
+
226
+
227 if (acceptFormat(pFormat) == false)
+
228 {
+
229 return DV_E_FORMATETC;
+
230 }
+
231
+
232 UTF8AsUTF16 pathWide(mFilePath.c_str());
+
233 // GHND ensures that the memory is zeroed
+
234 HDROP hGlobal = (HDROP)GlobalAlloc(GHND, sizeof(DROPFILES) + (sizeof(wchar_t) * (pathWide.GetLength() + 2)));
+
235
+
236 if (!hGlobal)
+
237 {
+
238 DBGMSG("DataObject::GetData ERROR: GlobalAlloc returned null, aborting.\n");
+
239 return false;
+
240 }
+
241
+
242 DROPFILES* pDropFiles = (DROPFILES*) GlobalLock(hGlobal);
+
243 if (!pDropFiles)
+
244 {
+
245 DBGMSG("DataObject::GetData ERROR: GlobalLock returned null, aborting.\n");
+
246 return false;
+
247 }
+
248 // Populate the dropfile structure and copy the file path
+
249 pDropFiles->pFiles = sizeof(DROPFILES);
+
250 pDropFiles->fWide = true;
+
251 std::copy_n(pathWide.Get(), pathWide.GetLength(), reinterpret_cast<wchar_t*>(&pDropFiles[1]));
+
252
+
253 // not sure if this is necessary to set the medium but why not
+
254 pMedium->tymed = TYMED_HGLOBAL;
+
255 pMedium->hGlobal = hGlobal;
+
256 pMedium->pUnkForRelease = nullptr;
+
257
+
258 GlobalUnlock(hGlobal);
+
259
+
260 return S_OK;
+
261 }
+
262
+
263 HRESULT STDMETHODCALLTYPE QueryGetData( FORMATETC *pFormat )
+
264 {
+
265 if (pFormat == nullptr)
+
266 {
+
267 return E_INVALIDARG;
+
268 }
+
269
+
270 if (acceptFormat(pFormat) == false)
+
271 {
+
272 return DV_E_FORMATETC;
+
273 }
+
274
+
275 return S_OK;
+
276 }
+
277
+
278 HRESULT GetCanonicalFormatEtc(FORMATETC*, FORMATETC* pFormatOut) override
+
279 {
+
280 pFormatOut->ptd = nullptr;
+
281 return E_NOTIMPL;
+
282 }
+
283
+
284 HRESULT EnumFormatEtc(DWORD direction, IEnumFORMATETC** resultHandle) override
+
285 {
+
286 if (!resultHandle)
+
287 {
+
288 return E_POINTER;
+
289 }
+
290 if (direction == DATADIR_GET)
+
291 {
+
292 *resultHandle = new EnumFORMATETC(mFormatPtr);
+
293 return S_OK;
+
294 }
+
295 *resultHandle = nullptr;
+
296 return E_NOTIMPL;
+
297 }
+
298
+
299 // unimplemented (unnecessary?) functions
+
300 HRESULT STDMETHODCALLTYPE GetDataHere(FORMATETC*, STGMEDIUM*) { return E_NOTIMPL; }
+
301 HRESULT STDMETHODCALLTYPE SetData(FORMATETC*, STGMEDIUM*, BOOL) { return E_NOTIMPL; }
+
302 HRESULT STDMETHODCALLTYPE DAdvise(FORMATETC*, DWORD, IAdviseSink*, DWORD*) { return E_NOTIMPL; }
+
303 HRESULT STDMETHODCALLTYPE DUnadvise(DWORD) { return E_NOTIMPL; }
+
304 HRESULT STDMETHODCALLTYPE EnumDAdvise(IEnumSTATDATA**) { return E_NOTIMPL; }
+
305private:
+
306 int mRefCount = 1;
+
307 std::string mFilePath;
+
308 const FORMATETC* const mFormatPtr;
+
309};
+
310} // end of DragAndDropHelpers namespace
+
311
+
312END_IGRAPHICS_NAMESPACE
+
313END_IPLUG_NAMESPACE
+
IPlug logging a.k.a tracing functionality.
+ + + +
+ + + + diff --git a/_i_platform_view_control_8h_source.html b/_i_platform_view_control_8h_source.html index 2ef9aef3..a72b6c4d 100644 --- a/_i_platform_view_control_8h_source.html +++ b/_i_platform_view_control_8h_source.html @@ -188,7 +188,7 @@
IGraphics::AttachPlatformView
virtual void AttachPlatformView(const IRECT &r, void *pView)
Add an OS view as a sub-view, on top of the IGraphics view.
Definition: IGraphics.h:799
IGraphics::HidePlatformView
virtual void HidePlatformView(void *pView, bool hide)
Hide a previously attached platform view from the IGraphics view.
Definition: IGraphics.h:808
IGraphics::RemovePlatformView
virtual void RemovePlatformView(void *pView)
Remove a previously attached platform view from the IGraphics view.
Definition: IGraphics.h:803
-
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1095
+
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1101
IPlatformViewControl
A control that let's you embed a HWND, UIView or NSView inside an IGraphics UI.
Definition: IPlatformViewControl.h:30
IPlatformViewControl::OnAttached
void OnAttached() override
Called after the control has been attached, and its delegate and graphics member variable set.
Definition: IPlatformViewControl.h:51
IPlatformViewControl::OnResize
void OnResize() override
Called when IControl is constructed or resized using SetRect().
Definition: IPlatformViewControl.h:67
diff --git a/_i_plug_a_p_p__dialog_8cpp_source.html b/_i_plug_a_p_p__dialog_8cpp_source.html index 1a3dcb84..769ee1a2 100644 --- a/_i_plug_a_p_p__dialog_8cpp_source.html +++ b/_i_plug_a_p_p__dialog_8cpp_source.html @@ -883,14 +883,14 @@
IGEditorDelegate
An editor delegate base class for a SOMETHING that uses IGraphics for it's UI.
Definition: IGraphicsEditorDelegate.h:30
IGEditorDelegate::GetUI
IGraphics * GetUI()
Get a pointer to the IGraphics context.
Definition: IGraphicsEditorDelegate.h:75
IGraphics
The lowest level base class of an IGraphics context.
Definition: IGraphics.h:86
-
IGraphics::ShowControlBounds
void ShowControlBounds(bool enable)
Definition: IGraphics.h:1167
+
IGraphics::ShowControlBounds
void ShowControlBounds(bool enable)
Definition: IGraphics.h:1173
IGraphics::EnableLiveEdit
void EnableLiveEdit(bool enable)
Live edit mode allows you to relocate controls at runtime in debug builds.
Definition: IGraphics.cpp:1533
-
IGraphics::ShowAreaDrawnEnabled
bool ShowAreaDrawnEnabled() const
Definition: IGraphics.h:1173
-
IGraphics::LiveEditEnabled
bool LiveEditEnabled() const
Definition: IGraphics.h:1183
-
IGraphics::ShowControlBoundsEnabled
bool ShowControlBoundsEnabled() const
Definition: IGraphics.h:1176
+
IGraphics::ShowAreaDrawnEnabled
bool ShowAreaDrawnEnabled() const
Definition: IGraphics.h:1179
+
IGraphics::LiveEditEnabled
bool LiveEditEnabled() const
Definition: IGraphics.h:1189
+
IGraphics::ShowControlBoundsEnabled
bool ShowControlBoundsEnabled() const
Definition: IGraphics.h:1182
IGraphics::ShowFPSDisplay
void ShowFPSDisplay(bool enable)
Shows a control to display the frame rate of drawing.
Definition: IGraphics.cpp:429
-
IGraphics::ShowingFPSDisplay
bool ShowingFPSDisplay()
Definition: IGraphics.h:1336
-
IGraphics::ShowAreaDrawn
void ShowAreaDrawn(bool enable)
Definition: IGraphics.h:1170
+
IGraphics::ShowingFPSDisplay
bool ShowingFPSDisplay()
Definition: IGraphics.h:1342
+
IGraphics::ShowAreaDrawn
void ShowAreaDrawn(bool enable)
Definition: IGraphics.h:1176
IGraphics::SetScreenScale
void SetScreenScale(float scale)
Called by the platform IGraphics class when moving to a new screen to set DPI.
Definition: IGraphics.cpp:75
IPlugAPPHost
A class that hosts an IPlug as a standalone app and provides Audio/Midi I/O.
Definition: IPlugAPP_host.h:82
IPlugAPPHost::ProbeAudioIO
void ProbeAudioIO()
find out which devices have input channels & which have output channels, add their ids to the lists
Definition: IPlugAPP_host.cpp:256
diff --git a/_i_popup_menu_control_8cpp_source.html b/_i_popup_menu_control_8cpp_source.html index 034ef13e..394d0eac 100644 --- a/_i_popup_menu_control_8cpp_source.html +++ b/_i_popup_menu_control_8cpp_source.html @@ -1116,7 +1116,7 @@
IGraphics::UpdateTooltips
virtual void UpdateTooltips()=0
Call this if you modify control tool tips at runtime.
IGraphics::FillRoundRect
virtual void FillRoundRect(const IColor &color, const IRECT &bounds, float cornerRadius=5.f, const IBlend *pBlend=0)
Fill a rounded rectangle with a color.
Definition: IGraphics.cpp:2576
IGraphics::FillTriangle
virtual void FillTriangle(const IColor &color, float x1, float y1, float x2, float y2, float x3, float y3, const IBlend *pBlend=0)
Fill a triangle with a color.
Definition: IGraphics.cpp:2562
-
IGraphics::GetBounds
IRECT GetBounds() const
Returns an IRECT that represents the entire UI bounds This is useful for programatically arranging UI...
Definition: IGraphics.h:1188
+
IGraphics::GetBounds
IRECT GetBounds() const
Returns an IRECT that represents the entire UI bounds This is useful for programatically arranging UI...
Definition: IGraphics.h:1194
IGraphics::MeasureText
virtual float MeasureText(const IText &text, const char *str, IRECT &bounds) const
Measure the rectangular region that some text will occupy.
Definition: IGraphics.cpp:678
IPopupMenu::Item
A class to specify an item of a pop up menu.
Definition: IGraphicsPopupMenu.h:45
IPopupMenuControl
A base control for a pop-up menu/drop-down list that stays within the bounds of the IGraphics context...
Definition: IPopupMenuControl.h:30
diff --git a/_i_text_entry_control_8cpp_source.html b/_i_text_entry_control_8cpp_source.html index ecfc4e24..f13f38ad 100644 --- a/_i_text_entry_control_8cpp_source.html +++ b/_i_text_entry_control_8cpp_source.html @@ -656,12 +656,12 @@
IGraphics
The lowest level base class of an IGraphics context.
Definition: IGraphics.h:86
IGraphics::DrawText
void DrawText(const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=0)
Draw some text to the graphics context in a specific rectangle.
Definition: IGraphics.cpp:670
IGraphics::CreatePopupMenu
void CreatePopupMenu(IControl &control, IPopupMenu &menu, const IRECT &bounds, int valIdx=0)
Shows a pop up/contextual menu in relation to a rectangular region of the graphics context.
Definition: IGraphics.cpp:1960
-
IGraphics::ClearInTextEntryControl
void ClearInTextEntryControl()
Called when the text entry is dismissed, to reset mInTextEntry.
Definition: IGraphics.h:1128
+
IGraphics::ClearInTextEntryControl
void ClearInTextEntryControl()
Called when the text entry is dismissed, to reset mInTextEntry.
Definition: IGraphics.h:1134
IGraphics::SetTextInClipboard
virtual bool SetTextInClipboard(const char *str)=0
Set text in the clipboard.
IGraphics::FillRect
virtual void FillRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill a rectangular region of the graphics context with a color.
Definition: IGraphics.cpp:2569
IGraphics::SetControlValueAfterTextEdit
void SetControlValueAfterTextEdit(const char *str)
Called by the platform class after returning from a text entry in order to update a control with a ne...
Definition: IGraphics.cpp:235
IGraphics::SetAllControlsDirty
void SetAllControlsDirty()
Calls SetDirty() on every control.
Definition: IGraphics.cpp:582
-
IGraphics::GetControlInTextEntry
IControl * GetControlInTextEntry()
Definition: IGraphics.h:1125
+
IGraphics::GetControlInTextEntry
IControl * GetControlInTextEntry()
Definition: IGraphics.h:1131
IGraphics::MeasureText
virtual float MeasureText(const IText &text, const char *str, IRECT &bounds) const
Measure the rectangular region that some text will occupy.
Definition: IGraphics.cpp:678
IParam
IPlug's parameter class.
Definition: IPlugParameter.h:31
IParam::Type
EParamType Type() const
Get the parameter's type.
Definition: IPlugParameter.h:423
diff --git a/_i_v_tabbed_pages_control_8h_source.html b/_i_v_tabbed_pages_control_8h_source.html index 5757c3fa..ae8d7102 100644 --- a/_i_v_tabbed_pages_control_8h_source.html +++ b/_i_v_tabbed_pages_control_8h_source.html @@ -342,7 +342,7 @@
IControl::SetTargetAndDrawRECTs
void SetTargetAndDrawRECTs(const IRECT &bounds)
Set BOTH the draw rect and the target area, within the graphics context for this control.
Definition: IControl.h:327
IGraphics
The lowest level base class of an IGraphics context.
Definition: IGraphics.h:86
IGraphics::DrawRoundRect
virtual void DrawRoundRect(const IColor &color, const IRECT &bounds, float cornerRadius=5.f, const IBlend *pBlend=0, float thickness=1.f)
Draw a rounded rectangle to the graphics context.
Definition: IGraphics.cpp:2504
-
IGraphics::GetBubbleControl
IBubbleControl * GetBubbleControl(int i=0)
Definition: IGraphics.h:1416
+
IGraphics::GetBubbleControl
IBubbleControl * GetBubbleControl(int i=0)
Definition: IGraphics.h:1422
IGraphics::FillRoundRect
virtual void FillRoundRect(const IColor &color, const IRECT &bounds, float cornerRadius=5.f, const IBlend *pBlend=0)
Fill a rounded rectangle with a color.
Definition: IGraphics.cpp:2576
IVTabPage
A control used as the base class for a tabbed page of subcontrols.
Definition: IVTabbedPagesControl.h:30
IVTabPage::OnStyleChanged
void OnStyleChanged() override
Implement if extra changes are required in response to style changing.
Definition: IVTabbedPagesControl.h:69
diff --git a/_i_web_view_control_8h_source.html b/_i_web_view_control_8h_source.html index 894a5772..39531647 100644 --- a/_i_web_view_control_8h_source.html +++ b/_i_web_view_control_8h_source.html @@ -191,7 +191,7 @@
IGraphics::AttachPlatformView
virtual void AttachPlatformView(const IRECT &r, void *pView)
Add an OS view as a sub-view, on top of the IGraphics view.
Definition: IGraphics.h:799
IGraphics::HidePlatformView
virtual void HidePlatformView(void *pView, bool hide)
Hide a previously attached platform view from the IGraphics view.
Definition: IGraphics.h:808
IGraphics::RemovePlatformView
virtual void RemovePlatformView(void *pView)
Remove a previously attached platform view from the IGraphics view.
Definition: IGraphics.h:803
-
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1095
+
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1101
IWebViewControl
A control that allows the embedding of HTML UI inside an IGraphics context using a platform-native we...
Definition: IWebViewControl.h:37
IWebViewControl::OnRescale
void OnRescale() override
Implement to do something when graphics is scaled globally (e.g.
Definition: IWebViewControl.h:83
IWebViewControl::OnResize
void OnResize() override
Called when IControl is constructed or resized using SetRect().
Definition: IWebViewControl.h:88
diff --git a/_test_custom_shader_control_8h_source.html b/_test_custom_shader_control_8h_source.html index 9da61e18..a5496ffc 100644 --- a/_test_custom_shader_control_8h_source.html +++ b/_test_custom_shader_control_8h_source.html @@ -303,11 +303,11 @@
IGraphics::DrawText
void DrawText(const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=0)
Draw some text to the graphics context in a specific rectangle.
Definition: IGraphics.cpp:670
IGraphics::GetDrawContext
virtual void * GetDrawContext()=0
Gets a void pointer to underlying drawing context, for the IGraphics backend See draw class implement...
IGraphics::DrawDottedRect
virtual void DrawDottedRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0, float thickness=1.f, float dashLen=2.f)
Draw a dotted rectangle to the graphics context.
Definition: IGraphics.cpp:2539
-
IGraphics::WindowWidth
int WindowWidth() const
Gets the width of the graphics context including draw scaling.
Definition: IGraphics.h:1083
+
IGraphics::WindowWidth
int WindowWidth() const
Gets the width of the graphics context including draw scaling.
Definition: IGraphics.h:1089
IGraphics::FillRect
virtual void FillRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill a rectangular region of the graphics context with a color.
Definition: IGraphics.cpp:2569
-
IGraphics::GetScreenScale
float GetScreenScale() const
Gets the screen/display scaling factor, e.g.
Definition: IGraphics.h:1099
-
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1095
-
IGraphics::WindowHeight
int WindowHeight() const
Gets the height of the graphics context including draw scaling.
Definition: IGraphics.h:1087
+
IGraphics::GetScreenScale
float GetScreenScale() const
Gets the screen/display scaling factor, e.g.
Definition: IGraphics.h:1105
+
IGraphics::GetDrawScale
float GetDrawScale() const
Gets the graphics context scaling factor.
Definition: IGraphics.h:1101
+
IGraphics::WindowHeight
int WindowHeight() const
Gets the height of the graphics context including draw scaling.
Definition: IGraphics.h:1093
IKnobControlBase
A base class for knob/dial controls, to handle mouse action and Sender.
Definition: IControl.h:1368
TestCustomShaderControl
Control to test IGraphicsNanoVG with Metal Shaders.
Definition: TestCustomShaderControl.h:200
TestCustomShaderControl::Draw
void Draw(IGraphics &g) override
Draw the control to the graphics context.
Definition: TestCustomShaderControl.h:208
diff --git a/_test_custom_shader_control_8mm_source.html b/_test_custom_shader_control_8mm_source.html index dfb54e11..ed56f340 100644 --- a/_test_custom_shader_control_8mm_source.html +++ b/_test_custom_shader_control_8mm_source.html @@ -218,7 +218,7 @@
IControl::mMouseIsOver
bool mMouseIsOver
if mGraphics::mHandleMouseOver = true, this will be true when the mouse is over control.
Definition: IControl.h:560
IGraphics
The lowest level base class of an IGraphics context.
Definition: IGraphics.h:86
IGraphics::DrawFittedBitmap
virtual void DrawFittedBitmap(const IBitmap &bitmap, const IRECT &bounds, const IBlend *pBlend=0)
Draw a bitmap (raster) image to the graphics context, scaling the image to fit the bounds.
Definition: IGraphics.cpp:2774
-
IGraphics::GetTotalScale
float GetTotalScale() const
Gets the combined draw and screen/display scaling factor.
Definition: IGraphics.h:1107
+
IGraphics::GetTotalScale
float GetTotalScale() const
Gets the combined draw and screen/display scaling factor.
Definition: IGraphics.h:1113
IGraphics::GetDrawContext
virtual void * GetDrawContext()=0
Gets a void pointer to underlying drawing context, for the IGraphics backend See draw class implement...
IGraphics::DrawDottedRect
virtual void DrawDottedRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0, float thickness=1.f, float dashLen=2.f)
Draw a dotted rectangle to the graphics context.
Definition: IGraphics.cpp:2539
IGraphics::FillRect
virtual void FillRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill a rectangular region of the graphics context with a color.
Definition: IGraphics.cpp:2569
diff --git a/_test_multi_touch_control_8h_source.html b/_test_multi_touch_control_8h_source.html index 7014f0aa..10a5ea85 100644 --- a/_test_multi_touch_control_8h_source.html +++ b/_test_multi_touch_control_8h_source.html @@ -200,7 +200,7 @@
IGraphics::ResumeLayer
void ResumeLayer(ILayerPtr &layer)
If a layer already exists, continue drawing to it.
Definition: IGraphics.cpp:1987
IGraphics::CheckLayer
bool CheckLayer(const ILayerPtr &layer)
Test to see if a layer needs drawing, for instance if the control's bounds were changed.
Definition: IGraphics.cpp:2032
IGraphics::DrawLayer
void DrawLayer(const ILayerPtr &layer, const IBlend *pBlend=nullptr)
Draw a layer to the main IGraphics context.
Definition: IGraphics.cpp:2045
-
IGraphics::GetTouches
void GetTouches(IControl *pControl, std::vector< ITouchID > &touchesOnThisControl) const
Populate a vector with the touchIDs active on pControl.
Definition: IGraphics.h:1399
+
IGraphics::GetTouches
void GetTouches(IControl *pControl, std::vector< ITouchID > &touchesOnThisControl) const
Populate a vector with the touchIDs active on pControl.
Definition: IGraphics.h:1405
IGraphics::StartLayer
void StartLayer(IControl *pOwner, const IRECT &r, bool cacheable=false)
Create an IGraphics layer.
Definition: IGraphics.cpp:1977
IGraphics::EndLayer
ILayerPtr EndLayer()
End an IGraphics layer.
Definition: IGraphics.cpp:2000
IMultiTouchControlBase
A base class for controls that can do do multitouch.
Definition: IControl.h:1274
diff --git a/annotated.html b/annotated.html index 509f5721..d42d4870 100644 --- a/annotated.html +++ b/annotated.html @@ -83,215 +83,219 @@
Here are the classes, structs, unions and interfaces with brief descriptions:
[detail level 12]
- - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 CAPIBitmapA base class interface for a bitmap abstraction around the different drawing back end bitmap representations
 CGFXLabelControlControl to display the graphics backend
 CIAboutBoxControlA "meta control" which you can attach child controls to display an about box, or preferences panel When you attach the control to the IGraphics context, it should be added last so it sits on top of other controls, and set hidden
 CIBButtonControlA bitmap button/momentary switch control
 CIBitmapUser-facing bitmap abstraction that you use to manage bitmap data, independant of draw class/platform
 CIBitmapBaseA base interface to be combined with IControl for bitmap-based controls "IBControls", managing an IBitmap
 CIBitmapControlA basic control to draw a bitmap, or one frame of a stacked bitmap depending on the current value
 CIBKnobControlA bitmap knob/dial control that draws a frame from a stacked bitmap
 CIBKnobRotaterControlA bitmap knob/dial control that rotates an image
 CIBlendUsed to manage composite/blend operations, independent of draw class/platform
 CIBMeterControlA bitmap meter control, that can be used for VUMeters
 CIBSliderControlA bitmap slider/fader control
 CIBSwitchControlA bitmap switch control
 CIBTextControlA control to display text using a monospace bitmap font
 CIBubbleControlA special control to draw contextual info as a slider etc is moved If used in the main IControl stack, you probably want it to be the very last control that is added, so that it gets drawn on top
 CIBufferSenderIBufferSender is a utility class which can be used to defer buffer data for sending to the GUI
 CIBusInfoUsed to manage information about a bus such as whether it's an input or output, channel count
 CIButtonControlBaseA base class for buttons/momentary switches - cannot be linked to parameters
 CIByteChunkManages a block of memory, for plug-in settings store/recall
 CIByteChunkReaderHelper class to maintain a read position whilst extracting data from an IByteChunk
+
 NDragAndDropHelpers
 CAPIBitmapA base class interface for a bitmap abstraction around the different drawing back end bitmap representations
 CGFXLabelControlControl to display the graphics backend
 CIAboutBoxControlA "meta control" which you can attach child controls to display an about box, or preferences panel When you attach the control to the IGraphics context, it should be added last so it sits on top of other controls, and set hidden
 CIBButtonControlA bitmap button/momentary switch control
 CIBitmapUser-facing bitmap abstraction that you use to manage bitmap data, independant of draw class/platform
 CIBitmapBaseA base interface to be combined with IControl for bitmap-based controls "IBControls", managing an IBitmap
 CIBitmapControlA basic control to draw a bitmap, or one frame of a stacked bitmap depending on the current value
 CIBKnobControlA bitmap knob/dial control that draws a frame from a stacked bitmap
 CIBKnobRotaterControlA bitmap knob/dial control that rotates an image
 CIBlendUsed to manage composite/blend operations, independent of draw class/platform
 CIBMeterControlA bitmap meter control, that can be used for VUMeters
 CIBSliderControlA bitmap slider/fader control
 CIBSwitchControlA bitmap switch control
 CIBTextControlA control to display text using a monospace bitmap font
 CIBubbleControlA special control to draw contextual info as a slider etc is moved If used in the main IControl stack, you probably want it to be the very last control that is added, so that it gets drawn on top
 CIBufferSenderIBufferSender is a utility class which can be used to defer buffer data for sending to the GUI
 CIBusInfoUsed to manage information about a bus such as whether it's an input or output, channel count
 CIButtonControlBaseA base class for buttons/momentary switches - cannot be linked to parameters
 CIByteChunkManages a block of memory, for plug-in settings store/recall
 CIByteChunkReaderHelper class to maintain a read position whilst extracting data from an IByteChunk
 CIByteGetterA helper class for IByteChunk and IByteStream that avoids code duplication
 CIByteStreamManages a non-owned block of memory, for receiving arbitrary message byte streams
 CICaptionControlA control to display the textual representation of a parameter
 CIChannelDataUsed to manage scratch buffers for each channel of I/O, which may involve converting from single to double precision
 CIColorUsed to manage color data, independent of draw class/platform
 CIColorPickerControlA control for choosing a color
 CIColorStopUsed to represent a point/stop in a gradient
 CIContainerBaseIContainerBase allows a control to nest sub controls and it clips the drawing of those subcontrols Inheritors can add child controls by overriding OnAttached() and calling AddChildControl(), or passing in an AttachFunc lambda to the construtor
 CIControlThe lowest level base class of an IGraphics control
 CICornerResizerControlA control for resizing the plug-in window by clicking and dragging in the bottom right-hand corner This can be added with IGraphics::AttachCornerResizer()
 CIDirBrowseControlBaseAn abstract IControl base class that you can inherit from in order to make a control that pops up a menu to browse files Optionally with a specific extension
 CIEditableTextControlA basic control to display some editable text
 CIEditorDelegateThis pure virtual interface delegates communication in both directions between a UI editor and something else (which is usually a plug-in) It is also the class that owns parameter objects (for historical reasons) - although it's not necessary to allocate them
 CIFillOptionsUsed to manage fill behaviour
 CIFlexBoxIFlexBox is a basic C++ helper for Yoga https://yogalayout.com
 CIFPSDisplayControlPerformance display meter, based on code from NanoVG This is a special control that lives outside the main IGraphics control stack
 CIGEditorDelegateAn editor delegate base class for a SOMETHING that uses IGraphics for it's UI
 CIGestureInfoUsed to describe a particular gesture
 CIGraphicsThe lowest level base class of an IGraphics context
 CIGraphicsCanvasIGraphics draw class HTML5 canvas
 CIGraphicsIOSIGraphics platform class for IOS
 CIGraphicsLinuxIGraphics platform class for linux
 CIGraphicsLiveEditA control to enable live modification of control layout in an IGraphics context in debug builds This is based on the work of Youlean, who first included it in iPlug-Youlean The lives outside the main IGraphics control stack and it can be added with IGraphics::EnableLiveEdit()
 CIGraphicsMacIGraphics platform class for macOS
 CIGraphicsNanoVGIGraphics draw class using NanoVG
+
 CIByteGetterA helper class for IByteChunk and IByteStream that avoids code duplication
 CIByteStreamManages a non-owned block of memory, for receiving arbitrary message byte streams
 CICaptionControlA control to display the textual representation of a parameter
 CIChannelDataUsed to manage scratch buffers for each channel of I/O, which may involve converting from single to double precision
 CIColorUsed to manage color data, independent of draw class/platform
 CIColorPickerControlA control for choosing a color
 CIColorStopUsed to represent a point/stop in a gradient
 CIContainerBaseIContainerBase allows a control to nest sub controls and it clips the drawing of those subcontrols Inheritors can add child controls by overriding OnAttached() and calling AddChildControl(), or passing in an AttachFunc lambda to the construtor
 CIControlThe lowest level base class of an IGraphics control
 CICornerResizerControlA control for resizing the plug-in window by clicking and dragging in the bottom right-hand corner This can be added with IGraphics::AttachCornerResizer()
 CIDirBrowseControlBaseAn abstract IControl base class that you can inherit from in order to make a control that pops up a menu to browse files Optionally with a specific extension
 CIEditableTextControlA basic control to display some editable text
 CIEditorDelegateThis pure virtual interface delegates communication in both directions between a UI editor and something else (which is usually a plug-in) It is also the class that owns parameter objects (for historical reasons) - although it's not necessary to allocate them
 CIFillOptionsUsed to manage fill behaviour
 CIFlexBoxIFlexBox is a basic C++ helper for Yoga https://yogalayout.com
 CIFPSDisplayControlPerformance display meter, based on code from NanoVG This is a special control that lives outside the main IGraphics control stack
 CIGEditorDelegateAn editor delegate base class for a SOMETHING that uses IGraphics for it's UI
 CIGestureInfoUsed to describe a particular gesture
 CIGraphicsThe lowest level base class of an IGraphics context
 CIGraphicsCanvasIGraphics draw class HTML5 canvas
 CIGraphicsIOSIGraphics platform class for IOS
 CIGraphicsLinuxIGraphics platform class for linux
 CIGraphicsLiveEditA control to enable live modification of control layout in an IGraphics context in debug builds This is based on the work of Youlean, who first included it in iPlug-Youlean The lives outside the main IGraphics control stack and it can be added with IGraphics::EnableLiveEdit()
 CIGraphicsMacIGraphics platform class for macOS
 CIGraphicsNanoVGIGraphics draw class using NanoVG
 CIGraphicsSkiaIGraphics draw class using Skia
 CIGraphicsWebIGraphics platform class for the web
 CIGraphicsWinIGraphics platform class for Windows
 CIKeyPressUsed for key press info, such as ASCII representation, virtual key (mapped to win32 codes) and modifiers
 CIKnobControlBaseA base class for knob/dial controls, to handle mouse action and Sender
 CILambdaControlA control that can be specialised with a lambda function, for quick experiments without making a custom IControl
 CILayerAn abstraction that is used to store a temporary raster image/framebuffer
 CILEDControlGlowing LED control
 CIMatrixUsed to store transformation matrices
 CIMidiMsgEncapsulates a MIDI message and provides helper functions
 CIMidiQueueA class to help with queuing timestamped MIDI messages
 CIMouseInfoUsed to group mouse coordinates with mouse modifier information
 CIMouseModUsed to manage mouse modifiers i.e
 CIMultiLineTextControlA basic control to display some text that needs to span multiple lines
 CIMultiTouchControlBaseA base class for controls that can do do multitouch
 CIOConfigAn IOConfig is used to store bus info for each input/output configuration defined in the channel io string
 CIPanelControlA basic control to fill a rectangle with a color or gradient
 CIParamIPlug's parameter class
 CIPatternUsed to store pattern information for gradients
 CIPeakAvgSenderIPeakAvgSender is a utility class which can be used to defer peak & avg/RMS data from sample buffers for sending to the GUI It also features an envelope follower to control meter ballistics
 CIPeakSenderIPeakSender is a utility class which can be used to defer peak data from sample buffers for sending to the GUI It sends the average peak value over a certain time window
 CIPlatformViewControlA control that let's you embed a HWND, UIView or NSView inside an IGraphics UI
 CIPLUG_AUVIEWCONTROLLER
 CIPlugAAXAAX API base class for an IPlug plug-in
 CIPlugAPIBaseThe base class of an IPlug plug-in, which interacts with the different plug-in APIs
 CIPlugAPPStandalone application base class for an IPlug plug-in
 CIPlugAPPHostA class that hosts an IPlug as a standalone app and provides Audio/Midi I/O
 CIPlugAUAudioUnit v2 API base class for an IPlug plug-in
 CIPlugAUFactoryAudioUnit v2 Factory Class Template
 CIPlugAUv3AudioUnit v3 API base class for an IPlug plug-in
 CIPluginBaseBase class that contains plug-in info and state manipulation methods
 CIPlugProcessorThe base class for IPlug Audio Processing
 CIPlugQueueA lock-free SPSC queue used to transfer data between threads based on MLQueue.h by Randy Jones based on https://kjellkod.wordpress.com/2012/11/28/c-debt-paid-in-full-wait-free-lock-free-queue/
 CIPlugReaperVST2Reaper specific VST2.4 API base class for an IPlug plug-in
 CIPlugVST2VST2.4 API base class for an IPlug plug-in
 CIPlugVST3VST3 base class for a non-distributed IPlug VST3 plug-in
 CIPlugVST3BypassParameterVST3 bypass parameter helper
 CIPlugVST3ControllerVST3 Controller API-base class for a distributed IPlug VST3 plug-in
 CIPlugVST3ControllerBaseShared VST3 controller code
 CIPlugVST3PresetParameterVST3 preset parameter helper
 CIPlugVST3ProcessorVST3 Processor API-base class for a distributed IPlug VST3 plug-in
 CIPlugVST3ProcessorBaseShared VST3 processor code
 CIPlugVST3StateShared VST3 State management code
 CIPlugWAMWebAudioModule (WAM) API base class
 CIPlugWebThis is used for the UI "editor" - controller side of a WAM or remote editors that communicate with desktop iPlug plug-ins via web sockets
 CIPopupMenuA class for setting the contents of a pop up menu
 CIPopupMenuControlA base control for a pop-up menu/drop-down list that stays within the bounds of the IGraphics context
 CIPresetA struct used for specifying baked-in factory presets
 CIRECTUsed to manage a rectangular area, independent of draw class/platform
 CIRECTListUsed to manage a list of rectangular areas and optimize them for drawing to the screen
 CIRTTextControlA control to display some text in the UI, driven by values in the RT audio thread
 CISenderISender is a utility class which can be used to defer data from the realtime audio processing and send it to the GUI for visualization
 CISenderDataISenderData is used to represent a typed data packet, that may contain values for multiple channels
 CIShaderControlThis control allows you to draw to the UI via a shader written using the Skia shading language, which is similar to GLSL
 CIShadowUsed to specify properties of a drop-shadow to a layer
 CISkLottieControlA control that hosts a Lottie animation, via Skia's Skottie module https://skia.org/user/modules/skottie
 CISkParagraphControlA control that demonstrates how to draw rich text using SkParagraph
 CISliderControlBaseA base class for slider/fader controls, to handle mouse action and Sender
 CIStrokeOptionsUsed to manage stroke behaviour for path based drawing back ends
 CISVGUser-facing SVG abstraction that you use to manage SVG data ISVG doesn't actually own the image data
 CISVGButtonControlA vector button/momentary switch control which shows an SVG image
 CISVGControlA basic control to draw an SVG image to the screen
 CISVGKnobControlA vector knob/dial control which rotates an SVG image
 CISVGSliderControlA Slider control with and SVG for track and handle
 CISVGSwitchControlA vector switch control which shows one of multiple SVG states
 CISVGToggleControlA vector toggle switch control which shows an SVG image
 CISwitchControlBaseA base class for switch controls
 CISysExA struct for dealing with SysEx messages
 CITextIText is used to manage font and text/text entry style for a piece of text on the UI, independent of draw class/platform
 CITextControlA basic control to display some text
 CITextEntryControlA Text entry widget drawn by IGraphics
 CITextToggleControlA control to toggle between two text strings on click
 CITimeInfoEncapsulates information about the host transport state
 CIURLControlA control to show a clickable URL, that changes color after clicking
 CIVBakedPresetManagerControlA "meta control" for a "preset manager" for "baked in" factory presets It adds several child buttons
 CIVButtonControlA vector button/momentary switch control
 CIVColorSpecContains a set of 9 colors used to theme IVControls
 CIVColorSwatchControlA control to show a color swatch of up to 9 colors
 CIVDiskPresetManagerControlA "meta control" for a "preset manager" for disk-based preset files It adds several child buttons
 CIVDisplayControlA control to display a rolling graphics of historical values
 CIVec2Encapsulate an xy point in one struct
 CIVectorBaseA base interface to be combined with IControl for vectorial controls "IVControls", in order for them to share a common style If you need more flexibility, you're on your own!
 CIVGroupControlA control to draw a rectangle around a named IControl group
 CIVKeyboardControlVectorial keyboard control
 CIVKnobControlA vector knob control drawn using graphics primitives
 CIVLabelControlA vector label control that can display text with a shadow
 CIVLEDMeterControlVectorial multi-channel capable meter control with segmented LEDs, log response
 CIVMenuButtonControlA vector button that pops up a menu
 CIVMeterControlVectorial multi-channel capable meter control, linear or log response
 CIVMultiSliderControlA vectorial multi-slider control
 CIVMultiToggleControlA vectorial multi-toggle control, could be used for a trigger in a step sequencer or tarnce gate
 CIVNumberBoxControlA "meta control" for a number box with an Inc/Dec button It adds several child buttons if buttons = true
 CIVPanelControlA panel control which can be styled with emboss etc
 CIVPeakAvgMeterControlVectorial multi-channel capable meter control, with log response, held-peaks and filled-average/rms Requires an IPeakAvgSender
 CIVPlotControlA vector plot to display functions and waveforms
 CIVRadioButtonControlA vector "radio buttons" switch control
 CIVRangeSliderControlA vector range slider control, with two handles
 CIVScopeControlVectorial multi-channel capable oscilloscope control
 CIVSliderControlA vector slider control
 CIVSlideSwitchControlA switch with a slide animation when clicked
 CIVStyleA struct encapsulating a set of properties used to configure IVControls
 CIVSwitchControlA vector switch control
 CIVTabbedPagesControlA control to manage tabbed pages of sub controls Basic usage example:
 CIVTabPageA control used as the base class for a tabbed page of subcontrols
 CIVTabSwitchControlA vector "tab" multi switch control
 CIVToggleControlA vector toggle control
 CIVTrackControlBaseA base class for mult-strip/track controls, such as multi-sliders, meters Track refers to the channel/strip, Step refers to cross-axis steps, e.g
 CIVXYPadControlA vector XY Pad slider control
 CIWebViewControlA control that allows the embedding of HTML UI inside an IGraphics context using a platform-native webview and bi-directional communication with that content NOTE: this control attaches a sub view on top of the IGraphics view, so it will render all content on-top The platform native webviews run in a separate process and communicate via IPC
 CIWheelControlVectorial "wheel" control for pitchbender/modwheel
 CParamTupleIn certain cases we need to queue parameter changes for transferral between threads
 CPlaceHolderA control to use as a placeholder during development
 CReaperActionHelper struct for registering Reaper Actions
 CReaperExtBaseReaper extension base class interface
 CSysExDataThis structure is used when queueing Sysex messages
 CTestAnimationControlControl to test animation
 CTestArcControlControl to test drawing arcs
 CTestBezierControlControl to test drawing bezier curves
 CTestBlendControlControl to test blend methods
 CTestColorControlControl to colors
 CTestCursorControlControl to test changing the platform cursor
 CTestCustomShaderControlControl to test IGraphicsNanoVG with Metal Shaders
 CTestDirBrowseControlControl to test IDirBrowseControlBase
 CTestDragAndDropControlControl to test dropping single and multiple files
 CTestDrawContextControlControl to test obtaining a drawing API (NanoVG, Skia, Canvas) context and using that API within an IControl
 CTestDropShadowControlControl to test layer drop shadows
 CTestFlexBoxControlControl to test IGraphicsFlexBox
 CTestFontControlControl to test drawing fonts
 CTestGesturesControlControl to test multi gesture recognizers
 CTestGradientControlControl to test drawing gradients with path based drawing backends
 CTestImageControlControl to test drawing bitmaps
 CTestKeyboardControlControl to test keyboard input
 CTestLayerControlControl to test IGraphics layers
 CTestMaskControlControl to display the size of a region
 CTestMPSControlControl to test IGraphicsNanoVG with Metal Performance Shaders
 CTestMTControlControl to test multi touch
 CTestMultiPathControlControl to test drawing paths in path-based drawing backends
 CTestPolyControlControl to test drawing polygons
 CTestShadowGradientControlControl to test drawing shadows with gradients
 CTestSizeControlControl to display the size of a region
 CTestSVGControlControl to test drawing SVGs
 CTestTextControlControl to test drawing text
 CTestTextOrientationControlControl to test drawing text with orientation
 CTestTextSizeControlControl to test drawing text with varying size
 CTimerBase class for timer
 CIGraphicsSkiaIGraphics draw class using Skia
 CIGraphicsWebIGraphics platform class for the web
 CIGraphicsWinIGraphics platform class for Windows
 CIKeyPressUsed for key press info, such as ASCII representation, virtual key (mapped to win32 codes) and modifiers
 CIKnobControlBaseA base class for knob/dial controls, to handle mouse action and Sender
 CILambdaControlA control that can be specialised with a lambda function, for quick experiments without making a custom IControl
 CILayerAn abstraction that is used to store a temporary raster image/framebuffer
 CILEDControlGlowing LED control
 CIMatrixUsed to store transformation matrices
 CIMidiMsgEncapsulates a MIDI message and provides helper functions
 CIMidiQueueA class to help with queuing timestamped MIDI messages
 CIMouseInfoUsed to group mouse coordinates with mouse modifier information
 CIMouseModUsed to manage mouse modifiers i.e
 CIMultiLineTextControlA basic control to display some text that needs to span multiple lines
 CIMultiTouchControlBaseA base class for controls that can do do multitouch
 CIOConfigAn IOConfig is used to store bus info for each input/output configuration defined in the channel io string
 CIPanelControlA basic control to fill a rectangle with a color or gradient
 CIParamIPlug's parameter class
 CIPatternUsed to store pattern information for gradients
 CIPeakAvgSenderIPeakAvgSender is a utility class which can be used to defer peak & avg/RMS data from sample buffers for sending to the GUI It also features an envelope follower to control meter ballistics
 CIPeakSenderIPeakSender is a utility class which can be used to defer peak data from sample buffers for sending to the GUI It sends the average peak value over a certain time window
 CIPlatformViewControlA control that let's you embed a HWND, UIView or NSView inside an IGraphics UI
 CIPLUG_AUVIEWCONTROLLER
 CIPlugAAXAAX API base class for an IPlug plug-in
 CIPlugAPIBaseThe base class of an IPlug plug-in, which interacts with the different plug-in APIs
 CIPlugAPPStandalone application base class for an IPlug plug-in
 CIPlugAPPHostA class that hosts an IPlug as a standalone app and provides Audio/Midi I/O
 CIPlugAUAudioUnit v2 API base class for an IPlug plug-in
 CIPlugAUFactoryAudioUnit v2 Factory Class Template
 CIPlugAUv3AudioUnit v3 API base class for an IPlug plug-in
 CIPluginBaseBase class that contains plug-in info and state manipulation methods
 CIPlugProcessorThe base class for IPlug Audio Processing
 CIPlugQueueA lock-free SPSC queue used to transfer data between threads based on MLQueue.h by Randy Jones based on https://kjellkod.wordpress.com/2012/11/28/c-debt-paid-in-full-wait-free-lock-free-queue/
 CIPlugReaperVST2Reaper specific VST2.4 API base class for an IPlug plug-in
 CIPlugVST2VST2.4 API base class for an IPlug plug-in
 CIPlugVST3VST3 base class for a non-distributed IPlug VST3 plug-in
 CIPlugVST3BypassParameterVST3 bypass parameter helper
 CIPlugVST3ControllerVST3 Controller API-base class for a distributed IPlug VST3 plug-in
 CIPlugVST3ControllerBaseShared VST3 controller code
 CIPlugVST3PresetParameterVST3 preset parameter helper
 CIPlugVST3ProcessorVST3 Processor API-base class for a distributed IPlug VST3 plug-in
 CIPlugVST3ProcessorBaseShared VST3 processor code
 CIPlugVST3StateShared VST3 State management code
 CIPlugWAMWebAudioModule (WAM) API base class
 CIPlugWebThis is used for the UI "editor" - controller side of a WAM or remote editors that communicate with desktop iPlug plug-ins via web sockets
 CIPopupMenuA class for setting the contents of a pop up menu
 CIPopupMenuControlA base control for a pop-up menu/drop-down list that stays within the bounds of the IGraphics context
 CIPresetA struct used for specifying baked-in factory presets
 CIRECTUsed to manage a rectangular area, independent of draw class/platform
 CIRECTListUsed to manage a list of rectangular areas and optimize them for drawing to the screen
 CIRTTextControlA control to display some text in the UI, driven by values in the RT audio thread
 CISenderISender is a utility class which can be used to defer data from the realtime audio processing and send it to the GUI for visualization
 CISenderDataISenderData is used to represent a typed data packet, that may contain values for multiple channels
 CIShaderControlThis control allows you to draw to the UI via a shader written using the Skia shading language, which is similar to GLSL
 CIShadowUsed to specify properties of a drop-shadow to a layer
 CISkLottieControlA control that hosts a Lottie animation, via Skia's Skottie module https://skia.org/user/modules/skottie
 CISkParagraphControlA control that demonstrates how to draw rich text using SkParagraph
 CISliderControlBaseA base class for slider/fader controls, to handle mouse action and Sender
 CIStrokeOptionsUsed to manage stroke behaviour for path based drawing back ends
 CISVGUser-facing SVG abstraction that you use to manage SVG data ISVG doesn't actually own the image data
 CISVGButtonControlA vector button/momentary switch control which shows an SVG image
 CISVGControlA basic control to draw an SVG image to the screen
 CISVGKnobControlA vector knob/dial control which rotates an SVG image
 CISVGSliderControlA Slider control with and SVG for track and handle
 CISVGSwitchControlA vector switch control which shows one of multiple SVG states
 CISVGToggleControlA vector toggle switch control which shows an SVG image
 CISwitchControlBaseA base class for switch controls
 CISysExA struct for dealing with SysEx messages
 CITextIText is used to manage font and text/text entry style for a piece of text on the UI, independent of draw class/platform
 CITextControlA basic control to display some text
 CITextEntryControlA Text entry widget drawn by IGraphics
 CITextToggleControlA control to toggle between two text strings on click
 CITimeInfoEncapsulates information about the host transport state
 CIURLControlA control to show a clickable URL, that changes color after clicking
 CIVBakedPresetManagerControlA "meta control" for a "preset manager" for "baked in" factory presets It adds several child buttons
 CIVButtonControlA vector button/momentary switch control
 CIVColorSpecContains a set of 9 colors used to theme IVControls
 CIVColorSwatchControlA control to show a color swatch of up to 9 colors
 CIVDiskPresetManagerControlA "meta control" for a "preset manager" for disk-based preset files It adds several child buttons
 CIVDisplayControlA control to display a rolling graphics of historical values
 CIVec2Encapsulate an xy point in one struct
 CIVectorBaseA base interface to be combined with IControl for vectorial controls "IVControls", in order for them to share a common style If you need more flexibility, you're on your own!
 CIVGroupControlA control to draw a rectangle around a named IControl group
 CIVKeyboardControlVectorial keyboard control
 CIVKnobControlA vector knob control drawn using graphics primitives
 CIVLabelControlA vector label control that can display text with a shadow
 CIVLEDMeterControlVectorial multi-channel capable meter control with segmented LEDs, log response
 CIVMenuButtonControlA vector button that pops up a menu
 CIVMeterControlVectorial multi-channel capable meter control, linear or log response
 CIVMultiSliderControlA vectorial multi-slider control
 CIVMultiToggleControlA vectorial multi-toggle control, could be used for a trigger in a step sequencer or tarnce gate
 CIVNumberBoxControlA "meta control" for a number box with an Inc/Dec button It adds several child buttons if buttons = true
 CIVPanelControlA panel control which can be styled with emboss etc
 CIVPeakAvgMeterControlVectorial multi-channel capable meter control, with log response, held-peaks and filled-average/rms Requires an IPeakAvgSender
 CIVPlotControlA vector plot to display functions and waveforms
 CIVRadioButtonControlA vector "radio buttons" switch control
 CIVRangeSliderControlA vector range slider control, with two handles
 CIVScopeControlVectorial multi-channel capable oscilloscope control
 CIVSliderControlA vector slider control
 CIVSlideSwitchControlA switch with a slide animation when clicked
 CIVStyleA struct encapsulating a set of properties used to configure IVControls
 CIVSwitchControlA vector switch control
 CIVTabbedPagesControlA control to manage tabbed pages of sub controls Basic usage example:
 CIVTabPageA control used as the base class for a tabbed page of subcontrols
 CIVTabSwitchControlA vector "tab" multi switch control
 CIVToggleControlA vector toggle control
 CIVTrackControlBaseA base class for mult-strip/track controls, such as multi-sliders, meters Track refers to the channel/strip, Step refers to cross-axis steps, e.g
 CIVXYPadControlA vector XY Pad slider control
 CIWebViewControlA control that allows the embedding of HTML UI inside an IGraphics context using a platform-native webview and bi-directional communication with that content NOTE: this control attaches a sub view on top of the IGraphics view, so it will render all content on-top The platform native webviews run in a separate process and communicate via IPC
 CIWheelControlVectorial "wheel" control for pitchbender/modwheel
 CParamTupleIn certain cases we need to queue parameter changes for transferral between threads
 CPlaceHolderA control to use as a placeholder during development
 CReaperActionHelper struct for registering Reaper Actions
 CReaperExtBaseReaper extension base class interface
 CSysExDataThis structure is used when queueing Sysex messages
 CTestAnimationControlControl to test animation
 CTestArcControlControl to test drawing arcs
 CTestBezierControlControl to test drawing bezier curves
 CTestBlendControlControl to test blend methods
 CTestColorControlControl to colors
 CTestCursorControlControl to test changing the platform cursor
 CTestCustomShaderControlControl to test IGraphicsNanoVG with Metal Shaders
 CTestDirBrowseControlControl to test IDirBrowseControlBase
 CTestDragAndDropControlControl to test dropping single and multiple files
 CTestDrawContextControlControl to test obtaining a drawing API (NanoVG, Skia, Canvas) context and using that API within an IControl
 CTestDropShadowControlControl to test layer drop shadows
 CTestFlexBoxControlControl to test IGraphicsFlexBox
 CTestFontControlControl to test drawing fonts
 CTestGesturesControlControl to test multi gesture recognizers
 CTestGradientControlControl to test drawing gradients with path based drawing backends
 CTestImageControlControl to test drawing bitmaps
 CTestKeyboardControlControl to test keyboard input
 CTestLayerControlControl to test IGraphics layers
 CTestMaskControlControl to display the size of a region
 CTestMPSControlControl to test IGraphicsNanoVG with Metal Performance Shaders
 CTestMTControlControl to test multi touch
 CTestMultiPathControlControl to test drawing paths in path-based drawing backends
 CTestPolyControlControl to test drawing polygons
 CTestShadowGradientControlControl to test drawing shadows with gradients
 CTestSizeControlControl to display the size of a region
 CTestSVGControlControl to test drawing SVGs
 CTestTextControlControl to test drawing text
 CTestTextOrientationControlControl to test drawing text with orientation
 CTestTextSizeControlControl to test drawing text with varying size
 CTimerBase class for timer
diff --git a/class_drag_and_drop_helpers_1_1_data_object-members.html b/class_drag_and_drop_helpers_1_1_data_object-members.html new file mode 100644 index 00000000..2c04c768 --- /dev/null +++ b/class_drag_and_drop_helpers_1_1_data_object-members.html @@ -0,0 +1,112 @@ + + + + + + + + +iPlug 2: Member List + + + + + + + + + + + + +
+
+ + + + + + +
+
iPlug2 - C++ Audio Plug-in Framework +
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
DragAndDropHelpers::DataObject Member List
+
+
+ +

This is the complete list of members for DragAndDropHelpers::DataObject, including all inherited members.

+ + + + + + + + + + + + + + + + +
acceptFormat(FORMATETC *f) (defined in DragAndDropHelpers::DataObject)DragAndDropHelpers::DataObjectinline
AddRef() (defined in DragAndDropHelpers::DataObject)DragAndDropHelpers::DataObjectinline
DAdvise(FORMATETC *, DWORD, IAdviseSink *, DWORD *) (defined in DragAndDropHelpers::DataObject)DragAndDropHelpers::DataObjectinline
DataObject(const FORMATETC *f, const char *filePath) (defined in DragAndDropHelpers::DataObject)DragAndDropHelpers::DataObjectinline
DUnadvise(DWORD) (defined in DragAndDropHelpers::DataObject)DragAndDropHelpers::DataObjectinline
EnumDAdvise(IEnumSTATDATA **) (defined in DragAndDropHelpers::DataObject)DragAndDropHelpers::DataObjectinline
EnumFormatEtc(DWORD direction, IEnumFORMATETC **resultHandle) override (defined in DragAndDropHelpers::DataObject)DragAndDropHelpers::DataObjectinline
GetCanonicalFormatEtc(FORMATETC *, FORMATETC *pFormatOut) override (defined in DragAndDropHelpers::DataObject)DragAndDropHelpers::DataObjectinline
GetData(FORMATETC *pFormat, STGMEDIUM *pMedium) (defined in DragAndDropHelpers::DataObject)DragAndDropHelpers::DataObjectinline
GetDataHere(FORMATETC *, STGMEDIUM *) (defined in DragAndDropHelpers::DataObject)DragAndDropHelpers::DataObjectinline
QueryGetData(FORMATETC *pFormat) (defined in DragAndDropHelpers::DataObject)DragAndDropHelpers::DataObjectinline
QueryInterface(REFIID refiid, void **resultHandle) (defined in DragAndDropHelpers::DataObject)DragAndDropHelpers::DataObjectinline
Release() (defined in DragAndDropHelpers::DataObject)DragAndDropHelpers::DataObjectinline
SetData(FORMATETC *, STGMEDIUM *, BOOL) (defined in DragAndDropHelpers::DataObject)DragAndDropHelpers::DataObjectinline
~DataObject() (defined in DragAndDropHelpers::DataObject)DragAndDropHelpers::DataObjectinlinevirtual
+ + + + diff --git a/class_drag_and_drop_helpers_1_1_data_object.html b/class_drag_and_drop_helpers_1_1_data_object.html new file mode 100644 index 00000000..62d81299 --- /dev/null +++ b/class_drag_and_drop_helpers_1_1_data_object.html @@ -0,0 +1,658 @@ + + + + + + + + +iPlug 2: DragAndDropHelpers::DataObject Class Reference + + + + + + + + + + + + +
+
+ + + + + + +
+
iPlug2 - C++ Audio Plug-in Framework +
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +List of all members
+
DragAndDropHelpers::DataObject Class Reference
+
+
+
+Inheritance diagram for DragAndDropHelpers::DataObject:
+
+
+
+
[legend]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 DataObject (const FORMATETC *f, const char *filePath)
 
HRESULT STDMETHODCALLTYPE QueryInterface (REFIID refiid, void **resultHandle)
 
ULONG STDMETHODCALLTYPE AddRef ()
 
ULONG STDMETHODCALLTYPE Release ()
 
bool acceptFormat (FORMATETC *f)
 
HRESULT STDMETHODCALLTYPE GetData (FORMATETC *pFormat, STGMEDIUM *pMedium)
 
HRESULT STDMETHODCALLTYPE QueryGetData (FORMATETC *pFormat)
 
HRESULT GetCanonicalFormatEtc (FORMATETC *, FORMATETC *pFormatOut) override
 
HRESULT EnumFormatEtc (DWORD direction, IEnumFORMATETC **resultHandle) override
 
HRESULT STDMETHODCALLTYPE GetDataHere (FORMATETC *, STGMEDIUM *)
 
HRESULT STDMETHODCALLTYPE SetData (FORMATETC *, STGMEDIUM *, BOOL)
 
HRESULT STDMETHODCALLTYPE DAdvise (FORMATETC *, DWORD, IAdviseSink *, DWORD *)
 
HRESULT STDMETHODCALLTYPE DUnadvise (DWORD)
 
HRESULT STDMETHODCALLTYPE EnumDAdvise (IEnumSTATDATA **)
 
+

Detailed Description

+
+

Definition at line 178 of file IGraphicsWin_dnd.h.

+

Constructor & Destructor Documentation

+ +

◆ DataObject()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
DragAndDropHelpers::DataObject::DataObject (const FORMATETC * f,
const char * filePath 
)
+
+inline
+
+ +

Definition at line 181 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ ~DataObject()

+ +
+
+ + + + + +
+ + + + + + + +
virtual DragAndDropHelpers::DataObject::~DataObject ()
+
+inlinevirtual
+
+ +

Definition at line 186 of file IGraphicsWin_dnd.h.

+ +
+
+

Member Function Documentation

+ +

◆ acceptFormat()

+ +
+
+ + + + + +
+ + + + + + + + +
bool DragAndDropHelpers::DataObject::acceptFormat (FORMATETC * f)
+
+inline
+
+ +

Definition at line 215 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ AddRef()

+ +
+
+ + + + + +
+ + + + + + + +
ULONG STDMETHODCALLTYPE DragAndDropHelpers::DataObject::AddRef ()
+
+inline
+
+ +

Definition at line 203 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ DAdvise()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
HRESULT STDMETHODCALLTYPE DragAndDropHelpers::DataObject::DAdvise (FORMATETC * ,
DWORD ,
IAdviseSink * ,
DWORD *  
)
+
+inline
+
+ +

Definition at line 302 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ DUnadvise()

+ +
+
+ + + + + +
+ + + + + + + + +
HRESULT STDMETHODCALLTYPE DragAndDropHelpers::DataObject::DUnadvise (DWORD )
+
+inline
+
+ +

Definition at line 303 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ EnumDAdvise()

+ +
+
+ + + + + +
+ + + + + + + + +
HRESULT STDMETHODCALLTYPE DragAndDropHelpers::DataObject::EnumDAdvise (IEnumSTATDATA ** )
+
+inline
+
+ +

Definition at line 304 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ EnumFormatEtc()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
HRESULT DragAndDropHelpers::DataObject::EnumFormatEtc (DWORD direction,
IEnumFORMATETC ** resultHandle 
)
+
+inlineoverride
+
+ +

Definition at line 284 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ GetCanonicalFormatEtc()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
HRESULT DragAndDropHelpers::DataObject::GetCanonicalFormatEtc (FORMATETC * ,
FORMATETC * pFormatOut 
)
+
+inlineoverride
+
+ +

Definition at line 278 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ GetData()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
HRESULT STDMETHODCALLTYPE DragAndDropHelpers::DataObject::GetData (FORMATETC * pFormat,
STGMEDIUM * pMedium 
)
+
+inline
+
+ +

Definition at line 220 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ GetDataHere()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
HRESULT STDMETHODCALLTYPE DragAndDropHelpers::DataObject::GetDataHere (FORMATETC * ,
STGMEDIUM *  
)
+
+inline
+
+ +

Definition at line 300 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ QueryGetData()

+ +
+
+ + + + + +
+ + + + + + + + +
HRESULT STDMETHODCALLTYPE DragAndDropHelpers::DataObject::QueryGetData (FORMATETC * pFormat)
+
+inline
+
+ +

Definition at line 263 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ QueryInterface()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
HRESULT STDMETHODCALLTYPE DragAndDropHelpers::DataObject::QueryInterface (REFIID refiid,
void ** resultHandle 
)
+
+inline
+
+ +

Definition at line 191 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ Release()

+ +
+
+ + + + + +
+ + + + + + + +
ULONG STDMETHODCALLTYPE DragAndDropHelpers::DataObject::Release ()
+
+inline
+
+ +

Definition at line 204 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ SetData()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
HRESULT STDMETHODCALLTYPE DragAndDropHelpers::DataObject::SetData (FORMATETC * ,
STGMEDIUM * ,
BOOL  
)
+
+inline
+
+ +

Definition at line 301 of file IGraphicsWin_dnd.h.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/class_drag_and_drop_helpers_1_1_data_object__inherit__graph.map b/class_drag_and_drop_helpers_1_1_data_object__inherit__graph.map new file mode 100644 index 00000000..6265f843 --- /dev/null +++ b/class_drag_and_drop_helpers_1_1_data_object__inherit__graph.map @@ -0,0 +1,4 @@ + + + + diff --git a/class_drag_and_drop_helpers_1_1_data_object__inherit__graph.md5 b/class_drag_and_drop_helpers_1_1_data_object__inherit__graph.md5 new file mode 100644 index 00000000..d82abc04 --- /dev/null +++ b/class_drag_and_drop_helpers_1_1_data_object__inherit__graph.md5 @@ -0,0 +1 @@ +fbffb025264a39d4cb763f19376cd4ad \ No newline at end of file diff --git a/class_drag_and_drop_helpers_1_1_data_object__inherit__graph.svg b/class_drag_and_drop_helpers_1_1_data_object__inherit__graph.svg new file mode 100644 index 00000000..b72bcd10 --- /dev/null +++ b/class_drag_and_drop_helpers_1_1_data_object__inherit__graph.svg @@ -0,0 +1,37 @@ + + + + + + +DragAndDropHelpers::DataObject + + +Node1 + + +DragAndDropHelpers +::DataObject + + + + + +Node2 + + +IDataObject + + + + + +Node2->Node1 + + + + + diff --git a/class_drag_and_drop_helpers_1_1_drop_source-members.html b/class_drag_and_drop_helpers_1_1_drop_source-members.html new file mode 100644 index 00000000..553ed88c --- /dev/null +++ b/class_drag_and_drop_helpers_1_1_drop_source-members.html @@ -0,0 +1,104 @@ + + + + + + + + +iPlug 2: Member List + + + + + + + + + + + + +
+
+ + + + + + +
+
iPlug2 - C++ Audio Plug-in Framework +
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
DragAndDropHelpers::DropSource Member List
+
+
+ +

This is the complete list of members for DragAndDropHelpers::DropSource, including all inherited members.

+ + + + + + + + +
AddRef() override (defined in DragAndDropHelpers::DropSource)DragAndDropHelpers::DropSourceinline
DropSource() (defined in DragAndDropHelpers::DropSource)DragAndDropHelpers::DropSourceinline
GiveFeedback(DWORD) override (defined in DragAndDropHelpers::DropSource)DragAndDropHelpers::DropSourceinline
QueryContinueDrag(BOOL escapeKeyPressed, DWORD grfKeyState) override (defined in DragAndDropHelpers::DropSource)DragAndDropHelpers::DropSourceinline
QueryInterface(REFIID refiid, void **resultHandle) override (defined in DragAndDropHelpers::DropSource)DragAndDropHelpers::DropSourceinline
Release() override (defined in DragAndDropHelpers::DropSource)DragAndDropHelpers::DropSourceinline
~DropSource() (defined in DragAndDropHelpers::DropSource)DragAndDropHelpers::DropSourceinline
+ + + + diff --git a/class_drag_and_drop_helpers_1_1_drop_source.html b/class_drag_and_drop_helpers_1_1_drop_source.html new file mode 100644 index 00000000..523070b6 --- /dev/null +++ b/class_drag_and_drop_helpers_1_1_drop_source.html @@ -0,0 +1,337 @@ + + + + + + + + +iPlug 2: DragAndDropHelpers::DropSource Class Reference + + + + + + + + + + + + +
+
+ + + + + + +
+
iPlug2 - C++ Audio Plug-in Framework +
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
+Public Member Functions | +List of all members
+
DragAndDropHelpers::DropSource Class Reference
+
+
+
+Inheritance diagram for DragAndDropHelpers::DropSource:
+
+
+
+
[legend]
+ + + + + + + + + + + + +

+Public Member Functions

HRESULT STDMETHODCALLTYPE QueryInterface (REFIID refiid, void **resultHandle) override
 
ULONG STDMETHODCALLTYPE AddRef () override
 
ULONG STDMETHODCALLTYPE Release () override
 
HRESULT STDMETHODCALLTYPE QueryContinueDrag (BOOL escapeKeyPressed, DWORD grfKeyState) override
 
HRESULT STDMETHODCALLTYPE GiveFeedback (DWORD) override
 
+

Detailed Description

+
+

Definition at line 20 of file IGraphicsWin_dnd.h.

+

Constructor & Destructor Documentation

+ +

◆ DropSource()

+ +
+
+ + + + + +
+ + + + + + + +
DragAndDropHelpers::DropSource::DropSource ()
+
+inline
+
+ +

Definition at line 23 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ ~DropSource()

+ +
+
+ + + + + +
+ + + + + + + +
DragAndDropHelpers::DropSource::~DropSource ()
+
+inline
+
+ +

Definition at line 24 of file IGraphicsWin_dnd.h.

+ +
+
+

Member Function Documentation

+ +

◆ AddRef()

+ +
+
+ + + + + +
+ + + + + + + +
ULONG STDMETHODCALLTYPE DragAndDropHelpers::DropSource::AddRef ()
+
+inlineoverride
+
+ +

Definition at line 41 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ GiveFeedback()

+ +
+
+ + + + + +
+ + + + + + + + +
HRESULT STDMETHODCALLTYPE DragAndDropHelpers::DropSource::GiveFeedback (DWORD )
+
+inlineoverride
+
+ +

Definition at line 69 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ QueryContinueDrag()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
HRESULT STDMETHODCALLTYPE DragAndDropHelpers::DropSource::QueryContinueDrag (BOOL escapeKeyPressed,
DWORD grfKeyState 
)
+
+inlineoverride
+
+ +

Definition at line 54 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ QueryInterface()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
HRESULT STDMETHODCALLTYPE DragAndDropHelpers::DropSource::QueryInterface (REFIID refiid,
void ** resultHandle 
)
+
+inlineoverride
+
+ +

Definition at line 29 of file IGraphicsWin_dnd.h.

+ +
+
+ +

◆ Release()

+ +
+
+ + + + + +
+ + + + + + + +
ULONG STDMETHODCALLTYPE DragAndDropHelpers::DropSource::Release ()
+
+inlineoverride
+
+ +

Definition at line 42 of file IGraphicsWin_dnd.h.

+ +
+
+
The documentation for this class was generated from the following file: +
+ + + + diff --git a/class_drag_and_drop_helpers_1_1_drop_source__inherit__graph.map b/class_drag_and_drop_helpers_1_1_drop_source__inherit__graph.map new file mode 100644 index 00000000..707f54dd --- /dev/null +++ b/class_drag_and_drop_helpers_1_1_drop_source__inherit__graph.map @@ -0,0 +1,4 @@ + + + + diff --git a/class_drag_and_drop_helpers_1_1_drop_source__inherit__graph.md5 b/class_drag_and_drop_helpers_1_1_drop_source__inherit__graph.md5 new file mode 100644 index 00000000..4e302eb3 --- /dev/null +++ b/class_drag_and_drop_helpers_1_1_drop_source__inherit__graph.md5 @@ -0,0 +1 @@ +a2805202587421d019fd9bcd16c8a8fa \ No newline at end of file diff --git a/class_drag_and_drop_helpers_1_1_drop_source__inherit__graph.svg b/class_drag_and_drop_helpers_1_1_drop_source__inherit__graph.svg new file mode 100644 index 00000000..03840da5 --- /dev/null +++ b/class_drag_and_drop_helpers_1_1_drop_source__inherit__graph.svg @@ -0,0 +1,37 @@ + + + + + + +DragAndDropHelpers::DropSource + + +Node1 + + +DragAndDropHelpers +::DropSource + + + + + +Node2 + + +IDropSource + + + + + +Node2->Node1 + + + + + diff --git a/class_i_bubble_control.html b/class_i_bubble_control.html index 3117d0e4..275edd30 100644 --- a/class_i_bubble_control.html +++ b/class_i_bubble_control.html @@ -654,7 +654,7 @@

Definition at line 51 of file IBubbleControl.h.

-

References IGraphics::ControlIsCaptured(), IControl::GetUI(), IControl::Hide(), IControl::SetActionFunction(), IControl::SetAnimation(), IControl::SetAnimationEndActionFunction(), and IControl::SetDirty().

+

References IGraphics::ControlIsCaptured(), IControl::GetUI(), IControl::Hide(), IControl::SetActionFunction(), IControl::SetAnimation(), IControl::SetAnimationEndActionFunction(), and IControl::SetDirty().

diff --git a/class_i_control.html b/class_i_control.html index 0b18a8a4..0b42c5e3 100644 --- a/class_i_control.html +++ b/class_i_control.html @@ -1498,7 +1498,7 @@

Definition at line 421 of file IControl.h.

-

References IGraphics::GetControlTag(), and GetUI().

+

References IGraphics::GetControlTag(), and GetUI().

Referenced by IWheelControl::OnPopupMenuSelection(), IGraphics::RemoveControl(), and IGraphics::RemoveControls().

diff --git a/class_i_corner_resizer_control.html b/class_i_corner_resizer_control.html index c326042e..b2fea214 100644 --- a/class_i_corner_resizer_control.html +++ b/class_i_corner_resizer_control.html @@ -822,7 +822,7 @@

Definition at line 56 of file ICornerResizerControl.h.

-

References IGraphics::GetBounds(), IGraphics::GetDrawScale(), IRECT::GetFromBRHC(), IControl::GetUI(), and IControl::SetTargetAndDrawRECTs().

+

References IGraphics::GetBounds(), IGraphics::GetDrawScale(), IRECT::GetFromBRHC(), IControl::GetUI(), and IControl::SetTargetAndDrawRECTs().

diff --git a/class_i_graphics-members.html b/class_i_graphics-members.html index 78432005..6c5b6cdf 100644 --- a/class_i_graphics-members.html +++ b/class_i_graphics-members.html @@ -240,164 +240,165 @@ IGraphics(IGEditorDelegate &dlg, int w, int h, int fps=DEFAULT_FPS, float scale=1.) (defined in IGraphics)IGraphics IGraphics(const IGraphics &)=delete (defined in IGraphics)IGraphics IGraphicsLiveEdit (defined in IGraphics)IGraphicsfriend - IsDirty(IRECTList &rects)IGraphics - IsInPlatformTextEntry()IGraphicsinline - ITextEntryControl (defined in IGraphics)IGraphicsfriend - LiveEditEnabled() constIGraphicsinline - LoadAPIBitmap(const char *fileNameOrResID, int scale, EResourceLocation location, const char *ext)=0IGraphicsprotectedpure virtual - LoadAPIBitmap(const char *name, const void *pData, int dataSize, int scale)=0IGraphicsprotectedpure virtual - LoadAPIFont(const char *fontID, const PlatformFontPtr &font)=0IGraphicsprotectedpure virtual - LoadBitmap(const char *fileNameOrResID, int nStates=1, bool framesAreHorizontal=false, int targetScale=0)IGraphicsvirtual - LoadBitmap(const char *name, const void *pData, int dataSize, int nStates=1, bool framesAreHorizontal=false, int targetScale=0)IGraphicsvirtual - LoadFont(const char *fontID, const char *fileNameOrResID)IGraphicsvirtual - LoadFont(const char *fontID, void *pData, int dataSize)IGraphicsvirtual - LoadFont(const char *fontID, const char *fontName, ETextStyle style)IGraphics - LoadPlatformFont(const char *fontID, const char *fileNameOrResID)=0IGraphicspure virtual - LoadPlatformFont(const char *fontID, void *pData, int dataSize)=0IGraphicspure virtual - LoadPlatformFont(const char *fontID, const char *fontName, ETextStyle style)=0IGraphicspure virtual - LoadResource(const char *fileNameOrResID, const char *fileType)IGraphicsvirtual - LoadSVG(const char *fileNameOrResID, const char *units="px", float dpi=72.f)IGraphicsvirtual - LoadSVG(const char *name, const void *pData, int dataSize, const char *units="px", float dpi=72.f)IGraphicsvirtual - mClipRECT (defined in IGraphics)IGraphicsprotected - mCursorHidden (defined in IGraphics)IGraphicsprotected - mCursorLock (defined in IGraphics)IGraphicsprotected - mCursorX (defined in IGraphics)IGraphicsprotected - mCursorY (defined in IGraphics)IGraphicsprotected - mDelegate (defined in IGraphics)IGraphicsprotected - MeasureText(const IText &text, const char *str, IRECT &bounds) constIGraphicsvirtual - mLayers (defined in IGraphics)IGraphicsprotected - MoveMouseCursor(float x, float y)=0IGraphicspure virtual - mTabletInput (defined in IGraphics)IGraphicsprotected - mTransform (defined in IGraphics)IGraphicsprotected - mTransformStates (defined in IGraphics)IGraphicsprotected - MultiTouchEnabled() constIGraphicsinline - mXTranslation (defined in IGraphics)IGraphicsprotected - mYTranslation (defined in IGraphics)IGraphicsprotected - NBubbleControls() constIGraphicsinline - NControls() constIGraphicsinline - OnAppearanceChanged(EUIAppearance appearance)IGraphics - OnDragResize(float x, float y)IGraphics - OnDrop(const char *str, float x, float y)IGraphics - OnDropMultiple(const std::vector< const char * > &paths, float x, float y)IGraphics - OnGestureRecognized(const IGestureInfo &info)IGraphics - OnGUIIdle()IGraphics - OnKeyDown(float x, float y, const IKeyPress &key)IGraphics - OnKeyUp(float x, float y, const IKeyPress &key)IGraphics - OnMouseDblClick(float x, float y, const IMouseMod &mod)IGraphics - OnMouseDown(const std::vector< IMouseInfo > &points)IGraphics - OnMouseDrag(const std::vector< IMouseInfo > &points)IGraphics - OnMouseOut()IGraphics - OnMouseOver(float x, float y, const IMouseMod &mod)IGraphics - OnMouseUp(const std::vector< IMouseInfo > &points)IGraphics - OnMouseWheel(float x, float y, const IMouseMod &mod, float delta)IGraphics - OnSetCursor()IGraphicsinline - OnTouchCancelled(const std::vector< IMouseInfo > &points)IGraphics - OnViewDestroyed()IGraphicsinlinevirtual - OnViewInitialized(void *pContext)IGraphicsinlinevirtual - OpenURL(const char *url, const char *msgWindowTitle=0, const char *confirmMsg=0, const char *errMsgOnFailure=0)=0IGraphicspure virtual - OpenWindow(void *pParentWnd)=0IGraphicspure virtual - operator=(const IGraphics &)=delete (defined in IGraphics)IGraphics - PathArc(float cx, float cy, float r, float a1, float a2, EWinding winding=EWinding::CW)=0IGraphicspure virtual - PathCircle(float cx, float cy, float r)IGraphics - PathClear()=0IGraphicspure virtual - PathClipRegion(const IRECT r=IRECT())IGraphics - PathClose()=0IGraphicspure virtual - PathConvexPolygon(float *x, float *y, int nPoints)IGraphics - PathCubicBezierTo(float c1x, float c1y, float c2x, float c2y, float x2, float y2)=0IGraphicspure virtual - PathEllipse(const IRECT &bounds)IGraphics - PathEllipse(float x, float y, float r1, float r2, float angle=0.0)IGraphics - PathFill(const IPattern &pattern, const IFillOptions &options=IFillOptions(), const IBlend *pBlend=0)=0IGraphicspure virtual - PathLine(float x1, float y1, float x2, float y2)IGraphicsinline - PathLineTo(float x, float y)=0IGraphicspure virtual - PathMoveTo(float x, float y)=0IGraphicspure virtual - PathQuadraticBezierTo(float cx, float cy, float x2, float y2)=0IGraphicspure virtual - PathRadialLine(float cx, float cy, float angle, float rMin, float rMax)IGraphics - PathRect(const IRECT &bounds)IGraphics - PathRoundRect(const IRECT &bounds, float ctl, float ctr, float cbl, float cbr)IGraphics - PathRoundRect(const IRECT &bounds, float cornerRadius=5.f)IGraphics - PathSetWinding(bool clockwise)IGraphicsinlinevirtual - PathStroke(const IPattern &pattern, float thickness, const IStrokeOptions &options=IStrokeOptions(), const IBlend *pBlend=0)=0IGraphicspure virtual - PathTransformMatrix(const IMatrix &matrix)IGraphics - PathTransformReset(bool clearStates=false)IGraphics - PathTransformRestore()IGraphics - PathTransformRotate(float angle)IGraphics - PathTransformSave()IGraphics - PathTransformScale(float x, float y)IGraphics - PathTransformScale(float scale)IGraphics - PathTransformSetMatrix(const IMatrix &matrix)=0 (defined in IGraphics)IGraphicspure virtual - PathTransformSkew(float xAngle, float yAngle)IGraphics - PathTransformTranslate(float x, float y)IGraphics - PathTriangle(float x1, float y1, float x2, float y2, float x3, float y3)IGraphics - PlatformSupportsMultiTouch() constIGraphicsinlinevirtual - PopLayer()IGraphicsprotected - PopupHostContextMenuForParam(int controlIdx, int paramIdx, float x, float y)IGraphics - PopupHostContextMenuForParam(IControl *pControl, int paramIdx, float x, float y)IGraphics - PromptForColor(IColor &color, const char *str="", IColorPickerHandlerFunc func=nullptr)=0IGraphicspure virtual - PromptForDirectory(WDL_String &dir, IFileDialogCompletionHandlerFunc completionHandler=nullptr)=0IGraphicspure virtual - PromptForFile(WDL_String &fileName, WDL_String &path, EFileAction action=EFileAction::Open, const char *ext="", IFileDialogCompletionHandlerFunc completionHandler=nullptr)=0IGraphicspure virtual - PromptUserInput(IControl &control, const IRECT &bounds, int valIdx=0)IGraphics - PushLayer(ILayer *pLayer)IGraphicsprotected - ReleaseBitmap(const IBitmap &bitmap)IGraphicsvirtual - ReleaseMouseCapture()IGraphics - RemoveAllControls()IGraphics - RemoveControl(int idx)IGraphics - RemoveControl(IControl *pControl)IGraphics - RemoveControls(int fromIdx)IGraphics - RemoveControlWithTag(int ctrlTag)IGraphics - RemovePlatformView(void *pView)IGraphicsinlinevirtual - RemovePopupMenuControl()IGraphics - RemoveTextEntryControl()IGraphics - Resize(int w, int h, float scale, bool needsPlatformResize=true)IGraphics - RespondsToGesture(float x, float y)IGraphics - ResumeLayer(ILayerPtr &layer)IGraphics - RetainBitmap(const IBitmap &bitmap, const char *cacheName)IGraphicsvirtual - RevealPathInExplorerOrFinder(WDL_String &path, bool select=false)IGraphicsinlinevirtual - ScaleBitmap(const IBitmap &inBitmap, const char *cacheName, int targetScale)IGraphicsvirtual - SearchBitmapInCache(const char *fileName, int targetScale, int &sourceScale)IGraphicsprotected - SearchImageResource(const char *fileName, const char *type, WDL_String &result, int targetScale, int &sourceScale)IGraphicsprotected - SetAllControlsClean()IGraphics - SetAllControlsDirty()IGraphics - SetControlBounds(IControl *pControl, const IRECT &r)IGraphics - SetControlPosition(IControl *pControl, float x, float y)IGraphics - SetControlSize(IControl *pControl, float w, float h)IGraphics - SetControlValueAfterPopupMenu(IPopupMenu *pMenu)IGraphics - SetControlValueAfterTextEdit(const char *str)IGraphics - SetDisplayTickFunc(IDisplayTickFunc func)IGraphicsinline - SetFilePathInClipboard(const char *path)IGraphicsinlinevirtual - SetKeyHandlerFunc(IKeyHandlerFunc func)IGraphicsinline - SetLayoutOnResize(bool layoutOnResize) (defined in IGraphics)IGraphics - SetMouseCursor(ECursor cursorType=ECursor::ARROW)IGraphicsinlinevirtual - SetPlatformContext(void *pContext)IGraphicsinline - SetPTParameterHighlight(int paramIdx, bool isHighlighted, int color)IGraphics - SetQwertyMidiKeyHandlerFunc(std::function< void(const IMidiMsg &msg)> func=nullptr)IGraphics - SetScaleConstraints(float lo, float hi)IGraphics - SetScreenScale(float scale)IGraphics - SetSharedResourcesSubPath(const char *sharedResourcesSubPath)IGraphicsinline - SetStrictDrawing(bool strict)IGraphics - SetTabletInput(bool tablet)IGraphicsinline - SetTextInClipboard(const char *str)=0IGraphicspure virtual - SetTranslation(float x, float y)IGraphicsinline - SetUIAppearanceChangedFunc(IUIAppearanceChangedFunc func)IGraphicsinline - SetWinModuleHandle(void *pHinstance)IGraphicsinlinevirtual - ShowAreaDrawn(bool enable)IGraphicsinline - ShowAreaDrawnEnabled() constIGraphicsinline - ShowBubbleControl(IControl *pCaller, float x, float y, const char *str, EDirection dir=EDirection::Horizontal, IRECT minimumContentBounds=IRECT()) (defined in IGraphics)IGraphics - ShowControlBounds(bool enable)IGraphicsinline - ShowControlBoundsEnabled() constIGraphicsinline - ShowFPSDisplay(bool enable)IGraphics - ShowingFPSDisplay()IGraphicsinline - ShowMessageBox(const char *str, const char *caption, EMsgBoxType type, IMsgBoxCompletionHandlerFunc completionHandler=nullptr)=0IGraphicspure virtual - StartLayer(IControl *pOwner, const IRECT &r, bool cacheable=false)IGraphics - StyleAllVectorControls(const IVStyle &style)IGraphics - TooltipsEnabled() constIGraphicsinline - UpdateLayer()IGraphicsinlineprotectedvirtual - UpdatePeers(IControl *pCaller, int callerValIdx)IGraphics - UpdateTooltips()=0IGraphicspure virtual - Width() constIGraphicsinline - WindowHeight() constIGraphicsinline - WindowIsOpen()IGraphicsinlinevirtual - WindowWidth() constIGraphicsinline - ~IGraphics() (defined in IGraphics)IGraphicsvirtual + InitiateExternalFileDragDrop(const char *path, const IRECT &iconBounds)IGraphicsinlinevirtual + IsDirty(IRECTList &rects)IGraphics + IsInPlatformTextEntry()IGraphicsinline + ITextEntryControl (defined in IGraphics)IGraphicsfriend + LiveEditEnabled() constIGraphicsinline + LoadAPIBitmap(const char *fileNameOrResID, int scale, EResourceLocation location, const char *ext)=0IGraphicsprotectedpure virtual + LoadAPIBitmap(const char *name, const void *pData, int dataSize, int scale)=0IGraphicsprotectedpure virtual + LoadAPIFont(const char *fontID, const PlatformFontPtr &font)=0IGraphicsprotectedpure virtual + LoadBitmap(const char *fileNameOrResID, int nStates=1, bool framesAreHorizontal=false, int targetScale=0)IGraphicsvirtual + LoadBitmap(const char *name, const void *pData, int dataSize, int nStates=1, bool framesAreHorizontal=false, int targetScale=0)IGraphicsvirtual + LoadFont(const char *fontID, const char *fileNameOrResID)IGraphicsvirtual + LoadFont(const char *fontID, void *pData, int dataSize)IGraphicsvirtual + LoadFont(const char *fontID, const char *fontName, ETextStyle style)IGraphics + LoadPlatformFont(const char *fontID, const char *fileNameOrResID)=0IGraphicspure virtual + LoadPlatformFont(const char *fontID, void *pData, int dataSize)=0IGraphicspure virtual + LoadPlatformFont(const char *fontID, const char *fontName, ETextStyle style)=0IGraphicspure virtual + LoadResource(const char *fileNameOrResID, const char *fileType)IGraphicsvirtual + LoadSVG(const char *fileNameOrResID, const char *units="px", float dpi=72.f)IGraphicsvirtual + LoadSVG(const char *name, const void *pData, int dataSize, const char *units="px", float dpi=72.f)IGraphicsvirtual + mClipRECT (defined in IGraphics)IGraphicsprotected + mCursorHidden (defined in IGraphics)IGraphicsprotected + mCursorLock (defined in IGraphics)IGraphicsprotected + mCursorX (defined in IGraphics)IGraphicsprotected + mCursorY (defined in IGraphics)IGraphicsprotected + mDelegate (defined in IGraphics)IGraphicsprotected + MeasureText(const IText &text, const char *str, IRECT &bounds) constIGraphicsvirtual + mLayers (defined in IGraphics)IGraphicsprotected + MoveMouseCursor(float x, float y)=0IGraphicspure virtual + mTabletInput (defined in IGraphics)IGraphicsprotected + mTransform (defined in IGraphics)IGraphicsprotected + mTransformStates (defined in IGraphics)IGraphicsprotected + MultiTouchEnabled() constIGraphicsinline + mXTranslation (defined in IGraphics)IGraphicsprotected + mYTranslation (defined in IGraphics)IGraphicsprotected + NBubbleControls() constIGraphicsinline + NControls() constIGraphicsinline + OnAppearanceChanged(EUIAppearance appearance)IGraphics + OnDragResize(float x, float y)IGraphics + OnDrop(const char *str, float x, float y)IGraphics + OnDropMultiple(const std::vector< const char * > &paths, float x, float y)IGraphics + OnGestureRecognized(const IGestureInfo &info)IGraphics + OnGUIIdle()IGraphics + OnKeyDown(float x, float y, const IKeyPress &key)IGraphics + OnKeyUp(float x, float y, const IKeyPress &key)IGraphics + OnMouseDblClick(float x, float y, const IMouseMod &mod)IGraphics + OnMouseDown(const std::vector< IMouseInfo > &points)IGraphics + OnMouseDrag(const std::vector< IMouseInfo > &points)IGraphics + OnMouseOut()IGraphics + OnMouseOver(float x, float y, const IMouseMod &mod)IGraphics + OnMouseUp(const std::vector< IMouseInfo > &points)IGraphics + OnMouseWheel(float x, float y, const IMouseMod &mod, float delta)IGraphics + OnSetCursor()IGraphicsinline + OnTouchCancelled(const std::vector< IMouseInfo > &points)IGraphics + OnViewDestroyed()IGraphicsinlinevirtual + OnViewInitialized(void *pContext)IGraphicsinlinevirtual + OpenURL(const char *url, const char *msgWindowTitle=0, const char *confirmMsg=0, const char *errMsgOnFailure=0)=0IGraphicspure virtual + OpenWindow(void *pParentWnd)=0IGraphicspure virtual + operator=(const IGraphics &)=delete (defined in IGraphics)IGraphics + PathArc(float cx, float cy, float r, float a1, float a2, EWinding winding=EWinding::CW)=0IGraphicspure virtual + PathCircle(float cx, float cy, float r)IGraphics + PathClear()=0IGraphicspure virtual + PathClipRegion(const IRECT r=IRECT())IGraphics + PathClose()=0IGraphicspure virtual + PathConvexPolygon(float *x, float *y, int nPoints)IGraphics + PathCubicBezierTo(float c1x, float c1y, float c2x, float c2y, float x2, float y2)=0IGraphicspure virtual + PathEllipse(const IRECT &bounds)IGraphics + PathEllipse(float x, float y, float r1, float r2, float angle=0.0)IGraphics + PathFill(const IPattern &pattern, const IFillOptions &options=IFillOptions(), const IBlend *pBlend=0)=0IGraphicspure virtual + PathLine(float x1, float y1, float x2, float y2)IGraphicsinline + PathLineTo(float x, float y)=0IGraphicspure virtual + PathMoveTo(float x, float y)=0IGraphicspure virtual + PathQuadraticBezierTo(float cx, float cy, float x2, float y2)=0IGraphicspure virtual + PathRadialLine(float cx, float cy, float angle, float rMin, float rMax)IGraphics + PathRect(const IRECT &bounds)IGraphics + PathRoundRect(const IRECT &bounds, float ctl, float ctr, float cbl, float cbr)IGraphics + PathRoundRect(const IRECT &bounds, float cornerRadius=5.f)IGraphics + PathSetWinding(bool clockwise)IGraphicsinlinevirtual + PathStroke(const IPattern &pattern, float thickness, const IStrokeOptions &options=IStrokeOptions(), const IBlend *pBlend=0)=0IGraphicspure virtual + PathTransformMatrix(const IMatrix &matrix)IGraphics + PathTransformReset(bool clearStates=false)IGraphics + PathTransformRestore()IGraphics + PathTransformRotate(float angle)IGraphics + PathTransformSave()IGraphics + PathTransformScale(float x, float y)IGraphics + PathTransformScale(float scale)IGraphics + PathTransformSetMatrix(const IMatrix &matrix)=0 (defined in IGraphics)IGraphicspure virtual + PathTransformSkew(float xAngle, float yAngle)IGraphics + PathTransformTranslate(float x, float y)IGraphics + PathTriangle(float x1, float y1, float x2, float y2, float x3, float y3)IGraphics + PlatformSupportsMultiTouch() constIGraphicsinlinevirtual + PopLayer()IGraphicsprotected + PopupHostContextMenuForParam(int controlIdx, int paramIdx, float x, float y)IGraphics + PopupHostContextMenuForParam(IControl *pControl, int paramIdx, float x, float y)IGraphics + PromptForColor(IColor &color, const char *str="", IColorPickerHandlerFunc func=nullptr)=0IGraphicspure virtual + PromptForDirectory(WDL_String &dir, IFileDialogCompletionHandlerFunc completionHandler=nullptr)=0IGraphicspure virtual + PromptForFile(WDL_String &fileName, WDL_String &path, EFileAction action=EFileAction::Open, const char *ext="", IFileDialogCompletionHandlerFunc completionHandler=nullptr)=0IGraphicspure virtual + PromptUserInput(IControl &control, const IRECT &bounds, int valIdx=0)IGraphics + PushLayer(ILayer *pLayer)IGraphicsprotected + ReleaseBitmap(const IBitmap &bitmap)IGraphicsvirtual + ReleaseMouseCapture()IGraphics + RemoveAllControls()IGraphics + RemoveControl(int idx)IGraphics + RemoveControl(IControl *pControl)IGraphics + RemoveControls(int fromIdx)IGraphics + RemoveControlWithTag(int ctrlTag)IGraphics + RemovePlatformView(void *pView)IGraphicsinlinevirtual + RemovePopupMenuControl()IGraphics + RemoveTextEntryControl()IGraphics + Resize(int w, int h, float scale, bool needsPlatformResize=true)IGraphics + RespondsToGesture(float x, float y)IGraphics + ResumeLayer(ILayerPtr &layer)IGraphics + RetainBitmap(const IBitmap &bitmap, const char *cacheName)IGraphicsvirtual + RevealPathInExplorerOrFinder(WDL_String &path, bool select=false)IGraphicsinlinevirtual + ScaleBitmap(const IBitmap &inBitmap, const char *cacheName, int targetScale)IGraphicsvirtual + SearchBitmapInCache(const char *fileName, int targetScale, int &sourceScale)IGraphicsprotected + SearchImageResource(const char *fileName, const char *type, WDL_String &result, int targetScale, int &sourceScale)IGraphicsprotected + SetAllControlsClean()IGraphics + SetAllControlsDirty()IGraphics + SetControlBounds(IControl *pControl, const IRECT &r)IGraphics + SetControlPosition(IControl *pControl, float x, float y)IGraphics + SetControlSize(IControl *pControl, float w, float h)IGraphics + SetControlValueAfterPopupMenu(IPopupMenu *pMenu)IGraphics + SetControlValueAfterTextEdit(const char *str)IGraphics + SetDisplayTickFunc(IDisplayTickFunc func)IGraphicsinline + SetFilePathInClipboard(const char *path)IGraphicsinlinevirtual + SetKeyHandlerFunc(IKeyHandlerFunc func)IGraphicsinline + SetLayoutOnResize(bool layoutOnResize) (defined in IGraphics)IGraphics + SetMouseCursor(ECursor cursorType=ECursor::ARROW)IGraphicsinlinevirtual + SetPlatformContext(void *pContext)IGraphicsinline + SetPTParameterHighlight(int paramIdx, bool isHighlighted, int color)IGraphics + SetQwertyMidiKeyHandlerFunc(std::function< void(const IMidiMsg &msg)> func=nullptr)IGraphics + SetScaleConstraints(float lo, float hi)IGraphics + SetScreenScale(float scale)IGraphics + SetSharedResourcesSubPath(const char *sharedResourcesSubPath)IGraphicsinline + SetStrictDrawing(bool strict)IGraphics + SetTabletInput(bool tablet)IGraphicsinline + SetTextInClipboard(const char *str)=0IGraphicspure virtual + SetTranslation(float x, float y)IGraphicsinline + SetUIAppearanceChangedFunc(IUIAppearanceChangedFunc func)IGraphicsinline + SetWinModuleHandle(void *pHinstance)IGraphicsinlinevirtual + ShowAreaDrawn(bool enable)IGraphicsinline + ShowAreaDrawnEnabled() constIGraphicsinline + ShowBubbleControl(IControl *pCaller, float x, float y, const char *str, EDirection dir=EDirection::Horizontal, IRECT minimumContentBounds=IRECT()) (defined in IGraphics)IGraphics + ShowControlBounds(bool enable)IGraphicsinline + ShowControlBoundsEnabled() constIGraphicsinline + ShowFPSDisplay(bool enable)IGraphics + ShowingFPSDisplay()IGraphicsinline + ShowMessageBox(const char *str, const char *caption, EMsgBoxType type, IMsgBoxCompletionHandlerFunc completionHandler=nullptr)=0IGraphicspure virtual + StartLayer(IControl *pOwner, const IRECT &r, bool cacheable=false)IGraphics + StyleAllVectorControls(const IVStyle &style)IGraphics + TooltipsEnabled() constIGraphicsinline + UpdateLayer()IGraphicsinlineprotectedvirtual + UpdatePeers(IControl *pCaller, int callerValIdx)IGraphics + UpdateTooltips()=0IGraphicspure virtual + Width() constIGraphicsinline + WindowHeight() constIGraphicsinline + WindowIsOpen()IGraphicsinlinevirtual + WindowWidth() constIGraphicsinline + ~IGraphics() (defined in IGraphics)IGraphicsvirtual