Loading...
Searching...
No Matches
element.h
Go to the documentation of this file.
#ifndef ARC_NCURSES_ELEMENT_H_
#define ARC_NCURSES_ELEMENT_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "view.h"
#include "arc/std/string.h"
#include "arc/std/bool.h"
#include "arc/math/point.h"
/**
* @brief
*/
typedef struct ARC_ConsoleElement ARC_ConsoleElement;
/**
* @brief
*/
typedef void (*ARC_ConsoleElement_RenderFn)(ARC_ConsoleView *view, ARC_ConsoleElement *element);
/**
* @brief
*/
typedef struct ARC_ConsoleElement {
uint32_t type;
uint8_t flags;
ARC_String *string;
ARC_Point pos;
ARC_ConsoleElement_RenderFn renderFn;
} ARC_ConsoleElement;
/**
* @brief
*/
#define ARC_CONSOLE_ELEMENT_FLAG_NONE 0b00000000
#define ARC_CONSOLE_ELEMENT_FLAG_SELECTABLE 0b00000001
#define ARC_CONSOLE_ELEMENT_FLAG_SELECTED 0b00000010
/**
* @brief
*/
void ARC_ConsoleElement_Create(ARC_ConsoleElement **element, uint32_t type, uint8_t flags, ARC_String *string, ARC_Point pos, ARC_ConsoleElement_RenderFn renderFn);
/**
* @brief
*/
void ARC_ConsoleElement_Destroy(ARC_ConsoleElement *element);
/**
* @brief
*/
void ARC_ConsoleElement_DefaultRenderFn(ARC_ConsoleView *view, ARC_ConsoleElement *element);
/**
* @brief
*
* @param
*/
ARC_Bool ARC_ConsoleElement_IsSelectable(ARC_ConsoleElement *element);
/**
* @brief
*
* @param
*/
void ARC_ConsoleElement_SetSelected(ARC_ConsoleElement *element, ARC_Bool selected);
/**
* @brief
*/
void ARC_ConsoleElement_ToggleSelected(ARC_ConsoleElement *element);
#endif //!ARC_CONSOLE_ELEMENT_H_
bool.h
ARC_Bool
#define ARC_Bool
Definition bool.h:10
view.h
ARC_ConsoleView
struct ARC_ConsoleView ARC_ConsoleView
Definition view.h:18
ARC_ConsoleElement_DefaultRenderFn
void ARC_ConsoleElement_DefaultRenderFn(ARC_ConsoleView *view, ARC_ConsoleElement *element)
ARC_ConsoleElement
struct ARC_ConsoleElement ARC_ConsoleElement
Definition element.h:17
ARC_ConsoleElement_SetSelected
void ARC_ConsoleElement_SetSelected(ARC_ConsoleElement *element, ARC_Bool selected)
ARC_ConsoleElement_IsSelectable
ARC_Bool ARC_ConsoleElement_IsSelectable(ARC_ConsoleElement *element)
ARC_ConsoleElement_Create
void ARC_ConsoleElement_Create(ARC_ConsoleElement **element, uint32_t type, uint8_t flags, ARC_String *string, ARC_Point pos, ARC_ConsoleElement_RenderFn renderFn)
ARC_ConsoleElement_RenderFn
void(* ARC_ConsoleElement_RenderFn)(ARC_ConsoleView *view, ARC_ConsoleElement *element)
Definition element.h:22
ARC_ConsoleElement_ToggleSelected
void ARC_ConsoleElement_ToggleSelected(ARC_ConsoleElement *element)
ARC_ConsoleElement_Destroy
void ARC_ConsoleElement_Destroy(ARC_ConsoleElement *element)
point.h
string.h
ARC_ConsoleElement
Definition element.h:27
ARC_ConsoleElement::type
uint32_t type
Definition element.h:28
ARC_ConsoleElement::renderFn
ARC_ConsoleElement_RenderFn renderFn
Definition element.h:34
ARC_ConsoleElement::string
ARC_String * string
Definition element.h:30
ARC_ConsoleElement::pos
ARC_Point pos
Definition element.h:32
ARC_ConsoleElement::flags
uint8_t flags
Definition element.h:29
ARC_Point
Definition point.h:10
ARC_String
substring position within a string
Definition string.h:14