iPlug 2: IGraphics Class Reference

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

#include <IGraphics.h>

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, const 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...
 
virtual 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 partial text input)
 
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 to refresh the platform tooltip state.
 
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 DeleteFromPopupMenu (IPopupMenu *pMenu, int itemIdx)
 Called by IOS platform (or other supported platforms) in order to update a control with a deletion interaction on a popup 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)
 Resizes the graphics context to new dimensions and scale. More...
 
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 SetFPSDisplayBounds (const IRECT &bounds)
 
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)
 
bool 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 MouseOverEnabled () 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 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
 Internal method to measure text dimensions. More...
 
virtual void DoDrawText (const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=nullptr)=0
 Internal method to draw text. More...
 
void DoMeasureTextRotation (const IText &text, const IRECT &bounds, IRECT &rect) const
 Measures text bounds accounting for rotation. More...
 
void CalculateTextRotation (const IText &text, const IRECT &bounds, IRECT &rect, double &tx, double &ty) const
 Calculates rotation parameters for text drawing. More...
 
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
 

The lowest level base class of an IGraphics context.

Definition at line 82 of file IGraphics.h.

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

◆ ~IGraphics()

IGraphics::~IGraphics ( )
virtual

◆ ActivateGLContext()

virtual void IGraphics::ActivateGLContext ( )
inlineprotectedvirtual

◆ AlphaChannel()

virtual int IGraphics::AlphaChannel ( ) const
protectedpure virtual

◆ ApplyLayerDropShadow()

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

◆ 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 IGraphicsNanoVG, and IGraphicsSkia.

Referenced by ApplyLayerDropShadow().

◆ AssignParamNameToolTips()

void IGraphics::AssignParamNameToolTips ( )

◆ AttachBackground()

void IGraphics::AttachBackground ( const char *  fileName)

◆ AttachBubbleControl() [1/2]

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

◆ AttachBubbleControl() [2/2]

◆ AttachControl()

IControl * IGraphics::AttachControl ( IControl pControl,
int  ctrlTag = kNoTag,
const char *  group = "" 
)

◆ 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 
)

◆ 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 333 of file IGraphics.cpp.

References GetDelegate().

◆ AttachGestureRecognizer()

void IGraphics::AttachGestureRecognizer ( EGestureType  type)
virtual

◆ AttachGestureRecognizerToRegion()

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

◆ AttachPanelBackground()

void IGraphics::AttachPanelBackground ( const IPattern color)

◆ AttachPlatformView()

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

◆ 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 364 of file IGraphics.cpp.

References GetDelegate().

Referenced by TestDirBrowseControl::OnMouseDown().

◆ AttachSVGBackground()

void IGraphics::AttachSVGBackground ( const char *  fileName)

◆ AttachTextEntryControl()

void IGraphics::AttachTextEntryControl ( )

◆ BeginFrame()

void IGraphics::BeginFrame ( )
virtual

◆ BitmapExtSupported()

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

◆ 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

◆ 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
Returns
true if the layer needs to be updated

Definition at line 2050 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 ( )

◆ ClearInTextEntryControl()

void IGraphics::ClearInTextEntryControl ( )
inline

◆ 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

◆ 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 1420 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
drawScaleThe current draw scale for the graphics context
cacheableUsed to make sure the underlying bitmap can be shared between plug-in instances
Returns
APIBitmap* The new API Bitmap

Implemented in 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 IText style for the text entry field text.
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]

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 1976 of file IGraphics.cpp.

Referenced by CreatePopupMenu(), ITextEntryControl::OnMouseDown(), IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnMouseDown(), IWheelControl::OnMouseDown(), IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::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 1049 of file IGraphics.h.

References CreatePopupMenu().

◆ CreateTextEntry()

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

◆ DeactivateGLContext()

virtual void IGraphics::DeactivateGLContext ( )
inlineprotectedvirtual

◆ DeleteFromPopupMenu()

void IGraphics::DeleteFromPopupMenu ( IPopupMenu pMenu,
int  itemIdx 
)

Called by IOS platform (or other supported platforms) in order to update a control with a deletion interaction on a popup menu.

Parameters
pMenuThe menu that an item was deleted in
itemIdxThe index of the deleted item

Definition at line 280 of file IGraphics.cpp.

References IControl::OnDeleteFromPopupMenu().

◆ DisableControl()

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

◆ DoDrawText()

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

Internal method to draw text.

Parameters
textThe text style to use for drawing
strThe string to draw
boundsThe bounding rectangle for the text
pBlendOptional blend mode

Implemented in IGraphicsNanoVG, and IGraphicsSkia.

Referenced by DrawText().

◆ DoMeasureText()

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

Internal method to measure text dimensions.

Parameters
textThe text style to use for measurement
strThe string to measure
boundsOutput rectangle updated with the measured text bounds
Returns
The width of the measured text

Implemented in IGraphicsNanoVG, and IGraphicsSkia.

Referenced by MeasureText().

◆ DoMeasureTextRotation()

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

◆ DoTextRotation()

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

◆ 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 2543 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 
)

◆ 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 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 727 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 2550 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 2536 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

◆ 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 2497 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 2557 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

◆ 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 2573 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

◆ 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 2792 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 
)

◆ DrawGrid()

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

◆ DrawHorizontalLine() [1/2]

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

◆ 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 819 of file IGraphics.cpp.

References DrawLine().

◆ DrawLayer()

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

Draw a layer to the main IGraphics context.

Parameters
layerThe layer to draw
pBlendOptional blend method

Definition at line 2063 of file IGraphics.cpp.

References DrawBitmap(), PathTransformReset(), PathTransformRestore(), and PathTransformSave().

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

◆ DrawLine()

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

◆ 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 792 of file IGraphics.cpp.

References DrawHorizontalLine(), and DrawVerticalLine().

◆ DrawMultiLineText()

virtual void IGraphics::DrawMultiLineText ( const IText text,
const char *  str,
const 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, and IGraphicsSkia.

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 2429 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 824 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

Draw a rectangle to the graphics context.

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

Definition at line 2515 of file IGraphics.cpp.

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

Referenced by IVLabelControl::Draw(), IVXYPadControl::Draw(), IVPlotControl::Draw(), IFPSDisplayControl::Draw(), IVBarGraphSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::Draw(), IVDisplayControl::Draw(), IVKeyboardControl::Draw(), IWheelControl::Draw(), IVMeterControl< MAXNC >::Draw(), IVMultiSliderControl< MAXNC >::Draw(), IVScopeControl< MAXNC, MAXBUF >::Draw(), IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::Draw(), TestArcControl::Draw(), TestBezierControl::Draw(), TestBlendControl::Draw(), TestDirBrowseControl::Draw(), TestFlexBoxControl::Draw(), TestMTControl::Draw(), IPanelControl::Draw(), IVRangeSliderControl::DrawWidget(), and IVColorSwatchControl::DrawWidget().

◆ DrawRotatedBitmap()

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

◆ DrawRotatedLayer()

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

◆ DrawRotatedSVG()

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

◆ 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

◆ 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 2529 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 2802 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 
)

Draw some text to the graphics context in a specific rectangle.

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

Definition at line 683 of file IGraphics.cpp.

References DoDrawText().

Referenced by IVLabelControl::Draw(), IFPSDisplayControl::Draw(), ITextEntryControl::Draw(), IVKeyboardControl::Draw(), TestAnimationControl::Draw(), TestBlendControl::Draw(), TestColorControl::Draw(), TestCursorControl::Draw(), TestCustomShaderControl::Draw(), TestDirBrowseControl::Draw(), TestDragAndDropControl::Draw(), TestDrawContextControl::Draw(), TestFlexBoxControl::Draw(), TestFontControl::Draw(), TestGesturesControl::Draw(), GFXLabelControl::Draw(), TestImageControl::Draw(), TestKeyboardControl::Draw(), TestLayerControl::Draw(), TestMPSControl::Draw(), TestMTControl::Draw(), TestSizeControl::Draw(), TestTextControl::Draw(), TestTextOrientationControl::Draw(), TestTextSizeControl::Draw(), ITextControl::Draw(), IURLControl::Draw(), PlaceHolder::Draw(), IPopupMenuControl::DrawCellText(), IVectorBase::DrawLabel(), IGraphicsSkia::DrawMultiLineText(), DrawMultiLineText(), DrawText(), IVectorBase::DrawValue(), IVToggleControl::DrawValue(), IVRadioButtonControl::DrawWidget(), and IVColorSwatchControl::DrawWidget().

◆ 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 699 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

◆ DrawVerticalLine() [1/2]

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

◆ 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 814 of file IGraphics.cpp.

References DrawLine().

◆ EnableLiveEdit()

void IGraphics::EnableLiveEdit ( bool  enable)

◆ 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 1601 of file IGraphics.h.

Referenced by IGraphicsLiveEdit::OnInit().

◆ EnableMultiTouch()

bool IGraphics::EnableMultiTouch ( bool  enable)
inline

◆ EnableTooltips()

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

Definition at line 1543 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()

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 2018 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 2615 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

◆ 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 2608 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

◆ 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 2638 of file IGraphics.cpp.

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

◆ FillRect()

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

Fill a rectangular region of the graphics context with a color.

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

Definition at line 2587 of file IGraphics.cpp.

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

Referenced by IFPSDisplayControl::Draw(), ITextEntryControl::Draw(), IVKeyboardControl::Draw(), IVNumberBoxControl::Draw(), ISkParagraphControl::Draw(), TestAnimationControl::Draw(), TestArcControl::Draw(), TestBezierControl::Draw(), TestBlendControl::Draw(), TestCursorControl::Draw(), TestDirBrowseControl::Draw(), TestDragAndDropControl::Draw(), TestFlexBoxControl::Draw(), TestFontControl::Draw(), GFXLabelControl::Draw(), TestImageControl::Draw(), TestKeyboardControl::Draw(), TestMaskControl::Draw(), TestShadowGradientControl::Draw(), TestSVGControl::Draw(), TestTextControl::Draw(), TestTextOrientationControl::Draw(), TestTextSizeControl::Draw(), ITextControl::Draw(), IMultiLineTextControl::Draw(), IURLControl::Draw(), PlaceHolder::Draw(), IVTrackControlBase::DrawBackground(), IVectorBase::DrawBackground(), IPopupMenuControl::DrawCellBackground(), DrawPoint(), IPopupMenuControl::DrawSeparator(), IVTrackControlBase::DrawTrackHandle(), IVectorBase::DrawValue(), IVToggleControl::DrawValue(), IVRangeSliderControl::DrawWidget(), and IVColorSwatchControl::DrawWidget().

◆ FillRoundRect() [1/2]

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

◆ 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 2601 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 2580 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

◆ ForAllControls()

template<typename T , typename... Args>

void IGraphics::ForAllControls ( method,
Args...  args 
)

◆ ForAllControlsFunc()

void IGraphics::ForAllControlsFunc ( IControlFunction  func)

◆ ForControlInGroup()

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

◆ 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 515 of file IGraphics.cpp.

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

◆ ForControlWithParam() [2/2]

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

◆ ForMatchingControls()

template<typename T , typename... Args>

void IGraphics::ForMatchingControls ( method,
int  paramIdx,
Args...  args 
)

◆ ForStandardControlsFunc()

void IGraphics::ForStandardControlsFunc ( IControlFunction  func)

◆ 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 1114 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

◆ GetBackingPixelScale()

virtual float IGraphics::GetBackingPixelScale ( ) const
inlineprotectedvirtual

◆ 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 1211 of file IGraphics.h.

References Height(), and Width().

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

◆ GetBubbleControl()

Returns
Pointer to the special bubble control at index i, if one has been attached

Definition at line 1443 of file IGraphics.h.

◆ GetBundleID()

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

◆ GetControl()

IControl * IGraphics::GetControl ( int  idx)
inline

Get the control at a certain index in the control stack.

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

Definition at line 1375 of file IGraphics.h.

Referenced by IGraphicsLiveEdit::Draw(), ForControlInGroup(), ForControlWithParam(), ForStandardControlsFunc(), GetControlWithParamIdx(), OnKeyDown(), OnKeyUp(), IGraphicsLiveEdit::OnMouseDown(), IGraphicsLiveEdit::OnMouseDrag(), IGraphicsLiveEdit::OnMouseOver(), IGraphicsLiveEdit::OnMouseUp(), PopupHostContextMenuForParam(), RemoveControl(), RemoveControls(), and StyleAllVectorControls().

◆ 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 1380 of file IGraphics.h.

Referenced by GetIdxOfTaggedControl().

◆ GetControlInTextEntry()

IControl * IGraphics::GetControlInTextEntry ( )
inline

◆ 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 1399 of file IGraphics.h.

Referenced by IControl::GetTag().

◆ GetControlWithParamIdx()

IControl * IGraphics::GetControlWithParamIdx ( int  paramIdx)

◆ GetControlWithTag()

IControl * IGraphics::GetControlWithTag ( int  ctrlTag) const

◆ GetDelegate()

Gets a pointer to the delegate class that handles communication to and from this graphics context.

Returns
pointer to the delegate

Definition at line 1139 of file IGraphics.h.

Referenced by AttachBackground(), AttachBubbleControl(), AttachControl(), AttachCornerResizer(), AttachPanelBackground(), AttachPopupMenuControl(), AttachSVGBackground(), AttachTextEntryControl(), EnableLiveEdit(), OnMouseDown(), OnMouseUp(), PopupHostContextMenuForParam(), Resize(), SetControlValueAfterPopupMenu(), SetQwertyMidiKeyHandlerFunc(), SetScreenScale(), and ShowFPSDisplay().

◆ GetDrawContext()

virtual void * IGraphics::GetDrawContext ( )
pure virtual

◆ GetDrawingAPIStr()

virtual const char * IGraphics::GetDrawingAPIStr ( )
pure virtual

◆ GetDrawScale()

float IGraphics::GetDrawScale ( ) const
inline

◆ GetIdxOfTaggedControl()

int IGraphics::GetIdxOfTaggedControl ( int  ctrlTag) const
inline

◆ GetLastClickedParamForPTAutomation()

int IGraphics::GetLastClickedParamForPTAutomation ( )

[AAX only]

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

Definition at line 1405 of file IGraphics.cpp.

◆ GetLayerBitmapData()

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

◆ GetMouseDownPoint()

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

◆ GetMouseLocation()

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

◆ 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 1610 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 1398 of file IGraphics.cpp.

References IControl::GetParamIdx().

◆ GetPixelSnapped()

IRECT IGraphics::GetPixelSnapped ( IRECT r) const
inline

◆ 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

◆ 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 1237 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 IGraphicsNanoVG, and IGraphicsSkia.

◆ GetPopupMenuControl()

Returns
Pointer to the special pop-up menu control, if one has been attached

Definition at line 1437 of file IGraphics.h.

◆ GetPromptMenu()

◆ 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 1157 of file IGraphics.h.

◆ GetResizingInProcess()

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

Definition at line 1160 of file IGraphics.h.

◆ GetRoundedScreenScale()

int IGraphics::GetRoundedScreenScale ( ) const
inline

◆ GetScaledBitmap()

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 1536 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 1122 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

◆ GetTextEntryControl()

Returns
Pointer to the special text entry control, if one has been attached

Definition at line 1440 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

◆ GetTouches()

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

◆ GetTransformMatrix()

IMatrix IGraphics::GetTransformMatrix ( ) const
inlineprotected

◆ GetUIAppearance()

virtual EUIAppearance IGraphics::GetUIAppearance ( ) const
inlinevirtual

Get the UI Appearance (Light/Dark mode)

Returns
Light/Dark mode

Definition at line 1598 of file IGraphics.h.

◆ GetWindow()

virtual void * IGraphics::GetWindow ( )
pure virtual

◆ GetWinModuleHandle()

virtual void * IGraphics::GetWinModuleHandle ( )
inlinevirtual

◆ Height()

int IGraphics::Height ( ) const
inline

◆ HideControl()

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

◆ HideMouseCursor()

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

Call to hide/show the mouse cursor.

Parameters
hideShould the cursor be hidden or shown
lockSet true to hold the cursor in place while hidden

Referenced by IVXYPadControl::OnMouseDown(), IVNumberBoxControl::OnMouseDown(), TestArcControl::OnMouseDown(), TestPolyControl::OnMouseDown(), IKnobControlBase::OnMouseDown(), ISliderControlBase::OnMouseDown(), IVXYPadControl::OnMouseUp(), IVNumberBoxControl::OnMouseUp(), TestArcControl::OnMouseUp(), TestPolyControl::OnMouseUp(), IKnobControlBase::OnMouseUp(), ISliderControlBase::OnMouseUp(), and ReleaseMouseCapture().

◆ HidePlatformView()

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

◆ 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()

◆ IsInPlatformTextEntry()

bool IGraphics::IsInPlatformTextEntry ( )
inline

◆ LiveEditEnabled()

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

Definition at line 1206 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 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 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 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

◆ LoadBitmap() [2/2]

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

◆ LoadFont() [1/3]

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

◆ LoadFont() [2/3]

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

◆ 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 2211 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 1682 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

◆ 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
unitsThe length units used in the SVG (e.g. "px", "pt", "mm")
dpiThe dots per inch of the SVG file
Returns
An ISVG representing the image

Definition at line 1657 of file IGraphics.cpp.

◆ MeasureText()

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

◆ MouseOverEnabled()

bool IGraphics::MouseOverEnabled ( ) const
inline
Returns
true if the context has mouse overs enabled

Definition at line 1607 of file IGraphics.h.

◆ 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 1178 of file IGraphics.h.

◆ NBubbleControls()

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

Definition at line 1446 of file IGraphics.h.

◆ NControls()

int IGraphics::NControls ( ) const
inline

◆ 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 1530 of file IGraphics.cpp.

◆ OnDragResize()

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

◆ 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 1282 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 1288 of file IGraphics.cpp.

References IControl::OnDropMultiple().

◆ OnGestureRecognized()

void IGraphics::OnGestureRecognized ( const IGestureInfo info)

◆ OnGUIIdle()

void IGraphics::OnGUIIdle ( )

◆ OnKeyDown()

bool IGraphics::OnKeyDown ( float  x,
float  y,
const IKeyPress key 
)

◆ OnKeyUp()

bool IGraphics::OnKeyUp ( float  x,
float  y,
const IKeyPress key 
)

◆ OnMouseDblClick()

bool IGraphics::OnMouseDblClick ( float  x,
float  y,
const IMouseMod mod 
)

◆ OnMouseDown()

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

◆ OnMouseDrag()

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

◆ OnMouseOut()

void IGraphics::OnMouseOut ( )

◆ OnMouseOver()

bool IGraphics::OnMouseOver ( float  x,
float  y,
const IMouseMod mod 
)

◆ OnMouseUp()

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

◆ OnMouseWheel()

bool 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
deltaScroll amount (positive = up/forward, negative = down/backward)
Returns
/c true on handled

Definition at line 1236 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 1574 of file IGraphics.h.

References SetMouseCursor().

◆ OnTouchCancelled()

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

◆ OnViewDestroyed()

virtual void IGraphics::OnViewDestroyed ( )
inlinevirtual

◆ OnViewInitialized()

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

◆ 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
msgWindowTitleTitle for any confirmation dialog (platform-specific)
confirmMsgConfirmation message to display before opening (platform-specific)
errMsgOnFailureError message to display on failure (platform-specific)
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
pParentWndPointer to parent platform window or view handle (HWND on Windows, NSView* on macOS)
Returns
Pointer to the 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

◆ PathCircle()

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

◆ PathClear()

virtual void IGraphics::PathClear ( )
pure virtual

Clear the stack of path drawing commands.

Implemented in IGraphicsNanoVG, and IGraphicsSkia.

Referenced by DrawArc(), DrawCircle(), DrawConvexPolygon(), DrawData(), DrawDottedLine(), DrawDottedRect(), DrawEllipse(), DrawGrid(), DrawLine(), DrawRect(), DrawRoundRect(), DrawTriangle(), IVGroupControl::DrawWidget(), FillArc(), FillCircle(), FillConvexPolygon(), FillEllipse(), FillRect(), FillRoundRect(), FillTriangle(), PopLayer(), and PushLayer().

◆ PathClipRegion()

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

◆ 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 2713 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 IGraphicsNanoVG, and IGraphicsSkia.

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

◆ PathEllipse() [1/2]

void IGraphics::PathEllipse ( const IRECT bounds)

◆ PathEllipse() [2/2]

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

◆ PathFill()

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 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 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

Move the current point in the current path.

Parameters
xThe X coordinate
yThe Y coordinate

Implemented in IGraphicsNanoVG, and IGraphicsSkia.

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

◆ 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 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 831 of file IGraphics.cpp.

References PathLine().

◆ PathRect()

void IGraphics::PathRect ( const IRECT bounds)

Add a rectangle to the current path.

Parameters
boundsThe bounds of the rectangle to add

Definition at line 2653 of file IGraphics.cpp.

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

Referenced by IGraphicsNanoVG::ApplyShadowMask(), IWheelControl::Draw(), TestColorControl::Draw(), TestGesturesControl::Draw(), TestMultiPathControl::Draw(), IPanelControl::Draw(), DrawDottedRect(), DrawRect(), FillRect(), and PathRoundRect().

◆ 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 2680 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 2662 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

◆ PathStroke()

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 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)

◆ PathTransformReset()

void IGraphics::PathTransformReset ( bool  clearStates = false)

◆ PathTransformRestore()

void IGraphics::PathTransformRestore ( )

Restore the affine transform of the current path, to the previously saved state.

Definition at line 2726 of file IGraphics.cpp.

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

◆ PathTransformRotate()

void IGraphics::PathTransformRotate ( float  angle)

◆ PathTransformSave()

void IGraphics::PathTransformSave ( )

Save the current affine transform of the current path.

Definition at line 2721 of file IGraphics.cpp.

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

◆ PathTransformScale() [1/2]

void IGraphics::PathTransformScale ( float  scale)

◆ PathTransformScale() [2/2]

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

◆ 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 2771 of file IGraphics.cpp.

References IMatrix::Skew().

◆ PathTransformTranslate()

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

◆ 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 2645 of file IGraphics.cpp.

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

Referenced by DrawTriangle(), and FillTriangle().

◆ PlatformSupportsMultiTouch()

virtual bool IGraphics::PlatformSupportsMultiTouch ( ) const
inlinevirtual

◆ PopLayer()

ILayer * IGraphics::PopLayer ( )
protected

◆ 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 1417 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 1504 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 635 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

◆ ReleaseBitmap()

void IGraphics::ReleaseBitmap ( const IBitmap bitmap)
virtual

◆ ReleaseMouseCapture()

void IGraphics::ReleaseMouseCapture ( )

◆ RemoveAllControls()

void IGraphics::RemoveAllControls ( )

◆ RemoveControl() [1/2]

void IGraphics::RemoveControl ( IControl pControl)

◆ RemoveControl() [2/2]

void IGraphics::RemoveControl ( int  idx)

◆ RemoveControls()

void IGraphics::RemoveControls ( int  fromIdx)

◆ RemoveControlWithTag()

void IGraphics::RemoveControlWithTag ( int  ctrlTag)

◆ 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 ( )

◆ RemoveTextEntryControl()

void IGraphics::RemoveTextEntryControl ( )

◆ Resize()

void IGraphics::Resize ( int  w,
int  h,
float  scale,
bool  needsPlatformResize = true 
)

Resizes the graphics context to new dimensions and scale.

Parameters
wNew width in pixels
hNew height in pixels
scaleNew scale ratio
needsPlatformResizeSet true for manual resize from plug-in UI, false when called from IEditorDelegate::OnParentWindowResize() to avoid feedback loops

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 
)

◆ ResumeLayer()

void IGraphics::ResumeLayer ( ILayerPtr layer)

◆ RetainBitmap()

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

◆ 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 1862 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
fileNameThe filename key to search for
targetScaleThe desired scale factor
sourceScaleOutput parameter set to the actual scale of the found bitmap
Returns
Pointer to the bitmap in the cache, or nullptr if not found

Definition at line 1914 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
fileNameThe base filename to search for
typeThe file extension (e.g. "png", "jpg")
resultOutput string to receive the found resource path
targetScaleThe desired scale factor to find
sourceScaleOutput parameter set to the actual scale of the found resource
Returns
EResourceLocation::kNotFound if not found, kAbsolutePath for file system paths, or kWinBinary/kPreloadedTexture for embedded resources

Definition at line 1892 of file IGraphics.cpp.

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

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

◆ SetAllControlsClean()

void IGraphics::SetAllControlsClean ( )

◆ SetAllControlsDirty()

void IGraphics::SetAllControlsDirty ( )

Calls SetDirty() on every control.

Definition at line 595 of file IGraphics.cpp.

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

Referenced by EnableLiveEdit(), IGraphicsLiveEdit::OnKeyDown(), IGraphicsLiveEdit::OnMouseUp(), RemoveControl(), RemoveControls(), RemoveControlWithTag(), Resize(), SetControlBounds(), SetControlPosition(), SetControlSize(), SetScreenScale(), SetStrictDrawing(), ShowAreaDrawn(), ShowControlBounds(), and ShowFPSDisplay().

◆ SetControlBounds()

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

◆ SetControlPosition()

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

◆ SetControlSize()

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

◆ SetControlValueAfterPopupMenu()

void IGraphics::SetControlValueAfterPopupMenu ( IPopupMenu pMenu)

◆ SetControlValueAfterTextEdit()

void IGraphics::SetControlValueAfterTextEdit ( const char *  str)

◆ SetDisplayTickFunc()

void IGraphics::SetDisplayTickFunc ( IDisplayTickFunc  func)
inline

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

Parameters

Definition at line 1215 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.

◆ SetFPSDisplayBounds()

void IGraphics::SetFPSDisplayBounds ( const IRECT bounds)
inline

◆ 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 1223 of file IGraphics.h.

Referenced by SetQwertyMidiKeyHandlerFunc().

◆ SetLayoutOnResize()

void IGraphics::SetLayoutOnResize ( bool  layoutOnResize)

◆ SetMouseCursor()

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

◆ 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 
)

◆ SetQwertyMidiKeyHandlerFunc()

void IGraphics::SetQwertyMidiKeyHandlerFunc ( std::function< void(const IMidiMsg &msg)>  func = nullptr)

◆ 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)

◆ SetSharedResourcesSubPath()

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

Sets the name of the shared resources subpath.

Definition at line 1661 of file IGraphics.h.

◆ SetStrictDrawing()

void IGraphics::SetStrictDrawing ( bool  strict)

Enables strict drawing mode.

When enabled, only dirty controls are redrawn. When disabled, all controls are redrawn on each frame.

Parameters
strictSet /c true to enable strict drawing mode

Definition at line 978 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 1619 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 1020 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

Definition at line 1219 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 1193 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 1196 of file IGraphics.h.

◆ ShowBubbleControl()

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

◆ ShowControlBounds()

void IGraphics::ShowControlBounds ( bool  enable)
inline

◆ ShowControlBoundsEnabled()

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

Definition at line 1199 of file IGraphics.h.

◆ ShowFPSDisplay()

void IGraphics::ShowFPSDisplay ( bool  enable)

◆ ShowingFPSDisplay()

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

Definition at line 1363 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 1995 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)

◆ TooltipsEnabled()

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

Definition at line 1154 of file IGraphics.h.

◆ UpdateLayer()

virtual void IGraphics::UpdateLayer ( )
inlineprotectedvirtual

◆ UpdatePeers()

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

◆ Width()

int IGraphics::Width ( ) const
inline

◆ WindowHeight()

int IGraphics::WindowHeight ( ) const
inline

◆ WindowIsOpen()

virtual bool IGraphics::WindowIsOpen ( )
inlinevirtual

◆ WindowWidth()

int IGraphics::WindowWidth ( ) const
inline

◆ ICornerResizerControl

◆ IGraphicsLiveEdit

◆ ITextEntryControl

◆ mClipRECT

IRECT IGraphics::mClipRECT

protected

◆ mCursorHidden

bool IGraphics::mCursorHidden = false

protected

◆ mCursorLock

bool IGraphics::mCursorLock = false

protected

◆ mCursorX

float IGraphics::mCursorX = -1.f

protected

◆ mCursorY

float IGraphics::mCursorY = -1.f

protected

◆ mDelegate

◆ mLayers

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

protected

◆ mTabletInput

bool IGraphics::mTabletInput = false

protected

◆ mTransform

◆ mTransformStates

std::stack<IMatrix> IGraphics::mTransformStates

protected

◆ mXTranslation

float IGraphics::mXTranslation = 0.f

protected

◆ mYTranslation

float IGraphics::mYTranslation = 0.f

protected

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