-
Notifications
You must be signed in to change notification settings - Fork 3
/
nvg_helpers.h
35 lines (31 loc) · 1.61 KB
/
nvg_helpers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef __PICLOCK_NVG_HELPERS_H_INCLUDED
#define __PICLOCK_NVG_HELPERS_H_INCLUDED
#include <nanovg.h>
#include <string>
#include "fonts.h"
//Legacy type from old OpenVG libraries...
typedef float VGfloat;
extern NVGcolor colWhite;
extern NVGcolor colMidGray;
extern NVGcolor colBlack;
extern NVGcolor colRed;
extern NVGcolor colBlue;
extern NVGcolor colNtpSynced;
extern NVGcolor colNtpNotSync[2];
extern NVGcolor colNtpText;
extern NVGcolor colCommsOk;
extern NVGcolor colCommsFail;
extern void Rotate(NVGcontext *vg, float degrees);
extern void Roundrect(NVGcontext *vg, float x, float y, float w, float h, float r);
extern void Rect(NVGcontext *vg, float x, float y, float w, float h);
extern void Line(NVGcontext *vg, float x1, float y1, float x2, float y2);
extern float TextHeight(NVGcontext *vg, const Fontinfo &f, int pointsize);
extern float TextWidth(NVGcontext *vg, const char * str, const Fontinfo &f, int pointsize);
extern void TextMid(NVGcontext *vg, float x, float y, const char* s, const Fontinfo &f, int pointsize);
extern void Text(NVGcontext *vg, float x, float y, const char* s, const Fontinfo &f, int pointsize);
extern void drawimage(NVGcontext *vg, float x, float y, float w, float h, int img_handle);
extern void RotateTextClipCache();
extern void TextClip(NVGcontext *vg, float x, float y, const std::string &s, const Fontinfo &f, int pointsize, float clipwidth, const std::string &clip_str);
extern void TextMidBottom(NVGcontext *vg, float x, float y, const char* s, const Fontinfo &f, int pointsize);
extern int MaxPointSize(NVGcontext *vg, float width, float height, const std::string & text, const Fontinfo & f);
#endif