Index: src/action_funclist.h =================================================================== --- src/action_funclist.h (revision 1105) +++ src/action_funclist.h (revision 1106) @@ -116,6 +116,7 @@ action_entry(ToggleLocalRef) action_entry(ToggleCheckPlanes) action_entry(ToggleUniqueNames) +action_entry(ToggleStroke) action_entry(Via) action_entry(ViaByName) action_entry(Value) Index: src/const.h =================================================================== --- src/const.h (revision 1105) +++ src/const.h (revision 1106) @@ -310,6 +310,7 @@ #define ENABLEMINCUTFLAG 0x00400000 #define SNAPOFFGRIDLINEFLAG 0x00800000 #define HIGHLIGHTONPOINTFLAG 0x01000000 +#define ENABLESTROKEFLAG 0x02000000 /* --------------------------------------------------------------------------- * object types Index: src/flags.c =================================================================== --- src/flags.c (revision 1105) +++ src/flags.c (revision 1106) @@ -283,6 +283,8 @@ , {"enablemincut", FlagTESTFLAG, ENABLEMINCUTFLAG} , + {"enablestroke", FlagTESTFLAG, ENABLESTROKEFLAG} + , {"snapoffgridline", FlagTESTFLAG, SNAPOFFGRIDLINEFLAG} , {"highlightonpoint", FlagTESTFLAG, HIGHLIGHTONPOINTFLAG} Index: src/global.h =================================================================== --- src/global.h (revision 1105) +++ src/global.h (revision 1106) @@ -672,7 +672,8 @@ /* connections is done */ AutoPlace, /* flag which says we should force placement of the windows on startup */ - EnableMincut; /* Enable calculating mincut on shorts (rats_mincut.c) when non-zero */ + EnableMincut, /* Enable calculating mincut on shorts (rats_mincut.c) when non-zero */ + EnableStroke; /* Enable libstroke gesutres on middle mouse button when non-zero */ } SettingType, *SettingTypePtr; /* ---------------------------------------------------------------------- Index: src/gui_act.c =================================================================== --- src/gui_act.c (revision 1105) +++ src/gui_act.c (revision 1106) @@ -342,6 +342,10 @@ TOGGLE_FLAG(ENABLEMINCUTFLAG, PCB); break; + case F_ToggleStroke: + TOGGLE_FLAG(ENABLESTROKEFLAG, PCB); + break; + case F_ToggleShowDRC: TOGGLE_FLAG(SHOWDRCFLAG, PCB); break; @@ -706,18 +710,12 @@ case F_PolygonHole: SetMode(POLYGONHOLE_MODE); break; -#ifndef HAVE_LIBSTROKE case F_Release: - ReleaseMode(); - break; -#else - case F_Release: - if (mid_stroke) + if ((mid_stroke) && (Settings.EnableStroke)) FinishStroke(); else ReleaseMode(); break; -#endif case F_Remove: SetMode(REMOVE_MODE); break; @@ -728,12 +726,13 @@ SetMode(ROTATE_MODE); break; case F_Stroke: -#ifdef HAVE_LIBSTROKE - mid_stroke = true; - StrokeBox.X1 = Crosshair.X; - StrokeBox.Y1 = Crosshair.Y; - break; -#else + if (Settings.EnableStroke) { + fprintf(stderr, "stroke: MIID!\n"); + mid_stroke = true; + StrokeBox.X1 = Crosshair.X; + StrokeBox.Y1 = Crosshair.Y; + break; + } /* Handle middle mouse button restarts of drawing mode. If not in | a drawing mode, middle mouse button will select objects. */ @@ -753,7 +752,6 @@ NotifyMode(); } break; -#endif case F_Text: SetMode(TEXT_MODE); break; Index: src/main.c =================================================================== --- src/main.c (revision 1105) +++ src/main.c (revision 1106) @@ -1310,6 +1310,16 @@ */ ISET(EnableMincut, 1, "enable-mincut", "global enable mincut (1=yes, 0=no)"), +/* %start-doc options "1 General Options" +@ftable @code +@item --enable-stroke +Whether to enable libstroke support (1=yes, 0=no); when disabled, it overrides the setting +read from the pcb. Will not really work unless the libstroke plugin is also loaded. +@end ftable +%end-doc +*/ + ISET(EnableStroke, 1, "enable-stroke", "global enable libstroke (1=yes, 0=no)"), + }; REGISTER_ATTRIBUTES(main_attribute_list) Index: src/strflags.c =================================================================== --- src/strflags.c (revision 1105) +++ src/strflags.c (revision 1106) @@ -133,7 +133,8 @@ {LOCKNAMESFLAG, N("locknames"), 1}, {ONLYNAMESFLAG, N("onlynames"), 1}, {HIDENAMESFLAG, N("hidenames"), 1}, - {ENABLEMINCUTFLAG, N("enablemincut"), 1} + {ENABLEMINCUTFLAG, N("enablemincut"), 1}, + {ENABLESTROKEFLAG, N("enablestroke"), 1} }; #undef N