Skip to content

Commit b2b66aa

Browse files
marciotPragma8123
authored andcommitted
🚸 Update FTDI Eve / CocoaPress UI (MarlinFirmware#26233)
1 parent f652ff4 commit b2b66aa

36 files changed

+1568
-501
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
2+
/****************************************************************************
3+
* This program is free software: you can redistribute it and/or modify *
4+
* it under the terms of the GNU General Public License as published by *
5+
* the Free Software Foundation, either version 3 of the License, or *
6+
* (at your option) any later version. *
7+
* *
8+
* This program is distributed in the hope that it will be useful, *
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
11+
* GNU General Public License for more details. *
12+
* *
13+
* To view a copy of the GNU General Public License, go to the following *
14+
* location: <http://www.gnu.org/licenses/>. *
15+
****************************************************************************/
16+
17+
/**
18+
* This file was auto-generated using "svg2cpp.pl"
19+
*
20+
* The encoding consists of x,y pairs with the min and max scaled to
21+
* 0x0000 and 0xFFFE. A single 0xFFFF in the data stream indicates the
22+
* start of a new closed path.
23+
*/
24+
25+
#pragma once
26+
27+
constexpr float x_min = 0.000000;
28+
29+
constexpr float x_max = 480.000000;
30+
31+
constexpr float y_min = 0.000000;
32+
33+
constexpr float y_max = 272.000000;
34+
35+
const PROGMEM uint16_t outline[] = {
36+
0x8278, 0xC8E7, 0x7714, 0xC659, 0x6D20, 0xC0EF, 0x64D1, 0xB8D4, 0x5E5F, 0xAE2F,
37+
0x5AF5, 0xA493, 0x58F2, 0x99F6, 0x5886, 0x8B4E, 0x590F, 0x7956, 0x5997, 0x69F3,
38+
0x5B46, 0x5E96, 0x5E92, 0x5430, 0x6363, 0x4AF8, 0x69A4, 0x4327, 0x6F5B, 0x3E4A,
39+
0x7871, 0x3979, 0x82A1, 0x371E, 0x8CBB, 0x3756, 0x95A1, 0x3997, 0x9D90, 0x3D88,
40+
0xA50B, 0x43B6, 0xA6BC, 0x46C9, 0xA776, 0x4A42, 0xA669, 0x6D96, 0xA54B, 0x71E5,
41+
0xA030, 0x7B45, 0x9ECB, 0x7CC5, 0x9B2C, 0x7E1D, 0x9717, 0x7C80, 0x9521, 0x7B11,
42+
0x8FAD, 0x77D6, 0x8A1D, 0x7607, 0x82E0, 0x7609, 0x7CDD, 0x7812, 0x77F3, 0x7C15,
43+
0x75EF, 0x7EC5, 0x7830, 0x8278, 0x7D94, 0x8772, 0x847F, 0x8A0B, 0x8B98, 0x89F7,
44+
0x9127, 0x8806, 0x96AB, 0x849C, 0x9C6D, 0x81F2, 0x9F8E, 0x82E5, 0xA22C, 0x85FF,
45+
0xA63C, 0x8D9E, 0xA78B, 0x931F, 0xA68F, 0xB5E2, 0xA5D0, 0xB944, 0xA430, 0xBC3E,
46+
0x9E55, 0xC146, 0x94CA, 0xC660, 0x8A75, 0xC8DB, 0x8278, 0xC8E7, 0x8278, 0xC8E7
47+
};
48+
49+
const PROGMEM uint16_t shadow[] = {
50+
0x8699, 0x52F4, 0x807A, 0x5409, 0x7A89, 0x576A, 0x7583, 0x5D79, 0x7227, 0x6695,
51+
0x714B, 0x70C7, 0x71C8, 0x75DB, 0x730A, 0x7A69, 0x7496, 0x7A0E, 0x7601, 0x787F,
52+
0x78EF, 0x7565, 0x80E9, 0x7178, 0x8924, 0x7108, 0x914E, 0x7393, 0x9914, 0x789A,
53+
0x9B62, 0x792D, 0x9D8A, 0x7823, 0xA0FE, 0x72DA, 0xA34C, 0x6DC9, 0xA3D7, 0x6766,
54+
0xA42B, 0x5E98, 0xA3FD, 0x55F8, 0xA279, 0x55CE, 0xA12E, 0x578E, 0x9FE2, 0x59BB,
55+
0x9E59, 0x5AD8, 0x9AAC, 0x5AE1, 0x9728, 0x58ED, 0x9019, 0x54A3, 0x8699, 0x52F4,
56+
0x8699, 0x52F4, 0xFFFF, 0x5CA3, 0x849F, 0x5B93, 0x8686, 0x5B52, 0x896F, 0x5B3F,
57+
0x8FA9, 0x5C60, 0x9D67, 0x6003, 0xA994, 0x6582, 0xB393, 0x6C3B, 0xBAC7, 0x7604,
58+
0xC0E2, 0x8047, 0xC3D1, 0x8AB3, 0xC3DC, 0x94FB, 0xC14A, 0x9C85, 0xBD52, 0xA35D,
59+
0xB6C2, 0xA41B, 0xABC2, 0xA460, 0xA092, 0xA416, 0x9C7C, 0xA33E, 0x9B91, 0xA20E,
60+
0x9C3C, 0x9618, 0xA353, 0x8992, 0xA62E, 0x7CED, 0xA4E9, 0x7097, 0x9FA2, 0x6ADE,
61+
0x9B4F, 0x65A4, 0x9557, 0x6117, 0x8DDF, 0x5D63, 0x850D, 0x5CA3, 0x849F, 0x5CA3,
62+
0x849F
63+
};
64+
65+
const PROGMEM uint16_t highlight[] = {
66+
0x861C, 0x5348, 0x8243, 0x53C6, 0x7EBF, 0x5693, 0x7C12, 0x5B55, 0x7ABE, 0x61B3,
67+
0x7AFC, 0x6656, 0x7C42, 0x6A49, 0x7FB1, 0x7163, 0x862A, 0x7090, 0x8C99, 0x717A,
68+
0x92E2, 0x740A, 0x98E8, 0x782A, 0x9AB3, 0x7852, 0x9C22, 0x7665, 0x9E0C, 0x7087,
69+
0x9E69, 0x65BE, 0x9C07, 0x5BDE, 0x9319, 0x568D, 0x8E92, 0x544E, 0x89E2, 0x534D,
70+
0x861C, 0x5348, 0x861C, 0x5348, 0xFFFF, 0x6B6A, 0x9CA0, 0x69D9, 0x9F11, 0x695E,
71+
0xA2AD, 0x6A25, 0xAA51, 0x6DB0, 0xBBAA, 0x785A, 0xC170, 0x8372, 0xC3D0, 0x8E9F,
72+
0xC2E2, 0x9987, 0xBEBD, 0x9CAB, 0xBCE9, 0x9EFE, 0xB9D2, 0x9E63, 0xB379, 0x9CE9,
73+
0xAD92, 0x98DE, 0xA2B8, 0x8D7F, 0xA5FA, 0x81FE, 0xA636, 0x76A6, 0xA32E, 0x6BC5,
74+
0x9CA0, 0x6B6A, 0x9CA0, 0x6B6A, 0x9CA0
75+
};
76+
77+
const PROGMEM uint16_t stroke[] = {
78+
0x8282, 0xC890, 0x7A14, 0xC6FB, 0x7257, 0xC3D9, 0x6B6A, 0xBF38, 0x6569, 0xB928,
79+
0x5E84, 0xADEC, 0x5B1E, 0xA460, 0x5926, 0x99F8, 0x58A5, 0x90C0, 0x59B6, 0x6B3D,
80+
0x5B4C, 0x5F6C, 0x5EA3, 0x549E, 0x63A2, 0x4B13, 0x6A2E, 0x430B, 0x71D8, 0x3D0C,
81+
0x7A7A, 0x3923, 0x83D5, 0x3761, 0x8DAA, 0x37DB, 0x98A8, 0x3B38, 0xA283, 0x4193,
82+
0xA638, 0x4620, 0xA741, 0x4B64, 0xA6C5, 0x5D20, 0xA613, 0x6E81, 0xA43A, 0x738A,
83+
0xA01F, 0x7AE8, 0x9DE9, 0x7D0E, 0x9B69, 0x7DBD, 0x9629, 0x7B6D, 0x905C, 0x77C9,
84+
0x8A94, 0x75BF, 0x8402, 0x7587, 0x7E52, 0x76FE, 0x79CA, 0x79CE, 0x75B1, 0x7EC7,
85+
0x780B, 0x82C0, 0x7C5E, 0x8702, 0x8193, 0x89A9, 0x8702, 0x8AA4, 0x8C76, 0x8A18,
86+
0x91F2, 0x8803, 0x977B, 0x8464, 0x9C8C, 0x825E, 0x9EAF, 0x82C4, 0xA0FC, 0x84BC,
87+
0xA3C6, 0x8965, 0xA6CF, 0x8FEF, 0xA756, 0x9463, 0xA6DA, 0xA612, 0xA5DF, 0xB86B,
88+
0xA414, 0xBBE7, 0xA03D, 0xBF7C, 0x9648, 0xC56A, 0x8B45, 0xC86E, 0x8282, 0xC890,
89+
0x8282, 0xC890, 0xFFFF, 0x89EE, 0xC221, 0x9395, 0xBFE8, 0x9C6D, 0xBB4F, 0xA047,
90+
0xB837, 0xA298, 0xB561, 0xA30A, 0xAA1F, 0xA34B, 0x9D6D, 0xA204, 0x9E54, 0x9820,
91+
0xA474, 0x960F, 0xA542, 0x886E, 0xA808, 0x803F, 0xA783, 0x785E, 0xA57C, 0x703C,
92+
0xA168, 0x691E, 0x9BB9, 0x623D, 0x92BA, 0x5D27, 0x8795, 0x5C9D, 0x868D, 0x5C4D,
93+
0x90BE, 0x5DBC, 0x9E89, 0x6126, 0xA944, 0x6630, 0xB207, 0x6CB0, 0xB914, 0x6E6F,
94+
0xBA8C, 0x7080, 0xBC05, 0x78E3, 0xC016, 0x8263, 0xC21E, 0x89EE, 0xC221, 0x89EE,
95+
0xC221, 0xFFFF, 0x8CBB, 0xA14B, 0x9726, 0x9E32, 0xA086, 0x9855, 0xA324, 0x95C0,
96+
0xA39A, 0x92E9, 0xA121, 0x8DC2, 0x9E86, 0x8984, 0x9C63, 0x88AD, 0x98A6, 0x8A73,
97+
0x8FB6, 0x8F97, 0x86EE, 0x90FB, 0x804C, 0x8FBC, 0x7A84, 0x8C98, 0x7476, 0x85CD,
98+
0x706D, 0x7C88, 0x6EAA, 0x7064, 0x6EFF, 0x6929, 0x7056, 0x624A, 0x73DB, 0x59D0,
99+
0x76F3, 0x5586, 0x7AA5, 0x523E, 0x83F8, 0x4E97, 0x8B83, 0x4EA9, 0x9221, 0x50DF,
100+
0x98F7, 0x552D, 0x9C44, 0x56AE, 0x9DAF, 0x5652, 0xA12C, 0x5116, 0xA370, 0x4C6E,
101+
0xA381, 0x4A6D, 0xA10D, 0x4772, 0x985F, 0x41B3, 0x8EB8, 0x3E71, 0x8631, 0x3DA9,
102+
0x7DFC, 0x3EA4, 0x7645, 0x4159, 0x6F3D, 0x45BB, 0x6952, 0x4B6F, 0x646A, 0x529B,
103+
0x60B0, 0x5AA7, 0x5E57, 0x6375, 0x5D39, 0x6ED1, 0x5E1E, 0x7B35, 0x6120, 0x8666,
104+
0x6620, 0x9016, 0x6D01, 0x97F7, 0x7747, 0x9E7A, 0x83D9, 0xA18C, 0x8CBB, 0xA14B,
105+
0x8CBB, 0xA14B, 0xFFFF, 0x7481, 0x77DA, 0x793F, 0x7317, 0x7EE3, 0x701D, 0x8044,
106+
0x6FBD, 0x81B4, 0x6F76, 0x846C, 0x6F18, 0x8E1D, 0x7044, 0x97FF, 0x75D2, 0x9B2B,
107+
0x772F, 0x9DAF, 0x75F3, 0xA26D, 0x6D0E, 0xA2E9, 0x62B8, 0xA33C, 0x583A, 0xA31E,
108+
0x573E, 0xA252, 0x5871, 0x9FC0, 0x5BDB, 0x9CD5, 0x5D2A, 0x9751, 0x5AEC, 0x914A,
109+
0x5720, 0x8B83, 0x5519, 0x83E3, 0x5506, 0x7ECB, 0x56B4, 0x7A0F, 0x59E9, 0x765D,
110+
0x5E9D, 0x73CE, 0x64A3, 0x727C, 0x6BCF, 0x7286, 0x72FD, 0x73A3, 0x78D6, 0x7481,
111+
0x77DA, 0x7481, 0x77DA
112+
};
113+
114+
const PROGMEM uint16_t surface[] = {
115+
0x8CBB, 0xA14B, 0x9726, 0x9E32, 0xA086, 0x9855, 0xA324, 0x95C0, 0xA39A, 0x92E9,
116+
0xA121, 0x8DC2, 0x9E86, 0x8984, 0x9C63, 0x88AD, 0x98A6, 0x8A73, 0x8FB6, 0x8F97,
117+
0x86EE, 0x90FB, 0x804C, 0x8FBC, 0x7A84, 0x8C98, 0x7476, 0x85CD, 0x706D, 0x7C88,
118+
0x6EAA, 0x7064, 0x6EFF, 0x6929, 0x7056, 0x624A, 0x73DB, 0x59D0, 0x76F3, 0x5586,
119+
0x7AA5, 0x523E, 0x83F8, 0x4E97, 0x8B83, 0x4EA9, 0x9221, 0x50DF, 0x98F7, 0x552D,
120+
0x9C44, 0x56AE, 0x9DAF, 0x5652, 0xA12C, 0x5116, 0xA370, 0x4C6E, 0xA381, 0x4A6D,
121+
0xA10D, 0x4772, 0x985F, 0x41B3, 0x8EB8, 0x3E71, 0x8631, 0x3DA9, 0x7DFC, 0x3EA4,
122+
0x7645, 0x4159, 0x6F3D, 0x45BB, 0x6952, 0x4B6F, 0x646A, 0x529B, 0x60B0, 0x5AA7,
123+
0x5E57, 0x6375, 0x5D39, 0x6ED1, 0x5E1E, 0x7B35, 0x6120, 0x8666, 0x6620, 0x9016,
124+
0x6D01, 0x97F7, 0x7747, 0x9E7A, 0x83D9, 0xA18C, 0x8CBB, 0xA14B, 0x8CBB, 0xA14B
125+
};
126+
127+
//#define LOGO_BACKGROUND 0xF05A22
128+
#define LOGO_BACKGROUND 0xFFFFFF
129+
130+
#define LOGO_PAINT_PATHS \
131+
LOGO_PAINT_PATH(0xF27121, surface) \
132+
LOGO_PAINT_PATH(0x6B2C1B, shadow) \
133+
LOGO_PAINT_PATH(0xBC3E26, highlight) \
134+
LOGO_PAINT_PATH(0x3C2215, stroke)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
/********************
2+
* about_screen.cpp *
3+
********************/
4+
5+
/****************************************************************************
6+
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
7+
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
8+
* *
9+
* This program is free software: you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation, either version 3 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
* This program is distributed in the hope that it will be useful, *
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17+
* GNU General Public License for more details. *
18+
* *
19+
* To view a copy of the GNU General Public License, go to the following *
20+
* location: <https://www.gnu.org/licenses/>. *
21+
****************************************************************************/
22+
23+
#include "../config.h"
24+
#include "../screens.h"
25+
26+
#ifdef COCOA_ABOUT_SCREEN
27+
28+
#define GRID_COLS 4
29+
#define GRID_ROWS 8
30+
31+
using namespace FTDI;
32+
using namespace Theme;
33+
using namespace ExtUI;
34+
35+
void AboutScreen::onEntry() {
36+
BaseScreen::onEntry();
37+
sound.play(chimes, PLAY_ASYNCHRONOUS);
38+
}
39+
40+
void AboutScreen::onRedraw(draw_mode_t) {
41+
CommandProcessor cmd;
42+
cmd.cmd(CLEAR_COLOR_RGB(bg_color))
43+
.cmd(CLEAR(true,true,true))
44+
.cmd(COLOR_RGB(bg_text_enabled))
45+
.tag(0);
46+
47+
#define HEADING_POS BTN_POS(1,1), BTN_SIZE(4,2)
48+
#define FW_VERS_POS BTN_POS(1,3), BTN_SIZE(4,1)
49+
#define FW_INFO_POS BTN_POS(1,4), BTN_SIZE(4,1)
50+
#define LICENSE_POS BTN_POS(1,5), BTN_SIZE(4,3)
51+
#define STATS_POS BTN_POS(1,8), BTN_SIZE(2,1)
52+
#define BACK_POS BTN_POS(3,8), BTN_SIZE(2,1)
53+
54+
char about_str[1
55+
+ strlen_P(GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2))
56+
#ifdef TOOLHEAD_NAME
57+
+ strlen_P(TOOLHEAD_NAME)
58+
#endif
59+
];
60+
#ifdef TOOLHEAD_NAME
61+
// If MSG_ABOUT_TOUCH_PANEL_2 has %s, substitute in the toolhead name.
62+
// But this is optional, so squelch the compiler warning here.
63+
#pragma GCC diagnostic push
64+
#pragma GCC diagnostic ignored "-Wformat-extra-args"
65+
sprintf_P(about_str, GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2), TOOLHEAD_NAME);
66+
#pragma GCC diagnostic pop
67+
#else
68+
strcpy_P(about_str, GET_TEXT(MSG_ABOUT_TOUCH_PANEL_2));
69+
#endif
70+
71+
draw_text_box(cmd, HEADING_POS,
72+
#ifdef MACHINE_NAME
73+
F(MACHINE_NAME)
74+
#else
75+
GET_TEXT_F(MSG_ABOUT_TOUCH_PANEL_1)
76+
#endif
77+
, OPT_CENTER, font_xlarge
78+
);
79+
#if ALL(TOUCH_UI_DEVELOPER_MENU, FTDI_DEVELOPER_MENU)
80+
cmd.tag(3);
81+
#endif
82+
draw_text_box(cmd, FW_VERS_POS,
83+
#ifdef TOUCH_UI_VERSION
84+
F(TOUCH_UI_VERSION)
85+
#else
86+
FPSTR(getFirmwareName_str())
87+
#endif
88+
, OPT_CENTER, font_medium);
89+
cmd.tag(0);
90+
draw_text_box(cmd, FW_INFO_POS, about_str, OPT_CENTER, font_medium);
91+
draw_text_box(cmd, LICENSE_POS, GET_TEXT_F(MSG_LICENSE), OPT_CENTER, font_tiny);
92+
93+
cmd.font(font_medium);
94+
#if ENABLED(PRINTCOUNTER)
95+
cmd.colors(normal_btn)
96+
.tag(2).button(STATS_POS, GET_TEXT_F(MSG_INFO_STATS_MENU));
97+
#endif
98+
cmd.colors(action_btn)
99+
.tag(1).button(BACK_POS, GET_TEXT_F(MSG_BUTTON_DONE));
100+
}
101+
102+
bool AboutScreen::onTouchEnd(uint8_t tag) {
103+
switch (tag) {
104+
case 1: GOTO_PREVIOUS(); break;
105+
#if ENABLED(PRINTCOUNTER)
106+
case 2: GOTO_SCREEN(StatisticsScreen); break;
107+
#endif
108+
#if ALL(TOUCH_UI_DEVELOPER_MENU, FTDI_DEVELOPER_MENU)
109+
case 3: GOTO_SCREEN(DeveloperMenu); break;
110+
#endif
111+
default: return false;
112+
}
113+
return true;
114+
}
115+
116+
#endif // COCOA_ABOUT_SCREEN
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/******************
2+
* about_screen.h *
3+
******************/
4+
5+
/****************************************************************************
6+
* Written By Mark Pelletier 2017 - Aleph Objects, Inc. *
7+
* Written By Marcio Teixeira 2018 - Aleph Objects, Inc. *
8+
* *
9+
* This program is free software: you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation, either version 3 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
* This program is distributed in the hope that it will be useful, *
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17+
* GNU General Public License for more details. *
18+
* *
19+
* To view a copy of the GNU General Public License, go to the following *
20+
* location: <https://www.gnu.org/licenses/>. *
21+
****************************************************************************/
22+
23+
#pragma once
24+
25+
#define COCOA_ABOUT_SCREEN
26+
#define COCOA_ABOUT_SCREEN_CLASS AboutScreen
27+
28+
class AboutScreen : public BaseScreen, public UncachedScreen {
29+
public:
30+
static void onEntry();
31+
static void onRedraw(draw_mode_t);
32+
static bool onTouchEnd(uint8_t tag);
33+
};

0 commit comments

Comments
 (0)