41 #ifndef YOCTO_DISPLAY_H 42 #define YOCTO_DISPLAY_H 54 #ifndef _Y_ENABLED_ENUM 55 #define _Y_ENABLED_ENUM 62 #ifndef _Y_ORIENTATION_ENUM 63 #define _Y_ORIENTATION_ENUM 72 #ifndef _Y_DISPLAYTYPE_ENUM 73 #define _Y_DISPLAYTYPE_ENUM 81 #define Y_STARTUPSEQ_INVALID (YAPI_INVALID_STRING) 82 #define Y_BRIGHTNESS_INVALID (YAPI_INVALID_UINT) 83 #define Y_DISPLAYWIDTH_INVALID (YAPI_INVALID_UINT) 84 #define Y_DISPLAYHEIGHT_INVALID (YAPI_INVALID_UINT) 85 #define Y_LAYERWIDTH_INVALID (YAPI_INVALID_UINT) 86 #define Y_LAYERHEIGHT_INVALID (YAPI_INVALID_UINT) 87 #define Y_LAYERCOUNT_INVALID (YAPI_INVALID_UINT) 88 #define Y_COMMAND_INVALID (YAPI_INVALID_STRING) 129 #pragma option push -w-8022 147 int command_push(
string cmd);
148 int command_flush(
string cmd);
183 virtual int reset(
void);
195 virtual int clear(
void);
209 virtual int selectColorPen(
int color);
225 virtual int selectGrayPen(
int graylevel);
237 virtual int selectEraser(
void);
255 virtual int setAntialiasingMode(
bool mode);
267 virtual int drawPixel(
int x,
int y);
281 virtual int drawRect(
int x1,
int y1,
int x2,
int y2);
295 virtual int drawBar(
int x1,
int y1,
int x2,
int y2);
308 virtual int drawCircle(
int x,
int y,
int r);
321 virtual int drawDisc(
int x,
int y,
int r);
336 virtual int selectFont(
string fontname);
356 virtual int drawText(
int x,
int y,
Y_ALIGN anchor,
string text);
372 virtual int drawImage(
int x,
int y,
string imagename);
394 virtual int drawBitmap(
int x,
int y,
int w,
string bitmap,
int bgcol);
406 virtual int moveTo(
int x,
int y);
420 virtual int lineTo(
int x,
int y);
435 virtual int consoleOut(
string text);
449 virtual int setConsoleMargins(
int x1,
int y1,
int x2,
int y2);
462 virtual int setConsoleBackground(
int bgcol);
474 virtual int setConsoleWordWrap(
bool wordwrap);
484 virtual int clearConsole(
void);
500 virtual int setLayerPosition(
int x,
int y,
int scrollTime);
512 virtual int hide(
void);
521 virtual int unhide(
void);
528 virtual YDisplay* get_display(
void);
537 virtual int get_displayWidth(
void);
546 virtual int get_displayHeight(
void);
555 virtual int get_layerWidth(
void);
564 virtual int get_layerHeight(
void);
566 virtual int resetHiddenFlag(
void);
572 int drawBitmap(
int x,
int y,
int w,
const std::vector<unsigned char>& data,
int bgcol);
588 #pragma option push -w-8022 657 {
return this->get_enabled(); }
670 {
return this->set_enabled(newval); }
679 string get_startupSeq(
void);
682 {
return this->get_startupSeq(); }
695 int set_startupSeq(
const string& newval);
697 {
return this->set_startupSeq(newval); }
706 int get_brightness(
void);
709 {
return this->get_brightness(); }
722 int set_brightness(
int newval);
724 {
return this->set_brightness(newval); }
737 {
return this->get_orientation(); }
752 {
return this->set_orientation(newval); }
761 int get_displayWidth(
void);
764 {
return this->get_displayWidth(); }
773 int get_displayHeight(
void);
776 {
return this->get_displayHeight(); }
789 {
return this->get_displayType(); }
798 int get_layerWidth(
void);
801 {
return this->get_layerWidth(); }
810 int get_layerHeight(
void);
813 {
return this->get_layerHeight(); }
822 int get_layerCount(
void);
825 {
return this->get_layerCount(); }
827 string get_command(
void);
830 {
return this->get_command(); }
832 int set_command(
const string& newval);
834 {
return this->set_command(newval); }
863 static YDisplay* FindDisplay(
string func);
890 virtual int resetAll(
void);
903 virtual int fade(
int brightness,
int duration);
914 virtual int newSequence(
void);
927 virtual int saveSequence(
string sequenceName);
939 virtual int playSequence(
string sequenceName);
955 virtual int pauseSequence(
int delay_ms);
965 virtual int stopSequence(
void);
979 virtual int upload(
string pathname,
string content);
995 virtual int copyLayerContent(
int srcLayerId,
int dstLayerId);
1012 virtual int swapLayerContent(
int layerIdA,
int layerIdB);
1027 {
return this->nextDisplay();}
1038 static YDisplay* FirstDisplay(
void);
1064 int flushLayers(
void);
1066 int sendCommand(
string cmd);
1069 void resetHiddenLayerFlags(
void);
Y_ENABLED_enum enabled(void)
Y_ORIENTATION_enum orientation(void)
void(* YDisplayValueCallback)(YDisplay *func, const string &functionValue)
YDisplay * yFindDisplay(const string &func)
Y_DISPLAYTYPE_enum _displayType
static YDisplay * FindDisplay(string func)
Y_ORIENTATION_enum _orientation
int setCommand(const string &newval)
static const string STARTUPSEQ_INVALID
static YDisplay * Find(string func)
#define YAPI_INVALID_UINT
int setEnabled(Y_ENABLED_enum newval)
virtual int _parseAttr(YJSONObject *json_val)
static YDisplay * First(void)
int setOrientation(Y_ORIENTATION_enum newval)
int setStartupSeq(const string &newval)
static const string COMMAND_INVALID
int setBrightness(int newval)
static int upload(const char *hubserial, const char *subpath, const char *filename, u8 *data, u32 data_len, char *errmsg)
virtual int registerValueCallback(YFunctionValueCallback callback)
YDisplayValueCallback _valueCallbackDisplay
#define YOCTO_CLASS_EXPORT
static YDisplay * FirstDisplay(void)
Y_DISPLAYTYPE_enum displayType(void)
vector< YDisplayLayer * > _allDisplayLayers
virtual int _invokeValueCallback(string value)
YDisplay * yFirstDisplay(void)