aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/guitest
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2009-04-01 21:13:09 +0000
committerThomas Grill <xovo@users.sourceforge.net>2009-04-01 21:13:09 +0000
commit0ed7a8b68dd73e2b0473b8127aeca99f3bac9061 (patch)
tree5c67818b38a5cc2f9caa5ca7f8640ca356adf02b /externals/grill/guitest
parentbb4c7f6a245394d09dac9adfb2efb093d3d98452 (diff)
cleaned up grill externals - replaced with svn:externals to svn.grrrr.org/ext/trunk/
svn path=/trunk/; revision=10951
Diffstat (limited to 'externals/grill/guitest')
-rw-r--r--externals/grill/guitest/build-pd-linux.sh11
-rw-r--r--externals/grill/guitest/config-pd-linux.txt27
-rw-r--r--externals/grill/guitest/flgui.cpp781
-rw-r--r--externals/grill/guitest/flgui.h237
-rw-r--r--externals/grill/guitest/flguiobj.cpp801
-rw-r--r--externals/grill/guitest/flguiobj.h362
-rw-r--r--externals/grill/guitest/guitest.vcproj226
-rw-r--r--externals/grill/guitest/main.cpp166
-rw-r--r--externals/grill/guitest/make-files.txt7
-rw-r--r--externals/grill/guitest/makefile.pd-linux87
-rw-r--r--externals/grill/guitest/pd/guitest1.pd7
11 files changed, 0 insertions, 2712 deletions
diff --git a/externals/grill/guitest/build-pd-linux.sh b/externals/grill/guitest/build-pd-linux.sh
deleted file mode 100644
index 413650f7..00000000
--- a/externals/grill/guitest/build-pd-linux.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-. config-pd-linux.txt
-
-make -f makefile.pd-linux &&
-{
- if [ $INSTPATH != "" ]; then
- echo Now install as root
- su -c "make -f makefile.pd-linux install"
- fi
-}
diff --git a/externals/grill/guitest/config-pd-linux.txt b/externals/grill/guitest/config-pd-linux.txt
deleted file mode 100644
index 7a0d3302..00000000
--- a/externals/grill/guitest/config-pd-linux.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright (c) 2002-2004 Thomas Grill (xovo@gmx.net)
-#
-
-# your c++ compiler (define only if it's different than g++)
-# CXX=g++
-
-# where are the PD header files?
-# leave it blank if it is a system directory (like /usr/local/include),
-# since gcc >= 3.2 complains about it
-PDPATH=/usr/src/pd-0.37-0/src
-
-# where do the flext libraries reside?
-FLEXTPATH=/usr/local/lib/pd/flext
-
-# where should flext libraries be built?
-TARGDIR=./pd-linux
-
-# where should the external be installed?
-# (leave blank to omit installation)
-INSTPATH=/usr/local/lib/pd/extra
-
-# user defined compiler flags
-UFLAGS=
-
-# define for shared build
-# FLEXT_SHARED=1
-
diff --git a/externals/grill/guitest/flgui.cpp b/externals/grill/guitest/flgui.cpp
deleted file mode 100644
index dc280b4b..00000000
--- a/externals/grill/guitest/flgui.cpp
+++ /dev/null
@@ -1,781 +0,0 @@
-#include "flgui.h"
-#include "flguiobj.h"
-#include "flinternal.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-
-#if FLEXT_SYS == FLEXT_SYS_PD
-t_class *flext_gui::px_class = NULL;
-t_class *flext_gui::pxkey_class = NULL;
-
-struct flext_gui::px_object // no virtual table!
-{
- t_object obj; // MUST reside at memory offset 0
- t_canvas *canv;
-
- void init(t_canvas *c) { canv = c; }
-};
-
-struct flext_gui::pxkey_object // no virtual table!
-{
- t_object obj; // MUST reside at memory offset 0
- flext_gui *th;
-
- void init(flext_gui *t) { th = t; }
-};
-#endif
-
-
-flext_gui::flext_gui(int xs,int ys):
- objs(NULL),
-#if FLEXT_SYS == FLEXT_SYS_PD
- xsize(xs),ysize(ys),
-#endif
-#if FLEXT_SYS == FLEXT_SYS_MAX
- curx(-1),cury(-1),curmod(-1),
- created(false),
-#endif
- bindsym(NULL)
-{
- canvas = new FCanvas(thisCanvas());
- objs = new GuiGroup(canvas);
-
-#if FLEXT_SYS == FLEXT_SYS_PD
- AddCanvas();
-#else
- t_box *b = (t_box *)gensym("#B")->s_thing;
-
- int x = b->b_rect.left,y = b->b_rect.top;
- t_pxbox *p = thisHdr();
- box_new(&p->z_box, thisCanvas(), F_DRAWFIRSTIN | F_GROWBOTH | F_SAVVY,x,y,x+xs,y+ys);
- p->z_box.b_firstin = (void *)p; /* it's not really an inlet */
- box_ready(&p->z_box);
-#endif
-}
-
-flext_gui::~flext_gui()
-{
-#if FLEXT_SYS == FLEXT_SYS_PD
- RmvCanvas();
-#endif
-
- delete objs;
- delete canvas;
-}
-
-
-void flext_gui::setup(t_classid c)
-{
-#if FLEXT_SYS == FLEXT_SYS_PD
- SetWidget(c);
-
- pxkey_class = class_new(gensym("flext_gui key proxy"),NULL,NULL,sizeof(pxkey_object),CLASS_PD|CLASS_NOINLET, A_NULL);
- add_anything(pxkey_class,pxkey_method);
- pxkey = (pxkey_object *)pd_new(pxkey_class);
-
- pd_bind(&pxkey_class,gensym("#keyname"));
-// pd_bind(&pxkey_class,gensym("#key"));
-// pd_bind(&pxkey_class,gensym("#keyup"));
-
- gcanv = NULL;
-
-#ifdef DIRECT_TK
- px_class = class_new(gensym("flext_gui proxy"),NULL,NULL,sizeof(px_object),CLASS_PD|CLASS_NOINLET, A_NULL);
- add_anything(px_class,px_method);
-
- gcm_motion = MakeSymbol("_tk_motion");
- gcm_mousekey = MakeSymbol("_tk_mousekey");
- gcm_mousewheel = MakeSymbol("_tk_mousewheel");
- gcm_key = MakeSymbol("_tk_key");
- gcm_destroy = MakeSymbol("_tk_destroy");
-#endif
-
- // this is wrong if a modifier key is pressed during creation of the first object.....
- curmod = 0;
-
-
-
- sys_gui(
- "proc flgui_apply {id} {\n"
- // strip "." from the TK id to make a variable name suffix
- "set vid [string trimleft $id .]\n"
-
- // for each variable, make a local variable to hold its name...
- "set var_graph_width [concat graph_width_$vid]\n"
- "global $var_graph_width\n"
- "set var_graph_height [concat graph_height_$vid]\n"
- "global $var_graph_height\n"
- "set var_graph_draw [concat graph_draw_$vid]\n"
- "global $var_graph_draw\n"
-
- "set cmd [concat $id dialog [eval concat $$var_graph_width] [eval concat $$var_graph_height] [eval concat $$var_graph_draw] \\;]\n"
- // puts stderr $cmd
- "pd $cmd\n"
- "}\n"
-
- "proc flgui_cancel {id} {\n"
- "set cmd [concat $id cancel \\;]\n"
- // puts stderr $cmd
- "pd $cmd\n"
- "}\n"
-
- "proc flgui_ok {id} {\n"
- "flgui_apply $id\n"
- "flgui_cancel $id\n"
- "}\n"
-
- "proc pdtk_flgui_dialog {id width height draw} {\n"
- "set vid [string trimleft $id .]\n"
-
- "set var_graph_width [concat graph_width_$vid]\n"
- "global $var_graph_width\n"
- "set var_graph_height [concat graph_height_$vid]\n"
- "global $var_graph_height\n"
- "set var_graph_draw [concat graph_draw_$vid]\n"
- "global $var_graph_draw\n"
-
- "set $var_graph_width $width\n"
- "set $var_graph_height $height\n"
- "set $var_graph_draw $draw\n"
-
- "toplevel $id\n"
- "wm title $id {flext}\n"
- "wm protocol $id WM_DELETE_WINDOW [concat flgui_cancel $id]\n"
-
- "label $id.label -text {Attributes}\n"
- "pack $id.label -side top\n"
-
- "frame $id.buttonframe\n"
- "pack $id.buttonframe -side bottom -fill x -pady 2m\n"
-
- "button $id.buttonframe.cancel -text {Cancel} -command \"flgui_cancel $id\"\n"
- "button $id.buttonframe.apply -text {Apply} -command \"flgui_apply $id\"\n"
- "button $id.buttonframe.ok -text {OK} -command \"flgui_ok $id\"\n"
-
- "pack $id.buttonframe.cancel -side left -expand 1\n"
- "pack $id.buttonframe.apply -side left -expand 1\n"
- "pack $id.buttonframe.ok -side left -expand 1\n"
-
- "frame $id.1rangef\n"
- "pack $id.1rangef -side top\n"
- "label $id.1rangef.lwidth -text \"Width :\"\n"
- "entry $id.1rangef.width -textvariable $var_graph_width -width 7\n"
- "pack $id.1rangef.lwidth $id.1rangef.width -side left\n"
-
- "frame $id.2rangef\n"
- "pack $id.2rangef -side top\n"
- "label $id.2rangef.lheight -text \"Height :\"\n"
- "entry $id.2rangef.height -textvariable $var_graph_height -width 7\n"
- "pack $id.2rangef.lheight $id.2rangef.height -side left\n"
-
- "checkbutton $id.draw -text {Draw Sample} -variable $var_graph_draw -anchor w\n"
- "pack $id.draw -side top\n"
-
- "bind $id.1rangef.width <KeyPress-Return> [concat flgui_ok $id]\n"
- "bind $id.2rangef.height <KeyPress-Return> [concat flgui_ok $id]\n"
- "focus $id.1rangef.width\n"
- "}\n"
- );
-
-#else
- addmess((method)sg_update, "update", A_CANT, A_NULL);
- addmess((method)sg_click, "click", A_CANT, A_NULL);
- addmess((method)sg_psave, "psave", A_CANT, A_NULL);
- addmess((method)sg_bfont, "bfont", A_CANT, A_NULL);
- addmess((method)sg_key, "key", A_CANT, A_NULL);
- addmess((method)sg_bidle, "bidle", A_CANT, A_NULL);
-#endif
-}
-
-#if FLEXT_SYS == FLEXT_SYS_PD
-
-// this event mask declares supported events
-int flext_gui::evmask = evMotion|evMouseDown|evMouseDrag|evKeyDown|evKeyUp|evKeyRepeat;
-int flext_gui::curmod = 0;
-flext_gui::pxkey_object *flext_gui::pxkey = NULL;
-flext_gui::guicanv *flext_gui::gcanv = NULL;
-
-#ifdef DIRECT_TK
-const t_symbol *flext_gui::gcm_motion = NULL;
-const t_symbol *flext_gui::gcm_mousekey = NULL;
-const t_symbol *flext_gui::gcm_mousewheel = NULL;
-const t_symbol *flext_gui::gcm_key = NULL;
-const t_symbol *flext_gui::gcm_destroy = NULL;
-
-void flext_gui::px_method(px_object *obj,const t_symbol *s,int argc,t_atom *argv)
-{
- guicanv *ix = gcanv;
- for(; ix && ix->canv != obj->canv; ix = ix->nxt);
-
- if(ix) {
- CBParams parms;
-
- if(s == gcm_motion) {
- parms.kind = evMotion;
- parms.pMotion.x = GetAInt(argv[0]);
- parms.pMotion.y = GetAInt(argv[1]);
- parms.pMotion.mod = GetAInt(argv[2]);
- }
- else if(s == gcm_mousekey) {
- parms.kind = GetAInt(argv[0])?evMouseDown:evMouseUp;
- parms.pMouseKey.x = GetAInt(argv[1]);
- parms.pMouseKey.y = GetAInt(argv[2]);
- parms.pMouseKey.b = GetAInt(argv[3]);
- parms.pMouseKey.mod = GetAInt(argv[4]);
- }
- else if(s == gcm_mousewheel) {
- parms.kind = evMouseWheel;
- parms.pMouseWheel.x = GetAInt(argv[0]);
- parms.pMouseWheel.y = GetAInt(argv[1]);
- parms.pMouseWheel.mod = GetAInt(argv[2]);
- parms.pMouseWheel.delta = GetAInt(argv[3]);
- }
- else if(s == gcm_key) {
- parms.kind = GetAInt(argv[0])?evKeyDown:evKeyUp;
- parms.pKey.k = GetAInt(argv[1]);
- parms.pKey.a = GetAInt(argv[2]);
-// parms.pKey.n = GetAInt(argv[3]);
- parms.pKey.mod = GetAInt(argv[4]);
- }
- else if(s == gcm_destroy) {
-// post("TK destroy");
- DelCanvas(ix->canv);
- }
-
- if(parms.kind != evNone) {
- for(canvobj *co = ix->head; co; co = co->nxt)
- co->guiobj->m_Method(parms);
- }
-
- }
- else
- error("flext_gui: canvas not found!");
-}
-
-#endif
-
-static const char *extkeys[] = {
- "Escape","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12",
- "Prior","Next","Home","End","Delete","Insert",""
-};
-
-void flext_gui::pxkey_method(pxkey_object *obj,const t_symbol *s,int argc,t_atom *argv)
-{
-/*
- if(s == sym_float && argc == 1) {
- lastkey = GetInt(argv[0]);
- }
- else
-*/
- if(s == sym_list && argc == 2) {
- CBParams p;
-
- bool down = GetABool(argv[0]);
- const char *str = GetString(argv[1]);
- int code = str[0];
- int asc = code;
- int mod = mod_None;
- if(code && str[1] != 0) {
- code = asc = 0;
- if(GetSymbol(argv[1]) == MakeSymbol("Shift_L") || GetSymbol(argv[1]) == MakeSymbol("Shift_R")) {
- code = 2001;
- mod = mod_Shift;
- }
- else if(GetSymbol(argv[1]) == MakeSymbol("Control_L") || GetSymbol(argv[1]) == MakeSymbol("Control_R")) {
- code = 2002;
- mod = mod_Ctrl;
- }
- else if(GetSymbol(argv[1]) == MakeSymbol("Alt_L") || GetSymbol(argv[1]) == MakeSymbol("Alt_R")) {
- code = 2003;
- mod = mod_Alt;
- }
- else {
- for(int i = 0;; ++i) {
- const char *ci = extkeys[i];
- if(!*ci) break;
- if(GetSymbol(argv[1]) == MakeSymbol(ci)) {
- code = 1000+i;
- break;
- }
- }
- }
-#if 0 //def FLEXT_DEBUG
- else
- post("unknown modifier %s",str);
-#endif
- }
-
- if(down) curmod |= mod;
- else curmod &= ~mod;
-
-// post("Key down=%i c=%c mod=%i",down?1:0,code,curmod);
-
- if(code || mod) {
- // remember past keycodes for repetition detection
- static int lastcode = 0,lastasc = 0,lastmod = 0;
-
- // button is pressed
- if(down) {
- if(lastcode == code && lastmod == curmod)
- p.kind = evKeyRepeat;
- else {
- p.kind = evKeyDown;
- lastcode = code;
- lastasc = asc;
- lastmod = curmod;
- }
- }
- else {
- p.kind = evKeyUp;
- lastcode = lastasc = 0;
- }
-
- p.ext = true;
- p.pKey.k = code; //lastkey;
- p.pKey.a = asc;
- p.pKey.mod = curmod;
-
- for(guicanv *ix = gcanv; ix; ix = ix->nxt)
- for(canvobj *ci = ix->head; ci; ci = ci->nxt)
- ci->guiobj->m_Method(p);
- }
- }
- else
- post("flext_gui key proxy - unknown method");
-}
-
-void flext_gui::g_Properties()
-{
- char buf[800];
- sprintf(buf, "pdtk_flgui_dialog %%s %d %d %d\n",0, 0, 0);
- gfxstub_new((t_pd *)thisHdr(), thisHdr(), buf);
-}
-
-
-flext_gui::guicanv::guicanv(t_canvas *c):
- canv(c),nxt(NULL),ref(0),
- head(NULL),tail(NULL)
-{
- char tmp[25];
- sprintf(tmp,"FLCANV%x",c);
- sym = MakeSymbol(tmp);
-
-#ifdef DIRECT_TK
- // proxy for canvas messages
- (px = (px_object *)pd_new(px_class))->init(c);
-#endif
-}
-
-flext_gui::guicanv::~guicanv()
-{
-#ifdef DIRECT_TK
- if(px) pd_free(&px->obj.ob_pd);
-#endif
-}
-
-void flext_gui::guicanv::Push(flext_gui *o)
-{
- canvobj *co = new canvobj(o);
- if(tail) tail->nxt = co;
- tail = co;
- if(!head) head = tail;
-
- ++ref;
-}
-
-void flext_gui::guicanv::Pop(flext_gui *o)
-{
- canvobj *prv = NULL,*ix = head;
- for(; ix && ix->guiobj != o; prv = ix,ix = ix->nxt);
-
- if(ix) {
- --ref;
- if(prv) prv->nxt = ix->nxt;
- else head = ix->nxt;
- if(!ix->nxt) tail = prv;
- }
- else
- error("flext_gui: object not found in canvas!");
-}
-
-
-void flext_gui::AddCanvas()
-{
- t_canvas *c = thisCanvas();
- guicanv *prv = NULL,*ix = gcanv;
- for(; ix && ix->canv != c; prv = ix,ix = ix->nxt);
-
- if(ix) {
- ix->Push(this);
- }
- else {
- guicanv *nc = new guicanv(c);
- if(prv) prv->nxt = nc;
- else gcanv = nc;
-
- nc->Push(this);
-
-#ifdef DIRECT_TK
- pd_bind(&nc->px->obj.ob_pd,(t_symbol *)nc->sym);
-
-/*
- // initialize new canvas object
- sys_vgui("bind .x%x.c <Motion> {pd %s %s %%x %%y %%s \\;}\n",c,GetString(nc->sym),GetString(gcm_motion));
-
- sys_vgui("bind .x%x.c <ButtonPress> {pd %s %s 1 %%x %%y %%b %%s \\;}\n",c,GetString(nc->sym),GetString(gcm_mousekey));
- sys_vgui("bind .x%x.c <ButtonRelease> {pd %s %s 0 %%x %%y %%b %%s \\;}\n",c,GetString(nc->sym),GetString(gcm_mousekey));
- sys_vgui("bind .x%x.c <MouseWheel> {pd %s %s %%x %%y %%s %%D \\;}\n",c,GetString(nc->sym),GetString(gcm_mousewheel));
- sys_vgui("bind .x%x.c <KeyPress> {pd %s %s 1 %%k %%A %%N %%s \\;}\n",c,GetString(nc->sym),GetString(gcm_key));
- sys_vgui("bind .x%x.c <KeyRelease> {pd %s %s 0 %%k %%A %%N %%s \\;}\n",c,GetString(nc->sym),GetString(gcm_key));
-
- // what happend to objects in subpatchers?
- sys_vgui("bind .x%x.c <Destroy> {pd %s %s \\;}\n",c,GetString(nc->sym),GetString(gcm_destroy));
-
- // sys_vgui("bind .x%x.c <Visibility> {pd %s %s %x %s \\;}\n",c,GetString(nc->sym),"_tk_visibility",this);
-*/
-#endif
- }
-}
-
-void flext_gui::RmvCanvas()
-{
- guicanv *ix = gcanv;
- for(; ix && ix->canv != thisCanvas(); ix = ix->nxt);
-
- if(ix) {
- ix->Pop(this);
- if(!ix->Refs()) DelCanvas(thisCanvas());
- }
- else {
- error("flext_gui: Canvas not found!");
- }
-}
-
-void flext_gui::DelCanvas(t_canvas *c)
-{
- guicanv *prv = NULL,*ix = gcanv;
- for(; ix && ix->canv != c; prv = ix,ix = ix->nxt);
-
- if(ix) {
-#ifdef DIRECT_TK
- pd_unbind(&ix->px->obj.ob_pd,(t_symbol *)ix->sym);
-#endif
-
- if(prv) prv->nxt = ix->nxt;
- else gcanv = ix->nxt;
- }
- else {
- error("flext_gui: Canvas not found!");
- }
-}
-
-static GuiObj *GetGuiObj(const t_atom &a)
-{
- GuiObj *th = NULL;
- sscanf(flext::GetString(a),"%x",&th);
- return th;
-}
-
-void flext_gui::g_Displace(int dx, int dy)
-{
-// post("Displace");
-
- XLo(XLo()+dx);
- YLo(YLo()+dy);
-
- Group().MoveRel(dx,dy);
- FixLines();
-}
-
-void flext_gui::g_Delete()
-{
- objs->Clear();
- DelLines();
-}
-
-
-
-t_widgetbehavior flext_gui::widgetbehavior;
-
-void flext_gui::SetWidget(t_class *c)
-{
- // widgetbehavior struct MUST be resident... (static is just ok here)
-
- widgetbehavior.w_getrectfn = sg_getrect;
- widgetbehavior.w_displacefn = sg_displace;
- widgetbehavior.w_selectfn = sg_select;
- widgetbehavior.w_activatefn = NULL; //sg_activate;
- widgetbehavior.w_deletefn = sg_delete;
- widgetbehavior.w_visfn = sg_vis;
- widgetbehavior.w_clickfn = sg_click;
-
-#if PD_MINOR_VERSION >= 37
- class_setpropertiesfn(c,sg_properties);
- class_setsavefn(c,sg_save);
-#else
- widgetbehavior.w_propertiesfn = sg_properties;
- widgetbehavior.w_savefn = sg_save;
-#endif
-
- class_setwidget(c, &widgetbehavior);
-}
-
-void flext_gui::sg_getrect(t_gobj *c, t_glist *,int *xp1, int *yp1, int *xp2, int *yp2)
-{
- flext_gui *th = thisObject(c);
- /*th->g_GetRect(*xp1,*yp1,*xp2,*yp2);*/
- *xp1 = th->XLo(),*yp1 = th->YLo(),*xp2 = th->XHi(),*yp2 = th->YHi();
-}
-
-void flext_gui::sg_displace(t_gobj *c, t_glist *, int dx, int dy)
-{
- thisObject(c)->g_Displace(dx,dy);
-}
-
-void flext_gui::sg_select(t_gobj *c, t_glist *, int selected)
-{
-// post("Select");
-
- flext_gui *th = thisObject(c);
- th->g_Edit(th->selected = (selected != 0));
-}
-
-void flext_gui::sg_vis(t_gobj *c, t_glist *, int vis)
-{
- post("Visible %i",vis);
-
- if(vis) {
- flext_gui *g = thisObject(c);
- g->g_Create();
- g->Group().MoveRel(g->XLo(),g->YLo());
- g->FixLines();
- }
-}
-
-int flext_gui::sg_click(t_gobj *c, t_glist *gl,int xpix, int ypix, int shift, int alt, int dbl, int doit)
-{
- flext_gui *g = thisObject(c);
- CBParams p;
- int x = xpix-g->XLo();
- int y = ypix-g->YLo();
-
- // PD bug: shift isn't reported for idle mousing
-// int mod = (alt?mod_Alt:0)+(shift?mod_Shift:0)+(dbl?mod_Double:0);
-
- if(doit) {
- // button is pressed
- p.kind = evMouseDown;
- p.pMouseKey.x = g->xdrag = x;
- p.pMouseKey.y = g->ydrag = y;
- g->dxdrag = g->dydrag = 0;
- p.pMouseKey.b = 1;
- p.pMouseKey.mod = curmod; //mod;
-
- glist_grab(gl,c,(t_glistmotionfn)sg_drag,0,xpix,ypix);
- }
- else {
- // only mouse position change
- p.kind = evMotion;
- p.pMotion.x = x;
- p.pMotion.y = y;
- p.pMotion.mod = curmod; //mod;
- }
- g->m_Method(p);
- return 1;
-}
-
-void flext_gui::sg_drag(t_gobj *c,t_floatarg dx,t_floatarg dy)
-{
- flext_gui *g = thisObject(c);
- CBParams p;
- p.kind = evMouseDrag;
- p.pMouseDrag.dx = (g->dxdrag += (int)dx);
- p.pMouseDrag.dy = (g->dydrag += (int)dy);
- p.pMouseDrag.x = g->xdrag+g->dxdrag;
- p.pMouseDrag.y = g->ydrag+g->dydrag;;
- p.pMouseDrag.b = 1;
- p.pMouseDrag.mod = curmod; //mod;
- g->m_Method(p);
-}
-
-void flext_gui::sg_delete(t_gobj *c, t_glist *)
-{
- thisObject(c)->g_Delete();
-}
-
-void flext_gui::sg_properties(t_gobj *c, t_glist *)
-{
- thisObject(c)->g_Properties();
-}
-
-void flext_gui::sg_save(t_gobj *c, t_binbuf *b)
-{
- thisObject(c)->g_Save(b);
-}
-
-/*
-bool flext_gui::sg_Key(flext_base *c,int argc,t_atom *argv)
-{
- return true;
-}
-
-bool flext_gui::sg_KeyNum(flext_base *c,int &keynum)
-{
- flext_gui *g = dynamic_cast<flext_gui *>(c);
- post("KeyNum %i",keynum);
- return true;
-}
-
-bool flext_gui::sg_KeyUp(flext_base *c,int &keynum)
-{
- flext_gui *g = dynamic_cast<flext_gui *>(c);
- post("KeyUp %i",keynum);
- return true;
-}
-*/
-
-#else // MAXMSP
-
-// this declared supported events
-int flext_gui::evmask = evMotion|evMouseDown|evKeyDown;
-
-static void dragfun()
-{
-}
-
-static void tmfun()
-{
-}
-
-void flext_gui::sg_click(t_object *x, Point pt, short m)
-{
- flext_gui *g = thisObject(x);
- CBParams p(evMouseDown);
- p.pMouseKey.x = pt.h-g->XLo();
- p.pMouseKey.y = pt.v-g->YLo();
- p.pMouseKey.b = 0;
- p.pMouseKey.mod = (m&256?mod_Meta:0)+(m&512?mod_Shift:0)+(m&1024?mod_Caps:0)+(m&2048?mod_Alt:0)+(m&4096?mod_Ctrl:0);
- g->m_Method(p);
-}
-
-void flext_gui::sg_update(t_object *x)
-{
- flext_gui *g = thisObject(x);
- if(!g->created) { g->g_Create(); g->created = true; }
-
- // draw elements
- g->Update();
-}
-
-void flext_gui::sg_psave (t_object *x, t_binbuf *dest) { thisObject(x)->g_Save(dest); }
-
-void flext_gui::sg_bfont (t_object *x, short size, short font) {}
-
-void flext_gui::sg_key (t_object *x, short keyvalue)
-{
- flext_gui *g = thisObject(x);
-
- CBParams p(evKeyDown);
- p.pKey.k = keyvalue;
- p.pKey.a = 0;
- p.pKey.mod = 0;
- g->m_Method(p);
-}
-
-void flext_gui::sg_enter (t_object *x) {}
-
-void flext_gui::sg_clipregion (t_object *x, RgnHandle *rgn, short *result) {}
-
-void flext_gui::sg_bidle (t_object *x)
-{
- flext_gui *g = thisObject(x);
- Point pnt; GetMouse(&pnt);
-
- CBParams p(evMotion);
- p.pMotion.x = pnt.h-g->XLo();
- p.pMotion.y = pnt.v-g->YLo();
- p.pMotion.mod = 0;
-
- if(p.pMotion.x != g->curx || p.pMotion.y != g->cury || p.pMotion.mod != g->curmod) {
- g->m_Method(p);
- g->curx = p.pMotion.x;
- g->cury = p.pMotion.y;
- g->curmod = p.pMotion.mod;
- }
-}
-
-void flext_gui::g_Displace(int dx, int dy)
-{
-}
-
-void flext_gui::g_Delete()
-{
- objs->Clear();
-}
-
-void flext_gui::Update()
-{
- box_ready(&thisHdr()->z_box);
-
- if(Group().Canv().Pre(XLo(),YLo()))
- Group().Draw();
- Group().Canv().Post();
-}
-
-#endif // PD / MAXMSP
-
-void flext_gui::m_Method(const CBParams &p)
-{
-/*
- switch(p.kind) {
- case evMotion: {
- // if(!g->Selected() || mod)
- post("Motion: x=%i y=%i m=%i",p.pMotion.x,p.pMotion.y,p.pMotion.mod);
- break;
- }
- case evMouseDown: {
- post("MouseDown: x=%i y=%i b=%i m=%i",p.pMouseKey.x,p.pMouseKey.y,p.pMouseKey.b,p.pMouseKey.mod);
- break;
- }
- case evMouseUp: {
- post("MouseUp: x=%i y=%i b=%i m=%i",p.pMouseKey.x,p.pMouseKey.y,p.pMouseKey.b,p.pMouseKey.mod);
- break;
- }
- case evMouseWheel: {
- post("Mousewheel: x=%i y=%i m=%i d=%i",p.pMouseWheel.x,p.pMouseWheel.y,p.pMouseWheel.mod,p.pMouseWheel.delta);
- break;
- }
- case evKeyDown: {
- post("KeyDown: k=%i a=%i m=%i",p.pKey.k,p.pKey.a,p.pKey.mod);
- break;
- }
- case evKeyUp: {
- post("KeyUp: k=%i a=%i m=%i",p.pKey.k,p.pKey.a,p.pKey.mod);
- break;
- }
- }
-*/
- if(!Selected() || p.kind != evMotion || p.kind != evMouseDown || p.kind != evMouseUp)
- Group().Method(*this,p);
- }
-
-bool flext_gui::BindEvent(GuiSingle &o,bool (*cb)(flext_gui &o,GuiSingle &obj,const CBParams &p),int evs)
-{
- if((evs&EventMask()) == evs) {
- o.AddEvent(evs,cb);
- return true;
- }
- else
- // not all requested events supported
- return false;
-}
-
-void flext_gui::UnbindEvent(GuiSingle &o,bool (*cb)(flext_gui &o,GuiSingle &obj,const CBParams &p),int evs)
-{
- o.RmvEvent(evs,cb);
-}
-
-
diff --git a/externals/grill/guitest/flgui.h b/externals/grill/guitest/flgui.h
deleted file mode 100644
index 0f62f01b..00000000
--- a/externals/grill/guitest/flgui.h
+++ /dev/null
@@ -1,237 +0,0 @@
-#ifndef __FLEXT_GUI
-#define __FLEXT_GUI
-
-//#define FLEXT_VIRT
-#include <flext.h>
-
-#if FLEXT_SYS == FLEXT_SYS_PD
-#pragma warning( disable : 4091 )
-#include <g_canvas.h>
-#endif
-
-class FCanvas;
-class GuiObj;
-class GuiGroup;
-class GuiSingle;
-
-class flext_gui:
- public flext_base
-{
- FLEXT_HEADER_S(flext_gui,flext_dsp,setup)
-
-public:
- flext_gui(int xs,int ys);
- ~flext_gui();
-
- enum CBEvs {
- evNone = 0,
- evMotion = 0x01,
- evMouseDown = 0x02,
- evMouseUp = 0x04,
- evMouseWheel = 0x08,
- evMouseDrag = 0x10,
- evKeyDown = 0x20,
- evKeyUp = 0x40,
- evKeyRepeat = 0x80
- };
-
- class CBParams {
- public:
- CBParams(CBEvs k = evNone): kind(k),ext(false) {}
-
- CBEvs kind;
- union {
- struct { int x,y,mod; } pMotion;
- struct { int x,y,b,mod; } pMouseKey;
- struct { int x,y,mod,delta; } pMouseWheel;
- struct { int x,y,dx,dy,b,mod; } pMouseDrag;
- struct { int k,a,mod; } pKey;
- };
- bool ext;
- };
-
- static int EventMask() { return evmask; }
-
- bool BindEvent(GuiSingle &o,bool (*cb)(flext_gui &o,GuiSingle &obj,const CBParams &p),int evs);
- void UnbindEvent(GuiSingle &o,bool (*cb)(flext_gui &o,GuiSingle &obj,const CBParams &p),int evs);
-
-protected:
-
- virtual void g_Create() {}
- virtual void g_Delete();
-// virtual void g_GetRect(int &xp1,int &yp1,int &xp2,int &yp2);
- virtual void g_Edit(bool selected) {}
- virtual void g_Displace(int dx, int dy);
-// virtual void g_Activate(bool state) {}
-// virtual int g_Click(int xpix, int ypix, int shift, int alt, int dbl, int doit) { return 0; }
- virtual void g_Properties();
- virtual void g_Save(t_binbuf *b) {}
-/*
- virtual bool g_Motion(GuiObj &obj,int x,int y,int mod) { return false; }
- virtual bool g_MouseKey(GuiObj &obj,bool down,int x,int y,int b,int mod) { return false; }
- virtual bool g_MouseWheel(GuiObj &obj,int x,int y,int d,int mod) { return false; }
- virtual bool g_Key(GuiObj &obj,bool down,int k,int a,int n,int mod) { return false; }
- virtual bool g_Region(GuiObj &obj,bool on,int mod) { return false; }
- virtual bool g_Focus(GuiObj &obj,bool on,int mod) { return false; }
-*/
-
-#if FLEXT_SYS == FLEXT_SYS_PD
- bool Selected() const { return selected; }
-
- void FixLines() { canvas_fixlinesfor( thisCanvas(), thisHdr() ); }
- void DelLines() { canvas_deletelinesfor( glist_getcanvas(thisCanvas()), (t_text *)thisHdr()); }
-
- int XLo() const { return thisHdr()->te_xpix; }
- int YLo() const { return thisHdr()->te_ypix; }
- int XHi() const { return XLo()+XSize()-1; }
- int YHi() const { return YLo()+YSize()-1; }
- void XLo(int x) { thisHdr()->te_xpix = x; }
- void YLo(int y) { thisHdr()->te_ypix = y; }
-
- int XSize() const { return xsize; }
- int YSize() const { return ysize; }
-#else // MAXMSP
- bool Selected() const { return box_ownerlocked((t_box *)(&thisHdr()->z_box)) == 0; }
-
- void FixLines() {}
- void DelLines() {}
-
- int XLo() const { return thisHdr()->z_box.b_rect.left; }
- int YLo() const { return thisHdr()->z_box.b_rect.top; }
- int XHi() const { return thisHdr()->z_box.b_rect.right; }
- int YHi() const { return thisHdr()->z_box.b_rect.bottom; }
- void XLo(int x) { thisHdr()->z_box.b_rect.left = x; }
- void YLo(int y) { thisHdr()->z_box.b_rect.top = y; }
-
- int XSize() const { return XHi()-XLo()+1; }
- int YSize() const { return YHi()-YLo()+1; }
-#endif
-
- const t_symbol *Id() const { return bindsym; }
-
- GuiGroup &Group() { return *objs; }
-
-
-// static void Setup(t_class *c);
-
-
- enum Modifier {
- mod_None = 0,
- mod_Ctrl = 0x0001,
- mod_Shift = 0x0002,
- mod_Alt = 0x0004,
- mod_Meta = 0x0008,
- mod_Mod1 = 0x0010,
- mod_Mod2 = 0x0020,
- mod_Mod3 = 0x0040,
- mod_Caps = 0x0080,
- mod_Double = 0x0100,
-// mod_Triple = 0x0200,
- mod_Button1 = 0x1000,
- mod_Button2 = 0x2000,
- mod_Button3 = 0x4000,
- mod_Button4 = 0x8000
- };
-
-private:
- bool visible;
- FCanvas *canvas;
- GuiGroup *objs;
-
- const t_symbol *bindsym;
-
- static int evmask;
-
- static void setup(t_class *);
-
- virtual void m_Method(const CBParams &p);
-
-#if FLEXT_SYS == FLEXT_SYS_PD
- bool selected;
- int xsize,ysize;
- int xdrag,ydrag,dxdrag,dydrag;
-
- static void sg_getrect(t_gobj *c, t_glist *,int *xp1, int *yp1, int *xp2, int *yp2);
- static void sg_displace(t_gobj *c, t_glist *, int dx, int dy);
- static void sg_select(t_gobj *c, t_glist *, int selected);
-// static void sg_activate(t_gobj *c, t_glist *, int state) { thisObject(c)->g_Activate(state != 0); }
- static void sg_delete(t_gobj *c, t_glist *);
- static void sg_vis(t_gobj *c, t_glist *, int vis);
- static int sg_click(t_gobj *c, t_glist *,int xpix, int ypix, int shift, int alt, int dbl, int doit);
- static void sg_drag(t_gobj *x, t_floatarg dx, t_floatarg dy);
- static void sg_properties(t_gobj *c, t_glist *);
- static void sg_save(t_gobj *c, t_binbuf *b);
-// static void sg_motion(void *c, float dx,float dy) { thisObject((t_gobj *)c)->g_Motion(dx,dy); }
-
- static bool sg_Key(flext_base *c,int argc,t_atom *argv);
- static bool sg_KeyNum(flext_base *c,int &keynum);
- static bool sg_KeyUp(flext_base *c,int &keynum);
-
- static t_widgetbehavior widgetbehavior;
- static void SetWidget(t_class *c);
-
- struct px_object;
- struct pxkey_object;
- static int curmod; //,lastkey;
- static pxkey_object *pxkey;
-
- class canvobj {
- public:
- canvobj(flext_gui *go): guiobj(go),nxt(NULL) {}
-
- flext_gui *guiobj;
- canvobj *nxt;
- };
-
- class guicanv {
- public:
- guicanv(t_canvas *c);
- ~guicanv();
-
- int Refs() const { return ref; }
- void Push(flext_gui *o);
- void Pop(flext_gui *o);
-
-#ifdef DIRECT_TK
- px_object *px;
-#endif
- const t_symbol *sym;
- t_canvas *canv;
- guicanv *nxt;
- canvobj *head,*tail;
- int ref;
- };
-
- static guicanv *gcanv;
- static const t_symbol *gcm_motion,*gcm_mousekey,*gcm_mousewheel,*gcm_key,*gcm_destroy;
- static void px_method(px_object *c,const t_symbol *s,int argc,t_atom *argv);
- static void pxkey_method(pxkey_object *c,const t_symbol *s,int argc,t_atom *argv);
-
- void AddCanvas();
- void RmvCanvas();
- static void DelCanvas(t_canvas *c);
-
-public:
- static t_class *px_class,*pxkey_class;
- static void sg_tk(t_canvas *c,const t_symbol *s,int argc,t_atom *argv);
-
-#else // MAXMSP
- int curx,cury,curmod;
- bool created;
- static t_clock clock;
- static t_qelem qelem;
-
- void Update();
-
- static void sg_click(t_object *x, Point pt, short modifiers);
- static void sg_update(t_object *x);
- static void sg_psave (t_object *x, t_binbuf *dest);
- static void sg_bfont (t_object *x, short size, short font);
- static void sg_key (t_object *x,short keyvalue);
- static void sg_enter (t_object *x);
- static void sg_clipregion (t_object *x, RgnHandle *rgn, short *result);
- static void sg_bidle(t_object *x);
-#endif
-};
-
-#endif
diff --git a/externals/grill/guitest/flguiobj.cpp b/externals/grill/guitest/flguiobj.cpp
deleted file mode 100644
index 7bb22098..00000000
--- a/externals/grill/guitest/flguiobj.cpp
+++ /dev/null
@@ -1,801 +0,0 @@
-#include "flguiobj.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-
-#define USETAGS
-
-#define BUFSIZE 20000
-#define ZONE 1000
-
-
-#if FLEXT_SYS == FLEXT_SYS_PD
-bool FCanvas::store = true;
-bool FCanvas::debug = false;
-#endif
-
-FCanvas::FCanvas(t_canvas *c):
- canvas(c)
-#if FLEXT_SYS == FLEXT_SYS_PD
- ,buffer(new char[BUFSIZE]),bufix(0),waiting(0)
-#endif
-{}
-
-FCanvas::~FCanvas()
-{
-#if FLEXT_SYS == FLEXT_SYS_PD
- if(buffer) delete[] buffer;
-#endif
-}
-
-#if FLEXT_SYS == FLEXT_SYS_PD
-void FCanvas::Send(const char *t)
-{
- if(debug) post("GUI - %s",t);
- sys_gui((char *)t);
-}
-
-void FCanvas::SendBuf()
-{
- if(bufix) {
- Send(buffer);
- bufix = 0;
- }
-}
-
-void FCanvas::ToBuf(const char *t)
-{
- int len = strlen(t);
- if(!len) return;
-
- bool end = t[len-1] == '\n';
- if((store && waiting) || !end) {
- int nxt = bufix+len;
- if(nxt >= BUFSIZE || (end && nxt >= BUFSIZE-ZONE)) SendBuf();
-
- memcpy(buffer+bufix,t,len);
- buffer[bufix += len] = 0;
- }
- else {
- SendBuf();
- Send(t);
- }
-}
-
-FCanvas &FCanvas::TkC()
-{
- char tmp[20];
- sprintf(tmp,".x%x.c ",canvas);
- ToBuf(tmp);
- return *this;
-}
-
-FCanvas &FCanvas::TkE()
-{
- ToBuf("\n");
- return *this;
-}
-
-FCanvas &FCanvas::Tk(char *fmt,...)
-{
- // int result, i;
- char buf[2048];
- va_list ap;
-
- va_start(ap, fmt);
- vsprintf(buf, fmt, ap);
- ToBuf(buf);
- va_end(ap);
- return *this;
-}
-#endif
-
-bool FCanvas::Pre(int x,int y)
-{
- xpos = x,ypos = y;
-#if FLEXT_SYS == FLEXT_SYS_PD
- ++waiting;
- return true;
-#else
- svgp = patcher_setport(canvas);
- if(svgp != NULL) {
- GetForeColor(&svcol);
- GetPenState(&svpen);
- ::PenMode(patCopy);
- return true;
- }
- else return false;
-#endif
-}
-
-void FCanvas::Post()
-{
-#if FLEXT_SYS == FLEXT_SYS_PD
- if(!--waiting) SendBuf();
-#else
- if(svgp) {
- RGBForeColor(&svcol);
- SetPenState(&svpen);
- SetPort(svgp);
- }
-#endif
-}
-
-
-// --------------------------------------------------------------------------
-
-
-FRect &FRect::Add(const FPnt &p)
-{
- if(p.x < lo.x) lo.x = p.x;
- if(p.y < lo.y) lo.y = p.y;
- if(p.x > hi.x) hi.x = p.x;
- if(p.y > hi.y) hi.y = p.y;
- return *this;
-}
-
-FRect &FRect::Add(const FRect &r)
-{
- if(r.lo.x < lo.x) lo.x = r.lo.x;
- if(r.lo.y < lo.y) lo.y = r.lo.y;
- if(r.hi.x > hi.x) hi.x = r.hi.x;
- if(r.hi.y > hi.y) hi.y = r.hi.y;
- return *this;
-}
-
-bool FRect::In(const FPnt &p) const
-{
- return p.x >= lo.x && p.x <= hi.x && p.y >= lo.y && p.y <= hi.y;
-}
-
-bool FRect::Inter(const FRect &r) const
-{
- return true;
-}
-
-
-// --------------------------------------------------------------------------
-
-
-GuiObj::GuiObj(FCanvas *c,GuiGroup *p):
- canvas(c),idsym(NULL),
- parent(p)
-// ,ori(0,0)
-{}
-
-GuiObj::~GuiObj()
-{
-// Delete();
-}
-
-
-// --------------------------------------------------------------------------
-
-GuiSingle::Event::Event(int evmask,bool (*m)(flext_gui &g,GuiSingle &obj,const flext_gui::CBParams &p)):
- methfl(evmask),method(m),ext(false),nxt(NULL)
-{}
-
-GuiSingle::Event::~Event() { if(nxt) delete nxt; }
-
-
-GuiSingle::GuiSingle(FCanvas *c,GuiGroup *p,const t_symbol *s):
- GuiObj(c,p),sym(s),active(false),event(NULL)
-{
- char tmp[20];
-#ifdef __MWERKS__
- std::
-#endif
- sprintf(tmp,"GUI%x",this);
- idsym = MakeSymbol(tmp);
-}
-
-GuiSingle::~GuiSingle()
-{
- Delete();
- if(event) delete event;
-}
-
-void GuiSingle::Symbol(const t_symbol *s)
-{
- sym = s;
-}
-
-GuiSingle *GuiSingle::Find(const t_symbol *s)
-{
- return sym == s?this:NULL;
-}
-
-GuiObj &GuiSingle::MoveTo(int x,int y)
-{
-#if FLEXT_SYS == FLEXT_SYS_PD
- if(active) {
- canvas->TkC().Tk("coords %s %i %i\n",GetString(Id()), x, y);
- }
-#endif
- rect.MoveTo(x,y);
- return *this;
-}
-
-GuiObj &GuiSingle::MoveRel(int dx,int dy)
-{
-#if FLEXT_SYS == FLEXT_SYS_PD
- if(active) {
- canvas->TkC().Tk("move %s %i %i\n",GetString(Id()), dx, dy);
- }
-#endif
- rect.Move(dx,dy);
- return *this;
-}
-
-GuiObj &GuiSingle::Delete()
-{
-#if FLEXT_SYS == FLEXT_SYS_PD
- if(active) {
- canvas->TkC().Tk("delete -tags %s\n",GetString(Id()));
- active = false;
- }
-#endif
- return *this;
-}
-
-GuiObj &GuiSingle::FillColor(unsigned long col)
-{
-#if FLEXT_SYS == FLEXT_SYS_PD
- if(active) {
- canvas->TkC().Tk("itemconfigure %s -fill #%06x\n",GetString(Id()),col);
- }
-#endif
- return *this;
-}
-
-GuiObj &GuiSingle::Outline(unsigned long col)
-{
-#if FLEXT_SYS == FLEXT_SYS_PD
- if(active) {
- canvas->TkC().Tk("itemconfigure %s -outline #%06x\n",GetString(Id()),col);
- }
-#endif
- return *this;
-}
-
-GuiObj &GuiSingle::Focus()
-{
-#if FLEXT_SYS == FLEXT_SYS_PD
- if(active) {
- canvas->TkC().Tk("focus %s\n",GetString(Id()));
- }
-#endif
- return *this;
-}
-
-bool GuiSingle::Method(flext_gui &g,const flext_gui::CBParams &p)
-{
- bool ret = true;
- for(Event *ei = event; ei && ret; ei = ei->nxt)
- ret = ret && ((ei->method && (ei->methfl&p.kind))?ei->method(g,*this,p):true);
- return ret;
-}
-
-void GuiSingle::AddEvent(int evmask,bool (*m)(flext_gui &g,GuiSingle &obj,const flext_gui::CBParams &p))
-{
- Event *prv = NULL,*ix = event;
- for(; ix && ix->method != m; prv = ix,ix = ix->nxt) {}
-
- if(ix)
- // previous handler found -> update event mask
- ix->methfl |= evmask;
- else {
- // no previous handler was found -> make new one
-
- Event *nev = new Event(evmask,m);
- if(prv) prv->nxt = nev;
- else event = nev;
- }
-}
-
-void GuiSingle::RmvEvent(int evmask,bool (*m)(flext_gui &g,GuiSingle &obj,const flext_gui::CBParams &p))
-{
- Event *prv = NULL,*ix = event;
- for(; ix && ix->method != m; prv = ix,ix = ix->nxt) {}
-
- if(ix) {
- // handler found
-
- if(!(ix->methfl &= ~evmask)) {
- // mask has become zero -> remove handler
-
- if(prv) prv->nxt = ix->nxt;
- else event = ix->nxt;
- ix->nxt = NULL;
- delete ix;
- }
- }
-}
-
-
-
-// --------------------------------------------------------------------------
-
-
-GuiGroup::GuiGroup(FCanvas *c,GuiGroup *p):
- GuiObj(c,p),head(NULL),tail(NULL)
-{
- char tmp[20];
-#ifdef __MWERKS__
- std::
-#endif
- sprintf(tmp,"GRP%x",this);
- idsym = MakeSymbol(tmp);
-}
-
-GuiGroup::~GuiGroup() { Clear(); }
-
-void GuiGroup::Clear()
-{
- for(Part *ix = head; ix; ) {
- Part *n = ix->nxt;
-#if FLEXT_SYS == FLEXT_SYS_PD
- RemoveTag(ix->obj);
-#endif
- if(ix->owner) delete ix->obj;
- delete ix;
- ix = n;
- }
- head = tail = NULL;
-}
-
-void GuiGroup::Add(GuiObj *o,bool owner)
-{
- o->canvas = canvas;
-#if FLEXT_SYS == FLEXT_SYS_PD
- AddTag(o); // valid only for GuiSingle!
-#endif
- Part *n = new Part(o,owner);
- if(!head) head = n;
- else tail->nxt = n;
- tail = n;
-
- rect.Add(o->rect);
-}
-
-GuiSingle *GuiGroup::Find(const t_symbol *s)
-{
- GuiSingle *r = NULL;
- for(Part *ix = head; ix && !r; ix = ix->nxt) {
- r = ix->obj->Find(s);
- }
- return r;
-}
-
-GuiSingle *GuiGroup::Detach(const t_symbol *s)
-{
- if(head) {
- Part *p = NULL,*ix = head;
- while(ix) {
- if(ix->obj->Symbol() == s) {
- // found
- if(p) p->nxt = ix->nxt;
- GuiSingle *ret = (GuiSingle *)(ix->obj);
-
-#if FLEXT_SYS == FLEXT_SYS_PD
- RemoveTag(ret);
-#endif
- if(head == ix) head = ix->nxt;
- if(tail == ix) tail = p;
-
- delete ix;
-
- return ret;
- }
- else p = ix,ix = ix->nxt;
- }
- }
- return NULL;
-}
-
-GuiObj &GuiGroup::MoveRel(int dx,int dy)
-{
-#if FLEXT_SYS == FLEXT_SYS_PD
- canvas->TkC().Tk("move %s %i %i\n",GetString(Id()), dx, dy);
-#endif
- for(Part *ix = head; ix; ix = ix->nxt) {
- ix->obj->rect.Move(dx,dy);
- }
- return *this;
-}
-
-GuiObj &GuiGroup::Delete()
-{
-#if FLEXT_SYS == FLEXT_SYS_PD
- canvas->TkC().Tk("delete -tags %s\n",GetString(Id()));
-
- for(Part *ix = head; ix; ix = ix->nxt) ix->obj->Inactive();
-#endif
- return *this;
-}
-
-
-GuiObj &GuiGroup::Draw()
-{
- for(Part *ix = head; ix; ix = ix->nxt) ix->obj->Draw();
- return *this;
-}
-
-
-#if FLEXT_SYS == FLEXT_SYS_PD
-
-void GuiGroup::AddTag(GuiObj *o)
-{
- canvas->TkC().Tk("addtag %s withtag %s\n",GetString(Id()),GetString(o->Id()));
-}
-
-void GuiGroup::RemoveTag(GuiObj *o)
-{
- canvas->TkC().Tk("dtag %s %s\n",GetString(o->Id()),GetString(Id()));
-}
-
-#endif
-
-GuiGroup *GuiGroup::Add_Group()
-{
- GuiGroup *obj = new GuiGroup(canvas,this);
- Add(obj);
- return obj;
-}
-
-
-GuiSingle *GuiGroup::Add_Point(int x,int y,long fill)
-{
- GuiPoint *obj = new GuiPoint(canvas,this);
- obj->Set(x,y,fill);
- Add(obj);
- return obj;
-}
-
-GuiSingle *GuiGroup::Add_Cloud(int n,const FPnt *p,long fill)
-{
- GuiCloud *obj = new GuiCloud(canvas,this);
- obj->Set(n,p,fill);
- Add(obj);
- return obj;
-}
-
-GuiSingle *GuiGroup::Add_Box(int x,int y,int xsz,int ysz,int width,long fill,long outl)
-{
- GuiBox *obj = new GuiBox(canvas,this);
- obj->Set(x,y,xsz,ysz,width,fill,outl);
- Add(obj);
- return obj;
-}
-
-GuiSingle *GuiGroup::Add_Rect(int x,int y,int xsz,int ysz,int width,long outl)
-{
- GuiRect *obj = new GuiRect(canvas,this);
- obj->Set(x,y,xsz,ysz,width,outl);
- Add(obj);
- return obj;
-}
-
-GuiSingle *GuiGroup::Add_Line(int x1,int y1,int x2,int y2,int width,long fill)
-{
- GuiLine *obj = new GuiLine(canvas,this);
- obj->Set(x1,y1,x2,y2,width,fill);
- Add(obj);
- return obj;
-}
-
-GuiSingle *GuiGroup::Add_Poly(int n,const FPnt *p,int width,long fill)
-{
- GuiPoly *obj = new GuiPoly(canvas,this);
- obj->Set(n,p,width,fill);
- Add(obj);
- return obj;
-}
-
-GuiSingle *GuiGroup::Add_Text(int x,int y,const char *txt,long fill,GuiText::just_t just)
-{
- GuiText *obj = new GuiText(canvas,this);
- obj->Set(x,y,txt,fill,just);
- Add(obj);
- return obj;
-}
-
-GuiSingle *GuiGroup::Remove(GuiSingle *go)
-{
- for(Part *prv = NULL,*ix = head; ix; prv = ix,ix = ix->nxt)
- if(ix->obj == go) {
- if(prv) prv->nxt = ix->nxt;
- else head = ix->nxt;
- if(!head) tail = NULL;
-
- GuiObj *ret = ix->obj;
- delete ix;
-
- if(head) {
- rect = head->obj->rect;
- for(ix = head->nxt; ix; ix = ix->nxt) rect.Add(ix->obj->rect);
- }
-
- return (GuiSingle *)ret;
- }
-
- return NULL;
-}
-
-bool GuiGroup::Method(flext_gui &g,const flext_gui::CBParams &p)
-{
- bool go = true;
- for(Part *ix = head; go && ix; ix = ix->nxt) go = go && ix->obj->Method(g,p);
- return go;
-}
-
-
-// --------------------------------------------------------------------------
-
-
-GuiObj &GuiPoint::Set(int x,int y,long fl)
-{
- Delete();
- fill = fl;
- rect(x,y,x,y);
-
-#if FLEXT_SYS == FLEXT_SYS_PD
- canvas->TkC();
- canvas->Tk("create line %i %i %i %i -tags %s",x,y,x+1,y,GetString(Id()));
- if(fill >= 0) canvas->Tk(" -fill #%06x",fill);
- canvas->TkE();
-
- active = true;
-#endif
- return *this;
-}
-
-GuiObj &GuiPoint::Draw()
-{
-#if FLEXT_SYS == FLEXT_SYS_MAX
-#endif
- return *this;
-}
-
-
-GuiObj &GuiCloud::Set(int n,const FPnt *p,long fl)
-{
- int i;
- Delete();
-
- fill = fl;
- pnt = new FPnt[pnts = n];
- rect(pnt[0] = p[0],p[0]);
- for(i = 1; i < n; ++i) rect.Add(pnt[i] = p[i]);
-
-#if FLEXT_SYS == FLEXT_SYS_PD
- canvas->TkC().Tk("create line");
- for(i = 0; i < n; ++i)
- canvas->Tk(" %i %i",p[i].X(),p[i].Y());
- canvas->Tk(" -tags %s",GetString(Id()));
- if(fill >= 0) canvas->Tk(" -fill #%06x",fill);
- canvas->TkE();
-
- active = true;
-#endif
- return *this;
-}
-
-GuiObj &GuiCloud::Draw()
-{
-#if FLEXT_SYS == FLEXT_SYS_MAX
-#endif
- return *this;
-}
-
-GuiObj &GuiCloud::Delete()
-{
- if(pnt) { delete[] pnt; pnt = NULL; }
- return *this;
-}
-
-
-GuiObj &GuiBox::Set(int x,int y,int xsz,int ysz,int wd,long fl,long outl)
-{
- Delete();
- rect(x,y,x+xsz-1,y+ysz-1);
- width = wd,fill = fl,outln = outl;
-
-#if FLEXT_SYS == FLEXT_SYS_PD
- canvas->TkC().Tk("create rectangle %i %i %i %i -tags %s",x,y,x+xsz,y+ysz,GetString(Id()));
- if(wd >= 0) canvas->Tk(" -width %i",wd);
- if(fl >= 0) canvas->Tk(" -fill #%06x",fl);
- if(outl >= 0) canvas->Tk(" -outline #%06x",outl);
- canvas->TkE();
-
- active = true;
-#endif
- return *this;
-}
-
-GuiObj &GuiBox::Draw()
-{
-#if FLEXT_SYS == FLEXT_SYS_MAX
- ::Rect r;
- ::RGBColor col;
- int w = width;
- if(!w) w = 1;
-
- r.left = Canv().X()+rect.Lo().X();
- r.top = Canv().Y()+rect.Lo().Y();
- r.right = Canv().X()+rect.Hi().X();
- r.bottom = Canv().Y()+rect.Hi().Y();
-
- if(width >= 0) {
- col.red = (outln>>8)&0xff00;
- col.green = outln&0xff00;
- col.blue = (outln&0xff)<<8;
- ::RGBForeColor(&col);
- ::PenSize(w,w);
- ::FrameRect(&r);
- }
- col.red = (fill>>8)&0xff00;
- col.green = fill&0xff00;
- col.blue = (fill&0xff)<<8;
- ::RGBForeColor(&col);
- ::PaintRect(&r);
-#endif
- return *this;
-}
-
-
-GuiObj &GuiRect::Set(int x,int y,int xsz,int ysz,int wd,long outl)
-{
- Delete();
- rect(x,y,x+xsz-1,y+ysz-1);
- width = wd,outln = outl;
-
-#if FLEXT_SYS == FLEXT_SYS_PD
- canvas->TkC().Tk("create line %i %i %i %i %i %i %i %i %i %i -tags %s",x,y,x+xsz,y,x+xsz,y+ysz,x,y+ysz,x,y,GetString(Id()));
- if(width >= 0) canvas->Tk(" -width %i",width);
- if(outl >= 0) canvas->Tk(" -fill #%06x",outl);
- canvas->TkE();
-
- active = true;
-#endif
- return *this;
-}
-
-GuiObj &GuiRect::Draw()
-{
-#if FLEXT_SYS == FLEXT_SYS_MAX
-#endif
- return *this;
-}
-
-
-GuiObj &GuiLine::Set(int x1,int y1,int x2,int y2,int wd,long fl)
-{
- Delete();
- rect(p1(x1,y1),p2(x2,y2));
- width = wd,fill = fl;
-
-#if FLEXT_SYS == FLEXT_SYS_PD
- canvas->TkC().Tk("create line %i %i %i %i -tags %s",x1,y1,x2,y2,GetString(Id()));
- if(width >= 0) canvas->Tk(" -width %i",width);
- if(fill >= 0) canvas->Tk(" -fill #%06x",fill);
- canvas->TkE();
-
- active = true;
-#endif
- return *this;
-}
-
-GuiObj &GuiLine::Draw()
-{
-#if FLEXT_SYS == FLEXT_SYS_MAX
- ::Point p;
- ::RGBColor col;
- int w = width;
- if(!w) w = 1;
-
- col.red = (fill>>8)&0xff00;
- col.green = fill&0xff00;
- col.blue = (fill&0xff)<<8;
- ::RGBForeColor(&col);
- ::PenSize(w,w);
- p.h = Canv().X()+p1.X();
- p.v = Canv().Y()+p1.Y();
- ::MoveTo(p.h,p.v);
- p.h = Canv().X()+p2.X();
- p.v = Canv().Y()+p2.Y();
- ::LineTo(p.h,p.v);
-#endif
- return *this;
-}
-
-
-GuiObj &GuiPoly::Set(int n,const FPnt *p,int wd,long fl)
-{
- int i;
-
- Delete();
-
- width = wd,fill = fl;
- pnt = new FPnt[pnts = n];
- rect(pnt[0] = p[0],p[0]);
- for(i = 1; i < n; ++i) rect.Add(pnt[i] = p[i]);
-
-#if FLEXT_SYS == FLEXT_SYS_PD
- canvas->TkC().Tk("create line");
- for(i = 0; i < n; ++i)
- canvas->Tk(" %i %i",p[i].X(),p[i].Y());
- canvas->Tk(" -tags %s",GetString(Id()));
- if(width >= 0) canvas->Tk(" -width %i",width);
- if(fill >= 0) canvas->Tk(" -fill #%06x",fill);
- canvas->TkE();
-
- active = true;
-#endif
- return *this;
-}
-
-GuiObj &GuiPoly::Draw()
-{
-#if FLEXT_SYS == FLEXT_SYS_MAX
- ::Point p;
- ::RGBColor col;
- int ox = Canv().X(),oy = Canv().Y();
- int w = width;
- if(!w) w = 1;
-
- col.red = (fill>>8)&0xff00;
- col.green = fill&0xff00;
- col.blue = (fill&0xff)<<8;
- ::RGBForeColor(&col);
- ::PenSize(w,w);
- p.h = ox+pnt[0].X();
- p.v = oy+pnt[0].Y();
- ::MoveTo(p.h,p.v);
- for(int i = 1; i < pnts; ++i) {
- p.h = ox+pnt[i].X();
- p.v = oy+pnt[i].Y();
- ::LineTo(p.h,p.v);
- }
-#endif
- return *this;
-}
-
-GuiObj &GuiPoly::Delete()
-{
- if(pnt) { delete[] pnt; pnt = NULL; }
- return *this;
-}
-
-
-GuiObj &GuiText::Set(int x,int y,const char *txt,long fl,just_t jt)
-{
- Delete();
- rect(x,y,x,y);
- fill = fl,just = jt;
-
-#if FLEXT_SYS == FLEXT_SYS_PD
- canvas->TkC().Tk("create text %i %i -tags %s",x,y,GetString(Id()));
- if(txt) canvas->Tk(" -text %s",txt);
- if(fill >= 0) canvas->Tk(" -fill #%06x",fill);
- if(just != none) {
- static const char justtxt[][7] = {"left","right","center"};
- canvas->Tk(" -justify %s",justtxt[(int)just]);
- }
- canvas->TkE();
-
- active = true;
-#endif
- return *this;
-}
-
-GuiObj &GuiText::Draw()
-{
-#if FLEXT_SYS == FLEXT_SYS_MAX
-#endif
- return *this;
-}
-
diff --git a/externals/grill/guitest/flguiobj.h b/externals/grill/guitest/flguiobj.h
deleted file mode 100644
index 86c7366a..00000000
--- a/externals/grill/guitest/flguiobj.h
+++ /dev/null
@@ -1,362 +0,0 @@
-#ifndef __FLGUIOBJ_H
-#define __FLGUIOBJ_H
-
-#define FLEXT_VIRT
-#include <flext.h>
-#include "flgui.h"
-
-
-class FCanvas
-{
-public:
- FCanvas(t_canvas *c);
- ~FCanvas();
-
-#if FLEXT_SYS == FLEXT_SYS_PD
- FCanvas &Tk(char *fmt,...);
- FCanvas &TkC();
- FCanvas &TkE();
-
- void ToBuf(const char *t);
-#endif
-
- bool Pre(int x,int y);
- void Post();
-
- int X() const { return xpos; }
- int Y() const { return ypos; }
-
-protected:
-
- t_canvas *canvas;
- int xpos,ypos;
-
-#if FLEXT_SYS == FLEXT_SYS_PD
- void Send(const char *t);
- void SendBuf();
-
- static bool debug,store;
-
- char *buffer;
- int bufix;
- int waiting;
-#else
- PenState svpen;
- RGBColor svcol;
- GrafPtr svgp;
-#endif
-};
-
-
-class FPnt
-{
-public:
- FPnt() {}
- FPnt(const FPnt &p): x(p.x),y(p.y) {}
- FPnt(int px,int py): x(px),y(py) {}
-
- FPnt &operator =(const FPnt &p) { x = p.x,y = p.y; return *this; }
- FPnt &operator ()(int px,int py) { x = px,y = py; return *this; }
-
- FPnt &Move(int dx,int dy) { x += dx,y += dy; return *this; }
-
- int X() const { return x; }
- int Y() const { return y; }
-
-//protected:
- int x,y;
-};
-
-class FRect
-{
-public:
- FRect() {}
- FRect(const FRect &r): lo(r.lo),hi(r.hi) {}
- FRect(int xlo,int ylo,int xhi,int yhi): lo(xlo,ylo),hi(xhi,yhi) {}
-
- FRect &operator =(const FRect &r) { lo = r.lo; hi = r.hi; return *this; }
- FRect &operator ()(const FPnt &l,const FPnt &h) { lo = l; hi = h; return *this; }
- FRect &operator ()(int xlo,int ylo,int xhi,int yhi) { lo(xlo,ylo); hi(xhi,yhi); return *this; }
-
- FRect &Move(int dx,int dy) { lo.Move(dx,dy); hi.Move(dx,dy); return *this; }
- FRect &MoveTo(int x,int y) { hi(x+hi.X()-lo.X(),y+hi.Y()-lo.Y()); lo(x,y); return *this; }
-
- FPnt &Lo() { return lo; }
- FPnt &Hi() { return hi; }
- int SizeX() const { return hi.X()-lo.X()+1; }
- int SizeY() const { return hi.Y()-lo.Y()+1; }
-
- FRect &Add(const FPnt &p);
- FRect &Add(const FRect &r);
- bool In(const FPnt &p) const;
- bool Inter(const FRect &r) const;
-
-protected:
- FPnt lo,hi;
-};
-
-class GuiObj:
- public flext
-{
- friend class GuiGroup;
-public:
- GuiObj(FCanvas *c = NULL,GuiGroup *p = NULL);
- virtual ~GuiObj();
-
- const t_symbol *Id() const { return idsym; }
- virtual const t_symbol *Symbol() const { return NULL; }
-
- virtual void Active() {}
- virtual void Inactive() {}
-
-/*
- void Origin(int x,int y) { ori(x,y); }
- void Origin(const FPnt &p) { ori = p; }
- const FPnt &Origin() const { return ori; }
- void OriMove(int dx,int dy) { ori.Move(dx,dy); }
- int OriX() const { return ori.X(); }
- int OriY() const { return ori.Y(); }
-*/
-
- virtual GuiSingle *Find(const t_symbol *s) { return NULL; }
- inline GuiSingle *Find(const char *s) { return Find(MakeSymbol(s)); }
-
- virtual GuiObj &MoveRel(int dx,int dy) = 0;
- virtual GuiObj &Focus() { return *this; }
-
- virtual GuiObj &Draw() = 0;
-
- FCanvas &Canv() { return *canvas; }
-
-protected:
- virtual GuiObj &Delete() = 0;
-
- GuiGroup *parent;
- FCanvas *canvas;
- const t_symbol *idsym;
-
- virtual bool Method(flext_gui &g,const flext_gui::CBParams &p) = 0;
-
- FRect rect;
-};
-
-
-class GuiSingle:
- public GuiObj
-{
- friend class flext_gui;
-public:
- GuiSingle(FCanvas *c = NULL,GuiGroup *p = NULL,const t_symbol *s = NULL);
- ~GuiSingle();
-
- virtual const t_symbol *Symbol() const { return sym; }
- virtual void Symbol(const t_symbol *s);
- void Symbol(const char *s) { Symbol(MakeSymbol(s)); }
-
- virtual void Active() { active = true; }
- virtual void Inactive() { active = false; }
-
- virtual bool In(const FPnt &p) const { return false; }
-
- virtual GuiSingle *Find(const t_symbol *s);
- virtual GuiObj &MoveTo(int x,int y);
- virtual GuiObj &MoveRel(int dx,int dy);
- virtual GuiObj &FillColor(unsigned long col);
- virtual GuiObj &Outline(unsigned long col);
-
- virtual GuiObj &Focus();
-
- GuiGroup &Parent() { return *parent; }
-
-protected:
- virtual GuiObj &Delete();
-
- const t_symbol *sym;
- bool active;
-
- class Event {
- public:
- Event(int evmask,bool (*m)(flext_gui &g,GuiSingle &obj,const flext_gui::CBParams &p));
- ~Event();
-
- int methfl;
- bool (*method)(flext_gui &g,GuiSingle &obj,const flext_gui::CBParams &p);
- bool ext;
- Event *nxt;
- } *event;
-
- void AddEvent(int evmask,bool (*m)(flext_gui &g,GuiSingle &obj,const flext_gui::CBParams &p));
- void RmvEvent(int evmask,bool (*m)(flext_gui &g,GuiSingle &obj,const flext_gui::CBParams &p));
-
- virtual bool Method(flext_gui &g,const flext_gui::CBParams &p);
-};
-
-
-class GuiPoint:
- public GuiSingle
-{
- friend class GuiGroup;
-
- GuiPoint(FCanvas *c = NULL,GuiGroup *p = NULL,const t_symbol *s = NULL): GuiSingle(c,p,s) {}
- GuiObj &Set(int x,int y,long fill = -1);
- virtual GuiObj &Draw();
-
- long fill;
-public:
-};
-
-
-class GuiCloud:
- public GuiSingle
-{
- friend class GuiGroup;
-
- GuiCloud(FCanvas *c = NULL,GuiGroup *p = NULL,const t_symbol *s = NULL): GuiSingle(c,p,s),pnt(NULL) {}
- GuiObj &Set(int n,const FPnt *p,long fill = -1);
- virtual GuiObj &Draw();
- virtual GuiObj &Delete();
-
- long fill;
- int pnts;
- FPnt *pnt;
-public:
-};
-
-
-class GuiBox:
- public GuiSingle
-{
- friend class GuiGroup;
-
- GuiBox(FCanvas *c = NULL,GuiGroup *p = NULL,const t_symbol *s = NULL): GuiSingle(c,p,s) {}
- GuiObj &Set(int x,int y,int xsz,int ysz,int width = -1,long fill = -1,long outl = -1);
- virtual GuiObj &Draw();
-
- virtual bool In(const FPnt &p) const { return rect.In(p); }
-
- int width;
- long fill,outln;
-public:
-};
-
-
-class GuiRect:
- public GuiSingle
-{
- friend class GuiGroup;
-
- GuiRect(FCanvas *c = NULL,GuiGroup *p = NULL,const t_symbol *s = NULL): GuiSingle(c,p,s) {}
- GuiObj &Set(int x,int y,int xsz,int ysz,int width = -1,long outl = -1);
- virtual GuiObj &Draw();
-
- virtual bool In(const FPnt &p) const { return rect.In(p); }
-
- int width;
- long outln;
-public:
-};
-
-
-class GuiLine:
- public GuiSingle
-{
- friend class GuiGroup;
-
- GuiLine(FCanvas *c = NULL,GuiGroup *p = NULL,const t_symbol *s = NULL): GuiSingle(c,p,s) {}
- GuiObj &Set(int x1,int y1,int x2,int y2,int width = -1,long fill = -1);
- virtual GuiObj &Draw();
-
- int width;
- long fill;
- FPnt p1,p2;
-public:
-};
-
-
-class GuiPoly:
- public GuiSingle
-{
- friend class GuiGroup;
-
- GuiPoly(FCanvas *c = NULL,GuiGroup *p = NULL,const t_symbol *s = NULL): GuiSingle(c,p,s),pnt(NULL) {}
- GuiObj &Set(int n,const FPnt *p,int width = -1,long fill = -1);
- virtual GuiObj &Draw();
- virtual GuiObj &Delete();
-
- int width;
- long fill;
- int pnts;
- FPnt *pnt;
-public:
-};
-
-
-class GuiText:
- public GuiSingle
-{
- friend class GuiGroup;
-public:
- enum just_t { none = -1,left = 0,right,center };
-protected:
- GuiText(FCanvas *c = NULL,GuiGroup *p = NULL,const t_symbol *s = NULL): GuiSingle(c,p,s) {}
- GuiObj &Set(int x,int y,const char *txt = NULL,long fill = -1,just_t just = none);
- virtual GuiObj &Draw();
-
- just_t just;
- long fill;
-};
-
-
-class GuiGroup:
- public GuiObj
-{
- friend class flext_gui;
-public:
- GuiGroup(FCanvas *c,GuiGroup *p = NULL);
- ~GuiGroup();
-
- virtual GuiSingle *Find(const t_symbol *s);
- virtual GuiObj &MoveRel(int dx,int dy);
-
- void Clear();
- void Add(GuiObj *o,bool own = true);
- GuiSingle *Detach(const t_symbol *s);
-
- virtual GuiObj &Draw();
-
- GuiGroup *Add_Group();
- GuiSingle *Add_Point(int x,int y,long fill = -1);
- inline GuiSingle *Add_Point(const FPnt &p,long fill = -1) { return Add_Point(p.X(),p.Y(),fill); }
- GuiSingle *Add_Cloud(int n,const FPnt *p,long fill = -1);
- GuiSingle *Add_Box(int x,int y,int xsz,int ysz,int width = -1,long fill = -1,long outl = -1);
- GuiSingle *Add_Rect(int x,int y,int xsz,int ysz,int width = -1,long outl = -1);
- GuiSingle *Add_Line(int x1,int y1,int x2,int y2,int width = -1,long fill = -1);
- inline GuiSingle *Add_Line(const FPnt &p1,const FPnt &p2,int width = -1,long fill = -1) { return Add_Line(p1.X(),p1.Y(),p2.X(),p2.Y(),width,fill); }
- GuiSingle *Add_Poly(int n,const FPnt *p,int width = -1,long fill = -1);
- GuiSingle *Add_Text(int x,int y,const char *txt,long fill = -1,GuiText::just_t just = GuiText::none);
- inline GuiSingle *Add_Text(const FPnt &p,const char *txt,long fill = -1,GuiText::just_t just = GuiText::none) { return Add_Text(p.X(),p.Y(),txt,fill,just); }
-
- GuiSingle *Remove(GuiSingle *obj);
-
-protected:
-#if FLEXT_SYS == FLEXT_SYS_PD
- void AddTag(GuiObj *o);
- void RemoveTag(GuiObj *o);
-#endif
-
- virtual GuiObj &Delete();
-
- class Part
- {
- public:
- Part(GuiObj *o,bool own = true): obj(o),owner(own),nxt(NULL) {}
-
- GuiObj *obj;
- bool owner;
- Part *nxt;
- } *head,*tail;
-
- virtual bool Method(flext_gui &g,const flext_gui::CBParams &p);
-};
-
-#endif
diff --git a/externals/grill/guitest/guitest.vcproj b/externals/grill/guitest/guitest.vcproj
deleted file mode 100644
index caa49efc..00000000
--- a/externals/grill/guitest/guitest.vcproj
+++ /dev/null
@@ -1,226 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="guitest"
- SccProjectName="max/guitest"
- SccAuxPath=""
- SccLocalPath="."
- SccProvider="MSSCCI:Jalindi Igloo">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Release|Win32"
- OutputDirectory=".\msvc\r"
- IntermediateDirectory=".\msvc\r"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="F:\prog\pd\pd-cvs\src,f:\prog\max\flext\source"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;NT;PD"
- StringPooling="TRUE"
- RuntimeLibrary="4"
- EnableFunctionLevelLinking="TRUE"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile=".\msvc\r/guitest.pch"
- AssemblerListingLocation=".\msvc\r/"
- ObjectFile=".\msvc\r/"
- ProgramDataBaseFileName=".\msvc\r/"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="pd.lib flext-pdwin.lib"
- OutputFile=".\msvc\r/guitest.dll"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="f:\prog\pd\pd-cvs\bin,f:\prog\max\flext\pd-msvc"
- ProgramDatabaseFile=".\msvc\r/guitest.pdb"
- ImportLibrary=".\msvc\r/guitest.lib"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="TRUE"
- SuppressStartupBanner="TRUE"
- TargetEnvironment="1"
- TypeLibraryName=".\msvc\r/guitest.tlb"
- HeaderFileName=""/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="3079"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory=".\msvc\d"
- IntermediateDirectory=".\msvc\d"
- ConfigurationType="2"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="FALSE"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="F:\prog\pd\pd-cvs\src,f:\prog\max\flext\source"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;NT;PD"
- BasicRuntimeChecks="3"
- RuntimeLibrary="5"
- RuntimeTypeInfo="TRUE"
- UsePrecompiledHeader="2"
- PrecompiledHeaderFile=".\msvc\d/guitest.pch"
- AssemblerListingLocation=".\msvc\d/"
- ObjectFile=".\msvc\d/"
- ProgramDataBaseFileName=".\msvc\d/"
- BrowseInformation="1"
- WarningLevel="3"
- SuppressStartupBanner="TRUE"
- DebugInformationFormat="4"
- CompileAs="0"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="pd.lib flext_d-pdwin.lib"
- OutputFile=".\msvc\d/guitest.dll"
- LinkIncremental="1"
- SuppressStartupBanner="TRUE"
- AdditionalLibraryDirectories="f:\prog\pd\pd-cvs\bin,f:\prog\max\flext\pd-msvc"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile=".\msvc\d/guitest.pdb"
- ImportLibrary=".\msvc\d/guitest.lib"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="TRUE"
- SuppressStartupBanner="TRUE"
- TargetEnvironment="1"
- TypeLibraryName=".\msvc\d/guitest.tlb"
- HeaderFileName=""/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="3079"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath="flgui.cpp">
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;NT;PD;$(NoInherit)"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;NT;PD;$(NoInherit)"
- BasicRuntimeChecks="3"
- BrowseInformation="1"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="flgui.h">
- </File>
- <File
- RelativePath="flguiobj.cpp">
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;NT;PD;$(NoInherit)"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;NT;PD;$(NoInherit)"
- BasicRuntimeChecks="3"
- BrowseInformation="1"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="flguiobj.h">
- </File>
- <File
- RelativePath="main.cpp">
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;NT;PD;$(NoInherit)"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;NT;PD;$(NoInherit)"
- BasicRuntimeChecks="3"
- BrowseInformation="1"/>
- </FileConfiguration>
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/externals/grill/guitest/main.cpp b/externals/grill/guitest/main.cpp
deleted file mode 100644
index 96e168dc..00000000
--- a/externals/grill/guitest/main.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-#include "flgui.h"
-#include "flguiobj.h"
-
-#include <stdlib.h>
-/*
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-*/
-
-#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 303)
-#error You need at least flext version 0.3.3
-#endif
-
-
-#define V void
-#define I int
-#define C char
-#define BL bool
-#define L long
-#define UL unsigned long
-
-class guitest:
-public flext_gui //,virtual public flext_base
-{
- FLEXT_HEADER(guitest,flext_gui)
-
-public:
- guitest(I argc,t_atom *argv);
- ~guitest();
-
- void m_bang()
- {
- post("%s - bang!",thisName());
- }
-
-protected:
-
- virtual void g_Create();
-// virtual void g_Edit(bool selected);
-
- static bool g_Motion(flext_gui &g,GuiSingle &obj,const CBParams &p);
- static bool g_MouseKey(flext_gui &g,GuiSingle &obj,const CBParams &p);
- static bool g_Key(flext_gui &g,GuiSingle &obj,const CBParams &p);
-
-// virtual void g_Properties();
- virtual void g_Save(t_binbuf *b);
-
-private:
- FLEXT_CALLBACK(m_bang);
-};
-
-FLEXT_NEW_V("guitest",guitest)
-
-guitest::guitest(I argc,t_atom *argv):
- flext_gui(400,100)
-{
- AddInAnything();
- AddOutInt(2);
-
- FLEXT_ADDBANG(0,m_bang);
-}
-
-guitest::~guitest()
-{
-}
-
-
-void guitest::g_Create()
-{
- GuiSingle *frame = Group().Add_Box(0,0,XSize(),YSize(),-1,0xE0E0E0);
- frame->Symbol("rect1");
-// GuiSingle *wave = Group().Add_Box(8,10,XSize()-16,YSize()-11,0,0x4040FF);
- Group().Add_Text(1,1,"Hula",-1,GuiText::left);
-/*
- I n = XSize()-16;
- FPnt *p = new FPnt[n];
- for(int i = 0; i < n; ++i) {
- p[i](8+i,10+rand()%(YSize()-11));
- }
- Group().Add_Poly(n,p,-1,0xC0C0C0);
- delete[] p;
-
- if(!BindEvent(*frame,g_Motion,evMotion)) post("Motion not supported");
- if(!BindEvent(*frame,g_Motion,evMouseDrag)) post("MouseDrag not supported");
- if(!BindEvent(*wave,g_MouseKey,evMouseDown)) post("MouseDown not supported");
- if(!BindEvent(*wave,g_MouseKey,evKeyDown)) post("KeyDown not supported");
- if(!BindEvent(*wave,g_MouseKey,evKeyUp)) post("KeyUp not supported");
- if(!BindEvent(*wave,g_MouseKey,evKeyRepeat)) post("KeyRepeat not supported");
-*/
-}
-
-/*
-void guitest::g_Properties()
-{
- post("properties");
-}
-*/
-
-void guitest::g_Save(t_binbuf *b)
-{
- post("save");
-#if FLEXT_SYS == FLEXT_SYS_PD
- binbuf_addv(b, "ssiis;", gensym("#X"),gensym("obj"),
- (t_int)XLo(), (t_int)YLo(),MakeSymbol(thisName())
- // here the arguments
- );
-#else
-#endif
-}
-
-/*
-void guitest::g_Edit(bool selected)
-{
- post("select is=%d", selected);
-
- GuiSingle *obj = Group().Find(MakeSymbol("rect1"));
- if(obj)
- obj->Outline(selected?0xFF0000:0x000000);
- else
- post("obj not found");
-}
-*/
-
-bool guitest::g_Motion(flext_gui &g,GuiSingle &obj,const CBParams &p)
-{
- if(p.kind == evMotion) {
- post("Motion %s x:%i y:%i mod:%i",GetString(obj.Id()),p.pMotion.x,p.pMotion.y,p.pMotion.mod);
- }
- else if(p.kind == evMouseDrag) {
- post("Drag %s x:%i y:%i dx:%i dy:%i b:%i mod:%i",GetString(obj.Id()),p.pMouseDrag.x,p.pMouseDrag.y,p.pMouseDrag.dx,p.pMouseDrag.dy,p.pMouseDrag.b,p.pMouseDrag.mod);
- }
- else
- post("Motion");
- return true;
-}
-
-bool guitest::g_MouseKey(flext_gui &g,GuiSingle &obj,const CBParams &p)
-{
- if(p.kind == evMouseDown) {
- post("MouseDown %s x:%i y:%i b:%i mod:%i",GetString(obj.Id()),p.pMouseKey.x,p.pMouseKey.y,p.pMouseKey.b,p.pMouseKey.mod);
- }
- else if(p.kind == evKeyDown) {
- post("KeyDown %s asc:%i key:%i mod:%i",GetString(obj.Id()),p.pKey.a,p.pKey.k,p.pKey.mod);
- }
- else if(p.kind == evKeyUp) {
- post("KeyUp %s asc:%i key:%i mod:%i",GetString(obj.Id()),p.pKey.a,p.pKey.k,p.pKey.mod);
- }
- else if(p.kind == evKeyRepeat) {
- post("KeyRepeat %s asc:%i key:%i mod:%i",GetString(obj.Id()),p.pKey.a,p.pKey.k,p.pKey.mod);
- }
- return true;
-}
-
-bool guitest::g_Key(flext_gui &g,GuiSingle &obj,const CBParams &p)
-{
- post("Key");
- return true;
-}
-
-
-
-
-
-
-
diff --git a/externals/grill/guitest/make-files.txt b/externals/grill/guitest/make-files.txt
deleted file mode 100644
index f5670fa3..00000000
--- a/externals/grill/guitest/make-files.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-# all the source files from the package
-NAME=guitest
-
-SRCDIR=.
-
-SRCS= flgui.cpp flguiobj.cpp main.cpp
-HDRS= flgui.h flguiobj.h
diff --git a/externals/grill/guitest/makefile.pd-linux b/externals/grill/guitest/makefile.pd-linux
deleted file mode 100644
index 3c8632bb..00000000
--- a/externals/grill/guitest/makefile.pd-linux
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright (C) 2002-2004 Thomas Grill (xovo@gmx.net)
-#
-# Makefile for gcc @ linux
-#
-# usage:
-# to build run "make -f makefile.pd-linux"
-# to install (as root), do "make -f makefile.pd-linux install"
-#
-
-CONFIG=config-pd-linux.txt
-
-include $(CONFIG)
-
-# compiler+linker stuff
-INCLUDES=$(PDPATH)
-FLAGS=-DFLEXT_SYS=2
-CFLAGS=-O2 $(UFLAGS)
-LDFLAGS=$(UFLAGS) # needed by icc
-LIBS=
-
-ifdef FLEXT_SHARED
-CFLAGS+=-shared -DFLEXT_SHARED
-LDFLAGS+=-L $(FLEXTPATH)
-
-ifeq ($(CXX),icc)
-LDFLAGS+=-i_dynamic
-else
-LDFLAGS+=-Wl,-Bdynamic
-endif
-
-FLEXTLIB=-lflext
-
-else
-
-FLEXTLIB=$(FLEXTPATH)/libflext.a
-
-endif
-
-
-# ---------------------------------------------
-# the rest can stay untouched
-# ----------------------------------------------
-
-include make-files.txt
-
-
-TARGET=$(TARGDIR)/$(NAME).pd_linux
-
-# default target
-all: $(TARGDIR) $(TARGET)
-
-$(patsubst %,$(SRCDIR)/%,$(SRCS)): $(patsubst %,$(SRCDIR)/%,$(HDRS)) $(CONFIG)
- touch $@
-
-$(TARGDIR):
- mkdir $(TARGDIR)
-
-$(TARGDIR)/%.o : $(SRCDIR)/%.cpp
- $(CXX) -c $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(FLEXTPATH)) $< -o $@
-
-$(TARGET) : $(patsubst %.cpp,$(TARGDIR)/%.o,$(SRCS))
- $(CXX) -shared $(LDFLAGS) -o $@ $^ $(FLEXTLIB) $(patsubst %,-l%,$(LIBS))
- strip --strip-unneeded $@
- chmod 755 $@
-
-$(INSTPATH):
- mkdir $(INSTPATH)
-
-install:: $(INSTPATH)
-
-install:: $(TARGET)
- cp $^ $(INSTPATH)
- chown root.root $(patsubst %,$(INSTPATH)/%,$(notdir $^))
- chmod 755 $(patsubst %,$(INSTPATH)/%,$(notdir $^))
-
-.PHONY: clean
-clean:
- rm -f $(TARGDIR)/*.o $(TARGET)
-
-
-
-
-
-
-
-
-
diff --git a/externals/grill/guitest/pd/guitest1.pd b/externals/grill/guitest/pd/guitest1.pd
deleted file mode 100644
index dab24e77..00000000
--- a/externals/grill/guitest/pd/guitest1.pd
+++ /dev/null
@@ -1,7 +0,0 @@
-#N canvas 0 0 456 306 12;
-#X obj 31 87 guitest;
-#X obj 32 47 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 30 231 print OUTPUT;
-#X connect 0 0 2 0;
-#X connect 1 0 0 0;