LiVES  2.4.1-svn
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
rfx-builder.h
Go to the documentation of this file.
1 // rfx-builder.h
2 // LiVES
3 // (c) G. Finch 2004 - 2015 <salsaman@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 
11 #define RFX_BUILDER "build-lives-rfx-plugin"
12 
14 #define RFX_VERSION "1.8"
15 
17 #define RFX_BUILDER_MULTI "build-lives-rfx-plugin-multi"
18 
20 #define RFXBUILDER_SCRIPT_SUFFIX "script"
21 
23 #define MAXFLOATLEN 11
24 
26 #define MAXINTLEN strlen(lives_strdup_printf("%d",LIVES_MAXINT))
27 
28 // advanced menu entries
29 void on_new_rfx_activate(LiVESMenuItem *, livespointer status);
30 void on_edit_rfx_activate(LiVESMenuItem *, livespointer status);
31 void on_copy_rfx_activate(LiVESMenuItem *, livespointer);
32 void on_rename_rfx_activate(LiVESMenuItem *, livespointer);
33 void on_delete_rfx_activate(LiVESMenuItem *, livespointer status);
34 void on_rebuild_rfx_activate(LiVESMenuItem *, livespointer);
35 void on_promote_rfx_activate(LiVESMenuItem *, livespointer);
36 void on_import_rfx_activate(LiVESMenuItem *, livespointer status);
37 void on_export_rfx_activate(LiVESMenuItem *, livespointer status);
38 
39 // the builder window
40 
42 #define RFXBUILD_MAX_REQ 128
43 
45 #define RFXBUILD_MAX_PARAMS 32
46 
48 #define RFXBUILD_MAX_PARAMW_HINTS 512
49 
52 #define RFXBUILD_MAX_TROWS 512
53 
54 
55 #define PREF_RFXDIALOG_W ((int)(800.*widget_opts.scale))
56 #define PREF_RFXDIALOG_H ((int)(650.*widget_opts.scale))
57 
58 
60 #define RFXBUILD_MAX_DP 16
61 typedef struct {
62  int when;
63  char *code;
65 
66 
67 
68 typedef enum {
75 
76 
77 typedef enum {
83 
84 
85 typedef enum {
92 
93 
94 typedef enum {
99 
100 
101 
102 typedef struct {
104 
105  LiVESWidget *dialog;
106  LiVESWidget *name_entry;
107  LiVESWidget *spinbutton_version;
108  LiVESWidget *author_entry;
109  LiVESWidget *url_entry;
110  LiVESWidget *menu_text_entry;
111  LiVESWidget *action_desc_hbox;
112  LiVESWidget *action_desc_entry;
113  LiVESWidget *action_desc_hsep;
114  LiVESWidget *spinbutton_min_frames;
118  LiVESWidget *type_tool_radiobutton;
120  LiVESWidget *langc_combo;
121  LiVESWidget *table;
122  LiVESWidget *requirements_button;
123  LiVESWidget *properties_button;
124  LiVESWidget *params_button;
125  LiVESWidget *param_window_button;
126  LiVESWidget *pre_button;
127  LiVESWidget *loop_button;
128  LiVESWidget *post_button;
129  LiVESWidget *trigger_button;
130  LiVESWidget *prop_slow;
131  LiVESWidget *prop_batchg;
132  LiVESWidget *hbox_batchg;
133  LiVESWidget *min_frames_label;
134 
136 
138 
140 
141  LiVESWidget *entry[RFXBUILD_MAX_TROWS];
142  LiVESWidget *entry2[RFXBUILD_MAX_TROWS];
143  LiVESWidget *entry3[RFXBUILD_MAX_TROWS];
144  LiVESWidget *param_dialog;
145  LiVESWidget *param_name_entry;
146  LiVESWidget *param_label_entry;
147  LiVESWidget *param_type_combo;
148  LiVESWidget *param_dp_label;
149  LiVESWidget *param_def_label;
150  LiVESWidget *param_min_label;
151  LiVESWidget *param_max_label;
152  LiVESWidget *param_step_label;
153  LiVESWidget *param_wrap_hbox;
155  LiVESWidget *param_strlist_hbox;
156  LiVESWidget *param_def_combo;
157  LiVESWidget *paramw_rest_entry;
158  LiVESWidget *paramw_kw_combo;
159  LiVESWidget *paramw_sp_combo;
160  LiVESWidget *paramw_spsub_combo;
161  LiVESWidget *paramw_rest_label;
162  LiVESWidget *hbox_bg;
163  LiVESWidget *param_strdef_button;
164  LiVESWidget *param_strdef_hbox;
165  LiVESWidget *trigger_when_entry;
166  LiVESWidget *spinbutton_param_dp;
168  LiVESWidget *spinbutton_param_def;
169  LiVESWidget *spinbutton_param_min;
170  LiVESWidget *spinbutton_param_max;
171  LiVESWidget *spinbutton_param_step;
172  LiVESWidget *code_textview;
173  LiVESWidget *new_entry_button;
174  LiVESWidget *edit_entry_button;
175  LiVESWidget *remove_entry_button;
176  LiVESWidget *move_up_button;
177  LiVESWidget *move_down_button;
178 
179  uint32_t props;
180 
181  char *pre_code;
182  char *loop_code;
183  char *post_code;
184 
186 
187  char *reqs[RFXBUILD_MAX_REQ];
188  int num_reqs;
190 
195 
196  char *paramw_hints[RFXBUILD_MAX_PARAMS];
199 
204 
206 
207  char *field_delim;
208 
210 
213 
214  char *script_name;
215  char *oname;
216 
217  ulong min_spin_f;
218  ulong max_spin_f;
219  ulong def_spin_f;
220  ulong step_spin_f;
221 
222  char *rfx_version;
224 
226 
227 // builder window widgets/callbacks
228 rfx_build_window_t *make_rfx_build_window(const char *in_script_name, lives_rfx_status_t in_status);
229 void on_rfxbuilder_ok(LiVESButton *, livespointer);
230 void on_rfxbuilder_cancel(LiVESButton *, livespointer);
232 void on_list_table_clicked(LiVESButton *, livespointer rfxbuilder);
233 void on_requirements_ok(LiVESButton *, livespointer rfxbuilder);
234 void on_requirements_cancel(LiVESButton *, livespointer);
235 void on_properties_clicked(LiVESButton *, livespointer rfxbuilder);
236 void on_properties_ok(LiVESButton *, livespointer rfxbuilder);
237 void on_params_ok(LiVESButton *, livespointer rfxbuilder);
238 void on_params_cancel(LiVESButton *, livespointer);
239 void on_param_window_ok(LiVESButton *, livespointer rfxbuilder);
240 void on_param_window_cancel(LiVESButton *, livespointer);
241 void on_code_clicked(LiVESButton *, livespointer rfxbuilder);
242 void on_code_ok(LiVESButton *, livespointer rfxbuilder);
243 void on_code_cancel(LiVESButton *, livespointer);
244 void on_triggers_ok(LiVESButton *, livespointer rfxbuilder);
245 void on_triggers_cancel(LiVESButton *, livespointer);
246 
247 
248 
249 
250 LiVESWidget *make_param_dialog(int pnum, rfx_build_window_t *rfxbuilder);
251 LiVESWidget *make_param_window_dialog(int hnum, rfx_build_window_t *rfxbuilder);
252 LiVESWidget *make_trigger_dialog(int tnum, rfx_build_window_t *rfxbuilder);
253 
254 void on_table_add_row(LiVESButton *, livespointer rfxbuilder);
255 void on_table_edit_row(LiVESButton *, livespointer rfxbuilder);
256 void on_table_swap_row(LiVESButton *, livespointer rfxbuilder);
257 void on_table_delete_row(LiVESButton *, livespointer rfxbuilder);
258 
259 void param_set_from_dialog(lives_param_t *copy_param, rfx_build_window_t *rfxbuilder);
260 
261 void after_param_dp_changed(LiVESSpinButton *, livespointer rfxbuilder);
262 void after_param_min_changed(LiVESSpinButton *, livespointer rfxbuilder);
263 void after_param_max_changed(LiVESSpinButton *, livespointer rfxbuilder);
264 void after_param_def_changed(LiVESSpinButton *, livespointer rfxbuilder);
265 void after_rfxbuilder_type_toggled(LiVESToggleButton *, livespointer rfxbuilder);
266 void on_param_type_changed(LiVESCombo *, livespointer rfxbuilder);
267 void on_paramw_kw_changed(LiVESCombo *, livespointer rfxbuilder);
268 void on_paramw_sp_changed(LiVESCombo *, livespointer rfxbuilder);
269 void on_paramw_spsub_changed(LiVESCombo *, livespointer rfxbuilder);
270 void populate_script_combo(LiVESCombo *script_combo, lives_rfx_status_t status);
271 void on_script_status_changed(LiVESCombo *status_combo, livespointer script_combo);
272 
273 // fileselectors
274 void on_export_rfx_ok(LiVESButton *, char *script_name);
275 void on_import_rfx_ok(LiVESButton *, livespointer status);
276 
278 void add_rfx_effects(void);
279 
280 // utility functions
281 char *prompt_for_script_name(const char *sname, lives_rfx_status_t status);
282 boolean check_builder_programs(void);
283 LiVESList *get_script_list(short status);
284 
286 boolean perform_param_checks(rfx_build_window_t *, int index, int rows);
287 
288 
289 // read/write script files
291 boolean script_to_rfxbuilder(rfx_build_window_t *, const char *script_file);
292 
293 LiVESList *get_script_section(const char *section, const char *script_file, boolean strip);
294 
295 #endif // HAS_LIVES_RFX_BUILDER_H
LiVESList * get_script_section(const char *section, const char *script_file, boolean strip)
Definition: rfx-builder.c:3717
lives_rfx_build_type_t
Definition: rfx-builder.h:68
void on_table_swap_row(LiVESButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:1657
boolean perform_rfxbuilder_checks(rfx_build_window_t *)
Definition: rfx-builder.c:2992
lives_rfx_table_type_t table_type
Definition: rfx-builder.h:135
#define RFXBUILD_MAX_TROWS
Definition: rfx-builder.h:52
void populate_script_combo(LiVESCombo *script_combo, lives_rfx_status_t status)
Definition: rfx-builder.c:4325
void on_rename_rfx_activate(LiVESMenuItem *, livespointer)
Definition: rfx-builder.c:68
void on_edit_rfx_activate(LiVESMenuItem *, livespointer status)
Definition: rfx-builder.c:30
LiVESWidget * author_entry
Definition: rfx-builder.h:108
LiVESList * get_script_list(short status)
Definition: rfx-builder.c:4362
void after_param_def_changed(LiVESSpinButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:2336
void on_params_cancel(LiVESButton *, livespointer)
Definition: rfx-builder.c:795
LiVESWidget * action_desc_hsep
Definition: rfx-builder.h:113
void on_code_cancel(LiVESButton *, livespointer)
char * prompt_for_script_name(const char *sname, lives_rfx_status_t status)
Definition: rfx-builder.c:4097
void on_params_ok(LiVESButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:761
LiVESWidget * param_strlist_hbox
Definition: rfx-builder.h:155
LiVESWidget * spinbutton_param_def
Definition: rfx-builder.h:168
LiVESWidget * spinbutton_param_step
Definition: rfx-builder.h:171
LiVESWidget * pre_button
Definition: rfx-builder.h:126
Definition: rfx-builder.h:80
Definition: rfx-builder.h:73
Definition: rfx-builder.h:71
#define RFXBUILD_MAX_PARAMS
maximum parameters
Definition: rfx-builder.h:45
LiVESWidget * param_wrap_hbox
Definition: rfx-builder.h:153
Definition: rfx-builder.h:70
int when
Definition: rfx-builder.h:62
void on_rfxbuilder_ok(LiVESButton *, livespointer)
Definition: rfx-builder.c:2928
void on_properties_clicked(LiVESButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:973
LiVESWidget * new_entry_button
Definition: rfx-builder.h:173
void on_import_rfx_ok(LiVESButton *, livespointer status)
void on_param_type_changed(LiVESCombo *, livespointer rfxbuilder)
Definition: rfx-builder.c:2365
void on_paramw_spsub_changed(LiVESCombo *, livespointer rfxbuilder)
Definition: rfx-builder.c:2686
LiVESWidget * paramw_spsub_combo
Definition: rfx-builder.h:160
LiVESWidget * make_param_dialog(int pnum, rfx_build_window_t *rfxbuilder)
Definition: rfx-builder.c:1937
void on_export_rfx_activate(LiVESMenuItem *, livespointer status)
Definition: rfx-builder.c:3981
LiVESWidget * param_def_label
Definition: rfx-builder.h:149
LiVESWidget * type_tool_radiobutton
Definition: rfx-builder.h:118
void on_code_ok(LiVESButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:837
boolean perform_param_checks(rfx_build_window_t *, int index, int rows)
Definition: rfx-builder.c:3048
void add_rfx_effects(void)
add dynamic menu entries
Definition: rfx-builder.c:4383
#define RFXBUILD_MAX_REQ
maximum requirements
Definition: rfx-builder.h:42
lives_param_t * params
store our parameters
Definition: rfx-builder.h:191
Definition: rfx-builder.h:69
void on_table_delete_row(LiVESButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:1705
ulong def_spin_f
Definition: rfx-builder.h:219
void on_table_edit_row(LiVESButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:1538
void param_set_from_dialog(lives_param_t *copy_param, rfx_build_window_t *rfxbuilder)
Definition: rfx-builder.c:1463
lives_param_t * copy_params
store our parameters while editing
Definition: rfx-builder.h:192
int num_params
upper limit is RFXBUILD_MAX_PARAMS-1
Definition: rfx-builder.h:193
void after_rfxbuilder_type_toggled(LiVESToggleButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:461
lives_rfx_code_type_t
Definition: rfx-builder.h:85
LiVESWidget * spinbutton_param_min
Definition: rfx-builder.h:169
LiVESWidget * trigger_button
Definition: rfx-builder.h:129
char * loop_code
Definition: rfx-builder.h:182
int onum_reqs
Definition: rfx-builder.h:189
LiVESWidget * code_textview
Definition: rfx-builder.h:172
LiVESWidget * url_entry
Definition: rfx-builder.h:109
rfx_trigger_t * copy_triggers
store triggers while editing
Definition: rfx-builder.h:201
boolean has_init_trigger
Definition: rfx-builder.h:205
Definition: rfx-builder.h:89
LiVESWidget * spinbutton_param_max
Definition: rfx-builder.h:170
Definition: rfx-builder.h:79
void on_code_clicked(LiVESButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:2791
void on_rfxbuilder_cancel(LiVESButton *, livespointer)
Definition: rfx-builder.c:2938
LiVESWidget * menu_text_entry
Definition: rfx-builder.h:110
boolean rfxbuilder_to_script(rfx_build_window_t *)
Definition: rfx-builder.c:3066
LiVESWidget * requirements_button
Definition: rfx-builder.h:122
LiVESWidget * dialog
Definition: rfx-builder.h:105
int edit_param
Definition: rfx-builder.h:185
uint32_t props
Definition: rfx-builder.h:179
Definition: rfx-builder.h:61
LiVESWidget * param_def_combo
Definition: rfx-builder.h:156
ulong step_spin_f
Definition: rfx-builder.h:220
LiVESWidget * param_dp_label
Definition: rfx-builder.h:148
LiVESWidget * spinbutton_min_frames
Definition: rfx-builder.h:114
LiVESWidget * hbox_batchg
Definition: rfx-builder.h:132
LiVESWidget * paramw_sp_combo
Definition: rfx-builder.h:159
Definition: rfx-builder.h:81
LiVESWidget * param_wrap_checkbutton
Definition: rfx-builder.h:154
boolean check_builder_programs(void)
Definition: rfx-builder.c:3815
LiVESWidget * param_min_label
Definition: rfx-builder.h:150
LiVESWidget * type_utility_radiobutton
Definition: rfx-builder.h:119
char * oname
Definition: rfx-builder.h:215
boolean script_to_rfxbuilder(rfx_build_window_t *, const char *script_file)
Definition: rfx-builder.c:3394
LiVESWidget * table
Definition: rfx-builder.h:121
LiVESWidget * make_trigger_dialog(int tnum, rfx_build_window_t *rfxbuilder)
Definition: rfx-builder.c:2705
char * post_code
Definition: rfx-builder.h:183
lives_rfx_status_t
Definition: plugins.h:465
LiVESWidget * type_effect0_radiobutton
Definition: rfx-builder.h:117
int onum_triggers
Definition: rfx-builder.h:203
LiVESWidget * type_effect2_radiobutton
Definition: rfx-builder.h:116
void on_param_window_ok(LiVESButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:815
LiVESWidget * param_type_combo
Definition: rfx-builder.h:147
LiVESWidget * edit_entry_button
Definition: rfx-builder.h:174
lives_rfx_builder_mode_t mode
Definition: rfx-builder.h:209
LiVESWidget * action_desc_entry
Definition: rfx-builder.h:112
Definition: rfx-builder.h:87
LiVESWidget * type_effect1_radiobutton
Definition: rfx-builder.h:115
void on_list_table_clicked(LiVESButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:508
void on_export_rfx_ok(LiVESButton *, char *script_name)
void on_copy_rfx_activate(LiVESMenuItem *, livespointer)
Definition: rfx-builder.c:54
lives_rfx_table_type_t
Definition: rfx-builder.h:77
LiVESWidget * make_param_window_dialog(int hnum, rfx_build_window_t *rfxbuilder)
Definition: rfx-builder.c:2511
LiVESWidget * paramw_rest_entry
Definition: rfx-builder.h:157
LiVESWidget * langc_combo
Definition: rfx-builder.h:120
ulong max_spin_f
Definition: rfx-builder.h:218
Definition: plugins.h:401
int num_paramw_hints
upper limit is RFXBUILD_MAX_PARAMW_HINTS-1
Definition: rfx-builder.h:197
LiVESWidget * param_step_label
Definition: rfx-builder.h:152
void after_param_dp_changed(LiVESSpinButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:2190
int num_reqs
Definition: rfx-builder.h:188
void rfxbuilder_destroy(rfx_build_window_t *)
Definition: rfx-builder.c:2947
void on_paramw_sp_changed(LiVESCombo *, livespointer rfxbuilder)
Definition: rfx-builder.c:2661
Definition: rfx-builder.h:78
Definition: rfx-builder.h:96
void on_paramw_kw_changed(LiVESCombo *, livespointer rfxbuilder)
Definition: rfx-builder.c:2641
void on_properties_ok(LiVESButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:741
int table_rows
Definition: rfx-builder.h:137
int table_swap_row2
Definition: rfx-builder.h:212
void on_rebuild_rfx_activate(LiVESMenuItem *, livespointer)
Definition: rfx-builder.c:3776
lives_rfx_builder_mode_t
Definition: rfx-builder.h:94
char * script_name
Definition: rfx-builder.h:214
LiVESWidget * post_button
Definition: rfx-builder.h:128
Definition: rfx-builder.h:90
LiVESWidget * param_dialog
Definition: rfx-builder.h:144
lives_rfx_build_type_t type
Definition: rfx-builder.h:103
LiVESWidget * paramw_kw_combo
Definition: rfx-builder.h:158
LiVESWidget * param_max_label
Definition: rfx-builder.h:151
char * rfx_version
Definition: rfx-builder.h:222
Definition: rfx-builder.h:72
LiVESWidget * trigger_when_entry
Definition: rfx-builder.h:165
Definition: rfx-builder.h:95
LiVESWidget * param_label_entry
Definition: rfx-builder.h:146
LiVESWidget * spinbutton_param_dp
Definition: rfx-builder.h:166
LiVESWidget * spinbutton_param_group
Definition: rfx-builder.h:167
Definition: rfx-builder.h:97
void after_param_min_changed(LiVESSpinButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:2237
LiVESWidget * properties_button
Definition: rfx-builder.h:123
void on_requirements_ok(LiVESButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:721
void on_table_add_row(LiVESButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:1100
void on_triggers_cancel(LiVESButton *, livespointer)
Definition: rfx-builder.c:925
void on_delete_rfx_activate(LiVESMenuItem *, livespointer status)
Definition: rfx-builder.c:3845
rfx_trigger_t * triggers
Definition: rfx-builder.h:200
void after_param_max_changed(LiVESSpinButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:2287
ulong min_spin_f
Definition: rfx-builder.h:217
LiVESWidget * min_frames_label
Definition: rfx-builder.h:133
char * field_delim
Definition: rfx-builder.h:207
LiVESWidget * prop_slow
Definition: rfx-builder.h:130
void on_new_rfx_activate(LiVESMenuItem *, livespointer status)
Definition: rfx-builder.c:22
char * code
Definition: rfx-builder.h:63
LiVESWidget * action_desc_hbox
Definition: rfx-builder.h:111
LiVESWidget * param_strdef_button
Definition: rfx-builder.h:163
LiVESWidget * param_window_button
Definition: rfx-builder.h:125
LiVESWidget * remove_entry_button
Definition: rfx-builder.h:175
int num_triggers
upper limit is RFXBUILD_MAX_PARAMS, 0 == init
Definition: rfx-builder.h:202
LiVESWidget * name_entry
Definition: rfx-builder.h:106
lives_rfx_code_type_t codetype
Definition: rfx-builder.h:139
LiVESWidget * prop_batchg
Definition: rfx-builder.h:131
Definition: rfx-builder.h:88
void on_triggers_ok(LiVESButton *, livespointer rfxbuilder)
Definition: rfx-builder.c:903
LiVESWidget * paramw_rest_label
Definition: rfx-builder.h:161
char * pre_code
Definition: rfx-builder.h:181
LiVESWidget * spinbutton_version
Definition: rfx-builder.h:107
LiVESWidget * hbox_bg
Definition: rfx-builder.h:162
void on_param_window_cancel(LiVESButton *, livespointer)
Definition: rfx-builder.c:830
int onum_params
Definition: rfx-builder.h:194
LiVESWidget * move_down_button
Definition: rfx-builder.h:177
LiVESWidget * loop_button
Definition: rfx-builder.h:127
void on_promote_rfx_activate(LiVESMenuItem *, livespointer)
Definition: rfx-builder.c:3912
LiVESWidget * params_button
Definition: rfx-builder.h:124
rfx_build_window_t * make_rfx_build_window(const char *in_script_name, lives_rfx_status_t in_status)
Definition: rfx-builder.c:80
void on_import_rfx_activate(LiVESMenuItem *, livespointer status)
Definition: rfx-builder.c:4017
int onum_paramw_hints
Definition: rfx-builder.h:198
void on_requirements_cancel(LiVESButton *, livespointer)
Definition: rfx-builder.c:734
Definition: rfx-builder.h:102
LiVESWidget * move_up_button
Definition: rfx-builder.h:176
void on_script_status_changed(LiVESCombo *status_combo, livespointer script_combo)
Definition: rfx-builder.c:4341
LiVESWidget * param_name_entry
Definition: rfx-builder.h:145
Definition: rfx-builder.h:86
int plugin_version
Definition: rfx-builder.h:223
LiVESWidget * param_strdef_hbox
Definition: rfx-builder.h:164
int table_swap_row1
Definition: rfx-builder.h:211