Choco OS
V.0.16.9.0
Join to the chocolate world
|
The file with interface for TGUI. More...
#include <oc_stdtypes.h>
#include <stdbool.h>
#include <oc_stdlib.h>
#include <oc_vt100.h>
#include <oc_list.h>
#include <oc_null.h>
#include <oc_string.h>
Go to the source code of this file.
Data Structures | |
struct | oC_TGUI_Style_t |
stores style of elements More... | |
struct | oC_TGUI_ProgressBarStyle_t |
style for progress bar More... | |
struct | oC_TGUI_TextBoxStyle_t |
style for text box More... | |
struct | oC_TGUI_BoxStyle_t |
style for box More... | |
struct | oC_TGUI_Position_t |
stores cursor position More... | |
struct | oC_TGUI_MenuEntry_t |
Entry in menu. More... | |
struct | oC_TGUI_MenuStyle_t |
Style of the menu. More... | |
struct | oC_TGUI_Property_t |
struct | oC_TGUI_PropertyStyle_t |
struct | oC_TGUI_DrawPropertyConfig_t |
struct | oC_TGUI_DrawListMenuConfig_t |
struct | oC_TGUI_EditBoxStyle_t |
struct | oC_TGUI_QuickEditBoxStyle_t |
struct | oC_TGUI_EditBox_t |
struct | oC_TGUI_QuickEditBox_t |
struct | oC_TGUI_PushButtonStyle_t |
struct | oC_TGUI_PushButton_t |
struct | oC_TGUI_SelectionBoxStyle_t |
struct | oC_TGUI_SelectionBox_t |
struct | oC_TGUI_ActiveObject_t |
struct | oC_TGUI_Spiner_t |
struct | oC_TGUI_ColorData_t |
Typedefs | |
typedef int32_t | oC_TGUI_EntryIndex_t |
stores index for menu More... | |
typedef uint16_t | oC_TGUI_Line_t |
stores line or height of terminal cursor position More... | |
typedef uint16_t | oC_TGUI_Column_t |
stores column or width of terminal cursor position More... | |
typedef void(* | oC_TGUI_MenuHandler_t) (void *Parameter) |
Menu entry activated function. More... | |
typedef void(* | oC_TGUI_DrawListHandler_t) (oC_TGUI_Position_t Position, oC_List_ElementHandle_t ElementHandle, oC_TGUI_Column_t Width) |
Function for drawing list menu element. More... | |
typedef void(* | oC_TGUI_SelectListHandler_t) (oC_List_ElementHandle_t ListElement) |
List element selected function. More... | |
typedef void(* | oC_TGUI_EditBoxSaveValueHandler_t) (char *Buffer, uint32_t Size, void *Parameter) |
Function for saving value of edit box. More... | |
typedef void(* | oC_TGUI_QuickEditBoxSaveValueHandler_t) (char *Buffer, uint32_t Size, void *Parameter) |
Function for saving value of quick edit box. More... | |
typedef bool(* | oC_TGUI_PushButtonHandler_t) (void *Parameter) |
Function called when push button is pressed. More... | |
typedef void(* | oC_TGUI_SelectionHandler_t) (const char *SelectedValue, uint32_t SelectedIndex, void *Parameter) |
Function called when value is changed. More... | |
Enumerations |
Functions | |
bool | oC_TGUI_ResetDevice (void) |
function for reseting a terminal More... | |
bool | oC_TGUI_ClearPartOfScreen (oC_TGUI_Position_t StartPosition, oC_TGUI_Column_t Width, oC_TGUI_Line_t Height, oC_TGUI_Color_t Color) |
clears selected part of the screen More... | |
bool | oC_TGUI_DrawBox (const char *Title, const char *InsideText, oC_TGUI_Position_t TopLeft, oC_TGUI_Column_t Width, oC_TGUI_Line_t Height, const oC_TGUI_BoxStyle_t *Style) |
draws a box More... | |
oC_TGUI_EntryIndex_t | oC_TGUI_DrawMenu (oC_TGUI_Position_t TopLeft, oC_TGUI_Column_t Width, oC_TGUI_Line_t Height, const oC_TGUI_MenuEntry_t *MenuEntries, oC_TGUI_EntryIndex_t NumberOfEntries, const oC_TGUI_MenuStyle_t *Style) |
draws a menu More... | |
bool | oC_TGUI_DrawActiveObjects (oC_TGUI_ActiveObject_t *ActiveObjects, uint32_t NumberOfObjects) |
draws array of active objects and handles it More... | |
This program 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Definition in file oc_tgui.h.
bool oC_TGUI_ClearPartOfScreen | ( | oC_TGUI_Position_t | StartPosition, |
oC_TGUI_Column_t | Width, | ||
oC_TGUI_Line_t | Height, | ||
oC_TGUI_Color_t | Color | ||
) |
The function is for quickly clear part of the screen by using the given background color.
StartPosition | Position of the top left corner to clear |
Width | Width of part of screen to clear |
Height | Height of part of screen to clear |
Color | Background color to use for clearing |
bool oC_TGUI_DrawActiveObjects | ( | oC_TGUI_ActiveObject_t * | ActiveObjects, |
uint32_t | NumberOfObjects | ||
) |
The function is for drawing and handling array of active objects. The function ends, when the pressed key is ESCAPE or when function arguments are not correct.
ActiveObjects | Pointer to array with active objects |
NumberOfObjects | Number of elements in the ActiveObjects array |
bool oC_TGUI_DrawBox | ( | const char * | Title, |
const char * | TextInside, | ||
oC_TGUI_Position_t | TopLeft, | ||
oC_TGUI_Column_t | Width, | ||
oC_TGUI_Line_t | Height, | ||
const oC_TGUI_BoxStyle_t * | Style | ||
) |
The function is for drawing a box - it is a rectangle with title, text inside and shadow. The example you can see below:
Title | Pointer to the string with title |
TextInside | Pointer to the string with text that should be placed in the box, or NULL if it is not required |
TopLeft | Position of the top left box corner |
Width | Width of the box (including 1 column for the shadow) |
Height | Height of the box (including 1 line for the shadow) |
Style | Pointer to the style of the box. |
oC_TGUI_EntryIndex_t oC_TGUI_DrawMenu | ( | oC_TGUI_Position_t | TopLeft, |
oC_TGUI_Column_t | Width, | ||
oC_TGUI_Line_t | Height, | ||
const oC_TGUI_MenuEntry_t * | MenuEntries, | ||
oC_TGUI_EntryIndex_t | NumberOfEntries, | ||
const oC_TGUI_MenuStyle_t * | Style | ||
) |
The function is for drawing menu. It returns index of the lately selected entry or -1 if there was an error. The function ends, when the selected item has not assigned a correct Handler. If the selected item has a valid Handler pointer, the function calls it and waits for the press of the key. You can use it for example as the Exit menu entry.
TopLeft | Position of the top left menu corner |
Width | Width including shadow |
Height | Height including shadow |
MenuEntries | Array with menu entries |
NumberOfEntries | Number of menu entries in the array |
Style | Pointer to the menu style |