Browse Source

update eez-framework

master
Martin Vladic 2 years ago
parent
commit
f09b1d46be
  1. 2
      Middlewares/eez
  2. 2
      Src/conf/eez/conf.h
  3. 2333
      Src/eez-flow-template-stm32f469i-disco.eez-project
  4. 26
      Src/gui/app_context.cpp
  5. 1
      Src/gui/app_context.h
  6. 17602
      Src/gui/document.cpp
  7. 263
      Src/gui/document.h

2
Middlewares/eez

@ -1 +1 @@
Subproject commit 96978d9d7a283ed76c9439fe52c769a17820e48e
Subproject commit 23839e9ea1c7118a7cc947712b37a3045f260804

2
Src/conf/eez/conf.h

@ -38,3 +38,5 @@ static const uint32_t GUI_STATE_BUFFER_SIZE = 64 * 1024;
#if defined(EEZ_PLATFORM_SIMULATOR)
static const uint32_t GUI_STATE_BUFFER_SIZE = 128 * 1024;
#endif
#define OPTION_KEYPAD 1

2333
Src/eez-flow-template-stm32f469i-disco.eez-project

File diff suppressed because one or more lines are too long

26
Src/gui/app_context.cpp

@ -15,20 +15,8 @@ DeviceAppContext g_deviceAppContext;
void DeviceAppContext::stateManagment() {
AppContext::stateManagment();
// if none page is active then show touch screen calibration page or banner
if (getActivePageId() == PAGE_ID_NONE) {
if (!isTouchCalibrated()) {
enterTouchCalibration(&g_deviceAppContext);
} else {
showPage(getMainPageId());
}
}
// play power up tune when banner page shows up
static bool g_powerUpPlayed;
if (!g_powerUpPlayed && getActivePageId() == PAGE_ID_MAIN) {
sound::playPowerUp(sound::PLAY_POWER_UP_CONDITION_NONE);
g_powerUpPlayed = true;
showPage(getMainPageId());
}
}
@ -36,18 +24,6 @@ int DeviceAppContext::getMainPageId() {
return PAGE_ID_MAIN;
}
void DeviceAppContext::pageRenderCustom(int i, WidgetCursor &widgetCursor) {
if (getActivePageId() == PAGE_ID_TOUCH_CALIBRATION_YES_NO) {
auto touchEvent = touch::getLastEvent();
if (touchEvent.type == EVENT_TYPE_TOUCH_DOWN || touchEvent.type == EVENT_TYPE_TOUCH_MOVE) {
int x = MIN(MAX(touchEvent.x, 1), display::getDisplayWidth() - 2);
int y = MIN(MAX(touchEvent.y, 1), display::getDisplayHeight() - 2);
display::setColor(255, 255, 255);
display::fillRect(x - 1, y - 1, x + 1, y + 1);
}
}
}
bool DeviceAppContext::isAutoRepeatAction(int action) {
return action == ACTION_ID_KEYPAD_BACK;
}

1
Src/gui/app_context.h

@ -10,7 +10,6 @@ namespace gui {
class DeviceAppContext : public AppContext {
public:
void stateManagment() override;
void pageRenderCustom(int i, WidgetCursor &widgetCursor) override;
bool isAutoRepeatAction(int action) override;
protected:

17602
Src/gui/document.cpp

File diff suppressed because it is too large Load Diff

263
Src/gui/document.h

@ -11,25 +11,23 @@ namespace gui {
enum DataEnum {
DATA_ID_NONE = 0,
DATA_ID_ALERT_MESSAGE = 1,
DATA_ID_TOUCH_CALIBRATION_POINT = 2,
DATA_ID_KEYPAD_TEXT = 3,
DATA_ID_KEYPAD_EDIT_UNIT = 4,
DATA_ID_KEYPAD_SIGN_ENABLED = 5,
DATA_ID_KEYPAD_UNIT_ENABLED = 6,
DATA_ID_KEYPAD_DOT_ENABLED = 7,
DATA_ID_KEYPAD_OPTION1_ENABLED = 8,
DATA_ID_KEYPAD_OPTION1_TEXT = 9,
DATA_ID_KEYPAD_OPTION2_ENABLED = 10,
DATA_ID_KEYPAD_OPTION2_TEXT = 11,
DATA_ID_KEYPAD_OPTION3_ENABLED = 12,
DATA_ID_KEYPAD_OPTION3_TEXT = 13,
DATA_ID_KEYPAD_MODE = 14,
DATA_ID_KEYPAD_OK_ENABLED = 15
DATA_ID_KEYPAD_TEXT = 2,
DATA_ID_KEYPAD_EDIT_UNIT = 3,
DATA_ID_KEYPAD_SIGN_ENABLED = 4,
DATA_ID_KEYPAD_UNIT_ENABLED = 5,
DATA_ID_KEYPAD_DOT_ENABLED = 6,
DATA_ID_KEYPAD_OPTION1_ENABLED = 7,
DATA_ID_KEYPAD_OPTION1_TEXT = 8,
DATA_ID_KEYPAD_OPTION2_ENABLED = 9,
DATA_ID_KEYPAD_OPTION2_TEXT = 10,
DATA_ID_KEYPAD_OPTION3_ENABLED = 11,
DATA_ID_KEYPAD_OPTION3_TEXT = 12,
DATA_ID_KEYPAD_MODE = 13,
DATA_ID_KEYPAD_OK_ENABLED = 14
};
void data_none(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_alert_message(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_touch_calibration_point(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_keypad_text(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_keypad_edit_unit(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_keypad_sign_enabled(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
@ -91,13 +89,12 @@ extern ActionExecFunc g_actionExecFunctions[];
enum FontsEnum {
FONT_ID_NONE = 0,
FONT_ID_SHADOW = 1,
FONT_ID_ICONS = 2,
FONT_ID_ICONS = 1,
FONT_ID_SHADOW = 2,
FONT_ID_MEDIUM = 3,
FONT_ID_OSWALD_24 = 4,
FONT_ID_GUI_ICONS = 5,
FONT_ID_OSWALD_38 = 6,
FONT_ID_OSWALD_17 = 7
FONT_ID_OSWALD_38 = 5,
FONT_ID_OSWALD_17 = 6
};
enum BitmapsEnum {
@ -106,46 +103,43 @@ enum BitmapsEnum {
enum StylesEnum {
STYLE_ID_NONE = 0,
STYLE_ID_DEFAULT = 1,
STYLE_ID_INFO_ALERT = 2,
STYLE_ID_ERROR_ALERT = 3,
STYLE_ID_ERROR_ALERT_BUTTON = 4,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_CONTAINER = 5,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_CONTAINER_S = 6,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_ITEM = 7,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_ITEM_S = 8,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_DISABLED_ITEM = 9,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_DISABLED_ITEM_S = 10,
STYLE_ID_MENU_WITH_BUTTONS_MESSAGE = 11,
STYLE_ID_MENU_WITH_BUTTONS_CONTAINER = 12,
STYLE_ID_MENU_WITH_BUTTONS_BUTTON = 13,
STYLE_ID_FPS_GRAPH = 14,
STYLE_ID_BACKGROUND = 15,
STYLE_ID_INFO_ALERT = 1,
STYLE_ID_ERROR_ALERT = 2,
STYLE_ID_ERROR_ALERT_BUTTON = 3,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_CONTAINER = 4,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_CONTAINER_S = 5,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_ITEM = 6,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_ITEM_S = 7,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_DISABLED_ITEM = 8,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_DISABLED_ITEM_S = 9,
STYLE_ID_MENU_WITH_BUTTONS_MESSAGE = 10,
STYLE_ID_MENU_WITH_BUTTONS_CONTAINER = 11,
STYLE_ID_MENU_WITH_BUTTONS_BUTTON = 12,
STYLE_ID_FPS_GRAPH = 13,
STYLE_ID_BACKGROUND = 14,
STYLE_ID_DEFAULT = 15,
STYLE_ID_INLINE15 = 16,
STYLE_ID_INLINE16 = 17,
STYLE_ID_INLINE17 = 18,
STYLE_ID_DEFAULT_24 = 19,
STYLE_ID_BUTTON = 20,
STYLE_ID_BUTTON_DISABLED = 21,
STYLE_ID_TOUCH_CALIBRATION = 22,
STYLE_ID_NOTE_M = 23,
STYLE_ID_TOUCH_CALIBRATION_POINT = 24,
STYLE_ID_DEFAULT_38 = 25,
STYLE_ID_DISABLED_BUTTON = 26,
STYLE_ID_BUTTON_ICON = 27,
STYLE_ID_TEXT_INPUT = 28,
STYLE_ID_TEXT_BUTTON = 29,
STYLE_ID_TEXT_BUTTON_ICON = 30,
STYLE_ID_TEXT_BUTTON_ICON_DISABLED = 31,
STYLE_ID_TAB = 32,
STYLE_ID_QUOTE = 33,
STYLE_ID_DEFAULT_38 = 22,
STYLE_ID_DISABLED_BUTTON = 23,
STYLE_ID_BUTTON_ICON = 24,
STYLE_ID_TEXT_INPUT = 25,
STYLE_ID_TEXT_BUTTON = 26,
STYLE_ID_TEXT_BUTTON_ICON = 27,
STYLE_ID_TEXT_BUTTON_ICON_DISABLED = 28,
STYLE_ID_TAB = 29,
STYLE_ID_QUOTE = 30,
STYLE_ID_INLINE30 = 31,
STYLE_ID_INLINE31 = 32,
STYLE_ID_INLINE32 = 33,
STYLE_ID_INLINE33 = 34,
STYLE_ID_INLINE34 = 35,
STYLE_ID_INLINE35 = 36,
STYLE_ID_INLINE36 = 37,
STYLE_ID_LABEL_LEFT_ALIGNED = 38,
STYLE_ID_BUTTON_LARGE = 39,
STYLE_ID_BLOCK = 40
STYLE_ID_LABEL_LEFT_ALIGNED = 35,
STYLE_ID_BUTTON_LARGE = 36,
STYLE_ID_BLOCK = 37
};
enum ThemesEnum {
@ -192,55 +186,49 @@ enum ColorsEnum {
COLOR_ID_CUSTOM_3510E6 = 35,
COLOR_ID_CUSTOM_14D224 = 36,
COLOR_ID_CUSTOM_EC2A15 = 37,
COLOR_ID_CUSTOM_FFFFFF = 38,
COLOR_ID_CUSTOM_00FF00 = 39,
COLOR_ID_CUSTOM_B9F3F0 = 40,
COLOR_ID_CUSTOM_EEE30F = 41,
COLOR_ID_CUSTOM_C0C0C0 = 42,
COLOR_ID_CUSTOM_808080 = 43,
COLOR_ID_CUSTOM_C8C8C8 = 44
COLOR_ID_CUSTOM_B9F3F0 = 38,
COLOR_ID_CUSTOM_EEE30F = 39,
COLOR_ID_CUSTOM_C0C0C0 = 40,
COLOR_ID_CUSTOM_808080 = 41,
COLOR_ID_CUSTOM_C8C8C8 = 42
};
enum PagesEnum {
PAGE_ID_NONE = 0,
PAGE_ID_MAIN = 1,
PAGE_ID_TOUCH_CALIBRATION = 2,
PAGE_ID_TOUCH_CALIBRATION_YES_NO = 3,
PAGE_ID_NUMERIC_KEYPAD = 4,
PAGE_ID_KEYBOARD = 5,
PAGE_ID_ANIM_DEMO = 6,
PAGE_ID_INPUT_DEMO = 7,
PAGE_ID_ROLLER_INPUT_DEMO = 8,
PAGE_ID_LOADER = 9
PAGE_ID_NUMERIC_KEYPAD = 2,
PAGE_ID_KEYBOARD = 3,
PAGE_ID_ANIM_DEMO = 4,
PAGE_ID_INPUT_DEMO = 5,
PAGE_ID_ROLLER_INPUT_DEMO = 6,
PAGE_ID_LOADER = 7
};
extern const uint8_t assets[68232];
extern const uint8_t assets[66919];
#elif defined(EEZ_PLATFORM_SIMULATOR)
enum DataEnum {
DATA_ID_NONE = 0,
DATA_ID_ALERT_MESSAGE = 1,
DATA_ID_TOUCH_CALIBRATION_POINT = 2,
DATA_ID_KEYPAD_TEXT = 3,
DATA_ID_KEYPAD_EDIT_UNIT = 4,
DATA_ID_KEYPAD_SIGN_ENABLED = 5,
DATA_ID_KEYPAD_UNIT_ENABLED = 6,
DATA_ID_KEYPAD_DOT_ENABLED = 7,
DATA_ID_KEYPAD_OPTION1_ENABLED = 8,
DATA_ID_KEYPAD_OPTION1_TEXT = 9,
DATA_ID_KEYPAD_OPTION2_ENABLED = 10,
DATA_ID_KEYPAD_OPTION2_TEXT = 11,
DATA_ID_KEYPAD_OPTION3_ENABLED = 12,
DATA_ID_KEYPAD_OPTION3_TEXT = 13,
DATA_ID_KEYPAD_MODE = 14,
DATA_ID_KEYPAD_OK_ENABLED = 15,
DATA_ID_MAIN_APP_VIEW = 16
DATA_ID_KEYPAD_TEXT = 2,
DATA_ID_KEYPAD_EDIT_UNIT = 3,
DATA_ID_KEYPAD_SIGN_ENABLED = 4,
DATA_ID_KEYPAD_UNIT_ENABLED = 5,
DATA_ID_KEYPAD_DOT_ENABLED = 6,
DATA_ID_KEYPAD_OPTION1_ENABLED = 7,
DATA_ID_KEYPAD_OPTION1_TEXT = 8,
DATA_ID_KEYPAD_OPTION2_ENABLED = 9,
DATA_ID_KEYPAD_OPTION2_TEXT = 10,
DATA_ID_KEYPAD_OPTION3_ENABLED = 11,
DATA_ID_KEYPAD_OPTION3_TEXT = 12,
DATA_ID_KEYPAD_MODE = 13,
DATA_ID_KEYPAD_OK_ENABLED = 14,
DATA_ID_MAIN_APP_VIEW = 15
};
void data_none(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_alert_message(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_touch_calibration_point(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_keypad_text(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_keypad_edit_unit(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_keypad_sign_enabled(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
@ -303,13 +291,12 @@ extern ActionExecFunc g_actionExecFunctions[];
enum FontsEnum {
FONT_ID_NONE = 0,
FONT_ID_SHADOW = 1,
FONT_ID_ICONS = 2,
FONT_ID_ICONS = 1,
FONT_ID_SHADOW = 2,
FONT_ID_MEDIUM = 3,
FONT_ID_OSWALD_24 = 4,
FONT_ID_GUI_ICONS = 5,
FONT_ID_OSWALD_38 = 6,
FONT_ID_OSWALD_17 = 7
FONT_ID_OSWALD_38 = 5,
FONT_ID_OSWALD_17 = 6
};
enum BitmapsEnum {
@ -319,47 +306,44 @@ enum BitmapsEnum {
enum StylesEnum {
STYLE_ID_NONE = 0,
STYLE_ID_DEFAULT = 1,
STYLE_ID_INFO_ALERT = 2,
STYLE_ID_ERROR_ALERT = 3,
STYLE_ID_ERROR_ALERT_BUTTON = 4,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_CONTAINER = 5,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_CONTAINER_S = 6,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_ITEM = 7,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_ITEM_S = 8,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_DISABLED_ITEM = 9,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_DISABLED_ITEM_S = 10,
STYLE_ID_MENU_WITH_BUTTONS_MESSAGE = 11,
STYLE_ID_MENU_WITH_BUTTONS_CONTAINER = 12,
STYLE_ID_MENU_WITH_BUTTONS_BUTTON = 13,
STYLE_ID_FPS_GRAPH = 14,
STYLE_ID_BACKGROUND = 15,
STYLE_ID_INFO_ALERT = 1,
STYLE_ID_ERROR_ALERT = 2,
STYLE_ID_ERROR_ALERT_BUTTON = 3,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_CONTAINER = 4,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_CONTAINER_S = 5,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_ITEM = 6,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_ITEM_S = 7,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_DISABLED_ITEM = 8,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_DISABLED_ITEM_S = 9,
STYLE_ID_MENU_WITH_BUTTONS_MESSAGE = 10,
STYLE_ID_MENU_WITH_BUTTONS_CONTAINER = 11,
STYLE_ID_MENU_WITH_BUTTONS_BUTTON = 12,
STYLE_ID_FPS_GRAPH = 13,
STYLE_ID_BACKGROUND = 14,
STYLE_ID_DEFAULT = 15,
STYLE_ID_INLINE15 = 16,
STYLE_ID_INLINE16 = 17,
STYLE_ID_INLINE17 = 18,
STYLE_ID_DEFAULT_24 = 19,
STYLE_ID_BUTTON = 20,
STYLE_ID_BUTTON_DISABLED = 21,
STYLE_ID_TOUCH_CALIBRATION = 22,
STYLE_ID_NOTE_M = 23,
STYLE_ID_TOUCH_CALIBRATION_POINT = 24,
STYLE_ID_DEFAULT_38 = 25,
STYLE_ID_DISABLED_BUTTON = 26,
STYLE_ID_BUTTON_ICON = 27,
STYLE_ID_TEXT_INPUT = 28,
STYLE_ID_TEXT_BUTTON = 29,
STYLE_ID_TEXT_BUTTON_ICON = 30,
STYLE_ID_TEXT_BUTTON_ICON_DISABLED = 31,
STYLE_ID_TAB = 32,
STYLE_ID_QUOTE = 33,
STYLE_ID_DEFAULT_38 = 22,
STYLE_ID_DISABLED_BUTTON = 23,
STYLE_ID_BUTTON_ICON = 24,
STYLE_ID_TEXT_INPUT = 25,
STYLE_ID_TEXT_BUTTON = 26,
STYLE_ID_TEXT_BUTTON_ICON = 27,
STYLE_ID_TEXT_BUTTON_ICON_DISABLED = 28,
STYLE_ID_TAB = 29,
STYLE_ID_QUOTE = 30,
STYLE_ID_INLINE30 = 31,
STYLE_ID_INLINE31 = 32,
STYLE_ID_INLINE32 = 33,
STYLE_ID_INLINE33 = 34,
STYLE_ID_INLINE34 = 35,
STYLE_ID_INLINE35 = 36,
STYLE_ID_INLINE36 = 37,
STYLE_ID_LABEL_LEFT_ALIGNED = 38,
STYLE_ID_BUTTON_LARGE = 39,
STYLE_ID_BLOCK = 40,
STYLE_ID_INLINE40 = 41
STYLE_ID_LABEL_LEFT_ALIGNED = 35,
STYLE_ID_BUTTON_LARGE = 36,
STYLE_ID_BLOCK = 37,
STYLE_ID_INLINE37 = 38
};
enum ThemesEnum {
@ -406,30 +390,27 @@ enum ColorsEnum {
COLOR_ID_CUSTOM_3510E6 = 35,
COLOR_ID_CUSTOM_14D224 = 36,
COLOR_ID_CUSTOM_EC2A15 = 37,
COLOR_ID_CUSTOM_FFFFFF = 38,
COLOR_ID_CUSTOM_00FF00 = 39,
COLOR_ID_CUSTOM_B9F3F0 = 40,
COLOR_ID_CUSTOM_EEE30F = 41,
COLOR_ID_CUSTOM_C0C0C0 = 42,
COLOR_ID_CUSTOM_808080 = 43,
COLOR_ID_CUSTOM_C8C8C8 = 44
COLOR_ID_CUSTOM_B9F3F0 = 38,
COLOR_ID_CUSTOM_EEE30F = 39,
COLOR_ID_CUSTOM_C0C0C0 = 40,
COLOR_ID_CUSTOM_808080 = 41,
COLOR_ID_CUSTOM_C8C8C8 = 42,
COLOR_ID_CUSTOM_FFFFFF = 43
};
enum PagesEnum {
PAGE_ID_NONE = 0,
PAGE_ID_MAIN = 1,
PAGE_ID_TOUCH_CALIBRATION = 2,
PAGE_ID_TOUCH_CALIBRATION_YES_NO = 3,
PAGE_ID_NUMERIC_KEYPAD = 4,
PAGE_ID_KEYBOARD = 5,
PAGE_ID_ANIM_DEMO = 6,
PAGE_ID_INPUT_DEMO = 7,
PAGE_ID_ROLLER_INPUT_DEMO = 8,
PAGE_ID_LOADER = 9,
PAGE_ID_FRONT_PANEL = 10
PAGE_ID_NUMERIC_KEYPAD = 2,
PAGE_ID_KEYBOARD = 3,
PAGE_ID_ANIM_DEMO = 4,
PAGE_ID_INPUT_DEMO = 5,
PAGE_ID_ROLLER_INPUT_DEMO = 6,
PAGE_ID_LOADER = 7,
PAGE_ID_FRONT_PANEL = 8
};
extern const uint8_t assets[84687];
extern const uint8_t assets[83361];
#endif

Loading…
Cancel
Save