Index: trunk/doc/conf/tree/editor.html =================================================================== --- trunk/doc/conf/tree/editor.html (revision 25235) +++ trunk/doc/conf/tree/editor.html (revision 25236) @@ -4,7 +4,6 @@
node name type flags description
zoom real 0 default zoom -
mode integer 0 currently active mode
buffer_number integer 0 number of the current buffer
clear_line boolean 0 new lines/arc clear polygons.
clear_polypoly boolean 0 new polygons clear polygons. @@ -52,6 +51,7 @@
beep_when_finished boolean 0 flag if a signal should be produced when searching of connections is done
undo_warning_size integer 0 warn the user when undo list exceeds this amount of kilobytes in memory
subc_conv_refdes string 0 automatic refdes value assigned to new subcircuits on conversion from objects - if empty, no refdes text or attribute is added; if the value is , the refdes text object is added but no refdes attribute is created +
mode integer 0 [hidlib] currently active mode
grid_unit unit 0 [hidlib] select whether you draw in mm or mil
grid coord 0 [hidlib] grid in pcb-units
grids list 0 [hidlib] grid in grid-string format Index: trunk/src/board.c =================================================================== --- trunk/src/board.c (revision 25235) +++ trunk/src/board.c (revision 25236) @@ -265,7 +265,7 @@ /* crosshair range is different if pastebuffer-mode * is enabled */ - if (conf_core.editor.mode == PCB_MODE_PASTE_BUFFER) + if (pcbhl_conf.editor.mode == PCB_MODE_PASTE_BUFFER) pcb_crosshair_set_range(PCB_PASTEBUFFER->X - PCB_PASTEBUFFER->BoundingBox.X1, PCB_PASTEBUFFER->Y - PCB_PASTEBUFFER->BoundingBox.Y1, MAX(0, Index: trunk/src/conf_act.c =================================================================== --- trunk/src/conf_act.c (revision 25235) +++ trunk/src/conf_act.c (revision 25236) @@ -252,7 +252,7 @@ id = pcb_tool_lookup(dst); if (id >= 0) { - PCB_ACT_IRES(conf_core.editor.mode == id); + PCB_ACT_IRES(pcbhl_conf.editor.mode == id); return 0; } PCB_ACT_IRES(-1); Index: trunk/src/conf_core.h =================================================================== --- trunk/src/conf_core.h (revision 25235) +++ trunk/src/conf_core.h (revision 25236) @@ -19,7 +19,6 @@ const struct { /* editor */ CFT_REAL zoom; /* default zoom */ - CFT_INTEGER mode; /* currently active mode */ CFT_INTEGER buffer_number; /* number of the current buffer */ CFT_BOOLEAN clear_line; /* new lines/arc clear polygons. */ CFT_BOOLEAN clear_polypoly; /* new polygons clear polygons. */ Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 25235) +++ trunk/src/crosshair.c (revision 25236) @@ -753,7 +753,7 @@ double sq_dist; /* avoid snapping to an object if it is in the same subc */ - if ((snapo != NULL) && (conf_core.editor.mode == PCB_MODE_MOVE) && (pcb_crosshair.AttachedObject.Type == PCB_OBJ_SUBC)) { + if ((snapo != NULL) && (pcbhl_conf.editor.mode == PCB_MODE_MOVE) && (pcb_crosshair.AttachedObject.Type == PCB_OBJ_SUBC)) { pcb_any_obj_t *parent = (pcb_any_obj_t *)pcb_obj_parent_subc(snapo); int n; pcb_cardinal_t parent_id = snapo->ID; @@ -902,7 +902,7 @@ ans = pcb_search_grid_slop(pcb_crosshair.X, pcb_crosshair.Y, PCB_OBJ_PSTK | PCB_OBJ_SUBC_PART, &ptr1, &ptr2, &ptr3); /* Avoid snapping padstack to any other padstack */ - if (conf_core.editor.mode == PCB_MODE_MOVE && pcb_crosshair.AttachedObject.Type == PCB_OBJ_PSTK && (ans & PCB_OBJ_PSTK)) + if (pcbhl_conf.editor.mode == PCB_MODE_MOVE && pcb_crosshair.AttachedObject.Type == PCB_OBJ_PSTK && (ans & PCB_OBJ_PSTK)) ans = PCB_OBJ_VOID; if (ans != PCB_OBJ_VOID) { @@ -966,7 +966,7 @@ if (conf_core.editor.highlight_on_point) onpoint_work(&pcb_crosshair, pcb_crosshair.X, pcb_crosshair.Y); - if (conf_core.editor.mode == PCB_MODE_ARROW) { + if (pcbhl_conf.editor.mode == PCB_MODE_ARROW) { ans = pcb_search_grid_slop(pcb_crosshair.X, pcb_crosshair.Y, PCB_OBJ_LINE_POINT, &ptr1, &ptr2, &ptr3); if (ans == PCB_OBJ_VOID) { if ((pcb_gui != NULL) && (pcb_gui->point_cursor != NULL)) @@ -978,7 +978,7 @@ } } - if (conf_core.editor.mode == PCB_MODE_LINE && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST && conf_core.editor.auto_drc) + if (pcbhl_conf.editor.mode == PCB_MODE_LINE && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST && conf_core.editor.auto_drc) pcb_line_enforce_drc(); pcb_gui->set_crosshair(pcb_crosshair.X, pcb_crosshair.Y, HID_SC_DO_NOTHING); @@ -1087,7 +1087,7 @@ void pcb_crosshair_range_to_buffer(void) { - if (conf_core.editor.mode == PCB_MODE_PASTE_BUFFER) { + if (pcbhl_conf.editor.mode == PCB_MODE_PASTE_BUFFER) { if (pcb_set_buffer_bbox(PCB_PASTEBUFFER) == 0) { pcb_crosshair_set_range(PCB_PASTEBUFFER->X - PCB_PASTEBUFFER->bbox_naked.X1, PCB_PASTEBUFFER->Y - PCB_PASTEBUFFER->bbox_naked.Y1, Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 25235) +++ trunk/src/gui_act.c (revision 25236) @@ -245,7 +245,7 @@ case F_ToggleAutoDRC: pcb_notify_crosshair_change(pcb_false); conf_toggle_editor(auto_drc); - if (conf_core.editor.auto_drc && conf_core.editor.mode == PCB_MODE_LINE) { + if (conf_core.editor.auto_drc && pcbhl_conf.editor.mode == PCB_MODE_LINE) { if (pcb_data_clear_flag(PCB->Data, PCB_FLAG_FOUND, 1, 1) > 0) { pcb_undo_inc_serial(); pcb_draw(); @@ -421,13 +421,13 @@ break; case F_Cancel: { - int saved_mode = conf_core.editor.mode; + int saved_mode = pcbhl_conf.editor.mode; pcb_tool_select_by_id(&PCB->hidlib, saved_mode); } break; case F_Escape: { - switch (conf_core.editor.mode) { + switch (pcbhl_conf.editor.mode) { case PCB_MODE_VIA: case PCB_MODE_PASTE_BUFFER: case PCB_MODE_TEXT: @@ -531,13 +531,13 @@ } /* Handle middle mouse button restarts of drawing mode. If not in a drawing mode, middle mouse button will select objects. */ - if (conf_core.editor.mode == PCB_MODE_LINE && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST) + if (pcbhl_conf.editor.mode == PCB_MODE_LINE && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST) pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_LINE); - else if (conf_core.editor.mode == PCB_MODE_ARC && pcb_crosshair.AttachedBox.State != PCB_CH_STATE_FIRST) + else if (pcbhl_conf.editor.mode == PCB_MODE_ARC && pcb_crosshair.AttachedBox.State != PCB_CH_STATE_FIRST) pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARC); - else if (conf_core.editor.mode == PCB_MODE_RECTANGLE && pcb_crosshair.AttachedBox.State != PCB_CH_STATE_FIRST) + else if (pcbhl_conf.editor.mode == PCB_MODE_RECTANGLE && pcb_crosshair.AttachedBox.State != PCB_CH_STATE_FIRST) pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_RECTANGLE); - else if (conf_core.editor.mode == PCB_MODE_POLYGON && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST) + else if (pcbhl_conf.editor.mode == PCB_MODE_POLYGON && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST) pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_POLYGON); else { pcb_tool_save(&PCB->hidlib); @@ -857,7 +857,7 @@ pcb_notify_crosshair_change(pcb_false); set_same_(((pcb_line_t *) ptr2)->Thickness, -1, -1, ((pcb_line_t *) ptr2)->Clearance / 2, NULL); layer = (pcb_layer_t *) ptr1; - if (conf_core.editor.mode != PCB_MODE_LINE) + if (pcbhl_conf.editor.mode != PCB_MODE_LINE) pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_LINE); pcb_notify_crosshair_change(pcb_true); pcb_event(&PCB->hidlib, PCB_EVENT_ROUTE_STYLES_CHANGED, NULL); @@ -867,7 +867,7 @@ pcb_notify_crosshair_change(pcb_false); set_same_(((pcb_arc_t *) ptr2)->Thickness, -1, -1, ((pcb_arc_t *) ptr2)->Clearance / 2, NULL); layer = (pcb_layer_t *) ptr1; - if (conf_core.editor.mode != PCB_MODE_ARC) + if (pcbhl_conf.editor.mode != PCB_MODE_ARC) pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARC); pcb_notify_crosshair_change(pcb_true); pcb_event(&PCB->hidlib, PCB_EVENT_ROUTE_STYLES_CHANGED, NULL); Index: trunk/src/hidlib.c =================================================================== --- trunk/src/hidlib.c (revision 25235) +++ trunk/src/hidlib.c (revision 25236) @@ -26,7 +26,6 @@ #include "config.h" -#include "conf_core.h" #include "hidlib_conf.h" #include "tool.h" #include "event.h" @@ -37,7 +36,7 @@ static void hidlib_gui_init_ev(pcb_hidlib_t *hidlib, void *user_data, int argc, pcb_event_arg_t argv[]) { pcb_tool_gui_init(); - pcb_gui->set_mouse_cursor(hidlib, conf_core.editor.mode); /* make sure the mouse cursor is set up now that it is registered */ + pcb_gui->set_mouse_cursor(hidlib, pcbhl_conf.editor.mode); /* make sure the mouse cursor is set up now that it is registered */ } Index: trunk/src/hidlib_conf.h =================================================================== --- trunk/src/hidlib_conf.h (revision 25235) +++ trunk/src/hidlib_conf.h (revision 25236) @@ -71,6 +71,7 @@ } appearance; const struct { + CFT_INTEGER mode; /* currently active mode */ CFT_UNIT grid_unit; /* select whether you draw in mm or mil */ CFT_COORD grid; /* grid in pcb-units */ CFT_LIST grids; /* grid in grid-string format */ Index: trunk/src/polygon_act.c =================================================================== --- trunk/src/polygon_act.c (revision 25235) +++ trunk/src/polygon_act.c (revision 25236) @@ -32,8 +32,9 @@ * */ #include "config.h" -#include "conf_core.h" +#include "hidlib_conf.h" + #include "board.h" #include "data.h" #include "undo.h" @@ -97,7 +98,7 @@ PCB_ACT_CONVARG(1, FGW_KEYWORD, Polygon, op = fgw_keyword(&argv[1])); - if ((argc > 1) && ((conf_core.editor.mode == PCB_MODE_POLYGON) || (conf_core.editor.mode == PCB_MODE_POLYGON_HOLE))) { + if ((argc > 1) && ((pcbhl_conf.editor.mode == PCB_MODE_POLYGON) || (pcbhl_conf.editor.mode == PCB_MODE_POLYGON_HOLE))) { pcb_notify_crosshair_change(pcb_false); switch(op) { /* close open polygon if possible */ Index: trunk/src/tool.c =================================================================== --- trunk/src/tool.c (revision 25235) +++ trunk/src/tool.c (revision 25236) @@ -29,6 +29,7 @@ #include "tool.h" #include "board.h" +#include "hidlib_conf.h" #include "conf_core.h" #include "crosshair.h" #include "data.h" @@ -133,7 +134,7 @@ id = PCB_MODE_ARROW; } - pcb_tool_prev_id = conf_core.editor.mode; + pcb_tool_prev_id = pcbhl_conf.editor.mode; pcb_tool_next_id = id; uninit_current_tool(); sprintf(id_s, "%d", id); @@ -171,7 +172,7 @@ int pcb_tool_save(pcb_hidlib_t *hidlib) { - save_stack[save_position] = conf_core.editor.mode; + save_stack[save_position] = pcbhl_conf.editor.mode; if (save_position < PCB_MAX_MODESTACK_DEPTH - 1) save_position++; else @@ -205,9 +206,9 @@ #define wrap(func, err_ret, prefix, args) \ do { \ const pcb_tool_t *tool; \ - if ((conf_core.editor.mode < 0) || (conf_core.editor.mode >= vtp0_len(&pcb_tools))) \ + if ((pcbhl_conf.editor.mode < 0) || (pcbhl_conf.editor.mode >= vtp0_len(&pcb_tools))) \ { err_ret; } \ - tool = (const pcb_tool_t *)pcb_tools.array[conf_core.editor.mode]; \ + tool = (const pcb_tool_t *)pcb_tools.array[pcbhl_conf.editor.mode]; \ if (tool->func == NULL) \ { err_ret; } \ prefix tool->func args; \ @@ -355,8 +356,8 @@ * the same layer), and when moving a line end-point * (but don't snap to the same line) */ - if ((conf_core.editor.mode == PCB_MODE_LINE && CURRENT == layer) || - (conf_core.editor.mode == PCB_MODE_MOVE + if ((pcbhl_conf.editor.mode == PCB_MODE_LINE && CURRENT == layer) || + (pcbhl_conf.editor.mode == PCB_MODE_MOVE && pcb_crosshair.AttachedObject.Type == PCB_OBJ_LINE_POINT && pcb_crosshair.AttachedObject.Ptr1 == layer && pcb_crosshair.AttachedObject.Ptr2 != line)) Index: trunk/src/tool.h =================================================================== --- trunk/src/tool.h (revision 25235) +++ trunk/src/tool.h (revision 25236) @@ -113,7 +113,7 @@ /**** Tool function wrappers; calling these will operate on the current tool - as defined in conf_core.editor.mode ****/ + as defined in pcbhl_conf.editor.mode ****/ void pcb_tool_notify_mode(void); void pcb_tool_adjust_attached_objects(void); Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 25235) +++ trunk/src_plugins/hid_lesstif/main.c (revision 25236) @@ -1984,7 +1984,7 @@ const char *s45 = cur_clip(); XmString xs; - switch (conf_core.editor.mode) { + switch (pcbhl_conf.editor.mode) { case PCB_MODE_VIA: buf = pcb_strdup_printf("%m+%.2mS/%.2mS \370=%.2mS", UUNIT, conf_core.design.via_thickness, conf_core.design.clearance, conf_core.design.via_drilling_hole); break; @@ -2230,14 +2230,14 @@ } { - if (old_cursor_mode != conf_core.editor.mode) { + if (old_cursor_mode != pcbhl_conf.editor.mode) { const char *s = "None"; XmString ms; int cursor = -1; static int free_cursor = 0; - old_cursor_mode = conf_core.editor.mode; - switch (conf_core.editor.mode) { + old_cursor_mode = pcbhl_conf.editor.mode; + switch (pcbhl_conf.editor.mode) { case PCB_MODE_VIA: s = "Via"; cursor = -1; Index: trunk/src_plugins/lib_hid_pcbui/toolbar.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/toolbar.c (revision 25235) +++ trunk/src_plugins/lib_hid_pcbui/toolbar.c (revision 25236) @@ -33,7 +33,7 @@ #include "hid_dad.h" #include "tool.h" #include "board.h" -#include "conf_core.h" +#include "hidlib_conf.h" #include "toolbar.h" @@ -58,7 +58,7 @@ int st, wid = toolbar.tid2wid.array[tid]; if (wid == 0) continue; - st = (tid == conf_core.editor.mode) ? 2 : 1; + st = (tid == pcbhl_conf.editor.mode) ? 2 : 1; pcb_gui->attr_dlg_widget_state(toolbar.sub.dlg_hid_ctx, wid, st); } toolbar.lock = 0; Index: trunk/src_plugins/stroke/stroke.c =================================================================== --- trunk/src_plugins/stroke/stroke.c (revision 25235) +++ trunk/src_plugins/stroke/stroke.c (revision 25236) @@ -130,11 +130,11 @@ return pcb_actionv_(f, res, 5, args); } else if (pcb_strcasecmp(cmd, "stopline") == 0) { - if (conf_core.editor.mode == PCB_MODE_LINE) + if (pcbhl_conf.editor.mode == PCB_MODE_LINE) pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_LINE); - else if (conf_core.editor.mode == PCB_MODE_POLYGON) + else if (pcbhl_conf.editor.mode == PCB_MODE_POLYGON) pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_POLYGON); - else if (conf_core.editor.mode == PCB_MODE_POLYGON_HOLE) + else if (pcbhl_conf.editor.mode == PCB_MODE_POLYGON_HOLE) pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_POLYGON_HOLE); } else