From 090cc95f2bdee05ffffb0e110f9b9342aee2ba29 Mon Sep 17 00:00:00 2001 From: Kirill Shumilov Date: Fri, 21 Aug 2020 17:00:32 +0300 Subject: [PATCH] chore(stdlib): update `xod/graphics` --- .../__lib__/xod/graphics/bitmap/patch.cpp | 20 ++---- .../__lib__/xod/graphics/canvas/patch.cpp | 52 ++++++-------- .../graphics/circle-outline-colored/patch.cpp | 52 ++++++-------- .../xod/graphics/circle-outline/patch.cpp | 49 ++++++------- .../graphics/circle-solid-colored/patch.cpp | 66 ++++++++---------- .../xod/graphics/circle-solid/patch.cpp | 63 +++++++---------- .../__lib__/xod/graphics/graphics/patch.cpp | 19 ++---- .../xod/graphics/heart-16x16-bw/patch.cpp | 57 +++++++--------- .../xod/graphics/heart-16x16-rgb/patch.cpp | 57 +++++++--------- .../xod/graphics/heart-16x16-rgba/patch.cpp | 58 ++++++++-------- .../xod/graphics/humidity-16x16-bw/patch.cpp | 57 +++++++--------- .../xod/graphics/humidity-16x16-rgb/patch.cpp | 57 +++++++--------- .../graphics/humidity-16x16-rgba/patch.cpp | 57 +++++++--------- .../__lib__/xod/graphics/image/patch.cpp | 59 +++++++--------- .../xod/graphics/line-colored/patch.cpp | 60 +++++++--------- workspace/__lib__/xod/graphics/line/patch.cpp | 55 ++++++--------- .../xod/graphics/point-colored/patch.cpp | 52 ++++++-------- .../__lib__/xod/graphics/point/patch.cpp | 47 +++++-------- .../pulse-on-change(graphics)/patch.cpp | 15 ++-- .../graphics/rect-outline-colored/patch.cpp | 60 +++++++--------- .../xod/graphics/rect-outline/patch.cpp | 56 ++++++--------- .../xod/graphics/rect-solid-colored/patch.cpp | 59 +++++++--------- .../__lib__/xod/graphics/rect-solid/patch.cpp | 55 ++++++--------- .../graphics/temperature-16x16-bw/patch.cpp | 57 +++++++--------- .../graphics/temperature-16x16-rgb/patch.cpp | 57 +++++++--------- .../graphics/temperature-16x16-rgba/patch.cpp | 57 +++++++--------- .../xod/graphics/text-colored/patch.cpp | 61 +++++++---------- workspace/__lib__/xod/graphics/text/patch.cpp | 57 +++++++--------- .../triangle-outline-colored/patch.cpp | 68 ++++++++----------- .../xod/graphics/triangle-outline/patch.cpp | 64 +++++++---------- .../graphics/triangle-solid-colored/patch.cpp | 67 ++++++++---------- .../xod/graphics/triangle-solid/patch.cpp | 63 +++++++---------- .../xod/graphics/warning-16x16-bw/patch.cpp | 57 +++++++--------- .../xod/graphics/warning-16x16-rgb/patch.cpp | 57 +++++++--------- .../xod/graphics/warning-16x16-rgba/patch.cpp | 57 +++++++--------- .../xod/graphics/wifi-16x16-bw/patch.cpp | 57 +++++++--------- .../xod/graphics/wifi-16x16-rgb/patch.cpp | 57 +++++++--------- .../xod/graphics/wifi-16x16-rgba/patch.cpp | 57 +++++++--------- 38 files changed, 879 insertions(+), 1196 deletions(-) diff --git a/workspace/__lib__/xod/graphics/bitmap/patch.cpp b/workspace/__lib__/xod/graphics/bitmap/patch.cpp index bbadd23d..689994b0 100644 --- a/workspace/__lib__/xod/graphics/bitmap/patch.cpp +++ b/workspace/__lib__/xod/graphics/bitmap/patch.cpp @@ -1,16 +1,8 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State {}; - -using Type = Bitmap*; - -// clang-format off -{{ GENERATED_CODE }} -// clang-format on - -void evaluate(Context ctx) {} +node { + meta { + using Type = Bitmap*; + } + void evaluate(Context ctx) {} +} diff --git a/workspace/__lib__/xod/graphics/canvas/patch.cpp b/workspace/__lib__/xod/graphics/canvas/patch.cpp index 3a76d2b5..b225bef3 100644 --- a/workspace/__lib__/xod/graphics/canvas/patch.cpp +++ b/workspace/__lib__/xod/graphics/canvas/patch.cpp @@ -1,43 +1,31 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State { +node { uint8_t mem[sizeof(Canvas)]; Canvas* canvas; int16_t x, y, w, h; -}; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto bgColor = getValue(ctx); + auto fgColor = getValue(ctx); -void evaluate(Context ctx) { + int16_t x = (int16_t)getValue(ctx); + int16_t y = (int16_t)getValue(ctx); + int16_t w = (int16_t)getValue(ctx); + int16_t h = (int16_t)getValue(ctx); - auto state = getState(ctx); + if (isSettingUp()) { + canvas = new (mem) Canvas(); + } - auto bgColor = getValue(ctx); - auto fgColor = getValue(ctx); - - int16_t x = (int16_t)getValue(ctx); - int16_t y = (int16_t)getValue(ctx); - int16_t w = (int16_t)getValue(ctx); - int16_t h = (int16_t)getValue(ctx); - - if (isSettingUp()) { - state->canvas = new (state->mem) Canvas(); - } - - if (isSettingUp() || x != state->x || y != state->y || w != state->w || h != state->h || isInputDirty(ctx) || isInputDirty(ctx)) { - state->x = x; - state->y = y; - state->w = w; - state->h = h; - state->canvas->setPosition(x, y, w, h); - state->canvas->setStyle(bgColor, fgColor); - emitValue(ctx, state->canvas); + if (isSettingUp() || x != x || y != y || w != w || h != h || isInputDirty(ctx) || isInputDirty(ctx)) { + x = x; + y = y; + w = w; + h = h; + canvas->setPosition(x, y, w, h); + canvas->setStyle(bgColor, fgColor); + emitValue(ctx, canvas); + } } } diff --git a/workspace/__lib__/xod/graphics/circle-outline-colored/patch.cpp b/workspace/__lib__/xod/graphics/circle-outline-colored/patch.cpp index 991cc8e2..c81477a3 100644 --- a/workspace/__lib__/xod/graphics/circle-outline-colored/patch.cpp +++ b/workspace/__lib__/xod/graphics/circle-outline-colored/patch.cpp @@ -1,45 +1,35 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State { +node { uint8_t mem[sizeof(CircleOutline)]; CircleOutline* circleOutlineColored; int16_t x, y, r; XColor strokeColor; -}; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); + strokeColor = getValue(ctx); -void evaluate(Context ctx) { - auto state = getState(ctx); + int16_t x = (int16_t)getValue(ctx); + int16_t y = (int16_t)getValue(ctx); + int16_t r = (int16_t)getValue(ctx); - auto gfx = getValue(ctx); - state->strokeColor = getValue(ctx); + if (isSettingUp()) { + circleOutlineColored = new (mem) CircleOutline(gfx); + } - int16_t x = (int16_t)getValue(ctx); - int16_t y = (int16_t)getValue(ctx); - int16_t r = (int16_t)getValue(ctx); + if (isSettingUp() || x != x || y != y || r != r || isInputDirty(ctx)) { + x = x; + y = y; + r = r; + circleOutlineColored->setPosition(x, y, r); + circleOutlineColored->setStyle(&strokeColor); + emitValue(ctx, circleOutlineColored); + } - if (isSettingUp()) { - state->circleOutlineColored = new (state->mem) CircleOutline(gfx); + if (isInputDirty(ctx)) { + emitValue(ctx, circleOutlineColored); + } } - if (isSettingUp() || x != state->x || y != state->y || r != state->r || isInputDirty(ctx)) { - state->x = x; - state->y = y; - state->r = r; - state->circleOutlineColored->setPosition(x, y, r); - state->circleOutlineColored->setStyle(&state->strokeColor); - emitValue(ctx, state->circleOutlineColored); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->circleOutlineColored); - } } diff --git a/workspace/__lib__/xod/graphics/circle-outline/patch.cpp b/workspace/__lib__/xod/graphics/circle-outline/patch.cpp index bd7a145c..9514e1ca 100644 --- a/workspace/__lib__/xod/graphics/circle-outline/patch.cpp +++ b/workspace/__lib__/xod/graphics/circle-outline/patch.cpp @@ -1,42 +1,31 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State { +node { uint8_t mem[sizeof(CircleOutline)]; CircleOutline* circleOutline; int16_t x, y, r; -}; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); -void evaluate(Context ctx) { - auto state = getState(ctx); + int16_t x = (int16_t)getValue(ctx); + int16_t y = (int16_t)getValue(ctx); + int16_t r = (int16_t)getValue(ctx); - auto gfx = getValue(ctx); + if (isSettingUp()) { + circleOutline = new (mem) CircleOutline(gfx); + } - int16_t x = (int16_t)getValue(ctx); - int16_t y = (int16_t)getValue(ctx); - int16_t r = (int16_t)getValue(ctx); + if (isSettingUp() || x != x || y != y || r != r) { + x = x; + y = y; + r = r; + circleOutline->setPosition(x, y, r); + emitValue(ctx, circleOutline); + } - if (isSettingUp()) { - state->circleOutline = new (state->mem) CircleOutline(gfx); - } - - if (isSettingUp() || x != state->x || y != state->y || r != state->r) { - state->x = x; - state->y = y; - state->r = r; - state->circleOutline->setPosition(x, y, r); - emitValue(ctx, state->circleOutline); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->circleOutline); + if (isInputDirty(ctx)) { + emitValue(ctx, circleOutline); + } } } diff --git a/workspace/__lib__/xod/graphics/circle-solid-colored/patch.cpp b/workspace/__lib__/xod/graphics/circle-solid-colored/patch.cpp index 1b0b85fb..40eee2b2 100644 --- a/workspace/__lib__/xod/graphics/circle-solid-colored/patch.cpp +++ b/workspace/__lib__/xod/graphics/circle-solid-colored/patch.cpp @@ -1,45 +1,35 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State { +node { uint8_t mem[sizeof(CircleSolid)]; CircleSolid* circleSolidColored; int16_t x, y, r; XColor fillColor; + + void evaluate(Context ctx) { + auto gfx = getValue(ctx); + fillColor = getValue(ctx); + + int16_t x = (int16_t)getValue(ctx); + int16_t y = (int16_t)getValue(ctx); + int16_t r = (int16_t)getValue(ctx); + + if (isSettingUp()) { + circleSolidColored = new (mem) CircleSolid(gfx); + } + + if (isSettingUp() || x != x || y != y || r != r || isInputDirty(ctx)) { + x = x; + y = y; + r = r; + circleSolidColored->setPosition(x, y, r); + circleSolidColored->setStyle(&fillColor); + emitValue(ctx, circleSolidColored); + } + + if (isInputDirty(ctx)) { + emitValue(ctx, circleSolidColored); + } + } + }; - -// clang-format off -{{ GENERATED_CODE }} -// clang-format on - -void evaluate(Context ctx) { - auto state = getState(ctx); - - auto gfx = getValue(ctx); - state->fillColor = getValue(ctx); - - int16_t x = (int16_t)getValue(ctx); - int16_t y = (int16_t)getValue(ctx); - int16_t r = (int16_t)getValue(ctx); - - if (isSettingUp()) { - state->circleSolidColored = new (state->mem) CircleSolid(gfx); - } - - if (isSettingUp() || x != state->x || y != state->y || r != state->r || isInputDirty(ctx)) { - state->x = x; - state->y = y; - state->r = r; - state->circleSolidColored->setPosition(x, y, r); - state->circleSolidColored->setStyle(&state->fillColor); - emitValue(ctx, state->circleSolidColored); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->circleSolidColored); - } -} diff --git a/workspace/__lib__/xod/graphics/circle-solid/patch.cpp b/workspace/__lib__/xod/graphics/circle-solid/patch.cpp index 5a9d8128..2bb27d0a 100644 --- a/workspace/__lib__/xod/graphics/circle-solid/patch.cpp +++ b/workspace/__lib__/xod/graphics/circle-solid/patch.cpp @@ -1,42 +1,31 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State { +node { uint8_t mem[sizeof(CircleSolid)]; CircleSolid* circleSolid; - int16_t x, y, r; + int16_t _x, _y, _r; + + void evaluate(Context ctx) { + auto gfx = getValue(ctx); + + int16_t x = (int16_t)getValue(ctx); + int16_t y = (int16_t)getValue(ctx); + int16_t r = (int16_t)getValue(ctx); + + if (isSettingUp()) { + circleSolid = new (mem) CircleSolid(gfx); + } + + if (isSettingUp() || x != _x || y != _y || r != _r) { + _x = x; + _y = y; + _r = r; + circleSolid->setPosition(x, y, r); + emitValue(ctx, circleSolid); + } + + if (isInputDirty(ctx)) { + emitValue(ctx, circleSolid); + } + } }; - -// clang-format off -{{ GENERATED_CODE }} -// clang-format on - -void evaluate(Context ctx) { - auto state = getState(ctx); - - auto gfx = getValue(ctx); - - int16_t x = (int16_t)getValue(ctx); - int16_t y = (int16_t)getValue(ctx); - int16_t r = (int16_t)getValue(ctx); - - if (isSettingUp()) { - state->circleSolid = new (state->mem) CircleSolid(gfx); - } - - if (isSettingUp() || x != state->x || y != state->y || r != state->r) { - state->x = x; - state->y = y; - state->r = r; - state->circleSolid->setPosition(x, y, r); - emitValue(ctx, state->circleSolid); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->circleSolid); - } -} diff --git a/workspace/__lib__/xod/graphics/graphics/patch.cpp b/workspace/__lib__/xod/graphics/graphics/patch.cpp index 6440b3ea..71b408b1 100644 --- a/workspace/__lib__/xod/graphics/graphics/patch.cpp +++ b/workspace/__lib__/xod/graphics/graphics/patch.cpp @@ -1,16 +1,9 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State {}; +node { + meta { + using Type = XGraphics*; + } -using Type = XGraphics*; - -// clang-format off -{{ GENERATED_CODE }} -// clang-format on - -void evaluate(Context ctx) {} + void evaluate(Context ctx) {} +} diff --git a/workspace/__lib__/xod/graphics/heart-16x16-bw/patch.cpp b/workspace/__lib__/xod/graphics/heart-16x16-bw/patch.cpp index 36ab35d5..24d68c5d 100644 --- a/workspace/__lib__/xod/graphics/heart-16x16-bw/patch.cpp +++ b/workspace/__lib__/xod/graphics/heart-16x16-bw/patch.cpp @@ -1,34 +1,29 @@ +nodespace { + static const unsigned char icon[] PROGMEM = { -static const unsigned char icon[] PROGMEM = { + 0b00000000, 0b00000000, // + 0b00000000, 0b00000000, // + 0b00111100, 0b01111000, // #### #### + 0b01111110, 0b11111100, // ###### ###### + 0b11111111, 0b11111110, // ############### + 0b11111111, 0b11111110, // ############### + 0b11111111, 0b11111110, // ############### + 0b11111111, 0b11111110, // ############### + 0b01111111, 0b11111100, // ############# + 0b01111111, 0b11111100, // ############# + 0b00111111, 0b11111000, // ########### + 0b00011111, 0b11110000, // ######### + 0b00001111, 0b11100000, // ####### + 0b00000111, 0b11000000, // ##### + 0b00000011, 0b10000000, // ### + 0b00000001, 0b00000000, // # -0b00000000, 0b00000000, // -0b00000000, 0b00000000, // -0b00111100, 0b01111000, // #### #### -0b01111110, 0b11111100, // ###### ###### -0b11111111, 0b11111110, // ############### -0b11111111, 0b11111110, // ############### -0b11111111, 0b11111110, // ############### -0b11111111, 0b11111110, // ############### -0b01111111, 0b11111100, // ############# -0b01111111, 0b11111100, // ############# -0b00111111, 0b11111000, // ########### -0b00011111, 0b11110000, // ######### -0b00001111, 0b11100000, // ####### -0b00000111, 0b11000000, // ##### -0b00000011, 0b10000000, // ### -0b00000001, 0b00000000, // # - -}; - -struct State { - uint8_t mem[sizeof(Bitmap)]; - Bitmap* myBitmap; -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - auto state = getState(ctx); - state->myBitmap = new (state->mem) Bitmap(icon, 0, 16, 16); - emitValue(ctx, state->myBitmap); + }; +} +node { + Bitmap myBitmap = Bitmap(icon, 0, 16, 16); + + void evaluate(Context ctx) { + emitValue(ctx, &myBitmap); + } } diff --git a/workspace/__lib__/xod/graphics/heart-16x16-rgb/patch.cpp b/workspace/__lib__/xod/graphics/heart-16x16-rgb/patch.cpp index 0a0352f2..d23dab03 100644 --- a/workspace/__lib__/xod/graphics/heart-16x16-rgb/patch.cpp +++ b/workspace/__lib__/xod/graphics/heart-16x16-rgb/patch.cpp @@ -1,34 +1,29 @@ +nodespace { + static const unsigned char icon[] PROGMEM = { -static const unsigned char icon[] PROGMEM = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x03,0xd8,0x03,0xc0,0x03,0x00,0x00,0x00,0x00,0xc0,0x02,0xd8,0x03,0xc0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x86,0xe1,0x28,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xe0,0x03,0xe0,0x03,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x98,0x02,0xea,0x8d,0xe0,0x87,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x03,0x98,0x02,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0xa8,0x02,0xea,0xae,0xe0,0x06,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x03,0xa0,0x02,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x88,0x02,0xe1,0x69,0xe0,0x26,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xd0,0x03,0x80,0x01,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x24,0xe0,0xa7,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xd8,0x03,0xc0,0x22,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd8,0x03,0xe0,0x04,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xd8,0x03,0xc0,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd8,0x03,0xd8,0x04,0xd8,0x04,0xd0,0x03,0xc8,0x03,0xc0,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x02,0xc0,0x23,0xc0,0x23,0xb8,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x22,0x90,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x03,0xd8,0x03,0xc0,0x03,0x00,0x00,0x00,0x00,0xc0,0x02,0xd8,0x03,0xc0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x86,0xe1,0x28,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xe0,0x03,0xe0,0x03,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x98,0x02,0xea,0x8d,0xe0,0x87,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x03,0x98,0x02,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0xa8,0x02,0xea,0xae,0xe0,0x06,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x03,0xa0,0x02,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x88,0x02,0xe1,0x69,0xe0,0x26,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xd0,0x03,0x80,0x01,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x24,0xe0,0xa7,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xd8,0x03,0xc0,0x22,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd8,0x03,0xe0,0x04,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xd8,0x03,0xc0,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd8,0x03,0xd8,0x04,0xd8,0x04,0xd0,0x03,0xc8,0x03,0xc0,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x02,0xc0,0x23,0xc0,0x23,0xb8,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x22,0x90,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - -}; - -struct State { - uint8_t mem[sizeof(Bitmap)]; - Bitmap* myBitmap; -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - auto state = getState(ctx); - state->myBitmap = new (state->mem) Bitmap(icon, 1, 16, 16); - emitValue(ctx, state->myBitmap); + }; +} +node { + Bitmap myBitmap = Bitmap(icon, 1, 16, 16); + + void evaluate(Context ctx) { + emitValue(ctx, &myBitmap); + } } diff --git a/workspace/__lib__/xod/graphics/heart-16x16-rgba/patch.cpp b/workspace/__lib__/xod/graphics/heart-16x16-rgba/patch.cpp index a1c12ef8..2e9d87ce 100644 --- a/workspace/__lib__/xod/graphics/heart-16x16-rgba/patch.cpp +++ b/workspace/__lib__/xod/graphics/heart-16x16-rgba/patch.cpp @@ -1,34 +1,30 @@ +nodespace { + static const unsigned char icon[] PROGMEM = { -static const unsigned char icon[] PROGMEM = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x03,0xd8,0x03,0xc0,0x03,0x00,0x00,0x00,0x00,0xc0,0x02,0xd8,0x03,0xc0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x86,0xe1,0x28,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xe0,0x03,0xe0,0x03,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x98,0x02,0xea,0x8d,0xe0,0x87,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x03,0x98,0x02,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0xa8,0x02,0xea,0xae,0xe0,0x06,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x03,0xa0,0x02,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x88,0x02,0xe1,0x69,0xe0,0x26,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xd0,0x03,0x80,0x01,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x24,0xe0,0xa7,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xd8,0x03,0xc0,0x22,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd8,0x03,0xe0,0x04,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xd8,0x03,0xc0,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd8,0x03,0xd8,0x04,0xd8,0x04,0xd0,0x03,0xc8,0x03,0xc0,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x02,0xc0,0x23,0xc0,0x23,0xb8,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x22,0x90,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + + }; +} +node { + Bitmap myBitmap = Bitmap(icon, 2, 16, 16, 0x0000); + + void evaluate(Context ctx) { + emitValue(ctx, &myBitmap); + } -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x03,0xd8,0x03,0xc0,0x03,0x00,0x00,0x00,0x00,0xc0,0x02,0xd8,0x03,0xc0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x86,0xe1,0x28,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xe0,0x03,0xe0,0x03,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x98,0x02,0xea,0x8d,0xe0,0x87,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x03,0x98,0x02,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0xa8,0x02,0xea,0xae,0xe0,0x06,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x03,0xa0,0x02,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x88,0x02,0xe1,0x69,0xe0,0x26,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xe0,0x04,0xd0,0x03,0x80,0x01,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x24,0xe0,0xa7,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xd8,0x03,0xc0,0x22,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd8,0x03,0xe0,0x04,0xe0,0x05,0xe0,0x05,0xe0,0x04,0xe0,0x04,0xd8,0x03,0xc0,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd8,0x03,0xd8,0x04,0xd8,0x04,0xd0,0x03,0xc8,0x03,0xc0,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb8,0x02,0xc0,0x23,0xc0,0x23,0xb8,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x22,0x90,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - -}; - -struct State { - uint8_t mem[sizeof(Bitmap)]; - Bitmap* myBitmap; -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - auto state = getState(ctx); - state->myBitmap = new (state->mem) Bitmap(icon, 2, 16, 16, 0x0000); - emitValue(ctx, state->myBitmap); } diff --git a/workspace/__lib__/xod/graphics/humidity-16x16-bw/patch.cpp b/workspace/__lib__/xod/graphics/humidity-16x16-bw/patch.cpp index 521ba771..18a3d0b4 100644 --- a/workspace/__lib__/xod/graphics/humidity-16x16-bw/patch.cpp +++ b/workspace/__lib__/xod/graphics/humidity-16x16-bw/patch.cpp @@ -1,34 +1,29 @@ +nodespace { + static const unsigned char icon[] PROGMEM = { -static const unsigned char icon[] PROGMEM = { + 0b00000000, 0b00000000, // + 0b00000001, 0b10000000, // ## + 0b00000011, 0b11000000, // #### + 0b00000111, 0b11100000, // ###### + 0b00001111, 0b11110000, // ######## + 0b00001111, 0b11110000, // ######## + 0b00011111, 0b11111000, // ########## + 0b00011111, 0b11011000, // ####### ## + 0b00111111, 0b10011100, // ####### ### + 0b00111111, 0b10011100, // ####### ### + 0b00111111, 0b00011100, // ###### ### + 0b00011110, 0b00111000, // #### ### + 0b00011111, 0b11111000, // ########## + 0b00001111, 0b11110000, // ######## + 0b00000011, 0b11000000, // #### + 0b00000000, 0b00000000, // -0b00000000, 0b00000000, // -0b00000001, 0b10000000, // ## -0b00000011, 0b11000000, // #### -0b00000111, 0b11100000, // ###### -0b00001111, 0b11110000, // ######## -0b00001111, 0b11110000, // ######## -0b00011111, 0b11111000, // ########## -0b00011111, 0b11011000, // ####### ## -0b00111111, 0b10011100, // ####### ### -0b00111111, 0b10011100, // ####### ### -0b00111111, 0b00011100, // ###### ### -0b00011110, 0b00111000, // #### ### -0b00011111, 0b11111000, // ########## -0b00001111, 0b11110000, // ######## -0b00000011, 0b11000000, // #### -0b00000000, 0b00000000, // - -}; - -struct State { - uint8_t mem[sizeof(Bitmap)]; - Bitmap* myBitmap; -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - auto state = getState(ctx); - state->myBitmap = new (state->mem) Bitmap(icon, 0, 16, 16); - emitValue(ctx, state->myBitmap); + }; +} +node { + Bitmap myBitmap = Bitmap(icon, 0, 16, 16); + + void evaluate(Context ctx) { + emitValue(ctx, &myBitmap); + } } diff --git a/workspace/__lib__/xod/graphics/humidity-16x16-rgb/patch.cpp b/workspace/__lib__/xod/graphics/humidity-16x16-rgb/patch.cpp index 6400a45c..5de88417 100644 --- a/workspace/__lib__/xod/graphics/humidity-16x16-rgb/patch.cpp +++ b/workspace/__lib__/xod/graphics/humidity-16x16-rgb/patch.cpp @@ -1,34 +1,29 @@ +nodespace { + static const unsigned char icon[] PROGMEM = { -static const unsigned char icon[] PROGMEM = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xf3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd7,0x35,0xbc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd7,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2d,0x39,0x23,0xf3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x2c,0x96,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0x9b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd8,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2d,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xd3,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x2d,0x5a,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2c,0xb7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2d,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd7,0x56,0x3d,0x4e,0x1c,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2c,0xd7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3d,0xdc,0x76,0x7d,0x3d,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x7b,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xf3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd7,0x35,0xbc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd7,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2d,0x39,0x23,0xf3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x2c,0x96,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0x9b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd8,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2d,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xd3,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x2d,0x5a,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2c,0xb7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2d,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd7,0x56,0x3d,0x4e,0x1c,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2c,0xd7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3d,0xdc,0x76,0x7d,0x3d,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x7b,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - -}; - -struct State { - uint8_t mem[sizeof(Bitmap)]; - Bitmap* myBitmap; -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - auto state = getState(ctx); - state->myBitmap = new (state->mem) Bitmap(icon, 1, 16, 16); - emitValue(ctx, state->myBitmap); + }; +} +node { + Bitmap myBitmap = Bitmap(icon, 1, 16, 16); + + void evaluate(Context ctx) { + emitValue(ctx, &myBitmap); + } } diff --git a/workspace/__lib__/xod/graphics/humidity-16x16-rgba/patch.cpp b/workspace/__lib__/xod/graphics/humidity-16x16-rgba/patch.cpp index 637ca817..dabd20ad 100644 --- a/workspace/__lib__/xod/graphics/humidity-16x16-rgba/patch.cpp +++ b/workspace/__lib__/xod/graphics/humidity-16x16-rgba/patch.cpp @@ -1,34 +1,29 @@ +nodespace { + static const unsigned char icon[] PROGMEM = { -static const unsigned char icon[] PROGMEM = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xf3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd7,0x35,0xbc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd7,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2d,0x39,0x23,0xf3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x2c,0x96,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0x9b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd8,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2d,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xd3,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x2d,0x5a,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2c,0xb7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2d,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd7,0x56,0x3d,0x4e,0x1c,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2c,0xd7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3d,0xdc,0x76,0x7d,0x3d,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x7b,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xf3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd7,0x35,0xbc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd7,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2d,0x39,0x23,0xf3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x2c,0x96,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0x9b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd8,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2d,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xd3,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x2d,0x5a,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2c,0xb7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2d,0x39,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0xd7,0x56,0x3d,0x4e,0x1c,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x2c,0xd7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3d,0xdc,0x76,0x7d,0x3d,0xdc,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x7b,0x35,0xdc,0x35,0xdc,0x35,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - -}; - -struct State { - uint8_t mem[sizeof(Bitmap)]; - Bitmap* myBitmap; -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - auto state = getState(ctx); - state->myBitmap = new (state->mem) Bitmap(icon, 2, 16, 16, 0x0000); - emitValue(ctx, state->myBitmap); + }; +} +node { + Bitmap myBitmap = Bitmap(icon, 2, 16, 16 0x0000); + + void evaluate(Context ctx) { + emitValue(ctx, &myBitmap); + } } diff --git a/workspace/__lib__/xod/graphics/image/patch.cpp b/workspace/__lib__/xod/graphics/image/patch.cpp index 12057736..d2321ac4 100644 --- a/workspace/__lib__/xod/graphics/image/patch.cpp +++ b/workspace/__lib__/xod/graphics/image/patch.cpp @@ -1,46 +1,35 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State { +node { uint8_t mem[sizeof(Image)]; Image* image; - int16_t x, y, w, h; -}; + int16_t _x, _y, _w, _h; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); + auto bitmap = getValue(ctx); -void evaluate(Context ctx) { - auto state = getState(ctx); + int16_t x = (int16_t)getValue(ctx); + int16_t y = (int16_t)getValue(ctx); + int16_t w = (int16_t)getValue(ctx); + int16_t h = (int16_t)getValue(ctx); - auto gfx = getValue(ctx); - auto bitmap = getValue(ctx); + if (isSettingUp()) { + image = new (mem) Image(gfx); + } - int16_t x = (int16_t)getValue(ctx); - int16_t y = (int16_t)getValue(ctx); - int16_t w = (int16_t)getValue(ctx); - int16_t h = (int16_t)getValue(ctx); + if (isSettingUp() || x != _x || y != _y || w != _w || h != _h || isInputDirty(ctx)) { + _x = x; + _y = y; + _w = w; + _h = h; + image->linkBitmap(bitmap); + image->setImagePosition(x, y, w, h); + emitValue(ctx, image); + } - if (isSettingUp()) { - state->image = new (state->mem) Image(gfx); - } - - if (isSettingUp() || x != state->x || y != state->y || w != state->w || h != state->h || isInputDirty(ctx)) { - state->x = x; - state->y = y; - state->w = w; - state->h = h; - state->image->linkBitmap(bitmap); - state->image->setImagePosition(x, y, w, h); - emitValue(ctx, state->image); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->image); + if (isInputDirty(ctx)) { + emitValue(ctx, image); + } } } diff --git a/workspace/__lib__/xod/graphics/line-colored/patch.cpp b/workspace/__lib__/xod/graphics/line-colored/patch.cpp index be992a36..0f49116a 100644 --- a/workspace/__lib__/xod/graphics/line-colored/patch.cpp +++ b/workspace/__lib__/xod/graphics/line-colored/patch.cpp @@ -1,47 +1,35 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on - -struct State { +node { uint8_t mem[sizeof(Line)]; Line* lineColored; - int16_t x0, y0, x1, y1; + int16_t _x0, _y0, _x1, _y1; XColor strokeColor; -}; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); + strokeColor = getValue(ctx); -void evaluate(Context ctx) { - auto state = getState(ctx); + int16_t x0 = (int16_t)getValue(ctx); + int16_t y0 = (int16_t)getValue(ctx); + int16_t x1 = (int16_t)getValue(ctx); + int16_t y1 = (int16_t)getValue(ctx); - auto gfx = getValue(ctx); - state->strokeColor = getValue(ctx); + if (isSettingUp()) { + lineColored = new (mem) Line(gfx); + } - int16_t x0 = (int16_t)getValue(ctx); - int16_t y0 = (int16_t)getValue(ctx); - int16_t x1 = (int16_t)getValue(ctx); - int16_t y1 = (int16_t)getValue(ctx); + if (isSettingUp() || x0 != _x0 || y0 != _y0 || x1 != _x1 || y1 != _y1 || isInputDirty(ctx)) { + _x0 = x0; + _y0 = y0; + _x1 = x1; + _y1 = y1; + lineColored->setPosition(x0, y0, x1, y1); + lineColored->setStyle(&strokeColor); + emitValue(ctx, lineColored); + } - if (isSettingUp()) { - state->lineColored = new (state->mem) Line(gfx); - } - - if (isSettingUp() || x0 != state->x0 || y0 != state->y0 || x1 != state->x1 || y1 != state->y1 || isInputDirty(ctx)) { - state->x0 = x0; - state->y0 = y0; - state->x1 = x1; - state->y1 = y1; - state->lineColored->setPosition(x0, y0, x1, y1); - state->lineColored->setStyle(&state->strokeColor); - emitValue(ctx, state->lineColored); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->lineColored); + if (isInputDirty(ctx)) { + emitValue(ctx, lineColored); + } } } diff --git a/workspace/__lib__/xod/graphics/line/patch.cpp b/workspace/__lib__/xod/graphics/line/patch.cpp index 1ad695c5..13bd6d70 100644 --- a/workspace/__lib__/xod/graphics/line/patch.cpp +++ b/workspace/__lib__/xod/graphics/line/patch.cpp @@ -1,44 +1,33 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State { +node { uint8_t mem[sizeof(Line)]; Line* line; - int16_t x0, y0, x1, y1; -}; + int16_t _x0, _y0, _x1, _y1; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); -void evaluate(Context ctx) { - auto state = getState(ctx); + int16_t x0 = (int16_t)getValue(ctx); + int16_t y0 = (int16_t)getValue(ctx); + int16_t x1 = (int16_t)getValue(ctx); + int16_t y1 = (int16_t)getValue(ctx); - auto gfx = getValue(ctx); + if (isSettingUp()) { + line = new (mem) Line(gfx); + } - int16_t x0 = (int16_t)getValue(ctx); - int16_t y0 = (int16_t)getValue(ctx); - int16_t x1 = (int16_t)getValue(ctx); - int16_t y1 = (int16_t)getValue(ctx); + if (isSettingUp() || x0 != _x0 || y0 != _y0 || x1 != _x1 || y1 != _y1) { + _x0 = x0; + _y0 = y0; + _x1 = x1; + _y1 = y1; + line->setPosition(x0, y0, x1, y1); + emitValue(ctx, line); + } - if (isSettingUp()) { - state->line = new (state->mem) Line(gfx); - } - - if (isSettingUp() || x0 != state->x0 || y0 != state->y0 || x1 != state->x1 || y1 != state->y1) { - state->x0 = x0; - state->y0 = y0; - state->x1 = x1; - state->y1 = y1; - state->line->setPosition(x0, y0, x1, y1); - emitValue(ctx, state->line); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->line); + if (isInputDirty(ctx)) { + emitValue(ctx, line); + } } } diff --git a/workspace/__lib__/xod/graphics/point-colored/patch.cpp b/workspace/__lib__/xod/graphics/point-colored/patch.cpp index 763ff06e..6c7922c7 100644 --- a/workspace/__lib__/xod/graphics/point-colored/patch.cpp +++ b/workspace/__lib__/xod/graphics/point-colored/patch.cpp @@ -1,44 +1,32 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on - -struct State { +node { uint8_t mem[sizeof(Point)]; Point* pointColored; - int16_t x, y; + int16_t _x, _y; XColor strokeColor; -}; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); -void evaluate(Context ctx) { + strokeColor = getValue(ctx); - auto state = getState(ctx); - auto gfx = getValue(ctx); + int16_t x = (int16_t)getValue(ctx); + int16_t y = (int16_t)getValue(ctx); - state->strokeColor = getValue(ctx); + if (isSettingUp()) { + pointColored = new (mem) Point(gfx); + } - int16_t x = (int16_t)getValue(ctx); - int16_t y = (int16_t)getValue(ctx); + if (isSettingUp() || x != _x || y != _y || isInputDirty(ctx)) { + _x = x; + _y = y; + pointColored->setPosition(x, y); + pointColored->setStyle(&strokeColor); + emitValue(ctx, pointColored); + } - if (isSettingUp()) { - state->pointColored = new (state->mem) Point(gfx); - } - - if (isSettingUp() || state->x != x || state->y != y || isInputDirty(ctx)) { - state->x = x; - state->y = y; - state->pointColored->setPosition(x, y); - state->pointColored->setStyle(&state->strokeColor); - emitValue(ctx, state->pointColored); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->pointColored); + if (isInputDirty(ctx)) { + emitValue(ctx, pointColored); + } } } diff --git a/workspace/__lib__/xod/graphics/point/patch.cpp b/workspace/__lib__/xod/graphics/point/patch.cpp index 2158977f..188c4df7 100644 --- a/workspace/__lib__/xod/graphics/point/patch.cpp +++ b/workspace/__lib__/xod/graphics/point/patch.cpp @@ -1,40 +1,29 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State { +node { uint8_t mem[sizeof(Point)]; Point* point; - int16_t x, y; -}; + int16_t _x, _y; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); -void evaluate(Context ctx) { + int16_t x = (int16_t)getValue(ctx); + int16_t y = (int16_t)getValue(ctx); - auto state = getState(ctx); - auto gfx = getValue(ctx); + if (isSettingUp()) { + point = new (mem) Point(gfx); + } - int16_t x = (int16_t)getValue(ctx); - int16_t y = (int16_t)getValue(ctx); + if (isSettingUp() || x != _x || y != _y) { + _x = x; + _y = y; + point->setPosition(x, y); + emitValue(ctx, point); + } - if (isSettingUp()) { - state->point = new (state->mem) Point(gfx); - } - - if (isSettingUp() || state->x != x || state->y != y) { - state->x = x; - state->y = y; - state->point->setPosition(x, y); - emitValue(ctx, state->point); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->point); + if (isInputDirty(ctx)) { + emitValue(ctx, point); + } } } diff --git a/workspace/__lib__/xod/graphics/pulse-on-change(graphics)/patch.cpp b/workspace/__lib__/xod/graphics/pulse-on-change(graphics)/patch.cpp index cd846bc5..d7b25921 100644 --- a/workspace/__lib__/xod/graphics/pulse-on-change(graphics)/patch.cpp +++ b/workspace/__lib__/xod/graphics/pulse-on-change(graphics)/patch.cpp @@ -1,11 +1,8 @@ -struct State { -}; +node { + void evaluate(Context ctx) { + //Change in at least one of the elements in the graphical tree is a signal that the whole tree has changed. -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - //Change in at least one of the elements in the graphical tree is a signal that the whole tree has changed. - - if (isInputDirty(ctx)) - emitValue(ctx, 1); + if (isInputDirty(ctx)) + emitValue(ctx, 1); + } } diff --git a/workspace/__lib__/xod/graphics/rect-outline-colored/patch.cpp b/workspace/__lib__/xod/graphics/rect-outline-colored/patch.cpp index 852a8cc3..e54e2914 100644 --- a/workspace/__lib__/xod/graphics/rect-outline-colored/patch.cpp +++ b/workspace/__lib__/xod/graphics/rect-outline-colored/patch.cpp @@ -1,47 +1,35 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on - -struct State { +node { uint8_t mem[sizeof(RectangleOutline)]; RectangleOutline* rectangleOutlineColored; - int16_t x, y, w, h; + int16_t _x, _y, _w, _h; XColor strokeColor; -}; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); + strokeColor = getValue(ctx); -void evaluate(Context ctx) { - auto state = getState(ctx); + int16_t x = (int16_t)getValue(ctx); + int16_t y = (int16_t)getValue(ctx); + int16_t w = (int16_t)getValue(ctx); + int16_t h = (int16_t)getValue(ctx); - auto gfx = getValue(ctx); - state->strokeColor = getValue(ctx); + if (isSettingUp()) { + rectangleOutlineColored = new (mem) RectangleOutline(gfx); + } - int16_t x = (int16_t)getValue(ctx); - int16_t y = (int16_t)getValue(ctx); - int16_t w = (int16_t)getValue(ctx); - int16_t h = (int16_t)getValue(ctx); + if (isSettingUp() || x != _x || y != _y || w != _w || h != _h || isInputDirty(ctx)) { + _x = x; + _y = y; + _w = w; + _h = h; + rectangleOutlineColored->setPosition(x, y, w, h); + rectangleOutlineColored->setStyle(&strokeColor); + emitValue(ctx, rectangleOutlineColored); + } - if (isSettingUp()) { - state->rectangleOutlineColored = new (state->mem) RectangleOutline(gfx); - } - - if (isSettingUp() || x != state->x || y != state->y || w != state->w || h != state->h || isInputDirty(ctx)) { - state->x = x; - state->y = y; - state->w = w; - state->h = h; - state->rectangleOutlineColored->setPosition(x, y, w, h); - state->rectangleOutlineColored->setStyle(&state->strokeColor); - emitValue(ctx, state->rectangleOutlineColored); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->rectangleOutlineColored); + if (isInputDirty(ctx)) { + emitValue(ctx, rectangleOutlineColored); + } } } diff --git a/workspace/__lib__/xod/graphics/rect-outline/patch.cpp b/workspace/__lib__/xod/graphics/rect-outline/patch.cpp index 0b974e08..c5451b02 100644 --- a/workspace/__lib__/xod/graphics/rect-outline/patch.cpp +++ b/workspace/__lib__/xod/graphics/rect-outline/patch.cpp @@ -1,44 +1,32 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on - -struct State { +node { uint8_t mem[sizeof(RectangleOutline)]; RectangleOutline* rectangleOutline; - int16_t x, y, w, h; -}; + int16_t _x, _y, _w, _h; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); -void evaluate(Context ctx) { - auto state = getState(ctx); + int16_t x = (int16_t)getValue(ctx); + int16_t y = (int16_t)getValue(ctx); + int16_t w = (int16_t)getValue(ctx); + int16_t h = (int16_t)getValue(ctx); - auto gfx = getValue(ctx); + if (isSettingUp()) { + rectangleOutline = new (mem) RectangleOutline(gfx); + } - int16_t x = (int16_t)getValue(ctx); - int16_t y = (int16_t)getValue(ctx); - int16_t w = (int16_t)getValue(ctx); - int16_t h = (int16_t)getValue(ctx); + if (isSettingUp() || x != _x || y != _y || w != _w || h != _h) { + _x = x; + _y = y; + _w = w; + _h = h; + rectangleOutline->setPosition(x, y, w, h); + emitValue(ctx, rectangleOutline); + } - if (isSettingUp()) { - state->rectangleOutline = new (state->mem) RectangleOutline(gfx); - } - - if (isSettingUp() || x != state->x || y != state->y || w != state->w || h != state->h) { - state->x = x; - state->y = y; - state->w = w; - state->h = h; - state->rectangleOutline->setPosition(x, y, w, h); - emitValue(ctx, state->rectangleOutline); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->rectangleOutline); + if (isInputDirty(ctx)) { + emitValue(ctx, rectangleOutline); + } } } diff --git a/workspace/__lib__/xod/graphics/rect-solid-colored/patch.cpp b/workspace/__lib__/xod/graphics/rect-solid-colored/patch.cpp index 174835bd..6558199b 100644 --- a/workspace/__lib__/xod/graphics/rect-solid-colored/patch.cpp +++ b/workspace/__lib__/xod/graphics/rect-solid-colored/patch.cpp @@ -1,47 +1,36 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State { +node { uint8_t mem[sizeof(RectangleSolid)]; RectangleSolid* rectangleSolidColored; - int16_t x, y, w, h; + int16_t _x, _y, _w, _h; XColor fillColor; -}; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); + fillColor = getValue(ctx); -void evaluate(Context ctx) { - auto state = getState(ctx); + int16_t x = (int16_t)getValue(ctx); + int16_t y = (int16_t)getValue(ctx); + int16_t w = (int16_t)getValue(ctx); + int16_t h = (int16_t)getValue(ctx); - auto gfx = getValue(ctx); - state->fillColor = getValue(ctx); + if (isSettingUp()) { + rectangleSolidColored = new (mem) RectangleSolid(gfx); + } - int16_t x = (int16_t)getValue(ctx); - int16_t y = (int16_t)getValue(ctx); - int16_t w = (int16_t)getValue(ctx); - int16_t h = (int16_t)getValue(ctx); + if (isSettingUp() || x != _x || y != _y || w != _w || h != _h || isInputDirty(ctx)) { + _x = x; + _y = y; + _w = w; + _h = h; + rectangleSolidColored->setPosition(x, y, w, h); + rectangleSolidColored->setStyle(&fillColor); + emitValue(ctx, rectangleSolidColored); + } - if (isSettingUp()) { - state->rectangleSolidColored = new (state->mem) RectangleSolid(gfx); - } - - if (isSettingUp() || x != state->x || y != state->y || w != state->w || h != state->h || isInputDirty(ctx)) { - state->x = x; - state->y = y; - state->w = w; - state->h = h; - state->rectangleSolidColored->setPosition(x, y, w, h); - state->rectangleSolidColored->setStyle(&state->fillColor); - emitValue(ctx, state->rectangleSolidColored); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->rectangleSolidColored); + if (isInputDirty(ctx)) { + emitValue(ctx, rectangleSolidColored); + } } } diff --git a/workspace/__lib__/xod/graphics/rect-solid/patch.cpp b/workspace/__lib__/xod/graphics/rect-solid/patch.cpp index ec455572..52aac1d1 100644 --- a/workspace/__lib__/xod/graphics/rect-solid/patch.cpp +++ b/workspace/__lib__/xod/graphics/rect-solid/patch.cpp @@ -1,44 +1,33 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State { +node { uint8_t mem[sizeof(RectangleSolid)]; RectangleSolid* rectangleSolid; - int16_t x, y, w, h; -}; + int16_t _x, _y, _w, _h; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); -void evaluate(Context ctx) { - auto state = getState(ctx); + int16_t x = (int16_t)getValue(ctx); + int16_t y = (int16_t)getValue(ctx); + int16_t w = (int16_t)getValue(ctx); + int16_t h = (int16_t)getValue(ctx); - auto gfx = getValue(ctx); + if (isSettingUp()) { + rectangleSolid = new (mem) RectangleSolid(gfx); + } - int16_t x = (int16_t)getValue(ctx); - int16_t y = (int16_t)getValue(ctx); - int16_t w = (int16_t)getValue(ctx); - int16_t h = (int16_t)getValue(ctx); + if (isSettingUp() || x != _x || y != _y || w != _w || h != _h) { + _x = x; + _y = y; + _w = w; + _h = h; + rectangleSolid->setPosition(x, y, w, h); + emitValue(ctx, rectangleSolid); + } - if (isSettingUp()) { - state->rectangleSolid = new (state->mem) RectangleSolid(gfx); - } - - if (isSettingUp() || x != state->x || y != state->y || w != state->w || h != state->h) { - state->x = x; - state->y = y; - state->w = w; - state->h = h; - state->rectangleSolid->setPosition(x, y, w, h); - emitValue(ctx, state->rectangleSolid); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->rectangleSolid); + if (isInputDirty(ctx)) { + emitValue(ctx, rectangleSolid); + } } } diff --git a/workspace/__lib__/xod/graphics/temperature-16x16-bw/patch.cpp b/workspace/__lib__/xod/graphics/temperature-16x16-bw/patch.cpp index 4b77bc00..ccb0744f 100644 --- a/workspace/__lib__/xod/graphics/temperature-16x16-bw/patch.cpp +++ b/workspace/__lib__/xod/graphics/temperature-16x16-bw/patch.cpp @@ -1,34 +1,29 @@ +nodespace { + static const unsigned char icon[] PROGMEM = { -static const unsigned char icon[] PROGMEM = { + 0b00000001, 0b11000000, // ### + 0b00000011, 0b11100000, // ##### + 0b00000111, 0b00100000, // ### # + 0b00000111, 0b11100000, // ###### + 0b00000111, 0b00100000, // ### # + 0b00000111, 0b11100000, // ###### + 0b00000111, 0b00100000, // ### # + 0b00000111, 0b11100000, // ###### + 0b00000111, 0b00100000, // ### # + 0b00001111, 0b11110000, // ######## + 0b00011111, 0b11111000, // ########## + 0b00011111, 0b11111000, // ########## + 0b00011111, 0b11111000, // ########## + 0b00011111, 0b11111000, // ########## + 0b00001111, 0b11110000, // ######## + 0b00000111, 0b11100000, // ###### -0b00000001, 0b11000000, // ### -0b00000011, 0b11100000, // ##### -0b00000111, 0b00100000, // ### # -0b00000111, 0b11100000, // ###### -0b00000111, 0b00100000, // ### # -0b00000111, 0b11100000, // ###### -0b00000111, 0b00100000, // ### # -0b00000111, 0b11100000, // ###### -0b00000111, 0b00100000, // ### # -0b00001111, 0b11110000, // ######## -0b00011111, 0b11111000, // ########## -0b00011111, 0b11111000, // ########## -0b00011111, 0b11111000, // ########## -0b00011111, 0b11111000, // ########## -0b00001111, 0b11110000, // ######## -0b00000111, 0b11100000, // ###### - -}; - -struct State { - uint8_t mem[sizeof(Bitmap)]; - Bitmap* myBitmap; -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - auto state = getState(ctx); - state->myBitmap = new (state->mem) Bitmap(icon, 0, 16, 16); - emitValue(ctx, state->myBitmap); + }; +} +node { + Bitmap myBitmap = Bitmap(icon, 0, 16, 16); + + void evaluate(Context ctx) { + emitValue(ctx, &myBitmap); + } } diff --git a/workspace/__lib__/xod/graphics/temperature-16x16-rgb/patch.cpp b/workspace/__lib__/xod/graphics/temperature-16x16-rgb/patch.cpp index 928afc60..a03e9e27 100644 --- a/workspace/__lib__/xod/graphics/temperature-16x16-rgb/patch.cpp +++ b/workspace/__lib__/xod/graphics/temperature-16x16-rgb/patch.cpp @@ -1,34 +1,29 @@ +nodespace { + static const unsigned char icon[] PROGMEM = { -static const unsigned char icon[] PROGMEM = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0xd6,0x74,0xd6,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xdf,0x9f,0xdf,0xbf,0xef,0xff,0x85,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0x9f,0xf9,0x40,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xa6,0x3b,0xf9,0x60,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xbf,0xf9,0x20,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xbf,0xf0,0xe0,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xa6,0x3b,0xe8,0xa0,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xdf,0xe0,0x80,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xdf,0xd8,0x40,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x74,0x7d,0x38,0x9e,0x3c,0xc8,0x40,0xd7,0xff,0x8d,0x99,0x6c,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x74,0xbf,0x3f,0xea,0x63,0xc0,0x60,0xfb,0x03,0xd7,0xff,0x64,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x74,0xbe,0x5c,0xd0,0xa0,0xe9,0x60,0xf9,0xa0,0xd7,0xff,0x64,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0xb5,0x9e,0x7f,0xc1,0x62,0xd8,0x80,0xe2,0x22,0xc7,0x9f,0x64,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5b,0xf2,0x74,0xf7,0x9e,0x9f,0xa7,0x3f,0xb7,0x3f,0x7d,0x37,0x5b,0xd2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5b,0xf2,0x6c,0x74,0x6c,0x54,0x6c,0x54,0x5b,0xd2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0xd6,0x74,0xd6,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xdf,0x9f,0xdf,0xbf,0xef,0xff,0x85,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0x9f,0xf9,0x40,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xa6,0x3b,0xf9,0x60,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xbf,0xf9,0x20,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xbf,0xf0,0xe0,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xa6,0x3b,0xe8,0xa0,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xdf,0xe0,0x80,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xdf,0xd8,0x40,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x74,0x7d,0x38,0x9e,0x3c,0xc8,0x40,0xd7,0xff,0x8d,0x99,0x6c,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x74,0xbf,0x3f,0xea,0x63,0xc0,0x60,0xfb,0x03,0xd7,0xff,0x64,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x74,0xbe,0x5c,0xd0,0xa0,0xe9,0x60,0xf9,0xa0,0xd7,0xff,0x64,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0xb5,0x9e,0x7f,0xc1,0x62,0xd8,0x80,0xe2,0x22,0xc7,0x9f,0x64,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5b,0xf2,0x74,0xf7,0x9e,0x9f,0xa7,0x3f,0xb7,0x3f,0x7d,0x37,0x5b,0xd2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5b,0xf2,0x6c,0x74,0x6c,0x54,0x6c,0x54,0x5b,0xd2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - -}; - -struct State { - uint8_t mem[sizeof(Bitmap)]; - Bitmap* myBitmap; -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - auto state = getState(ctx); - state->myBitmap = new (state->mem) Bitmap(icon, 1, 16, 16); - emitValue(ctx, state->myBitmap); + }; +} +node { + Bitmap myBitmap = Bitmap(icon, 1, 16, 16); + + void evaluate(Context ctx) { + emitValue(ctx, &myBitmap); + } } diff --git a/workspace/__lib__/xod/graphics/temperature-16x16-rgba/patch.cpp b/workspace/__lib__/xod/graphics/temperature-16x16-rgba/patch.cpp index 6b335aec..374b01d7 100644 --- a/workspace/__lib__/xod/graphics/temperature-16x16-rgba/patch.cpp +++ b/workspace/__lib__/xod/graphics/temperature-16x16-rgba/patch.cpp @@ -1,34 +1,29 @@ +nodespace { + static const unsigned char icon[] PROGMEM = { -static const unsigned char icon[] PROGMEM = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0xd6,0x74,0xd6,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xdf,0x9f,0xdf,0xbf,0xef,0xff,0x85,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0x9f,0xf9,0x40,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xa6,0x3b,0xf9,0x60,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xbf,0xf9,0x20,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xbf,0xf0,0xe0,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xa6,0x3b,0xe8,0xa0,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xdf,0xe0,0x80,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xdf,0xd8,0x40,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x74,0x7d,0x38,0x9e,0x3c,0xc8,0x40,0xd7,0xff,0x8d,0x99,0x6c,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x74,0xbf,0x3f,0xea,0x63,0xc0,0x60,0xfb,0x03,0xd7,0xff,0x64,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x74,0xbe,0x5c,0xd0,0xa0,0xe9,0x60,0xf9,0xa0,0xd7,0xff,0x64,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0xb5,0x9e,0x7f,0xc1,0x62,0xd8,0x80,0xe2,0x22,0xc7,0x9f,0x64,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5b,0xf2,0x74,0xf7,0x9e,0x9f,0xa7,0x3f,0xb7,0x3f,0x7d,0x37,0x5b,0xd2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5b,0xf2,0x6c,0x74,0x6c,0x54,0x6c,0x54,0x5b,0xd2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0xd6,0x74,0xd6,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xdf,0x9f,0xdf,0xbf,0xef,0xff,0x85,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0x9f,0xf9,0x40,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xa6,0x3b,0xf9,0x60,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xbf,0xf9,0x20,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xbf,0xf0,0xe0,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xa6,0x3b,0xe8,0xa0,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xdf,0xe0,0x80,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x54,0xd7,0xdf,0xd8,0x40,0xe7,0xff,0x7d,0x17,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x74,0x7d,0x38,0x9e,0x3c,0xc8,0x40,0xd7,0xff,0x8d,0x99,0x6c,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x74,0xbf,0x3f,0xea,0x63,0xc0,0x60,0xfb,0x03,0xd7,0xff,0x64,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x74,0xbe,0x5c,0xd0,0xa0,0xe9,0x60,0xf9,0xa0,0xd7,0xff,0x64,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0xb5,0x9e,0x7f,0xc1,0x62,0xd8,0x80,0xe2,0x22,0xc7,0x9f,0x64,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5b,0xf2,0x74,0xf7,0x9e,0x9f,0xa7,0x3f,0xb7,0x3f,0x7d,0x37,0x5b,0xd2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5b,0xf2,0x6c,0x74,0x6c,0x54,0x6c,0x54,0x5b,0xd2,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - -}; - -struct State { - uint8_t mem[sizeof(Bitmap)]; - Bitmap* myBitmap; -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - auto state = getState(ctx); - state->myBitmap = new (state->mem) Bitmap(icon, 2, 16, 16, 0x0000); - emitValue(ctx, state->myBitmap); + }; +} +node { + Bitmap myBitmap = Bitmap(icon, 2, 16, 16, 0x0000); + + void evaluate(Context ctx) { + emitValue(ctx, &myBitmap); + } } diff --git a/workspace/__lib__/xod/graphics/text-colored/patch.cpp b/workspace/__lib__/xod/graphics/text-colored/patch.cpp index f42bc029..00f4bcd6 100644 --- a/workspace/__lib__/xod/graphics/text-colored/patch.cpp +++ b/workspace/__lib__/xod/graphics/text-colored/patch.cpp @@ -1,49 +1,38 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State { +node { uint8_t mem[sizeof(Text)]; Text* textColored; - uint8_t textScale; - int16_t x, y; + uint8_t _textScale; + int16_t _x, _y; XColor textColor; -}; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); -void evaluate(Context ctx) { + textColor = getValue(ctx); + int16_t x = (int16_t)getValue(ctx); + int16_t y = (int16_t)getValue(ctx); + uint8_t textScale = max(1, (int)getValue(ctx)); - auto state = getState(ctx); - auto gfx = getValue(ctx); + if (isSettingUp()) { + textColored = new (mem) Text(gfx); + } - state->textColor = getValue(ctx); - int16_t x = (int16_t)getValue(ctx); - int16_t y = (int16_t)getValue(ctx); - uint8_t textScale = max(1, (int)getValue(ctx)); + if (isSettingUp() || _x != x || _y != y || _textScale != textScale || isInputDirty(ctx) || isInputDirty(ctx)) { + _x = x; + _y = y; + _textScale = textScale; + textColored->setText(getValue(ctx)); + textColored->setPosition(x, y); + textColored->setTextScale(textScale); + textColored->setTextColor(&textColor); + emitValue(ctx, textColored); + } - if (isSettingUp()) { - state->textColored = new (state->mem) Text(gfx); - } - - if (isSettingUp() || state->x != x || state->y != y || state->textScale != textScale || isInputDirty(ctx) || isInputDirty(ctx)) { - state->x = x; - state->y = y; - state->textScale = textScale; - state->textColored->setText(getValue(ctx)); - state->textColored->setPosition(x, y); - state->textColored->setTextScale(textScale); - state->textColored->setTextColor(&state->textColor); - emitValue(ctx, state->textColored); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->textColored); + if (isInputDirty(ctx)) { + emitValue(ctx, textColored); + } } } diff --git a/workspace/__lib__/xod/graphics/text/patch.cpp b/workspace/__lib__/xod/graphics/text/patch.cpp index 7fe48827..26cd6e81 100644 --- a/workspace/__lib__/xod/graphics/text/patch.cpp +++ b/workspace/__lib__/xod/graphics/text/patch.cpp @@ -1,45 +1,34 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State { +node { uint8_t mem[sizeof(Text)]; Text* text; - uint8_t textScale; - int16_t x, y; -}; + uint8_t _textScale; + int16_t _x, _y; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); -void evaluate(Context ctx) { + int16_t x = (int16_t)getValue(ctx); + int16_t y = (int16_t)getValue(ctx); + uint8_t textScale = max(1, (int)getValue(ctx)); - auto state = getState(ctx); - auto gfx = getValue(ctx); + if (isSettingUp()) { + text = new (mem) Text(gfx); + } - int16_t x = (int16_t)getValue(ctx); - int16_t y = (int16_t)getValue(ctx); - uint8_t textScale = max(1, (int)getValue(ctx)); + if (isSettingUp() || _x != x || _y != y || textScale != _textScale || isInputDirty(ctx)) { + _x = x; + _y = y; + _textScale = textScale; + text->setText(getValue(ctx)); + text->setPosition(x, y); + text->setTextScale(textScale); + emitValue(ctx, text); + } - if (isSettingUp()) { - state->text = new (state->mem) Text(gfx); - } - - if (isSettingUp() || state->x != x || state->y != y || state->textScale != textScale || isInputDirty(ctx)) { - state->x = x; - state->y = y; - state->textScale = textScale; - state->text->setText(getValue(ctx)); - state->text->setPosition(x, y); - state->text->setTextScale(textScale); - emitValue(ctx, state->text); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->text); + if (isInputDirty(ctx)) { + emitValue(ctx, text); + } } } diff --git a/workspace/__lib__/xod/graphics/triangle-outline-colored/patch.cpp b/workspace/__lib__/xod/graphics/triangle-outline-colored/patch.cpp index c180fca6..dedfd90b 100644 --- a/workspace/__lib__/xod/graphics/triangle-outline-colored/patch.cpp +++ b/workspace/__lib__/xod/graphics/triangle-outline-colored/patch.cpp @@ -1,51 +1,39 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on - -struct State { +node { uint8_t mem[sizeof(TriangleOutline)]; TriangleOutline* triangleOutlineColored; - int16_t x0, y0, x1, y1, x2, y2; + int16_t _x0, _y0, _x1, _y1, _x2, _y2; XColor strokeColor; -}; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); + strokeColor = getValue(ctx); -void evaluate(Context ctx) { - auto state = getState(ctx); + int16_t x0 = (int16_t)getValue(ctx); + int16_t y0 = (int16_t)getValue(ctx); + int16_t x1 = (int16_t)getValue(ctx); + int16_t y1 = (int16_t)getValue(ctx); + int16_t x2 = (int16_t)getValue(ctx); + int16_t y2 = (int16_t)getValue(ctx); - auto gfx = getValue(ctx); - state->strokeColor = getValue(ctx); + if (isSettingUp()) { + triangleOutlineColored = new (mem) TriangleOutline(gfx); + } - int16_t x0 = (int16_t)getValue(ctx); - int16_t y0 = (int16_t)getValue(ctx); - int16_t x1 = (int16_t)getValue(ctx); - int16_t y1 = (int16_t)getValue(ctx); - int16_t x2 = (int16_t)getValue(ctx); - int16_t y2 = (int16_t)getValue(ctx); + if (isSettingUp() || x0 != _x0 || y0 != _y0 || x1 != _x1 || y1 != _y1 || x2 != _x2 || y2 != _y2 || isInputDirty(ctx)) { + _x0 = x0; + _y0 = y0; + _x1 = x1; + _y1 = y1; + _x2 = x2; + _y2 = y2; + triangleOutlineColored->setPosition(x0, y0, x1, y1, x2, y2); + triangleOutlineColored->setStyle(&strokeColor); + emitValue(ctx, triangleOutlineColored); + } - if (isSettingUp()) { - state->triangleOutlineColored = new (state->mem) TriangleOutline(gfx); - } - - if (isSettingUp() || x0 != state->x0 || y0 != state->y0 || x1 != state->x1 || y1 != state->y1 || x2 != state->x2 || y2 != state->y2 || isInputDirty(ctx)) { - state->x0 = x0; - state->y0 = y0; - state->x1 = x1; - state->y1 = y1; - state->x2 = x2; - state->y2 = y2; - state->triangleOutlineColored->setPosition(x0, y0, x1, y1, x2, y2); - state->triangleOutlineColored->setStyle(&state->strokeColor); - emitValue(ctx, state->triangleOutlineColored); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->triangleOutlineColored); + if (isInputDirty(ctx)) { + emitValue(ctx, triangleOutlineColored); + } } } diff --git a/workspace/__lib__/xod/graphics/triangle-outline/patch.cpp b/workspace/__lib__/xod/graphics/triangle-outline/patch.cpp index c5509666..10bb8cdb 100644 --- a/workspace/__lib__/xod/graphics/triangle-outline/patch.cpp +++ b/workspace/__lib__/xod/graphics/triangle-outline/patch.cpp @@ -1,48 +1,36 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on - -struct State { +node { uint8_t mem[sizeof(TriangleOutline)]; TriangleOutline* triangleOutline; - int16_t x0, y0, x1, y1, x2, y2; -}; + int16_t _x0, _y0, _x1, _y1, _x2, _y2; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); -void evaluate(Context ctx) { - auto state = getState(ctx); + int16_t x0 = (int16_t)getValue(ctx); + int16_t y0 = (int16_t)getValue(ctx); + int16_t x1 = (int16_t)getValue(ctx); + int16_t y1 = (int16_t)getValue(ctx); + int16_t x2 = (int16_t)getValue(ctx); + int16_t y2 = (int16_t)getValue(ctx); - auto gfx = getValue(ctx); + if (isSettingUp()) { + triangleOutline = new (mem) TriangleOutline(gfx); + } - int16_t x0 = (int16_t)getValue(ctx); - int16_t y0 = (int16_t)getValue(ctx); - int16_t x1 = (int16_t)getValue(ctx); - int16_t y1 = (int16_t)getValue(ctx); - int16_t x2 = (int16_t)getValue(ctx); - int16_t y2 = (int16_t)getValue(ctx); + if (isSettingUp() || x0 != _x0 || y0 != _y0 || x1 != _x1 || y1 != _y1 || x2 != _x2 || y2 != _y2) { + _x0 = x0; + _y0 = y0; + _x1 = x1; + _y1 = y1; + _x2 = x2; + _y2 = y2; + triangleOutline->setPosition(x0, y0, x1, y1, x2, y2); + emitValue(ctx, triangleOutline); + } - if (isSettingUp()) { - state->triangleOutline = new (state->mem) TriangleOutline(gfx); - } - - if (isSettingUp() || x0 != state->x0 || y0 != state->y0 || x1 != state->x1 || y1 != state->y1 || x2 != state->x2 || y2 != state->y2) { - state->x0 = x0; - state->y0 = y0; - state->x1 = x1; - state->y1 = y1; - state->x2 = x2; - state->y2 = y2; - state->triangleOutline->setPosition(x0, y0, x1, y1, x2, y2); - emitValue(ctx, state->triangleOutline); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->triangleOutline); + if (isInputDirty(ctx)) { + emitValue(ctx, triangleOutline); + } } } diff --git a/workspace/__lib__/xod/graphics/triangle-solid-colored/patch.cpp b/workspace/__lib__/xod/graphics/triangle-solid-colored/patch.cpp index e4d9baab..86cdd0fe 100644 --- a/workspace/__lib__/xod/graphics/triangle-solid-colored/patch.cpp +++ b/workspace/__lib__/xod/graphics/triangle-solid-colored/patch.cpp @@ -1,51 +1,40 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State { +node { uint8_t mem[sizeof(TriangleSolid)]; TriangleSolid* triangleSolidColored; - int16_t x0, y0, x1, y1, x2, y2; + int16_t _x0, _y0, _x1, _y1, _x2, _y2; XColor fillColor; -}; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); + fillColor = getValue(ctx); -void evaluate(Context ctx) { - auto state = getState(ctx); + int16_t x0 = (int16_t)getValue(ctx); + int16_t y0 = (int16_t)getValue(ctx); + int16_t x1 = (int16_t)getValue(ctx); + int16_t y1 = (int16_t)getValue(ctx); + int16_t x2 = (int16_t)getValue(ctx); + int16_t y2 = (int16_t)getValue(ctx); - auto gfx = getValue(ctx); - state->fillColor = getValue(ctx); + if (isSettingUp()) { + triangleSolidColored = new (mem) TriangleSolid(gfx); + } - int16_t x0 = (int16_t)getValue(ctx); - int16_t y0 = (int16_t)getValue(ctx); - int16_t x1 = (int16_t)getValue(ctx); - int16_t y1 = (int16_t)getValue(ctx); - int16_t x2 = (int16_t)getValue(ctx); - int16_t y2 = (int16_t)getValue(ctx); + if (isSettingUp() || x0 != _x0 || y0 != _y0 || x1 != _x1 || y1 != _y1 || x2 != _x2 || y2 != _y2 || isInputDirty(ctx)) { + _x0 = x0; + _y0 = y0; + _x1 = x1; + _y1 = y1; + _x2 = x2; + _y2 = y2; + triangleSolidColored->setPosition(x0, y0, x1, y1, x2, y2); + triangleSolidColored->setStyle(&fillColor); + emitValue(ctx, triangleSolidColored); + } - if (isSettingUp()) { - state->triangleSolidColored = new (state->mem) TriangleSolid(gfx); - } - - if (isSettingUp() || x0 != state->x0 || y0 != state->y0 || x1 != state->x1 || y1 != state->y1 || x2 != state->x2 || y2 != state->y2 || isInputDirty(ctx)) { - state->x0 = x0; - state->y0 = y0; - state->x1 = x1; - state->y1 = y1; - state->x2 = x2; - state->y2 = y2; - state->triangleSolidColored->setPosition(x0, y0, x1, y1, x2, y2); - state->triangleSolidColored->setStyle(&state->fillColor); - emitValue(ctx, state->triangleSolidColored); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->triangleSolidColored); + if (isInputDirty(ctx)) { + emitValue(ctx, triangleSolidColored); + } } } diff --git a/workspace/__lib__/xod/graphics/triangle-solid/patch.cpp b/workspace/__lib__/xod/graphics/triangle-solid/patch.cpp index 4f9d8e08..29b91f64 100644 --- a/workspace/__lib__/xod/graphics/triangle-solid/patch.cpp +++ b/workspace/__lib__/xod/graphics/triangle-solid/patch.cpp @@ -1,48 +1,37 @@ - -// clang-format off -{{#global}} #include -{{/global}} -// clang-format on -struct State { +node { uint8_t mem[sizeof(TriangleSolid)]; TriangleSolid* triangleSolid; - int16_t x0, y0, x1, y1, x2, y2; -}; + int16_t _x0, _y0, _x1, _y1, _x2, _y2; -// clang-format off -{{ GENERATED_CODE }} -// clang-format on + void evaluate(Context ctx) { + auto gfx = getValue(ctx); -void evaluate(Context ctx) { - auto state = getState(ctx); + int16_t x0 = (int16_t)getValue(ctx); + int16_t y0 = (int16_t)getValue(ctx); + int16_t x1 = (int16_t)getValue(ctx); + int16_t y1 = (int16_t)getValue(ctx); + int16_t x2 = (int16_t)getValue(ctx); + int16_t y2 = (int16_t)getValue(ctx); - auto gfx = getValue(ctx); + if (isSettingUp()) { + triangleSolid = new (mem) TriangleSolid(gfx); + } - int16_t x0 = (int16_t)getValue(ctx); - int16_t y0 = (int16_t)getValue(ctx); - int16_t x1 = (int16_t)getValue(ctx); - int16_t y1 = (int16_t)getValue(ctx); - int16_t x2 = (int16_t)getValue(ctx); - int16_t y2 = (int16_t)getValue(ctx); + if (isSettingUp() || x0 != _x0 || y0 != _y0 || x1 != _x1 || y1 != _y1 || x2 != _x2 || y2 != _y2) { + _x0 = x0; + _y0 = y0; + _x1 = x1; + _y1 = y1; + _x2 = x2; + _y2 = y2; + triangleSolid->setPosition(x0, y0, x1, y1, x2, y2); + emitValue(ctx, triangleSolid); + } - if (isSettingUp()) { - state->triangleSolid = new (state->mem) TriangleSolid(gfx); - } - - if (isSettingUp() || x0 != state->x0 || y0 != state->y0 || x1 != state->x1 || y1 != state->y1 || x2 != state->x2 || y2 != state->y2) { - state->x0 = x0; - state->y0 = y0; - state->x1 = x1; - state->y1 = y1; - state->x2 = x2; - state->y2 = y2; - state->triangleSolid->setPosition(x0, y0, x1, y1, x2, y2); - emitValue(ctx, state->triangleSolid); - } - - if (isInputDirty(ctx)) { - emitValue(ctx, state->triangleSolid); + if (isInputDirty(ctx)) { + emitValue(ctx, triangleSolid); + } } } diff --git a/workspace/__lib__/xod/graphics/warning-16x16-bw/patch.cpp b/workspace/__lib__/xod/graphics/warning-16x16-bw/patch.cpp index a635eda4..51c32221 100644 --- a/workspace/__lib__/xod/graphics/warning-16x16-bw/patch.cpp +++ b/workspace/__lib__/xod/graphics/warning-16x16-bw/patch.cpp @@ -1,34 +1,29 @@ +nodespace { + static const unsigned char icon[] PROGMEM = { -static const unsigned char icon[] PROGMEM = { + 0b00000000, 0b10000000, // # + 0b00000001, 0b11000000, // ### + 0b00000001, 0b11000000, // ### + 0b00000011, 0b11100000, // ##### + 0b00000011, 0b01100000, // ## ## + 0b00000111, 0b01110000, // ### ### + 0b00000110, 0b00110000, // ## ## + 0b00001110, 0b10111000, // ### # ### + 0b00001100, 0b10011000, // ## # ## + 0b00011100, 0b10011100, // ### # ### + 0b00011000, 0b10001100, // ## # ## + 0b00111000, 0b00001110, // ### ### + 0b00110000, 0b10000110, // ## # ## + 0b01111111, 0b11111111, // ############### + 0b01111111, 0b11111111, // ############### + 0b00000000, 0b00000000, // -0b00000000, 0b10000000, // # -0b00000001, 0b11000000, // ### -0b00000001, 0b11000000, // ### -0b00000011, 0b11100000, // ##### -0b00000011, 0b01100000, // ## ## -0b00000111, 0b01110000, // ### ### -0b00000110, 0b00110000, // ## ## -0b00001110, 0b10111000, // ### # ### -0b00001100, 0b10011000, // ## # ## -0b00011100, 0b10011100, // ### # ### -0b00011000, 0b10001100, // ## # ## -0b00111000, 0b00001110, // ### ### -0b00110000, 0b10000110, // ## # ## -0b01111111, 0b11111111, // ############### -0b01111111, 0b11111111, // ############### -0b00000000, 0b00000000, // - -}; - -struct State { - uint8_t mem[sizeof(Bitmap)]; - Bitmap* myBitmap; -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - auto state = getState(ctx); - state->myBitmap = new (state->mem) Bitmap(icon, 0, 16, 16); - emitValue(ctx, state->myBitmap); + }; +} +node { + Bitmap myBitmap = Bitmap(icon, 0, 16, 16); + + void evaluate(Context ctx) { + emitValue(ctx, &myBitmap); + } } diff --git a/workspace/__lib__/xod/graphics/warning-16x16-rgb/patch.cpp b/workspace/__lib__/xod/graphics/warning-16x16-rgb/patch.cpp index 411acc36..9f2f84fe 100644 --- a/workspace/__lib__/xod/graphics/warning-16x16-rgb/patch.cpp +++ b/workspace/__lib__/xod/graphics/warning-16x16-rgb/patch.cpp @@ -1,34 +1,29 @@ +nodespace { + static const unsigned char icon[] PROGMEM = { -static const unsigned char icon[] PROGMEM = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6b,0x23,0x6b,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf7,0x07,0xf7,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb5,0x25,0xff,0x47,0xff,0x47,0xb5,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf7,0x07,0xff,0x47,0xff,0x47,0xf7,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb5,0x25,0xff,0x27,0x83,0xe7,0x83,0xe7,0xff,0x27,0xb5,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0xe7,0xf6,0xe7,0x42,0x07,0x42,0x07,0xf6,0xe7,0xf6,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb5,0x05,0xff,0x26,0xf6,0xc6,0x4a,0x27,0x4a,0x27,0xf6,0xc6,0xff,0x26,0xb5,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0xc6,0xff,0x05,0xf6,0xc6,0x52,0x66,0x52,0x66,0xf6,0xc6,0xff,0x05,0xf6,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0xb4,0xe4,0xfe,0xe5,0xfe,0xe5,0xfe,0xc5,0x5a,0x86,0x5a,0xa6,0xfe,0xc5,0xfe,0xe5,0xfe,0xe5,0xb5,0x04,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0x85,0xfe,0xe5,0xfe,0xe5,0xfe,0xc5,0x62,0xc5,0x62,0xc5,0xfe,0xc5,0xfe,0xe5,0xfe,0xe5,0xf6,0x85,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0xb4,0xc3,0xfe,0xc4,0xfe,0xc4,0xfe,0xc4,0xfe,0xa4,0x6b,0x05,0x6b,0x05,0xfe,0xa4,0xfe,0xc4,0xfe,0xc4,0xfe,0xc4,0xb4,0xe3,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0xf6,0x44,0xfe,0xa3,0xfe,0xa3,0xfe,0xa3,0xfe,0xa3,0x9c,0x24,0x9c,0x24,0xfe,0xa3,0xfe,0xa3,0xfe,0xa3,0xfe,0xa3,0xf6,0x44,0x00,0x00,0x00,0x00 + ,0x00,0x00,0xb4,0xa3,0xfe,0x83,0xfe,0x83,0xfe,0x83,0xfe,0x83,0xfe,0x63,0x8b,0xa4,0x8b,0xa4,0xfe,0x63,0xfe,0x83,0xfe,0x83,0xfe,0x83,0xfe,0x83,0xb4,0xa3,0x00,0x00 + ,0x00,0x00,0xf6,0x02,0xfe,0x62,0xfe,0x62,0xfe,0x62,0xfe,0x62,0xfe,0x42,0x8b,0xa3,0x8b,0xa3,0xfe,0x42,0xfe,0x62,0xfe,0x62,0xfe,0x62,0xfe,0x62,0xf6,0x02,0x00,0x00 + ,0x83,0x41,0xfe,0x21,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x22,0xfe,0x22,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x21,0x83,0x41 + ,0x00,0x00,0x83,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x83,0x41,0x00,0x00 -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6b,0x23,0x6b,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf7,0x07,0xf7,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb5,0x25,0xff,0x47,0xff,0x47,0xb5,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf7,0x07,0xff,0x47,0xff,0x47,0xf7,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb5,0x25,0xff,0x27,0x83,0xe7,0x83,0xe7,0xff,0x27,0xb5,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0xe7,0xf6,0xe7,0x42,0x07,0x42,0x07,0xf6,0xe7,0xf6,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb5,0x05,0xff,0x26,0xf6,0xc6,0x4a,0x27,0x4a,0x27,0xf6,0xc6,0xff,0x26,0xb5,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0xc6,0xff,0x05,0xf6,0xc6,0x52,0x66,0x52,0x66,0xf6,0xc6,0xff,0x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,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x21,0x83,0x41 -,0x00,0x00,0x83,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x83,0x41,0x00,0x00 - -}; - -struct State { - uint8_t mem[sizeof(Bitmap)]; - Bitmap* myBitmap; -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - auto state = getState(ctx); - state->myBitmap = new (state->mem) Bitmap(icon, 1, 16, 16); - emitValue(ctx, state->myBitmap); + }; +} +node { + Bitmap myBitmap = Bitmap(icon, 1, 16, 16); + + void evaluate(Context ctx) { + emitValue(ctx, &myBitmap); + } } diff --git a/workspace/__lib__/xod/graphics/warning-16x16-rgba/patch.cpp b/workspace/__lib__/xod/graphics/warning-16x16-rgba/patch.cpp index 555e6aa3..88c4094b 100644 --- a/workspace/__lib__/xod/graphics/warning-16x16-rgba/patch.cpp +++ b/workspace/__lib__/xod/graphics/warning-16x16-rgba/patch.cpp @@ -1,34 +1,29 @@ +nodespace { + static const unsigned char icon[] PROGMEM = { -static const unsigned char icon[] PROGMEM = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6b,0x23,0x6b,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf7,0x07,0xf7,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb5,0x25,0xff,0x47,0xff,0x47,0xb5,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf7,0x07,0xff,0x47,0xff,0x47,0xf7,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb5,0x25,0xff,0x27,0x83,0xe7,0x83,0xe7,0xff,0x27,0xb5,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0xe7,0xf6,0xe7,0x42,0x07,0x42,0x07,0xf6,0xe7,0xf6,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb5,0x05,0xff,0x26,0xf6,0xc6,0x4a,0x27,0x4a,0x27,0xf6,0xc6,0xff,0x26,0xb5,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0xc6,0xff,0x05,0xf6,0xc6,0x52,0x66,0x52,0x66,0xf6,0xc6,0xff,0x05,0xf6,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0xb4,0xe4,0xfe,0xe5,0xfe,0xe5,0xfe,0xc5,0x5a,0x86,0x5a,0xa6,0xfe,0xc5,0xfe,0xe5,0xfe,0xe5,0xb5,0x04,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0x85,0xfe,0xe5,0xfe,0xe5,0xfe,0xc5,0x62,0xc5,0x62,0xc5,0xfe,0xc5,0xfe,0xe5,0xfe,0xe5,0xf6,0x85,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0xb4,0xc3,0xfe,0xc4,0xfe,0xc4,0xfe,0xc4,0xfe,0xa4,0x6b,0x05,0x6b,0x05,0xfe,0xa4,0xfe,0xc4,0xfe,0xc4,0xfe,0xc4,0xb4,0xe3,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0xf6,0x44,0xfe,0xa3,0xfe,0xa3,0xfe,0xa3,0xfe,0xa3,0x9c,0x24,0x9c,0x24,0xfe,0xa3,0xfe,0xa3,0xfe,0xa3,0xfe,0xa3,0xf6,0x44,0x00,0x00,0x00,0x00 + ,0x00,0x00,0xb4,0xa3,0xfe,0x83,0xfe,0x83,0xfe,0x83,0xfe,0x83,0xfe,0x63,0x8b,0xa4,0x8b,0xa4,0xfe,0x63,0xfe,0x83,0xfe,0x83,0xfe,0x83,0xfe,0x83,0xb4,0xa3,0x00,0x00 + ,0x00,0x00,0xf6,0x02,0xfe,0x62,0xfe,0x62,0xfe,0x62,0xfe,0x62,0xfe,0x42,0x8b,0xa3,0x8b,0xa3,0xfe,0x42,0xfe,0x62,0xfe,0x62,0xfe,0x62,0xfe,0x62,0xf6,0x02,0x00,0x00 + ,0x83,0x41,0xfe,0x21,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x22,0xfe,0x22,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x21,0x83,0x41 + ,0x00,0x00,0x83,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x83,0x41,0x00,0x00 -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6b,0x23,0x6b,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf7,0x07,0xf7,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb5,0x25,0xff,0x47,0xff,0x47,0xb5,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf7,0x07,0xff,0x47,0xff,0x47,0xf7,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb5,0x25,0xff,0x27,0x83,0xe7,0x83,0xe7,0xff,0x27,0xb5,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0xe7,0xf6,0xe7,0x42,0x07,0x42,0x07,0xf6,0xe7,0xf6,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xb5,0x05,0xff,0x26,0xf6,0xc6,0x4a,0x27,0x4a,0x27,0xf6,0xc6,0xff,0x26,0xb5,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0xc6,0xff,0x05,0xf6,0xc6,0x52,0x66,0x52,0x66,0xf6,0xc6,0xff,0x05,0xf6,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0xb4,0xe4,0xfe,0xe5,0xfe,0xe5,0xfe,0xc5,0x5a,0x86,0x5a,0xa6,0xfe,0xc5,0xfe,0xe5,0xfe,0xe5,0xb5,0x04,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0x85,0xfe,0xe5,0xfe,0xe5,0xfe,0xc5,0x62,0xc5,0x62,0xc5,0xfe,0xc5,0xfe,0xe5,0xfe,0xe5,0xf6,0x85,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0xb4,0xc3,0xfe,0xc4,0xfe,0xc4,0xfe,0xc4,0xfe,0xa4,0x6b,0x05,0x6b,0x05,0xfe,0xa4,0xfe,0xc4,0xfe,0xc4,0xfe,0xc4,0xb4,0xe3,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0xf6,0x44,0xfe,0xa3,0xfe,0xa3,0xfe,0xa3,0xfe,0xa3,0x9c,0x24,0x9c,0x24,0xfe,0xa3,0xfe,0xa3,0xfe,0xa3,0xfe,0xa3,0xf6,0x44,0x00,0x00,0x00,0x00 -,0x00,0x00,0xb4,0xa3,0xfe,0x83,0xfe,0x83,0xfe,0x83,0xfe,0x83,0xfe,0x63,0x8b,0xa4,0x8b,0xa4,0xfe,0x63,0xfe,0x83,0xfe,0x83,0xfe,0x83,0xfe,0x83,0xb4,0xa3,0x00,0x00 -,0x00,0x00,0xf6,0x02,0xfe,0x62,0xfe,0x62,0xfe,0x62,0xfe,0x62,0xfe,0x42,0x8b,0xa3,0x8b,0xa3,0xfe,0x42,0xfe,0x62,0xfe,0x62,0xfe,0x62,0xfe,0x62,0xf6,0x02,0x00,0x00 -,0x83,0x41,0xfe,0x21,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x22,0xfe,0x22,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x41,0xfe,0x21,0x83,0x41 -,0x00,0x00,0x83,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x8b,0x41,0x83,0x41,0x00,0x00 - -}; - -struct State { - uint8_t mem[sizeof(Bitmap)]; - Bitmap* myBitmap; -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - auto state = getState(ctx); - state->myBitmap = new (state->mem) Bitmap(icon, 2, 16, 16, 0x0000); - emitValue(ctx, state->myBitmap); + }; +} +node { + Bitmap myBitmap = Bitmap(icon, 2, 16, 16, 0x0000); + + void evaluate(Context ctx) { + emitValue(ctx, &myBitmap); + } } diff --git a/workspace/__lib__/xod/graphics/wifi-16x16-bw/patch.cpp b/workspace/__lib__/xod/graphics/wifi-16x16-bw/patch.cpp index cd433f68..26874303 100644 --- a/workspace/__lib__/xod/graphics/wifi-16x16-bw/patch.cpp +++ b/workspace/__lib__/xod/graphics/wifi-16x16-bw/patch.cpp @@ -1,34 +1,29 @@ +nodespace { + static const unsigned char icon[] PROGMEM = { -static const unsigned char icon[] PROGMEM = { + 0b00000000, 0b00000000, // + 0b00000111, 0b11100000, // ###### + 0b00011111, 0b11111000, // ########## + 0b00111111, 0b11111100, // ############ + 0b01110000, 0b00001110, // ### ### + 0b01100111, 0b11100110, // ## ###### ## + 0b00001111, 0b11110000, // ######## + 0b00011000, 0b00011000, // ## ## + 0b00000011, 0b11000000, // #### + 0b00000111, 0b11100000, // ###### + 0b00000100, 0b00100000, // # # + 0b00000001, 0b10000000, // ## + 0b00000001, 0b10000000, // ## + 0b00000000, 0b00000000, // + 0b00000000, 0b00000000, // + 0b00000000, 0b00000000, // -0b00000000, 0b00000000, // -0b00000111, 0b11100000, // ###### -0b00011111, 0b11111000, // ########## -0b00111111, 0b11111100, // ############ -0b01110000, 0b00001110, // ### ### -0b01100111, 0b11100110, // ## ###### ## -0b00001111, 0b11110000, // ######## -0b00011000, 0b00011000, // ## ## -0b00000011, 0b11000000, // #### -0b00000111, 0b11100000, // ###### -0b00000100, 0b00100000, // # # -0b00000001, 0b10000000, // ## -0b00000001, 0b10000000, // ## -0b00000000, 0b00000000, // -0b00000000, 0b00000000, // -0b00000000, 0b00000000, // - -}; - -struct State { - uint8_t mem[sizeof(Bitmap)]; - Bitmap* myBitmap; -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - auto state = getState(ctx); - state->myBitmap = new (state->mem) Bitmap(icon, 0, 16, 16); - emitValue(ctx, state->myBitmap); + }; +} +node { + Bitmap myBitmap = Bitmap(icon, 0, 16, 16); + + void evaluate(Context ctx) { + emitValue(ctx, &myBitmap); + } } diff --git a/workspace/__lib__/xod/graphics/wifi-16x16-rgb/patch.cpp b/workspace/__lib__/xod/graphics/wifi-16x16-rgb/patch.cpp index fe217f6d..59d37305 100644 --- a/workspace/__lib__/xod/graphics/wifi-16x16-rgb/patch.cpp +++ b/workspace/__lib__/xod/graphics/wifi-16x16-rgb/patch.cpp @@ -1,34 +1,29 @@ +nodespace { + static const unsigned char icon[] PROGMEM = { -static const unsigned char icon[] PROGMEM = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2a,0xee,0x4d,0x1a,0x55,0xfe,0x55,0xfe,0x55,0xfe,0x55,0xfe,0x4d,0x3a,0x2a,0xef,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x4d,0x3a,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x4d,0x5b,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x4d,0x9c,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x4d,0xbc,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x45,0x1a,0x4d,0xbd,0x4d,0xbd,0x4d,0xbd,0x4d,0xbd,0x5d,0xfd,0x76,0x3d,0x6e,0x3d,0x5d,0xdd,0x4d,0xbd,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,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1a,0x2b,0x34,0x35,0x3d,0x1a,0x3d,0x1a,0x3d,0x1a,0x3d,0x1a,0x34,0x35,0x1a,0x4c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - -}; - -struct State { - uint8_t mem[sizeof(Bitmap)]; - Bitmap* myBitmap; -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - auto state = getState(ctx); - state->myBitmap = new (state->mem) Bitmap(icon, 1, 16, 16); - emitValue(ctx, state->myBitmap); + }; +} +node { + Bitmap myBitmap = Bitmap(icon, 1, 16, 16); + + void evaluate(Context ctx) { + emitValue(ctx, &myBitmap); + } } diff --git a/workspace/__lib__/xod/graphics/wifi-16x16-rgba/patch.cpp b/workspace/__lib__/xod/graphics/wifi-16x16-rgba/patch.cpp index 5e954a75..d0667a74 100644 --- a/workspace/__lib__/xod/graphics/wifi-16x16-rgba/patch.cpp +++ b/workspace/__lib__/xod/graphics/wifi-16x16-rgba/patch.cpp @@ -1,34 +1,29 @@ +nodespace { + static const unsigned char icon[] PROGMEM = { -static const unsigned char icon[] PROGMEM = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2a,0xee,0x4d,0x1a,0x55,0xfe,0x55,0xfe,0x55,0xfe,0x55,0xfe,0x4d,0x3a,0x2a,0xef,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x4d,0x3a,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x4d,0x5b,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x00,0x00,0x00,0x00,0x4d,0x9c,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x55,0xdd,0x4d,0xbc,0x00,0x00,0x00,0x00 + ,0x00,0x00,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,0x3d,0x3b,0x3d,0x3b,0x3d,0x3b,0x3d,0x3b,0x3d,0x3b,0x3d,0x3b,0x34,0x76,0x00,0x00,0x00,0x00,0x00,0x00 -,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1a,0x2b,0x34,0x35,0x3d,0x1a,0x3d,0x1a,0x3d,0x1a,0x3d,0x1a,0x34,0x35,0x1a,0x4c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - -}; - -struct State { - uint8_t mem[sizeof(Bitmap)]; - Bitmap* myBitmap; -}; - -{{ GENERATED_CODE }} - -void evaluate(Context ctx) { - auto state = getState(ctx); - state->myBitmap = new (state->mem) Bitmap(icon, 2, 16, 16, 0x0000); - emitValue(ctx, state->myBitmap); + }; +} +node { + Bitmap myBitmap = Bitmap(icon, 2, 16, 16, 0x0000); + + void evaluate(Context ctx) { + emitValue(ctx, &myBitmap); + } }