diff options
| author | Matthias Melcher <git@matthiasm.com> | 2021-12-08 15:52:15 +0100 |
|---|---|---|
| committer | Matthias Melcher <git@matthiasm.com> | 2021-12-08 15:52:15 +0100 |
| commit | 16dae3ea063ae134b8b87ca199575e904dfbb7d4 (patch) | |
| tree | ff0ce9e635bb39f49bfcce2c5e7fe099334a0d15 /fluid/widget_browser.h | |
| parent | 2d18c6f650c0001319c8883f8deb819d12984ac0 (diff) | |
Fluid: restructuring and commenting.
tl;dr : making Fluid maintainable, no changes in code execution and logic.
This is a pretty extensive restructuring of the Fluid source tree.
It was neccessary because source and header files were getting
much too big to handle. Many source files had no header, and many
headers declared functions that were in diffrent source files.
Reorganized much of the include statements.
Added comments to some of the files.
Added Doxygen configuration file for standalone Fluid docs.
Tested everything by rebuilding Fluid .fl designs with the resorted
version of Fluid.
Diffstat (limited to 'fluid/widget_browser.h')
| -rw-r--r-- | fluid/widget_browser.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/fluid/widget_browser.h b/fluid/widget_browser.h new file mode 100644 index 000000000..c00d45052 --- /dev/null +++ b/fluid/widget_browser.h @@ -0,0 +1,62 @@ +// +// Widget Browser code for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2021 by Bill Spitzak and others. +// +// This library is free software. Distribution and use rights are outlined in +// the file "COPYING" which should have been included with this file. If this +// file is missing or damaged, see the license at: +// +// https://www.fltk.org/COPYING.php +// +// Please see the following page on how to report bugs and issues: +// +// https://www.fltk.org/bugs.php +// + +#ifndef _FLUID_WIDGET_BROWSER_H +#define _FLUID_WIDGET_BROWSER_H + +#include <FL/Fl_Browser_.H> + +class Fl_Type; +class Widget_Browser; + +extern Widget_Browser *widget_browser; + +extern void redraw_browser(); +extern Fl_Widget *make_widget_browser(int x,int y,int w,int h); +extern void redraw_widget_browser(Fl_Type *caller); +extern void select(Fl_Type *o, int v); +extern void select_only(Fl_Type *o); +extern void deselect(); +extern void reveal_in_browser(Fl_Type *t); + +class Widget_Browser : public Fl_Browser_ +{ + friend class Fl_Type; + + static void callback_stub(Fl_Widget *o, void *) { + ((Widget_Browser *)o)->callback(); + } + + Fl_Type* pushedtitle; + + // required routines for Fl_Browser_ subclass: + void *item_first() const ; + void *item_next(void *) const ; + void *item_prev(void *) const ; + int item_selected(void *) const ; + void item_select(void *,int); + int item_width(void *) const ; + int item_height(void *) const ; + void item_draw(void *,int,int,int,int) const ; + int incr_height() const ; + +public: + int handle(int); + void callback(); + Widget_Browser(int,int,int,int,const char * =0); +}; + +#endif // _FLUID_WIDGET_BROWSER_H |
