1 // paramspecial.h
2 // LiVES
3 // (c) G. Finch 2004 - 2020 <salsaman+lives@gmail.com>
4 // released under the GNU GPL 3 or later
5 // see file ../COPYING or www.gnu.org for licensing details
6 
7 // dynamic window generation from parameter arrays :-)
8 // special widgets
9 
10 // TODO - refactor all of this using lives_special_t, use a union
11 
12 #ifndef HAS_LIVES_PARAMSPECIAL_H
13 #define HAS_LIVES_PARAMSPECIAL_H
14 
15 typedef struct {
16   lives_rfx_t *rfx;
17   boolean added;
18   lives_param_special_t type;
19   lives_param_t *xstart_param;
20   lives_param_t *ystart_param;
21   lives_param_t *scale_param;
22   lives_param_t *xend_param;
23   lives_param_t *yend_param;
24 
25   int stdwidgets; // 2 for singlepoint, 3 for scaledpoint, 4 for demask, multirect
26   int *extra_params;
27   int num_extra;
28   LiVESWidget **extra_widgets;
29 } lives_special_framedraw_rect_t;
30 
31 typedef struct {
32   lives_param_t *height_param;
33   lives_param_t *width_param;
34   LiVESWidget *lockbutton;
35   ulong width_func;
36   ulong height_func;
37   double ratio;
38   int nwidgets;
39   boolean no_reset;
40 } lives_special_aspect_t;
41 
42 typedef struct {
43   lives_param_t *font_param;
44   lives_param_t *size_param;
45   ulong size_paramfunc;
46   ulong entry_func;
47   int nwidgets;
48 } lives_special_fontchooser_t;
49 
50 typedef struct {
51   lives_rfx_t *rfx;
52   lives_param_t *start_param;
53   lives_param_t *end_param;
54 } lives_special_mergealign_t;
55 
56 ////////////////////////////////
57 
58 #define ASPECT_BUTTON_WIDTH ((int)(250. * widget_opts.scale))
59 #define ASPECT_BUTTON_HEIGHT DEF_BUTTON_HEIGHT
60 
61 #define WEED_LEAF_HOST_VALUE_SPECIAL "host_valspec"
62 #define LIVES_VALUE_LETTERBOX_OFFSX (1 << 0) // def val. == param_max * lb_offs_x / width
63 #define LIVES_VALUE_LETTERBOX_OFFSY (1 << 1)
64 #define LIVES_VALUE_LETTERBOX_WIDTH (1 << 2) // def val == param_max * lb_width / width
65 #define LIVES_VALUE_LETTERBOX_HEIGHT (1 << 3)
66 
67 #include "multitrack.h"
68 
69 void init_special(void);
70 
71 void add_to_special(const char *special_string, lives_rfx_t *);
72 
73 void check_for_special(lives_rfx_t *, lives_param_t *param, LiVESBox *);
74 void check_for_special_type(lives_rfx_t *rfx, lives_param_t *param, LiVESBox *pbox);
75 
76 void reset_framedraw_preview(void);
77 
78 void fd_connect_spinbutton(lives_rfx_t *);
79 
80 void fd_tweak(lives_rfx_t *);
81 
82 void after_aspect_width_changed(LiVESSpinButton *, livespointer);
83 
84 void after_aspect_height_changed(LiVESToggleButton *, livespointer);
85 
86 const lives_special_aspect_t *paramspecial_get_aspect(void);
87 
88 boolean check_filewrite_overwrites(void);
89 
90 boolean special_cleanup(boolean is_ok);
91 
92 void setmergealign(void);
93 
94 void set_aspect_ratio_widgets(lives_param_t *w, lives_param_t *h);
95 
96 boolean is_perchannel_multi(lives_rfx_t *rfx, int pnum);
97 
98 LiVESPixbuf *mt_framedraw(lives_mt *, weed_layer_t *layer);
99 
100 lives_special_mergealign_t mergealign;
101 
102 #endif
103