[Code Refactoring]: Modified the source code for compatibility with the upstream repo (due to 'infix_wire' feature integration with new name 'infix_interface')
This commit is contained in:
parent
24bfb5b363
commit
8ce32b73b7
|
|
@ -2202,6 +2202,7 @@ int callback(const char *winpath, int event, int mx, int my, KeySym key,
|
||||||
XKeyboardState kbdstate;
|
XKeyboardState kbdstate;
|
||||||
#endif
|
#endif
|
||||||
int draw_xhair = tclgetboolvar("draw_crosshair");
|
int draw_xhair = tclgetboolvar("draw_crosshair");
|
||||||
|
int infix_interface = tclgetboolvar("infix_interface");
|
||||||
int rstate; /* (reduced state, without ShiftMask) */
|
int rstate; /* (reduced state, without ShiftMask) */
|
||||||
|
|
||||||
/* this fix uses an alternative method for getting mouse coordinates on KeyPress/KeyRelease
|
/* this fix uses an alternative method for getting mouse coordinates on KeyPress/KeyRelease
|
||||||
|
|
@ -2748,16 +2749,17 @@ int rstate; /* (reduced state, without ShiftMask) */
|
||||||
{
|
{
|
||||||
int prev_state = xctx->ui_state;
|
int prev_state = xctx->ui_state;
|
||||||
if(xctx->semaphore >= 2) break;
|
if(xctx->semaphore >= 2) break;
|
||||||
if(tclgetboolvar("infix_wire")) {
|
|
||||||
start_wire(xctx->mousex_snap, xctx->mousey_snap);
|
if(infix_interface) {
|
||||||
} else if(prev_state == STARTWIRE) {
|
|
||||||
start_wire(xctx->mousex_snap, xctx->mousey_snap);
|
start_wire(xctx->mousex_snap, xctx->mousey_snap);
|
||||||
|
if(prev_state == STARTWIRE) {
|
||||||
|
tcleval("set constr_mv 0");
|
||||||
|
xctx->constr_mv = 0;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
tcleval("xschem wire");
|
xctx->last_command = 0;
|
||||||
}
|
xctx->ui_state |= MENUSTART;
|
||||||
if(prev_state == STARTWIRE) {
|
xctx->ui_state2 = MENUSTARTWIRE;
|
||||||
tcleval("set constr_mv 0");
|
|
||||||
xctx->constr_mv = 0;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -2805,10 +2807,15 @@ int rstate; /* (reduced state, without ShiftMask) */
|
||||||
{
|
{
|
||||||
if(xctx->semaphore >= 2) break;
|
if(xctx->semaphore >= 2) break;
|
||||||
dbg(1, "callback(): start polygon\n");
|
dbg(1, "callback(): start polygon\n");
|
||||||
xctx->mx_double_save=xctx->mousex_snap;
|
if(infix_interface) {
|
||||||
xctx->my_double_save=xctx->mousey_snap;
|
xctx->mx_double_save = xctx->mousex_snap;
|
||||||
xctx->last_command = 0;
|
xctx->my_double_save = xctx->mousey_snap;
|
||||||
new_polygon(PLACE, xctx->mousex_snap, xctx->mousey_snap);
|
xctx->last_command = 0;
|
||||||
|
new_polygon(PLACE, xctx->mousex_snap, xctx->mousey_snap);
|
||||||
|
} else {
|
||||||
|
xctx->ui_state |= MENUSTART;
|
||||||
|
xctx->ui_state2 = MENUSTARTPOLYGON;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(key=='P' && rstate == 0) /* pan, other way to. */
|
if(key=='P' && rstate == 0) /* pan, other way to. */
|
||||||
|
|
@ -2957,10 +2964,15 @@ int rstate; /* (reduced state, without ShiftMask) */
|
||||||
if(key=='r' /* && !xctx->ui_state */ && rstate==0) /* start rect */
|
if(key=='r' /* && !xctx->ui_state */ && rstate==0) /* start rect */
|
||||||
{
|
{
|
||||||
dbg(1, "callback(): start rect\n");
|
dbg(1, "callback(): start rect\n");
|
||||||
xctx->mx_double_save=xctx->mousex_snap;
|
if(infix_interface) {
|
||||||
xctx->my_double_save=xctx->mousey_snap;
|
xctx->mx_double_save=xctx->mousex_snap;
|
||||||
xctx->last_command = 0;
|
xctx->my_double_save=xctx->mousey_snap;
|
||||||
new_rect(PLACE,xctx->mousex_snap, xctx->mousey_snap);
|
xctx->last_command = 0;
|
||||||
|
new_rect(PLACE,xctx->mousex_snap, xctx->mousey_snap);
|
||||||
|
} else{
|
||||||
|
xctx->ui_state |= MENUSTART;
|
||||||
|
xctx->ui_state2 = MENUSTARTRECT;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(key=='V' && rstate == ControlMask) /* toggle spice/vhdl netlist */
|
if(key=='V' && rstate == ControlMask) /* toggle spice/vhdl netlist */
|
||||||
|
|
@ -3130,19 +3142,29 @@ int rstate; /* (reduced state, without ShiftMask) */
|
||||||
if(key=='C' /* && !xctx->ui_state */ && rstate == 0) /* place arc */
|
if(key=='C' /* && !xctx->ui_state */ && rstate == 0) /* place arc */
|
||||||
{
|
{
|
||||||
if(xctx->semaphore >= 2) break;
|
if(xctx->semaphore >= 2) break;
|
||||||
xctx->mx_double_save=xctx->mousex_snap;
|
if(infix_interface) {
|
||||||
xctx->my_double_save=xctx->mousey_snap;
|
xctx->mx_double_save=xctx->mousex_snap;
|
||||||
xctx->last_command = 0;
|
xctx->my_double_save=xctx->mousey_snap;
|
||||||
new_arc(PLACE, 180., xctx->mousex_snap, xctx->mousey_snap);
|
xctx->last_command = 0;
|
||||||
|
new_arc(PLACE, 180., xctx->mousex_snap, xctx->mousey_snap);
|
||||||
|
} else {
|
||||||
|
xctx->ui_state |= MENUSTART;
|
||||||
|
xctx->ui_state2 = MENUSTARTARC;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(key=='C' /* && !xctx->ui_state */ && rstate == ControlMask) /* place circle */
|
if(key=='C' /* && !xctx->ui_state */ && rstate == ControlMask) /* place circle */
|
||||||
{
|
{
|
||||||
if(xctx->semaphore >= 2) break;
|
if(xctx->semaphore >= 2) break;
|
||||||
xctx->mx_double_save=xctx->mousex_snap;
|
if(infix_interface) {
|
||||||
xctx->my_double_save=xctx->mousey_snap;
|
xctx->mx_double_save=xctx->mousex_snap;
|
||||||
xctx->last_command = 0;
|
xctx->my_double_save=xctx->mousey_snap;
|
||||||
new_arc(PLACE, 360., xctx->mousex_snap, xctx->mousey_snap);
|
xctx->last_command = 0;
|
||||||
|
new_arc(PLACE, 360., xctx->mousex_snap, xctx->mousey_snap);
|
||||||
|
} else {
|
||||||
|
xctx->ui_state |= MENUSTART;
|
||||||
|
xctx->ui_state2 = MENUSTARTCIRCLE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(key=='O' && rstate == ControlMask ) /* load most recent tile */
|
if(key=='O' && rstate == ControlMask ) /* load most recent tile */
|
||||||
|
|
@ -3452,10 +3474,17 @@ int rstate; /* (reduced state, without ShiftMask) */
|
||||||
if(key=='l' /* && !xctx->ui_state */ && rstate == 0) /* start line */
|
if(key=='l' /* && !xctx->ui_state */ && rstate == 0) /* start line */
|
||||||
{
|
{
|
||||||
int prev_state = xctx->ui_state;
|
int prev_state = xctx->ui_state;
|
||||||
start_line(xctx->mousex_snap, xctx->mousey_snap);
|
if(xctx->semaphore>=2) break;
|
||||||
if(prev_state == STARTLINE) {
|
if(infix_interface) {
|
||||||
tcleval("set constr_mv 0" );
|
start_line(xctx->mousex_snap, xctx->mousey_snap);
|
||||||
xctx->constr_mv=0;
|
if(prev_state == STARTLINE) {
|
||||||
|
tcleval("set constr_mv 0" );
|
||||||
|
xctx->constr_mv=0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
xctx->last_command = 0;
|
||||||
|
xctx->ui_state |= MENUSTART;
|
||||||
|
xctx->ui_state2 = MENUSTARTLINE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7589,7 +7589,7 @@ 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 infix_wire orthogonal_wiring bespice_listen_port big_grid_points bus_replacement_char cadgrid cadlayers
|
autotrim_wires infix_interface orthogonal_wiring 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 cairo_font_name cairo_font_scale change_lw color_ps tctx::colors compare_sch constr_mv
|
||||||
copy_cell crosshair_layer custom_label_prefix custom_token dark_colors dark_colorscheme
|
copy_cell crosshair_layer custom_label_prefix custom_token dark_colors dark_colorscheme
|
||||||
dark_gui_colorscheme delay_flag dim_bg dim_value disable_unique_names
|
dark_gui_colorscheme delay_flag dim_bg dim_value disable_unique_names
|
||||||
|
|
@ -8010,7 +8010,7 @@ proc build_widgets { {topwin {} } } {
|
||||||
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
|
||||||
global cadsnap cadgrid draw_window toolbar_visible hide_symbols undo_type
|
global cadsnap cadgrid draw_window toolbar_visible hide_symbols undo_type
|
||||||
global disable_unique_names persistent_command autotrim_wires infix_wire orthogonal_wiring 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
|
||||||
|
|
@ -8133,7 +8133,7 @@ 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-wire" -variable infix_wire \
|
$topwin.menubar.option add checkbutton -label "Enable infix-interface" -variable infix_interface \
|
||||||
-selectcolor $selectcolor
|
-selectcolor $selectcolor
|
||||||
$topwin.menubar.option add checkbutton -label "Enable orthogonal wiring" -variable orthogonal_wiring \
|
$topwin.menubar.option add checkbutton -label "Enable orthogonal wiring" -variable orthogonal_wiring \
|
||||||
-selectcolor $selectcolor -accelerator Shift+L
|
-selectcolor $selectcolor -accelerator Shift+L
|
||||||
|
|
@ -9067,7 +9067,7 @@ 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 autotrim_wires 0
|
set_ne autotrim_wires 0
|
||||||
set_ne infix_wire 0
|
set_ne infix_interface 0
|
||||||
set_ne orthogonal_wiring 1
|
set_ne orthogonal_wiring 1
|
||||||
set_ne compare_sch 0
|
set_ne compare_sch 0
|
||||||
set_ne disable_unique_names 0
|
set_ne disable_unique_names 0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue