fltk/fluid/tools/autodoc.h
Matthias Melcher 51a55bc736
Fluid: restructuring and rejuvenation of the source code.
* Add classes for application and project
* Removed all globals from Fluid.h
* Extracting args and project history into their own classes
* Moving globals into Application class
* Initialize values inside headers for some classes.
* Undo functionality wrapped in a class inside Project.
* File reader and writer are now linked to a project.
* Avoid global project access
* Nodes (former Types) will be managed by a new Tree class.
* Removed static members (hidden globals) form Node/Fl_Type.
* Adding Tree iterator.
* Use nullptr instead of 0, NULL, or 0L
* Renamed Fl_..._Type to ..._Node, FL_OVERRIDE -> override
* Renaming ..._type to ...::prototype
* Splitting Widget Panel into multiple files.
* Moved callback code into widget panel file.
* Cleaning up Fluid_Image -> Image_asset
* Moving Fd_Snap_Action into new namespace fld::app::Snap_Action etc.
* Moved mergeback into proj folder.
* `enum ID` is now `enum class Type`.
2025-03-16 17:16:12 -04:00

60 lines
1.7 KiB
C++

//
// Self-generate snapshots of user interface for FLUID documentation.
//
// Copyright 2023-2025 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
//
/**
\file autodoc.h
\brief tools to take snapshots of UI elements for documentation purposes
*/
#ifndef fl_screenshot_H
#define fl_screenshot_H
#include <FL/Fl_Export.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Rect.H>
#include <string>
/** Class to initialize a Rect by providing the margin around a rect. */
class Fl_Margin : public Fl_Rect {
public:
Fl_Margin(int dx, int dy, int dr, int db);
};
int fl_snapshot(const char *filename, Fl_Widget **w,
const Fl_Rect &frame = Fl_Margin(4, 4, 4, 4),
const Fl_Rect &blend = Fl_Margin(4, 4, 4, 4),
double scale=1.0);
int fl_snapshot(const char *filename, Fl_Widget *w1, Fl_Widget *w2,
const Fl_Rect &frame = Fl_Margin(4, 4, 4, 4),
const Fl_Rect &blend = Fl_Margin(4, 4, 4, 4),
double scale=1.0);
int fl_snapshot(const char *filename, Fl_Widget *w,
const Fl_Rect &frame = Fl_Margin(4, 4, 4, 4),
const Fl_Rect &blend = Fl_Margin(4, 4, 4, 4),
double scale=1.0);
extern const int FL_SNAP_TO_WINDOW;
extern Fl_Widget *FL_SNAP_AREA_CLEAR;
extern void run_autodoc(const std::string &target_dir);
#endif