Commit 739a0c57 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

streamlined API (moved vars/structs from glist to editor struct)

parent 19aa32ad
......@@ -352,7 +352,7 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv)
int font = (owner ? owner->gl_font : sys_defaultfont);
glist_init(x);
x->gl_magic_glass = magicGlass_new(x);
//x->gl_magic_glass = magicGlass_new(x);
x->gl_obj.te_type = T_OBJECT;
if (!owner)
canvas_addtolist(x);
......@@ -461,9 +461,6 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv)
x->move_offset_y = 0;
x->move_vis = 0;
x->canvas_cnct_inlet_tag[0] = 0;
x->canvas_cnct_outlet_tag[0] = 0;
x->u_queue = canvas_undo_init(x);
return(x);
......@@ -889,12 +886,6 @@ void canvas_free(t_canvas *x)
t_gobj *y;
int dspstate = canvas_suspend_dsp();
if (x->gl_magic_glass) {
//magicGlass_free(x->gl_magic_glass);
pd_free(&x->gl_magic_glass->x_obj.te_g.g_pd);
x->gl_magic_glass = NULL;
}
//canvas_noundo(x);
canvas_undo_free(x);
......@@ -1385,10 +1376,12 @@ static void canvas_dodsp(t_canvas *x, int toplevel, t_signal **sp)
/* find all the "dsp" boxes and add them to the graph */
ob = &x->gl_magic_glass->x_obj;
if (ob && magicGlass_bound(x->gl_magic_glass)) {
//fprintf(stderr,"adding cord inspector to dsp %d\n", magicGlass_bound(x->gl_magic_glass));
ugen_add(dc, ob); // this t_canvas could be an array, hence no gl_magic_glass
if (x->gl_editor) {
ob = &x->gl_editor->gl_magic_glass->x_obj;
if (ob && magicGlass_bound(x->gl_editor->gl_magic_glass)) {
//fprintf(stderr,"adding cord inspector to dsp %d\n", magicGlass_bound(x->gl_magic_glass));
ugen_add(dc, ob); // this t_canvas could be an array, hence no gl_magic_glass
}
}
for (y = x->gl_list; y; y = y->g_next)
......
......@@ -121,6 +121,9 @@ typedef struct _editor
unsigned int e_lastmoved: 1; /* one if mouse has moved since click */
unsigned int e_textdirty: 1; /* one if e_textedfor has changed */
unsigned int e_selectedline: 1; /* one if a line is selected */
t_magicGlass *gl_magic_glass; /* magic glass object */
char canvas_cnct_inlet_tag[4096]; /* tags for currently highlighted nlets */
char canvas_cnct_outlet_tag[4096];
} t_editor;
#define MA_NONE 0 /* e_onmotion: do nothing on mouse motion */
......@@ -202,30 +205,21 @@ struct _glist
unsigned int gl_isgraph:1; /* show as graph on parent */
unsigned int gl_hidetext:1; /* hide object-name + args when doing graph on parent */
unsigned int gl_gop_initialized:1; /* used for tagged moving of gop-ed objects to avoid redundant reinit */
t_magicGlass *gl_magic_glass; /* magic glass object */
//global preset array pointer
t_preset_hub *gl_phub;
//infinite undo goodies (have to stay here rather than the editor to prevent its obliteration when editor is deleted)
t_undo_action *u_queue;
t_undo_action *u_last;
//dpsaha@vt.edu for the gop dynamic resizing
t_pd *x_handle;
int scale_offset_x;
int scale_offset_y;
int scale_vis;
int scale_vis;
//dpsaha@vt.edu for the move handle
t_pd *x_mhandle;
int move_offset_x;
int move_offset_y;
int move_vis;
//infinite undo goodies
t_undo_action *u_queue;
t_undo_action *u_last;
//global preset array pointer
t_preset_hub *gl_phub;
//tags for currently highlighted nlets
char canvas_cnct_inlet_tag[4096];
char canvas_cnct_outlet_tag[4096];
};
#define gl_gobj gl_obj.te_g
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment