aboutsummaryrefslogtreecommitdiff
path: root/src/c_fl_counter.cpp
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2025-01-21 21:04:54 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2025-01-21 21:04:54 +1300
commitb4438b2fbe895694be98e6e8426103deefc51448 (patch)
tree760d86cd7c06420a91dad102cc9546aee73146fc /src/c_fl_counter.cpp
parenta4703a65b015140cd4a7a985db66264875ade734 (diff)
Split public API and private implementation files into different directories
Diffstat (limited to 'src/c_fl_counter.cpp')
-rw-r--r--src/c_fl_counter.cpp120
1 files changed, 0 insertions, 120 deletions
diff --git a/src/c_fl_counter.cpp b/src/c_fl_counter.cpp
deleted file mode 100644
index 9fe5d20..0000000
--- a/src/c_fl_counter.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-// Programmed by Jedidiah Barber
-// Released into the public domain
-
-
-#include <FL/Fl_Counter.H>
-#include "c_fl_counter.h"
-
-
-
-
-// Exports from Ada
-
-extern "C" void widget_draw_hook(void * ud);
-extern "C" int widget_handle_hook(void * ud, int e);
-
-extern "C" int valuator_format_hook(void * ud, char * buf);
-
-
-
-
-// Attaching all relevant hooks and friends
-
-class My_Counter : public Fl_Counter {
-public:
- using Fl_Counter::Fl_Counter;
-
- friend void fl_counter_draw(COUNTER c);
- friend int fl_counter_handle(COUNTER c, int e);
-
- int format(char * buf);
- void draw();
- int handle(int e);
-};
-
-int My_Counter::format(char * buf) {
- return valuator_format_hook(this->user_data(), buf);
-}
-
-void My_Counter::draw() {
- widget_draw_hook(this->user_data());
-}
-
-int My_Counter::handle(int e) {
- return widget_handle_hook(this->user_data(), e);
-}
-
-
-
-
-// Flattened C API
-
-COUNTER new_fl_counter(int x, int y, int w, int h, char* label) {
- My_Counter *c = new My_Counter(x, y, w, h, label);
- return c;
-}
-
-void free_fl_counter(COUNTER c) {
- delete static_cast<My_Counter*>(c);
-}
-
-
-
-
-double fl_counter_get_step(COUNTER c) {
- return static_cast<Fl_Counter*>(c)->step();
-}
-
-void fl_counter_set_step_top(COUNTER c, double t) {
- static_cast<Fl_Counter*>(c)->step(t);
-}
-
-void fl_counter_set_lstep(COUNTER c, double t) {
- static_cast<Fl_Counter*>(c)->lstep(t);
-}
-
-void fl_counter_set_step_both(COUNTER c, double s, double l) {
- static_cast<Fl_Counter*>(c)->step(s, l);
-}
-
-
-
-
-unsigned int fl_counter_get_textcolor(COUNTER c) {
- return static_cast<Fl_Counter*>(c)->textcolor();
-}
-
-void fl_counter_set_textcolor(COUNTER c, unsigned int t) {
- static_cast<Fl_Counter*>(c)->textcolor(t);
-}
-
-int fl_counter_get_textfont(COUNTER c) {
- return static_cast<Fl_Counter*>(c)->textfont();
-}
-
-void fl_counter_set_textfont(COUNTER c, int t) {
- static_cast<Fl_Counter*>(c)->textfont(t);
-}
-
-int fl_counter_get_textsize(COUNTER c) {
- return static_cast<Fl_Counter*>(c)->textsize();
-}
-
-void fl_counter_set_textsize(COUNTER c, int t) {
- static_cast<Fl_Counter*>(c)->textsize(t);
-}
-
-
-
-
-void fl_counter_draw(COUNTER c) {
- static_cast<My_Counter*>(c)->Fl_Counter::draw();
-}
-
-int fl_counter_handle(COUNTER c, int e) {
- return static_cast<My_Counter*>(c)->Fl_Counter::handle(e);
-}
-
-