iPlug2 - C++ Audio Plug-in Framework
|
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... | |
void | ApplyLayerDropShadow (ILayerPtr &layer, const IShadow &shadow) |
Applies a drop shadow directly onto a layer. More... | |
virtual void | GetLayerBitmapData (const ILayerPtr &layer, RawBitmapData &data)=0 |
Get the contents of a layer as Raw RGBA bitmap data NOTE: you should only call this within IControl::Draw() More... | |
virtual void | PathClear ()=0 |
Clear the stack of path drawing commands. More... | |
virtual void | PathClose ()=0 |
Close the path that is being specified. More... | |
void | PathLine (float x1, float y1, float x2, float y2) |
Add a line to the current path. More... | |
void | PathRadialLine (float cx, float cy, float angle, float rMin, float rMax) |
Add a radial line to the current path. More... | |
void | PathTriangle (float x1, float y1, float x2, float y2, float x3, float y3) |
Add a triangle to the current path. More... | |
void | PathRect (const IRECT &bounds) |
Add a rectangle to the current path. More... | |
void | PathRoundRect (const IRECT &bounds, float ctl, float ctr, float cbl, float cbr) |
Add a rounded rectangle to the current path, with independent corner roundness. More... | |
void | PathRoundRect (const IRECT &bounds, float cornerRadius=5.f) |
Add a rounded rectangle to the current path. More... | |
virtual void | PathArc (float cx, float cy, float r, float a1, float a2, EWinding winding=EWinding::CW)=0 |
Add an arc to the current path. More... | |
void | PathCircle (float cx, float cy, float r) |
Add a circle to the current path. More... | |
void | PathEllipse (const IRECT &bounds) |
Add an ellipse to the current path, specifying the rectangular region. More... | |
void | PathEllipse (float x, float y, float r1, float r2, float angle=0.0) |
Add an ellipse to the current path. More... | |
void | PathConvexPolygon (float *x, float *y, int nPoints) |
Add a convex polygon to the current path. More... | |
virtual void | PathMoveTo (float x, float y)=0 |
Move the current point in the current path. More... | |
virtual void | PathLineTo (float x, float y)=0 |
Add a line to the current path from the current point to the specified location. More... | |
virtual void | PathSetWinding (bool clockwise) |
NanoVG only. More... | |
virtual void | PathCubicBezierTo (float c1x, float c1y, float c2x, float c2y, float x2, float y2)=0 |
Add a cubic bezier to the current path from the current point to the specified location. More... | |
virtual void | PathQuadraticBezierTo (float cx, float cy, float x2, float y2)=0 |
Add a quadratic bezier to the current path from the current point to the specified location. More... | |
virtual void | PathStroke (const IPattern &pattern, float thickness, const IStrokeOptions &options=IStrokeOptions(), const IBlend *pBlend=0)=0 |
Stroke the current current path. More... | |
virtual void | PathFill (const IPattern &pattern, const IFillOptions &options=IFillOptions(), const IBlend *pBlend=0)=0 |
Fill the current current path. More... | |
void | PathTransformSave () |
Save the current affine transform of the current path. More... | |
void | PathTransformRestore () |
Restore the affine transform of the current path, to the previously saved state. More... | |
void | PathTransformReset (bool clearStates=false) |
Reset the affine transform of the current path, to the default state. More... | |
void | PathTransformTranslate (float x, float y) |
Apply a translation transform to the current path. More... | |
void | PathTransformScale (float x, float y) |
Apply a scale transform to the current path, with independant x, y scales. More... | |
void | PathTransformScale (float scale) |
Apply a scale transform to the current path, with independant x, y scales. More... | |
void | PathTransformRotate (float angle) |
Apply a rotation transform to the current path. More... | |
void | PathTransformSkew (float xAngle, float yAngle) |
Apply a skew transform to the current path. More... | |
void | PathTransformMatrix (const IMatrix &matrix) |
Apply an arbitary affine transform matrix to the current path. More... | |
void | PathClipRegion (const IRECT r=IRECT()) |
Clip the current path to a particular region. More... | |
virtual void | PathTransformSetMatrix (const IMatrix &matrix)=0 |
void | DoTextRotation (const IText &text, const IRECT &bounds, const IRECT &rect) |
virtual void | AttachPlatformView (const IRECT &r, void *pView) |
Add an OS view as a sub-view, on top of the IGraphics view. More... | |
virtual void | RemovePlatformView (void *pView) |
Remove a previously attached platform view from the IGraphics view. More... | |
virtual void | HidePlatformView (void *pView, bool hide) |
Hide a previously attached platform view from the IGraphics view. More... | |
virtual void | GetMouseLocation (float &x, float &y) const =0 |
Get the x, y position of the mouse cursor. More... | |
virtual void | HideMouseCursor (bool hide=true, bool lock=true)=0 |
Call to hide/show the mouse cursor. More... | |
virtual void | MoveMouseCursor (float x, float y)=0 |
Force move the mouse cursor to a specific position. More... | |
virtual ECursor | SetMouseCursor (ECursor cursorType=ECursor::ARROW) |
Sets the mouse cursor to one of ECursor (implementations should return the result of the base implementation) More... | |
virtual void | ForceEndUserEdit ()=0 |
Call to force end text entry (will cancel any half input text. More... | |
virtual void * | OpenWindow (void *pParentWnd)=0 |
Open a new platform view for this graphics context. More... | |
virtual void | CloseWindow ()=0 |
Close the platform view for this graphics context. | |
virtual void * | GetWindow ()=0 |
Get a pointer to the platform view e.g. More... | |
virtual bool | WindowIsOpen () |
virtual bool | GetTextFromClipboard (WDL_String &str)=0 |
Get text from the clipboard. More... | |
virtual bool | SetTextInClipboard (const char *str)=0 |
Set text in the clipboard. More... | |
virtual bool | SetFilePathInClipboard (const char *path) |
Set a file path in the clipboard. More... | |
virtual bool | InitiateExternalFileDragDrop (const char *path, const IRECT &iconBounds) |
Initiate an drag-n-drop operation of an existing file, to be dropped outside of the current window. More... | |
virtual void | UpdateTooltips ()=0 |
Call this if you modify control tool tips at runtime. More... | |
virtual EMsgBoxResult | ShowMessageBox (const char *str, const char *title, EMsgBoxType type, IMsgBoxCompletionHandlerFunc completionHandler=nullptr)=0 |
Pop up a modal platform message box dialog. More... | |
virtual void | PromptForFile (WDL_String &fileName, WDL_String &path, EFileAction action=EFileAction::Open, const char *ext="", IFileDialogCompletionHandlerFunc completionHandler=nullptr)=0 |
Create a platform file prompt dialog to choose a path for opening/saving a single file. More... | |
virtual void | PromptForDirectory (WDL_String &dir, IFileDialogCompletionHandlerFunc completionHandler=nullptr)=0 |
Create a platform file prompt dialog to choose a directory path for opening/saving a directory. More... | |
virtual bool | PromptForColor (IColor &color, const char *str="", IColorPickerHandlerFunc func=nullptr)=0 |
Create a platform color chooser dialog. More... | |
virtual bool | OpenURL (const char *url, const char *msgWindowTitle=0, const char *confirmMsg=0, const char *errMsgOnFailure=0)=0 |
Open a URL in the platform’s default browser. More... | |
virtual const char * | GetPlatformAPIStr () |
virtual bool | RevealPathInExplorerOrFinder (WDL_String &path, bool select=false) |
virtual void | SetWinModuleHandle (void *pHinstance) |
Used on Windows to set the HINSTANCE module handle, which allows graphics APIs to load resources from the binary. More... | |
virtual void * | GetWinModuleHandle () |
void | SetPlatformContext (void *pContext) |
Set the platform draw context Used in order to set the platform level draw context - CGContextRef context on macOS and the GDI HDC draw context handle on Windows. More... | |
void * | GetPlatformContext () |
Get the platform level draw context - an HDC or CGContextRef. More... | |
virtual void | ClientToScreen (float &x, float &y) |
Convert an x, y position in the view to screen coordinates. More... | |
virtual PlatformFontPtr | LoadPlatformFont (const char *fontID, const char *fileNameOrResID)=0 |
Load a font from disk or resource in a platform format. More... | |
virtual PlatformFontPtr | LoadPlatformFont (const char *fontID, void *pData, int dataSize)=0 |
Load a font from data in memory. More... | |
virtual PlatformFontPtr | LoadPlatformFont (const char *fontID, const char *fontName, ETextStyle style)=0 |
Load a system font in a platform format. More... | |
virtual void | CachePlatformFont (const char *fontID, const PlatformFontPtr &font)=0 |
Called to indicate that the platform should cache data about the platform font if needed. More... | |
virtual const char * | GetBundleID () const |
Get the bundle ID on macOS and iOS, returns emtpy string on other OSs. More... | |
virtual const char * | GetAppGroupID () const |
Get the app group ID on macOS and iOS, returns emtpy string on other OSs. More... | |
IGraphics (IGEditorDelegate &dlg, int w, int h, int fps=DEFAULT_FPS, float scale=1.) | |
IGraphics (const IGraphics &)=delete | |
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) |
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 | 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 bool | AssetsLoaded () |
Specialized in IGraphicsCanvas drawing backend. More... | |
virtual int | AlphaChannel () const =0 |
virtual bool | FlippedBitmap () const =0 |
EResourceLocation | SearchImageResource (const char *fileName, const char *type, WDL_String &result, int targetScale, int &sourceScale) |
Search for a bitmap image resource matching the target scale. More... | |
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 |
virtual void | DoDrawText (const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=nullptr)=0 |
void | DoMeasureTextRotation (const IText &text, const IRECT &bounds, IRECT &rect) const |
void | CalculateTextRotation (const IText &text, const IRECT &bounds, IRECT &rect, double &tx, double &ty) const |
virtual float | GetBackingPixelScale () const |
IMatrix | GetTransformMatrix () const |
Protected Attributes | |
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. |
||
) |
Definition at line 46 of file IGraphics.cpp.
|
virtual |
Definition at line 61 of file IGraphics.cpp.
|
inlineprotectedvirtual |
Definition at line 975 of file IGraphics.h.
|
protectedpure virtual |
Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by ApplyLayerDropShadow().
Applies a drop shadow directly onto a layer.
layer | - the layer to add the shadow to |
shadow | - the shadow to add |
Definition at line 2086 of file IGraphics.cpp.
References AlphaChannel(), ApplyShadowMask(), FlippedBitmap(), and GetLayerBitmapData().
Referenced by TestDropShadowControl::Draw(), GFXLabelControl::Draw(), and TestShadowGradientControl::Draw().
|
protectedpure virtual |
Implemented by a graphics backend to apply a calculated shadow mask to a layer, according to the shadow settings specified.
layer | The layer to apply the shadow to |
mask | The mask of the shadow as raw bitmap data |
shadow | The shadow specification |
Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by ApplyLayerDropShadow().
|
inlineprotectedvirtual |
Specialized in IGraphicsCanvas drawing backend.
Reimplemented in IGraphicsCanvas.
Definition at line 1731 of file IGraphics.h.
void IGraphics::AssignParamNameToolTips | ( | ) |
Call this method in order to create tool tips for every IControl that show the associated parameter's name.
Definition at line 600 of file IGraphics.cpp.
References ForStandardControlsFunc().
void IGraphics::AttachBackground | ( | const char * | fileName | ) |
Attach an IBitmapControl as the lowest IControl in the control stack to be the background for the graphics context.
fileName | CString fileName resource id for the bitmap image |
Definition at line 288 of file IGraphics.cpp.
References GetDelegate(), LoadBitmap(), and IControl::SetDelegate().
void IGraphics::AttachBubbleControl | ( | const IText & | text = DEFAULT_TEXT | ) |
Attach the default control to show text as a control changes.
Definition at line 352 of file IGraphics.cpp.
References AttachBubbleControl().
Referenced by AttachBubbleControl().
void IGraphics::AttachBubbleControl | ( | IBubbleControl * | pControl | ) |
Attach a custom control to show text as a control changes.
Definition at line 358 of file IGraphics.cpp.
References GetDelegate(), and IControl::SetDelegate().
IControl * IGraphics::AttachControl | ( | IControl * | pControl, |
int | ctrlTag = kNoTag , |
||
const char * | group = "" |
||
) |
Attach an IControl to the graphics context and add it to the top of the control stack.
The control is owned by the graphics context and will be deleted when the context is deleted.
pControl | A pointer to an IControl to attach. |
ctrlTag | An integer tag that you can use to identify the control |
group | A CString that you can use to address controlled by group |
Definition at line 309 of file IGraphics.cpp.
References GetDelegate(), IControl::OnAttached(), IControl::SetDelegate(), and IControl::SetGroup().
Referenced by IGraphicsLiveEdit::OnMouseDown(), and IGraphicsLiveEdit::OnPopupMenuSelection().
void IGraphics::AttachCornerResizer | ( | EUIResizerMode | sizeMode = EUIResizerMode::Scale , |
bool | layoutOnResize = false , |
||
const IColor & | color = COLOR_TRANSLUCENT , |
||
const IColor & | mouseOverColor = COLOR_BLACK , |
||
const IColor & | dragColor = COLOR_BLACK , |
||
float | size = 20.f |
||
) |
Attach the default control to scale or increase the UI size by dragging the plug-in bottom right-hand corner.
sizeMode | Choose whether to scale or size the UI |
Definition at line 328 of file IGraphics.cpp.
References AttachCornerResizer(), and GetBounds().
Referenced by AttachCornerResizer().
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.
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().
|
virtual |
Registers a gesture recognizer with the graphics context.
type | The type of gesture recognizer |
Definition at line 2389 of file IGraphics.cpp.
Referenced by IControl::AttachGestureRecognizer(), and AttachGestureRecognizerToRegion().
void IGraphics::AttachGestureRecognizerToRegion | ( | const IRECT & | bounds, |
EGestureType | type, | ||
IGestureFunc | func | ||
) |
Attach a gesture recognizer to a rectangular region of the GUI, i.e.
not linked to an IControl
bounds | The area that should recognize the gesture |
type | The type of gesture to recognize |
func | The function to call when the gesture is recognized |
Definition at line 2397 of file IGraphics.cpp.
References IRECTList::Add(), AttachGestureRecognizer(), and IRECTList::Size().
void IGraphics::AttachPanelBackground | ( | const IPattern & | color | ) |
Attach an IPanelControl as the lowest IControl in the control stack to fill the background with a solid color.
color | The color to fill the panel with |
Definition at line 302 of file IGraphics.cpp.
References GetBounds(), GetDelegate(), and IControl::SetDelegate().
|
inlinevirtual |
Add an OS view as a sub-view, on top of the IGraphics view.
r | The bounds where the view should be attached |
pView | the platform view, which would be a HWND on Windows, NSView* on macOS or UIView* on iOS |
Definition at line 799 of file IGraphics.h.
Referenced by IPlatformViewControl::OnAttached(), and IWebViewControl::OnAttached().
void IGraphics::AttachPopupMenuControl | ( | const IText & | text = DEFAULT_TEXT , |
const IRECT & | bounds = IRECT() |
||
) |
Attach a control for pop-up menus, to override platform style menus.
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().
void IGraphics::AttachSVGBackground | ( | const char * | fileName | ) |
Attach an ISVGControl as the lowest IControl in the control stack to be the background for the graphics context.
fileName | CString fileName resource id for the SVG image |
Definition at line 295 of file IGraphics.cpp.
References GetBounds(), GetDelegate(), LoadSVG(), and IControl::SetDelegate().
void IGraphics::AttachTextEntryControl | ( | ) |
Attach a control for text entry, to override platform text entry.
Definition at line 378 of file IGraphics.cpp.
References GetDelegate().
|
virtual |
Called at the beginning of drawing.
Call base implementation if overridden.
Reimplemented in IGraphicsNanoVG, and IGraphicsSkia.
Definition at line 875 of file IGraphics.cpp.
Referenced by IGraphicsNanoVG::BeginFrame(), IGraphicsSkia::BeginFrame(), and Draw().
|
pure virtual |
Checks a file extension and reports whether this drawing API supports loading that extension.
Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by LoadBitmap().
|
pure virtual |
Called to indicate that the platform should cache data about the platform font if needed.
fontID | A string that is used to reference the font |
font | A const PlatformFontPtr reference to the relevant font |
Referenced by LoadFont().
|
protected |
text |
bounds |
rect |
tx |
ty |
Definition at line 2246 of file IGraphics.cpp.
References IRECT::MH(), IRECT::MW(), IMatrix::Rotate(), IMatrix::TransformPoint(), and IRECT::Union().
Referenced by DoMeasureTextRotation().
bool IGraphics::CheckLayer | ( | const ILayerPtr & | layer | ) |
Test to see if a layer needs drawing, for instance if the control's bounds were changed.
layer | The layer to check |
true
if the layer needs to be updated Definition at line 2043 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().
void IGraphics::ClearGestureRegions | ( | ) |
Remove all gesture recognizers linked to regions.
Definition at line 2404 of file IGraphics.cpp.
References IRECTList::Clear().
|
inline |
Called when the text entry is dismissed, to reset mInTextEntry.
Definition at line 1139 of file IGraphics.h.
Referenced by RemoveControl(), RemoveControls(), and SetControlValueAfterTextEdit().
|
inlinevirtual |
Convert an x, y position in the view to screen coordinates.
x | the x position to convert |
y | the y position to convert |
Definition at line 940 of file IGraphics.h.
|
inline |
Check to see if any control is captured.
Definition at line 1400 of file IGraphics.h.
Referenced by IBubbleControl::IBubbleControl(), OnMouseDrag(), OnMouseUp(), OnTouchCancelled(), RemoveControl(), and RemoveControls().
|
inline |
Check to see if the control is already captured.
true
is the control is already captured Definition at line 1404 of file IGraphics.h.
|
protectedpure virtual |
Creates a new API bitmap, either in memory or as a GPU texture.
width | The desired width |
height | The desired height |
scale | The scale in relation to 1:1 pixels |
drawScale |
cacheable | Used to make sure the underlying bitmap can be shared between plug-in instances |
Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by StartLayer().
|
protectedpure virtual |
Calls the platform backend to create the platform popup menu.
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 |
|
protectedpure virtual |
Creates a platform native text entry field.
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().
void IGraphics::CreatePopupMenu | ( | IControl & | control, |
IPopupMenu & | menu, | ||
const IRECT & | bounds, | ||
int | valIdx = 0 |
||
) |
Shows a pop up/contextual menu in relation to a rectangular region of the graphics context.
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 1971 of file IGraphics.cpp.
Referenced by CreatePopupMenu(), ITextEntryControl::OnMouseDown(), IWheelControl::OnMouseDown(), IVSpectrumAnalyzerControl< MAXNC, MAX_FFT_SIZE >::OnMouseDown(), TestDirBrowseControl::OnMouseDown(), TestFlexBoxControl::OnMouseDown(), IGraphicsLiveEdit::OnMouseDown(), and PromptUserInput().
|
inline |
Shows a pop up/contextual menu at point.
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 1038 of file IGraphics.h.
References CreatePopupMenu().
void IGraphics::CreateTextEntry | ( | IControl & | control, |
const IText & | text, | ||
const IRECT & | bounds, | ||
const char * | str = "" , |
||
int | valIdx = 0 |
||
) |
Create a text entry box.
control | The control that the text entry belongs to. If this control is linked to a parameter, the text entry will be configured with initial text matching the parameter value |
text | An IText struct to set the formatting of the text entry box |
bounds | The rectangular region that the text entry will occupy. |
str | A CString to specify the default text to display when the text entry box is opened (unless the control specified by the first argument is linked to a parameter) |
valIdx | The value index for the control value that the text entry relates to |
Definition at line 1934 of file IGraphics.cpp.
References CreatePlatformTextEntry(), IControl::GetParamIdx(), IControl::GetTextEntryLength(), and IControl::SetDirty().
Referenced by IVNumberBoxControl::OnMouseDblClick(), TestTextControl::OnMouseDblClick(), PlaceHolder::OnMouseDblClick(), IEditableTextControl::OnMouseDown(), and PromptUserInput().
|
inlineprotectedvirtual |
Definition at line 978 of file IGraphics.h.
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.
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().
void IGraphics::DisableControl | ( | int | paramIdx, |
bool | diable | ||
) |
Disable or enable controls linked to a specific parameter.
paramIdx | The parameter index |
disable | /c true to disable |
Definition at line 491 of file IGraphics.cpp.
References ForMatchingControls(), and IControl::SetDisabled().
|
protectedpure virtual |
text |
str |
bounds |
pBlend |
Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by DrawText().
|
protectedpure virtual |
text |
str |
bounds |
Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by MeasureText().
|
protected |
text |
bounds |
rect |
Definition at line 2238 of file IGraphics.cpp.
References CalculateTextRotation(), and IRECT::Translate().
Referenced by IGraphicsCanvas::DoMeasureText(), IGraphicsNanoVG::DoMeasureText(), and IGraphicsSkia::DoMeasureText().
|
inline |
Definition at line 759 of file IGraphics.h.
void IGraphics::Draw | ( | IRECTList & | rects | ) |
Called by the platform class indicating a number of rectangles in the UI that need to redraw.
rects | A set of rectangular regions to draw |
Definition at line 946 of file IGraphics.cpp.
References BeginFrame(), IRECTList::Bounds(), Draw(), EndFrame(), IRECTList::Get(), GetBackingPixelScale(), IRECTList::Optimize(), IRECT::PixelAlign(), IRECTList::PixelAlign(), and IRECTList::Size().
Referenced by Draw().
|
virtual |
Draw an arc to the graphics context.
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 2536 of file IGraphics.cpp.
References PathArc(), PathClear(), and PathStroke().
Referenced by TestArcControl::Draw().
void IGraphics::DrawBitmap | ( | const IBitmap & | bitmap, |
const IRECT & | bounds, | ||
int | frame = 1 , |
||
const IBlend * | pBlend = 0 |
||
) |
Draws a bitmap into the graphics context.
NOTE: this helper method handles multi-frame bitmaps, indexable via frame
bitmap | - the bitmap to draw |
bounds | - where to draw the bitmap |
frame | - the frame index of the bitmap to draw (when bitmap is multi-frame) |
pBlend | - blend operation |
Definition at line 700 of file IGraphics.cpp.
References Clip(), DrawBitmap(), IBitmap::GetFramesAreHorizontal(), IBitmap::H(), IBitmap::N(), and IBitmap::W().
|
pure virtual |
Draw a bitmap (raster) image to the graphics context.
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 IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by IBSliderControl::Draw(), IWheelControl::Draw(), DrawBitmap(), IBitmapBase::DrawBitmap(), DrawBitmapedText(), DrawFittedBitmap(), DrawFittedLayer(), DrawLayer(), DrawRotatedBitmap(), and ScaleBitmap().
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.
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 722 of file IGraphics.cpp.
References DrawBitmap(), IRECT::H(), and IRECT::W().
Referenced by IBTextControl::Draw().
|
virtual |
Draw a circle to the graphics context.
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 2543 of file IGraphics.cpp.
References PathCircle(), PathClear(), and PathStroke().
Referenced by TestArcControl::Draw().
|
virtual |
Draw a convex polygon to the graphics context.
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 2529 of file IGraphics.cpp.
References PathClear(), PathConvexPolygon(), and PathStroke().
Referenced by TestPolyControl::Draw().
|
virtual |
Draw a line between a collection of normalized points.
color | The color to draw the line with |
bounds | The rectangular region to draw the line in |
normYPoints | Ptr to float array - the normalized Y positions of the points |
nPoints | The number of points in the normYPoints / normXPoints |
normXPoints | Optional normailzed X positions of the points |
pBlend | Optional blend method |
thickness | Optional line thickness |
pFillColor | Optional color for the fill area |
Definition at line 2461 of file IGraphics.cpp.
References IRECT::H(), PathClear(), PathFill(), PathLineTo(), PathMoveTo(), PathStroke(), and IRECT::W().
Referenced by IVPlotControl::Draw(), and IVScopeControl< MAXNC, MAXBUF >::DrawWidget().
|
virtual |
Draw a dotted line to the graphics context.
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 2490 of file IGraphics.cpp.
References PathClear(), PathLineTo(), PathMoveTo(), and PathStroke().
|
virtual |
Draw a dotted rectangle to the graphics context.
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 2550 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().
|
virtual |
Draw an ellipse within a rectangular region of the graphics context.
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 |
Definition at line 2559 of file IGraphics.cpp.
References PathClear(), PathEllipse(), and PathStroke().
Referenced by ILEDControl::Draw(), TestMTControl::Draw(), and IVectorBase::DrawPressableEllipse().
|
virtual |
Draw an ellipse around a central point given two radii and an angle of orientation.
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 2566 of file IGraphics.cpp.
References PathClear(), PathEllipse(), and PathStroke().
|
inlinevirtual |
NanoVG only.
Reimplemented in IGraphicsSkia, and IGraphicsNanoVG.
Definition at line 404 of file IGraphics.h.
Referenced by IPopupMenuControl::DrawPanelShadow().
|
virtual |
Draw a bitmap (raster) image to the graphics context, scaling the image to fit the bounds.
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 2785 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().
void IGraphics::DrawFittedLayer | ( | const ILayerPtr & | layer, |
const IRECT & | bounds, | ||
const IBlend * | pBlend | ||
) |
Draw a layer to the main IGraphics context, fitting it to a rectangle that is different to the layer's bounds.
layer | The layer to draw |
bounds | The bounds in which to draw the layer |
pBlend | Optional blend method |
Definition at line 2064 of file IGraphics.cpp.
References DrawBitmap(), IRECT::H(), PathTransformRestore(), PathTransformSave(), PathTransformScale(), PathTransformTranslate(), and IRECT::W().
|
virtual |
Draw a grid to the graphics context.
color | The color to draw the grid lines with |
bounds | The rectangular region to fill the grid in |
gridSizeH | The width of the grid cells |
gridSizeV | The height of the grid cells |
pBlend | Optional blend method |
thickness | Optional line thickness |
Definition at line 2435 of file IGraphics.cpp.
References PathClear(), PathLineTo(), PathMoveTo(), and PathStroke().
Referenced by IVPlotControl::Draw(), IWheelControl::Draw(), and IGraphicsLiveEdit::Draw().
void IGraphics::DrawHorizontalLine | ( | const IColor & | color, |
const IRECT & | bounds, | ||
float | y, | ||
const IBlend * | pBlend = 0 , |
||
float | thickness = 1.f |
||
) |
Draw a horizontal line, within a rectangular region of the graphics context.
color | The color to draw the line with |
bounds | The rectangular region to draw the line in |
y | The normalized position of the line on the vertical axis, within bounds |
pBlend | Optional blend method |
thickness | Optional line thickness |
Definition at line 802 of file IGraphics.cpp.
References Clip(), and DrawHorizontalLine().
Referenced by IVTrackControlBase::DrawBackground(), DrawHorizontalLine(), DrawLineAcross(), and IVScopeControl< MAXNC, MAXBUF >::DrawWidget().
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.
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 814 of file IGraphics.cpp.
References DrawLine().
Draw a layer to the main IGraphics context.
layer | The layer to draw |
pBlend | Optional blend method |
Definition at line 2056 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().
|
virtual |
Draw a line to the graphics context.
color | The color to draw the line 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 |
Definition at line 2427 of file IGraphics.cpp.
References PathClear(), PathLineTo(), PathMoveTo(), and PathStroke().
Referenced by IVKeyboardControl::Draw(), TestSizeControl::Draw(), IURLControl::Draw(), PlaceHolder::Draw(), DrawHorizontalLine(), DrawRadialLine(), and DrawVerticalLine().
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.
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 787 of file IGraphics.cpp.
References DrawHorizontalLine(), and DrawVerticalLine().
|
inlinevirtual |
Draw some multi-line text to the graphics context in a specific rectangle (NanoVG only)
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().
|
virtual |
Fill a rectangle corresponding to a pixel on a 1:1 screen with a color.
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 2422 of file IGraphics.cpp.
References FillRect().
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.
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 819 of file IGraphics.cpp.
References DrawLine().
Referenced by TestArcControl::Draw(), and TestLayerControl::Draw().
|
virtual |
Draw a rectangle to the graphics context.
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 2508 of file IGraphics.cpp.
References PathClear(), PathRect(), and PathStroke().
Referenced by IVLabelControl::Draw(), IVXYPadControl::Draw(), IVPlotControl::Draw(), IFPSDisplayControl::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().
|
virtual |
Draw a bitmap (raster) image to the graphics context with rotation.
bitmap | The bitmap image to draw to the graphics context |
destCentreX | The X of the centre point at which to rotate the image around |
destCentreY | The Y of the centre point at which to rotate the image around |
angle | The angle of rotation in degrees clockwise |
pBlend | Optional blend method |
Definition at line 2410 of file IGraphics.cpp.
References DrawBitmap(), IBitmap::GetDrawScale(), IBitmap::H(), PathTransformRestore(), PathTransformRotate(), PathTransformSave(), PathTransformTranslate(), and IBitmap::W().
Referenced by IBKnobRotaterControl::Draw(), and DrawRotatedLayer().
void IGraphics::DrawRotatedLayer | ( | const ILayerPtr & | layer, |
double | angle | ||
) |
Draw a layer to the main IGraphics context, with rotation.
layer | The layer to draw |
angle | The angle of rotation in degrees clockwise |
Definition at line 2076 of file IGraphics.cpp.
References DrawRotatedBitmap(), IRECT::MH(), IRECT::MW(), PathTransformReset(), PathTransformRestore(), and PathTransformSave().
|
virtual |
Draw an SVG image to the graphics context with rotation.
svg | The SVG image to draw to the graphics context |
destCentreX | The X coordinate of the centre point at which to rotate the image around |
destCentreY | The Y coordinate of the centre point at which to rotate the image around |
width | The width of the drawn SVG |
height | The heigh of the drawn SVG |
angle | The angle to rotate the SVG mask at in degrees clockwise |
pBlend | Optional blend method |
Definition at line 2808 of file IGraphics.cpp.
References DrawSVG(), PathTransformRestore(), PathTransformRotate(), PathTransformSave(), and PathTransformTranslate().
Referenced by ISVGKnobControl::Draw().
|
virtual |
Draw a rounded rectangle to the graphics context.
color | The color to draw the shape with |
bounds | The rectangular region to draw the shape in |
cornerRadius | The corner radius in pixels |
pBlend | Optional blend method |
thickness | Optional line thickness |
Definition at line 2515 of file IGraphics.cpp.
References PathClear(), PathRoundRect(), and PathStroke().
Referenced by IVTabbedPagesControl::Draw(), TestPolyControl::Draw(), and IVectorBase::DrawPressableRectangle().
|
virtual |
Draw a rounded rectangle to the graphics context with individual corner roundness.
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 2522 of file IGraphics.cpp.
References PathClear(), PathRoundRect(), and PathStroke().
|
virtual |
Draw an SVG image to the graphics context.
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 2795 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().
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.
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 678 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().
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.
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 694 of file IGraphics.cpp.
References DrawText().
|
virtual |
Draw a triangle to the graphics context.
color | The color to draw 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 |
thickness | Optional line thickness |
Definition at line 2501 of file IGraphics.cpp.
References PathClear(), PathStroke(), and PathTriangle().
Referenced by TestArcControl::Draw(), IGraphicsLiveEdit::Draw(), and IVectorBase::DrawPressableTriangle().
void IGraphics::DrawVerticalLine | ( | const IColor & | color, |
const IRECT & | bounds, | ||
float | x, | ||
const IBlend * | pBlend = 0 , |
||
float | thickness = 1.f |
||
) |
Draw a vertical line, within a rectangular region of the graphics context.
color | The color to draw the line with |
bounds | The rectangular region to draw the line in |
x | The normalized position of the line on the horizontal axis, within bounds |
pBlend | Optional blend method |
thickness | Optional line thickness |
Definition at line 795 of file IGraphics.cpp.
References Clip(), and DrawVerticalLine().
Referenced by IWheelControl::Draw(), IVTrackControlBase::DrawBackground(), DrawLineAcross(), and DrawVerticalLine().
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.
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 809 of file IGraphics.cpp.
References DrawLine().
void IGraphics::EnableLiveEdit | ( | bool | enable | ) |
Live edit mode allows you to relocate controls at runtime in debug builds.
enable | Set true if you wish to enable live editing mode |
Definition at line 1544 of file IGraphics.cpp.
References GetDelegate(), ReleaseMouseCapture(), SetAllControlsDirty(), and SetMouseCursor().
|
inline |
enable | Set true if you want to handle mouse over messages. Note: this may increase the amount CPU usage if you redraw on mouse overs etc |
Definition at line 1585 of file IGraphics.h.
Referenced by IGraphicsLiveEdit::OnInit().
|
inline |
Enable/disable multi touch, if platform supports it.
true
if platform supports it Definition at line 1152 of file IGraphics.h.
References PlatformSupportsMultiTouch().
void IGraphics::EnableTooltips | ( | bool | enable | ) |
enable | Set true to enable tool tips when the user mouses over a control |
Definition at line 1538 of file IGraphics.cpp.
|
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().
ILayerPtr IGraphics::EndLayer | ( | ) |
End an IGraphics layer.
Switches drawing back to the main context
Definition at line 2011 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().
|
virtual |
Fill an arc segment with a color.
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 2608 of file IGraphics.cpp.
References PathArc(), PathClear(), PathClose(), PathFill(), and PathMoveTo().
Referenced by TestArcControl::Draw().
|
virtual |
Fill a circle with a color.
color | The color to fill 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 |
Definition at line 2617 of file IGraphics.cpp.
References PathCircle(), PathClear(), and PathFill().
Referenced by TestArcControl::Draw(), TestLayerControl::Draw(), IControl::DrawPTHighlight(), and IVectorBase::DrawSplash().
|
virtual |
Fill a convex polygon with a color.
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 2601 of file IGraphics.cpp.
References PathClear(), PathConvexPolygon(), and PathFill().
Referenced by TestPolyControl::Draw().
|
virtual |
Fill an ellipse within a rectangular region of the graphics context.
color | The color to fill the shape with |
bounds | The rectangular region to fill the shape in |
pBlend | Optional blend method |
Definition at line 2624 of file IGraphics.cpp.
References PathClear(), PathEllipse(), and PathFill().
Referenced by ILEDControl::Draw(), TestMTControl::Draw(), and IVectorBase::DrawPressableEllipse().
|
virtual |
Fill an ellipse.
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 2631 of file IGraphics.cpp.
References PathClear(), PathEllipse(), and PathFill().
|
virtual |
Fill a rectangular region of the graphics context with a color.
color | The color to fill the shape with |
bounds | The rectangular region to fill the shape in |
pBlend | Optional blend method |
Definition at line 2580 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().
|
virtual |
Fill a rounded rectangle with a color.
color | The color to fill the shape with |
bounds | The rectangular region to fill the shape in |
cornerRadius | The corner radius in pixels |
pBlend | Optional blend method |
Definition at line 2587 of file IGraphics.cpp.
References PathClear(), PathFill(), and PathRoundRect().
Referenced by IVKeyboardControl::Draw(), IWheelControl::Draw(), IVTabbedPagesControl::Draw(), TestLayerControl::Draw(), TestPolyControl::Draw(), IPopupMenuControl::DrawPanelBackground(), IVectorBase::DrawPressableRectangle(), and IPopupMenuControl::DrawTick().
|
virtual |
Fill a rounded rectangle with a color.
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 2594 of file IGraphics.cpp.
References PathClear(), PathFill(), and PathRoundRect().
|
virtual |
Fill a triangle with a color.
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 2573 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().
|
protectedpure virtual |
true
if the drawing backend flips images (e.g. OpenGL) Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by ApplyLayerDropShadow().
void IGraphics::ForAllControls | ( | T | method, |
Args... | args | ||
) |
For all controls, including the "special controls" call a method.
method | The method to call |
args | The method arguments |
Definition at line 579 of file IGraphics.cpp.
References ForAllControlsFunc().
Referenced by OnGUIIdle(), OnMouseOut(), Resize(), SetAllControlsClean(), SetAllControlsDirty(), and SetScreenScale().
void IGraphics::ForAllControlsFunc | ( | IControlFunction | func | ) |
For all controls, including the "special controls" call a method.
func | A std::function to perform on each control |
Definition at line 548 of file IGraphics.cpp.
References ForStandardControlsFunc().
Referenced by ForAllControls(), and IsDirty().
|
pure virtual |
Call to force end text entry (will cancel any half input text.
void IGraphics::ForControlInGroup | ( | const char * | group, |
IControlFunction | func | ||
) |
For all standard controls in the main control stack that are linked to a group, execute a function.
group | CString specifying the group name |
func | A std::function to perform on each control |
Definition at line 527 of file IGraphics.cpp.
References GetControl(), IControl::GetGroup(), and NControls().
Referenced by IVGroupControl::SetBoundsBasedOnGroup().
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.
params | The parameter indexes to match |
func | A std::function to perform on each control |
Definition at line 510 of file IGraphics.cpp.
References GetControl(), IControl::LinkedToParam(), and NControls().
void IGraphics::ForControlWithParam | ( | int | paramIdx, |
IControlFunction | func | ||
) |
For all standard controls in the main control stack that are linked to a specific parameter, execute a function.
paramIdx | The parameter index to match |
func | A std::function to perform on each control |
Definition at line 496 of file IGraphics.cpp.
References GetControl(), IControl::LinkedToParam(), and NControls().
Referenced by ForMatchingControls().
void IGraphics::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.
method | The method to call |
paramIdx | The parameter index to match |
args | The method arguments |
Definition at line 585 of file IGraphics.cpp.
References ForControlWithParam().
Referenced by DisableControl(), HideControl(), and SetPTParameterHighlight().
void IGraphics::ForStandardControlsFunc | ( | IControlFunction | func | ) |
For all standard controls in the main control stack perform a function.
func | A std::function to perform on each control |
Definition at line 542 of file IGraphics.cpp.
References GetControl(), and NControls().
Referenced by AssignParamNameToolTips(), ForAllControlsFunc(), IGraphicsLiveEdit::OnMouseDrag(), and UpdatePeers().
|
inline |
Gets the drawing frame rate.
Definition at line 1102 of file IGraphics.h.
|
inlinevirtual |
Get the app group ID on macOS and iOS, returns emtpy string on other OSs.
Definition at line 971 of file IGraphics.h.
|
inline |
Definition at line 1418 of file IGraphics.h.
|
inlineprotectedvirtual |
Definition at line 1784 of file IGraphics.h.
References GetDrawScale(), and GetScreenScale().
Referenced by Draw(), GetPixelSnapped(), and StartLayer().
|
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.
Definition at line 1199 of file IGraphics.h.
References Height(), and Width().
Referenced by AttachCornerResizer(), AttachPanelBackground(), AttachSVGBackground(), IPopupMenuControl::CreatePopupMenu(), IGraphicsLiveEdit::Draw(), ICornerResizerControl::OnRescale(), IGraphicsLiveEdit::OnResize(), and ShowFPSDisplay().
|
inline |
Definition at line 1427 of file IGraphics.h.
|
inlinevirtual |
Get the bundle ID on macOS and iOS, returns emtpy string on other OSs.
Definition at line 968 of file IGraphics.h.
Referenced by LoadResource(), and SearchImageResource().
|
inline |
Get the control at a certain index in the control stack.
idx | The index of the control to get |
Definition at line 1359 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().
|
inline |
Get the index of a particular IControl in the control stack.
pControl | Pointer to the control to get |
Definition at line 1364 of file IGraphics.h.
Referenced by GetIdxOfTaggedControl().
|
inline |
Definition at line 1136 of file IGraphics.h.
Referenced by ITextControl::Draw(), ITextEntryControl::OnKeyDown(), and OnMouseDrag().
|
inline |
Get the tag given to a control.
pControl | Pointer to the control to get the tag for |
Definition at line 1383 of file IGraphics.h.
Referenced by IControl::GetTag().
IControl * IGraphics::GetControlWithParamIdx | ( | int | paramIdx | ) |
Get the first control with a parameter index that matches paramIdx.
idx | The paramater index of the control to get |
Definition at line 471 of file IGraphics.cpp.
References GetControl(), IControl::LinkedToParam(), and NControls().
IControl * IGraphics::GetControlWithTag | ( | int | ctrlTag | ) | const |
Get the control with a particular tag.
ctrlTag | The tag to look for |
Definition at line 456 of file IGraphics.cpp.
Referenced by GetIdxOfTaggedControl(), and RemoveControlWithTag().
|
inline |
Gets a pointer to the delegate class that handles communication to and from this graphics context.
Definition at line 1127 of file IGraphics.h.
Referenced by AttachBackground(), AttachBubbleControl(), AttachControl(), AttachCornerResizer(), AttachPanelBackground(), AttachPopupMenuControl(), AttachSVGBackground(), AttachTextEntryControl(), EnableLiveEdit(), OnMouseDown(), OnMouseUp(), PopupHostContextMenuForParam(), Resize(), SetControlValueAfterPopupMenu(), SetQwertyMidiKeyHandlerFunc(), SetScreenScale(), and ShowFPSDisplay().
|
pure virtual |
Gets a void pointer to underlying drawing context, for the IGraphics backend See draw class implementation headers (e.g.
IGraphicsNanoVG.h) for what you can cast the void pointer to
Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by IColorPickerControl::Draw(), ISkLottieControl::Draw(), ISkParagraphControl::Draw(), and TestDrawContextControl::Draw().
|
pure virtual |
Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by IFPSDisplayControl::Draw(), and GFXLabelControl::Draw().
|
inline |
Gets the graphics context scaling factor.
Definition at line 1106 of file IGraphics.h.
Referenced by CheckLayer(), GetBackingPixelScale(), IWebViewControl::OnAttached(), OnDragResize(), ICornerResizerControl::OnRescale(), PopupHostContextMenuForParam(), Resize(), ScaleBitmap(), and StartLayer().
|
inline |
Gets the index of a tagged control.
ctrlTag | The tag to look for |
Definition at line 1369 of file IGraphics.h.
References GetControlIdx(), and GetControlWithTag().
int IGraphics::GetLastClickedParamForPTAutomation | ( | ) |
[AAX only]
Definition at line 1400 of file IGraphics.cpp.
|
pure virtual |
Get the contents of a layer as Raw RGBA bitmap data NOTE: you should only call this within IControl::Draw()
layer | The layer to get the data from |
data | The pixel data extracted from the layer |
Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by ApplyLayerDropShadow().
|
inline |
Get the x, y position of the last mouse down message.
Does not get cleared on mouse up etc.
x | Where the X position will be stored |
y | Where the Y position will be stored |
Definition at line 1599 of file IGraphics.h.
Referenced by IGraphicsLiveEdit::OnMouseDrag(), IGraphicsLiveEdit::OnPopupMenuSelection(), and SplashClickActionFunc().
|
pure virtual |
Get the x, y position of the mouse cursor.
x | Where the X position will be stored |
y | Where the Y position will be stored |
Referenced by IGEditorDelegate::OnKeyDown(), and IGEditorDelegate::OnKeyUp().
|
inline |
Definition at line 1594 of file IGraphics.h.
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)
x | The X coordinate to check |
y | The Y coordinateto check |
Definition at line 1393 of file IGraphics.cpp.
References IControl::GetParamIdx().
Gets the nearest backing pixel aligned rect to the input IRECT.
r | The IRECT to snap |
Definition at line 1123 of file IGraphics.h.
References GetBackingPixelScale(), and IRECT::GetPixelSnapped().
|
inlinevirtual |
Definition at line 914 of file IGraphics.h.
|
inline |
Get the platform level draw context - an HDC or CGContextRef.
Definition at line 935 of file IGraphics.h.
Referenced by IGraphicsSkia::EndFrame().
|
inlinevirtual |
Returns a scaling factor for resizing parent windows via the host/plugin API.
Definition at line 1225 of file IGraphics.h.
Referenced by Resize(), and SetScreenScale().
|
pure virtual |
Get the color at an X, Y location in the graphics context.
x | The X coordinate of the pixel |
y | The Y coordinate of the pixel |
Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
|
inline |
Definition at line 1421 of file IGraphics.h.
|
inline |
Definition at line 1130 of file IGraphics.h.
|
inline |
Definition at line 1145 of file IGraphics.h.
|
inline |
Definition at line 1148 of file IGraphics.h.
|
inline |
Gets the screen/display scaling factor, rounded up.
Definition at line 1114 of file IGraphics.h.
References GetScreenScale().
Referenced by GetScaledBitmap(), LoadBitmap(), IGraphicsNanoVG::LoadBitmap(), and ScaleBitmap().
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.
inBitmap | The source bitmap to find a scaled version of |
Definition at line 1531 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().
|
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%
Definition at line 1110 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().
|
inline |
Gets the name of the shared resources subpath.
Definition at line 1642 of file IGraphics.h.
Referenced by LoadResource(), and SearchImageResource().
|
inline |
Definition at line 1424 of file IGraphics.h.
|
pure virtual |
Get text from the clipboard.
str | A WDL_String that will be filled with the text that is currently on the clipboard |
|
inline |
Gets the combined draw and screen/display scaling factor.
Definition at line 1118 of file IGraphics.h.
Referenced by PopupHostContextMenuForParam().
|
inline |
Populate a vector with the touchIDs active on pControl.
Definition at line 1410 of file IGraphics.h.
Referenced by TestMTControl::Draw().
|
inlineprotected |
Definition at line 1786 of file IGraphics.h.
|
inlinevirtual |
Get the UI Appearance (Light/Dark mode)
Definition at line 1582 of file IGraphics.h.
|
pure virtual |
Get a pointer to the platform view e.g.
HWND or NSView for this graphics context return void pointer to platform window or view handle
Referenced by IGraphicsSkia::EndFrame(), IWebViewControl::OnAttached(), and WindowIsOpen().
|
inlinevirtual |
Definition at line 926 of file IGraphics.h.
Referenced by IGraphicsNanoVG::LoadAPIBitmap(), IGraphicsSkia::LoadAPIBitmap(), LoadResource(), and SearchImageResource().
|
inline |
Gets the height of the graphics context.
Definition at line 1090 of file IGraphics.h.
Referenced by GetBounds(), OnDragResize(), and Resize().
void IGraphics::HideControl | ( | int | paramIdx, |
bool | hide | ||
) |
Hide controls linked to a specific parameter.
paramIdx | The parameter index |
hide | /c true to hide |
Definition at line 486 of file IGraphics.cpp.
References ForMatchingControls(), and IControl::Hide().
|
pure virtual |
Call to hide/show the mouse cursor.
hide | Should the cursor be hidden or shown |
lock | Set true to hold the cursor in place while hidden |
Referenced by IVXYPadControl::OnMouseDown(), IVNumberBoxControl::OnMouseDown(), TestArcControl::OnMouseDown(), TestPolyControl::OnMouseDown(), IKnobControlBase::OnMouseDown(), ISliderControlBase::OnMouseDown(), IVXYPadControl::OnMouseUp(), IVNumberBoxControl::OnMouseUp(), TestArcControl::OnMouseUp(), TestPolyControl::OnMouseUp(), IKnobControlBase::OnMouseUp(), ISliderControlBase::OnMouseUp(), and ReleaseMouseCapture().
|
inlinevirtual |
Hide a previously attached platform view from the IGraphics view.
pView | the platform view to remove, which would be a HWND on Windows, NSView* on macOS or UIView* on iOS |
hide | should it be hidden or not |
Definition at line 808 of file IGraphics.h.
Referenced by IPlatformViewControl::Hide(), and IWebViewControl::Hide().
|
inlinevirtual |
Initiate an drag-n-drop operation of an existing file, to be dropped outside of the current window.
path | A CString that contains a path to a file on disk |
iconBounds | The area where the icon should appear |
Definition at line 872 of file IGraphics.h.
bool IGraphics::IsDirty | ( | IRECTList & | rects | ) |
Called repeatedly at frame rate by the platform class to check what the graphics context says is dirty.
rects | The rectangular regions which will be added to to mark what is dirty in the context |
Definition at line 833 of file IGraphics.cpp.
References IRECTList::Add(), IRECT::Clank(), ForAllControlsFunc(), IRECT::GetPadded(), IControl::GetParent(), IControl::GetRECT(), IControl::IsDirty(), and OnGUIIdle().
|
inline |
Definition at line 1133 of file IGraphics.h.
Referenced by OnMouseDrag().
|
inline |
true
if live edit mode is enabled Definition at line 1194 of file IGraphics.h.
|
protectedpure virtual |
Drawing API method to load a bitmap, called internally.
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 |
Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by LoadBitmap().
|
protectedpure virtual |
Drawing API method to load a bitmap from binary data, called internally.
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 |
Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
|
protectedpure virtual |
Drawing API method to load a font from a PlatformFontPtr, called internally.
fontID | A CString that will be used to reference the font |
font | Valid PlatformFontPtr, loaded via LoadPlatformFont |
true
if the font was loaded successfully Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by LoadFont().
|
virtual |
Load a bitmap image from disk or from windows resource.
fileNameOrResID | CString file name or resource ID |
nStates | The number of states/frames in a multi-frame stacked bitmap |
framesAreHorizontal | Set true if the frames in a bitmap are stacked horizontally |
targetScale | Set to a number > 0 to explicity load e.g. an @2x.png |
Reimplemented in IGraphicsNanoVG.
Definition at line 1732 of file IGraphics.cpp.
References BitmapExtSupported(), GetRoundedScreenScale(), APIBitmap::GetScale(), LoadAPIBitmap(), RetainBitmap(), ScaleBitmap(), SearchBitmapInCache(), and SearchImageResource().
Referenced by AttachBackground(), and GetScaledBitmap().
|
virtual |
Load a bitmap image from memory.
name | CString name to associate with the bitmap, must include a file extension |
pData | pointer to the bitmap file data |
dataSize | size of the data at pData |
nStates | The number of states/frames in a multi-frame stacked bitmap |
framesAreHorizontal | Set true if the frames in a bitmap are stacked horizontally |
targetScale | Set to a number > 0 to explicity load e.g. an @2x.png |
Definition at line 1794 of file IGraphics.cpp.
References BitmapExtSupported(), GetRoundedScreenScale(), APIBitmap::GetScale(), LoadAPIBitmap(), RetainBitmap(), ScaleBitmap(), and SearchBitmapInCache().
|
virtual |
Load a font to be used by the graphics context.
fontID | A CString that will be used to reference the font |
fileNameOrResID | A CString absolute path or resource ID |
true
on success Definition at line 2187 of file IGraphics.cpp.
References CachePlatformFont(), LoadAPIFont(), and LoadPlatformFont().
bool IGraphics::LoadFont | ( | const char * | fontID, |
const char * | fontName, | ||
ETextStyle | style | ||
) |
Load a font with a particular style (bold, italic) from a font file.
fontID | A CString that will be used to reference the font |
fontName | A CString font name |
style | A font style |
true
on success Definition at line 2221 of file IGraphics.cpp.
References CachePlatformFont(), LoadAPIFont(), and LoadPlatformFont().
|
virtual |
Load a font from in-memory data to be used by the graphics context.
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 |
true
on success Definition at line 2204 of file IGraphics.cpp.
References CachePlatformFont(), LoadAPIFont(), and LoadPlatformFont().
|
pure virtual |
Load a font from disk or resource in a platform format.
fontID | A string that is used to reference the font |
fileNameOrResID | A resource or file name/path |
Referenced by LoadFont().
|
pure virtual |
Load a system font in a platform format.
fontID | A string that is used to reference the font |
fontName | A string defining the font name |
style | An ETextStyle defining the font style |
|
pure virtual |
Load a font from data in memory.
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 |
|
virtual |
Load a resource from the file system, the bundle, or a Windows resource, and returns its data.
fileNameOrResID | CString file name or resource ID |
fileType | Type of the file (e.g "png", "svg", "ttf") |
Definition at line 1677 of file IGraphics.cpp.
References GetBundleID(), GetSharedResourcesSubPath(), GetWinModuleHandle(), LoadWinResource(), and LocateResource().
Referenced by LoadSVG().
|
virtual |
Load an SVG from disk or from windows resource.
fileNameOrResID | A CString absolute path or resource ID |
Definition at line 1631 of file IGraphics.cpp.
References LoadResource(), and LoadSVG().
Referenced by AttachSVGBackground(), and LoadSVG().
|
virtual |
Load an SVG image from memory.
name | CString name to associate with the SVG |
pData | Pointer to the SVG file data |
dataSize | Size (in bytes) of the data at pData |
units |
dpi | The dots per inch of the SVG file |
Definition at line 1652 of file IGraphics.cpp.
Measure the rectangular region that some text will occupy.
text | An IText struct containing font and text properties and layout info |
str | The text string to draw |
bounds | after calling the method this IRECT will be updated with the rectangular region the text will occupy |
Definition at line 686 of file IGraphics.cpp.
References DoMeasureText().
Referenced by TestFlexBoxControl::Draw(), GFXLabelControl::Draw(), TestTextOrientationControl::Draw(), IURLControl::Draw(), PlaceHolder::Draw(), IVectorBase::MakeRects(), and ITextControl::SetBoundsBasedOnStr().
|
inline |
true
if the context has mouse overs enabled Definition at line 1591 of file IGraphics.h.
|
pure virtual |
Force move the mouse cursor to a specific position.
x | New X position in pixels |
y | New Y position in pixels |
|
inline |
Definition at line 1166 of file IGraphics.h.
|
inline |
Definition at line 1430 of file IGraphics.h.
|
inline |
Definition at line 1442 of file IGraphics.h.
Referenced by IGraphicsLiveEdit::Draw(), ForControlInGroup(), ForControlWithParam(), ForStandardControlsFunc(), GetControlWithParamIdx(), IGraphicsLiveEdit::OnMouseDown(), RemoveControls(), and StyleAllVectorControls().
void IGraphics::OnAppearanceChanged | ( | EUIAppearance | appearance | ) |
Called by the platform class if the view changes to dark/light mode.
appearance | Light/Dark mode |
Definition at line 1525 of file IGraphics.cpp.
void IGraphics::OnDragResize | ( | float | x, |
float | y | ||
) |
Called by ICornerResizerControl as the corner is dragged to resize.
Definition at line 1510 of file IGraphics.cpp.
References GetDrawScale(), Height(), Resize(), and Width().
Referenced by OnMouseDrag().
void IGraphics::OnDrop | ( | const char * | str, |
float | x, | ||
float | y | ||
) |
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 1277 of file IGraphics.cpp.
References IControl::OnDrop().
void IGraphics::OnDropMultiple | ( | const std::vector< const char * > & | paths, |
float | x, | ||
float | y | ||
) |
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 1283 of file IGraphics.cpp.
References IControl::OnDropMultiple().
void IGraphics::OnGestureRecognized | ( | const IGestureInfo & | info | ) |
Called by platform class when a gesture is recognized.
Definition at line 2374 of file IGraphics.cpp.
References IRECTList::Find(), IControl::GetWantsGestures(), and IControl::OnGesture().
void IGraphics::OnGUIIdle | ( | ) |
This is an idle timer tick call on the GUI thread, only active if USE_IDLE_CALLS is defined.
Definition at line 1504 of file IGraphics.cpp.
References ForAllControls(), and IControl::OnGUIIdle().
Referenced by IsDirty().
bool IGraphics::OnKeyDown | ( | float | x, |
float | y, | ||
const IKeyPress & | key | ||
) |
x | The X coordinate of the mouse cursor at the time of the key press |
y | The Y coordinate of the mouse cursor at the time of the key press |
key | Info about the keypress |
true
if handled Definition at line 1241 of file IGraphics.cpp.
References GetControl(), and IControl::OnKeyDown().
Referenced by IGEditorDelegate::OnKeyDown().
bool IGraphics::OnKeyUp | ( | float | x, |
float | y, | ||
const IKeyPress & | key | ||
) |
x | The X coordinate of the mouse cursor at the time of the key press |
y | The Y coordinate of the mouse cursor at the time of the key press |
key | Info about the keypress |
true
if handled Definition at line 1259 of file IGraphics.cpp.
References GetControl(), and IControl::OnKeyUp().
Referenced by IGEditorDelegate::OnKeyUp().
bool IGraphics::OnMouseDblClick | ( | float | x, |
float | y, | ||
const IMouseMod & | mod | ||
) |
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 |
Definition at line 1203 of file IGraphics.cpp.
References IControl::GetMouseDblAsSingleClick(), IControl::OnMouseDblClick(), OnMouseDown(), and ReleaseMouseCapture().
void IGraphics::OnMouseDown | ( | const std::vector< IMouseInfo > & | points | ) |
Called when the platform class sends mouse down events.
Definition at line 979 of file IGraphics.cpp.
References IEditorDelegate::BeginInformHostOfParamChangeFromUI(), GetDelegate(), IControl::GetParamIdx(), IControl::GetValIdxForPos(), IControl::NVals(), IControl::OnMouseDown(), PopupHostContextMenuForParam(), and ReleaseMouseCapture().
Referenced by OnMouseDblClick().
void IGraphics::OnMouseDrag | ( | const std::vector< IMouseInfo > & | points | ) |
Called when the platform class sends drag events.
Definition at line 1163 of file IGraphics.cpp.
References ControlIsCaptured(), GetControlInTextEntry(), IsInPlatformTextEntry(), OnDragResize(), and IControl::OnMouseDrag().
void IGraphics::OnMouseOut | ( | ) |
Called when the mouse leaves the graphics context.
Definition at line 1153 of file IGraphics.cpp.
References ForAllControls(), IControl::OnMouseOut(), and SetMouseCursor().
bool IGraphics::OnMouseOver | ( | float | x, |
float | y, | ||
const IMouseMod & | mod | ||
) |
x | The X coordinate at which to draw |
y | The Y coordinate at which to draw |
mod | IMouseMod struct contain information about the modifiers held |
true
if handled Definition at line 1131 of file IGraphics.cpp.
References IControl::OnMouseOut(), and IControl::OnMouseOver().
Referenced by OnMouseUp().
void IGraphics::OnMouseUp | ( | const std::vector< IMouseInfo > & | points | ) |
Called when the platform class sends mouse up events.
Definition at line 1065 of file IGraphics.cpp.
References ControlIsCaptured(), IEditorDelegate::EndInformHostOfParamChangeFromUI(), GetDelegate(), IControl::GetParamIdx(), IControl::NVals(), OnMouseOver(), and IControl::OnMouseUp().
bool IGraphics::OnMouseWheel | ( | float | x, |
float | y, | ||
const IMouseMod & | mod, | ||
float | delta | ||
) |
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 | Delta value |
Definition at line 1231 of file IGraphics.cpp.
References IControl::OnMouseWheel().
|
inline |
Called when the mouse enters the graphics context, to update the cursor to mCursorType.
Definition at line 1558 of file IGraphics.h.
References SetMouseCursor().
void IGraphics::OnTouchCancelled | ( | const std::vector< IMouseInfo > & | points | ) |
Called when the platform class sends touch cancel events.
Definition at line 1106 of file IGraphics.cpp.
References ControlIsCaptured(), and IControl::OnTouchCancelled().
|
inlinevirtual |
Called after a platform view is destroyed, so that drawing classes can e.g.
free any resources
Reimplemented in IGraphicsNanoVG, and IGraphicsSkia.
Definition at line 97 of file IGraphics.h.
|
inlinevirtual |
Called after platform view initialization, so that drawing classes can e.g.
create an OpenGL context.
Reimplemented in IGraphicsNanoVG, and IGraphicsSkia.
Definition at line 94 of file IGraphics.h.
|
pure virtual |
Open a URL in the platform’s default browser.
url | CString specifying the URL to open |
msgWindowTitle |
confirmMsg |
errMsgOnFailure |
Referenced by IURLControl::OnMouseDown().
|
pure virtual |
|
pure virtual |
Add an arc to the current path.
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 |
Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by TestMultiPathControl::Draw(), DrawArc(), IVGroupControl::DrawWidget(), FillArc(), PathCircle(), and PathRoundRect().
void IGraphics::PathCircle | ( | float | cx, |
float | cy, | ||
float | r | ||
) |
Add a circle to the current path.
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 |
Definition at line 2699 of file IGraphics.cpp.
References PathArc(), PathClose(), and PathMoveTo().
Referenced by TestMultiPathControl::Draw(), DrawCircle(), FillCircle(), and PathEllipse().
|
pure virtual |
Clear the stack of path drawing commands.
Implemented in IGraphicsCanvas, 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().
Clip the current path to a particular region.
r | The rectangular region to clip |
Definition at line 2776 of file IGraphics.cpp.
References IRECT::Empty(), and IRECT::Intersect().
Referenced by IVectorBase::DrawSplash(), PopLayer(), and PushLayer().
|
pure virtual |
Close the path that is being specified.
Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by TestMultiPathControl::Draw(), FillArc(), PathCircle(), PathConvexPolygon(), PathRect(), PathRoundRect(), and PathTriangle().
void IGraphics::PathConvexPolygon | ( | float * | x, |
float * | y, | ||
int | nPoints | ||
) |
Add a convex polygon to the current path.
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 2706 of file IGraphics.cpp.
References PathClose(), PathLineTo(), and PathMoveTo().
Referenced by DrawConvexPolygon(), and FillConvexPolygon().
|
pure virtual |
Add a cubic bezier to the current path from the current point to the specified location.
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 IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by TestBezierControl::Draw(), and TestMultiPathControl::Draw().
void IGraphics::PathEllipse | ( | const IRECT & | bounds | ) |
Add an ellipse to the current path, specifying the rectangular region.
bounds | The rectangular region to draw the shape in |
Definition at line 2694 of file IGraphics.cpp.
References IRECT::H(), IRECT::MH(), IRECT::MW(), PathEllipse(), and IRECT::W().
Referenced by ILEDControl::Draw(), DrawEllipse(), FillEllipse(), and PathEllipse().
void IGraphics::PathEllipse | ( | float | x, |
float | y, | ||
float | r1, | ||
float | r2, | ||
float | angle = 0.0 |
||
) |
Add an ellipse to the current path.
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 |
Definition at line 2678 of file IGraphics.cpp.
References PathCircle(), PathTransformRestore(), PathTransformRotate(), PathTransformSave(), PathTransformScale(), and PathTransformTranslate().
|
pure virtual |
Fill the current current path.
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 IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by IFPSDisplayControl::Draw(), ILEDControl::Draw(), IWheelControl::Draw(), TestColorControl::Draw(), TestGesturesControl::Draw(), TestGradientControl::Draw(), TestMultiPathControl::Draw(), IPanelControl::Draw(), DrawData(), FillArc(), FillCircle(), FillConvexPolygon(), FillEllipse(), FillRect(), FillRoundRect(), and FillTriangle().
|
inline |
Add a line to the current path.
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().
|
pure virtual |
Add a line to the current path from the current point to the specified location.
x | The X coordinate of the end of the line |
y | The Y coordinate of the end of the line |
Implemented in IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by IFPSDisplayControl::Draw(), TestMultiPathControl::Draw(), DrawData(), DrawDottedLine(), DrawGrid(), DrawLine(), IVGroupControl::DrawWidget(), IVDisplayControl::DrawWidget(), PathConvexPolygon(), PathLine(), PathRect(), and PathTriangle().
|
pure virtual |
Move the current point in the current path.
x | The X coordinate |
y | The Y coordinate |
Implemented in IGraphicsCanvas, 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().
|
pure virtual |
Add a quadratic bezier to the current path from the current point to the specified location.
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 IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by TestBezierControl::Draw().
void IGraphics::PathRadialLine | ( | float | cx, |
float | cy, | ||
float | angle, | ||
float | rMin, | ||
float | rMax | ||
) |
Add a radial line to the current path.
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 826 of file IGraphics.cpp.
References PathLine().
void IGraphics::PathRect | ( | const IRECT & | bounds | ) |
Add a rectangle to the current path.
bounds | The bounds of the rectangle to add |
Definition at line 2646 of file IGraphics.cpp.
References PathClose(), PathLineTo(), and PathMoveTo().
Referenced by IGraphicsNanoVG::ApplyShadowMask(), IWheelControl::Draw(), TestColorControl::Draw(), TestGesturesControl::Draw(), TestMultiPathControl::Draw(), IPanelControl::Draw(), IGraphicsCanvas::DrawBitmap(), DrawDottedRect(), DrawRect(), FillRect(), and PathRoundRect().
void IGraphics::PathRoundRect | ( | const IRECT & | bounds, |
float | cornerRadius = 5.f |
||
) |
Add a rounded rectangle to the current path.
bounds | The rectangular region to draw the shape in |
cornerRadius | The corner radius in pixels |
Definition at line 2673 of file IGraphics.cpp.
References PathRoundRect().
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.
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 2655 of file IGraphics.cpp.
References IRECT::H(), PathArc(), PathClose(), PathMoveTo(), PathRect(), and IRECT::W().
Referenced by TestGradientControl::Draw(), TestMultiPathControl::Draw(), DrawRoundRect(), FillRoundRect(), and PathRoundRect().
|
inlinevirtual |
NanoVG only.
https://github.com/memononen/nanovg/blob/master/src/nanovg.h#L454
clockwise | Should the path be wound clockwise |
Reimplemented in IGraphicsNanoVG.
Definition at line 685 of file IGraphics.h.
|
pure virtual |
Stroke the current current path.
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 IGraphicsCanvas, IGraphicsNanoVG, and IGraphicsSkia.
Referenced by TestBezierControl::Draw(), TestGradientControl::Draw(), TestMultiPathControl::Draw(), DrawArc(), DrawCircle(), DrawConvexPolygon(), DrawData(), DrawDottedLine(), DrawDottedRect(), DrawEllipse(), DrawGrid(), DrawLine(), DrawRect(), DrawRoundRect(), DrawTriangle(), IVGroupControl::DrawWidget(), and IVDisplayControl::DrawWidget().
void IGraphics::PathTransformMatrix | ( | const IMatrix & | matrix | ) |
Apply an arbitary affine transform matrix to the current path.
matrix | The transfomation matrix |
Definition at line 2770 of file IGraphics.cpp.
References IMatrix::Transform().
void IGraphics::PathTransformReset | ( | bool | clearStates = false | ) |
Reset the affine transform of the current path, to the default state.
clearStates | Selects whether the call also empties the transform stack |
Definition at line 2729 of file IGraphics.cpp.
Referenced by DrawLayer(), DrawRotatedLayer(), PopLayer(), and PushLayer().
void IGraphics::PathTransformRestore | ( | ) |
Restore the affine transform of the current path, to the previously saved state.
Definition at line 2719 of file IGraphics.cpp.
Referenced by IGraphicsNanoVG::ApplyShadowMask(), IGraphicsCanvas::DoDrawText(), IGraphicsNanoVG::DoDrawText(), IGraphicsSkia::DoDrawText(), TestGesturesControl::Draw(), DrawFittedBitmap(), DrawFittedLayer(), DrawLayer(), DrawRotatedBitmap(), DrawRotatedLayer(), DrawRotatedSVG(), DrawSVG(), and PathEllipse().
void IGraphics::PathTransformRotate | ( | float | angle | ) |
Apply a rotation transform to the current path.
angle | Angle to rotate in degrees clockwise |
Definition at line 2758 of file IGraphics.cpp.
References IMatrix::Rotate().
Referenced by TestGesturesControl::Draw(), DrawRotatedBitmap(), DrawRotatedSVG(), and PathEllipse().
void IGraphics::PathTransformSave | ( | ) |
Save the current affine transform of the current path.
Definition at line 2714 of file IGraphics.cpp.
Referenced by IGraphicsNanoVG::ApplyShadowMask(), IGraphicsCanvas::DoDrawText(), IGraphicsNanoVG::DoDrawText(), IGraphicsSkia::DoDrawText(), TestGesturesControl::Draw(), DrawFittedBitmap(), DrawFittedLayer(), DrawLayer(), DrawRotatedBitmap(), DrawRotatedLayer(), DrawRotatedSVG(), DrawSVG(), and PathEllipse().
void IGraphics::PathTransformScale | ( | float | scale | ) |
Apply a scale transform to the current path, with independant x, y scales.
scale | Scale amount |
Definition at line 2753 of file IGraphics.cpp.
References PathTransformScale().
void IGraphics::PathTransformScale | ( | float | x, |
float | y | ||
) |
Apply a scale transform to the current path, with independant x, y scales.
x | Horizontal scale amount |
y | Horizontal scale amount |
Definition at line 2747 of file IGraphics.cpp.
References IMatrix::Scale().
Referenced by TestGesturesControl::Draw(), DrawFittedBitmap(), DrawFittedLayer(), DrawSVG(), PathEllipse(), and PathTransformScale().
void IGraphics::PathTransformSkew | ( | float | xAngle, |
float | yAngle | ||
) |
Apply a skew transform to the current path.
xAngle | Angle to skew horizontal in degrees clockwise |
yAngle | Angle to skew vertical in degrees clockwise |
Definition at line 2764 of file IGraphics.cpp.
References IMatrix::Skew().
void IGraphics::PathTransformTranslate | ( | float | x, |
float | y | ||
) |
Apply a translation transform to the current path.
x | Horizontal translation amount |
y | Vertical translation amount |
Definition at line 2741 of file IGraphics.cpp.
References IMatrix::Translate().
Referenced by IGraphicsNanoVG::ApplyShadowMask(), TestGesturesControl::Draw(), DrawFittedBitmap(), DrawFittedLayer(), DrawRotatedBitmap(), DrawRotatedSVG(), DrawSVG(), and PathEllipse().
void IGraphics::PathTriangle | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2, | ||
float | x3, | ||
float | y3 | ||
) |
Add a triangle to the current path.
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 2638 of file IGraphics.cpp.
References PathClose(), PathLineTo(), and PathMoveTo().
Referenced by DrawTriangle(), and FillTriangle().
|
inlinevirtual |
Definition at line 1169 of file IGraphics.h.
Referenced by EnableMultiTouch().
|
protected |
Pop a layer off the stack.
Definition at line 2025 of file IGraphics.cpp.
References PathClear(), PathClipRegion(), PathTransformReset(), and UpdateLayer().
Referenced by IGraphicsNanoVG::ApplyShadowMask(), EndLayer(), and IGraphicsNanoVG::GetLayerBitmapData().
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
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 1412 of file IGraphics.cpp.
References IControl::CreateContextMenu(), GetDelegate(), GetDrawScale(), and GetTotalScale().
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
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 1499 of file IGraphics.cpp.
References GetControl(), and PopupHostContextMenuForParam().
Referenced by OnMouseDown(), and PopupHostContextMenuForParam().
|
pure virtual |
Create a platform color chooser dialog.
NOTE: this method will block the main thread
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 |
Referenced by IVColorSwatchControl::OnMouseDown().
|
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
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. |
|
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.
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().
Prompt for user input either using a text entry or pop up menu.
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 630 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().
|
protected |
Push a layer on to the stack.
pLayer | The new layer |
Definition at line 2016 of file IGraphics.cpp.
References ILayer::Bounds(), PathClear(), PathClipRegion(), PathTransformReset(), and UpdateLayer().
Referenced by IGraphicsNanoVG::ApplyShadowMask(), IGraphicsNanoVG::GetLayerBitmapData(), ResumeLayer(), and StartLayer().
|
virtual |
Releases an IBitmap from the cache/static storage.
bitmap | The bitmap to release |
Reimplemented in IGraphicsNanoVG.
Definition at line 1845 of file IGraphics.cpp.
References IBitmap::GetAPIBitmap().
void IGraphics::ReleaseMouseCapture | ( | ) |
Used to tell the graphics context to stop tracking mouse interaction with a control.
Definition at line 1289 of file IGraphics.cpp.
References HideMouseCursor().
Referenced by EnableLiveEdit(), IGraphicsLiveEdit::OnKeyDown(), OnMouseDblClick(), OnMouseDown(), IURLControl::OnMouseDown(), RemoveAllControls(), RemoveControl(), RemoveControls(), and Resize().
void IGraphics::RemoveAllControls | ( | ) |
Removes all regular IControls from the control list, as well as special controls (frees memory).
Definition at line 194 of file IGraphics.cpp.
References ReleaseMouseCapture().
Referenced by IGraphicsNanoVG::OnViewDestroyed(), and IGraphicsSkia::OnViewDestroyed().
void IGraphics::RemoveControl | ( | IControl * | pControl | ) |
Remove a control at using ptr, (frees memory).
Definition at line 172 of file IGraphics.cpp.
References ClearInTextEntryControl(), ControlIsCaptured(), IControl::GetTag(), ReleaseMouseCapture(), and SetAllControlsDirty().
void IGraphics::RemoveControl | ( | int | idx | ) |
Remove a control at a particular index, (frees memory).
Definition at line 167 of file IGraphics.cpp.
References GetControl(), and RemoveControl().
Referenced by IGraphicsLiveEdit::OnKeyDown(), IGraphicsLiveEdit::OnPopupMenuSelection(), and RemoveControl().
void IGraphics::RemoveControls | ( | int | fromIdx | ) |
Remove controls from the control list above a particular index, (frees memory).
Definition at line 139 of file IGraphics.cpp.
References ClearInTextEntryControl(), ControlIsCaptured(), GetControl(), IControl::GetTag(), NControls(), ReleaseMouseCapture(), and SetAllControlsDirty().
void IGraphics::RemoveControlWithTag | ( | int | ctrlTag | ) |
Remove controls from the control list with a particular tag.
Definition at line 132 of file IGraphics.cpp.
References GetControlWithTag(), and SetAllControlsDirty().
|
inlinevirtual |
Remove a previously attached platform view from the IGraphics view.
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.
void IGraphics::RemovePopupMenuControl | ( | ) |
Remove the IGraphics popup menu, use platform popup menu if available.
Definition at line 373 of file IGraphics.cpp.
Referenced by TestDirBrowseControl::OnMouseDown().
void IGraphics::RemoveTextEntryControl | ( | ) |
Remove the IGraphics text entry, use platform text entry if available.
Definition at line 387 of file IGraphics.cpp.
void IGraphics::Resize | ( | int | w, |
int | h, | ||
float | scale, | ||
bool | needsPlatformResize = true |
||
) |
w | New width in pixels |
h | New height in pixels |
scale | New scale ratio |
needsPlatformResize | This should be true for a "manual" resize from the plug-in UI and false if being called from IEditorDelegate::OnParentWindowResize(), in order to avoid feedback |
Definition at line 90 of file IGraphics.cpp.
References Clip(), IEditorDelegate::ConstrainEditorResize(), IEditorDelegate::EditorResizeFromUI(), ForAllControls(), GetDelegate(), GetDrawScale(), GetPlatformWindowScale(), Height(), IGEditorDelegate::LayoutUI(), IControl::OnResize(), ReleaseMouseCapture(), SetAllControlsDirty(), Width(), WindowHeight(), and WindowWidth().
Referenced by OnDragResize(), ICornerResizerControl::OnMouseDblClick(), IGEditorDelegate::OpenWindow(), and IGEditorDelegate::UnserializeEditorSize().
bool IGraphics::RespondsToGesture | ( | float | x, |
float | y | ||
) |
Called by platform class to see if the point at x, y is linked to a gesture recognizer.
Definition at line 2354 of file IGraphics.cpp.
References IRECTList::Find(), IControl::GetWantsGestures(), and IRECTList::Size().
void IGraphics::ResumeLayer | ( | ILayerPtr & | layer | ) |
If a layer already exists, continue drawing to it.
layer | the layer to resume |
Definition at line 1998 of file IGraphics.cpp.
References PushLayer().
Referenced by TestKeyboardControl::Draw(), and TestMTControl::Draw().
|
virtual |
Adds an IBitmap to the cache/static storage.
bitmap | The bitmap to cache |
cacheName | The name by which this bitmap is identified int the cache |
Reimplemented in IGraphicsNanoVG.
Definition at line 1851 of file IGraphics.cpp.
References IBitmap::GetAPIBitmap(), and IBitmap::GetScale().
Referenced by LoadBitmap(), and ScaleBitmap().
|
inlinevirtual |
path | WDL_String reference where the path will be put on success or empty string on failure |
select | et true if you want to select the item in Explorer/Finder |
true
on success (if the path was valid) Definition at line 919 of file IGraphics.h.
|
virtual |
Returns a new IBitmap, an integer scaled version of the input, and adds it to the cache.
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 1857 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().
|
protected |
Search the static storage cache for a bitmap image resource matching the target scale.
fileName |
targetScale |
sourceScale |
Definition at line 1909 of file IGraphics.cpp.
Referenced by LoadBitmap().
|
protected |
Search for a bitmap image resource matching the target scale.
fileName |
type |
result |
targetScale |
sourceScale |
Definition at line 1887 of file IGraphics.cpp.
References GetBundleID(), GetSharedResourcesSubPath(), GetWinModuleHandle(), and LocateResource().
Referenced by LoadBitmap(), and IGraphicsNanoVG::LoadBitmap().
void IGraphics::SetAllControlsClean | ( | ) |
Calls SetClean() on every control.
Definition at line 595 of file IGraphics.cpp.
References ForAllControls().
void IGraphics::SetAllControlsDirty | ( | ) |
Calls SetDirty() on every control.
Definition at line 590 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().
Set a controls target and draw rect to r, redrawing the interface correctly.
idx | The index of the control |
r | The new bounds for the control's target and draw rect |
Definition at line 228 of file IGraphics.cpp.
References IControl::IsHidden(), SetAllControlsDirty(), and IControl::SetTargetAndDrawRECTs().
void IGraphics::SetControlPosition | ( | IControl * | pControl, |
float | x, | ||
float | y | ||
) |
Reposition a control, redrawing the interface correctly.
pControl | The control |
x | The new x position |
y | The new y position |
Definition at line 214 of file IGraphics.cpp.
References IControl::IsHidden(), SetAllControlsDirty(), and IControl::SetPosition().
Referenced by IGraphicsLiveEdit::OnMouseDrag().
void IGraphics::SetControlSize | ( | IControl * | pControl, |
float | w, | ||
float | h | ||
) |
Resize a control, redrawing the interface correctly.
pControl | The control |
w | The new width |
h | The new height |
Definition at line 221 of file IGraphics.cpp.
References IControl::IsHidden(), SetAllControlsDirty(), and IControl::SetSize().
Referenced by IGraphicsLiveEdit::OnMouseDrag().
void IGraphics::SetControlValueAfterPopupMenu | ( | IPopupMenu * | pMenu | ) |
Called by PopupMenuControl in order to update a control with a new value after returning from the non-blocking menu.
The base class has a record of the control, so it is not needed here.
pMenu | The menu that was clicked |
Definition at line 255 of file IGraphics.cpp.
References IEditorDelegate::EndInformHostOfParamChangeFromUI(), GetDelegate(), IControl::GetParamIdx(), IControl::NVals(), IControl::OnContextSelection(), and IControl::OnPopupMenuSelection().
void IGraphics::SetControlValueAfterTextEdit | ( | const char * | str | ) |
Called by the platform class after returning from a text entry in order to update a control with a new value.
The base class has a record of the control, so it is not needed here.
str | The new value as a CString |
Definition at line 235 of file IGraphics.cpp.
References ClearInTextEntryControl(), IControl::GetParam(), IControl::OnTextEntryCompletion(), IControl::SetValueFromUserInput(), IParam::StringToValue(), and IParam::ToNormalized().
|
inline |
Sets a function that is called at the frame rate, prior to checking for dirty controls.
func | The function to call |
Definition at line 1203 of file IGraphics.h.
|
inlinevirtual |
Set a file path in the clipboard.
Returns false on unsupported platforms
str | A CString that contains a path to a file on disk |
Definition at line 866 of file IGraphics.h.
|
inline |
Set a function that is called when key presses are not intercepted by any controls.
keyHandlerFunc | A std::function conforming to IKeyHandlerFunc |
Definition at line 1211 of file IGraphics.h.
Referenced by SetQwertyMidiKeyHandlerFunc().
void IGraphics::SetLayoutOnResize | ( | bool | layoutOnResize | ) |
Definition at line 121 of file IGraphics.cpp.
|
inlinevirtual |
Sets the mouse cursor to one of ECursor (implementations should return the result of the base implementation)
cursorType | The cursor type |
Definition at line 828 of file IGraphics.h.
Referenced by EnableLiveEdit(), TestCursorControl::OnMouseDown(), OnMouseOut(), ICornerResizerControl::OnMouseOut(), TestCursorControl::OnMouseOut(), IURLControl::OnMouseOut(), ICornerResizerControl::OnMouseOver(), IURLControl::OnMouseOver(), IGraphicsLiveEdit::OnMouseOver(), and OnSetCursor().
|
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.
pContext | void pointer to CGContextRef or HDC |
Definition at line 931 of file IGraphics.h.
void IGraphics::SetPTParameterHighlight | ( | int | paramIdx, |
bool | isHighlighted, | ||
int | color | ||
) |
[AAX only] See AAX_CEffectGUI::SetControlHighlightInfo()
paramIdx | The index of the parameter to highlight |
isHighlighted | /c true if the parameter should be highlighted |
color | An integer corresponding to AAX_EHighlightColor |
Definition at line 1407 of file IGraphics.cpp.
References ForMatchingControls(), and IControl::SetPTParameterHighlight().
void IGraphics::SetQwertyMidiKeyHandlerFunc | ( | std::function< void(const IMidiMsg &msg)> | func = nullptr | ) |
A helper to set the IGraphics KeyHandlerFunc in order to make an instrument playable via QWERTY keys.
func | A function to do something when a MIDI message is triggered |
Definition at line 2286 of file IGraphics.cpp.
References Clip(), GetDelegate(), IMidiMsg::MakeNoteOffMsg(), IMidiMsg::MakeNoteOnMsg(), IEditorDelegate::SendMidiMsgFromUI(), and SetKeyHandlerFunc().
void IGraphics::SetScaleConstraints | ( | float | lo, |
float | hi | ||
) |
Sets the minimum and maximum (draw) scaling values.
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.
void IGraphics::SetScreenScale | ( | float | scale | ) |
Called by the platform IGraphics class when moving to a new screen to set DPI.
scale | The scale of the screen, typically 2 on a macOS retina screen, or 2 with 200% scaling on windows |
Definition at line 75 of file IGraphics.cpp.
References IEditorDelegate::EditorResizeFromUI(), ForAllControls(), GetDelegate(), GetPlatformWindowScale(), IControl::OnRescale(), SetAllControlsDirty(), WindowHeight(), and WindowWidth().
|
inline |
Sets the name of the shared resources subpath.
Definition at line 1645 of file IGraphics.h.
void IGraphics::SetStrictDrawing | ( | bool | strict | ) |
Enables strict drawing mode.
strict | Set /c true to enable strict drawing mode |
Definition at line 973 of file IGraphics.cpp.
References SetAllControlsDirty().
|
inline |
Set by the platform class if the mouse input is coming from a tablet/stylus.
tablet | true means input is from a tablet |
Definition at line 1603 of file IGraphics.h.
|
pure virtual |
Set text in the clipboard.
str | A CString that will be used to set the current text in the clipboard |
|
inline |
Called by some platform IGraphics classes in order to translate the graphics context, in response to e.g.
iOS onscreen keyboard appearing
Definition at line 1009 of file IGraphics.h.
|
inline |
Sets a function that is called when the OS appearance (light/dark mode) is changed.
func | The function to call |
Definition at line 1207 of file IGraphics.h.
|
inlinevirtual |
Used on Windows to set the HINSTANCE module handle, which allows graphics APIs to load resources from the binary.
pHinstance | void pointer to the platform instance |
Definition at line 923 of file IGraphics.h.
|
inline |
enable | Set true if you wish to show the rectangular region that is drawn on each frame, in order to debug redraw problems |
Definition at line 1181 of file IGraphics.h.
References SetAllControlsDirty().
|
inline |
true
if showning the area drawn on each frame Definition at line 1184 of file IGraphics.h.
void IGraphics::ShowBubbleControl | ( | IControl * | pCaller, |
float | x, | ||
float | y, | ||
const char * | str, | ||
EDirection | dir = EDirection::Horizontal , |
||
IRECT | minimumContentBounds = IRECT() |
||
) |
Definition at line 392 of file IGraphics.cpp.
|
inline |
enable | Set true if you wish to draw the rectangular region of the graphics context occupied by each IControl in mControls |
Definition at line 1178 of file IGraphics.h.
References SetAllControlsDirty().
|
inline |
true
if showning the control bounds Definition at line 1187 of file IGraphics.h.
void IGraphics::ShowFPSDisplay | ( | bool | enable | ) |
Shows a control to display the frame rate of drawing.
enable | true to show |
Definition at line 437 of file IGraphics.cpp.
References GetBounds(), GetDelegate(), and SetAllControlsDirty().
|
inline |
true
if performance display is shown Definition at line 1347 of file IGraphics.h.
|
pure virtual |
Pop up a modal platform message box dialog.
str | The text message to display in the dialog |
title | The title of the message box window |
type | EMsgBoxType describing the button options available |
completionHanlder | an IMsgBoxCompletionHandlerFunc that will be called when a button is pressed |
Create an IGraphics layer.
Switches drawing to an offscreen bitmap for drawing IControl* pOwner The control that owns the layer
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 1988 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().
void IGraphics::StyleAllVectorControls | ( | const IVStyle & | style | ) |
Helper method to style all of the controls which inherit IVectorBase.
IVStyle | Style for the controls |
Definition at line 1924 of file IGraphics.cpp.
References GetControl(), NControls(), and IVectorBase::SetStyle().
|
inline |
true
if tool tips are enabled Definition at line 1142 of file IGraphics.h.
|
inlineprotectedvirtual |
Implemented by a graphics backend to prepare for drawing to the layer at the top of the stack.
Reimplemented in IGraphicsSkia.
Definition at line 578 of file IGraphics.h.
Referenced by PopLayer(), and PushLayer().
void IGraphics::UpdatePeers | ( | IControl * | pCaller, |
int | callerValIdx | ||
) |
This method is called after interacting with a control, so that any other controls linked to the same parameter index, will also be set dirty, and have their values updated.
pCaller | The control that triggered the parameter change. |
callerValIdx | The index of the value in the control that triggered the parameter change. |
Definition at line 611 of file IGraphics.cpp.
References ForStandardControlsFunc(), IControl::GetParamIdx(), and IControl::GetValue().
Referenced by IControl::SetDirty().
|
pure virtual |
Call this if you modify control tool tips at runtime.
|
inline |
Gets the width of the graphics context.
Definition at line 1086 of file IGraphics.h.
Referenced by GetBounds(), OnDragResize(), and Resize().
|
inline |
Gets the height of the graphics context including draw scaling.
Definition at line 1098 of file IGraphics.h.
Referenced by IGraphicsNanoVG::BeginFrame(), IGraphicsSkia::BeginFrame(), IGraphicsNanoVG::CreateAPIBitmap(), IGraphicsNanoVG::DrawResize(), IGraphicsSkia::DrawResize(), IGraphicsNanoVG::EndFrame(), IGraphicsSkia::EndFrame(), Resize(), and SetScreenScale().
|
inlinevirtual |
Definition at line 851 of file IGraphics.h.
References GetWindow().
|
inline |
Gets the width of the graphics context including draw scaling.
Definition at line 1094 of file IGraphics.h.
Referenced by IGraphicsNanoVG::BeginFrame(), IGraphicsSkia::BeginFrame(), IGraphicsNanoVG::CreateAPIBitmap(), IGraphicsNanoVG::DrawResize(), IGraphicsSkia::DrawResize(), IGraphicsNanoVG::EndFrame(), IGraphicsSkia::EndFrame(), Resize(), and SetScreenScale().
|
friend |
Definition at line 1862 of file IGraphics.h.
|
friend |
Definition at line 1861 of file IGraphics.h.
|
friend |
Definition at line 1863 of file IGraphics.h.
|
protected |
Definition at line 1867 of file IGraphics.h.
|
protected |
Definition at line 1853 of file IGraphics.h.
|
protected |
Definition at line 1854 of file IGraphics.h.
|
protected |
Definition at line 1856 of file IGraphics.h.
|
protected |
Definition at line 1857 of file IGraphics.h.
|
protected |
Definition at line 1852 of file IGraphics.h.
|
protected |
Definition at line 1865 of file IGraphics.h.
|
protected |
Definition at line 1855 of file IGraphics.h.
|
protected |
Definition at line 1868 of file IGraphics.h.
|
protected |
Definition at line 1869 of file IGraphics.h.
|
protected |
Definition at line 1858 of file IGraphics.h.
|
protected |
Definition at line 1859 of file IGraphics.h.