format: update .clang-format
This commit is contained in:
@@ -5,24 +5,24 @@
|
||||
#include "src/ui/vektorcanvas.h"
|
||||
|
||||
typedef struct button_tool_set_data {
|
||||
VektorAppState *state;
|
||||
VektorAppState* state;
|
||||
VektorAppTool tool;
|
||||
} button_tool_set_data;
|
||||
|
||||
static void appstate_set_tool(GtkButton *button, gpointer user_data) {
|
||||
button_tool_set_data *data = (button_tool_set_data *)user_data;
|
||||
static void appstate_set_tool(GtkButton* button, gpointer user_data) {
|
||||
button_tool_set_data* data = (button_tool_set_data*)user_data;
|
||||
data->state->selectedTool = data->tool;
|
||||
|
||||
// setting tool also resets selected primitive
|
||||
data->state->selectedPrimitive = NULL;
|
||||
}
|
||||
|
||||
static void canvas_onclick(GtkGestureClick *gesture, int n_press, double x,
|
||||
static void canvas_onclick(GtkGestureClick* gesture, int n_press, double x,
|
||||
double y, gpointer user_data) {
|
||||
|
||||
VektorAppState *state = user_data;
|
||||
VektorAppState* state = user_data;
|
||||
|
||||
GtkWidget *widget =
|
||||
GtkWidget* widget =
|
||||
gtk_event_controller_get_widget(GTK_EVENT_CONTROLLER(gesture));
|
||||
|
||||
int widget_w = gtk_widget_get_width(widget);
|
||||
@@ -38,7 +38,7 @@ static void canvas_onclick(GtkGestureClick *gesture, int n_press, double x,
|
||||
vektor_appstate_canvas_click(state, x * sx, y * sy);
|
||||
}
|
||||
|
||||
void vektor_appstate_canvas_click(VektorAppState *state, double x, double y) {
|
||||
void vektor_appstate_canvas_click(VektorAppState* state, double x, double y) {
|
||||
V2 pos = (V2){x, y};
|
||||
|
||||
begin_click_dispatch:
|
||||
@@ -46,7 +46,7 @@ begin_click_dispatch:
|
||||
// create new polyline primitive if none is selected
|
||||
if (state->selectedPrimitive == NULL) {
|
||||
|
||||
VektorPolyline *line = vektor_polyline_new();
|
||||
VektorPolyline* line = vektor_polyline_new();
|
||||
VektorPrimitive linePrimitive =
|
||||
(VektorPrimitive){.kind = VEKTOR_POLYLINE, .polyline = line};
|
||||
vektor_primitivebuffer_add_primitive(state->primitiveBuffer,
|
||||
@@ -72,8 +72,8 @@ begin_click_dispatch:
|
||||
vektor_canvas_update(state->canvas);
|
||||
}
|
||||
|
||||
void vektor_appstate_new(VektorWidgetState *wstate, VektorAppState *stateOut) {
|
||||
button_tool_set_data *data_linetool = malloc(sizeof(button_tool_set_data));
|
||||
void vektor_appstate_new(VektorWidgetState* wstate, VektorAppState* stateOut) {
|
||||
button_tool_set_data* data_linetool = malloc(sizeof(button_tool_set_data));
|
||||
data_linetool->state = stateOut;
|
||||
data_linetool->tool = VektorLineTool;
|
||||
|
||||
@@ -90,7 +90,7 @@ void vektor_appstate_new(VektorWidgetState *wstate, VektorAppState *stateOut) {
|
||||
G_CALLBACK(appstate_set_tool), data_linetool);
|
||||
|
||||
// Add click gesture to canvas
|
||||
GtkGesture *canvasClickGesture = gtk_gesture_click_new();
|
||||
GtkGesture* canvasClickGesture = gtk_gesture_click_new();
|
||||
g_signal_connect(G_OBJECT(canvasClickGesture), "pressed",
|
||||
G_CALLBACK(canvas_onclick), stateOut);
|
||||
gtk_widget_add_controller(GTK_WIDGET(wstate->workspaceCanvas),
|
||||
|
||||
@@ -10,18 +10,18 @@ typedef enum VektorAppTool { VektorLineTool } VektorAppTool;
|
||||
|
||||
typedef struct VektorAppState {
|
||||
VektorAppTool selectedTool;
|
||||
VektorPrimitive *selectedPrimitive;
|
||||
VektorPrimitive* selectedPrimitive;
|
||||
|
||||
// Logic space
|
||||
VektorPrimitiveBuffer *primitiveBuffer;
|
||||
VektorPrimitiveBuffer* primitiveBuffer;
|
||||
// Pixel space
|
||||
VektorFramebuffer *frameBuffer;
|
||||
VektorFramebuffer* frameBuffer;
|
||||
// View space
|
||||
VektorCanvas *canvas;
|
||||
VektorCanvas* canvas;
|
||||
|
||||
} VektorAppState;
|
||||
|
||||
void vektor_appstate_new(VektorWidgetState *wstate, VektorAppState *stateOut);
|
||||
void vektor_appstate_canvas_click(VektorAppState *state, double x, double y);
|
||||
void vektor_appstate_new(VektorWidgetState* wstate, VektorAppState* stateOut);
|
||||
void vektor_appstate_canvas_click(VektorAppState* state, double x, double y);
|
||||
|
||||
#endif
|
||||
@@ -1,14 +1,14 @@
|
||||
#include "primitives.h"
|
||||
|
||||
VektorPolyline *vektor_polyline_new(void) {
|
||||
VektorPolyline *pl = malloc(sizeof(VektorPolyline));
|
||||
VektorPolyline* vektor_polyline_new(void) {
|
||||
VektorPolyline* pl = malloc(sizeof(VektorPolyline));
|
||||
pl->count = 0;
|
||||
pl->capacity = 4;
|
||||
pl->points = malloc(sizeof(V2) * pl->capacity);
|
||||
return pl;
|
||||
}
|
||||
|
||||
void vektor_polyline_add_point(VektorPolyline *pl, V2 point) {
|
||||
void vektor_polyline_add_point(VektorPolyline* pl, V2 point) {
|
||||
if (pl->count >= pl->capacity) {
|
||||
pl->capacity *= 2;
|
||||
pl->points = realloc(pl->points, sizeof(V2) * pl->capacity);
|
||||
@@ -16,22 +16,22 @@ void vektor_polyline_add_point(VektorPolyline *pl, V2 point) {
|
||||
pl->points[pl->count++] = point;
|
||||
}
|
||||
|
||||
void vektor_polyline_free(VektorPolyline *pl) {
|
||||
void vektor_polyline_free(VektorPolyline* pl) {
|
||||
if (!pl)
|
||||
return;
|
||||
free(pl->points);
|
||||
free(pl);
|
||||
}
|
||||
|
||||
VektorPolygon *vektor_polygon_new(void) {
|
||||
VektorPolygon *pg = malloc(sizeof(VektorPolygon));
|
||||
VektorPolygon* vektor_polygon_new(void) {
|
||||
VektorPolygon* pg = malloc(sizeof(VektorPolygon));
|
||||
pg->count = 0;
|
||||
pg->capacity = 4;
|
||||
pg->points = malloc(sizeof(V2) * pg->capacity);
|
||||
return pg;
|
||||
}
|
||||
|
||||
void vektor_polygon_add_point(VektorPolygon *pg, V2 point) {
|
||||
void vektor_polygon_add_point(VektorPolygon* pg, V2 point) {
|
||||
if (pg->count >= pg->capacity) {
|
||||
pg->capacity *= 2;
|
||||
pg->points = realloc(pg->points, sizeof(V2) * pg->capacity);
|
||||
@@ -39,14 +39,14 @@ void vektor_polygon_add_point(VektorPolygon *pg, V2 point) {
|
||||
pg->points[pg->count++] = point;
|
||||
}
|
||||
|
||||
void vektor_polygon_free(VektorPolygon *pg) {
|
||||
void vektor_polygon_free(VektorPolygon* pg) {
|
||||
if (!pg)
|
||||
return;
|
||||
free(pg->points);
|
||||
free(pg);
|
||||
}
|
||||
|
||||
void vektor_primitivebuffer_add_primitive(VektorPrimitiveBuffer *buffer,
|
||||
void vektor_primitivebuffer_add_primitive(VektorPrimitiveBuffer* buffer,
|
||||
VektorPrimitive prim) {
|
||||
if (buffer->count >= buffer->capacity) {
|
||||
buffer->capacity = buffer->capacity ? buffer->capacity * 2 : 4;
|
||||
|
||||
@@ -11,13 +11,13 @@ typedef struct {
|
||||
} VektorLine;
|
||||
|
||||
typedef struct {
|
||||
V2 *points;
|
||||
V2* points;
|
||||
size_t count;
|
||||
size_t capacity;
|
||||
} VektorPolyline;
|
||||
|
||||
typedef struct {
|
||||
V2 *points;
|
||||
V2* points;
|
||||
size_t count;
|
||||
size_t capacity;
|
||||
} VektorPolygon;
|
||||
@@ -38,27 +38,27 @@ typedef struct {
|
||||
VektorPrimitiveKind kind;
|
||||
union {
|
||||
VektorLine line;
|
||||
VektorPolyline *polyline;
|
||||
VektorPolygon *polygon;
|
||||
VektorPolyline* polyline;
|
||||
VektorPolygon* polygon;
|
||||
VektorCircle circle;
|
||||
};
|
||||
} VektorPrimitive;
|
||||
|
||||
VektorPolyline *vektor_polyline_new(void);
|
||||
void vektor_polyline_add_point(VektorPolyline *pl, V2 point);
|
||||
void vektor_polyline_free(VektorPolyline *pl);
|
||||
VektorPolyline* vektor_polyline_new(void);
|
||||
void vektor_polyline_add_point(VektorPolyline* pl, V2 point);
|
||||
void vektor_polyline_free(VektorPolyline* pl);
|
||||
|
||||
VektorPolygon *vektor_polygon_new(void);
|
||||
void vektor_polygon_add_point(VektorPolygon *pl, V2 point);
|
||||
void vektor_polygon_free(VektorPolygon *pl);
|
||||
VektorPolygon* vektor_polygon_new(void);
|
||||
void vektor_polygon_add_point(VektorPolygon* pl, V2 point);
|
||||
void vektor_polygon_free(VektorPolygon* pl);
|
||||
|
||||
typedef struct {
|
||||
VektorPrimitive *primitives;
|
||||
VektorPrimitive* primitives;
|
||||
size_t count;
|
||||
size_t capacity;
|
||||
} VektorPrimitiveBuffer;
|
||||
|
||||
void vektor_primitivebuffer_add_primitive(VektorPrimitiveBuffer *edges,
|
||||
void vektor_primitivebuffer_add_primitive(VektorPrimitiveBuffer* edges,
|
||||
VektorPrimitive edge);
|
||||
|
||||
#endif // PRIMITIVES_H_
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "stddef.h"
|
||||
#include <stddef.h>
|
||||
|
||||
void vektor_edgebuffer_add_edge(EdgeBuffer *buffer, Edge edge) {
|
||||
void vektor_edgebuffer_add_edge(EdgeBuffer* buffer, Edge edge) {
|
||||
if (buffer->count >= buffer->capacity) {
|
||||
buffer->capacity = buffer->capacity ? buffer->capacity * 2 : 4;
|
||||
buffer->edges = realloc(buffer->edges, sizeof(Edge) * buffer->capacity);
|
||||
@@ -11,18 +11,18 @@ void vektor_edgebuffer_add_edge(EdgeBuffer *buffer, Edge edge) {
|
||||
buffer->edges[buffer->count++] = edge;
|
||||
}
|
||||
|
||||
void vektor_line_flatten(EdgeBuffer *buffer, VektorLine line) {
|
||||
void vektor_line_flatten(EdgeBuffer* buffer, VektorLine line) {
|
||||
vektor_edgebuffer_add_edge(buffer, (Edge){line.p1, line.p2, 0});
|
||||
}
|
||||
|
||||
void vektor_polyline_flatten(EdgeBuffer *buffer, VektorPolyline *line) {
|
||||
void vektor_polyline_flatten(EdgeBuffer* buffer, VektorPolyline* line) {
|
||||
for (size_t i = 0; i + 1 < line->count; i++) {
|
||||
vektor_edgebuffer_add_edge(
|
||||
buffer, (Edge){line->points[i], line->points[i + 1], 0});
|
||||
}
|
||||
}
|
||||
|
||||
void vektor_polygon_flatten(EdgeBuffer *buffer, VektorPolygon *pg) {
|
||||
void vektor_polygon_flatten(EdgeBuffer* buffer, VektorPolygon* pg) {
|
||||
size_t n = pg->count;
|
||||
if (n < 3)
|
||||
return;
|
||||
@@ -42,7 +42,7 @@ inline VektorFramebuffer vektor_framebuffer_new(unsigned int W,
|
||||
return fb;
|
||||
}
|
||||
|
||||
inline void vektor_framebuffer_putpixel(VektorFramebuffer *fb, int x, int y,
|
||||
inline void vektor_framebuffer_putpixel(VektorFramebuffer* fb, int x, int y,
|
||||
VektorColor color) {
|
||||
if ((unsigned)x >= fb->width || (unsigned)y >= fb->height)
|
||||
return;
|
||||
@@ -54,7 +54,7 @@ inline void vektor_framebuffer_putpixel(VektorFramebuffer *fb, int x, int y,
|
||||
fb->pixels[i + 3] = color.a;
|
||||
}
|
||||
|
||||
void draw_filled_circle(VektorFramebuffer *fb, int cx, int cy, int r,
|
||||
void draw_filled_circle(VektorFramebuffer* fb, int cx, int cy, int r,
|
||||
VektorColor color) {
|
||||
for (int y = -r; y <= r; y++) {
|
||||
int dx = (int)sqrt(r * r - y * y);
|
||||
@@ -64,7 +64,7 @@ void draw_filled_circle(VektorFramebuffer *fb, int cx, int cy, int r,
|
||||
}
|
||||
}
|
||||
|
||||
void vektor_framebuffer_drawline(VektorFramebuffer *fb, V2 a, V2 b,
|
||||
void vektor_framebuffer_drawline(VektorFramebuffer* fb, V2 a, V2 b,
|
||||
VektorColor color, double thickness) {
|
||||
int x0 = (int)a.x;
|
||||
int y0 = (int)a.y;
|
||||
@@ -94,11 +94,11 @@ void vektor_framebuffer_drawline(VektorFramebuffer *fb, V2 a, V2 b,
|
||||
}
|
||||
}
|
||||
|
||||
void vektor_framebuffer_rasterize(VektorFramebuffer *fb,
|
||||
VektorPrimitiveBuffer *prims) {
|
||||
void vektor_framebuffer_rasterize(VektorFramebuffer* fb,
|
||||
VektorPrimitiveBuffer* prims) {
|
||||
EdgeBuffer edges = {0};
|
||||
for (size_t i = 0; i < prims->count; i++) {
|
||||
VektorPrimitive *p = &prims->primitives[i];
|
||||
VektorPrimitive* p = &prims->primitives[i];
|
||||
|
||||
switch (p->kind) {
|
||||
case VEKTOR_LINE:
|
||||
|
||||
@@ -14,33 +14,33 @@ typedef struct {
|
||||
} Edge;
|
||||
|
||||
typedef struct {
|
||||
Edge *edges;
|
||||
Edge* edges;
|
||||
size_t count;
|
||||
size_t capacity;
|
||||
} EdgeBuffer;
|
||||
|
||||
void vektor_edgebuffer_add_edge(EdgeBuffer *edges, Edge edge);
|
||||
void vektor_edgebuffer_add_edge(EdgeBuffer* edges, Edge edge);
|
||||
|
||||
void vektor_line_flatten(EdgeBuffer *edges, VektorLine line);
|
||||
void vektor_polyline_flatten(EdgeBuffer *edges, VektorPolyline *line);
|
||||
void vektor_polygon_flatten(EdgeBuffer *buffer, VektorPolygon *line);
|
||||
void vektor_line_flatten(EdgeBuffer* edges, VektorLine line);
|
||||
void vektor_polyline_flatten(EdgeBuffer* edges, VektorPolyline* line);
|
||||
void vektor_polygon_flatten(EdgeBuffer* buffer, VektorPolygon* line);
|
||||
|
||||
typedef struct {
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
unsigned char *pixels; // Flat RGBA8 array
|
||||
unsigned char* pixels; // Flat RGBA8 array
|
||||
} VektorFramebuffer;
|
||||
|
||||
VektorFramebuffer vektor_framebuffer_new(unsigned int width,
|
||||
unsigned int height);
|
||||
|
||||
void vektor_framebuffer_putpixel(VektorFramebuffer *fb, int x, int y,
|
||||
void vektor_framebuffer_putpixel(VektorFramebuffer* fb, int x, int y,
|
||||
VektorColor color);
|
||||
|
||||
void vektor_framebuffer_drawline(VektorFramebuffer *fb, V2 a, V2 b,
|
||||
void vektor_framebuffer_drawline(VektorFramebuffer* fb, V2 a, V2 b,
|
||||
VektorColor color, double thickness);
|
||||
|
||||
void vektor_framebuffer_rasterize(VektorFramebuffer *fb,
|
||||
VektorPrimitiveBuffer *primitives);
|
||||
void vektor_framebuffer_rasterize(VektorFramebuffer* fb,
|
||||
VektorPrimitiveBuffer* primitives);
|
||||
|
||||
#endif // RASTER_H_
|
||||
|
||||
17
src/main.c
17
src/main.c
@@ -10,17 +10,16 @@
|
||||
#include "./ui/vektorcanvas.h"
|
||||
#include "./util/color.h"
|
||||
|
||||
static void on_map(GtkWidget *window, gpointer user_data) {
|
||||
vektor_uictrl_map((VektorWidgetState *)user_data);
|
||||
static void on_map(GtkWidget* window, gpointer user_data) {
|
||||
vektor_uictrl_map((VektorWidgetState*)user_data);
|
||||
}
|
||||
|
||||
static void activate(GtkApplication *app, gpointer user_data) {
|
||||
static void activate(GtkApplication* app, gpointer user_data) {
|
||||
|
||||
VektorWidgetState *widget_state =
|
||||
(VektorWidgetState *)malloc(sizeof(VektorWidgetState));
|
||||
VektorWidgetState* widget_state =
|
||||
(VektorWidgetState*)malloc(sizeof(VektorWidgetState));
|
||||
vektor_uictrl_init(app, widget_state);
|
||||
VektorAppState *app_state =
|
||||
(VektorAppState *)malloc(sizeof(VektorAppState));
|
||||
VektorAppState* app_state = (VektorAppState*)malloc(sizeof(VektorAppState));
|
||||
vektor_appstate_new(widget_state, app_state);
|
||||
|
||||
g_signal_connect(widget_state->window, "map", G_CALLBACK(on_map),
|
||||
@@ -29,9 +28,9 @@ static void activate(GtkApplication *app, gpointer user_data) {
|
||||
gtk_window_present(widget_state->window);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
GtkApplication *app;
|
||||
GtkApplication* app;
|
||||
int status;
|
||||
|
||||
app = gtk_application_new("dev.frox.vektor", G_APPLICATION_DEFAULT_FLAGS);
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
#include "gtk/gtk.h"
|
||||
#include "gtk/gtkcssprovider.h"
|
||||
|
||||
void vektor_uictrl_init(GtkApplication *app, VektorWidgetState *stateOut) {
|
||||
GtkBuilder *builder = gtk_builder_new();
|
||||
GError *error = NULL;
|
||||
void vektor_uictrl_init(GtkApplication* app, VektorWidgetState* stateOut) {
|
||||
GtkBuilder* builder = gtk_builder_new();
|
||||
GError* error = NULL;
|
||||
|
||||
// TODO: .ui files as resources instead of sketchy relative paths
|
||||
if (!gtk_builder_add_from_file(builder, "./ui/main.ui", &error)) {
|
||||
@@ -14,7 +14,7 @@ void vektor_uictrl_init(GtkApplication *app, VektorWidgetState *stateOut) {
|
||||
}
|
||||
|
||||
// Load css
|
||||
GtkCssProvider *provider = gtk_css_provider_new();
|
||||
GtkCssProvider* provider = gtk_css_provider_new();
|
||||
gtk_css_provider_load_from_path(provider, "./ui/main.css");
|
||||
gtk_style_context_add_provider_for_display(
|
||||
gdk_display_get_default(), GTK_STYLE_PROVIDER(provider),
|
||||
@@ -38,7 +38,7 @@ void vektor_uictrl_init(GtkApplication *app, VektorWidgetState *stateOut) {
|
||||
g_object_unref(builder);
|
||||
}
|
||||
|
||||
void vektor_uictrl_map(VektorWidgetState *state) {
|
||||
void vektor_uictrl_map(VektorWidgetState* state) {
|
||||
|
||||
// set the workspace divider to 7:3 ratio
|
||||
int window_width = gtk_widget_get_width(GTK_WIDGET(state->window));
|
||||
|
||||
@@ -8,16 +8,16 @@ Global application widget state, holding references to
|
||||
all the widgets used in internal logic of the program
|
||||
*/
|
||||
typedef struct VektorWidgetState {
|
||||
GtkWindow *window;
|
||||
GtkPaned *workspacePaned;
|
||||
GtkPicture *workspaceCanvas;
|
||||
GtkWindow* window;
|
||||
GtkPaned* workspacePaned;
|
||||
GtkPicture* workspaceCanvas;
|
||||
|
||||
GtkButton *workspaceButtonLinetool;
|
||||
GtkButton* workspaceButtonLinetool;
|
||||
|
||||
// GtkWidget* Workspace
|
||||
} VektorWidgetState;
|
||||
|
||||
void vektor_uictrl_init(GtkApplication *app, VektorWidgetState *stateOut);
|
||||
void vektor_uictrl_map(VektorWidgetState *state);
|
||||
void vektor_uictrl_init(GtkApplication* app, VektorWidgetState* stateOut);
|
||||
void vektor_uictrl_map(VektorWidgetState* state);
|
||||
|
||||
#endif
|
||||
@@ -8,7 +8,7 @@
|
||||
#define VKTR_CANVAS_HEIGHT 400
|
||||
#define VKTR_CANVAS_SIZE (VKTR_CANVAS_WIDTH * VKTR_CANVAS_HEIGHT * 4)
|
||||
|
||||
void vektor_canvas_init(VektorWidgetState *state, VektorCanvas *canvasOut) {
|
||||
void vektor_canvas_init(VektorWidgetState* state, VektorCanvas* canvasOut) {
|
||||
canvasOut->canvasWidget = state->workspaceCanvas;
|
||||
canvasOut->width = VKTR_CANVAS_WIDTH;
|
||||
canvasOut->height = VKTR_CANVAS_HEIGHT;
|
||||
@@ -28,7 +28,7 @@ void vektor_canvas_init(VektorWidgetState *state, VektorCanvas *canvasOut) {
|
||||
}
|
||||
|
||||
/* Generate new texture based on canvasPixels*/
|
||||
void vektor_canvas_update(VektorCanvas *canvas) {
|
||||
void vektor_canvas_update(VektorCanvas* canvas) {
|
||||
g_bytes_unref(canvas->canvasPixelBytes);
|
||||
canvas->canvasPixelBytes =
|
||||
g_bytes_new(canvas->canvasPixels, VKTR_CANVAS_SIZE);
|
||||
@@ -42,7 +42,7 @@ void vektor_canvas_update(VektorCanvas *canvas) {
|
||||
GDK_PAINTABLE(canvas->canvasTexture));
|
||||
}
|
||||
|
||||
void vektor_canvas_fill(VektorCanvas *canvas, VektorColor color) {
|
||||
void vektor_canvas_fill(VektorCanvas* canvas, VektorColor color) {
|
||||
for (int x = 0; x < VKTR_CANVAS_WIDTH; x++) {
|
||||
for (int y = 0; y < VKTR_CANVAS_HEIGHT; y++) {
|
||||
int i = (y * VKTR_CANVAS_WIDTH + x) * 4;
|
||||
@@ -54,7 +54,7 @@ void vektor_canvas_fill(VektorCanvas *canvas, VektorColor color) {
|
||||
}
|
||||
}
|
||||
|
||||
void vektor_canvas_drawfrom(VektorFramebuffer *fb, VektorCanvas *target) {
|
||||
void vektor_canvas_drawfrom(VektorFramebuffer* fb, VektorCanvas* target) {
|
||||
for (int x = 0; x < fb->width; x++) {
|
||||
for (int y = 0; y < fb->height; y++) {
|
||||
|
||||
|
||||
@@ -6,20 +6,20 @@
|
||||
#include "uicontroller.h"
|
||||
|
||||
typedef struct VektorCanvas {
|
||||
GtkPicture *canvasWidget;
|
||||
GtkPicture* canvasWidget;
|
||||
|
||||
// texture related stuff
|
||||
guchar *canvasPixels;
|
||||
GdkTexture *canvasTexture;
|
||||
GBytes *canvasPixelBytes;
|
||||
guchar* canvasPixels;
|
||||
GdkTexture* canvasTexture;
|
||||
GBytes* canvasPixelBytes;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
} VektorCanvas;
|
||||
|
||||
void vektor_canvas_init(VektorWidgetState *state, VektorCanvas *canvasOut);
|
||||
void vektor_canvas_update(VektorCanvas *canvas);
|
||||
void vektor_canvas_fill(VektorCanvas *canvas, VektorColor color);
|
||||
void vektor_canvas_drawfrom(VektorFramebuffer *fb, VektorCanvas *canvas);
|
||||
void vektor_canvas_init(VektorWidgetState* state, VektorCanvas* canvasOut);
|
||||
void vektor_canvas_update(VektorCanvas* canvas);
|
||||
void vektor_canvas_fill(VektorCanvas* canvas, VektorColor color);
|
||||
void vektor_canvas_drawfrom(VektorFramebuffer* fb, VektorCanvas* canvas);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user