Gooey GUI Library
|
Header file for the GooeyCanvas module. More...
#include "common/gooey_common.h"
Go to the source code of this file.
Functions | |
GooeyCanvas * | GooeyCanvas_Create (int x, int y, int width, int height) |
Adds a canvas to the specified 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 the foreground color of the user-defined canvas. | |
Header file for the GooeyCanvas module.
Provides functions to create and manipulate a user-defined canvas for drawing primitives such as rectangles, lines, and arcs.
GooeyCanvas * GooeyCanvas_Create | ( | int | x, |
int | y, | ||
int | width, | ||
int | height | ||
) |
Adds a canvas to the specified window.
This function creates a new GooeyCanvas and attaches it to the given GooeyWindow at the specified coordinates and dimensions.
x | The x-coordinate of the canvas position. |
y | The y-coordinate of the canvas position. |
width | The width of the canvas. |
height | The height of the 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.
The arc is drawn within the specified bounding box and between the given angles.
canvas | The user-defined canvas. |
x_center | The x-coordinate of the arc's center. |
y_center | The y-coordinate of the arc's center. |
width | The width of the arc's bounding box. |
height | The height of the arc's bounding box. |
angle1 | The starting angle of the arc in degrees. |
angle2 | The ending angle of the arc in degrees. |
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.
canvas | The user-defined canvas. |
x1 | The x-coordinate of the starting point of the line. |
y1 | The y-coordinate of the starting point of the line. |
x2 | The x-coordinate of the ending point of the line. |
y2 | The y-coordinate of the ending point of the line. |
color_hex | The color of the line in hexadecimal format. |
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.
The rectangle can be either filled with a solid color or outlined.
canvas | The user-defined canvas. |
x | The x-coordinate of the rectangle's top-left corner. |
y | The y-coordinate of the rectangle's top-left corner. |
width | The width of the rectangle. |
height | The height of the rectangle. |
color_hex | The color of the rectangle in hexadecimal format. |
is_filled | If true, the rectangle is filled with a solid color; otherwise, it is hollow. |
void GooeyCanvas_SetForeground | ( | GooeyCanvas * | canvas, |
unsigned long | color_hex | ||
) |
Sets the foreground color of the user-defined canvas.
The foreground color is used for subsequent drawing operations.
canvas | The user-defined canvas. |
color_hex | The foreground color in hexadecimal format. |