CicmWrapper
A wrapper for Pure Data
 All Data Structures Functions Variables Modules
estruct.h
1 /*
2  * CicmWrapper - Pure Data Enhanced
3  *
4  * A wrapper for Pure Data
5  *
6  * Copyright (C) 2013 Pierre Guillot, CICM - Université Paris 8
7  * All rights reserved.
8  *
9  * Website : http://www.mshparisnord.fr/HoaLibrary/
10  * Contacts : cicm.mshparisnord@gmail.com
11  *
12  * This library is free software; you can redistribute it and/or modify it
13  * under the terms of the GNU Library General Public License as published
14  * by the Free Software Foundation; either version 2 of the License.
15  *
16  * This library is distributed in the hope that it will be useful, but WITHOUT
17  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
19  * License for more details.
20  *
21  * You should have received a copy of the GNU Library General Public License
22  * along with this library; if not, write to the Free Software Foundation,
23  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24  *
25  */
26 
34 #include "ecommon.h"
35 
36 #ifndef DEF_ESTRUCT
37 #define DEF_ESTRUCT
38 
39 typedef enum _emod_flags
40 {
41  EMOD_NONE = 0,
42  EMOD_SHIFT = 1,
43  EMOD_MAJ = 2,
44  EMOD_CTRL = 4,
45  EMOD_CMD = 8,
46  EMOD_ALT = 16,
47  EMOD_RIGHT = 32
48 } t_emod_flags;
49 
50 typedef enum _ekey_flags
51 {
52  EKEY_DEL = 0,
53  EKEY_TAB = 1,
54  EKEY_ENTER = 2,
55  EKEY_ESC = 3
56 
57 } t_ekey_flags;
58 
59 typedef enum _eselitem_flags
60 {
61  EITEM_NONE = 0,
62  EITEM_OBJ = 1,
63  EITEM_INLET = 2,
64  EITEM_OUTLET = 3,
65  EITEM_BOTTOM = 4,
66  EITEM_CORNER = 5,
67  EITEM_RIGHT = 6
68 
69 } t_eselitem_flags;
70 
76 typedef enum t_elayer_flags
77 {
78  EGRAPHICS_OPEN = 0,
79  EGRAPHICS_CLOSE = -1,
80  EGRAPHICS_INVALID = -2,
81  EGRAPHICS_TODRAW = -3
82 } t_elayer_flags;
83 
89 typedef enum t_etextanchor_flags
90 {
91  ETEXT_UP = 0,
92  ETEXT_UP_LEFT = 1,
93  ETEXT_UP_RIGHT = 2,
94  ETEXT_DOWN = 3,
95  ETEXT_DOWN_LEFT = 4,
96  ETEXT_DOWN_RIGHT = 5,
97  ETEXT_LEFT = 6,
98  ETEXT_RIGHT = 7,
99  ETEXT_CENTER = 8
101 } t_etextanchor_flags;
102 
108 typedef enum t_etextwrap_flags
109 {
110  ETEXT_NOWRAP = 0,
111  ETEXT_WRAP = 1
112 } t_etextwrap_flags;
113 
119 typedef enum t_etextjustify_flags
120 {
121  ETEXT_JLEFT = 0,
122  ETEXT_JRIGHT = 1,
123  ETEXT_JCENTER = 2
124 } t_etextjustify_flags;
125 
131 typedef enum
132 {
133  E_GOBJ_INVALID = 0,
134  E_GOBJ_PATH ,
135  E_GOBJ_RECT ,
136  E_GOBJ_ARC ,
137  E_GOBJ_OVAL ,
138  E_GOBJ_TEXT ,
139  E_GOBJ_IMAG
140 } egraphics_types;
141 
147 typedef enum
148 {
149  E_PATH_MOVE = 0,
150  E_PATH_CURVE = 1
151 } epath_types;
152 
158 typedef struct t_pt
159 {
160  float x;
161  float y;
162 } t_pt;
163 
169 typedef struct t_rect
170 {
171  float x;
172  float y;
173  float width;
174  float height;
175 } t_rect;
176 
182 typedef struct t_matrix
183 {
184  float xx;
185  float yx;
186  float xy;
187  float yy;
188  float x0;
189  float y0;
190 } t_matrix;
191 
197 typedef struct t_rgb
198 {
199  float red;
200  float green;
201  float blue;
202 } t_rgb;
203 
209 typedef struct t_rgba
210 {
211  float red;
212  float green;
213  float blue;
214  float alpha;
215 } t_rgba;
216 
222 typedef struct t_hsl
223 {
224  float hue;
225  float saturation;
226  float lightness;
227 } t_hsl;
228 
234 typedef struct t_hsla
235 {
236  float hue;
237  float saturation;
238  float lightness;
239  float alpha;
240 } t_hsla;
241 
247 typedef struct t_efont
248 {
249  float c_size;
250  long c_sizereal;
251  t_symbol* c_family;
252  t_symbol* c_slant;
253  t_symbol* c_weight;
254 } t_efont;
255 
261 typedef struct t_etext
262 {
263  t_symbol* c_text;
267  t_symbol* c_anchor;
268  t_symbol* c_justify;
269 } t_etext;
270 
276 typedef struct t_egobj
277 {
278  egraphics_types e_type;
279  int e_filled;
280  t_symbol* e_color;
281  float e_width;
284  long e_npoints;
285  float e_roundness;
287  t_symbol* e_anchor;
288  t_symbol* e_justify;
289  t_symbol* e_text;
291 } t_egobj;
292 
298 typedef struct t_epopup
299 {
300  t_symbol* c_name;
301  t_symbol* c_send;
302 }t_epopup;
303 
309 typedef struct t_elayer
310 {
311  t_object* e_owner;
312  t_symbol* e_name;
313  t_symbol* e_id;
314  int e_state;
317  t_symbol* e_color;
323 } t_elayer;
324 
330 typedef struct t_edrawparams
331 {
332  float d_cornersize;
337 } t_edrawparams;
338 
344 typedef struct t_eproxy
345 {
346  t_pd p_pd;
347  t_object* p_owner;
348  t_inlet* p_inlet;
349  int p_index;
350 } t_eproxy;
351 
352 typedef struct t_ewidget
353 {
354  t_getrectfn w_getrectfn;
355  t_displacefn w_displacefn;
356  t_selectfn w_selectfn;
357  t_activatefn w_activatefn;
358  t_deletefn w_deletefn;
359  t_visfn w_visfn;
360  t_clickfn w_clickfn;
361  method w_assist;
362  method w_paint;
363  method w_mouseenter;
364  method w_mouseleave;
365  method w_mousemove;
366  method w_mousedown;
367  method w_mousedrag;
368  method w_mouseup;
369  method w_mousewheel;
370  method w_dblclick;
371  method w_key;
372  method w_keyfilter;
373  method w_getdrawparameters;
374  method w_save;
375  method w_dosave;
376  method w_popup;
377  method w_dsp;
378  method w_object_standat_paint;
379  method w_oksize;
380  t_err_method w_notify;
381  method w_write;
382  method w_read;
383 } t_ewidget;
384 
385 typedef struct t_eattr
386 {
387  t_object obj;
388  t_symbol* name;
389  t_symbol* type;
390  t_symbol* category;
391  t_symbol* label;
392  t_symbol* style;
393  long order;
394  char save;
395  char paint;
396  char invisible;
397  long flags;
398  long offset;
399  long sizemax;
400  long size;
401 
402  method getter;
403  method setter;
404  long clipped;
405  double minimum;
406  double maximum;
407  double step;
408  t_symbol* defvals;
409  t_symbol** itemslist;
410  long itemssize;
411 } t_eattr;
412 
413 
419 typedef struct t_eclass
420 {
421  t_class c_class;
422  char c_box;
423  char c_dsp;
426  long c_nattr;
427 }t_eclass;
428 
441 typedef struct t_eobj
442 {
443  t_object o_obj;
444  t_symbol* o_id;
445  t_canvas* o_canvas;
447  int o_nproxy;
449 }t_eobj;
450 
465 typedef struct t_edspobj
466 {
468  float d_float;
469  long d_dsp_size;
470  t_int* d_dsp_vectors;
471  long d_dsp_flag;
473  t_float** d_sigs_out;
474  t_float* d_sigs_real;
476  long d_misc;
477 }t_edspobj;
478 
493 typedef struct t_ebox
494 {
496 
497  t_symbol* b_receive_id;
498  t_symbol* b_send_id;
499  t_symbol* b_objpreset_id;
501  t_symbol* b_canvas_id;
502  t_symbol* b_drawing_id;
503  t_symbol* b_window_id;
504  t_symbol* b_all_id;
506  long b_flags;
517  char b_visible;
525 }t_ebox;
526 
535 typedef struct t_edspbox
536 {
539  t_symbol* b_receive_id;
540  t_symbol* b_send_id;
541  t_symbol* b_objpreset_id;
543  t_symbol* b_canvas_id;
544  t_symbol* b_drawing_id;
545  t_symbol* b_window_id;
546  t_symbol* b_all_id;
548  long b_flags;
559  char b_visible;
568  float d_float;
569  long d_dsp_size;
570  t_int* d_dsp_vectors;
571  long d_dsp_flag;
573  t_float** d_sigs_out;
574  t_float* d_sigs_real;
576  long d_misc;
577 }t_edspbox;
578 
579 
580 #endif
t_symbol * b_canvas_id
Definition: estruct.h:543
t_efont e_font
Definition: estruct.h:286
t_symbol * e_name
Definition: estruct.h:312
t_symbol * c_text
Definition: estruct.h:263
float hue
Definition: estruct.h:224
long d_dsp_size
Definition: estruct.h:569
float height
Definition: estruct.h:174
t_symbol * c_family
Definition: estruct.h:251
method d_perform_method
Definition: estruct.h:475
int p_index
Definition: estruct.h:349
void * d_dsp_user_param
Definition: estruct.h:472
float yy
Definition: estruct.h:187
t_symbol * b_all_id
Definition: estruct.h:504
void * d_dsp_user_param
Definition: estruct.h:572
A hsl color structure.
Definition: estruct.h:222
long b_flags
Definition: estruct.h:548
method d_perform_method
Definition: estruct.h:575
t_efont b_font
Definition: estruct.h:551
The class.
Definition: estruct.h:419
Definition: estruct.h:385
t_symbol * b_objpreset_id
Definition: estruct.h:541
t_object * p_owner
Definition: estruct.h:347
long e_npoints
Definition: estruct.h:284
t_egobj * e_objects
Definition: estruct.h:321
t_rect e_rect
Definition: estruct.h:315
float e_roundness
Definition: estruct.h:285
int b_selected_outlet
Definition: estruct.h:513
char b_have_window
Definition: estruct.h:561
t_symbol * e_color
Definition: estruct.h:280
t_class c_class
Definition: estruct.h:421
float y
Definition: estruct.h:172
t_matrix e_matrix
Definition: estruct.h:319
t_symbol * b_receive_id
Definition: estruct.h:539
long d_misc
Definition: estruct.h:476
t_symbol * b_drawing_id
Definition: estruct.h:544
t_symbol * e_anchor
Definition: estruct.h:287
A rgba color structure.
Definition: estruct.h:209
float xy
Definition: estruct.h:186
t_symbol * b_window_id
Definition: estruct.h:545
float d_cornersize
Definition: estruct.h:332
float e_width
Definition: estruct.h:281
t_inlet * p_inlet
Definition: estruct.h:348
float x
Definition: estruct.h:160
t_symbol * e_text
Definition: estruct.h:289
char b_isinsubcanvas
Definition: estruct.h:520
float x
Definition: estruct.h:171
long b_flags
Definition: estruct.h:506
t_symbol * b_window_id
Definition: estruct.h:503
A point structure.
Definition: estruct.h:158
char c_box
Definition: estruct.h:422
int e_line_width
Definition: estruct.h:318
char c_dsp
Definition: estruct.h:423
t_efont b_font
Definition: estruct.h:509
int b_selected_item
Definition: estruct.h:553
long e_number_objects
Definition: estruct.h:322
t_symbol * e_id
Definition: estruct.h:313
float d_float
Definition: estruct.h:468
t_ewidget c_widget
Definition: estruct.h:424
t_rgba c_color
Definition: estruct.h:264
t_symbol * b_canvas_id
Definition: estruct.h:501
t_edrawparams b_boxparameters
Definition: estruct.h:563
int o_current_proxy
Definition: estruct.h:448
int b_selected_box
Definition: estruct.h:552
float saturation
Definition: estruct.h:225
float red
Definition: estruct.h:211
int b_selected_inlet
Definition: estruct.h:554
t_float ** d_sigs_out
Definition: estruct.h:573
float xx
Definition: estruct.h:184
egraphics_types e_type
Definition: estruct.h:278
t_symbol * c_anchor
Definition: estruct.h:267
long d_dsp_flag
Definition: estruct.h:571
The drawing layer.
Definition: estruct.h:309
int b_selected_outlet
Definition: estruct.h:555
The object.
Definition: estruct.h:441
char b_mouse_down
Definition: estruct.h:557
t_rgba d_bordercolor
Definition: estruct.h:334
t_symbol * c_weight
Definition: estruct.h:253
Definition: estruct.h:352
t_symbol * b_send_id
Definition: estruct.h:498
int b_selected_item
Definition: estruct.h:511
t_rect b_rect
Definition: estruct.h:549
t_float ** d_sigs_out
Definition: estruct.h:473
The Proxy object.
Definition: estruct.h:344
t_int * d_dsp_vectors
Definition: estruct.h:570
char b_have_window
Definition: estruct.h:519
long c_nattr
Definition: estruct.h:426
t_elayer * b_layers
Definition: estruct.h:565
t_rgba d_boxfillcolor
Definition: estruct.h:335
float hue
Definition: estruct.h:236
t_egobj e_new_objects
Definition: estruct.h:320
float y
Definition: estruct.h:161
t_symbol * c_send
Definition: estruct.h:301
t_symbol * c_name
Definition: estruct.h:300
float width
Definition: estruct.h:173
A matrix structure.
Definition: estruct.h:182
float yx
Definition: estruct.h:185
The GUI DSP object.
Definition: estruct.h:535
char b_visible
Definition: estruct.h:517
t_eobj d_obj
Definition: estruct.h:467
char b_visible
Definition: estruct.h:559
long b_number_of_layers
Definition: estruct.h:524
float alpha
Definition: estruct.h:214
t_object o_obj
Definition: estruct.h:443
A rgb color structure.
Definition: estruct.h:197
t_eobj b_obj
The object.
Definition: estruct.h:495
float blue
Definition: estruct.h:213
char b_ready_to_draw
Definition: estruct.h:518
float lightness
Definition: estruct.h:238
t_pt * e_points
Definition: estruct.h:283
float d_borderthickness
Definition: estruct.h:333
t_symbol * e_justify
Definition: estruct.h:288
char b_mouse_down
Definition: estruct.h:515
int b_selected_box
Definition: estruct.h:510
t_symbol * b_send_id
Definition: estruct.h:540
long d_dsp_flag
Definition: estruct.h:471
long b_number_of_layers
Definition: estruct.h:566
t_pd p_pd
Definition: estruct.h:346
long d_dsp_size
Definition: estruct.h:469
The text structure.
Definition: estruct.h:261
t_rect b_rect
Definition: estruct.h:507
t_rect b_rect_last
Definition: estruct.h:550
t_canvas * o_canvas
Definition: estruct.h:445
The popup structure.
Definition: estruct.h:298
t_symbol * b_receive_id
Definition: estruct.h:497
t_eproxy ** o_proxy
Definition: estruct.h:446
char b_isinsubcanvas
Definition: estruct.h:562
t_edrawparams b_boxparameters
Definition: estruct.h:521
t_symbol * c_slant
Definition: estruct.h:252
The GUI object.
Definition: estruct.h:493
t_rect b_rect_last
Definition: estruct.h:508
t_eobj b_obj
Definition: estruct.h:537
t_symbol * b_drawing_id
Definition: estruct.h:502
float saturation
Definition: estruct.h:237
t_eattr ** c_attr
Definition: estruct.h:425
float red
Definition: estruct.h:199
The drawing object.
Definition: estruct.h:276
int e_state
Definition: estruct.h:314
int b_selected_inlet
Definition: estruct.h:512
char b_ready_to_draw
Definition: estruct.h:560
float green
Definition: estruct.h:200
int e_filled
Definition: estruct.h:279
t_float * d_sigs_real
Definition: estruct.h:574
float d_float
Definition: estruct.h:568
long c_sizereal
Definition: estruct.h:250
t_efont c_font
Definition: estruct.h:265
t_rect c_rect
Definition: estruct.h:266
float lightness
Definition: estruct.h:226
float x0
Definition: estruct.h:188
A hsla color structure.
Definition: estruct.h:234
t_symbol * b_all_id
Definition: estruct.h:546
t_elayer * b_layers
Definition: estruct.h:523
int o_nproxy
Definition: estruct.h:447
t_symbol * o_id
Definition: estruct.h:444
t_symbol * c_justify
Definition: estruct.h:268
t_object * e_owner
Definition: estruct.h:311
The drawing parameters.
Definition: estruct.h:330
t_symbol * b_objpreset_id
Definition: estruct.h:499
float blue
Definition: estruct.h:201
The DSP object.
Definition: estruct.h:465
t_symbol * e_color
Definition: estruct.h:317
float alpha
Definition: estruct.h:239
t_float * d_sigs_real
Definition: estruct.h:474
A rectangle structure.
Definition: estruct.h:169
t_int * d_dsp_vectors
Definition: estruct.h:470
float c_size
Definition: estruct.h:249
float green
Definition: estruct.h:212
The font structure.
Definition: estruct.h:247
float y0
Definition: estruct.h:189