aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/guitest
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2002-12-17 04:36:31 +0000
committerThomas Grill <xovo@users.sourceforge.net>2002-12-17 04:36:31 +0000
commita5b45e8e2e99686ea73fa2793d7fec84f0d1a3ed (patch)
tree4b31406382bacd13aa784ea22d584ac634f8d8ad /externals/grill/guitest
parenta0cb0bd2e02740e50ec16dde2fb4e07f1702d1d0 (diff)
""
svn path=/trunk/; revision=303
Diffstat (limited to 'externals/grill/guitest')
-rw-r--r--externals/grill/guitest/flgui.cpp16
-rw-r--r--externals/grill/guitest/flgui.h6
-rw-r--r--externals/grill/guitest/flguiobj.cpp64
-rw-r--r--externals/grill/guitest/flguiobj.h6
-rw-r--r--externals/grill/guitest/main.cpp2
5 files changed, 47 insertions, 47 deletions
diff --git a/externals/grill/guitest/flgui.cpp b/externals/grill/guitest/flgui.cpp
index 86d8e4ea..1bad0851 100644
--- a/externals/grill/guitest/flgui.cpp
+++ b/externals/grill/guitest/flgui.cpp
@@ -7,7 +7,7 @@
#include <stdlib.h>
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
t_class *flext_gui::px_class = NULL;
t_class *flext_gui::pxkey_class = NULL;
@@ -31,10 +31,10 @@ struct flext_gui::pxkey_object // no virtual table!
flext_gui::flext_gui(int xs,int ys):
objs(NULL),
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
xsize(xs),ysize(ys),
#endif
-#ifdef MAXMSP
+#if FLEXT_SYS == FLEXT_SYS_MAX
curx(-1),cury(-1),curmod(-1),
created(false),
#endif
@@ -43,7 +43,7 @@ flext_gui::flext_gui(int xs,int ys):
canvas = new Canvas(thisCanvas());
objs = new GuiGroup(canvas);
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
AddCanvas();
#else
t_box *b = (t_box *)gensym("#B")->s_thing;
@@ -58,7 +58,7 @@ flext_gui::flext_gui(int xs,int ys):
flext_gui::~flext_gui()
{
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
RmvCanvas();
#endif
@@ -69,7 +69,7 @@ flext_gui::~flext_gui()
void flext_gui::setup(t_class *c)
{
-#ifdef PD
+#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);
@@ -105,7 +105,7 @@ void flext_gui::setup(t_class *c)
#endif
}
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
int flext_gui::evmask = evMotion|evMouseDown|evKeyDown|evKeyUp;
int flext_gui::curmod = 0;
@@ -216,7 +216,7 @@ void flext_gui::pxkey_method(pxkey_object *obj,const t_symbol *s,int argc,t_atom
}
}
}
-#ifdef DEBUG
+#if 0 //def FLEXT_DEBUG
else
post("unknown modifier %s",str);
#endif
diff --git a/externals/grill/guitest/flgui.h b/externals/grill/guitest/flgui.h
index d9b302db..211a4935 100644
--- a/externals/grill/guitest/flgui.h
+++ b/externals/grill/guitest/flgui.h
@@ -4,7 +4,7 @@
#define FLEXT_VIRT
#include <flext.h>
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
#pragma warning( disable : 4091 )
#include <g_canvas.h>
#endif
@@ -72,7 +72,7 @@ protected:
virtual bool g_Focus(GuiObj &obj,bool on,int mod) { return false; }
*/
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
bool Selected() const { return selected; }
void FixLines() { canvas_fixlinesfor( thisCanvas(), thisHdr() ); }
@@ -143,7 +143,7 @@ private:
virtual void m_Method(const CBParams &p);
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
bool selected;
int xsize,ysize;
diff --git a/externals/grill/guitest/flguiobj.cpp b/externals/grill/guitest/flguiobj.cpp
index b845ae5e..5641e9b5 100644
--- a/externals/grill/guitest/flguiobj.cpp
+++ b/externals/grill/guitest/flguiobj.cpp
@@ -12,26 +12,26 @@
#define ZONE 1000
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
bool Canvas::store = true;
bool Canvas::debug = false;
#endif
Canvas::Canvas(t_canvas *c):
canvas(c)
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
,buffer(new char[BUFSIZE]),bufix(0),waiting(0)
#endif
{}
Canvas::~Canvas()
{
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
if(buffer) delete[] buffer;
#endif
}
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
void Canvas::Send(const char *t)
{
if(debug) post("GUI - %s",t);
@@ -96,7 +96,7 @@ Canvas &Canvas::Tk(char *fmt,...)
bool Canvas::Pre(int x,int y)
{
xpos = x,ypos = y;
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
++waiting;
return true;
#else
@@ -113,7 +113,7 @@ bool Canvas::Pre(int x,int y)
void Canvas::Post()
{
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
if(!--waiting) SendBuf();
#else
if(svgp) {
@@ -210,7 +210,7 @@ GuiSingle *GuiSingle::Find(const t_symbol *s)
GuiObj &GuiSingle::MoveTo(int x,int y)
{
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
if(active) {
canvas->TkC().Tk("coords %s %i %i\n",GetString(Id()), x, y);
}
@@ -221,7 +221,7 @@ GuiObj &GuiSingle::MoveTo(int x,int y)
GuiObj &GuiSingle::MoveRel(int dx,int dy)
{
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
if(active) {
canvas->TkC().Tk("move %s %i %i\n",GetString(Id()), dx, dy);
}
@@ -232,7 +232,7 @@ GuiObj &GuiSingle::MoveRel(int dx,int dy)
GuiObj &GuiSingle::Delete()
{
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
if(active) {
canvas->TkC().Tk("delete -tags %s\n",GetString(Id()));
active = false;
@@ -243,7 +243,7 @@ GuiObj &GuiSingle::Delete()
GuiObj &GuiSingle::FillColor(unsigned long col)
{
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
if(active) {
canvas->TkC().Tk("itemconfigure %s -fill #%06x\n",GetString(Id()),col);
}
@@ -253,7 +253,7 @@ GuiObj &GuiSingle::FillColor(unsigned long col)
GuiObj &GuiSingle::Outline(unsigned long col)
{
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
if(active) {
canvas->TkC().Tk("itemconfigure %s -outline #%06x\n",GetString(Id()),col);
}
@@ -263,7 +263,7 @@ GuiObj &GuiSingle::Outline(unsigned long col)
GuiObj &GuiSingle::Focus()
{
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
if(active) {
canvas->TkC().Tk("focus %s\n",GetString(Id()));
}
@@ -337,7 +337,7 @@ void GuiGroup::Clear()
{
for(Part *ix = head; ix; ) {
Part *n = ix->nxt;
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
RemoveTag(ix->obj);
#endif
if(ix->owner) delete ix->obj;
@@ -350,7 +350,7 @@ void GuiGroup::Clear()
void GuiGroup::Add(GuiObj *o,bool owner)
{
o->canvas = canvas;
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
AddTag(o); // valid only for GuiSingle!
#endif
Part *n = new Part(o,owner);
@@ -380,7 +380,7 @@ GuiSingle *GuiGroup::Detach(const t_symbol *s)
if(p) p->nxt = ix->nxt;
GuiSingle *ret = (GuiSingle *)(ix->obj);
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
RemoveTag(ret);
#endif
if(head == ix) head = ix->nxt;
@@ -398,7 +398,7 @@ GuiSingle *GuiGroup::Detach(const t_symbol *s)
GuiObj &GuiGroup::MoveRel(int dx,int dy)
{
-#ifdef PD
+#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) {
@@ -409,7 +409,7 @@ GuiObj &GuiGroup::MoveRel(int dx,int dy)
GuiObj &GuiGroup::Delete()
{
-#ifdef PD
+#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();
@@ -425,7 +425,7 @@ GuiObj &GuiGroup::Draw()
}
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
void GuiGroup::AddTag(GuiObj *o)
{
@@ -542,7 +542,7 @@ GuiObj &GuiPoint::Set(int x,int y,long fl)
fill = fl;
rect(x,y,x,y);
-#ifdef PD
+#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);
@@ -555,7 +555,7 @@ GuiObj &GuiPoint::Set(int x,int y,long fl)
GuiObj &GuiPoint::Draw()
{
-#ifdef MAXMSP
+#if FLEXT_SYS == FLEXT_SYS_MAX
#endif
return *this;
}
@@ -571,7 +571,7 @@ GuiObj &GuiCloud::Set(int n,const Pnt *p,long fl)
rect(pnt[0] = p[0],p[0]);
for(i = 1; i < n; ++i) rect.Add(pnt[i] = p[i]);
-#ifdef PD
+#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());
@@ -586,7 +586,7 @@ GuiObj &GuiCloud::Set(int n,const Pnt *p,long fl)
GuiObj &GuiCloud::Draw()
{
-#ifdef MAXMSP
+#if FLEXT_SYS == FLEXT_SYS_MAX
#endif
return *this;
}
@@ -604,7 +604,7 @@ GuiObj &GuiBox::Set(int x,int y,int xsz,int ysz,int wd,long fl,long outl)
rect(x,y,x+xsz-1,y+ysz-1);
width = wd,fill = fl,outln = outl;
-#ifdef PD
+#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);
@@ -618,7 +618,7 @@ GuiObj &GuiBox::Set(int x,int y,int xsz,int ysz,int wd,long fl,long outl)
GuiObj &GuiBox::Draw()
{
-#ifdef MAXMSP
+#if FLEXT_SYS == FLEXT_SYS_MAX
::Rect r;
::RGBColor col;
int w = width;
@@ -653,7 +653,7 @@ GuiObj &GuiRect::Set(int x,int y,int xsz,int ysz,int wd,long outl)
rect(x,y,x+xsz-1,y+ysz-1);
width = wd,outln = outl;
-#ifdef PD
+#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);
@@ -666,7 +666,7 @@ GuiObj &GuiRect::Set(int x,int y,int xsz,int ysz,int wd,long outl)
GuiObj &GuiRect::Draw()
{
-#ifdef MAXMSP
+#if FLEXT_SYS == FLEXT_SYS_MAX
#endif
return *this;
}
@@ -678,7 +678,7 @@ GuiObj &GuiLine::Set(int x1,int y1,int x2,int y2,int wd,long fl)
rect(p1(x1,y1),p2(x2,y2));
width = wd,fill = fl;
-#ifdef PD
+#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);
@@ -691,7 +691,7 @@ GuiObj &GuiLine::Set(int x1,int y1,int x2,int y2,int wd,long fl)
GuiObj &GuiLine::Draw()
{
-#ifdef MAXMSP
+#if FLEXT_SYS == FLEXT_SYS_MAX
::Point p;
::RGBColor col;
int w = width;
@@ -724,7 +724,7 @@ GuiObj &GuiPoly::Set(int n,const Pnt *p,int wd,long fl)
rect(pnt[0] = p[0],p[0]);
for(i = 1; i < n; ++i) rect.Add(pnt[i] = p[i]);
-#ifdef PD
+#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());
@@ -740,7 +740,7 @@ GuiObj &GuiPoly::Set(int n,const Pnt *p,int wd,long fl)
GuiObj &GuiPoly::Draw()
{
-#ifdef MAXMSP
+#if FLEXT_SYS == FLEXT_SYS_MAX
::Point p;
::RGBColor col;
int ox = Canv().X(),oy = Canv().Y();
@@ -777,7 +777,7 @@ GuiObj &GuiText::Set(int x,int y,const char *txt,long fl,just_t jt)
rect(x,y,x,y);
fill = fl,just = jt;
-#ifdef PD
+#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);
@@ -794,7 +794,7 @@ GuiObj &GuiText::Set(int x,int y,const char *txt,long fl,just_t jt)
GuiObj &GuiText::Draw()
{
-#ifdef MAXMSP
+#if FLEXT_SYS == FLEXT_SYS_MAX
#endif
return *this;
}
diff --git a/externals/grill/guitest/flguiobj.h b/externals/grill/guitest/flguiobj.h
index 807b0f07..b4448bc2 100644
--- a/externals/grill/guitest/flguiobj.h
+++ b/externals/grill/guitest/flguiobj.h
@@ -12,7 +12,7 @@ public:
Canvas(t_canvas *c);
~Canvas();
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
Canvas &Tk(char *fmt,...);
Canvas &TkC();
Canvas &TkE();
@@ -31,7 +31,7 @@ protected:
t_canvas *canvas;
int xpos,ypos;
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
void Send(const char *t);
void SendBuf();
@@ -339,7 +339,7 @@ public:
GuiSingle *Remove(GuiSingle *obj);
protected:
-#ifdef PD
+#if FLEXT_SYS == FLEXT_SYS_PD
void AddTag(GuiObj *o);
void RemoveTag(GuiObj *o);
#endif
diff --git a/externals/grill/guitest/main.cpp b/externals/grill/guitest/main.cpp
index 775a206b..cfedfa86 100644
--- a/externals/grill/guitest/main.cpp
+++ b/externals/grill/guitest/main.cpp
@@ -82,7 +82,7 @@ void guitest::g_Properties()
void guitest::g_Save(t_binbuf *b)
{
post("save");
-#ifdef PD
+#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