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_double_window.cpp | 114 --------------------------------------------- 1 file changed, 114 deletions(-) delete mode 100644 src/c_fl_double_window.cpp (limited to 'src/c_fl_double_window.cpp') diff --git a/src/c_fl_double_window.cpp b/src/c_fl_double_window.cpp deleted file mode 100644 index 67db73b..0000000 --- a/src/c_fl_double_window.cpp +++ /dev/null @@ -1,114 +0,0 @@ - - -// Programmed by Jedidiah Barber -// Released into the public domain - - -#include -#include "c_fl_double_window.h" - - - - -// Exports from Ada - -extern "C" void widget_draw_hook(void * ud); -extern "C" int widget_handle_hook(void * ud, int e); - - - - -// Non-friend protected access - -class Friend_Double_Window : Fl_Double_Window { -public: - // Only needed for the (int) version - using Fl_Double_Window::flush; -}; - - - - -// Attaching all relevant hooks and friends - -class My_Double_Window : public Fl_Double_Window { -public: - using Fl_Double_Window::Fl_Double_Window; - - friend void fl_double_window_draw(DOUBLEWINDOW n); - friend int fl_double_window_handle(DOUBLEWINDOW n, int e); - - void draw(); - int handle(int e); -}; - -void My_Double_Window::draw() { - widget_draw_hook(this->user_data()); -} - -int My_Double_Window::handle(int e) { - return widget_handle_hook(this->user_data(), e); -} - - - - -// Flattened C API - -DOUBLEWINDOW new_fl_double_window(int x, int y, int w, int h, char* label) { - My_Double_Window *d = new My_Double_Window(x, y, w, h, label); - return d; -} - -DOUBLEWINDOW new_fl_double_window2(int w, int h, char* label) { - My_Double_Window *d = new My_Double_Window(w, h, label); - return d; -} - -void free_fl_double_window(DOUBLEWINDOW d) { - delete static_cast(d); -} - - - - -void fl_double_window_show(DOUBLEWINDOW d) { - static_cast(d)->show(); -} - -void fl_double_window_show2(DOUBLEWINDOW d, int c, void * v) { - static_cast(d)->show(c, static_cast(v)); -} - -void fl_double_window_hide(DOUBLEWINDOW d) { - static_cast(d)->hide(); -} - -void fl_double_window_flush(DOUBLEWINDOW d) { - static_cast(d)->flush(); -} - -void fl_double_window_flush2(DOUBLEWINDOW d, int e) { - void (Fl_Double_Window::*myflush)(int) = &Friend_Double_Window::flush; - (static_cast(d)->*myflush)(e); -} - - - - -void fl_double_window_resize(DOUBLEWINDOW d, int x, int y, int w, int h) { - static_cast(d)->resize(x, y, w, h); -} - - - - -void fl_double_window_draw(DOUBLEWINDOW n) { - static_cast(n)->Fl_Double_Window::draw(); -} - -int fl_double_window_handle(DOUBLEWINDOW n, int e) { - return static_cast(n)->Fl_Double_Window::handle(e); -} - - -- cgit