BSB Developer Docs
Loading...
Searching...
No Matches
rectangle.h File Reference

Rectangle widget with configurable background and border. More...

#include <gui/widget.h>

Go to the source code of this file.

Typedefs

typedef struct RectangleWidget RectangleWidget
 Rectangle opaque structure.
 

Enumerations

enum  RectangleWidgetBackgroundType {
  RectangleWidgetBackgroundNone , RectangleWidgetBackgroundSolid , RectangleWidgetBackgroundGradientH , RectangleWidgetBackgroundGradientV ,
  RectangleWidgetBackgroundMax
}
 

Functions

RectangleWidget * rectangle_widget_alloc (Widget *parent)
 Create a new RectangleWidget instance.
 
void rectangle_widget_free (RectangleWidget *instance)
 Delete a RectangleWidget instance.
 
Widget * rectangle_widget_get_base (RectangleWidget *instance)
 Get a pointer to the base class instance.
 
void rectangle_widget_set_size (RectangleWidget *instance, size_t width, size_t height, int8_t radius)
 Set the size of a RectangleWidget instance.
 
void rectangle_widget_set_background (RectangleWidget *instance, RectangleWidgetBackgroundType type, Color color_start, Color color_end)
 Set the background type of a RectangleWidget instance.
 
void rectangle_widget_set_border (RectangleWidget *instance, int8_t width, Color color)
 Set the border properties of a RectangleWidget instance.
 

Detailed Description

Rectangle widget with configurable background and border.

Function Documentation

◆ rectangle_widget_alloc()

RectangleWidget * rectangle_widget_alloc ( Widget * parent)

Create a new RectangleWidget instance.

Parameters
[in,out]parentpointer to the parent Widget instance
Returns
pointer to the newly created RectangleWidget instance

◆ rectangle_widget_free()

void rectangle_widget_free ( RectangleWidget * instance)

Delete a RectangleWidget instance.

Parameters
[in,out]instancepointer to the RectangleWidget instance to be deleted

◆ rectangle_widget_get_base()

Widget * rectangle_widget_get_base ( RectangleWidget * instance)

Get a pointer to the base class instance.

The return value can be used in all Widget methods.

Parameters
[in,out]instancepointer to the RectangleWidget instance to be queried
Returns
pointer to the base class instance

◆ rectangle_widget_set_background()

void rectangle_widget_set_background ( RectangleWidget * instance,
RectangleWidgetBackgroundType type,
Color color_start,
Color color_end )

Set the background type of a RectangleWidget instance.

Parameters
[in,out]instancepointer to the RectangleWidget instance
[in]typethe background type to set
[in]color_startthe starting color for the background
[in]color_endthe ending color for the background (used for gradients)

◆ rectangle_widget_set_border()

void rectangle_widget_set_border ( RectangleWidget * instance,
int8_t width,
Color color )

Set the border properties of a RectangleWidget instance.

Parameters
[in,out]instancepointer to the RectangleWidget instance
[in]widththe width of the border
[in]colorthe color of the border

◆ rectangle_widget_set_size()

void rectangle_widget_set_size ( RectangleWidget * instance,
size_t width,
size_t height,
int8_t radius )

Set the size of a RectangleWidget instance.

Parameters
[in,out]instancepointer to the RectangleWidget instance
[in]widththe width of the rectangle
[in]heightthe height of the rectangle
[in]radiusthe radius of the rectangle corners