Gooey GUI Library
Loading...
Searching...
No Matches
gooey_canvas.h File Reference
#include "core/gooey_backend_internal.h"
#include "core/gooey_common.h"

Go to the source code of this file.

Functions

GooeyCanvas * GooeyCanvas_Add (GooeyWindow *win, int x, int y, int width, int height)
 Adds a canvas to the window.
 
void GooeyCanvas_DrawRectangle (GooeyCanvas *canvas, int x, int y, int width, int height, unsigned long color_hex, bool is_filled)
 Draws a rectangle onto the user-defined canvas.
 
void GooeyCanvas_DrawLine (GooeyCanvas *canvas, int x1, int y1, int x2, int y2, unsigned long color_hex)
 Draws a line onto the user-defined canvas.
 
void GooeyCanvas_DrawArc (GooeyCanvas *canvas, int x_center, int y_center, int width, int height, int angle1, int angle2)
 Draws an arc onto the user-defined canvas.
 
void GooeyCanvas_SetForeground (GooeyCanvas *canvas, unsigned long color_hex)
 Sets foreground of the user-defined canvas.
 
void GooeyCanvas_Draw (GooeyWindow *window)
 

Function Documentation

◆ GooeyCanvas_Add()

GooeyCanvas * GooeyCanvas_Add ( GooeyWindow *  win,
int  x,
int  y,
int  width,
int  height 
)

Adds a canvas to the window.

Parameters
winThe window to add the canvas to.
xThe x-coordinate of the canvas' position.
yThe y-coordinate of the canvas' position.
widthThe width of the canvas.
heightThe height of the canvas.
Returns
A new GooeyCanvas object.

◆ GooeyCanvas_Draw()

void GooeyCanvas_Draw ( GooeyWindow *  window)

◆ GooeyCanvas_DrawArc()

void GooeyCanvas_DrawArc ( GooeyCanvas *  canvas,
int  x_center,
int  y_center,
int  width,
int  height,
int  angle1,
int  angle2 
)

Draws an arc onto the user-defined canvas.

Parameters
canvasThe user-defined canvas.
x_centerThe x-coordinate of the arc.
y_centerThe y-coordinate of the arc.
widthThe width of the arc.
heightThe height of the arc.
angle1starting angle of the arc.
angle2end angle of the arc.

◆ GooeyCanvas_DrawLine()

void GooeyCanvas_DrawLine ( GooeyCanvas *  canvas,
int  x1,
int  y1,
int  x2,
int  y2,
unsigned long  color_hex 
)

Draws a line onto the user-defined canvas.

Parameters
canvasThe user-defined canvas.
x1The x-coordinate of the origin point of the line.
y1The y-coordinate of the origin point of the line.
x2The x-coordinate of the last point of the line.
y2The y-coordinate of the last point of the line.
color_hexThe color of the line in hexadecimal.

◆ GooeyCanvas_DrawRectangle()

void GooeyCanvas_DrawRectangle ( GooeyCanvas *  canvas,
int  x,
int  y,
int  width,
int  height,
unsigned long  color_hex,
bool  is_filled 
)

Draws a rectangle onto the user-defined canvas.

Parameters
canvasThe user-defined canvas.
xThe x-coordinate of the rectangle.
yThe y-coordinate of the rectangle.
widthThe width of the rectangle.
heightThe height of the rectangle.
color_hexThe color of the rectangle in hexadecimal.
is_filledIf true, the rectangle is filled with a solid color. If false it is hollow.

◆ GooeyCanvas_SetForeground()

void GooeyCanvas_SetForeground ( GooeyCanvas *  canvas,
unsigned long  color_hex 
)

Sets foreground of the user-defined canvas.

Parameters
canvasThe user-defined canvas.
color_hexThe foreground color in hexadecimal.