diff --git a/src/LiquidMenu.h b/src/LiquidMenu.h index 1abc675..16b8917 100644 --- a/src/LiquidMenu.h +++ b/src/LiquidMenu.h @@ -39,7 +39,7 @@ Include file for LiquidMenu library. #include #if defined(__AVR__) -# include +#include #endif #include #include @@ -47,9 +47,8 @@ Include file for LiquidMenu library. #include "LiquidMenu_config.h" #include "LiquidMenu_debug.h" - #if LIQUIDMENU_LIBRARY == LiquidCrystal_LIBRARY -# pragma message ("LiquidMenu: Selected 'LiquidCrystal' (parallel) library. Edit 'LiquidMenu_config.h' file to change it.") +#pragma message("LiquidMenu: Selected 'LiquidCrystal' (parallel) library. Edit 'LiquidMenu_config.h' file to change it.") #include #elif LIQUIDMENU_LIBRARY == LiquidCrystal_I2C_LIBRARY // # pragma message ("LiquidMenu: Selected 'LiquidCrystal_I2C' (I2C) library. Edit 'LiquidMenu_config.h' file to change it.") @@ -59,13 +58,11 @@ Include file for LiquidMenu library. #endif #if LIQUIDMENU_DEBUG -# warning "LiquidMenu: Debugging messages are enabled." +#warning "LiquidMenu: Debugging messages are enabled." #endif const char LIQUIDMENU_VERSION[] = "1.6"; ///< The version of the library. - - /// @name Getter function typedefs /** @@ -92,40 +89,45 @@ typedef double (*doubleFnPtr)(); /// `char` typedef char (*charFnPtr)(); /// `char*` -typedef char * (*charPtrFnPtr)(); +typedef char *(*charPtrFnPtr)(); /// `const char*` -typedef const char * (*constcharPtrFnPtr)(); +typedef const char *(*constcharPtrFnPtr)(); ///@} - /// Data type enum. /** Used to store the data type of `void*` so that they can be cast back later. */ -enum class DataType : uint8_t { +enum class DataType : uint8_t +{ NOT_USED = 0, - BOOL = 1, BOOLEAN = 1, + BOOL = 1, + BOOLEAN = 1, INT8_T = 8, UINT8_T = 9, INT16_T = 16, UINT16_T = 17, INT32_T = 32, UINT32_T = 33, - FLOAT = 50, DOUBLE = 50, + FLOAT = 50, + DOUBLE = 50, CHAR = 60, CHAR_PTR = 61, CONST_CHAR_PTR = 62, PROG_CONST_CHAR_PTR = 65, GLYPH = 70, FIRST_GETTER = 200, - BOOL_GETTER = 201, BOOLEAN_GETTER = 201, + BOOL_GETTER = 201, + BOOLEAN_GETTER = 201, INT8_T_GETTER = 208, - UINT8_T_GETTER = 209, BYTE_GETTER = 209, + UINT8_T_GETTER = 209, + BYTE_GETTER = 209, INT16_T_GETTER = 216, UINT16_T_GETTER = 217, INT32_T_GETTER = 232, UINT32_T_GETTER = 233, - FLOAT_GETTER = 240, DOUBLE_GETTER = 240, + FLOAT_GETTER = 240, + DOUBLE_GETTER = 240, CHAR_GETTER = 250, CHAR_PTR_GETTER = 251, CONST_CHAR_PTR_GETTER = 252 @@ -135,8 +137,10 @@ enum class DataType : uint8_t { /* Used to store and set the relative or absolute position of the focus indicator. */ -enum class Position : uint8_t { - RIGHT = 1, NORMAL = 1, +enum class Position : uint8_t +{ + RIGHT = 1, + NORMAL = 1, LEFT = 2, CUSTOM = 3, }; @@ -164,13 +168,13 @@ DataType recognizeType(char variable); @param variable - variable to be checked @returns the data type in `DataType` enum format */ -DataType recognizeType(char* variable); +DataType recognizeType(char *variable); /** @param variable - variable to be checked @returns the data type in `DataType` enum format */ -DataType recognizeType(const char* variable); +DataType recognizeType(const char *variable); /** @param variable - variable to be checked @@ -220,56 +224,48 @@ DataType recognizeType(float variable); */ DataType recognizeType(double variable); - /** @param variable - variable to be checked @returns the data type in `DataType` enum format */ DataType recognizeType(boolFnPtr variable); - /** @param variable - variable to be checked @returns the data type in `DataType` enum format */ DataType recognizeType(int8tFnPtr variable); - /** @param variable - variable to be checked @returns the data type in `DataType` enum format */ DataType recognizeType(uint8tFnPtr variable); - /** @param variable - variable to be checked @returns the data type in `DataType` enum format */ DataType recognizeType(int16tFnPtr variable); - /** @param variable - variable to be checked @returns the data type in `DataType` enum format */ DataType recognizeType(uint16tFnPtr variable); - /** @param variable - variable to be checked @returns the data type in `DataType` enum format */ DataType recognizeType(int32tFnPtr variable); - /** @param variable - variable to be checked @returns the data type in `DataType` enum format */ DataType recognizeType(uint32tFnPtr variable); - /** @param variable - variable to be checked @returns the data type in `DataType` enum format @@ -282,21 +278,18 @@ DataType recognizeType(floatFnPtr variable); */ DataType recognizeType(doubleFnPtr variable); - /** @param variable - variable to be checked @returns the data type in `DataType` enum format */ DataType recognizeType(charFnPtr variable); - /** @param variable - variable to be checked @returns the data type in `DataType` enum format */ DataType recognizeType(charPtrFnPtr variable); - /** @param variable - variable to be checked @returns the data type in `DataType` enum format @@ -304,8 +297,6 @@ DataType recognizeType(charPtrFnPtr variable); DataType recognizeType(constcharPtrFnPtr variable); ///@} - - /// Debug prints an address /** Used for convenience when printing the class's address for identification. @@ -314,6 +305,9 @@ Used for convenience when printing the class's address for identification. */ void print_me(uintptr_t address); +class LiquidLine; +class LiquidScreen; +class LiquidMenu; /// Represents the individual lines printed on the display. /** @@ -323,7 +317,8 @@ where the focus indicator is positioned and pointers to the callback functions. This classes' objects go into a LiquidScreen object which controls them. The public methods are for configuration only. */ -class LiquidLine { +class LiquidLine +{ friend class LiquidScreen; public: @@ -338,16 +333,19 @@ class LiquidLine { @param row - the row at which the line is printed */ LiquidLine(uint8_t column, uint8_t row) - : _row(row), _column(column), _focusRow(row - 1), - _focusColumn(column - 1), _focusPosition(Position::NORMAL), - _floatDecimalPlaces(2), _variableCount(0), _focusable(false) { + : _row(row), _column(column), _focusRow(row - 1), + _focusColumn(column - 1), _focusPosition(Position::NORMAL), + _floatDecimalPlaces(2), _variableCount(0), _focusable(false) + { - for (uint8_t i = 0; i < MAX_VARIABLES; i++) { + for (uint8_t i = 0; i < MAX_VARIABLES; i++) + { _variable[i] = nullptr; _variableType[i] = DataType::NOT_USED; } - for (uint8_t f = 0; f < MAX_FUNCTIONS; f++) { + for (uint8_t f = 0; f < MAX_FUNCTIONS; f++) + { _function[f] = 0; } } @@ -360,7 +358,8 @@ class LiquidLine { */ template LiquidLine(uint8_t column, uint8_t row, A &variableA) - : LiquidLine(column, row) { + : LiquidLine(column, row) + { add_variable(variableA); } @@ -374,7 +373,8 @@ class LiquidLine { template LiquidLine(uint8_t column, uint8_t row, A &variableA, B &variableB) - : LiquidLine(column, row, variableA) { + : LiquidLine(column, row, variableA) + { add_variable(variableB); } @@ -389,7 +389,8 @@ class LiquidLine { template LiquidLine(uint8_t column, uint8_t row, A &variableA, B &variableB, C &variableC) - : LiquidLine(column, row, variableA, variableB) { + : LiquidLine(column, row, variableA, variableB) + { add_variable(variableC); } @@ -405,13 +406,13 @@ class LiquidLine { template LiquidLine(uint8_t column, uint8_t row, A &variableA, B &variableB, C &variableC, D &variableD) - : LiquidLine(column, row, variableA, variableB, variableC) { + : LiquidLine(column, row, variableA, variableB, variableC) + { add_variable(variableD); } ///@} - /// @name Public methods ///@{ @@ -428,31 +429,40 @@ class LiquidLine { @see MAX_VARIABLES */ template - bool add_variable(T &variable) { - DEBUG(F("LLine ")); print_me(reinterpret_cast(this)); + bool add_variable(T &variable) + { + DEBUG(F("LLine ")); + print_me(reinterpret_cast(this)); DataType varType = recognizeType(variable); - #if LIQUIDMENU_DEBUG +#if LIQUIDMENU_DEBUG DEBUG(F("Add ")); - if ((uint8_t)varType < (uint8_t)DataType::FIRST_GETTER) { + if ((uint8_t)varType < (uint8_t)DataType::FIRST_GETTER) + { DEBUG(F("variable \"")); DEBUG(variable); - } else { + } + else + { DEBUG(F("getter \"N/A")); } DEBUG(F("\" of DataType(")); - DEBUG((uint8_t)varType); DEBUG(F(")")); - #endif + DEBUG((uint8_t)varType); + DEBUG(F(")")); +#endif - if (_variableCount < MAX_VARIABLES) { - _variable[_variableCount] = (void*)&variable; + if (_variableCount < MAX_VARIABLES) + { + _variable[_variableCount] = (void *)&variable; _variableType[_variableCount] = varType; _variableCount++; - + DEBUGLN(F("")); return true; - } else { + } + else + { DEBUGLN(F(" failed, edit LiquidMenu_config.h to allow for more variables")); return false; } @@ -531,7 +541,7 @@ class LiquidLine { ///@} // public for debugging convenience - const void *_variable[MAX_VARIABLES]; ///< Pointers to the variables + const void *_variable[MAX_VARIABLES]; ///< Pointers to the variables DataType _variableType[MAX_VARIABLES]; ///< Data type of the variables private: @@ -581,12 +591,11 @@ class LiquidLine { uint8_t _row, _column, _focusRow, _focusColumn; Position _focusPosition; uint8_t _floatDecimalPlaces; - uint8_t _variableCount; ///< Count of the variables + uint8_t _variableCount; ///< Count of the variables void (*_function[MAX_FUNCTIONS])(void); ///< Pointers to the functions - bool _focusable; ///< Determines whether the line is focusable + bool _focusable; ///< Determines whether the line is focusable }; - /// Represents a screen shown on the display. /** A screen is made up of LiquidLine objects. It holds pointers to them and @@ -596,11 +605,11 @@ them. The public methods are for configuration only. @see LiquidLine */ -class LiquidScreen { +class LiquidScreen +{ friend class LiquidMenu; public: - /// @name Constructors ///@{ @@ -715,8 +724,26 @@ class LiquidScreen { LiquidLine *_p_liquidLine[MAX_LINES]; ///< The LiquidLine objects uint8_t get_lineCount() const; - + + /*An array of functions to allow us to not run long if else statements*/ + void set_special_case(bool val); + bool is_special_case(); + void set_prev_menu(LiquidMenu *prev); + LiquidMenu *get_prev_menu(); + void set_prev_screen(LiquidScreen *prev); + LiquidScreen *get_prev_screen(); + void set_next_menu(LiquidMenu *next); + LiquidMenu *get_next_menu(); + void set_next_screen(LiquidScreen *next); + LiquidScreen *get_next_screen(); + private: + LiquidMenu *nextMenu; + LiquidScreen *nextScreen = NULL; + LiquidMenu *prevMenu; + LiquidScreen *prevScreen = NULL; + bool specialCase = false; + /// Prints the lines pointed by the screen. /** Calls the `LiquidLine::print(DisplayClass *p_liquidCrystal, bool isFocused)` @@ -730,7 +757,7 @@ class LiquidScreen { /** Switches the focus to the next or previous line according to the passed parameter. - + @note After one iteration through the focusable lines is completed, the focus indicator will hide for one step. To disable this behavior set `LM_FOCUS_INDICATOR_GHOSTING` to false in `LiquiMenu_config.h` @@ -769,13 +796,12 @@ class LiquidScreen { */ bool call_function(uint8_t number) const; - uint8_t _lineCount; ///< Count of the LiquidLine objects - uint8_t _focus; ///< Index of the focused line + uint8_t _lineCount; ///< Count of the LiquidLine objects + uint8_t _focus; ///< Index of the focused line uint8_t _displayLineCount; ///< The number of lines the display supports - bool _hidden; ///< If hidden skips this screen when cycling + bool _hidden; ///< If hidden skips this screen when cycling }; - /// Represents a collection of screens forming a menu. /** A menu is made up of LiquidScreen objects. It holds pointers to them and @@ -786,11 +812,11 @@ the same public methods. @see LiquidScreen */ -class LiquidMenu { +class LiquidMenu +{ friend class LiquidSystem; public: - /// @name Constructors ///@{ @@ -877,7 +903,7 @@ class LiquidMenu { @returns a pointer to the current screen. */ - LiquidScreen* get_currentScreen() const; + LiquidScreen *get_currentScreen() const; uint8_t get_currentScreenNumber() const; @@ -949,7 +975,7 @@ class LiquidMenu { @param forward - true for forward, false for backward */ void switch_focus(bool forward = true); - + /// Directly select focused line. /** @param lineIndex - index of the focused line @@ -1047,7 +1073,7 @@ class LiquidMenu { ///@} - DisplayClass *_p_liquidCrystal; ///< Pointer to the DisplayClass object FIXME + DisplayClass *_p_liquidCrystal; ///< Pointer to the DisplayClass object FIXME LiquidScreen *_p_liquidScreen[MAX_SCREENS]; ///< The LiquidScreen objects uint8_t get_screenCount() const; @@ -1067,9 +1093,9 @@ for multiple menus. @see LiquidMenu */ -class LiquidSystem { +class LiquidSystem +{ public: - /// @name Constructors ///@{ @@ -1140,12 +1166,12 @@ class LiquidSystem { /** * @brief return a reference to the current menu - * + * * @return pointer to menu */ - LiquidMenu * get_currentMenu() const; + LiquidMenu *get_currentMenu() const; - uint8_t get_currentMenuNumber() const; + uint8_t get_currentMenuNumber() const; /// Returns a reference to the current screen. /** @@ -1153,7 +1179,7 @@ class LiquidSystem { @returns a pointer to the current screen. */ - LiquidScreen* get_currentScreen() const; + LiquidScreen *get_currentScreen() const; uint8_t get_currentScreenNumber() const; @@ -1238,7 +1264,7 @@ class LiquidSystem { @returns the index of the currently focused line */ uint8_t get_focusedLine() const; - + /// Sets the focus position for the whole menu at once. /** The valid positions are `LEFT` and `RIGHT`. `CUSTOM` is not valid @@ -1315,7 +1341,6 @@ class LiquidSystem { ///@} - private: LiquidMenu *_p_liquidMenu[MAX_MENUS]; ///< The LiquidMenu objects uint8_t _menuCount; ///< Count of the LiquidMenu objects diff --git a/src/LiquidScreen.cpp b/src/LiquidScreen.cpp index e5f8fdc..9900aa8 100644 --- a/src/LiquidScreen.cpp +++ b/src/LiquidScreen.cpp @@ -29,7 +29,6 @@ SOFTWARE. #include "LiquidMenu.h" - /// Line count subtrahend for comparison during focus iteration /** 0 - "ghosting" is enabled @@ -38,47 +37,55 @@ SOFTWARE. #define LM_LINE_COUNT_SUBTRAHEND (0) #if LM_FOCUS_INDICATOR_GHOSTING == true - #undef LM_LINE_COUNT_SUBTRAHEND - #define LM_LINE_COUNT_SUBTRAHEND (0) +#undef LM_LINE_COUNT_SUBTRAHEND +#define LM_LINE_COUNT_SUBTRAHEND (0) #elif LM_FOCUS_INDICATOR_GHOSTING == false - #undef LM_LINE_COUNT_SUBTRAHEND - #define LM_LINE_COUNT_SUBTRAHEND (1) +#undef LM_LINE_COUNT_SUBTRAHEND +#define LM_LINE_COUNT_SUBTRAHEND (1) #endif - - LiquidScreen::LiquidScreen() : _lineCount(0), _focus(0), _hidden(false) {} LiquidScreen::LiquidScreen(LiquidLine &liquidLine) - : LiquidScreen() { + : LiquidScreen() +{ add_line(liquidLine); } LiquidScreen::LiquidScreen(LiquidLine &liquidLine1, LiquidLine &liquidLine2) - : LiquidScreen(liquidLine1) { + : LiquidScreen(liquidLine1) +{ add_line(liquidLine2); } LiquidScreen::LiquidScreen(LiquidLine &liquidLine1, LiquidLine &liquidLine2, - LiquidLine &liquidLine3) - : LiquidScreen(liquidLine1, liquidLine2) { + LiquidLine &liquidLine3) + : LiquidScreen(liquidLine1, liquidLine2) +{ add_line(liquidLine3); } LiquidScreen::LiquidScreen(LiquidLine &liquidLine1, LiquidLine &liquidLine2, - LiquidLine &liquidLine3, LiquidLine &liquidLine4) - : LiquidScreen(liquidLine1, liquidLine2, liquidLine3) { + LiquidLine &liquidLine3, LiquidLine &liquidLine4) + : LiquidScreen(liquidLine1, liquidLine2, liquidLine3) +{ add_line(liquidLine4); } -bool LiquidScreen::add_line(LiquidLine &liquidLine) { - DEBUG(F("LScreen ")); print_me(reinterpret_cast(this)); +bool LiquidScreen::add_line(LiquidLine &liquidLine) +{ + DEBUG(F("LScreen ")); + print_me(reinterpret_cast(this)); - DEBUG(F("Add line (0x")); DEBUG((uintptr_t)&liquidLine); - DEBUG(F(") count(")) DEBUG(_lineCount); DEBUG(F(")")); + DEBUG(F("Add line (0x")); + DEBUG((uintptr_t)&liquidLine); + DEBUG(F(") count(")) + DEBUG(_lineCount); + DEBUG(F(")")); - if (_lineCount < MAX_LINES) { + if (_lineCount < MAX_LINES) + { _p_liquidLine[_lineCount] = &liquidLine; _lineCount++; @@ -88,69 +95,91 @@ bool LiquidScreen::add_line(LiquidLine &liquidLine) { // Naively set the number of lines the display has to the // number of added LiquidLine objects. When adding more - // LiquidLine objects that the display's number of lines, - // void LiquidScreen::set_displayLineCount(uint8_t lines) - // must be used to set the number of lines the display has. - _displayLineCount = _lineCount; + // LiquidLine objects that the display's number of lines, + // void LiquidScreen::set_displayLineCount(uint8_t lines) + // must be used to set the number of lines the display has. + _displayLineCount = _lineCount; DEBUGLN(F("")); return true; - } else { + } + else + { DEBUGLN(F(" failed, edit LiquidMenu_config.h to allow for more lines")); return false; } - } -bool LiquidScreen::set_focusPosition(Position position) { - DEBUG(F("LScreen ")); print_me(reinterpret_cast(this)); +bool LiquidScreen::set_focusPosition(Position position) +{ + DEBUG(F("LScreen ")); + print_me(reinterpret_cast(this)); - if (position == Position::CUSTOM) { + if (position == Position::CUSTOM) + { DEBUGLN(F("Can't set focus position to 'CUSTOM' for the whole screen at once")); return false; - } else { - DEBUG(F("Focus position set to : ")); DEBUGLN((uint8_t)position); - for (uint8_t l = 0; l < _lineCount; l++) { + } + else + { + DEBUG(F("Focus position set to : ")); + DEBUGLN((uint8_t)position); + for (uint8_t l = 0; l < _lineCount; l++) + { _p_liquidLine[l]->set_focusPosition(position); } return true; } } -void LiquidScreen::set_displayLineCount(uint8_t lines) { +void LiquidScreen::set_displayLineCount(uint8_t lines) +{ _displayLineCount = lines; } -void LiquidScreen::hide(bool hide) { +void LiquidScreen::hide(bool hide) +{ _hidden = hide; } -void LiquidScreen::print(DisplayClass *p_liquidCrystal) const { +void LiquidScreen::print(DisplayClass *p_liquidCrystal) const +{ uint8_t lOffset = 0; uint8_t displayLineCount = _displayLineCount; - if (displayLineCount == 0) { + if (displayLineCount == 0) + { displayLineCount = _lineCount; - } else if (displayLineCount > _lineCount) { + } + else if (displayLineCount > _lineCount) + { displayLineCount = _lineCount; } - if (_focus >= displayLineCount) { + if (_focus >= displayLineCount) + { lOffset = (_focus - displayLineCount) + 1; - if ((displayLineCount + lOffset) > _lineCount) { + if ((displayLineCount + lOffset) > _lineCount) + { lOffset = (_lineCount - displayLineCount); } } uint8_t offsetRow = 0; - for (uint8_t l = lOffset; l < displayLineCount + lOffset; l++) { + for (uint8_t l = lOffset; l < displayLineCount + lOffset; l++) + { bool focus = true; - if (_focus != l) { + if (_focus != l) + { focus = false; DEBUG(F("|")); - } else { + } + else + { DEBUG(F("| -->")); } - DEBUG(F("\tLine ")); DEBUG(l); - if (displayLineCount < _lineCount) { + DEBUG(F("\tLine ")); + DEBUG(l); + if (displayLineCount < _lineCount) + { _p_liquidLine[l]->_row = offsetRow; } _p_liquidLine[l]->print(p_liquidCrystal, focus); @@ -158,63 +187,146 @@ void LiquidScreen::print(DisplayClass *p_liquidCrystal) const { } } -void LiquidScreen::switch_focus(bool forward) { - DEBUG(F("LScreen ")); print_me(reinterpret_cast(this)); +void LiquidScreen::switch_focus(bool forward) +{ + DEBUG(F("LScreen ")); + print_me(reinterpret_cast(this)); // LM_LINE_COUNT_SUBTRAHEND: // 0 - "ghosting" is enabled // 1 - "ghosting" is disabled - - do { - if (forward) { - if (_focus < (_lineCount - LM_LINE_COUNT_SUBTRAHEND)) { + + do + { + if (forward) + { + if (_focus < (_lineCount - LM_LINE_COUNT_SUBTRAHEND)) + { _focus++; - if (_focus == (_lineCount - LM_LINE_COUNT_SUBTRAHEND)) { + if (_focus == (_lineCount - LM_LINE_COUNT_SUBTRAHEND)) + { break; } - } else { + } + else + { _focus = 0; } - } else { //else (forward) - if (_focus == 0) { + } + else + { // else (forward) + if (_focus == 0) + { _focus = (_lineCount - LM_LINE_COUNT_SUBTRAHEND); break; - } else { + } + else + { _focus--; } - } //else (forward) + } // else (forward) } while (_p_liquidLine[_focus]->_focusable == false); - DEBUG(F("Focus switched to ")); DEBUGLN(_focus); + DEBUG(F("Focus switched to ")); + DEBUGLN(_focus); } -bool LiquidScreen::set_focusedLine(uint8_t lineIndex) { - if (lineIndex < _lineCount && _p_liquidLine[lineIndex]->_focusable == true) { +bool LiquidScreen::set_focusedLine(uint8_t lineIndex) +{ + if (lineIndex < _lineCount && _p_liquidLine[lineIndex]->_focusable == true) + { _focus = lineIndex; return true; - } else { + } + else + { return false; } } -uint8_t LiquidScreen::get_focusedLine() const { +uint8_t LiquidScreen::get_focusedLine() const +{ return _focus; } -uint8_t LiquidScreen::get_lineCount() const { +uint8_t LiquidScreen::get_lineCount() const +{ return _lineCount; } -bool LiquidScreen::is_callable(uint8_t number) const { - if (_focus != _lineCount) { +bool LiquidScreen::is_callable(uint8_t number) const +{ + if (_focus != _lineCount) + { return _p_liquidLine[_focus]->is_callable(number); } return false; } -bool LiquidScreen::call_function(uint8_t number) const { - if (_focus != _lineCount) { +bool LiquidScreen::call_function(uint8_t number) const +{ + if (_focus != _lineCount) + { return _p_liquidLine[_focus]->call_function(number); } return false; } + +void LiquidScreen::set_special_case(bool val) +{ + specialCase = val; +} + +/** + * Default to false + */ +bool LiquidScreen::is_special_case() +{ + return specialCase; +} + +void LiquidScreen::set_prev_menu(LiquidMenu *prev) +{ + prevMenu = prev; +} + +LiquidMenu *LiquidScreen::get_prev_menu() +{ + return prevMenu; +} + +void LiquidScreen::set_prev_screen(LiquidScreen *next) +{ + prevScreen = next; +} + +/** + * Default to NULL. If it's NULL, we use change_menu with true; + */ +LiquidScreen *LiquidScreen::get_prev_screen() +{ + return prevScreen; +} + +void LiquidScreen::set_next_menu(LiquidMenu *next) +{ + nextMenu = next; +} + +LiquidMenu *LiquidScreen::get_next_menu() +{ + return nextMenu; +} + +void LiquidScreen::set_next_screen(LiquidScreen *next) +{ + nextScreen = next; +} + +/** + * Default to NULL. If it's NULL, we use change_menu with true; + */ +LiquidScreen *LiquidScreen::get_next_screen() +{ + return nextScreen; +} \ No newline at end of file