summaryrefslogtreecommitdiff
path: root/fluid/tools/autodoc.h
blob: 136a7e119c8682e85ef91ea329abff98cbb42eaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// 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