From b4438b2fbe895694be98e6e8426103deefc51448 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Tue, 21 Jan 2025 21:04:54 +1300 Subject: Split public API and private implementation files into different directories --- src/c_fl_box.cpp | 72 -------------------------------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 src/c_fl_box.cpp (limited to 'src/c_fl_box.cpp') diff --git a/src/c_fl_box.cpp b/src/c_fl_box.cpp deleted file mode 100644 index e9c170d..0000000 --- a/src/c_fl_box.cpp +++ /dev/null @@ -1,72 +0,0 @@ - - -// Programmed by Jedidiah Barber -// Released into the public domain - - -#include -#include "c_fl_box.h" - - - - -// Exports from Ada - -extern "C" void widget_draw_hook(void * ud); -extern "C" int widget_handle_hook(void * ud, int e); - - - - -// Attaching all relevant hooks and friends - -class My_Box : public Fl_Box { -public: - using Fl_Box::Fl_Box; - - friend void fl_box_draw(BOX n); - friend int fl_box_handle(BOX n, int e); - - void draw(); - int handle(int e); -}; - -void My_Box::draw() { - widget_draw_hook(this->user_data()); -} - -int My_Box::handle(int e) { - return widget_handle_hook(this->user_data(), e); -} - - - - -// Flattened C API - -BOX new_fl_box(int x, int y, int w, int h, char* label) { - My_Box *b = new My_Box(x, y, w, h, label); - return b; -} - -BOX new_fl_box2(int k, int x, int y, int w, int h, char * label) { - My_Box *b = new My_Box(static_cast(k), x, y, w, h, label); - return b; -} - -void free_fl_box(BOX b) { - delete static_cast(b); -} - - - - -void fl_box_draw(BOX n) { - static_cast(n)->Fl_Box::draw(); -} - -int fl_box_handle(BOX n, int e) { - return static_cast(n)->Fl_Box::handle(e); -} - - -- cgit