Chesto 0.9
A declarative and element-based library for creating GUIs on homebrew'd consoles
|
Public Member Functions | |
EKeyboard (std::function< void(char)> typeAction) | |
void | render (Element *parent) |
display the current state of the display More... | |
bool | process (InputEvents *event) |
process any input that is received for this element More... | |
void | updateSize () |
void | just_type (const char input) |
bool | listenForPhysicalKeys (InputEvents *e) |
const std::string & | getTextInput () |
int | rowCount () |
int | rowLength (int row) |
void | type (int y, int x) |
void | generateEKeyboard () |
void | backspace () |
Public Member Functions inherited from Element | |
virtual bool | process (InputEvents *event) |
process any input that is received for this element More... | |
virtual void | render (Element *parent) |
display the current state of the display More... | |
bool | onTouchDown (InputEvents *event) |
bool | onTouchDrag (InputEvents *event) |
bool | onTouchUp (InputEvents *event) |
void | hide () |
void | unhide () |
void | renderBackground (bool fill=true) |
void | append (Element *element) |
void | remove (Element *element) |
void | removeAll (bool moveToTrash=false) |
void | position (int x, int y) |
position the element More... | |
void | recalcPosition (Element *parent) |
CST_Rect | getBounds () |
CST_Renderer * | getRenderer () |
void | wipeAll (bool delSelf=false) |
Element * | child (Element *child) |
Element * | setPosition (int x, int y) |
Element * | setAction (std::function< void()> func) |
Element * | centerHorizontallyIn (Element *parent) |
Element * | centerVerticallyIn (Element *parent) |
Element * | centerIn (Element *parent) |
Element * | setAbsolute (bool isAbs) |
Element * | constrain (int flags, int padding=0) |
Element * | animate (int durationIn, std::function< void(float)> onStep, std::function< void()> onFinish) |
Element * | moveToFront () |
Element * | setTouchable (bool touchable) |
void | screenshot (std::string path) |
Take a screenshot of this element and its children, and save it to the given path. More... | |
Public Attributes | |
std::string | textInput |
std::function< void(char)> | typeAction = NULL |
const char * | lower_keys = "`1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./" |
const char * | upper_keys = "~!@#$\%^&*()_+QWERTYUIOP{}|ASDFGHJKL:\"ZXCVBNM<>?" |
int | breaks [4] = { 13, 13, 11, 10 } |
std::vector< std::string * > | rows |
const CST_Keycode | usbKeys [KEYCODE_COUNT] |
bool | shiftOn = false |
bool | capsOn = false |
int | mode = 0 |
int | curRow = -1 |
int | index = -1 |
int | keyWidth = 0 |
int | padding = 0 |
int | textSize = 0 |
int | dPos = 0 |
int | dHeight = 0 |
int | sPos = 0 |
int | enterPos = 0 |
int | enterHeight = 0 |
int | dWidth = 0 |
int | sWidth = 0 |
int | enterWidth = 0 |
int | kXPad = 0 |
int | kXOff = 0 |
int | yYOff = 0 |
int | kYPad = 0 |
int | ySpacing = 0 |
bool | hasRoundedKeys = false |
CST_Font * | roundKeyFont = NULL |
bool | touchMode = false |
bool | immersiveMode = false |
bool | preventEnterAndTab = false |
bool | storeOwnText = false |
bool | isTouchDrag = false |
Public Attributes inherited from Element | |
std::function< void()> | action = NULL |
the action to call (from binded callback) on touch or button selection https://stackoverflow.com/questions/14189440/c-class-member-callback-simple-examples More... | |
std::function< void(InputEvents *event)> | actionWithEvents = NULL |
std::vector< Element * > | elements |
visible GUI child elements of this element More... | |
float | scale = 1.0f |
bool | touchable = false |
whether or not this element can be touched (highlights bounds) More... | |
bool | dragging = false |
whether or not this element is currently being dragged More... | |
bool | needsRedraw = false |
whether or not this element needs the screen redrawn next time it's processed More... | |
int | futureRedrawCounter = 0 |
whether this element needs a redraw for the next X redraws (decreases each time) (0 is no redraws) More... | |
int | lastMouseY = 0 |
the last Y, X coordinate of the mouse (from a drag probably) More... | |
int | lastMouseX = 0 |
bool | hasBackground = false |
rgb | backgroundColor = {0, 0, 0} |
bool | isAbsolute = false |
Element * | parent = NULL |
the parent element (can sometimes be null if it isn't set) More... | |
bool | hidden = false |
whether this element should skip rendering or not More... | |
bool | isProtected = false |
int | elasticCounter = 0 |
how much time is left in an elastic-type flick/scroll set by the last distance traveled in a scroll, and counts down every frame More... | |
int | width = 0 |
width and height of this element (must be manually set, isn't usually calculated (but is in some cases, like text or images)) More... | |
int | height = 0 |
int | x = 0 |
int | y = 0 |
int | xAbs = 0 |
int | yAbs = 0 |
double | angle = 0 |
rotation angle in degrees More... | |
int | xOff = 0 |
int | yOff = 0 |
std::vector< Constraint * > | constraints |
std::vector< Animation * > | animations |
bool | useColorMask = false |
whether or not to overlay a color mask on top of this element More... | |
CST_Color | maskColor = {0,0,0,0} |
The color to overlay on top. More... | |
Additional Inherited Members | |
Public Types inherited from Element | |
typedef Element | super |
Definition at line 7 of file EKeyboard.hpp.
EKeyboard::EKeyboard | ( | ) |
Definition at line 5 of file EKeyboard.cpp.
EKeyboard::EKeyboard | ( | std::function< void(char)> | typeAction | ) |
Definition at line 10 of file EKeyboard.cpp.
EKeyboard::~EKeyboard | ( | ) |
Definition at line 633 of file EKeyboard.cpp.
void EKeyboard::backspace | ( | ) |
Definition at line 609 of file EKeyboard.cpp.
void EKeyboard::generateEKeyboard | ( | ) |
Definition at line 563 of file EKeyboard.cpp.
const std::string & EKeyboard::getTextInput | ( | ) |
Definition at line 628 of file EKeyboard.cpp.
void EKeyboard::just_type | ( | const char | input | ) |
Definition at line 547 of file EKeyboard.cpp.
bool EKeyboard::listenForPhysicalKeys | ( | InputEvents * | e | ) |
Definition at line 354 of file EKeyboard.cpp.
|
virtual |
process any input that is received for this element
Reimplemented from Element.
Definition at line 153 of file EKeyboard.cpp.
References InputEvents::held(), Element::hidden, InputEvents::touchIn(), and Element::width.
|
virtual |
display the current state of the display
Reimplemented from Element.
Definition at line 26 of file EKeyboard.cpp.
References Element::hidden, Element::render(), and Element::width.
|
inline |
Definition at line 48 of file EKeyboard.hpp.
|
inline |
Definition at line 52 of file EKeyboard.hpp.
void EKeyboard::type | ( | int | y, |
int | x | ||
) |
Definition at line 540 of file EKeyboard.cpp.
void EKeyboard::updateSize | ( | ) |
Definition at line 443 of file EKeyboard.cpp.
int EKeyboard::breaks[4] = { 13, 13, 11, 10 } |
Definition at line 34 of file EKeyboard.hpp.
bool EKeyboard::capsOn = false |
Definition at line 57 of file EKeyboard.hpp.
int EKeyboard::curRow = -1 |
Definition at line 61 of file EKeyboard.hpp.
int EKeyboard::dHeight = 0 |
Definition at line 74 of file EKeyboard.hpp.
int EKeyboard::dPos = 0 |
Definition at line 73 of file EKeyboard.hpp.
int EKeyboard::dWidth = 0 |
Definition at line 78 of file EKeyboard.hpp.
int EKeyboard::enterHeight = 0 |
Definition at line 77 of file EKeyboard.hpp.
int EKeyboard::enterPos = 0 |
Definition at line 76 of file EKeyboard.hpp.
int EKeyboard::enterWidth = 0 |
Definition at line 80 of file EKeyboard.hpp.
bool EKeyboard::hasRoundedKeys = false |
Definition at line 90 of file EKeyboard.hpp.
bool EKeyboard::immersiveMode = false |
Definition at line 94 of file EKeyboard.hpp.
int EKeyboard::index = -1 |
Definition at line 62 of file EKeyboard.hpp.
bool EKeyboard::isTouchDrag = false |
Definition at line 100 of file EKeyboard.hpp.
int EKeyboard::keyWidth = 0 |
Definition at line 68 of file EKeyboard.hpp.
int EKeyboard::kXOff = 0 |
Definition at line 84 of file EKeyboard.hpp.
int EKeyboard::kXPad = 0 |
Definition at line 83 of file EKeyboard.hpp.
int EKeyboard::kYPad = 0 |
Definition at line 86 of file EKeyboard.hpp.
const char* EKeyboard::lower_keys = "`1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./" |
Definition at line 32 of file EKeyboard.hpp.
int EKeyboard::mode = 0 |
Definition at line 58 of file EKeyboard.hpp.
int EKeyboard::padding = 0 |
Definition at line 69 of file EKeyboard.hpp.
bool EKeyboard::preventEnterAndTab = false |
Definition at line 97 of file EKeyboard.hpp.
CST_Font* EKeyboard::roundKeyFont = NULL |
Definition at line 91 of file EKeyboard.hpp.
std::vector<std::string*> EKeyboard::rows |
Definition at line 39 of file EKeyboard.hpp.
bool EKeyboard::shiftOn = false |
Definition at line 56 of file EKeyboard.hpp.
int EKeyboard::sPos = 0 |
Definition at line 75 of file EKeyboard.hpp.
bool EKeyboard::storeOwnText = false |
Definition at line 98 of file EKeyboard.hpp.
int EKeyboard::sWidth = 0 |
Definition at line 79 of file EKeyboard.hpp.
std::string EKeyboard::textInput |
Definition at line 24 of file EKeyboard.hpp.
int EKeyboard::textSize = 0 |
Definition at line 70 of file EKeyboard.hpp.
bool EKeyboard::touchMode = false |
Definition at line 93 of file EKeyboard.hpp.
std::function<void(char)> EKeyboard::typeAction = NULL |
Definition at line 28 of file EKeyboard.hpp.
const char* EKeyboard::upper_keys = "~!@#$\%^&*()_+QWERTYUIOP{}|ASDFGHJKL:\"ZXCVBNM<>?" |
Definition at line 33 of file EKeyboard.hpp.
const CST_Keycode EKeyboard::usbKeys[KEYCODE_COUNT] |
Definition at line 41 of file EKeyboard.hpp.
int EKeyboard::ySpacing = 0 |
Definition at line 87 of file EKeyboard.hpp.
int EKeyboard::yYOff = 0 |
Definition at line 85 of file EKeyboard.hpp.