small ansi-C compliance changes
This commit is contained in:
parent
dafb0c870d
commit
31d5e0938f
|
|
@ -2477,7 +2477,8 @@ static void handle_enter_notify(int draw_xhair, int crosshair_size)
|
||||||
}
|
}
|
||||||
|
|
||||||
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[PATH_MAX + 100];
|
char str[PATH_MAX + 100];
|
||||||
if( waves_selected(event, key, state, button)) {
|
if( waves_selected(event, key, state, button)) {
|
||||||
|
|
@ -2602,12 +2603,18 @@ static void handle_motion_notify(int event, KeySym key, int state, int rstate, i
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
int cadence_compat, int wire_draw_active, int snap_cursor)
|
||||||
{
|
{
|
||||||
char str[PATH_MAX + 100];
|
char str[PATH_MAX + 100];
|
||||||
|
int dr_gr;
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case '0' ... '4':
|
case '0':
|
||||||
|
case '1':
|
||||||
|
case '2':
|
||||||
|
case '3':
|
||||||
|
case '4':
|
||||||
if(state == 0) { /* toggle pin logic level */
|
if(state == 0) { /* toggle pin logic level */
|
||||||
if(xctx->semaphore >= 2) break;
|
if(xctx->semaphore >= 2) break;
|
||||||
if(key == '4') logic_set(-1, 1, NULL);
|
if(key == '4') logic_set(-1, 1, NULL);
|
||||||
|
|
@ -2638,7 +2645,10 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
||||||
} /* /20110112 */
|
} /* /20110112 */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '6' ... '9':
|
case '6':
|
||||||
|
case '7':
|
||||||
|
case '8':
|
||||||
|
case '9':
|
||||||
if(state==ControlMask) { /* choose layer */
|
if(state==ControlMask) { /* choose layer */
|
||||||
char n[30];
|
char n[30];
|
||||||
xctx->rectcolor = (int)key - '0'+4;
|
xctx->rectcolor = (int)key - '0'+4;
|
||||||
|
|
@ -3786,7 +3796,6 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '%': /* toggle draw grid */
|
case '%': /* toggle draw grid */
|
||||||
int dr_gr;
|
|
||||||
dr_gr = tclgetboolvar("draw_grid");
|
dr_gr = tclgetboolvar("draw_grid");
|
||||||
dr_gr =!dr_gr;
|
dr_gr =!dr_gr;
|
||||||
if(dr_gr) {
|
if(dr_gr) {
|
||||||
|
|
@ -4118,9 +4127,9 @@ static void handle_key_press(int event, KeySym key, int state, int rstate, int m
|
||||||
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;
|
||||||
|
|
@ -4366,7 +4375,8 @@ static void handle_button_press(int event, int state, int rstate, KeySym key, in
|
||||||
}
|
}
|
||||||
|
|
||||||
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[PATH_MAX + 100];
|
char str[PATH_MAX + 100];
|
||||||
if(waves_selected(event, key, state, button)) {
|
if(waves_selected(event, key, state, button)) {
|
||||||
|
|
@ -4595,7 +4605,8 @@ int wire_draw_active = (xctx->ui_state & STARTWIRE) ||
|
||||||
redraw_only = 1;
|
redraw_only = 1;
|
||||||
new_schematic("switch_no_tcl_ctx", win_path, "", 1);
|
new_schematic("switch_no_tcl_ctx", win_path, "", 1);
|
||||||
} else {
|
} else {
|
||||||
dbg(1, "callback(): switching window context: %s --> %s, semaphore=%d\n", old_win_path, win_path, xctx->semaphore);
|
dbg(1, "callback(): switching window context: %s --> %s, semaphore=%d\n",
|
||||||
|
old_win_path, win_path, xctx->semaphore);
|
||||||
new_schematic("switch", win_path, "", 1);
|
new_schematic("switch", win_path, "", 1);
|
||||||
}
|
}
|
||||||
tclvareval("housekeeping_ctx", NULL);
|
tclvareval("housekeeping_ctx", NULL);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue