diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..b1fc16d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.0) +project(CicmWrapper C) + +message("Configuring CicmWrapper") + + +file(GLOB_RECURSE PROJECT_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/*.c) + +file(GLOB_RECURSE PROJECT_HDRS ${CMAKE_CURRENT_SOURCE_DIR}/*.h) + +add_library(${PROJECT_NAME} ${PROJECT_SRCS}) + +set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) diff --git a/Sources/ebox.c b/Sources/ebox.c index 3d9f19e..0e01288 100644 --- a/Sources/ebox.c +++ b/Sources/ebox.c @@ -945,8 +945,11 @@ t_pd_err ebox_set_font(t_ebox *x, t_object *attr, int argc, t_atom *argv) else x->b_font.c_family = gensym("Helvetica"); - x->b_font.c_family = gensym(strtok(x->b_font.c_family->s_name," ',.-")); - x->b_font.c_family->s_name[0] = (char)toupper(x->b_font.c_family->s_name[0]); + const char* token = strtok(x->b_font.c_family->s_name," ',.-"); + char* buffer = strdup(token); + buffer[0] = toupper(buffer[0]); + x->b_font.c_family = gensym(buffer); + free(buffer); return 0; } diff --git a/Sources/eclass.c b/Sources/eclass.c index 17f6b0c..b9fffb7 100644 --- a/Sources/eclass.c +++ b/Sources/eclass.c @@ -49,7 +49,7 @@ void eclass_guiinit(t_eclass* c, long flags) { ewidget_init(c); c->c_box = 1; - + // DEFAULT ATTRIBUTES // CLASS_ATTR_FLOAT_ARRAY (c, "size", 0, t_ebox, b_rect.width, 2); CLASS_ATTR_SYMBOL (c, "fontname", 0, t_ebox, b_font.c_family); @@ -58,7 +58,7 @@ void eclass_guiinit(t_eclass* c, long flags) CLASS_ATTR_LONG (c, "fontsize", 0, t_ebox, b_font.c_sizereal); CLASS_ATTR_SYMBOL (c, "receive", 0, t_ebox, b_receive_id); CLASS_ATTR_SYMBOL (c, "send", 0, t_ebox, b_send_id); - + CLASS_ATTR_DEFAULT (c, "size", 0, "100. 100."); CLASS_ATTR_FILTER_MIN (c, "size", 4); CLASS_ATTR_SAVE (c, "size", 0); @@ -66,7 +66,7 @@ void eclass_guiinit(t_eclass* c, long flags) CLASS_ATTR_CATEGORY (c, "size", 0, "Basic"); CLASS_ATTR_LABEL (c, "size", 0, "Patching Size"); CLASS_ATTR_ACCESSORS (c, "size", NULL, (t_err_method)ebox_size_set); - + CLASS_ATTR_DEFAULT (c, "fontname", 0, "Helvetica"); CLASS_ATTR_SAVE (c, "fontname", 0); CLASS_ATTR_PAINT (c, "fontname", 0); @@ -75,7 +75,7 @@ void eclass_guiinit(t_eclass* c, long flags) CLASS_ATTR_ACCESSORS (c, "fontname", NULL, (t_err_method)ebox_set_font); CLASS_ATTR_STYLE (c, "fontname", 0, "menu"); CLASS_ATTR_ITEMS (c, "fontname", 0, "Helvetica Monaco Courier Times DejaVu"); - + CLASS_ATTR_DEFAULT (c, "fontweight", 0, "normal"); CLASS_ATTR_SAVE (c, "fontweight", 0); CLASS_ATTR_PAINT (c, "fontweight", 0); @@ -84,7 +84,7 @@ void eclass_guiinit(t_eclass* c, long flags) CLASS_ATTR_ACCESSORS (c, "fontweight", NULL, (t_err_method)ebox_set_fontweight); CLASS_ATTR_STYLE (c, "fontweight", 0, "menu"); CLASS_ATTR_ITEMS (c, "fontweight", 0, "normal bold"); - + CLASS_ATTR_DEFAULT (c, "fontslant", 0, "roman"); CLASS_ATTR_SAVE (c, "fontslant", 0); CLASS_ATTR_PAINT (c, "fontslant", 0); @@ -93,7 +93,7 @@ void eclass_guiinit(t_eclass* c, long flags) CLASS_ATTR_ACCESSORS (c, "fontslant", NULL, (t_err_method)ebox_set_fontslant); CLASS_ATTR_STYLE (c, "fontslant", 0, "menu"); CLASS_ATTR_ITEMS (c, "fontslant", 0, "roman italic"); - + CLASS_ATTR_DEFAULT (c, "fontsize", 0, "11"); CLASS_ATTR_FILTER_MIN (c, "fontsize", 4); CLASS_ATTR_SAVE (c, "fontsize", 0); @@ -102,32 +102,32 @@ void eclass_guiinit(t_eclass* c, long flags) CLASS_ATTR_LABEL (c, "fontsize", 0, "Font Size"); CLASS_ATTR_ACCESSORS (c, "fontsize", NULL, ebox_set_fontsize); CLASS_ATTR_STYLE (c, "fontsize", 0, "number"); - + CLASS_ATTR_DEFAULT (c, "receive", 0, "(null)"); CLASS_ATTR_ACCESSORS (c, "receive", NULL, ebox_set_receiveid); CLASS_ATTR_SAVE (c, "receive", 0); CLASS_ATTR_CATEGORY (c, "receive", 0, "Basic"); CLASS_ATTR_LABEL (c, "receive", 0, "Receive Symbol"); - + CLASS_ATTR_DEFAULT (c, "send", 0, "(null)"); CLASS_ATTR_ACCESSORS (c, "send", NULL, ebox_set_sendid); CLASS_ATTR_SAVE (c, "send", 0); CLASS_ATTR_CATEGORY (c, "send", 0, "Basic"); CLASS_ATTR_LABEL (c, "send", 0, "Send Symbol"); - + // GUI always need this methods // class_addmethod((t_class *)c, (t_method)ebox_attrprint, gensym("attrprint"), A_NULL, 0); class_addmethod((t_class *)c, (t_method)ebox_dialog, gensym("dialog"), A_GIMME, 0); - + class_addmethod((t_class *)c, (t_method)ebox_mouse_enter, gensym("mouseenter"), A_NULL, 0); class_addmethod((t_class *)c, (t_method)ebox_mouse_leave, gensym("mouseleave"), A_NULL, 0); class_addmethod((t_class *)c, (t_method)ebox_mouse_move, gensym("mousemove"), A_GIMME, 0); class_addmethod((t_class *)c, (t_method)ebox_mouse_down, gensym("mousedown"), A_GIMME, 0); class_addmethod((t_class *)c, (t_method)ebox_mouse_up, gensym("mouseup"), A_GIMME, 0); - + class_addmethod((t_class *)c, (t_method)ebox_pos, gensym("pos"), A_DEFFLOAT,A_DEFFLOAT,0); class_addmethod((t_class *)c, (t_method)ebox_vis, gensym("vis"), A_DEFFLOAT,0); - + class_setwidget((t_class *)&c->c_class, (t_widgetbehavior *)&c->c_widget); class_setsavefn((t_class *)&c->c_class, (t_savefn)eobj_save); } @@ -150,7 +150,7 @@ t_pd_err eclass_register(t_symbol *name, t_eclass *c) { c->c_class.c_floatsignalin = calcoffset(t_edspobj, d_dsp.d_float); } - + if(c->c_nattr) { eclass_properties_dialog(c); @@ -264,7 +264,7 @@ void eclass_addmethod(t_eclass* c, t_typ_method m, const char* name, t_atomtype class_addmethod((t_class *)c, (t_method)m, gensym(name), type, 0); } else if(gensym(name) == gensym("write")) - { + { class_addmethod((t_class *)c, (t_method)eobj_write, gensym(name), type, 0); class_addmethod((t_class *)c, (t_method)eobj_write, gensym("eobjwriteto"), type, 0); c->c_widget.w_write = m; @@ -322,7 +322,7 @@ void eclass_new_attr_typed(t_eclass* c, const char* attrname, const char* type, attr->defvals = NULL; attr->itemslist = NULL; attr->itemssize = 0; - + attrs = (t_eattr **)realloc(c->c_attr, (size_t)(c->c_nattr + 1) * sizeof(t_eattr *)); if(attrs) { @@ -332,12 +332,13 @@ void eclass_new_attr_typed(t_eclass* c, const char* attrname, const char* type, sprintf(getattr, "get%s", attrname); class_addmethod((t_class *)c, (t_method)eclass_attr_getter, gensym(getattr), A_GIMME, 0); c->c_nattr++; + eclass_attr_label(c, attrname, 0, attrname); } else { error("%s can't increase memory for %s attribute.", c->c_class.c_name->s_name, attrname); } - + } else { @@ -445,7 +446,7 @@ void eclass_attr_itemlist(t_eclass* c, const char* attrname, long flags, const c if(c->c_attr[i]->name == gensym(attrname)) { pch = strtok(gensym(list)->s_name," ,"); - + while(pch != NULL) { pch = strtok(NULL, " ,"); @@ -475,7 +476,7 @@ void eclass_attr_itemlist(t_eclass* c, const char* attrname, long flags, const c j++; } } - + } else { @@ -499,7 +500,7 @@ void eclass_attr_filter_min(t_eclass* c, const char* attrname, float value) c->c_attr[i]->clipped = 1; else if(c->c_attr[i]->clipped == 2) c->c_attr[i]->clipped = 3; - + c->c_attr[i]->minimum = value; return ; } @@ -517,7 +518,7 @@ void eclass_attr_filter_max(t_eclass* c, const char* attrname, float value) c->c_attr[i]->clipped = 2; else if(c->c_attr[i]->clipped == 1) c->c_attr[i]->clipped = 3; - + c->c_attr[i]->maximum = value; return ; } @@ -596,10 +597,15 @@ void eclass_attr_getter(t_object* x, t_symbol *s, int* argc, t_atom** argv) char *point; t_ebox* z = (t_ebox *)x; t_eclass* c = (t_eclass *)z->b_obj.o_obj.te_g.g_pd; + + // if argc is null, this might have been wrongly called from patcher + if(!argc) + return; + if(argv[0] && argc[0]) free(argv); argc[0] = 0; - + for(i = 0; i < c->c_nattr; i++) { if(c->c_attr[i]->name == s) @@ -614,9 +620,9 @@ void eclass_attr_getter(t_object* x, t_symbol *s, int* argc, t_atom** argv) if(argc[0] > c->c_attr[i]->sizemax) argc[0] = (int)c->c_attr[i]->sizemax; } - + point = (char *)x + c->c_attr[i]->offset; - + argv[0] = (t_atom *)calloc((size_t)argc[0], sizeof(t_atom)); if(c->c_attr[i]->getter) { @@ -679,7 +685,7 @@ void eclass_attr_setter(t_object* x, t_symbol *s, int argc, t_atom *argv) long *point_size; t_ebox* z = (t_ebox *)x; t_eclass* c = (t_eclass *)z->b_obj.o_obj.te_g.g_pd; - + for(i = 0; i < c->c_nattr; i++) { if(c->c_attr[i]->name == s) @@ -700,9 +706,9 @@ void eclass_attr_setter(t_object* x, t_symbol *s, int argc, t_atom *argv) point_size = (long *)point; point_size[0] = (long)size; } - + point = (char *)(x) + c->c_attr[i]->offset; - + if(c->c_attr[i]->clipped == 1 || c->c_attr[i]->clipped == 3) { for(j = 0; j < argc; j++) @@ -723,7 +729,7 @@ void eclass_attr_setter(t_object* x, t_symbol *s, int argc, t_atom *argv) } } } - + if(c->c_attr[i]->setter) { c->c_attr[i]->setter(x, c->c_attr[i], argc, argv); @@ -791,13 +797,13 @@ void eclass_attr_setter(t_object* x, t_symbol *s, int argc, t_atom *argv) pointor[j] = argv[j]; } } - + ebox_notify(z, s, s_attr_modified, NULL, NULL); if(c->c_widget.w_notify != NULL) { c->c_widget.w_notify(x, s, s_attr_modified, NULL, NULL); } - + if(c->c_attr[i]->paint) { if(c->c_widget.w_oksize != NULL) @@ -808,7 +814,7 @@ void eclass_attr_setter(t_object* x, t_symbol *s, int argc, t_atom *argv) { c->c_widget.w_getdrawparameters(x, NULL, &z->b_boxparameters); } - + ebox_redraw(z); } if(c->c_attr[i]->save && eobj_isbox(x) && ebox_isdrawable((t_ebox*) x)) @@ -828,7 +834,7 @@ static void ewidget_init(t_eclass* c) c->c_widget.w_activatefn = NULL; c->c_widget.w_deletefn = ebox_wdelete; c->c_widget.w_clickfn = NULL; - + c->c_widget.w_paint = NULL; c->c_widget.w_mouseenter = NULL; c->c_widget.w_mouseleave = NULL; @@ -859,10 +865,11 @@ static void ewidget_init(t_eclass* c) */ static void eclass_properties_dialog(t_eclass* c) { +#ifndef PURR_DATA int i, j, lenght; char buffer[1000]; char temp[1000]; - + // DIALOG WINDOW APPLY // for(i = 0; i < c->c_nattr; i++) { @@ -915,7 +922,7 @@ static void eclass_properties_dialog(t_eclass* c) sys_gui("}\n"); } } - + // DIALOG WINDOW CREATION // sys_vgui("proc pdtk_%s_dialog {id \n", c->c_class.c_name->s_name); for(i = 0; i < c->c_nattr; i++) @@ -927,7 +934,7 @@ static void eclass_properties_dialog(t_eclass* c) } sys_gui("} {\n"); sys_gui("set vid [string trimleft $id .]\n"); - + for(i = 0; i < c->c_nattr; i++) { if(!c->c_attr[i]->invisible) @@ -940,19 +947,19 @@ static void eclass_properties_dialog(t_eclass* c) sys_vgui("toplevel $id\n"); sys_vgui("wm title $id {%s properties}\n", c->c_class.c_name->s_name); sys_vgui("wm resizable $id 0 0\n", c->c_class.c_name->s_name); - + for(i = 0; i < c->c_nattr; i++) { if(!c->c_attr[i]->invisible) { sys_vgui("frame $id.name%i \n", i+1); sys_vgui("frame $id.sele%i \n", i+1); - + // ATTRIBUTES NAMES // sys_vgui("label $id.name%i.name -justify left -font {Helvetica 12} -text \"%s :\"\n", i+1, c->c_attr[i]->label->s_name); sys_vgui("pack $id.name%i.name -side left\n", i+1); // SELECTOR // - + if(c->c_attr[i]->style == gensym("checkbutton")) { sys_vgui("checkbutton $id.sele%i.selec -variable $var_%s -command [concat pdtk_%s_dialog_apply_%s $id]\n", i+1, c->c_attr[i]->name->s_name, c->c_class.c_name->s_name, c->c_attr[i]->name->s_name); @@ -972,7 +979,7 @@ static void eclass_properties_dialog(t_eclass* c) sys_vgui("$id.sele%i.selec configure -from -9999999999999 -to 9999999999999\n", i+1, (float)c->c_attr[i]->maximum); // Should be enough sys_vgui("$id.sele%i.selec delete 0 end \n", i+1); sys_vgui("$id.sele%i.selec insert 0 $%s \n", i+1, c->c_attr[i]->name->s_name); - + sys_vgui("bind $id.sele%i.selec [concat pdtk_%s_dialog_apply_%s $id]\n", i+1, c->c_class.c_name->s_name, c->c_attr[i]->name->s_name); sys_vgui("pack $id.sele%i.selec -side left\n", i+1); } @@ -986,7 +993,7 @@ static void eclass_properties_dialog(t_eclass* c) sys_vgui("%s ", c->c_attr[i]->itemslist[c->c_attr[i]->itemssize - 1 - j]->s_name); } sys_vgui("}\n"); - + sys_vgui("bind $id.sele%i.selec [concat pdtk_%s_dialog_apply_%s $id]\n", i+1, c->c_class.c_name->s_name, c->c_attr[i]->name->s_name); sys_vgui("pack $id.sele%i.selec -side left\n", i+1); sys_vgui("$id.sele%i.selec set $%s \n", i+1, c->c_attr[i]->name->s_name); @@ -996,15 +1003,15 @@ static void eclass_properties_dialog(t_eclass* c) sys_vgui("entry $id.sele%i.selec -font {Helvetica 12} -width 20 -textvariable [string trim $var_%s]\n", i+1, c->c_attr[i]->name->s_name); sys_vgui("bind $id.sele%i.selec [concat pdtk_%s_dialog_apply_%s $id]\n", i+1, c->c_class.c_name->s_name, c->c_attr[i]->name->s_name); sys_vgui("pack $id.sele%i.selec -side left\n", i+1); - + } - + sys_vgui("grid config $id.name%i -column 0 -row %i -sticky w\n", i+1, i+1); sys_vgui("grid config $id.sele%i -column 1 -row %i -sticky w\n", i+1, i+1); } } sys_gui("}\n"); - +#endif } diff --git a/Sources/eclass.h b/Sources/eclass.h index a1d6fd1..c616d36 100644 --- a/Sources/eclass.h +++ b/Sources/eclass.h @@ -230,7 +230,7 @@ void eclass_attr_paint(t_eclass* c, const char* attrname, long flags); /*! * \fn void eclass_attr_invisible(t_eclass* c, const char* attrname, long flags) - * \brief Sets if the attribute should be displayed in the properties window. + * \brief Sets if the attribute should be displayed in the properties window. * \details You should prefer to use the MACROS. * \param c The t_eclass pointer * \param attrname The attribute name @@ -261,7 +261,7 @@ void eclass_attr_accessor(t_eclass* c, const char* attrname, t_err_method getter void eclass_attr_itemlist(t_eclass* c, const char* attrname, long flags, const char* list); //! @cond -#define calcoffset(x,y) ((long)(&(((x *)0L)->y))) +#define calcoffset(x,y) ((intptr_t)(&(((x *)0)->y))) //! @endcond //! Macros that create an int attribute diff --git a/Sources/ecommon.c b/Sources/ecommon.c index edb02aa..8e8a99a 100644 --- a/Sources/ecommon.c +++ b/Sources/ecommon.c @@ -37,6 +37,7 @@ void epd_init(void) s_double = gensym("double"); if(!epd_symbol->s_thing) { +#ifndef PURR_DATA // PATCHER MOUSE MOTION // sys_vgui("proc eobj_canvas_motion {patcher val} {\n"); sys_gui(" set rx [winfo rootx $patcher]\n"); @@ -45,7 +46,7 @@ void epd_init(void) sys_gui(" set y [winfo pointery .]\n"); sys_vgui(" pdtk_canvas_motion $patcher [expr $x - $rx] [expr $y - $ry] $val\n"); sys_gui("}\n"); - + // PATCHER MOUSE DOWN // sys_vgui("proc eobj_canvas_down {patcher val} {\n"); sys_gui(" set rx [winfo rootx $patcher]\n"); @@ -54,7 +55,7 @@ void epd_init(void) sys_gui(" set y [winfo pointery .]\n"); sys_vgui(" pdtk_canvas_mouse $patcher [expr $x - $rx] [expr $y - $ry] 0 $val\n"); sys_gui("}\n"); - + // PATCHER MOUSE UP // sys_vgui("proc eobj_canvas_up {patcher} {\n"); sys_gui(" set rx [winfo rootx $patcher]\n"); @@ -63,7 +64,7 @@ void epd_init(void) sys_gui(" set y [winfo pointery .]\n"); sys_vgui(" pdtk_canvas_mouseup $patcher [expr $x - $rx] [expr $y - $ry] 0\n"); sys_gui("}\n"); - + // PATCHER MOUSE RIGHT // sys_vgui("proc eobj_canvas_right {patcher} {\n"); sys_gui(" set rx [winfo rootx $patcher]\n"); @@ -72,16 +73,16 @@ void epd_init(void) sys_gui(" set y [winfo pointery .]\n"); sys_vgui(" pdtk_canvas_rightclick $patcher [expr $x - $rx] [expr $y - $ry] 0\n"); sys_gui("}\n"); - + // OBJECT SAVE FILE // sys_gui("proc eobj_saveas {name initialfile initialdir} {\n"); sys_gui("if { ! [file isdirectory $initialdir]} {set initialdir $::env(HOME)}\n"); sys_gui("set filename [tk_getSaveFile -initialfile $initialfile -initialdir $initialdir -defaultextension .pd -filetypes $::filetypes]\n"); sys_gui("if {$filename eq \"\"} return;\n"); - + sys_gui("set extension [file extension $filename]\n"); sys_gui("set oldfilename $filename\n"); - + sys_gui("if {$filename ne $oldfilename && [file exists $filename]} {\n"); sys_gui("set answer [tk_messageBox -type okcancel -icon question -default cancel-message [_ \"$filename\" already exists. Do you want to replace it?]]\n"); sys_gui("if {$answer eq \"cancel\"} return;\n"); @@ -92,7 +93,7 @@ void epd_init(void) sys_gui("set ::filenewdir $dirname\n"); sys_gui("::pd_guiprefs::update_recentfiles $filename\n"); sys_gui("}\n"); - + // OBJECT OPEN FILE // sys_gui("proc eobj_openfrom {name} {\n"); sys_gui("if { ! [file isdirectory $::filenewdir]} {\n"); @@ -101,7 +102,7 @@ void epd_init(void) sys_gui("set files [tk_getOpenFile -multiple true -initialdir $::fileopendir]\n"); sys_gui("pdsend \"$name eobjreadfrom [enquote_path $files]\"\n"); sys_gui("}\n"); - + // RGBA TO HEX // sys_gui("proc eobj_rgba_to_hex {red green blue alpha} { \n"); sys_gui("set nR [expr int( $red * 65025 )]\n"); @@ -112,7 +113,7 @@ void epd_init(void) sys_gui("append col [format {%4.4x} $nB]\n"); sys_gui("return #$col\n"); sys_gui("}\n"); - +#endif epd_symbol->s_thing = (t_class **)1; } } @@ -506,43 +507,45 @@ t_pd_err binbuf_get_attribute_float(t_binbuf *d, t_symbol *key, float *value) void epd_add_folder(const char* name, const char* folder) { - char path[MAXPDSTRING]; - t_namelist* var = sys_searchpath; - while (var) - { - sprintf(path, "%s/%s",var->nl_string, name); - if(strncmp(var->nl_string, name, strlen(name)) == 0) - { - sprintf(path, "%s/%s", var->nl_string, folder); - namelist_append_files(sys_staticpath, path); - return; - } - else if(access(path, O_RDONLY) != -1) - { - sprintf(path, "%s/%s/%s", var->nl_string, name, folder); - namelist_append_files(sys_staticpath, path); - return; - } - var = var->nl_next; - } - var = sys_staticpath; +#if !defined(PDL2ORK) + char path[MAXPDSTRING]; + t_namelist* var = pd_this->pd_stuff->st_searchpath; + while (var) + { + sprintf(path, "%s/%s",var->nl_string, name); + if(strncmp(var->nl_string, name, strlen(name)) == 0) + { + sprintf(path, "%s/%s", var->nl_string, folder); + namelist_append_files(pd_this->pd_stuff->st_staticpath, path); + return; + } + else if(access(path, O_RDONLY) != -1) + { + sprintf(path, "%s/%s/%s", var->nl_string, name, folder); + namelist_append_files(pd_this->pd_stuff->st_staticpath, path); + return; + } + var = var->nl_next; + } + var = pd_this->pd_stuff->st_staticpath; while (var) { sprintf(path, "%s/%s",var->nl_string, name); - if(strncmp(var->nl_string, name, strlen(name)) == 0) - { - sprintf(path, "%s/%s", var->nl_string, folder); - namelist_append_files(sys_staticpath, path); - return; - } - else if(access(path, O_RDONLY) != -1) - { - sprintf(path, "%s/%s/%s", var->nl_string, name, folder); - namelist_append_files(sys_staticpath, path); - return; - } - var = var->nl_next; + if(strncmp(var->nl_string, name, strlen(name)) == 0) + { + sprintf(path, "%s/%s", var->nl_string, folder); + namelist_append_files(pd_this->pd_stuff->st_staticpath, path); + return; + } + else if(access(path, O_RDONLY) != -1) + { + sprintf(path, "%s/%s/%s", var->nl_string, name, folder); + namelist_append_files(pd_this->pd_stuff->st_staticpath, path); + return; + } + var = var->nl_next; } +#endif } diff --git a/Sources/edefine.h b/Sources/edefine.h index 6dddcc5..bff3cab 100644 --- a/Sources/edefine.h +++ b/Sources/edefine.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -82,16 +83,6 @@ extern t_symbol* s_long; //! The pre-defined double t_symbol* extern t_symbol* s_double; -//! @cond -typedef struct _namelist /* element in a linked list of stored strings */ -{ - struct _namelist *nl_next; /* next in list */ - char *nl_string; /* the string */ -} t_namelist; - -EXTERN t_namelist *sys_staticpath; -EXTERN t_namelist *sys_searchpath; -EXTERN t_namelist *namelist_append_files(t_namelist *listwas, const char *s); //! @endcond /** @} */ @@ -118,10 +109,10 @@ EXTERN t_namelist *namelist_append_files(t_namelist *listwas, const char *s); */ typedef enum elayer_flags { - EGRAPHICS_OPEN = 0, /*!< Open. */ - EGRAPHICS_CLOSE = -1, /*!< Closed. */ - EGRAPHICS_INVALID = -2, /*!< Invalid. */ - EGRAPHICS_TODRAW = -3 /*!< To be drawn. */ + EGRAPHICS_OPEN = 0, /*!< Open. */ + EGRAPHICS_CLOSE = -1, /*!< Closed. */ + EGRAPHICS_INVALID = -2, /*!< Invalid. */ + EGRAPHICS_TODRAW = -3 /*!< To be drawn. */ } elayer_flags; /** @@ -131,16 +122,16 @@ typedef enum elayer_flags */ typedef enum etextanchor_flags { - ETEXT_UP = 0, /*!< Up and center. */ - ETEXT_UP_LEFT = 1, /*!< Up anfd left. */ - ETEXT_UP_RIGHT = 2, /*!< Up anfd right. */ - ETEXT_DOWN = 3, /*!< Down and center. */ - ETEXT_DOWN_LEFT = 4, /*!< Down anfd left. */ - ETEXT_DOWN_RIGHT = 5, /*!< Down anfd right. */ - ETEXT_LEFT = 6, /*!< Left. */ - ETEXT_RIGHT = 7, /*!< right. */ - ETEXT_CENTER = 8 /*!< Center. */ - + ETEXT_UP = 0, /*!< Up and center. */ + ETEXT_UP_LEFT = 1, /*!< Up anfd left. */ + ETEXT_UP_RIGHT = 2, /*!< Up anfd right. */ + ETEXT_DOWN = 3, /*!< Down and center. */ + ETEXT_DOWN_LEFT = 4, /*!< Down anfd left. */ + ETEXT_DOWN_RIGHT = 5, /*!< Down anfd right. */ + ETEXT_LEFT = 6, /*!< Left. */ + ETEXT_RIGHT = 7, /*!< right. */ + ETEXT_CENTER = 8 /*!< Center. */ + } etextanchor_flags; /** @@ -150,8 +141,8 @@ typedef enum etextanchor_flags */ typedef enum etextwrap_flags { - ETEXT_NOWRAP = 0, /*!< False. */ - ETEXT_WRAP = 1 /*!< True. */ + ETEXT_NOWRAP = 0, /*!< False. */ + ETEXT_WRAP = 1 /*!< True. */ } etextwrap_flags; /** @@ -161,9 +152,9 @@ typedef enum etextwrap_flags */ typedef enum etextjustify_flags { - ETEXT_JLEFT = 0, /*!< Left. */ - ETEXT_JRIGHT = 1, /*!< Right. */ - ETEXT_JCENTER = 2 /*!< Center. */ + ETEXT_JLEFT = 0, /*!< Left. */ + ETEXT_JRIGHT = 1, /*!< Right. */ + ETEXT_JCENTER = 2 /*!< Center. */ } etextjustify_flags; /** @@ -173,13 +164,13 @@ typedef enum etextjustify_flags */ typedef enum { - E_GOBJ_INVALID = 0, /*!< This type is invalid. */ - E_GOBJ_PATH , /*!< This is a path. */ - E_GOBJ_RECT , /*!< This is a rect. */ - E_GOBJ_ARC , /*!< This is an arc. */ - E_GOBJ_OVAL , /*!< This is an oval. */ - E_GOBJ_TEXT , /*!< This is a text. */ - E_GOBJ_IMAG /*!< This is an image. */ + E_GOBJ_INVALID = 0, /*!< This type is invalid. */ + E_GOBJ_PATH , /*!< This is a path. */ + E_GOBJ_RECT , /*!< This is a rect. */ + E_GOBJ_ARC , /*!< This is an arc. */ + E_GOBJ_OVAL , /*!< This is an oval. */ + E_GOBJ_TEXT , /*!< This is a text. */ + E_GOBJ_IMAG /*!< This is an image. */ } egraphics_types; /** @@ -189,8 +180,8 @@ typedef enum */ typedef enum { - E_PATH_MOVE = 0, /*!< This type is move. */ - E_PATH_CURVE = 1 /*!< This type is curve. */ + E_PATH_MOVE = 0, /*!< This type is move. */ + E_PATH_CURVE = 1 /*!< This type is curve. */ } epath_types; /** @@ -200,8 +191,8 @@ typedef enum */ typedef struct t_pt { - float x; /*!< The abscissa coordiante. */ - float y; /*!< The ordiante coordiante. */ + float x; /*!< The abscissa coordiante. */ + float y; /*!< The ordiante coordiante. */ } t_pt; /** @@ -211,10 +202,10 @@ typedef struct t_pt */ typedef struct t_rect { - float x; /*!< The abscissa coordiante. */ - float y; /*!< The ordiante coordiante. */ - float width; /*!< The width of the rectangle */ - float height; /*!< The height of the rectangle */ + float x; /*!< The abscissa coordiante. */ + float y; /*!< The ordiante coordiante. */ + float width; /*!< The width of the rectangle */ + float height; /*!< The height of the rectangle */ } t_rect; /** @@ -224,12 +215,12 @@ typedef struct t_rect */ typedef struct t_matrix { - float xx; /*!< The abscissa-abscissa translation of the matrix */ - float yx; /*!< The abscissa-ordiante translation of the matrix */ - float xy; /*!< The ordiante-abscissa translation of the matrix */ - float yy; /*!< The ordiante-ordiante translation of the matrix */ - float x0; /*!< The abscissa origin of the matrix */ - float y0; /*!< The ordiante origin of the matrix */ + float xx; /*!< The abscissa-abscissa translation of the matrix */ + float yx; /*!< The abscissa-ordiante translation of the matrix */ + float xy; /*!< The ordiante-abscissa translation of the matrix */ + float yy; /*!< The ordiante-ordiante translation of the matrix */ + float x0; /*!< The abscissa origin of the matrix */ + float y0; /*!< The ordiante origin of the matrix */ } t_matrix; /** @@ -239,9 +230,9 @@ typedef struct t_matrix */ typedef struct t_rgb { - float red; /*!< The red value. */ - float green; /*!< The green value. */ - float blue; /*!< The blue value. */ + float red; /*!< The red value. */ + float green; /*!< The green value. */ + float blue; /*!< The blue value. */ } t_rgb; /** @@ -251,10 +242,10 @@ typedef struct t_rgb */ typedef struct t_rgba { - float red; /*!< The red value. */ - float green; /*!< The green value. */ - float blue; /*!< The blue value. */ - float alpha; /*!< The alpha value. */ + float red; /*!< The red value. */ + float green; /*!< The green value. */ + float blue; /*!< The blue value. */ + float alpha; /*!< The alpha value. */ } t_rgba; /** @@ -264,9 +255,9 @@ typedef struct t_rgba */ typedef struct t_hsl { - float hue; /*!< The hue value. */ - float saturation; /*!< The saturation value. */ - float lightness; /*!< The lightness value. */ + float hue; /*!< The hue value. */ + float saturation; /*!< The saturation value. */ + float lightness; /*!< The lightness value. */ } t_hsl; /** @@ -276,10 +267,10 @@ typedef struct t_hsl */ typedef struct t_hsla { - float hue; /*!< The hue value. */ - float saturation; /*!< The saturation value. */ - float lightness; /*!< The lightness value. */ - float alpha; /*!< The alpha value. */ + float hue; /*!< The hue value. */ + float saturation; /*!< The saturation value. */ + float lightness; /*!< The lightness value. */ + float alpha; /*!< The alpha value. */ } t_hsla; //! The pre-defined black t_rgba @@ -306,11 +297,11 @@ extern const t_rgba rgba_red; */ typedef struct t_efont { - float c_size; /*!< The size of the font. */ - long c_sizereal; /*!< The plateform's size of the font. */ - t_symbol* c_family; /*!< The family of the font (times, helvetica, ect.). */ - t_symbol* c_slant; /*!< The slant of the font (regular, italic, etc.). */ - t_symbol* c_weight; /*!< The weight of the font (normal, bold). */ + float c_size; /*!< The size of the font. */ + long c_sizereal; /*!< The plateform's size of the font. */ + t_symbol* c_family; /*!< The family of the font (times, helvetica, ect.). */ + t_symbol* c_slant; /*!< The slant of the font (regular, italic, etc.). */ + t_symbol* c_weight; /*!< The weight of the font (normal, bold). */ } t_efont; /** @@ -320,12 +311,12 @@ typedef struct t_efont */ typedef struct t_etext { - t_symbol* c_text; /*!< The text. */ - t_rgba c_color; /*!< The color of the text. */ - t_efont c_font; /*!< The font of the text. */ - t_rect c_rect; /*!< The rectangle of the text. */ - t_symbol* c_anchor; /*!< The anchor of the text. */ - t_symbol* c_justify; /*!< The justification of the text. */ + t_symbol* c_text; /*!< The text. */ + t_rgba c_color; /*!< The color of the text. */ + t_efont c_font; /*!< The font of the text. */ + t_rect c_rect; /*!< The rectangle of the text. */ + t_symbol* c_anchor; /*!< The anchor of the text. */ + t_symbol* c_justify; /*!< The justification of the text. */ } t_etext; /** @@ -335,19 +326,19 @@ typedef struct t_etext */ typedef struct t_egobj { - egraphics_types e_type; /*!< The type of the graphical object. */ - int e_filled; /*!< The filled state of the graphical object. */ - t_symbol* e_color; /*!< The color of the graphical object. */ - float e_width; /*!< The line width of the graphical object. */ - - t_pt* e_points; /*!< The points of the graphical object. */ - long e_npoints; /*!< The number of points of the graphical object. */ - float e_roundness; /*!< The roundness of the graphical object. */ - t_efont e_font; /*!< The font of the graphical object. */ - t_symbol* e_anchor; /*!< The anchor of the graphical object. */ - t_symbol* e_justify; /*!< The justification of the graphical object. */ - t_symbol* e_text; /*!< The text of the graphical object. */ - + egraphics_types e_type; /*!< The type of the graphical object. */ + int e_filled; /*!< The filled state of the graphical object. */ + t_symbol* e_color; /*!< The color of the graphical object. */ + float e_width; /*!< The line width of the graphical object. */ + + t_pt* e_points; /*!< The points of the graphical object. */ + long e_npoints; /*!< The number of points of the graphical object. */ + float e_roundness; /*!< The roundness of the graphical object. */ + t_efont e_font; /*!< The font of the graphical object. */ + t_symbol* e_anchor; /*!< The anchor of the graphical object. */ + t_symbol* e_justify; /*!< The justification of the graphical object. */ + t_symbol* e_text; /*!< The text of the graphical object. */ + } t_egobj; /** @@ -357,18 +348,18 @@ typedef struct t_egobj */ typedef struct t_elayer { - t_object* e_owner; /*!< The layer owner. */ - t_symbol* e_name; /*!< The layer name. */ - t_symbol* e_id; /*!< The layer canvas ID. */ - int e_state; /*!< The layer state. */ - t_rect e_rect; /*!< The layer size. */ - - t_symbol* e_color; /*!< The layer color. */ - int e_line_width; /*!< The layer line width. */ - t_matrix e_matrix; /*!< The layer matrix. */ - t_egobj e_new_objects; /*!< The layer new object. */ - t_egobj* e_objects; /*!< The layer objects. */ - long e_number_objects; /*!< The number of layer objects. */ + t_object* e_owner; /*!< The layer owner. */ + t_symbol* e_name; /*!< The layer name. */ + t_symbol* e_id; /*!< The layer canvas ID. */ + int e_state; /*!< The layer state. */ + t_rect e_rect; /*!< The layer size. */ + + t_symbol* e_color; /*!< The layer color. */ + int e_line_width; /*!< The layer line width. */ + t_matrix e_matrix; /*!< The layer matrix. */ + t_egobj e_new_objects; /*!< The layer new object. */ + t_egobj* e_objects; /*!< The layer objects. */ + long e_number_objects; /*!< The number of layer objects. */ } t_elayer; /** @} */ @@ -387,8 +378,8 @@ typedef struct t_elayer */ typedef struct t_epopup { - t_symbol* c_name; /*!< The name of the popup. */ - t_symbol* c_send; /*!< The name of the owner. */ + t_symbol* c_name; /*!< The name of the popup. */ + t_symbol* c_send; /*!< The name of the owner. */ }t_epopup; /** @} */ @@ -411,34 +402,34 @@ typedef struct t_epopup */ typedef struct t_ewidget { - t_getrectfn w_getrectfn; /*!< The native Pd get size method. */ - t_displacefn w_displacefn; /*!< The native Pd displace method. */ - t_selectfn w_selectfn; /*!< The native Pd selection method. */ - t_activatefn w_activatefn; /*!< The native (dummy) Pd active method. */ - t_deletefn w_deletefn; /*!< The native Pd deletion method. */ - t_visfn w_visfn; /*!< The native Pd visible method. */ - t_clickfn w_clickfn; /*!< The native Pd click method. */ - t_typ_method w_assist; /*!< The dummy iolets assist method. */ - t_typ_method w_paint; /*!< The paint method. */ - t_typ_method w_mouseenter; /*!< The mouse enter method. */ - t_typ_method w_mouseleave; /*!< The mouse leave method. */ - t_typ_method w_mousemove; /*!< The mouse move method. */ - t_typ_method w_mousedown; /*!< The mouse down method. */ - t_typ_method w_mousedrag; /*!< The mouse drag method. */ - t_typ_method w_mouseup; /*!< The mouse up method. */ - t_typ_method w_mousewheel; /*!< The mouse wheel method. */ - t_typ_method w_dblclick; /*!< The mouse double click method. */ - t_typ_method w_key; /*!< The key method. */ - t_typ_method w_keyfilter; /*!< The key filter method. */ - t_typ_method w_getdrawparameters; /*!< The get draw parameter method. */ - t_typ_method w_save; /*!< The save method. */ - t_typ_method w_dosave; /*!< The real save method. */ - t_typ_method w_popup; /*!< The popup method. */ - t_typ_method w_dsp; /*!< The dsp method. */ - t_typ_method w_oksize; /*!< The size validation method. */ - t_err_method w_notify; /*!< The notification method. */ - t_typ_method w_write; /*!< The write to file method. */ - t_typ_method w_read; /*!< The read from file method. */ + t_getrectfn w_getrectfn; /*!< The native Pd get size method. */ + t_displacefn w_displacefn; /*!< The native Pd displace method. */ + t_selectfn w_selectfn; /*!< The native Pd selection method. */ + t_activatefn w_activatefn; /*!< The native (dummy) Pd active method. */ + t_deletefn w_deletefn; /*!< The native Pd deletion method. */ + t_visfn w_visfn; /*!< The native Pd visible method. */ + t_clickfn w_clickfn; /*!< The native Pd click method. */ + t_typ_method w_assist; /*!< The dummy iolets assist method. */ + t_typ_method w_paint; /*!< The paint method. */ + t_typ_method w_mouseenter; /*!< The mouse enter method. */ + t_typ_method w_mouseleave; /*!< The mouse leave method. */ + t_typ_method w_mousemove; /*!< The mouse move method. */ + t_typ_method w_mousedown; /*!< The mouse down method. */ + t_typ_method w_mousedrag; /*!< The mouse drag method. */ + t_typ_method w_mouseup; /*!< The mouse up method. */ + t_typ_method w_mousewheel; /*!< The mouse wheel method. */ + t_typ_method w_dblclick; /*!< The mouse double click method. */ + t_typ_method w_key; /*!< The key method. */ + t_typ_method w_keyfilter; /*!< The key filter method. */ + t_typ_method w_getdrawparameters; /*!< The get draw parameter method. */ + t_typ_method w_save; /*!< The save method. */ + t_typ_method w_dosave; /*!< The real save method. */ + t_typ_method w_popup; /*!< The popup method. */ + t_typ_method w_dsp; /*!< The dsp method. */ + t_typ_method w_oksize; /*!< The size validation method. */ + t_err_method w_notify; /*!< The notification method. */ + t_typ_method w_write; /*!< The write to file method. */ + t_typ_method w_read; /*!< The read from file method. */ } t_ewidget; /** @@ -448,30 +439,30 @@ typedef struct t_ewidget */ typedef struct t_eattr { - t_object obj; /*!< The dummy object. */ - t_symbol* name; /*!< The name of the attribute. */ - t_symbol* type; /*!< The type of the attribute (int, long, float,d double, rgba, etc.). */ - t_symbol* category; /*!< The dummy category of the attribute. */ - t_symbol* label; /*!< The label of the attribute. */ - t_symbol* style; /*!< The style of the attribute (checkbutton, color, number, entry, menu). */ - long order; /*!< The dummy order of the attribute. */ - char save; /*!< If the attribute should be saved. */ - char paint; /*!< If the attribute should repaint the t_ebox when it has changed. */ - char invisible; /*!< If the attribute is invisible. */ - long flags; /*!< The dummy flags of the attribute. */ - long offset; /*!< The offset of the attribute in the object structure. */ - long sizemax; /*!< The maximum size of the attribute if the attribute is an array. */ - long size; /*!< The size of the attribute if the attribute is an array. */ - - t_err_method getter; /*!< The getter method of the attribute. */ - t_err_method setter; /*!< The setter method of the attribute. */ - long clipped; /*!< If the attribute is clipped if it's value or an array of numerical values. */ - float minimum; /*!< The minimum value of the attribute. */ - float maximum; /*!< The maximum value of the attribute. */ - float step; /*!< The increment or decrement step calue of the attribute. */ - t_symbol* defvals; /*!< The default value of the attribute. */ - t_symbol** itemslist; /*!< The available items of an attribute if it is a menu. */ - long itemssize; /*!< The number of available items of an attribute if it is a menu. */ + t_object obj; /*!< The dummy object. */ + t_symbol* name; /*!< The name of the attribute. */ + t_symbol* type; /*!< The type of the attribute (int, long, float,d double, rgba, etc.). */ + t_symbol* category; /*!< The dummy category of the attribute. */ + t_symbol* label; /*!< The label of the attribute. */ + t_symbol* style; /*!< The style of the attribute (checkbutton, color, number, entry, menu). */ + long order; /*!< The dummy order of the attribute. */ + char save; /*!< If the attribute should be saved. */ + char paint; /*!< If the attribute should repaint the t_ebox when it has changed. */ + char invisible; /*!< If the attribute is invisible. */ + long flags; /*!< The dummy flags of the attribute. */ + long offset; /*!< The offset of the attribute in the object structure. */ + long sizemax; /*!< The maximum size of the attribute if the attribute is an array. */ + long size; /*!< The size of the attribute if the attribute is an array. */ + + t_err_method getter; /*!< The getter method of the attribute. */ + t_err_method setter; /*!< The setter method of the attribute. */ + long clipped; /*!< If the attribute is clipped if it's value or an array of numerical values. */ + float minimum; /*!< The minimum value of the attribute. */ + float maximum; /*!< The maximum value of the attribute. */ + float step; /*!< The increment or decrement step calue of the attribute. */ + t_symbol* defvals; /*!< The default value of the attribute. */ + t_symbol** itemslist; /*!< The available items of an attribute if it is a menu. */ + long itemssize; /*!< The number of available items of an attribute if it is a menu. */ } t_eattr; @@ -482,12 +473,12 @@ typedef struct t_eattr */ typedef struct t_eclass { - t_class c_class; /*!< The default class. */ - char c_box; /*!< The marker if the class is GUI. */ - char c_dsp; /*!< The marker if the class is DSP. */ - t_ewidget c_widget; /*!< The extra widget methods. */ - t_eattr** c_attr; /*!< The attributes. */ - long c_nattr; /*!< The number of attributes. */ + t_class c_class; /*!< The default class. */ + char c_box; /*!< The marker if the class is GUI. */ + char c_dsp; /*!< The marker if the class is DSP. */ + t_ewidget c_widget; /*!< The extra widget methods. */ + t_eattr** c_attr; /*!< The attributes. */ + long c_nattr; /*!< The number of attributes. */ }t_eclass; /** @} */ @@ -505,10 +496,10 @@ typedef struct t_eclass */ typedef struct t_eproxy { - t_pd p_pd; /*!< The class object. */ - t_object* p_owner; /*!< The pointer to the eobj owner. */ - t_inlet* p_inlet; /*!< The pointer to the inlet. */ - int p_index; /*!< The index of the proxy. */ + t_pd p_pd; /*!< The class object. */ + t_object* p_owner; /*!< The pointer to the eobj owner. */ + t_inlet* p_inlet; /*!< The pointer to the inlet. */ + int p_index; /*!< The index of the proxy. */ } t_eproxy; /** @@ -519,12 +510,12 @@ typedef struct t_eproxy */ typedef struct t_eobj { - t_object o_obj; /*!< The Pd object. */ - t_symbol* o_id; /*!< The object ID. */ - t_canvas* o_canvas; /*!< The canvas that own the object. */ - t_eproxy** o_proxy; /*!< The array of proxy inlets. */ - int o_nproxy; /*!< The number of proxy inlets. */ - int o_current_proxy; /*!< The index of the current proxy inlet used */ + t_object o_obj; /*!< The Pd object. */ + t_symbol* o_id; /*!< The object ID. */ + t_canvas* o_canvas; /*!< The canvas that own the object. */ + t_eproxy** o_proxy; /*!< The array of proxy inlets. */ + int o_nproxy; /*!< The number of proxy inlets. */ + int o_current_proxy; /*!< The index of the current proxy inlet used */ }t_eobj; /** @} */ @@ -543,15 +534,15 @@ typedef struct t_eobj */ typedef struct t_edsp { - float d_float; /*!< The float member to initialize the signal method. */ - long d_size; /*!< The number of signal inlets and outlets. */ - t_int* d_vectors; /*!< The vector that contains all the pointers for the perform method. */ - long d_flags; /*!< The flags to initialize the perform method. */ - void* d_user_param; /*!< The user parameters to pass through the perform method. */ - t_float** d_sigs_out; /*!< The array of signal vectors. */ - t_float* d_sigs_real; /*!< The real array of signal. */ - t_typ_method d_perform_method; /*!< The user perform method. */ - long d_misc; /*!< The flag that could be inplace or not. */ + float d_float; /*!< The float member to initialize the signal method. */ + long d_size; /*!< The number of signal inlets and outlets. */ + t_int* d_vectors; /*!< The vector that contains all the pointers for the perform method. */ + long d_flags; /*!< The flags to initialize the perform method. */ + void* d_user_param; /*!< The user parameters to pass through the perform method. */ + t_float** d_sigs_out; /*!< The array of signal vectors. */ + t_float* d_sigs_real; /*!< The real array of signal. */ + t_typ_method d_perform_method; /*!< The user perform method. */ + long d_misc; /*!< The flag that could be inplace or not. */ }t_edsp; /** @@ -561,8 +552,8 @@ typedef struct t_edsp */ typedef enum { - E_INPLACE = 0, /*!< The signal processing can be inplace. */ - E_NO_INPLACE = 1 /*!< The signal processing can't be inplace. */ + E_INPLACE = 0, /*!< The signal processing can be inplace. */ + E_NO_INPLACE = 1 /*!< The signal processing can't be inplace. */ } edsp_flags; /** @@ -573,8 +564,8 @@ typedef enum */ typedef struct t_edspobj { - t_eobj d_obj; /*!< The default object. */ - t_edsp d_dsp; /*!< The dsp structure. */ + t_eobj d_obj; /*!< The default object. */ + t_edsp d_dsp; /*!< The dsp structure. */ }t_edspobj; /** @} */ @@ -592,13 +583,13 @@ typedef struct t_edspobj */ typedef enum emod_flags { - EMOD_NONE = 0, /*!< Nothing. */ - EMOD_SHIFT = 1, /*!< Shift. */ - EMOD_MAJ = 2, /*!< Maj. */ - EMOD_CTRL = 4, /*!< Control. */ - EMOD_CMD = 8, /*!< Command. */ - EMOD_ALT = 16,/*!< Alt. */ - EMOD_RIGHT = 32 /*!< Right click. */ + EMOD_NONE = 0, /*!< Nothing. */ + EMOD_SHIFT = 1, /*!< Shift. */ + EMOD_MAJ = 2, /*!< Maj. */ + EMOD_CTRL = 4, /*!< Control. */ + EMOD_CMD = 8, /*!< Command. */ + EMOD_ALT = 16,/*!< Alt. */ + EMOD_RIGHT = 32 /*!< Right click. */ } emod_flags; /** @@ -608,23 +599,23 @@ typedef enum emod_flags */ typedef enum ekey_flags { - EKEY_DEL = 0, /*!< The delete key. */ - EKEY_TAB = 1, /*!< The tabulation key. */ - EKEY_ENTER = 2, /*!< The return key. */ - EKEY_ESC = 3 /*!< The escape key. */ - + EKEY_DEL = 0, /*!< The delete key. */ + EKEY_TAB = 1, /*!< The tabulation key. */ + EKEY_ENTER = 2, /*!< The return key. */ + EKEY_ESC = 3 /*!< The escape key. */ + } ekey_flags; //! @cond typedef enum eselitem_flags { - EITEM_NONE = 0, - EITEM_OBJ = 1, - EITEM_INLET = 2, - EITEM_OUTLET = 3, - EITEM_BOTTOM = 4, - EITEM_CORNER = 5, - EITEM_RIGHT = 6 + EITEM_NONE = 0, + EITEM_OBJ = 1, + EITEM_INLET = 2, + EITEM_OUTLET = 3, + EITEM_BOTTOM = 4, + EITEM_CORNER = 5, + EITEM_RIGHT = 6 } eselitem_flags; //! @endcond @@ -635,10 +626,10 @@ typedef enum eselitem_flags */ typedef enum { - EBOX_GROWNO = (1<<4), /*!< The width and the height can't be modified. */ - EBOX_GROWLINK = (1<<5), /*!< The width and the height are linked. */ - EBOX_GROWINDI = (1<<6), /*!< The width and the height are independant. */ - EBOX_IGNORELOCKCLICK = (1<<7) /*!< The t_ebox ignore the mouse events. */ + EBOX_GROWNO = (1<<4), /*!< The width and the height can't be modified. */ + EBOX_GROWLINK = (1<<5), /*!< The width and the height are linked. */ + EBOX_GROWINDI = (1<<6), /*!< The width and the height are independant. */ + EBOX_IGNORELOCKCLICK = (1<<7) /*!< The t_ebox ignore the mouse events. */ } ebox_flags; /** @@ -648,19 +639,19 @@ typedef enum */ typedef enum { - ECURSOR_LEFT_PTR = 0, /*!< The left_ptr string. */ - ECURSOR_CENTER_PTR = 1, /*!< The center_ptr string. */ - ECURSOR_SDOUBLE_ARROW= 2, /*!< The sb_v_double_arrow string. */ - ECURSOR_PLUS = 3, /*!< The plus string. */ - ECURSOR_HAND = 4, /*!< The hand2 string. */ - ECURSOR_CIRCLE = 5, /*!< The circle string. */ - ECURSOR_X = 6, /*!< The X_cursor string. */ - ECURSOR_BOTTOM = 7, /*!< The bottom_side string. */ - ECURSOR_RIGHT_CORNER = 8, /*!< The bottom_right_corner string. */ - ECURSOR_RIGHT_SIDE = 9, /*!< The right_side string. */ - ECURSOR_DOUBLE_ARROW = 10, /*!< The double_arrow string. */ - ECURSOR_EXCHANGE = 11, /*!< The exchange string. */ - ECURSOR_XTERM = 12 /*!< The xterm string. */ + ECURSOR_LEFT_PTR = 0, /*!< The left_ptr string. */ + ECURSOR_CENTER_PTR = 1, /*!< The center_ptr string. */ + ECURSOR_SDOUBLE_ARROW= 2, /*!< The sb_v_double_arrow string. */ + ECURSOR_PLUS = 3, /*!< The plus string. */ + ECURSOR_HAND = 4, /*!< The hand2 string. */ + ECURSOR_CIRCLE = 5, /*!< The circle string. */ + ECURSOR_X = 6, /*!< The X_cursor string. */ + ECURSOR_BOTTOM = 7, /*!< The bottom_side string. */ + ECURSOR_RIGHT_CORNER = 8, /*!< The bottom_right_corner string. */ + ECURSOR_RIGHT_SIDE = 9, /*!< The right_side string. */ + ECURSOR_DOUBLE_ARROW = 10, /*!< The double_arrow string. */ + ECURSOR_EXCHANGE = 11, /*!< The exchange string. */ + ECURSOR_XTERM = 12 /*!< The xterm string. */ } ebox_cursors; /** @@ -670,11 +661,11 @@ typedef enum */ typedef struct t_edrawparams { - float d_cornersize; /*!< The corner roundness. */ - float d_borderthickness; /*!< The border size. */ - t_rgba d_bordercolor; /*!< The border color. */ - t_rgba d_boxfillcolor; /*!< The background color. */ - + float d_cornersize; /*!< The corner roundness. */ + float d_borderthickness; /*!< The border size. */ + t_rgba d_bordercolor; /*!< The border color. */ + t_rgba d_boxfillcolor; /*!< The background color. */ + } t_edrawparams; /** @@ -685,36 +676,36 @@ typedef struct t_edrawparams */ typedef struct t_ebox { - t_eobj b_obj; ///c_widget.w_read(x, s, 1, av); return; } + +#if !defined(PDL2ORK) // Look in the search path - var = sys_searchpath; + var = pd_this->pd_stuff->st_searchpath; while (var) { sprintf(buf, "%s/%s", var->nl_string, atom_getsymbol(argv)->s_name); @@ -312,6 +314,7 @@ void eobj_read(t_eobj* x, t_symbol* s, int argc, t_atom *argv) } var = var->nl_next; } +#endif // Nothing work but we don't care if(c->c_widget.w_read)