iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
IGraphics Class Referenceabstract

The lowest level base class of an IGraphics context. More...

#include <IGraphics.h>

Inheritance diagram for IGraphics:
[legend]

Public Member Functions

virtual void BeginFrame ()
 Called at the beginning of drawing. More...
 
virtual void OnViewInitialized (void *pContext)
 Called after platform view initialization, so that drawing classes can e.g. More...
 
virtual void OnViewDestroyed ()
 Called after a platform view is destroyed, so that drawing classes can e.g. More...
 
virtual void EndFrame ()
 Called by some drawing API classes to finally blit the draw bitmap onto the screen or perform other cleanup after drawing. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual void DrawRect (const IColor &color, const IRECT &bounds, const IBlend *pBlend=0, float thickness=1.f)
 Draw a rectangle to the graphics context. More...
 
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. More...
 
virtual void DrawRoundRect (const IColor &color, const IRECT &bounds, float cRTL, float cRTR, float cRBR, float cRBL, const IBlend *pBlend=0, float thickness=1.f)
 Draw a rounded rectangle to the graphics context with individual corner roundness. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual void DrawEllipse (const IColor &color, float x, float y, float r1, float r2, float angle=0.0, const IBlend *pBlend=0, float thickness=1.f)
 Draw an ellipse around a central point given two radii and an angle of orientation. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual void FillRect (const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
 Fill a rectangular region of the graphics context with a color. More...
 
virtual void FillRoundRect (const IColor &color, const IRECT &bounds, float cornerRadius=5.f, const IBlend *pBlend=0)
 Fill a rounded rectangle with a color. More...
 
virtual void FillRoundRect (const IColor &color, const IRECT &bounds, float cRTL, float cRTR, float cRBR, float cRBL, const IBlend *pBlend=0)
 Fill a rounded rectangle with a color. More...
 
virtual void FillCircle (const IColor &color, float cx, float cy, float r, const IBlend *pBlend=0)
 Fill a circle with a color. More...
 
virtual void FillEllipse (const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
 Fill an ellipse within a rectangular region of the graphics context. More...
 
virtual void FillEllipse (const IColor &color, float x, float y, float r1, float r2, float angle=0.0, const IBlend *pBlend=0)
 Fill an ellipse. More...
 
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. More...
 
virtual void FillConvexPolygon (const IColor &color, float *x, float *y, int nPoints, const IBlend *pBlend=0)
 Fill a convex polygon with a color. More...
 
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. More...
 
void DrawText (const IText &text, const char *str, float x, float y, const IBlend *pBlend=0)
 Draw some text to the graphics context at a point. More...
 
virtual float MeasureText (const IText &text, const char *str, IRECT &bounds) const
 Measure the rectangular region that some text will occupy. More...
 
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) More...
 
virtual IColor GetPoint (int x, int y)=0
 Get the color at an X, Y location in the graphics context. More...
 
virtual void * GetDrawContext ()=0
 Gets a void pointer to underlying drawing context, for the IGraphics backend See draw class implementation headers (e.g. More...
 
virtual const char * GetDrawingAPIStr ()=0
 
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. More...
 
virtual void RetainBitmap (const IBitmap &bitmap, const char *cacheName)
 Adds an IBitmap to the cache/static storage. More...
 
virtual void ReleaseBitmap (const IBitmap &bitmap)
 Releases an IBitmap from the cache/static storage. More...
 
IBitmap GetScaledBitmap (IBitmap &inBitmap)
 Get a version of the input bitmap from the cache that corresponds to the current screen scale For example, when IControl::OnRescale() is called bitmap-based IControls can load in. More...
 
virtual bool BitmapExtSupported (const char *ext)=0
 Checks a file extension and reports whether this drawing API supports loading that extension. More...
 
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. More...
 
void DrawBitmap (const IBitmap &bitmap, const IRECT &bounds, int frame=1, const IBlend *pBlend=0)
 Draws a bitmap into the graphics context. More...
 
void DrawBitmapedText (const IBitmap &bitmap, const IRECT &bounds, IText &text, IBlend *pBlend, const char *str, bool vCenter=true, bool multiline=false, int charWidth=6, int charHeight=12, int charOffset=0)
 Draws mono spaced bitmap text. More...
 
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. More...
 
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. More...
 
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. More...
 
void DrawVerticalLine (const IColor &color, float xi, float yLo, float yHi, const IBlend *pBlend=0, float thickness=1.f)
 Draw a clipped vertical line at a position bounds. More...
 
void DrawHorizontalLine (const IColor &color, float yi, float xLo, float xHi, const IBlend *pBlend=0, float thickness=1.f)
 Draw a clipped horizontal line at a position bounds. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual bool LoadFont (const char *fontID, const char *fileNameOrResID)
 Load a font to be used by the graphics context. More...
 
virtual bool LoadFont (const char *fontID, void *pData, int dataSize)
 Load a font from in-memory data to be used by the graphics context. More...
 
bool LoadFont (const char *fontID, const char *fontName, ETextStyle style)
 Load a font with a particular style (bold, italic) from a font file. More...
 
void StartLayer (IControl *pOwner, const IRECT &r, bool cacheable=false)
 Create an IGraphics layer. More...
 
void ResumeLayer (ILayerPtr &layer)
 If a layer already exists, continue drawing to it. More...
 
ILayerPtr EndLayer ()
 End an IGraphics layer. More...
 
bool CheckLayer (const ILayerPtr &layer)
 Test to see if a layer needs drawing, for instance if the control's bounds were changed. More...
 
void DrawLayer (const ILayerPtr &layer, const IBlend *pBlend=nullptr)
 Draw a layer to the main IGraphics context. More...
 
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's bounds. More...
 
void DrawRotatedLayer (const ILayerPtr &layer, double angle)
 Draw a layer to the main IGraphics context, with rotation. More...
 
void ApplyLayerDropShadow (ILayerPtr &layer, const IShadow &shadow)
 Applies a drop shadow directly onto a layer. More...
 
virtual void GetLayerBitmapData (const ILayerPtr &layer, RawBitmapData &data)=0
 Get the contents of a layer as Raw RGBA bitmap data NOTE: you should only call this within IControl::Draw() More...
 
virtual void PathClear ()=0
 Clear the stack of path drawing commands. More...
 
virtual void PathClose ()=0
 Close the path that is being specified. More...
 
void PathLine (float x1, float y1, float x2, float y2)
 Add a line to the current path. More...
 
void PathRadialLine (float cx, float cy, float angle, float rMin, float rMax)
 Add a radial line to the current path. More...
 
void PathTriangle (float x1, float y1, float x2, float y2, float x3, float y3)
 Add a triangle to the current path. More...
 
void PathRect (const IRECT &bounds)
 Add a rectangle to the current path. More...
 
void PathRoundRect (const IRECT &bounds, float ctl, float ctr, float cbl, float cbr)
 Add a rounded rectangle to the current path, with independent corner roundness. More...
 
void PathRoundRect (const IRECT &bounds, float cornerRadius=5.f)
 Add a rounded rectangle to the current path. More...
 
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. More...
 
void PathCircle (float cx, float cy, float r)
 Add a circle to the current path. More...
 
void PathEllipse (const IRECT &bounds)
 Add an ellipse to the current path, specifying the rectangular region. More...
 
void PathEllipse (float x, float y, float r1, float r2, float angle=0.0)
 Add an ellipse to the current path. More...
 
void PathConvexPolygon (float *x, float *y, int nPoints)
 Add a convex polygon to the current path. More...
 
virtual void PathMoveTo (float x, float y)=0
 Move the current point in the current path. More...
 
virtual void PathLineTo (float x, float y)=0
 Add a line to the current path from the current point to the specified location. More...
 
virtual void PathSetWinding (bool clockwise)
 NanoVG only. More...
 
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. More...
 
virtual void PathQuadraticBezierTo (float cx, float cy, float x2, float y2)=0
 Add a quadratic bezier to the current path from the current point to the specified location. More...
 
virtual void PathStroke (const IPattern &pattern, float thickness, const IStrokeOptions &options=IStrokeOptions(), const IBlend *pBlend=0)=0
 Stroke the current current path. More...
 
virtual void PathFill (const IPattern &pattern, const IFillOptions &options=IFillOptions(), const IBlend *pBlend=0)=0
 Fill the current current path. More...
 
void PathTransformSave ()
 Save the current affine transform of the current path. More...
 
void PathTransformRestore ()
 Restore the affine transform of the current path, to the previously saved state. More...
 
void PathTransformReset (bool clearStates=false)
 Reset the affine transform of the current path, to the default state. More...
 
void PathTransformTranslate (float x, float y)
 Apply a translation transform to the current path. More...
 
void PathTransformScale (float x, float y)
 Apply a scale transform to the current path, with independant x, y scales. More...
 
void PathTransformScale (float scale)
 Apply a scale transform to the current path, with independant x, y scales. More...
 
void PathTransformRotate (float angle)
 Apply a rotation transform to the current path. More...
 
void PathTransformSkew (float xAngle, float yAngle)
 Apply a skew transform to the current path. More...
 
void PathTransformMatrix (const IMatrix &matrix)
 Apply an arbitary affine transform matrix to the current path. More...
 
void PathClipRegion (const IRECT r=IRECT())
 Clip the current path to a particular region. More...
 
virtual void PathTransformSetMatrix (const IMatrix &matrix)=0
 
void DoTextRotation (const IText &text, const IRECT &bounds, const IRECT &rect)
 
virtual void AttachPlatformView (const IRECT &r, void *pView)
 Add an OS view as a sub-view, on top of the IGraphics view. More...
 
virtual void RemovePlatformView (void *pView)
 Remove a previously attached platform view from the IGraphics view. More...
 
virtual void HidePlatformView (void *pView, bool hide)
 Hide a previously attached platform view from the IGraphics view. More...
 
virtual void GetMouseLocation (float &x, float &y) const =0
 Get the x, y position of the mouse cursor. More...
 
virtual void HideMouseCursor (bool hide=true, bool lock=true)=0
 Call to hide/show the mouse cursor. More...
 
virtual void MoveMouseCursor (float x, float y)=0
 Force move the mouse cursor to a specific position. More...
 
virtual ECursor SetMouseCursor (ECursor cursorType=ECursor::ARROW)
 Sets the mouse cursor to one of ECursor (implementations should return the result of the base implementation) More...
 
virtual void ForceEndUserEdit ()=0
 Call to force end text entry (will cancel any half input text. More...
 
virtual void * OpenWindow (void *pParentWnd)=0
 Open a new platform view for this graphics context. More...
 
virtual void CloseWindow ()=0
 Close the platform view for this graphics context.
 
virtual void * GetWindow ()=0
 Get a pointer to the platform view e.g. More...
 
virtual bool WindowIsOpen ()
 
virtual bool GetTextFromClipboard (WDL_String &str)=0
 Get text from the clipboard. More...
 
virtual bool SetTextInClipboard (const char *str)=0
 Set text in the clipboard. More...
 
virtual bool SetFilePathInClipboard (const char *path)
 Set a file path in the clipboard. More...
 
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. More...
 
virtual void UpdateTooltips ()=0
 Call this if you modify control tool tips at runtime. More...
 
virtual EMsgBoxResult ShowMessageBox (const char *str, const char *title, EMsgBoxType type, IMsgBoxCompletionHandlerFunc completionHandler=nullptr)=0
 Pop up a modal platform message box dialog. More...
 
virtual void PromptForFile (WDL_String &fileName, WDL_String &path, EFileAction action=EFileAction::Open, const char *ext="", IFileDialogCompletionHandlerFunc completionHandler=nullptr)=0
 Create a platform file prompt dialog to choose a path for opening/saving a single file. More...
 
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. More...
 
virtual bool PromptForColor (IColor &color, const char *str="", IColorPickerHandlerFunc func=nullptr)=0
 Create a platform color chooser dialog. More...
 
virtual bool OpenURL (const char *url, const char *msgWindowTitle=0, const char *confirmMsg=0, const char *errMsgOnFailure=0)=0
 Open a URL in the platform’s default browser. More...
 
virtual const char * GetPlatformAPIStr ()
 
virtual bool RevealPathInExplorerOrFinder (WDL_String &path, bool select=false)
 
virtual void SetWinModuleHandle (void *pHinstance)
 Used on Windows to set the HINSTANCE module handle, which allows graphics APIs to load resources from the binary. More...
 
virtual void * GetWinModuleHandle ()
 
void SetPlatformContext (void *pContext)
 Set the platform draw context Used in order to set the platform level draw context - CGContextRef context on macOS and the GDI HDC draw context handle on Windows. More...
 
void * GetPlatformContext ()
 Get the platform level draw context - an HDC or CGContextRef. More...
 
virtual void ClientToScreen (float &x, float &y)
 Convert an x, y position in the view to screen coordinates. More...
 
virtual PlatformFontPtr LoadPlatformFont (const char *fontID, const char *fileNameOrResID)=0
 Load a font from disk or resource in a platform format. More...
 
virtual PlatformFontPtr LoadPlatformFont (const char *fontID, void *pData, int dataSize)=0
 Load a font from data in memory. More...
 
virtual PlatformFontPtr LoadPlatformFont (const char *fontID, const char *fontName, ETextStyle style)=0
 Load a system font in a platform format. More...
 
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. More...
 
virtual const char * GetBundleID () const
 Get the bundle ID on macOS and iOS, returns emtpy string on other OSs. More...
 
virtual const char * GetAppGroupID () const
 Get the app group ID on macOS and iOS, returns emtpy string on other OSs. More...
 
 IGraphics (IGEditorDelegate &dlg, int w, int h, int fps=DEFAULT_FPS, float scale=1.)
 
 IGraphics (const IGraphics &)=delete
 
IGraphicsoperator= (const IGraphics &)=delete
 
void SetScreenScale (float scale)
 Called by the platform IGraphics class when moving to a new screen to set DPI. More...
 
void SetTranslation (float x, float y)
 Called by some platform IGraphics classes in order to translate the graphics context, in response to e.g. More...
 
bool IsDirty (IRECTList &rects)
 Called repeatedly at frame rate by the platform class to check what the graphics context says is dirty. More...
 
void Draw (IRECTList &rects)
 Called by the platform class indicating a number of rectangles in the UI that need to redraw. More...
 
void PromptUserInput (IControl &control, const IRECT &bounds, int valIdx=0)
 Prompt for user input either using a text entry or pop up menu. More...
 
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. More...
 
void CreatePopupMenu (IControl &control, IPopupMenu &menu, float x, float y, int valIdx=0)
 Shows a pop up/contextual menu at point. More...
 
void CreateTextEntry (IControl &control, const IText &text, const IRECT &bounds, const char *str="", int valIdx=0)
 Create a text entry box. More...
 
void SetControlValueAfterTextEdit (const char *str)
 Called by the platform class after returning from a text entry in order to update a control with a new value. More...
 
void SetControlValueAfterPopupMenu (IPopupMenu *pMenu)
 Called by PopupMenuControl in order to update a control with a new value after returning from the non-blocking menu. More...
 
void SetScaleConstraints (float lo, float hi)
 Sets the minimum and maximum (draw) scaling values. More...
 
void Resize (int w, int h, float scale, bool needsPlatformResize=true)
 
void SetStrictDrawing (bool strict)
 Enables strict drawing mode. More...
 
void SetLayoutOnResize (bool layoutOnResize)
 
int Width () const
 Gets the width of the graphics context. More...
 
int Height () const
 Gets the height of the graphics context. More...
 
int WindowWidth () const
 Gets the width of the graphics context including draw scaling. More...
 
int WindowHeight () const
 Gets the height of the graphics context including draw scaling. More...
 
int FPS () const
 Gets the drawing frame rate. More...
 
float GetDrawScale () const
 Gets the graphics context scaling factor. More...
 
float GetScreenScale () const
 Gets the screen/display scaling factor, e.g. More...
 
int GetRoundedScreenScale () const
 Gets the screen/display scaling factor, rounded up. More...
 
float GetTotalScale () const
 Gets the combined draw and screen/display scaling factor. More...
 
IRECT GetPixelSnapped (IRECT &r) const
 Gets the nearest backing pixel aligned rect to the input IRECT. More...
 
IGEditorDelegateGetDelegate ()
 Gets a pointer to the delegate class that handles communication to and from this graphics context. More...
 
IPopupMenuGetPromptMenu ()
 
bool IsInPlatformTextEntry ()
 
IControlGetControlInTextEntry ()
 
void ClearInTextEntryControl ()
 Called when the text entry is dismissed, to reset mInTextEntry. More...
 
bool TooltipsEnabled () const
 
EUIResizerMode GetResizerMode () const
 
bool GetResizingInProcess () const
 
bool EnableMultiTouch (bool enable)
 Enable/disable multi touch, if platform supports it. More...
 
bool MultiTouchEnabled () const
 
virtual bool PlatformSupportsMultiTouch () const
 
void EnableTooltips (bool enable)
 
void AssignParamNameToolTips ()
 Call this method in order to create tool tips for every IControl that show the associated parameter's name. More...
 
void ShowControlBounds (bool enable)
 
void ShowAreaDrawn (bool enable)
 
bool ShowAreaDrawnEnabled () const
 
bool ShowControlBoundsEnabled () const
 
void EnableLiveEdit (bool enable)
 Live edit mode allows you to relocate controls at runtime in debug builds. More...
 
bool LiveEditEnabled () const
 
IRECT GetBounds () const
 Returns an IRECT that represents the entire UI bounds This is useful for programatically arranging UI elements by slicing up the IRECT using the various IRECT methods. More...
 
void SetDisplayTickFunc (IDisplayTickFunc func)
 Sets a function that is called at the frame rate, prior to checking for dirty controls. More...
 
void SetUIAppearanceChangedFunc (IUIAppearanceChangedFunc func)
 Sets a function that is called when the OS appearance (light/dark mode) is changed. More...
 
void SetKeyHandlerFunc (IKeyHandlerFunc func)
 Set a function that is called when key presses are not intercepted by any controls. More...
 
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. More...
 
bool RespondsToGesture (float x, float y)
 Called by platform class to see if the point at x, y is linked to a gesture recognizer. More...
 
void OnGestureRecognized (const IGestureInfo &info)
 Called by platform class when a gesture is recognized. More...
 
virtual float GetPlatformWindowScale () const
 Returns a scaling factor for resizing parent windows via the host/plugin API. More...
 
void ForAllControlsFunc (IControlFunction func)
 For all controls, including the "special controls" call a method. More...
 
template<typename T , typename... Args>
void ForAllControls (T method, Args... args)
 For all controls, including the "special controls" call a method. More...
 
void ForStandardControlsFunc (IControlFunction func)
 For all standard controls in the main control stack perform a function. More...
 
template<typename T , typename... Args>
void ForMatchingControls (T method, int paramIdx, Args... args)
 For all standard controls in the main control stack that are linked to a specific parameter, call a method. More...
 
void ForControlWithParam (int paramIdx, IControlFunction func)
 For all standard controls in the main control stack that are linked to a specific parameter, execute a function. More...
 
void ForControlWithParam (const std::initializer_list< int > &params, IControlFunction func)
 For all standard controls in the main control stack that are linked to one of several parameters, execute a function. More...
 
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. More...
 
void AttachBackground (const char *fileName)
 Attach an IBitmapControl as the lowest IControl in the control stack to be the background for the graphics context. More...
 
void AttachSVGBackground (const char *fileName)
 Attach an ISVGControl as the lowest IControl in the control stack to be the background for the graphics context. More...
 
void AttachPanelBackground (const IPattern &color)
 Attach an IPanelControl as the lowest IControl in the control stack to fill the background with a solid color. More...
 
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)
 Attach the default control to scale or increase the UI size by dragging the plug-in bottom right-hand corner. More...
 
void AttachCornerResizer (ICornerResizerControl *pControl, EUIResizerMode sizeMode=EUIResizerMode::Scale, bool layoutOnResize=false)
 Attach your own control to scale or increase the UI size by dragging the plug-in bottom right-hand corner. More...
 
void AttachPopupMenuControl (const IText &text=DEFAULT_TEXT, const IRECT &bounds=IRECT())
 Attach a control for pop-up menus, to override platform style menus. More...
 
void RemovePopupMenuControl ()
 Remove the IGraphics popup menu, use platform popup menu if available. More...
 
void AttachTextEntryControl ()
 Attach a control for text entry, to override platform text entry. More...
 
void RemoveTextEntryControl ()
 Remove the IGraphics text entry, use platform text entry if available. More...
 
void AttachBubbleControl (const IText &text=DEFAULT_TEXT)
 Attach the default control to show text as a control changes. More...
 
void AttachBubbleControl (IBubbleControl *pControl)
 Attach a custom control to show text as a control changes. More...
 
void ShowBubbleControl (IControl *pCaller, float x, float y, const char *str, EDirection dir=EDirection::Horizontal, IRECT minimumContentBounds=IRECT())
 
void ShowFPSDisplay (bool enable)
 Shows a control to display the frame rate of drawing. More...
 
bool ShowingFPSDisplay ()
 
IControlAttachControl (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. More...
 
IControlGetControl (int idx)
 Get the control at a certain index in the control stack. More...
 
int GetControlIdx (IControl *pControl) const
 Get the index of a particular IControl in the control stack. More...
 
int GetIdxOfTaggedControl (int ctrlTag) const
 Gets the index of a tagged control. More...
 
IControlGetControlWithTag (int ctrlTag) const
 Get the control with a particular tag. More...
 
int GetControlTag (const IControl *pControl) const
 Get the tag given to a control. More...
 
IControlGetControlWithParamIdx (int paramIdx)
 Get the first control with a parameter index that matches paramIdx. More...
 
bool ControlIsCaptured () const
 Check to see if any control is captured. More...
 
bool ControlIsCaptured (IControl *pControl) const
 Check to see if the control is already captured. More...
 
void GetTouches (IControl *pControl, std::vector< ITouchID > &touchesOnThisControl) const
 Populate a vector with the touchIDs active on pControl. More...
 
IControlGetBackgroundControl ()
 
IPopupMenuControlGetPopupMenuControl ()
 
ITextEntryControlGetTextEntryControl ()
 
IBubbleControlGetBubbleControl (int i=0)
 
int NBubbleControls () const
 
void StyleAllVectorControls (const IVStyle &style)
 Helper method to style all of the controls which inherit IVectorBase. More...
 
void UpdatePeers (IControl *pCaller, int callerValIdx)
 This method is called after interacting with a control, so that any other controls linked to the same parameter index, will also be set dirty, and have their values updated. More...
 
int NControls () const
 
void RemoveControlWithTag (int ctrlTag)
 Remove controls from the control list with a particular tag. More...
 
void RemoveControls (int fromIdx)
 Remove controls from the control list above a particular index, (frees memory). More...
 
void RemoveControl (int idx)
 Remove a control at a particular index, (frees memory). More...
 
void RemoveControl (IControl *pControl)
 Remove a control at using ptr, (frees memory). More...
 
void RemoveAllControls ()
 Removes all regular IControls from the control list, as well as special controls (frees memory). More...
 
void HideControl (int paramIdx, bool hide)
 Hide controls linked to a specific parameter. More...
 
void DisableControl (int paramIdx, bool diable)
 Disable or enable controls linked to a specific parameter. More...
 
void SetAllControlsDirty ()
 Calls SetDirty() on every control. More...
 
void SetAllControlsClean ()
 Calls SetClean() on every control. More...
 
void SetControlPosition (IControl *pControl, float x, float y)
 Reposition a control, redrawing the interface correctly. More...
 
void SetControlSize (IControl *pControl, float w, float h)
 Resize a control, redrawing the interface correctly. More...
 
void SetControlBounds (IControl *pControl, const IRECT &r)
 Set a controls target and draw rect to r, redrawing the interface correctly. More...
 
void OnMouseDown (const std::vector< IMouseInfo > &points)
 Called when the platform class sends mouse down events. More...
 
void OnMouseUp (const std::vector< IMouseInfo > &points)
 Called when the platform class sends mouse up events. More...
 
void OnMouseDrag (const std::vector< IMouseInfo > &points)
 Called when the platform class sends drag events. More...
 
void OnTouchCancelled (const std::vector< IMouseInfo > &points)
 Called when the platform class sends touch cancel events. More...
 
bool OnMouseDblClick (float x, float y, const IMouseMod &mod)
 
void OnMouseWheel (float x, float y, const IMouseMod &mod, float delta)
 
bool OnKeyDown (float x, float y, const IKeyPress &key)
 
bool OnKeyUp (float x, float y, const IKeyPress &key)
 
bool OnMouseOver (float x, float y, const IMouseMod &mod)
 
void OnMouseOut ()
 Called when the mouse leaves the graphics context. More...
 
void OnSetCursor ()
 Called when the mouse enters the graphics context, to update the cursor to mCursorType. More...
 
void OnDrop (const char *str, float x, float y)
 
void OnDropMultiple (const std::vector< const char * > &paths, float x, float y)
 
void OnGUIIdle ()
 This is an idle timer tick call on the GUI thread, only active if USE_IDLE_CALLS is defined. More...
 
void OnDragResize (float x, float y)
 Called by ICornerResizerControl as the corner is dragged to resize. More...
 
void OnAppearanceChanged (EUIAppearance appearance)
 Called by the platform class if the view changes to dark/light mode. More...
 
virtual EUIAppearance GetUIAppearance () const
 Get the UI Appearance (Light/Dark mode) More...
 
void EnableMouseOver (bool enable)
 
void ReleaseMouseCapture ()
 Used to tell the graphics context to stop tracking mouse interaction with a control. More...
 
bool CanEnableMouseOver () const
 
int GetMouseOver () const
 
void GetMouseDownPoint (float &x, float &y) const
 Get the x, y position of the last mouse down message. More...
 
void SetTabletInput (bool tablet)
 Set by the platform class if the mouse input is coming from a tablet/stylus. More...
 
int GetParamIdxForPTAutomation (float x, float y)
 [AAX only] This can be called by the ProTools API class (e.g. More...
 
int GetLastClickedParamForPTAutomation ()
 [AAX only] More...
 
void SetPTParameterHighlight (int paramIdx, bool isHighlighted, int color)
 [AAX only] See AAX_CEffectGUI::SetControlHighlightInfo() More...
 
void PopupHostContextMenuForParam (int controlIdx, int paramIdx, float x, float y)
 [VST3 primarily] In VST3 plug-ins this enable support for the IContextMenu interface, which allows the host to add contextual options to e.g. More...
 
void PopupHostContextMenuForParam (IControl *pControl, int paramIdx, float x, float y)
 [VST3 primarily] In VST3 plug-ins this enable support for the IContextMenu interface, which allows the host to add contextual options to e.g. More...
 
const char * GetSharedResourcesSubPath () const
 Gets the name of the shared resources subpath. More...
 
void SetSharedResourcesSubPath (const char *sharedResourcesSubPath)
 Sets the name of the shared resources subpath. More...
 
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. More...
 
virtual IBitmap LoadBitmap (const char *name, const void *pData, int dataSize, int nStates=1, bool framesAreHorizontal=false, int targetScale=0)
 Load a bitmap image from memory. More...
 
virtual ISVG LoadSVG (const char *fileNameOrResID, const char *units="px", float dpi=72.f)
 Load an SVG from disk or from windows resource. More...
 
virtual ISVG LoadSVG (const char *name, const void *pData, int dataSize, const char *units="px", float dpi=72.f)
 Load an SVG image from memory. More...
 
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. More...
 
virtual void AttachGestureRecognizer (EGestureType type)
 Registers a gesture recognizer with the graphics context. More...
 
void AttachGestureRecognizerToRegion (const IRECT &bounds, EGestureType type, IGestureFunc func)
 Attach a gesture recognizer to a rectangular region of the GUI, i.e. More...
 
void ClearGestureRegions ()
 Remove all gesture recognizers linked to regions. More...
 

Protected Member Functions

virtual void ApplyShadowMask (ILayerPtr &layer, RawBitmapData &mask, const IShadow &shadow)=0
 Implemented by a graphics backend to apply a calculated shadow mask to a layer, according to the shadow settings specified. More...
 
virtual void UpdateLayer ()
 Implemented by a graphics backend to prepare for drawing to the layer at the top of the stack. More...
 
void PushLayer (ILayer *pLayer)
 Push a layer on to the stack. More...
 
ILayerPopLayer ()
 Pop a layer off the stack. More...
 
virtual void ActivateGLContext ()
 
virtual void DeactivateGLContext ()
 
virtual void CreatePlatformTextEntry (int paramIdx, const IText &text, const IRECT &bounds, int length, const char *str)=0
 Creates a platform native text entry field. More...
 
virtual IPopupMenuCreatePlatformPopupMenu (IPopupMenu &menu, const IRECT bounds, bool &isAsync)=0
 Calls the platform backend to create the platform popup menu. More...
 
virtual APIBitmapLoadAPIBitmap (const char *fileNameOrResID, int scale, EResourceLocation location, const char *ext)=0
 Drawing API method to load a bitmap, called internally. More...
 
virtual APIBitmapLoadAPIBitmap (const char *name, const void *pData, int dataSize, int scale)=0
 Drawing API method to load a bitmap from binary data, called internally. More...
 
virtual APIBitmapCreateAPIBitmap (int width, int height, float scale, double drawScale, bool cacheable=false)=0
 Creates a new API bitmap, either in memory or as a GPU texture. More...
 
virtual bool LoadAPIFont (const char *fontID, const PlatformFontPtr &font)=0
 Drawing API method to load a font from a PlatformFontPtr, called internally. More...
 
virtual bool AssetsLoaded ()
 Specialized in IGraphicsCanvas drawing backend. More...
 
virtual int AlphaChannel () const =0
 
virtual bool FlippedBitmap () const =0
 
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. More...
 
APIBitmapSearchBitmapInCache (const char *fileName, int targetScale, int &sourceScale)
 Search the static storage cache for a bitmap image resource matching the target scale. More...
 
virtual float DoMeasureText (const IText &text, const char *str, IRECT &bounds) const =0
 
virtual void DoDrawText (const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=nullptr)=0
 
void DoMeasureTextRotation (const IText &text, const IRECT &bounds, IRECT &rect) const
 
void CalculateTextRotation (const IText &text, const IRECT &bounds, IRECT &rect, double &tx, double &ty) const
 
virtual float GetBackingPixelScale () const
 
IMatrix GetTransformMatrix () const
 

Protected Attributes

IGEditorDelegatemDelegate
 
bool mCursorHidden = false
 
bool mCursorLock = false
 
bool mTabletInput = false
 
float mCursorX = -1.f
 
float mCursorY = -1.f
 
float mXTranslation = 0.f
 
float mYTranslation = 0.f
 
std::stack< ILayer * > mLayers
 
IRECT mClipRECT
 
IMatrix mTransform
 
std::stack< IMatrixmTransformStates
 

Friends

class IGraphicsLiveEdit
 
class ICornerResizerControl
 
class ITextEntryControl
 

Detailed Description

The lowest level base class of an IGraphics context.

Definition at line 82 of file IGraphics.h.

Constructor & Destructor Documentation

◆ IGraphics()

IGraphics::IGraphics ( IGEditorDelegate dlg,
int  w,
int  h,
int  fps = DEFAULT_FPS,
float  scale = 1. 
)

Definition at line 46 of file IGraphics.cpp.

◆ ~IGraphics()

IGraphics::~IGraphics ( )
virtual

Definition at line 61 of file IGraphics.cpp.

Member Function Documentation

◆ ActivateGLContext()

virtual void IGraphics::ActivateGLContext ( )
inlineprotectedvirtual

Definition at line 975 of file IGraphics.h.

◆ AlphaChannel()

virtual int IGraphics::AlphaChannel ( ) const
protectedpure virtual
Returns
int The index of the alpha component in a drawing backend's pixel (RGBA or ARGB)

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by ApplyLayerDropShadow().

◆ ApplyLayerDropShadow()

void IGraphics::ApplyLayerDropShadow ( ILayerPtr layer,
const IShadow shadow 
)

Applies a drop shadow directly onto a layer.

Parameters
layer- the layer to add the shadow to
shadow- the shadow to add

Definition at line 2075 of file IGraphics.cpp.

References AlphaChannel(), ApplyShadowMask(), FlippedBitmap(), and GetLayerBitmapData().

Referenced by TestDropShadowControl::Draw(), GFXLabelControl::Draw(), and TestShadowGradientControl::Draw().

◆ ApplyShadowMask()

virtual void IGraphics::ApplyShadowMask ( ILayerPtr layer,
RawBitmapData &  mask,
const IShadow shadow 
)
protectedpure virtual

Implemented by a graphics backend to apply a calculated shadow mask to a layer, according to the shadow settings specified.

Parameters
layerThe layer to apply the shadow to
maskThe mask of the shadow as raw bitmap data
shadowThe shadow specification

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by ApplyLayerDropShadow().

◆ AssetsLoaded()

virtual bool IGraphics::AssetsLoaded ( )
inlineprotectedvirtual

Specialized in IGraphicsCanvas drawing backend.

Reimplemented in IGraphicsCanvas.

Definition at line 1725 of file IGraphics.h.

◆ AssignParamNameToolTips()

void IGraphics::AssignParamNameToolTips ( )

Call this method in order to create tool tips for every IControl that show the associated parameter's name.

Definition at line 592 of file IGraphics.cpp.

References ForStandardControlsFunc().

◆ AttachBackground()

void IGraphics::AttachBackground ( const char *  fileName)

Attach an IBitmapControl as the lowest IControl in the control stack to be the background for the graphics context.

Parameters
fileNameCString fileName resource id for the bitmap image

Definition at line 280 of file IGraphics.cpp.

References GetDelegate(), LoadBitmap(), and IControl::SetDelegate().

◆ AttachBubbleControl() [1/2]

void IGraphics::AttachBubbleControl ( const IText text = DEFAULT_TEXT)

Attach the default control to show text as a control changes.

Definition at line 344 of file IGraphics.cpp.

References AttachBubbleControl().

Referenced by AttachBubbleControl().

◆ AttachBubbleControl() [2/2]

void IGraphics::AttachBubbleControl ( IBubbleControl pControl)

Attach a custom control to show text as a control changes.

Definition at line 350 of file IGraphics.cpp.

References GetDelegate(), and IControl::SetDelegate().

◆ AttachControl()

IControl * IGraphics::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.

The control is owned by the graphics context and will be deleted when the context is deleted.

Parameters
pControlA pointer to an IControl to attach.
ctrlTagAn integer tag that you can use to identify the control
groupA CString that you can use to address controlled by group
Returns
The index of the control (and the number of controls in the stack)

Definition at line 301 of file IGraphics.cpp.

References GetDelegate(), IControl::OnAttached(), IControl::SetDelegate(), and IControl::SetGroup().

Referenced by IGraphicsLiveEdit::OnMouseDown(), and IGraphicsLiveEdit::OnPopupMenuSelection().

◆ AttachCornerResizer() [1/2]

void IGraphics::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 
)

Attach the default control to scale or increase the UI size by dragging the plug-in bottom right-hand corner.

Parameters
sizeModeChoose whether to scale or size the UI

Definition at line 320 of file IGraphics.cpp.

References AttachCornerResizer(), and GetBounds().

Referenced by AttachCornerResizer().

◆ AttachCornerResizer() [2/2]

void IGraphics::AttachCornerResizer ( ICornerResizerControl pControl,
EUIResizerMode  sizeMode = EUIResizerMode::Scale,
bool  layoutOnResize = false 
)

Attach your own control to scale or increase the UI size by dragging the plug-in bottom right-hand corner.

Parameters
pControlcontrol a control that inherits from ICornerResizerControl
sizeModeChoose whether to scale or size the UI

Definition at line 325 of file IGraphics.cpp.

References GetDelegate().

◆ AttachGestureRecognizer()

void IGraphics::AttachGestureRecognizer ( EGestureType  type)
virtual

Registers a gesture recognizer with the graphics context.

Parameters
typeThe type of gesture recognizer

Definition at line 2378 of file IGraphics.cpp.

Referenced by IControl::AttachGestureRecognizer(), and AttachGestureRecognizerToRegion().

◆ AttachGestureRecognizerToRegion()

void IGraphics::AttachGestureRecognizerToRegion ( const IRECT bounds,
EGestureType  type,
IGestureFunc  func 
)

Attach a gesture recognizer to a rectangular region of the GUI, i.e.

not linked to an IControl

Parameters
boundsThe area that should recognize the gesture
typeThe type of gesture to recognize
funcThe function to call when the gesture is recognized

Definition at line 2386 of file IGraphics.cpp.

References IRECTList::Add(), AttachGestureRecognizer(), and IRECTList::Size().

◆ AttachPanelBackground()

void IGraphics::AttachPanelBackground ( const IPattern color)

Attach an IPanelControl as the lowest IControl in the control stack to fill the background with a solid color.

Parameters
colorThe color to fill the panel with

Definition at line 294 of file IGraphics.cpp.

References GetBounds(), GetDelegate(), and IControl::SetDelegate().

◆ AttachPlatformView()

virtual void IGraphics::AttachPlatformView ( const IRECT r,
void *  pView 
)
inlinevirtual

Add an OS view as a sub-view, on top of the IGraphics view.

Parameters
rThe bounds where the view should be attached
pViewthe platform view, which would be a HWND on Windows, NSView* on macOS or UIView* on iOS

Definition at line 799 of file IGraphics.h.

Referenced by IPlatformViewControl::OnAttached(), and IWebViewControl::OnAttached().

◆ AttachPopupMenuControl()

void IGraphics::AttachPopupMenuControl ( const IText text = DEFAULT_TEXT,
const IRECT bounds = IRECT() 
)

Attach a control for pop-up menus, to override platform style menus.

Parameters
textThe text style to use for the menu
boundsThe area that the menu should occupy. An empty IRECT will mean the bounds are calculated based on the menu items

Definition at line 356 of file IGraphics.cpp.

References GetDelegate().

Referenced by TestDirBrowseControl::OnMouseDown().

◆ AttachSVGBackground()

void IGraphics::AttachSVGBackground ( const char *  fileName)

Attach an ISVGControl as the lowest IControl in the control stack to be the background for the graphics context.

Parameters
fileNameCString fileName resource id for the SVG image

Definition at line 287 of file IGraphics.cpp.

References GetBounds(), GetDelegate(), LoadSVG(), and IControl::SetDelegate().

◆ AttachTextEntryControl()

void IGraphics::AttachTextEntryControl ( )

Attach a control for text entry, to override platform text entry.

Definition at line 370 of file IGraphics.cpp.

References GetDelegate().

◆ BeginFrame()

void IGraphics::BeginFrame ( )
virtual

Called at the beginning of drawing.

Call base implementation if overridden.

Reimplemented in IGraphicsNanoVG, and IGraphicsSkia.

Definition at line 867 of file IGraphics.cpp.

Referenced by IGraphicsNanoVG::BeginFrame(), IGraphicsSkia::BeginFrame(), and Draw().

◆ BitmapExtSupported()

virtual bool IGraphics::BitmapExtSupported ( const char *  ext)
pure virtual

Checks a file extension and reports whether this drawing API supports loading that extension.

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by LoadBitmap().

◆ CachePlatformFont()

virtual void IGraphics::CachePlatformFont ( const char *  fontID,
const PlatformFontPtr &  font 
)
pure virtual

Called to indicate that the platform should cache data about the platform font if needed.

Parameters
fontIDA string that is used to reference the font
fontA const PlatformFontPtr reference to the relevant font

Referenced by LoadFont().

◆ CalculateTextRotation()

void IGraphics::CalculateTextRotation ( const IText text,
const IRECT bounds,
IRECT rect,
double &  tx,
double &  ty 
) const
protected
Todo:
Parameters
text
Todo:
Parameters
bounds
Todo:
Parameters
rect
Todo:
Parameters
tx
Todo:
Parameters
ty
Todo:

Definition at line 2235 of file IGraphics.cpp.

References IRECT::MH(), IRECT::MW(), IMatrix::Rotate(), IMatrix::TransformPoint(), and IRECT::Union().

Referenced by DoMeasureTextRotation().

◆ CanEnableMouseOver()

bool IGraphics::CanEnableMouseOver ( ) const
inline
Returns
true if the context can handle mouse overs

Definition at line 1585 of file IGraphics.h.

◆ CheckLayer()

bool IGraphics::CheckLayer ( const ILayerPtr layer)

Test to see if a layer needs drawing, for instance if the control's bounds were changed.

Parameters
layerThe layer to check
Returns
true if the layer needs to be updated

Definition at line 2032 of file IGraphics.cpp.

References GetDrawScale(), APIBitmap::GetDrawScale(), APIBitmap::GetScale(), and GetScreenScale().

Referenced by IVPlotControl::Draw(), IWheelControl::Draw(), TestDropShadowControl::Draw(), GFXLabelControl::Draw(), TestKeyboardControl::Draw(), TestLayerControl::Draw(), TestMTControl::Draw(), TestSVGControl::Draw(), and ISVGControl::Draw().

◆ ClearGestureRegions()

void IGraphics::ClearGestureRegions ( )

Remove all gesture recognizers linked to regions.

Definition at line 2393 of file IGraphics.cpp.

References IRECTList::Clear().

◆ ClearInTextEntryControl()

void IGraphics::ClearInTextEntryControl ( )
inline

Called when the text entry is dismissed, to reset mInTextEntry.

Definition at line 1134 of file IGraphics.h.

Referenced by RemoveControl(), RemoveControls(), and SetControlValueAfterTextEdit().

◆ ClientToScreen()

virtual void IGraphics::ClientToScreen ( float &  x,
float &  y 
)
inlinevirtual

Convert an x, y position in the view to screen coordinates.

Parameters
xthe x position to convert
ythe y position to convert

Definition at line 940 of file IGraphics.h.

◆ ControlIsCaptured() [1/2]

bool IGraphics::ControlIsCaptured ( ) const
inline

Check to see if any control is captured.

Definition at line 1395 of file IGraphics.h.

Referenced by IBubbleControl::IBubbleControl(), OnMouseDrag(), OnMouseUp(), OnTouchCancelled(), RemoveControl(), and RemoveControls().

◆ ControlIsCaptured() [2/2]

bool IGraphics::ControlIsCaptured ( IControl pControl) const
inline

Check to see if the control is already captured.

Returns
true is the control is already captured

Definition at line 1399 of file IGraphics.h.

◆ CreateAPIBitmap()

virtual APIBitmap * IGraphics::CreateAPIBitmap ( int  width,
int  height,
float  scale,
double  drawScale,
bool  cacheable = false 
)
protectedpure virtual

Creates a new API bitmap, either in memory or as a GPU texture.

Parameters
widthThe desired width
heightThe desired height
scaleThe scale in relation to 1:1 pixels
drawScale
Todo:
Parameters
cacheableUsed to make sure the underlying bitmap can be shared between plug-in instances
Returns
APIBitmap* The new API Bitmap

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by StartLayer().

◆ CreatePlatformPopupMenu()

virtual IPopupMenu * IGraphics::CreatePlatformPopupMenu ( IPopupMenu menu,
const IRECT  bounds,
bool &  isAsync 
)
protectedpure virtual

Calls the platform backend to create the platform popup menu.

Parameters
menuThe source IPopupMenu
boundsThe rectangular area in which to create the menu
isAsyncThis gets set true on platforms where popupmenu creation is asyncronous
Returns
A ptr to the chosen IPopupMenu or nullptr in the case of async or dismissed menu

◆ CreatePlatformTextEntry()

virtual void IGraphics::CreatePlatformTextEntry ( int  paramIdx,
const IText text,
const IRECT bounds,
int  length,
const char *  str 
)
protectedpure virtual

Creates a platform native text entry field.

Parameters
paramIdxThe index of the parameter associated with the text entry field.
textThe text to be displayed in the text entry field.
boundsThe rectangle that defines the size and position of the text entry field.
lengthThe maximum allowed length of the text in the text entry field.
strThe initial string to be displayed in the text entry field.

Referenced by CreateTextEntry().

◆ CreatePopupMenu() [1/2]

void IGraphics::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.

Parameters
controlA reference to the IControl creating this pop-up menu. If it exists IControl::OnPopupMenuSelection() will be called on successful selection
menuReference to an IPopupMenu class populated with the items for the platform menu
boundsThe platform menu will popup at the bottom left hand corner of this rectangular region
valIdxThe value index for the control value that the menu relates to

Definition at line 1960 of file IGraphics.cpp.

Referenced by CreatePopupMenu(), ITextEntryControl::OnMouseDown(), IWheelControl::OnMouseDown(), TestDirBrowseControl::OnMouseDown(), TestFlexBoxControl::OnMouseDown(), IGraphicsLiveEdit::OnMouseDown(), and PromptUserInput().

◆ CreatePopupMenu() [2/2]

void IGraphics::CreatePopupMenu ( IControl control,
IPopupMenu menu,
float  x,
float  y,
int  valIdx = 0 
)
inline

Shows a pop up/contextual menu at point.

Parameters
controlA reference to the IControl creating this pop-up menu. If it exists IControl::OnPopupMenuSelection() will be called on successful selection
xThe X coordinate at which to pop up the menu
yThe Y coordinate at which to pop up the menu
valIdxThe value index for the control value that the menu relates to

Definition at line 1038 of file IGraphics.h.

References CreatePopupMenu().

◆ CreateTextEntry()

void IGraphics::CreateTextEntry ( IControl control,
const IText text,
const IRECT bounds,
const char *  str = "",
int  valIdx = 0 
)

Create a text entry box.

Parameters
controlThe control that the text entry belongs to. If this control is linked to a parameter, the text entry will be configured with initial text matching the parameter value
textAn IText struct to set the formatting of the text entry box
boundsThe rectangular region that the text entry will occupy.
strA CString to specify the default text to display when the text entry box is opened (unless the control specified by the first argument is linked to a parameter)
valIdxThe value index for the control value that the text entry relates to

Definition at line 1923 of file IGraphics.cpp.

References CreatePlatformTextEntry(), IControl::GetParamIdx(), IControl::GetTextEntryLength(), and IControl::SetDirty().

Referenced by IVNumberBoxControl::OnMouseDblClick(), TestTextControl::OnMouseDblClick(), PlaceHolder::OnMouseDblClick(), IEditableTextControl::OnMouseDown(), and PromptUserInput().

◆ DeactivateGLContext()

virtual void IGraphics::DeactivateGLContext ( )
inlineprotectedvirtual

Definition at line 978 of file IGraphics.h.

◆ DisableControl()

void IGraphics::DisableControl ( int  paramIdx,
bool  diable 
)

Disable or enable controls linked to a specific parameter.

Parameters
paramIdxThe parameter index
disable/c true to disable

Definition at line 483 of file IGraphics.cpp.

References ForMatchingControls(), and IControl::SetDisabled().

◆ DoDrawText()

virtual void IGraphics::DoDrawText ( const IText text,
const char *  str,
const IRECT bounds,
const IBlend pBlend = nullptr 
)
protectedpure virtual
Todo:
Parameters
text
Todo:
Parameters
str
Todo:
Parameters
bounds
Todo:
Parameters
pBlend
Todo:

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by DrawText().

◆ DoMeasureText()

virtual float IGraphics::DoMeasureText ( const IText text,
const char *  str,
IRECT bounds 
) const
protectedpure virtual
Todo:
Parameters
text
Todo:
Parameters
str
Todo:
Parameters
bounds
Todo:
Returns
The width of the text

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by MeasureText().

◆ DoMeasureTextRotation()

void IGraphics::DoMeasureTextRotation ( const IText text,
const IRECT bounds,
IRECT rect 
) const
protected
Todo:
Parameters
text
Todo:
Parameters
bounds
Todo:
Parameters
rect
Todo:

Definition at line 2227 of file IGraphics.cpp.

References CalculateTextRotation(), and IRECT::Translate().

Referenced by IGraphicsCanvas::DoMeasureText(), IGraphicsNanoVG::DoMeasureText(), and IGraphicsSkia::DoMeasureText().

◆ DoTextRotation()

void IGraphics::DoTextRotation ( const IText text,
const IRECT bounds,
const IRECT rect 
)
inline

Definition at line 759 of file IGraphics.h.

◆ Draw()

void IGraphics::Draw ( IRECTList rects)

Called by the platform class indicating a number of rectangles in the UI that need to redraw.

Parameters
rectsA set of rectangular regions to draw

Definition at line 938 of file IGraphics.cpp.

References BeginFrame(), IRECTList::Bounds(), Draw(), EndFrame(), IRECTList::Get(), GetBackingPixelScale(), IRECTList::Optimize(), IRECT::PixelAlign(), IRECTList::PixelAlign(), and IRECTList::Size().

Referenced by Draw().

◆ DrawArc()

void IGraphics::DrawArc ( const IColor color,
float  cx,
float  cy,
float  r,
float  a1,
float  a2,
const IBlend pBlend = 0,
float  thickness = 1.f 
)
virtual

Draw an arc to the graphics context.

Parameters
colorThe color to draw the shape with
cxThe X coordinate of the centre of the circle on which the arc lies
cyThe Y coordinate of the centre of the circle on which the arc lies
rThe radius of the circle on which the arc lies
a1the start angle of the arc at in degrees clockwise where 0 is up
a2the end angle of the arc at in degrees clockwise where 0 is up
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 2525 of file IGraphics.cpp.

References PathArc(), PathClear(), and PathStroke().

Referenced by TestArcControl::Draw().

◆ DrawBitmap() [1/2]

void IGraphics::DrawBitmap ( const IBitmap bitmap,
const IRECT bounds,
int  frame = 1,
const IBlend pBlend = 0 
)

Draws a bitmap into the graphics context.

NOTE: this helper method handles multi-frame bitmaps, indexable via frame

Parameters
bitmap- the bitmap to draw
bounds- where to draw the bitmap
frame- the frame index of the bitmap to draw (when bitmap is multi-frame)
pBlend- blend operation

Definition at line 692 of file IGraphics.cpp.

References Clip(), DrawBitmap(), IBitmap::GetFramesAreHorizontal(), IBitmap::H(), IBitmap::N(), and IBitmap::W().

◆ DrawBitmap() [2/2]

virtual void IGraphics::DrawBitmap ( const IBitmap bitmap,
const IRECT bounds,
int  srcX,
int  srcY,
const IBlend pBlend = 0 
)
pure virtual

Draw a bitmap (raster) image to the graphics context.

Parameters
bitmapThe bitmap image to draw to the graphics context
boundsThe rectangular region to draw the image in
srcXThe X offset in the source image to draw from
srcYThe Y offset in the source image to draw from
pBlendOptional blend method

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by IBSliderControl::Draw(), IWheelControl::Draw(), DrawBitmap(), IBitmapBase::DrawBitmap(), DrawBitmapedText(), DrawFittedBitmap(), DrawFittedLayer(), DrawLayer(), DrawRotatedBitmap(), and ScaleBitmap().

◆ DrawBitmapedText()

void IGraphics::DrawBitmapedText ( const IBitmap bitmap,
const IRECT bounds,
IText text,
IBlend pBlend,
const char *  str,
bool  vCenter = true,
bool  multiline = false,
int  charWidth = 6,
int  charHeight = 12,
int  charOffset = 0 
)

Draws mono spaced bitmap text.

Useful for identical looking text on multiple platforms.

Parameters
bitmapthe bitmap containing glyphs to draw
boundswhere to draw the bitmap
texttext properties (note - many of these are irrelevant for bitmapped text)
pBlendblend operation
strthe string to draw
vCentercentre the text vertically
multilineshould the text spill onto multiple lines
charWidthhow wide is a character in the bitmap
charHeighthow high is a character in the bitmap
charOffsetwhat is the offset between characters drawn

Definition at line 714 of file IGraphics.cpp.

References DrawBitmap(), IRECT::H(), and IRECT::W().

Referenced by IBTextControl::Draw().

◆ DrawCircle()

void IGraphics::DrawCircle ( const IColor color,
float  cx,
float  cy,
float  r,
const IBlend pBlend = 0,
float  thickness = 1.f 
)
virtual

Draw a circle to the graphics context.

Parameters
colorThe color to draw the shape with
cxThe X coordinate of the centre of the circle
cyThe Y coordinate of the centre of the circle
rThe radius of the circle
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 2532 of file IGraphics.cpp.

References PathCircle(), PathClear(), and PathStroke().

Referenced by TestArcControl::Draw().

◆ DrawConvexPolygon()

void IGraphics::DrawConvexPolygon ( const IColor color,
float *  x,
float *  y,
int  nPoints,
const IBlend pBlend = 0,
float  thickness = 1.f 
)
virtual

Draw a convex polygon to the graphics context.

Parameters
colorThe color to draw the shape with
xPointer to the first element in an array of X coordinates for the vertices of the polygon
yPointer to the first element in an array of Y coordinates for the vertices of the polygon
nPointsThe number of points in the coordinate arrays
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 2518 of file IGraphics.cpp.

References PathClear(), PathConvexPolygon(), and PathStroke().

Referenced by TestPolyControl::Draw().

◆ DrawData()

void IGraphics::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 
)
virtual

Draw a line between a collection of normalized points.

Parameters
colorThe color to draw the line with
boundsThe rectangular region to draw the line in
normYPointsPtr to float array - the normalized Y positions of the points
nPointsThe number of points in the normYPoints / normXPoints
normXPointsOptional normailzed X positions of the points
pBlendOptional blend method
thicknessOptional line thickness
pFillColorOptional color for the fill area

Definition at line 2450 of file IGraphics.cpp.

References IRECT::H(), PathClear(), PathFill(), PathLineTo(), PathMoveTo(), PathStroke(), and IRECT::W().

Referenced by IVPlotControl::Draw(), and IVScopeControl< MAXNC, MAXBUF >::DrawWidget().

◆ DrawDottedLine()

void IGraphics::DrawDottedLine ( const IColor color,
float  x1,
float  y1,
float  x2,
float  y2,
const IBlend pBlend = 0,
float  thickness = 1.f,
float  dashLen = 2.f 
)
virtual

Draw a dotted line to the graphics context.

Parameters
colorThe color to draw the shape with
x1The X coordinate of the start of the line
y1The Y coordinate of the start of the line
x2The X coordinate of the end of the line
y2The Y coordinate of the end of the line
pBlendOptional blend method
thicknessOptional line thickness

Reimplemented in IGraphicsNanoVG.

Definition at line 2479 of file IGraphics.cpp.

References PathClear(), PathLineTo(), PathMoveTo(), and PathStroke().

◆ DrawDottedRect()

void IGraphics::DrawDottedRect ( const IColor color,
const IRECT bounds,
const IBlend pBlend = 0,
float  thickness = 1.f,
float  dashLen = 2.f 
)
virtual

Draw a dotted rectangle to the graphics context.

Parameters
colorThe color to draw the shape with
boundsThe rectangular region to draw the shape in
pBlendOptional blend method
thicknessOptional line thickness

Reimplemented in IGraphicsNanoVG.

Definition at line 2539 of file IGraphics.cpp.

References PathClear(), PathRect(), and PathStroke().

Referenced by TestAnimationControl::Draw(), TestColorControl::Draw(), TestCursorControl::Draw(), TestDirBrowseControl::Draw(), TestDragAndDropControl::Draw(), TestDrawContextControl::Draw(), TestDropShadowControl::Draw(), TestGesturesControl::Draw(), TestGradientControl::Draw(), TestImageControl::Draw(), TestLayerControl::Draw(), TestMultiPathControl::Draw(), TestSVGControl::Draw(), and IGraphicsLiveEdit::Draw().

◆ DrawEllipse() [1/2]

void IGraphics::DrawEllipse ( const IColor color,
const IRECT bounds,
const IBlend pBlend = 0,
float  thickness = 1.f 
)
virtual

Draw an ellipse within a rectangular region of the graphics context.

Parameters
colorThe color to draw the shape with
boundsThe rectangular region to draw the shape in
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 2548 of file IGraphics.cpp.

References PathClear(), PathEllipse(), and PathStroke().

Referenced by ILEDControl::Draw(), TestMTControl::Draw(), and IVectorBase::DrawPressableEllipse().

◆ DrawEllipse() [2/2]

void IGraphics::DrawEllipse ( const IColor color,
float  x,
float  y,
float  r1,
float  r2,
float  angle = 0.0,
const IBlend pBlend = 0,
float  thickness = 1.f 
)
virtual

Draw an ellipse around a central point given two radii and an angle of orientation.

Parameters
colorThe color to draw the shape with
xThe X coordinate of the centre of the ellipse
yThe Y coordinate of the centre of the ellipse
r1The radius of the ellipse along the line found by rotating the x-axis by the angle
r2The radius of the ellipse along the line found by rotating the y-axis by the angle
angleThe angle rotates the radii r1 and r2 clockwise in degrees to adjust the orientation
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 2555 of file IGraphics.cpp.

References PathClear(), PathEllipse(), and PathStroke().

◆ DrawFastDropShadow()

virtual void IGraphics::DrawFastDropShadow ( const IRECT innerBounds,
const IRECT outerBounds,
float  xyDrop = 5.f,
float  roundness = 0.f,
float  blur = 10.f,
IBlend pBlend = nullptr 
)
inlinevirtual

NanoVG only.

Reimplemented in IGraphicsSkia, and IGraphicsNanoVG.

Definition at line 404 of file IGraphics.h.

Referenced by IPopupMenuControl::DrawPanelShadow().

◆ DrawFittedBitmap()

void IGraphics::DrawFittedBitmap ( const IBitmap bitmap,
const IRECT bounds,
const IBlend pBlend = 0 
)
virtual

Draw a bitmap (raster) image to the graphics context, scaling the image to fit the bounds.

Parameters
bitmapThe bitmap image to draw to the graphics context
boundsThe rectangular region to draw the image in
pBlendOptional blend method

Definition at line 2774 of file IGraphics.cpp.

References DrawBitmap(), IBitmap::H(), IRECT::H(), PathTransformRestore(), PathTransformSave(), PathTransformScale(), PathTransformTranslate(), IBitmap::W(), and IRECT::W().

Referenced by TestBlendControl::Draw(), TestImageControl::Draw(), and TestMaskControl::Draw().

◆ DrawFittedLayer()

void IGraphics::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's bounds.

Parameters
layerThe layer to draw
boundsThe bounds in which to draw the layer
pBlendOptional blend method

Definition at line 2053 of file IGraphics.cpp.

References DrawBitmap(), IRECT::H(), PathTransformRestore(), PathTransformSave(), PathTransformScale(), PathTransformTranslate(), and IRECT::W().

◆ DrawGrid()

void IGraphics::DrawGrid ( const IColor color,
const IRECT bounds,
float  gridSizeH,
float  gridSizeV,
const IBlend pBlend = 0,
float  thickness = 1.f 
)
virtual

Draw a grid to the graphics context.

Parameters
colorThe color to draw the grid lines with
boundsThe rectangular region to fill the grid in
gridSizeHThe width of the grid cells
gridSizeVThe height of the grid cells
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 2424 of file IGraphics.cpp.

References PathClear(), PathLineTo(), PathMoveTo(), and PathStroke().

Referenced by IVPlotControl::Draw(), IWheelControl::Draw(), and IGraphicsLiveEdit::Draw().

◆ DrawHorizontalLine() [1/2]

void IGraphics::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.

Parameters
colorThe color to draw the line with
boundsThe rectangular region to draw the line in
yThe normalized position of the line on the vertical axis, within bounds
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 794 of file IGraphics.cpp.

References Clip(), and DrawHorizontalLine().

Referenced by IVTrackControlBase::DrawBackground(), DrawHorizontalLine(), DrawLineAcross(), and IVScopeControl< MAXNC, MAXBUF >::DrawWidget().

◆ DrawHorizontalLine() [2/2]

void IGraphics::DrawHorizontalLine ( const IColor color,
float  yi,
float  xLo,
float  xHi,
const IBlend pBlend = 0,
float  thickness = 1.f 
)

Draw a clipped horizontal line at a position bounds.

Parameters
colorThe color to draw the line with
yiThe position of the line on the y axis
xLoThe start of the horizontal line on the x axis
xHiThe end of the horizontal line on the x axis
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 806 of file IGraphics.cpp.

References DrawLine().

◆ DrawLayer()

void IGraphics::DrawLayer ( const ILayerPtr layer,
const IBlend pBlend = nullptr 
)

◆ DrawLine()

void IGraphics::DrawLine ( const IColor color,
float  x1,
float  y1,
float  x2,
float  y2,
const IBlend pBlend = 0,
float  thickness = 1.f 
)
virtual

Draw a line to the graphics context.

Parameters
colorThe color to draw the line with
x1The X coordinate of the start of the line
y1The Y coordinate of the start of the line
x2The X coordinate of the end of the line
y2The Y coordinate of the end of the line
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 2416 of file IGraphics.cpp.

References PathClear(), PathLineTo(), PathMoveTo(), and PathStroke().

Referenced by IVKeyboardControl::Draw(), TestSizeControl::Draw(), IURLControl::Draw(), PlaceHolder::Draw(), DrawHorizontalLine(), DrawRadialLine(), and DrawVerticalLine().

◆ DrawLineAcross()

void IGraphics::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.

Parameters
colorThe color to draw the line with
boundsThe rectangular region to draw the line in
dirThe direction of the line
posThe normalized position of the line on the horizontal or vertical axis, within bounds
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 779 of file IGraphics.cpp.

References DrawHorizontalLine(), and DrawVerticalLine().

◆ DrawMultiLineText()

virtual void IGraphics::DrawMultiLineText ( const IText text,
const char *  str,
IRECT bounds,
const IBlend pBlend = 0 
)
inlinevirtual

Draw some multi-line text to the graphics context in a specific rectangle (NanoVG only)

Parameters
textAn IText struct containing font and text properties and layout info
strThe text string to draw
boundsThe rectangular region in the graphics where you would like to draw the text
pBlendOptional blend method

Reimplemented in IGraphicsNanoVG.

Definition at line 363 of file IGraphics.h.

References DrawText().

Referenced by IMultiLineTextControl::Draw().

◆ DrawPoint()

void IGraphics::DrawPoint ( const IColor color,
float  x,
float  y,
const IBlend pBlend = 0 
)
virtual

Fill a rectangle corresponding to a pixel on a 1:1 screen with a color.

Parameters
colorThe color to fill the point with
xThe X coordinate at which to draw
yThe Y coordinate at which to draw
pBlendOptional blend method

Definition at line 2411 of file IGraphics.cpp.

References FillRect().

◆ DrawRadialLine()

void IGraphics::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.

Parameters
colorThe color to draw the line with
cxcentre point x coordinate
cycentre point y coordinate
angleThe angle to draw at in degrees clockwise where 0 is up
rMinminima of the radial line (distance from cx,cy)
rMaxmaxima of the radial line (distance from cx,cy)
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 811 of file IGraphics.cpp.

References DrawLine().

Referenced by TestArcControl::Draw(), and TestLayerControl::Draw().

◆ DrawRect()

void IGraphics::DrawRect ( const IColor color,
const IRECT bounds,
const IBlend pBlend = 0,
float  thickness = 1.f 
)
virtual

◆ DrawRotatedBitmap()

void IGraphics::DrawRotatedBitmap ( const IBitmap bitmap,
float  destCentreX,
float  destCentreY,
double  angle,
const IBlend pBlend = 0 
)
virtual

Draw a bitmap (raster) image to the graphics context with rotation.

Parameters
bitmapThe bitmap image to draw to the graphics context
destCentreXThe X of the centre point at which to rotate the image around
destCentreYThe Y of the centre point at which to rotate the image around
angleThe angle of rotation in degrees clockwise
pBlendOptional blend method

Definition at line 2399 of file IGraphics.cpp.

References DrawBitmap(), IBitmap::GetDrawScale(), IBitmap::H(), PathTransformRestore(), PathTransformRotate(), PathTransformSave(), PathTransformTranslate(), and IBitmap::W().

Referenced by IBKnobRotaterControl::Draw(), and DrawRotatedLayer().

◆ DrawRotatedLayer()

void IGraphics::DrawRotatedLayer ( const ILayerPtr layer,
double  angle 
)

Draw a layer to the main IGraphics context, with rotation.

Parameters
layerThe layer to draw
angleThe angle of rotation in degrees clockwise

Definition at line 2065 of file IGraphics.cpp.

References DrawRotatedBitmap(), IRECT::MH(), IRECT::MW(), PathTransformReset(), PathTransformRestore(), and PathTransformSave().

◆ DrawRotatedSVG()

void IGraphics::DrawRotatedSVG ( const ISVG svg,
float  destCentreX,
float  destCentreY,
float  width,
float  height,
double  angle,
const IBlend pBlend = 0 
)
virtual

Draw an SVG image to the graphics context with rotation.

Parameters
svgThe SVG image to draw to the graphics context
destCentreXThe X coordinate of the centre point at which to rotate the image around
destCentreYThe Y coordinate of the centre point at which to rotate the image around
widthThe width of the drawn SVG
heightThe heigh of the drawn SVG
angleThe angle to rotate the SVG mask at in degrees clockwise
pBlendOptional blend method

Definition at line 2797 of file IGraphics.cpp.

References DrawSVG(), PathTransformRestore(), PathTransformRotate(), PathTransformSave(), and PathTransformTranslate().

Referenced by ISVGKnobControl::Draw().

◆ DrawRoundRect() [1/2]

void IGraphics::DrawRoundRect ( const IColor color,
const IRECT bounds,
float  cornerRadius = 5.f,
const IBlend pBlend = 0,
float  thickness = 1.f 
)
virtual

Draw a rounded rectangle to the graphics context.

Parameters
colorThe color to draw the shape with
boundsThe rectangular region to draw the shape in
cornerRadiusThe corner radius in pixels
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 2504 of file IGraphics.cpp.

References PathClear(), PathRoundRect(), and PathStroke().

Referenced by IVTabbedPagesControl::Draw(), TestPolyControl::Draw(), and IVectorBase::DrawPressableRectangle().

◆ DrawRoundRect() [2/2]

void IGraphics::DrawRoundRect ( const IColor color,
const IRECT bounds,
float  cRTL,
float  cRTR,
float  cRBR,
float  cRBL,
const IBlend pBlend = 0,
float  thickness = 1.f 
)
virtual

Draw a rounded rectangle to the graphics context with individual corner roundness.

Parameters
colorThe color to draw the shape with
boundsThe rectangular region to draw the shape in
cRTLThe top left corner radius in pixels
cRTRThe top right corner radius in pixels
cRBRThe bottom right corner radius in pixels
cRBLThe bottom left corner radius in pixels
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 2511 of file IGraphics.cpp.

References PathClear(), PathRoundRect(), and PathStroke().

◆ DrawSVG()

void IGraphics::DrawSVG ( const ISVG svg,
const IRECT bounds,
const IBlend pBlend = 0,
const IColor pStrokeColor = nullptr,
const IColor pFillColor = nullptr 
)
virtual

Draw an SVG image to the graphics context.

Parameters
svgThe SVG image to the graphics context
boundsThe rectangular region to draw the image in
pBlendOptional blend method
pStrokeColorOptional color to override all SVG stroke commands
pFillColorOptional color to override all SVG fill commands

Definition at line 2784 of file IGraphics.cpp.

References ISVG::H(), IRECT::H(), PathTransformRestore(), PathTransformSave(), PathTransformScale(), PathTransformTranslate(), ISVG::W(), and IRECT::W().

Referenced by ISVGButtonControl::Draw(), ISVGToggleControl::Draw(), ISVGSwitchControl::Draw(), ISVGSliderControl::Draw(), TestDropShadowControl::Draw(), TestSVGControl::Draw(), ISVGControl::Draw(), and DrawRotatedSVG().

◆ DrawText() [1/2]

void IGraphics::DrawText ( const IText text,
const char *  str,
const IRECT bounds,
const IBlend pBlend = 0 
)

◆ DrawText() [2/2]

void IGraphics::DrawText ( const IText text,
const char *  str,
float  x,
float  y,
const IBlend pBlend = 0 
)

Draw some text to the graphics context at a point.

Parameters
textAn IText struct containing font and text properties and layout info
strThe text string to draw
xThe x position in the graphics where you would like to draw the text
yThe y position in the graphics where you would like to draw the text
pBlendOptional blend method

Definition at line 686 of file IGraphics.cpp.

References DrawText().

◆ DrawTriangle()

void IGraphics::DrawTriangle ( const IColor color,
float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3,
const IBlend pBlend = 0,
float  thickness = 1.f 
)
virtual

Draw a triangle to the graphics context.

Parameters
colorThe color to draw the shape with
x1The X coordinate of the first vertex
y1The Y coordinate of the first vertex
x2The X coordinate of the second vertex
y2The Y coordinate of the second vertex
x3The X coordinate of the third vertex
y3The Y coordinate of the third vertex
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 2490 of file IGraphics.cpp.

References PathClear(), PathStroke(), and PathTriangle().

Referenced by TestArcControl::Draw(), IGraphicsLiveEdit::Draw(), and IVectorBase::DrawPressableTriangle().

◆ DrawVerticalLine() [1/2]

void IGraphics::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.

Parameters
colorThe color to draw the line with
boundsThe rectangular region to draw the line in
xThe normalized position of the line on the horizontal axis, within bounds
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 787 of file IGraphics.cpp.

References Clip(), and DrawVerticalLine().

Referenced by IWheelControl::Draw(), IVTrackControlBase::DrawBackground(), DrawLineAcross(), and DrawVerticalLine().

◆ DrawVerticalLine() [2/2]

void IGraphics::DrawVerticalLine ( const IColor color,
float  xi,
float  yLo,
float  yHi,
const IBlend pBlend = 0,
float  thickness = 1.f 
)

Draw a clipped vertical line at a position bounds.

Parameters
colorThe color to draw the line with
xiThe position of the line on the x axis
yLoThe start of the vertical line on the y axis
yHiThe end of the vertical line on the y axis
pBlendOptional blend method
thicknessOptional line thickness

Definition at line 801 of file IGraphics.cpp.

References DrawLine().

◆ EnableLiveEdit()

void IGraphics::EnableLiveEdit ( bool  enable)

Live edit mode allows you to relocate controls at runtime in debug builds.

Parameters
enableSet true if you wish to enable live editing mode

Definition at line 1533 of file IGraphics.cpp.

References GetDelegate(), ReleaseMouseCapture(), SetAllControlsDirty(), and SetMouseCursor().

◆ EnableMouseOver()

void IGraphics::EnableMouseOver ( bool  enable)
inline
Parameters
enableSet true if you want to handle mouse over messages. Note: this may increase the amount CPU usage if you redraw on mouse overs etc

Definition at line 1579 of file IGraphics.h.

Referenced by IGraphicsLiveEdit::OnInit().

◆ EnableMultiTouch()

bool IGraphics::EnableMultiTouch ( bool  enable)
inline

Enable/disable multi touch, if platform supports it.

Returns
true if platform supports it

Definition at line 1147 of file IGraphics.h.

References PlatformSupportsMultiTouch().

◆ EnableTooltips()

void IGraphics::EnableTooltips ( bool  enable)
Parameters
enableSet true to enable tool tips when the user mouses over a control

Definition at line 1527 of file IGraphics.cpp.

◆ EndFrame()

virtual void IGraphics::EndFrame ( )
inlinevirtual

Called by some drawing API classes to finally blit the draw bitmap onto the screen or perform other cleanup after drawing.

Reimplemented in IGraphicsNanoVG, and IGraphicsSkia.

Definition at line 100 of file IGraphics.h.

Referenced by Draw().

◆ EndLayer()

ILayerPtr IGraphics::EndLayer ( )

End an IGraphics layer.

Switches drawing back to the main context

Returns
ILayerPtr a pointer to the layer, which should be kept around in order to draw it

Definition at line 2000 of file IGraphics.cpp.

References PopLayer().

Referenced by IVPlotControl::Draw(), IWheelControl::Draw(), TestBlendControl::Draw(), TestDropShadowControl::Draw(), GFXLabelControl::Draw(), TestKeyboardControl::Draw(), TestLayerControl::Draw(), TestMTControl::Draw(), TestShadowGradientControl::Draw(), TestSVGControl::Draw(), ISVGControl::Draw(), and ScaleBitmap().

◆ FillArc()

void IGraphics::FillArc ( const IColor color,
float  cx,
float  cy,
float  r,
float  a1,
float  a2,
const IBlend pBlend = 0 
)
virtual

Fill an arc segment with a color.

Parameters
colorThe color to fill the shape with
cxThe X coordinate of the centre of the circle on which the arc lies
cyThe Y coordinate of the centre of the circle on which the arc lies
rThe radius of the circle on which the arc lies
a1the start angle of the arc at in degrees clockwise where 0 is up
a2the end angle of the arc at in degrees clockwise where 0 is up
pBlendOptional blend method

Definition at line 2597 of file IGraphics.cpp.

References PathArc(), PathClear(), PathClose(), PathFill(), and PathMoveTo().

Referenced by TestArcControl::Draw().

◆ FillCircle()

void IGraphics::FillCircle ( const IColor color,
float  cx,
float  cy,
float  r,
const IBlend pBlend = 0 
)
virtual

Fill a circle with a color.

Parameters
colorThe color to fill the shape with
cxThe X coordinate of the centre of the circle
cyThe Y coordinate of the centre of the circle
rThe radius of the circle
pBlendOptional blend method

Definition at line 2606 of file IGraphics.cpp.

References PathCircle(), PathClear(), and PathFill().

Referenced by TestArcControl::Draw(), TestLayerControl::Draw(), IControl::DrawPTHighlight(), and IVectorBase::DrawSplash().

◆ FillConvexPolygon()

void IGraphics::FillConvexPolygon ( const IColor color,
float *  x,
float *  y,
int  nPoints,
const IBlend pBlend = 0 
)
virtual

Fill a convex polygon with a color.

Parameters
colorThe color to fill the shape with
xPointer to the first element in an array of X coordinates for the vertices of the polygon
yPointer to the first element in an array of Y coordinates for the vertices of the polygon
nPointsThe number of points in the coordinate arrays
pBlendOptional blend method

Definition at line 2590 of file IGraphics.cpp.

References PathClear(), PathConvexPolygon(), and PathFill().

Referenced by TestPolyControl::Draw().

◆ FillEllipse() [1/2]

void IGraphics::FillEllipse ( const IColor color,
const IRECT bounds,
const IBlend pBlend = 0 
)
virtual

Fill an ellipse within a rectangular region of the graphics context.

Parameters
colorThe color to fill the shape with
boundsThe rectangular region to fill the shape in
pBlendOptional blend method

Definition at line 2613 of file IGraphics.cpp.

References PathClear(), PathEllipse(), and PathFill().

Referenced by ILEDControl::Draw(), TestMTControl::Draw(), and IVectorBase::DrawPressableEllipse().

◆ FillEllipse() [2/2]

void IGraphics::FillEllipse ( const IColor color,
float  x,
float  y,
float  r1,
float  r2,
float  angle = 0.0,
const IBlend pBlend = 0 
)
virtual

Fill an ellipse.

Parameters
colorThe color to draw the shape with
xThe X coordinate of the centre of the ellipse
yThe Y coordinate of the centre of the ellipse
r1The radius of the ellipse along the line found by rotating the x-axis by the angle
r2The radius of the ellipse along the line found by rotating the y-axis by the angle
angleThe angle rotates the radii r1 and r2 clockwise in degrees to adjust the orientation
pBlendOptional blend method

Definition at line 2620 of file IGraphics.cpp.

References PathClear(), PathEllipse(), and PathFill().

◆ FillRect()

void IGraphics::FillRect ( const IColor color,
const IRECT bounds,
const IBlend pBlend = 0 
)
virtual

◆ FillRoundRect() [1/2]

void IGraphics::FillRoundRect ( const IColor color,
const IRECT bounds,
float  cornerRadius = 5.f,
const IBlend pBlend = 0 
)
virtual

Fill a rounded rectangle with a color.

Parameters
colorThe color to fill the shape with
boundsThe rectangular region to fill the shape in
cornerRadiusThe corner radius in pixels
pBlendOptional blend method

Definition at line 2576 of file IGraphics.cpp.

References PathClear(), PathFill(), and PathRoundRect().

Referenced by IVKeyboardControl::Draw(), IWheelControl::Draw(), IVTabbedPagesControl::Draw(), TestLayerControl::Draw(), TestPolyControl::Draw(), IPopupMenuControl::DrawPanelBackground(), IVectorBase::DrawPressableRectangle(), and IPopupMenuControl::DrawTick().

◆ FillRoundRect() [2/2]

void IGraphics::FillRoundRect ( const IColor color,
const IRECT bounds,
float  cRTL,
float  cRTR,
float  cRBR,
float  cRBL,
const IBlend pBlend = 0 
)
virtual

Fill a rounded rectangle with a color.

Parameters
colorThe color to fill the shape with
boundsThe rectangular region to fill the shape in
cRTLThe top left corner radius in pixels
cRTRThe top right corner radius in pixels
cRBRThe bottom right corner radius in pixels
cRBLThe bottom left corner radius in pixels
pBlendOptional blend method

Definition at line 2583 of file IGraphics.cpp.

References PathClear(), PathFill(), and PathRoundRect().

◆ FillTriangle()

void IGraphics::FillTriangle ( const IColor color,
float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3,
const IBlend pBlend = 0 
)
virtual

Fill a triangle with a color.

Parameters
colorThe color to fill the shape with
x1The X coordinate of the first vertex
y1The Y coordinate of the first vertex
x2The X coordinate of the second vertex
y2The Y coordinate of the second vertex
x3The X coordinate of the third vertex
y3The Y coordinate of the third vertex
pBlendOptional blend method

Definition at line 2562 of file IGraphics.cpp.

References PathClear(), PathFill(), and PathTriangle().

Referenced by ICornerResizerControl::Draw(), IVNumberBoxControl::Draw(), TestArcControl::Draw(), TestDirBrowseControl::Draw(), ICaptionControl::Draw(), IGraphicsLiveEdit::Draw(), IPopupMenuControl::DrawCalloutArrow(), IPopupMenuControl::DrawDownArrow(), IVectorBase::DrawPressableTriangle(), IPopupMenuControl::DrawSubMenuArrow(), IPopupMenuControl::DrawSubMenuCalloutArrow(), and IPopupMenuControl::DrawUpArrow().

◆ FlippedBitmap()

virtual bool IGraphics::FlippedBitmap ( ) const
protectedpure virtual
Returns
bool true if the drawing backend flips images (e.g. OpenGL)

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by ApplyLayerDropShadow().

◆ ForAllControls()

template<typename T , typename... Args>
void IGraphics::ForAllControls ( method,
Args...  args 
)

For all controls, including the "special controls" call a method.

Parameters
methodThe method to call
argsThe method arguments

Definition at line 571 of file IGraphics.cpp.

References ForAllControlsFunc().

Referenced by OnGUIIdle(), OnMouseOut(), Resize(), SetAllControlsClean(), SetAllControlsDirty(), and SetScreenScale().

◆ ForAllControlsFunc()

void IGraphics::ForAllControlsFunc ( IControlFunction  func)

For all controls, including the "special controls" call a method.

Parameters
funcA std::function to perform on each control

Definition at line 540 of file IGraphics.cpp.

References ForStandardControlsFunc().

Referenced by ForAllControls(), and IsDirty().

◆ ForceEndUserEdit()

virtual void IGraphics::ForceEndUserEdit ( )
pure virtual

Call to force end text entry (will cancel any half input text.

Todo:
check)

◆ ForControlInGroup()

void IGraphics::ForControlInGroup ( const char *  group,
IControlFunction  func 
)

For all standard controls in the main control stack that are linked to a group, execute a function.

Parameters
groupCString specifying the group name
funcA std::function to perform on each control

Definition at line 519 of file IGraphics.cpp.

References GetControl(), IControl::GetGroup(), and NControls().

Referenced by IVGroupControl::SetBoundsBasedOnGroup().

◆ ForControlWithParam() [1/2]

void IGraphics::ForControlWithParam ( const std::initializer_list< int > &  params,
IControlFunction  func 
)

For all standard controls in the main control stack that are linked to one of several parameters, execute a function.

Parameters
paramsThe parameter indexes to match
funcA std::function to perform on each control

Definition at line 502 of file IGraphics.cpp.

References GetControl(), IControl::LinkedToParam(), and NControls().

◆ ForControlWithParam() [2/2]

void IGraphics::ForControlWithParam ( int  paramIdx,
IControlFunction  func 
)

For all standard controls in the main control stack that are linked to a specific parameter, execute a function.

Parameters
paramIdxThe parameter index to match
funcA std::function to perform on each control

Definition at line 488 of file IGraphics.cpp.

References GetControl(), IControl::LinkedToParam(), and NControls().

Referenced by ForMatchingControls().

◆ ForMatchingControls()

template<typename T , typename... Args>
void IGraphics::ForMatchingControls ( method,
int  paramIdx,
Args...  args 
)

For all standard controls in the main control stack that are linked to a specific parameter, call a method.

Parameters
methodThe method to call
paramIdxThe parameter index to match
argsThe method arguments

Definition at line 577 of file IGraphics.cpp.

References ForControlWithParam().

Referenced by DisableControl(), HideControl(), and SetPTParameterHighlight().

◆ ForStandardControlsFunc()

void IGraphics::ForStandardControlsFunc ( IControlFunction  func)

For all standard controls in the main control stack perform a function.

Parameters
funcA std::function to perform on each control

Definition at line 534 of file IGraphics.cpp.

References GetControl(), and NControls().

Referenced by AssignParamNameToolTips(), ForAllControlsFunc(), IGraphicsLiveEdit::OnMouseDrag(), and UpdatePeers().

◆ FPS()

int IGraphics::FPS ( ) const
inline

Gets the drawing frame rate.

Returns
A whole number representing the desired frame rate at which the graphics context is redrawn. NOTE: the actual frame rate might be different

Definition at line 1097 of file IGraphics.h.

◆ GetAppGroupID()

virtual const char * IGraphics::GetAppGroupID ( ) const
inlinevirtual

Get the app group ID on macOS and iOS, returns emtpy string on other OSs.

Definition at line 971 of file IGraphics.h.

◆ GetBackgroundControl()

IControl * IGraphics::GetBackgroundControl ( )
inline

Definition at line 1413 of file IGraphics.h.

◆ GetBackingPixelScale()

virtual float IGraphics::GetBackingPixelScale ( ) const
inlineprotectedvirtual
Returns
float
Todo:

Definition at line 1778 of file IGraphics.h.

References GetDrawScale(), and GetScreenScale().

Referenced by Draw(), GetPixelSnapped(), and StartLayer().

◆ GetBounds()

IRECT IGraphics::GetBounds ( ) const
inline

Returns an IRECT that represents the entire UI bounds This is useful for programatically arranging UI elements by slicing up the IRECT using the various IRECT methods.

Returns
An IRECT that corresponds to the entire UI area, with, L = 0, T = 0, R = Width() and B = Height()

Definition at line 1194 of file IGraphics.h.

References Height(), and Width().

Referenced by AttachCornerResizer(), AttachPanelBackground(), AttachSVGBackground(), IPopupMenuControl::CreatePopupMenu(), IGraphicsLiveEdit::Draw(), ICornerResizerControl::OnRescale(), IGraphicsLiveEdit::OnResize(), and ShowFPSDisplay().

◆ GetBubbleControl()

IBubbleControl * IGraphics::GetBubbleControl ( int  i = 0)
inline
Returns
Pointer to the special bubble control at index i, if one has been attached

Definition at line 1422 of file IGraphics.h.

◆ GetBundleID()

virtual const char * IGraphics::GetBundleID ( ) const
inlinevirtual

Get the bundle ID on macOS and iOS, returns emtpy string on other OSs.

Definition at line 968 of file IGraphics.h.

Referenced by LoadResource(), and SearchImageResource().

◆ GetControl()

IControl * IGraphics::GetControl ( int  idx)
inline

◆ GetControlIdx()

int IGraphics::GetControlIdx ( IControl pControl) const
inline

Get the index of a particular IControl in the control stack.

Parameters
pControlPointer to the control to get
Returns
integer index of the control in mControls array or -1 if not found

Definition at line 1359 of file IGraphics.h.

Referenced by GetIdxOfTaggedControl().

◆ GetControlInTextEntry()

IControl * IGraphics::GetControlInTextEntry ( )
inline
Returns
Ptr to the control that launched the text entry

Definition at line 1131 of file IGraphics.h.

Referenced by ITextControl::Draw(), ITextEntryControl::OnKeyDown(), and OnMouseDrag().

◆ GetControlTag()

int IGraphics::GetControlTag ( const IControl pControl) const
inline

Get the tag given to a control.

Parameters
pControlPointer to the control to get the tag for
Returns
The tag assigned to the control when it was attached, or kNoTag (-1)

Definition at line 1378 of file IGraphics.h.

Referenced by IControl::GetTag().

◆ GetControlWithParamIdx()

IControl * IGraphics::GetControlWithParamIdx ( int  paramIdx)

Get the first control with a parameter index that matches paramIdx.

Parameters
idxThe paramater index of the control to get
Returns
A pointer to the IControl object at idx or nullptr if not found

Definition at line 463 of file IGraphics.cpp.

References GetControl(), IControl::LinkedToParam(), and NControls().

◆ GetControlWithTag()

IControl * IGraphics::GetControlWithTag ( int  ctrlTag) const

Get the control with a particular tag.

Parameters
ctrlTagThe tag to look for
Returns
A pointer to the IControl object with the tag of nullptr if not found

Definition at line 448 of file IGraphics.cpp.

Referenced by GetIdxOfTaggedControl(), and RemoveControlWithTag().

◆ GetDelegate()

IGEditorDelegate * IGraphics::GetDelegate ( )
inline

◆ GetDrawContext()

virtual void * IGraphics::GetDrawContext ( )
pure virtual

Gets a void pointer to underlying drawing context, for the IGraphics backend See draw class implementation headers (e.g.

IGraphicsNanoVG.h) for what you can cast the void pointer to

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by IColorPickerControl::Draw(), ISkLottieControl::Draw(), ISkParagraphControl::Draw(), and TestDrawContextControl::Draw().

◆ GetDrawingAPIStr()

virtual const char * IGraphics::GetDrawingAPIStr ( )
pure virtual
Returns
A CString representing the Drawing API in use e.g. "NanoVG"

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by IFPSDisplayControl::Draw(), and GFXLabelControl::Draw().

◆ GetDrawScale()

float IGraphics::GetDrawScale ( ) const
inline

Gets the graphics context scaling factor.

Returns
The scaling applied to the graphics context

Definition at line 1101 of file IGraphics.h.

Referenced by CheckLayer(), GetBackingPixelScale(), IWebViewControl::OnAttached(), OnDragResize(), ICornerResizerControl::OnRescale(), PopupHostContextMenuForParam(), Resize(), ScaleBitmap(), and StartLayer().

◆ GetIdxOfTaggedControl()

int IGraphics::GetIdxOfTaggedControl ( int  ctrlTag) const
inline

Gets the index of a tagged control.

Parameters
ctrlTagThe tag to look for
Returns
int index or -1 if not found

Definition at line 1364 of file IGraphics.h.

References GetControlIdx(), and GetControlWithTag().

◆ GetLastClickedParamForPTAutomation()

int IGraphics::GetLastClickedParamForPTAutomation ( )

[AAX only]

Returns
An integer representing the last clicked parameter index (or -1 if none)

Definition at line 1389 of file IGraphics.cpp.

◆ GetLayerBitmapData()

virtual void IGraphics::GetLayerBitmapData ( const ILayerPtr layer,
RawBitmapData &  data 
)
pure virtual

Get the contents of a layer as Raw RGBA bitmap data NOTE: you should only call this within IControl::Draw()

Parameters
layerThe layer to get the data from
dataThe pixel data extracted from the layer

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by ApplyLayerDropShadow().

◆ GetMouseDownPoint()

void IGraphics::GetMouseDownPoint ( float &  x,
float &  y 
) const
inline

Get the x, y position of the last mouse down message.

Does not get cleared on mouse up etc.

Parameters
xWhere the X position will be stored
yWhere the Y position will be stored

Definition at line 1593 of file IGraphics.h.

Referenced by IGraphicsLiveEdit::OnMouseDrag(), IGraphicsLiveEdit::OnPopupMenuSelection(), and SplashClickActionFunc().

◆ GetMouseLocation()

virtual void IGraphics::GetMouseLocation ( float &  x,
float &  y 
) const
pure virtual

Get the x, y position of the mouse cursor.

Parameters
xWhere the X position will be stored
yWhere the Y position will be stored

Referenced by IGEditorDelegate::OnKeyDown(), and IGEditorDelegate::OnKeyUp().

◆ GetMouseOver()

int IGraphics::GetMouseOver ( ) const
inline
Returns
An integer representing the control index in IGraphics::mControls which the mouse is over, or -1 if it is not

Definition at line 1588 of file IGraphics.h.

◆ GetParamIdxForPTAutomation()

int IGraphics::GetParamIdxForPTAutomation ( float  x,
float  y 
)

[AAX only] This can be called by the ProTools API class (e.g.

IPlugAAX) in order to ascertain the parameter linked to the control under the mouse. The purpose is to facillitate ProTool's special contextual menus (for configuring parameter automation)

Parameters
xThe X coordinate to check
yThe Y coordinateto check
Returns
An integer representing the parameter index that was found (or -1 if not found)

Definition at line 1382 of file IGraphics.cpp.

References IControl::GetParamIdx().

◆ GetPixelSnapped()

IRECT IGraphics::GetPixelSnapped ( IRECT r) const
inline

Gets the nearest backing pixel aligned rect to the input IRECT.

Parameters
rThe IRECT to snap
Returns
The IRECT nearest to the input IRECT that is aligned exactly to backing pixels

Definition at line 1118 of file IGraphics.h.

References GetBackingPixelScale(), and IRECT::GetPixelSnapped().

◆ GetPlatformAPIStr()

virtual const char * IGraphics::GetPlatformAPIStr ( )
inlinevirtual
Returns
A CString representing the Platform API in use e.g. "macOS"

Definition at line 914 of file IGraphics.h.

◆ GetPlatformContext()

void * IGraphics::GetPlatformContext ( )
inline

Get the platform level draw context - an HDC or CGContextRef.

Returns
void pointer to an HDC or CGContext

Definition at line 935 of file IGraphics.h.

Referenced by IGraphicsSkia::EndFrame().

◆ GetPlatformWindowScale()

virtual float IGraphics::GetPlatformWindowScale ( ) const
inlinevirtual

Returns a scaling factor for resizing parent windows via the host/plugin API.

Returns
A scaling factor for resizing parent windows

Definition at line 1220 of file IGraphics.h.

Referenced by Resize(), and SetScreenScale().

◆ GetPoint()

virtual IColor IGraphics::GetPoint ( int  x,
int  y 
)
pure virtual

Get the color at an X, Y location in the graphics context.

Parameters
xThe X coordinate of the pixel
yThe Y coordinate of the pixel
Returns
An IColor specifiying the color of the pixel at x, y

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

◆ GetPopupMenuControl()

IPopupMenuControl * IGraphics::GetPopupMenuControl ( )
inline
Returns
Pointer to the special pop-up menu control, if one has been attached

Definition at line 1416 of file IGraphics.h.

◆ GetPromptMenu()

IPopupMenu & IGraphics::GetPromptMenu ( )
inline
Returns
Get a persistant IPopupMenu (remember to clear it before use)

Definition at line 1125 of file IGraphics.h.

◆ GetResizerMode()

EUIResizerMode IGraphics::GetResizerMode ( ) const
inline
Returns
An EUIResizerMode Representing whether the graphics context should scale or be resized, e.g. when dragging a corner resizer

Definition at line 1140 of file IGraphics.h.

◆ GetResizingInProcess()

bool IGraphics::GetResizingInProcess ( ) const
inline
Returns
true if resizing is in process

Definition at line 1143 of file IGraphics.h.

◆ GetRoundedScreenScale()

int IGraphics::GetRoundedScreenScale ( ) const
inline

Gets the screen/display scaling factor, rounded up.

Returns
The scale factor of the screen/display on which this graphics context is currently located

Definition at line 1109 of file IGraphics.h.

References GetScreenScale().

Referenced by GetScaledBitmap(), LoadBitmap(), IGraphicsNanoVG::LoadBitmap(), and ScaleBitmap().

◆ GetScaledBitmap()

IBitmap IGraphics::GetScaledBitmap ( IBitmap inBitmap)

Get a version of the input bitmap from the cache that corresponds to the current screen scale For example, when IControl::OnRescale() is called bitmap-based IControls can load in.

Parameters
inBitmapThe source bitmap to find a scaled version of
Returns
IBitmap The scaled bitmap

Definition at line 1520 of file IGraphics.cpp.

References IBitmap::GetFramesAreHorizontal(), IBitmap::GetResourceName(), GetRoundedScreenScale(), LoadBitmap(), and IBitmap::N().

Referenced by IBButtonControl::OnRescale(), IBSwitchControl::OnRescale(), IBKnobControl::OnRescale(), IBSliderControl::OnRescale(), IBTextControl::OnRescale(), IBMeterControl::OnRescale(), and IBitmapControl::OnRescale().

◆ GetScreenScale()

float IGraphics::GetScreenScale ( ) const
inline

Gets the screen/display scaling factor, e.g.

2 for a macOS retina screen, 1.5 on Windows when screen is scaled to 150%

Returns
The scale factor of the display on which this graphics context is currently located

Definition at line 1105 of file IGraphics.h.

Referenced by IGraphicsNanoVG::BeginFrame(), IGraphicsSkia::BeginFrame(), CheckLayer(), IGraphicsNanoVG::CreateAPIBitmap(), IGraphicsNanoVG::DrawResize(), IGraphicsSkia::DrawResize(), IGraphicsNanoVG::EndFrame(), IGraphicsSkia::EndFrame(), GetBackingPixelScale(), GetRoundedScreenScale(), and StartLayer().

◆ GetSharedResourcesSubPath()

const char * IGraphics::GetSharedResourcesSubPath ( ) const
inline

Gets the name of the shared resources subpath.

Definition at line 1636 of file IGraphics.h.

Referenced by LoadResource(), and SearchImageResource().

◆ GetTextEntryControl()

ITextEntryControl * IGraphics::GetTextEntryControl ( )
inline
Returns
Pointer to the special text entry control, if one has been attached

Definition at line 1419 of file IGraphics.h.

◆ GetTextFromClipboard()

virtual bool IGraphics::GetTextFromClipboard ( WDL_String &  str)
pure virtual

Get text from the clipboard.

Parameters
strA WDL_String that will be filled with the text that is currently on the clipboard
Returns
/c true on success

◆ GetTotalScale()

float IGraphics::GetTotalScale ( ) const
inline

Gets the combined draw and screen/display scaling factor.

Returns
The draw scale * screen scale

Definition at line 1113 of file IGraphics.h.

Referenced by PopupHostContextMenuForParam().

◆ GetTouches()

void IGraphics::GetTouches ( IControl pControl,
std::vector< ITouchID > &  touchesOnThisControl 
) const
inline

Populate a vector with the touchIDs active on pControl.

Definition at line 1405 of file IGraphics.h.

Referenced by TestMTControl::Draw().

◆ GetTransformMatrix()

IMatrix IGraphics::GetTransformMatrix ( ) const
inlineprotected

Definition at line 1780 of file IGraphics.h.

◆ GetUIAppearance()

virtual EUIAppearance IGraphics::GetUIAppearance ( ) const
inlinevirtual

Get the UI Appearance (Light/Dark mode)

Returns
Light/Dark mode

Definition at line 1576 of file IGraphics.h.

◆ GetWindow()

virtual void * IGraphics::GetWindow ( )
pure virtual

Get a pointer to the platform view e.g.

HWND or NSView for this graphics context return void pointer to platform window or view handle

Referenced by IGraphicsSkia::EndFrame(), IWebViewControl::OnAttached(), and WindowIsOpen().

◆ GetWinModuleHandle()

virtual void * IGraphics::GetWinModuleHandle ( )
inlinevirtual
Returns
a void pointer that can be cast back to HINSTANCE to get the module handle on windows, returns nullptr on other platforms

Definition at line 926 of file IGraphics.h.

Referenced by IGraphicsNanoVG::LoadAPIBitmap(), IGraphicsSkia::LoadAPIBitmap(), LoadResource(), and SearchImageResource().

◆ Height()

int IGraphics::Height ( ) const
inline

Gets the height of the graphics context.

Returns
A whole number representing the height of the graphics context in pixels on a 1:1 screen

Definition at line 1085 of file IGraphics.h.

Referenced by GetBounds(), OnDragResize(), and Resize().

◆ HideControl()

void IGraphics::HideControl ( int  paramIdx,
bool  hide 
)

Hide controls linked to a specific parameter.

Parameters
paramIdxThe parameter index
hide/c true to hide

Definition at line 478 of file IGraphics.cpp.

References ForMatchingControls(), and IControl::Hide().

◆ HideMouseCursor()

virtual void IGraphics::HideMouseCursor ( bool  hide = true,
bool  lock = true 
)
pure virtual

◆ HidePlatformView()

virtual void IGraphics::HidePlatformView ( void *  pView,
bool  hide 
)
inlinevirtual

Hide a previously attached platform view from the IGraphics view.

Parameters
pViewthe platform view to remove, which would be a HWND on Windows, NSView* on macOS or UIView* on iOS
hideshould it be hidden or not

Definition at line 808 of file IGraphics.h.

Referenced by IPlatformViewControl::Hide(), and IWebViewControl::Hide().

◆ InitiateExternalFileDragDrop()

virtual bool IGraphics::InitiateExternalFileDragDrop ( const char *  path,
const IRECT iconBounds 
)
inlinevirtual

Initiate an drag-n-drop operation of an existing file, to be dropped outside of the current window.

Parameters
pathA CString that contains a path to a file on disk
iconBoundsThe area where the icon should appear
Returns
/c true on success

Definition at line 872 of file IGraphics.h.

◆ IsDirty()

bool IGraphics::IsDirty ( IRECTList rects)

Called repeatedly at frame rate by the platform class to check what the graphics context says is dirty.

Parameters
rectsThe rectangular regions which will be added to to mark what is dirty in the context
Returns
/c true if a control is dirty

Definition at line 825 of file IGraphics.cpp.

References IRECTList::Add(), IRECT::Clank(), ForAllControlsFunc(), IRECT::GetPadded(), IControl::GetParent(), IControl::GetRECT(), IControl::IsDirty(), and OnGUIIdle().

◆ IsInPlatformTextEntry()

bool IGraphics::IsInPlatformTextEntry ( )
inline
Returns
True if a platform text entry in is progress

Definition at line 1128 of file IGraphics.h.

Referenced by OnMouseDrag().

◆ LiveEditEnabled()

bool IGraphics::LiveEditEnabled ( ) const
inline
Returns
true if live edit mode is enabled

Definition at line 1189 of file IGraphics.h.

◆ LoadAPIBitmap() [1/2]

virtual APIBitmap * IGraphics::LoadAPIBitmap ( const char *  fileNameOrResID,
int  scale,
EResourceLocation  location,
const char *  ext 
)
protectedpure virtual

Drawing API method to load a bitmap, called internally.

Parameters
fileNameOrResIDA CString absolute path or resource ID
scaleInteger to identify the scale of the resource, for multi-scale bitmaps
locationIdentifies the kind of resource location
extCString for the file extension
Returns
APIBitmap* Drawing API bitmap abstraction

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by LoadBitmap().

◆ LoadAPIBitmap() [2/2]

virtual APIBitmap * IGraphics::LoadAPIBitmap ( const char *  name,
const void *  pData,
int  dataSize,
int  scale 
)
protectedpure virtual

Drawing API method to load a bitmap from binary data, called internally.

Parameters
nameCString for the name of the resource
pDataRaw pointer to the binary data
dataSizeSize of the data in bytes
scaleInteger to identify the scale of the resource, for multi-scale bitmaps
Returns
APIBitmap* Drawing API bitmap abstraction

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

◆ LoadAPIFont()

virtual bool IGraphics::LoadAPIFont ( const char *  fontID,
const PlatformFontPtr &  font 
)
protectedpure virtual

Drawing API method to load a font from a PlatformFontPtr, called internally.

Parameters
fontIDA CString that will be used to reference the font
fontValid PlatformFontPtr, loaded via LoadPlatformFont
Returns
bool true if the font was loaded successfully

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by LoadFont().

◆ LoadBitmap() [1/2]

IBitmap IGraphics::LoadBitmap ( const char *  fileNameOrResID,
int  nStates = 1,
bool  framesAreHorizontal = false,
int  targetScale = 0 
)
virtual

Load a bitmap image from disk or from windows resource.

Parameters
fileNameOrResIDCString file name or resource ID
nStatesThe number of states/frames in a multi-frame stacked bitmap
framesAreHorizontalSet true if the frames in a bitmap are stacked horizontally
targetScaleSet to a number > 0 to explicity load e.g. an @2x.png
Returns
An IBitmap representing the image

Reimplemented in IGraphicsNanoVG.

Definition at line 1721 of file IGraphics.cpp.

References BitmapExtSupported(), GetRoundedScreenScale(), APIBitmap::GetScale(), LoadAPIBitmap(), RetainBitmap(), ScaleBitmap(), SearchBitmapInCache(), and SearchImageResource().

Referenced by AttachBackground(), and GetScaledBitmap().

◆ LoadBitmap() [2/2]

IBitmap IGraphics::LoadBitmap ( const char *  name,
const void *  pData,
int  dataSize,
int  nStates = 1,
bool  framesAreHorizontal = false,
int  targetScale = 0 
)
virtual

Load a bitmap image from memory.

Parameters
nameCString name to associate with the bitmap, must include a file extension
pDatapointer to the bitmap file data
dataSizesize of the data at pData
nStatesThe number of states/frames in a multi-frame stacked bitmap
framesAreHorizontalSet true if the frames in a bitmap are stacked horizontally
targetScaleSet to a number > 0 to explicity load e.g. an @2x.png
Returns
An IBitmap representing the image

Definition at line 1783 of file IGraphics.cpp.

References BitmapExtSupported(), GetRoundedScreenScale(), APIBitmap::GetScale(), LoadAPIBitmap(), RetainBitmap(), ScaleBitmap(), and SearchBitmapInCache().

◆ LoadFont() [1/3]

bool IGraphics::LoadFont ( const char *  fontID,
const char *  fileNameOrResID 
)
virtual

Load a font to be used by the graphics context.

Parameters
fontIDA CString that will be used to reference the font
fileNameOrResIDA CString absolute path or resource ID
Returns
true on success

Definition at line 2176 of file IGraphics.cpp.

References CachePlatformFont(), LoadAPIFont(), and LoadPlatformFont().

◆ LoadFont() [2/3]

bool IGraphics::LoadFont ( const char *  fontID,
const char *  fontName,
ETextStyle  style 
)

Load a font with a particular style (bold, italic) from a font file.

Parameters
fontIDA CString that will be used to reference the font
fontNameA CString font name
styleA font style
Returns
true on success

Definition at line 2210 of file IGraphics.cpp.

References CachePlatformFont(), LoadAPIFont(), and LoadPlatformFont().

◆ LoadFont() [3/3]

bool IGraphics::LoadFont ( const char *  fontID,
void *  pData,
int  dataSize 
)
virtual

Load a font from in-memory data to be used by the graphics context.

Parameters
fontIDA CString that will be used to reference the font
pDataPointer to the font data in memory
dataSizeSize (in bytes) of data at pData
Returns
true on success

Definition at line 2193 of file IGraphics.cpp.

References CachePlatformFont(), LoadAPIFont(), and LoadPlatformFont().

◆ LoadPlatformFont() [1/3]

virtual PlatformFontPtr IGraphics::LoadPlatformFont ( const char *  fontID,
const char *  fileNameOrResID 
)
pure virtual

Load a font from disk or resource in a platform format.

Parameters
fontIDA string that is used to reference the font
fileNameOrResIDA resource or file name/path
Returns
PlatformFontPtr from which the platform font can be retrieved

Referenced by LoadFont().

◆ LoadPlatformFont() [2/3]

virtual PlatformFontPtr IGraphics::LoadPlatformFont ( const char *  fontID,
const char *  fontName,
ETextStyle  style 
)
pure virtual

Load a system font in a platform format.

Parameters
fontIDA string that is used to reference the font
fontNameA string defining the font name
styleAn ETextStyle defining the font style
Returns
PlatformFontPtr from which the platform font can be retrieved

◆ LoadPlatformFont() [3/3]

virtual PlatformFontPtr IGraphics::LoadPlatformFont ( const char *  fontID,
void *  pData,
int  dataSize 
)
pure virtual

Load a font from data in memory.

Parameters
fontIDA CString that is used to reference the font
pDataPointer to font data in memory
dataSizeSize (in bytes) of data at pData
Returns
PlatformFontPtr from which the platform font may be retrieved

◆ LoadResource()

WDL_TypedBuf< uint8_t > IGraphics::LoadResource ( const char *  fileNameOrResID,
const char *  fileType 
)
virtual

Load a resource from the file system, the bundle, or a Windows resource, and returns its data.

Parameters
fileNameOrResIDCString file name or resource ID
fileTypeType of the file (e.g "png", "svg", "ttf")
Returns
A WDL_TypedBuf containing the data, or with a length of 0 if the resource was not found

Definition at line 1666 of file IGraphics.cpp.

References GetBundleID(), GetSharedResourcesSubPath(), GetWinModuleHandle(), LoadWinResource(), and LocateResource().

Referenced by LoadSVG().

◆ LoadSVG() [1/2]

ISVG IGraphics::LoadSVG ( const char *  fileNameOrResID,
const char *  units = "px",
float  dpi = 72.f 
)
virtual

Load an SVG from disk or from windows resource.

Parameters
fileNameOrResIDA CString absolute path or resource ID
Returns
An ISVG representing the image

Definition at line 1620 of file IGraphics.cpp.

References LoadResource(), and LoadSVG().

Referenced by AttachSVGBackground(), and LoadSVG().

◆ LoadSVG() [2/2]

ISVG IGraphics::LoadSVG ( const char *  name,
const void *  pData,
int  dataSize,
const char *  units = "px",
float  dpi = 72.f 
)
virtual

Load an SVG image from memory.

Parameters
nameCString name to associate with the SVG
pDataPointer to the SVG file data
dataSizeSize (in bytes) of the data at pData
units
Todo:
Parameters
dpiThe dots per inch of the SVG file
Returns
An ISVG representing the image

Definition at line 1641 of file IGraphics.cpp.

◆ MeasureText()

float IGraphics::MeasureText ( const IText text,
const char *  str,
IRECT bounds 
) const
virtual

Measure the rectangular region that some text will occupy.

Parameters
textAn IText struct containing font and text properties and layout info
strThe text string to draw
boundsafter calling the method this IRECT will be updated with the rectangular region the text will occupy

Definition at line 678 of file IGraphics.cpp.

References DoMeasureText().

Referenced by TestFlexBoxControl::Draw(), GFXLabelControl::Draw(), TestTextOrientationControl::Draw(), IURLControl::Draw(), PlaceHolder::Draw(), IVectorBase::MakeRects(), and ITextControl::SetBoundsBasedOnStr().

◆ MoveMouseCursor()

virtual void IGraphics::MoveMouseCursor ( float  x,
float  y 
)
pure virtual

Force move the mouse cursor to a specific position.

Parameters
xNew X position in pixels
yNew Y position in pixels

◆ MultiTouchEnabled()

bool IGraphics::MultiTouchEnabled ( ) const
inline
Returns
/c true if multi touch is enabled

Definition at line 1161 of file IGraphics.h.

◆ NBubbleControls()

int IGraphics::NBubbleControls ( ) const
inline
Returns
Number of attached bubble controls

Definition at line 1425 of file IGraphics.h.

◆ NControls()

int IGraphics::NControls ( ) const
inline
Returns
The number of controls that have been added to this graphics context

Definition at line 1437 of file IGraphics.h.

Referenced by IGraphicsLiveEdit::Draw(), ForControlInGroup(), ForControlWithParam(), ForStandardControlsFunc(), GetControlWithParamIdx(), IGraphicsLiveEdit::OnMouseDown(), RemoveControls(), and StyleAllVectorControls().

◆ OnAppearanceChanged()

void IGraphics::OnAppearanceChanged ( EUIAppearance  appearance)

Called by the platform class if the view changes to dark/light mode.

Parameters
appearanceLight/Dark mode

Definition at line 1514 of file IGraphics.cpp.

◆ OnDragResize()

void IGraphics::OnDragResize ( float  x,
float  y 
)

Called by ICornerResizerControl as the corner is dragged to resize.

Definition at line 1499 of file IGraphics.cpp.

References GetDrawScale(), Height(), Resize(), and Width().

Referenced by OnMouseDrag().

◆ OnDrop()

void IGraphics::OnDrop ( const char *  str,
float  x,
float  y 
)
Parameters
strA CString with the absolute path of the dropped item
xThe X coordinate where the drag and drop occurred
yThe Y coordinate where the drag and drop occurred

Definition at line 1266 of file IGraphics.cpp.

References IControl::OnDrop().

◆ OnDropMultiple()

void IGraphics::OnDropMultiple ( const std::vector< const char * > &  paths,
float  x,
float  y 
)
Parameters
pathsA vector with the absolute paths of the dropped items
xThe X coordinate where the drag and drop occurred
yThe Y coordinate where the drag and drop occurred

Definition at line 1272 of file IGraphics.cpp.

References IControl::OnDropMultiple().

◆ OnGestureRecognized()

void IGraphics::OnGestureRecognized ( const IGestureInfo info)

Called by platform class when a gesture is recognized.

Definition at line 2363 of file IGraphics.cpp.

References IRECTList::Find(), IControl::GetWantsGestures(), and IControl::OnGesture().

◆ OnGUIIdle()

void IGraphics::OnGUIIdle ( )

This is an idle timer tick call on the GUI thread, only active if USE_IDLE_CALLS is defined.

Definition at line 1493 of file IGraphics.cpp.

References ForAllControls(), and IControl::OnGUIIdle().

Referenced by IsDirty().

◆ OnKeyDown()

bool IGraphics::OnKeyDown ( float  x,
float  y,
const IKeyPress key 
)
Parameters
xThe X coordinate of the mouse cursor at the time of the key press
yThe Y coordinate of the mouse cursor at the time of the key press
keyInfo about the keypress
Returns
true if handled

Definition at line 1230 of file IGraphics.cpp.

References GetControl(), and IControl::OnKeyDown().

Referenced by IGEditorDelegate::OnKeyDown().

◆ OnKeyUp()

bool IGraphics::OnKeyUp ( float  x,
float  y,
const IKeyPress key 
)
Parameters
xThe X coordinate of the mouse cursor at the time of the key press
yThe Y coordinate of the mouse cursor at the time of the key press
keyInfo about the keypress
Returns
true if handled

Definition at line 1248 of file IGraphics.cpp.

References GetControl(), and IControl::OnKeyUp().

Referenced by IGEditorDelegate::OnKeyUp().

◆ OnMouseDblClick()

bool IGraphics::OnMouseDblClick ( float  x,
float  y,
const IMouseMod mod 
)
Parameters
xThe X coordinate at which the mouse event occurred
yThe Y coordinate at which the mouse event occurred
modIMouseMod struct contain information about the modifiers held
Returns
/c true on handled

Definition at line 1195 of file IGraphics.cpp.

References IControl::GetMouseDblAsSingleClick(), IControl::OnMouseDblClick(), OnMouseDown(), and ReleaseMouseCapture().

◆ OnMouseDown()

void IGraphics::OnMouseDown ( const std::vector< IMouseInfo > &  points)

◆ OnMouseDrag()

void IGraphics::OnMouseDrag ( const std::vector< IMouseInfo > &  points)

Called when the platform class sends drag events.

Definition at line 1155 of file IGraphics.cpp.

References ControlIsCaptured(), GetControlInTextEntry(), IsInPlatformTextEntry(), OnDragResize(), and IControl::OnMouseDrag().

◆ OnMouseOut()

void IGraphics::OnMouseOut ( )

Called when the mouse leaves the graphics context.

Definition at line 1145 of file IGraphics.cpp.

References ForAllControls(), IControl::OnMouseOut(), and SetMouseCursor().

◆ OnMouseOver()

bool IGraphics::OnMouseOver ( float  x,
float  y,
const IMouseMod mod 
)
Parameters
xThe X coordinate at which to draw
yThe Y coordinate at which to draw
modIMouseMod struct contain information about the modifiers held
Returns
true if handled

Definition at line 1123 of file IGraphics.cpp.

References IControl::OnMouseOut(), and IControl::OnMouseOver().

Referenced by OnMouseUp().

◆ OnMouseUp()

void IGraphics::OnMouseUp ( const std::vector< IMouseInfo > &  points)

◆ OnMouseWheel()

void IGraphics::OnMouseWheel ( float  x,
float  y,
const IMouseMod mod,
float  delta 
)
Parameters
xThe X coordinate at which the mouse event occurred
yThe Y coordinate at which the mouse event occurred
modIMouseMod struct contain information about the modifiers held
deltaDelta value
Todo:
explain

Definition at line 1223 of file IGraphics.cpp.

References IControl::OnMouseWheel().

◆ OnSetCursor()

void IGraphics::OnSetCursor ( )
inline

Called when the mouse enters the graphics context, to update the cursor to mCursorType.

Definition at line 1552 of file IGraphics.h.

References SetMouseCursor().

◆ OnTouchCancelled()

void IGraphics::OnTouchCancelled ( const std::vector< IMouseInfo > &  points)

Called when the platform class sends touch cancel events.

Definition at line 1098 of file IGraphics.cpp.

References ControlIsCaptured(), and IControl::OnTouchCancelled().

◆ OnViewDestroyed()

virtual void IGraphics::OnViewDestroyed ( )
inlinevirtual

Called after a platform view is destroyed, so that drawing classes can e.g.

free any resources

Reimplemented in IGraphicsNanoVG, and IGraphicsSkia.

Definition at line 97 of file IGraphics.h.

◆ OnViewInitialized()

virtual void IGraphics::OnViewInitialized ( void *  pContext)
inlinevirtual

Called after platform view initialization, so that drawing classes can e.g.

create an OpenGL context.

Reimplemented in IGraphicsNanoVG, and IGraphicsSkia.

Definition at line 94 of file IGraphics.h.

◆ OpenURL()

virtual bool IGraphics::OpenURL ( const char *  url,
const char *  msgWindowTitle = 0,
const char *  confirmMsg = 0,
const char *  errMsgOnFailure = 0 
)
pure virtual

Open a URL in the platform’s default browser.

Parameters
urlCString specifying the URL to open
msgWindowTitle
Todo:
?
Parameters
confirmMsg
Todo:
?
Parameters
errMsgOnFailure
Todo:
?
Returns
/c true on success

Referenced by IURLControl::OnMouseDown().

◆ OpenWindow()

virtual void * IGraphics::OpenWindow ( void *  pParentWnd)
pure virtual

Open a new platform view for this graphics context.

Parameters
pParentWndvoid pointer to parent platform window or view handle (if applicable)
Todo:
check
Returns
void pointer to newly created IGraphics platform view

◆ PathArc()

virtual void IGraphics::PathArc ( float  cx,
float  cy,
float  r,
float  a1,
float  a2,
EWinding  winding = EWinding::CW 
)
pure virtual

Add an arc to the current path.

Parameters
cxThe X coordinate of the centre of the circle on which the arc lies
cyThe Y coordinate of the centre of the circle on which the arc lies
rThe radius of the circle on which the arc lies
a1the start angle of the arc at in degrees clockwise where 0 is up
a2the end angle of the arc at in degrees clockwise where 0 is up

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by TestMultiPathControl::Draw(), DrawArc(), IVGroupControl::DrawWidget(), FillArc(), PathCircle(), and PathRoundRect().

◆ PathCircle()

void IGraphics::PathCircle ( float  cx,
float  cy,
float  r 
)

Add a circle to the current path.

Parameters
cxThe X coordinate of the centre of the circle
cyThe Y coordinate of the centre of the circle
rThe radius of the circle

Definition at line 2688 of file IGraphics.cpp.

References PathArc(), PathClose(), and PathMoveTo().

Referenced by TestMultiPathControl::Draw(), DrawCircle(), FillCircle(), and PathEllipse().

◆ PathClear()

virtual void IGraphics::PathClear ( )
pure virtual

◆ PathClipRegion()

void IGraphics::PathClipRegion ( const IRECT  r = IRECT())

Clip the current path to a particular region.

Parameters
rThe rectangular region to clip

Definition at line 2765 of file IGraphics.cpp.

References IRECT::Empty(), and IRECT::Intersect().

Referenced by IVectorBase::DrawSplash(), PopLayer(), and PushLayer().

◆ PathClose()

virtual void IGraphics::PathClose ( )
pure virtual

◆ PathConvexPolygon()

void IGraphics::PathConvexPolygon ( float *  x,
float *  y,
int  nPoints 
)

Add a convex polygon to the current path.

Parameters
xPointer to the first element in an array of X coordinates for the vertices of the polygon
yPointer to the first element in an array of Y coordinates for the vertices of the polygon
nPointsThe number of points in the coordinate arrays

Definition at line 2695 of file IGraphics.cpp.

References PathClose(), PathLineTo(), and PathMoveTo().

Referenced by DrawConvexPolygon(), and FillConvexPolygon().

◆ PathCubicBezierTo()

virtual void IGraphics::PathCubicBezierTo ( float  c1x,
float  c1y,
float  c2x,
float  c2y,
float  x2,
float  y2 
)
pure virtual

Add a cubic bezier to the current path from the current point to the specified location.

Parameters
c1xControl point 1 X coordinate
c1yControl point 1 Y coordinate
c2xControl point 2 X coordinate
c2yControl point 2 Y coordinate
x2The X coordinate of the end of the line
y2The Y coordinate of the end of the line

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by TestBezierControl::Draw(), and TestMultiPathControl::Draw().

◆ PathEllipse() [1/2]

void IGraphics::PathEllipse ( const IRECT bounds)

Add an ellipse to the current path, specifying the rectangular region.

Parameters
boundsThe rectangular region to draw the shape in

Definition at line 2683 of file IGraphics.cpp.

References IRECT::H(), IRECT::MH(), IRECT::MW(), PathEllipse(), and IRECT::W().

Referenced by ILEDControl::Draw(), DrawEllipse(), FillEllipse(), and PathEllipse().

◆ PathEllipse() [2/2]

void IGraphics::PathEllipse ( float  x,
float  y,
float  r1,
float  r2,
float  angle = 0.0 
)

Add an ellipse to the current path.

Parameters
xThe X coordinate of the centre of the ellipse
yThe Y coordinate of the centre of the ellipse
r1The radius of the ellipse along the line found by rotating the x-axis by the angle
r2The radius of the ellipse along the line found by rotating the y-axis by the angle
angleThe angle rotates the radii r1 and r2 clockwise in degrees to adjust the orientation

Definition at line 2667 of file IGraphics.cpp.

References PathCircle(), PathTransformRestore(), PathTransformRotate(), PathTransformSave(), PathTransformScale(), and PathTransformTranslate().

◆ PathFill()

virtual void IGraphics::PathFill ( const IPattern pattern,
const IFillOptions options = IFillOptions(),
const IBlend pBlend = 0 
)
pure virtual

Fill the current current path.

Parameters
patternThe IPattern to use, for e.g. color or gradient
optionsOptional IFillOptions to specify fill rule and preserve options
pBlendOptional blend method

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by IFPSDisplayControl::Draw(), ILEDControl::Draw(), IWheelControl::Draw(), TestColorControl::Draw(), TestGesturesControl::Draw(), TestGradientControl::Draw(), TestMultiPathControl::Draw(), IPanelControl::Draw(), DrawData(), FillArc(), FillCircle(), FillConvexPolygon(), FillEllipse(), FillRect(), FillRoundRect(), and FillTriangle().

◆ PathLine()

void IGraphics::PathLine ( float  x1,
float  y1,
float  x2,
float  y2 
)
inline

Add a line to the current path.

Parameters
x1The X coordinate of the start of the line
y1The Y coordinate of the start of the line
x2The X coordinate of the end of the line
y2The Y coordinate of the end of the line

Definition at line 601 of file IGraphics.h.

References PathLineTo(), and PathMoveTo().

Referenced by PathRadialLine().

◆ PathLineTo()

virtual void IGraphics::PathLineTo ( float  x,
float  y 
)
pure virtual

Add a line to the current path from the current point to the specified location.

Parameters
xThe X coordinate of the end of the line
yThe Y coordinate of the end of the line

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by IFPSDisplayControl::Draw(), TestMultiPathControl::Draw(), DrawData(), DrawDottedLine(), DrawGrid(), DrawLine(), IVGroupControl::DrawWidget(), IVDisplayControl::DrawWidget(), PathConvexPolygon(), PathLine(), PathRect(), and PathTriangle().

◆ PathMoveTo()

virtual void IGraphics::PathMoveTo ( float  x,
float  y 
)
pure virtual

◆ PathQuadraticBezierTo()

virtual void IGraphics::PathQuadraticBezierTo ( float  cx,
float  cy,
float  x2,
float  y2 
)
pure virtual

Add a quadratic bezier to the current path from the current point to the specified location.

Parameters
cxControl point X coordinate
cyControl point Y coordinate
x2The X coordinate of the end of the line
y2The Y coordinate of the end of the line

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by TestBezierControl::Draw().

◆ PathRadialLine()

void IGraphics::PathRadialLine ( float  cx,
float  cy,
float  angle,
float  rMin,
float  rMax 
)

Add a radial line to the current path.

Parameters
cxcentre point x coordinate
cycentre point y coordinate
angleThe angle to draw at in degrees clockwise where 0 is up
rMinminima of the radial line (distance from cx,cy)
rMaxmaxima of the radial line (distance from cx,cy)

Definition at line 818 of file IGraphics.cpp.

References PathLine().

◆ PathRect()

void IGraphics::PathRect ( const IRECT bounds)

◆ PathRoundRect() [1/2]

void IGraphics::PathRoundRect ( const IRECT bounds,
float  cornerRadius = 5.f 
)

Add a rounded rectangle to the current path.

Parameters
boundsThe rectangular region to draw the shape in
cornerRadiusThe corner radius in pixels

Definition at line 2662 of file IGraphics.cpp.

References PathRoundRect().

◆ PathRoundRect() [2/2]

void IGraphics::PathRoundRect ( const IRECT bounds,
float  ctl,
float  ctr,
float  cbl,
float  cbr 
)

Add a rounded rectangle to the current path, with independent corner roundness.

Parameters
boundsThe rectangular region to draw the shape in
cRTLThe top left corner radius in pixels
cRTRThe top right corner radius in pixels
cRBRThe bottom right corner radius in pixels
cRBLThe bottom left corner radius in pixels

Definition at line 2644 of file IGraphics.cpp.

References IRECT::H(), PathArc(), PathClose(), PathMoveTo(), PathRect(), and IRECT::W().

Referenced by TestGradientControl::Draw(), TestMultiPathControl::Draw(), DrawRoundRect(), FillRoundRect(), and PathRoundRect().

◆ PathSetWinding()

virtual void IGraphics::PathSetWinding ( bool  clockwise)
inlinevirtual

NanoVG only.

https://github.com/memononen/nanovg/blob/master/src/nanovg.h#L454

Parameters
clockwiseShould the path be wound clockwise

Reimplemented in IGraphicsNanoVG.

Definition at line 685 of file IGraphics.h.

◆ PathStroke()

virtual void IGraphics::PathStroke ( const IPattern pattern,
float  thickness,
const IStrokeOptions options = IStrokeOptions(),
const IBlend pBlend = 0 
)
pure virtual

Stroke the current current path.

Parameters
patternThe IPattern to use, for e.g. color or gradient
thicknessThe line thickness
optionsOptional IStrokeOptions to specify dash, join and path preserve options
pBlendOptional blend method

Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.

Referenced by TestBezierControl::Draw(), TestGradientControl::Draw(), TestMultiPathControl::Draw(), DrawArc(), DrawCircle(), DrawConvexPolygon(), DrawData(), DrawDottedLine(), DrawDottedRect(), DrawEllipse(), DrawGrid(), DrawLine(), DrawRect(), DrawRoundRect(), DrawTriangle(), IVGroupControl::DrawWidget(), and IVDisplayControl::DrawWidget().

◆ PathTransformMatrix()

void IGraphics::PathTransformMatrix ( const IMatrix matrix)

Apply an arbitary affine transform matrix to the current path.

Parameters
matrixThe transfomation matrix

Definition at line 2759 of file IGraphics.cpp.

References IMatrix::Transform().

◆ PathTransformReset()

void IGraphics::PathTransformReset ( bool  clearStates = false)

Reset the affine transform of the current path, to the default state.

Parameters
clearStatesSelects whether the call also empties the transform stack

Definition at line 2718 of file IGraphics.cpp.

Referenced by DrawLayer(), DrawRotatedLayer(), PopLayer(), and PushLayer().

◆ PathTransformRestore()

void IGraphics::PathTransformRestore ( )

◆ PathTransformRotate()

void IGraphics::PathTransformRotate ( float  angle)

Apply a rotation transform to the current path.

Parameters
angleAngle to rotate in degrees clockwise

Definition at line 2747 of file IGraphics.cpp.

References IMatrix::Rotate().

Referenced by TestGesturesControl::Draw(), DrawRotatedBitmap(), DrawRotatedSVG(), and PathEllipse().

◆ PathTransformSave()

void IGraphics::PathTransformSave ( )

◆ PathTransformScale() [1/2]

void IGraphics::PathTransformScale ( float  scale)

Apply a scale transform to the current path, with independant x, y scales.

Parameters
scaleScale amount

Definition at line 2742 of file IGraphics.cpp.

References PathTransformScale().

◆ PathTransformScale() [2/2]

void IGraphics::PathTransformScale ( float  x,
float  y 
)

Apply a scale transform to the current path, with independant x, y scales.

Parameters
xHorizontal scale amount
yHorizontal scale amount

Definition at line 2736 of file IGraphics.cpp.

References IMatrix::Scale().

Referenced by TestGesturesControl::Draw(), DrawFittedBitmap(), DrawFittedLayer(), DrawSVG(), PathEllipse(), and PathTransformScale().

◆ PathTransformSkew()

void IGraphics::PathTransformSkew ( float  xAngle,
float  yAngle 
)

Apply a skew transform to the current path.

Parameters
xAngleAngle to skew horizontal in degrees clockwise
yAngleAngle to skew vertical in degrees clockwise

Definition at line 2753 of file IGraphics.cpp.

References IMatrix::Skew().

◆ PathTransformTranslate()

void IGraphics::PathTransformTranslate ( float  x,
float  y 
)

Apply a translation transform to the current path.

Parameters
xHorizontal translation amount
yVertical translation amount

Definition at line 2730 of file IGraphics.cpp.

References IMatrix::Translate().

Referenced by IGraphicsNanoVG::ApplyShadowMask(), TestGesturesControl::Draw(), DrawFittedBitmap(), DrawFittedLayer(), DrawRotatedBitmap(), DrawRotatedSVG(), DrawSVG(), and PathEllipse().

◆ PathTriangle()

void IGraphics::PathTriangle ( float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3 
)

Add a triangle to the current path.

Parameters
x1The X coordinate of the first vertex
y1The Y coordinate of the first vertex
x2The X coordinate of the second vertex
y2The Y coordinate of the second vertex
x3The X coordinate of the third vertex
y3The Y coordinate of the third vertex

Definition at line 2627 of file IGraphics.cpp.

References PathClose(), PathLineTo(), and PathMoveTo().

Referenced by DrawTriangle(), and FillTriangle().

◆ PlatformSupportsMultiTouch()

virtual bool IGraphics::PlatformSupportsMultiTouch ( ) const
inlinevirtual
Returns
/c true if the platform supports multi touch

Definition at line 1164 of file IGraphics.h.

Referenced by EnableMultiTouch().

◆ PopLayer()

ILayer * IGraphics::PopLayer ( )
protected

Pop a layer off the stack.

Returns
ILayer* The layer that came off the stack

Definition at line 2014 of file IGraphics.cpp.

References PathClear(), PathClipRegion(), PathTransformReset(), and UpdateLayer().

Referenced by IGraphicsNanoVG::ApplyShadowMask(), EndLayer(), and IGraphicsNanoVG::GetLayerBitmapData().

◆ PopupHostContextMenuForParam() [1/2]

void IGraphics::PopupHostContextMenuForParam ( IControl pControl,
int  paramIdx,
float  x,
float  y 
)

[VST3 primarily] In VST3 plug-ins this enable support for the IContextMenu interface, which allows the host to add contextual options to e.g.

automate a parameter associated with a control

Parameters
pControlPtr to the control in the control stack
paramIdxThe parameter index associated with the control
xThe X coordinate at which to popup the context menu
yThe Y coordinate at which to popup the context menu

Definition at line 1401 of file IGraphics.cpp.

References IControl::CreateContextMenu(), GetDelegate(), GetDrawScale(), and GetTotalScale().

◆ PopupHostContextMenuForParam() [2/2]

void IGraphics::PopupHostContextMenuForParam ( int  controlIdx,
int  paramIdx,
float  x,
float  y 
)

[VST3 primarily] In VST3 plug-ins this enable support for the IContextMenu interface, which allows the host to add contextual options to e.g.

automate a parameter associated with a control

Parameters
controlIdxThe index of the control in the control stack
paramIdxThe parameter index associated with the control
xThe X coordinate at which to popup the context menu
yThe Y coordinate at which to popup the context menu

Definition at line 1488 of file IGraphics.cpp.

References GetControl(), and PopupHostContextMenuForParam().

Referenced by OnMouseDown(), and PopupHostContextMenuForParam().

◆ PromptForColor()

virtual bool IGraphics::PromptForColor ( IColor color,
const char *  str = "",
IColorPickerHandlerFunc  func = nullptr 
)
pure virtual

Create a platform color chooser dialog.

NOTE: this method will block the main thread

Parameters
colorWhen a color is chosen the IColor referenced will be updated with the new color
strThe text to display in the dialog box e.g. "Please choose a color... (Windows only)"
IColorPickerHandlerFuncfunc callback for asynchronous color pickers
Returns
/c true if prompt completed successfully

Referenced by IVColorSwatchControl::OnMouseDown().

◆ PromptForDirectory()

virtual void IGraphics::PromptForDirectory ( WDL_String &  dir,
IFileDialogCompletionHandlerFunc  completionHandler = nullptr 
)
pure virtual

Create a platform file prompt dialog to choose a directory path for opening/saving a directory.

NOTE: this method will block the main thread

Parameters
dirNon const WDL_String reference specifying the directory path. Set this prior to calling the method for save dialogs, to provide a default path. For load dialogs, on successful selection of a directory this will get set to the full path.
completionHandleran IFileDialogCompletionHandlerFunc that will be called when a file is selected or the dialog is cancelled. Only the path argument will be populated.

◆ PromptForFile()

virtual void IGraphics::PromptForFile ( WDL_String &  fileName,
WDL_String &  path,
EFileAction  action = EFileAction::Open,
const char *  ext = "",
IFileDialogCompletionHandlerFunc  completionHandler = nullptr 
)
pure virtual

Create a platform file prompt dialog to choose a path for opening/saving a single file.

NOTE: this method will block the main thread on macOS, unless you speficy the completionHander, which will be called asynchronously when the dialog button is pressed. On iOS, you must supply a completionHander.

Parameters
fileNameNon const WDL_String reference specifying the file name. Set this prior to calling the method for save dialogs, to provide a default file name. For file-open dialogs, on successful selection of a file this will get set to the file’s name.
pathWDL_String reference where the path will be put on success or empty string on failure/user cancelled
actionDetermines whether this is an file-open dialog or a file-save dialog
extA space separated CString list of file extensions to filter in the dialog (e.g. “.wav .aif”
completionHandleran IFileDialogCompletionHandlerFunc that will be called when a file is selected or the dialog is cancelled

Referenced by ISkLottieControl::OnMouseDown(), TestImageControl::OnMouseDown(), and TestSVGControl::OnMouseDown().

◆ PromptUserInput()

void IGraphics::PromptUserInput ( IControl control,
const IRECT bounds,
int  valIdx = 0 
)

Prompt for user input either using a text entry or pop up menu.

Parameters
controlReference to the control which the prompt relates to
boundsRectangular region of the graphics context that the prompt (e.g. text entry box) should occupy
valIdxThe value index for the control value that the prompt relates to

Definition at line 622 of file IGraphics.cpp.

References CreatePopupMenu(), CreateTextEntry(), IParam::GetDisplay(), IParam::GetDisplayText(), IParam::GetLabel(), IParam::GetName(), IControl::GetParam(), IControl::GetPromptShowsParamLabel(), IControl::GetText(), IParam::NDisplayTexts(), and IParam::Type().

Referenced by IControl::PromptUserInput().

◆ PushLayer()

void IGraphics::PushLayer ( ILayer pLayer)
protected

Push a layer on to the stack.

Parameters
pLayerThe new layer

Definition at line 2005 of file IGraphics.cpp.

References ILayer::Bounds(), PathClear(), PathClipRegion(), PathTransformReset(), and UpdateLayer().

Referenced by IGraphicsNanoVG::ApplyShadowMask(), IGraphicsNanoVG::GetLayerBitmapData(), ResumeLayer(), and StartLayer().

◆ ReleaseBitmap()

void IGraphics::ReleaseBitmap ( const IBitmap bitmap)
virtual

Releases an IBitmap from the cache/static storage.

Parameters
bitmapThe bitmap to release

Reimplemented in IGraphicsNanoVG.

Definition at line 1834 of file IGraphics.cpp.

References IBitmap::GetAPIBitmap().

◆ ReleaseMouseCapture()

void IGraphics::ReleaseMouseCapture ( )

Used to tell the graphics context to stop tracking mouse interaction with a control.

Definition at line 1278 of file IGraphics.cpp.

References HideMouseCursor().

Referenced by EnableLiveEdit(), IGraphicsLiveEdit::OnKeyDown(), OnMouseDblClick(), OnMouseDown(), IURLControl::OnMouseDown(), RemoveAllControls(), RemoveControl(), RemoveControls(), and Resize().

◆ RemoveAllControls()

void IGraphics::RemoveAllControls ( )

Removes all regular IControls from the control list, as well as special controls (frees memory).

Definition at line 194 of file IGraphics.cpp.

References ReleaseMouseCapture().

Referenced by IGraphicsNanoVG::OnViewDestroyed(), and IGraphicsSkia::OnViewDestroyed().

◆ RemoveControl() [1/2]

void IGraphics::RemoveControl ( IControl pControl)

Remove a control at using ptr, (frees memory).

Definition at line 172 of file IGraphics.cpp.

References ClearInTextEntryControl(), ControlIsCaptured(), IControl::GetTag(), ReleaseMouseCapture(), and SetAllControlsDirty().

◆ RemoveControl() [2/2]

void IGraphics::RemoveControl ( int  idx)

Remove a control at a particular index, (frees memory).

Definition at line 167 of file IGraphics.cpp.

References GetControl(), and RemoveControl().

Referenced by IGraphicsLiveEdit::OnKeyDown(), IGraphicsLiveEdit::OnPopupMenuSelection(), and RemoveControl().

◆ RemoveControls()

void IGraphics::RemoveControls ( int  fromIdx)

Remove controls from the control list above a particular index, (frees memory).


Definition at line 139 of file IGraphics.cpp.

References ClearInTextEntryControl(), ControlIsCaptured(), GetControl(), IControl::GetTag(), NControls(), ReleaseMouseCapture(), and SetAllControlsDirty().

◆ RemoveControlWithTag()

void IGraphics::RemoveControlWithTag ( int  ctrlTag)

Remove controls from the control list with a particular tag.


Definition at line 132 of file IGraphics.cpp.

References GetControlWithTag(), and SetAllControlsDirty().

◆ RemovePlatformView()

virtual void IGraphics::RemovePlatformView ( void *  pView)
inlinevirtual

Remove a previously attached platform view from the IGraphics view.

Parameters
pViewthe platform view to remove, which would be a HWND on Windows, NSView* on macOS or UIView* on iOS

Definition at line 803 of file IGraphics.h.

◆ RemovePopupMenuControl()

void IGraphics::RemovePopupMenuControl ( )

Remove the IGraphics popup menu, use platform popup menu if available.

Definition at line 365 of file IGraphics.cpp.

Referenced by TestDirBrowseControl::OnMouseDown().

◆ RemoveTextEntryControl()

void IGraphics::RemoveTextEntryControl ( )

Remove the IGraphics text entry, use platform text entry if available.

Definition at line 379 of file IGraphics.cpp.

◆ Resize()

void IGraphics::Resize ( int  w,
int  h,
float  scale,
bool  needsPlatformResize = true 
)
Todo:
detailed description of how this works
Parameters
wNew width in pixels
hNew height in pixels
scaleNew scale ratio
needsPlatformResizeThis should be true for a "manual" resize from the plug-in UI and false if being called from IEditorDelegate::OnParentWindowResize(), in order to avoid feedback

Definition at line 90 of file IGraphics.cpp.

References Clip(), IEditorDelegate::ConstrainEditorResize(), IEditorDelegate::EditorResizeFromUI(), ForAllControls(), GetDelegate(), GetDrawScale(), GetPlatformWindowScale(), Height(), IGEditorDelegate::LayoutUI(), IControl::OnResize(), ReleaseMouseCapture(), SetAllControlsDirty(), Width(), WindowHeight(), and WindowWidth().

Referenced by OnDragResize(), ICornerResizerControl::OnMouseDblClick(), IGEditorDelegate::OpenWindow(), and IGEditorDelegate::UnserializeEditorSize().

◆ RespondsToGesture()

bool IGraphics::RespondsToGesture ( float  x,
float  y 
)

Called by platform class to see if the point at x, y is linked to a gesture recognizer.

Definition at line 2343 of file IGraphics.cpp.

References IRECTList::Find(), IControl::GetWantsGestures(), and IRECTList::Size().

◆ ResumeLayer()

void IGraphics::ResumeLayer ( ILayerPtr layer)

If a layer already exists, continue drawing to it.

Parameters
layerthe layer to resume

Definition at line 1987 of file IGraphics.cpp.

References PushLayer().

Referenced by TestKeyboardControl::Draw(), and TestMTControl::Draw().

◆ RetainBitmap()

void IGraphics::RetainBitmap ( const IBitmap bitmap,
const char *  cacheName 
)
virtual

Adds an IBitmap to the cache/static storage.

Parameters
bitmapThe bitmap to cache
cacheNameThe name by which this bitmap is identified int the cache

Reimplemented in IGraphicsNanoVG.

Definition at line 1840 of file IGraphics.cpp.

References IBitmap::GetAPIBitmap(), and IBitmap::GetScale().

Referenced by LoadBitmap(), and ScaleBitmap().

◆ RevealPathInExplorerOrFinder()

virtual bool IGraphics::RevealPathInExplorerOrFinder ( WDL_String &  path,
bool  select = false 
)
inlinevirtual
Parameters
pathWDL_String reference where the path will be put on success or empty string on failure
selectet true if you want to select the item in Explorer/Finder
Returns
true on success (if the path was valid)

Definition at line 919 of file IGraphics.h.

◆ ScaleBitmap()

IBitmap IGraphics::ScaleBitmap ( const IBitmap inBitmap,
const char *  cacheName,
int  targetScale 
)
virtual

Returns a new IBitmap, an integer scaled version of the input, and adds it to the cache.

Parameters
inbitmapThe source bitmap to be scaled
cacheNameThe name by which this bitmap is identified int the cache (along with targetScale)
targetScaleAn integer scale factor of the new bitmap
Returns
IBitmap The new IBitmap that has been added to the cache

Definition at line 1846 of file IGraphics.cpp.

References DrawBitmap(), EndLayer(), GetDrawScale(), IBitmap::GetDrawScale(), IBitmap::GetFramesAreHorizontal(), GetRoundedScreenScale(), IBitmap::H(), IBitmap::N(), RetainBitmap(), StartLayer(), and IBitmap::W().

Referenced by LoadBitmap().

◆ SearchBitmapInCache()

APIBitmap * IGraphics::SearchBitmapInCache ( const char *  fileName,
int  targetScale,
int &  sourceScale 
)
protected

Search the static storage cache for a bitmap image resource matching the target scale.

Parameters
fileName
Todo:
Parameters
targetScale
Todo:
Parameters
sourceScale
Todo:
Returns
pointer to the bitmap in the cache, or null pointer if not found

Definition at line 1898 of file IGraphics.cpp.

Referenced by LoadBitmap().

◆ SearchImageResource()

EResourceLocation IGraphics::SearchImageResource ( const char *  fileName,
const char *  type,
WDL_String &  result,
int  targetScale,
int &  sourceScale 
)
protected

Search for a bitmap image resource matching the target scale.

Parameters
fileName
Todo:
Parameters
type
Todo:
Parameters
result
Todo:
Parameters
targetScale
Todo:
Parameters
sourceScale
Todo:
Returns
EResourceLocation
Todo:

Definition at line 1876 of file IGraphics.cpp.

References GetBundleID(), GetSharedResourcesSubPath(), GetWinModuleHandle(), and LocateResource().

Referenced by LoadBitmap(), and IGraphicsNanoVG::LoadBitmap().

◆ SetAllControlsClean()

void IGraphics::SetAllControlsClean ( )

Calls SetClean() on every control.

Definition at line 587 of file IGraphics.cpp.

References ForAllControls().

◆ SetAllControlsDirty()

void IGraphics::SetAllControlsDirty ( )

◆ SetControlBounds()

void IGraphics::SetControlBounds ( IControl pControl,
const IRECT r 
)

Set a controls target and draw rect to r, redrawing the interface correctly.

Parameters
idxThe index of the control
rThe new bounds for the control's target and draw rect

Definition at line 228 of file IGraphics.cpp.

References IControl::IsHidden(), SetAllControlsDirty(), and IControl::SetTargetAndDrawRECTs().

◆ SetControlPosition()

void IGraphics::SetControlPosition ( IControl pControl,
float  x,
float  y 
)

Reposition a control, redrawing the interface correctly.

Parameters
pControlThe control
xThe new x position
yThe new y position

Definition at line 214 of file IGraphics.cpp.

References IControl::IsHidden(), SetAllControlsDirty(), and IControl::SetPosition().

Referenced by IGraphicsLiveEdit::OnMouseDrag().

◆ SetControlSize()

void IGraphics::SetControlSize ( IControl pControl,
float  w,
float  h 
)

Resize a control, redrawing the interface correctly.

Parameters
pControlThe control
wThe new width
hThe new height

Definition at line 221 of file IGraphics.cpp.

References IControl::IsHidden(), SetAllControlsDirty(), and IControl::SetSize().

Referenced by IGraphicsLiveEdit::OnMouseDrag().

◆ SetControlValueAfterPopupMenu()

void IGraphics::SetControlValueAfterPopupMenu ( IPopupMenu pMenu)

Called by PopupMenuControl in order to update a control with a new value after returning from the non-blocking menu.

The base class has a record of the control, so it is not needed here.

Parameters
pMenuThe menu that was clicked

Definition at line 255 of file IGraphics.cpp.

References IEditorDelegate::EndInformHostOfParamChangeFromUI(), GetDelegate(), IControl::GetParamIdx(), IControl::NVals(), IControl::OnContextSelection(), and IControl::OnPopupMenuSelection().

◆ SetControlValueAfterTextEdit()

void IGraphics::SetControlValueAfterTextEdit ( const char *  str)

Called by the platform class after returning from a text entry in order to update a control with a new value.

The base class has a record of the control, so it is not needed here.

Parameters
strThe new value as a CString

Definition at line 235 of file IGraphics.cpp.

References ClearInTextEntryControl(), IControl::GetParam(), IControl::OnTextEntryCompletion(), IControl::SetValueFromUserInput(), IParam::StringToValue(), and IParam::ToNormalized().

◆ SetDisplayTickFunc()

void IGraphics::SetDisplayTickFunc ( IDisplayTickFunc  func)
inline

Sets a function that is called at the frame rate, prior to checking for dirty controls.

Parameters
funcThe function to call

Definition at line 1198 of file IGraphics.h.

◆ SetFilePathInClipboard()

virtual bool IGraphics::SetFilePathInClipboard ( const char *  path)
inlinevirtual

Set a file path in the clipboard.

Returns false on unsupported platforms

Parameters
strA CString that contains a path to a file on disk
Returns
/c true on success

Definition at line 866 of file IGraphics.h.

◆ SetKeyHandlerFunc()

void IGraphics::SetKeyHandlerFunc ( IKeyHandlerFunc  func)
inline

Set a function that is called when key presses are not intercepted by any controls.

Parameters
keyHandlerFuncA std::function conforming to IKeyHandlerFunc

Definition at line 1206 of file IGraphics.h.

Referenced by SetQwertyMidiKeyHandlerFunc().

◆ SetLayoutOnResize()

void IGraphics::SetLayoutOnResize ( bool  layoutOnResize)

Definition at line 121 of file IGraphics.cpp.

◆ SetMouseCursor()

virtual ECursor IGraphics::SetMouseCursor ( ECursor  cursorType = ECursor::ARROW)
inlinevirtual

Sets the mouse cursor to one of ECursor (implementations should return the result of the base implementation)

Parameters
cursorTypeThe cursor type
Returns
The previous cursor type so it can be restored later

Definition at line 828 of file IGraphics.h.

Referenced by EnableLiveEdit(), TestCursorControl::OnMouseDown(), OnMouseOut(), ICornerResizerControl::OnMouseOut(), TestCursorControl::OnMouseOut(), IURLControl::OnMouseOut(), ICornerResizerControl::OnMouseOver(), IURLControl::OnMouseOver(), IGraphicsLiveEdit::OnMouseOver(), and OnSetCursor().

◆ SetPlatformContext()

void IGraphics::SetPlatformContext ( void *  pContext)
inline

Set the platform draw context Used in order to set the platform level draw context - CGContextRef context on macOS and the GDI HDC draw context handle on Windows.

Parameters
pContextvoid pointer to CGContextRef or HDC

Definition at line 931 of file IGraphics.h.

◆ SetPTParameterHighlight()

void IGraphics::SetPTParameterHighlight ( int  paramIdx,
bool  isHighlighted,
int  color 
)

[AAX only] See AAX_CEffectGUI::SetControlHighlightInfo()

Parameters
paramIdxThe index of the parameter to highlight
isHighlighted/c true if the parameter should be highlighted
colorAn integer corresponding to AAX_EHighlightColor

Definition at line 1396 of file IGraphics.cpp.

References ForMatchingControls(), and IControl::SetPTParameterHighlight().

◆ SetQwertyMidiKeyHandlerFunc()

void IGraphics::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.

Parameters
funcA function to do something when a MIDI message is triggered

Definition at line 2275 of file IGraphics.cpp.

References Clip(), GetDelegate(), IMidiMsg::MakeNoteOffMsg(), IMidiMsg::MakeNoteOnMsg(), IEditorDelegate::SendMidiMsgFromUI(), and SetKeyHandlerFunc().

◆ SetScaleConstraints()

void IGraphics::SetScaleConstraints ( float  lo,
float  hi 
)

Sets the minimum and maximum (draw) scaling values.

Parameters
loThe minimum scalar that the IGraphics context can be scaled down to
hiThe maxiumum scalar that the IGraphics context can be scaled up to

Definition at line 126 of file IGraphics.cpp.

◆ SetScreenScale()

void IGraphics::SetScreenScale ( float  scale)

Called by the platform IGraphics class when moving to a new screen to set DPI.

Parameters
scaleThe scale of the screen, typically 2 on a macOS retina screen, or 2 with 200% scaling on windows

Definition at line 75 of file IGraphics.cpp.

References IEditorDelegate::EditorResizeFromUI(), ForAllControls(), GetDelegate(), GetPlatformWindowScale(), IControl::OnRescale(), SetAllControlsDirty(), WindowHeight(), and WindowWidth().

◆ SetSharedResourcesSubPath()

void IGraphics::SetSharedResourcesSubPath ( const char *  sharedResourcesSubPath)
inline

Sets the name of the shared resources subpath.

Definition at line 1639 of file IGraphics.h.

◆ SetStrictDrawing()

void IGraphics::SetStrictDrawing ( bool  strict)

Enables strict drawing mode.

Todo:
explain strict drawing
Parameters
strictSet /c true to enable strict drawing mode

Definition at line 965 of file IGraphics.cpp.

References SetAllControlsDirty().

◆ SetTabletInput()

void IGraphics::SetTabletInput ( bool  tablet)
inline

Set by the platform class if the mouse input is coming from a tablet/stylus.

Parameters
tablettrue means input is from a tablet

Definition at line 1597 of file IGraphics.h.

◆ SetTextInClipboard()

virtual bool IGraphics::SetTextInClipboard ( const char *  str)
pure virtual

Set text in the clipboard.

Parameters
strA CString that will be used to set the current text in the clipboard
Returns
/c true on success

◆ SetTranslation()

void IGraphics::SetTranslation ( float  x,
float  y 
)
inline

Called by some platform IGraphics classes in order to translate the graphics context, in response to e.g.

iOS onscreen keyboard appearing

Definition at line 1009 of file IGraphics.h.

◆ SetUIAppearanceChangedFunc()

void IGraphics::SetUIAppearanceChangedFunc ( IUIAppearanceChangedFunc  func)
inline

Sets a function that is called when the OS appearance (light/dark mode) is changed.

Parameters
funcThe function to call

Definition at line 1202 of file IGraphics.h.

◆ SetWinModuleHandle()

virtual void IGraphics::SetWinModuleHandle ( void *  pHinstance)
inlinevirtual

Used on Windows to set the HINSTANCE module handle, which allows graphics APIs to load resources from the binary.

Parameters
pHinstancevoid pointer to the platform instance

Definition at line 923 of file IGraphics.h.

◆ ShowAreaDrawn()

void IGraphics::ShowAreaDrawn ( bool  enable)
inline
Parameters
enableSet true if you wish to show the rectangular region that is drawn on each frame, in order to debug redraw problems

Definition at line 1176 of file IGraphics.h.

References SetAllControlsDirty().

◆ ShowAreaDrawnEnabled()

bool IGraphics::ShowAreaDrawnEnabled ( ) const
inline
Returns
true if showning the area drawn on each frame

Definition at line 1179 of file IGraphics.h.

◆ ShowBubbleControl()

void IGraphics::ShowBubbleControl ( IControl pCaller,
float  x,
float  y,
const char *  str,
EDirection  dir = EDirection::Horizontal,
IRECT  minimumContentBounds = IRECT() 
)

Definition at line 384 of file IGraphics.cpp.

◆ ShowControlBounds()

void IGraphics::ShowControlBounds ( bool  enable)
inline
Parameters
enableSet true if you wish to draw the rectangular region of the graphics context occupied by each IControl in mControls

Definition at line 1173 of file IGraphics.h.

References SetAllControlsDirty().

◆ ShowControlBoundsEnabled()

bool IGraphics::ShowControlBoundsEnabled ( ) const
inline
Returns
true if showning the control bounds

Definition at line 1182 of file IGraphics.h.

◆ ShowFPSDisplay()

void IGraphics::ShowFPSDisplay ( bool  enable)

Shows a control to display the frame rate of drawing.

Parameters
enabletrue to show

Definition at line 429 of file IGraphics.cpp.

References GetBounds(), GetDelegate(), and SetAllControlsDirty().

◆ ShowingFPSDisplay()

bool IGraphics::ShowingFPSDisplay ( )
inline
Returns
true if performance display is shown

Definition at line 1342 of file IGraphics.h.

◆ ShowMessageBox()

virtual EMsgBoxResult IGraphics::ShowMessageBox ( const char *  str,
const char *  title,
EMsgBoxType  type,
IMsgBoxCompletionHandlerFunc  completionHandler = nullptr 
)
pure virtual

Pop up a modal platform message box dialog.

Parameters
strThe text message to display in the dialog
titleThe title of the message box window
typeEMsgBoxType describing the button options available
See also
EMsgBoxType
Parameters
completionHanlderan IMsgBoxCompletionHandlerFunc that will be called when a button is pressed
Returns
EMsgBoxResult signifying which button was pressed

◆ StartLayer()

void IGraphics::StartLayer ( IControl pOwner,
const IRECT r,
bool  cacheable = false 
)

Create an IGraphics layer.

Switches drawing to an offscreen bitmap for drawing IControl* pOwner The control that owns the layer

Parameters
rThe bounds of the layer within the IGraphics context
cacheableUsed to make sure the underlying bitmap can be shared between plug-in instances

Definition at line 1977 of file IGraphics.cpp.

References CreateAPIBitmap(), GetBackingPixelScale(), GetDrawScale(), IRECT::GetPixelAligned(), IControl::GetRECT(), GetScreenScale(), IRECT::H(), PushLayer(), and IRECT::W().

Referenced by IVPlotControl::Draw(), IWheelControl::Draw(), TestBlendControl::Draw(), TestDropShadowControl::Draw(), GFXLabelControl::Draw(), TestKeyboardControl::Draw(), TestLayerControl::Draw(), TestMaskControl::Draw(), TestMTControl::Draw(), TestShadowGradientControl::Draw(), TestSVGControl::Draw(), ISVGControl::Draw(), and ScaleBitmap().

◆ StyleAllVectorControls()

void IGraphics::StyleAllVectorControls ( const IVStyle style)

Helper method to style all of the controls which inherit IVectorBase.

Parameters
IVStyleStyle for the controls

Definition at line 1913 of file IGraphics.cpp.

References GetControl(), NControls(), and IVectorBase::SetStyle().

◆ TooltipsEnabled()

bool IGraphics::TooltipsEnabled ( ) const
inline
Returns
true if tool tips are enabled

Definition at line 1137 of file IGraphics.h.

◆ UpdateLayer()

virtual void IGraphics::UpdateLayer ( )
inlineprotectedvirtual

Implemented by a graphics backend to prepare for drawing to the layer at the top of the stack.

Reimplemented in IGraphicsSkia.

Definition at line 578 of file IGraphics.h.

Referenced by PopLayer(), and PushLayer().

◆ UpdatePeers()

void IGraphics::UpdatePeers ( IControl pCaller,
int  callerValIdx 
)

This method is called after interacting with a control, so that any other controls linked to the same parameter index, will also be set dirty, and have their values updated.

Parameters
pCallerThe control that triggered the parameter change.
callerValIdxThe index of the value in the control that triggered the parameter change.

Definition at line 603 of file IGraphics.cpp.

References ForStandardControlsFunc(), IControl::GetParamIdx(), and IControl::GetValue().

Referenced by IControl::SetDirty().

◆ UpdateTooltips()

virtual void IGraphics::UpdateTooltips ( )
pure virtual

Call this if you modify control tool tips at runtime.

Todo:
explain

◆ Width()

int IGraphics::Width ( ) const
inline

Gets the width of the graphics context.

Returns
A whole number representing the width of the graphics context in pixels on a 1:1 screen

Definition at line 1081 of file IGraphics.h.

Referenced by GetBounds(), OnDragResize(), and Resize().

◆ WindowHeight()

int IGraphics::WindowHeight ( ) const
inline

Gets the height of the graphics context including draw scaling.

Returns
A whole number representing the height of the graphics context with scaling in pixels on a 1:1 screen

Definition at line 1093 of file IGraphics.h.

Referenced by IGraphicsNanoVG::BeginFrame(), IGraphicsSkia::BeginFrame(), IGraphicsNanoVG::CreateAPIBitmap(), IGraphicsNanoVG::DrawResize(), IGraphicsSkia::DrawResize(), IGraphicsNanoVG::EndFrame(), IGraphicsSkia::EndFrame(), Resize(), and SetScreenScale().

◆ WindowIsOpen()

virtual bool IGraphics::WindowIsOpen ( )
inlinevirtual
Returns
/c true if the platform window/view is open

Definition at line 851 of file IGraphics.h.

References GetWindow().

◆ WindowWidth()

int IGraphics::WindowWidth ( ) const
inline

Gets the width of the graphics context including draw scaling.

Returns
A whole number representing the width of the graphics context with scaling in pixels on a 1:1 screen

Definition at line 1089 of file IGraphics.h.

Referenced by IGraphicsNanoVG::BeginFrame(), IGraphicsSkia::BeginFrame(), IGraphicsNanoVG::CreateAPIBitmap(), IGraphicsNanoVG::DrawResize(), IGraphicsSkia::DrawResize(), IGraphicsNanoVG::EndFrame(), IGraphicsSkia::EndFrame(), Resize(), and SetScreenScale().

Friends And Related Function Documentation

◆ ICornerResizerControl

friend class ICornerResizerControl
friend

Definition at line 1856 of file IGraphics.h.

◆ IGraphicsLiveEdit

friend class IGraphicsLiveEdit
friend

Definition at line 1855 of file IGraphics.h.

◆ ITextEntryControl

friend class ITextEntryControl
friend

Definition at line 1857 of file IGraphics.h.

Member Data Documentation

◆ mClipRECT

IRECT IGraphics::mClipRECT
protected

Definition at line 1861 of file IGraphics.h.

◆ mCursorHidden

bool IGraphics::mCursorHidden = false
protected

Definition at line 1847 of file IGraphics.h.

◆ mCursorLock

bool IGraphics::mCursorLock = false
protected

Definition at line 1848 of file IGraphics.h.

◆ mCursorX

float IGraphics::mCursorX = -1.f
protected

Definition at line 1850 of file IGraphics.h.

◆ mCursorY

float IGraphics::mCursorY = -1.f
protected

Definition at line 1851 of file IGraphics.h.

◆ mDelegate

IGEditorDelegate* IGraphics::mDelegate
protected

Definition at line 1846 of file IGraphics.h.

◆ mLayers

std::stack<ILayer*> IGraphics::mLayers
protected

Definition at line 1859 of file IGraphics.h.

◆ mTabletInput

bool IGraphics::mTabletInput = false
protected

Definition at line 1849 of file IGraphics.h.

◆ mTransform

IMatrix IGraphics::mTransform
protected

Definition at line 1862 of file IGraphics.h.

◆ mTransformStates

std::stack<IMatrix> IGraphics::mTransformStates
protected

Definition at line 1863 of file IGraphics.h.

◆ mXTranslation

float IGraphics::mXTranslation = 0.f
protected

Definition at line 1852 of file IGraphics.h.

◆ mYTranslation

float IGraphics::mYTranslation = 0.f
protected

Definition at line 1853 of file IGraphics.h.


The documentation for this class was generated from the following files: