CicmWrapper  Beta 0.4
A wrapper for Pure Data
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
ebox.h
1 /*
2  * CicmWrapper - Pure Data Enhanced
3 
4  * Copyright (C) 2013 Pierre Guillot, CICM - Université Paris 8
5  * All rights reserved.
6  * Website : https://github.com/CICM/CicmWrapper
7  * Contacts : cicm.mshparisnord@gmail.com
8  * For information on usage and redistribution, and for a DISCLAIMER OF ALL
9  * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
10  */
11 
18 #ifndef DEF_EBOX
19 #define DEF_EBOX
20 
21 #include "edefine.h"
22 
36 void ebox_new(t_ebox *x, long flags);
37 
38 
45 void ebox_ready(t_ebox *x);
46 
53 void ebox_free(t_ebox* x);
54 
62 
70 
78 
85 float ebox_getfontsize(t_ebox* x);
86 
94 
102 char ebox_isdrawable(t_ebox* x);
103 
111 void ebox_attrprocess_viabinbuf(void *x, t_binbuf *d);
112 
121 void ebox_attrprocess_viatoms(void *x, int argc, t_atom *argv);
122 
130 void ebox_set_cursor(t_ebox* x, int cursor);
131 
137 void ebox_redraw(t_ebox *x);
138 
146 void ebox_get_rect_for_view(t_ebox* x, t_rect *rect);
147 
158 t_elayer* ebox_start_layer(t_ebox *x, t_symbol *name, float width, float height);
159 
169 
180 t_pd_err ebox_paint_layer(t_ebox *x, t_symbol *name, float x_p, float y_p);
181 
191 
195 /*
198  * \memberof ebox
199  * \param x The ebox pointer
200  * \return Nothing
201  */
202 void ebox_mouse_enter(t_ebox* x);
203 
205 /*
206  * \memberof ebox
207  * \param x The ebox pointer
208  * \return Nothing
209  */
210 void ebox_mouse_leave(t_ebox* x);
211 
213 /*
214  * \memberof ebox
215  * \param x The ebox pointer
216  * \param s The message selector
217  * \param argc The size of the array of atoms
218  * \param argv The array of atoms
219  * \return Nothing
220  */
221 void ebox_mouse_move(t_ebox* x, t_symbol* s, int argc, t_atom *argv);
222 
224 /*
225  * \memberof ebox
226  * \param x The ebox pointer
227  * \param s The message selector
228  * \param argc The size of the array of atoms
229  * \param argv The array of atoms
230  * \return Nothing
231  */
232 void ebox_mouse_up(t_ebox* x, t_symbol* s, int argc, t_atom *argv);
233 
235 /*
236  * \memberof ebox
237  * \param x The ebox pointer
238  * \param s The message selector
239  * \param argc The size of the array of atoms
240  * \param argv The array of atoms
241  * \return Nothing
242  */
243 void ebox_mouse_down(t_ebox* x, t_symbol* s, int argc, t_atom *argv);
244 
246 /*
247  * \memberof ebox
248  * \param x The ebox pointer
249  * \param s The message selector
250  * \param argc The size of the array of atoms
251  * \param argv The array of atoms
252  * \return Nothing
253  */
254 void ebox_mouse_dblclick(t_ebox* x, t_symbol* s, int argc, t_atom *argv);
255 
257 /*
258  * \memberof ebox
259  * \param x The ebox pointer
260  * \param s The message selector
261  * \param argc The size of the array of atoms
262  * \param argv The array of atoms
263  * \return Nothing
264  */
265 void ebox_mouse_wheel(t_ebox* x, t_symbol* s, int argc, t_atom *argv);
266 
268 /*
269  * \memberof ebox
270  * \param x The ebox pointer
271  * \param s The message selector
272  * \param argc The size of the array of atoms
273  * \param argv The array of atoms
274  */
275 void ebox_key(t_ebox* x, t_symbol* s, int argc, t_atom *argv);
276 
278 /*
279  * \memberof ebox
280  * \param x The ebox pointer
281  * \param b The binbuf
282  */
283 void ebox_dosave(t_ebox* x, t_binbuf *b);
284 
286 /*
287  * \memberof ebox
288  * \param x The ebox pointer
289  * \param newx The new abscissa
290  * \param newy The new ordinate
291  */
292 void ebox_pos(t_ebox* x, float newx, float newy);
293 
295 /*
296  * \memberof ebox
297  * \param x The ebox pointer
298  * \param vis The visible state
299  */
300 void ebox_vis(t_ebox* x, int vis);
301 
303 /*
304  * \memberof ebox
305  * \param x The gobj
306  * \param attr Nothing (for Max 6 compatibility)
307  * \param argc The size of the array of atoms
308  * \param argv The array of atoms
309  * \return Always 0 (for the moment)
310  */
311 t_pd_err ebox_set_receiveid(t_ebox *x, t_object *attr, int argc, t_atom *argv);
312 
314 /*
315  * \memberof ebox
316  * \param x The gobj
317  * \param attr Nothing (for Max 6 compatibility)
318  * \param argc The size of the array of atoms
319  * \param argv The array of atoms
320  * \return Always 0 (for the moment)
321  */
322 t_pd_err ebox_set_sendid(t_ebox *x, t_object *attr, int argc, t_atom *argv);
323 
325 /*
326  * \memberof ebox
327  * \param x The ebox
328  * \param attr Nothing (for Max 6 compatibility)
329  * \param argc The size of the array of atoms
330  * \param argv The array of atoms
331  * \return Always 0 (for the moment)
332  */
333 t_pd_err ebox_set_presetid(t_ebox *x, t_object *attr, int argc, t_atom *argv);
334 
336 /*
337  * \memberof ebox
338  * \param x The ebox
339  */
340 t_symbol* ebox_get_presetid(t_ebox* x);
341 
343 /*
344  * \memberof ebox
345  * \param x The gobj
346  * \param attr Nothing (for Max 6 compatibility)
347  * \param argc The size of the array of atoms
348  * \param argv The array of atoms
349  * \return Always 0 (for the moment)
350  */
351 t_pd_err ebox_set_font(t_ebox *x, t_object *attr, int argc, t_atom *argv);
352 
354 /*
355  * \memberof ebox
356  * \param x The gobj
357  * \param attr Nothing (for Max 6 compatibility)
358  * \param argc The size of the array of atoms
359  * \param argv The array of atoms
360  * \return Always 0 (for the moment)
361  */
362 t_pd_err ebox_set_fontweight(t_ebox *x, t_object *attr, int argc, t_atom *argv);
363 
365 /*
366  * \memberof ebox
367  * \param x The gobj
368  * \param attr Nothing (for Max 6 compatibility)
369  * \param argc The size of the array of atoms
370  * \param argv The array of atoms
371  * \return Always 0 (for the moment)
372  */
373 t_pd_err ebox_set_fontslant(t_ebox *x, t_object *attr, int argc, t_atom *argv);
374 
376 /*
377  * \memberof ebox
378  * \param x The gobj
379  * \param attr Nothing (for Max 6 compatibility)
380  * \param argc The size of the array of atoms
381  * \param argv The array of atoms
382  * \return Always 0 (for the moment)
383  */
384 t_pd_err ebox_set_fontsize(t_ebox *x, t_object *attr, int argc, t_atom *argv);
385 
387 /*
388  * \memberof ebox
389  * \param z The gobj object
390  * \param glist The canvas
391  * \return Nothing
392  */
393 void ebox_properties(t_ebox *x, t_glist *glist);
394 
396 /*
397  * \memberof ebox
398  * \param x The object
399  * \param s Nothing (for Max 6 compatibility)
400  * \return Nothing
401  */
402 void ebox_dialog(t_ebox *x, t_symbol *s, int argc, t_atom *argv);
403 
405 /*
406  * \memberof ebox
407  * \param x The ebox
408  * \param s The name of the attribute
409  * \param msg Nothing (for Max 6 compatibility)
410  * \param sender Nothing (for Max 6 compatibility)
411  * \param data Nothing (for Max 6 compatibility)
412  * \return Always 0 (for the moment)
413  */
414 t_pd_err ebox_notify(t_ebox *x, t_symbol *s, t_symbol *msg, void *sender, void *data);
415 
417 /*
418  * \memberof ebox
419  * \param x The ebox
420  * \param attr Nothing (for Max 6 compatibility)
421  * \param argc The size of the array of atoms
422  * \param argv The array of atoms that contains the new width and the new height
423  * \return Always 0 (for the moment)
424  */
425 t_pd_err ebox_size_set(t_ebox *x, t_object *attr, int argc, t_atom *argv);
426 
428 /*
429  * \memberof ebox
430  * \param x The ebox
431  * \return Nothing
432  */
433 void ebox_attrprint(t_ebox* x);
434 
435 // The defaults pd widgets
436 void ebox_wgetrect(t_gobj *z, t_glist *glist, int *xp1, int *yp1, int *xp2, int *yp2);
437 void ebox_wvis(t_gobj *z, t_glist *glist, int vis);
438 void ebox_wdisplace(t_gobj *z, t_glist *glist, int dx, int dy);
439 void ebox_wselect(t_gobj *z, t_glist *glist, int selected);
440 void ebox_wdelete(t_gobj *z, t_glist *glist);
442 
443 
444 #endif
445 
446 
447 
t_pd_err ebox_paint_layer(t_ebox *x, t_symbol *name, float x_p, float y_p)
Paints a layer in the t_ebox.
Definition: ebox.c:1370
void ebox_redraw(t_ebox *x)
Notifies the t_ebox that it should be redrawn.
Definition: ebox.c:1219
t_pd_err ebox_invalidate_layer(t_ebox *x, t_symbol *name)
Marks a layer as invalid.
Definition: ebox.c:1356
void ebox_attrprocess_viabinbuf(void *x, t_binbuf *d)
Changes the attributes with a binbuf.
Definition: ebox.c:164
void ebox_attrprocess_viatoms(void *x, int argc, t_atom *argv)
Changes the attributes with an array of atoms.
Definition: ebox.c:142
t_elayer * ebox_start_layer(t_ebox *x, t_symbol *name, float width, float height)
Creates or initializes a layer for the t_ebox.
Definition: ebox.c:1243
t_symbol * ebox_getfontslant(t_ebox *x)
Retrieves the slant of the font of the t_ebox.
Definition: ebox.c:95
The t_atom struture.
Definition: enative.h:105
The t_binbuf struture.
Definition: enative.h:58
The t_symbol struture.
Definition: enative.h:46
The graphical t_object struture.
Definition: enative.h:132
The t_object struture.
Definition: enative.h:143
float ebox_getfontsize(t_ebox *x)
Retrieves the size of the font of the t_ebox.
Definition: ebox.c:105
void ebox_new(t_ebox *x, long flags)
Initializes the graphical members of the t_ebox.
Definition: ebox.c:42
void ebox_get_rect_for_view(t_ebox *x, t_rect *rect)
Retrieves the rectangle of the t_ebox.
Definition: ebox.c:1235
void ebox_free(t_ebox *x)
Indicates that the t_ebox can be drawn.
Definition: ebox.c:76
char ebox_isdrawable(t_ebox *x)
Retrieves if a t_ebox is drawable.
Definition: ebox.c:124
long t_pd_err
The error type.
Definition: edefine.h:69
t_class * t_pd
pure datum: nothing but a class pointer
Definition: enative.h:125
t_symbol * ebox_getfontweight(t_ebox *x)
Retrieves the weight of the font of the t_ebox.
Definition: ebox.c:100
t_pd * ebox_getsender(t_ebox *x)
Retrieves the link list of object binded to the t_ebox.
Definition: ebox.c:110
void ebox_set_cursor(t_ebox *x, int cursor)
Changes the cursor of the mouse.
Definition: ebox.c:136
The drawing layer.
Definition: edefine.h:373
A rectangle structure.
Definition: edefine.h:227
t_pd_err ebox_end_layer(t_ebox *x, t_symbol *name)
Marks a layer as ready to be drawn.
Definition: ebox.c:1341
void ebox_ready(t_ebox *x)
Indicates that the t_ebox can be drawn.
Definition: ebox.c:58
The GUI object.
Definition: edefine.h:701
t_symbol * ebox_getfontname(t_ebox *x)
Retrieves the name of the font of the t_ebox.
Definition: ebox.c:90