Termux:GUI C/C++ Bindings
Loading...
Searching...
No Matches
views.h File Reference

This file contains all functions related to Views. More...

#include "types.h"

Go to the source code of this file.

Functions

tgui_err tgui_show_cursor (tgui_connection c, tgui_activity a, tgui_view v, bool show)
 Sets whether an EditText shows the cursor or not. More...
 
tgui_err tgui_linear_params (tgui_connection c, tgui_activity a, tgui_view v, float weight, int position)
 Sets the parameters for a View in a LinearLayout. More...
 
tgui_err tgui_grid_params (tgui_connection c, tgui_activity a, tgui_view v, size_t row, size_t col, size_t row_size, size_t col_size, tgui_grid_alignment row_align, tgui_grid_alignment col_align)
 Sets the parameters for a View in a GridLayout. More...
 
tgui_err tgui_view_location (tgui_connection c, tgui_activity a, tgui_view v, tgui_size_unit unit, float x, float y, bool top)
 Sets the location of the View manually. Useful for FrameLayout. Can also make it display on top of its siblings. More...
 
tgui_err tgui_relative_params (tgui_connection c, tgui_activity a, tgui_view v)
 Sets the parameters for a View in a RelativeLayout. NOT IMPLEMENTED! More...
 
tgui_err tgui_visibility (tgui_connection c, tgui_activity a, tgui_view v, tgui_view_visibility vis)
 Sets the visibility of a View. More...
 
tgui_err tgui_set_width (tgui_connection c, tgui_activity a, tgui_view v, tgui_view_size width)
 Sets the width of a View. More...
 
tgui_err tgui_set_height (tgui_connection c, tgui_activity a, tgui_view v, tgui_view_size height)
 Sets the height of a View. More...
 
tgui_err tgui_get_dimensions (tgui_connection c, tgui_activity a, tgui_view v, tgui_size_unit unit, float *width, float *height)
 Gets the dimensions of a View. More...
 
tgui_err tgui_delete_view (tgui_connection c, tgui_activity a, tgui_view v)
 Deletes a View. More...
 
tgui_err tgui_delete_children (tgui_connection c, tgui_activity a, tgui_view v)
 Deletes the children of a View. More...
 
tgui_err tgui_set_margin (tgui_connection c, tgui_activity a, tgui_view v, tgui_size size, tgui_direction dir)
 Sets the margins for a View. More...
 
tgui_err tgui_set_padding (tgui_connection c, tgui_activity a, tgui_view v, tgui_size size, tgui_direction dir)
 Sets the padding for a View. More...
 
tgui_err tgui_background_color (tgui_connection c, tgui_activity a, tgui_view v, tgui_color color)
 Sets the background color of a View. More...
 
tgui_err tgui_text_color (tgui_connection c, tgui_activity a, tgui_view v, tgui_color color)
 Sets the text color of a View. More...
 
tgui_err tgui_progress (tgui_connection c, tgui_activity a, tgui_view v, unsigned char progress)
 Sets the progress of a ProgressBar. More...
 
tgui_err tgui_refreshing (tgui_connection c, tgui_activity a, tgui_view v, bool refreshing)
 Set whether a SwipeRefreshLayout is in the refreshing state. More...
 
tgui_err tgui_set_text (tgui_connection c, tgui_activity a, tgui_view v, const char *text)
 Sets the Text of a View. More...
 
tgui_err tgui_set_gravity (tgui_connection c, tgui_activity a, tgui_view v, tgui_gravity horizontal, tgui_gravity vertical)
 Sets the gravity of the text in a View. More...
 
tgui_err tgui_text_size (tgui_connection c, tgui_activity a, tgui_view v, tgui_size size)
 Sets the text size of a View. More...
 
tgui_err tgui_get_text (tgui_connection c, tgui_activity a, tgui_view v, char **text)
 Gets the text of a View. More...
 
tgui_err tgui_set_checked (tgui_connection c, tgui_activity a, tgui_view v, bool checked)
 Sets whether a View is checked. More...
 
tgui_err tgui_focus (tgui_connection c, tgui_activity a, tgui_view v, bool force_soft)
 Sets the focus to a View. More...
 
tgui_err tgui_get_scroll_position (tgui_connection c, tgui_activity a, tgui_view v, tgui_size_unit unit, float *x, float *y)
 Gets the scroll position of a View. More...
 
tgui_err tgui_set_scroll_position (tgui_connection c, tgui_activity a, tgui_view v, tgui_size x, tgui_size y, bool smooth)
 Sets the scroll position for a View. More...
 
tgui_err tgui_set_list (tgui_connection c, tgui_activity a, tgui_view v, const char *const *list)
 Sets the list of a Spinner. More...
 
tgui_err tgui_set_image (tgui_connection c, tgui_activity a, tgui_view v, const void *img, size_t length)
 Sets the image of an ImageView. More...
 
tgui_err tgui_add_buffer (tgui_connection c, tgui_buffer *buffer)
 Creates a memory buffer shared with the plugin and maps it. More...
 
tgui_err tgui_delete_buffer (tgui_connection c, tgui_buffer *buffer)
 Deletes the buffer in the plugin, closes the file descriptor and removes the memory mapping. More...
 
tgui_err tgui_blit_buffer (tgui_connection c, const tgui_buffer *buffer)
 Blits a buffer in the plugin, making the image available to ImageViews on the next refresh. More...
 
tgui_err tgui_set_buffer (tgui_connection c, tgui_activity a, tgui_view v, const tgui_buffer *buffer)
 Sets an ImageVIew to display the contents of a buffer. More...
 
tgui_err tgui_refresh_image_view (tgui_connection c, tgui_activity a, tgui_view v)
 Refreshes an ImageView after blitting the contents of its buffer. More...
 
tgui_err tgui_select_tab (tgui_connection c, tgui_activity a, tgui_view v, unsigned int index)
 Selects a tab in a TabLayout. More...
 
tgui_err tgui_select_item (tgui_connection c, tgui_activity a, tgui_view v, unsigned int index)
 Selects an item in a Spinner. More...
 
tgui_err tgui_set_clickable (tgui_connection c, tgui_activity a, tgui_view v, bool clickable)
 Sets whether a View is clickable by the user. More...
 

Detailed Description

This file contains all functions related to Views.

Function Documentation

◆ tgui_show_cursor()

tgui_err tgui_show_cursor ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
bool  show 
)

Sets whether an EditText shows the cursor or not.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
showWhether to show the cursor or not.
Returns
tgui_err The error code.

◆ tgui_linear_params()

tgui_err tgui_linear_params ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
float  weight,
int  position 
)

Sets the parameters for a View in a LinearLayout.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
weightThe layout weight. Use a negative number to keep the current weight.
positionthe position in the View. Use 0 to keep the position.
Returns
tgui_err The error code.

◆ tgui_grid_params()

tgui_err tgui_grid_params ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
size_t  row,
size_t  col,
size_t  row_size,
size_t  col_size,
tgui_grid_alignment  row_align,
tgui_grid_alignment  col_align 
)

Sets the parameters for a View in a GridLayout.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
rowThe row position.
colThe column position.
row_sizeHow many rows the View occupies.
col_sizeHow many columns the View occupies.
row_alignThe alignment in the row.
col_alignThe alignment in the column.
Returns
tgui_err The error code.

◆ tgui_view_location()

tgui_err tgui_view_location ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
tgui_size_unit  unit,
float  x,
float  y,
bool  top 
)

Sets the location of the View manually. Useful for FrameLayout. Can also make it display on top of its siblings.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
unitThe unit for x and y.
xThe horizontal position.
yThe vertical position.
topSet to true if you want to move the View on top of its siblings.
Returns
tgui_err The error code.

◆ tgui_relative_params()

tgui_err tgui_relative_params ( tgui_connection  c,
tgui_activity  a,
tgui_view  v 
)

Sets the parameters for a View in a RelativeLayout. NOT IMPLEMENTED!

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
Returns
tgui_err The error code.

◆ tgui_visibility()

tgui_err tgui_visibility ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
tgui_view_visibility  vis 
)

Sets the visibility of a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
visThe visibility.
Returns
tgui_err The error code.

◆ tgui_set_width()

tgui_err tgui_set_width ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
tgui_view_size  width 
)

Sets the width of a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
widthThe width.
Returns
tgui_err The error code.

◆ tgui_set_height()

tgui_err tgui_set_height ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
tgui_view_size  height 
)

Sets the height of a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
heightThe height.
Returns
tgui_err The error code.

◆ tgui_get_dimensions()

tgui_err tgui_get_dimensions ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
tgui_size_unit  unit,
float *  width,
float *  height 
)

Gets the dimensions of a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
unitThe unit of the returned dimensions.
[out]widthIf successful, will contain the View width in the desired unit.
[out]heightIf successful, will contain the View height in the desired unit.
Returns
tgui_err The error code.

◆ tgui_delete_view()

tgui_err tgui_delete_view ( tgui_connection  c,
tgui_activity  a,
tgui_view  v 
)

Deletes a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
Returns
tgui_err The error code.

◆ tgui_delete_children()

tgui_err tgui_delete_children ( tgui_connection  c,
tgui_activity  a,
tgui_view  v 
)

Deletes the children of a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
Returns
tgui_err The error code.

◆ tgui_set_margin()

tgui_err tgui_set_margin ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
tgui_size  size,
tgui_direction  dir 
)

Sets the margins for a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
sizeThe margin size.
dirThe direction(s) to apply the margin.
Returns
tgui_err The error code.

◆ tgui_set_padding()

tgui_err tgui_set_padding ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
tgui_size  size,
tgui_direction  dir 
)

Sets the padding for a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
sizeThe padding size.
dirThe direction(s) to apply the padding.
Returns
tgui_err The error code.

◆ tgui_background_color()

tgui_err tgui_background_color ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
tgui_color  color 
)

Sets the background color of a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
colorThe color.
Returns
tgui_err The error code.

◆ tgui_text_color()

tgui_err tgui_text_color ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
tgui_color  color 
)

Sets the text color of a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
colorThe text color.
Returns
tgui_err The error code.

◆ tgui_progress()

tgui_err tgui_progress ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
unsigned char  progress 
)

Sets the progress of a ProgressBar.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
progressThe progress from 0 to 100(inclusive).
Returns
tgui_err The error code.

◆ tgui_refreshing()

tgui_err tgui_refreshing ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
bool  refreshing 
)

Set whether a SwipeRefreshLayout is in the refreshing state.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
refreshingThe refreshing state.
Returns
tgui_err The error code.

◆ tgui_set_text()

tgui_err tgui_set_text ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
const char *  text 
)

Sets the Text of a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
textThe text.
Returns
tgui_err The error code.

◆ tgui_set_gravity()

tgui_err tgui_set_gravity ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
tgui_gravity  horizontal,
tgui_gravity  vertical 
)

Sets the gravity of the text in a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
horizontalThe horizontal gravity.
verticalThe vertical gravity.
Returns
tgui_err The error code.

◆ tgui_text_size()

tgui_err tgui_text_size ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
tgui_size  size 
)

Sets the text size of a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
sizeThe text size.
Returns
tgui_err The error code.

◆ tgui_get_text()

tgui_err tgui_get_text ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
char **  text 
)

Gets the text of a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
[out]textThe text of the View. When successful, this has to be freed with free().
Returns
tgui_err The error code.

◆ tgui_set_checked()

tgui_err tgui_set_checked ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
bool  checked 
)

Sets whether a View is checked.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
checkedThe new checked status.
Returns
tgui_err The error code.

◆ tgui_focus()

tgui_err tgui_focus ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
bool  force_soft 
)

Sets the focus to a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
force_softIf true, forces the software keyboard to open.
Returns
tgui_err The error code.

◆ tgui_get_scroll_position()

tgui_err tgui_get_scroll_position ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
tgui_size_unit  unit,
float *  x,
float *  y 
)

Gets the scroll position of a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
unitThe unit for x and y.
[out]xThe x scroll position.
[out]yThe y scroll position.
Returns
tgui_err The error code.

◆ tgui_set_scroll_position()

tgui_err tgui_set_scroll_position ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
tgui_size  x,
tgui_size  y,
bool  smooth 
)

Sets the scroll position for a View.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
xThe x scroll position.
yThe y scroll position.
smoothWhether to jump or scroll smoothly.
Returns
tgui_err The error code.

◆ tgui_set_list()

tgui_err tgui_set_list ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
const char *const *  list 
)

Sets the list of a Spinner.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
[in]listA NULL terminated list of pointers to strings.
Returns
tgui_err The error code.

◆ tgui_set_image()

tgui_err tgui_set_image ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
const void *  img,
size_t  length 
)

Sets the image of an ImageView.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
imgThe image data in PGN/JPEG.
lengthThe length of the image data.
Returns
tgui_err The error code.

◆ tgui_add_buffer()

tgui_err tgui_add_buffer ( tgui_connection  c,
tgui_buffer buffer 
)

Creates a memory buffer shared with the plugin and maps it.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_SYSTEM: mmap failed
Parameters
cThe connection to use.
[in]bufferA buffer with the width and height fields > 0 and a valid format field. The data, id and fd fields are filled out if successful.
Returns
tgui_err The error code.

◆ tgui_delete_buffer()

tgui_err tgui_delete_buffer ( tgui_connection  c,
tgui_buffer buffer 
)

Deletes the buffer in the plugin, closes the file descriptor and removes the memory mapping.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
Parameters
cThe connection to use.
bufferThe buffer to delete.
Returns
tgui_err The error code.

◆ tgui_blit_buffer()

tgui_err tgui_blit_buffer ( tgui_connection  c,
const tgui_buffer buffer 
)

Blits a buffer in the plugin, making the image available to ImageViews on the next refresh.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
[in]bufferThe buffer to blit.
Returns
tgui_err The error code.

◆ tgui_set_buffer()

tgui_err tgui_set_buffer ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
const tgui_buffer buffer 
)

Sets an ImageVIew to display the contents of a buffer.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
[in]bufferThe buffer to set.
Returns
tgui_err The error code.

◆ tgui_refresh_image_view()

tgui_err tgui_refresh_image_view ( tgui_connection  c,
tgui_activity  a,
tgui_view  v 
)

Refreshes an ImageView after blitting the contents of its buffer.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
Returns
tgui_err The error code.

◆ tgui_select_tab()

tgui_err tgui_select_tab ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
unsigned int  index 
)

Selects a tab in a TabLayout.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
indexThe tab to select.
Returns
tgui_err The error code.

◆ tgui_select_item()

tgui_err tgui_select_item ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
unsigned int  index 
)

Selects an item in a Spinner.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
indexThe item to select.
Returns
tgui_err The error code.

◆ tgui_set_clickable()

tgui_err tgui_set_clickable ( tgui_connection  c,
tgui_activity  a,
tgui_view  v,
bool  clickable 
)

Sets whether a View is clickable by the user.

Errors

  • TGUI_ERR_MESSAGE: Protobuf I/O error.
  • TGUI_ERR_NOMEM: Not enough memory.
  • TGUI_ERR_EXCEPTION: Generic exception triggered.
  • TGUI_ERR_ACTIVITY_DESTROYED: The Activity was already closed.
  • TGUI_ERR_VIEW_INVALID: Invalid view type.
Parameters
cThe connection to use.
aThe Activity the View is in.
vThe View.
clickableThe new clickable state.
Returns
tgui_err The error code.