From a6a1c9763c62b9aa8643b0c5b9937f3a930337b8 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Mon, 28 Oct 2024 02:34:18 +1300 Subject: Fl_Label binding added --- src/c_fl_label.cpp | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 src/c_fl_label.cpp (limited to 'src/c_fl_label.cpp') diff --git a/src/c_fl_label.cpp b/src/c_fl_label.cpp new file mode 100644 index 0000000..71b81ba --- /dev/null +++ b/src/c_fl_label.cpp @@ -0,0 +1,96 @@ + + +// Programmed by Jedidiah Barber +// Released into the public domain + + +#include +#include +#include "c_fl_label.h" +#include "c_fl_type.h" + + + + +LABEL new_fl_label(const char * v, int f, int s, unsigned int h, int k, unsigned int p) { + Fl_Label *l = new Fl_Label; + l->value = v; + l->font = f; + l->size = s; + l->color = h; + l->align_ = p; + l->type = (uchar)k; + return l; +} + +void free_fl_label(LABEL l) { + delete reinterpret_cast(l); +} + + + + +void fl_label_set_value(LABEL l, const char * v) { + reinterpret_cast(l)->value = v; +} + +int fl_label_get_font(LABEL l) { + return reinterpret_cast(l)->font; +} + +void fl_label_set_font(LABEL l, int f) { + reinterpret_cast(l)->font = f; +} + +int fl_label_get_size(LABEL l) { + return reinterpret_cast(l)->size; +} + +void fl_label_set_size(LABEL l, int s) { + reinterpret_cast(l)->size = s; +} + +unsigned int fl_label_get_color(LABEL l) { + return reinterpret_cast(l)->color; +} + +void fl_label_set_color(LABEL l, unsigned int h) { + reinterpret_cast(l)->color = h; +} + +int fl_label_get_type(LABEL l) { + return (int)reinterpret_cast(l)->type; +} + +void fl_label_set_type(LABEL l, int k) { + reinterpret_cast(l)->type = (uchar)k; +} + +unsigned int fl_label_get_align(LABEL l) { + return reinterpret_cast(l)->align_; +} + +void fl_label_set_align(LABEL l, unsigned int p) { + reinterpret_cast(l)->align_ = p; +} + +void fl_label_set_image(LABEL l, void * i) { + reinterpret_cast(l)->image = reinterpret_cast(i); +} + +void fl_label_set_deimage(LABEL l, void * i) { + reinterpret_cast(l)->deimage = reinterpret_cast(i); +} + + + + +void fl_label_draw(LABEL l, int x, int y, int w, int h, unsigned int p) { + reinterpret_cast(l)->draw(x, y, w, h, p); +} + +void fl_label_measure(LABEL l, int &w, int &h) { + reinterpret_cast(l)->measure(w, h); +} + + -- cgit