#include <stdio.h>
#include "m_pd.h"
#include "m_imp.h"
#include "s_stuff.h"
#include "g_canvas.h"
#include "g_undo.h"
#include "s_utf8.h"
#include <string.h>
#include "m_private_utils.h"
struct _instanceeditor
{ … };
#define THISED …
#define PASTE_OFFSET …
void glist_readfrombinbuf(t_glist *x, const t_binbuf *b, const char *filename,
int selectem);
static void canvas_doclear(t_canvas *x);
static void glist_setlastxy(t_glist *gl, int xval, int yval);
static void glist_donewloadbangs(t_glist *x);
static t_binbuf *canvas_docopy(t_canvas *x);
static void canvas_dopaste(t_canvas *x, t_binbuf *b);
static void canvas_paste(t_canvas *x);
static void canvas_clearline(t_canvas *x);
static t_glist *glist_finddirty(t_glist *x);
static void canvas_zoom(t_canvas *x, t_floatarg zoom);
static void canvas_displaceselection(t_canvas *x, int dx, int dy);
void canvas_setgraph(t_glist *x, int flag, int nogoprect);
void glist_deselectline(t_glist *x);
static void _editor_selectlinecolor(t_glist*x, const char*color)
{ … }
void glist_selectline(t_glist *x, t_outconnect *oc, int index1,
int outno, int index2, int inno)
{ … }
void glist_deselectline(t_glist *x)
{ … }
int glist_isselected(t_glist *x, t_gobj *y)
{ … }
void glist_select(t_glist *x, t_gobj *y)
{ … }
static void glist_checkanddeselectall(t_glist *gl, t_gobj *g)
{ … }
void glist_deselect(t_glist *x, t_gobj *y)
{ … }
void glist_noselect(t_glist *x)
{ … }
void glist_selectall(t_glist *x)
{ … }
int glist_getindex(t_glist *x, t_gobj *y)
{ … }
int glist_selectionindex(t_glist *x, t_gobj *y, int selected)
{ … }
static t_gobj *glist_nth(t_glist *x, int n)
{ … }
t_rtext *glist_textedfor(t_glist *gl)
{ … }
void glist_settexted(t_glist *gl, t_rtext *x)
{ … }
static void canvas_applybinbuf(t_canvas *x, t_binbuf *b)
{ … }
static int canvas_undo_confirmdiscard(t_gobj *g)
{ … }
void canvas_undo_set_name(const char*name)
{ … }
void canvas_setundo(t_canvas *x, t_undofn undofn, void *buf,
const char *name)
{ … }
void canvas_noundo(t_canvas *x)
{ … }
static void canvas_undomenu(t_canvas *x)
{ … }
t_undo_connect;
void *canvas_undo_set_disconnect(t_canvas *x,
int index1, int outno, int index2, int inno);
void *canvas_undo_set_connect(t_canvas *x,
int index1, int outno, int index2, int inno)
{ … }
int canvas_undo_connect(t_canvas *x, void *z, int action)
{ … }
static void canvas_connect_with_undo(t_canvas *x,
t_float index1, t_float outno, t_float index2, t_float inno)
{ … }
void *canvas_undo_set_disconnect(t_canvas *x,
int index1, int outno, int index2, int inno)
{ … }
void canvas_disconnect(t_canvas *x,
t_float index1, t_float outno, t_float index2, t_float inno)
{ … }
int canvas_undo_disconnect(t_canvas *x, void *z, int action)
{ … }
static void canvas_disconnect_with_undo(t_canvas *x,
t_float index1, t_float outno, t_float index2, t_float inno)
{ … }
#define UCUT_CUT …
#define UCUT_CLEAR …
#define UCUT_TEXT …
t_undo_cut;
void *canvas_undo_set_cut(t_canvas *x, int mode)
{ … }
int canvas_undo_cut(t_canvas *x, void *z, int action)
{ … }
t_undo_move_elem;
t_undo_move;
void *canvas_undo_set_move(t_canvas *x, int selected)
{ … }
int canvas_undo_move(t_canvas *x, void *z, int action)
{ … }
t_undo_paste;
void *canvas_undo_set_paste(t_canvas *x, int numpasted, int duplicate,
int d_offset)
{ … }
void *canvas_undo_set_pastebinbuf(t_canvas *x, t_binbuf *b,
int numpasted, int duplicate, int d_offset)
{ … }
int canvas_undo_paste(t_canvas *x, void *z, int action)
{ … }
t_undo_apply;
void *canvas_undo_set_apply(t_canvas *x, int n)
{ … }
static int canvas_apply_restore_original_position(t_canvas *x, int orig_pos);
int canvas_undo_apply(t_canvas *x, void *z, int action)
{ … }
int canvas_apply_restore_original_position(t_canvas *x, int orig_pos)
{ … }
t_undo_arrange;
void *canvas_undo_set_arrange(t_canvas *x, t_gobj *obj, int newindex)
{ … }
static void canvas_doarrange(t_canvas *x, t_float which, t_gobj *oldy,
t_gobj *oldy_prev, t_gobj *oldy_next)
{ … }
int canvas_undo_arrange(t_canvas *x, void *z, int action)
{ … }
t_undo_canvas_properties;
void *canvas_undo_set_canvas(t_canvas *x)
{ … }
int canvas_undo_canvas_apply(t_canvas *x, void *z, int action)
{ … }
t_undo_create;
void *canvas_undo_set_create(t_canvas *x)
{ … }
int canvas_undo_create(t_canvas *x, void *z, int action)
{ … }
void *canvas_undo_set_recreate(t_canvas *x, t_gobj *y, int pos)
{ … }
int canvas_undo_recreate(t_canvas *x, void *z, int action)
{ … }
static void canvas_dofont(t_canvas *x, t_floatarg font, t_floatarg xresize, t_floatarg yresize);
t_undo_font;
void *canvas_undo_set_font(t_canvas *x, int font, t_float resize, int which)
{ … }
int canvas_undo_font(t_canvas *x, void *z, int action)
{ … }
int clone_match(t_pd *z, t_symbol *name, t_symbol *dir);
static void canvas_cut(t_canvas *x);
static void glist_doreload(t_glist *gl, t_symbol *name, t_symbol *dir,
t_gobj *except)
{ … }
void canvas_reload(t_symbol *name, t_symbol *dir, t_glist *except)
{ … }
static const char *cursorlist[] = …;
void canvas_setcursor(t_canvas *x, unsigned int cursornum)
{ … }
int canvas_hitbox(t_canvas *x, t_gobj *y, int xpos, int ypos,
int *x1p, int *y1p, int *x2p, int *y2p)
{ … }
static t_gobj *canvas_findhitbox(t_canvas *x, int xpos, int ypos,
int *x1p, int *y1p, int *x2p, int *y2p)
{ … }
static t_editor *editor_new(t_glist *owner)
{ … }
static void editor_free(t_editor *x, t_glist *y)
{ … }
void canvas_create_editor(t_glist *x)
{ … }
void canvas_destroy_editor(t_glist *x)
{ … }
void canvas_reflecttitle(t_canvas *x);
void canvas_map(t_canvas *x, t_floatarg f);
void canvas_vis(t_canvas *x, t_floatarg f)
{ … }
void canvas_setgraph(t_glist *x, int flag, int nogoprect)
{ … }
void garray_properties(t_garray *x);
void canvas_properties(t_gobj*z, t_glist*unused)
{ … }
static void canvas_donecanvasdialog(t_glist *x,
t_symbol *s, int argc, t_atom *argv)
{ … }
static void canvas_done_popup(t_canvas *x, t_float which,
t_float xpos, t_float ypos)
{ … }
#define NOMOD …
#define SHIFTMOD …
#define CTRLMOD …
#define ALTMOD …
#define RIGHTCLICK …
#define DCLICKINTERVAL …
void gatom_undarken(t_text *x);
static void undarken_if_gatom(t_gobj *gobj)
{ … }
static void canvas_rightclick(t_canvas *x, int xpos, int ypos, int mod)
{ … }
static void canvas_doclick(t_canvas *x, int xpix, int ypix, int mod, int doit)
{ … }
void canvas_mouse(t_canvas *x, t_floatarg xpix, t_floatarg ypix,
t_floatarg which, t_floatarg mod)
{ … }
int canvas_isconnected (t_canvas *x, t_text *ob1, int n1,
t_text *ob2, int n2)
{ … }
static int canconnect(t_canvas*x, t_object *src, int nout,
t_object *sink, int nin)
{ … }
static int tryconnect(t_canvas*x, t_object *src, int nout,
t_object *sink, int nin)
{ … }
static void canvas_doconnect(t_canvas *x, int xpos, int ypos, int mod, int doit)
{ … }
void canvas_selectinrect(t_canvas *x, int lox, int loy, int hix, int hiy)
{ … }
static void canvas_doregion(t_canvas *x, int xpos, int ypos, int doit)
{ … }
void canvas_mouseup(t_canvas *x,
t_floatarg fxpos, t_floatarg fypos, t_floatarg fwhich,
t_floatarg fmod)
{ … }
static void canvas_displaceselection(t_canvas *x, int dx, int dy)
{ … }
void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av)
{ … }
static void delay_move(t_canvas *x)
{ … }
extern void text_getfont(t_text *x, t_glist *thisglist,
int *fwidthp, int *fheightp, int *guifsize);
void canvas_motion(t_canvas *x, t_floatarg xpos, t_floatarg ypos,
t_floatarg fmod)
{ … }
void canvas_startmotion(t_canvas *x)
{ … }
extern int sys_perf;
void canvas_print(t_canvas *x, t_symbol *s)
{ … }
static t_glist *glist_finddirty(t_glist *x)
{ … }
void glob_verifyquit(void *dummy, t_floatarg f)
{ … }
void canvas_menuclose(t_canvas *x, t_floatarg fforce)
{ … }
static void canvas_menufont(t_canvas *x)
{ … }
t_zoomfn;
static void canvas_zoom(t_canvas *x, t_floatarg zoom)
{ … }
static int atoms_match(int inargc, t_atom *inargv, int searchargc,
t_atom *searchargv, int wholeword)
{ … }
extern int clone_get_n(t_gobj *x);
extern t_glist *clone_get_instance(t_gobj *x, int n);
static int canvas_dofind(t_canvas *x, int *myindexp)
{ … }
static void canvas_find(t_canvas *x, t_symbol *s, t_floatarg wholeword)
{ … }
static void canvas_find_again(t_canvas *x)
{ … }
static void canvas_find_parent(t_canvas *x)
{ … }
extern t_pd *message_get_responder(t_gobj *x);
extern t_class *text_class;
static int glist_dofinderror(t_glist *gl, const void *error_object)
{ … }
void canvas_finderror(const void *error_object)
{ … }
void canvas_stowconnections(t_canvas *x)
{ … }
void canvas_restoreconnections(t_canvas *x)
{ … }
static t_binbuf *canvas_docopy(t_canvas *x)
{ … }
static void canvas_copy(t_canvas *x)
{ … }
static void canvas_clearline(t_canvas *x)
{ … }
static void canvas_doclear(t_canvas *x)
{ … }
static void canvas_cut(t_canvas *x)
{ … }
static void glist_donewloadbangs(t_glist *x)
{ … }
static int binbuf_nextmess(int argc, const t_atom *argv)
{ … }
static int binbuf_getpos(t_binbuf*b, int *x0, int *y0, t_symbol**type)
{ … }
static void canvas_dopaste(t_canvas *x, t_binbuf *b)
{ … }
static t_symbol *get_object_type(t_object *obj)
{ … }
static void canvas_paste_replace(t_canvas *x)
{ … }
static void canvas_paste(t_canvas *x)
{ … }
static void canvas_duplicate(t_canvas *x)
{ … }
static void canvas_selectall(t_canvas *x)
{ … }
static void canvas_deselectall(t_canvas *x)
{ … }
static void canvas_cycleselect(t_canvas*x, t_float foffset)
{ … }
static void canvas_reselect(t_canvas *x)
{ … }
void canvas_connect(t_canvas *x, t_floatarg fwhoout, t_floatarg foutno,
t_floatarg fwhoin, t_floatarg finno)
{ … }
#define XTOLERANCE …
#define YTOLERANCE …
#define NHIST …
static void canvas_tidy(t_canvas *x)
{ … }
static int canvas_getconns(t_object*objsrc, int *outno, t_object*objsink, int *inno)
{ … }
static int canvas_try_bypassobj1(t_canvas* x,
t_object* obj0, int in0, int out0,
t_object* obj1, int in1, int out1,
t_object* obj2, int in2, int out2)
{ … }
static int canvas_try_insert(t_canvas *x
, t_object* obj00, int in00, int out00
, t_object* obj11, int in11, int out11
, t_object* obj22, int in22, int out22
)
{ … }
static void canvas_connect_selection(t_canvas *x)
{ … }
static void canvas_texteditor(t_canvas *x)
{ … }
void glob_key(void *dummy, t_symbol *s, int ac, t_atom *av)
{ … }
void canvas_editmode(t_canvas *x, t_floatarg state)
{ … }
static void canvas_dofont(t_canvas *x, t_floatarg font, t_floatarg xresize,
t_floatarg yresize)
{ … }
static void canvas_font(t_canvas *x, t_floatarg font, t_floatarg resize,
t_floatarg whichresize)
{ … }
void glist_getnextxy(t_glist *gl, int *xpix, int *ypix)
{ … }
static void glist_setlastxy(t_glist *gl, int xval, int yval)
{ … }
void canvas_triggerize(t_glist*cnv);
void g_editor_setup(void)
{ … }
void canvas_editor_for_class(t_class *c)
{ … }
void g_editor_newpdinstance(void)
{ … }
void g_editor_freepdinstance(void)
{ … }