"whiteboard and transparency experiments"
Brought to you by:
johnston
|
From: <ivt...@li...> - 2002-02-13 17:42:57
|
Patch: ivtools-020213-johnston-027
For: ivtools-1.0.1
Author: joh...@us...
Subject: whiteboard and transparency experiments
Requires:
This is an intermediate patch to ivtools-1.0.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:
- further work on comdraw whiteboard capability. Setting up for a
distributed drawing environment by ensuring that all graphics can be
constructed via command line instead of directly.
- instituted (then disabled) a transparent pixel capability. Needs an
API in comdraw or drawtool first.
Index: OverlayUnidraw/ovarrow.c
diff -c OverlayUnidraw/ovarrow.c:1.2 OverlayUnidraw/ovarrow.c:1.3
*** OverlayUnidraw/ovarrow.c:1.2 Thu Nov 29 07:39:20 2001
--- src/OverlayUnidraw/ovarrow.c Wed Feb 13 09:32:52 2002
***************
*** 765,771 ****
} else {
for (int i = 0; i < n;) {
for (int j=0; j < 10 && i < n; j++, i++) {
! out << "(" << x[i] << "," << y[i] << ")";
if (i+1 < n ) out << ",";
}
if (i+1 < n ) {
--- 765,774 ----
} else {
for (int i = 0; i < n;) {
for (int j=0; j < 10 && i < n; j++, i++) {
! if (ptlist_parens())
! out << "(" << x[i] << "," << y[i] << ")";
! else
! out << x[i] << "," << y[i];
if (i+1 < n ) out << ",";
}
if (i+1 < n ) {
***************
*** 1153,1159 ****
} else {
for (int i = 0; i < n; ) {
for (int j = 0; j < 10 && i < n; j++, i++) {
! out << "(" << x[i] << "," << y[i] << ")";
if (i+1 < n ) out << ",";
}
if (i+1 < n ) {
--- 1156,1165 ----
} else {
for (int i = 0; i < n; ) {
for (int j = 0; j < 10 && i < n; j++, i++) {
! if (ptlist_parens())
! out << "(" << x[i] << "," << y[i] << ")";
! else
! out << x[i] << "," << y[i];
if (i+1 < n ) out << ",";
}
if (i+1 < n ) {
Index: OverlayUnidraw/ovpainter.c
diff -c OverlayUnidraw/ovpainter.c:1.4 OverlayUnidraw/ovpainter.c:1.5
*** OverlayUnidraw/ovpainter.c:1.4 Wed Jan 30 14:12:08 2002
--- src/OverlayUnidraw/ovpainter.c Wed Feb 13 09:32:52 2002
***************
*** 1183,1189 ****
XSetGraphicsExposures(dpy, Rep()->fillgc, False);
int _ymin = c->pheight() - 1 - (ymin + pheight);
! if (r_r->alphaval()<1.0) {
/* WITH alpha-tranparency */
--- 1183,1191 ----
XSetGraphicsExposures(dpy, Rep()->fillgc, False);
int _ymin = c->pheight() - 1 - (ymin + pheight);
! boolean transparent_val = 0;
!
! if (r_r->alphaval()<1.0 || transparent_val) {
/* WITH alpha-tranparency */
***************
*** 1218,1230 ****
d.rep()->default_visual_->find_color(val2, xc2);
float alpha = r_r->alphaval();
float beta = 1.0 - alpha;
! short unsigned newred = (short unsigned)(xc1.red*alpha+xc2.red*beta);
! short unsigned newgreen = (short unsigned)(xc1.green*alpha+xc2.green*beta);
! short unsigned newblue = (short unsigned)(xc1.blue*alpha+xc2.blue*beta);
!
! XColor newcolor;
! d.rep()->default_visual_->find_color((short unsigned int)newred, (short unsigned int)newgreen, (short unsigned int)newblue, newcolor);
! XPutPixel(im1, i, j, newcolor.pixel);
}
}
--- 1220,1239 ----
d.rep()->default_visual_->find_color(val2, xc2);
float alpha = r_r->alphaval();
float beta = 1.0 - alpha;
! if (!(transparent_val &&
! xc1.red==0xffff &&
! xc1.green==0xffff &&
! xc1.blue==0xffff)) {
! unsigned short newred = (short unsigned)(xc1.red*alpha+xc2.red*beta);
! unsigned short newgreen = (short unsigned)(xc1.green*alpha+xc2.green*beta);
! unsigned short newblue = (short unsigned)(xc1.blue*alpha+xc2.blue*beta);
!
! XColor newcolor;
! d.rep()->default_visual_->find_color((short unsigned int)newred, (short unsigned int)newgreen, (short unsigned int)newblue, newcolor);
! XPutPixel(im1, i, j, newcolor.pixel);
! } else {
! XPutPixel(im1, i, j, xc2.pixel);
! }
}
}
Index: OverlayUnidraw/ovvertices.c
diff -c OverlayUnidraw/ovvertices.c:1.2 OverlayUnidraw/ovvertices.c:1.3
*** OverlayUnidraw/ovvertices.c:1.2 Wed Nov 14 16:41:55 2001
--- src/OverlayUnidraw/ovvertices.c Wed Feb 13 09:32:52 2002
***************
*** 215,221 ****
} else {
for (int i = 0; i < n; ) {
for (int j = 0; j < 10 && i < n; j++, i++) {
! out << "(" << x[i] << "," << y[i] << ")";
if (i+1 < n )
out << ",";
}
--- 215,224 ----
} else {
for (int i = 0; i < n; ) {
for (int j = 0; j < 10 && i < n; j++, i++) {
! if (ptlist_parens())
! out << "(" << x[i] << "," << y[i] << ")";
! else
! out << x[i] << "," << y[i];
if (i+1 < n )
out << ",";
}
Index: OverlayUnidraw/scriptview.c
diff -c OverlayUnidraw/scriptview.c:1.2 OverlayUnidraw/scriptview.c:1.3
*** OverlayUnidraw/scriptview.c:1.2 Wed Nov 14 16:41:55 2001
--- src/OverlayUnidraw/scriptview.c Wed Feb 13 09:32:52 2002
***************
*** 65,70 ****
--- 65,72 ----
/*****************************************************************************/
+ boolean OverlayScript::_ptlist_parens = true;
+
ClassId OverlayScript::GetClassId () { return OVERLAY_SCRIPT; }
boolean OverlayScript::IsA (ClassId id) {
Index: OverlayUnidraw/scriptview.h
diff -c OverlayUnidraw/scriptview.h:1.1 OverlayUnidraw/scriptview.h:1.2
*** OverlayUnidraw/scriptview.h:1.1 Fri Nov 2 13:07:03 2001
--- src/OverlayUnidraw/scriptview.h Wed Feb 13 09:32:52 2002
***************
*** 158,163 ****
--- 158,169 ----
static boolean skip_comp(istream& in);
// skip the text for the current component while de-serializing.
+ static boolean ptlist_parens() { return _ptlist_parens; }
+ // get flag that indicates putting parens around pointlist's
+
+ static void ptlist_parens(boolean flag) { _ptlist_parens = flag; }
+ // set flag that indicates putting parens around pointlist's
+
protected:
virtual void FillBg(ostream& out);
virtual void Brush(ostream& out);
***************
*** 177,182 ****
--- 183,190 ----
virtual void SetParent(ComponentView* child, ComponentView* parent);
OverlayScript* _parent;
+
+ static boolean _ptlist_parens;
};
//: composite version of OverlayScript.
Index: ComUnidraw/comeditor.c
diff -c ComUnidraw/comeditor.c:1.9 ComUnidraw/comeditor.c:1.10
*** ComUnidraw/comeditor.c:1.9 Thu Jan 31 10:20:46 2002
--- src/ComUnidraw/comeditor.c Wed Feb 13 09:32:55 2002
***************
*** 228,233 ****
--- 228,235 ----
OverlayEditor::ExecuteCmd(cmd);
else {
ostrstream sbuf;
+ boolean oldflag = OverlayScript::ptlist_parens();
+ OverlayScript::ptlist_parens(false);
switch (cmd->GetClassId()) {
case PASTE_CMD:
{
***************
*** 271,276 ****
--- 273,279 ----
}
break;
}
+ OverlayScript::ptlist_parens(oldflag);
}
}
*** /dev/null Wed Feb 13 09:33:01 PST 2002
--- patches/ivtools-020213-johnston-027
*************** patches/ivtools-020213-johnston-027
*** 0 ****
--- 1 ----
+ ivtools-020213-johnston-027
|