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 | |
| IGraphics & | operator= (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... | |
| IGEditorDelegate * | GetDelegate () |
| Gets a pointer to the delegate class that handles communication to and from this graphics context. More... | |
| IPopupMenu & | GetPromptMenu () |
| bool | IsInPlatformTextEntry () |
| IControl * | GetControlInTextEntry () |
| 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 > ¶ms, 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 () |
| IControl * | AttachControl (IControl *pControl, int ctrlTag=kNoTag, const char *group="") |
| Attach an IControl to the graphics context and add it to the top of the control stack. More... | |
| IControl * | GetControl (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... | |
| IControl * | GetControlWithTag (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... | |
| IControl * | GetControlWithParamIdx (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... | |
| IControl * | GetBackgroundControl () |
| IPopupMenuControl * | GetPopupMenuControl () |
| ITextEntryControl * | GetTextEntryControl () |
| IBubbleControl * | GetBubbleControl (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... | |
| ILayer * | PopLayer () |
| 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 IPopupMenu * | CreatePlatformPopupMenu (IPopupMenu &menu, const IRECT bounds, bool &isAsync)=0 |
| Calls the platform backend to create the platform popup menu. More... | |
| virtual APIBitmap * | LoadAPIBitmap (const char *fileNameOrResID, int scale, EResourceLocation location, const char *ext)=0 |
| Drawing API method to load a bitmap, called internally. More... | |
| virtual APIBitmap * | LoadAPIBitmap (const char *name, const void *pData, int dataSize, int scale)=0 |
| Drawing API method to load a bitmap from binary data, called internally. More... | |
| virtual APIBitmap * | CreateAPIBitmap (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... | |
| APIBitmap * | SearchBitmapInCache (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 | |
| IGEditorDelegate * | mDelegate |
| 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< IMatrix > | mTransformStates |
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()
|
virtual |
◆ ActivateGLContext()
|
inlineprotectedvirtual |
◆ AlphaChannel()
|
protectedpure virtual |
◆ ApplyLayerDropShadow()
◆ ApplyShadowMask()
|
protectedpure virtual |
Implemented by a graphics backend to apply a calculated shadow mask to a layer, according to the shadow settings specified.
- Parameters
-
layer The layer to apply the shadow to mask The mask of the shadow as raw bitmap data shadow The 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
-
pControl control a control that inherits from ICornerResizerControl sizeMode Choose whether to scale or size the UI
Definition at line 333 of file IGraphics.cpp.
References GetDelegate().
◆ AttachGestureRecognizer()
|
virtual |
◆ AttachGestureRecognizerToRegion()
| void IGraphics::AttachGestureRecognizerToRegion | ( | const IRECT & | bounds, |
| EGestureType | type, | ||
| IGestureFunc | func | ||
| ) |
◆ AttachPanelBackground()
| void IGraphics::AttachPanelBackground | ( | const IPattern & | color | ) |
◆ AttachPlatformView()
|
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
-
text The text style to use for the menu bounds The 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()
|
virtual |
◆ BitmapExtSupported()
|
pure virtual |
◆ CachePlatformFont()
|
pure virtual |
Called to indicate that the platform should cache data about the platform font if needed.
- Parameters
-
fontID A string that is used to reference the font font A const PlatformFontPtr reference to the relevant font
Referenced by LoadFont().
◆ CalculateTextRotation()
|
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
trueif 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()
|
inline |
◆ ClientToScreen()
|
inlinevirtual |
Convert an x, y position in the view to screen coordinates.
- Parameters
-
x the x position to convert y the y position to convert
Definition at line 940 of file IGraphics.h.
◆ ControlIsCaptured() [1/2]
|
inline |
◆ ControlIsCaptured() [2/2]
|
inline |
Check to see if the control is already captured.
- Returns
trueis the control is already captured
Definition at line 1420 of file IGraphics.h.
◆ CreateAPIBitmap()
|
protectedpure virtual |
Creates a new API bitmap, either in memory or as a GPU texture.
- Parameters
-
width The desired width height The desired height scale The scale in relation to 1:1 pixels drawScale The current draw scale for the graphics context cacheable Used 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()
|
protectedpure virtual |
Calls the platform backend to create the platform popup menu.
- Parameters
-
menu The source IPopupMenu bounds The rectangular area in which to create the menu isAsync This 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()
|
protectedpure virtual |
Creates a platform native text entry field.
- Parameters
-
paramIdx The index of the parameter associated with the text entry field. text The IText style for the text entry field text. bounds The rectangle that defines the size and position of the text entry field. length The maximum allowed length of the text in the text entry field. str The 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
-
control A reference to the IControl creating this pop-up menu. If it exists IControl::OnPopupMenuSelection() will be called on successful selection menu Reference to an IPopupMenu class populated with the items for the platform menu bounds The platform menu will popup at the bottom left hand corner of this rectangular region valIdx The 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]
|
inline |
Shows a pop up/contextual menu at point.
- Parameters
-
control A reference to the IControl creating this pop-up menu. If it exists IControl::OnPopupMenuSelection() will be called on successful selection x The X coordinate at which to pop up the menu y The Y coordinate at which to pop up the menu valIdx The 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()
|
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
-
pMenu The menu that an item was deleted in itemIdx The 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()
|
protectedpure virtual |
Internal method to draw text.
- Parameters
-
text The text style to use for drawing str The string to draw bounds The bounding rectangle for the text pBlend Optional blend mode
Implemented in IGraphicsNanoVG, and IGraphicsSkia.
Referenced by DrawText().
◆ DoMeasureText()
|
protectedpure virtual |
Internal method to measure text dimensions.
- Parameters
-
text The text style to use for measurement str The string to measure bounds Output rectangle updated with the measured text bounds
- Returns
- The width of the measured text
Implemented in IGraphicsNanoVG, and IGraphicsSkia.
Referenced by MeasureText().
◆ DoMeasureTextRotation()
|
protected |
◆ DoTextRotation()
|
inline |
◆ Draw()
◆ DrawArc()
|
virtual |
Draw an arc to the graphics context.
- Parameters
-
color The color to draw the shape with cx The X coordinate of the centre of the circle on which the arc lies cy The Y coordinate of the centre of the circle on which the arc lies r The radius of the circle on which the arc lies a1 the start angle of the arc at in degrees clockwise where 0 is up a2 the end angle of the arc at in degrees clockwise where 0 is up pBlend Optional blend method thickness Optional 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]
|
pure virtual |
Draw a bitmap (raster) image to the graphics context.
- Parameters
-
bitmap The bitmap image to draw to the graphics context bounds The rectangular region to draw the image in srcX The X offset in the source image to draw from srcY The Y offset in the source image to draw from pBlend Optional 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
-
bitmap the bitmap containing glyphs to draw bounds where to draw the bitmap text text properties (note - many of these are irrelevant for bitmapped text) pBlend blend operation str the string to draw vCenter centre the text vertically multiline should the text spill onto multiple lines charWidth how wide is a character in the bitmap charHeight how high is a character in the bitmap charOffset what 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()
|
virtual |
Draw a circle to the graphics context.
- Parameters
-
color The color to draw the shape with cx The X coordinate of the centre of the circle cy The Y coordinate of the centre of the circle r The radius of the circle pBlend Optional blend method thickness Optional line thickness
Definition at line 2550 of file IGraphics.cpp.
References PathCircle(), PathClear(), and PathStroke().
Referenced by TestArcControl::Draw().
◆ DrawConvexPolygon()
|
virtual |
Draw a convex polygon to the graphics context.
- Parameters
-
color The color to draw the shape with x Pointer to the first element in an array of X coordinates for the vertices of the polygon y Pointer to the first element in an array of Y coordinates for the vertices of the polygon nPoints The number of points in the coordinate arrays pBlend Optional blend method thickness Optional line thickness
Definition at line 2536 of file IGraphics.cpp.
References PathClear(), PathConvexPolygon(), and PathStroke().
Referenced by TestPolyControl::Draw().
◆ DrawData()
|
virtual |
◆ DrawDottedLine()
|
virtual |
Draw a dotted line to the graphics context.
- Parameters
-
color The color to draw the shape with x1 The X coordinate of the start of the line y1 The Y coordinate of the start of the line x2 The X coordinate of the end of the line y2 The Y coordinate of the end of the line pBlend Optional blend method thickness Optional line thickness
Reimplemented in IGraphicsNanoVG.
Definition at line 2497 of file IGraphics.cpp.
References PathClear(), PathLineTo(), PathMoveTo(), and PathStroke().
◆ DrawDottedRect()
|
virtual |
Draw a dotted rectangle to the graphics context.
- Parameters
-
color The color to draw the shape with bounds The rectangular region to draw the shape in pBlend Optional blend method thickness Optional 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]
|
virtual |
◆ DrawEllipse() [2/2]
|
virtual |
Draw an ellipse around a central point given two radii and an angle of orientation.
- Parameters
-
color The color to draw the shape with x The X coordinate of the centre of the ellipse y The Y coordinate of the centre of the ellipse r1 The radius of the ellipse along the line found by rotating the x-axis by the angle r2 The radius of the ellipse along the line found by rotating the y-axis by the angle angle The angle rotates the radii r1 and r2 clockwise in degrees to adjust the orientation pBlend Optional blend method thickness Optional line thickness
Definition at line 2573 of file IGraphics.cpp.
References PathClear(), PathEllipse(), and PathStroke().
◆ DrawFastDropShadow()
|
inlinevirtual |
◆ DrawFittedBitmap()
|
virtual |
Draw a bitmap (raster) image to the graphics context, scaling the image to fit the bounds.
- Parameters
-
bitmap The bitmap image to draw to the graphics context bounds The rectangular region to draw the image in pBlend Optional 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()
|
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
-
color The color to draw the line with yi The position of the line on the y axis xLo The start of the horizontal line on the x axis xHi The end of the horizontal line on the x axis pBlend Optional blend method thickness Optional line thickness
Definition at line 819 of file IGraphics.cpp.
References DrawLine().
◆ DrawLayer()
Draw a layer to the main IGraphics context.
- Parameters
-
layer The layer to draw pBlend Optional 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()
|
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
-
color The color to draw the line with bounds The rectangular region to draw the line in dir The direction of the line pos The normalized position of the line on the horizontal or vertical axis, within bounds pBlend Optional blend method thickness Optional line thickness
Definition at line 792 of file IGraphics.cpp.
References DrawHorizontalLine(), and DrawVerticalLine().
◆ DrawMultiLineText()
|
inlinevirtual |
Draw some multi-line text to the graphics context in a specific rectangle (NanoVG only)
- Parameters
-
text An IText struct containing font and text properties and layout info str The text string to draw bounds The rectangular region in the graphics where you would like to draw the text pBlend Optional blend method
Reimplemented in IGraphicsNanoVG, and IGraphicsSkia.
Definition at line 363 of file IGraphics.h.
References DrawText().
Referenced by IMultiLineTextControl::Draw().
◆ DrawPoint()
|
virtual |
Fill a rectangle corresponding to a pixel on a 1:1 screen with a color.
- Parameters
-
color The color to fill the point with x The X coordinate at which to draw y The Y coordinate at which to draw pBlend Optional 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
-
color The color to draw the line with cx centre point x coordinate cy centre point y coordinate angle The angle to draw at in degrees clockwise where 0 is up rMin minima of the radial line (distance from cx,cy) rMax maxima of the radial line (distance from cx,cy) pBlend Optional blend method thickness Optional line thickness
Definition at line 824 of file IGraphics.cpp.
References DrawLine().
Referenced by TestArcControl::Draw(), and TestLayerControl::Draw().
◆ DrawRect()
|
virtual |
Draw a rectangle to the graphics context.
- Parameters
-
bounds The rectangular area in which to draw the shape color The color to draw the shape to draw the shape with pBlend Optional blend method thickness Optional 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()
|
virtual |
◆ DrawRotatedLayer()
| void IGraphics::DrawRotatedLayer | ( | const ILayerPtr & | layer, |
| double | angle | ||
| ) |
◆ DrawRotatedSVG()
|
virtual |
◆ DrawRoundRect() [1/2]
|
virtual |
◆ DrawRoundRect() [2/2]
|
virtual |
Draw a rounded rectangle to the graphics context with individual corner roundness.
- Parameters
-
color The color to draw the shape with bounds The rectangular region to draw the shape in cRTL The top left corner radius in pixels cRTR The top right corner radius in pixels cRBR The bottom right corner radius in pixels cRBL The bottom left corner radius in pixels pBlend Optional blend method thickness Optional line thickness
Definition at line 2529 of file IGraphics.cpp.
References PathClear(), PathRoundRect(), and PathStroke().
◆ DrawSVG()
|
virtual |
Draw an SVG image to the graphics context.
- Parameters
-
svg The SVG image to the graphics context bounds The rectangular region to draw the image in pBlend Optional blend method pStrokeColor Optional color to override all SVG stroke commands pFillColor Optional 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
-
text An IText struct containing font and text properties and layout info str The text string to draw bounds The rectangular region in the graphics where you would like to draw the text pBlend Optional 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
-
text An IText struct containing font and text properties and layout info str The text string to draw x The x position in the graphics where you would like to draw the text y The y position in the graphics where you would like to draw the text pBlend Optional blend method
Definition at line 699 of file IGraphics.cpp.
References DrawText().
◆ DrawTriangle()
|
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
-
color The color to draw the line with xi The position of the line on the x axis yLo The start of the vertical line on the y axis yHi The end of the vertical line on the y axis pBlend Optional blend method thickness Optional line thickness
Definition at line 814 of file IGraphics.cpp.
References DrawLine().
◆ EnableLiveEdit()
| void IGraphics::EnableLiveEdit | ( | bool | enable | ) |
◆ EnableMouseOver()
|
inline |
- Parameters
-
enable Set trueif 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()
|
inline |
◆ EnableTooltips()
| void IGraphics::EnableTooltips | ( | bool | enable | ) |
- Parameters
-
enable Set trueto enable tool tips when the user mouses over a control
Definition at line 1543 of file IGraphics.cpp.
◆ 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()
|
virtual |
Fill an arc segment with a color.
- Parameters
-
color The color to fill the shape with cx The X coordinate of the centre of the circle on which the arc lies cy The Y coordinate of the centre of the circle on which the arc lies r The radius of the circle on which the arc lies a1 the start angle of the arc at in degrees clockwise where 0 is up a2 the end angle of the arc at in degrees clockwise where 0 is up pBlend Optional blend method
Definition at line 2615 of file IGraphics.cpp.
References PathArc(), PathClear(), PathClose(), PathFill(), and PathMoveTo().
Referenced by TestArcControl::Draw().
◆ FillCircle()
|
virtual |
◆ FillConvexPolygon()
|
virtual |
Fill a convex polygon with a color.
- Parameters
-
color The color to fill the shape with x Pointer to the first element in an array of X coordinates for the vertices of the polygon y Pointer to the first element in an array of Y coordinates for the vertices of the polygon nPoints The number of points in the coordinate arrays pBlend Optional blend method
Definition at line 2608 of file IGraphics.cpp.
References PathClear(), PathConvexPolygon(), and PathFill().
Referenced by TestPolyControl::Draw().
◆ FillEllipse() [1/2]
|
virtual |
◆ FillEllipse() [2/2]
|
virtual |
Fill an ellipse.
- Parameters
-
color The color to draw the shape with x The X coordinate of the centre of the ellipse y The Y coordinate of the centre of the ellipse r1 The radius of the ellipse along the line found by rotating the x-axis by the angle r2 The radius of the ellipse along the line found by rotating the y-axis by the angle angle The angle rotates the radii r1 and r2 clockwise in degrees to adjust the orientation pBlend Optional blend method
Definition at line 2638 of file IGraphics.cpp.
References PathClear(), PathEllipse(), and PathFill().
◆ FillRect()
|
virtual |
Fill a rectangular region of the graphics context with a color.
- Parameters
-
color The color to fill the shape with bounds The rectangular region to fill the shape in pBlend Optional 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]
|
virtual |
◆ FillRoundRect() [2/2]
|
virtual |
Fill a rounded rectangle with a color.
- Parameters
-
color The color to fill the shape with bounds The rectangular region to fill the shape in cRTL The top left corner radius in pixels cRTR The top right corner radius in pixels cRBR The bottom right corner radius in pixels cRBL The bottom left corner radius in pixels pBlend Optional blend method
Definition at line 2601 of file IGraphics.cpp.
References PathClear(), PathFill(), and PathRoundRect().
◆ FillTriangle()
|
virtual |
Fill a triangle with a color.
- Parameters
-
color The color to fill the shape with x1 The X coordinate of the first vertex y1 The Y coordinate of the first vertex x2 The X coordinate of the second vertex y2 The Y coordinate of the second vertex x3 The X coordinate of the third vertex y3 The Y coordinate of the third vertex pBlend Optional 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()
|
protectedpure virtual |
◆ ForAllControls()
template<typename T , typename... Args>
| void IGraphics::ForAllControls | ( | T | 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
-
params The parameter indexes to match func A 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 | ( | T | method, |
| int | paramIdx, | ||
| Args... | args | ||
| ) |
◆ ForStandardControlsFunc()
| void IGraphics::ForStandardControlsFunc | ( | IControlFunction | func | ) |
◆ FPS()
|
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()
|
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()
|
inline |
◆ GetBackingPixelScale()
|
inlineprotectedvirtual |
◆ GetBounds()
|
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()
|
inlinevirtual |
◆ GetControl()
|
inline |
Get the control at a certain index in the control stack.
- Parameters
-
idx The 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()
|
inline |
Get the index of a particular IControl in the control stack.
- Parameters
-
pControl Pointer 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()
|
inline |
◆ GetControlTag()
|
inline |
Get the tag given to a control.
- Parameters
-
pControl Pointer 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()
|
pure virtual |
◆ GetDrawingAPIStr()
|
pure virtual |
◆ GetDrawScale()
|
inline |
◆ GetIdxOfTaggedControl()
|
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()
|
pure virtual |
◆ GetMouseDownPoint()
|
inline |
◆ GetMouseLocation()
|
pure virtual |
◆ GetMouseOver()
|
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
-
x The X coordinate to check y The 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()
◆ GetPlatformAPIStr()
|
inlinevirtual |
- Returns
- A CString representing the Platform API in use e.g. "macOS"
Definition at line 914 of file IGraphics.h.
◆ GetPlatformContext()
|
inline |
◆ GetPlatformWindowScale()
|
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()
|
pure virtual |
Get the color at an X, Y location in the graphics context.
- Parameters
-
x The X coordinate of the pixel y The 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()
|
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()
|
inline |
- Returns
- true if resizing is in process
Definition at line 1160 of file IGraphics.h.
◆ GetRoundedScreenScale()
|
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
-
inBitmap The 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()
|
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()
|
inline |
◆ GetTextEntryControl()
- Returns
- Pointer to the special text entry control, if one has been attached
Definition at line 1440 of file IGraphics.h.
◆ GetTextFromClipboard()
|
pure virtual |
Get text from the clipboard.
- Parameters
-
str A WDL_String that will be filled with the text that is currently on the clipboard
- Returns
- /c true on success
◆ GetTotalScale()
|
inline |
◆ GetTouches()
|
inline |
◆ GetTransformMatrix()
|
inlineprotected |
◆ GetUIAppearance()
|
inlinevirtual |
Get the UI Appearance (Light/Dark mode)
- Returns
- Light/Dark mode
Definition at line 1598 of file IGraphics.h.
◆ GetWindow()
|
pure virtual |
◆ GetWinModuleHandle()
|
inlinevirtual |
◆ Height()
|
inline |
◆ HideControl()
| void IGraphics::HideControl | ( | int | paramIdx, |
| bool | hide | ||
| ) |
◆ HideMouseCursor()
|
pure virtual |
Call to hide/show the mouse cursor.
- Parameters
-
hide Should the cursor be hidden or shown lock Set trueto 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()
|
inlinevirtual |
◆ InitiateExternalFileDragDrop()
|
inlinevirtual |
Initiate an drag-n-drop operation of an existing file, to be dropped outside of the current window.
- Parameters
-
path A CString that contains a path to a file on disk iconBounds The area where the icon should appear
- Returns
- /c true on success
Definition at line 872 of file IGraphics.h.
◆ IsDirty()
◆ IsInPlatformTextEntry()
|
inline |
◆ LiveEditEnabled()
|
inline |
- Returns
trueif live edit mode is enabled
Definition at line 1206 of file IGraphics.h.
◆ LoadAPIBitmap() [1/2]
|
protectedpure virtual |
Drawing API method to load a bitmap, called internally.
- Parameters
-
fileNameOrResID A CString absolute path or resource ID scale Integer to identify the scale of the resource, for multi-scale bitmaps location Identifies the kind of resource location ext CString for the file extension
- Returns
- APIBitmap* Drawing API bitmap abstraction
Implemented in IGraphicsNanoVG, and IGraphicsSkia.
Referenced by LoadBitmap().
◆ LoadAPIBitmap() [2/2]
|
protectedpure virtual |
Drawing API method to load a bitmap from binary data, called internally.
- Parameters
-
name CString for the name of the resource pData Raw pointer to the binary data dataSize Size of the data in bytes scale Integer to identify the scale of the resource, for multi-scale bitmaps
- Returns
- APIBitmap* Drawing API bitmap abstraction
Implemented in IGraphicsNanoVG, and IGraphicsSkia.
◆ LoadAPIFont()
|
protectedpure virtual |
Drawing API method to load a font from a PlatformFontPtr, called internally.
- Parameters
-
fontID A CString that will be used to reference the font font Valid PlatformFontPtr, loaded via LoadPlatformFont
- Returns
- bool
trueif the font was loaded successfully
Implemented in IGraphicsNanoVG, and IGraphicsSkia.
Referenced by LoadFont().
◆ LoadBitmap() [1/2]
|
virtual |
◆ LoadBitmap() [2/2]
|
virtual |
◆ LoadFont() [1/3]
|
virtual |
◆ LoadFont() [2/3]
| bool IGraphics::LoadFont | ( | const char * | fontID, |
| const char * | fontName, | ||
| ETextStyle | style | ||
| ) |
◆ LoadFont() [3/3]
|
virtual |
Load a font from in-memory data to be used by the graphics context.
- Parameters
-
fontID A CString that will be used to reference the font pData Pointer to the font data in memory dataSize Size (in bytes) of data at pData
- Returns
trueon success
Definition at line 2211 of file IGraphics.cpp.
References CachePlatformFont(), LoadAPIFont(), and LoadPlatformFont().
◆ LoadPlatformFont() [1/3]
|
pure virtual |
Load a font from disk or resource in a platform format.
- Parameters
-
fontID A string that is used to reference the font fileNameOrResID A resource or file name/path
- Returns
- PlatformFontPtr from which the platform font can be retrieved
Referenced by LoadFont().
◆ LoadPlatformFont() [2/3]
|
pure virtual |
Load a system font in a platform format.
- Parameters
-
fontID A string that is used to reference the font fontName A string defining the font name style An ETextStyle defining the font style
- Returns
- PlatformFontPtr from which the platform font can be retrieved
◆ LoadPlatformFont() [3/3]
|
pure virtual |
Load a font from data in memory.
- Parameters
-
fontID A CString that is used to reference the font pData Pointer to font data in memory dataSize Size (in bytes) of data at pData
- Returns
- PlatformFontPtr from which the platform font may be retrieved
◆ LoadResource()
|
virtual |
Load a resource from the file system, the bundle, or a Windows resource, and returns its data.
- Parameters
-
fileNameOrResID CString file name or resource ID fileType Type 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]
|
virtual |
◆ LoadSVG() [2/2]
|
virtual |
Load an SVG image from memory.
- Parameters
-
name CString name to associate with the SVG pData Pointer to the SVG file data dataSize Size (in bytes) of the data at pDataunits The length units used in the SVG (e.g. "px", "pt", "mm") dpi The dots per inch of the SVG file
- Returns
- An ISVG representing the image
Definition at line 1657 of file IGraphics.cpp.
◆ MeasureText()
◆ MouseOverEnabled()
|
inline |
- Returns
trueif the context has mouse overs enabled
Definition at line 1607 of file IGraphics.h.
◆ MoveMouseCursor()
|
pure virtual |
Force move the mouse cursor to a specific position.
- Parameters
-
x New X position in pixels y New Y position in pixels
◆ MultiTouchEnabled()
|
inline |
- Returns
- /c true if multi touch is enabled
Definition at line 1178 of file IGraphics.h.
◆ NBubbleControls()
|
inline |
- Returns
- Number of attached bubble controls
Definition at line 1446 of file IGraphics.h.
◆ NControls()
|
inline |
◆ OnAppearanceChanged()
| void IGraphics::OnAppearanceChanged | ( | EUIAppearance | appearance | ) |
Called by the platform class if the view changes to dark/light mode.
- Parameters
-
appearance Light/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
-
str A CString with the absolute path of the dropped item x The X coordinate where the drag and drop occurred y The 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
-
paths A vector with the absolute paths of the dropped items x The X coordinate where the drag and drop occurred y The 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
-
x The X coordinate at which the mouse event occurred y The Y coordinate at which the mouse event occurred mod IMouseMod struct contain information about the modifiers held delta Scroll amount (positive = up/forward, negative = down/backward)
- Returns
- /c true on handled
Definition at line 1236 of file IGraphics.cpp.
References IControl::OnMouseWheel().
◆ 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()
|
inlinevirtual |
◆ OnViewInitialized()
|
inlinevirtual |
◆ OpenURL()
|
pure virtual |
Open a URL in the platform's default browser.
- Parameters
-
url CString specifying the URL to open msgWindowTitle Title for any confirmation dialog (platform-specific) confirmMsg Confirmation message to display before opening (platform-specific) errMsgOnFailure Error message to display on failure (platform-specific)
- Returns
- /c true on success
Referenced by IURLControl::OnMouseDown().
◆ OpenWindow()
|
pure virtual |
Open a new platform view for this graphics context.
- Parameters
-
pParentWnd Pointer to parent platform window or view handle (HWND on Windows, NSView* on macOS)
- Returns
- Pointer to the newly created IGraphics platform view
◆ PathArc()
|
pure virtual |
◆ PathCircle()
| void IGraphics::PathCircle | ( | float | cx, |
| float | cy, | ||
| float | r | ||
| ) |
◆ 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()
◆ PathClose()
|
pure virtual |
◆ PathConvexPolygon()
| void IGraphics::PathConvexPolygon | ( | float * | x, |
| float * | y, | ||
| int | nPoints | ||
| ) |
Add a convex polygon to the current path.
- Parameters
-
x Pointer to the first element in an array of X coordinates for the vertices of the polygon y Pointer to the first element in an array of Y coordinates for the vertices of the polygon nPoints The 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()
|
pure virtual |
Add a cubic bezier to the current path from the current point to the specified location.
- Parameters
-
c1x Control point 1 X coordinate c1y Control point 1 Y coordinate c2x Control point 2 X coordinate c2y Control point 2 Y coordinate x2 The X coordinate of the end of the line y2 The 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
-
pattern The IPattern to use, for e.g. color or gradient options Optional IFillOptions to specify fill rule and preserve options pBlend Optional 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()
|
inline |
Add a line to the current path.
- Parameters
-
x1 The X coordinate of the start of the line y1 The Y coordinate of the start of the line x2 The X coordinate of the end of the line y2 The Y coordinate of the end of the line
Definition at line 601 of file IGraphics.h.
References PathLineTo(), and PathMoveTo().
Referenced by PathRadialLine().
◆ PathLineTo()
|
pure virtual |
Add a line to the current path from the current point to the specified location.
- Parameters
-
x The X coordinate of the end of the line y The 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()
|
pure virtual |
Move the current point in the current path.
- Parameters
-
x The X coordinate y The 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()
|
pure virtual |
Add a quadratic bezier to the current path from the current point to the specified location.
- Parameters
-
cx Control point X coordinate cy Control point Y coordinate x2 The X coordinate of the end of the line y2 The 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
-
cx centre point x coordinate cy centre point y coordinate angle The angle to draw at in degrees clockwise where 0 is up rMin minima of the radial line (distance from cx,cy) rMax maxima 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
-
bounds The 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
-
bounds The rectangular region to draw the shape in cornerRadius The 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
-
bounds The rectangular region to draw the shape in cRTL The top left corner radius in pixels cRTR The top right corner radius in pixels cRBR The bottom right corner radius in pixels cRBL The 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()
|
inlinevirtual |
◆ PathStroke()
Stroke the current current path.
- Parameters
-
pattern The IPattern to use, for e.g. color or gradient thickness The line thickness options Optional IStrokeOptions to specify dash, join and path preserve options pBlend Optional 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
-
xAngle Angle to skew horizontal in degrees clockwise yAngle Angle 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
-
x1 The X coordinate of the first vertex y1 The Y coordinate of the first vertex x2 The X coordinate of the second vertex y2 The Y coordinate of the second vertex x3 The X coordinate of the third vertex y3 The 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()
|
inlinevirtual |
◆ 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
-
pControl Ptr to the control in the control stack paramIdx The parameter index associated with the control x The X coordinate at which to popup the context menu y The 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
-
controlIdx The index of the control in the control stack paramIdx The parameter index associated with the control x The X coordinate at which to popup the context menu y The 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()
|
pure virtual |
Create a platform color chooser dialog.
NOTE: this method will block the main thread
- Parameters
-
color When a color is chosen the IColor referenced will be updated with the new color str The text to display in the dialog box e.g. "Please choose a color... (Windows only)" IColorPickerHandlerFunc func callback for asynchronous color pickers
- Returns
- /c true if prompt completed successfully
Referenced by IVColorSwatchControl::OnMouseDown().
◆ PromptForDirectory()
|
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
-
dir Non 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. completionHandler an IFileDialogCompletionHandlerFunc that will be called when a file is selected or the dialog is cancelled. Only the path argument will be populated.
◆ PromptForFile()
|
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
-
fileName Non 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. path WDL_String reference where the path will be put on success or empty string on failure/user cancelled action Determines whether this is an file-open dialog or a file-save dialog ext A space separated CString list of file extensions to filter in the dialog (e.g. “.wav .aif” completionHandler an 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()
Prompt for user input either using a text entry or pop up menu.
- Parameters
-
control Reference to the control which the prompt relates to bounds Rectangular region of the graphics context that the prompt (e.g. text entry box) should occupy valIdx The 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()
|
protected |
◆ ReleaseBitmap()
|
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()
|
inlinevirtual |
Remove a previously attached platform view from the IGraphics view.
- Parameters
-
pView the 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
-
w New width in pixels h New height in pixels scale New scale ratio needsPlatformResize Set 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()
|
virtual |
◆ RevealPathInExplorerOrFinder()
|
inlinevirtual |
- Parameters
-
path WDL_String reference where the path will be put on success or empty string on failure select et trueif you want to select the item in Explorer/Finder
- Returns
trueon success (if the path was valid)
Definition at line 919 of file IGraphics.h.
◆ ScaleBitmap()
|
virtual |
Returns a new IBitmap, an integer scaled version of the input, and adds it to the cache.
- Parameters
-
inbitmap The source bitmap to be scaled cacheName The name by which this bitmap is identified int the cache (along with targetScale) targetScale An integer scale factor of the new bitmap
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()
|
protected |
Search the static storage cache for a bitmap image resource matching the target scale.
- Parameters
-
fileName The filename key to search for targetScale The desired scale factor sourceScale Output 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()
|
protected |
Search for a bitmap image resource matching the target scale.
- Parameters
-
fileName The base filename to search for type The file extension (e.g. "png", "jpg") result Output string to receive the found resource path targetScale The desired scale factor to find sourceScale Output 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()
◆ 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()
|
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()
|
inlinevirtual |
Set a file path in the clipboard.
Returns false on unsupported platforms
- Parameters
-
str A CString that contains a path to a file on disk
- Returns
- /c true on success
Definition at line 866 of file IGraphics.h.
◆ SetFPSDisplayBounds()
|
inline |
◆ SetKeyHandlerFunc()
|
inline |
Set a function that is called when key presses are not intercepted by any controls.
- Parameters
-
keyHandlerFunc A std::function conforming to IKeyHandlerFunc
Definition at line 1223 of file IGraphics.h.
Referenced by SetQwertyMidiKeyHandlerFunc().
◆ SetLayoutOnResize()
| void IGraphics::SetLayoutOnResize | ( | bool | layoutOnResize | ) |
◆ SetMouseCursor()
|
inlinevirtual |
◆ SetPlatformContext()
|
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
-
pContext void 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
-
lo The minimum scalar that the IGraphics context can be scaled down to hi The 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()
|
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
-
strict Set /c true to enable strict drawing mode
Definition at line 978 of file IGraphics.cpp.
References SetAllControlsDirty().
◆ SetTabletInput()
|
inline |
Set by the platform class if the mouse input is coming from a tablet/stylus.
- Parameters
-
tablet truemeans input is from a tablet
Definition at line 1619 of file IGraphics.h.
◆ SetTextInClipboard()
|
pure virtual |
Set text in the clipboard.
- Parameters
-
str A CString that will be used to set the current text in the clipboard
- Returns
- /c true on success
◆ SetTranslation()
|
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()
|
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()
|
inlinevirtual |
Used on Windows to set the HINSTANCE module handle, which allows graphics APIs to load resources from the binary.
- Parameters
-
pHinstance void pointer to the platform instance
Definition at line 923 of file IGraphics.h.
◆ ShowAreaDrawn()
|
inline |
- Parameters
-
enable Set trueif 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()
|
inline |
- Returns
trueif 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()
|
inline |
◆ ShowControlBoundsEnabled()
|
inline |
- Returns
trueif showning the control bounds
Definition at line 1199 of file IGraphics.h.
◆ ShowFPSDisplay()
| void IGraphics::ShowFPSDisplay | ( | bool | enable | ) |
◆ ShowingFPSDisplay()
|
inline |
- Returns
trueif performance display is shown
Definition at line 1363 of file IGraphics.h.
◆ ShowMessageBox()
|
pure virtual |
Pop up a modal platform message box dialog.
- Parameters
-
str The text message to display in the dialog title The title of the message box window type EMsgBoxType describing the button options available
- See also
- EMsgBoxType
- Parameters
-
completionHanlder an IMsgBoxCompletionHandlerFunc that will be called when a button is pressed
- Returns
- EMsgBoxResult signifying which button was pressed
◆ StartLayer()
Create an IGraphics layer.
Switches drawing to an offscreen bitmap for drawing IControl* pOwner The control that owns the layer
- Parameters
-
r The bounds of the layer within the IGraphics context cacheable Used 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()
|
inline |
- Returns
trueif tool tips are enabled
Definition at line 1154 of file IGraphics.h.
◆ UpdateLayer()
|
inlineprotectedvirtual |
◆ UpdatePeers()
| void IGraphics::UpdatePeers | ( | IControl * | pCaller, |
| int | callerValIdx | ||
| ) |
◆ Width()
|
inline |
◆ WindowHeight()
|
inline |
◆ WindowIsOpen()
|
inlinevirtual |
◆ WindowWidth()
|
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: