[Merge Conflict Resolution]: Resolved merge conflicts in a way that preserves all previous work done on the system, as well as mitigate possible bugs from last upstream refactor.
This commit is contained in:
commit
2519567cc7
245
src/callback.c
245
src/callback.c
|
|
@ -102,6 +102,7 @@ void redraw_w_a_l_r_p_z_rubbers(int force)
|
||||||
{
|
{
|
||||||
double mx = xctx->mousex_snap;
|
double mx = xctx->mousex_snap;
|
||||||
double my = xctx->mousey_snap;
|
double my = xctx->mousey_snap;
|
||||||
|
double origin_shifted_x2, origin_shifted_y2;
|
||||||
|
|
||||||
if(!force && xctx->mousex_snap == xctx->prev_rubberx && xctx->mousey_snap == xctx->prev_rubbery) return;
|
if(!force && xctx->mousex_snap == xctx->prev_rubberx && xctx->mousey_snap == xctx->prev_rubbery) return;
|
||||||
|
|
||||||
|
|
@ -110,11 +111,11 @@ void redraw_w_a_l_r_p_z_rubbers(int force)
|
||||||
if(xctx->constr_mv == 1) my = xctx->my_double_save;
|
if(xctx->constr_mv == 1) my = xctx->my_double_save;
|
||||||
if(xctx->constr_mv == 2) mx = xctx->mx_double_save;
|
if(xctx->constr_mv == 2) mx = xctx->mx_double_save;
|
||||||
if(tclgetboolvar("orthogonal_wiring")) {
|
if(tclgetboolvar("orthogonal_wiring")) {
|
||||||
/* Origin shift the cartesian coordinate p2(x2,y2) w.r.t. p1(x1,y1) */
|
|
||||||
double origin_shifted_x2 = xctx->nl_x2 - xctx->nl_x1, origin_shifted_y2 = xctx->nl_y2 - xctx->nl_y1;
|
|
||||||
new_wire(RUBBER|CLEAR, xctx->mousex_snap, xctx->mousey_snap);
|
new_wire(RUBBER|CLEAR, xctx->mousex_snap, xctx->mousey_snap);
|
||||||
/* Draw whichever component of the resulting orthogonal-wire is bigger
|
/* Origin shift the cartesian coordinate p2(x2,y2) w.r.t. p1(x1,y1) */
|
||||||
* (either horizontal or vertical), first */
|
origin_shifted_x2 = xctx->nl_x2 - xctx->nl_x1;
|
||||||
|
origin_shifted_y2 = xctx->nl_y2 - xctx->nl_y1;
|
||||||
|
/* Draw whichever component of the resulting orthogonal-wire is bigger (either horizontal or vertical), first */
|
||||||
if(origin_shifted_x2*origin_shifted_x2 > origin_shifted_y2*origin_shifted_y2){
|
if(origin_shifted_x2*origin_shifted_x2 > origin_shifted_y2*origin_shifted_y2){
|
||||||
xctx->manhattan_lines = 1;
|
xctx->manhattan_lines = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -248,12 +249,11 @@ static void start_wire(double mx, double my)
|
||||||
if(xctx->constr_mv == 1) my = xctx->my_double_save;
|
if(xctx->constr_mv == 1) my = xctx->my_double_save;
|
||||||
if(xctx->constr_mv == 2) mx = xctx->mx_double_save;
|
if(xctx->constr_mv == 2) mx = xctx->mx_double_save;
|
||||||
} else {
|
} else {
|
||||||
xctx->manhattan_lines = 1;
|
|
||||||
xctx->mx_double_save=mx;
|
xctx->mx_double_save=mx;
|
||||||
xctx->my_double_save=my;
|
xctx->my_double_save=my;
|
||||||
}
|
}
|
||||||
new_wire(PLACE,mx, my);
|
new_wire(PLACE,mx, my);
|
||||||
if(tclgetboolvar("orthogonal_wiring") && !tclgetboolvar("constr_mv")) {
|
if(tclgetboolvar("orthogonal_wiring") && !tclgetboolvar("constr_mv")){
|
||||||
xctx->constr_mv = 0;
|
xctx->constr_mv = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1523,82 +1523,99 @@ void draw_crosshair(int what, int state)
|
||||||
xctx->draw_pixmap = sdp;
|
xctx->draw_pixmap = sdp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void find_snap_position(double *x, double *y, int pos_changed) {
|
/* what == 3 : erase and draw a new cursor
|
||||||
if (!pos_changed) {
|
* what == 1 : erase the cursor
|
||||||
*x = xctx->prev_snapx;
|
* what == 2 : draw a diamond-shaped cursor that snaps to a component endpoint */
|
||||||
*y = xctx->prev_snapy;
|
void draw_snap_cursor(int what)
|
||||||
} else {
|
{
|
||||||
xctx->closest_pin_found = find_closest_net_or_symbol_pin(
|
int sdw, sdp;
|
||||||
xctx->mousex, xctx->mousey, x, y);
|
int snapcursor_size = tclgetintvar("snap_cursor_size");
|
||||||
}
|
int pos_changed = (xctx->mousex_snap - xctx->prev_gridx) || (xctx->mousey_snap - xctx->prev_gridy);
|
||||||
}
|
double prev_x = xctx->prev_snapx;
|
||||||
|
double prev_y = xctx->prev_snapy;
|
||||||
|
dbg(1, "draw_snap_cursor(): what=%d\n", what);
|
||||||
|
sdw = xctx->draw_window;
|
||||||
|
sdp = xctx->draw_pixmap;
|
||||||
|
|
||||||
void draw_snap_cursor_shape(GC gc, double x, double y, int snapcursor_size) {
|
if(!xctx->mouse_inside) return;
|
||||||
/* Convert coordinates to screen space */
|
|
||||||
double screen_x = X_TO_SCREEN(x);
|
|
||||||
double screen_y = Y_TO_SCREEN(y);
|
|
||||||
double left = screen_x - snapcursor_size;
|
|
||||||
double right = screen_x + snapcursor_size;
|
|
||||||
double top = screen_y - snapcursor_size;
|
|
||||||
double bottom = screen_y + snapcursor_size;
|
|
||||||
int i;
|
|
||||||
/* Define crosshair lines */
|
|
||||||
double lines[4][4];
|
|
||||||
lines[0][0] = screen_x; lines[0][1] = top; lines[0][2] = right; lines[0][3] = screen_y;
|
|
||||||
lines[1][0] = right; lines[1][1] = screen_y; lines[1][2] = screen_x; lines[1][3] = bottom;
|
|
||||||
lines[2][0] = screen_x; lines[2][1] = bottom; lines[2][2] = left; lines[2][3] = screen_y;
|
|
||||||
lines[3][0] = left; lines[3][1] = screen_y; lines[3][2] = screen_x; lines[3][3] = top;
|
|
||||||
/* Draw crosshair lines */
|
|
||||||
for (i = 0; i < 4; i++) {
|
|
||||||
draw_xhair_line(gc, snapcursor_size, lines[i][0], lines[i][1], lines[i][2], lines[i][3]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void erase_snap_cursor(double prev_x, double prev_y, int snapcursor_size) {
|
|
||||||
if (fix_broken_tiled_fill || !_unix) {
|
|
||||||
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
|
|
||||||
(int)X_TO_SCREEN(prev_x) - INT_WIDTH(xctx->lw) - snapcursor_size,
|
|
||||||
(int)Y_TO_SCREEN(prev_y) - INT_WIDTH(xctx->lw) - snapcursor_size,
|
|
||||||
2 * INT_WIDTH(xctx->lw) + 2 * snapcursor_size,
|
|
||||||
2 * INT_WIDTH(xctx->lw) + 2 * snapcursor_size,
|
|
||||||
(int)X_TO_SCREEN(prev_x) - INT_WIDTH(xctx->lw) - snapcursor_size,
|
|
||||||
(int)Y_TO_SCREEN(prev_y) - INT_WIDTH(xctx->lw) - snapcursor_size);
|
|
||||||
} else {
|
|
||||||
draw_snap_cursor_shape(xctx->gctiled, prev_x, prev_y, snapcursor_size);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* action = 1 => erase */
|
|
||||||
void draw_snap_cursor(int action) {
|
|
||||||
int snapcursor_size;
|
|
||||||
int pos_changed;
|
|
||||||
int prev_draw_window = xctx->draw_window;
|
|
||||||
int prev_draw_pixmap = xctx->draw_pixmap;
|
|
||||||
|
|
||||||
if (!xctx->mouse_inside) return; /* Early exit if mouse is outside */
|
|
||||||
snapcursor_size = tclgetintvar("snap_cursor_size");
|
|
||||||
pos_changed = (xctx->mousex_snap != xctx->prev_gridx) || (xctx->mousey_snap != xctx->prev_gridy);
|
|
||||||
/* Save current drawing context */
|
|
||||||
xctx->draw_pixmap = 0;
|
xctx->draw_pixmap = 0;
|
||||||
xctx->draw_window = 1;
|
xctx->draw_window = 1;
|
||||||
/* Erase and redraw the cursor if needed */
|
if(what & 1) {
|
||||||
if (action & 1) {
|
if(fix_broken_tiled_fill || !_unix) {
|
||||||
double new_x, new_y;
|
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
|
||||||
erase_snap_cursor(xctx->prev_snapx, xctx->prev_snapy, snapcursor_size);
|
(int)X_TO_SCREEN(prev_x) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size,
|
||||||
|
(int)Y_TO_SCREEN(prev_y) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size,
|
||||||
find_snap_position(&new_x, &new_y, pos_changed);
|
2 * INT_WIDTH(xctx->lw) + 2 * snapcursor_size,
|
||||||
draw_snap_cursor_shape(xctx->gc[xctx->crosshair_layer],new_x, new_y, snapcursor_size);
|
2 * INT_WIDTH(xctx->lw) + 2 * snapcursor_size,
|
||||||
|
(int)X_TO_SCREEN(prev_x) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size,
|
||||||
/* Update previous position tracking */
|
(int)Y_TO_SCREEN(prev_y) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size);
|
||||||
|
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
|
||||||
|
(int)X_TO_SCREEN(prev_x) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size,
|
||||||
|
(int)Y_TO_SCREEN(prev_y) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size,
|
||||||
|
2 * INT_WIDTH(xctx->lw) + 2 * snapcursor_size,
|
||||||
|
2 * INT_WIDTH(xctx->lw) + 2 * snapcursor_size,
|
||||||
|
(int)X_TO_SCREEN(prev_x) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size,
|
||||||
|
(int)Y_TO_SCREEN(prev_y) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size);
|
||||||
|
} else {
|
||||||
|
draw_xhair_line(xctx->gctiled, snapcursor_size,
|
||||||
|
X_TO_SCREEN(prev_x),
|
||||||
|
Y_TO_SCREEN(prev_y) - snapcursor_size,
|
||||||
|
X_TO_SCREEN(prev_x) + snapcursor_size,
|
||||||
|
Y_TO_SCREEN(prev_y));
|
||||||
|
draw_xhair_line(xctx->gctiled, snapcursor_size,
|
||||||
|
X_TO_SCREEN(prev_x) + snapcursor_size,
|
||||||
|
Y_TO_SCREEN(prev_y),
|
||||||
|
X_TO_SCREEN(prev_x),
|
||||||
|
Y_TO_SCREEN(prev_y) + snapcursor_size);
|
||||||
|
draw_xhair_line(xctx->gctiled, snapcursor_size,
|
||||||
|
X_TO_SCREEN(prev_x),
|
||||||
|
Y_TO_SCREEN(prev_y) + snapcursor_size,
|
||||||
|
X_TO_SCREEN(prev_x) - snapcursor_size,
|
||||||
|
Y_TO_SCREEN(prev_y));
|
||||||
|
draw_xhair_line(xctx->gctiled, snapcursor_size,
|
||||||
|
X_TO_SCREEN(prev_x) - snapcursor_size,
|
||||||
|
Y_TO_SCREEN(prev_y),
|
||||||
|
X_TO_SCREEN(prev_x),
|
||||||
|
Y_TO_SCREEN(prev_y) - snapcursor_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(what & 1) {
|
||||||
|
double x, y;
|
||||||
|
if(!pos_changed) {
|
||||||
|
x = xctx->prev_snapx;
|
||||||
|
y = xctx->prev_snapy;
|
||||||
|
} else { /* Only search for nearest pin if the grid-snap-point has changed */
|
||||||
|
xctx->closest_pin_found = find_closest_net_or_symbol_pin(xctx->mousex, xctx->mousey, &x, &y);
|
||||||
|
}
|
||||||
|
draw_xhair_line(xctx->gc[xctx->crosshair_layer], snapcursor_size,
|
||||||
|
X_TO_SCREEN(x),
|
||||||
|
Y_TO_SCREEN(y) - snapcursor_size,
|
||||||
|
X_TO_SCREEN(x) + snapcursor_size,
|
||||||
|
Y_TO_SCREEN(y));
|
||||||
|
draw_xhair_line(xctx->gc[xctx->crosshair_layer], snapcursor_size,
|
||||||
|
X_TO_SCREEN(x) + snapcursor_size,
|
||||||
|
Y_TO_SCREEN(y),
|
||||||
|
X_TO_SCREEN(x),
|
||||||
|
Y_TO_SCREEN(y) + snapcursor_size);
|
||||||
|
draw_xhair_line(xctx->gc[xctx->crosshair_layer], snapcursor_size,
|
||||||
|
X_TO_SCREEN(x),
|
||||||
|
Y_TO_SCREEN(y) + snapcursor_size,
|
||||||
|
X_TO_SCREEN(x) - snapcursor_size,
|
||||||
|
Y_TO_SCREEN(y));
|
||||||
|
draw_xhair_line(xctx->gc[xctx->crosshair_layer], snapcursor_size,
|
||||||
|
X_TO_SCREEN(x) - snapcursor_size,
|
||||||
|
Y_TO_SCREEN(y),
|
||||||
|
X_TO_SCREEN(x),
|
||||||
|
Y_TO_SCREEN(y) - snapcursor_size);
|
||||||
xctx->prev_gridx = xctx->mousex_snap;
|
xctx->prev_gridx = xctx->mousex_snap;
|
||||||
xctx->prev_gridy = xctx->mousey_snap;
|
xctx->prev_gridy = xctx->mousey_snap;
|
||||||
xctx->prev_snapx = new_x;
|
xctx->prev_snapx = x;
|
||||||
xctx->prev_snapy = new_y;
|
xctx->prev_snapy = y;
|
||||||
}
|
}
|
||||||
draw_selection(xctx->gc[SELLAYER], 0);
|
draw_selection(xctx->gc[SELLAYER], 0);
|
||||||
/* Restore previous drawing context */
|
|
||||||
xctx->draw_window = prev_draw_window;
|
xctx->draw_window = sdw;
|
||||||
xctx->draw_pixmap = prev_draw_pixmap;
|
xctx->draw_pixmap = sdp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* complete the STARTWIRE, STARTRECT, STARTZOOM, STARTCOPY ... operations */
|
/* complete the STARTWIRE, STARTRECT, STARTZOOM, STARTCOPY ... operations */
|
||||||
|
|
@ -2446,12 +2463,13 @@ static void handle_enter_notify(int draw_xhair, int crosshair_size)
|
||||||
xctx->mousey_snap = -340;
|
xctx->mousey_snap = -340;
|
||||||
merge_file(1, ".sch");
|
merge_file(1, ".sch");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_motion_notify(int event, KeySym key, int state, int rstate, int button,
|
static void handle_motion_notify(int event, KeySym key, int state, int rstate, int button,
|
||||||
int mx, int my, int aux, int draw_xhair, int enable_stretch, int snap_cursor, int wire_draw_active)
|
int mx, int my, int aux, int draw_xhair, int enable_stretch, int snap_cursor, int wire_draw_active, char *str)
|
||||||
{
|
{
|
||||||
char str[PATH_MAX + 100];
|
|
||||||
if( waves_selected(event, key, state, button)) {
|
if( waves_selected(event, key, state, button)) {
|
||||||
waves_callback(event, mx, my, key, button, aux, state);
|
waves_callback(event, mx, my, key, button, aux, state);
|
||||||
return;
|
return;
|
||||||
|
|
@ -2460,6 +2478,7 @@ static void handle_motion_notify(int event, KeySym key, int state, int rstate, i
|
||||||
draw_crosshair(1, state); /* when moving mouse: first action is delete crosshair, will be drawn later */
|
draw_crosshair(1, state); /* when moving mouse: first action is delete crosshair, will be drawn later */
|
||||||
if(snap_cursor && wire_draw_active) draw_snap_cursor(1);
|
if(snap_cursor && wire_draw_active) draw_snap_cursor(1);
|
||||||
}
|
}
|
||||||
|
if(snap_cursor && wire_draw_active) draw_snap_cursor(1);
|
||||||
/* pan schematic */
|
/* pan schematic */
|
||||||
if(xctx->ui_state & STARTPAN) pan(RUBBER, mx, my);
|
if(xctx->ui_state & STARTPAN) pan(RUBBER, mx, my);
|
||||||
|
|
||||||
|
|
@ -2569,14 +2588,14 @@ static void handle_motion_notify(int event, KeySym key, int state, int rstate, i
|
||||||
draw_crosshair(2, state); /* what = 2(draw) */
|
draw_crosshair(2, state); /* what = 2(draw) */
|
||||||
}
|
}
|
||||||
if(snap_cursor && wire_draw_active) draw_snap_cursor(2);
|
if(snap_cursor && wire_draw_active) draw_snap_cursor(2);
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_key_press(int event, KeySym key, int state, int rstate, int mx, int my,
|
static void handle_key_press(int event, KeySym key, int state, int rstate, int mx, int my,
|
||||||
int button, int aux, int infix_interface, int enable_stretch, const char *win_path, double c_snap)
|
int button, int aux, int infix_interface, int enable_stretch, const char *win_path, double c_snap,
|
||||||
|
int cadence_compat, int wire_draw_active, int snap_cursor, char *str)
|
||||||
{
|
{
|
||||||
char str[PATH_MAX + 100];
|
|
||||||
int cadence_compat = tclgetboolvar("cadence_compat");
|
|
||||||
int snap_cursor = tclgetboolvar("snap_cursor");
|
|
||||||
if(key==' ') {
|
if(key==' ') {
|
||||||
if(xctx->ui_state & STARTWIRE) { /* & instead of == 20190409 */
|
if(xctx->ui_state & STARTWIRE) { /* & instead of == 20190409 */
|
||||||
new_wire(RUBBER|CLEAR, xctx->mousex_snap, xctx->mousey_snap);
|
new_wire(RUBBER|CLEAR, xctx->mousex_snap, xctx->mousey_snap);
|
||||||
|
|
@ -2811,14 +2830,9 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
||||||
hilight_net_pin_mismatches();
|
hilight_net_pin_mismatches();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(key== 'W' /* && !xctx->ui_state */ && rstate == 0 && !cadence_compat) { /* create wire snapping to closest instance pin */
|
if(key== 'W' /* && !xctx->ui_state */ && rstate == 0 && !cadence_compat) { /* create wire snapping to closest instance pin (original keybind) */
|
||||||
if(xctx->semaphore >= 2) return;
|
if(xctx->semaphore >= 2) return;
|
||||||
if(infix_interface) {
|
|
||||||
snapped_wire(c_snap);
|
snapped_wire(c_snap);
|
||||||
} else {
|
|
||||||
xctx->ui_state |= MENUSTART;
|
|
||||||
xctx->ui_state2 = MENUSTARTSNAPWIRE;
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(key== 's' /* && !xctx->ui_state */ && rstate == 0 && cadence_compat) { /* create wire snapping to closest instance pin (cadence keybind) */
|
if(key== 's' /* && !xctx->ui_state */ && rstate == 0 && cadence_compat) { /* create wire snapping to closest instance pin (cadence keybind) */
|
||||||
|
|
@ -2841,6 +2855,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
||||||
xctx->last_command = 0;
|
xctx->last_command = 0;
|
||||||
xctx->ui_state |= MENUSTART;
|
xctx->ui_state |= MENUSTART;
|
||||||
xctx->ui_state2 = MENUSTARTWIRE;
|
xctx->ui_state2 = MENUSTARTWIRE;
|
||||||
|
if(prev_state & STARTWIRE) start_wire(xctx->mousex_snap, xctx->mousey_snap);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -2874,6 +2889,19 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
||||||
{
|
{
|
||||||
view_zoom(0.0); return;
|
view_zoom(0.0); return;
|
||||||
}
|
}
|
||||||
|
if(key=='z' && EQUAL_MODMASK && cadence_compat) /* toggle snap-cursor option */
|
||||||
|
{
|
||||||
|
if(tclgetboolvar("snap_cursor")) {
|
||||||
|
tclsetvar("snap_cursor", "0");
|
||||||
|
draw_snap_cursor(1);
|
||||||
|
xctx->closest_pin_found = 0;
|
||||||
|
xctx->prev_snapx = 0.0;
|
||||||
|
xctx->prev_snapy = 0.0;
|
||||||
|
} else {
|
||||||
|
tclsetvar("snap_cursor", "1");
|
||||||
|
if(wire_draw_active) draw_snap_cursor(3);
|
||||||
|
}
|
||||||
|
}
|
||||||
if(key=='p' && EQUAL_MODMASK) /* add symbol pin */
|
if(key=='p' && EQUAL_MODMASK) /* add symbol pin */
|
||||||
{
|
{
|
||||||
xctx->push_undo();
|
xctx->push_undo();
|
||||||
|
|
@ -3066,12 +3094,7 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
||||||
draw(); /* needed to ungrey or grey out components due to *_ignore attribute */
|
draw(); /* needed to ungrey or grey out components due to *_ignore attribute */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(key== 's' /* && !xctx->ui_state */ && rstate == 0 && cadence_compat) { /* create wire snapping to closest instance pin (cadence keybind) */
|
if((key=='s' && rstate == 0) && !cadence_compat) /* simulate (original keybind) */
|
||||||
if(xctx->semaphore >= 2) return;
|
|
||||||
snapped_wire(c_snap);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if((key=='s' && rstate == 0) && !cadence_compat) /* simulate, original binding for s */
|
|
||||||
{
|
{
|
||||||
if(xctx->semaphore >= 2) return;
|
if(xctx->semaphore >= 2) return;
|
||||||
if(waves_selected(event, key, state, button)) {
|
if(waves_selected(event, key, state, button)) {
|
||||||
|
|
@ -3596,6 +3619,16 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
||||||
place_net_label(0);
|
place_net_label(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(key=='L' && rstate == 0) { /* toggle orthogonal routing */
|
||||||
|
if(tclgetboolvar("orthogonal_wiring")){
|
||||||
|
tclsetboolvar("orthogonal_wiring", 0);
|
||||||
|
xctx->manhattan_lines = 0;
|
||||||
|
} else {
|
||||||
|
tclsetboolvar("orthogonal_wiring", 1);
|
||||||
|
}
|
||||||
|
redraw_w_a_l_r_p_z_rubbers(1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if(key=='F' && rstate == 0) /* flip */
|
if(key=='F' && rstate == 0) /* flip */
|
||||||
{
|
{
|
||||||
if(xctx->ui_state & STARTMOVE) move_objects(FLIP,0,0,0);
|
if(xctx->ui_state & STARTMOVE) move_objects(FLIP,0,0,0);
|
||||||
|
|
@ -4061,14 +4094,16 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
||||||
break_wires_at_pins(1);
|
break_wires_at_pins(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_button_press(int event, int state, int rstate, KeySym key, int button, int mx, int my,
|
static void handle_button_press(int event, int state, int rstate, KeySym key, int button, int mx, int my,
|
||||||
double c_snap, int draw_xhair, int crosshair_size, int enable_stretch, int aux )
|
double c_snap, int draw_xhair, int crosshair_size, int enable_stretch, int aux)
|
||||||
{
|
{
|
||||||
|
dbg(1, "callback(): ButtonPress ui_state=%d state=%d\n",xctx->ui_state,state);
|
||||||
int use_cursor_for_sel = tclgetintvar("use_cursor_for_selection");
|
int use_cursor_for_sel = tclgetintvar("use_cursor_for_selection");
|
||||||
int excl = xctx->ui_state & (STARTWIRE | STARTRECT | STARTLINE | STARTPOLYGON | STARTARC);
|
int excl = xctx->ui_state & (STARTWIRE | STARTRECT | STARTLINE | STARTPOLYGON | STARTARC);
|
||||||
dbg(1, "callback(): ButtonPress ui_state=%d state=%d\n",xctx->ui_state,state);
|
|
||||||
if(waves_selected(event, key, state, button)) {
|
if(waves_selected(event, key, state, button)) {
|
||||||
waves_callback(event, mx, my, key, button, aux, state);
|
waves_callback(event, mx, my, key, button, aux, state);
|
||||||
return;
|
return;
|
||||||
|
|
@ -4309,12 +4344,13 @@ static void handle_button_press(int event, int state, int rstate, KeySym key, in
|
||||||
return;
|
return;
|
||||||
} /* if(!excl) */
|
} /* if(!excl) */
|
||||||
} /* button==Button1 */
|
} /* button==Button1 */
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_button_release(int event, KeySym key, int state, int button, int mx, int my,
|
static void handle_button_release(int event, KeySym key, int state, int button, int mx, int my,
|
||||||
int aux, double c_snap, int enable_stretch, int draw_xhair, int snap_cursor, int wire_draw_active)
|
int aux, double c_snap, int enable_stretch, int draw_xhair, int snap_cursor, int wire_draw_active, char *str)
|
||||||
{
|
{
|
||||||
char str[PATH_MAX + 100];
|
|
||||||
if(waves_selected(event, key, state, button)) {
|
if(waves_selected(event, key, state, button)) {
|
||||||
waves_callback(event, mx, my, key, button, aux, state);
|
waves_callback(event, mx, my, key, button, aux, state);
|
||||||
return;
|
return;
|
||||||
|
|
@ -4409,10 +4445,12 @@ static void handle_button_release(int event, KeySym key, int state, int button,
|
||||||
}
|
}
|
||||||
if(draw_xhair) draw_crosshair(3, state); /* restore crosshair when selecting / unselecting */
|
if(draw_xhair) draw_crosshair(3, state); /* restore crosshair when selecting / unselecting */
|
||||||
if(snap_cursor && wire_draw_active) draw_snap_cursor(3);
|
if(snap_cursor && wire_draw_active) draw_snap_cursor(3);
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_double_click(int event, int state, KeySym key, int button,
|
static void handle_double_click(int event, int state, KeySym key, int button,
|
||||||
int mx, int my, int aux, int cadence_compat )
|
int mx, int my, int aux, int cadence_compat)
|
||||||
{
|
{
|
||||||
if( waves_selected(event, key, state, button)) {
|
if( waves_selected(event, key, state, button)) {
|
||||||
waves_callback(event, mx, my, key, button, aux, state);
|
waves_callback(event, mx, my, key, button, aux, state);
|
||||||
|
|
@ -4435,10 +4473,8 @@ static void handle_double_click(int event, int state, KeySym key, int button,
|
||||||
edit_property(0);
|
edit_property(0);
|
||||||
} else {
|
} else {
|
||||||
if(xctx->ui_state & STARTWIRE) {
|
if(xctx->ui_state & STARTWIRE) {
|
||||||
if( cadence_compat ) {
|
|
||||||
redraw_w_a_l_r_p_z_rubbers(1);
|
redraw_w_a_l_r_p_z_rubbers(1);
|
||||||
start_wire(mx, my);
|
start_wire(mx, my);
|
||||||
}
|
|
||||||
xctx->ui_state &= ~STARTWIRE;
|
xctx->ui_state &= ~STARTWIRE;
|
||||||
}
|
}
|
||||||
if(xctx->ui_state & STARTLINE) {
|
if(xctx->ui_state & STARTLINE) {
|
||||||
|
|
@ -4634,7 +4670,8 @@ int wire_draw_active = (xctx->ui_state & STARTWIRE) ||
|
||||||
|
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
handle_motion_notify(event, key, state, rstate, button, mx, my,
|
handle_motion_notify(event, key, state, rstate, button, mx, my,
|
||||||
aux, draw_xhair, enable_stretch, snap_cursor, wire_draw_active);
|
aux, draw_xhair, enable_stretch,
|
||||||
|
snap_cursor, wire_draw_active, str);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
|
|
@ -4642,7 +4679,8 @@ int wire_draw_active = (xctx->ui_state & STARTWIRE) ||
|
||||||
|
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
handle_key_press(event, key, state, rstate, mx, my, button, aux,
|
handle_key_press(event, key, state, rstate, mx, my, button, aux,
|
||||||
infix_interface, enable_stretch, win_path, c_snap);
|
infix_interface, enable_stretch, win_path, c_snap,
|
||||||
|
cadence_compat, wire_draw_active, snap_cursor, str);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
|
|
@ -4651,7 +4689,8 @@ int wire_draw_active = (xctx->ui_state & STARTWIRE) ||
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
handle_button_release(event, key, state, button, mx, my, aux, c_snap, enable_stretch, draw_xhair, snap_cursor, wire_draw_active);
|
handle_button_release(event, key, state, button, mx, my, aux, c_snap, enable_stretch,
|
||||||
|
draw_xhair, snap_cursor, wire_draw_active, str);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case -3: /* double click : edit prop */
|
case -3: /* double click : edit prop */
|
||||||
|
|
|
||||||
|
|
@ -7851,9 +7851,9 @@ set tctx::global_list {
|
||||||
PDK_ROOT PDK SKYWATER_MODELS SKYWATER_STDCELLS
|
PDK_ROOT PDK SKYWATER_MODELS SKYWATER_STDCELLS
|
||||||
INITIALINSTDIR INITIALLOADDIR INITIALPROPDIR INITIALTEXTDIR XSCHEM_LIBRARY_PATH
|
INITIALINSTDIR INITIALLOADDIR INITIALPROPDIR INITIALTEXTDIR XSCHEM_LIBRARY_PATH
|
||||||
add_all_windows_drives auto_hilight auto_hilight_graph_nodes autofocus_mainwindow
|
add_all_windows_drives auto_hilight auto_hilight_graph_nodes autofocus_mainwindow
|
||||||
autotrim_wires bespice_listen_port big_grid_points bus_replacement_char cadgrid cadlayers
|
autotrim_wires orthogonal_wiring snap_cursor bespice_listen_port big_grid_points bus_replacement_char cadgrid cadlayers
|
||||||
cadsnap cairo_font_name cairo_font_scale change_lw color_ps tctx::colors compare_sch constr_mv
|
cadsnap cadence_compat cairo_font_name cairo_font_scale change_lw color_ps tctx::colors compare_sch constr_mv
|
||||||
copy_cell crosshair_layer crosshair_size cursor_2_hook custom_label_prefix custom_token
|
copy_cell crosshair_layer crosshair_size cursor_2_hook snap_cursor_size custom_label_prefix custom_token
|
||||||
dark_colors dark_colorscheme dark_gui_colorscheme delay_flag
|
dark_colors dark_colorscheme dark_gui_colorscheme delay_flag
|
||||||
dim_bg dim_value disable_unique_names do_all_inst draw_crosshair
|
dim_bg dim_value disable_unique_names do_all_inst draw_crosshair
|
||||||
draw_grid draw_grid_axes draw_window edit_prop_pos edit_prop_size
|
draw_grid draw_grid_axes draw_window edit_prop_pos edit_prop_size
|
||||||
|
|
@ -8271,9 +8271,9 @@ proc build_widgets { {topwin {} } } {
|
||||||
global dark_gui_colorscheme draw_crosshair
|
global dark_gui_colorscheme draw_crosshair
|
||||||
global recentfile color_ps transparent_svg menu_debug_var enable_stretch
|
global recentfile color_ps transparent_svg menu_debug_var enable_stretch
|
||||||
global netlist_show flat_netlist split_files compare_sch intuitive_interface
|
global netlist_show flat_netlist split_files compare_sch intuitive_interface
|
||||||
global draw_grid big_grid_points sym_txt change_lw incr_hilight symbol_width
|
global draw_grid big_grid_points sym_txt change_lw incr_hilight symbol_width cadence_compat
|
||||||
global cadsnap cadgrid draw_window toolbar_visible hide_symbols undo_type
|
global cadsnap cadgrid draw_window toolbar_visible hide_symbols undo_type snap_cursor
|
||||||
global disable_unique_names persistent_command autotrim_wires en_hilight_conn_inst
|
global disable_unique_names persistent_command autotrim_wires infix_interface orthogonal_wiring en_hilight_conn_inst
|
||||||
global local_netlist_dir editor netlist_type netlist_dir spiceprefix initial_geometry
|
global local_netlist_dir editor netlist_type netlist_dir spiceprefix initial_geometry
|
||||||
if { $dark_gui_colorscheme} {
|
if { $dark_gui_colorscheme} {
|
||||||
set selectcolor white
|
set selectcolor white
|
||||||
|
|
@ -8396,6 +8396,10 @@ proc build_widgets { {topwin {} } } {
|
||||||
-onvalue disk -offvalue memory -command {switch_undo}
|
-onvalue disk -offvalue memory -command {switch_undo}
|
||||||
$topwin.menubar.option add checkbutton -label "Enable stretch" -variable enable_stretch \
|
$topwin.menubar.option add checkbutton -label "Enable stretch" -variable enable_stretch \
|
||||||
-selectcolor $selectcolor -accelerator Y
|
-selectcolor $selectcolor -accelerator Y
|
||||||
|
$topwin.menubar.option add checkbutton -label "Enable infix-interface" -variable infix_interface \
|
||||||
|
-selectcolor $selectcolor
|
||||||
|
$topwin.menubar.option add checkbutton -label "Enable orthogonal wiring" -variable orthogonal_wiring \
|
||||||
|
-selectcolor $selectcolor -accelerator Shift-L
|
||||||
$topwin.menubar.option add checkbutton -label "Unsel. partial sel. wires after stretch move" \
|
$topwin.menubar.option add checkbutton -label "Unsel. partial sel. wires after stretch move" \
|
||||||
-selectcolor $selectcolor -variable unselect_partial_sel_wires
|
-selectcolor $selectcolor -variable unselect_partial_sel_wires
|
||||||
|
|
||||||
|
|
@ -8414,6 +8418,8 @@ proc build_widgets { {topwin {} } } {
|
||||||
|
|
||||||
$topwin.menubar.option add checkbutton -label "Draw crosshair" \
|
$topwin.menubar.option add checkbutton -label "Draw crosshair" \
|
||||||
-variable draw_crosshair -selectcolor $selectcolor -accelerator {Alt-X}
|
-variable draw_crosshair -selectcolor $selectcolor -accelerator {Alt-X}
|
||||||
|
$topwin.menubar.option add checkbutton -label "Draw persistent snap cursor" -variable snap_cursor \
|
||||||
|
-selectcolor $selectcolor -accelerator {Alt-Z}
|
||||||
|
|
||||||
$topwin.menubar.option add command -label "Replace \[ and \] for buses in SPICE netlist" \
|
$topwin.menubar.option add command -label "Replace \[ and \] for buses in SPICE netlist" \
|
||||||
-command {
|
-command {
|
||||||
|
|
@ -9307,6 +9313,7 @@ set_ne ps_page_title 1 ;# add a title in the top left page corner
|
||||||
set_ne draw_crosshair 0
|
set_ne draw_crosshair 0
|
||||||
set_ne crosshair_layer 8 ;# Yellow
|
set_ne crosshair_layer 8 ;# Yellow
|
||||||
set_ne crosshair_size 0
|
set_ne crosshair_size 0
|
||||||
|
set_ne snap_cursor_size 6
|
||||||
set_ne ps_paper_size {a4 842 595}
|
set_ne ps_paper_size {a4 842 595}
|
||||||
set_ne transparent_svg 0
|
set_ne transparent_svg 0
|
||||||
set_ne only_probes 0 ; # 20110112
|
set_ne only_probes 0 ; # 20110112
|
||||||
|
|
@ -9336,13 +9343,12 @@ set_ne big_grid_points 0
|
||||||
set_ne draw_grid_axes 1
|
set_ne draw_grid_axes 1
|
||||||
set_ne persistent_command 0
|
set_ne persistent_command 0
|
||||||
set_ne intuitive_interface 1
|
set_ne intuitive_interface 1
|
||||||
set_ne infix_interface 1
|
|
||||||
set_ne orthogonal_wiring 0
|
|
||||||
set_ne snap_cursor 0
|
|
||||||
set_ne snap_cursor_size 6
|
|
||||||
set_ne cadence_compat 0
|
|
||||||
set_ne use_cursor_for_selection 0
|
set_ne use_cursor_for_selection 0
|
||||||
set_ne autotrim_wires 0
|
set_ne autotrim_wires 0
|
||||||
|
set_ne cadence_compat 0
|
||||||
|
set_ne infix_interface 1
|
||||||
|
set_ne snap_cursor 0
|
||||||
|
set_ne orthogonal_wiring 0
|
||||||
set_ne compare_sch 0
|
set_ne compare_sch 0
|
||||||
set_ne disable_unique_names 0
|
set_ne disable_unique_names 0
|
||||||
set_ne sym_txt 1
|
set_ne sym_txt 1
|
||||||
|
|
|
||||||
23
src/xschemrc
23
src/xschemrc
|
|
@ -226,6 +226,18 @@
|
||||||
#### if not set show selected items at end of drag. Default: enabled (1)
|
#### if not set show selected items at end of drag. Default: enabled (1)
|
||||||
# set incremental_select 0
|
# set incremental_select 0
|
||||||
|
|
||||||
|
#### if set to 1, pressing 'w', 'l', 'r', 'C', or 'Ctrl+C' will immediately place the
|
||||||
|
#### corresponding component at current cursor position without waiting for Button1 (LMB) click.
|
||||||
|
#### This setting can be disabled via the Options menu
|
||||||
|
#### default: 0
|
||||||
|
# set infix_interface 1
|
||||||
|
|
||||||
|
#### wires are drawn in free-form mode with this mode enabled (default).
|
||||||
|
#### if set to 0, wires drawn on the schematic will no longer strictly
|
||||||
|
#### follow orthogonal routes to connect two distinct points together.
|
||||||
|
#### default: 0
|
||||||
|
# set orthogonal_wiring 1
|
||||||
|
|
||||||
#### if set to 1 automatically join/trim wires while editing
|
#### if set to 1 automatically join/trim wires while editing
|
||||||
#### this may slow down on rally big designs. Can be disabled via menu
|
#### this may slow down on rally big designs. Can be disabled via menu
|
||||||
#### default: 0
|
#### default: 0
|
||||||
|
|
@ -271,7 +283,16 @@
|
||||||
# set crosshair_layer 8
|
# set crosshair_layer 8
|
||||||
|
|
||||||
#### set crosshair size; Default: 0 (full screen spanning crosshair)
|
#### set crosshair size; Default: 0 (full screen spanning crosshair)
|
||||||
# set crosshair_size 5
|
# set crosshair_size 2
|
||||||
|
|
||||||
|
#### enable drawing a diamond-shaped cursor at the closest circuit endpoint. Default: disabled (0)
|
||||||
|
# set snap_cursor 1
|
||||||
|
|
||||||
|
#### set snap_cursor_size; Default: 6 (Diamond-shaped cursor that snaps to nearest circuit endpoint)
|
||||||
|
# set snap_cursor_size 6
|
||||||
|
|
||||||
|
#### set cadence_compat; Default: 0 (Cadence-style keybinds are not used by default)
|
||||||
|
# set cadence_compat 1
|
||||||
|
|
||||||
#### enable drawing a diamond-shaped cursor at the closest circuit endpoint. Default: disabled (0)
|
#### enable drawing a diamond-shaped cursor at the closest circuit endpoint. Default: disabled (0)
|
||||||
# set snap_cursor 1
|
# set snap_cursor 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue