format: update .clang-format
This commit is contained in:
@@ -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