-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautodoc.cxx
612 lines (530 loc) · 22.9 KB
/
autodoc.cxx
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
//
// Self-generate snapshots of user interface for FLUID documentation.
//
// Copyright 2024 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 NDEBUG
#include "autodoc.h"
#include "fluid.h"
#include "factory.h"
#include "widget_browser.h"
#include "widget_panel.h"
#include "Fl_Widget_Type.h"
#include "Fl_Window_Type.h"
#include "function_panel.h"
#include "settings_panel.h"
#include "codeview_panel.h"
#include <FL/Enumerations.H>
#include <FL/fl_draw.H>
#include <FL/Fl_Image_Surface.H>
#include <FL/Fl_PNG_Image.H>
#include <FL/Fl_Menu_Bar.H>
extern Fl_Double_Window *settings_window;
/** \file autodoc.cxx
\todo Implement a function to snapshot a window including decoration
- see: void Fl_Widget_Surface::draw_decorated_window(Fl_Window *win, int win_offset_x, int win_offset_y)
- see: void Fl_Widget_Surface::origin(int x, int y)
- see: void Fl_Widget_Surface::draw(Fl_Widget* widget, int delta_x, int delta_y)
- see: void Fl_Widget_Surface::print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x, int delta_y)
\todo Implement a version that snaps multiple windows in a desktop style situation.
\todo a version that takes snapshots of a range of menu items
\todo implement FL_SNAP_TO_GROUP, possibly with a number on how many groups up in the hierarchy
*/
/** \addtogroup fl_drawings
@{
*/
const int FL_SNAP_TO_WINDOW = 0x01000000;
static Fl_Box snap_clear_(0, 0, 0, 0);
Fl_Widget *FL_SNAP_AREA_CLEAR = &snap_clear_;
static inline int fl_min(int a, int b) { return a < b ? a : b; }
static inline uchar fl_min(uchar a, uchar b) { return a < b ? a : b; }
static inline int fl_max(int a, int b) { return a > b ? a : b; }
/**
Create a rect by providing a margin around a zero size rectangle.
\param[in] dx, dy positive integers, move margin up and left
\param[in] dr, db move margin to the right and down
*/
Fl_Margin::Fl_Margin(int dx, int dy, int dr, int db)
: Fl_Rect(-dx, -dy, dx+dr, dy+db)
{
}
/**
Convert an RGB image into an RGBA image.
\param[inout] image pointer to an RGB image, deletes the RGB image, returns the RGBA image
\return 0 if the image is now in RGBA format, or -1 if it can't be converted
*/
static int convert_RGB_to_RGBA(Fl_RGB_Image *&img) {
if (img->d() == 4)
return 0;
if (img->d() != 3)
return -1;
// Copy pixel data from RGB to RGBA raw data
int img_w = img->w();
int img_h = img->h();
uchar *data = new uchar[img_w * img_h * 4], *dst = data;
int ld = img->ld(); if (ld == 0) ld = img_w * 3;
int i, j;
for (i=0; i<img_h; i++) {
const uchar *src = (const uchar*)img->data()[0] + i * ld;
for (j=0; j<img_w; j++) {
*dst++ = *src++;
*dst++ = *src++;
*dst++ = *src++;
*dst++ = 255;
}
}
// Delete the old image
delete img;
// Create the new image
img = new Fl_RGB_Image(data, img_w, img_h, 4);
img->alloc_array = 1;
return 0;
}
/**
Blend the left side lines of the alpha channel of an RBGA image to full transparency.
\param[in] img must be an RGBA image
\param[in] dx number of lines to blend
*/
void blend_alpha_left(const Fl_RGB_Image *img, int dx) {
if (img->d() != 4)
return;
if (dx > img->w())
return;
if (dx > 0) {
int max_x = dx, max_y = img->h();
int ld = img->ld(); if (ld == 0) ld = img->w() * img->d();
float a = 255.0f/static_cast<float>(max_x);
for (int i = 0; i < max_x; i++) {
uchar *rgba = (uchar*)img->data()[0] + i * img->d();
uchar alpha = static_cast<uchar>(i * a);
for (int j = 0; j < max_y; j++) {
rgba[3] = fl_min(alpha, rgba[3]);
rgba += ld;
}
}
}
}
/**
Blend the top lines of the alpha channel of an RBGA image to full transparency.
\param[in] img must be an RGBA image
\param[in] dy number of lines to blend
*/
void blend_alpha_top(const Fl_RGB_Image *img, int dy) {
if (img->d() != 4)
return;
if (dy > img->h())
return;
if (dy > 0) {
int max_x = img->w(), max_y = dy;
int ld = img->ld(); if (ld == 0) ld = img->w() * img->d();
float a = 255.0f/static_cast<float>(max_y);
for (int i = 0; i < max_y; i++) {
uchar *rgba = (uchar*)img->data()[0] + i * ld;
uchar alpha = static_cast<uchar>(i * a);
for (int j = 0; j < max_x; j++) {
rgba[3] = fl_min(alpha, rgba[3]);
rgba += 4;
}
}
}
}
/**
Blend the right side lines of the alpha channel of an RBGA image to full transparency.
\param[in] img must be an RGBA image
\param[in] dx number of lines to blend
*/
void blend_alpha_right(const Fl_RGB_Image *img, int dx) {
if (img->d() != 4)
return;
if (dx > img->w())
return;
if (dx > 0) {
int max_x = dx, max_y = img->h();
int ld = img->ld(); if (ld == 0) ld = img->w() * img->d();
float a = 255.0f/static_cast<float>(max_x);
for (int i = 0; i < max_x; i++) {
uchar *rgba = (uchar*)img->data()[0] + (img->w()-i-1) * img->d();
uchar alpha = static_cast<uchar>(i * a);
for (int j = 0; j < max_y; j++) {
rgba[3] = fl_min(alpha, rgba[3]);
rgba += ld;
}
}
}
}
/**
Blend the bottom lines of the alpha channel of an RBGA image to full transparency.
\param[in] img must be an RGBA image
\param[in] dy number of lines to blend
*/
void blend_alpha_bottom(const Fl_RGB_Image *img, int dy) {
if (img->d() != 4)
return;
if (dy > img->h())
return;
if (dy > 0) {
int max_x = img->w(), max_y = dy;
int ld = img->ld(); if (ld == 0) ld = img->w() * img->d();
float a = 255.0f/static_cast<float>(max_y);
for (int i = 0; i < max_y; i++) {
uchar *rgba = (uchar*)img->data()[0] + (img->h()-i-1) * ld;
uchar alpha = static_cast<uchar>(i * a);
for (int j = 0; j < max_x; j++) {
rgba[3] = fl_min(alpha, rgba[3]);
rgba += 4;
}
}
}
}
/**
Take a snapshot of a number of widgets and save it as a png image.
Draw a rectangular snapshot that fits around all widgets inside a window.
All widgets must be inside the same window. It's up to the caller to ensure
that widgets are visible. This includes children of `Fl_Tabs`.
Outside labels of widgets are not taken into account, but a `frame` can be
provided to grow the snapshot rectangle. Setting individual parameters of the
frame to `FL_SNAP_TO_WINDOW` will extend the snapshot to the borders of the
top level window.
Another `blend` frame can be added around the image that fades to full
transparency on selected sides.
Use `Fl_Margin` to create `frame` and `blend` using positive integers to grow
the rectangle to the left, top, right, and bottom.
The image can be scaled after all processing. Note that snapshot is always
created in FLTK resolution, even if the screen uses a higher resolution.
\param[in] filename the snapshot will be written to this file in png format
\param[in] w draw a bounding box around all widgets in the NULL terminated list
\param[in] frame add a margin around the bounding box
\param[in] blend add another margin around the bounding box that fades to full transparency
\param[in] scale scale everything by this factor before saving it
\return the result of fl_write_png or -3 if another error occurred
*/
int fl_snapshot(const char *filename, Fl_Widget **w,
const Fl_Rect &frame,
const Fl_Rect &blend,
double scale)
{
int i, min_x = 0, min_y = 0, max_x = 0, max_y = 0, bb_w, bb_h, img_w, img_h;
// Get the bounding box for all widgets and make sure that all widgets are shown
for (i=0; w[i]; i++) {
int x, y;
Fl_Widget *ww = w[i];
if (ww == FL_SNAP_AREA_CLEAR) {
min_x = max_x = 0;
min_y = max_y = 0;
} else {
ww->top_window_offset(x, y);
if (i==0) {
min_x = x; max_x = x + ww->w();
min_y = y; max_y = y + ww->h();
} else {
min_x = fl_min(min_x, x); max_x = fl_max(max_x, x + ww->w());
min_y = fl_min(min_y, y); max_y = fl_max(max_y, y + ww->h());
}
}
// this does not help us with Fl_Tab groups
while (ww) { ww->show(); ww = ww->parent(); }
}
// Check for special values in frame and adjust bounding box
Fl_Rect c_frame = frame;
if (frame.x() == -FL_SNAP_TO_WINDOW) c_frame.x(-min_x);
if (frame.y() == -FL_SNAP_TO_WINDOW) c_frame.y(-min_y);
if (frame.r() == FL_SNAP_TO_WINDOW) c_frame.r(w[0]->top_window()->w()-max_x);
if (frame.b() == FL_SNAP_TO_WINDOW) c_frame.b(w[0]->top_window()->h()-max_y);
min_x += c_frame.x(); max_x += c_frame.r();
min_y += c_frame.y(); max_y += c_frame.b();
bb_w = max_x - min_x; bb_h = max_y - min_y;
img_w = bb_w + blend.w();
img_h = bb_h + blend.h();
// Generate the Image Surface
Fl_Image_Surface *srfc = new Fl_Image_Surface(img_w, img_h);
Fl_Image_Surface::push_current(srfc);
// Draw the background
fl_rectf(0, 0, img_w, img_h, 0x1395bf00);
// Draw the top level window
srfc->draw(w[0]->top_window(), -blend.x()-min_x, -blend.y()-min_y);
Fl_Image_Surface::pop_current();
Fl_RGB_Image *img = srfc->image();
// Do we want an alpha blended extension of the frame?
if ((blend.x()<0 || blend.y()<0 || blend.r()>0 || blend.b()>0)) {
if (convert_RGB_to_RGBA(img) == -1) {
delete img;
delete srfc;
return -3;
}
if (blend.x() < 0) blend_alpha_left(img, -blend.x());
if (blend.y() < 0) blend_alpha_top(img, -blend.y());
if (blend.r() > 0) blend_alpha_right(img, blend.r());
if (blend.b() > 0) blend_alpha_bottom(img, blend.b());
}
// If scale is set, scale the image
if (scale != 1.0) {
Fl_Image::scaling_algorithm(FL_RGB_SCALING_BILINEAR);
int scaled_img_w = static_cast<int>(img->w()*scale);
int scaled_img_h = static_cast<int>(img->h()*scale);
Fl_RGB_Image *scaled_img =
static_cast<Fl_RGB_Image*>(img->copy(scaled_img_w, scaled_img_h));
delete img;
img = scaled_img;
}
// Write the image to disk
int ret = fl_write_png(filename, img);
// Clean up
delete img;
delete srfc;
return ret;
}
/**
Take a snapshot of the size of the bounding box around two widgets and save it as a png image.
\param[in] filename the snapshot will be written to this file in png format
\param[in] w1, w2 top left and bottom right widget
\param[in] frame add a margin around the bounding box
\param[in] blend add another margin around the bounding box that fades to full transparency
\param[in] scale scale everything by this factor before saving it
\return the result of fl_write_png or -3 if another error occurred
\see fl_snapshot(const char*, Fl_Widget**, const Fl_Rect&, const Fl_Rect&, double)
*/
int fl_snapshot(const char *filename, Fl_Widget *w1, Fl_Widget *w2,
const Fl_Rect &frame,
const Fl_Rect &blend,
double scale)
{
Fl_Widget *ww[3] = { w1, w2, NULL };
return fl_snapshot(filename, ww, frame, blend, scale);
}
/**
Take a snapshot of a widget inside its window and save it as a png image.
\param[in] filename the snapshot will be written to this file in png format
\param[in] w snap this window, can also be a groups
\param[in] frame add a margin around the bounding box
\param[in] blend add another margin around the bounding box that fades to full transparency
\param[in] scale scale everything by this factor before saving it
\return the result of fl_write_png or -3 if another error occurred
\see fl_snapshot(const char*, Fl_Widget**, const Fl_Rect&, const Fl_Rect&, double)
*/
int fl_snapshot(const char *filename, Fl_Widget *w,
const Fl_Rect &frame,
const Fl_Rect &blend,
double scale)
{
Fl_Widget *ww[2] = { w, NULL };
return fl_snapshot(filename, ww, frame, blend, scale);
}
/** @} */
void run_autodoc(const Fl_String &target_dir) {
// A list of all the margins we will use later
Fl_Margin win_margin(0, 0, 0, 0);
Fl_Margin win_blend(10, 10, 10, 10);
Fl_Margin tab_margin(FL_SNAP_TO_WINDOW, 32, FL_SNAP_TO_WINDOW, 4);
Fl_Margin xtab_margin(FL_SNAP_TO_WINDOW, 50, FL_SNAP_TO_WINDOW, 4);
Fl_Margin row_margin(FL_SNAP_TO_WINDOW, 4, FL_SNAP_TO_WINDOW, 4);
Fl_Margin xrow_margin(FL_SNAP_TO_WINDOW, 14, FL_SNAP_TO_WINDOW, 4);
Fl_Margin row_blend(0, 10, 0, 10);
// Fl::scheme("gtk+");
// Create a silly project that contains all widgets that we want to document
new_project(false);
/*Fl_Type *t_func = */ add_new_widget_from_user("Function", kAddAsLastChild, false);
Fl_Window_Type *t_win = (Fl_Window_Type*)add_new_widget_from_user("Fl_Window", kAddAsLastChild, false);
t_win->label("My Main Window");
Fl_Widget_Type *t_grp = (Fl_Widget_Type*)add_new_widget_from_user("Fl_Group", kAddAsLastChild, false);
t_grp->public_ = 0;
Fl_Widget_Type *t_btn = (Fl_Widget_Type*)add_new_widget_from_user("Fl_Button", kAddAsLastChild, false);
t_btn->comment("Don't press this button!");
t_btn->name("emergency_btn");
((Fl_Button*)t_btn->o)->shortcut(FL_COMMAND|'g');
Fl_Type *t_sldr = add_new_widget_from_user("Fl_Slider", kAddAsLastChild, false);
Fl_Type *t_inp = add_new_widget_from_user("Fl_Input", kAddAsLastChild, false);
Fl_Type *t_flx = add_new_widget_from_user("Fl_Flex", kAddAsLastChild, false);
Fl_Type *t_flxc = add_new_widget_from_user("Fl_Button", kAddAsLastChild, false);
select_only(t_grp);
Fl_Type *t_grd = add_new_widget_from_user("Fl_Grid", kAddAsLastChild, false);
Fl_Type *t_grdc = add_new_widget_from_user("Fl_Button", kAddAsLastChild, false);
widget_browser->rebuild();
g_project.update_settings_dialog();
// TODO: FLUID overview
// TODO: explain FLUID command line usage
// TODO: take a snapshot of FLUID in a desktop situation
// (main, toolbar, document, widget editor, code view)
// ---- main window
// explain titlebar
// explain menubar?
// explain widget browser
// explain widget browser entry
main_window->size(350, 320);
fl_snapshot((target_dir + "main_window.png").c_str(), main_window, win_margin, win_blend);
fl_snapshot((target_dir + "main_menubar.png").c_str(), main_menubar, row_margin, row_blend);
fl_snapshot((target_dir + "main_browser.png").c_str(), widget_browser, FL_SNAP_AREA_CLEAR,
Fl_Rect(0, 30, FL_SNAP_TO_WINDOW, 100), row_blend, 2.0);
// TODO: document view
// explain dnd
// explain selection, multiple selection, keyboard shortcuts
// explain mouse functionality and alignment
// explain live resize
// arrow: move by 1
// shift: resize by one
// Meta: move by Widget Gap
// Shift Meta: resize by Widget Increment
// ---- widget bin
// show grouping
// explain non-widget types and where they will be located
// explain widgets types an their dnd option
// explain menu arrays
// list exceptions (subwindow, scroll)
Fl::wait(0.2);
Fl::flush();
fl_snapshot((target_dir + "widgetbin_panel.png").c_str(), widgetbin_panel, win_margin, win_blend);
// ---- code view
// explain functionality
// explain live update and choices
// show various tabs
// explain find and locate
if (!codeview_panel) make_codeview();
codeview_panel->show();
Fl::wait(0.2);
Fl::flush();
update_codeview_cb(NULL, NULL); // must be visible on screen for this to work
cv_tab->value(cv_source_tab);
codeview_panel->redraw();
Fl::flush();
fl_snapshot((target_dir + "codeview_panel.png").c_str(), codeview_panel, win_margin, win_blend);
fl_snapshot((target_dir + "cv_find_row.png").c_str(), cv_find_row, row_margin, row_blend);
fl_snapshot((target_dir + "cv_settings_row.png").c_str(), cv_settings_row, row_margin, row_blend);
// ---- settings dialog
// show and explain all tabs
fl_snapshot((target_dir + "w_settings.png").c_str(), settings_window, win_margin, win_blend);
fl_snapshot((target_dir + "w_settings_general_tab.png").c_str(), w_settings_general_tab, xtab_margin, row_blend);
w_settings_tabs->value(w_settings_project_tab);
fl_snapshot((target_dir + "w_settings_project_tab.png").c_str(), w_settings_project_tab, xtab_margin, row_blend);
w_settings_tabs->value(w_settings_layout_tab);
fl_snapshot((target_dir + "w_settings_layout_tab.png").c_str(), w_settings_layout_tab, xtab_margin, row_blend);
w_settings_tabs->value(w_settings_shell_tab);
w_settings_shell_list->value(1);
w_settings_shell_list->do_callback();
fl_snapshot((target_dir + "w_settings_shell_tab.png").c_str(), w_settings_shell_tab, xtab_margin, row_blend);
w_settings_tabs->value(w_settings_i18n_tab);
i18n_type_chooser->value(1);
i18n_type_chooser->do_callback();
fl_snapshot((target_dir + "w_settings_i18n_gnu.png").c_str(), i18n_type_chooser, i18n_gnu_static_function_input, row_margin, row_blend);
i18n_type_chooser->value(2);
i18n_type_chooser->do_callback();
fl_snapshot((target_dir + "w_settings_i18n_psx.png").c_str(), i18n_type_chooser, i18n_pos_set_input, row_margin, row_blend);
w_settings_tabs->value(w_settings_user_tab);
fl_snapshot((target_dir + "w_settings_user_tab.png").c_str(), w_settings_user_tab, xtab_margin, row_blend);
// ---- dialog types
// list and show all non-widget types and their respective dialog boxes
// -- ID_Function
Fl_Window *adoc_function_panel = make_function_panel();
f_name_input->value("count_trees(const char *forest_name)");
f_return_type_input->value("unsigned int");
fl_snapshot((target_dir + "function_panel.png").c_str(), adoc_function_panel, win_margin, win_blend);
adoc_function_panel->hide();
// -- ID_Code
Fl_Window *adoc_code_panel = make_code_panel();
code_input->buffer()->text("// increment user count\nif (new_user) {\n user_count++;\n}\n");
fl_snapshot((target_dir + "code_panel.png").c_str(), adoc_code_panel, win_margin, win_blend);
adoc_code_panel->hide();
// -- ID_CodeBlock
Fl_Window *adoc_codeblock_panel = make_codeblock_panel();
code_before_input->value("if (test())");
code_after_input->value("// test widgets added...");
fl_snapshot((target_dir + "codeblock_panel.png").c_str(), adoc_codeblock_panel, win_margin, win_blend);
adoc_codeblock_panel->hide();
// -- ID_Decl
Fl_Window *adoc_decl_panel = make_decl_panel();
decl_class_choice->hide();
decl_input->buffer()->text("const char *damage = \"'tis but a scratch\";");
fl_snapshot((target_dir + "decl_panel.png").c_str(), adoc_decl_panel, win_margin, win_blend);
adoc_decl_panel->hide();
// -- ID_DeclBlock
Fl_Window *adoc_declblock_panel = make_declblock_panel();
declblock_before_input->value("#ifdef NDEBUG");
declblock_after_input->value("#endif // NDEBUG");
fl_snapshot((target_dir + "declblock_panel.png").c_str(), adoc_declblock_panel, win_margin, win_blend);
adoc_declblock_panel->hide();
// -- ID_Class
Fl_Window *adoc_class_panel = make_class_panel();
decl_class_choice->hide();
c_name_input->value("Zoo_Giraffe");
c_subclass_input->value("Zoo_Animal");
fl_snapshot((target_dir + "class_panel.png").c_str(), adoc_class_panel, win_margin, win_blend);
adoc_class_panel->hide();
// -- ID_Widget_Class is handled like Fl_Window_Type
// -- ID_Comment
Fl_Window *adoc_comment_panel = make_comment_panel();
comment_input->buffer()->text("Make sure that the giraffe gets enough hay,\nbut the monkey can't reach it.");
fl_snapshot((target_dir + "comment_panel.png").c_str(), adoc_comment_panel, win_margin, win_blend);
adoc_comment_panel->hide();
// -- ID_Data
Fl_Window *adoc_data_panel = make_data_panel();
data_class_choice->hide();
data_input->value("emulated_ROM");
data_filename->value("./ROM.bin");
fl_snapshot((target_dir + "data_panel.png").c_str(), adoc_data_panel, win_margin, win_blend);
adoc_data_panel->hide();
// ---- widget dialog
t_win->open(); // open the window
t_win->open(); // open the panel
select_only(t_win);
// -- snapshot of the widget properties panel
fl_snapshot((target_dir + "widget_panel.png").c_str(), the_panel, win_margin, win_blend);
fl_snapshot((target_dir + "wLiveMode.png").c_str(), wLiveMode, row_margin, row_blend);
// -- snapshot of the GUI tab
widget_tabs->value(wp_gui_tab);
fl_snapshot((target_dir + "wp_gui_tab.png").c_str(), wp_gui_tab, tab_margin, row_blend);
fl_snapshot((target_dir + "wp_gui_label.png").c_str(), wp_gui_label, row_margin, row_blend);
select_only(t_btn);
fl_snapshot((target_dir + "wp_gui_image.png").c_str(), widget_image_input, widget_deimage_input, row_margin, row_blend);
fl_snapshot((target_dir + "wp_gui_alignment.png").c_str(), wp_gui_alignment, row_margin, row_blend);
fl_snapshot((target_dir + "wp_gui_size.png").c_str(), widget_x_input, xrow_margin, row_blend);
select_only(t_sldr);
fl_snapshot((target_dir + "wp_gui_values.png").c_str(), wp_gui_values, xrow_margin, row_blend);
select_only(t_flxc);
fl_snapshot((target_dir + "wp_gui_flexp.png").c_str(), wp_gui_flexp, xrow_margin, row_blend);
select_only(t_flx);
fl_snapshot((target_dir + "wp_gui_margins.png").c_str(), wp_gui_margins, xrow_margin, row_blend);
select_only(t_win);
fl_snapshot((target_dir + "wp_gui_sizerange.png").c_str(), wp_gui_sizerange, xrow_margin, row_blend);
select_only(t_btn);
fl_snapshot((target_dir + "wp_gui_shortcut.png").c_str(), wp_gui_shortcut, row_margin, row_blend);
select_only(t_win);
fl_snapshot((target_dir + "wp_gui_xclass.png").c_str(), wp_gui_xclass, row_margin, row_blend);
select_only(t_btn);
fl_snapshot((target_dir + "wp_gui_attributes.png").c_str(), wp_gui_attributes, row_margin, row_blend);
fl_snapshot((target_dir + "wp_gui_tooltip.png").c_str(), wp_gui_tooltip, row_margin, row_blend);
// -- snapshot of the style tab
widget_tabs->value(wp_style_tab);
select_only(t_inp);
fl_snapshot((target_dir + "wp_style_tab.png").c_str(), wp_style_tab, tab_margin, row_blend);
fl_snapshot((target_dir + "wp_style_label.png").c_str(), wp_style_label, row_margin, row_blend);
select_only(t_btn);
fl_snapshot((target_dir + "wp_style_box.png").c_str(), wp_style_box, wp_style_downbox, row_margin, row_blend);
select_only(t_inp);
fl_snapshot((target_dir + "wp_style_text.png").c_str(), wp_style_text, row_margin, row_blend);
// -- snapshot of the C++ tab
widget_tabs->value(wp_cpp_tab);
select_only(t_btn);
fl_snapshot((target_dir + "wp_cpp_tab.png").c_str(), wp_cpp_tab, tab_margin, row_blend);
fl_snapshot((target_dir + "wp_cpp_class.png").c_str(), wp_cpp_class, row_margin, row_blend);
fl_snapshot((target_dir + "wp_cpp_name.png").c_str(), wp_cpp_name, row_margin, row_blend);
fl_snapshot((target_dir + "v_input.png").c_str(), v_input[0], v_input[3], row_margin, row_blend);
fl_snapshot((target_dir + "wComment.png").c_str(), wComment, row_margin, row_blend);
fl_snapshot((target_dir + "wp_cpp_callback.png").c_str(), wCallback, w_when_box, row_margin, row_blend);
// -- snapshot of the Grid tab
select_only(t_grd);
widget_tabs->value(widget_tab_grid);
fl_snapshot((target_dir + "wp_grid_tab.png").c_str(), widget_tab_grid, tab_margin, row_blend);
// -- snapshot of the Grid Child tab
select_only(t_grdc);
widget_tabs->value(widget_tab_grid_child);
fl_snapshot((target_dir + "wp_gridc_tab.png").c_str(), widget_tab_grid_child, tab_margin, row_blend);
}
#endif // NDEBUG