LiVES 3.2.0
rfx-builder.h
Go to the documentation of this file.
1// rfx-builder.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#ifndef HAS_LIVES_RFX_BUILDER_H
8#define HAS_LIVES_RFX_BUILDER_H
9
10#define EXEC_RFX_BUILDER "build-lives-rfx-plugin"
11
13#define RFX_VERSION "1.8.3"
14
16#define EXEC_RFX_BUILDER_MULTI "build-lives-rfx-plugin-multi"
17
19#define RFXBUILDER_SCRIPT_SUFFIX "script"
20
22#define MAXFLOATLEN 11
23
25#define MAXINTLEN strlen(lives_strdup_printf("%d", LIVES_MAXINT))
26
27// advanced menu entries
28void on_new_rfx_activate(LiVESMenuItem *, livespointer status);
29void on_edit_rfx_activate(LiVESMenuItem *, livespointer status);
30void on_copy_rfx_activate(LiVESMenuItem *, livespointer);
31void on_rename_rfx_activate(LiVESMenuItem *, livespointer);
32void on_delete_rfx_activate(LiVESMenuItem *, livespointer status);
33void on_rebuild_rfx_activate(LiVESMenuItem *, livespointer);
34void on_promote_rfx_activate(LiVESMenuItem *, livespointer);
35void on_import_rfx_activate(LiVESMenuItem *, livespointer status);
36void on_export_rfx_activate(LiVESMenuItem *, livespointer status);
37
38// the builder window
39
41#define RFXBUILD_MAX_REQ 128
42
44#define RFXBUILD_MAX_PARAMS 32
45
47#define RFXBUILD_MAX_PARAMW_HINTS 512
48
51#define RFXBUILD_MAX_TROWS 512
52
53#define PREF_RFXDIALOG_W ((int)(720.*widget_opts.scale))
54#define PREF_RFXDIALOG_H ((int)(650.*widget_opts.scale))
55
56#define RFX_LOADED (mainw->helper_procthreads[PT_LAZY_RFX] ? \
57 lives_proc_thread_check(mainw->helper_procthreads[PT_LAZY_RFX]) : FALSE)
58
60#define RFXBUILD_MAX_DP 16
61typedef struct {
62 int when;
63 char *code;
65
66typedef enum {
73
74typedef enum {
80
81typedef enum {
88
89typedef enum {
94
95typedef struct {
97
98 LiVESWidget *dialog;
99 LiVESWidget *name_entry;
100 LiVESWidget *spinbutton_version;
101 LiVESWidget *author_entry;
102 LiVESWidget *url_entry;
103 LiVESWidget *menu_text_entry;
104 LiVESWidget *action_desc_hbox;
105 LiVESWidget *action_desc_entry;
106 LiVESWidget *action_desc_hsep;
113 LiVESWidget *langc_combo;
114 LiVESWidget *table;
116 LiVESWidget *properties_button;
117 LiVESWidget *params_button;
119 LiVESWidget *pre_button;
120 LiVESWidget *loop_button;
121 LiVESWidget *post_button;
122 LiVESWidget *trigger_button;
123 LiVESWidget *prop_slow;
124 LiVESWidget *prop_batchg;
125 LiVESWidget *hbox_batchg;
126 LiVESWidget *min_frames_label;
127
129
131
133
134 LiVESWidget *entry[RFXBUILD_MAX_TROWS];
135 LiVESWidget *entry2[RFXBUILD_MAX_TROWS];
136 LiVESWidget *entry3[RFXBUILD_MAX_TROWS];
137 LiVESWidget *param_dialog;
138 LiVESWidget *param_name_entry;
139 LiVESWidget *param_label_entry;
140 LiVESWidget *param_type_combo;
141 LiVESWidget *param_dp_label;
142 LiVESWidget *param_def_label;
143 LiVESWidget *param_min_label;
144 LiVESWidget *param_max_label;
145 LiVESWidget *param_step_label;
146 LiVESWidget *param_wrap_hbox;
148 LiVESWidget *param_strlist_hbox;
149 LiVESWidget *param_def_combo;
150 LiVESWidget *paramw_rest_entry;
151 LiVESWidget *paramw_kw_combo;
152 LiVESWidget *paramw_sp_combo;
153 LiVESWidget *paramw_spsub_combo;
154 LiVESWidget *paramw_rest_label;
155 LiVESWidget *hbox_bg;
157 LiVESWidget *param_strdef_hbox;
158 LiVESWidget *trigger_when_entry;
165 LiVESWidget *code_textview;
166 LiVESWidget *new_entry_button;
167 LiVESWidget *edit_entry_button;
169 LiVESWidget *move_up_button;
170 LiVESWidget *move_down_button;
171
172 uint32_t props;
173
174 char *pre_code;
177
179
180 char *reqs[RFXBUILD_MAX_REQ];
183
188
189 char *paramw_hints[RFXBUILD_MAX_PARAMS];
192
197
199
201
203
206
208 char *oname;
209
214
218
219// fileselectors
220void on_export_rfx_ok(LiVESButton *, char *script_name);
221void on_import_rfx_ok(LiVESButton *, livespointer status);
222
226void update_rfx_menus(void);
227
228// utility functions
229char *prompt_for_script_name(const char *sname, lives_rfx_status_t status);
230boolean check_builder_programs(void);
231LiVESList *get_script_list(lives_rfx_status_t status);
232
234boolean perform_param_checks(rfx_build_window_t *, int index, int rows);
235
236// read/write script files
238boolean script_to_rfxbuilder(rfx_build_window_t *, const char *script_file);
239
240LiVESList *get_script_section(const char *section, const char *script_file, boolean strip);
241
242#endif // HAS_LIVES_RFX_BUILDER_H
#define ulong
Definition: main.h:178
lives_rfx_status_t
Definition: plugins.h:611
void on_rename_rfx_activate(LiVESMenuItem *, livespointer)
Definition: rfx-builder.c:109
#define RFXBUILD_MAX_REQ
maximum requirements
Definition: rfx-builder.h:41
boolean script_to_rfxbuilder(rfx_build_window_t *, const char *script_file)
Definition: rfx-builder.c:3279
lives_rfx_build_type_t
Definition: rfx-builder.h:66
@ RFX_BUILD_TYPE_EFFECT1
Definition: rfx-builder.h:67
@ RFX_BUILD_TYPE_UTILITY
Definition: rfx-builder.h:71
@ RFX_BUILD_TYPE_EFFECT0
Definition: rfx-builder.h:69
@ RFX_BUILD_TYPE_EFFECT2
Definition: rfx-builder.h:68
@ RFX_BUILD_TYPE_TOOL
Definition: rfx-builder.h:70
#define RFXBUILD_MAX_TROWS
max table rows : this should be set to the largest of the previous maxima
Definition: rfx-builder.h:51
char * prompt_for_script_name(const char *sname, lives_rfx_status_t status)
Definition: rfx-builder.c:3920
void on_new_rfx_activate(LiVESMenuItem *, livespointer status)
Definition: rfx-builder.c:62
void on_import_rfx_ok(LiVESButton *, livespointer status)
void on_export_rfx_ok(LiVESButton *, char *script_name)
void on_delete_rfx_activate(LiVESMenuItem *, livespointer status)
Definition: rfx-builder.c:3699
LiVESList * get_script_list(lives_rfx_status_t status)
Definition: rfx-builder.c:4150
boolean perform_rfxbuilder_checks(rfx_build_window_t *)
Definition: rfx-builder.c:2872
LiVESList * get_script_section(const char *section, const char *script_file, boolean strip)
Definition: rfx-builder.c:3611
lives_rfx_builder_mode_t
Definition: rfx-builder.h:89
@ RFX_BUILDER_MODE_EDIT
Definition: rfx-builder.h:91
@ RFX_BUILDER_MODE_COPY
Definition: rfx-builder.h:92
@ RFX_BUILDER_MODE_NEW
Definition: rfx-builder.h:90
void on_import_rfx_activate(LiVESMenuItem *, livespointer status)
Definition: rfx-builder.c:3849
boolean perform_param_checks(rfx_build_window_t *, int index, int rows)
Definition: rfx-builder.c:2933
void on_promote_rfx_activate(LiVESMenuItem *, livespointer)
Definition: rfx-builder.c:3759
void add_rfx_effects(lives_rfx_status_t status)
add dynamic menu entries
Definition: rfx-builder.c:4172
boolean rfxbuilder_to_script(rfx_build_window_t *)
Definition: rfx-builder.c:2952
lives_rfx_table_type_t
Definition: rfx-builder.h:74
@ RFX_TABLE_TYPE_PARAM_WINDOW
Definition: rfx-builder.h:78
@ RFX_TABLE_TYPE_PARAMS
Definition: rfx-builder.h:76
@ RFX_TABLE_TYPE_TRIGGERS
Definition: rfx-builder.h:77
@ RFX_TABLE_TYPE_REQUIREMENTS
Definition: rfx-builder.h:75
boolean check_builder_programs(void)
Definition: rfx-builder.c:3668
void on_copy_rfx_activate(LiVESMenuItem *, livespointer)
Definition: rfx-builder.c:95
void on_edit_rfx_activate(LiVESMenuItem *, livespointer status)
Definition: rfx-builder.c:71
#define RFXBUILD_MAX_PARAMS
maximum parameters
Definition: rfx-builder.h:44
void on_export_rfx_activate(LiVESMenuItem *, livespointer status)
Definition: rfx-builder.c:3821
void update_rfx_menus(void)
Definition: rfx-builder.c:4684
void add_rfx_effects2(lives_rfx_status_t status)
Definition: rfx-builder.c:4481
void on_rebuild_rfx_activate(LiVESMenuItem *, livespointer)
parse text and return non empty lines between <section> and </section>
Definition: rfx-builder.c:3631
lives_rfx_code_type_t
Definition: rfx-builder.h:81
@ RFX_CODE_TYPE_STRDEF
Definition: rfx-builder.h:85
@ RFX_CODE_TYPE_PRE
Definition: rfx-builder.h:82
@ RFX_CODE_TYPE_LOOP
Definition: rfx-builder.h:83
@ RFX_CODE_TYPE_STRING_LIST
Definition: rfx-builder.h:86
@ RFX_CODE_TYPE_POST
Definition: rfx-builder.h:84
LiVESWidget * spinbutton_param_min
Definition: rfx-builder.h:162
rfx_trigger_t * triggers
Definition: rfx-builder.h:193
lives_rfx_builder_mode_t mode
Definition: rfx-builder.h:202
LiVESWidget * edit_entry_button
Definition: rfx-builder.h:167
lives_rfx_build_type_t type
Definition: rfx-builder.h:96
LiVESWidget * param_max_label
Definition: rfx-builder.h:144
LiVESWidget * move_up_button
Definition: rfx-builder.h:169
LiVESWidget * param_strdef_button
Definition: rfx-builder.h:156
LiVESWidget * action_desc_entry
Definition: rfx-builder.h:105
int num_triggers
upper limit is RFXBUILD_MAX_PARAMS, 0 == init
Definition: rfx-builder.h:195
LiVESWidget * paramw_spsub_combo
Definition: rfx-builder.h:153
LiVESWidget * loop_button
Definition: rfx-builder.h:120
LiVESWidget * spinbutton_param_def
Definition: rfx-builder.h:161
boolean has_init_trigger
Definition: rfx-builder.h:198
LiVESWidget * min_frames_label
Definition: rfx-builder.h:126
lives_param_t * copy_params
store our parameters while editing
Definition: rfx-builder.h:185
LiVESWidget * paramw_sp_combo
Definition: rfx-builder.h:152
LiVESWidget * move_down_button
Definition: rfx-builder.h:170
LiVESWidget * menu_text_entry
Definition: rfx-builder.h:103
LiVESWidget * param_dialog
Definition: rfx-builder.h:137
LiVESWidget * param_type_combo
Definition: rfx-builder.h:140
LiVESWidget * action_desc_hbox
Definition: rfx-builder.h:104
LiVESWidget * type_effect0_radiobutton
Definition: rfx-builder.h:110
LiVESWidget * param_strdef_hbox
Definition: rfx-builder.h:157
LiVESWidget * langc_combo
Definition: rfx-builder.h:113
LiVESWidget * author_entry
Definition: rfx-builder.h:101
LiVESWidget * param_wrap_hbox
Definition: rfx-builder.h:146
lives_param_t * params
store our parameters
Definition: rfx-builder.h:184
LiVESWidget * table
Definition: rfx-builder.h:114
LiVESWidget * action_desc_hsep
Definition: rfx-builder.h:106
LiVESWidget * new_entry_button
Definition: rfx-builder.h:166
LiVESWidget * spinbutton_min_frames
Definition: rfx-builder.h:107
int num_params
upper limit is RFXBUILD_MAX_PARAMS-1
Definition: rfx-builder.h:186
LiVESWidget * hbox_batchg
Definition: rfx-builder.h:125
LiVESWidget * spinbutton_param_group
Definition: rfx-builder.h:160
LiVESWidget * post_button
Definition: rfx-builder.h:121
LiVESWidget * code_textview
Definition: rfx-builder.h:165
rfx_trigger_t * copy_triggers
store triggers while editing
Definition: rfx-builder.h:194
LiVESWidget * pre_button
Definition: rfx-builder.h:119
LiVESWidget * type_effect2_radiobutton
Definition: rfx-builder.h:109
lives_rfx_table_type_t table_type
Definition: rfx-builder.h:128
LiVESWidget * paramw_rest_entry
Definition: rfx-builder.h:150
LiVESWidget * param_min_label
Definition: rfx-builder.h:143
LiVESWidget * dialog
Definition: rfx-builder.h:98
LiVESWidget * type_utility_radiobutton
Definition: rfx-builder.h:112
LiVESWidget * param_wrap_checkbutton
Definition: rfx-builder.h:147
LiVESWidget * params_button
Definition: rfx-builder.h:117
LiVESWidget * prop_slow
Definition: rfx-builder.h:123
LiVESWidget * param_label_entry
Definition: rfx-builder.h:139
int num_paramw_hints
upper limit is RFXBUILD_MAX_PARAMW_HINTS-1
Definition: rfx-builder.h:190
LiVESWidget * prop_batchg
Definition: rfx-builder.h:124
LiVESWidget * trigger_when_entry
Definition: rfx-builder.h:158
LiVESWidget * param_window_button
Definition: rfx-builder.h:118
LiVESWidget * type_effect1_radiobutton
Definition: rfx-builder.h:108
LiVESWidget * paramw_kw_combo
Definition: rfx-builder.h:151
LiVESWidget * spinbutton_param_dp
Definition: rfx-builder.h:159
LiVESWidget * type_tool_radiobutton
Definition: rfx-builder.h:111
LiVESWidget * properties_button
Definition: rfx-builder.h:116
LiVESWidget * spinbutton_param_step
Definition: rfx-builder.h:164
LiVESWidget * spinbutton_version
Definition: rfx-builder.h:100
LiVESWidget * paramw_rest_label
Definition: rfx-builder.h:154
LiVESWidget * requirements_button
Definition: rfx-builder.h:115
LiVESWidget * param_def_label
Definition: rfx-builder.h:142
LiVESWidget * trigger_button
Definition: rfx-builder.h:122
LiVESWidget * param_name_entry
Definition: rfx-builder.h:138
LiVESWidget * spinbutton_param_max
Definition: rfx-builder.h:163
LiVESWidget * remove_entry_button
Definition: rfx-builder.h:168
LiVESWidget * param_dp_label
Definition: rfx-builder.h:141
LiVESWidget * name_entry
Definition: rfx-builder.h:99
LiVESWidget * param_strlist_hbox
Definition: rfx-builder.h:148
lives_rfx_code_type_t codetype
Definition: rfx-builder.h:132
LiVESWidget * hbox_bg
Definition: rfx-builder.h:155
LiVESWidget * param_def_combo
Definition: rfx-builder.h:149
LiVESWidget * param_step_label
Definition: rfx-builder.h:145
LiVESWidget * url_entry
Definition: rfx-builder.h:102