Loading...
Searching...
No Matches
view.c File Reference
`#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

## Functions

void | ARC_ConsoleView_Create (ARC_ConsoleView **view, ARC_Rect bounds)
| creates ARC_ConsoleView type
void | ARC_ConsoleView_Destroy (ARC_ConsoleView *ncurses)
| destroys ARC_ConsoleView type
void | ARC_ConsoleView_AddElement (ARC_ConsoleView *view, ARC_ConsoleElement *element)
| adds an ARC_ConsoleElement to the ARC_ConsoleView type
void | ARC_ConsoleView_RemoveElement (ARC_ConsoleView *view, uint32_t index)
void | ARC_ConsoleView_Clear (ARC_ConsoleView *view)
void | ARC_ConsoleView_RenderCharAt (ARC_ConsoleView *view, char character, ARC_Point pos)
void | ARC_ConsoleView_RenderWCharAt (ARC_ConsoleView *view, wchar_t character, ARC_Point pos)
void | ARC_ConsoleView_RenderKeyAt (ARC_ConsoleView *view, ARC_ConsoleKey key, ARC_Point pos)
void | ARC_ConsoleView_RenderUint32At (ARC_ConsoleView *view, uint32_t uint32, ARC_Point pos)
void | ARC_ConsoleView_RenderStringAt (ARC_ConsoleView *view, ARC_String *text, ARC_Point pos)
void | ARC_ConsoleView_RenderCStringWithStrlenAt (ARC_ConsoleView *view, char *cstr, ARC_Point pos)
void | ARC_ConsoleView_RenderRect (ARC_ConsoleView *view, ARC_Rect bounds)
void | ARC_ConsoleView_RenderElements (ARC_ConsoleView *view)
ARC_Rect | ARC_ConsoleView_GetBounds (ARC_ConsoleView *view)
| gets the bounds of an ARC_ConsoleView
ARC_ConsoleElement * | ARC_ConsoleView_GetElement (ARC_ConsoleView *view, uint32_t index)
| adds an ARC_ConsoleElement to the ARC_ConsoleView type
char | ARC_ConsoleView_GetChar (ARC_ConsoleView *view)
| gets a char from the view
char | ARC_ConsoleView_GetCharAt (ARC_ConsoleView *view, ARC_Point pos)
| gets a char from the view at a position
ARC_ConsoleKey | ARC_ConsoleView_GetConsoleKeyAt (ARC_ConsoleView *view, ARC_Point pos)
| gets a console key from the view at a position
ARC_ConsoleKey * | ARC_ConsoleView_GetCreateConsoleKeyAt (ARC_ConsoleView *view, ARC_Point pos)
| gets and creates a console key from the view at a position
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
void | ARC_ConsoleView_SetCursorVisibility (ARC_ConsoleView *view, uint8_t visibility)
| sets a visibility of the cursor with an ARC_ConsoleView
void | ARC_ConsoleView_SetBorder (ARC_ConsoleView *view, uint32_t border)
| sets a border on the ARC_ConsoleView
void | ARC_ConsoleView_SetAttribute (ARC_ConsoleView *view, uint32_t attribute)
| sets a border on the ARC_ConsoleView

## Variables

uint8_t | arc_ncurses_win_size = 0

## Function Documentation

## ARC_ConsoleView_AddElement()

void ARC_ConsoleView_AddElement | ( | ARC_ConsoleView * | view,
|  | ARC_ConsoleElement * | element )

adds an ARC_ConsoleElement to the ARC_ConsoleView type

Note
  the elements position will be based on the ARC_ConsoleView which might mess up how it looks

Parameters

  view |
  elment |

Definition at line 76 of file view.c.

{
ARC_Vector_Add(view->elements, (void *)element);
}
ARC_ConsoleView::elements
ARC_Vector * elements
Definition view.c:20
ARC_Vector_Add
void ARC_Vector_Add(ARC_Vector *vector, void *data)
adds an item to an ARC_Vector
Definition vector.c:70

References ARC_Vector_Add(), and ARC_ConsoleView::elements.

## ARC_ConsoleView_Clear()

void ARC_ConsoleView_Clear | ( | ARC_ConsoleView * | view | ) |

Parameters

  view |
  index |

Definition at line 84 of file view.c.

{
wclear(view->window);
wrefresh(view->window);
}
ARC_ConsoleView::window
WINDOW * window
Definition view.c:16

References ARC_ConsoleView::window.

## ARC_ConsoleView_Create()

void ARC_ConsoleView_Create | ( | ARC_ConsoleView ** | view,
|  | ARC_Rect | bounds )

creates ARC_ConsoleView type

Parameters

  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.

{
if(arc_ncurses_win_size == ~(uint8_t)0){
arc_errno = ARC_ERRNO_OVERFLOW;
ARC_DEBUG_ERR("ARC_NCurses_Create(ncurses), max num of ARC_NCurses have been created, consider making arc_ncurses_win_size a uint32_t to increase the max");
*view = NULL;
return;
}
//if this is the first ncurses, init ncurses
if(arc_ncurses_win_size == 0){
setlocale(LC_ALL, "");
initscr();
//start_color();
cbreak();
keypad(stdscr, TRUE);
refresh();
}
*view = (ARC_ConsoleView *)malloc(sizeof(ARC_ConsoleView));
ARC_Rect viewBounds = { 0, 0, COLS, LINES };
if(bounds.w != 0 && bounds.h != 0){
viewBounds = bounds;
}
(*view)->window = newwin(viewBounds.h, viewBounds.w, viewBounds.y, viewBounds.x);
(*view)->bounds = viewBounds;
keypad((*view)->window, TRUE);
noecho();
(*view)->echo = false;
ARC_Vector_Create(&(*view)->elements);
wrefresh((*view)->window);
arc_ncurses_win_size++;
}
arc_ncurses_win_size
uint8_t arc_ncurses_win_size
Definition view.c:13
arc_errno
int32_t arc_errno
Definition errno.c:5
ARC_ERRNO_OVERFLOW
#define ARC_ERRNO_OVERFLOW
Definition errno.h:10
ARC_ConsoleView
Definition view.c:15
ARC_Rect
Definition rectangle.h:12
ARC_Rect::x
int32_t x
Definition rectangle.h:13
ARC_Rect::w
int32_t w
Definition rectangle.h:15
ARC_Rect::y
int32_t y
Definition rectangle.h:14
ARC_Rect::h
int32_t h
Definition rectangle.h:16
ARC_Vector_Create
void ARC_Vector_Create(ARC_Vector **vector, ARC_Vector_CompareDataFn *compareDataFn, ARC_Vector_DestroyDataFn *destroyDataFn)
creates an ARC_Vector which is an "expandable" array
Definition vector.c:31

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.

## ARC_ConsoleView_Destroy()

void ARC_ConsoleView_Destroy | ( | ARC_ConsoleView * | view | ) |

destroys ARC_ConsoleView type

Parameters

  view | ARC_ConsoleView to destroy

Definition at line 63 of file view.c.

{
arc_ncurses_win_size--;
ARC_Vector_Destroy(ncurses->elements);
delwin(ncurses->window);
free(ncurses);
if(arc_ncurses_win_size == 0){
endwin();
}
}
ARC_Vector_Destroy
void ARC_Vector_Destroy(ARC_Vector *vector)
destroys an ARC_Vector
Definition vector.c:54

References arc_ncurses_win_size, ARC_Vector_Destroy(), ARC_ConsoleView::elements, and ARC_ConsoleView::window.

## ARC_ConsoleView_GetBounds()

ARC_Rect ARC_ConsoleView_GetBounds | ( | ARC_ConsoleView * | view | ) |

gets the bounds of an ARC_ConsoleView

Parameters

  view | ARC_ConsoleView to get bounds from

Returns
  the bounds of the ARC_ConsoleView

Definition at line 147 of file view.c.

{
return view->bounds;
}
ARC_ConsoleView::bounds
ARC_Rect bounds
Definition view.c:17

References ARC_ConsoleView::bounds.

Referenced by ARC_ConsoleBuffer_Render(), and ARC_ConsoleBuffer_RenderSection().

## ARC_ConsoleView_GetChar()

char ARC_ConsoleView_GetChar | ( | ARC_ConsoleView * | view | ) |

gets a char from the view

Note
  use ARC_ConsoleView_GetInt32At if you want to check for direction key or special character input

Parameters

  view | the ARC_ConsoleView to get the char from

Definition at line 155 of file view.c.

{
return wgetch(view->window);
}

References ARC_ConsoleView::window.

## ARC_ConsoleView_GetCharAt()

char ARC_ConsoleView_GetCharAt | ( | ARC_ConsoleView * | view,
|  | ARC_Point | pos )

gets a char from the view at a position

Note
  use ARC_ConsoleView_GetInt32At if you want to check for direction key or special character input

Parameters

  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.

{
return mvwgetch(view->window, pos.y, pos.x);
}
ARC_Point::y
int32_t y
Definition point.h:12
ARC_Point::x
int32_t x
Definition point.h:11

References ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.

## ARC_ConsoleView_GetConsoleKeyAt()

ARC_ConsoleKey ARC_ConsoleView_GetConsoleKeyAt | ( | ARC_ConsoleView * | view,
|  | ARC_Point | pos )

gets a console key from the view at a position

Note
  you most likely do not want to use this function outside of a backend as ARC_ConsoleKey is defined within the console backend

Parameters

  view | the ARC_ConsoleView to get the console key from
  pos | the positiion to get the console key at

Returns
  a console key

Definition at line 163 of file view.c.

{
return (ARC_ConsoleKey){ mvwgetch(view->window, pos.y, pos.x) };
}
ARC_ConsoleKeyType
Definition key.h:11

References ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.

Referenced by ARC_ConsoleView_GetStringInput().

## ARC_ConsoleView_GetCreateConsoleKeyAt()

ARC_ConsoleKey * ARC_ConsoleView_GetCreateConsoleKeyAt | ( | ARC_ConsoleView * | view,
|  | ARC_Point | pos )

gets and creates a console key from the view at a position

Note
  the given ARC_ConsoleKey needs to be destroyed
  use ARC_ConsoleView_GetConsoleKeyAt if you want to check for keyboard or special character input

Parameters

  view | the ARC_ConsoleView to get the console key from
  pos | the positiion to get the console key at

Returns
  a console key

Definition at line 167 of file view.c.

{
ARC_ConsoleKey *key;
ARC_ConsoleKey_Create(&key, NULL);
key->key = mvwgetch(view->window, pos.y, pos.x);
return key;
}
ARC_ConsoleKey_Create
void ARC_ConsoleKey_Create(ARC_ConsoleKey **consoleKey, ARC_ConsoleKey_Key *key)
Definition key.c:7
ARC_ConsoleKeyType::key
int32_t key
Definition key.h:12

References ARC_ConsoleKey_Create(), ARC_ConsoleKeyType::key, ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.

## ARC_ConsoleView_GetElement()

ARC_ConsoleElement * ARC_ConsoleView_GetElement | ( | ARC_ConsoleView * | view,
|  | uint32_t | index )

adds an ARC_ConsoleElement to the ARC_ConsoleView type

Note
  the elements position will be based on the ARC_ConsoleView which might mess up how it looks

Parameters

  view |
  index |

Definition at line 151 of file view.c.

{
return (ARC_ConsoleElement *)ARC_Vector_Get(view->elements, index);
}
ARC_ConsoleElement
Definition element.h:27
ARC_Vector_Get
void * ARC_Vector_Get(ARC_Vector *vector, uint32_t index)
gets an item from an ARC_Vector at a position index
Definition vector.c:153

References ARC_Vector_Get(), and ARC_ConsoleView::elements.

## ARC_ConsoleView_GetStringInput()

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

Parameters

  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.

{
noecho();
uint32_t cstringSize = view->bounds.w - pos.x;
char cstring[view->bounds.w - pos.x];
ARC_ConsoleKey temp = ARC_ConsoleView_GetConsoleKeyAt(view, pos);
uint32_t index = 0;
while(temp.key != '\n'){
//store the last size to be able to clear efficeintly
uint32_t lastSize = index;
//if override function exists and it overrode the current char
if(overrideCharInputFn != NULL && (*overrideCharInputFn)(&temp, cstring, &index, cstringSize, userdata)){
for(uint32_t i = 0; i < lastSize; i++){
ARC_ConsoleView_RenderCharAt(view, ' ', (ARC_Point){ pos.x + i, pos.y });
}
for(uint32_t i = 0; i < index; i++){
ARC_ConsoleView_RenderCharAt(view, cstring[i], (ARC_Point){ pos.x + i, pos.y });
}
temp = ARC_ConsoleView_GetConsoleKeyAt(view, (ARC_Point){ pos.x + index, pos.y });
continue;
}
if(temp.key == KEY_BACKSPACE || temp.key == KEY_DC || temp.key == 127){
if(index == 0){
temp = ARC_ConsoleView_GetConsoleKeyAt(view, (ARC_Point){ pos.x + index, pos.y });
continue;
}
index--;
ARC_ConsoleView_RenderCharAt(view, ' ', (ARC_Point){ pos.x + index, pos.y });
cstring[index] = '\0';
temp = ARC_ConsoleView_GetConsoleKeyAt(view, (ARC_Point){ pos.x + index, pos.y });
continue;
}
if(index < (view->bounds.w - 1) - pos.x){
ARC_ConsoleView_RenderCharAt(view, (char)(temp.key), (ARC_Point){ pos.x + index, pos.y });
cstring[index] = (char)(temp.key);
index++;
}
temp = ARC_ConsoleView_GetConsoleKeyAt(view, (ARC_Point){ pos.x + index, pos.y });
}
if(view->echo){
echo();
}
if(index == 0){
return NULL;
}
ARC_String *string;
ARC_String_Create(&string, cstring, index);
return string;
}
ARC_ConsoleView_RenderCharAt
void ARC_ConsoleView_RenderCharAt(ARC_ConsoleView *view, char character, ARC_Point pos)
Definition view.c:89
ARC_ConsoleView_GetConsoleKeyAt
ARC_ConsoleKey ARC_ConsoleView_GetConsoleKeyAt(ARC_ConsoleView *view, ARC_Point pos)
gets a console key from the view at a position
Definition view.c:163
ARC_String_Create
void ARC_String_Create(ARC_String **string, char *data, uint64_t length)
creates ARC_String type
Definition string.c:9
ARC_ConsoleView::echo
ARC_Bool echo
Definition view.c:18
ARC_Point
Definition point.h:10
ARC_String
substring position within a string
Definition string.h:14

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.

## ARC_ConsoleView_RemoveElement()

void ARC_ConsoleView_RemoveElement | ( | ARC_ConsoleView * | view,
|  | uint32_t | index )

Parameters

  view |
  index |

Definition at line 80 of file view.c.

{
ARC_Vector_RemoveIndex(view->elements, index);
}
ARC_Vector_RemoveIndex
void ARC_Vector_RemoveIndex(ARC_Vector *vector, uint32_t index)
removes an item from an ARC_Vector at an index
Definition vector.c:110

References ARC_Vector_RemoveIndex(), and ARC_ConsoleView::elements.

## ARC_ConsoleView_RenderCharAt()

void ARC_ConsoleView_RenderCharAt | ( | ARC_ConsoleView * | view,
|  | char | character,
|  | ARC_Point | pos )

Parameters

  view |
  character |
  pos |

Definition at line 89 of file view.c.

{
mvwprintw(view->window, pos.y, pos.x, "%c", character);
wrefresh(view->window);
}

References ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.

Referenced by ARC_ConsoleView_GetStringInput().

## ARC_ConsoleView_RenderCStringWithStrlenAt()

void ARC_ConsoleView_RenderCStringWithStrlenAt | ( | ARC_ConsoleView * | view,
|  | char * | cstr,
|  | ARC_Point | pos )

Parameters

  view |
  text |
  pos |

Definition at line 114 of file view.c.

{
mvwprintw(view->window, pos.y, pos.x, "%s", cstr);
wrefresh(view->window);
}

References ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.

## ARC_ConsoleView_RenderElements()

void ARC_ConsoleView_RenderElements | ( | ARC_ConsoleView * | view | ) |

Parameters

  view |

Definition at line 139 of file view.c.

{
for(uint32_t i = 0; i < ARC_Vector_Size(view->elements); i++){
ARC_ConsoleElement *element = (ARC_ConsoleElement *)ARC_Vector_Get(view->elements, i);
element->renderFn(view, element);
wrefresh(view->window);
}
}
ARC_ConsoleElement::renderFn
ARC_ConsoleElement_RenderFn renderFn
Definition element.h:34

References ARC_Vector_Get(), ARC_ConsoleView::elements, ARC_ConsoleElement::renderFn, and ARC_ConsoleView::window.

## ARC_ConsoleView_RenderKeyAt()

void ARC_ConsoleView_RenderKeyAt | ( | ARC_ConsoleView * | view,
|  | ARC_ConsoleKey | key,
|  | ARC_Point | pos )

Parameters

  view |
  key |
  pos |

Definition at line 99 of file view.c.

{
mvwprintw(view->window, pos.y, pos.x, "%c", (char)key.key);
wrefresh(view->window);
}

References ARC_ConsoleKeyType::key, ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.

## ARC_ConsoleView_RenderRect()

void ARC_ConsoleView_RenderRect | ( | ARC_ConsoleView * | view,
|  | ARC_Rect | bounds )

Parameters

  view |
  bounds |

Definition at line 119 of file view.c.

{
//render corners
ARC_ConsoleView_RenderWCharAt(view, L'┌', (ARC_Point){ bounds.x, bounds.y });
ARC_ConsoleView_RenderWCharAt(view, L'└', (ARC_Point){ bounds.x, (bounds.h - 1) + bounds.y });
ARC_ConsoleView_RenderWCharAt(view, L'┐', (ARC_Point){ (bounds.w - 1) + bounds.x, bounds.y });
ARC_ConsoleView_RenderWCharAt(view, L'┘', (ARC_Point){ (bounds.w - 1) + bounds.x, (bounds.h - 1) + bounds.y });
//render virticle lines
for(int32_t x = 1; x < bounds.w - 1; x++){
ARC_ConsoleView_RenderWCharAt(view, L'─', (ARC_Point){ bounds.x + x, bounds.y });
ARC_ConsoleView_RenderWCharAt(view, L'─', (ARC_Point){ bounds.x + x, (bounds.h - 1) + bounds.y });
}
//render horizontal lines
for(int32_t y = 1; y < bounds.h - 1; y++){
ARC_ConsoleView_RenderWCharAt(view, L'│', (ARC_Point){ bounds.x, bounds.y + y });
ARC_ConsoleView_RenderWCharAt(view, L'│', (ARC_Point){ (bounds.w - 1) + bounds.x, bounds.y + y });
}
}
ARC_ConsoleView_RenderWCharAt
void ARC_ConsoleView_RenderWCharAt(ARC_ConsoleView *view, wchar_t character, ARC_Point pos)
Definition view.c:94

References ARC_ConsoleView_RenderWCharAt(), ARC_Rect::h, ARC_Rect::w, ARC_Rect::x, and ARC_Rect::y.

## ARC_ConsoleView_RenderStringAt()

void ARC_ConsoleView_RenderStringAt | ( | ARC_ConsoleView * | view,
|  | ARC_String * | text,
|  | ARC_Point | pos )

Parameters

  view |
  text |
  pos |

Definition at line 109 of file view.c.

{
mvwprintw(view->window, pos.y, pos.x, "%s", text->data);
wrefresh(view->window);
}
ARC_String::data
char * data
Definition string.h:15

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().

## ARC_ConsoleView_RenderUint32At()

void ARC_ConsoleView_RenderUint32At | ( | ARC_ConsoleView * | view,
|  | uint32_t | uint32,
|  | ARC_Point | pos )

Parameters

  view |
  uint32 |
  pos |

Definition at line 104 of file view.c.

{
mvwprintw(view->window, pos.y, pos.x, "%d", uint32);
wrefresh(view->window);
}

References ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.

## ARC_ConsoleView_RenderWCharAt()

void ARC_ConsoleView_RenderWCharAt | ( | ARC_ConsoleView * | view,
|  | wchar_t | character,
|  | ARC_Point | pos )

Parameters

  view |
  character |
  pos |

Definition at line 94 of file view.c.

{
mvwprintw(view->window, pos.y, pos.x, "%lc", character);
wrefresh(view->window);
}

References ARC_ConsoleView::window, ARC_Point::x, and ARC_Point::y.

Referenced by ARC_ConsoleView_RenderRect().

## ARC_ConsoleView_SetAttribute()

void ARC_ConsoleView_SetAttribute | ( | ARC_ConsoleView * | view,
|  | uint32_t | attribute )

sets a border on the ARC_ConsoleView

Parameters

  view | ARC_ConsoleView to set border to
  border | The border to set

Definition at line 259 of file view.c.

{
switch(attribute){
case ARC_CONSOLE_VIEW_ATTRIBUTE_NONE:
wattroff(view->window, A_REVERSE);
break;
case ARC_CONSOLE_VIEW_ATTRIBUTE_REVERSE:
wattron(view->window, A_REVERSE);
break;
}
}
ARC_CONSOLE_VIEW_ATTRIBUTE_REVERSE
#define ARC_CONSOLE_VIEW_ATTRIBUTE_REVERSE
Definition view.h:253
ARC_CONSOLE_VIEW_ATTRIBUTE_NONE
#define ARC_CONSOLE_VIEW_ATTRIBUTE_NONE
border options
Definition view.h:252

References ARC_CONSOLE_VIEW_ATTRIBUTE_NONE, ARC_CONSOLE_VIEW_ATTRIBUTE_REVERSE, and ARC_ConsoleView::window.

Referenced by ARC_ConsoleElement_DefaultRenderFn().

## ARC_ConsoleView_SetBorder()

void ARC_ConsoleView_SetBorder | ( | ARC_ConsoleView * | view,
|  | uint32_t | border )

sets a border on the ARC_ConsoleView

Parameters

  view | ARC_ConsoleView to set border to
  border | The border to set

Definition at line 246 of file view.c.

{
switch(border){
case ARC_CONSOLE_VIEW_BORDER_NONE:
wborder(view->window, ' ', ' ', ' ',' ',' ',' ',' ',' ');
break;
case ARC_CONSOLE_VIEW_BORDER_DEFAULT:
box(view->window, 0, 0);
break;
}
wrefresh(view->window);
}
ARC_CONSOLE_VIEW_BORDER_NONE
#define ARC_CONSOLE_VIEW_BORDER_NONE
border options
Definition view.h:238
ARC_CONSOLE_VIEW_BORDER_DEFAULT
#define ARC_CONSOLE_VIEW_BORDER_DEFAULT
Definition view.h:239

References ARC_CONSOLE_VIEW_BORDER_DEFAULT, ARC_CONSOLE_VIEW_BORDER_NONE, and ARC_ConsoleView::window.

## ARC_ConsoleView_SetCursorVisibility()

void ARC_ConsoleView_SetCursorVisibility | ( | ARC_ConsoleView * | view,
|  | uint8_t | visibility )

sets a visibility of the cursor with an ARC_ConsoleView

Parameters

  view | ARC_ConsoleView to set mouse visibility
  visibility | the visibility to set

Definition at line 235 of file view.c.

{
switch(visibility){
case ARC_CONSOLE_VIEW_CURSOR_HIDDEN:
curs_set(0);
break;
case ARC_CONSOLE_VIEW_CURSOR_VISIBLE:
curs_set(1);
break;
}
}
ARC_CONSOLE_VIEW_CURSOR_HIDDEN
#define ARC_CONSOLE_VIEW_CURSOR_HIDDEN
mouse options
Definition view.h:224
ARC_CONSOLE_VIEW_CURSOR_VISIBLE
#define ARC_CONSOLE_VIEW_CURSOR_VISIBLE
Definition view.h:225

References ARC_CONSOLE_VIEW_CURSOR_HIDDEN, and ARC_CONSOLE_VIEW_CURSOR_VISIBLE.

## Variable Documentation

## arc_ncurses_win_size

uint8_t arc_ncurses_win_size = 0

Definition at line 13 of file view.c.

Referenced by ARC_ConsoleView_Create(), and ARC_ConsoleView_Destroy().