|
Archeus 0.0.0
A C library and game engine that focuses on documentation
|
#include "arc/console/view.h"#include "key.h"#include "arc/console/element.h"#include "arc/std/bool.h"#include "arc/std/errno.h"#include "arc/std/vector.h"#include "arc/std/string.h"#include <locale.h>#include <ncurses.h>#include <stdlib.h>Go to the source code of this file.
Data Structures | |
| struct | ARC_ConsoleView |
Variables | |
| uint8_t | arc_ncurses_win_size = 0 |
| void ARC_ConsoleView_AddElement | ( | ARC_ConsoleView * | view, |
| ARC_ConsoleElement * | element ) |
adds an ARC_ConsoleElement to the ARC_ConsoleView type
| view | |
| elment |
Definition at line 76 of file view.c.
References ARC_Vector_Add(), and ARC_ConsoleView::elements.
| void ARC_ConsoleView_Clear | ( | ARC_ConsoleView * | view | ) |
| view | |
| index |
Definition at line 84 of file view.c.
References ARC_ConsoleView::window.
| void ARC_ConsoleView_Create | ( | ARC_ConsoleView ** | view, |
| ARC_Rect | bounds ) |
creates ARC_ConsoleView type
| view | ARC_ConsoleView to create |
| bounds | the bounds of the window, if bounds.w == 0 or bounds.h == 0, bounds will take up the entire screen |
Definition at line 23 of file view.c.
References arc_errno, ARC_ERRNO_OVERFLOW, arc_ncurses_win_size, ARC_Vector_Create(), ARC_Rect::h, ARC_Rect::w, ARC_Rect::x, and ARC_Rect::y.
| void ARC_ConsoleView_Destroy | ( | ARC_ConsoleView * | view | ) |
destroys ARC_ConsoleView type
| view | ARC_ConsoleView to destroy |
Definition at line 63 of file view.c.
References arc_ncurses_win_size, ARC_Vector_Destroy(), ARC_ConsoleView::elements, and ARC_ConsoleView::window.
| ARC_Rect ARC_ConsoleView_GetBounds | ( | ARC_ConsoleView * | view | ) |
gets the bounds of an ARC_ConsoleView
| view | ARC_ConsoleView to get bounds from |
Definition at line 147 of file view.c.
References ARC_ConsoleView::bounds.
Referenced by ARC_ConsoleBuffer_Render(), and ARC_ConsoleBuffer_RenderSection().
| char ARC_ConsoleView_GetChar | ( | ARC_ConsoleView * | view | ) |
gets a char from the view
| view | the ARC_ConsoleView to get the char from |
Definition at line 155 of file view.c.
References ARC_ConsoleView::window.
| char ARC_ConsoleView_GetCharAt | ( | ARC_ConsoleView * | view, |
| ARC_Point | pos ) |
gets a char from the view at a position
| view | the ARC_ConsoleView to get the char from |
| pos | the positiion to get the char at |
Definition at line 159 of file view.c.
References ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.
| ARC_ConsoleKey ARC_ConsoleView_GetConsoleKeyAt | ( | ARC_ConsoleView * | view, |
| ARC_Point | pos ) |
gets a console key from the view at a position
| view | the ARC_ConsoleView to get the console key from |
| pos | the positiion to get the console key at |
Definition at line 163 of file view.c.
References ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.
Referenced by ARC_ConsoleView_GetStringInput().
| ARC_ConsoleKey * ARC_ConsoleView_GetCreateConsoleKeyAt | ( | ARC_ConsoleView * | view, |
| ARC_Point | pos ) |
gets and creates a console key from the view at a position
| view | the ARC_ConsoleView to get the console key from |
| pos | the positiion to get the console key at |
Definition at line 167 of file view.c.
References ARC_ConsoleKey_Create(), ARC_ConsoleKeyType::key, ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.
| ARC_ConsoleElement * ARC_ConsoleView_GetElement | ( | ARC_ConsoleView * | view, |
| uint32_t | index ) |
adds an ARC_ConsoleElement to the ARC_ConsoleView type
| view | |
| index |
Definition at line 151 of file view.c.
References ARC_Vector_Get(), and ARC_ConsoleView::elements.
| ARC_String * ARC_ConsoleView_GetStringInput | ( | ARC_ConsoleView * | view, |
| ARC_Point | pos, | ||
| ARC_ConsoleView_OverrideCharInputFn * | overrideCharInputFn, | ||
| void * | userdata ) |
gets a ARC_String from the view at a position
| view | the ARC_ConsoleView to get the string from |
| pos | the positiion to get the string at |
| overrideCharInputFn | a function to allow overriding what happens when inputing chars, can be NULL |
| userdata | data that a user can pass to use within the overrideCharInputFn |
Definition at line 174 of file view.c.
References ARC_ConsoleView_GetConsoleKeyAt(), ARC_ConsoleView_RenderCharAt(), ARC_String_Create(), ARC_ConsoleView::bounds, ARC_ConsoleView::echo, ARC_ConsoleKeyType::key, ARC_Rect::w, ARC_Point::x, and ARC_Point::y.
| void ARC_ConsoleView_RemoveElement | ( | ARC_ConsoleView * | view, |
| uint32_t | index ) |
| view | |
| index |
Definition at line 80 of file view.c.
References ARC_Vector_RemoveIndex(), and ARC_ConsoleView::elements.
| void ARC_ConsoleView_RenderCharAt | ( | ARC_ConsoleView * | view, |
| char | character, | ||
| ARC_Point | pos ) |
| view | |
| character | |
| pos |
Definition at line 89 of file view.c.
References ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.
Referenced by ARC_ConsoleView_GetStringInput().
| void ARC_ConsoleView_RenderCStringWithStrlenAt | ( | ARC_ConsoleView * | view, |
| char * | cstr, | ||
| ARC_Point | pos ) |
| view | |
| text | |
| pos |
Definition at line 114 of file view.c.
References ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.
| void ARC_ConsoleView_RenderElements | ( | ARC_ConsoleView * | view | ) |
| view |
Definition at line 139 of file view.c.
References ARC_Vector_Get(), ARC_ConsoleView::elements, ARC_ConsoleElement::renderFn, and ARC_ConsoleView::window.
| void ARC_ConsoleView_RenderKeyAt | ( | ARC_ConsoleView * | view, |
| ARC_ConsoleKey | key, | ||
| ARC_Point | pos ) |
| view | |
| key | |
| pos |
Definition at line 99 of file view.c.
References ARC_ConsoleKeyType::key, ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.
| void ARC_ConsoleView_RenderRect | ( | ARC_ConsoleView * | view, |
| ARC_Rect | bounds ) |
| view | |
| bounds |
Definition at line 119 of file view.c.
References ARC_ConsoleView_RenderWCharAt(), ARC_Rect::h, ARC_Rect::w, ARC_Rect::x, and ARC_Rect::y.
| void ARC_ConsoleView_RenderStringAt | ( | ARC_ConsoleView * | view, |
| ARC_String * | text, | ||
| ARC_Point | pos ) |
| view | |
| text | |
| pos |
Definition at line 109 of file view.c.
References ARC_String::data, ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.
Referenced by ARC_ConsoleBuffer_Render(), ARC_ConsoleBuffer_RenderSection(), and ARC_ConsoleElement_DefaultRenderFn().
| void ARC_ConsoleView_RenderUint32At | ( | ARC_ConsoleView * | view, |
| uint32_t | uint32, | ||
| ARC_Point | pos ) |
| view | |
| uint32 | |
| pos |
Definition at line 104 of file view.c.
References ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.
| void ARC_ConsoleView_RenderWCharAt | ( | ARC_ConsoleView * | view, |
| wchar_t | character, | ||
| ARC_Point | pos ) |
| view | |
| character | |
| pos |
Definition at line 94 of file view.c.
References ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.
Referenced by ARC_ConsoleView_RenderRect().
| void ARC_ConsoleView_SetAttribute | ( | ARC_ConsoleView * | view, |
| uint32_t | attribute ) |
sets a border on the ARC_ConsoleView
| view | ARC_ConsoleView to set border to |
| border | The border to set |
Definition at line 259 of file view.c.
References ARC_CONSOLE_VIEW_ATTRIBUTE_NONE, ARC_CONSOLE_VIEW_ATTRIBUTE_REVERSE, and ARC_ConsoleView::window.
Referenced by ARC_ConsoleElement_DefaultRenderFn().
| void ARC_ConsoleView_SetBorder | ( | ARC_ConsoleView * | view, |
| uint32_t | border ) |
sets a border on the ARC_ConsoleView
| view | ARC_ConsoleView to set border to |
| border | The border to set |
Definition at line 246 of file view.c.
References ARC_CONSOLE_VIEW_BORDER_DEFAULT, ARC_CONSOLE_VIEW_BORDER_NONE, and ARC_ConsoleView::window.
| void ARC_ConsoleView_SetCursorVisibility | ( | ARC_ConsoleView * | view, |
| uint8_t | visibility ) |
sets a visibility of the cursor with an ARC_ConsoleView
| view | ARC_ConsoleView to set mouse visibility |
| visibility | the visibility to set |
Definition at line 235 of file view.c.
References ARC_CONSOLE_VIEW_CURSOR_HIDDEN, and ARC_CONSOLE_VIEW_CURSOR_VISIBLE.
| uint8_t arc_ncurses_win_size = 0 |
Definition at line 13 of file view.c.
Referenced by ARC_ConsoleView_Create(), and ARC_ConsoleView_Destroy().