mikroSDK Reference Manual
VTFT Library

Data Structures

struct  vtft_event_set
 
struct  vtft_pen
 
struct  vtft_gradient
 
struct  vtft_press_gradient
 
struct  vtft_font
 
struct  vtft_text
 
struct  vtft_c_text
 
struct  vtft_component
 
struct  vtft_positioned_component
 
struct  vtft_active_component
 
struct  vtft_colored_component
 
struct  vtft_box
 
struct  vtft_rounded_box
 
struct  vtft_circle
 
struct  vtft_ellipse
 
struct  vtft_line
 
struct  vtft_label
 
struct  vtft_button
 
struct  vtft_rounded_button
 
struct  vtft_circle_button
 
struct  vtft_image
 
struct  vtft_abstract_check_box
 
struct  vtft_check_box
 
struct  vtft_radio_button
 
struct  vtft_progress_bar
 
struct  vtft_screen
 
struct  vtft_s
 

Typedefs

typedef uint8_t vtft_bool_t
 
typedef uint8_t vtft_byte_t
 
typedef int16_t vtft_index_t
 
typedef gl_int_t vtft_coord_t
 
typedef gl_uint_t vtft_ucoord_t
 
typedef vtft_component_type vtft_comp_type_t
 
typedef void(* vtft_event) ()
 
typedef void(* vtft_draw_handle) (struct vtft_s *instance, vtft_component *__generic_ptr component)
 
typedef struct vtft_s vtft_t
 

Enumerations

enum  vtft_component_type {
  VTFT_COMPONENT_NONE , VTFT_COMPONENT_BOX , VTFT_COMPONENT_ROUNDED_BOX , VTFT_COMPONENT_CIRCLE ,
  VTFT_COMPONENT_ELLIPSE , VTFT_COMPONENT_LINE , VTFT_COMPONENT_LABEL , VTFT_COMPONENT_BUTTON ,
  VTFT_COMPONENT_ROUNDED_BUTTON , VTFT_COMPONENT_CIRCLE_BUTTON , VTFT_COMPONENT_IMAGE , VTFT_COMPONENT_CHECK_BOX ,
  VTFT_COMPONENT_RADIO_BUTTON , VTFT_COMPONENT_PROGRESS_BAR , VTFT_COMPONENT_COUNT
}
 
enum  vtft_gradient_style {
  VTFT_GRADIENT_NONE , VTFT_GRADIENT_TOP_BOTTOM , VTFT_GRADIENT_BOTTOM_TOP , VTFT_GRADIENT_LEFT_RIGHT ,
  VTFT_GRADIENT_RIGHT_LEFT
}
 
enum  vtft_text_alignment {
  VTFT_TEXT_ALIGNMENT_LEFT , VTFT_TEXT_ALIGNMENT_CENTER , VTFT_TEXT_ALIGNMENT_RIGHT , VTFT_TEXT_ALIGNMENT_TOP ,
  VTFT_TEXT_ALIGNMENT_MIDDLE , VTFT_TEXT_ALIGNMENT_BOTTOM
}
 

Functions list

void vtft_init (vtft_t *vtft_instance, tp_t *tp_instance)
 Initializes the VTFT library with the given gl and tp instances.
 
void vtft_set_progress_bar_position (vtft_t *instance, vtft_progress_bar *progress_bar, vtft_ucoord_t position)
 Sets the position of the given progress bar.
 
void vtft_draw_component (vtft_t *instance, const vtft_component *__generic_ptr component)
 Draws the given component, using the appropriate drawing function.
 
void vtft_refresh_current_screen (vtft_t *instance)
 Redraws the current screen and all of its components.
 
void vtft_set_current_screen (vtft_t *instance, vtft_screen *screen)
 Sets the current screen and draws it.
 
void vtft_process (vtft_t *instance)
 Processes the periodic events.
 
void _draw_none (vtft_t *instance, const vtft_component *__generic_ptr component)
 An empty drawing handle for components with an invalid type.
 
void _draw_box (vtft_t *instance, const vtft_component *__generic_ptr component)
 Draws the given box component.
 
void _draw_rounded_box (vtft_t *instance, const vtft_component *__generic_ptr component)
 Draws the given rounded box component.
 
void _draw_circle (vtft_t *instance, const vtft_component *__generic_ptr component)
 Draws the given circle component.
 
void _draw_ellipse (vtft_t *instance, const vtft_component *__generic_ptr component)
 Draws the given ellipse component.
 
void _draw_line (vtft_t *instance, const vtft_component *__generic_ptr component)
 Draws the given line component.
 
void _draw_label (vtft_t *instance, const vtft_component *__generic_ptr component)
 Draws the given label component.
 
void _draw_button (vtft_t *instance, const vtft_component *__generic_ptr component)
 Draws the given button component.
 
void _draw_rounded_button (vtft_t *instance, const vtft_component *__generic_ptr component)
 Draws the given rounded button component.
 
void _draw_circle_button (vtft_t *instance, const vtft_component *__generic_ptr component)
 Draws the given circle button component.
 
void _draw_image (vtft_t *instance, const vtft_component *__generic_ptr component)
 Draws the given image component.
 
void _draw_check_box (vtft_t *instance, const vtft_component *__generic_ptr component)
 Draws the given check box.
 
void _draw_radio_button (vtft_t *instance, vtft_component *__generic_ptr component)
 Draws the given radio button.
 
void _draw_progress_bar (vtft_t *instance, vtft_component *__generic_ptr component)
 Draws the given progress bar.
 
void _update_progress_bar (vtft_t *instance, vtft_progress_bar *progressBar)
 Updates the position of the given progress bar.
 

Function Documentation

◆ _draw_box()

void _draw_box ( vtft_t * instance,
const vtft_component *__generic_ptr component )

Function uses Graphics Library to draw a box shape.

Parameters
[in]instanceInitialized VTFT library instance. See vtft_t structure definition for detailed explanation.
[in]componentThe box component that will be drawn. See vtft_component structure definition for detailed explanation.
Returns
Nothing.

Example

◆ _draw_button()

void _draw_button ( vtft_t * instance,
const vtft_component *__generic_ptr component )

Function uses Graphics Library to frst draw button shape, then writes text over said shape.

Parameters
[in]instanceInitialized VTFT library instance. See vtft_t structure definition for detailed explanation.
[in]componentThe button component that will be drawn. See vtft_component structure definition for detailed explanation.
Returns
Nothing.

Example

◆ _draw_check_box()

void _draw_check_box ( vtft_t * instance,
const vtft_component *__generic_ptr component )

Function uses Graphics Library to draw checkbox shape. It's in the nature of check box to change it's value when checked or unchecked so the component itself should probably not be constant.

Parameters
[in]instanceInitialized VTFT library instance. See vtft_t structure definition for detailed explanation.
[in]componentThe check box component that will be drawn. See vtft_component structure definition for detailed explanation.
Returns
Nothing.

Example

◆ _draw_circle()

void _draw_circle ( vtft_t * instance,
const vtft_component *__generic_ptr component )

Function uses Graphics Library to draw a circle.

Parameters
[in]instanceInitialized VTFT library instance. See vtft_t structure definition for detailed explanation.
[in]componentThe circle component that will be drawn. See vtft_component structure definition for detailed explanation.
Returns
Nothing.

Example

◆ _draw_circle_button()

void _draw_circle_button ( vtft_t * instance,
const vtft_component *__generic_ptr component )

Function uses Graphics Library to frst draw circular button shape, then writes text over said shape.

Parameters
[in]instanceInitialized VTFT library instance. See vtft_t structure definition for detailed explanation.
[in]componentThe circle component that will be drawn. See vtft_component structure definition for detailed explanation.
Returns
Nothing.

Example

◆ _draw_ellipse()

void _draw_ellipse ( vtft_t * instance,
const vtft_component *__generic_ptr component )

Function uses Graphics Library to draw a ellipse.

Parameters
[in]instanceInitialized VTFT library instance. See vtft_t structure definition for detailed explanation.
[in]componentThe ellipse component that will be drawn. See vtft_component structure definition for detailed explanation.
Returns
Nothing.

Example

◆ _draw_image()

void _draw_image ( vtft_t * instance,
const vtft_component *__generic_ptr component )

Function uses Graphics Library to draw an image. Supported formats are 16bit BMP, 8bit BMP, 4bit BMP, 1bit BMP and JPEG.

Parameters
[in]instanceInitialized VTFT library instance. See vtft_t structure definition for detailed explanation.
[in]componentThe image component that will be drawn. See vtft_component structure definition for detailed explanation.
Returns
Nothing.

Example

◆ _draw_label()

void _draw_label ( vtft_t * instance,
const vtft_component *__generic_ptr component )

Function uses Graphics Library to draw text.

Parameters
[in]instanceInitialized VTFT library instance. See vtft_t structure definition for detailed explanation.
[in]componentThe label component that will be drawn. See vtft_component structure definition for detailed explanation.
Returns
Nothing.

Example

◆ _draw_line()

void _draw_line ( vtft_t * instance,
const vtft_component *__generic_ptr component )

Function uses Graphics Library to draw a line.

Parameters
[in]instanceInitialized VTFT library instance. See vtft_t structure definition for detailed explanation.
[in]componentThe line component that will be drawn. See vtft_component structure definition for detailed explanation.
Returns
Nothing.

Example

◆ _draw_none()

void _draw_none ( vtft_t * instance,
const vtft_component *__generic_ptr component )

An empty drawing handle for components with an invalid type.

Parameters
[in]instanceInitialized VTFT library instance. See vtft_t structure definition for detailed explanation.
[in]componentComponent of invalid type. See vtft_component structure definition for detailed explanation.
Returns
Nothing.

Example

◆ _draw_progress_bar()

void _draw_progress_bar ( vtft_t * instance,
vtft_component *__generic_ptr component )

Function uses Graphics Library to draw progres bar shape. It's in the nature of progress bar to change it's value so the component itself should probably not be constant.

Parameters
[in]instanceInitialized VTFT library instance. See vtft_t structure definition for detailed explanation.
[in]componentThe progress bar component that will be drawn. See vtft_component structure definition for detailed explanation.
Returns
Nothing.

Example

◆ _draw_radio_button()

void _draw_radio_button ( vtft_t * instance,
vtft_component *__generic_ptr component )

Function uses Graphics Library to draw radio button shape. It's in the nature of radio button to change it's value when checked or unchecked so the component itself should probably not be constant.

Parameters
[in]instanceInitialized VTFT library instance. See vtft_t structure definition for detailed explanation.
[in]componentThe radio button component that will be drawn. See vtft_component structure definition for detailed explanation.
Returns
Nothing.

Example

◆ _draw_rounded_box()

void _draw_rounded_box ( vtft_t * instance,
const vtft_component *__generic_ptr component )

Function uses Graphics Library to draw a rounded box shape.

Parameters
[in]instanceInitialized VTFT library instance. See vtft_t structure definition for detailed explanation.
[in]componentThe rounded box component that will be drawn. See vtft_component structure definition for detailed explanation.
Returns
Nothing.

Example

◆ _draw_rounded_button()

void _draw_rounded_button ( vtft_t * instance,
const vtft_component *__generic_ptr component )

Function uses Graphics Library to frst draw button shape, then writes text over said shape.

Parameters
[in]instanceInitialized VTFT library instance. See vtft_t structure definition for detailed explanation.
[in]componentThe rounded button component that will be drawn. See vtft_component structure definition for detailed explanation.
Returns
Nothing.

Example

◆ _update_progress_bar()

void _update_progress_bar ( vtft_t * instance,
vtft_progress_bar * progressBar )

Some components can be constant due to the fact that their values can not be changed while other components, such as progress bar, change their value making them invalid for a const prameter.

Parameters
[in]instanceInitialized VTFT library instance. See vtft_t structure definition for detailed explanation.
[out]progressBarThe progres bar component that will be updated. See vtft_progress_bar structure definition for detailed explanation.
Returns
Nothing.

Example

◆ vtft_draw_component()

void vtft_draw_component ( vtft_t * instance,
const vtft_component *__generic_ptr component )

Draws the given component, using the appropriate drawing function.

Parameters
[in]instanceInitialized VTFT instance. See vtft_t structure definition for detailed explanation.
[in]componentComponent to be drawn. See vtft_component structure definition for detailed explanation.
Returns
Nothing.

Example

◆ vtft_init()

void vtft_init ( vtft_t * vtft_instance,
tp_t * tp_instance )

Initializes the VTFT library with the given gl and tp instances.

Parameters
[out]vtft_instanceVTFT instance to be initialized. See vtft_t structure definition for detailed explanation.
[in]tp_instanceTP instance. See tp_t structure definition for detailed explanation.
Returns
Nothing.

Example

◆ vtft_process()

void vtft_process ( vtft_t * instance)

Processes the periodic events.

Parameters
[in]instanceInitialized VTFT instance. See vtft_t structure definition for detailed explanation.
Returns
Nothing.

Example

◆ vtft_refresh_current_screen()

void vtft_refresh_current_screen ( vtft_t * instance)

Redraws the current screen and all of its components.

Parameters
[in]instanceInitialized VTFT instance. See vtft_t structure definition for detailed explanation.
Returns
Nothing.

Example

◆ vtft_set_current_screen()

void vtft_set_current_screen ( vtft_t * instance,
vtft_screen * screen )

Sets the current screen and draws it.

Parameters
[in]instanceInitialized VTFT instance. See vtft_t structure definition for detailed explanation.
[in]screenScreen to be set as current. See vtft_screen structure definition for detailed explanation.
Returns
Nothing.

Example

◆ vtft_set_progress_bar_position()

void vtft_set_progress_bar_position ( vtft_t * instance,
vtft_progress_bar * progress_bar,
vtft_ucoord_t position )

Sets the position of the given progress bar.

Parameters
[in]instanceInitialized VTFT instance. See vtft_t structure definition for detailed explanation.
[in]progress_barProgress bar whose position is going to be set. See vtft_progress_bar structure definition for detailed explanation.
[in]positionPosition to be set. See vtft_ucoord_t structure definition for detailed explanation.
Returns
Nothing.

Example