iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
IGraphics::Structs

Utility structures and classes for IGraphics. More...

Classes

class  IPopupMenu
 A class for setting the contents of a pop up menu. More...
 
class  IBitmap
 User-facing bitmap abstraction that you use to manage bitmap data, independant of draw class/platform. More...
 
struct  ISVG
 User-facing SVG abstraction that you use to manage SVG data ISVG doesn't actually own the image data. More...
 
struct  IColor
 Used to manage color data, independent of draw class/platform. More...
 
struct  IBlend
 Used to manage composite/blend operations, independent of draw class/platform. More...
 
struct  IFillOptions
 Used to manage fill behaviour. More...
 
struct  IStrokeOptions
 Used to manage stroke behaviour for path based drawing back ends. More...
 
struct  IText
 IText is used to manage font and text/text entry style for a piece of text on the UI, independent of draw class/platform. More...
 
struct  IRECT
 Used to manage a rectangular area, independent of draw class/platform. More...
 
struct  IMouseMod
 Used to manage mouse modifiers i.e. More...
 
struct  IMouseInfo
 Used to group mouse coordinates with mouse modifier information. More...
 
struct  IGestureInfo
 Used to describe a particular gesture. More...
 
class  IRECTList
 Used to manage a list of rectangular areas and optimize them for drawing to the screen. More...
 
struct  IMatrix
 Used to store transformation matrices. More...
 
struct  IColorStop
 Used to represent a point/stop in a gradient. More...
 
struct  IPattern
 Used to store pattern information for gradients. More...
 
class  ILayer
 An abstraction that is used to store a temporary raster image/framebuffer. More...
 
struct  IShadow
 Used to specify properties of a drop-shadow to a layer. More...
 
struct  IVColorSpec
 Contains a set of 9 colors used to theme IVControls. More...
 
struct  IVStyle
 A struct encapsulating a set of properties used to configure IVControls. More...
 

Typedefs

using IActionFunction = std::function< void(IControl *)>
 
using IAnimationFunction = std::function< void(IControl *)>
 
using IControlFunction = std::function< void(IControl *)>
 
using ILambdaDrawFunction = std::function< void(ILambdaControl *, IGraphics &, IRECT &)>
 
using IKeyHandlerFunc = std::function< bool(const IKeyPress &key, bool isUp)>
 
using IMsgBoxCompletionHandlerFunc = std::function< void(EMsgBoxResult result)>
 
using IFileDialogCompletionHandlerFunc = std::function< void(const WDL_String &fileName, const WDL_String &path)>
 
using IColorPickerHandlerFunc = std::function< void(const IColor &result)>
 
using IGestureFunc = std::function< void(IControl *, const IGestureInfo &)>
 
using IPopupFunction = std::function< void(IPopupMenu *pMenu)>
 
using IDisplayTickFunc = std::function< void()>
 
using IUIAppearanceChangedFunc = std::function< void(EUIAppearance appearance)>
 
using ITouchID = uintptr_t
 
using MTLTexturePtr = void *
 
using Milliseconds = std::chrono::duration< double, std::chrono::milliseconds::period >
 
using TimePoint = std::chrono::time_point< std::chrono::high_resolution_clock, Milliseconds >
 
using ILayerPtr = std::unique_ptr< ILayer >
 ILayerPtr is a managed pointer for transferring the ownership of layers. More...
 

Functions

void EmptyClickActionFunc (IControl *pCaller)
 A click action function that does nothing. More...
 
void DefaultClickActionFunc (IControl *pCaller)
 A click action function that triggers the default animation function for DEFAULT_ANIMATION_DURATION. More...
 
void DefaultAnimationFunc (IControl *pCaller)
 An animation function that just calls the caller control's OnEndAnimation() method at the end of the animation
More...
 
void SplashClickActionFunc (IControl *pCaller)
 The splash click action function is used by IVControls to start SplashAnimationFunc. More...
 
void SplashAnimationFunc (IControl *pCaller)
 The splash animation function is used by IVControls to animate the splash. More...
 
void ShowBubbleHorizontalActionFunc (IControl *pCaller)
 Use with a param-linked control to popup the bubble control horizontally. More...
 
void ShowBubbleVerticalActionFunc (IControl *pCaller)
 Use with a param-linked control to popup the bubble control vertically. More...
 
const IColor COLOR_TRANSPARENT (0, 0, 0, 0)
 
const IColor COLOR_TRANSLUCENT (10, 0, 0, 0)
 
const IColor COLOR_BLACK (255, 0, 0, 0)
 
const IColor COLOR_BLACK_DROP_SHADOW (128, 0, 0, 0)
 
const IColor COLOR_GRAY (255, 127, 127, 127)
 
const IColor COLOR_LIGHT_GRAY (255, 240, 240, 240)
 
const IColor COLOR_MID_GRAY (255, 200, 200, 200)
 
const IColor COLOR_DARK_GRAY (255, 70, 70, 70)
 
const IColor COLOR_WHITE (255, 255, 255, 255)
 
const IColor COLOR_RED (255, 255, 0, 0)
 
const IColor COLOR_GREEN (255, 0, 255, 0)
 
const IColor COLOR_BLUE (255, 0, 0, 255)
 
const IColor COLOR_YELLOW (255, 255, 255, 0)
 
const IColor COLOR_ORANGE (255, 255, 127, 0)
 
const IColor COLOR_INDIGO (255, 75, 0, 130)
 
const IColor COLOR_VIOLET (255, 148, 0, 211)
 
static IColor GetRainbow (int colorIdx)
 
float BlendWeight (const IBlend *pBlend)
 Helper function to extract the blend weight value from an IBlend ptr if it is valid. More...
 
static const char * TextStyleString (ETextStyle style)
 Helper to get a CString based on ETextStyle. More...
 

Variables

const IColor DEFAULT_GRAPHICS_BGCOLOR = COLOR_GRAY
 
const IColor DEFAULT_BGCOLOR = COLOR_TRANSPARENT
 
const IColor DEFAULT_FGCOLOR = COLOR_MID_GRAY
 
const IColor DEFAULT_PRCOLOR = COLOR_LIGHT_GRAY
 
const IColor DEFAULT_FRCOLOR = COLOR_DARK_GRAY
 
const IColor DEFAULT_HLCOLOR = COLOR_TRANSLUCENT
 
const IColor DEFAULT_SHCOLOR = IColor(60, 0, 0, 0)
 
const IColor DEFAULT_X1COLOR = COLOR_BLACK
 
const IColor DEFAULT_X2COLOR = COLOR_GREEN
 
const IColor DEFAULT_X3COLOR = COLOR_BLUE
 
const IColor DEFAULT_TEXT_FGCOLOR = COLOR_BLACK
 
const IColor DEFAULT_TEXTENTRY_BGCOLOR = COLOR_WHITE
 
const IColor DEFAULT_TEXTENTRY_FGCOLOR = COLOR_BLACK
 
const IBlend BLEND_75 = IBlend(EBlend::Default, 0.75f)
 
const IBlend BLEND_50 = IBlend(EBlend::Default, 0.5f)
 
const IBlend BLEND_25 = IBlend(EBlend::Default, 0.25f)
 
const IBlend BLEND_10 = IBlend(EBlend::Default, 0.1f)
 
const IBlend BLEND_05 = IBlend(EBlend::Default, 0.05f)
 
const IBlend BLEND_01 = IBlend(EBlend::Default, 0.01f)
 
const IBlend BLEND_DST_IN = IBlend(EBlend::DstIn, 1.f)
 
const IBlend BLEND_DST_OVER = IBlend(EBlend::DstOver, 1.f)
 
const IText DEFAULT_TEXT = IText()
 
const IVColorSpec DEFAULT_COLOR_SPEC = IVColorSpec()
 
static constexpr bool DEFAULT_HIDE_CURSOR = true
 
static constexpr bool DEFAULT_SHOW_VALUE = true
 
static constexpr bool DEFAULT_SHOW_LABEL = true
 
static constexpr bool DEFAULT_DRAW_FRAME = true
 
static constexpr bool DEFAULT_DRAW_SHADOWS = true
 
static constexpr bool DEFAULT_EMBOSS = false
 
static constexpr float DEFAULT_ROUNDNESS = 0.f
 
static constexpr float DEFAULT_FRAME_THICKNESS = 1.f
 
static constexpr float DEFAULT_SHADOW_OFFSET = 3.f
 
static constexpr float DEFAULT_WIDGET_FRAC = 1.f
 
static constexpr float DEFAULT_WIDGET_ANGLE = 0.f
 
static constexpr EOrientation DEFAULT_LABEL_ORIENTATION = EOrientation::North
 
const IText DEFAULT_LABEL_TEXT {DEFAULT_TEXT_SIZE + 5.f, EVAlign::Top}
 
const IText DEFAULT_VALUE_TEXT {DEFAULT_TEXT_SIZE, EVAlign::Bottom}
 
const IVStyle DEFAULT_STYLE = IVStyle()
 

Detailed Description

Utility structures and classes for IGraphics.


Class Documentation

◆ IStrokeOptions

struct IStrokeOptions

Used to manage stroke behaviour for path based drawing back ends.

Definition at line 589 of file IGraphicsStructs.h.

Class Members
ELineCap mCapOption = ELineCap::Butt
DashOptions mDash
ELineJoin mJoinOption = ELineJoin::Miter
float mMiterLimit = 10.f
bool mPreserve = false

◆ IMouseInfo

struct IMouseInfo

Used to group mouse coordinates with mouse modifier information.

Definition at line 1709 of file IGraphicsStructs.h.

Class Members
float dX = 0.0
float dY = 0.0
IMouseMod ms
float x = 0.0
float y = 0.0

◆ IGestureInfo

struct IGestureInfo

Used to describe a particular gesture.

Definition at line 1717 of file IGraphicsStructs.h.

Class Members
float angle = 0.f
float scale = 0.f
EGestureState state = EGestureState::Unknown
EGestureType type = EGestureType::Unknown
float velocity = 0.f
float x = 0.f
float y = 0.f

Typedef Documentation

◆ IActionFunction

using IActionFunction = std::function<void(IControl*)>

Definition at line 44 of file IGraphicsStructs.h.

◆ IAnimationFunction

using IAnimationFunction = std::function<void(IControl*)>

Definition at line 45 of file IGraphicsStructs.h.

◆ IColorPickerHandlerFunc

using IColorPickerHandlerFunc = std::function<void(const IColor& result)>

Definition at line 51 of file IGraphicsStructs.h.

◆ IControlFunction

using IControlFunction = std::function<void(IControl*)>

Definition at line 46 of file IGraphicsStructs.h.

◆ IDisplayTickFunc

using IDisplayTickFunc = std::function<void()>

Definition at line 54 of file IGraphicsStructs.h.

◆ IFileDialogCompletionHandlerFunc

using IFileDialogCompletionHandlerFunc = std::function<void(const WDL_String& fileName, const WDL_String& path)>

Definition at line 50 of file IGraphicsStructs.h.

◆ IGestureFunc

using IGestureFunc = std::function<void(IControl*, const IGestureInfo&)>

Definition at line 52 of file IGraphicsStructs.h.

◆ IKeyHandlerFunc

using IKeyHandlerFunc = std::function<bool(const IKeyPress& key, bool isUp)>

Definition at line 48 of file IGraphicsStructs.h.

◆ ILambdaDrawFunction

using ILambdaDrawFunction = std::function<void(ILambdaControl*, IGraphics&, IRECT&)>

Definition at line 47 of file IGraphicsStructs.h.

◆ ILayerPtr

using ILayerPtr = std::unique_ptr<ILayer>

ILayerPtr is a managed pointer for transferring the ownership of layers.

Definition at line 2359 of file IGraphicsStructs.h.

◆ IMsgBoxCompletionHandlerFunc

using IMsgBoxCompletionHandlerFunc = std::function<void(EMsgBoxResult result)>

Definition at line 49 of file IGraphicsStructs.h.

◆ IPopupFunction

using IPopupFunction = std::function<void(IPopupMenu* pMenu)>

Definition at line 53 of file IGraphicsStructs.h.

◆ ITouchID

using ITouchID = uintptr_t

Definition at line 56 of file IGraphicsStructs.h.

◆ IUIAppearanceChangedFunc

using IUIAppearanceChangedFunc = std::function<void(EUIAppearance appearance)>

Definition at line 55 of file IGraphicsStructs.h.

◆ Milliseconds

using Milliseconds = std::chrono::duration<double, std::chrono::milliseconds::period>

Definition at line 81 of file IGraphicsStructs.h.

◆ MTLTexturePtr

using MTLTexturePtr = void*

Definition at line 79 of file IGraphicsStructs.h.

◆ TimePoint

using TimePoint = std::chrono::time_point<std::chrono::high_resolution_clock, Milliseconds>

Definition at line 82 of file IGraphicsStructs.h.

Function Documentation

◆ BlendWeight()

float BlendWeight ( const IBlend pBlend)
inline

Helper function to extract the blend weight value from an IBlend ptr if it is valid.

Parameters
pBlendptr to an IBlend or nullptr
Returns
float The blend weight value

Definition at line 560 of file IGraphicsStructs.h.

Referenced by IGraphicsCanvas::DrawBitmap(), and IGraphicsNanoVG::DrawBitmap().

◆ DefaultAnimationFunc()

void DefaultAnimationFunc ( IControl pCaller)

An animation function that just calls the caller control's OnEndAnimation() method at the end of the animation

Definition at line 21 of file IControl.cpp.

References IControl::GetAnimationProgress().

Referenced by DefaultClickActionFunc(), and ILambdaControl::OnMouseDown().

◆ DefaultClickActionFunc()

void DefaultClickActionFunc ( IControl pCaller)

A click action function that triggers the default animation function for DEFAULT_ANIMATION_DURATION.

Definition at line 45 of file IControl.cpp.

References DefaultAnimationFunc(), and IControl::SetAnimation().

◆ EmptyClickActionFunc()

void EmptyClickActionFunc ( IControl pCaller)

A click action function that does nothing.

Definition at line 43 of file IControl.cpp.

◆ GetRainbow()

static IColor GetRainbow ( int  colorIdx)
static

Definition at line 510 of file IGraphicsStructs.h.

◆ ShowBubbleHorizontalActionFunc()

void ShowBubbleHorizontalActionFunc ( IControl pCaller)

Use with a param-linked control to popup the bubble control horizontally.

Definition at line 55 of file IControl.cpp.

References IParam::GetDisplayWithLabel(), IControl::GetParam(), IControl::GetRECT(), IControl::GetUI(), and IRECT::MH().

◆ ShowBubbleVerticalActionFunc()

void ShowBubbleVerticalActionFunc ( IControl pCaller)

Use with a param-linked control to popup the bubble control vertically.

Definition at line 66 of file IControl.cpp.

References IParam::GetDisplayWithLabel(), IControl::GetParam(), IControl::GetRECT(), IControl::GetUI(), and IRECT::MW().

◆ SplashAnimationFunc()

void SplashAnimationFunc ( IControl pCaller)

The splash animation function is used by IVControls to animate the splash.

Definition at line 30 of file IControl.cpp.

References IControl::As(), IControl::GetAnimationProgress(), and IControl::SetDirty().

Referenced by SplashClickActionFunc().

◆ SplashClickActionFunc()

void SplashClickActionFunc ( IControl pCaller)

◆ TextStyleString()

static const char * TextStyleString ( ETextStyle  style)
static

Helper to get a CString based on ETextStyle.

Definition at line 648 of file IGraphicsStructs.h.

Variable Documentation

◆ BLEND_01

const IBlend BLEND_01 = IBlend(EBlend::Default, 0.01f)

Definition at line 570 of file IGraphicsStructs.h.

◆ BLEND_05

const IBlend BLEND_05 = IBlend(EBlend::Default, 0.05f)

Definition at line 569 of file IGraphicsStructs.h.

◆ BLEND_10

const IBlend BLEND_10 = IBlend(EBlend::Default, 0.1f)

Definition at line 568 of file IGraphicsStructs.h.

◆ BLEND_25

const IBlend BLEND_25 = IBlend(EBlend::Default, 0.25f)

Definition at line 567 of file IGraphicsStructs.h.

◆ BLEND_50

const IBlend BLEND_50 = IBlend(EBlend::Default, 0.5f)

Definition at line 566 of file IGraphicsStructs.h.

◆ BLEND_75

const IBlend BLEND_75 = IBlend(EBlend::Default, 0.75f)

Definition at line 565 of file IGraphicsStructs.h.

◆ BLEND_DST_IN

const IBlend BLEND_DST_IN = IBlend(EBlend::DstIn, 1.f)

Definition at line 571 of file IGraphicsStructs.h.

◆ BLEND_DST_OVER

const IBlend BLEND_DST_OVER = IBlend(EBlend::DstOver, 1.f)

Definition at line 572 of file IGraphicsStructs.h.

◆ DEFAULT_BGCOLOR

const IColor DEFAULT_BGCOLOR = COLOR_TRANSPARENT

Definition at line 527 of file IGraphicsStructs.h.

◆ DEFAULT_COLOR_SPEC

const IVColorSpec DEFAULT_COLOR_SPEC = IVColorSpec()

Definition at line 2455 of file IGraphicsStructs.h.

◆ DEFAULT_DRAW_FRAME

constexpr bool DEFAULT_DRAW_FRAME = true
staticconstexpr

Definition at line 2460 of file IGraphicsStructs.h.

◆ DEFAULT_DRAW_SHADOWS

constexpr bool DEFAULT_DRAW_SHADOWS = true
staticconstexpr

Definition at line 2461 of file IGraphicsStructs.h.

◆ DEFAULT_EMBOSS

constexpr bool DEFAULT_EMBOSS = false
staticconstexpr

Definition at line 2462 of file IGraphicsStructs.h.

◆ DEFAULT_FGCOLOR

const IColor DEFAULT_FGCOLOR = COLOR_MID_GRAY

Definition at line 528 of file IGraphicsStructs.h.

◆ DEFAULT_FRAME_THICKNESS

constexpr float DEFAULT_FRAME_THICKNESS = 1.f
staticconstexpr

Definition at line 2464 of file IGraphicsStructs.h.

◆ DEFAULT_FRCOLOR

const IColor DEFAULT_FRCOLOR = COLOR_DARK_GRAY

Definition at line 531 of file IGraphicsStructs.h.

◆ DEFAULT_GRAPHICS_BGCOLOR

const IColor DEFAULT_GRAPHICS_BGCOLOR = COLOR_GRAY

Definition at line 526 of file IGraphicsStructs.h.

◆ DEFAULT_HIDE_CURSOR

constexpr bool DEFAULT_HIDE_CURSOR = true
staticconstexpr

Definition at line 2457 of file IGraphicsStructs.h.

◆ DEFAULT_HLCOLOR

const IColor DEFAULT_HLCOLOR = COLOR_TRANSLUCENT

Definition at line 532 of file IGraphicsStructs.h.

◆ DEFAULT_LABEL_ORIENTATION

constexpr EOrientation DEFAULT_LABEL_ORIENTATION = EOrientation::North
staticconstexpr

Definition at line 2468 of file IGraphicsStructs.h.

◆ DEFAULT_LABEL_TEXT

const IText DEFAULT_LABEL_TEXT {DEFAULT_TEXT_SIZE + 5.f, EVAlign::Top}

Definition at line 2469 of file IGraphicsStructs.h.

◆ DEFAULT_PRCOLOR

const IColor DEFAULT_PRCOLOR = COLOR_LIGHT_GRAY

Definition at line 529 of file IGraphicsStructs.h.

◆ DEFAULT_ROUNDNESS

constexpr float DEFAULT_ROUNDNESS = 0.f
staticconstexpr

Definition at line 2463 of file IGraphicsStructs.h.

◆ DEFAULT_SHADOW_OFFSET

constexpr float DEFAULT_SHADOW_OFFSET = 3.f
staticconstexpr

Definition at line 2465 of file IGraphicsStructs.h.

◆ DEFAULT_SHCOLOR

const IColor DEFAULT_SHCOLOR = IColor(60, 0, 0, 0)

Definition at line 533 of file IGraphicsStructs.h.

◆ DEFAULT_SHOW_LABEL

constexpr bool DEFAULT_SHOW_LABEL = true
staticconstexpr

Definition at line 2459 of file IGraphicsStructs.h.

◆ DEFAULT_SHOW_VALUE

constexpr bool DEFAULT_SHOW_VALUE = true
staticconstexpr

Definition at line 2458 of file IGraphicsStructs.h.

◆ DEFAULT_STYLE

const IVStyle DEFAULT_STYLE = IVStyle()

Definition at line 2563 of file IGraphicsStructs.h.

◆ DEFAULT_TEXT

const IText DEFAULT_TEXT = IText()

Definition at line 743 of file IGraphicsStructs.h.

◆ DEFAULT_TEXT_FGCOLOR

const IColor DEFAULT_TEXT_FGCOLOR = COLOR_BLACK

Definition at line 538 of file IGraphicsStructs.h.

◆ DEFAULT_TEXTENTRY_BGCOLOR

const IColor DEFAULT_TEXTENTRY_BGCOLOR = COLOR_WHITE

Definition at line 539 of file IGraphicsStructs.h.

◆ DEFAULT_TEXTENTRY_FGCOLOR

const IColor DEFAULT_TEXTENTRY_FGCOLOR = COLOR_BLACK

Definition at line 540 of file IGraphicsStructs.h.

◆ DEFAULT_VALUE_TEXT

const IText DEFAULT_VALUE_TEXT {DEFAULT_TEXT_SIZE, EVAlign::Bottom}

Definition at line 2470 of file IGraphicsStructs.h.

◆ DEFAULT_WIDGET_ANGLE

constexpr float DEFAULT_WIDGET_ANGLE = 0.f
staticconstexpr

Definition at line 2467 of file IGraphicsStructs.h.

◆ DEFAULT_WIDGET_FRAC

constexpr float DEFAULT_WIDGET_FRAC = 1.f
staticconstexpr

Definition at line 2466 of file IGraphicsStructs.h.

◆ DEFAULT_X1COLOR

const IColor DEFAULT_X1COLOR = COLOR_BLACK

Definition at line 534 of file IGraphicsStructs.h.

◆ DEFAULT_X2COLOR

const IColor DEFAULT_X2COLOR = COLOR_GREEN

Definition at line 535 of file IGraphicsStructs.h.

◆ DEFAULT_X3COLOR

const IColor DEFAULT_X3COLOR = COLOR_BLUE

Definition at line 536 of file IGraphicsStructs.h.