each schematic windows has its own "current later" (rectcolor)
This commit is contained in:
parent
4d26ce66a8
commit
17124c761c
|
|
@ -1103,7 +1103,7 @@ void descend_schematic(int instnumber)
|
|||
prepare_netlist_structs(0);
|
||||
if(enable_drill) drill_hilight();
|
||||
}
|
||||
dbg(1, "descend_schematic(): before zoom(): xctx->prep_hash_inst=%d\n", xctx->prep_hash_inst);
|
||||
dbg(1, "descend_schematic(): before zoom(): prep_hash_inst=%d\n", xctx->prep_hash_inst);
|
||||
zoom_full(1, 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -1366,7 +1366,7 @@ void zoom_full(int dr, int sel)
|
|||
xctx->xorigin=-boundbox.x1+(xctx->areaw-4*INT_WIDTH(xctx->lw))/40*xctx->zoom;
|
||||
xctx->yorigin=(xctx->areah-4*INT_WIDTH(xctx->lw))*xctx->zoom-boundbox.y2 -
|
||||
(xctx->areah-4*INT_WIDTH(xctx->lw))/40*xctx->zoom;
|
||||
dbg(1, "zoom_full(): xctx->areaw=%d, xctx->areah=%d\n", xctx->areaw, xctx->areah);
|
||||
dbg(1, "zoom_full(): areaw=%d, areah=%d\n", xctx->areaw, xctx->areah);
|
||||
|
||||
change_linewidth(-1.);
|
||||
if(dr)
|
||||
|
|
@ -1466,7 +1466,7 @@ void draw_stuff(void)
|
|||
view_unzoom(40);
|
||||
#ifndef STORE
|
||||
n /= (cadlayers - 4);
|
||||
for(rectcolor = 4; rectcolor < cadlayers; rectcolor++) {
|
||||
for(xctx->rectcolor = 4; xctx->rectcolor < cadlayers; xctx->rectcolor++) {
|
||||
#else
|
||||
#endif
|
||||
for(i = 0; i < n; i++)
|
||||
|
|
@ -1479,10 +1479,10 @@ void draw_stuff(void)
|
|||
y2=y1+h;
|
||||
ORDER(x1,y1,x2,y2);
|
||||
#ifdef STORE
|
||||
rectcolor = (int) (16.0*rand()/(RAND_MAX+1.0))+4;
|
||||
storeobject(-1, x1, y1, x2, y2, xRECT,rectcolor, 0, NULL);
|
||||
xctx->rectcolor = (int) (16.0*rand()/(RAND_MAX+1.0))+4;
|
||||
storeobject(-1, x1, y1, x2, y2, xRECT,xctx->rectcolor, 0, NULL);
|
||||
#else
|
||||
drawtemprect(gc[rectcolor], ADD, x1, y1, x2, y2);
|
||||
drawtemprect(gc[xctx->rectcolor], ADD, x1, y1, x2, y2);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -1496,10 +1496,10 @@ void draw_stuff(void)
|
|||
y2=y1+h;
|
||||
ORDER(x1,y1,x2,y2);
|
||||
#ifdef STORE
|
||||
rectcolor = (int) (16.0*rand()/(RAND_MAX+1.0))+4;
|
||||
storeobject(-1, x1, y1, x2, y2,xRECT,rectcolor, 0, NULL);
|
||||
xctx->rectcolor = (int) (16.0*rand()/(RAND_MAX+1.0))+4;
|
||||
storeobject(-1, x1, y1, x2, y2,xRECT,xctx->rectcolor, 0, NULL);
|
||||
#else
|
||||
drawtemprect(gc[rectcolor], ADD, x1, y1, x2, y2);
|
||||
drawtemprect(gc[xctx->rectcolor], ADD, x1, y1, x2, y2);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -1513,14 +1513,14 @@ void draw_stuff(void)
|
|||
y2=y1+h;
|
||||
RECTORDER(x1,y1,x2,y2);
|
||||
#ifdef STORE
|
||||
rectcolor = (int) (16.0*rand()/(RAND_MAX+1.0))+4;
|
||||
storeobject(-1, x1, y1, x2, y2,xRECT,rectcolor, 0, NULL);
|
||||
xctx->rectcolor = (int) (16.0*rand()/(RAND_MAX+1.0))+4;
|
||||
storeobject(-1, x1, y1, x2, y2,xRECT,xctx->rectcolor, 0, NULL);
|
||||
#else
|
||||
drawtemprect(gc[rectcolor], ADD, x1, y1, x2, y2);
|
||||
drawtemprect(gc[xctx->rectcolor], ADD, x1, y1, x2, y2);
|
||||
#endif
|
||||
}
|
||||
#ifndef STORE
|
||||
drawtemprect(gc[rectcolor], END, 0.0, 0.0, 0.0, 0.0);
|
||||
drawtemprect(gc[xctx->rectcolor], END, 0.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
#else
|
||||
draw();
|
||||
|
|
@ -1718,7 +1718,7 @@ void change_layer()
|
|||
y1 = xctx->line[c][n].y1;
|
||||
x2 = xctx->line[c][n].x2;
|
||||
y2 = xctx->line[c][n].y2;
|
||||
storeobject(-1, x1,y1,x2,y2,LINE,rectcolor, 0, xctx->line[c][n].prop_ptr);
|
||||
storeobject(-1, x1,y1,x2,y2,LINE,xctx->rectcolor, 0, xctx->line[c][n].prop_ptr);
|
||||
}
|
||||
if(type==ARC && xctx->arc[c][n].sel==SELECTED) {
|
||||
x1 = xctx->arc[c][n].x;
|
||||
|
|
@ -1726,18 +1726,18 @@ void change_layer()
|
|||
r = xctx->arc[c][n].r;
|
||||
a = xctx->arc[c][n].a;
|
||||
b = xctx->arc[c][n].b;
|
||||
store_arc(-1, x1, y1, r, a, b, rectcolor, 0, xctx->arc[c][n].prop_ptr);
|
||||
store_arc(-1, x1, y1, r, a, b, xctx->rectcolor, 0, xctx->arc[c][n].prop_ptr);
|
||||
}
|
||||
if(type==POLYGON && xctx->poly[c][n].sel==SELECTED) {
|
||||
store_poly(-1, xctx->poly[c][n].x, xctx->poly[c][n].y,
|
||||
xctx->poly[c][n].points, rectcolor, 0, xctx->poly[c][n].prop_ptr);
|
||||
xctx->poly[c][n].points, xctx->rectcolor, 0, xctx->poly[c][n].prop_ptr);
|
||||
}
|
||||
else if(type==xRECT && xctx->rect[c][n].sel==SELECTED) {
|
||||
x1 = xctx->rect[c][n].x1;
|
||||
y1 = xctx->rect[c][n].y1;
|
||||
x2 = xctx->rect[c][n].x2;
|
||||
y2 = xctx->rect[c][n].y2;
|
||||
storeobject(-1, x1,y1,x2,y2,xRECT,rectcolor, 0, xctx->rect[c][n].prop_ptr);
|
||||
storeobject(-1, x1,y1,x2,y2,xRECT,xctx->rectcolor, 0, xctx->rect[c][n].prop_ptr);
|
||||
}
|
||||
}
|
||||
if(xctx->lastsel) delete_only_rect_line_arc_poly();
|
||||
|
|
@ -1768,8 +1768,8 @@ void new_arc(int what, double sweep)
|
|||
if(xctx->nl_sweep_angle==360.) xctx->nl_b=360.;
|
||||
if(xctx->nl_r>0.) {
|
||||
push_undo();
|
||||
drawarc(rectcolor, NOW, xctx->nl_x, xctx->nl_y, xctx->nl_r, xctx->nl_a, xctx->nl_b, 0, 0);
|
||||
store_arc(-1, xctx->nl_x, xctx->nl_y, xctx->nl_r, xctx->nl_a, xctx->nl_b, rectcolor, 0, NULL);
|
||||
drawarc(xctx->rectcolor, NOW, xctx->nl_x, xctx->nl_y, xctx->nl_r, xctx->nl_a, xctx->nl_b, 0, 0);
|
||||
store_arc(-1, xctx->nl_x, xctx->nl_y, xctx->nl_r, xctx->nl_a, xctx->nl_b, xctx->rectcolor, 0, NULL);
|
||||
}
|
||||
xctx->ui_state &= ~STARTARC;
|
||||
xctx->nl_state=0;
|
||||
|
|
@ -1791,7 +1791,7 @@ void new_arc(int what, double sweep)
|
|||
arc_3_points(xctx->nl_x1, xctx->nl_y1, xctx->nl_x2, xctx->nl_y2,
|
||||
xctx->nl_x3, xctx->nl_y3, &xctx->nl_x, &xctx->nl_y, &xctx->nl_r, &xctx->nl_a, &xctx->nl_b);
|
||||
if(xctx->nl_sweep_angle==360.) xctx->nl_b=360.;
|
||||
if(xctx->nl_r>0.) drawtemparc(gc[rectcolor], NOW, xctx->nl_x, xctx->nl_y, xctx->nl_r, xctx->nl_a, xctx->nl_b);
|
||||
if(xctx->nl_r>0.) drawtemparc(gc[xctx->rectcolor], NOW, xctx->nl_x, xctx->nl_y, xctx->nl_r, xctx->nl_a, xctx->nl_b);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1808,37 +1808,37 @@ void new_line(int what)
|
|||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1);
|
||||
storeobject(-1, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1,LINE,rectcolor,0,NULL);
|
||||
drawline(rectcolor,NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1, 0);
|
||||
storeobject(-1, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1,LINE,xctx->rectcolor,0,NULL);
|
||||
drawline(xctx->rectcolor,NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1, 0);
|
||||
}
|
||||
if(xctx->nl_yy2!=xctx->nl_yy1) {
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
storeobject(-1, xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2,LINE,rectcolor,0,NULL);
|
||||
drawline(rectcolor,NOW, xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2, 0);
|
||||
storeobject(-1, xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2,LINE,xctx->rectcolor,0,NULL);
|
||||
drawline(xctx->rectcolor,NOW, xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2, 0);
|
||||
}
|
||||
} else if(manhattan_lines==2) {
|
||||
if(xctx->nl_yy2!=xctx->nl_yy1) {
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2);
|
||||
storeobject(-1, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2,LINE,rectcolor,0,NULL);
|
||||
drawline(rectcolor,NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2, 0);
|
||||
storeobject(-1, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2,LINE,xctx->rectcolor,0,NULL);
|
||||
drawline(xctx->rectcolor,NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2, 0);
|
||||
}
|
||||
if(xctx->nl_xx2!=xctx->nl_xx1) {
|
||||
xctx->nl_xx1=xctx->nl_x1;xctx->nl_yy1=xctx->nl_y1;
|
||||
xctx->nl_xx2=xctx->nl_x2;xctx->nl_yy2=xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2);
|
||||
storeobject(-1, xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2,LINE,rectcolor,0,NULL);
|
||||
drawline(rectcolor,NOW, xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2, 0);
|
||||
storeobject(-1, xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2,LINE,xctx->rectcolor,0,NULL);
|
||||
drawline(xctx->rectcolor,NOW, xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2, 0);
|
||||
}
|
||||
} else {
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
storeobject(-1, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2,LINE,rectcolor,0,NULL);
|
||||
drawline(rectcolor,NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2, 0);
|
||||
storeobject(-1, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2,LINE,xctx->rectcolor,0,NULL);
|
||||
drawline(xctx->rectcolor,NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2, 0);
|
||||
}
|
||||
}
|
||||
xctx->nl_x1=xctx->nl_x2=xctx->mousex_snap;xctx->nl_y1=xctx->nl_y2=xctx->mousey_snap;
|
||||
|
|
@ -1866,11 +1866,11 @@ void new_line(int what)
|
|||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1);
|
||||
drawtempline(gc[rectcolor], NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1);
|
||||
drawtempline(gc[xctx->rectcolor], NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1);
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
drawtempline(gc[rectcolor], NOW, xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
drawtempline(gc[xctx->rectcolor], NOW, xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
}
|
||||
} else if(manhattan_lines==2) {
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
|
|
@ -1887,11 +1887,11 @@ void new_line(int what)
|
|||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2);
|
||||
drawtempline(gc[rectcolor], NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2);
|
||||
drawtempline(gc[xctx->rectcolor], NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2);
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2);
|
||||
drawtempline(gc[rectcolor], NOW, xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2);
|
||||
drawtempline(gc[xctx->rectcolor], NOW, xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2);
|
||||
}
|
||||
} else {
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
|
|
@ -1904,7 +1904,7 @@ void new_line(int what)
|
|||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
drawtempline(gc[rectcolor], NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
drawtempline(gc[xctx->rectcolor], NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1919,13 +1919,13 @@ void new_rect(int what)
|
|||
int save_draw;
|
||||
RECTORDER(xctx->nl_x1,xctx->nl_y1,xctx->nl_x2,xctx->nl_y2);
|
||||
push_undo();
|
||||
drawrect(rectcolor, NOW, xctx->nl_x1,xctx->nl_y1,xctx->nl_x2,xctx->nl_y2, 0);
|
||||
drawrect(xctx->rectcolor, NOW, xctx->nl_x1,xctx->nl_y1,xctx->nl_x2,xctx->nl_y2, 0);
|
||||
save_draw = draw_window;
|
||||
draw_window = 1;
|
||||
/* draw fill pattern even in XCopyArea mode */
|
||||
filledrect(rectcolor, NOW, xctx->nl_x1,xctx->nl_y1,xctx->nl_x2,xctx->nl_y2);
|
||||
filledrect(xctx->rectcolor, NOW, xctx->nl_x1,xctx->nl_y1,xctx->nl_x2,xctx->nl_y2);
|
||||
draw_window = save_draw;
|
||||
storeobject(-1, xctx->nl_x1,xctx->nl_y1,xctx->nl_x2,xctx->nl_y2,xRECT,rectcolor, 0, NULL);
|
||||
storeobject(-1, xctx->nl_x1,xctx->nl_y1,xctx->nl_x2,xctx->nl_y2,xRECT,xctx->rectcolor, 0, NULL);
|
||||
}
|
||||
xctx->nl_x1=xctx->nl_x2=xctx->mousex_snap;xctx->nl_y1=xctx->nl_y2=xctx->mousey_snap;
|
||||
xctx->ui_state |= STARTRECT;
|
||||
|
|
@ -1942,7 +1942,7 @@ void new_rect(int what)
|
|||
xctx->nl_x2=xctx->mousex_snap;xctx->nl_y2=xctx->mousey_snap;
|
||||
xctx->nl_xx1=xctx->nl_x1;xctx->nl_yy1=xctx->nl_y1;xctx->nl_xx2=xctx->nl_x2;xctx->nl_yy2=xctx->nl_y2;
|
||||
RECTORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
drawtemprect(gc[rectcolor], NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
drawtemprect(gc[xctx->rectcolor], NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1958,7 +1958,7 @@ void new_polygon(int what)
|
|||
}
|
||||
if( what & PLACE )
|
||||
{
|
||||
/* fprintf(errfp, "new_poly: PLACE, xctx->nl_points=%d\n", xctx->nl_points); */
|
||||
/* fprintf(errfp, "new_poly: PLACE, nl_points=%d\n", xctx->nl_points); */
|
||||
xctx->nl_polyy[xctx->nl_points]=xctx->mousey_snap;
|
||||
xctx->nl_polyx[xctx->nl_points]=xctx->mousex_snap;
|
||||
xctx->nl_points++;
|
||||
|
|
@ -1996,11 +1996,11 @@ void new_polygon(int what)
|
|||
xctx->nl_polyy[xctx->nl_points-1] == xctx->nl_polyy[0]) ) {
|
||||
push_undo();
|
||||
drawtemppolygon(xctx->gctiled, NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points+1);
|
||||
store_poly(-1, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points, rectcolor, 0, NULL);
|
||||
/* fprintf(errfp, "new_poly: finish: xctx->nl_points=%d\n", xctx->nl_points); */
|
||||
drawtemppolygon(gc[rectcolor], NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points);
|
||||
store_poly(-1, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points, xctx->rectcolor, 0, NULL);
|
||||
/* fprintf(errfp, "new_poly: finish: nl_points=%d\n", xctx->nl_points); */
|
||||
drawtemppolygon(gc[xctx->rectcolor], NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points);
|
||||
xctx->ui_state &= ~STARTPOLYGON;
|
||||
drawpolygon(rectcolor, NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points, 0, 0);
|
||||
drawpolygon(xctx->rectcolor, NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points, 0, 0);
|
||||
my_free(711, &xctx->nl_polyx);
|
||||
my_free(712, &xctx->nl_polyy);
|
||||
xctx->nl_maxpoints = xctx->nl_points = 0;
|
||||
|
|
@ -2011,7 +2011,7 @@ void new_polygon(int what)
|
|||
drawtemppolygon(xctx->gctiled, NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points+1);
|
||||
xctx->nl_polyy[xctx->nl_points] = xctx->mousey_snap;
|
||||
xctx->nl_polyx[xctx->nl_points] = xctx->mousex_snap;
|
||||
drawtemppolygon(gc[rectcolor], NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points+1);
|
||||
drawtemppolygon(gc[xctx->rectcolor], NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points+1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ int callback(int event, int mx, int my, KeySym key,
|
|||
{
|
||||
if(debug_var>=2)
|
||||
if(event != MotionNotify)
|
||||
fprintf(errfp, "callback(): reentrant call of callback(), xctx->semaphore=%d\n", xctx->semaphore);
|
||||
fprintf(errfp, "callback(): reentrant call of callback(), semaphore=%d\n", xctx->semaphore);
|
||||
/* if(event==Expose) {
|
||||
* XCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gctiled, mx,my,button,aux,mx,my);
|
||||
*
|
||||
|
|
@ -551,7 +551,7 @@ int callback(int event, int mx, int my, KeySym key,
|
|||
xctx->last_command=0;
|
||||
manhattan_lines = 0;
|
||||
horizontal_move = vertical_move = 0;
|
||||
dbg(1, "callback(): Escape: xctx->ui_state=%ld\n", xctx->ui_state);
|
||||
dbg(1, "callback(): Escape: ui_state=%ld\n", xctx->ui_state);
|
||||
if(xctx->ui_state & STARTMOVE)
|
||||
{
|
||||
move_objects(ABORT,0,0,0);
|
||||
|
|
@ -625,10 +625,10 @@ int callback(int event, int mx, int my, KeySym key,
|
|||
if(key<='9' && key >='0' && state==ControlMask) /* choose layer */
|
||||
{
|
||||
char n[30];
|
||||
rectcolor = key - '0'+4;
|
||||
my_snprintf(n, S(n), "%d", rectcolor);
|
||||
Tcl_VarEval(interp, "xschem set rectcolor ", n, "; reconfigure_layers_button", NULL);
|
||||
dbg(1, "callback(): new color: %d\n",color_index[rectcolor]);
|
||||
xctx->rectcolor = key - '0'+4;
|
||||
my_snprintf(n, S(n), "%d", xctx->rectcolor);
|
||||
Tcl_VarEval(interp, "xschem set xctx->rectcolor ", n, "; reconfigure_layers_button", NULL);
|
||||
dbg(1, "callback(): new color: %d\n",color_index[xctx->rectcolor]);
|
||||
break;
|
||||
}
|
||||
if(key==XK_Delete && (xctx->ui_state & SELECTION) ) /* delete objects */
|
||||
|
|
@ -1393,7 +1393,7 @@ int callback(int event, int mx, int my, KeySym key,
|
|||
break;
|
||||
|
||||
case ButtonPress: /* end operation */
|
||||
dbg(1, "callback(): ButtonPress xctx->ui_state=%ld state=%d\n",xctx->ui_state,state);
|
||||
dbg(1, "callback(): ButtonPress ui_state=%ld state=%d\n",xctx->ui_state,state);
|
||||
if(xctx->ui_state & STARTPAN2) {
|
||||
xctx->ui_state &=~STARTPAN2;
|
||||
xctx->mx_save = mx; xctx->my_save = my;
|
||||
|
|
@ -1679,7 +1679,7 @@ int callback(int event, int mx, int my, KeySym key,
|
|||
|
||||
break;
|
||||
}
|
||||
dbg(1, "callback(): ButtonRelease xctx->ui_state=%ld state=%d\n",xctx->ui_state,state);
|
||||
dbg(1, "callback(): ButtonRelease ui_state=%ld state=%d\n",xctx->ui_state,state);
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(xctx->ui_state & STARTSELECT) {
|
||||
if(state & ControlMask) {
|
||||
|
|
@ -1700,7 +1700,7 @@ int callback(int event, int mx, int my, KeySym key,
|
|||
break;
|
||||
case -3: /* double click : edit prop */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
dbg(1, "callback(): DoubleClick xctx->ui_state=%ld state=%d\n",xctx->ui_state,state);
|
||||
dbg(1, "callback(): DoubleClick ui_state=%ld state=%d\n",xctx->ui_state,state);
|
||||
if(button==Button1) {
|
||||
if(xctx->ui_state == STARTWIRE) {
|
||||
xctx->ui_state &= ~STARTWIRE;
|
||||
|
|
|
|||
|
|
@ -457,9 +457,9 @@ void break_wires_at_pins(void)
|
|||
/* printf(" k=%d, x0=%g, y0=%g\n", k, x0, y0); */
|
||||
for(wptr=xctx->wiretable[sqx][sqy] ; wptr ; wptr = wptr->next) {
|
||||
i = wptr->n;
|
||||
/* printf("check xctx->wire %d to xctx->wire %d\n", k, i); */
|
||||
/* printf("check wire %d to wire %d\n", k, i); */
|
||||
if(i==k) {
|
||||
continue; /* no check xctx->wire against itself */
|
||||
continue; /* no check wire against itself */
|
||||
}
|
||||
if( touch(xctx->wire[i].x1, xctx->wire[i].y1,
|
||||
xctx->wire[i].x2, xctx->wire[i].y2, x0,y0) )
|
||||
|
|
|
|||
|
|
@ -1768,7 +1768,7 @@ void draw(void)
|
|||
}
|
||||
draw_selection(gc[SELLAYER], 0); /* 20181009 moved outside of cadlayers loop */
|
||||
|
||||
dbg(1, "draw(): INT_WIDTH(xctx->lw)=%d\n",INT_WIDTH(xctx->lw));
|
||||
dbg(1, "draw(): INT_WIDTH(lw)=%d\n",INT_WIDTH(xctx->lw));
|
||||
} /* if(has_x) */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -902,10 +902,10 @@ void edit_symbol_property(int x)
|
|||
else if(x==2) tcleval("viewdata $::retval");
|
||||
my_strdup(78, &result, tclresult());
|
||||
}
|
||||
dbg(1, "edit_symbol_property(): before update_symbol, xctx->modified=%d\n", xctx->modified);
|
||||
dbg(1, "edit_symbol_property(): before update_symbol, modified=%d\n", xctx->modified);
|
||||
update_symbol(result, x);
|
||||
my_free(728, &result);
|
||||
dbg(1, "edit_symbol_property(): done update_symbol, xctx->modified=%d\n", xctx->modified);
|
||||
dbg(1, "edit_symbol_property(): done update_symbol, modified=%d\n", xctx->modified);
|
||||
i=-1;
|
||||
}
|
||||
|
||||
|
|
@ -1030,7 +1030,7 @@ void update_symbol(const char *result, int x)
|
|||
dbg(1, "update_symbol(): prefix!='\\0', name=%s\n", name);
|
||||
/* 20110325 only modify prefix if prefix not NUL */
|
||||
if(prefix) name[0]=prefix; /* change prefix if changing symbol type; */
|
||||
dbg(1, "update_symbol(): name=%s, xctx->inst[i].prop_ptr=%s\n", name, xctx->inst[i].prop_ptr);
|
||||
dbg(1, "update_symbol(): name=%s, inst[i].prop_ptr=%s\n", name, xctx->inst[i].prop_ptr);
|
||||
my_strdup(89, &ptr,subst_token(xctx->inst[i].prop_ptr, "name", name) );
|
||||
/* set name of current inst */
|
||||
|
||||
|
|
|
|||
|
|
@ -188,7 +188,6 @@ int draw_window=0;
|
|||
int text_svg=1; /* use <text> svg element for text instead of xschem's internal vector font */
|
||||
double cadhalfdotsize = CADHALFDOTSIZE;
|
||||
unsigned int color_index[256]; /* layer color lookup table */
|
||||
unsigned int rectcolor ; /* this is the currently used layer */
|
||||
int max_undo=MAX_UNDO;
|
||||
int draw_dots=1;
|
||||
int draw_single_layer=-1;
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ void update_symbol_bboxes(short rot, short flip)
|
|||
for(i=0;i<xctx->movelastsel;i++)
|
||||
{
|
||||
n = xctx->sel_array[i].n;
|
||||
dbg(1, "update_symbol_bboxes(): i=%d, xctx->movelastsel=%d, n=%d\n", i, xctx->movelastsel, n);
|
||||
dbg(1, "update_symbol_bboxes(): i=%d, movelastsel=%d, n=%d\n", i, xctx->movelastsel, n);
|
||||
dbg(1, "update_symbol_bboxes(): symbol flip=%d, rot=%d\n", xctx->inst[n].flip, xctx->inst[n].rot);
|
||||
if(xctx->sel_array[i].type == ELEMENT) {
|
||||
save_flip = xctx->inst[n].flip;
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ void merge_file(int selection_load, const char ext[])
|
|||
match_merged_inst(old);
|
||||
fclose(fd);
|
||||
xctx->ui_state |= STARTMERGE;
|
||||
dbg(1, "merge_file(): loaded file:wire=%d inst=%d xctx->ui_state=%ld\n",
|
||||
dbg(1, "merge_file(): loaded file:wire=%d inst=%d ui_state=%ld\n",
|
||||
xctx->wires , xctx->instances, xctx->ui_state);
|
||||
move_objects(START,0,0,0);
|
||||
xctx->mousex_snap = xctx->mx_double_save;
|
||||
|
|
|
|||
|
|
@ -583,7 +583,7 @@ void ps_draw(void)
|
|||
|
||||
|
||||
|
||||
dbg(1, "ps_draw(): INT_WIDTH(xctx->lw)=%d plotfile=%s\n",INT_WIDTH(xctx->lw), plotfile);
|
||||
dbg(1, "ps_draw(): INT_WIDTH(lw)=%d plotfile=%s\n",INT_WIDTH(xctx->lw), plotfile);
|
||||
fprintf(fd, "showpage\n\n");
|
||||
fprintf(fd, "%%%%EOF\n");
|
||||
fclose(fd);
|
||||
|
|
|
|||
|
|
@ -1078,7 +1078,7 @@ void push_undo(void)
|
|||
char diff_name[PATH_MAX+100]; /* overflow safe 20161122 */
|
||||
|
||||
if(no_undo)return;
|
||||
dbg(1, "push_undo(): xctx->cur_undo_ptr=%d xctx->tail_undo_ptr=%d xctx->head_undo_ptr=%d\n",
|
||||
dbg(1, "push_undo(): cur_undo_ptr=%d tail_undo_ptr=%d head_undo_ptr=%d\n",
|
||||
xctx->cur_undo_ptr, xctx->tail_undo_ptr, xctx->head_undo_ptr);
|
||||
|
||||
|
||||
|
|
@ -1151,7 +1151,7 @@ void pop_undo(int redo)
|
|||
if(no_undo)return;
|
||||
if(redo) {
|
||||
if(xctx->cur_undo_ptr < xctx->head_undo_ptr) {
|
||||
dbg(1, "pop_undo(): redo; xctx->cur_undo_ptr=%d xctx->tail_undo_ptr=%d xctx->head_undo_ptr=%d\n",
|
||||
dbg(1, "pop_undo(): redo; cur_undo_ptr=%d tail_undo_ptr=%d head_undo_ptr=%d\n",
|
||||
xctx->cur_undo_ptr, xctx->tail_undo_ptr, xctx->head_undo_ptr);
|
||||
xctx->cur_undo_ptr++;
|
||||
} else {
|
||||
|
|
@ -1159,7 +1159,7 @@ void pop_undo(int redo)
|
|||
}
|
||||
} else { /*redo=0 (undo) */
|
||||
if(xctx->cur_undo_ptr == xctx->tail_undo_ptr) return;
|
||||
dbg(1, "pop_undo(): undo; xctx->cur_undo_ptr=%d xctx->tail_undo_ptr=%d xctx->head_undo_ptr=%d\n",
|
||||
dbg(1, "pop_undo(): undo; cur_undo_ptr=%d tail_undo_ptr=%d head_undo_ptr=%d\n",
|
||||
xctx->cur_undo_ptr, xctx->tail_undo_ptr, xctx->head_undo_ptr);
|
||||
if(xctx->head_undo_ptr == xctx->cur_undo_ptr) {
|
||||
push_undo();
|
||||
|
|
|
|||
|
|
@ -578,7 +578,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
}
|
||||
else if(!strcmp(argv[2],"rectcolor")) {
|
||||
char s[30]; /* overflow safe 20161122 */
|
||||
my_snprintf(s, S(s), "%d",rectcolor);
|
||||
my_snprintf(s, S(s), "%d",xctx->rectcolor);
|
||||
Tcl_SetResult(interp, s,TCL_VOLATILE);
|
||||
}
|
||||
else if(!strcmp(argv[2],"debug_var")) {
|
||||
|
|
@ -820,7 +820,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
{
|
||||
printf("*******global variables:*******\n");
|
||||
printf("netlist_dir=%s\n", netlist_dir? netlist_dir: "<NULL>");
|
||||
printf("INT_WIDTH(xctx->lw)=%d\n", INT_WIDTH(xctx->lw));
|
||||
printf("INT_WIDTH(lw)=%d\n", INT_WIDTH(xctx->lw));
|
||||
printf("wires=%d\n", xctx->wires);
|
||||
printf("instances=%d\n", xctx->instances);
|
||||
printf("symbols=%d\n", xctx->symbols);
|
||||
|
|
@ -851,7 +851,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
printf("modified=%d\n", xctx->modified);
|
||||
printf("color_ps=%d\n", color_ps);
|
||||
printf("a3page=%d\n", a3page);
|
||||
printf("xctx->hilight_nets=%d\n", xctx->hilight_nets);
|
||||
printf("hilight_nets=%d\n", xctx->hilight_nets);
|
||||
printf("need_reb_sel_arr=%d\n", xctx->need_reb_sel_arr);
|
||||
printf("******* end global variables:*******\n");
|
||||
}
|
||||
|
|
@ -868,7 +868,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
{
|
||||
printf("xschem : function used to communicate with the C program\n");
|
||||
printf("Usage:\n");
|
||||
printf(" xschem callback X-event_type xctx->mousex xctx->mousey Xkeysym mouse_button Xstate\n");
|
||||
printf(" xschem callback X-event_type mousex mousey Xkeysym mouse_button Xstate\n");
|
||||
printf(" can be used to send any event to the application\n");
|
||||
printf(" xschem netlist\n");
|
||||
printf(" generates a netlist in the selected format for the current schematic\n");
|
||||
|
|
@ -1277,9 +1277,9 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
ORDER(x1,y1,x2,y2);
|
||||
pos=-1;
|
||||
if(argc==7) pos=atol(argv[6]);
|
||||
storeobject(pos, x1,y1,x2,y2,LINE,rectcolor,0,NULL);
|
||||
storeobject(pos, x1,y1,x2,y2,LINE,xctx->rectcolor,0,NULL);
|
||||
save = draw_window; draw_window = 1;
|
||||
drawline(rectcolor,NOW, x1,y1,x2,y2, 0);
|
||||
drawline(xctx->rectcolor,NOW, x1,y1,x2,y2, 0);
|
||||
draw_window = save;
|
||||
}
|
||||
else xctx->ui_state |= MENUSTARTLINE;
|
||||
|
|
@ -1630,9 +1630,9 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
ORDER(x1,y1,x2,y2);
|
||||
pos=-1;
|
||||
if(argc==7) pos=atol(argv[6]);
|
||||
storeobject(pos, x1,y1,x2,y2,xRECT,rectcolor,0,NULL);
|
||||
storeobject(pos, x1,y1,x2,y2,xRECT,xctx->rectcolor,0,NULL);
|
||||
save = draw_window; draw_window = 1;
|
||||
drawrect(rectcolor,NOW, x1,y1,x2,y2, 0);
|
||||
drawrect(xctx->rectcolor,NOW, x1,y1,x2,y2, 0);
|
||||
draw_window = save;
|
||||
}
|
||||
else xctx->ui_state |= MENUSTARTRECT;
|
||||
|
|
@ -2041,7 +2041,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
sym_txt=atoi(argv[3]);
|
||||
}
|
||||
else if(!strcmp(argv[2],"rectcolor")) {
|
||||
rectcolor=atoi(argv[3]);
|
||||
xctx->rectcolor=atoi(argv[3]);
|
||||
tcleval("reconfigure_layers_button");
|
||||
rebuild_selected_array();
|
||||
if(xctx->lastsel) {
|
||||
|
|
|
|||
150
src/store.c
150
src/store.c
|
|
@ -148,157 +148,157 @@ void check_polygon_storage(int c)
|
|||
}
|
||||
|
||||
void store_arc(int pos, double x, double y, double r, double a, double b,
|
||||
unsigned int rectcolor, unsigned short sel, char *prop_ptr)
|
||||
unsigned int rectc, unsigned short sel, char *prop_ptr)
|
||||
{
|
||||
int n, j;
|
||||
const char *dash;
|
||||
check_arc_storage(rectcolor);
|
||||
if(pos==-1) n=xctx->arcs[rectcolor];
|
||||
check_arc_storage(rectc);
|
||||
if(pos==-1) n=xctx->arcs[rectc];
|
||||
else
|
||||
{
|
||||
for(j=xctx->arcs[rectcolor];j>pos;j--)
|
||||
for(j=xctx->arcs[rectc];j>pos;j--)
|
||||
{
|
||||
xctx->arc[rectcolor][j]=xctx->arc[rectcolor][j-1];
|
||||
xctx->arc[rectc][j]=xctx->arc[rectc][j-1];
|
||||
}
|
||||
n=pos;
|
||||
}
|
||||
xctx->arc[rectcolor][n].x = x;
|
||||
xctx->arc[rectcolor][n].y = y;
|
||||
xctx->arc[rectcolor][n].r = r;
|
||||
xctx->arc[rectcolor][n].a = a;
|
||||
xctx->arc[rectcolor][n].b = b;
|
||||
xctx->arc[rectcolor][n].prop_ptr = NULL;
|
||||
my_strdup(407, &xctx->arc[rectcolor][n].prop_ptr, prop_ptr);
|
||||
xctx->arc[rectcolor][n].sel = sel;
|
||||
if( !strcmp(get_tok_value(xctx->arc[rectcolor][n].prop_ptr,"fill",0),"true") )
|
||||
xctx->arc[rectcolor][n].fill =1;
|
||||
xctx->arc[rectc][n].x = x;
|
||||
xctx->arc[rectc][n].y = y;
|
||||
xctx->arc[rectc][n].r = r;
|
||||
xctx->arc[rectc][n].a = a;
|
||||
xctx->arc[rectc][n].b = b;
|
||||
xctx->arc[rectc][n].prop_ptr = NULL;
|
||||
my_strdup(407, &xctx->arc[rectc][n].prop_ptr, prop_ptr);
|
||||
xctx->arc[rectc][n].sel = sel;
|
||||
if( !strcmp(get_tok_value(xctx->arc[rectc][n].prop_ptr,"fill",0),"true") )
|
||||
xctx->arc[rectc][n].fill =1;
|
||||
else
|
||||
xctx->arc[rectcolor][n].fill =0;
|
||||
dash = get_tok_value(xctx->arc[rectcolor][n].prop_ptr,"dash",0);
|
||||
xctx->arc[rectc][n].fill =0;
|
||||
dash = get_tok_value(xctx->arc[rectc][n].prop_ptr,"dash",0);
|
||||
if( strcmp(dash, "") ) {
|
||||
int d = atoi(dash);
|
||||
xctx->arc[rectcolor][n].dash = d >= 0 ? d : 0;
|
||||
xctx->arc[rectc][n].dash = d >= 0 ? d : 0;
|
||||
} else
|
||||
xctx->arc[rectcolor][n].dash = 0;
|
||||
xctx->arc[rectc][n].dash = 0;
|
||||
|
||||
xctx->arcs[rectcolor]++;
|
||||
xctx->arcs[rectc]++;
|
||||
set_modify(1);
|
||||
}
|
||||
|
||||
void store_poly(int pos, double *x, double *y, int points, unsigned int rectcolor,
|
||||
void store_poly(int pos, double *x, double *y, int points, unsigned int rectc,
|
||||
unsigned short sel, char *prop_ptr)
|
||||
{
|
||||
int n, j;
|
||||
const char *dash;
|
||||
check_polygon_storage(rectcolor);
|
||||
if(pos==-1) n=xctx->polygons[rectcolor];
|
||||
check_polygon_storage(rectc);
|
||||
if(pos==-1) n=xctx->polygons[rectc];
|
||||
else
|
||||
{
|
||||
for(j=xctx->polygons[rectcolor];j>pos;j--)
|
||||
for(j=xctx->polygons[rectc];j>pos;j--)
|
||||
{
|
||||
xctx->poly[rectcolor][j]=xctx->poly[rectcolor][j-1];
|
||||
xctx->poly[rectc][j]=xctx->poly[rectc][j-1];
|
||||
}
|
||||
n=pos;
|
||||
}
|
||||
dbg(2, "store_poly(): storing POLYGON %d\n",n);
|
||||
|
||||
xctx->poly[rectcolor][n].x=NULL;
|
||||
xctx->poly[rectcolor][n].y=NULL;
|
||||
xctx->poly[rectcolor][n].selected_point=NULL;
|
||||
xctx->poly[rectcolor][n].prop_ptr=NULL;
|
||||
xctx->poly[rectcolor][n].x= my_calloc(408, points, sizeof(double));
|
||||
xctx->poly[rectcolor][n].y= my_calloc(409, points, sizeof(double));
|
||||
xctx->poly[rectcolor][n].selected_point= my_calloc(410, points, sizeof(unsigned short));
|
||||
my_strdup(411, &xctx->poly[rectcolor][n].prop_ptr, prop_ptr);
|
||||
xctx->poly[rectc][n].x=NULL;
|
||||
xctx->poly[rectc][n].y=NULL;
|
||||
xctx->poly[rectc][n].selected_point=NULL;
|
||||
xctx->poly[rectc][n].prop_ptr=NULL;
|
||||
xctx->poly[rectc][n].x= my_calloc(408, points, sizeof(double));
|
||||
xctx->poly[rectc][n].y= my_calloc(409, points, sizeof(double));
|
||||
xctx->poly[rectc][n].selected_point= my_calloc(410, points, sizeof(unsigned short));
|
||||
my_strdup(411, &xctx->poly[rectc][n].prop_ptr, prop_ptr);
|
||||
for(j=0;j<points; j++) {
|
||||
xctx->poly[rectcolor][n].x[j] = x[j];
|
||||
xctx->poly[rectcolor][n].y[j] = y[j];
|
||||
xctx->poly[rectc][n].x[j] = x[j];
|
||||
xctx->poly[rectc][n].y[j] = y[j];
|
||||
}
|
||||
xctx->poly[rectcolor][n].points = points;
|
||||
xctx->poly[rectcolor][n].sel = sel;
|
||||
xctx->poly[rectc][n].points = points;
|
||||
xctx->poly[rectc][n].sel = sel;
|
||||
|
||||
|
||||
if( !strcmp(get_tok_value(xctx->poly[rectcolor][n].prop_ptr,"fill",0),"true") )
|
||||
xctx->poly[rectcolor][n].fill =1;
|
||||
if( !strcmp(get_tok_value(xctx->poly[rectc][n].prop_ptr,"fill",0),"true") )
|
||||
xctx->poly[rectc][n].fill =1;
|
||||
else
|
||||
xctx->poly[rectcolor][n].fill =0;
|
||||
dash = get_tok_value(xctx->poly[rectcolor][n].prop_ptr,"dash",0);
|
||||
xctx->poly[rectc][n].fill =0;
|
||||
dash = get_tok_value(xctx->poly[rectc][n].prop_ptr,"dash",0);
|
||||
if( strcmp(dash, "") ) {
|
||||
int d = atoi(dash);
|
||||
xctx->poly[rectcolor][n].dash = d >= 0 ? d : 0;
|
||||
xctx->poly[rectc][n].dash = d >= 0 ? d : 0;
|
||||
} else
|
||||
xctx->poly[rectcolor][n].dash = 0;
|
||||
xctx->poly[rectc][n].dash = 0;
|
||||
|
||||
|
||||
xctx->polygons[rectcolor]++;
|
||||
xctx->polygons[rectc]++;
|
||||
set_modify(1);
|
||||
}
|
||||
|
||||
void storeobject(int pos, double x1,double y1,double x2,double y2,
|
||||
unsigned short type, unsigned int rectcolor,
|
||||
unsigned short type, unsigned int rectc,
|
||||
unsigned short sel, const char *prop_ptr)
|
||||
{
|
||||
int n, j;
|
||||
const char * dash;
|
||||
if(type == LINE)
|
||||
{
|
||||
check_line_storage(rectcolor);
|
||||
check_line_storage(rectc);
|
||||
|
||||
if(pos==-1) n=xctx->lines[rectcolor];
|
||||
if(pos==-1) n=xctx->lines[rectc];
|
||||
else
|
||||
{
|
||||
for(j=xctx->lines[rectcolor];j>pos;j--)
|
||||
for(j=xctx->lines[rectc];j>pos;j--)
|
||||
{
|
||||
xctx->line[rectcolor][j]=xctx->line[rectcolor][j-1];
|
||||
xctx->line[rectc][j]=xctx->line[rectc][j-1];
|
||||
}
|
||||
n=pos;
|
||||
}
|
||||
dbg(2, "storeobject(): storing LINE %d\n",n);
|
||||
xctx->line[rectcolor][n].x1=x1;
|
||||
xctx->line[rectcolor][n].x2=x2;
|
||||
xctx->line[rectcolor][n].y1=y1;
|
||||
xctx->line[rectcolor][n].y2=y2;
|
||||
xctx->line[rectcolor][n].prop_ptr=NULL;
|
||||
my_strdup(412, &xctx->line[rectcolor][n].prop_ptr, prop_ptr);
|
||||
xctx->line[rectcolor][n].sel=sel;
|
||||
xctx->line[rectc][n].x1=x1;
|
||||
xctx->line[rectc][n].x2=x2;
|
||||
xctx->line[rectc][n].y1=y1;
|
||||
xctx->line[rectc][n].y2=y2;
|
||||
xctx->line[rectc][n].prop_ptr=NULL;
|
||||
my_strdup(412, &xctx->line[rectc][n].prop_ptr, prop_ptr);
|
||||
xctx->line[rectc][n].sel=sel;
|
||||
if( prop_ptr && !strcmp(get_tok_value(prop_ptr, "bus", 0), "true") )
|
||||
xctx->line[rectcolor][n].bus = 1;
|
||||
xctx->line[rectc][n].bus = 1;
|
||||
else
|
||||
xctx->line[rectcolor][n].bus = 0;
|
||||
xctx->line[rectc][n].bus = 0;
|
||||
if(prop_ptr && (dash = get_tok_value(prop_ptr,"dash",0))[0]) {
|
||||
int d = atoi(dash);
|
||||
xctx->line[rectcolor][n].dash = d >= 0 ? d : 0;
|
||||
xctx->line[rectc][n].dash = d >= 0 ? d : 0;
|
||||
} else
|
||||
xctx->line[rectcolor][n].dash = 0;
|
||||
xctx->lines[rectcolor]++;
|
||||
xctx->line[rectc][n].dash = 0;
|
||||
xctx->lines[rectc]++;
|
||||
set_modify(1);
|
||||
}
|
||||
if(type == xRECT)
|
||||
{
|
||||
check_box_storage(rectcolor);
|
||||
if(pos==-1) n=xctx->rects[rectcolor];
|
||||
check_box_storage(rectc);
|
||||
if(pos==-1) n=xctx->rects[rectc];
|
||||
else
|
||||
{
|
||||
for(j=xctx->rects[rectcolor];j>pos;j--)
|
||||
for(j=xctx->rects[rectc];j>pos;j--)
|
||||
{
|
||||
xctx->rect[rectcolor][j]=xctx->rect[rectcolor][j-1];
|
||||
xctx->rect[rectc][j]=xctx->rect[rectc][j-1];
|
||||
}
|
||||
n=pos;
|
||||
}
|
||||
dbg(2, "storeobject(): storing RECT %d\n",n);
|
||||
xctx->rect[rectcolor][n].x1=x1;
|
||||
xctx->rect[rectcolor][n].x2=x2;
|
||||
xctx->rect[rectcolor][n].y1=y1;
|
||||
xctx->rect[rectcolor][n].y2=y2;
|
||||
xctx->rect[rectcolor][n].prop_ptr=NULL;
|
||||
my_strdup(413, &xctx->rect[rectcolor][n].prop_ptr, prop_ptr);
|
||||
xctx->rect[rectcolor][n].sel=sel;
|
||||
xctx->rect[rectc][n].x1=x1;
|
||||
xctx->rect[rectc][n].x2=x2;
|
||||
xctx->rect[rectc][n].y1=y1;
|
||||
xctx->rect[rectc][n].y2=y2;
|
||||
xctx->rect[rectc][n].prop_ptr=NULL;
|
||||
my_strdup(413, &xctx->rect[rectc][n].prop_ptr, prop_ptr);
|
||||
xctx->rect[rectc][n].sel=sel;
|
||||
if(prop_ptr && (dash = get_tok_value(prop_ptr,"dash",0))[0]) {
|
||||
int d = atoi(dash);
|
||||
xctx->rect[rectcolor][n].dash = d >= 0 ? d : 0;
|
||||
xctx->rect[rectc][n].dash = d >= 0 ? d : 0;
|
||||
} else
|
||||
xctx->rect[rectcolor][n].dash = 0;
|
||||
xctx->rects[rectcolor]++;
|
||||
xctx->rect[rectc][n].dash = 0;
|
||||
xctx->rects[rectc]++;
|
||||
set_modify(1);
|
||||
}
|
||||
if(type == WIRE)
|
||||
|
|
|
|||
|
|
@ -727,7 +727,7 @@ void svg_draw(void)
|
|||
}
|
||||
}
|
||||
|
||||
dbg(1, "svg_draw(): INT_WIDTH(xctx->lw)=%d\n",INT_WIDTH(xctx->lw));
|
||||
dbg(1, "svg_draw(): INT_WIDTH(lw)=%d\n",INT_WIDTH(xctx->lw));
|
||||
fprintf(fd, "</svg>\n");
|
||||
fclose(fd);
|
||||
draw_grid=old_grid;
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ void alloc_xschem_data()
|
|||
fprintf(errfp, "xinit(): problems creating tmp undo dir\n");
|
||||
tcleval( "exit");
|
||||
}
|
||||
dbg(1, "xctx->undo_dirname=%s\n", xctx->undo_dirname);
|
||||
dbg(1, "undo_dirname=%s\n", xctx->undo_dirname);
|
||||
#endif
|
||||
xctx->zoom=CADINITIALZOOM;
|
||||
xctx->mooz=1/CADINITIALZOOM;
|
||||
|
|
@ -460,6 +460,7 @@ void alloc_xschem_data()
|
|||
|
||||
xctx->hilight_nets = 0;
|
||||
xctx->hilight_color = 0;
|
||||
xctx->rectcolor = 0;
|
||||
for(i=0;i<CADMAXHIER;i++) xctx->sch_path[i]=NULL;
|
||||
my_strdup(1187, &xctx->sch_path[0],".");
|
||||
xctx->sch_inst_number[0] = 1;
|
||||
|
|
@ -1599,7 +1600,7 @@ int Tcl_AppInit(Tcl_Interp *inter)
|
|||
visual = vinfo.visual;
|
||||
*/
|
||||
dbg(1, "Tcl_AppInit(): done step b of xinit()\n");
|
||||
rectcolor= 4; /* this is the current layer when xschem started. */
|
||||
xctx->rectcolor= 4; /* this is the current layer when xschem started. */
|
||||
for(i=0;i<cadlayers;i++)
|
||||
{
|
||||
pixmap[i] = XCreateBitmapFromData(display, xctx->window, (char*)(pixdata[i]),16,16);
|
||||
|
|
|
|||
|
|
@ -548,6 +548,7 @@ typedef struct {
|
|||
int *inst_color;
|
||||
int hilight_nets;
|
||||
int hilight_color;
|
||||
unsigned int rectcolor; /* current layer */
|
||||
/* get_unnamed_node() */
|
||||
int new_node;
|
||||
int *node_mult;
|
||||
|
|
@ -696,7 +697,6 @@ extern double cadgrid;
|
|||
extern double cadhalfdotsize;
|
||||
extern int draw_pixmap; /* pixmap used as 2nd buffer */
|
||||
extern int draw_window;
|
||||
extern unsigned int rectcolor;
|
||||
extern XEvent xev;
|
||||
extern KeySym key;
|
||||
extern unsigned short enable_stretch;
|
||||
|
|
|
|||
Loading…
Reference in New Issue