128 void eclass_attr_setter(t_object* x, t_symbol *s,
int argc, t_atom *argv);
138 void eclass_attr_getter(t_object* x, t_symbol *s,
int* argc, t_atom** argv);
280 #define calcoffset(x,y) ((long)(&(((x *)0L)->y)))
284 #define CLASS_ATTR_INT(c,name,flags,struct,member) \
285 eclass_new_attr_typed(c,name, "int", 1, 0, flags, calcoffset(struct,member))
286 #define CLASS_ATTR_LONG(c,name,flags,struct,member) \
288 eclass_new_attr_typed(c,name, "long", 1, 0, flags, calcoffset(struct,member))
289 #define CLASS_ATTR_FLOAT(c,name,flags,struct,member) \
291 eclass_new_attr_typed(c,name, "float", 1, 0, flags, calcoffset(struct,member))
292 #define CLASS_ATTR_DOUBLE(c,name,flags,struct,member) \
294 eclass_new_attr_typed(c,name, "double", 1, 0, flags, calcoffset(struct,member))
295 #define CLASS_ATTR_RGB(c,name,flags,struct,member) \
297 eclass_new_attr_typed(c,name, "float", 3, 0, flags, calcoffset(struct,member))
298 #define CLASS_ATTR_RGBA(c,name,flags,struct,member) \
300 eclass_new_attr_typed(c,name, "float", 4, 0, flags, calcoffset(struct,member))
301 #define CLASS_ATTR_SYMBOL(c,name,flags,struct,member) \
303 eclass_new_attr_typed(c,name, "symbol", 1, 0, flags, calcoffset(struct,member))
304 #define CLASS_ATTR_ATOM(c,name,flags,struct,member) \
306 eclass_new_attr_typed(c,name, "atom", 1, 0, flags, calcoffset(struct,member))
307 #define CLASS_ATTR_INT_ARRAY(c,name,flags,struct,member,size) \
309 eclass_new_attr_typed(c,name, "int", size, 0, flags, calcoffset(struct,member))
310 #define CLASS_ATTR_LONG_ARRAY(c,name,flags,struct,member,size) \
312 eclass_new_attr_typed(c,name, "long", size, 0, flags, calcoffset(struct,member))
313 #define CLASS_ATTR_FLOAT_ARRAY(c,name,flags,struct,member,size) \
315 eclass_new_attr_typed(c,name, "float", size, 0, flags, calcoffset(struct,member))
316 #define CLASS_ATTR_DOUBLE_ARRAY(c,name,flags,struct,member,size) \
318 eclass_new_attr_typed(c,name, "double", size, 0, flags, calcoffset(struct,member))
319 #define CLASS_ATTR_SYMBOL_ARRAY(c,name,flags,struct,member, size) \
321 eclass_new_attr_typed(c,name, "symbol", size, 0, flags, calcoffset(struct,member))
322 #define CLASS_ATTR_ATOM_ARRAY(c,name,flags,struct,member, size) \
324 eclass_new_attr_typed(c,name, "atom", size, 0, flags, calcoffset(struct,member))
325 #define CLASS_ATTR_INT_VARSIZE(c,name,flags,struct,member, size, maxsize) \
327 eclass_new_attr_typed(c,name, "int", calcoffset(struct,size), maxsize, flags, calcoffset(struct,member))
328 #define CLASS_ATTR_LONG_VARSIZE(c,name,flags,struct,member, size, maxsize) \
330 eclass_new_attr_typed(c,name, "long", calcoffset(struct,size), maxsize, flags, calcoffset(struct,member))
331 #define CLASS_ATTR_FLOAT_VARSIZE(c,name,flags,struct,member, size, maxsize) \
333 eclass_new_attr_typed(c,name, "float", calcoffset(struct,size), maxsize, flags, calcoffset(struct,member))
334 #define CLASS_ATTR_DOUBLE_VARSIZE(c,name,flags,struct, member, size, maxsize) \
336 eclass_new_attr_typed(c,name, "double", calcoffset(struct,size), maxsize, flags, calcoffset(struct,member))
337 #define CLASS_ATTR_SYMBOL_VARSIZE(c,name,flags,struct, member, size, maxsize) \
339 eclass_new_attr_typed(c,name, "symbol", calcoffset(struct,size), maxsize, flags, calcoffset(struct,member))
340 #define CLASS_ATTR_ATOM_VARSIZE(c,name,flags,struct, member, size, maxsize) \
342 eclass_new_attr_typed(c,name, "atom", calcoffset(struct,size), maxsize, flags, calcoffset(struct,member))
345 #define CLASS_ATTR_CATEGORY(c,name,flags,categoryname) eclass_attr_category(c,name,flags,categoryname)
346 #define CLASS_ATTR_ORDER(c,name,flags,order) eclass_attr_order(c,name,flags,order)
348 #define CLASS_ATTR_LABEL(c,name,flags,label) eclass_attr_label(c,name,flags,label)
350 #define CLASS_ATTR_STYLE(c,name,flags,style) eclass_attr_style(c,name,flags,style)
352 #define CLASS_ATTR_DEFAULT(c,name,flags,val) eclass_attr_default(c,name,flags,val)
354 #define CLASS_ATTR_FILTER_MIN(c, name, value) eclass_attr_filter_min(c, name, value)
356 #define CLASS_ATTR_FILTER_MAX(c, name, value) eclass_attr_filter_max(c, name, value)
358 #define CLASS_ATTR_FILTER_CLIP(c, name, minval, maxval) eclass_attr_filter_min(c, name, minval); eclass_attr_filter_max(c, name, maxval);
360 #define CLASS_ATTR_STEP(c, name, value) eclass_attr_step(c, name, value)
362 #define CLASS_ATTR_SAVE(c,name,flags) eclass_attr_save(c,name,flags)
364 #define CLASS_ATTR_PAINT(c,name,flags) eclass_attr_paint(c,name,flags)
366 #define CLASS_ATTR_INVISIBLE(c,name,flags) eclass_attr_invisible(c,name,flags)
368 #define CLASS_ATTR_ACCESSORS(c,name,getter,setter) eclass_attr_accessor(c,name,(t_err_method)getter,(t_err_method)setter)
370 #define CLASS_ATTR_ITEMS(c,name,flags, list) eclass_attr_itemlist(c,name,flags, list)
372 #define CLASS_ATTR_DEFAULT_SAVE_PAINT(c,attrname,flags,parsestr) \
374 { CLASS_ATTR_DEFAULT(c,attrname,flags,parsestr); CLASS_ATTR_SAVE(c,attrname,flags); CLASS_ATTR_PAINT(c,attrname,flags); }
void eclass_addmethod(t_eclass *c, t_typ_method m, const char *name, t_atomtype type, long dummy)
Adds a method to the t_eclass.
Definition: eclass.c:178
t_pd_err(* t_err_method)(void *x,...)
The error method.
Definition: edefine.h:90
void eclass_new_attr_typed(t_eclass *c, const char *attrname, const char *type, long size, long maxsize, long flags, long offset)
Creates a new attribute.
Definition: eclass.c:300
t_pd_err eclass_register(t_symbol *name, t_eclass *c)
Initialize the t_eclass in a namespace and preprare the t_eclass to be ready.
Definition: eclass.c:159
void eclass_attr_paint(t_eclass *c, const char *attrname, long flags)
Sets if the attribute should call the ebox_redraw() function.
Definition: eclass.c:569
void eclass_attr_save(t_eclass *c, const char *attrname, long flags)
Sets if the attribute should be saved with the object.
Definition: eclass.c:556
void eclass_attr_accessor(t_eclass *c, const char *attrname, t_err_method getter, t_err_method setter)
Initialize new getter and setter methods for the attributes.
Definition: eclass.c:595
long t_pd_err
The error type.
Definition: edefine.h:84
void eclass_attr_default(t_eclass *c, const char *attrname, long flags, const char *value)
Sets the default value of an attribute.
Definition: eclass.c:369
void eclass_attr_step(t_eclass *c, const char *attrname, float value)
Sets the step value of an attribute.
Definition: eclass.c:543
void eclass_dspinit(t_eclass *c)
Initialize the t_eclass for the DSP behavior.
Definition: eclass.c:151
void eclass_init(t_eclass *c, long flags) _FUNCTION_DEPRECTAED_
Initialize the t_eclass for the GUI behavior (deprecated).
Definition: eclass.c:59
The class.
Definition: edefine.h:513
void eclass_attr_itemlist(t_eclass *c, const char *attrname, long flags, const char *list)
Sets the list available items of an attribute.
Definition: eclass.c:454
void eclass_attr_category(t_eclass *c, const char *attrname, long flags, const char *category)
Sets the category of an attribute.
Definition: eclass.c:382
void eclass_attr_filter_min(t_eclass *c, const char *attrname, float value)
Sets the minimum value of an attribute.
Definition: eclass.c:507
void eclass_attr_label(t_eclass *c, const char *attrname, long flags, const char *label)
Sets the label of an attribute.
Definition: eclass.c:409
t_eclass * eclass_new(const char *name, t_typ_method newm, t_typ_method freem, size_t size, int flags, t_atomtype arg1, int arg2)
Allocates the memory and initialize a new t_eclass.
Definition: eclass.c:37
void eclass_attr_invisible(t_eclass *c, const char *attrname, long flags)
Sets if the attribute should be displayed in the properties window.
Definition: eclass.c:582
void eclass_attr_filter_max(t_eclass *c, const char *attrname, float value)
Sets the maximum value of an attribute for number attributes.
Definition: eclass.c:525
void eclass_guiinit(t_eclass *c, long flags)
Initialize the t_eclass for the GUI behavior.
Definition: eclass.c:64
void eclass_attr_style(t_eclass *c, const char *attrname, long flags, const char *style)
Sets the style of an attribute.
Definition: eclass.c:422
void(* t_typ_method)(void *x,...)
The standart method.
Definition: edefine.h:86
void eclass_attr_order(t_eclass *c, const char *attrname, long flags, const char *order)
Sets the order of an attribute.
Definition: eclass.c:395