17 #ifndef DGL_NANO_WIDGET_HPP_INCLUDED
18 #define DGL_NANO_WIDGET_HPP_INCLUDED
60 NanoImage(NVGcontext*
const context,
const int imageId) noexcept;
70 DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(
NanoImage)
174 ALIGN_CENTER = 1 << 1,
175 ALIGN_RIGHT = 1 << 2,
178 ALIGN_MIDDLE = 1 << 4,
179 ALIGN_BOTTOM = 1 << 5,
180 ALIGN_BASELINE = 1 << 6
220 PatternRepeat repeat;
227 Paint(
const NVGpaint&) noexcept;
228 operator NVGpaint()
const noexcept;
256 NanoVG(
const int textAtlasWidth,
const int textAtlasHeight);
276 void beginFrame(
const uint width,
const uint height,
const float scaleFactor = 1.0f,
const Alpha alpha = PREMULTIPLIED_ALPHA);
319 void strokeColor(
const int red,
const int green,
const int blue,
const int alpha = 255);
325 void strokeColor(
const float red,
const float green,
const float blue,
const float alpha = 1.0f);
341 void fillColor(
const int red,
const int green,
const int blue,
const int alpha = 255);
347 void fillColor(
const float red,
const float green,
const float blue,
const float alpha = 1.0f);
369 void lineCap(LineCap cap = BUTT);
375 void lineJoin(LineCap join = MITER);
392 void transform(
float a,
float b,
float c,
float d,
float e,
float f);
407 void skewX(
float angle);
412 void skewY(
float angle);
417 void scale(
float x,
float y);
480 static void transformPoint(
float& dstx,
float& dsty,
const float xform[6],
float srcx,
float srcy);
527 Paint
boxGradient(
float x,
float y,
float w,
float h,
float r,
float f,
const Color& icol,
const Color& ocol);
542 Paint
imagePattern(
float ox,
float oy,
float ex,
float ey,
float angle,
const NanoImage* image, PatternRepeat repeat);
551 void scissor(
float x,
float y,
float w,
float h);
569 void moveTo(
float x,
float y);
574 void lineTo(
float x,
float y);
579 void bezierTo(
float c1x,
float c1y,
float c2x,
float c2y,
float x,
float y);
584 void arcTo(
float x1,
float y1,
float x2,
float y2,
float radius);
599 void arc(
float cx,
float cy,
float r,
float a0,
float a1, Winding dir);
604 void rect(
float x,
float y,
float w,
float h);
609 void roundedRect(
float x,
float y,
float w,
float h,
float r);
614 void ellipse(
float cx,
float cy,
float rx,
float ry);
619 void circle(
float cx,
float cy,
float r);
638 FontId
createFont(
const char* name,
const char* filename);
644 FontId
createFontMem(
const char* name,
const uchar* data,
int ndata,
bool freeData);
696 float text(
float x,
float y,
const char*
string,
const char* end);
703 void textBox(
float x,
float y,
float breakRowWidth,
const char*
string,
const char* end);
717 void textBoxBounds(
float x,
float y,
float breakRowWidth,
const char*
string,
const char* end,
float* bounds);
723 int textGlyphPositions(
float x,
float y,
const char*
string,
const char* end, GlyphPosition* positions,
int maxPositions);
729 void textMetrics(
float* ascender,
float* descender,
float* lineh);
736 int textBreakLines(
const char*
string,
const char* end,
float breakRowWidth, TextRow* rows,
int maxRows);
739 NVGcontext*
const fContext;
742 DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(
NanoVG)
765 leakDetector_NanoWidget()
782 void onDisplay()
override
789 glDisable(GL_CULL_FACE);
792 DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(
NanoWidget)
799 #endif // DGL_NANO_WIDGET_HPP_INCLUDED
static void transformPoint(float &dstx, float &dsty, const float xform[6], float srcx, float srcy)
NVGcontext * getContext() const noexcept
Definition: NanoVG.hpp:267
void textAlign(Align align)
Definition: NanoVG.hpp:237
Definition: NanoVG.hpp:37
void lineTo(float x, float y)
int textGlyphPositions(float x, float y, const char *string, const char *end, GlyphPosition *positions, int maxPositions)
Paint imagePattern(float ox, float oy, float ex, float ey, float angle, const NanoImage *image, PatternRepeat repeat)
static void transformScale(float dst[6], float sx, float sy)
void currentTransform(float xform[6])
void circle(float cx, float cy, float r)
static void transformMultiply(float dst[6], const float src[6])
void fontSize(float size)
void miterLimit(float limit)
Definition: Window.hpp:30
void strokeWidth(float size)
void textBoxBounds(float x, float y, float breakRowWidth, const char *string, const char *end, float *bounds)
Paint linearGradient(float sx, float sy, float ex, float ey, const Color &icol, const Color &ocol)
void translate(float x, float y)
static void transformPremultiply(float dst[6], const float src[6])
void arcTo(float x1, float y1, float x2, float y2, float radius)
void scale(float x, float y)
static void transformSkewX(float dst[6], float a)
void beginFrame(const uint width, const uint height, const float scaleFactor=1.0f, const Alpha alpha=PREMULTIPLIED_ALPHA)
void rect(float x, float y, float w, float h)
Paint radialGradient(float cx, float cy, float inr, float outr, const Color &icol, const Color &ocol)
void fontBlur(float blur)
void strokePaint(const Paint &paint)
void fontFaceId(FontId font)
void moveTo(float x, float y)
void transform(float a, float b, float c, float d, float e, float f)
void ellipse(float cx, float cy, float rx, float ry)
void bezierTo(float c1x, float c1y, float c2x, float c2y, float x, float y)
void fontFace(const char *font)
NanoImage * createImageMem(uchar *data, int ndata)
FontId createFontMem(const char *name, const uchar *data, int ndata, bool freeData)
void updateImage(const uchar *const data)
FontId findFont(const char *name)
NanoImage * createImage(const char *filename)
Definition: NanoVG.hpp:212
void pathWinding(Winding dir)
Definition: NanoVG.hpp:168
void textLineHeight(float lineHeight)
static void transformIdentity(float dst[6])
Size< uint > getSize() const noexcept
float textBounds(float x, float y, const char *string, const char *end, Rectangle< float > &bounds)
static float radToDeg(float rad)
Definition: NanoVG.hpp:231
FontId createFont(const char *name, const char *filename)
static void transformSkewY(float dst[6], float a)
static int transformInverse(float dst[6], const float src[6])
void roundedRect(float x, float y, float w, float h, float r)
static float degToRad(float deg)
void textBox(float x, float y, float breakRowWidth, const char *string, const char *end)
static void transformTranslate(float dst[6], float tx, float ty)
void arc(float cx, float cy, float r, float a0, float a1, Winding dir)
void lineCap(LineCap cap=BUTT)
Definition: Geometry.hpp:30
float text(float x, float y, const char *string, const char *end)
void lineJoin(LineCap join=MITER)
NanoImage(NVGcontext *const context, const int imageId) noexcept
void fillColor(const Color &color)
void scissor(float x, float y, float w, float h)
void strokeColor(const Color &color)
void textMetrics(float *ascender, float *descender, float *lineh)
void fillPaint(const Paint &paint)
static void transformRotate(float dst[6], float a)
Paint boxGradient(float x, float y, float w, float h, float r, float f, const Color &icol, const Color &ocol)
NanoImage * createImageRGBA(uint w, uint h, const uchar *data)
void textLetterSpacing(float spacing)
int textBreakLines(const char *string, const char *end, float breakRowWidth, TextRow *rows, int maxRows)