ivtools-patch Mailing List for ivtools (Page 10)
Brought to you by:
johnston
You can subscribe to this list here.
1999 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2000 |
Jan
(17) |
Feb
(14) |
Mar
(7) |
Apr
(7) |
May
(20) |
Jun
(18) |
Jul
(5) |
Aug
(9) |
Sep
(4) |
Oct
(2) |
Nov
(2) |
Dec
(1) |
2001 |
Jan
(3) |
Feb
(2) |
Mar
(5) |
Apr
(7) |
May
(9) |
Jun
(15) |
Jul
(10) |
Aug
(2) |
Sep
(10) |
Oct
(15) |
Nov
(14) |
Dec
(2) |
2002 |
Jan
(8) |
Feb
(13) |
Mar
(10) |
Apr
(3) |
May
(2) |
Jun
(7) |
Jul
(5) |
Aug
(3) |
Sep
(1) |
Oct
(1) |
Nov
(10) |
Dec
|
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
(4) |
Nov
(1) |
Dec
(3) |
2004 |
Jan
(2) |
Feb
(6) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
(4) |
Nov
(1) |
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2010 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ivt...@li...> - 2000-05-19 05:16:08
|
Patch: ivtools-000517-johnston-052 For: ivtools-0.8.2 Author: joh...@us... Subject: add global variables to comterp Requires: This is an intermediate patch to ivtools-0.8.2. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - add a global variable capability to comterp. Now you can: global(v1)=100 and the value v1 will be available in all other copies of the command interpreter running at the time. If a local variable of the same name exists, you can access the global value by: symval(global(v1)) The "global" command returns a ComValue of SymbolType with a new global flag set to true. This flag is subsequently checked when doing symbol lookup, and if true the values are taken from the global symbol table (a static class variable of ComTerp). - add a AttributeValue::clear() method to zero out all the bytes of the double sized multi-value union _v. Index: Attribute/attrvalue.c diff -c Attribute/attrvalue.c:1.8 Attribute/attrvalue.c:1.9 *** Attribute/attrvalue.c:1.8 Wed May 10 03:28:28 2000 --- src/Attribute/attrvalue.c Wed May 17 06:58:36 2000 *************** *** 37,46 **** --- 37,48 ---- /*****************************************************************************/ AttributeValue::AttributeValue(ValueType valtype) { + clear(); type(valtype); } AttributeValue::AttributeValue(ValueType valtype, attr_value value) { + clear(); type(valtype); _v = value; } *************** *** 52,113 **** --- 54,127 ---- } AttributeValue::AttributeValue() { + clear(); type(UnknownType); _aggregate_type = UnknownType; } AttributeValue::AttributeValue(unsigned char v) { + clear(); _type = AttributeValue::UCharType; _v.ucharval = v; } AttributeValue::AttributeValue(char v) { + clear(); _type = AttributeValue::CharType; _v.charval = v; } AttributeValue::AttributeValue(unsigned short v) { + clear(); _type = AttributeValue::UShortType; _v.ushortval = v; } AttributeValue::AttributeValue(short v) { + clear(); _type = AttributeValue::ShortType; _v.shortval = v; } AttributeValue::AttributeValue(unsigned int v, ValueType type) { + clear(); _type = type; _v.dfunsval = v; } AttributeValue::AttributeValue(unsigned int kv, unsigned int kn, ValueType type) { + clear(); _type = type; _v.keyval.keyid = kv; _v.keyval.keynarg = kn; } AttributeValue::AttributeValue(int v, ValueType type) { + clear(); _type = type; _v.dfintval = v; } AttributeValue::AttributeValue(unsigned long v) { + clear(); _type = AttributeValue::ULongType; _v.lnunsval = v; } AttributeValue::AttributeValue(long v) { + clear(); _type = AttributeValue::LongType; _v.lnintval = v; } AttributeValue::AttributeValue(float v) { + clear(); _type = AttributeValue::FloatType; _v.floatval = v; } AttributeValue::AttributeValue(double v) { + clear(); _type = AttributeValue::DoubleType; _v.doublval = v; } *************** *** 142,147 **** --- 156,166 ---- type(UnknownType); } + void AttributeValue::clear() { + unsigned char* buf = (unsigned char*)(void*)&_v; + for (int i=0; i<sizeof(double); i++) buf[i] = '\0'; + } + AttributeValue& AttributeValue::operator= (const AttributeValue& sv) { void* v1 = &_v; const void* v2 = &sv._v; *************** *** 176,189 **** long& AttributeValue::long_ref() { return _v.lnintval; } float& AttributeValue::float_ref() { return _v.floatval; } double& AttributeValue::double_ref() { return _v.doublval; } ! unsigned int& AttributeValue::string_ref() { return _v.symbolid; } ! unsigned int& AttributeValue::symbol_ref() { return _v.symbolid; } void*& AttributeValue::obj_ref() { return _v.objval.ptr; } unsigned int& AttributeValue::obj_type_ref() { return _v.objval.type; } AttributeValueList*& AttributeValue::array_ref() { return _v.arrayval.ptr; } unsigned int& AttributeValue::array_type_ref() { return _v.arrayval.type; } unsigned int& AttributeValue::keyid_ref() { return _v.keyval.keyid; } unsigned int& AttributeValue::keynarg_ref() { return _v.keyval.keynarg; } boolean AttributeValue::boolean_val() { switch (type()) { --- 195,214 ---- long& AttributeValue::long_ref() { return _v.lnintval; } float& AttributeValue::float_ref() { return _v.floatval; } double& AttributeValue::double_ref() { return _v.doublval; } ! unsigned int& AttributeValue::string_ref() { return _v.symval.symid; } ! unsigned int& AttributeValue::symbol_ref() { return _v.symval.symid; } void*& AttributeValue::obj_ref() { return _v.objval.ptr; } unsigned int& AttributeValue::obj_type_ref() { return _v.objval.type; } AttributeValueList*& AttributeValue::array_ref() { return _v.arrayval.ptr; } unsigned int& AttributeValue::array_type_ref() { return _v.arrayval.type; } unsigned int& AttributeValue::keyid_ref() { return _v.keyval.keyid; } unsigned int& AttributeValue::keynarg_ref() { return _v.keyval.keynarg; } + + boolean AttributeValue::global_flag() { return is_symbol() && _v.symval.globalflag; } + void AttributeValue::global_flag(boolean flag) + { + if (is_symbol()) _v.symval.globalflag = flag; + } boolean AttributeValue::boolean_val() { switch (type()) { Index: Attribute/attrvalue.h diff -c Attribute/attrvalue.h:1.10 Attribute/attrvalue.h:1.11 *** Attribute/attrvalue.h:1.10 Sat May 6 05:46:19 2000 --- src/Attribute/attrvalue.h Wed May 17 06:58:36 2000 *************** *** 39,44 **** --- 39,51 ---- class AttributeValueList; class ostream; + //: struct for symbol value, symid + global flag for symbol value + // used in attr_value. + typedef struct { + unsigned int symid; + boolean globalflag; + } symval_struct; + //: void* pointer plus object classid (see macro in OverlayUnidraw/ovcomps.h) // used in attr_value. typedef struct { *************** *** 73,79 **** unsigned long lnunsval; float floatval; double doublval; ! unsigned int symbolid; objval_struct objval; arrayval_struct arrayval; keyval_struct keyval; --- 80,86 ---- unsigned long lnunsval; float floatval; double doublval; ! symval_struct symval; objval_struct objval; arrayval_struct arrayval; keyval_struct keyval; *************** *** 131,136 **** --- 138,146 ---- virtual ~AttributeValue(); // set to UnknownType and unref pointer if ArrayType. + void clear(); + // clear bytes of multi-value union + AttributeValue& operator= (const AttributeValue&); // copy assignment operator. *************** *** 192,198 **** const char* string_ptr(); // lookup and return pointer to string associated with string. const char* symbol_ptr(); ! // lookup and return pointer to string associated with symbol. int array_len(); // length of list of values when ArrayType. --- 202,211 ---- const char* string_ptr(); // lookup and return pointer to string associated with string. const char* symbol_ptr(); ! boolean global_flag(); ! // return true if a symbol and the global flag is set. ! void global_flag(boolean flag); ! // set global flag of a symbol int array_len(); // length of list of values when ArrayType. Index: Attribute/lexscan.c diff -c Attribute/lexscan.c:1.1 Attribute/lexscan.c:1.2 *** Attribute/lexscan.c:1.1 Tue Jan 18 03:06:56 2000 --- src/Attribute/lexscan.c Wed May 17 06:58:36 2000 *************** *** 68,74 **** attr_value retval; switch (toktype) { case TOK_IDENTIFIER: ! case TOK_STRING: retval.symbolid = symbol_add(_token); break; case TOK_CHAR: retval.charval = *_token; break; case TOK_DFINT: retval.dfintval = *(int*)_token; break; case TOK_DFUNS: retval.dfunsval = *(unsigned int*)_token; break; --- 68,74 ---- attr_value retval; switch (toktype) { case TOK_IDENTIFIER: ! case TOK_STRING: retval.symval.symid = symbol_add(_token); break; case TOK_CHAR: retval.charval = *_token; break; case TOK_DFINT: retval.dfintval = *(int*)_token; break; case TOK_DFUNS: retval.dfunsval = *(unsigned int*)_token; break; *************** *** 76,82 **** case TOK_LNUNS: retval.lnunsval = *(unsigned long*)_token; break; case TOK_FLOAT: retval.floatval = *(float*)_token; break; case TOK_DOUBLE: retval.doublval = *(double*)_token; break; ! case TOK_OPERATOR: retval.symbolid = symbol_add(_token); break; case TOK_EOF: break; default: break; } --- 76,82 ---- case TOK_LNUNS: retval.lnunsval = *(unsigned long*)_token; break; case TOK_FLOAT: retval.floatval = *(float*)_token; break; case TOK_DOUBLE: retval.doublval = *(double*)_token; break; ! case TOK_OPERATOR: retval.symval.symid = symbol_add(_token); break; case TOK_EOF: break; default: break; } Index: ComTerp/assignfunc.c diff -c ComTerp/assignfunc.c:1.4 ComTerp/assignfunc.c:1.5 *** ComTerp/assignfunc.c:1.4 Mon Feb 21 20:48:40 2000 --- src/ComTerp/assignfunc.c Wed May 17 06:58:39 2000 *************** *** 54,60 **** operand2); attrlist->add_attribute(attr); Unref(attrlist); ! } else comterp()->localtable()->insert(operand1.symbol_val(), operand2); } else if (operand1.is_object(Attribute::class_symid())) { Attribute* attr = (Attribute*)operand1.obj_val(); --- 54,62 ---- operand2); attrlist->add_attribute(attr); Unref(attrlist); ! } else if (operand1.global_flag()) ! comterp()->globaltable()->insert(operand1.symbol_val(), operand2); ! else comterp()->localtable()->insert(operand1.symbol_val(), operand2); } else if (operand1.is_object(Attribute::class_symid())) { Attribute* attr = (Attribute*)operand1.obj_val(); Index: ComTerp/comterp.c diff -c ComTerp/comterp.c:1.14 ComTerp/comterp.c:1.15 *** ComTerp/comterp.c:1.14 Mon May 8 22:06:58 2000 --- src/ComTerp/comterp.c Wed May 17 06:58:39 2000 *************** *** 103,111 **** /* Create ComValue symbol table */ _localtable = new ComValueTable(100); ! if (_globaltable) { _globaltable = new ComValueTable(100); } _errbuf = new char[BUFSIZ]; --- 103,113 ---- /* Create ComValue symbol table */ _localtable = new ComValueTable(100); ! #if 0 ! if (!_globaltable) { _globaltable = new ComValueTable(100); } + #endif _errbuf = new char[BUFSIZ]; *************** *** 599,619 **** ComValue& ComTerp::lookup_symval(ComValue& comval) { if (comval.type() == ComValue::SymbolType) { void* vptr = nil; ! if (localtable()->find(vptr, comval.symbol_val())) { comval.assignval(*(ComValue*)vptr); return comval; ! } else { ! if (_alist) { ! int id = comval.symbol_val(); ! AttributeValue* aval = _alist->find(id); ! if (aval) { ! ComValue newval(*aval); ! *&comval = newval; ! } ! return comval; ! } else ! return ComValue::nullval(); ! } } else if (comval.is_object(Attribute::class_symid())) { comval.assignval(*((Attribute*)comval.obj_val())->Value()); --- 601,624 ---- ComValue& ComTerp::lookup_symval(ComValue& comval) { if (comval.type() == ComValue::SymbolType) { void* vptr = nil; ! ! if (localtable()->find(vptr, comval.symbol_val()) && !comval.global_flag() ) { comval.assignval(*(ComValue*)vptr); return comval; ! } else if (_alist) { ! int id = comval.symbol_val(); ! AttributeValue* aval = _alist->find(id); ! if (aval) { ! ComValue newval(*aval); ! *&comval = newval; ! } ! return comval; ! } else if (globaltable()->find(vptr, comval.symbol_val())) { ! comval.assignval(*(ComValue*)vptr); ! return comval; ! } else ! return ComValue::nullval(); ! } else if (comval.is_object(Attribute::class_symid())) { comval.assignval(*((Attribute*)comval.obj_val())->Value()); *************** *** 831,836 **** --- 836,842 ---- add_command("symval", new SymValFunc(this)); add_command("symbol", new SymbolFunc(this)); add_command("symadd", new SymAddFunc(this)); + add_command("global", new GlobalSymbolFunc(this)); add_command("split", new SplitStrFunc(this)); add_command("join", new JoinStrFunc(this)); Index: ComTerp/comterp.h diff -c ComTerp/comterp.h:1.6 ComTerp/comterp.h:1.7 *** ComTerp/comterp.h:1.6 Thu Apr 27 03:43:53 2000 --- src/ComTerp/comterp.h Wed May 17 06:58:39 2000 *************** *** 162,168 **** ComValueTable* localtable() const { return _localtable; } // local symbol table associated with an individual ComTerp. ! ComValueTable* globaltable() const { return _globaltable; } // global symbol table associated with every ComTerp. ComValue* localvalue(int symid); // value associated with a symbol id in the local symbol table. --- 162,169 ---- ComValueTable* localtable() const { return _localtable; } // local symbol table associated with an individual ComTerp. ! ComValueTable* globaltable() const ! { if (!_globaltable) _globaltable = new ComValueTable(100); return _globaltable; } // global symbol table associated with every ComTerp. ComValue* localvalue(int symid); // value associated with a symbol id in the local symbol table. Index: ComTerp/comvalue.c diff -c ComTerp/comvalue.c:1.13 ComTerp/comvalue.c:1.14 *** ComTerp/comvalue.c:1.13 Sat May 6 05:46:22 2000 --- src/ComTerp/comvalue.c Wed May 17 06:58:39 2000 *************** *** 149,155 **** --- 149,157 ---- case ComValue::SymbolType: if (brief) + if (svp->global_flag()) out << "global("; out << symbol_pntr( svp->symbol_ref()); + if (svp->global_flag()) out << ")"; else { title = "symbol( "; symbol = symbol_pntr( svp->symbol_ref() ); Index: ComTerp/dotfunc.c diff -c ComTerp/dotfunc.c:1.6 ComTerp/dotfunc.c:1.7 *** ComTerp/dotfunc.c:1.6 Fri Mar 24 23:15:20 2000 --- src/ComTerp/dotfunc.c Wed May 17 06:58:39 2000 *************** *** 48,54 **** return; } if (!after_part.is_symbol()) { ! cerr << "expression after \".\" needs to be a symbol or evaluate to a syymbol\n"; return; } --- 48,54 ---- return; } if (!after_part.is_symbol()) { ! cerr << "expression after \".\" needs to be a symbol or evaluate to a symbol\n"; return; } *************** *** 57,70 **** AttributeList* al = nil; if (!before_part.is_attribute() && !before_part.is_attributelist()) { int before_symid = before_part.symbol_val(); ! comterp()->localtable()->find(vptr, before_symid); if (vptr &&((ComValue*) vptr)->class_symid() == AttributeList::class_symid()) { al = (AttributeList*) ((ComValue*) vptr)->obj_val(); } else { al = new AttributeList(); Resource::ref(al); ComValue* comval = new ComValue(AttributeList::class_symid(), (void*)al); ! comterp()->localtable()->insert(before_symid, comval); } } else if (!before_part.is_attributelist()) al = (AttributeList*) ((Attribute*) before_part.obj_val())->Value()->obj_val(); --- 57,79 ---- AttributeList* al = nil; if (!before_part.is_attribute() && !before_part.is_attributelist()) { int before_symid = before_part.symbol_val(); ! boolean global = before_part.global_flag(); ! if (!global) { ! comterp()->localtable()->find(vptr, before_symid); ! if (!vptr) comterp()->globaltable()->find(vptr, before_symid); ! } else { ! comterp()->globaltable()->find(vptr, before_symid); ! } if (vptr &&((ComValue*) vptr)->class_symid() == AttributeList::class_symid()) { al = (AttributeList*) ((ComValue*) vptr)->obj_val(); } else { al = new AttributeList(); Resource::ref(al); ComValue* comval = new ComValue(AttributeList::class_symid(), (void*)al); ! if (!global) ! comterp()->localtable()->insert(before_symid, comval); ! else ! comterp()->globaltable()->insert(before_symid, comval); } } else if (!before_part.is_attributelist()) al = (AttributeList*) ((Attribute*) before_part.obj_val())->Value()->obj_val(); Index: ComTerp/symbolfunc.c diff -c ComTerp/symbolfunc.c:1.5 ComTerp/symbolfunc.c:1.6 *** ComTerp/symbolfunc.c:1.5 Mon May 8 22:06:58 2000 --- src/ComTerp/symbolfunc.c Wed May 17 06:58:39 2000 *************** *** 1,4 **** --- 1,5 ---- /* + * Copyright (c) 2000 IET Inc. * Copyright (c) 1998,1999,2000 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and *************** *** 226,231 **** --- 227,273 ---- } } push_stack(ComValue::nullval()); + } + + + GlobalSymbolFunc::GlobalSymbolFunc(ComTerp* comterp) : ComFunc(comterp) { + } + + void GlobalSymbolFunc::execute() { + // return symbol(s) with global flag set + boolean noargs = !nargs() && !nkeys(); + int numargs = nargs(); + if (!numargs) { + reset_stack(); + return; + } + int symbol_ids[numargs]; + for (int i=0; i<numargs; i++) { + ComValue& val = stack_arg(i, true); + if (val.is_symbol()) + symbol_ids[i] = val.symbol_val(); + else + symbol_ids[i] = -1; + } + reset_stack(); + + if (numargs>1) { + AttributeValueList* avl = new AttributeValueList(); + ComValue retval(avl); + for (int i=0; i<numargs; i++) { + AttributeValue* av = + new AttributeValue(symbol_ids[i], AttributeValue::SymbolType); + av->global_flag(true); + avl->Append(av); + } + push_stack(retval); + } else { + + ComValue retval (symbol_ids[0], AttributeValue::SymbolType); + retval.global_flag(true); + push_stack(retval); + } + } Index: ComTerp/symbolfunc.h diff -c ComTerp/symbolfunc.h:1.5 ComTerp/symbolfunc.h:1.6 *** ComTerp/symbolfunc.h:1.5 Fri May 12 04:18:16 2000 --- src/ComTerp/symbolfunc.h Wed May 17 06:58:39 2000 *************** *** 1,4 **** --- 1,5 ---- /* + * Copyright (c) 2000 IET Inc. * Copyright (c) 1998,1999 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and *************** *** 99,104 **** --- 100,117 ---- virtual const char* docstring() { return "str=%s(clist) -- join list of characters into string"; } + }; + + + //: command to make assign a global variable + // val=global(symbol)|global(symbol)=val -- make symbol global + class GlobalSymbolFunc : public ComFunc { + public: + GlobalSymbolFunc(ComTerp*); + virtual void execute(); + + virtual const char* docstring() { + return "sym=%s(symbol)|global(symbol)=val -- make symbol global"; } }; *** /dev/null Wed May 17 06:59:14 PDT 2000 --- patches/ivtools-000517-johnston-052 *************** patches/ivtools-000517-johnston-052 *** 0 **** --- 1 ---- + ivtools-000517-johnston-052 |
From: <ivt...@li...> - 2000-05-16 16:29:36
|
Patch: ivtools-000516-johnston-051 For: ivtools-0.8.2 Author: joh...@us... Subject: add ComUnidraw/highlightfunc.[ch] Requires: This is an intermediate patch to ivtools-0.8.2. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - adds ComUnidraw/highlightfunc.[ch] Index: ComUnidraw/highlightfunc.c diff -c /dev/null ComUnidraw/highlightfunc.c:1.1 *** /dev/null Tue May 16 22:37:26 2000 --- src/ComUnidraw/highlightfunc.c Tue May 16 22:37:23 2000 *************** *** 0 **** --- 1,56 ---- + /* + * Copyright (c) 2000 IET Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + + #include <ComUnidraw/highlightfunc.h> + #include <OverlayUnidraw/ovviews.h> + #include <OverlayUnidraw/ovcomps.h> + #include <Unidraw/Components/grcomp.h> + + #define TITLE "HighlightFunc" + + /*****************************************************************************/ + + HighlightFunc::HighlightFunc(ComTerp* comterp, Editor* ed) : UnidrawFunc(comterp, ed) { + } + + void HighlightFunc::execute() { + + ComValue grv = stack_arg(0); + ComValue gsv = stack_arg(1); + reset_stack(); + if (grv.object_compview() && gsv.object_compview()) { + ComponentView* grcompview = (ComponentView*)grv.obj_val(); + ComponentView* gscompview = (ComponentView*)gsv.obj_val(); + if (grcompview && grcompview->GetSubject() && gscompview && gscompview->GetSubject()) { + + Graphic* grgs = ((GraphicComp*)gscompview->GetSubject())->GetGraphic(); + if (grgs) { + OverlayComp* grcomp = ((OverlayView*)grcompview)->GetOverlayComp(); + OverlayView* grview = grcomp ? grcomp->FindView(_ed->GetViewer()) : nil; + if (grview) grview->HighlightGraphic(grgs); + } + } + } + push_stack(grv); + } + Index: ComUnidraw/highlightfunc.h diff -c /dev/null ComUnidraw/highlightfunc.h:1.1 *** /dev/null Tue May 16 22:37:26 2000 --- src/ComUnidraw/highlightfunc.h Tue May 16 22:37:24 2000 *************** *** 0 **** --- 1,39 ---- + /* + * Copyright (c) 2000 IET Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + + #if !defined(highlightfunc_h) + #define _highlightfunc_h + + #include <ComUnidraw/unifunc.h> + + //: command to highlight a graphic given another graphic's state + // highlight(compview compviewgs) -- set the highlight graphic state for a graphic + class HighlightFunc : public UnidrawFunc { + public: + HighlightFunc(ComTerp*,Editor*); + virtual void execute(); + virtual const char* docstring() { + return "%s(compview compviewgs) -- set the highlight graphic state for a graphic"; } + }; + + #endif /* !defined(_highlightfunc_h) */ *** /dev/null Tue May 16 22:37:45 PDT 2000 --- patches/ivtools-000516-johnston-051 *************** patches/ivtools-000516-johnston-051 *** 0 **** --- 1 ---- + ivtools-000516-johnston-051 |
From: <ivt...@li...> - 2000-05-16 16:24:24
|
Patch: ivtools-000516-johnston-050 For: ivtools-0.8.2 Author: joh...@us... Subject: highlight command for comdraw, fixed equality comparisons against nil Requires: This is an intermediate patch to ivtools-0.8.2. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - add highlight command to comdraw interpreter: highlight(compview compviewgs) -- set the highlight graphic state for a graphic It seems to work, but revealed some problems in the hybrid OverlayViewer system for managing highlighting and tic-mark handles. - changed ComTerpModule::reset to reuse buffers without reallocating them. - fixed equality comparisons in comterp against nil (which is ComValue::UnknownType under the hood). Now nil!=0 is true (1) and nil==0 is false (0). - added base class method to set an OverlayView's HighlightGraphic and member variable _hilite_gs to hold it. - fixed bug in OverlayScript::ReadOther. Now the attribute built from a keyword with no following value(followed by the closing paren) gets a value of true (1). Index: top_ivtools/MANIFEST diff -c top_ivtools/MANIFEST:1.7 top_ivtools/MANIFEST:1.8 *** top_ivtools/MANIFEST:1.7 Tue May 2 05:25:20 2000 --- ./MANIFEST Tue May 16 06:21:02 2000 *************** *** 200,205 **** --- 200,207 ---- ivtools-0.8/src/ComUnidraw/grfunc.h ivtools-0.8/src/ComUnidraw/grstatfunc.c ivtools-0.8/src/ComUnidraw/grstatfunc.h + ivtools-0.8/src/ComUnidraw/highlightfunc.c + ivtools-0.8/src/ComUnidraw/highlightfunc.h ivtools-0.8/src/ComUnidraw/nfunc.c ivtools-0.8/src/ComUnidraw/nfunc.h ivtools-0.8/src/ComUnidraw/plotfunc.c Index: top_ivtools/MANIFEST.perceps diff -c top_ivtools/MANIFEST.perceps:1.4 top_ivtools/MANIFEST.perceps:1.5 *** top_ivtools/MANIFEST.perceps:1.4 Tue May 2 05:25:20 2000 --- ./MANIFEST.perceps Tue May 16 06:21:02 2000 *************** *** 50,55 **** --- 50,56 ---- ComUnidraw/grdotfunc.h ComUnidraw/grfunc.h ComUnidraw/grstatfunc.h + ComUnidraw/highlightfunc.h ComUnidraw/nfunc.h ComUnidraw/plotfunc.h ComUnidraw/unifunc.h Index: Attribute/commodule.c diff -c Attribute/commodule.c:1.1 Attribute/commodule.c:1.2 *** Attribute/commodule.c:1.1 Tue Jan 18 03:06:56 2000 --- src/Attribute/commodule.c Tue May 16 06:21:07 2000 *************** *** 91,101 **** } void ComTerpModule::reset() { ! delete _buffer; ! delete _token; ! _buffer = new char[BUFSIZ*BUFSIZ]; ! _bufsiz = BUFSIZ*BUFSIZ; ! _token = new char[BUFSIZ*BUFSIZ]; ! _toksiz = BUFSIZ*BUFSIZ; _linenum = 0; } --- 91,97 ---- } void ComTerpModule::reset() { ! _buffer[0] = '\0'; ! _token[0] = '\0'; _linenum = 0; } Index: ComTerp/boolfunc.c diff -c ComTerp/boolfunc.c:1.3 ComTerp/boolfunc.c:1.4 *** ComTerp/boolfunc.c:1.3 Mon Apr 10 22:27:50 2000 --- src/ComTerp/boolfunc.c Tue May 16 06:21:10 2000 *************** *** 286,291 **** --- 286,294 ---- case ComValue::DoubleType: result.boolean_ref() = operand1.double_val() != operand2.double_val(); break; + case ComValue::UnknownType: + result.boolean_ref() = operand2.is_known(); + break; } reset_stack(); push_stack(result); Index: OverlayUnidraw/ovviews.c diff -c OverlayUnidraw/ovviews.c:1.1 OverlayUnidraw/ovviews.c:1.2 *** OverlayUnidraw/ovviews.c:1.1 Tue Jan 18 03:10:57 2000 --- src/OverlayUnidraw/ovviews.c Tue May 16 06:21:47 2000 *************** *** 62,67 **** --- 62,68 ---- _touched = false; UnfixSize(); UnfixLocation(); + _hilite_gs = nil; } ClassId OverlayView::GetClassId () { return OVERLAY_VIEW; } *************** *** 114,122 **** } Graphic* OverlayView::HighlightGraphic() { ! return nil; } void OverlayView::Highlight() { Graphic* hgr = HighlightGraphic(); if (!hgr) return; --- 115,128 ---- } Graphic* OverlayView::HighlightGraphic() { ! return _hilite_gs; } + void OverlayView::HighlightGraphic(Graphic* hilite_gs) { + delete _hilite_gs; + _hilite_gs = new FullGraphic(hilite_gs); + } + void OverlayView::Highlight() { Graphic* hgr = HighlightGraphic(); if (!hgr) return; *************** *** 370,375 **** --- 376,382 ---- delete view; } delete _views; + delete _hilite_gs; } static OverlayView* GetLeaf (OverlayView* ov) { Index: OverlayUnidraw/ovviews.h diff -c OverlayUnidraw/ovviews.h:1.1 OverlayUnidraw/ovviews.h:1.2 *** OverlayUnidraw/ovviews.h:1.1 Tue Jan 18 03:10:57 2000 --- src/OverlayUnidraw/ovviews.h Tue May 16 06:21:48 2000 *************** *** 87,92 **** --- 87,96 ---- // graphic used to highlight by changing graphic state. // A nil returned from this method disables the mechanism. + virtual void HighlightGraphic(Graphic* hilite_gs); + // graphic used to highlight by changing graphic state. + // A nil returned from this method disables the mechanism. + virtual Selection* MakeSelection(); // factor method to construct an OverlaySelection. *************** *** 136,141 **** --- 140,146 ---- boolean _fixed_size; float _fixed_size_factor; boolean _fixed_location; + Graphic* _hilite_gs; }; //: graphical view of OverlaysComp. Index: OverlayUnidraw/scriptview.c diff -c OverlayUnidraw/scriptview.c:1.1 OverlayUnidraw/scriptview.c:1.2 *** OverlayUnidraw/scriptview.c:1.1 Tue Jan 18 03:10:58 2000 --- src/OverlayUnidraw/scriptview.c Tue May 16 06:21:48 2000 *************** *** 551,565 **** AttributeValue* val; do { ! if (in.peek() == '\"') { sbuf[0] = '\"'; ParamList::parse_string(in, sbuf+1, SBUFSIZE-1); strcat(sbuf, "\"\n"); } ! else { ParamList::parse_token(in, sbuf, SBUFSIZE, " \t\n,"); strcat(sbuf, "\n"); ! } if (!in.good() && attrlist && keyword) { return -1; --- 551,567 ---- AttributeValue* val; do { ! char ch; ! if ((ch=in.peek()) == '\"') { sbuf[0] = '\"'; ParamList::parse_string(in, sbuf+1, SBUFSIZE-1); strcat(sbuf, "\"\n"); } ! else if (ch!=')') { ParamList::parse_token(in, sbuf, SBUFSIZE, " \t\n,"); strcat(sbuf, "\n"); ! } else ! strcpy(sbuf, "1\n"); if (!in.good() && attrlist && keyword) { return -1; Index: ComUnidraw/Imakefile diff -c ComUnidraw/Imakefile:1.3 ComUnidraw/Imakefile:1.4 *** ComUnidraw/Imakefile:1.3 Tue May 2 05:26:00 2000 --- src/ComUnidraw/Imakefile Tue May 16 06:21:54 2000 *************** *** 20,25 **** --- 20,26 ---- Obj26(grdotfunc) Obj26(grfunc) Obj26(grstatfunc) + Obj26(highlightfunc) Obj26(comeditor) Obj26(comterp-iohandler) Obj26(dialogfunc) Index: ComUnidraw/comeditor.c diff -c ComUnidraw/comeditor.c:1.5 ComUnidraw/comeditor.c:1.6 *** ComUnidraw/comeditor.c:1.5 Tue May 2 11:33:26 2000 --- src/ComUnidraw/comeditor.c Tue May 16 06:21:54 2000 *************** *** 25,30 **** --- 25,31 ---- #include <ComUnidraw/grdotfunc.h> #include <ComUnidraw/grfunc.h> #include <ComUnidraw/grstatfunc.h> + #include <ComUnidraw/highlightfunc.h> #include <ComUnidraw/comeditor.h> #include <ComUnidraw/comterp-iohandler.h> #include <ComUnidraw/dialogfunc.h> *************** *** 182,187 **** --- 183,190 ---- comterp->add_command("acknowledgebox", new AcknowledgeBoxFunc(comterp, this)); comterp->add_command("confirmbox", new ConfirmBoxFunc(comterp, this)); + + comterp->add_command("highlight", new HighlightFunc(comterp, this)); } /* virtual */ void ComEditor::ExecuteCmd(Command* cmd) { Index: comdraw/README diff -c comdraw/README:1.2 comdraw/README:1.3 *** comdraw/README:1.2 Tue Mar 21 12:03:05 2000 --- src/comdraw/README Tue May 16 06:21:56 2000 *************** *** 78,83 **** --- 78,84 ---- nrows() -- onscreen vertical extent in pixels handles(flag) -- enable/disable current selection tic marks and/or highlighting + highlight(compview compviewgs) -- set the highlight graphic state for a graphic zoom(zoomflt) -- zoom by factor zoomin() -- zoom-in by 2 Index: man1_ivtools/comdraw.1 diff -c man1_ivtools/comdraw.1:1.3 man1_ivtools/comdraw.1:1.4 *** man1_ivtools/comdraw.1:1.3 Tue May 2 11:33:44 2000 --- src/man/man1/comdraw.1 Tue May 16 06:22:15 2000 *************** *** 88,93 **** --- 88,94 ---- handles(flag) -- enable/disable current selection tic marks and/or highlighting + highlight(compview compviewgs) -- set the highlight graphic state for a graphic zoom(zoomflt) -- zoom by factor zoomin() -- zoom-in by 2 *** /dev/null Tue May 16 06:22:24 PDT 2000 --- patches/ivtools-000516-johnston-050 *************** patches/ivtools-000516-johnston-050 *** 0 **** --- 1 ---- + ivtools-000516-johnston-050 |
From: <ivt...@li...> - 2000-05-12 19:57:05
|
Patch: ivtools-000512-johnston-049 For: ivtools-0.8.2 Author: joh...@us... Subject: use of vector<char> to fix bug, comterp eval command returns scalar for single argument, asynch dialog boxes unmap on accept/cancel. Requires: This is an intermediate patch to ivtools-0.8.2. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - bug fixed in AttributeListEditor where a fixed buffer of length 1024 was overflowed. Replaced with a vector <char> instead. - change comterp eval command to return a single value if it has only one argument. - change the Dialog class so that a box put up with ::map_for or ::map_for_aligned (as opposed to ::post_for or ::post_for_aligned) can unmap itself when cancelled or accepted. Index: ComTerp/ctrlfunc.c diff -c ComTerp/ctrlfunc.c:1.2 ComTerp/ctrlfunc.c:1.3 *** ComTerp/ctrlfunc.c:1.2 Sun Feb 13 21:43:36 2000 --- src/ComTerp/ctrlfunc.c Fri May 12 04:18:16 2000 *************** *** 178,207 **** static int symret_sym = symbol_add("symret"); ComValue symretv(stack_key(symret_sym)); // evaluate every string fixed argument on the stack and return in array int numargs = nargsfixed(); ! if (numargs) { AttributeValueList* avl = nil; for (int i=0; i<numargs; i++) { ComValue argstrv (stack_arg(i)); if (argstrv.is_nil()) break; if (argstrv.is_string()) { ! if (comterp()->is_serv()) { ! ComValue* val = new ComValue(comterpserv()->run(argstrv.symbol_ptr(), true /* nested */)); ! if (val->is_nil() && symretv.is_true()) { ! delete val; ! val = new ComValue(argstrv.symbol_val(), AttributeValue::SymbolType); ! } ! if (!avl) avl = new AttributeValueList(); ! avl->Append(val); ! } else ! cerr << "need server (or remote) mode for eval(\"" << argstrv.string_ptr() << "\")\n"; } } reset_stack(); if (avl) { ComValue retval(avl); push_stack(retval); } } else reset_stack(); --- 178,228 ---- static int symret_sym = symbol_add("symret"); ComValue symretv(stack_key(symret_sym)); + if (!comterp()->is_serv()) { + cerr << "need server mode comterp (or remote mode) for eval command\n"; + reset_stack(); + push_stack(ComValue::nullval()); + return; + } + // evaluate every string fixed argument on the stack and return in array int numargs = nargsfixed(); ! if (numargs>1) { AttributeValueList* avl = nil; for (int i=0; i<numargs; i++) { ComValue argstrv (stack_arg(i)); if (argstrv.is_nil()) break; if (argstrv.is_string()) { ! ComValue* val = new ComValue(comterpserv()->run(argstrv.symbol_ptr(), true /* nested */)); ! if (val->is_nil() && symretv.is_true()) { ! delete val; ! val = new ComValue(argstrv.symbol_val(), AttributeValue::SymbolType); ! } ! if (!avl) avl = new AttributeValueList(); ! avl->Append(val); } } reset_stack(); if (avl) { ComValue retval(avl); push_stack(retval); + } + + } + /* unless only single argument */ + else if (numargs==1) { + + ComValue argstrv (stack_arg(0)); + reset_stack(); + if (argstrv.is_nil()) { + push_stack(ComValue::nullval()); + } else if (argstrv.is_string()) { + ComValue val(comterpserv()->run(argstrv.symbol_ptr(), true /* nested */)); + if (val.is_nil() && symretv.is_true()) { + val.assignval(ComValue(argstrv.symbol_val(), AttributeValue::SymbolType)); + } + push_stack(val); + } } else reset_stack(); Index: ComTerp/ctrlfunc.h diff -c ComTerp/ctrlfunc.h:1.3 ComTerp/ctrlfunc.h:1.4 *** ComTerp/ctrlfunc.h:1.3 Thu Apr 27 03:43:53 2000 --- src/ComTerp/ctrlfunc.h Fri May 12 04:18:16 2000 *************** *** 101,114 **** }; //: eval string command for ComTerp. ! // eval(cmdstr [cmdstr ...] :symret) -- evaluate string as commands, optionally returning symbol instead of nil. class EvalFunc : public ComFunc { public: EvalFunc(ComTerp*); virtual void execute(); virtual const char* docstring() { ! return "%s(cmdstr) -- evaluate string as commands, optionally return symbol instead of nil"; } }; --- 101,114 ---- }; //: eval string command for ComTerp. ! // str|lst=eval(cmdstr [cmdstr ...] :symret) -- evaluate string as commands, optionally returning symbol instead of nil. class EvalFunc : public ComFunc { public: EvalFunc(ComTerp*); virtual void execute(); virtual const char* docstring() { ! return "str|lst=%s(cmdstr) -- evaluate string as commands, optionally return symbol instead of nil"; } }; Index: ComTerp/symbolfunc.h diff -c ComTerp/symbolfunc.h:1.4 ComTerp/symbolfunc.h:1.5 *** ComTerp/symbolfunc.h:1.4 Mon May 8 22:06:58 2000 --- src/ComTerp/symbolfunc.h Fri May 12 04:18:16 2000 *************** *** 33,39 **** class ComTerp; //: symbol id command for ComTerp. ! // symid(symbol [symbol...]) -- return id(s) associated with symbol(s) class SymIdFunc : public ComFunc { public: SymIdFunc(ComTerp*); --- 33,39 ---- class ComTerp; //: symbol id command for ComTerp. ! // int|lst=symid(symbol [symbol ...]) -- return id(s) associated with symbol(s) class SymIdFunc : public ComFunc { public: SymIdFunc(ComTerp*); *************** *** 41,74 **** virtual boolean post_eval() { return true; } virtual const char* docstring() { ! return "%s(symbol [symbol...]) -- return id(s) associated with symbol(s)"; } }; //: symbol command for ComTerp. ! // symbol(symid [symid ...]) -- return symbol(s) associated with integer id(s) class SymbolFunc : public ComFunc { public: SymbolFunc(ComTerp*); virtual void execute(); virtual const char* docstring() { ! return "%s(symid [symid...]) -- return symbol(s) associated with integer id(s)"; } }; //: lookup symbol value command for ComTerp. ! // symval(symbol_var [symbol_var ...]) -- return value(s) associated with symbol variable(s) class SymValFunc : public ComFunc { public: SymValFunc(ComTerp*); virtual void execute(); virtual const char* docstring() { ! return "%s(symbol_var [symbol_var...]) -- return value(s) associated with symbol variables(s)"; } }; //: create symbol command for ComTerp. ! // symadd(symbol [symbol...]) -- create symbol(s) and return without lookup class SymAddFunc : public ComFunc { public: SymAddFunc(ComTerp*); --- 41,74 ---- virtual boolean post_eval() { return true; } virtual const char* docstring() { ! return "int|lst=%s(symbol [symbol ...]) -- return id(s) associated with symbol(s)"; } }; //: symbol command for ComTerp. ! // sym|lst=symbol(symid [symid ...]) -- return symbol(s) associated with integer id(s) class SymbolFunc : public ComFunc { public: SymbolFunc(ComTerp*); virtual void execute(); virtual const char* docstring() { ! return "sym|lst=%s(symid [symid ...]) -- return symbol(s) associated with integer id(s)"; } }; //: lookup symbol value command for ComTerp. ! // val|lst=symval(symbol_var [symbol_var ...]) -- return value(s) associated with symbol variable(s) class SymValFunc : public ComFunc { public: SymValFunc(ComTerp*); virtual void execute(); virtual const char* docstring() { ! return "val|lst=%s(symbol_var [symbol_var ...]) -- return value(s) associated with symbol variables(s)"; } }; //: create symbol command for ComTerp. ! // sym|lst=symadd(symbol [symbol ...]) -- create symbol(s) and return without lookup class SymAddFunc : public ComFunc { public: SymAddFunc(ComTerp*); *************** *** 76,82 **** virtual boolean post_eval() { return true; } virtual const char* docstring() { ! return "%s(symbol [symbol...]) -- create symbol(s) and return without lookup"; } }; //: command to split a symbol or string into a list of character objects --- 76,82 ---- virtual boolean post_eval() { return true; } virtual const char* docstring() { ! return "sym|lst=%s(symbol [symbol ...]) -- create symbol(s) and return without lookup"; } }; //: command to split a symbol or string into a list of character objects Index: comterp/README diff -c comterp/README:1.6 comterp/README:1.7 *** comterp/README:1.6 Mon May 8 22:07:00 2000 --- src/comterp_/README Fri May 12 04:18:19 2000 *************** *** 178,190 **** [str]=print(fmtstr val :string|:str :err) -- print value with format string [str]=print(val :string|:str :err) -- print value with format string ! symid(symbol [symbol...]) -- return integer id(s) associated with symbol(s) ! symbol(symid [symid...]) -- return symbol(s) associated with integer id(s) ! symval(symbol [symbol...]) -- return value(s) associated with symbol variables(s) ! symadd(symbol [symbol ...]) -- create symbol(s) and return without lookup. lst=split(symbol|string) -- split symbol or string into list of characters. --- 178,190 ---- [str]=print(fmtstr val :string|:str :err) -- print value with format string [str]=print(val :string|:str :err) -- print value with format string ! int|lst=symid(symbol [symbol ...]) -- return integer id(s) associated with symbol(s) ! sym|lst=symbol(symid [symid ...]) -- return symbol(s) associated with integer id(s) ! val|lst=symval(symbol [symbol ...]) -- return value(s) associated with symbol variables(s) ! sym|lst=symadd(symbol [symbol ...]) -- create symbol(s) and return without lookup. lst=split(symbol|string) -- split symbol or string into list of characters. *************** *** 208,214 **** val=remote(hoststr portnum cmdstr :nowait) -- remotely evaluate command string then locally evaluate result string ! val=eval(cmdstr [cmdstr ...] :symret ) -- evaluate string as commands, optionally return symbol instead of nil val=shell(cmdstr) -- evaluate command in shell --- 208,214 ---- val=remote(hoststr portnum cmdstr :nowait) -- remotely evaluate command string then locally evaluate result string ! val|lst=eval(cmdstr [cmdstr ...] :symret ) -- evaluate string as commands, optionally return symbol instead of nil val=shell(cmdstr) -- evaluate command in shell Index: src_interviews/dialogs.c diff -c src_interviews/dialogs.c:1.2 src_interviews/dialogs.c:1.3 *** src_interviews/dialogs.c:1.2 Thu Jan 27 01:51:26 2000 --- src/InterViews/dialogs.c Fri May 12 04:18:30 2000 *************** *** 155,161 **** /* class Dialog */ ! Dialog::Dialog(Glyph* g, Style* s) : InputHandler(g, s) { t_ = nil;} Dialog::~Dialog() { } boolean Dialog::post_for_aligned(Window* w, float x_align, float y_align) { --- 155,164 ---- /* class Dialog */ ! Dialog::Dialog(Glyph* g, Style* s) : InputHandler(g, s) { ! t_ = nil; ! unmap_for_dismiss_=false; ! } Dialog::~Dialog() { } boolean Dialog::post_for_aligned(Window* w, float x_align, float y_align) { *************** *** 198,203 **** --- 201,207 ---- t_->place(w->left() + 0.5 * w->width(), w->bottom() + 0.5 * w->height()); t_->align(x_align, y_align); t_->map(); + unmap_for_dismiss_=true; } void Dialog::map_at_aligned( *************** *** 210,215 **** --- 214,220 ---- t_->place(x, y); t_->align(x_align, y_align); t_->map(); + unmap_for_dismiss_=true; } void Dialog::unmap() { *************** *** 219,224 **** --- 224,230 ---- delete t_; t_ = nil; } + unmap_for_dismiss_=false; } boolean Dialog::mapped() { *************** *** 253,256 **** --- 259,263 ---- void Dialog::dismiss(boolean accept) { accepted_ = accept; done_ = true; + if (unmap_for_dismiss_) unmap(); } Index: AttrGlyph/attredit.c diff -c AttrGlyph/attredit.c:1.1 AttrGlyph/attredit.c:1.2 *** AttrGlyph/attredit.c:1.1 Tue Jan 18 03:09:42 2000 --- src/AttrGlyph/attredit.c Fri May 12 04:18:56 2000 *************** *** 43,48 **** --- 43,49 ---- #include <strstream.h> #include <string.h> + #include <vector.h> declareActionCallback(AttributeListEditor) implementActionCallback(AttributeListEditor) *************** *** 101,131 **** --- 102,169 ---- } } + #define STL_VECTOR void AttributeListEditor::update_text(boolean update) { ALIterator i; + #ifndef STL_VECTOR char buf[1024]; memset(buf, 0, 1024); + #else + vector <char> vbuf; + #endif for (_list->First(i); !_list->Done(i); _list->Next(i)) { Attribute* attr = _list->GetAttr(i); const char* name = attr->Name(); int namelen = name ? strlen(name) : 0; if (name) + #ifndef STL_VECTOR strcat(buf, name); + #else + { + const char* namep = name; + while (*namep) { vbuf.push_back(*namep++); } + } + #endif int n; for (n = 15; n > namelen-1; n--) + #ifndef STL_VECTOR strcat(buf, " "); + #else + vbuf.push_back(' '); + #endif + #ifndef STL_VECTOR strcat(buf, " "); + #else + vbuf.push_back(' '); + #endif strstream valstr; valstr << *attr->Value() << '\0'; const char* val = valstr.str(); int vallen = val ? strlen(val) : 0; if (val) + #ifndef STL_VECTOR strcat(buf, val); + #else + { + const char* valp = val; + while (*valp) { vbuf.push_back(*valp++); } + } + #endif for (n = 15; n > vallen; n--) + #ifndef STL_VECTOR strcat(buf, " "); strcat(buf, "\n"); + #else + vbuf.push_back(' '); + vbuf.push_back('\n'); + #endif + } + #ifndef STL_VECTOR _ete->text(buf, update); + #else + _ete->text(&vbuf[0], update); + #endif } void AttributeListEditor::build() { Index: OverlayUnidraw/ovgdialog.c diff -c OverlayUnidraw/ovgdialog.c:1.1 OverlayUnidraw/ovgdialog.c:1.2 *** OverlayUnidraw/ovgdialog.c:1.1 Tue Jan 18 03:10:48 2000 --- src/OverlayUnidraw/ovgdialog.c Fri May 12 04:19:04 2000 *************** *** 25,30 **** --- 25,31 ---- #include <OverlayUnidraw/ovcomps.h> #include <OverlayUnidraw/ovgdialog.h> #include <Unidraw/unidraw.h> + #include <Unidraw/statevars.h> #include <AttrGlyph/attredit.h> #include <IVGlyph/textedit.h> *************** *** 203,208 **** --- 204,210 ---- style_ = s; comp_ = oc; copylist_ = new AttributeList(comp_->GetAttributeList()); + Resource::ref(copylist_); build(copylist_); } *************** *** 250,261 **** void AttributeDialogImpl::accept() { editor_->add(); comp_->SetAttributeList(copylist_); dialog_->dismiss(true); unidraw->Update(); } void AttributeDialogImpl::cancel() { ! delete copylist_; dialog_->dismiss(false); } --- 252,266 ---- void AttributeDialogImpl::accept() { editor_->add(); + // should set modified flag here if something happenns + // ((ModifStatusVar*)<Editor>->GetState("ModifStatusVar"))->SetModifStatus(true); comp_->SetAttributeList(copylist_); + Unref(copylist_); dialog_->dismiss(true); unidraw->Update(); } void AttributeDialogImpl::cancel() { ! Unref(copylist_); dialog_->dismiss(false); } Index: OverlayUnidraw/ovkit.c diff -c OverlayUnidraw/ovkit.c:1.3 OverlayUnidraw/ovkit.c:1.4 *** OverlayUnidraw/ovkit.c:1.3 Tue Mar 14 23:18:59 2000 --- src/OverlayUnidraw/ovkit.c Fri May 12 04:19:04 2000 *************** *** 1436,1443 **** --- 1436,1447 ---- WidgetKit& kit = *WidgetKit::instance(); AttributeDialog* dlog = new AttributeDialog(comp, &kit, kit.style()); dlog->ref(); + #if 0 if (dlog->post_for(_ed->GetWindow())) ((ModifStatusVar*)_ed->GetState("ModifStatusVar"))->SetModifStatus(true); + #else + dlog->map_for(_ed->GetWindow()); + #endif } int OverlayKit::bintest(const char* command) { Index: include_interviews/dialog.h diff -c include_interviews/dialog.h:1.3 include_interviews/dialog.h:1.4 *** include_interviews/dialog.h:1.3 Tue May 2 11:33:36 2000 --- src/include/InterViews/dialog.h Fri May 12 04:19:17 2000 *************** *** 67,72 **** --- 67,73 ---- private: boolean done_; boolean accepted_; + boolean unmap_for_dismiss_; TransientWindow* t_; }; Index: man1_ivtools/comterp.1 diff -c man1_ivtools/comterp.1:1.6 man1_ivtools/comterp.1:1.7 *** man1_ivtools/comterp.1:1.6 Mon May 8 22:07:38 2000 --- src/man/man1/comterp.1 Fri May 12 04:19:24 2000 *************** *** 186,198 **** [str]=print(fmtstr val :string|:str :err) -- print value with format string [str]=print(val :string|:str :err) -- print value ! symid(symbol [symbol...]) -- return integer id(s) associated with symbol(s) ! symbol(symid [symid...]) -- return symbol(s) associated with integer id(s) ! symval(symbol [symbol...]) -- return value(s) associated with symbol variables(s) ! symadd(symbol [symbol ...]) -- create symbol(s) and return without lookup. lst=split(symbol|string) -- split symbol or string into list of characters. --- 186,198 ---- [str]=print(fmtstr val :string|:str :err) -- print value with format string [str]=print(val :string|:str :err) -- print value ! int|lst=symid(symbol [symbol ...]) -- return integer id(s) associated with symbol(s) ! sym|lst=symbol(symid [symid ...]) -- return symbol(s) associated with integer id(s) ! val|lst=symval(symbol [symbol ...]) -- return value(s) associated with symbol variables(s) ! sym|lst=symadd(symbol [symbol ...]) -- create symbol(s) and return without lookup. lst=split(symbol|string) -- split symbol or string into list of characters. *** /dev/null Fri May 12 04:19:30 PDT 2000 --- patches/ivtools-000512-johnston-049 *************** patches/ivtools-000512-johnston-049 *** 0 **** --- 1 ---- + ivtools-000512-johnston-049 |
From: <ivt...@li...> - 2000-05-12 19:56:10
|
Patch: ivtools-000510-johnston-048 For: ivtools-0.8.2 Author: joh...@us... Subject: use of STL vector back in Requires: This is an intermediate patch to ivtools-0.8.2. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - print "nil" instead of "Unknown type" when a ComValue is of UnknownType, since that is how UnknownType is used throughout comterp, as the nil value which means no value. - re-enable use of STL vector in ComterpHandler::handle_input. Index: Attribute/attrvalue.c diff -c Attribute/attrvalue.c:1.7 Attribute/attrvalue.c:1.8 *** Attribute/attrvalue.c:1.7 Sat May 6 05:46:19 2000 --- src/Attribute/attrvalue.c Wed May 10 03:28:28 2000 *************** *** 768,774 **** break; default: ! out << "Unknown type"; break; } #endif --- 768,774 ---- break; default: ! out << "nil"; break; } #endif Index: ComTerp/comhandler.c diff -c ComTerp/comhandler.c:1.4 ComTerp/comhandler.c:1.5 *** ComTerp/comhandler.c:1.4 Sat May 6 05:46:22 2000 --- src/ComTerp/comhandler.c Wed May 10 03:28:30 2000 *************** *** 41,47 **** ComterpHandler::ComterpHandler (void) { ! comterp_ = new ComTerpServ(BUFSIZ*BUFSIZ); comterp_->handler(this); comterp_->add_defaults(); _timeoutscriptid = -1; --- 41,47 ---- ComterpHandler::ComterpHandler (void) { ! comterp_ = new ComTerpServ(/*BUFSIZ*BUFSIZ*/); comterp_->handler(this); comterp_->add_defaults(); _timeoutscriptid = -1; *************** *** 122,128 **** int ComterpHandler::handle_input (ACE_HANDLE fd) { ! #if 1 const int bufsiz = BUFSIZ; //*BUFSIZ; char inbuf[bufsiz]; inbuf[0] = '\0'; --- 122,128 ---- int ComterpHandler::handle_input (ACE_HANDLE fd) { ! #if 0 const int bufsiz = BUFSIZ; //*BUFSIZ; char inbuf[bufsiz]; inbuf[0] = '\0'; *************** *** 134,140 **** char ch; filebuf ibuf(fd); istream istr(&ibuf); ! while(istr.good() && istr.get(ch),ch!='\n') inv.push_back(ch); inv.push_back('\0'); char* inbuf = &inv[0]; --- 134,140 ---- char ch; filebuf ibuf(fd); istream istr(&ibuf); ! while(istr.good() && istr.get(ch),ch!='\n'&&ch!='\0') inv.push_back(ch); inv.push_back('\0'); char* inbuf = &inv[0]; Index: OverlayUnidraw/ovcomps.c diff -c OverlayUnidraw/ovcomps.c:1.4 OverlayUnidraw/ovcomps.c:1.5 *** OverlayUnidraw/ovcomps.c:1.4 Thu Apr 6 23:23:45 2000 --- src/OverlayUnidraw/ovcomps.c Wed May 10 03:28:48 2000 *************** *** 194,199 **** --- 194,200 ---- } OverlayView* OverlayComp::FindView (Viewer* viewer) { + if (!_views) return nil; for (UList* u = _views->First(); u != _views->End(); u = u->Next()) { ComponentView* compview = View(u); if (compview->IsA(OVERLAY_VIEW) && *** /dev/null Wed May 10 03:29:05 PDT 2000 --- patches/ivtools-000510-johnston-048 *************** patches/ivtools-000510-johnston-048 *** 0 **** --- 1 ---- + ivtools-000510-johnston-048 |
From: <ivt...@li...> - 2000-05-12 19:55:29
|
Patch: ivtools-000508-johnston-047 For: ivtools-0.8.2 Author: joh...@us... Subject: split and join string commands, -DUnidrawCommon added to build of libUnidraw-common Requires: This is an intermediate patch to ivtools-0.8.2. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - new comterp commands to "split" a string or symbol into a list of characters, and to "join" a list of characters into a string or symbol. - add -DUnidrawCommon to the compiler command line in the Unidraw-common library, and make judicious use of "#ifndef UnidrawCommon" in Unidraw/component.c and Unidraw/compview.c, so they only pull in stuff out of libUnidraw-common. Index: ComTerp/comterp.c diff -c ComTerp/comterp.c:1.13 ComTerp/comterp.c:1.14 *** ComTerp/comterp.c:1.13 Mon May 1 23:52:59 2000 --- src/ComTerp/comterp.c Mon May 8 22:06:58 2000 *************** *** 831,836 **** --- 831,839 ---- add_command("symval", new SymValFunc(this)); add_command("symbol", new SymbolFunc(this)); add_command("symadd", new SymAddFunc(this)); + add_command("split", new SplitStrFunc(this)); + add_command("join", new JoinStrFunc(this)); + add_command("postfix", new PostFixFunc(this)); add_command("posteval", new PostEvalFunc(this)); Index: ComTerp/symbolfunc.c diff -c ComTerp/symbolfunc.c:1.4 ComTerp/symbolfunc.c:1.5 *** ComTerp/symbolfunc.c:1.4 Thu Apr 6 23:23:12 2000 --- src/ComTerp/symbolfunc.c Mon May 8 22:06:58 2000 *************** *** 1,5 **** /* ! * Copyright (c) 1998,1999 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided --- 1,5 ---- /* ! * Copyright (c) 1998,1999,2000 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided *************** *** 29,34 **** --- 29,36 ---- #include <Attribute/attrlist.h> #include <Attribute/attrvalue.h> + #include <Unidraw/iterator.h> + #include <iostream.h> #define TITLE "SymbolFunc" *************** *** 171,176 **** --- 173,231 ---- reset_stack(); push_stack(retval); } + } + + /*****************************************************************************/ + + SplitStrFunc::SplitStrFunc(ComTerp* comterp) : ComFunc(comterp) { + } + + void SplitStrFunc::execute() { + ComValue symvalv(stack_arg(0)); + reset_stack(); + + if (symvalv.is_string()) { + AttributeValueList* avl = new AttributeValueList(); + ComValue retval(avl); + const char* str = symvalv.symbol_ptr(); + int len = strlen(str); + for (int i=0; i<len; i++) + avl->Append(new AttributeValue(str[i])); + push_stack(retval); + } else + push_stack(ComValue::nullval()); + } + + /*****************************************************************************/ + + JoinStrFunc::JoinStrFunc(ComTerp* comterp) : ComFunc(comterp) { + } + + void JoinStrFunc::execute() { + ComValue listv(stack_arg(0)); + static sym_symid = symbol_add("sym"); + ComValue symflagv(stack_key(sym_symid)); + boolean symflag = symflagv.is_true(); + reset_stack(); + + if (listv.is_array()) { + AttributeValueList* avl = listv.array_val(); + if (avl) { + char cbuf[avl->Number()+1]; + Iterator i; + int cnt=0; + for (avl->First(i); !avl->Done(i); avl->Next(i)) { + cbuf[cnt] = avl->GetAttrVal(i)->char_val(); + cnt++; + } + cbuf[cnt] = '\0'; + + ComValue retval(symbol_add(cbuf), symflag ? ComValue::SymbolType : ComValue::StringType); + push_stack(retval); + return; + } + } + push_stack(ComValue::nullval()); } Index: ComTerp/symbolfunc.h diff -c ComTerp/symbolfunc.h:1.3 ComTerp/symbolfunc.h:1.4 *** ComTerp/symbolfunc.h:1.3 Thu Apr 6 23:23:12 2000 --- src/ComTerp/symbolfunc.h Mon May 8 22:06:58 2000 *************** *** 67,73 **** return "%s(symbol_var [symbol_var...]) -- return value(s) associated with symbol variables(s)"; } }; ! #//: create symbol command for ComTerp. // symadd(symbol [symbol...]) -- create symbol(s) and return without lookup class SymAddFunc : public ComFunc { public: --- 67,73 ---- return "%s(symbol_var [symbol_var...]) -- return value(s) associated with symbol variables(s)"; } }; ! //: create symbol command for ComTerp. // symadd(symbol [symbol...]) -- create symbol(s) and return without lookup class SymAddFunc : public ComFunc { public: *************** *** 78,81 **** --- 78,105 ---- virtual const char* docstring() { return "%s(symbol [symbol...]) -- create symbol(s) and return without lookup"; } }; + + //: command to split a symbol or string into a list of character objects + // lst=split(symbol|string) -- split symbol or string into list of characters. + class SplitStrFunc : public ComFunc { + public: + SplitStrFunc(ComTerp*); + virtual void execute(); + + virtual const char* docstring() { + return "lst=%s(symbol|string) -- split symbol or string into list of characters"; } + }; + + //: command to join list of characters into a string object + // str=join(clist) -- join list of characters into string + class JoinStrFunc : public ComFunc { + public: + JoinStrFunc(ComTerp*); + virtual void execute(); + + virtual const char* docstring() { + return "str=%s(clist) -- join list of characters into string"; } + }; + + #endif /* !defined(_symbolfunc_h) */ Index: comterp/README diff -c comterp/README:1.5 comterp/README:1.6 *** comterp/README:1.5 Thu Apr 6 23:23:15 2000 --- src/comterp_/README Mon May 8 22:07:00 2000 *************** *** 186,191 **** --- 186,195 ---- symadd(symbol [symbol ...]) -- create symbol(s) and return without lookup. + lst=split(symbol|string) -- split symbol or string into list of characters. + + str=join(clist :sym) -- join list of characters into string + postfix(arg1 [arg2 [arg3 ... [argn]]]) -- echo unevaluated postfix arguments (with [narg|nkey] after defined commands, {narg|nkey} after undefined commands, (narg) after keys, and a * following post-evaluation commands) Index: Unidraw/component.c diff -c Unidraw/component.c:1.1 Unidraw/component.c:1.2 *** Unidraw/component.c:1.1 Tue Jan 18 03:09:53 2000 --- src/Unidraw/component.c Mon May 8 22:07:20 2000 *************** *** 45,52 **** --- 45,54 ---- void Component::Read (istream&) { } void Component::Write (ostream&) { } void Component::Update () { } + #ifndef UnidrawCommon StateVar* Component::GetState (const char*) { return nil; } TransferFunct* Component::GetTransferFunct() { return nil; } + #endif boolean Component::_use_unidraw = true; *************** *** 60,67 **** --- 62,71 ---- delete _views; if (Component::use_unidraw()) { + #ifndef UnidrawCommon unidraw->GetCatalog()->Forget(this); unidraw->ClearHistory(this); + #endif } } *************** *** 75,80 **** --- 79,85 ---- view->SetSubject(nil); } + #ifndef UnidrawCommon ComponentView* Component::Create (ClassId viewId) { ClassId gv = Combine(GetClassId(), viewId); *************** *** 83,88 **** --- 88,94 ---- else return (ComponentView*) Creator::instance()->Create(gv); } + #endif ComponentView* Component::View (UList* r) { return (ComponentView*) (*r)(); *************** *** 94,101 **** --- 100,109 ---- } } + #ifndef UnidrawCommon void Component::Interpret (Command*) { } void Component::Uninterpret (Command*) { } + #endif Component* Component::GetParent () { return nil; } void Component::SetParent (Component*, Component*) { } void Component::First (Iterator&) { } Index: Unidraw/compview.c diff -c Unidraw/compview.c:1.1 Unidraw/compview.c:1.2 *** Unidraw/compview.c:1.1 Tue Jan 18 03:09:53 2000 --- src/Unidraw/compview.c Mon May 8 22:07:20 2000 *************** *** 52,59 **** --- 52,61 ---- } void ComponentView::Update () { } + #ifndef UnidrawCommon void ComponentView::Interpret (Command* c) { GetSubject()->Interpret(c); } void ComponentView::Uninterpret (Command* c) { GetSubject()->Uninterpret(c); } + #endif ComponentView* ComponentView::GetParent () { return nil; } void ComponentView::SetSubject (Component* c) { _subject = c; } Index: include_components/component.h diff -c include_components/component.h:1.1 include_components/component.h:1.2 *** include_components/component.h:1.1 Tue Jan 18 03:13:02 2000 --- src/include/Unidraw/Components/component.h Mon May 8 22:07:35 2000 *************** *** 31,41 **** --- 31,45 ---- #include <Unidraw/globals.h> + #ifndef UnidrawCommon class Command; + #endif class ComponentView; class Iterator; + #ifndef UnidrawCommon class StateVar; class TransferFunct; + #endif class UList; class istream; class ostream; *************** *** 46,58 **** --- 50,66 ---- public: virtual void Update(); virtual void Notify(); + #ifndef UnidrawCommon virtual void Interpret(Command*); virtual void Uninterpret(Command*); + #endif virtual Component* GetParent(); virtual Component* GetRoot(); + #ifndef UnidrawCommon virtual StateVar* GetState(const char*); virtual TransferFunct* GetTransferFunct(); + #endif virtual void First(Iterator&); virtual void Last(Iterator&); *************** *** 62,68 **** --- 70,78 ---- virtual void Attach(ComponentView*); virtual void Detach(ComponentView*); + #ifndef UnidrawCommon ComponentView* Create(ClassId); + #endif virtual ~Component(); virtual Component* Copy(); Index: include_components/compview.h diff -c include_components/compview.h:1.1 include_components/compview.h:1.2 *** include_components/compview.h:1.1 Tue Jan 18 03:13:03 2000 --- src/include/Unidraw/Components/compview.h Mon May 8 22:07:35 2000 *************** *** 29,35 **** --- 29,37 ---- #include <Unidraw/globals.h> + #ifndef UnidrawCommon class Command; + #endif class Component; class Iterator; *************** *** 38,45 **** --- 40,49 ---- class ComponentView { public: virtual void Update(); + #ifndef UnidrawCommon virtual void Interpret(Command*); virtual void Uninterpret(Command*); + #endif virtual ComponentView* GetParent(); virtual void First(Iterator&); Index: man1_ivtools/comterp.1 diff -c man1_ivtools/comterp.1:1.5 man1_ivtools/comterp.1:1.6 *** man1_ivtools/comterp.1:1.5 Thu Apr 6 23:24:09 2000 --- src/man/man1/comterp.1 Mon May 8 22:07:38 2000 *************** *** 194,199 **** --- 194,203 ---- symadd(symbol [symbol ...]) -- create symbol(s) and return without lookup. + lst=split(symbol|string) -- split symbol or string into list of characters. + + str=join(clist :sym) -- join list of characters into string + postfix(arg1 [arg2 [arg3 ... [argn]]]) -- echo unevaluated postfix arguments (with [narg|nkey] after defined commands, {narg|nkey} after undefined commands, (narg) after keys, and a * following post-evaluation commands) arr=posteval(arg1 [arg2 [arg3 ... [argn]]]) -- post-evaluate every fixed argument (until nil) and return array *** /dev/null Mon May 8 22:07:42 PDT 2000 --- patches/ivtools-000508-johnston-047 *************** patches/ivtools-000508-johnston-047 *** 0 **** --- 1 ---- + ivtools-000508-johnston-047 |
From: <ivt...@li...> - 2000-05-12 19:54:22
|
Patch: ivtools-000506-johnston-046 For: ivtools-0.8.2 Author: joh...@us... Subject: fix "geta" methods on AttributeValue and ComValue Requires: This is an intermediate patch to ivtools-0.8.2. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - fix AttributeValue::geta(int classid) and add back a ComValue::geta(int classid) - temporarily back out STL vector improvement. Did this as a test and then forget to back it in for this patch, back in soon. - fix the use of CLASS_SYMID macro in OverlaysComp class definition. It was missing the "s" from the class name string. Index: Attribute/attrvalue.c diff -c Attribute/attrvalue.c:1.6 Attribute/attrvalue.c:1.7 *** Attribute/attrvalue.c:1.6 Sat Mar 18 02:04:14 2000 --- src/Attribute/attrvalue.c Sat May 6 05:46:19 2000 *************** *** 870,881 **** } void* AttributeValue::geta(int id) { ! if (is_object(id)) { ! if (object_compview()) ! return nil; ! else ! return obj_val(); ! } else return nil; } --- 870,878 ---- } void* AttributeValue::geta(int id) { ! if (is_object(id)) ! return obj_val(); ! else return nil; } Index: Attribute/attrvalue.h diff -c Attribute/attrvalue.h:1.9 Attribute/attrvalue.h:1.10 *** Attribute/attrvalue.h:1.9 Fri Mar 24 23:15:18 2000 --- src/Attribute/attrvalue.h Sat May 6 05:46:19 2000 *************** *** 292,299 **** boolean is_attribute(); // returns true if ObjectType with an Attribute object. ! void* geta(int id); ! // get the class symbol id associated with an ObjectType. friend ostream& operator << (ostream& s, const AttributeValue&); // output AttributeValue to ostream. --- 292,299 ---- boolean is_attribute(); // returns true if ObjectType with an Attribute object. ! void* geta(int type); ! // return a pointer if ObjectType matches friend ostream& operator << (ostream& s, const AttributeValue&); // output AttributeValue to ostream. Index: ComTerp/comhandler.c diff -c ComTerp/comhandler.c:1.3 ComTerp/comhandler.c:1.4 *** ComTerp/comhandler.c:1.3 Thu May 4 04:52:27 2000 --- src/ComTerp/comhandler.c Sat May 6 05:46:22 2000 *************** *** 122,129 **** int ComterpHandler::handle_input (ACE_HANDLE fd) { ! #if 0 ! const int bufsiz = BUFSIZ*BUFSIZ; char inbuf[bufsiz]; inbuf[0] = '\0'; filebuf ibuf(fd); --- 122,129 ---- int ComterpHandler::handle_input (ACE_HANDLE fd) { ! #if 1 ! const int bufsiz = BUFSIZ; //*BUFSIZ; char inbuf[bufsiz]; inbuf[0] = '\0'; filebuf ibuf(fd); Index: ComTerp/comvalue.c diff -c ComTerp/comvalue.c:1.12 ComTerp/comvalue.c:1.13 *** ComTerp/comvalue.c:1.12 Mon May 1 23:52:59 2000 --- src/ComTerp/comvalue.c Sat May 6 05:46:22 2000 *************** *** 22,27 **** --- 22,28 ---- * */ + #include <Unidraw/Components/compview.h> #include <ComTerp/comfunc.h> #include <ComTerp/comvalue.h> #include <ComTerp/comterp.h> *************** *** 351,353 **** --- 352,365 ---- return is_type(CommandType) && func_classid==((ComFunc*)obj_val())->classid(); } + + void* ComValue::geta(int id) { + if (is_object(id)) { + if (object_compview()) + return ((ComponentView*)obj_val())->GetSubject(); + else + return obj_val(); + } else + return nil; + } + Index: ComTerp/comvalue.h diff -c ComTerp/comvalue.h:1.9 ComTerp/comvalue.h:1.10 *** ComTerp/comvalue.h:1.9 Mon Feb 21 20:48:41 2000 --- src/ComTerp/comvalue.h Sat May 6 05:46:22 2000 *************** *** 92,97 **** --- 92,100 ---- ComValue& operator= (const ComValue&); // assignment operator. + void* geta(int type); + // return a pointer if ObjectType matches + int narg() const; // number of arguments associated with this command or keyword. int nkey() const; Index: OverlayUnidraw/ovcomps.h diff -c OverlayUnidraw/ovcomps.h:1.4 OverlayUnidraw/ovcomps.h:1.5 *** OverlayUnidraw/ovcomps.h:1.4 Fri Mar 24 23:15:47 2000 --- src/OverlayUnidraw/ovcomps.h Sat May 6 05:46:54 2000 *************** *** 299,305 **** friend OverlaysScript; ! CLASS_SYMID("OverlayComp"); }; #include <OverlayUnidraw/indexmixins.h> --- 299,305 ---- friend OverlaysScript; ! CLASS_SYMID("OverlaysComp"); }; #include <OverlayUnidraw/indexmixins.h> *** /dev/null Sat May 6 05:47:17 PDT 2000 --- patches/ivtools-000506-johnston-046 *************** patches/ivtools-000506-johnston-046 *** 0 **** --- 1 ---- + ivtools-000506-johnston-046 |
From: <ivt...@li...> - 2000-05-03 23:04:25
|
Patch: ivtools-000504-johnston-045 For: ivtools-0.8.2 Author: joh...@us... Subject: use self-growing STL vector<char> to read in comterp commands from socket Requires: This is an intermediate patch to ivtools-0.8.2. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - use a self-growing STL (Standard Template Library) vector<char> to read comterp commands from a socket. This replaces the year-old hack of using a 1 megabyte input buffer (BUFSIZ*BUFSIZ), which was problematic in certain run-time environments, causing an inexplicable crash at the head of ComterpHandler::handle_input before any code of the method was executed. If this approach proves out, it should be migrated to all the other large input buffers spread around ivtools (where-ever the size is BUFSIZ*BUFSIZ), and would make for a significant reduction in the runtime footprint of some programs. Index: ComTerp/comhandler.c diff -c ComTerp/comhandler.c:1.2 ComTerp/comhandler.c:1.3 *** ComTerp/comhandler.c:1.2 Tue Feb 15 04:56:30 2000 --- src/ComTerp/comhandler.c Thu May 4 04:52:27 2000 *************** *** 1,4 **** --- 1,5 ---- /* + * Copyright (c) 2000 IET Inc. * Copyright (c) 1996 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and *************** *** 27,32 **** --- 28,34 ---- #include <ComTerp/comterpserv.h> #include <iostream.h> + #include <vector.h> #if BUFSIZ>1024 #undef BUFSIZ *************** *** 117,197 **** // Perform the logging record receive. static const unit = 15; - // #define INPUT_BY_READ - int ComterpHandler::handle_input (ACE_HANDLE fd) { ! #if 1 const int bufsiz = BUFSIZ*BUFSIZ; char inbuf[bufsiz]; - char outbuf[bufsiz]; inbuf[0] = '\0'; - #if !defined(INPUT_BY_READ) filebuf ibuf(fd); istream istr(&ibuf); istr.getline(inbuf, bufsiz); if (!comterp_ || !istr.good()) return -1; ! else if (!*inbuf) { filebuf obuf(fd ? fd : 1); ostream ostr(&obuf); ostr << "\n"; ostr.flush(); return 0; } - #else - int len = 0; - while (len<bufsiz-2) { - int nread = read(fd, inbuf+len, 1); - if (nread!=1) { - cerr << "zero bytes read, connection closed\n"; - return -1; - } - if (inbuf[len] == '\n') break; - len++; - } - inbuf[len] = '\0'; - #endif comterp_->load_string(inbuf); if (fd>0) cerr << "command via ACE -- " << inbuf << "\n"; - #else - comterp_->_infunc = (infuncptr)&ComTerpServ::fd_fgets; - #endif comterp_->_fd = fd; comterp_->_outfunc = (outfuncptr)&ComTerpServ::fd_fputs; - #if 1 int status = comterp_->ComTerp::run(false /* !once */); - #else - if (comterp_->read_expr()) { - if (comterp_->eval_expr()) { - err_print( stderr, "comterp" ); - filebuf obuf(fd ? fd : 1); - ostream ostr(&obuf); - ostr << "err\n"; - ostr.flush(); - } else if (comterp_->quitflag()) { - return -1; - } else { - filebuf obuf(fd ? fd : 1); - ostream ostr(&obuf); - comterp_->print_stack_top(ostr); - ostr << "\n"; - ostr.flush(); - } - } - #endif - #if 1 - #if !defined(INPUT_BY_READ) return (istr.good() ? 0 : -1) && status; - #else - return status; - #endif - #else - return comterp_->_instat ? 0 : -1; - #endif } int --- 119,162 ---- // Perform the logging record receive. static const unit = 15; int ComterpHandler::handle_input (ACE_HANDLE fd) { ! #if 0 const int bufsiz = BUFSIZ*BUFSIZ; char inbuf[bufsiz]; inbuf[0] = '\0'; filebuf ibuf(fd); istream istr(&ibuf); istr.getline(inbuf, bufsiz); + #else + vector<char> inv; + char ch; + filebuf ibuf(fd); + istream istr(&ibuf); + while(istr.good() && istr.get(ch),ch!='\n') + inv.push_back(ch); + inv.push_back('\0'); + char* inbuf = &inv[0]; + #endif + if (!comterp_ || !istr.good()) return -1; ! else if (!inbuf || !*inbuf) { filebuf obuf(fd ? fd : 1); ostream ostr(&obuf); ostr << "\n"; ostr.flush(); return 0; } comterp_->load_string(inbuf); if (fd>0) cerr << "command via ACE -- " << inbuf << "\n"; comterp_->_fd = fd; comterp_->_outfunc = (outfuncptr)&ComTerpServ::fd_fputs; int status = comterp_->ComTerp::run(false /* !once */); return (istr.good() ? 0 : -1) && status; } int *** /dev/null Thu May 4 04:53:02 PDT 2000 --- patches/ivtools-000504-johnston-045 *************** patches/ivtools-000504-johnston-045 *** 0 **** --- 1 ---- + ivtools-000504-johnston-045 |
From: <ivt...@li...> - 2000-05-01 23:27:21
|
Patch: ivtools-000502-johnston-043 For: ivtools-0.8.2 Author: joh...@us... Subject: add acknowledgebox command to comdraw to popup dialog box Requires: This is an intermediate patch to ivtools-0.8.2. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - add an "acknowledgebox" command (AcknowledgeBoxFunc) to command, to allow a script to pop-up a dialog box and require the user to press ok. Index: top_ivtools/MANIFEST diff -c top_ivtools/MANIFEST:1.6 top_ivtools/MANIFEST:1.7 *** top_ivtools/MANIFEST:1.6 Fri Mar 24 23:15:14 2000 --- ./MANIFEST Tue May 2 05:25:20 2000 *************** *** 192,197 **** --- 192,199 ---- ivtools-0.8/src/ComUnidraw/comterp-acehandler.h ivtools-0.8/src/ComUnidraw/comterp-iohandler.c ivtools-0.8/src/ComUnidraw/comterp-iohandler.h + ivtools-0.8/src/ComUnidraw/dialogfunc.c + ivtools-0.8/src/ComUnidraw/dialogfunc.h ivtools-0.8/src/ComUnidraw/grdotfunc.c ivtools-0.8/src/ComUnidraw/grdotfunc.h ivtools-0.8/src/ComUnidraw/grfunc.c Index: top_ivtools/MANIFEST.perceps diff -c top_ivtools/MANIFEST.perceps:1.3 top_ivtools/MANIFEST.perceps:1.4 *** top_ivtools/MANIFEST.perceps:1.3 Fri Mar 10 23:41:28 2000 --- ./MANIFEST.perceps Tue May 2 05:25:20 2000 *************** *** 46,51 **** --- 46,52 ---- ComUnidraw/comeditor.h ComUnidraw/comterp-acehandler.h ComUnidraw/comterp-iohandler.h + ComUnidraw/dialogfunc.h ComUnidraw/grdotfunc.h ComUnidraw/grfunc.h ComUnidraw/grstatfunc.h Index: ComUnidraw/Imakefile diff -c ComUnidraw/Imakefile:1.2 ComUnidraw/Imakefile:1.3 *** ComUnidraw/Imakefile:1.2 Fri Mar 10 23:42:09 2000 --- src/ComUnidraw/Imakefile Tue May 2 05:26:00 2000 *************** *** 22,27 **** --- 22,28 ---- Obj26(grstatfunc) Obj26(comeditor) Obj26(comterp-iohandler) + Obj26(dialogfunc) Obj26(nfunc) Obj26(plotfunc) Obj26(unifunc) Index: ComUnidraw/comeditor.c diff -c ComUnidraw/comeditor.c:1.3 ComUnidraw/comeditor.c:1.4 *** ComUnidraw/comeditor.c:1.3 Tue Mar 21 12:03:02 2000 --- src/ComUnidraw/comeditor.c Tue May 2 05:26:00 2000 *************** *** 27,32 **** --- 27,33 ---- #include <ComUnidraw/grstatfunc.h> #include <ComUnidraw/comeditor.h> #include <ComUnidraw/comterp-iohandler.h> + #include <ComUnidraw/dialogfunc.h> #include <ComUnidraw/nfunc.h> #include <ComUnidraw/plotfunc.h> *************** *** 178,183 **** --- 179,186 ---- comterp->add_command("dot", new GrDotFunc(comterp)); comterp->add_command("attrlist", new GrAttrListFunc(comterp)); + + comterp->add_command("acknowledgebox", new AcknowledgeBoxFunc(comterp, this)); } /* virtual */ void ComEditor::ExecuteCmd(Command* cmd) { Index: ComUnidraw/dialogfunc.c diff -c /dev/null ComUnidraw/dialogfunc.c:1.1 *** /dev/null Tue May 2 05:26:01 2000 --- src/ComUnidraw/dialogfunc.c Tue May 2 05:26:00 2000 *************** *** 0 **** --- 1,39 ---- + /* + * Copyright (c) 2000 IET Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + + #include <ComUnidraw/dialogfunc.h> + #include <IVGlyph/gdialogs.h> + #include <InterViews/window.h> + + #define TITLE "DialogFunc" + + /*****************************************************************************/ + + AcknowledgeBoxFunc::AcknowledgeBoxFunc(ComTerp* comterp, Editor* ed) : UnidrawFunc(comterp, ed) { + } + + void AcknowledgeBoxFunc::execute() { + ComValue msgstrv(stack_arg(0)); + reset_stack(); + GAcknowledgeDialog::post(GetEditor()->GetWindow(), msgstrv.symbol_ptr()); + } Index: ComUnidraw/dialogfunc.h diff -c /dev/null ComUnidraw/dialogfunc.h:1.1 *** /dev/null Tue May 2 05:26:01 2000 --- src/ComUnidraw/dialogfunc.h Tue May 2 05:26:00 2000 *************** *** 0 **** --- 1,40 ---- + /* + * Copyright (c) 2000 IET Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + + #if !defined(_dialog_func_h) + #define _dialog_func_h + + #include <ComUnidraw/unifunc.h> + + //: command to popup an acknowledge dialog box + // acknowledgebox() -- popup an acknowledge dialog box + class AcknowledgeBoxFunc : public UnidrawFunc { + public: + AcknowledgeBoxFunc(ComTerp*,Editor*); + virtual void execute(); + virtual const char* docstring() { + return "%s(message_str) -- popup an acknowledge dialog box"; } + + }; + + #endif /* !defined(_dialog_func_h) */ *** /dev/null Tue May 2 05:26:20 PDT 2000 --- patches/ivtools-000502-johnston-043 *************** patches/ivtools-000502-johnston-043 *** 0 **** --- 1 ---- + ivtools-000502-johnston-043 |
From: <ivt...@li...> - 2000-05-01 23:26:53
|
Patch: ivtools-000501-johnston-042 For: ivtools-0.8.2 Author: joh...@us... Subject: blank the output for ComValue of BlankType Requires: This is an intermediate patch to ivtools-0.8.2. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - remove the output for a ComValue of BlankType in the related ostream operator. This puts it back to the way it has long been. The output of "<blank>" was just a temporary debugging thing. Index: ComTerp/comterp.c diff -c ComTerp/comterp.c:1.12 ComTerp/comterp.c:1.13 *** ComTerp/comterp.c:1.12 Thu Apr 27 03:43:52 2000 --- src/ComTerp/comterp.c Mon May 1 23:52:59 2000 *************** *** 624,632 **** ComValue& ComTerp::lookup_symval(int symid) { void* vptr = nil; ! if (localtable()->find(vptr, symid)) ! return *(ComValue*)vptr; ! else return ComValue::nullval(); } --- 624,633 ---- ComValue& ComTerp::lookup_symval(int symid) { void* vptr = nil; ! if (localtable()->find(vptr, symid)) { ! ComValue* valptr = (ComValue*)vptr; ! return *valptr; ! } else return ComValue::nullval(); } Index: ComTerp/comvalue.c diff -c ComTerp/comvalue.c:1.11 ComTerp/comvalue.c:1.12 *** ComTerp/comvalue.c:1.11 Sat Apr 29 02:11:48 2000 --- src/ComTerp/comvalue.c Mon May 1 23:52:59 2000 *************** *** 292,298 **** break; case ComValue::BlankType: ! cerr << "<blank>"; break; case ComValue::ObjectType: --- 292,298 ---- break; case ComValue::BlankType: ! // cerr << "<blank>"; break; case ComValue::ObjectType: *** /dev/null Mon May 1 23:53:57 PDT 2000 --- patches/ivtools-000501-johnston-042 *************** patches/ivtools-000501-johnston-042 *** 0 **** --- 1 ---- + ivtools-000501-johnston-042 |
From: <ivt...@li...> - 2000-04-28 20:29:17
|
Patch: ivtools-000429-johnston-041 For: ivtools-0.8.1 Author: joh...@us... Subject: bring up to ivtools-0.8.2 Requires: This is an intermediate patch to ivtools-0.8.1. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - upgrade to ivtools-0.8.2. If rebuilding from patches or repository, be sure to first "rm make.*" in the top-level directory. Index: top_ivtools/CHANGES diff -c top_ivtools/CHANGES:1.2 top_ivtools/CHANGES:1.3 *** top_ivtools/CHANGES:1.2 Thu Mar 9 02:16:29 2000 --- ./CHANGES Sat Apr 29 02:30:02 2000 *************** *** 1,3 **** --- 1,131 ---- + April 28th 2000 ivtools-0.8.2 + + - Add a new version of a dot (".") func to comdraw, one that accesses + the AttributeList of a graphical component. This allows for easy + set/get access to the attributes of graphics in a drawing editor. + + - Change default behavior of comdraw select func to return list of + graphics in current selection. Implement the :all feature as well. + This is a non-backward compatible change for anyone who has relied on + the undocumented way the select func has behaved up until now (which + was the same as :all behavior should have been). + + - change comterp list output (what gets printed when a list is + returned on the stack) to use "," instead of "\n" and surround the + entire list with "{" and "}". Now you can see the difference between + lists of length 1 and scalars. + + - copy/move capability for text editor with interpreter from + FrameUnidraw to OverlayUnidraw, and make use of it in comdraw. + + - add a flag to ComValue (use space from one of two type-specific + unions) to indicate the void* pointer stored in an ComValue of + ObjectType is really a ComponentView, not the class indicated by the + classid symbol associated with it. This allows derived ComFunc's to + detect whether an object pointer is really a ComponentView indirection + to some Component object. + + - fix bug in comterp telcat mode where a bad pathname segfaults. + + - extend OverlayComp::FindValue to support the "up" flag. + + - change all the derived ComFunc's that work with ComponentView's to + set the ComValue::_object_compview flag, and provide a symbol for the + classid that corresponds to the kind of component. This needs to + become a virtual method on every component, which requires adding + CLASS_SYMID to all the *comp(s).h in the OverlayUnidraw library. + + - create "attrname" command to return name of attribute name/value pair. + + - create "attrlist" command to return the AttributeList of a component. + + - fix the adjusting of relative pathnames for an OverlayFileComp when + the whole document is saved out to a different directory. + + - finish migration to use of ComValue::object_compview method. + + - add FrameScript::suppress_frame method to trim the output of "frame" + objects from a derived program, i.e. a map viewer. + + - extend the use of a symbol-table based class id to all the + components in OverlayUnidraw, GraphUnidraw, and FrameUnidraw, so that + the command interpreter can print the class name of objects returned + on the stack. Elide the "Ov" from certain class names, + i.e. "RasterComp" instead of "RasterOvComp". + + - fix the equality operator (==) of comterp to return 0 when one + argument is of unknown type (unless both are of unknown type) + + - finalize arrangement of symbol manipulating commands of comterp: + + symid return symbol id given symbol + symbol return symbol given symbol id + symval lookup value associated with symbol + symadd return symbol without value lookup + + because symbol lookup is automatic in the interpreter, you only have to use symval when passing a symbol argument by variable to a command that accepts symbols without lookup. The command will take the name of the variable for input, not its contents, so wrapping it in symval() has the desired affect. + + symadd() is how you get a symbol assigned to a variable. + + - add test for non-existent input file to run() command. + + - extend list() command to initialize new list with contents of old + list supplied as the first argument, i.e. with "l1=1,2,3; + l2=list(v),4" lists l1 and l2 are distinct, where as with + "l1=1,2,3; l2=l1,4" l1 and l2 are the same. + + - add numframes() command to flipbook interpreter, and + FrameEditor::NumFrames method. + + - fix bug in comterp ! operator that made it not work for anything but boolean. + + - show many frames at once in ivtools flipbook with a new "showframes" + command. If four frames (plus background) existed in a flipbook + editor, this would show the first and third frame (and the the + background), when entered into the interpreter: + + showframes(1,4) + + This required generalizing the "other" frame concept of FrameEditor to + be a list of other frames to see instead of a single frame. To + preserve the "current frame" concept in the editor, the list of frames + given to "showframes" is searched for the max frame to make it the + current (and foremost) frame, then internally all other "other" frames + are stored as negative offsets from this frame. It would be possible + to have a mode (a keyword flag) on "showframes" to interpret the input + list as offsets both positive and negative from the current flag + (i.e. :offsets). + + - add ComTerp::lookup_symval(int symid), to give a non-in-place way of + looking up a variable's value. + + - make the comterp nil command post-evaluated, so none of its + arguments are processed or pushed on the stack. + + - fix a problem where inner-parenthesis (or extra outer parentheses) + on an expression wouldn't work when part of the body of a + post-evaluated command (i.e. for, cond, while, etc.). + + Before this didn't work: cond(1 (1+2)*3) + + Or this: cond(1 (1)) + + This time the bug wasn't in the mechanism for post-evaluating the + byte-compiled script, as many similar bugs have been in the past. + This time the fix was to a parser tweak adopted not that long ago to + generate blank placeholders in the parser output (the postfix + expression) to preserve where free-standing parentheses existed in the + original expression. + + - and now a better fix for the inner paren problems of the comterp + parser. I finally came to understand the origin of the problem was + not the popping of matched stand-alone parens, but in the failure to + recognize when parenthesized expressions are different from + parenthesized arguments. Consider "a(b (3))" v.s. "a(2 (3))" (try + this with "comtest parser" if you want. You might think the command + "a" has two arguments in each case. But in the first case it has only + one, and the "(3)" is interpreted as arguments for the command "b". + March 9th 2000 ivtools-0.8.1 Interpreter Changes Index: top_ivtools/INSTALL diff -c top_ivtools/INSTALL:1.6 top_ivtools/INSTALL:1.7 *** top_ivtools/INSTALL:1.6 Sat Mar 18 02:04:12 2000 --- ./INSTALL Sat Apr 29 02:30:02 2000 *************** *** 1,7 **** INSTALL for ivtools-0.8 ! Instructions for building ivtools-0.8.1 from source: 0. Compilation Environment --- 1,7 ---- INSTALL for ivtools-0.8 ! Instructions for building ivtools-0.8.2 from source: 0. Compilation Environment Index: top_ivtools/README diff -c top_ivtools/README:1.3 top_ivtools/README:1.4 *** top_ivtools/README:1.3 Thu Mar 9 02:16:30 2000 --- ./README Sat Apr 29 02:30:02 2000 *************** *** 2,8 **** README for ivtools 0.8 ! This directory contains a release of ivtools 0.8.1 from Vectaport Inc.. You should read the rest of this file for information on what ivtools is and the INSTALL file for instructions on how to build it. --- 2,8 ---- README for ivtools 0.8 ! This directory contains a release of ivtools 0.8.2 from Vectaport Inc.. You should read the rest of this file for information on what ivtools is and the INSTALL file for instructions on how to build it. Index: top_ivtools/VERSION diff -c top_ivtools/VERSION:1.2 top_ivtools/VERSION:1.3 *** top_ivtools/VERSION:1.2 Thu Mar 9 02:16:30 2000 --- ./VERSION Sat Apr 29 02:30:02 2000 *************** *** 1 **** ! Release 0.8.1 --- 1 ---- ! Release 0.8.2 Index: include_std/version.h diff -c include_std/version.h:1.3 include_std/version.h:1.4 *** include_std/version.h:1.3 Fri Mar 10 23:42:23 2000 --- src/include/ivstd/version.h Sat Apr 29 02:30:33 2000 *************** *** 1,3 **** ! #define IvtoolsVersion 0.8.1 ! #define VersionString "0.8.1" ! #define ReleaseString "ivtools-0.8.1" --- 1,3 ---- ! #define IvtoolsVersion 0.8.2 ! #define VersionString "0.8.2" ! #define ReleaseString "ivtools-0.8.2" Index: config_ivtools/params.def diff -c config_ivtools/params.def:1.2 config_ivtools/params.def:1.3 *** config_ivtools/params.def:1.2 Thu Mar 9 02:17:18 2000 --- config/params.def Sat Apr 29 02:30:39 2000 *************** *** 36,42 **** * VersionNumber */ #ifndef Version ! #define Version 0.8.1 #endif VERSION = Version --- 36,42 ---- * VersionNumber */ #ifndef Version ! #define Version 0.8.2 #endif VERSION = Version *** /dev/null Sat Apr 29 02:30:43 PDT 2000 --- patches/ivtools-000429-johnston-041 *************** patches/ivtools-000429-johnston-041 *** 0 **** --- 1 ---- + ivtools-000429-johnston-041 |
From: <ivt...@li...> - 2000-04-28 20:26:37
|
Patch: ivtools-000429-johnston-040 For: ivtools-0.8.1 Author: joh...@us... Subject: better inner-paren fix Requires: This is an intermediate patch to ivtools-0.8.1. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - this is a better fix for the inner paren problems of the comterp parser. I finally came to understand the origin of the problem was not the popping of matched stand-alone parens, but in the failure to recognize when parenthesized expressions are different from parenthesized arguments. Consider "a(b (3))" v.s. "a(2 (3))" (try this with "comtest parser" if you want. You might think the command "a" has two arguments in each case. But in the first case it has only one, and the "(3)" is interpreted as arguments for the command "b". Index: ComUtil/_parser.c diff -c ComUtil/_parser.c:1.2 ComUtil/_parser.c:1.3 *** ComUtil/_parser.c:1.2 Thu Apr 27 22:50:16 2000 --- src/ComUtil/_parser.c Sat Apr 29 02:11:44 2000 *************** *** 581,587 **** int temp_id; /* Temporary variables */ int index; int status; - int blank_count = 0; /* Static initialization */ if( *linenum == 0 ) { --- 581,586 ---- *************** *** 1012,1017 **** --- 1011,1022 ---- UNEXPECTED_NEW_EXPRESSION ) { UNEXPECTED_LPAREN_ERROR( tokstart ); } + + /* End of an argument */ + if( TopOfParenStack >= 0) { + ParenStack[ TopOfParenStack ].narg++; + } + } /* If left paren was encountered without a proceeding identifier */ *************** *** 1084,1093 **** /* If this parenthesis corresponds to a command, set up the */ /* the number of embedded arguments and keywords, and output */ - if( expecting == OPTYPE_BINARY ) ParenStack[TopOfParenStack].narg++; - if( ParenStack[TopOfParenStack].comm_id >= 0 ) { if (ParenStack[TopOfParenStack].nids > 0) { int i, lp; --- 1089,1104 ---- /* If this parenthesis corresponds to a command, set up the */ /* the number of embedded arguments and keywords, and output */ if( ParenStack[TopOfParenStack].comm_id >= 0 ) { + if( expecting == OPTYPE_BINARY) { + + /* End of an argument */ + if( TopOfParenStack >= 0) { + ParenStack[ TopOfParenStack ].narg++; + } + } + if (ParenStack[TopOfParenStack].nids > 0) { int i, lp; *************** *** 1096,1109 **** for (i = 0; i < lp; i++) { - ParenStack[TopOfParenStack].narg += blank_count>0; PFOUT( TOK_COMMAND, ParenStack[TopOfParenStack].comm_id, ParenStack[TopOfParenStack].narg, ParenStack[TopOfParenStack].nkey, ParenStack[TopOfParenStack].nids ); --TopOfParenStack; - blank_count = 0; } } else --- 1107,1118 ---- *************** *** 1121,1127 **** PFOUT_LITERAL( TOK_BLANK, token ); --TopOfParenStack; ! blank_count++; } /* Set up to expect a binary */ --- 1130,1140 ---- PFOUT_LITERAL( TOK_BLANK, token ); --TopOfParenStack; ! #if 0 ! if (TopOfParenStack>=0) { ! ParenStack[TopOfParenStack].narg++; ! } ! #endif } /* Set up to expect a binary */ Index: ComTerp/comvalue.c diff -c ComTerp/comvalue.c:1.10 ComTerp/comvalue.c:1.11 *** ComTerp/comvalue.c:1.10 Fri Mar 24 23:15:20 2000 --- src/ComTerp/comvalue.c Sat Apr 29 02:11:48 2000 *************** *** 292,297 **** --- 292,298 ---- break; case ComValue::BlankType: + cerr << "<blank>"; break; case ComValue::ObjectType: *** /dev/null Sat Apr 29 02:12:35 PDT 2000 --- patches/ivtools-000429-johnston-040 *************** patches/ivtools-000429-johnston-040 *** 0 **** --- 1 ---- + ivtools-000429-johnston-040 |
From: <ivt...@li...> - 2000-04-28 20:26:32
|
Patch: ivtools-000427-johnston-039 For: ivtools-0.8.1 Author: joh...@us... Subject: fix problem with inner-parens in post-evaluated expressions Fixes: SF bugs #100905 and #104886 This is an intermediate patch to ivtools-0.8.1. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - fix a problem where inner-parenthesis (or extra outer parentheses) on an expression wouldn't work when part of the body of a post-evaluated command (i.e. for, cond, while, etc.). Before this didn't work: cond(1 (1+2)*3) Or this: cond(1 (1)) This time the bug wasn't in the mechanism for post-evaluating the byte-compiled script, as many similar bugs have been in the past. This time the fix was to a parser tweak adopted not that long ago to generate blank placeholders in the parser output (the postfix expression) to preserve where free-standing parentheses existed in the original expression. Index: ComUtil/_parser.c diff -c ComUtil/_parser.c:1.1 ComUtil/_parser.c:1.2 *** ComUtil/_parser.c:1.1 Tue Jan 18 03:06:49 2000 --- src/ComUtil/_parser.c Thu Apr 27 22:50:16 2000 *************** *** 1096,1103 **** for (i = 0; i < lp; i++) { ! ParenStack[TopOfParenStack].narg += ! blank_count>1 ? blank_count-1 : 0; PFOUT( TOK_COMMAND, ParenStack[TopOfParenStack].comm_id, ParenStack[TopOfParenStack].narg, --- 1096,1102 ---- for (i = 0; i < lp; i++) { ! ParenStack[TopOfParenStack].narg += blank_count>0; PFOUT( TOK_COMMAND, ParenStack[TopOfParenStack].comm_id, ParenStack[TopOfParenStack].narg, *** /dev/null Thu Apr 27 22:51:11 PDT 2000 --- patches/ivtools-000427-johnston-039 *************** patches/ivtools-000427-johnston-039 *** 0 **** --- 1 ---- + ivtools-000427-johnston-039 |
From: <ivt...@li...> - 2000-04-14 22:06:31
|
make that "this would show the first and fourth frame" ---------- >From: ivt...@li... >To: ivt...@li... >Subject: "show many frames at once in ivtools flipbook" >Date: Fri, Apr 14, 2000, 2:42 PM > >Patch: ivtools-000415-johnston-037 >For: ivtools-0.8.1 >Author: joh...@us... >Subject: show many frames at once in ivtools flipbook >Requires: > >This is an intermediate patch to ivtools-0.8.1. To apply, cd to the >top-level directory of the ivtools source tree (the directory with src >and config subdirs), and apply like this: > > patch -p0 <ThisFile > >Summary of Changes: > >- show many frames at once in ivtools flipbook with a new "showframes" >command. If four frames (plus background) existed in a flipbook >editor, this would show the first and third frame (and the the >background), when entered into the interpreter: > > showframes(1,4) |
From: <ivt...@li...> - 2000-04-14 21:52:13
|
Patch: ivtools-000415-johnston-037 For: ivtools-0.8.1 Author: joh...@us... Subject: show many frames at once in ivtools flipbook Requires: This is an intermediate patch to ivtools-0.8.1. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - show many frames at once in ivtools flipbook with a new "showframes" command. If four frames (plus background) existed in a flipbook editor, this would show the first and third frame (and the the background), when entered into the interpreter: showframes(1,4) This required generalizing the "other" frame concept of FrameEditor to be a list of other frames to see instead of a single frame. To preserve the "current frame" concept in the editor, the list of frames given to "showframes" is searched for the max frame to make it the current (and foremost) frame, then internally all other "other" frames are stored as negative offsets from this frame. It would be possible to have a mode (a keyword flag) on "showframes" to interpret the input list as offsets both positive and negative from the current flag (i.e. :offsets). Index: ComTerp/comfunc.c diff -c ComTerp/comfunc.c:1.2 ComTerp/comfunc.c:1.3 *** ComTerp/comfunc.c:1.2 Thu Feb 17 04:54:52 2000 --- src/ComTerp/comfunc.c Sat Apr 15 03:29:44 2000 *************** *** 302,308 **** void ComFunc::push_funcstate(int nargs, int nkeys, int pedepth, int command_symid) { ! ComFuncState cfs(nargs, nkeys, pedepth, command_symid); _comterp->push_funcstate(cfs); } --- 302,309 ---- void ComFunc::push_funcstate(int nargs, int nkeys, int pedepth, int command_symid) { ! ComFuncState cfs(nargs, nkeys, pedepth, ! command_symid==0 ? classid() : command_symid ); _comterp->push_funcstate(cfs); } Index: OverlayUnidraw/oved.c diff -c OverlayUnidraw/oved.c:1.2 OverlayUnidraw/oved.c:1.3 *** OverlayUnidraw/oved.c:1.2 Tue Mar 14 23:18:58 2000 --- src/OverlayUnidraw/oved.c Sat Apr 15 03:30:56 2000 *************** *** 104,110 **** AttributeList* OverlayEditor::_edlauncherlist = nil; AttributeList* OverlayEditor::_comterplist = nil; - OverlayEditor::OverlayEditor (OverlayComp* comp, OverlayKit* ok) : IdrawEditor(false) { _viewer = nil; ok->SetEditor(this); --- 104,109 ---- *************** *** 141,146 **** --- 140,146 ---- ok->SetEditor(this); _overlay_kit = ok; _mousedoc = new ObservableText(""); + _texteditor = nil; } OverlayEditor::~OverlayEditor() { *************** *** 148,153 **** --- 148,154 ---- } void OverlayEditor::Init (OverlayComp* comp, const char* name) { + _texteditor = nil; if (!comp) comp = new OverlayIdrawComp; _overlay_kit->Init(comp, name); } Index: FrameUnidraw/framecmds.c diff -c FrameUnidraw/framecmds.c:1.1 FrameUnidraw/framecmds.c:1.2 *** FrameUnidraw/framecmds.c:1.1 Tue Jan 18 03:11:14 2000 --- src/FrameUnidraw/framecmds.c Sat Apr 15 03:31:03 2000 *************** *** 1,5 **** /* ! * Copyright (c) 1997 Vectaport Inc. * Copyright (c) 1994, 1995 Vectaport Inc., Cider Press * * Permission to use, copy, modify, distribute, and sell this software and --- 1,5 ---- /* ! * Copyright (c) 1997-2000 Vectaport Inc. * Copyright (c) 1994, 1995 Vectaport Inc., Cider Press * * Permission to use, copy, modify, distribute, and sell this software and Index: FrameUnidraw/frameeditor.c diff -c FrameUnidraw/frameeditor.c:1.5 FrameUnidraw/frameeditor.c:1.6 *** FrameUnidraw/frameeditor.c:1.5 Thu Apr 6 23:23:52 2000 --- src/FrameUnidraw/frameeditor.c Sat Apr 15 03:31:03 2000 *************** *** 1,5 **** /* ! * Copyright (c) 1994-1998 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided --- 1,5 ---- /* ! * Copyright (c) 1994-2000 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided *************** *** 91,102 **** } FrameEditor::FrameEditor(boolean initflag, OverlayKit* ok) ! : ComEditor(initflag, ok) {} ! FrameEditor::~FrameEditor() {} void FrameEditor::Init (OverlayComp* comp, const char* name) { ! _curr_other = _prev_other = 0; _texteditor = nil; _autonewframe = false; _autonewframe_tts = nil; --- 91,112 ---- } FrameEditor::FrameEditor(boolean initflag, OverlayKit* ok) ! : ComEditor(initflag, ok) { ! _curr_others = _prev_others = nil; ! _num_curr_others = _num_prev_others = 0; ! _texteditor = nil; ! _autonewframe = false; ! _autonewframe_tts = nil; ! } ! FrameEditor::~FrameEditor() { ! delete _curr_others; ! delete _prev_others; ! } void FrameEditor::Init (OverlayComp* comp, const char* name) { ! _curr_others = _prev_others = nil; ! _num_curr_others = _num_prev_others = 0; _texteditor = nil; _autonewframe = false; _autonewframe_tts = nil; *************** *** 161,168 **** void FrameEditor::UpdateFrame(boolean txtupdate) { FrameIdrawView *views = (FrameIdrawView*)GetViewer()->GetGraphicView(); ! views->UpdateFrame(_currframe, _prevframe, _curr_other, _prev_other); ! _prev_other = _curr_other; if (GetFrame()) UpdateText((OverlayComp*)GetFrame()->GetGraphicComp(), txtupdate); Iterator last; --- 171,183 ---- void FrameEditor::UpdateFrame(boolean txtupdate) { FrameIdrawView *views = (FrameIdrawView*)GetViewer()->GetGraphicView(); ! views->UpdateFrame(_currframe, _prevframe, ! _curr_others, _num_curr_others, ! _prev_others, _num_prev_others); ! delete _prev_others; ! _num_prev_others = _num_curr_others; ! _prev_others = new int[_num_prev_others]; ! for(int i=0; i<_num_prev_others; i++) _prev_others[i]=_curr_others[i]; if (GetFrame()) UpdateText((OverlayComp*)GetFrame()->GetGraphicComp(), txtupdate); Iterator last; *************** *** 190,195 **** --- 205,211 ---- comterp->add_command("createframe", new CreateFrameFunc(comterp, this)); comterp->add_command("autoframe", new AutoNewFrameFunc(comterp, this)); comterp->add_command("numframes", new NumFramesFunc(comterp, this)); + comterp->add_command("showframes", new ShowFramesFunc(comterp, this)); } void FrameEditor::DoAutoNewFrame() { *************** *** 215,220 **** for (views->First(i); !views->Done(i); views->Next(i)) { if (views->IsA(FRAME_VIEW)) count++; } ! return count-1; } } --- 231,258 ---- for (views->First(i); !views->Done(i); views->Next(i)) { if (views->IsA(FRAME_VIEW)) count++; } ! return count; } } + + void FrameEditor::OtherFrame(int other_frame) { + delete _prev_others; + _prev_others = _curr_others; + _num_prev_others = _num_curr_others; + _curr_others = new int[1]; + _curr_others[0] = other_frame; + _num_curr_others = 1; + } + + void FrameEditor::OtherFrames(int* other_frames, int num_other_frames) { + delete _prev_others; + _prev_others = _curr_others; + _num_prev_others = _num_curr_others; + _curr_others = new int[num_other_frames]; + for (int i=0; i<num_other_frames; i++) + _curr_others[i] = other_frames[i]; + _num_curr_others = num_other_frames; + } + + + Index: FrameUnidraw/frameeditor.h diff -c FrameUnidraw/frameeditor.h:1.4 FrameUnidraw/frameeditor.h:1.5 *** FrameUnidraw/frameeditor.h:1.4 Thu Apr 6 23:23:52 2000 --- src/FrameUnidraw/frameeditor.h Sat Apr 15 03:31:03 2000 *************** *** 1,5 **** /* ! * Copyright (c) 1994-1999 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided --- 1,5 ---- /* ! * Copyright (c) 1994-2000 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided *************** *** 62,73 **** virtual OverlaysView* GetFrame(int index=-1); // return current frame. ! int OtherFrame(){ return _curr_other; } // return index of previous (or secondary) frame. ! void OtherFrame(int other_frame) ! { _prev_other = _curr_other; _curr_other = other_frame; } // set index of previous (or secondary) frame. FrameNumberState*& framenumstate() { return _framenumstate; } // return reference to pointer to current-frame-number state variable FrameListState*& frameliststate() { return _frameliststate; } --- 62,77 ---- virtual OverlaysView* GetFrame(int index=-1); // return current frame. ! int OtherFrame(){ return _curr_others ? _curr_others[0] : nil; } // return index of previous (or secondary) frame. ! void OtherFrame(int other_frame); // set index of previous (or secondary) frame. + int* OtherFrames(){ return _curr_others; } + // return index of previous (or secondary) frames. + void OtherFrames(int* other_frames, int num_others); + // set index of previous (or secondary) frames. + FrameNumberState*& framenumstate() { return _framenumstate; } // return reference to pointer to current-frame-number state variable FrameListState*& frameliststate() { return _frameliststate; } *************** *** 91,98 **** FrameView* _prevframe; FrameNumberState* _framenumstate; FrameListState* _frameliststate; ! int _curr_other; ! int _prev_other; boolean _autonewframe; TelltaleState* _autonewframe_tts; --- 95,104 ---- FrameView* _prevframe; FrameNumberState* _framenumstate; FrameListState* _frameliststate; ! int* _curr_others; ! int* _prev_others; ! int _num_curr_others; ! int _num_prev_others; boolean _autonewframe; TelltaleState* _autonewframe_tts; Index: FrameUnidraw/framefunc.c diff -c FrameUnidraw/framefunc.c:1.3 FrameUnidraw/framefunc.c:1.4 *** FrameUnidraw/framefunc.c:1.3 Thu Apr 6 23:23:52 2000 --- src/FrameUnidraw/framefunc.c Sat Apr 15 03:31:03 2000 *************** *** 1,6 **** /* * Copyright (c) 2000 IET Inc. ! * Copyright (c) 1998 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided --- 1,6 ---- /* * Copyright (c) 2000 IET Inc. ! * Copyright (c) 1998-2000 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided *************** *** 27,34 **** --- 27,38 ---- #include <FrameUnidraw/framefunc.h> #include <FrameUnidraw/frameviews.h> #include <Unidraw/iterator.h> + #include <Unidraw/unidraw.h> #include <Unidraw/viewer.h> #include <ComTerp/comvalue.h> + #include <Attribute/attrlist.h> + #include <OS/math.h> + #include <iostream.h> static int on_symid = symbol_add("on"); static int off_symid = symbol_add("off"); *************** *** 40,46 **** void MoveFrameFunc::execute() { ComValue deltav(stack_arg(0, false, ComValue::oneval())); ! static int abs_symid = symbol_find("abs"); ComValue absflag(stack_key(abs_symid)); reset_stack(); --- 44,50 ---- void MoveFrameFunc::execute() { ComValue deltav(stack_arg(0, false, ComValue::oneval())); ! static int abs_symid = symbol_add("abs"); ComValue absflag(stack_key(abs_symid)); reset_stack(); *************** *** 115,119 **** --- 119,172 ---- FrameEditor* ed = (FrameEditor*)GetEditor(); ComValue retval(ed->NumFrames()); push_stack(retval); + } + + /*****************************************************************************/ + + ShowFramesFunc::ShowFramesFunc(ComTerp* comterp, Editor* ed) : UnidrawFunc(comterp, ed) { + } + + void ShowFramesFunc::execute() { + FrameEditor* ed = (FrameEditor*)GetEditor(); + ComValue flistv(stack_arg(0)); + reset_stack(); + AttributeValueList* avl = nil; + if (flistv.is_array() && + (avl = flistv.array_val()) && + avl->Number()>1 ) { + int topframe = 0; + int num_others=0; + Iterator it; + for (avl->First(it); !avl->Done(it); avl->Next(it)) { + topframe = Math::max(topframe, avl->GetAttrVal(it)->int_val()); + } + ComValue topval(topframe, ComValue::IntType); + static int abs_symid = symbol_add("abs"); + ComValue abskey(abs_symid, 0, ComValue::KeywordType); + push_stack(topval); + push_stack(abskey); + MoveFrameFunc moveframefunc(comterp(), ed); + moveframefunc.push_funcstate(1, 1, pedepth()); + moveframefunc.execute(); + moveframefunc.pop_funcstate(); + pop_stack(); + const int otherslen=avl->Number()-1; + int others[otherslen]; + int otherscnt=0; + for (avl->First(it); !avl->Done(it); avl->Next(it)) { + int currframe = avl->GetAttrVal(it)->int_val(); + if (currframe != topframe) { + int offset = currframe-topframe; + boolean takenflag=false; + for(int i=0; !takenflag && i<otherscnt; i++) + takenflag = others[i]==offset; + if (!takenflag) + others[otherscnt++] = offset; + } + } + ed->OtherFrames(others, otherscnt); + ed->UpdateFrame(true); + } else + cerr << "showframes: need at least two frames for this command.\n"; } Index: FrameUnidraw/framefunc.h diff -c FrameUnidraw/framefunc.h:1.3 FrameUnidraw/framefunc.h:1.4 *** FrameUnidraw/framefunc.h:1.3 Thu Apr 6 23:23:52 2000 --- src/FrameUnidraw/framefunc.h Sat Apr 15 03:31:03 2000 *************** *** 1,5 **** /* ! * Copyright (c) 1998,1999 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided --- 1,5 ---- /* ! * Copyright (c) 1998-2000 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided *************** *** 64,69 **** --- 64,79 ---- virtual void execute(); virtual const char* docstring() { return "%s() -- return number of frames in viewer"; } + }; + + //: interpreter command to show a set of frames at once + // showframes(fnum[,fnum[...,fnum]]) -- show list of frames + class ShowFramesFunc : public UnidrawFunc { + public: + ShowFramesFunc(ComTerp*,Editor*); + virtual void execute(); + virtual const char* docstring() { + return "%s(fnum[,fnum[...,fnum]]) -- show list of frames"; } }; #endif /* !defined(_framefunc_h) */ Index: FrameUnidraw/frameviews.c diff -c FrameUnidraw/frameviews.c:1.1 FrameUnidraw/frameviews.c:1.2 *** FrameUnidraw/frameviews.c:1.1 Tue Jan 18 03:11:18 2000 --- src/FrameUnidraw/frameviews.c Sat Apr 15 03:31:03 2000 *************** *** 61,67 **** } void FramesView::UpdateFrame(FrameView* curr, FrameView* prev, ! int curr_other, int prev_other) { Iterator i; First(i); FrameView* background = (FrameView*)GetView(i); --- 61,68 ---- } void FramesView::UpdateFrame(FrameView* curr, FrameView* prev, ! int* curr_others, int num_curr_others, ! int* prev_others, int num_prev_others) { Iterator i; First(i); FrameView* background = (FrameView*)GetView(i); *************** *** 70,86 **** if (prev) { if (prev != background) prev->Hide(); prev->Desensitize(); ! if (prev_other) { ! SetView(prev, i); ! if (prev_other>0) ! for (int ii=0; ii<prev_other; ii++) Next(i); ! else ! for (int ii=0; ii>prev_other; ii--) Prev(i); ! if (!Done(i)) { ! FrameView* frame = (FrameView*)GetView(i); ! if (frame != background) { ! frame->Hide(); ! frame->Sensitize(); } } } --- 71,89 ---- if (prev) { if (prev != background) prev->Hide(); prev->Desensitize(); ! if (prev_others) { ! for (int np=0; np<num_prev_others; np++) { ! SetView(prev, i); ! if (prev_others[np]>0) ! for (int ii=0; ii<prev_others[np]; ii++) Next(i); ! else ! for (int ii=0; ii>prev_others[np]; ii--) Prev(i); ! if (!Done(i)) { ! FrameView* frame = (FrameView*)GetView(i); ! if (frame != background) { ! frame->Hide(); ! frame->Sensitize(); ! } } } } *************** *** 88,104 **** if (curr) { if (curr != background) curr->Show(); curr->Sensitize(); ! if (curr_other) { ! SetView(curr, i); ! if (curr_other>0) ! for (int ii=0; ii<curr_other; ii++) Next(i); ! else ! for (int ii=0; ii>curr_other; ii--) Prev(i); ! if (!Done(i)) { ! FrameView* frame = (FrameView*)GetView(i); ! if (frame != background) { ! frame->Show(); ! frame->Desensitize(); } } } --- 91,109 ---- if (curr) { if (curr != background) curr->Show(); curr->Sensitize(); ! if (curr_others) { ! for (int np=0; np<num_curr_others; np++) { ! SetView(curr, i); ! if (curr_others[np]>0) ! for (int ii=0; ii<curr_others[np]; ii++) Next(i); ! else ! for (int ii=0; ii>curr_others[np]; ii--) Prev(i); ! if (!Done(i)) { ! FrameView* frame = (FrameView*)GetView(i); ! if (frame != background) { ! frame->Show(); ! frame->Desensitize(); ! } } } } Index: FrameUnidraw/frameviews.h diff -c FrameUnidraw/frameviews.h:1.1 FrameUnidraw/frameviews.h:1.2 *** FrameUnidraw/frameviews.h:1.1 Tue Jan 18 03:11:18 2000 --- src/FrameUnidraw/frameviews.h Sat Apr 15 03:31:03 2000 *************** *** 60,66 **** virtual boolean IsA(ClassId); void UpdateFrame(FrameView* curr, FrameView* prev, ! int curr_other = 0, int prev_other=0); }; //: graphical view of FrameIdrawComp. --- 60,67 ---- virtual boolean IsA(ClassId); void UpdateFrame(FrameView* curr, FrameView* prev, ! int* curr_others, int num_curr_others, ! int* prev_others, int num_prev_others); }; //: graphical view of FrameIdrawComp. *** /dev/null Sat Apr 15 03:31:27 PDT 2000 --- patches/ivtools-000415-johnston-036 *************** patches/ivtools-000415-johnston-036 *** 0 **** --- 1 ---- + ivtools-000415-johnston-036 |
From: <ivt...@li...> - 2000-04-14 21:50:40
|
Patch: ivtools-000410-johnston-036 For: ivtools-0.8.1 Author: joh...@us... Subject: fix bug in comterp ! operator that made it not work for anything but boolean Requires: This is an intermediate patch to ivtools-0.8.1. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - fix bug in comterp ! operator that made it not work for anything but boolean. Index: ComTerp/boolfunc.c diff -c ComTerp/boolfunc.c:1.2 ComTerp/boolfunc.c:1.3 *** ComTerp/boolfunc.c:1.2 Thu Apr 6 23:23:12 2000 --- src/ComTerp/boolfunc.c Mon Apr 10 22:27:50 2000 *************** *** 134,140 **** ComValue& operand1 = stack_arg(0); ComValue result(operand1); result.type(ComValue::BooleanType); ! switch (result.type()) { case ComValue::CharType: result.char_ref() = ! operand1.char_val(); break; --- 134,140 ---- ComValue& operand1 = stack_arg(0); ComValue result(operand1); result.type(ComValue::BooleanType); ! switch (operand1.type()) { case ComValue::CharType: result.char_ref() = ! operand1.char_val(); break; *************** *** 167,172 **** --- 167,183 ---- break; case ComValue::BooleanType: result.boolean_ref() = ! operand1.boolean_val(); + break; + case ComValue::UnknownType: + result.boolean_ref() = true; + break; + case ComValue::ArrayType: + case ComValue::ObjectType: + result.boolean_ref() = false; + break; + case ComValue::SymbolType: + case ComValue::StringType: + result.boolean_ref() = operand1.symbol_val()<0; break; } reset_stack(); *** /dev/null Mon Apr 10 22:28:41 PDT 2000 --- patches/ivtools-000410-johnston-036 *************** patches/ivtools-000410-johnston-036 *** 0 **** --- 1 ---- + ivtools-000410-johnston-036 |
From: <ivt...@li...> - 2000-04-06 23:33:48
|
Patch: ivtools-000406-johnston-035 For: ivtools-0.8.1 Author: joh...@us... Subject: Requires: This is an intermediate patch to ivtools-0.8.1. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - fix the equality operator (==) of comterp to return 0 when one argument is of unknown type (unless both are of unknown type) - finalize arrangement of symbol manipulating commands of comterp: symid return symbol id given symbol symbol return symbol given symbol id symval lookup value associated with symbol symadd return symbol without value lookup because symbol lookup is automatic in the interpreter, you only have to use symval when passing a symbol argument by variable to a command that accepts symbols without lookup. The command will take the name of the variable for input, not its contents, so wrapping it in symval() has the desired affect. symadd() is how you get a symbol assigned to a variable. - add test for non-existent input file to run() command. - extend list() command to initialize new list with contents of old list supplied as the first argument, i.e. with "l1=1,2,3; l2=list(v),4" lists l1 and l2 are distinct, where as with "l1=1,2,3; l2=l1,4" l1 and l2 are the same. - add numframes() command to flipbook interpreter, and FrameEditor::NumFrames method. Index: ComTerp/boolfunc.c diff -c ComTerp/boolfunc.c:1.1 ComTerp/boolfunc.c:1.2 *** ComTerp/boolfunc.c:1.1 Tue Jan 18 03:07:03 2000 --- src/ComTerp/boolfunc.c Thu Apr 6 23:23:12 2000 *************** *** 183,229 **** ComValue result(operand1); result.type(ComValue::BooleanType); ! switch (operand1.type()) { ! case ComValue::CharType: result.boolean_ref() = operand1.char_val() == operand2.char_val(); break; ! case ComValue::UCharType: result.boolean_ref() = operand1.uchar_val() == operand2.uchar_val(); break; ! case ComValue::ShortType: result.boolean_ref() = operand1.short_val() == operand2.short_val(); break; ! case ComValue::UShortType: result.boolean_ref() = operand1.ushort_val() == operand2.ushort_val(); break; ! case ComValue::IntType: result.boolean_ref() = operand1.int_val() == operand2.int_val(); break; ! case ComValue::UIntType: result.boolean_ref() = operand1.uint_val() == operand2.uint_val(); break; ! case ComValue::LongType: result.boolean_ref() = operand1.long_val() == operand2.long_val(); break; ! case ComValue::ULongType: result.boolean_ref() = operand1.ulong_val() == operand2.ulong_val(); break; ! case ComValue::FloatType: result.boolean_ref() = operand1.float_val() == operand2.float_val(); break; ! case ComValue::DoubleType: result.boolean_ref() = operand1.double_val() == operand2.double_val(); break; ! case ComValue::StringType: result.boolean_ref() = operand1.string_val() == operand2.string_val(); break; ! case ComValue::SymbolType: result.boolean_ref() = operand1.symbol_val() == operand2.symbol_val(); break; ! default: result.boolean_ref() = operand1.is_type(ComValue::UnknownType) && ! operand2.is_type(ComValue::UnknownType); break; } reset_stack(); push_stack(result); --- 183,234 ---- ComValue result(operand1); result.type(ComValue::BooleanType); ! if (operand2.type()==ComValue::UnknownType && operand1.type()!=ComValue::UnknownType) ! result.boolean_ref() = 0; ! ! else { ! switch (operand1.type()) { ! case ComValue::CharType: result.boolean_ref() = operand1.char_val() == operand2.char_val(); break; ! case ComValue::UCharType: result.boolean_ref() = operand1.uchar_val() == operand2.uchar_val(); break; ! case ComValue::ShortType: result.boolean_ref() = operand1.short_val() == operand2.short_val(); break; ! case ComValue::UShortType: result.boolean_ref() = operand1.ushort_val() == operand2.ushort_val(); break; ! case ComValue::IntType: result.boolean_ref() = operand1.int_val() == operand2.int_val(); break; ! case ComValue::UIntType: result.boolean_ref() = operand1.uint_val() == operand2.uint_val(); break; ! case ComValue::LongType: result.boolean_ref() = operand1.long_val() == operand2.long_val(); break; ! case ComValue::ULongType: result.boolean_ref() = operand1.ulong_val() == operand2.ulong_val(); break; ! case ComValue::FloatType: result.boolean_ref() = operand1.float_val() == operand2.float_val(); break; ! case ComValue::DoubleType: result.boolean_ref() = operand1.double_val() == operand2.double_val(); break; ! case ComValue::StringType: result.boolean_ref() = operand1.string_val() == operand2.string_val(); break; ! case ComValue::SymbolType: result.boolean_ref() = operand1.symbol_val() == operand2.symbol_val(); break; ! default: result.boolean_ref() = operand1.is_type(ComValue::UnknownType) && ! operand2.is_type(ComValue::UnknownType); break; + } } reset_stack(); push_stack(result); Index: ComTerp/comterp.c diff -c ComTerp/comterp.c:1.10 ComTerp/comterp.c:1.11 *** ComTerp/comterp.c:1.10 Tue Mar 21 12:02:21 2000 --- src/ComTerp/comterp.c Thu Apr 6 23:23:12 2000 *************** *** 820,827 **** add_command("help", new HelpFunc(this)); add_command("symid", new SymIdFunc(this)); add_command("symval", new SymValFunc(this)); ! add_command("symbol", new SymbolFunc(this), "symval"); ! add_command("symvar", new SymVarFunc(this)); add_command("postfix", new PostFixFunc(this)); add_command("posteval", new PostEvalFunc(this)); --- 820,827 ---- add_command("help", new HelpFunc(this)); add_command("symid", new SymIdFunc(this)); add_command("symval", new SymValFunc(this)); ! add_command("symbol", new SymbolFunc(this)); ! add_command("symadd", new SymAddFunc(this)); add_command("postfix", new PostFixFunc(this)); add_command("posteval", new PostEvalFunc(this)); *************** *** 864,874 **** FILE* fptr = fopen(filename, "r"); _inptr = fptr; _outfunc = nil; ComValue* retval = nil; int status = 0; ! while( !feof(fptr)) { if (read_expr()) { if (eval_expr(true)) { err_print( stderr, "comterp" ); --- 864,875 ---- FILE* fptr = fopen(filename, "r"); _inptr = fptr; _outfunc = nil; + if (!fptr) cerr << "unable to run from file " << filename << "\n"; ComValue* retval = nil; int status = 0; ! while( fptr && !feof(fptr)) { if (read_expr()) { if (eval_expr(true)) { err_print( stderr, "comterp" ); Index: ComTerp/listfunc.c diff -c ComTerp/listfunc.c:1.2 ComTerp/listfunc.c:1.3 *** ComTerp/listfunc.c:1.2 Mon Feb 21 20:48:41 2000 --- src/ComTerp/listfunc.c Thu Apr 6 23:23:12 2000 *************** *** 38,46 **** } void ListFunc::execute() { reset_stack(); ! AttributeValueList* avl = new AttributeValueList(); Resource::ref(avl); ComValue retval(avl); push_stack(retval); --- 38,49 ---- } void ListFunc::execute() { + ComValue listv(stack_arg(0)); reset_stack(); ! AttributeValueList* avl = listv.is_array() ! ? new AttributeValueList(listv.array_val()) ! : new AttributeValueList(); Resource::ref(avl); ComValue retval(avl); push_stack(retval); Index: ComTerp/listfunc.h diff -c ComTerp/listfunc.h:1.2 ComTerp/listfunc.h:1.3 *** ComTerp/listfunc.h:1.2 Mon Feb 21 20:48:41 2000 --- src/ComTerp/listfunc.h Thu Apr 6 23:23:12 2000 *************** *** 35,48 **** class ComValue; //: create list command for ComTerp. ! // lst=list() -- create an empty list. class ListFunc : public ComFunc { public: ListFunc(ComTerp*); virtual void execute(); virtual const char* docstring() { ! return "lst=%s() -- create an empty list"; } }; //: list member command for ComTerp. --- 35,48 ---- class ComValue; //: create list command for ComTerp. ! // lst=list([olst]) -- create an empty list or copy existing one. class ListFunc : public ComFunc { public: ListFunc(ComTerp*); virtual void execute(); virtual const char* docstring() { ! return "lst=%s([olst]) -- create an empty list or copy existing one"; } }; //: list member command for ComTerp. Index: ComTerp/symbolfunc.c diff -c ComTerp/symbolfunc.c:1.3 ComTerp/symbolfunc.c:1.4 *** ComTerp/symbolfunc.c:1.3 Wed Feb 23 04:27:32 2000 --- src/ComTerp/symbolfunc.c Thu Apr 6 23:23:12 2000 *************** *** 72,81 **** /*****************************************************************************/ ! SymValFunc::SymValFunc(ComTerp* comterp) : ComFunc(comterp) { } ! void SymValFunc::execute() { // return each symbol in the arguments as is boolean noargs = !nargs() && !nkeys(); int numargs = nargs(); --- 72,81 ---- /*****************************************************************************/ ! SymAddFunc::SymAddFunc(ComTerp* comterp) : ComFunc(comterp) { } ! void SymAddFunc::execute() { // return each symbol in the arguments as is boolean noargs = !nargs() && !nkeys(); int numargs = nargs(); *************** *** 143,152 **** /*****************************************************************************/ ! SymVarFunc::SymVarFunc(ComTerp* comterp) : ComFunc(comterp) { } ! void SymVarFunc::execute() { // return value for each symbol variable boolean noargs = !nargs() && !nkeys(); int numargs = nargs(); --- 143,152 ---- /*****************************************************************************/ ! SymValFunc::SymValFunc(ComTerp* comterp) : ComFunc(comterp) { } ! void SymValFunc::execute() { // return value for each symbol variable boolean noargs = !nargs() && !nkeys(); int numargs = nargs(); *************** *** 156,161 **** --- 156,162 ---- // return fully-evaluated value: expression --> symbol --> value varvalues[i] = &stack_arg(i, false); + // lookup_symval(*varvalues[i]); } if (numargs>1) { *************** *** 167,172 **** --- 168,174 ---- push_stack(retval); } else { ComValue retval (*varvalues[0]); + reset_stack(); push_stack(retval); } } Index: ComTerp/symbolfunc.h diff -c ComTerp/symbolfunc.h:1.2 ComTerp/symbolfunc.h:1.3 *** ComTerp/symbolfunc.h:1.2 Wed Feb 23 04:27:32 2000 --- src/ComTerp/symbolfunc.h Thu Apr 6 23:23:12 2000 *************** *** 44,60 **** return "%s(symbol [symbol...]) -- return id(s) associated with symbol(s)"; } }; - //: symbol value command for ComTerp. - // symval(symbol [symbol...]) -- preserve symbol(s) and return without lookup - class SymValFunc : public ComFunc { - public: - SymValFunc(ComTerp*); - virtual void execute(); - - virtual boolean post_eval() { return true; } - virtual const char* docstring() { - return "%s(symbol [symbol...]) -- preserve symbol(s) and return without lookup"; } - }; //: symbol command for ComTerp. // symbol(symid [symid ...]) -- return symbol(s) associated with integer id(s) --- 44,49 ---- *************** *** 67,81 **** return "%s(symid [symid...]) -- return symbol(s) associated with integer id(s)"; } }; ! //: symbol variable command for ComTerp. ! // symvar(symbol_var [symbol_var ...]) -- return value(s) associated with symbol variable(s) ! class SymVarFunc : public ComFunc { public: ! SymVarFunc(ComTerp*); virtual void execute(); virtual const char* docstring() { return "%s(symbol_var [symbol_var...]) -- return value(s) associated with symbol variables(s)"; } }; #endif /* !defined(_symbolfunc_h) */ --- 56,81 ---- return "%s(symid [symid...]) -- return symbol(s) associated with integer id(s)"; } }; ! //: lookup symbol value command for ComTerp. ! // symval(symbol_var [symbol_var ...]) -- return value(s) associated with symbol variable(s) ! class SymValFunc : public ComFunc { public: ! SymValFunc(ComTerp*); virtual void execute(); virtual const char* docstring() { return "%s(symbol_var [symbol_var...]) -- return value(s) associated with symbol variables(s)"; } }; + #//: create symbol command for ComTerp. + // symadd(symbol [symbol...]) -- create symbol(s) and return without lookup + class SymAddFunc : public ComFunc { + public: + SymAddFunc(ComTerp*); + virtual void execute(); + + virtual boolean post_eval() { return true; } + virtual const char* docstring() { + return "%s(symbol [symbol...]) -- create symbol(s) and return without lookup"; } + }; #endif /* !defined(_symbolfunc_h) */ Index: comterp/README diff -c comterp/README:1.4 comterp/README:1.5 *** comterp/README:1.4 Tue Mar 21 12:02:25 2000 --- src/comterp_/README Thu Apr 6 23:23:15 2000 *************** *** 153,159 **** LIST COMMANDS: ! lst=list() -- create an empty list val=at(list n) -- return nth item in a list --- 153,159 ---- LIST COMMANDS: ! lst=list([olst]) -- create an empty list or copy existing one val=at(list n) -- return nth item in a list *************** *** 180,190 **** symid(symbol [symbol...]) -- return integer id(s) associated with symbol(s) - symval(symbol [symbol...]) -- return symbols as is without lookup - symbol(symid [symid...]) -- return symbol(s) associated with integer id(s) ! symvar(symbol_var [symbol_var...]) -- return value(s) associated with symbol variable(s) postfix(arg1 [arg2 [arg3 ... [argn]]]) -- echo unevaluated postfix arguments (with [narg|nkey] after defined commands, {narg|nkey} after undefined commands, --- 180,190 ---- symid(symbol [symbol...]) -- return integer id(s) associated with symbol(s) symbol(symid [symid...]) -- return symbol(s) associated with integer id(s) + + symval(symbol [symbol...]) -- return value(s) associated with symbol variables(s) ! symadd(symbol [symbol ...]) -- create symbol(s) and return without lookup. postfix(arg1 [arg2 [arg3 ... [argn]]]) -- echo unevaluated postfix arguments (with [narg|nkey] after defined commands, {narg|nkey} after undefined commands, Index: OverlayUnidraw/ovcomps.c diff -c OverlayUnidraw/ovcomps.c:1.3 OverlayUnidraw/ovcomps.c:1.4 *** OverlayUnidraw/ovcomps.c:1.3 Fri Mar 24 23:15:47 2000 --- src/OverlayUnidraw/ovcomps.c Thu Apr 6 23:23:45 2000 *************** *** 923,930 **** if (g != nil) { Iterator j; parent = GetGraphic(); ! parent->SetGraphic(GetComp(i)->GetGraphic(), j); ! parent->InsertAfter(j, g); } SetParent(comp, this); } --- 923,933 ---- if (g != nil) { Iterator j; parent = GetGraphic(); ! GraphicComp* comp = GetComp(i); ! if (comp) { ! parent->SetGraphic(comp->GetGraphic(), j); ! parent->InsertAfter(j, g); ! } } SetParent(comp, this); } Index: ComUnidraw/grdotfunc.c diff -c ComUnidraw/grdotfunc.c:1.2 ComUnidraw/grdotfunc.c:1.3 *** ComUnidraw/grdotfunc.c:1.2 Tue Mar 21 12:03:02 2000 --- src/ComUnidraw/grdotfunc.c Thu Apr 6 23:23:48 2000 *************** *** 49,62 **** return; } if (!after_part.is_symbol()) { ! cerr << "expression after \".\" needs to be a symbol or evaluate to a syymbol\n"; return; } /* handle ComponentView case */ if (before_part.is_symbol()) lookup_symval(before_part); ! if (before_part.object_compview()) { ComponentView* compview = (ComponentView*)before_part.obj_val(); OverlayComp* comp = (OverlayComp*)compview->GetSubject(); ComValue stuffval(AttributeList::class_symid(), (void*)comp->GetAttributeList()); --- 49,63 ---- return; } if (!after_part.is_symbol()) { ! cerr << "expression after \".\" needs to be a symbol or evaluate to a symbol\n"; ! reset_stack(); return; } /* handle ComponentView case */ if (before_part.is_symbol()) lookup_symval(before_part); ! if (before_part.is_object() && before_part.object_compview()) { ComponentView* compview = (ComponentView*)before_part.obj_val(); OverlayComp* comp = (OverlayComp*)compview->GetSubject(); ComValue stuffval(AttributeList::class_symid(), (void*)comp->GetAttributeList()); Index: FrameUnidraw/frameeditor.c diff -c FrameUnidraw/frameeditor.c:1.4 FrameUnidraw/frameeditor.c:1.5 *** FrameUnidraw/frameeditor.c:1.4 Tue Mar 14 23:19:02 2000 --- src/FrameUnidraw/frameeditor.c Thu Apr 6 23:23:52 2000 *************** *** 173,179 **** OverlaysView* FrameEditor::GetFrame(int index) { if (index<0) return _currframe; ! else if (index<_frameliststate->framenumber()) { FrameIdrawView* views = (FrameIdrawView*)GetViewer()->GetGraphicView(); Iterator i; int count = 0; --- 173,179 ---- OverlaysView* FrameEditor::GetFrame(int index) { if (index<0) return _currframe; ! else if (_frameliststate && index<_frameliststate->framenumber()) { FrameIdrawView* views = (FrameIdrawView*)GetViewer()->GetGraphicView(); Iterator i; int count = 0; *************** *** 189,194 **** --- 189,195 ---- comterp->add_command("moveframe", new MoveFrameFunc(comterp, this)); comterp->add_command("createframe", new CreateFrameFunc(comterp, this)); comterp->add_command("autoframe", new AutoNewFrameFunc(comterp, this)); + comterp->add_command("numframes", new NumFramesFunc(comterp, this)); } void FrameEditor::DoAutoNewFrame() { *************** *** 202,205 **** --- 203,220 ---- void FrameEditor::ToggleAutoNewFrame() { _autonewframe = !_autonewframe; if (_autonewframe_tts) _autonewframe_tts->set(TelltaleState::is_chosen, _autonewframe); + } + + int FrameEditor::NumFrames() { + if (_frameliststate) + return _frameliststate->framenumber(); + else { + FrameIdrawView* views = (FrameIdrawView*)GetViewer()->GetGraphicView(); + Iterator i; + int count = 0; + for (views->First(i); !views->Done(i); views->Next(i)) { + if (views->IsA(FRAME_VIEW)) count++; + } + return count-1; + } } Index: FrameUnidraw/frameeditor.h diff -c FrameUnidraw/frameeditor.h:1.3 FrameUnidraw/frameeditor.h:1.4 *** FrameUnidraw/frameeditor.h:1.3 Tue Mar 14 23:19:03 2000 --- src/FrameUnidraw/frameeditor.h Thu Apr 6 23:23:52 2000 *************** *** 83,88 **** --- 83,91 ---- // virtual method which does the work of creating a new frame // if flag is set. + int NumFrames(); + // number of frames not counting background frame + protected: FrameView* _currframe; FrameView* _prevframe; Index: FrameUnidraw/framefunc.c diff -c FrameUnidraw/framefunc.c:1.2 FrameUnidraw/framefunc.c:1.3 *** FrameUnidraw/framefunc.c:1.2 Wed Feb 23 04:27:54 2000 --- src/FrameUnidraw/framefunc.c Thu Apr 6 23:23:52 2000 *************** *** 105,107 **** --- 105,119 ---- } } + /*****************************************************************************/ + + NumFramesFunc::NumFramesFunc(ComTerp* comterp, Editor* ed) : UnidrawFunc(comterp, ed) { + } + + void NumFramesFunc::execute() { + reset_stack(); + FrameEditor* ed = (FrameEditor*)GetEditor(); + ComValue retval(ed->NumFrames()); + push_stack(retval); + } + Index: FrameUnidraw/framefunc.h diff -c FrameUnidraw/framefunc.h:1.2 FrameUnidraw/framefunc.h:1.3 *** FrameUnidraw/framefunc.h:1.2 Wed Feb 23 04:27:54 2000 --- src/FrameUnidraw/framefunc.h Thu Apr 6 23:23:52 2000 *************** *** 56,59 **** --- 56,69 ---- return "%s(:on :off) -- command to toggle autonewframe"; } }; + //: interpreter command to return number of frames in viewer + // numframes() -- return number of frames in viewer + class NumFramesFunc : public UnidrawFunc { + public: + NumFramesFunc(ComTerp*,Editor*); + virtual void execute(); + virtual const char* docstring() { + return "%s() -- return number of frames in viewer"; } + }; + #endif /* !defined(_framefunc_h) */ Index: man1_ivtools/comterp.1 diff -c man1_ivtools/comterp.1:1.4 man1_ivtools/comterp.1:1.5 *** man1_ivtools/comterp.1:1.4 Tue Mar 21 12:03:44 2000 --- src/man/man1/comterp.1 Thu Apr 6 23:24:09 2000 *************** *** 163,169 **** .SH LIST COMMANDS: ! lst=list() -- create an empty list val=at(list n) -- return nth item in a list --- 163,169 ---- .SH LIST COMMANDS: ! lst=list([olst]) -- create an empty list or copy existing one val=at(list n) -- return nth item in a list *************** *** 188,198 **** symid(symbol [symbol...]) -- return integer id(s) associated with symbol(s) - symval(symbol [symbol...]) -- return symbols as is without lookup - symbol(symid [symid...]) -- return symbol(s) associated with integer id(s) ! symvar(symbol_var [symbol_var...]) -- return value(s) associated with symbol variable(s) postfix(arg1 [arg2 [arg3 ... [argn]]]) -- echo unevaluated postfix arguments (with [narg|nkey] after defined commands, {narg|nkey} after undefined commands, (narg) after keys, and a * following post-evaluation commands) --- 188,198 ---- symid(symbol [symbol...]) -- return integer id(s) associated with symbol(s) symbol(symid [symid...]) -- return symbol(s) associated with integer id(s) + + symval(symbol [symbol...]) -- return value(s) associated with symbol variables(s) ! symadd(symbol [symbol ...]) -- create symbol(s) and return without lookup. postfix(arg1 [arg2 [arg3 ... [argn]]]) -- echo unevaluated postfix arguments (with [narg|nkey] after defined commands, {narg|nkey} after undefined commands, (narg) after keys, and a * following post-evaluation commands) *** /dev/null Thu Apr 6 23:24:14 PDT 2000 --- patches/ivtools-000406-johnston-035 *************** patches/ivtools-000406-johnston-035 *** 0 **** --- 1 ---- + ivtools-000406-johnston-035 |
From: <ivt...@li...> - 2000-03-24 20:21:58
|
Patch: ivtools-000324-johnston-034 For: ivtools-0.8.1 Author: joh...@us... Subject: extend use of symbol-table class id to more components Requires: This is an intermediate patch to ivtools-0.8.1. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - extend the use of a symbol-table based class id to all the components in OverlayUnidraw, GraphUnidraw, and FrameUnidraw, so that the command interpreter can print the class name of objects returned on the stack. Elide the "Ov" from certain class names, i.e. "RasterComp" instead of "RasterOvComp". Index: top_ivtools/MANIFEST diff -c top_ivtools/MANIFEST:1.5 top_ivtools/MANIFEST:1.6 *** top_ivtools/MANIFEST:1.5 Fri Mar 10 23:41:28 2000 --- ./MANIFEST Fri Mar 24 23:15:14 2000 *************** *** 115,120 **** --- 115,121 ---- ivtools-0.8/src/Attribute/attrlist.h ivtools-0.8/src/Attribute/attrvalue.c ivtools-0.8/src/Attribute/attrvalue.h + ivtools-0.8/src/Attribute/classid.h ivtools-0.8/src/Attribute/commodule.c ivtools-0.8/src/Attribute/commodule.h ivtools-0.8/src/Attribute/lexscan.c Index: Attribute/_comutil.h diff -c Attribute/_comutil.h:1.4 Attribute/_comutil.h:1.5 *** Attribute/_comutil.h:1.4 Sat Feb 19 00:59:03 2000 --- src/Attribute/_comutil.h Fri Mar 24 23:15:18 2000 *************** *** 10,18 **** // unique id for a given type of component. #define CLASS_SYMID(name) \ public: \ - virtual int classid() { return _symid; }\ static const char* class_name() {return name;}\ static int class_symid()\ { if (_symid<0) _symid=symbol_add((char*)class_name()); return _symid;} \ protected: \ static int _symid; --- 10,19 ---- // unique id for a given type of component. #define CLASS_SYMID(name) \ public: \ static const char* class_name() {return name;}\ static int class_symid()\ + { if (_symid<0) _symid=symbol_add((char*)class_name()); return _symid;} \ + virtual int classid()\ { if (_symid<0) _symid=symbol_add((char*)class_name()); return _symid;} \ protected: \ static int _symid; Index: Attribute/attribute.h diff -c Attribute/attribute.h:1.3 Attribute/attribute.h:1.4 *** Attribute/attribute.h:1.3 Tue Feb 15 04:56:25 2000 --- src/Attribute/attribute.h Fri Mar 24 23:15:18 2000 *************** *** 24,37 **** #ifndef _attribute_h #define _attribute_h ! #include <Attribute/_comutil.h> ! ! extern "C" { ! int symbol_add(char*); ! int symbol_del(int); ! int symbol_find(char*); ! char* symbol_pntr(int); ! } class AttributeValue; class AttributeList; --- 24,30 ---- #ifndef _attribute_h #define _attribute_h ! #include <Attribute/classid.h> class AttributeValue; class AttributeList; Index: Attribute/attrlist.h diff -c Attribute/attrlist.h:1.4 Attribute/attrlist.h:1.5 *** Attribute/attrlist.h:1.4 Thu Feb 17 04:54:50 2000 --- src/Attribute/attrlist.h Fri Mar 24 23:15:18 2000 *************** *** 30,36 **** #include <OS/enter-scope.h> #include <InterViews/resource.h> ! #include <Attribute/_comutil.h> #ifndef ALITERATOR #define ALIterator _lib_iv(Iterator) --- 30,36 ---- #include <OS/enter-scope.h> #include <InterViews/resource.h> ! #include <Attribute/classid.h> #ifndef ALITERATOR #define ALIterator _lib_iv(Iterator) Index: Attribute/attrvalue.h diff -c Attribute/attrvalue.h:1.8 Attribute/attrvalue.h:1.9 *** Attribute/attrvalue.h:1.8 Sat Mar 18 02:04:14 2000 --- src/Attribute/attrvalue.h Fri Mar 24 23:15:18 2000 *************** *** 27,33 **** #include <stdlib.h> #include <OS/enter-scope.h> ! #include <Attribute/_comutil.h> extern "C" { int symbol_add(char*); --- 27,33 ---- #include <stdlib.h> #include <OS/enter-scope.h> ! #include <Attribute/classid.h> extern "C" { int symbol_add(char*); Index: Attribute/classid.h diff -c /dev/null Attribute/classid.h:1.1 *** /dev/null Fri Mar 24 23:15:19 2000 --- src/Attribute/classid.h Fri Mar 24 23:15:18 2000 *************** *** 0 **** --- 1,4 ---- + #ifndef _classid_h + #define _classid_h + #include <Attribute/_comutil.h> + #endif /* !defined(_classid_h) */ Index: ComTerp/comfunc.h diff -c ComTerp/comfunc.h:1.2 ComTerp/comfunc.h:1.3 *** ComTerp/comfunc.h:1.2 Tue Feb 15 04:56:30 2000 --- src/ComTerp/comfunc.h Fri Mar 24 23:15:20 2000 *************** *** 33,39 **** #include <stdlib.h> #include <OS/types.h> #include <ComTerp/comvalue.h> ! #include <Attribute/_comutil.h> class AttributeList; class ComFuncState; --- 33,39 ---- #include <stdlib.h> #include <OS/types.h> #include <ComTerp/comvalue.h> ! #include <Attribute/classid.h> class AttributeList; class ComFuncState; Index: ComTerp/comvalue.c diff -c ComTerp/comvalue.c:1.9 ComTerp/comvalue.c:1.10 *** ComTerp/comvalue.c:1.9 Sat Mar 18 02:04:16 2000 --- src/ComTerp/comvalue.c Fri Mar 24 23:15:20 2000 *************** *** 298,304 **** if (svp->class_symid() == Attribute::class_symid()) out << *((Attribute*)svp->obj_val())->Value(); else ! out << "<" << symbol_pntr(svp->class_symid()) << ">"; break; case ComValue::UnknownType: --- 298,304 ---- if (svp->class_symid() == Attribute::class_symid()) out << *((Attribute*)svp->obj_val())->Value(); else ! out << /* "<" << */ symbol_pntr(svp->class_symid()) /* << ">" */ ; break; case ComValue::UnknownType: Index: ComTerp/dotfunc.c diff -c ComTerp/dotfunc.c:1.5 ComTerp/dotfunc.c:1.6 *** ComTerp/dotfunc.c:1.5 Fri Mar 10 23:41:35 2000 --- src/ComTerp/dotfunc.c Fri Mar 24 23:15:20 2000 *************** *** 91,97 **** reset_stack(); if (dotted_pair.class_symid() != Attribute::class_symid()) return; Attribute *attr = (Attribute*)dotted_pair.obj_val(); ! ComValue retval(attr->SymbolId(), ComValue::SymbolType); push_stack(retval); } --- 91,97 ---- reset_stack(); if (dotted_pair.class_symid() != Attribute::class_symid()) return; Attribute *attr = (Attribute*)dotted_pair.obj_val(); ! ComValue retval(attr->SymbolId(), ComValue::StringType); push_stack(retval); } Index: OverlayUnidraw/ovarrow.c diff -c OverlayUnidraw/ovarrow.c:1.1 OverlayUnidraw/ovarrow.c:1.2 *** OverlayUnidraw/ovarrow.c:1.1 Tue Jan 18 03:10:42 2000 --- src/OverlayUnidraw/ovarrow.c Fri Mar 24 23:15:47 2000 *************** *** 72,79 **** ParamList* ArrowLineOvComp::_ovarrow_line_params = nil; ParamList* ArrowMultiLineOvComp::_ovarrow_multiline_params = nil; ParamList* ArrowSplineOvComp::_ovarrow_spline_params = nil; - ArrowLineOvComp::ArrowLineOvComp (ArrowLine* graphic) : LineOvComp(graphic) { } ArrowLineOvComp::ArrowLineOvComp(istream& in, OverlayComp* parent) --- 72,79 ---- ParamList* ArrowLineOvComp::_ovarrow_line_params = nil; ParamList* ArrowMultiLineOvComp::_ovarrow_multiline_params = nil; ParamList* ArrowSplineOvComp::_ovarrow_spline_params = nil; + int ArrowLineOvComp::_symid = -1; ArrowLineOvComp::ArrowLineOvComp (ArrowLine* graphic) : LineOvComp(graphic) { } ArrowLineOvComp::ArrowLineOvComp(istream& in, OverlayComp* parent) *************** *** 418,423 **** --- 418,425 ---- /****************************************************************************/ + int ArrowMultiLineOvComp::_symid = -1; + ArrowMultiLineOvComp::ArrowMultiLineOvComp (ArrowMultiLine* g) : MultiLineOvComp(g){} ArrowMultiLineOvComp::ArrowMultiLineOvComp(istream& in, OverlayComp* parent) *************** *** 856,861 **** --- 858,865 ---- } /****************************************************************************/ + + int ArrowSplineOvComp::_symid = -1; ArrowSplineOvComp::ArrowSplineOvComp (ArrowOpenBSpline* g) : SplineOvComp(g) {} Index: OverlayUnidraw/ovarrow.h diff -c OverlayUnidraw/ovarrow.h:1.1 OverlayUnidraw/ovarrow.h:1.2 *** OverlayUnidraw/ovarrow.h:1.1 Tue Jan 18 03:10:42 2000 --- src/OverlayUnidraw/ovarrow.h Fri Mar 24 23:15:47 2000 *************** *** 61,66 **** --- 61,68 ---- static ParamList* _ovarrow_line_params; friend OverlaysScript; + + CLASS_SYMID("ArrowLineComp"); }; //: graphical view of ArrowLineOvComp. *************** *** 138,143 **** --- 140,147 ---- static ParamList* _ovarrow_multiline_params; friend OverlaysScript; + + CLASS_SYMID("ArrowMultiLineComp"); }; //: graphical view of ArrowMultiLineOvComp. *************** *** 219,224 **** --- 223,230 ---- static ParamList* _ovarrow_spline_params; friend OverlaysScript; + + CLASS_SYMID("ArrowSplineComp"); }; //: graphical view of ArrowSplineOvComp. Index: OverlayUnidraw/ovcomps.c diff -c OverlayUnidraw/ovcomps.c:1.2 OverlayUnidraw/ovcomps.c:1.3 *** OverlayUnidraw/ovcomps.c:1.2 Sat Mar 18 02:04:36 2000 --- src/OverlayUnidraw/ovcomps.c Fri Mar 24 23:15:47 2000 *************** *** 369,374 **** --- 369,375 ---- /*****************************************************************************/ ParamList* OverlaysComp::_overlay_comps_params = nil; + int OverlaysComp::_symid = -1; OverlaysComp::OverlaysComp (OverlayComp* parent) : OverlayComp(new Picture, parent) { _comps = new UList; *************** *** 1154,1159 **** --- 1155,1161 ---- /*****************************************************************************/ ParamList* OverlayIdrawComp::_overlay_idraw_params = nil; + int OverlayIdrawComp::_symid = -1; OverlayIdrawComp::OverlayIdrawComp (const char* pathname, OverlayComp* parent) : OverlaysComp(parent) { Index: OverlayUnidraw/ovcomps.h diff -c OverlayUnidraw/ovcomps.h:1.3 OverlayUnidraw/ovcomps.h:1.4 *** OverlayUnidraw/ovcomps.h:1.3 Sat Mar 18 02:04:37 2000 --- src/OverlayUnidraw/ovcomps.h Fri Mar 24 23:15:47 2000 *************** *** 31,37 **** #include <UniIdraw/idcomp.h> #include <InterViews/observe.h> ! #include <Attribute/_comutil.h> class AttributeList; class AttributeValue; --- 31,37 ---- #include <UniIdraw/idcomp.h> #include <InterViews/observe.h> ! #include <Attribute/classid.h> class AttributeList; class AttributeValue; *************** *** 298,303 **** --- 298,305 ---- UList* _comps; friend OverlaysScript; + + CLASS_SYMID("OverlayComp"); }; #include <OverlayUnidraw/indexmixins.h> *************** *** 362,367 **** --- 364,371 ---- char* _basedir; friend OverlayCatalog; + + CLASS_SYMID("OverlayIdrawComp"); }; inline boolean OverlayComp::valid() { return _valid; } Index: OverlayUnidraw/ovellipse.c diff -c OverlayUnidraw/ovellipse.c:1.1 OverlayUnidraw/ovellipse.c:1.2 *** OverlayUnidraw/ovellipse.c:1.1 Tue Jan 18 03:10:47 2000 --- src/OverlayUnidraw/ovellipse.c Fri Mar 24 23:15:47 2000 *************** *** 61,66 **** --- 61,68 ---- /*****************************************************************************/ + int EllipseOvComp::_symid = -1; + ParamList* EllipseOvComp::_ovellipse_params = nil; ClassId EllipseOvComp::GetClassId () { return OVELLIPSE_COMP; } Index: OverlayUnidraw/ovellipse.h diff -c OverlayUnidraw/ovellipse.h:1.1 OverlayUnidraw/ovellipse.h:1.2 *** OverlayUnidraw/ovellipse.h:1.1 Tue Jan 18 03:10:47 2000 --- src/OverlayUnidraw/ovellipse.h Fri Mar 24 23:15:47 2000 *************** *** 60,65 **** --- 60,67 ---- static ParamList* _ovellipse_params; friend OverlaysScript; + + CLASS_SYMID("EllipseComp"); }; //: graphical view of EllipseOvComp. Index: OverlayUnidraw/ovfile.c diff -c OverlayUnidraw/ovfile.c:1.2 OverlayUnidraw/ovfile.c:1.3 *** OverlayUnidraw/ovfile.c:1.2 Tue Mar 21 12:02:56 2000 --- src/OverlayUnidraw/ovfile.c Fri Mar 24 23:15:47 2000 *************** *** 41,46 **** --- 41,47 ---- /*****************************************************************************/ ParamList* OverlayFileComp::_overlay_file_params = nil; + int OverlayFileComp::_symid = -1; OverlayFileComp::OverlayFileComp(OverlayComp* parent) : OverlaysComp(parent) { _pathname = nil; Index: OverlayUnidraw/ovfile.h diff -c OverlayUnidraw/ovfile.h:1.2 OverlayUnidraw/ovfile.h:1.3 *** OverlayUnidraw/ovfile.h:1.2 Tue Mar 21 12:02:56 2000 --- src/OverlayUnidraw/ovfile.h Fri Mar 24 23:15:47 2000 *************** *** 67,72 **** --- 67,74 ---- void GrowParamList(ParamList*); static ParamList* _overlay_file_params; char * _pathname; + + CLASS_SYMID("OverlayFileComp"); }; //: graphical view of OverlayFileComp. Index: OverlayUnidraw/ovline.c diff -c OverlayUnidraw/ovline.c:1.1 OverlayUnidraw/ovline.c:1.2 *** OverlayUnidraw/ovline.c:1.1 Tue Jan 18 03:10:49 2000 --- src/OverlayUnidraw/ovline.c Fri Mar 24 23:15:47 2000 *************** *** 68,75 **** ParamList* LineOvComp::_ovline_params = nil; ParamList* MultiLineOvComp::_ovmultiline_params = nil; - ClassId LineOvComp::GetClassId () { return OVLINE_COMP; } boolean LineOvComp::IsA (ClassId id) { --- 68,75 ---- ParamList* LineOvComp::_ovline_params = nil; ParamList* MultiLineOvComp::_ovmultiline_params = nil; + int LineOvComp::_symid = -1; ClassId LineOvComp::GetClassId () { return OVLINE_COMP; } boolean LineOvComp::IsA (ClassId id) { *************** *** 403,408 **** --- 403,410 ---- } /****************************************************************************/ + + int MultiLineOvComp::_symid = -1; ClassId MultiLineOvComp::GetClassId () { return OVMULTILINE_COMP; } Index: OverlayUnidraw/ovline.h diff -c OverlayUnidraw/ovline.h:1.1 OverlayUnidraw/ovline.h:1.2 *** OverlayUnidraw/ovline.h:1.1 Tue Jan 18 03:10:49 2000 --- src/OverlayUnidraw/ovline.h Fri Mar 24 23:15:47 2000 *************** *** 58,63 **** --- 58,64 ---- void GrowParamList(ParamList*); static ParamList* _ovline_params; + CLASS_SYMID("LineComp"); }; //: graphical view of LineOvComp. *************** *** 128,133 **** --- 129,135 ---- void GrowParamList(ParamList*); static ParamList* _ovmultiline_params; + CLASS_SYMID("MultiLineComp"); }; //: graphical view of MultiLineOvComp. Index: OverlayUnidraw/ovpolygon.c diff -c OverlayUnidraw/ovpolygon.c:1.1 OverlayUnidraw/ovpolygon.c:1.2 *** OverlayUnidraw/ovpolygon.c:1.1 Tue Jan 18 03:10:51 2000 --- src/OverlayUnidraw/ovpolygon.c Fri Mar 24 23:15:47 2000 *************** *** 57,62 **** --- 57,63 ---- /****************************************************************************/ ParamList* PolygonOvComp::_ovpolygon_params = nil; + int PolygonOvComp::_symid = -1; ClassId PolygonOvComp::GetClassId () { return OVPOLYGON_COMP; } Index: OverlayUnidraw/ovpolygon.h diff -c OverlayUnidraw/ovpolygon.h:1.1 OverlayUnidraw/ovpolygon.h:1.2 *** OverlayUnidraw/ovpolygon.h:1.1 Tue Jan 18 03:10:51 2000 --- src/OverlayUnidraw/ovpolygon.h Fri Mar 24 23:15:47 2000 *************** *** 53,58 **** --- 53,60 ---- static ParamList* _ovpolygon_params; friend OverlaysScript; + + CLASS_SYMID("PolygonComp"); }; //: graphical view of PolygonOvComp. Index: OverlayUnidraw/ovraster.c diff -c OverlayUnidraw/ovraster.c:1.3 OverlayUnidraw/ovraster.c:1.4 *** OverlayUnidraw/ovraster.c:1.3 Fri Mar 10 23:42:34 2000 --- src/OverlayUnidraw/ovraster.c Fri Mar 24 23:15:47 2000 *************** *** 91,96 **** --- 91,98 ---- /*****************************************************************************/ + int RasterOvComp::_symid = -1; + static ostream& operator<<(ostream& out, const CopyStringList& sl) { for (ListItr(CopyStringList) i(sl); i.more(); i.next()) { out << i.cur_ref().string() << "\n"; Index: OverlayUnidraw/ovraster.h diff -c OverlayUnidraw/ovraster.h:1.1 OverlayUnidraw/ovraster.h:1.2 *** OverlayUnidraw/ovraster.h:1.1 Tue Jan 18 03:10:53 2000 --- src/OverlayUnidraw/ovraster.h Fri Mar 24 23:15:47 2000 *************** *** 114,119 **** --- 114,121 ---- static boolean _warned; friend RasterScript; + + CLASS_SYMID("RasterComp"); }; //: graphical view of RasterOvComp. Index: OverlayUnidraw/ovrect.c diff -c OverlayUnidraw/ovrect.c:1.1 OverlayUnidraw/ovrect.c:1.2 *** OverlayUnidraw/ovrect.c:1.1 Tue Jan 18 03:10:53 2000 --- src/OverlayUnidraw/ovrect.c Fri Mar 24 23:15:47 2000 *************** *** 64,69 **** --- 64,70 ---- /*****************************************************************************/ ParamList* RectOvComp::_ovrect_params = nil; + int RectOvComp::_symid = -1; ClassId RectOvComp::GetClassId () { return OVRECT_COMP; } Index: OverlayUnidraw/ovrect.h diff -c OverlayUnidraw/ovrect.h:1.1 OverlayUnidraw/ovrect.h:1.2 *** OverlayUnidraw/ovrect.h:1.1 Tue Jan 18 03:10:53 2000 --- src/OverlayUnidraw/ovrect.h Fri Mar 24 23:15:47 2000 *************** *** 58,63 **** --- 58,65 ---- static ParamList* _ovrect_params; friend OverlaysScript; + + CLASS_SYMID("RectComp"); }; //: graphical view of RectOvComp. Index: OverlayUnidraw/ovspline.c diff -c OverlayUnidraw/ovspline.c:1.1 OverlayUnidraw/ovspline.c:1.2 *** OverlayUnidraw/ovspline.c:1.1 Tue Jan 18 03:10:54 2000 --- src/OverlayUnidraw/ovspline.c Fri Mar 24 23:15:47 2000 *************** *** 56,63 **** ParamList* SplineOvComp::_ovspline_params = nil; ParamList* ClosedSplineOvComp::_ovclosed_spline_params = nil; - ClassId SplineOvComp::GetClassId () { return OVSPLINE_COMP; } boolean SplineOvComp::IsA (ClassId id) { --- 56,63 ---- ParamList* SplineOvComp::_ovspline_params = nil; ParamList* ClosedSplineOvComp::_ovclosed_spline_params = nil; + int SplineOvComp::_symid = -1; ClassId SplineOvComp::GetClassId () { return OVSPLINE_COMP; } boolean SplineOvComp::IsA (ClassId id) { *************** *** 277,282 **** --- 277,284 ---- /*****************************************************************************/ + + int ClosedSplineOvComp::_symid = -1; ClassId ClosedSplineOvComp::GetClassId () { return OVCLOSEDSPLINE_COMP; } Index: OverlayUnidraw/ovspline.h diff -c OverlayUnidraw/ovspline.h:1.1 OverlayUnidraw/ovspline.h:1.2 *** OverlayUnidraw/ovspline.h:1.1 Tue Jan 18 03:10:54 2000 --- src/OverlayUnidraw/ovspline.h Fri Mar 24 23:15:47 2000 *************** *** 55,60 **** --- 55,62 ---- static ParamList* _ovspline_params; friend OverlaysScript; + + CLASS_SYMID("SplineComp"); }; //: graphic view of SplineOvComp. *************** *** 122,127 **** --- 124,131 ---- static ParamList* _ovclosed_spline_params; friend OverlaysScript; + + CLASS_SYMID("ClosedSplineComp"); }; //: graphic view of ClosedSplineOvComp. Index: OverlayUnidraw/ovstencil.c diff -c OverlayUnidraw/ovstencil.c:1.2 OverlayUnidraw/ovstencil.c:1.3 *** OverlayUnidraw/ovstencil.c:1.2 Wed Feb 2 03:09:59 2000 --- src/OverlayUnidraw/ovstencil.c Fri Mar 24 23:15:48 2000 *************** *** 50,61 **** --- 50,63 ---- /*****************************************************************************/ ParamList* StencilOvComp::_ovstencil_params = nil; + int StencilOvComp::_symid = -1; static const int no_mask = 0; static const int mask_equals_image = 1; static const int valid_mask = 2; /*****************************************************************************/ + ClassId StencilOvComp::GetClassId () { return OVSTENCIL_COMP; } Index: OverlayUnidraw/ovstencil.h diff -c OverlayUnidraw/ovstencil.h:1.1 OverlayUnidraw/ovstencil.h:1.2 *** OverlayUnidraw/ovstencil.h:1.1 Tue Jan 18 03:10:55 2000 --- src/OverlayUnidraw/ovstencil.h Fri Mar 24 23:15:48 2000 *************** *** 72,77 **** --- 72,79 ---- boolean _by_pathname; friend StencilScript; + + CLASS_SYMID("StencilComp"); }; //: graphical view of StencilOvComp. Index: OverlayUnidraw/ovtext.c diff -c OverlayUnidraw/ovtext.c:1.1 OverlayUnidraw/ovtext.c:1.2 *** OverlayUnidraw/ovtext.c:1.1 Tue Jan 18 03:10:55 2000 --- src/OverlayUnidraw/ovtext.c Fri Mar 24 23:15:48 2000 *************** *** 66,71 **** --- 66,72 ---- /*****************************************************************************/ ParamList* TextOvComp::_ovtext_params = nil; + int TextOvComp::_symid = -1; /*****************************************************************************/ Index: OverlayUnidraw/ovtext.h diff -c OverlayUnidraw/ovtext.h:1.1 OverlayUnidraw/ovtext.h:1.2 *** OverlayUnidraw/ovtext.h:1.1 Tue Jan 18 03:10:55 2000 --- src/OverlayUnidraw/ovtext.h Fri Mar 24 23:15:48 2000 *************** *** 65,70 **** --- 65,72 ---- static ParamList* _ovtext_params; friend OverlaysScript; + + CLASS_SYMID("TextComp"); }; //: graphical view of TextOvComp. Index: OverlayUnidraw/ovvertices.c diff -c OverlayUnidraw/ovvertices.c:1.1 OverlayUnidraw/ovvertices.c:1.2 *** OverlayUnidraw/ovvertices.c:1.1 Tue Jan 18 03:10:56 2000 --- src/OverlayUnidraw/ovvertices.c Fri Mar 24 23:15:48 2000 *************** *** 45,50 **** --- 45,52 ---- /****************************************************************************/ + int VerticesOvComp::_symid = -1; + ClassId VerticesOvComp::GetClassId () { return OVVERTICES_COMP; } boolean VerticesOvComp::IsA (ClassId id) { Index: OverlayUnidraw/ovvertices.h diff -c OverlayUnidraw/ovvertices.h:1.1 OverlayUnidraw/ovvertices.h:1.2 *** OverlayUnidraw/ovvertices.h:1.1 Tue Jan 18 03:10:57 2000 --- src/OverlayUnidraw/ovvertices.h Fri Mar 24 23:15:48 2000 *************** *** 55,60 **** --- 55,62 ---- protected: VerticesOvComp(Vertices* = nil, OverlayComp* parent = nil); VerticesOvComp(istream&, OverlayComp* parent = nil); + + CLASS_SYMID("VerticesComp"); }; //: graphical view of VerticesOvComp. Index: OverlayUnidraw/textfile.c diff -c OverlayUnidraw/textfile.c:1.1 OverlayUnidraw/textfile.c:1.2 *** OverlayUnidraw/textfile.c:1.1 Tue Jan 18 03:10:59 2000 --- src/OverlayUnidraw/textfile.c Fri Mar 24 23:15:48 2000 *************** *** 47,52 **** --- 47,53 ---- /*****************************************************************************/ ParamList* TextFileComp::_textfile_params = nil; + int TextFileComp::_symid = -1; /*****************************************************************************/ Index: OverlayUnidraw/textfile.h diff -c OverlayUnidraw/textfile.h:1.1 OverlayUnidraw/textfile.h:1.2 *** OverlayUnidraw/textfile.h:1.1 Tue Jan 18 03:10:59 2000 --- src/OverlayUnidraw/textfile.h Fri Mar 24 23:15:48 2000 *************** *** 65,70 **** --- 65,72 ---- int _linewidth; friend TextFileScript; + + CLASS_SYMID("TextFileComp"); }; //: graphical view of a TextOvComp. Index: ComUnidraw/grfunc.c diff -c ComUnidraw/grfunc.c:1.5 ComUnidraw/grfunc.c:1.6 *** ComUnidraw/grfunc.c:1.5 Sat Mar 18 02:04:39 2000 --- src/ComUnidraw/grfunc.c Fri Mar 24 23:15:50 2000 *************** *** 679,697 **** for (gv->First(i); !gv->Done(i); gv->Next(i)) { GraphicView* subgv = gv->GetView(i); newSel->Append(subgv); ! GraphicComp* comp = subgv->GetGraphicComp(); ! ComValue* compval = new ComValue(symbol_add("Component"), new ComponentView(comp)); compval->object_compview(true); avl->Append(compval); } ! } if (nargs()==0) { Iterator i; int count=0; for (sel->First(i); !sel->Done(i); sel->Next(i)) { GraphicView* grview = sel->GetView(i); ! Component* comp = grview ? grview->GetSubject() : nil; ! ComValue* compval = comp ? new ComValue(symbol_add("Component"), new ComponentView(comp)) : nil; if (compval) { compval->object_compview(true); --- 679,697 ---- for (gv->First(i); !gv->Done(i); gv->Next(i)) { GraphicView* subgv = gv->GetView(i); newSel->Append(subgv); ! OverlayComp* comp = (OverlayComp*)subgv->GetGraphicComp(); ! ComValue* compval = new ComValue(comp->classid(), new ComponentView(comp)); compval->object_compview(true); avl->Append(compval); } ! } else if (nargs()==0) { Iterator i; int count=0; for (sel->First(i); !sel->Done(i); sel->Next(i)) { GraphicView* grview = sel->GetView(i); ! OverlayComp* comp = grview ? (OverlayComp*)grview->GetSubject() : nil; ! ComValue* compval = comp ? new ComValue(comp->classid(), new ComponentView(comp)) : nil; if (compval) { compval->object_compview(true); *************** *** 705,716 **** for (int i=0; i<nargsfixed(); i++) { ComValue& obj = stack_arg(i); ! if (obj.obj_type_val() == _compview_id) { ComponentView* comview = (ComponentView*)obj.obj_val(); OverlayComp* comp = (OverlayComp*)comview->GetSubject(); if (comp) { newSel->Append(comp->FindView(viewer)); ! ComValue* compval = new ComValue(symbol_add("Component"), new ComponentView(comp)); compval->object_compview(true); avl->Append(compval); } --- 705,716 ---- for (int i=0; i<nargsfixed(); i++) { ComValue& obj = stack_arg(i); ! if (obj.object_compview()) { ComponentView* comview = (ComponentView*)obj.obj_val(); OverlayComp* comp = (OverlayComp*)comview->GetSubject(); if (comp) { newSel->Append(comp->FindView(viewer)); ! ComValue* compval = new ComValue(comp->classid(), new ComponentView(comp)); compval->object_compview(true); avl->Append(compval); } Index: ComUnidraw/grstatfunc.c diff -c ComUnidraw/grstatfunc.c:1.1 ComUnidraw/grstatfunc.c:1.2 *** ComUnidraw/grstatfunc.c:1.1 Tue Jan 18 03:11:07 2000 --- src/ComUnidraw/grstatfunc.c Fri Mar 24 23:15:50 2000 *************** *** 60,66 **** Viewer* viewer = _ed->GetViewer(); ComValue& obj = stack_arg(0); reset_stack(); ! if (obj.obj_type_val() == _compview_id) { ComponentView* compview = (ComponentView*)obj.obj_val(); if (compview && compview->GetSubject()) { Graphic* gr = ((GraphicComp*)compview->GetSubject())->GetGraphic(); --- 60,66 ---- Viewer* viewer = _ed->GetViewer(); ComValue& obj = stack_arg(0); reset_stack(); ! if (obj.object_compview()) { ComponentView* compview = (ComponentView*)obj.obj_val(); if (compview && compview->GetSubject()) { Graphic* gr = ((GraphicComp*)compview->GetSubject())->GetGraphic(); *************** *** 99,105 **** Viewer* viewer = _ed->GetViewer(); ComValue& obj = stack_arg(0); reset_stack(); ! if (obj.obj_type_val() == _compview_id) { ComponentView* compview = (ComponentView*)obj.obj_val(); if (compview && compview->GetSubject()) { Graphic* gr = ((GraphicComp*)compview->GetSubject())->GetGraphic(); --- 99,105 ---- Viewer* viewer = _ed->GetViewer(); ComValue& obj = stack_arg(0); reset_stack(); ! if (obj.object_compview()) { ComponentView* compview = (ComponentView*)obj.obj_val(); if (compview && compview->GetSubject()) { Graphic* gr = ((GraphicComp*)compview->GetSubject())->GetGraphic(); *************** *** 133,139 **** Viewer* viewer = _ed->GetViewer(); ComValue& obj = stack_arg(0); reset_stack(); ! if (obj.obj_type_val() == _compview_id) { ComponentView* compview = (ComponentView*)obj.obj_val(); if (compview && compview->GetSubject()) { GraphicComp* comp = (GraphicComp*)compview->GetSubject(); --- 133,139 ---- Viewer* viewer = _ed->GetViewer(); ComValue& obj = stack_arg(0); reset_stack(); ! if (obj.object_compview()) { ComponentView* compview = (ComponentView*)obj.obj_val(); if (compview && compview->GetSubject()) { GraphicComp* comp = (GraphicComp*)compview->GetSubject(); Index: ComUnidraw/unifunc.c diff -c ComUnidraw/unifunc.c:1.3 ComUnidraw/unifunc.c:1.4 *** ComUnidraw/unifunc.c:1.3 Sat Mar 18 02:04:39 2000 --- src/ComUnidraw/unifunc.c Fri Mar 24 23:15:50 2000 *************** *** 48,59 **** /*****************************************************************************/ - int UnidrawFunc::_compview_id = -1; - UnidrawFunc::UnidrawFunc(ComTerp* comterp, Editor* ed) : ComFunc(comterp) { _ed = ed; - if (_compview_id<0) - _compview_id = symbol_add("ComponentView"); } void UnidrawFunc::execute_log(Command* cmd) { --- 48,55 ---- *************** *** 207,213 **** if (!pathnamev.is_array()) { if (nargs()==1) { if (cmd = import(pathnamev.string_ptr())) { ! ComValue compval(symbol_add("Component"), new ComponentView(cmd->component())); compval.object_compview(true); push_stack(compval); --- 203,209 ---- if (!pathnamev.is_array()) { if (nargs()==1) { if (cmd = import(pathnamev.string_ptr())) { ! ComValue compval(((OverlayComp*)cmd->component())->classid(), new ComponentView(cmd->component())); compval.object_compview(true); push_stack(compval); *************** *** 216,222 **** } else { for (int i=0; i<nargs(); i++) if (cmd = import(stack_arg(i).string_ptr())) { ! ComValue compval(symbol_add("Component"), new ComponentView(cmd->component())); compval.object_compview(true); push_stack(compval); --- 212,218 ---- } else { for (int i=0; i<nargs(); i++) if (cmd = import(stack_arg(i).string_ptr())) { ! ComValue compval(((OverlayComp*)cmd->component())->classid(), new ComponentView(cmd->component())); compval.object_compview(true); push_stack(compval); *************** *** 231,237 **** inlist->First(it); while(!inlist->Done(it)) { cmd = import(inlist->GetAttrVal(it)->string_ptr()); ! ComValue* val = new ComValue(symbol_add("Component"), new ComponentView(cmd->component())); val->object_compview(true); outlist->Append(val); --- 227,233 ---- inlist->First(it); while(!inlist->Done(it)) { cmd = import(inlist->GetAttrVal(it)->string_ptr()); ! ComValue* val = new ComValue(((OverlayComp*)cmd->component())->classid(), new ComponentView(cmd->component())); val->object_compview(true); outlist->Append(val); Index: ComUnidraw/unifunc.h diff -c ComUnidraw/unifunc.h:1.1 ComUnidraw/unifunc.h:1.2 *** ComUnidraw/unifunc.h:1.1 Tue Jan 18 03:11:08 2000 --- src/ComUnidraw/unifunc.h Fri Mar 24 23:15:50 2000 *************** *** 45,52 **** void menulength_execute(const char* kind); Editor* _ed; - static int _compview_id; - }; //: command to update Unidraw from comdraw. --- 45,50 ---- Index: FrameUnidraw/framecomps.c diff -c FrameUnidraw/framecomps.c:1.1 FrameUnidraw/framecomps.c:1.2 *** FrameUnidraw/framecomps.c:1.1 Tue Jan 18 03:11:14 2000 --- src/FrameUnidraw/framecomps.c Fri Mar 24 23:15:53 2000 *************** *** 57,62 **** --- 57,63 ---- /*****************************************************************************/ ParamList* FrameOverlaysComp::_frame_ovcomps_params = nil; + int FrameOverlaysComp::_symid = -1; FrameOverlaysComp::FrameOverlaysComp(OverlayComp* parent) : OverlaysComp(parent) {} FrameOverlaysComp::FrameOverlaysComp(Graphic* g, OverlayComp* parent) : OverlaysComp(g, parent) {} *************** *** 117,122 **** --- 118,124 ---- /*****************************************************************************/ ParamList* FrameComp::_frame_comp_params = nil; + int FrameComp::_symid = -1; FrameComp::FrameComp(OverlayComp* parent) : OverlaysComp(parent) {} FrameComp::FrameComp(Graphic* g, OverlayComp* parent) : OverlaysComp(g, parent) {} *************** *** 415,420 **** --- 417,423 ---- /*****************************************************************************/ ParamList* FramesComp::_frame_comps_params = nil; + int FramesComp::_symid = -1; FramesComp::FramesComp(OverlayComp* parent) : FrameComp(parent) {} FramesComp::FramesComp(Graphic* g, OverlayComp* parent) : FrameComp(g, parent) {} *************** *** 477,482 **** --- 480,486 ---- /*****************************************************************************/ ParamList* FrameIdrawComp::_frame_idraw_params = nil; + int FrameIdrawComp::_symid = -1; FrameIdrawComp::FrameIdrawComp(boolean add_bg, const char* pathname, OverlayComp* parent) : FramesComp(parent) { Index: FrameUnidraw/framecomps.h diff -c FrameUnidraw/framecomps.h:1.1 FrameUnidraw/framecomps.h:1.2 *** FrameUnidraw/framecomps.h:1.1 Tue Jan 18 03:11:15 2000 --- src/FrameUnidraw/framecomps.h Fri Mar 24 23:15:53 2000 *************** *** 51,56 **** --- 51,57 ---- void GrowParamList(ParamList*); static ParamList* _frame_ovcomps_params; + CLASS_SYMID("FrameOverlaysComp"); }; //: single frame component. *************** *** 72,77 **** --- 73,79 ---- void GrowParamList(ParamList*); static ParamList* _frame_comp_params; + CLASS_SYMID("FrameComp"); }; //: composite frame component. *************** *** 93,98 **** --- 95,101 ---- void GrowParamList(ParamList*); static ParamList* _frame_comps_params; + CLASS_SYMID("FramesComp"); }; //: top-level component for flipbook document. *************** *** 140,145 **** --- 143,149 ---- char* _pathname; char* _basedir; + CLASS_SYMID("FrameIdrawComp"); }; #endif Index: GraphUnidraw/edgecomp.c diff -c GraphUnidraw/edgecomp.c:1.1 GraphUnidraw/edgecomp.c:1.2 *** GraphUnidraw/edgecomp.c:1.1 Tue Jan 18 03:11:24 2000 --- src/GraphUnidraw/edgecomp.c Fri Mar 24 23:15:55 2000 *************** *** 79,84 **** --- 79,85 ---- /*****************************************************************************/ ParamList* EdgeComp::_edge_params = nil; + int EdgeComp::_symid = -1; ClassId EdgeComp::GetClassId() { return EDGE_COMP; } Index: GraphUnidraw/edgecomp.h diff -c GraphUnidraw/edgecomp.h:1.1 GraphUnidraw/edgecomp.h:1.2 *** GraphUnidraw/edgecomp.h:1.1 Tue Jan 18 03:11:24 2000 --- src/GraphUnidraw/edgecomp.h Fri Mar 24 23:15:55 2000 *************** *** 108,113 **** --- 108,115 ---- static ParamList* _edge_params; int _start_node; int _end_node; + + CLASS_SYMID("EdgeComp"); }; //: graphical view of EdgeComp Index: GraphUnidraw/graphcomp.c diff -c GraphUnidraw/graphcomp.c:1.1 GraphUnidraw/graphcomp.c:1.2 *** GraphUnidraw/graphcomp.c:1.1 Tue Jan 18 03:11:25 2000 --- src/GraphUnidraw/graphcomp.c Fri Mar 24 23:15:55 2000 *************** *** 92,97 **** --- 92,98 ---- /*****************************************************************************/ ParamList* GraphComp::_graph_params = nil; + int GraphComp::_symid = -1; GraphComp::GraphComp (const char* pathname, OverlayComp* parent) : OverlaysComp(parent) { *************** *** 349,354 **** --- 350,356 ---- ParamList* GraphIdrawComp::_graph_idraw_params = nil; + int GraphIdrawComp::_symid = -1; GraphIdrawComp::GraphIdrawComp (const char* pathname, OverlayComp* parent) : OverlayIdrawComp(pathname, parent) { } Index: GraphUnidraw/graphcomp.h diff -c GraphUnidraw/graphcomp.h:1.1 GraphUnidraw/graphcomp.h:1.2 *** GraphUnidraw/graphcomp.h:1.1 Tue Jan 18 03:11:25 2000 --- src/GraphUnidraw/graphcomp.h Fri Mar 24 23:15:56 2000 *************** *** 84,89 **** --- 84,91 ---- ParamList* GetParamList(); void GrowParamList(ParamList*); static ParamList* _graph_params; + + CLASS_SYMID("GraphComp"); }; inline UList* GraphComp::GraphEdges() { return _graphedges; } *************** *** 149,154 **** --- 151,158 ---- ParamList* GetParamList(); void GrowParamList(ParamList*); static ParamList* _graph_idraw_params; + + CLASS_SYMID("GraphIdrawComp"); }; //: graphical view of GraphIdrawComp. Index: GraphUnidraw/nodecomp.c diff -c GraphUnidraw/nodecomp.c:1.1 GraphUnidraw/nodecomp.c:1.2 *** GraphUnidraw/nodecomp.c:1.1 Tue Jan 18 03:11:27 2000 --- src/GraphUnidraw/nodecomp.c Fri Mar 24 23:15:56 2000 *************** *** 103,108 **** --- 103,109 ---- /*****************************************************************************/ ParamList* NodeComp::_node_params = nil; + int NodeComp::_symid = -1; NodeComp::NodeComp(SF_Ellipse* ellipse, TextGraphic* txt, boolean rl, OverlayComp* parent) : OverlayComp(nil, parent) Index: GraphUnidraw/nodecomp.h diff -c GraphUnidraw/nodecomp.h:1.1 GraphUnidraw/nodecomp.h:1.2 *** GraphUnidraw/nodecomp.h:1.1 Tue Jan 18 03:11:28 2000 --- src/GraphUnidraw/nodecomp.h Fri Mar 24 23:15:56 2000 *************** *** 138,143 **** --- 138,145 ---- ParamList* GetParamList(); void GrowParamList(ParamList*); static ParamList* _node_params; + + CLASS_SYMID("NodeComp"); }; inline void NodeComp::SetGraph(GraphComp* comp) { _graph = comp; } *** /dev/null Fri Mar 24 23:16:13 PST 2000 --- patches/ivtools-000324-johnston-034 *************** patches/ivtools-000324-johnston-034 *** 0 **** --- 1 ---- + ivtools-000324-johnston-034 |
From: <ivt...@li...> - 2000-03-24 20:04:16
|
Patch: ivtools-000321-johnston-033 For: ivtools-0.8.1 Author: joh...@us... Subject: attrname and attrlist commands for manipulating component property lists, bug fix in relative pathname adjustment. Requires: This is an intermediate patch to ivtools-0.8.1. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - create "attrname" command to return name of attribute name/value pair. - create "attrlist" command to return the AttributeList of a component. - fix the adjusting of relative pathnames for an OverlayFileComp when the whole document is saved out to a different directory. - finish migration to use of ComValue::object_compview method. - add FrameScript::suppress_frame method to trim the output of "frame" objects from a derived program, i.e. a map viewer. Index: ComTerp/comterp.c diff -c ComTerp/comterp.c:1.9 ComTerp/comterp.c:1.10 *** ComTerp/comterp.c:1.9 Sat Feb 26 03:07:26 2000 --- src/ComTerp/comterp.c Tue Mar 21 12:02:21 2000 *************** *** 782,788 **** add_command("iterate", new IterateFunc(this)); add_command("dot", new DotFunc(this)); ! add_command("dotname", new DotNameFunc(this)); add_command("list", new ListFunc(this)); add_command("at", new ListAtFunc(this)); --- 782,788 ---- add_command("iterate", new IterateFunc(this)); add_command("dot", new DotFunc(this)); ! add_command("attrname", new DotNameFunc(this)); add_command("list", new ListFunc(this)); add_command("at", new ListAtFunc(this)); Index: comterp/README diff -c comterp/README:1.3 comterp/README:1.4 *** comterp/README:1.3 Wed Feb 23 04:27:34 2000 --- src/comterp_/README Tue Mar 21 12:02:25 2000 *************** *** 192,197 **** --- 192,199 ---- arr=posteval(arg1 [arg2 [arg3 ... [argn]]]) -- post-evaluate every fixed argument (until nil) and return array + + sym=attrname(attribute) -- return name field of dotted pair. quit() -- quit the interpreter Index: OverlayUnidraw/ovfile.c diff -c OverlayUnidraw/ovfile.c:1.1 OverlayUnidraw/ovfile.c:1.2 *** OverlayUnidraw/ovfile.c:1.1 Tue Jan 18 03:10:47 2000 --- src/OverlayUnidraw/ovfile.c Tue Mar 21 12:02:56 2000 *************** *** 135,140 **** --- 135,144 ---- SetAttributeList(((OverlayComp*)comp)->GetAttributeList()); } + void OverlayFileComp::AdjustBaseDir(const char* olddir, const char* newdir) { + OverlayComp::AdjustBaseDir(olddir, newdir); + } + /*****************************************************************************/ OverlayFileView::OverlayFileView() : OverlaysView() {} Index: OverlayUnidraw/ovfile.h diff -c OverlayUnidraw/ovfile.h:1.1 OverlayUnidraw/ovfile.h:1.2 *** OverlayUnidraw/ovfile.h:1.1 Tue Jan 18 03:10:47 2000 --- src/OverlayUnidraw/ovfile.h Tue Mar 21 12:02:56 2000 *************** *** 58,63 **** --- 58,67 ---- OverlayIdrawComp* GetIdrawComp(); // return point to underlying top-level component. virtual boolean operator == (OverlayComp&); + + virtual void AdjustBaseDir(const char* oldpath, const char* newpath); + // adjust base directory used for generating pathnames for this component, + // done when a document is saved to a new location. protected: ParamList* GetParamList(); void GrowParamList(ParamList*); Index: ComUnidraw/comeditor.c diff -c ComUnidraw/comeditor.c:1.2 ComUnidraw/comeditor.c:1.3 *** ComUnidraw/comeditor.c:1.2 Fri Mar 10 23:42:09 2000 --- src/ComUnidraw/comeditor.c Tue Mar 21 12:03:02 2000 *************** *** 177,182 **** --- 177,183 ---- comterp->add_command("import", new ImportFunc(comterp, this)); comterp->add_command("dot", new GrDotFunc(comterp)); + comterp->add_command("attrlist", new GrAttrListFunc(comterp)); } /* virtual */ void ComEditor::ExecuteCmd(Command* cmd) { Index: ComUnidraw/grdotfunc.c diff -c ComUnidraw/grdotfunc.c:1.1 ComUnidraw/grdotfunc.c:1.2 *** ComUnidraw/grdotfunc.c:1.1 Fri Mar 10 23:42:09 2000 --- src/ComUnidraw/grdotfunc.c Tue Mar 21 12:03:02 2000 *************** *** 39,52 **** } void GrDotFunc::execute() { - static int ComponentView_symid = symbol_add("ComponentView"); ComValue& before_part(stack_arg(0, true)); ComValue& after_part(stack_arg(1, true)); if (!before_part.is_symbol() && !(before_part.is_attribute() && ((Attribute*)before_part.obj_val())->Value()->is_attributelist()) && ! !(before_part.is_object(ComponentView_symid))) { ! cerr << "expression before \".\" needs to evaluate to a symbol or <AttributeList> or <ComponentView>\n"; return; } if (!after_part.is_symbol()) { --- 39,51 ---- } void GrDotFunc::execute() { ComValue& before_part(stack_arg(0, true)); ComValue& after_part(stack_arg(1, true)); if (!before_part.is_symbol() && !(before_part.is_attribute() && ((Attribute*)before_part.obj_val())->Value()->is_attributelist()) && ! !(before_part.object_compview())) { ! cerr << "expression before \".\" needs to evaluate to a symbol or <AttributeList> or <Component>\n"; return; } if (!after_part.is_symbol()) { *************** *** 57,63 **** /* handle ComponentView case */ if (before_part.is_symbol()) lookup_symval(before_part); ! if (before_part.is_object(ComponentView_symid)) { ComponentView* compview = (ComponentView*)before_part.obj_val(); OverlayComp* comp = (OverlayComp*)compview->GetSubject(); ComValue stuffval(AttributeList::class_symid(), (void*)comp->GetAttributeList()); --- 56,62 ---- /* handle ComponentView case */ if (before_part.is_symbol()) lookup_symval(before_part); ! if (before_part.object_compview()) { ComponentView* compview = (ComponentView*)before_part.obj_val(); OverlayComp* comp = (OverlayComp*)compview->GetSubject(); ComValue stuffval(AttributeList::class_symid(), (void*)comp->GetAttributeList()); *************** *** 66,68 **** --- 65,84 ---- DotFunc::execute(); } + + /*****************************************************************************/ + + GrAttrListFunc::GrAttrListFunc(ComTerp* comterp) : ComFunc(comterp) { + } + + void GrAttrListFunc::execute() { + ComValue compviewv(stack_arg(0)); + reset_stack(); + if (compviewv.object_compview()) { + ComponentView* compview = (ComponentView*)compviewv.obj_val(); + OverlayComp* comp = compview ? (OverlayComp*)compview->GetSubject() : nil; + ComValue retval(AttributeList::class_symid(), (void*)comp->GetAttributeList()); + push_stack(retval); + } + } + Index: ComUnidraw/grdotfunc.h diff -c ComUnidraw/grdotfunc.h:1.1 ComUnidraw/grdotfunc.h:1.2 *** ComUnidraw/grdotfunc.h:1.1 Fri Mar 10 23:42:09 2000 --- src/ComUnidraw/grdotfunc.h Tue Mar 21 12:03:02 2000 *************** *** 37,45 **** virtual void execute(); virtual const char* docstring() { ! return ". makes compound variables, and gives access to ComponentView AttributeList's."; } CLASS_SYMID("GrDotFunc"); }; #endif /* !defined(_grdotfunc_h) */ --- 37,57 ---- virtual void execute(); virtual const char* docstring() { ! return "%s(. makes compound variables, and gives access to ComponentView AttributeList's."; } CLASS_SYMID("GrDotFunc"); + }; + + //: attrlist command, for returning the attribute list of a component. + // attrlist(compview) -- return attribute list of component. + class GrAttrListFunc : public ComFunc { + public: + GrAttrListFunc(ComTerp*); + + virtual void execute(); + virtual const char* docstring() { + return "%s(compview) -- return attribute list of component."; } + }; #endif /* !defined(_grdotfunc_h) */ Index: comdraw/README diff -c comdraw/README:1.1 comdraw/README:1.2 *** comdraw/README:1.1 Tue Jan 18 03:11:10 2000 --- src/comdraw/README Tue Mar 21 12:03:05 2000 *************** *** 66,71 **** --- 66,72 ---- ATTRIBUTE COMMANDS compview=setattr(compview [:keyword value [:keyword value [...]]]) -- set attributes of a graphic component + attrlist(compview) -- return attribute list of component VIEWER COMMANDS Index: FrameUnidraw/framescripts.c diff -c FrameUnidraw/framescripts.c:1.1 FrameUnidraw/framescripts.c:1.2 *** FrameUnidraw/framescripts.c:1.1 Tue Jan 18 03:11:17 2000 --- src/FrameUnidraw/framescripts.c Tue Mar 21 12:03:10 2000 *************** *** 68,74 **** /*****************************************************************************/ ! FrameScript::FrameScript (FrameComp* subj) : OverlaysScript(subj) {} ClassId FrameScript::GetClassId () { return FRAME_SCRIPT; } --- 68,76 ---- /*****************************************************************************/ ! FrameScript::FrameScript (FrameComp* subj) : OverlaysScript(subj) { ! _suppress_frame = false; ! } ClassId FrameScript::GetClassId () { return FRAME_SCRIPT; } *************** *** 80,86 **** Iterator i; boolean status = true; ! out << "frame(\n"; static int readonly_symval = symbol_add("readonly"); boolean outflag = false; --- 82,88 ---- Iterator i; boolean status = true; ! if (!_suppress_frame) out << "frame(\n"; static int readonly_symval = symbol_add("readonly"); boolean outflag = false; *************** *** 104,110 **** out << "\n"; Indent(out); Attributes(out); ! out << ")"; return status; } --- 106,112 ---- out << "\n"; Indent(out); Attributes(out); ! if (!_suppress_frame) out << ")"; return status; } Index: FrameUnidraw/framescripts.h diff -c FrameUnidraw/framescripts.h:1.1 FrameUnidraw/framescripts.h:1.2 *** FrameUnidraw/framescripts.h:1.1 Tue Jan 18 03:11:17 2000 --- src/FrameUnidraw/framescripts.h Tue Mar 21 12:03:10 2000 *************** *** 1,4 **** --- 1,5 ---- /* + * Copyright (c) 2000 IET Inc. * Copyright (c) 1994, 1995, 1999 Vectaport * * Permission to use, copy, modify, distribute, and sell this software and its *************** *** 58,63 **** --- 59,68 ---- virtual boolean Definition(ostream&); static int ReadChildren(istream&, void*, void*, void*, void*); virtual boolean EmitPic(ostream&, Clipboard*, Clipboard*, boolean); + + boolean suppress_frame() { _suppress_frame = true; } + protected: + boolean _suppress_frame; }; //: serialized view of FramesComp. Index: man1_ivtools/comdraw.1 diff -c man1_ivtools/comdraw.1:1.1 man1_ivtools/comdraw.1:1.2 *** man1_ivtools/comdraw.1:1.1 Tue Jan 18 03:13:42 2000 --- src/man/man1/comdraw.1 Tue Mar 21 12:03:44 2000 *************** *** 73,79 **** .SH ATTRIBUTE COMMANDS ! compview=setattr(compview [:keyword value [:keyword value [...]]]) -- set attributes of a graphic component .SH VIEWER COMMANDS --- 73,80 ---- .SH ATTRIBUTE COMMANDS ! compview=setattr(compview [:keyword value [:keyword value [...]]]) -- set attributes of a graphic component ! attrlist(compview) -- return attribute list of component .SH VIEWER COMMANDS Index: man1_ivtools/comterp.1 diff -c man1_ivtools/comterp.1:1.3 man1_ivtools/comterp.1:1.4 *** man1_ivtools/comterp.1:1.3 Wed Feb 23 04:28:04 2000 --- src/man/man1/comterp.1 Tue Mar 21 12:03:44 2000 *************** *** 198,203 **** --- 198,204 ---- arr=posteval(arg1 [arg2 [arg3 ... [argn]]]) -- post-evaluate every fixed argument (until nil) and return array + sym=attrname(attribute) -- return name field of dotted pair. quit() -- quit the interpreter *** /dev/null Tue Mar 21 12:04:01 PST 2000 --- patches/ivtools-000321-johnston-033 *************** patches/ivtools-000321-johnston-033 *** 0 **** --- 1 ---- + ivtools-000321-johnston-033 |
From: <ivt...@li...> - 2000-03-21 08:09:39
|
Patch: ivtools-000321-johnston-033 For: ivtools-0.8.1 Author: joh...@us... Subject: attrname and attrlist commands for manipulating component property lists, bug fix in relative pathname adjustment. Requires: This is an intermediate patch to ivtools-0.8.1. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - create "attrname" command to return name of attribute name/value pair. - create "attrlist" command to return the AttributeList of a component. - fix the adjusting of relative pathnames for an OverlayFileComp when the whole document is saved out to a different directory. - finish migration to use of ComValue::object_compview method. - add FrameScript::suppress_frame method to trim the output of "frame" objects from a derived program, i.e. a map viewer. Index: ComTerp/comterp.c diff -c ComTerp/comterp.c:1.9 ComTerp/comterp.c:1.10 *** ComTerp/comterp.c:1.9 Sat Feb 26 03:07:26 2000 --- src/ComTerp/comterp.c Tue Mar 21 12:02:21 2000 *************** *** 782,788 **** add_command("iterate", new IterateFunc(this)); add_command("dot", new DotFunc(this)); ! add_command("dotname", new DotNameFunc(this)); add_command("list", new ListFunc(this)); add_command("at", new ListAtFunc(this)); --- 782,788 ---- add_command("iterate", new IterateFunc(this)); add_command("dot", new DotFunc(this)); ! add_command("attrname", new DotNameFunc(this)); add_command("list", new ListFunc(this)); add_command("at", new ListAtFunc(this)); Index: comterp/README diff -c comterp/README:1.3 comterp/README:1.4 *** comterp/README:1.3 Wed Feb 23 04:27:34 2000 --- src/comterp_/README Tue Mar 21 12:02:25 2000 *************** *** 192,197 **** --- 192,199 ---- arr=posteval(arg1 [arg2 [arg3 ... [argn]]]) -- post-evaluate every fixed argument (until nil) and return array + + sym=attrname(attribute) -- return name field of dotted pair. quit() -- quit the interpreter Index: OverlayUnidraw/ovfile.c diff -c OverlayUnidraw/ovfile.c:1.1 OverlayUnidraw/ovfile.c:1.2 *** OverlayUnidraw/ovfile.c:1.1 Tue Jan 18 03:10:47 2000 --- src/OverlayUnidraw/ovfile.c Tue Mar 21 12:02:56 2000 *************** *** 135,140 **** --- 135,144 ---- SetAttributeList(((OverlayComp*)comp)->GetAttributeList()); } + void OverlayFileComp::AdjustBaseDir(const char* olddir, const char* newdir) { + OverlayComp::AdjustBaseDir(olddir, newdir); + } + /*****************************************************************************/ OverlayFileView::OverlayFileView() : OverlaysView() {} Index: OverlayUnidraw/ovfile.h diff -c OverlayUnidraw/ovfile.h:1.1 OverlayUnidraw/ovfile.h:1.2 *** OverlayUnidraw/ovfile.h:1.1 Tue Jan 18 03:10:47 2000 --- src/OverlayUnidraw/ovfile.h Tue Mar 21 12:02:56 2000 *************** *** 58,63 **** --- 58,67 ---- OverlayIdrawComp* GetIdrawComp(); // return point to underlying top-level component. virtual boolean operator == (OverlayComp&); + + virtual void AdjustBaseDir(const char* oldpath, const char* newpath); + // adjust base directory used for generating pathnames for this component, + // done when a document is saved to a new location. protected: ParamList* GetParamList(); void GrowParamList(ParamList*); Index: ComUnidraw/comeditor.c diff -c ComUnidraw/comeditor.c:1.2 ComUnidraw/comeditor.c:1.3 *** ComUnidraw/comeditor.c:1.2 Fri Mar 10 23:42:09 2000 --- src/ComUnidraw/comeditor.c Tue Mar 21 12:03:02 2000 *************** *** 177,182 **** --- 177,183 ---- comterp->add_command("import", new ImportFunc(comterp, this)); comterp->add_command("dot", new GrDotFunc(comterp)); + comterp->add_command("attrlist", new GrAttrListFunc(comterp)); } /* virtual */ void ComEditor::ExecuteCmd(Command* cmd) { Index: ComUnidraw/grdotfunc.c diff -c ComUnidraw/grdotfunc.c:1.1 ComUnidraw/grdotfunc.c:1.2 *** ComUnidraw/grdotfunc.c:1.1 Fri Mar 10 23:42:09 2000 --- src/ComUnidraw/grdotfunc.c Tue Mar 21 12:03:02 2000 *************** *** 39,52 **** } void GrDotFunc::execute() { - static int ComponentView_symid = symbol_add("ComponentView"); ComValue& before_part(stack_arg(0, true)); ComValue& after_part(stack_arg(1, true)); if (!before_part.is_symbol() && !(before_part.is_attribute() && ((Attribute*)before_part.obj_val())->Value()->is_attributelist()) && ! !(before_part.is_object(ComponentView_symid))) { ! cerr << "expression before \".\" needs to evaluate to a symbol or <AttributeList> or <ComponentView>\n"; return; } if (!after_part.is_symbol()) { --- 39,51 ---- } void GrDotFunc::execute() { ComValue& before_part(stack_arg(0, true)); ComValue& after_part(stack_arg(1, true)); if (!before_part.is_symbol() && !(before_part.is_attribute() && ((Attribute*)before_part.obj_val())->Value()->is_attributelist()) && ! !(before_part.object_compview())) { ! cerr << "expression before \".\" needs to evaluate to a symbol or <AttributeList> or <Component>\n"; return; } if (!after_part.is_symbol()) { *************** *** 57,63 **** /* handle ComponentView case */ if (before_part.is_symbol()) lookup_symval(before_part); ! if (before_part.is_object(ComponentView_symid)) { ComponentView* compview = (ComponentView*)before_part.obj_val(); OverlayComp* comp = (OverlayComp*)compview->GetSubject(); ComValue stuffval(AttributeList::class_symid(), (void*)comp->GetAttributeList()); --- 56,62 ---- /* handle ComponentView case */ if (before_part.is_symbol()) lookup_symval(before_part); ! if (before_part.object_compview()) { ComponentView* compview = (ComponentView*)before_part.obj_val(); OverlayComp* comp = (OverlayComp*)compview->GetSubject(); ComValue stuffval(AttributeList::class_symid(), (void*)comp->GetAttributeList()); *************** *** 66,68 **** --- 65,84 ---- DotFunc::execute(); } + + /*****************************************************************************/ + + GrAttrListFunc::GrAttrListFunc(ComTerp* comterp) : ComFunc(comterp) { + } + + void GrAttrListFunc::execute() { + ComValue compviewv(stack_arg(0)); + reset_stack(); + if (compviewv.object_compview()) { + ComponentView* compview = (ComponentView*)compviewv.obj_val(); + OverlayComp* comp = compview ? (OverlayComp*)compview->GetSubject() : nil; + ComValue retval(AttributeList::class_symid(), (void*)comp->GetAttributeList()); + push_stack(retval); + } + } + Index: ComUnidraw/grdotfunc.h diff -c ComUnidraw/grdotfunc.h:1.1 ComUnidraw/grdotfunc.h:1.2 *** ComUnidraw/grdotfunc.h:1.1 Fri Mar 10 23:42:09 2000 --- src/ComUnidraw/grdotfunc.h Tue Mar 21 12:03:02 2000 *************** *** 37,45 **** virtual void execute(); virtual const char* docstring() { ! return ". makes compound variables, and gives access to ComponentView AttributeList's."; } CLASS_SYMID("GrDotFunc"); }; #endif /* !defined(_grdotfunc_h) */ --- 37,57 ---- virtual void execute(); virtual const char* docstring() { ! return "%s(. makes compound variables, and gives access to ComponentView AttributeList's."; } CLASS_SYMID("GrDotFunc"); + }; + + //: attrlist command, for returning the attribute list of a component. + // attrlist(compview) -- return attribute list of component. + class GrAttrListFunc : public ComFunc { + public: + GrAttrListFunc(ComTerp*); + + virtual void execute(); + virtual const char* docstring() { + return "%s(compview) -- return attribute list of component."; } + }; #endif /* !defined(_grdotfunc_h) */ Index: comdraw/README diff -c comdraw/README:1.1 comdraw/README:1.2 *** comdraw/README:1.1 Tue Jan 18 03:11:10 2000 --- src/comdraw/README Tue Mar 21 12:03:05 2000 *************** *** 66,71 **** --- 66,72 ---- ATTRIBUTE COMMANDS compview=setattr(compview [:keyword value [:keyword value [...]]]) -- set attributes of a graphic component + attrlist(compview) -- return attribute list of component VIEWER COMMANDS Index: FrameUnidraw/framescripts.c diff -c FrameUnidraw/framescripts.c:1.1 FrameUnidraw/framescripts.c:1.2 *** FrameUnidraw/framescripts.c:1.1 Tue Jan 18 03:11:17 2000 --- src/FrameUnidraw/framescripts.c Tue Mar 21 12:03:10 2000 *************** *** 68,74 **** /*****************************************************************************/ ! FrameScript::FrameScript (FrameComp* subj) : OverlaysScript(subj) {} ClassId FrameScript::GetClassId () { return FRAME_SCRIPT; } --- 68,76 ---- /*****************************************************************************/ ! FrameScript::FrameScript (FrameComp* subj) : OverlaysScript(subj) { ! _suppress_frame = false; ! } ClassId FrameScript::GetClassId () { return FRAME_SCRIPT; } *************** *** 80,86 **** Iterator i; boolean status = true; ! out << "frame(\n"; static int readonly_symval = symbol_add("readonly"); boolean outflag = false; --- 82,88 ---- Iterator i; boolean status = true; ! if (!_suppress_frame) out << "frame(\n"; static int readonly_symval = symbol_add("readonly"); boolean outflag = false; *************** *** 104,110 **** out << "\n"; Indent(out); Attributes(out); ! out << ")"; return status; } --- 106,112 ---- out << "\n"; Indent(out); Attributes(out); ! if (!_suppress_frame) out << ")"; return status; } Index: FrameUnidraw/framescripts.h diff -c FrameUnidraw/framescripts.h:1.1 FrameUnidraw/framescripts.h:1.2 *** FrameUnidraw/framescripts.h:1.1 Tue Jan 18 03:11:17 2000 --- src/FrameUnidraw/framescripts.h Tue Mar 21 12:03:10 2000 *************** *** 1,4 **** --- 1,5 ---- /* + * Copyright (c) 2000 IET Inc. * Copyright (c) 1994, 1995, 1999 Vectaport * * Permission to use, copy, modify, distribute, and sell this software and its *************** *** 58,63 **** --- 59,68 ---- virtual boolean Definition(ostream&); static int ReadChildren(istream&, void*, void*, void*, void*); virtual boolean EmitPic(ostream&, Clipboard*, Clipboard*, boolean); + + boolean suppress_frame() { _suppress_frame = true; } + protected: + boolean _suppress_frame; }; //: serialized view of FramesComp. Index: man1_ivtools/comdraw.1 diff -c man1_ivtools/comdraw.1:1.1 man1_ivtools/comdraw.1:1.2 *** man1_ivtools/comdraw.1:1.1 Tue Jan 18 03:13:42 2000 --- src/man/man1/comdraw.1 Tue Mar 21 12:03:44 2000 *************** *** 73,79 **** .SH ATTRIBUTE COMMANDS ! compview=setattr(compview [:keyword value [:keyword value [...]]]) -- set attributes of a graphic component .SH VIEWER COMMANDS --- 73,80 ---- .SH ATTRIBUTE COMMANDS ! compview=setattr(compview [:keyword value [:keyword value [...]]]) -- set attributes of a graphic component ! attrlist(compview) -- return attribute list of component .SH VIEWER COMMANDS Index: man1_ivtools/comterp.1 diff -c man1_ivtools/comterp.1:1.3 man1_ivtools/comterp.1:1.4 *** man1_ivtools/comterp.1:1.3 Wed Feb 23 04:28:04 2000 --- src/man/man1/comterp.1 Tue Mar 21 12:03:44 2000 *************** *** 198,203 **** --- 198,204 ---- arr=posteval(arg1 [arg2 [arg3 ... [argn]]]) -- post-evaluate every fixed argument (until nil) and return array + sym=attrname(attribute) -- return name field of dotted pair. quit() -- quit the interpreter *** /dev/null Tue Mar 21 12:04:01 PST 2000 --- patches/ivtools-000321-johnston-033 *************** patches/ivtools-000321-johnston-033 *** 0 **** --- 1 ---- + ivtools-000321-johnston-033 |
From: <ivt...@li...> - 2000-03-18 01:27:40
|
Patch: ivtools-000318-johnston-032 For: ivtools-0.8.1 Author: joh...@us... Subject: ComValue::object_compview() indicates use of ComponentView wrapper. Requires: This is an intermediate patch to ivtools-0.8.1. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - add a flag to ComValue (use space from one of two type-specific unions) to indicate the void* pointer stored in an ComValue of ObjectType is really a ComponentView, not the class indicated by the classid symbol associated with it. This allows derived ComFunc's to detect whether an object pointer is really a ComponentView indirection to some Component object. - fix bug in comterp telcat mode where a bad pathname segfaults. - extend OverlayComp::FindValue to support the "up" flag. - change all the derived ComFunc's that work with ComponentView's to set the ComValue::_object_compview flag, and provide a symbol for the classid that corresponds to the kind of component. This needs to become a virtual method on every component, which requires adding CLASS_SYMID to all the *comp(s).h in the OverlayUnidraw library. Index: top_ivtools/INSTALL diff -c top_ivtools/INSTALL:1.5 top_ivtools/INSTALL:1.6 *** top_ivtools/INSTALL:1.5 Thu Mar 9 02:16:29 2000 --- ./INSTALL Sat Mar 18 02:04:12 2000 *************** *** 15,22 **** egcs-1.0.3 and gcc-2.8.1. gcc-2.7.2 will still work, as probably would gcc-2.6.3. You will also need an equivalent copy of libstdc++. The libstdc++ version numbers stay roughly in synch with the gcc ! version numbers. If you have if you have gcc-2.8.1 you'd want ! libstdc++-2.8.1, etc.. 0.c. An installed copy of X11R6 as distributed by the Open Group, or an equivalent (XFree86 for Linux, or X11R5 from MIT). If you use a --- 15,22 ---- egcs-1.0.3 and gcc-2.8.1. gcc-2.7.2 will still work, as probably would gcc-2.6.3. You will also need an equivalent copy of libstdc++. The libstdc++ version numbers stay roughly in synch with the gcc ! version numbers. If you have gcc-2.8.1 you'd want libstdc++-2.8.1, ! etc.. 0.c. An installed copy of X11R6 as distributed by the Open Group, or an equivalent (XFree86 for Linux, or X11R5 from MIT). If you use a Index: Attribute/attrvalue.c diff -c Attribute/attrvalue.c:1.5 Attribute/attrvalue.c:1.6 *** Attribute/attrvalue.c:1.5 Wed Feb 23 04:27:30 2000 --- src/Attribute/attrvalue.c Sat Mar 18 02:04:14 2000 *************** *** 116,121 **** --- 116,122 ---- _type = AttributeValue::ObjectType; _v.objval.ptr = ptr; _v.objval.type = classid; + _object_compview = false; } AttributeValue::AttributeValue(AttributeValueList* ptr) { *************** *** 869,877 **** } void* AttributeValue::geta(int id) { ! if (is_object(id)) ! return obj_val(); else ! return nil; } --- 870,881 ---- } void* AttributeValue::geta(int id) { ! if (is_object(id)) { ! if (object_compview()) ! return nil; else ! return obj_val(); ! } else ! return nil; } Index: Attribute/attrvalue.h diff -c Attribute/attrvalue.h:1.7 Attribute/attrvalue.h:1.8 *** Attribute/attrvalue.h:1.7 Mon Feb 21 20:48:38 2000 --- src/Attribute/attrvalue.h Sat Mar 18 02:04:14 2000 *************** *** 203,208 **** --- 203,213 ---- boolean command_alias(); // returns true if command is an alias, not the first name. + boolean object_compview() { return _object_compview; } + // true if object is wrapped with a ComponentView + void object_compview(boolean flag) { _object_compview = flag; } + // true if object is wrapped with a ComponentView + void negate(); // negate numeric values. *************** *** 302,307 **** --- 307,313 ---- union { ValueType _aggregate_type; // used for ArrayType. unsigned int _command_symid; // used for CommandType. + boolean _object_compview; // used for ObjectType. }; }; Index: ComTerp/comvalue.c diff -c ComTerp/comvalue.c:1.8 ComTerp/comvalue.c:1.9 *** ComTerp/comvalue.c:1.8 Tue Mar 14 23:18:42 2000 --- src/ComTerp/comvalue.c Sat Mar 18 02:04:16 2000 *************** *** 267,273 **** avl->Next(i); if (!avl->Done(i)) out << ","; } ! if (!first) out << "}\n"; } else { out << "array of length " << svp->array_len(); ALIterator i; --- 267,273 ---- avl->Next(i); if (!avl->Done(i)) out << ","; } ! if (!first) out << "}"; } else { out << "array of length " << svp->array_len(); ALIterator i; *************** *** 298,304 **** if (svp->class_symid() == Attribute::class_symid()) out << *((Attribute*)svp->obj_val())->Value(); else ! out << "<" << symbol_pntr(svp->class_symid()) << ">"; break; case ComValue::UnknownType: --- 298,304 ---- if (svp->class_symid() == Attribute::class_symid()) out << *((Attribute*)svp->obj_val())->Value(); else ! out << "<" << symbol_pntr(svp->class_symid()) << ">"; break; case ComValue::UnknownType: Index: comterp/main.c diff -c comterp/main.c:1.1 comterp/main.c:1.2 *** comterp/main.c:1.1 Tue Jan 18 03:07:08 2000 --- src/comterp_/main.c Sat Mar 18 02:04:18 2000 *************** *** 145,151 **** } } ! } else { filebuf inbuf; inbuf.attach(fileno(inptr)); --- 145,151 ---- } } ! } else if (inptr) { filebuf inbuf; inbuf.attach(fileno(inptr)); *************** *** 155,209 **** obuf.attach(server.get_handle()); ostream out(&obuf); - #if 0 - for (;;) { - char ch; - in.get(ch); - if (!in.good()) break; - out << ch; - } - #else char buffer[BUFSIZ*BUFSIZ]; while(!in.eof() && in.good()) { in.read(buffer, BUFSIZ*BUFSIZ); if (!in.eof() || in.gcount()) out.write(buffer, in.gcount()); } - #endif out.flush(); ! ! #if 0 ! for (;;) { ! fgets(buffer, BUFSIZ*BUFSIZ, inptr); ! if (feof(inptr)) break; ! fputs(buffer, fptr); ! fflush(fptr); ! #if 0 ! fgets(buffer, BUFSIZ*BUFSIZ, fptr); ! fputs(buffer, stdout); ! #else ! char ch; ! ch = getc(fptr); ! if (ch == '>') { ! ch = getc(fptr); ! if (ch != ' ') { ! ungetc(ch, fptr); ! ungetc('>', fptr); ! fgets(buffer, BUFSIZ*BUFSIZ, fptr); ! fputs(buffer, stdout); ! } else { ! printf( "> " ); ! } ! } else { ! ungetc(ch, fptr); ! fgets(buffer, BUFSIZ*BUFSIZ, fptr); ! fputs(buffer, stdout); ! } ! #endif ! } ! #endif ! ! } if (argc<=4 && inptr) fclose(inptr); --- 155,169 ---- obuf.attach(server.get_handle()); ostream out(&obuf); char buffer[BUFSIZ*BUFSIZ]; while(!in.eof() && in.good()) { in.read(buffer, BUFSIZ*BUFSIZ); if (!in.eof() || in.gcount()) out.write(buffer, in.gcount()); } out.flush(); ! } else ! cerr << "comterp: unable to open file: " << argv[4] << "\n"; if (argc<=4 && inptr) fclose(inptr); *************** *** 213,219 **** return 0; } ! #endif if (server_flag || remote_flag) { ComTerpServ* terp = new ComTerpServ(BUFSIZ*BUFSIZ); --- 173,179 ---- return 0; } ! #endif /* defined(HAVE_ACE) */ if (server_flag || remote_flag) { ComTerpServ* terp = new ComTerpServ(BUFSIZ*BUFSIZ); Index: OverlayUnidraw/ovcomps.c diff -c OverlayUnidraw/ovcomps.c:1.1 OverlayUnidraw/ovcomps.c:1.2 *** OverlayUnidraw/ovcomps.c:1.1 Tue Jan 18 03:10:44 2000 --- src/OverlayUnidraw/ovcomps.c Sat Mar 18 02:04:36 2000 *************** *** 82,87 **** --- 82,89 ---- /*****************************************************************************/ + int OverlayComp::_symid = -1; + ParamList* OverlayComp::_overlay_comp_params = nil; OverlayComp::OverlayComp (Graphic* g, OverlayComp* parent) : GraphicComp(g) *************** *** 353,359 **** cerr << "breadth search not yet unsupported\n"; return nil; } else if (up) { ! cerr << "upward search not yet unsupported\n"; return nil; } else if (last) { cerr << "search for last value not yet unsupported\n"; --- 355,361 ---- cerr << "breadth search not yet unsupported\n"; return nil; } else if (up) { ! if (GetParent()) return ((OverlayComp*)GetParent())->FindValue(symid, last, breadth, down, up); return nil; } else if (last) { cerr << "search for last value not yet unsupported\n"; *************** *** 1125,1132 **** cerr << "breadth search not yet unsupported\n"; return nil; } else if (up) { ! cerr << "upward search not yet unsupported\n"; ! return nil; } else if (last) { cerr << "search for last value not yet unsupported\n"; return nil; --- 1127,1139 ---- cerr << "breadth search not yet unsupported\n"; return nil; } else if (up) { ! if (AttributeList* al = attrlist()) { ! AttributeValue* av = al->find(symid); ! if (av) return av; ! } ! return GetParent() ! ? ((OverlayComp*)GetParent())->FindValue(symid, last, breadth, down, up) ! : nil; } else if (last) { cerr << "search for last value not yet unsupported\n"; return nil; Index: OverlayUnidraw/ovcomps.h diff -c OverlayUnidraw/ovcomps.h:1.2 OverlayUnidraw/ovcomps.h:1.3 *** OverlayUnidraw/ovcomps.h:1.2 Tue Feb 15 04:57:49 2000 --- src/OverlayUnidraw/ovcomps.h Sat Mar 18 02:04:37 2000 *************** *** 171,176 **** --- 171,178 ---- friend OverlayScript; friend OverlaysScript; + + CLASS_SYMID("OverlayComp"); }; //: composite component, clone of GraphicComps derived from OverlayComp Index: OverlayUnidraw/ovkit.h diff -c OverlayUnidraw/ovkit.h:1.2 OverlayUnidraw/ovkit.h:1.3 *** OverlayUnidraw/ovkit.h:1.2 Tue Mar 14 23:18:59 2000 --- src/OverlayUnidraw/ovkit.h Sat Mar 18 02:04:37 2000 *************** *** 181,186 **** --- 181,190 ---- // set possible alternate X display string for constructing viewer. // Not yet working. + boolean& set_button_flag() { return _set_button_flag; } + // flag to add setr button to text editor + boolean& clr_button_flag() { return _clr_button_flag; } + // flag to add clear button to text editor protected: Glyph* MenuLine(PSBrush*); // create line to put in a pulldown menu. *************** *** 200,216 **** const char* otherdisplay(); // returns string that might specify an alternate X display. - boolean& set_button_flag() { return _set_button_flag; } - // flag to add setr button to text editor - boolean& clr_button_flag() { return _clr_button_flag; } - // flag to add clear button to text editor protected: OverlayEditor* _ed; Deck* _toolbars; Patch* _toolbar; char* _otherdisplay; - boolean _set_button_flag; boolean _clr_button_flag; --- 204,215 ---- Index: ComUnidraw/grfunc.c diff -c ComUnidraw/grfunc.c:1.4 ComUnidraw/grfunc.c:1.5 *** ComUnidraw/grfunc.c:1.4 Tue Mar 14 23:19:01 2000 --- src/ComUnidraw/grfunc.c Sat Mar 18 02:04:39 2000 *************** *** 118,124 **** Unref(rel); RectOvComp* comp = new RectOvComp(rect); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(_compview_id, new ComponentView(comp)); push_stack(compval); } else push_stack(ComValue::nullval()); --- 118,125 ---- Unref(rel); RectOvComp* comp = new RectOvComp(rect); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(symbol_add("RectComp"), new ComponentView(comp)); ! compval.object_compview(true); push_stack(compval); } else push_stack(ComValue::nullval()); *************** *** 180,186 **** Unref(rel); ArrowLineOvComp* comp = new ArrowLineOvComp(line); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(_compview_id, new ComponentView(comp)); push_stack(compval); } else push_stack(ComValue::nullval()); --- 181,188 ---- Unref(rel); ArrowLineOvComp* comp = new ArrowLineOvComp(line); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(symbol_add("ArrowLineComp"), new ComponentView(comp)); ! compval.object_compview(true); push_stack(compval); } else push_stack(ComValue::nullval()); *************** *** 241,247 **** Unref(rel); EllipseOvComp* comp = new EllipseOvComp(ellipse); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(_compview_id, new ComponentView(comp)); push_stack(compval); } else push_stack(ComValue::nullval()); --- 243,250 ---- Unref(rel); EllipseOvComp* comp = new EllipseOvComp(ellipse); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(symbol_add("EllipseComp"), new ComponentView(comp)); ! compval.object_compview(true); push_stack(compval); } else push_stack(ComValue::nullval()); *************** *** 303,309 **** text->Translate(args[x0], args[y0]); TextOvComp* comp = new TextOvComp(text); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(_compview_id, new ComponentView(comp)); push_stack(compval); } else push_stack(ComValue::nullval()); --- 306,313 ---- text->Translate(args[x0], args[y0]); TextOvComp* comp = new TextOvComp(text); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(symbol_add("TextComp"), new ComponentView(comp)); ! compval.object_compview(true); push_stack(compval); } else push_stack(ComValue::nullval()); *************** *** 366,372 **** Unref(rel); ArrowMultiLineOvComp* comp = new ArrowMultiLineOvComp(multiline); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(_compview_id, new ComponentView(comp)); push_stack(compval); } else push_stack(ComValue::nullval()); --- 370,377 ---- Unref(rel); ArrowMultiLineOvComp* comp = new ArrowMultiLineOvComp(multiline); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(symbol_add("ArrowMultiLineComp"), new ComponentView(comp)); ! compval.object_compview(true); push_stack(compval); } else push_stack(ComValue::nullval()); *************** *** 429,435 **** Unref(rel); ArrowSplineOvComp* comp = new ArrowSplineOvComp(openspline); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(_compview_id, new ComponentView(comp)); push_stack(compval); } else push_stack(ComValue::nullval()); --- 434,441 ---- Unref(rel); ArrowSplineOvComp* comp = new ArrowSplineOvComp(openspline); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(symbol_add("ArrowSplineComp"), new ComponentView(comp)); ! compval.object_compview(true); push_stack(compval); } else push_stack(ComValue::nullval()); *************** *** 490,496 **** Unref(rel); PolygonOvComp* comp = new PolygonOvComp(polygon); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(_compview_id, new ComponentView(comp)); push_stack(compval); } else push_stack(ComValue::nullval()); --- 496,503 ---- Unref(rel); PolygonOvComp* comp = new PolygonOvComp(polygon); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(symbol_add("PolygonComp"), new ComponentView(comp)); ! compval.object_compview(true); push_stack(compval); } else push_stack(ComValue::nullval()); *************** *** 552,558 **** Unref(rel); ClosedSplineOvComp* comp = new ClosedSplineOvComp(closedspline); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(_compview_id, new ComponentView(comp)); push_stack(compval); } else push_stack(ComValue::nullval()); --- 559,566 ---- Unref(rel); ClosedSplineOvComp* comp = new ClosedSplineOvComp(closedspline); cmd = new PasteCmd(_ed, new Clipboard(comp)); ! ComValue compval(symbol_add("ClosedSplineComp"), new ComponentView(comp)); ! compval.object_compview(true); push_stack(compval); } else push_stack(ComValue::nullval()); *************** *** 672,678 **** GraphicView* subgv = gv->GetView(i); newSel->Append(subgv); GraphicComp* comp = subgv->GetGraphicComp(); ! ComValue* compval = new ComValue(_compview_id, new ComponentView(comp)); avl->Append(compval); } --- 680,687 ---- GraphicView* subgv = gv->GetView(i); newSel->Append(subgv); GraphicComp* comp = subgv->GetGraphicComp(); ! ComValue* compval = new ComValue(symbol_add("Component"), new ComponentView(comp)); ! compval->object_compview(true); avl->Append(compval); } *************** *** 682,690 **** for (sel->First(i); !sel->Done(i); sel->Next(i)) { GraphicView* grview = sel->GetView(i); Component* comp = grview ? grview->GetSubject() : nil; ! ComValue* compval = comp ? new ComValue(_compview_id, new ComponentView(comp)) : nil; ! if (compval) avl->Append(compval); delete newSel; newSel = nil; } --- 691,702 ---- for (sel->First(i); !sel->Done(i); sel->Next(i)) { GraphicView* grview = sel->GetView(i); Component* comp = grview ? grview->GetSubject() : nil; ! ComValue* compval = comp ? new ComValue(symbol_add("Component"), new ComponentView(comp)) : nil; ! ! if (compval) { ! compval->object_compview(true); avl->Append(compval); + } delete newSel; newSel = nil; } *************** *** 698,704 **** OverlayComp* comp = (OverlayComp*)comview->GetSubject(); if (comp) { newSel->Append(comp->FindView(viewer)); ! ComValue* compval = new ComValue(_compview_id, new ComponentView(comp)); avl->Append(compval); } } --- 710,717 ---- OverlayComp* comp = (OverlayComp*)comview->GetSubject(); if (comp) { newSel->Append(comp->FindView(viewer)); ! ComValue* compval = new ComValue(symbol_add("Component"), new ComponentView(comp)); ! compval->object_compview(true); avl->Append(compval); } } Index: ComUnidraw/unifunc.c diff -c ComUnidraw/unifunc.c:1.2 ComUnidraw/unifunc.c:1.3 *** ComUnidraw/unifunc.c:1.2 Fri Mar 10 23:42:09 2000 --- src/ComUnidraw/unifunc.c Sat Mar 18 02:04:39 2000 *************** *** 1,5 **** /* ! * Copyright (c) 1994-1998 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided --- 1,5 ---- /* ! * Copyright (c) 1994-2000 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided *************** *** 207,223 **** if (!pathnamev.is_array()) { if (nargs()==1) { if (cmd = import(pathnamev.string_ptr())) { ! ComValue compval(_compview_id, new ComponentView(cmd->component())); push_stack(compval); } else push_stack(ComValue::nullval()); } else { for (int i=0; i<nargs(); i++) if (cmd = import(stack_arg(i).string_ptr())) { ! ComValue compval(_compview_id, new ComponentView(cmd->component())); push_stack(compval); } else push_stack(ComValue::nullval()); } --- 207,226 ---- if (!pathnamev.is_array()) { if (nargs()==1) { if (cmd = import(pathnamev.string_ptr())) { ! ComValue compval(symbol_add("Component"), new ComponentView(cmd->component())); + compval.object_compview(true); push_stack(compval); } else push_stack(ComValue::nullval()); } else { for (int i=0; i<nargs(); i++) if (cmd = import(stack_arg(i).string_ptr())) { ! ComValue compval(symbol_add("Component"), new ComponentView(cmd->component())); + compval.object_compview(true); push_stack(compval); + } else push_stack(ComValue::nullval()); } *************** *** 228,235 **** inlist->First(it); while(!inlist->Done(it)) { cmd = import(inlist->GetAttrVal(it)->string_ptr()); ! outlist->Append(new ComValue(_compview_id, ! new ComponentView(cmd->component()))); inlist->Next(it); } } --- 231,240 ---- inlist->First(it); while(!inlist->Done(it)) { cmd = import(inlist->GetAttrVal(it)->string_ptr()); ! ComValue* val = new ComValue(symbol_add("Component"), ! new ComponentView(cmd->component())); ! val->object_compview(true); ! outlist->Append(val); inlist->Next(it); } } *** /dev/null Sat Mar 18 02:04:54 PST 2000 --- patches/ivtools-000318-johnston-032 *************** patches/ivtools-000318-johnston-032 *** 0 **** --- 1 ---- + ivtools-000318-johnston-032 |
From: <ivt...@li...> - 2000-03-14 19:46:41
|
Patch: ivtools-000314-johnston-031 For: ivtools-0.8.1 Author: joh...@us... Subject: comma-separated one-line list output with braces, text interpreter in comdraw GUI Requires: This is an intermediate patch to ivtools-0.8.1. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - change comterp list output (what gets printed when a list is returned on the stack) to use "," instead of "\n" and surround the entire list with "{" and "}". Now you can see the difference between lists of length 1 and scalars. - copy/move capability for text editor with interpreter from FrameUnidraw to OverlayUnidraw, and make use of it in comdraw. Index: ComTerp/comvalue.c diff -c ComTerp/comvalue.c:1.7 ComTerp/comvalue.c:1.8 *** ComTerp/comvalue.c:1.7 Mon Feb 28 17:32:39 2000 --- src/ComTerp/comvalue.c Tue Mar 14 23:18:42 2000 *************** *** 258,268 **** avl->First(i); boolean first = true; while (!avl->Done(i)) { ComValue val(*avl->GetAttrVal(i)); out << val; avl->Next(i); ! if (!avl->Done(i)) out << "\n"; } } else { out << "array of length " << svp->array_len(); ALIterator i; --- 258,273 ---- avl->First(i); boolean first = true; while (!avl->Done(i)) { + if (first) { + out << "{"; + first = false; + } ComValue val(*avl->GetAttrVal(i)); out << val; avl->Next(i); ! if (!avl->Done(i)) out << ","; } + if (!first) out << "}\n"; } else { out << "array of length " << svp->array_len(); ALIterator i; Index: OverlayUnidraw/oved.c diff -c OverlayUnidraw/oved.c:1.1 OverlayUnidraw/oved.c:1.2 *** OverlayUnidraw/oved.c:1.1 Tue Jan 18 03:10:45 2000 --- src/OverlayUnidraw/oved.c Tue Mar 14 23:18:58 2000 *************** *** 39,44 **** --- 39,45 ---- #include <OverlayUnidraw/ovviewer.h> #include <IVGlyph/observables.h> + #include <IVGlyph/textedit.h> #include <UniIdraw/idcmds.h> #include <UniIdraw/idkybd.h> *************** *** 75,80 **** --- 76,83 ---- #include <stdlib.h> #include <string.h> + implementActionCallback(OverlayEditor) + /*****************************************************************************/ inline void InsertSeparator (PulldownMenu* pdm) { *************** *** 385,387 **** --- 388,410 ---- delete cmd; } } + + void OverlayEditor::SetText() { + GraphicComp* comp = GetFrame()->GetGraphicComp(); + ((OverlayComp*)comp)->SetAnnotation(TextEditor()->text()); + ((ModifStatusVar*)GetState("ModifStatusVar"))->SetModifStatus(true); + } + + void OverlayEditor::ClearText() { + _texteditor->text(""); + } + + void OverlayEditor::UpdateText(OverlayComp* comp, boolean update) { + if (_texteditor) { + const char* txt = comp->GetAnnotation(); + if (!txt) + txt = ""; + _texteditor->text(txt, update); + } + } + Index: OverlayUnidraw/oved.h diff -c OverlayUnidraw/oved.h:1.2 OverlayUnidraw/oved.h:1.3 *** OverlayUnidraw/oved.h:1.2 Wed Feb 23 04:27:51 2000 --- src/OverlayUnidraw/oved.h Tue Mar 14 23:18:59 2000 *************** *** 40,45 **** --- 40,46 ---- class Editor; class GraphicView; class Grid; + class EivTextEditor; class ObservableText; class OverlayComp; class OverlayPanner; *************** *** 161,166 **** --- 162,177 ---- // indirect command execution for distributed whiteboard mechanism. // actual mechanism implemented in ComEditor. + void SetText(); + // set contents of text-editor. + void ClearText(); + // clear contents of text-editor. + + EivTextEditor* TextEditor() { return _texteditor; } + // return pointer to text-editor that holds current frame annotation. + void UpdateText(OverlayComp*, boolean update =true); + // update contents of text-editor with frame annotation. + protected: void Init(OverlayComp* = nil, const char* = "OverlayEditor"); // construct empty component tree if necessary, and pass to *************** *** 175,190 **** --- 186,213 ---- int panner_align(); // handle -panner_align or -pal command line argument. + virtual ComTerpServ* GetComTerp() { return nil; } + // return nil because this is not a ComEditor. + virtual ComTerpServ* comterp() { return nil; } + // return nil because this is not a ComEditor. + virtual void SetComTerp(ComTerpServ* terp) { } + // do nothing because this is not a ComEditor + virtual void comterp(ComTerpServ* terp) { } + // do nothing because this is not a ComEditor + protected: OverlayKit* _overlay_kit; Tool* _curtool; ObservableText* _mousedoc; PtrLocState* _ptrlocstate; + EivTextEditor* _texteditor; static AttributeList* _edlauncherlist; static AttributeList* _comterplist; friend OverlayKit; }; + + declareActionCallback(OverlayEditor) inline ObservableText* OverlayEditor::MouseDocObservable() { return _mousedoc; } Index: OverlayUnidraw/ovkit.c diff -c OverlayUnidraw/ovkit.c:1.2 OverlayUnidraw/ovkit.c:1.3 *** OverlayUnidraw/ovkit.c:1.2 Wed Feb 2 03:09:59 2000 --- src/OverlayUnidraw/ovkit.c Tue Mar 14 23:18:59 2000 *************** *** 66,71 **** --- 66,72 ---- #include <OverlayUnidraw/slctbyattr.h> #include <ComGlyph/attrdialog.h> + #include <ComGlyph/comtextedit.h> #include <IVGlyph/exportchooser.h> #include <IVGlyph/saveaschooser.h> *************** *** 192,197 **** --- 193,200 ---- WidgetKit& kit = *WidgetKit::instance(); _ed = nil; _otherdisplay = nil; + _set_button_flag = false; + _clr_button_flag = false; } OverlayKit::~OverlayKit() { *************** *** 266,277 **** } void OverlayKit::InitLayout(const char* name) { Catalog* catalog = unidraw->GetCatalog(); const char* stripped_string = catalog->GetAttribute("stripped"); boolean stripped_flag = stripped_string ? strcmp(stripped_string, "true")==0 : false; ! if (_ed->GetWindow() == nil) { ! TextObserver* mousedoc_observer = new TextObserver(_ed->MouseDocObservable(), ""); const LayoutKit& lk = *LayoutKit::instance(); WidgetKit& wk = *WidgetKit::instance(); PolyGlyph* topbox = lk.vbox(); --- 269,285 ---- } void OverlayKit::InitLayout(const char* name) { + InitLayout(this, name); + } + + void OverlayKit::InitLayout(OverlayKit* kit, const char* name) { + OverlayEditor* ed = kit->GetEditor(); Catalog* catalog = unidraw->GetCatalog(); const char* stripped_string = catalog->GetAttribute("stripped"); boolean stripped_flag = stripped_string ? strcmp(stripped_string, "true")==0 : false; ! if (ed->GetWindow() == nil) { ! TextObserver* mousedoc_observer = new TextObserver(ed->MouseDocObservable(), ""); const LayoutKit& lk = *LayoutKit::instance(); WidgetKit& wk = *WidgetKit::instance(); PolyGlyph* topbox = lk.vbox(); *************** *** 279,297 **** if (stripped_flag) { Target* viewer = ! new Target(new Frame(Interior()), TargetPrimitiveHit); ! _ed->body(viewer); ! topbox->append(_ed); } else { ! Glyph* menus = MakeMenus(); ! Glyph* states = MakeStates(); ! Glyph* toolbar = MakeToolbar(); if (states) menus->append(states); Target* viewer = ! new Target(new Frame(Interior()), TargetPrimitiveHit); if (const char* toolbarloca = catalog->GetAttribute("toolbarloc")) { if (strcmp(toolbarloca, "r") == 0) toolbar->prepend(lk.vcenter(viewer)); --- 287,305 ---- if (stripped_flag) { Target* viewer = ! new Target(new Frame(ed->Interior()), TargetPrimitiveHit); ! ed->body(viewer); ! topbox->append(ed); } else { ! Glyph* menus = kit->MakeMenus(); ! Glyph* states = kit->MakeStates(); ! Glyph* toolbar = kit->MakeToolbar(); if (states) menus->append(states); Target* viewer = ! new Target(new Frame(ed->Interior()), TargetPrimitiveHit); if (const char* toolbarloca = catalog->GetAttribute("toolbarloc")) { if (strcmp(toolbarloca, "r") == 0) toolbar->prepend(lk.vcenter(viewer)); *************** *** 301,308 **** toolbar->append(lk.vcenter(viewer)); menus->append(toolbar); ! _ed->body(menus); ! topbox->append(_ed); topbox->append( wk.outset_frame( lk.hbox( --- 309,316 ---- toolbar->append(lk.vcenter(viewer)); menus->append(toolbar); ! ed->body(menus); ! topbox->append(ed); topbox->append( wk.outset_frame( lk.hbox( *************** *** 311,320 **** ) ); } ! _ed->GetKeyMap()->Execute(CODE_SELECT); ! ManagedWindow* w = new ApplicationWindow(topbox, _otherdisplay); ! _ed->SetWindow(w); Style* s = new Style(Session::instance()->style()); s->alias(name); w->style(s); --- 319,400 ---- ) ); } + + + ed->GetKeyMap()->Execute(CODE_SELECT); + + if (ed->comterp()) { + boolean set_flag = kit->_set_button_flag; + boolean clr_flag = kit->_clr_button_flag; + EivTextEditor* texteditor = nil; + if(!set_flag && !clr_flag) { + texteditor = new ComTextEditor(wk.style(), ed->comterp()); + } + else + texteditor = new EivTextEditor(wk.style()); + ed->_texteditor = texteditor; + Button* set = set_flag ? wk.push_button("Set", new ActionCallback(OverlayEditor)( + (OverlayEditor*)ed, &OverlayEditor::SetText + )) : nil; + Button* clear = clr_flag ? wk.push_button("Clear", new ActionCallback(OverlayEditor)( + (OverlayEditor*)ed, &OverlayEditor::ClearText + )) : nil; + Glyph* buttonbox = nil; + if (set && !clear) { + buttonbox = + lk.vbox( + lk.hcenter(set)); + } else if (!set && clear) { + buttonbox = + lk.vbox( + lk.hcenter(clear)); + } else if (set && clear) { + buttonbox = + lk.vbox( + lk.hcenter(set), + lk.vspace(10), + lk.hcenter(clear) + ); + } + if (buttonbox) { + topbox->append( + wk.outset_frame( + lk.hbox( + lk.vcenter( + lk.margin( + buttonbox, + 10 + ) + ), + lk.vcenter(texteditor) + ) + ) + ); + } else { + topbox->append( + wk.outset_frame( + lk.hbox( + lk.vcenter( + lk.margin( + lk.vbox( + wk.label("type help"), + lk.vspace(10), + wk.label("to print"), + lk.vspace(10), + wk.label("info to stdout") + ), + 10 + ) + ), + lk.vcenter(texteditor) + ) + ) + ); + } + } ! ManagedWindow* w = new ApplicationWindow(topbox, kit->_otherdisplay); ! ed->SetWindow(w); Style* s = new Style(Session::instance()->style()); s->alias(name); w->style(s); Index: OverlayUnidraw/ovkit.h diff -c OverlayUnidraw/ovkit.h:1.1 OverlayUnidraw/ovkit.h:1.2 *** OverlayUnidraw/ovkit.h:1.1 Tue Jan 18 03:10:49 2000 --- src/OverlayUnidraw/ovkit.h Tue Mar 14 23:18:59 2000 *************** *** 102,107 **** --- 102,109 ---- // initialize viewer to go with the editor. virtual void InitLayout(const char* name); // initialize chrome that goes around the viewer. + static void InitLayout(OverlayKit* kit, const char* name); + // static method that implements virtual method. virtual Glyph* MakeMenus(); // make all the pull-down menus and their menu bar. *************** *** 198,209 **** --- 200,218 ---- const char* otherdisplay(); // returns string that might specify an alternate X display. + boolean& set_button_flag() { return _set_button_flag; } + // flag to add setr button to text editor + boolean& clr_button_flag() { return _clr_button_flag; } + // flag to add clear button to text editor protected: OverlayEditor* _ed; Deck* _toolbars; Patch* _toolbar; char* _otherdisplay; + + boolean _set_button_flag; + boolean _clr_button_flag; protected: static OverlayKit* _overlaykit; Index: ComUnidraw/comeditor.h diff -c ComUnidraw/comeditor.h:1.2 ComUnidraw/comeditor.h:1.3 *** ComUnidraw/comeditor.h:1.2 Sat Feb 26 03:07:50 2000 --- src/ComUnidraw/comeditor.h Tue Mar 14 23:19:01 2000 *************** *** 47,59 **** // method for adding ComFunc objects to the ComTerp associated with // this ComEditor. ! ComTerpServ* GetComTerp() { return _terp;} // return pointer to associated ComTerp (always a ComTerpServ). ! ComTerpServ* comterp() { return _terp;} // return pointer to associated ComTerp (always a ComTerpServ). ! void SetComTerp(ComTerpServ* terp) { _terp = terp;} // set pointer to associated ComTerp (always a ComTerpServ). ! void comterp(ComTerpServ* terp) { _terp = terp;} // set pointer to associated ComTerp (always a ComTerpServ). virtual void ExecuteCmd(Command* cmd); --- 47,59 ---- // method for adding ComFunc objects to the ComTerp associated with // this ComEditor. ! virtual ComTerpServ* GetComTerp() { return _terp;} // return pointer to associated ComTerp (always a ComTerpServ). ! virtual ComTerpServ* comterp() { return _terp;} // return pointer to associated ComTerp (always a ComTerpServ). ! virtual void SetComTerp(ComTerpServ* terp) { _terp = terp;} // set pointer to associated ComTerp (always a ComTerpServ). ! virtual void comterp(ComTerpServ* terp) { _terp = terp;} // set pointer to associated ComTerp (always a ComTerpServ). virtual void ExecuteCmd(Command* cmd); Index: ComUnidraw/grfunc.c diff -c ComUnidraw/grfunc.c:1.3 ComUnidraw/grfunc.c:1.4 *** ComUnidraw/grfunc.c:1.3 Fri Mar 10 23:42:09 2000 --- src/ComUnidraw/grfunc.c Tue Mar 14 23:19:01 2000 *************** *** 685,690 **** --- 685,692 ---- ComValue* compval = comp ? new ComValue(_compview_id, new ComponentView(comp)) : nil; if (compval) avl->Append(compval); + delete newSel; + newSel = nil; } } else { *************** *** 703,712 **** } } ! delete sel; ! _ed->SetSelection(newSel); ! newSel->Update(); ! unidraw->Update(); reset_stack(); ComValue retval(avl); push_stack(retval); --- 705,716 ---- } } ! if (newSel){ ! delete sel; ! _ed->SetSelection(newSel); ! newSel->Update(); ! unidraw->Update(); ! } reset_stack(); ComValue retval(avl); push_stack(retval); Index: FrameUnidraw/frameeditor.c diff -c FrameUnidraw/frameeditor.c:1.3 FrameUnidraw/frameeditor.c:1.4 *** FrameUnidraw/frameeditor.c:1.3 Thu Mar 9 02:17:02 2000 --- src/FrameUnidraw/frameeditor.c Tue Mar 14 23:19:02 2000 *************** *** 170,194 **** if (frameliststate()) frameliststate()->framenumber(views->Index(last)+1); } - void FrameEditor::SetText() { - GraphicComp* comp = GetFrame()->GetGraphicComp(); - ((OverlayComp*)comp)->SetAnnotation(TextEditor()->text()); - ((ModifStatusVar*)GetState("ModifStatusVar"))->SetModifStatus(true); - } - - void FrameEditor::ClearText() { - _texteditor->text(""); - } - - void FrameEditor::UpdateText(OverlayComp* comp, boolean update) { - if (_texteditor) { - const char* txt = comp->GetAnnotation(); - if (!txt) - txt = ""; - _texteditor->text(txt, update); - } - } - OverlaysView* FrameEditor::GetFrame(int index) { if (index<0) return _currframe; --- 170,175 ---- Index: FrameUnidraw/frameeditor.h diff -c FrameUnidraw/frameeditor.h:1.2 FrameUnidraw/frameeditor.h:1.3 *** FrameUnidraw/frameeditor.h:1.2 Wed Feb 23 04:27:54 2000 --- src/FrameUnidraw/frameeditor.h Tue Mar 14 23:19:03 2000 *************** *** 57,71 **** virtual void InitCommands(); // execute Unidraw commands as needed after FrameEditor is constructed. - EivTextEditor* TextEditor() { return _texteditor; } - // return pointer to text-editor that holds current frame annotation. - void SetText(); - // set contents of text-editor as frame annotation. - void ClearText(); - // clear contents of text-editor. - void UpdateText(OverlayComp*, boolean update =true); - // update contents of text-editor with frame annotation. - void SetFrame(FrameView* f) { _prevframe = _currframe;_currframe = f; } // set current frame. virtual OverlaysView* GetFrame(int index=-1); --- 57,62 ---- *************** *** 97,103 **** FrameView* _prevframe; FrameNumberState* _framenumstate; FrameListState* _frameliststate; - EivTextEditor* _texteditor; int _curr_other; int _prev_other; boolean _autonewframe; --- 88,93 ---- Index: FrameUnidraw/framekit.c diff -c FrameUnidraw/framekit.c:1.4 FrameUnidraw/framekit.c:1.5 *** FrameUnidraw/framekit.c:1.4 Mon Feb 28 17:33:16 2000 --- src/FrameUnidraw/framekit.c Tue Mar 14 23:19:03 2000 *************** *** 97,104 **** FrameKit* FrameKit::_framekit = nil; FrameKit::FrameKit () { - _set_button_flag = false; - _clr_button_flag = false; } FrameKit* FrameKit::Instance() { --- 97,102 ---- *************** *** 181,188 **** ed->GetKeyMap()->Execute(CODE_SELECT); topbox->append(ed); if (!bookgeom) { ! boolean set_flag = ((FrameKit*)kit)->_set_button_flag; ! boolean clr_flag = ((FrameKit*)kit)->_clr_button_flag; EivTextEditor* texteditor = nil; if(!set_flag && !clr_flag) { texteditor = new ComTextEditor(wk.style(), ed->comterp()); --- 179,186 ---- ed->GetKeyMap()->Execute(CODE_SELECT); topbox->append(ed); if (!bookgeom) { ! boolean set_flag = kit->set_button_flag(); ! boolean clr_flag = kit->clr_button_flag(); EivTextEditor* texteditor = nil; if(!set_flag && !clr_flag) { texteditor = new ComTextEditor(wk.style(), ed->comterp()); Index: FrameUnidraw/framekit.h diff -c FrameUnidraw/framekit.h:1.2 FrameUnidraw/framekit.h:1.3 *** FrameUnidraw/framekit.h:1.2 Sat Feb 26 03:07:52 2000 --- src/FrameUnidraw/framekit.h Tue Mar 14 23:19:03 2000 *************** *** 55,62 **** static FrameKit* Instance(); protected: static FrameKit* _framekit; - boolean _set_button_flag; - boolean _clr_button_flag; }; #include <InterViews/action.h> --- 55,60 ---- *** /dev/null Tue Mar 14 23:19:16 PST 2000 --- patches/ivtools-000314-johnston-031 *************** patches/ivtools-000314-johnston-031 *** 0 **** --- 1 ---- + ivtools-000314-johnston-031 |
From: <ivt...@li...> - 2000-03-10 22:07:25
|
Patch: ivtools-000310-johnston-030 For: ivtools-0.8.1 Author: joh...@us... Subject: new dot (".") command for comdraw, :all for select command. This is an intermediate patch to ivtools-0.8.1. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - Add a new version of a dot (".") func to comdraw, one that accesses the AttributeList of a graphical component. This allows for easy set/get access to the attributes of graphics in a drawing editor. - Change default behavior of comdraw select func to return list of graphics in current selection. Implement the :all feature as well. This is a non-backward compatible change for anyone who has relied on the undocumented way the select func has behaved up until now (which was the same as :all behavior should have been). Index: top_ivtools/MANIFEST diff -c top_ivtools/MANIFEST:1.4 top_ivtools/MANIFEST:1.5 *** top_ivtools/MANIFEST:1.4 Thu Mar 9 02:27:11 2000 --- ./MANIFEST Fri Mar 10 23:41:28 2000 *************** *** 191,196 **** --- 191,198 ---- ivtools-0.8/src/ComUnidraw/comterp-acehandler.h ivtools-0.8/src/ComUnidraw/comterp-iohandler.c ivtools-0.8/src/ComUnidraw/comterp-iohandler.h + ivtools-0.8/src/ComUnidraw/grdotfunc.c + ivtools-0.8/src/ComUnidraw/grdotfunc.h ivtools-0.8/src/ComUnidraw/grfunc.c ivtools-0.8/src/ComUnidraw/grfunc.h ivtools-0.8/src/ComUnidraw/grstatfunc.c Index: top_ivtools/MANIFEST.perceps diff -c top_ivtools/MANIFEST.perceps:1.2 top_ivtools/MANIFEST.perceps:1.3 *** top_ivtools/MANIFEST.perceps:1.2 Mon Feb 28 17:32:35 2000 --- ./MANIFEST.perceps Fri Mar 10 23:41:28 2000 *************** *** 46,51 **** --- 46,52 ---- ComUnidraw/comeditor.h ComUnidraw/comterp-acehandler.h ComUnidraw/comterp-iohandler.h + ComUnidraw/grdotfunc.h ComUnidraw/grfunc.h ComUnidraw/grstatfunc.h ComUnidraw/nfunc.h Index: src_ivtools/Imakefile diff -c src_ivtools/Imakefile:1.1 src_ivtools/Imakefile:1.2 *** src_ivtools/Imakefile:1.1 Tue Jan 18 03:06:47 2000 --- src/Imakefile Fri Mar 10 23:41:31 2000 *************** *** 56,63 **** UniIdraw \ idraw \ \ - $(ACEDISPATCH) \ OverlayUnidraw \ drawtool \ \ $(IUEDIRS) \ --- 56,63 ---- UniIdraw \ idraw \ \ OverlayUnidraw \ + $(ACEDISPATCH) \ drawtool \ \ $(IUEDIRS) \ Index: ComTerp/dotfunc.c diff -c ComTerp/dotfunc.c:1.4 ComTerp/dotfunc.c:1.5 *** ComTerp/dotfunc.c:1.4 Mon Feb 21 20:48:41 2000 --- src/ComTerp/dotfunc.c Fri Mar 10 23:41:35 2000 *************** *** 42,48 **** reset_stack(); if (!before_part.is_symbol() && !(before_part.is_attribute() && ! ((Attribute*)before_part.obj_val())->Value()->is_attributelist())) { cerr << "expression before \".\" needs to evaluate to a symbol or <AttributeList>\n"; return; } --- 42,49 ---- reset_stack(); if (!before_part.is_symbol() && !(before_part.is_attribute() && ! ((Attribute*)before_part.obj_val())->Value()->is_attributelist()) && ! !before_part.is_attributelist()) { cerr << "expression before \".\" needs to evaluate to a symbol or <AttributeList>\n"; return; } *************** *** 54,60 **** /* lookup value of before variable */ void* vptr = nil; AttributeList* al = nil; ! if (!before_part.is_attribute()) { int before_symid = before_part.symbol_val(); comterp()->localtable()->find(vptr, before_symid); if (vptr &&((ComValue*) vptr)->class_symid() == AttributeList::class_symid()) { --- 55,61 ---- /* lookup value of before variable */ void* vptr = nil; AttributeList* al = nil; ! if (!before_part.is_attribute() && !before_part.is_attributelist()) { int before_symid = before_part.symbol_val(); comterp()->localtable()->find(vptr, before_symid); if (vptr &&((ComValue*) vptr)->class_symid() == AttributeList::class_symid()) { *************** *** 65,75 **** ComValue* comval = new ComValue(AttributeList::class_symid(), (void*)al); comterp()->localtable()->insert(before_symid, comval); } ! } else al = (AttributeList*) ((Attribute*) before_part.obj_val())->Value()->obj_val(); int after_symid = after_part.symbol_val(); ! Attribute* attr = al->GetAttr(after_symid); if (!attr) { attr = new Attribute(after_symid, new AttributeValue()); al->add_attribute(attr); --- 66,78 ---- ComValue* comval = new ComValue(AttributeList::class_symid(), (void*)al); comterp()->localtable()->insert(before_symid, comval); } ! } else if (!before_part.is_attributelist()) al = (AttributeList*) ((Attribute*) before_part.obj_val())->Value()->obj_val(); + else + al = (AttributeList*) before_part.obj_val(); int after_symid = after_part.symbol_val(); ! Attribute* attr = al ? al->GetAttr(after_symid) : nil; if (!attr) { attr = new Attribute(after_symid, new AttributeValue()); al->add_attribute(attr); Index: ComUnidraw/Imakefile diff -c ComUnidraw/Imakefile:1.1 ComUnidraw/Imakefile:1.2 *** ComUnidraw/Imakefile:1.1 Tue Jan 18 03:11:05 2000 --- src/ComUnidraw/Imakefile Fri Mar 10 23:42:09 2000 *************** *** 17,22 **** --- 17,23 ---- #define Obj26(file) MakeObjectFromSrcFlags(file,) + Obj26(grdotfunc) Obj26(grfunc) Obj26(grstatfunc) Obj26(comeditor) Index: ComUnidraw/comeditor.c diff -c ComUnidraw/comeditor.c:1.1 ComUnidraw/comeditor.c:1.2 *** ComUnidraw/comeditor.c:1.1 Tue Jan 18 03:11:05 2000 --- src/ComUnidraw/comeditor.c Fri Mar 10 23:42:09 2000 *************** *** 1,4 **** --- 1,5 ---- /* + * Copyright (c) 2000 IET Inc. * Copyright (c) 1994-1999 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and *************** *** 21,26 **** --- 22,28 ---- * */ + #include <ComUnidraw/grdotfunc.h> #include <ComUnidraw/grfunc.h> #include <ComUnidraw/grstatfunc.h> #include <ComUnidraw/comeditor.h> *************** *** 173,178 **** --- 175,182 ---- comterp->add_command("barplot", new BarPlotFunc(comterp, this)); comterp->add_command("import", new ImportFunc(comterp, this)); + + comterp->add_command("dot", new GrDotFunc(comterp)); } /* virtual */ void ComEditor::ExecuteCmd(Command* cmd) { Index: ComUnidraw/grdotfunc.c diff -c /dev/null ComUnidraw/grdotfunc.c:1.1 *** /dev/null Fri Mar 10 23:42:10 2000 --- src/ComUnidraw/grdotfunc.c Fri Mar 10 23:42:09 2000 *************** *** 0 **** --- 1,68 ---- + /* + * Copyright (c) 2000 IET Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + + #include <ComUnidraw/grdotfunc.h> + #include <OverlayUnidraw/ovcomps.h> + #include <Unidraw/Components/compview.h> + #include <ComTerp/comvalue.h> + #include <ComTerp/comterp.h> + #include <Attribute/attrlist.h> + #include <Attribute/attribute.h> + + #define TITLE "GrDotFunc" + + /*****************************************************************************/ + + int GrDotFunc::_symid = -1; + + GrDotFunc::GrDotFunc(ComTerp* comterp) : DotFunc(comterp) { + } + + void GrDotFunc::execute() { + static int ComponentView_symid = symbol_add("ComponentView"); + + ComValue& before_part(stack_arg(0, true)); + ComValue& after_part(stack_arg(1, true)); + if (!before_part.is_symbol() && + !(before_part.is_attribute() && ((Attribute*)before_part.obj_val())->Value()->is_attributelist()) && + !(before_part.is_object(ComponentView_symid))) { + cerr << "expression before \".\" needs to evaluate to a symbol or <AttributeList> or <ComponentView>\n"; + return; + } + if (!after_part.is_symbol()) { + cerr << "expression after \".\" needs to be a symbol or evaluate to a syymbol\n"; + return; + } + + /* handle ComponentView case */ + if (before_part.is_symbol()) + lookup_symval(before_part); + if (before_part.is_object(ComponentView_symid)) { + ComponentView* compview = (ComponentView*)before_part.obj_val(); + OverlayComp* comp = (OverlayComp*)compview->GetSubject(); + ComValue stuffval(AttributeList::class_symid(), (void*)comp->GetAttributeList()); + before_part.assignval(stuffval); + } + DotFunc::execute(); + + } Index: ComUnidraw/grdotfunc.h diff -c /dev/null ComUnidraw/grdotfunc.h:1.1 *** /dev/null Fri Mar 10 23:42:10 2000 --- src/ComUnidraw/grdotfunc.h Fri Mar 10 23:42:09 2000 *************** *** 0 **** --- 1,46 ---- + /* + * Copyright (c) 2000 IET Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of the copyright holders not be used in + * advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The copyright holders make + * no representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING + * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + + /* + * dot func for componentviews + */ + + #if !defined(_grdotfunc_h) + #define _grdotfunc_h + + #include <ComTerp/dotfunc.h> + + //: . (dot) operator, for compound variables, and access to ComponentView AttributeList's. + class GrDotFunc : public DotFunc { + public: + GrDotFunc(ComTerp*); + + virtual void execute(); + virtual const char* docstring() { + return ". makes compound variables, and gives access to ComponentView AttributeList's."; } + + CLASS_SYMID("GrDotFunc"); + }; + + #endif /* !defined(_grdotfunc_h) */ + Index: ComUnidraw/grfunc.c diff -c ComUnidraw/grfunc.c:1.2 ComUnidraw/grfunc.c:1.3 *** ComUnidraw/grfunc.c:1.2 Mon Feb 28 17:33:13 2000 --- src/ComUnidraw/grfunc.c Fri Mar 10 23:42:09 2000 *************** *** 43,48 **** --- 43,49 ---- #include <Unidraw/catalog.h> #include <Unidraw/clipboard.h> #include <Unidraw/editor.h> + #include <Unidraw/selection.h> #include <Unidraw/statevars.h> #include <Unidraw/unidraw.h> *************** *** 653,665 **** } void SelectFunc::execute() { ! Selection* s = _ed->GetSelection(); ! delete s; OverlaySelection* newSel = new OverlaySelection(); Viewer* viewer = _ed->GetViewer(); AttributeValueList* avl = new AttributeValueList(); ! if (nargs()==0) { GraphicView* gv = ((OverlayEditor*)_ed)->GetFrame(); Iterator i; --- 654,669 ---- } void SelectFunc::execute() { ! static int all_symid = symbol_add("all"); ! ComValue all_flagv(stack_key(all_symid)); ! boolean all_flag = all_flagv.is_true(); ! ! Selection* sel = _ed->GetViewer()->GetSelection(); OverlaySelection* newSel = new OverlaySelection(); Viewer* viewer = _ed->GetViewer(); AttributeValueList* avl = new AttributeValueList(); ! if (all_flag) { GraphicView* gv = ((OverlayEditor*)_ed)->GetFrame(); Iterator i; *************** *** 672,677 **** --- 676,692 ---- avl->Append(compval); } + } if (nargs()==0) { + Iterator i; + int count=0; + for (sel->First(i); !sel->Done(i); sel->Next(i)) { + GraphicView* grview = sel->GetView(i); + Component* comp = grview ? grview->GetSubject() : nil; + ComValue* compval = comp ? new ComValue(_compview_id, new ComponentView(comp)) : nil; + if (compval) + avl->Append(compval); + } + } else { for (int i=0; i<nargsfixed(); i++) { *************** *** 688,693 **** --- 703,709 ---- } } + delete sel; _ed->SetSelection(newSel); newSel->Update(); unidraw->Update(); Index: ComUnidraw/grfunc.h diff -c ComUnidraw/grfunc.h:1.1 ComUnidraw/grfunc.h:1.2 *** ComUnidraw/grfunc.h:1.1 Tue Jan 18 03:11:07 2000 --- src/ComUnidraw/grfunc.h Fri Mar 10 23:42:09 2000 *************** *** 151,163 **** }; //: command to select graphics in comdraw. ! // select([compview ...]) -- make these graphics the current selection (dflt is all) class SelectFunc : public UnidrawFunc { public: SelectFunc(ComTerp*,Editor*); virtual void execute(); virtual const char* docstring() { ! return "%s([compview ...]) -- make these graphics the current selection (dflt is all)"; } }; //: command to move current selection in comdraw --- 151,164 ---- }; //: command to select graphics in comdraw. ! // select([compview ...] :all) -- make these graphics the current selection, ! // default returns current selection. class SelectFunc : public UnidrawFunc { public: SelectFunc(ComTerp*,Editor*); virtual void execute(); virtual const char* docstring() { ! return "%s([compview ...] :all) -- make these graphics the current selection (dflt is current)"; } }; //: command to move current selection in comdraw Index: ComUnidraw/unifunc.c diff -c ComUnidraw/unifunc.c:1.1 ComUnidraw/unifunc.c:1.2 *** ComUnidraw/unifunc.c:1.1 Tue Jan 18 03:11:08 2000 --- src/ComUnidraw/unifunc.c Fri Mar 10 23:42:09 2000 *************** *** 53,59 **** UnidrawFunc::UnidrawFunc(ComTerp* comterp, Editor* ed) : ComFunc(comterp) { _ed = ed; if (_compview_id<0) ! _compview_id = symbol_add("CompView"); } void UnidrawFunc::execute_log(Command* cmd) { --- 53,59 ---- UnidrawFunc::UnidrawFunc(ComTerp* comterp, Editor* ed) : ComFunc(comterp) { _ed = ed; if (_compview_id<0) ! _compview_id = symbol_add("ComponentView"); } void UnidrawFunc::execute_log(Command* cmd) { Index: include_std/version.h diff -c include_std/version.h:1.2 include_std/version.h:1.3 *** include_std/version.h:1.2 Thu Mar 9 02:17:11 2000 --- src/include/ivstd/version.h Fri Mar 10 23:42:23 2000 *************** *** 1,3 **** ! #define IvtoolsVersion 0.8 #define VersionString "0.8.1" #define ReleaseString "ivtools-0.8.1" --- 1,3 ---- ! #define IvtoolsVersion 0.8.1 #define VersionString "0.8.1" #define ReleaseString "ivtools-0.8.1" *** /dev/null Fri Mar 10 23:42:33 PST 2000 --- patches/ivtools-000310-johnston-030 *************** patches/ivtools-000310-johnston-030 *** 0 **** --- 1 ---- + ivtools-000310-johnston-030 |
From: <ivt...@li...> - 2000-03-09 18:48:58
|
Patch: ivtools-000309-johnston-029 For: ivtools-0.8 Author: joh...@us... This is an intermediate patch to ivtools-0.8. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - bring it up to 0.8.1 Index: top_ivtools/CHANGES diff -c top_ivtools/CHANGES:1.1 top_ivtools/CHANGES:1.2 *** top_ivtools/CHANGES:1.1 Tue Jan 18 03:06:43 2000 --- ./CHANGES Thu Mar 9 02:16:29 2000 *************** *** 1,3 **** --- 1,232 ---- + March 9th 2000 ivtools-0.8.1 + + Interpreter Changes + + * Add the "." (dot) operator to comterp, to allow for compound + variables (i.e. "a.b"). They can be used on the right-hand or + left-hand side of an assignment operator, and used pretty much + anywhere a symbol can be used. + + The first operand is either a symbol to assign an AttributeList + to, or an expression that evaluates to an AttributeList. The + second operand is always a symbol. They can be concatenated + (i.e. "a.b.c"). + + * create a list func that initializes an empty list object. + + * extended the print func to invoke the ostream ComValue "<<" + operator if it only has one argument. + + * add new symval command to returns the symbol value instead of + looking up the value of that symbol in the variable tables. + + + * documented acos, asin, and atan as returning radians, + and cos, sin, tan as taking radians. + + * created autoframe command in flipbook command + interpreter, and synched it with the "Auto New Frame" checkbox + on the Frame pulldown menu. So now you can set/reset this + feature from either the GUI or interpreter, and the GUI + reflects the state. + + * settle on "dotname" for the command that returns the name of + a name/value attribute pair. This is because "." (dot) is the + operator used to create attribute list objects in the comterp + command interpreter. Normally most attribute objects are + automatically indirected to the attribute value when finally + applied, but in this command overrides that and returns the + symbol which is the attribute name. + + + * enable the command interpreter in the text editor panel at + the bottom of the flipbook user interface. + + * copy anything but the last line in the interpreter text + buffer to the end of the buffer before executing -- like shell + mode in emacs. + + Library Changes + + -- Attribute -- + + * migrate macro for declaring symbol-table based class ids to + one place -- Attribute/_comutil.h. Rename it CLASS_SYMID + (from classid). + + * AttributeList::add_attr fix. + + * new twist to the classid stuff. Now classid() gets defined + as a virtual function along with static methods for + class_name() and class_symid() when you add the CLASS_SYMID + macro (<Attribute/_comutil.h>) to a class definition. This + was used for identifying derived ComFunc's, ComFunc's that + have a func symbol id as well, but might vary with + internationalization or other custom changes to the + interpreter. But the symbol id of the class name itself + doesn't change. + + -- ComUtil -- + + * modify lexical scanner to preserve token state between invocations. + This fixes a problem with multi-line comments when comterp is + in server (when comterp is receiving input strings one at a + time from an external source). However, this does not fix the + problem with multi-line strings when comterp is in server + mode, which will require a better solution for preserving more + of the token state (i.e. the partial token buffer) between + invocations. This is also a necessary step in preserving + parallel use of one lexical scanner by more than one comterp + in the same program. + + -- ComTerp -- + + * fix a problem in server-mode comterp. Part of making + server-mode work was figuring out how to return from the + depths of the lexical scanner in the middle of an expression, + when an expression continues across multiple-lines, but the + capability to retrieve a new line (or string) is external to + the parser/scanner. To make this work I made up the + convention that if the input function (the function pointer + with an fgets signature passed to the parser/scanner C + routines) returns a null string (a string that begins with + '\000'), return out of the scanner and parser, yet assume + there is more to come. When that function + (ComTerpServ::s_fgets) was going to return the null string, it + still traversed the entire input buffer, which is huge by + default. + + * compress some code by making use of the new + ComValue::is_object(int classid) method to test both whether + something has a generic void* pointer for its value, and + whether it has a known matching classid (based on a id in a + symbol table for that kind of object). + + * migrate ComValue::geta() to AttributeValue::geta(). This is + the method that returns a void* to an ObjectType if the + classid matches. Work for every object but ComFunc's and + AttributeValueList's, which have their own types (CommandType + and ArrayType). + + -- IVGlyph -- + + * new Dialog methods to support stay-up dialog boxes that + don't block events being handled by the main application: + + void map_for(Window*); + virtual void map_for_aligned(Window*, float xalign, float yalign); + void map_at(Coord x, Coord y); + virtual void map_at_aligned( + Coord x, Coord y, float xalign, float yalign + ); + void unmap(); + boolean mapped(); + + These are an alternate to the pre-existing Dialog::post_* methods, + which map the dialog box to the screen then enter their own event + handling loop (the run() method), then unmap the dialog box when + done. + + With this new approach you call one of the Dialog::map_* methods + to bring up the dialog box, and control returns to the normal + event-handling loop of the main application. The action taken + when a Close or OK button has to be different with this new + approach. Instead of setting a flag that causes the local run + loop to terminate, you need to explicitly call Dialog::unmap. + + Dialog::unmapped is provided as a way to test if the dialog is + currently displayed. Repeated calls to Dialog::map_* are ok, + because the first thing these methods do is check if already + mapped, and if so they do nothing. + + * create a new ObsTextDialog that uses the new Dialog::map_* + methods (IVGlyph/odialogs.[ch]). + + * store the symbol id for a given ComFunc in a new _funcid member + variable. + + * create a ComTerp::eval_expr method that takes an array of fully + code-converted ComValue's ready to be executed. + + * so that a ComFunc execute method can ask ComTerp to invoke a + certain ComFunc on the subsequent symbol to be encountered after + the ComFunc execute method returns (ComTerp::func_for_next_sym()). + + * modify the various func of symbolfunc.c to generate scalar or + vector results depending on whether there is a single or multiple + argument. Affected are symbol, symid, and symvar. + + * add mechanism to ComTerp to pass values to the next expression + (ComTerp::val_for_next_func) and invoke a func on the next symbol + (ComTerp::func_for_next_sym). This allows for the stringing + together of stand-alone expressions interspersed by keywords that + lack parenthization. + + * add ComValue constructor that takes a ComFunc* directly and + makes something of CommandType. + + * derive ComGlyph's ComTextEditor and ComTE_View from + IVGlyph's EivTextEditor and TE_View. This adds an interactive + command interpreter capability to the text editor object, + where the user can enter expressions and see results computed. + While a command history plus anything else goes to stdout, the + results follow just the expression, so it is sometimes easier + to keep track of the commands you're using. All of stdout + could be rerouted to the texteditor window in the future. + vhclmaps vhclviewer is the first place in the source tree + where this capability is exposed for now. Check it out. + + -- OverlayUnidraw -- + + * the GraphicLoc tool to use the new ObsTextDialog box. Now the + GraphicLoc dialog box can stay up between uses of the tool, and + each new click refreshes the displayed text. + + -- FrameUnidraw -- + + * generalize the "select" command of comdraw to work in the + interpreter of flipbook and anything derived from flipbook, by + using the OverlayEditor::GetFrame() virtual method, which + hides the fact whether a multi-frame system is in place or + not. + + Miscellaneous and Config Changes + + * change the default behavior of make with no arguments to be + the same as "make World" the first time it used. So now + ivtools can build out of the box with the ubiquitous + "./configure;make" + + * add --enable-install-subdir argument to ./configure. This + allows a user to install in /usr/local/lib/ivtools and + /usr/local/bin/ivtools if they want (/usr/local can be changed + with --prefix). + + * change src/scripts/mkdirhier.sh to work with new versions of + mkdir that no longer accept multiple arguments. + + * pare down the various config/site.def.$CPU files to the + things actually used/required. Take out all definitions + now provided by the ./configure script. + + * patches submitted by Gregor Zych to compile ivtools-0.8 with + frozen Debian Potato. The first patch adds a function + definition that is disabled by default. Someone would need to + change the #if clause to correctly test for the Debian 2.2 + release. This was the only thing that didn't compile smoothly + on RedHat 5.1. + + * give variable names to all the constructor arguments in + Attribute/attrvalue.h and ComTerp/comvalue.h, to improve the + PERCEPS extracted web page. + + * change signature of accept() used in utils/sockets.cc to use + an unsigned instead of signed int* as the third argument. + This seems to be more the recent standard. + + - format bug in ComValue::ULongType ostream output. + + January 18th 2000 ivtools-0.8 Drawing Editor Changes Index: top_ivtools/INSTALL diff -c top_ivtools/INSTALL:1.4 top_ivtools/INSTALL:1.5 *** top_ivtools/INSTALL:1.4 Thu Jan 27 01:51:21 2000 --- ./INSTALL Thu Mar 9 02:16:29 2000 *************** *** 1,7 **** INSTALL for ivtools-0.8 ! Instructions for building ivtools-0.8 from source: 0. Compilation Environment --- 1,7 ---- INSTALL for ivtools-0.8 ! Instructions for building ivtools-0.8.1 from source: 0. Compilation Environment Index: top_ivtools/README diff -c top_ivtools/README:1.2 top_ivtools/README:1.3 *** top_ivtools/README:1.2 Tue Jan 18 21:58:16 2000 --- ./README Thu Mar 9 02:16:30 2000 *************** *** 2,8 **** README for ivtools 0.8 ! This directory contains a release of ivtools 0.8 from Vectaport Inc.. You should read the rest of this file for information on what ivtools is and the INSTALL file for instructions on how to build it. --- 2,8 ---- README for ivtools 0.8 ! This directory contains a release of ivtools 0.8.1 from Vectaport Inc.. You should read the rest of this file for information on what ivtools is and the INSTALL file for instructions on how to build it. Index: top_ivtools/VERSION diff -c top_ivtools/VERSION:1.1 top_ivtools/VERSION:1.2 *** top_ivtools/VERSION:1.1 Tue Jan 18 03:06:44 2000 --- ./VERSION Thu Mar 9 02:16:30 2000 *************** *** 1 **** ! Release 0.8 --- 1 ---- ! Release 0.8.1 Index: top_ivtools/configure diff -c top_ivtools/configure:1.2 top_ivtools/configure:1.3 *** top_ivtools/configure:1.2 Sat Jan 22 02:29:50 2000 --- ./configure Thu Mar 9 02:16:30 2000 *************** *** 1953,1958 **** echo writing \"CPU = `make CPU`\" echo CPU = `make CPU` >>config/config.mk echo ! echo "now do a \"make World\"" echo --- 1953,1958 ---- echo writing \"CPU = `make CPU`\" echo CPU = `make CPU` >>config/config.mk echo ! echo "now do a \"make\"" echo Index: top_ivtools/configure.in diff -c top_ivtools/configure.in:1.2 top_ivtools/configure.in:1.3 *** top_ivtools/configure.in:1.2 Sat Jan 22 02:29:50 2000 --- ./configure.in Thu Mar 9 02:16:30 2000 *************** *** 363,368 **** echo writing \"CPU = `make CPU`\" echo CPU = `make CPU` >>config/config.mk echo ! echo "now do a \"make World\"" echo --- 363,368 ---- echo writing \"CPU = `make CPU`\" echo CPU = `make CPU` >>config/config.mk echo ! echo "now do a \"make\"" echo Index: FrameUnidraw/frameeditor.c diff -c FrameUnidraw/frameeditor.c:1.2 FrameUnidraw/frameeditor.c:1.3 *** FrameUnidraw/frameeditor.c:1.2 Wed Feb 23 04:27:54 2000 --- src/FrameUnidraw/frameeditor.c Thu Mar 9 02:17:02 2000 *************** *** 207,213 **** ComEditor::AddCommands(comterp); comterp->add_command("moveframe", new MoveFrameFunc(comterp, this)); comterp->add_command("createframe", new CreateFrameFunc(comterp, this)); ! comterp->add_command("autonewframe", new AutoNewFrameFunc(comterp, this)); } void FrameEditor::DoAutoNewFrame() { --- 207,213 ---- ComEditor::AddCommands(comterp); comterp->add_command("moveframe", new MoveFrameFunc(comterp, this)); comterp->add_command("createframe", new CreateFrameFunc(comterp, this)); ! comterp->add_command("autoframe", new AutoNewFrameFunc(comterp, this)); } void FrameEditor::DoAutoNewFrame() { Index: include_std/version.h diff -c include_std/version.h:1.1 include_std/version.h:1.2 *** include_std/version.h:1.1 Tue Jan 18 03:13:20 2000 --- src/include/ivstd/version.h Thu Mar 9 02:17:11 2000 *************** *** 1,3 **** #define IvtoolsVersion 0.8 ! #define VersionString "0.8" ! #define ReleaseString "ivtools-0.8" --- 1,3 ---- #define IvtoolsVersion 0.8 ! #define VersionString "0.8.1" ! #define ReleaseString "ivtools-0.8.1" Index: config_ivtools/params.def diff -c config_ivtools/params.def:1.1 config_ivtools/params.def:1.2 *** config_ivtools/params.def:1.1 Tue Jan 18 03:14:42 2000 --- config/params.def Thu Mar 9 02:17:18 2000 *************** *** 36,42 **** * VersionNumber */ #ifndef Version ! #define Version 0.8 #endif VERSION = Version --- 36,42 ---- * VersionNumber */ #ifndef Version ! #define Version 0.8.1 #endif VERSION = Version *** /dev/null Thu Mar 9 02:17:21 PST 2000 --- patches/ivtools-000309-johnston-029 *************** patches/ivtools-000309-johnston-029 *** 0 **** --- 1 ---- + ivtools-000309-johnston-029 |
From: <ivt...@li...> - 2000-02-29 01:40:20
|
Patch: ivtools-000228-johnston-028 For: ivtools-0.8 Author: joh...@us... This is an intermediate patch to ivtools-0.8. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - enable the command interpreter in the text editor panel at the bottom of the flipbook user interface. - copy anything but the last line in the interpreter text buffer to the end of the buffer before executing -- like shell mode in emacs. - generalize the "select" command of comdraw to work in the interpreter of flipbook and anything derived from flipbook, by using the OverlayEditor::GetFrame() virtual method, which hides the fact whether a multi-frame system is in place or not. - format bug in ComValue::ULongType ostream output. Index: top_ivtools/MANIFEST diff -c top_ivtools/MANIFEST:1.2 top_ivtools/MANIFEST:1.3 *** top_ivtools/MANIFEST:1.2 Sat Feb 26 03:07:22 2000 --- ./MANIFEST Mon Feb 28 17:32:34 2000 *************** *** 59,66 **** ivtools-0.8/config/alpha3.2-gcc.mk ivtools-0.8/config/alpha4-gcc.mk ivtools-0.8/config/arch.def - ivtools-0.8/config/config.mk ivtools-0.8/config/config.defs.in ivtools-0.8/config/config.null.mk ivtools-0.8/config/default-gcc.mk ivtools-0.8/config/freebsd2.1-gcc.mk --- 59,66 ---- ivtools-0.8/config/alpha3.2-gcc.mk ivtools-0.8/config/alpha4-gcc.mk ivtools-0.8/config/arch.def ivtools-0.8/config/config.defs.in + ivtools-0.8/config/config.mk ivtools-0.8/config/config.null.mk ivtools-0.8/config/default-gcc.mk ivtools-0.8/config/freebsd2.1-gcc.mk *************** *** 417,422 **** --- 417,424 ---- ivtools-0.8/src/IVGlyph/namestate.h ivtools-0.8/src/IVGlyph/observables.c ivtools-0.8/src/IVGlyph/observables.h + ivtools-0.8/src/IVGlyph/odialogs.c + ivtools-0.8/src/IVGlyph/odialogs.h ivtools-0.8/src/IVGlyph/ofilechooser.c ivtools-0.8/src/IVGlyph/ofilechooser.h ivtools-0.8/src/IVGlyph/printchooser.c Index: top_ivtools/MANIFEST.perceps diff -c top_ivtools/MANIFEST.perceps:1.1 top_ivtools/MANIFEST.perceps:1.2 *** top_ivtools/MANIFEST.perceps:1.1 Tue Jan 18 03:06:44 2000 --- ./MANIFEST.perceps Mon Feb 28 17:32:35 2000 *************** *** 13,18 **** --- 13,20 ---- Attribute/lexscan.h Attribute/paramlist.h ComGlyph/attrdialog.h + ComGlyph/comtextedit.h + ComGlyph/comtextview.h ComGlyph/terpdialog.h ComTerp/_comterp.h ComTerp/_comutil.h *************** *** 26,31 **** --- 28,34 ---- ComTerp/comvalue.h ComTerp/condfunc.h ComTerp/ctrlfunc.h + ComTerp/dotfunc.h ComTerp/helpfunc.h ComTerp/iofunc.h ComTerp/lexscan.h *************** *** 100,105 **** --- 103,109 ---- IVGlyph/importchooser.h IVGlyph/namestate.h IVGlyph/observables.h + IVGlyph/odialogs.h IVGlyph/ofilechooser.h IVGlyph/printchooser.h IVGlyph/saveaschooser.h Index: ComTerp/comvalue.c diff -c ComTerp/comvalue.c:1.6 ComTerp/comvalue.c:1.7 *** ComTerp/comvalue.c:1.6 Mon Feb 21 20:48:41 2000 --- src/ComTerp/comvalue.c Mon Feb 28 17:32:39 2000 *************** *** 221,236 **** case ComValue::LongType: if (brief) ! out << svp->long_ref(); else out << "long( " << svp->long_ref() << " )"; break; case ComValue::ULongType: if (brief) ! out << "ulong( " << svp->ulong_ref() << " )"; else ! out << svp->ulong_ref(); break; case ComValue::FloatType: --- 221,236 ---- case ComValue::LongType: if (brief) ! out << svp->long_ref() << "L"; else out << "long( " << svp->long_ref() << " )"; break; case ComValue::ULongType: if (brief) ! out << svp->ulong_ref() << "L"; else ! out << "ulong( " << svp->ulong_ref() << " )"; break; case ComValue::FloatType: Index: ComGlyph/comtextview.c diff -c ComGlyph/comtextview.c:1.1 ComGlyph/comtextview.c:1.2 *** ComGlyph/comtextview.c:1.1 Sat Feb 26 03:07:46 2000 --- src/ComGlyph/comtextview.c Mon Feb 28 17:33:01 2000 *************** *** 140,145 **** --- 140,146 ---- void ComTE_View::newline() { + /* extract current line from text buffer */ beginning_of_line(); int mark = text_editor_->Dot(); end_of_line(); *************** *** 149,155 **** te_buffer_->Copy(mark, buffer, len); buffer[len] = '\0'; ! /* put newline in text editor */ insert_char('\n'); /* run this line through comterp */ --- 150,159 ---- te_buffer_->Copy(mark, buffer, len); buffer[len] = '\0'; ! /* if at the end of the buffer, just add a newline, otherwise, copy the whole line */ ! end_of_text(); ! if (dot != text_editor_->Dot()) ! insert_string(buffer, len); insert_char('\n'); /* run this line through comterp */ *************** *** 219,225 **** ostream* out = new strstream(); if (*comterp()->errmsg()) { *out << comterp()->errmsg() << "\n"; - cout << comterp()->errmsg() << "\n"; } else { if (status==0) { result.comterp(comterp()); --- 223,228 ---- Index: ComUnidraw/grfunc.c diff -c ComUnidraw/grfunc.c:1.1 ComUnidraw/grfunc.c:1.2 *** ComUnidraw/grfunc.c:1.1 Tue Jan 18 03:11:07 2000 --- src/ComUnidraw/grfunc.c Mon Feb 28 17:33:13 2000 *************** *** 27,32 **** --- 27,33 ---- #include <ComTerp/comterp.h> #include <OverlayUnidraw/ovarrow.h> + #include <OverlayUnidraw/oved.h> #include <OverlayUnidraw/ovcmds.h> #include <OverlayUnidraw/ovselection.h> #include <OverlayUnidraw/ovviewer.h> *************** *** 660,666 **** AttributeValueList* avl = new AttributeValueList(); if (nargs()==0) { ! GraphicView* gv = viewer->GetGraphicView(); Iterator i; int count=0; for (gv->First(i); !gv->Done(i); gv->Next(i)) { --- 661,667 ---- AttributeValueList* avl = new AttributeValueList(); if (nargs()==0) { ! GraphicView* gv = ((OverlayEditor*)_ed)->GetFrame(); Iterator i; int count=0; for (gv->First(i); !gv->Done(i); gv->Next(i)) { Index: FrameUnidraw/framekit.c diff -c FrameUnidraw/framekit.c:1.3 FrameUnidraw/framekit.c:1.4 *** FrameUnidraw/framekit.c:1.3 Sat Feb 26 03:07:52 2000 --- src/FrameUnidraw/framekit.c Mon Feb 28 17:33:16 2000 *************** *** 97,104 **** FrameKit* FrameKit::_framekit = nil; FrameKit::FrameKit () { ! _set_button_flag = true; ! _clr_button_flag = true; } FrameKit* FrameKit::Instance() { --- 97,104 ---- FrameKit* FrameKit::_framekit = nil; FrameKit::FrameKit () { ! _set_button_flag = false; ! _clr_button_flag = false; } FrameKit* FrameKit::Instance() { Index: FrameUnidraw/framestates.c diff -c FrameUnidraw/framestates.c:1.1 FrameUnidraw/framestates.c:1.2 *** FrameUnidraw/framestates.c:1.1 Tue Jan 18 03:11:17 2000 --- src/FrameUnidraw/framestates.c Mon Feb 28 17:33:16 2000 *************** *** 1,4 **** --- 1,5 ---- /* + * Copyright (c) 2000 IET Inc * Copyright (c) 1994, 1995 Vectaport Inc. * * Permission to use, copy, modify, distribute, and sell this software and *************** *** 22,27 **** --- 23,29 ---- */ #include <FrameUnidraw/framestates.h> + #include <Time/obstime.h> #include <InterViews/layout.h> #include <InterViews/patch.h> #include <IV-look/kit.h> *************** *** 36,43 **** _number = fn; _desc = strdup (desc ? desc : "Current Frame"); _usebg = usebg; if (_usebg && fn == 0) ! sprintf(buf, "%s: background", _desc); else sprintf(buf, "%s: %d", _desc, _number); name(buf, false); --- 38,46 ---- _number = fn; _desc = strdup (desc ? desc : "Current Frame"); _usebg = usebg; + _bgstr = nil; if (_usebg && fn == 0) ! sprintf(buf, "%s: %s", _desc, "background"); else sprintf(buf, "%s: %d", _desc, _number); name(buf, false); *************** *** 57,62 **** --- 60,72 ---- int FrameNumberState::framenumber() { return number(); } void FrameNumberState::framenumber(int fn, boolean notif) { number(fn, notif); } + + void FrameNumberState::set_bgstr(const char* str) { + if (_bgstr) delete _bgstr; + _bgstr = strdup(str); + if (_usebg && _number == 0) + sprintf(buf, "%s: %s", _desc, _bgstr); + } /*****************************************************************************/ Index: FrameUnidraw/framestates.h diff -c FrameUnidraw/framestates.h:1.1 FrameUnidraw/framestates.h:1.2 *** FrameUnidraw/framestates.h:1.1 Tue Jan 18 03:11:17 2000 --- src/FrameUnidraw/framestates.h Mon Feb 28 17:33:16 2000 *************** *** 25,30 **** --- 25,31 ---- #define framestates_h #include <IVGlyph/namestate.h> + #include <InterViews/observe.h> //: state variable for current-frame-number. class FrameNumberState : public NameState { *************** *** 34,47 **** int number(); void number(int, boolean notif =true); - // same as number methods int framenumber(); void framenumber(int, boolean notif =true); protected: int _number; char* _desc; char buf[256]; int _usebg; }; //: state variable for current-frame-count. --- 35,53 ---- int number(); void number(int, boolean notif =true); int framenumber(); + // same as number methods void framenumber(int, boolean notif =true); + // same as number methods + + void set_bgstr(const char*); + // set alternate string to represent "background" frame protected: int _number; char* _desc; char buf[256]; int _usebg; + char* _bgstr; }; //: state variable for current-frame-count. *** /dev/null Mon Feb 28 17:33:28 PST 2000 --- patches/ivtools-000228-johnston-028 *************** patches/ivtools-000228-johnston-028 *** 0 **** --- 1 ---- + ivtools-000228-johnston-028 |