diff options
author | Tectu <joel@unormal.org> | 2012-08-13 04:11:03 +0200 |
---|---|---|
committer | Tectu <joel@unormal.org> | 2012-08-13 04:11:03 +0200 |
commit | 54229cbdaaf585b5adf9b085229a22c9824c112c (patch) | |
tree | 846e654318f88d309bf6f7f0aadbf640d8cdd04b /gui/gui.h | |
parent | e7f0c8e2c2791fd2e571c762f03e277161f98a4b (diff) | |
download | uGFX-54229cbdaaf585b5adf9b085229a22c9824c112c.tar.gz uGFX-54229cbdaaf585b5adf9b085229a22c9824c112c.tar.bz2 uGFX-54229cbdaaf585b5adf9b085229a22c9824c112c.zip |
restructure
Diffstat (limited to 'gui/gui.h')
-rw-r--r-- | gui/gui.h | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/gui/gui.h b/gui/gui.h deleted file mode 100644 index 04d9a8b1..00000000 --- a/gui/gui.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu <joel@unormal.org> - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef GUI_H -#define GUI_H - -#include "ch.h" -#include "hal.h" -#include "glcd.h" -#include "chprintf.h" -#include "touchpad.h" -#include <string.h> - -struct guiNode_t { - uint8_t type; - uint16_t x0; - uint16_t y0; - uint16_t x1; - uint16_t y1; - uint16_t r1; - uint16_t r2; - uint16_t shadow; - uint16_t bkColor; - uint16_t valueColor; - uint16_t value; - uint16_t oldValue; - uint16_t percentage; - uint8_t orientation; - uint8_t mode; - uint8_t *active; - uint8_t *state; - char *label; - struct guiNode_t *next; -}; - -#ifdef __cplusplus -extern "C" { -#endif - -enum {button, slider, wheel, keymatrix}; -enum {horizontal, vertical}; -enum {inactive, active}; -enum {modePassive, modeActive}; - -/* - * Description: creates the GUI thread - * - * param: - interval: thread sleep in milliseconds after each GUI element update - * - priority: priority of the thread - * - * return: pointer to created thread - */ -Thread *guiInit(uint16_t interval, tprio_t priority); - -/* - * Description: prints all GUI elements structs (linked list) - * - * param: - chp: pointer to output stream - * - * return: none - */ -void guiPrintElements(BaseSequentialStream *chp); - -/* - * Description: deletes a GUI element from the linked list - * - * param: - label: label of the element (parameter of each guiDrawXXX function) - * - * return: 1 if successful, 0 otherwise - */ -uint8_t guiDeleteElement(char *label); - -/* - * Description: draws a button on the screen and keeps it's state up to date - * - * param: - x0, y0, x1, y1: start and end coordinates of the button's rectangle - * - str: string that gets drawn into the rectangle - button's lable - * - fontColor: color of the lable - * - buttonColor: color of the rectangle - * - shadow: draws a black shadow with N pixels size if != 0 - * - active: pass pointer to variable which holds the state 'active' or 'inactive' - * - state: pass pointer to variable whcih will keep the state of the button (pressed / unpressed)' - * - * return: 1 if button successfully created - */ -uint8_t guiDrawButton(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, char *str, font_t font, uint16_t fontColor, uint16_t buttonColor, uint16_t shadow, char *label, uint8_t *active, uint8_t *state); - -uint8_t guiDrawSlider(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint8_t orientation, uint8_t mode, uint16_t frameColor, uint16_t bkColor, uint16_t valueColor, char *label, uint8_t *active, uint8_t *value); - -uint8_t guiDrawWheel(uint16_t x0, uint16_t y0, uint16_t radius1, uint16_t radius2, uint16_t bkColor, uint16_t valueColor, char *label, uint8_t *active, uint8_t *value); - -uint8_t guiDrawKeymatrix(uint16_t x0, uint16_t y0, uint16_t buttonSize, uint16_t space, uint16_t shadow, uint16_t buttonColor, uint16_t fontColor, font_t font, char *label, uint8_t *active, uint8_t *value); - -#ifdef __cplusplus -} -#endif - -#endif |