Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 29339) +++ trunk/scconfig/Rev.h (revision 29340) @@ -1 +1 @@ -static const int myrev = 29339; +static const int myrev = 29340; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 29339) +++ trunk/scconfig/Rev.tab (revision 29340) @@ -1,4 +1,4 @@ -29339 configure librnd separation: tool code +29340 configure librnd separation: tool code 29309 distclean librnd separation 28871 configure compile standard extobjs by default 28855 configure extended object action infra Index: trunk/src/tool.c =================================================================== --- trunk/src/tool.c (revision 29339) +++ trunk/src/tool.c (nonexistent) @@ -1,257 +0,0 @@ -/* - * COPYRIGHT - * - * pcb-rnd, interactive printed circuit board design - * Copyright (C) 2017,2019,2020 Tibor 'Igor2' Palinkas - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Contact: - * Project page: http://repo.hu/projects/pcb-rnd - * lead developer: http://repo.hu/projects/pcb-rnd/contact.html - * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") - */ - -#include "config.h" - -#include "tool.h" - -#include -#include -#include - -#define PCB_MAX_MODESTACK_DEPTH 16 /* maximum depth of mode stack */ - -vtp0_t pcb_tools; - -pcb_toolid_t pcb_tool_prev_id; -pcb_toolid_t pcb_tool_next_id; -static int save_position = 0; -static int save_stack[PCB_MAX_MODESTACK_DEPTH]; - -static void init_current_tool(void); -static void uninit_current_tool(void); - -static int tool_select_lock = 0; - -void pcb_tool_init(void) -{ - vtp0_init(&pcb_tools); -} - -void pcb_tool_uninit(void) -{ - while(vtp0_len(&pcb_tools) != 0) { - const pcb_tool_t *tool = pcb_tool_get(0); - pcb_message(PCB_MSG_WARNING, "Unregistered tool: %s of %s; check your plugins, fix them to unregister their tools!\n", tool->name, tool->cookie); - pcb_tool_unreg_by_cookie(tool->cookie); - } - vtp0_uninit(&pcb_tools); -} - -void pcb_tool_chg_mode(pcb_hidlib_t *hl) -{ - if ((hl != NULL) && (!tool_select_lock)) - pcb_tool_select_by_id(hl, pcbhl_conf.editor.mode); -} - -pcb_toolid_t pcb_tool_reg(pcb_tool_t *tool, const char *cookie) -{ - pcb_toolid_t id; - if (pcb_tool_lookup(tool->name) != PCB_TOOLID_INVALID) /* don't register two tools with the same name */ - return -1; - tool->cookie = cookie; - id = pcb_tools.used; - vtp0_append(&pcb_tools, (void *)tool); - if (pcb_gui != NULL) - pcb_gui->reg_mouse_cursor(pcb_gui, id, tool->cursor.name, tool->cursor.pixel, tool->cursor.mask); - pcb_event(NULL, PCB_EVENT_TOOL_REG, "p", tool); - return id; -} - -void pcb_tool_unreg_by_cookie(const char *cookie) -{ - pcb_toolid_t n; - for(n = 0; n < vtp0_len(&pcb_tools); n++) { - const pcb_tool_t *tool = (const pcb_tool_t *)pcb_tools.array[n]; - if (tool->cookie == cookie) { - vtp0_remove(&pcb_tools, n, 1); - n--; - } - } -} - -pcb_toolid_t pcb_tool_lookup(const char *name) -{ - pcb_toolid_t n; - for(n = 0; n < vtp0_len(&pcb_tools); n++) { - const pcb_tool_t *tool = (const pcb_tool_t *)pcb_tools.array[n]; - if (strcmp(tool->name, name) == 0) - return n; - } - return PCB_TOOLID_INVALID; -} - -int pcb_tool_select_by_name(pcb_hidlib_t *hidlib, const char *name) -{ - pcb_toolid_t id = pcb_tool_lookup(name); - if (id == PCB_TOOLID_INVALID) - return -1; - return pcb_tool_select_by_id(hidlib, id); -} - -int pcb_tool_select_by_id(pcb_hidlib_t *hidlib, pcb_toolid_t id) -{ - char id_s[32]; - static pcb_bool recursing = pcb_false; - int ok = 1; - - if ((id < 0) || (id > vtp0_len(&pcb_tools))) - return -1; - - /* protect the cursor while changing the mode - * perform some additional stuff depending on the new mode - * reset 'state' of attached objects - */ - if (recursing) - return -1; - - /* check if the UI logic allows picking that tool */ - pcb_event(hidlib, PCB_EVENT_TOOL_SELECT_PRE, "pi", &ok, id); - if (ok == 0) - id = pcbhl_conf.editor.mode; - - recursing = pcb_true; - - pcb_tool_prev_id = pcbhl_conf.editor.mode; - pcb_tool_next_id = id; - uninit_current_tool(); - sprintf(id_s, "%d", id); - tool_select_lock = 1; - pcb_conf_set(CFR_DESIGN, "editor/mode", -1, id_s, POL_OVERWRITE); - tool_select_lock = 0; - init_current_tool(); - - recursing = pcb_false; - - if (pcb_gui != NULL) - pcb_gui->set_mouse_cursor(pcb_gui, id); - return 0; -} - -int pcb_tool_select_highest(pcb_hidlib_t *hidlib) -{ - pcb_toolid_t n, bestn = PCB_TOOLID_INVALID; - unsigned int bestp = -1; - for(n = 0; n < vtp0_len(&pcb_tools) && (bestp > 0); n++) { - const pcb_tool_t *tool = (const pcb_tool_t *)pcb_tools.array[n]; - if (tool->priority < bestp) { - bestp = tool->priority; - bestn = n; - } - } - if (bestn == PCB_TOOLID_INVALID) - return -1; - return pcb_tool_select_by_id(hidlib, bestn); -} - -int pcb_tool_save(pcb_hidlib_t *hidlib) -{ - save_stack[save_position] = pcbhl_conf.editor.mode; - if (save_position < PCB_MAX_MODESTACK_DEPTH - 1) - save_position++; - else - return -1; - return 0; -} - -int pcb_tool_restore(pcb_hidlib_t *hidlib) -{ - if (save_position == 0) { - pcb_message(PCB_MSG_ERROR, "hace: underflow of restore mode\n"); - return -1; - } - return pcb_tool_select_by_id(hidlib, save_stack[--save_position]); -} - -void pcb_tool_gui_init(void) -{ - pcb_toolid_t n; - pcb_tool_t **tool; - - if (pcb_gui == NULL) - return; - - for(n = 0, tool = (pcb_tool_t **)pcb_tools.array; n < pcb_tools.used; n++,tool++) - if (*tool != NULL) - pcb_gui->reg_mouse_cursor(pcb_gui, n, (*tool)->cursor.name, (*tool)->cursor.pixel, (*tool)->cursor.mask); -} - -/**** current tool function wrappers ****/ -#define wrap(func, err_ret, prefix, args) \ - do { \ - const pcb_tool_t *tool; \ - if ((pcbhl_conf.editor.mode < 0) || (pcbhl_conf.editor.mode >= vtp0_len(&pcb_tools))) \ - { err_ret; } \ - tool = (const pcb_tool_t *)pcb_tools.array[pcbhl_conf.editor.mode]; \ - if (tool->func == NULL) \ - { err_ret; } \ - prefix tool->func args; \ - } while(0) - -#define wrap_void(func, args) wrap(func, return, ;, args) -#define wrap_retv(func, err_ret, args) wrap(func, err_ret, return, args) - -static void init_current_tool(void) -{ - wrap_void(init, ()); -} - -static void uninit_current_tool(void) -{ - wrap_void(uninit, ()); -} - -void pcb_tool_notify_mode(pcb_hidlib_t *hidlib) -{ - wrap_void(notify_mode, (hidlib)); -} - -void pcb_tool_release_mode(pcb_hidlib_t *hidlib) -{ - wrap_void(release_mode, (hidlib)); -} - -void pcb_tool_adjust_attached_objects(pcb_hidlib_t *hl) -{ - wrap_void(adjust_attached_objects, (hl)); -} - -void pcb_tool_draw_attached(pcb_hidlib_t *hl) -{ - wrap_void(draw_attached, (hl)); -} - -pcb_bool pcb_tool_undo_act(pcb_hidlib_t *hl) -{ - wrap_retv(undo_act, return pcb_true, (hl)); -} - -pcb_bool pcb_tool_redo_act(pcb_hidlib_t *hl) -{ - wrap_retv(redo_act, return pcb_true, (hl)); -} - - Index: trunk/src/tool.h =================================================================== --- trunk/src/tool.h (revision 29339) +++ trunk/src/tool.h (nonexistent) @@ -1,124 +0,0 @@ -/* - * COPYRIGHT - * - * pcb-rnd, interactive printed circuit board design - * Copyright (C) 2017,2020 Tibor 'Igor2' Palinkas - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Contact: - * Project page: http://repo.hu/projects/pcb-rnd - * lead developer: http://repo.hu/projects/pcb-rnd/contact.html - * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") - */ - -#ifndef PCB_TOOL_H -#define PCB_TOOL_H - -#include - -#include -#include - -typedef int pcb_toolid_t; -#define PCB_TOOLID_INVALID (-1) - -typedef struct pcb_tool_cursor_s { - const char *name; /* if no custom graphics is provided, use a stock cursor by name */ - const unsigned char *pixel; /* 32 bytes: 16*16 bitmap */ - const unsigned char *mask; /* 32 bytes: 16*16 mask (1 means draw pixel) */ -} pcb_tool_cursor_t; - -#define PCB_TOOL_CURSOR_NAMED(name) { name, NULL, NULL } -#define PCB_TOOL_CURSOR_XBM(pixel, mask) { NULL, pixel, mask } - -typedef enum pcb_tool_flags_e { - PCB_TLF_AUTO_TOOLBAR = 1 /* automatically insert in the toolbar if the menu file didn't do it */ -} pcb_tool_flags_t; - -typedef struct pcb_tool_s { - const char *name; /* textual name of the tool */ - const char *help; /* help/tooltip that explains the feature */ - const char *cookie; /* plugin cookie _pointer_ of the registrar (comparision is pointer based, not strcmp) */ - unsigned int priority; /* lower values are higher priorities; escaping mode will try to select the highest prio tool */ - const char **icon; /* XPM for the tool buttons */ - pcb_tool_cursor_t cursor; /* name of the mouse cursor to switch to when the tool is activated */ - pcb_tool_flags_t flags; - - /* tool implementation */ - void (*init)(void); - void (*uninit)(void); - void (*notify_mode)(pcb_hidlib_t *hl); - void (*release_mode)(pcb_hidlib_t *hl); - void (*adjust_attached_objects)(pcb_hidlib_t *hl); - void (*draw_attached)(pcb_hidlib_t *hl); - pcb_bool (*undo_act)(pcb_hidlib_t *hl); - pcb_bool (*redo_act)(pcb_hidlib_t *hl); - pcb_bool (*escape)(pcb_hidlib_t *hl); - - pcb_bool allow_when_drawing_ratlines; -} pcb_tool_t; - -extern vtp0_t pcb_tools; -extern pcb_bool pcb_tool_is_saved; -extern pcb_toolid_t pcb_tool_prev_id; -extern pcb_toolid_t pcb_tool_next_id; - -/* (un)initialize the tool subsystem */ -void pcb_tool_init(void); -void pcb_tool_uninit(void); - -/* call this when the mode (tool) config node changes */ -void pcb_tool_chg_mode(pcb_hidlib_t *hl); - -/* Insert a new tool in pcb_tools; returns -1 on failure */ -pcb_toolid_t pcb_tool_reg(pcb_tool_t *tool, const char *cookie); - -/* Unregister all tools that has matching cookie */ -void pcb_tool_unreg_by_cookie(const char *cookie); - -/* Return the ID of a tool by name; returns -1 on error */ -pcb_toolid_t pcb_tool_lookup(const char *name); - - -/* Select a tool by name, id or pick the highest prio tool; return 0 on success */ -int pcb_tool_select_by_name(pcb_hidlib_t *hidlib, const char *name); -int pcb_tool_select_by_id(pcb_hidlib_t *hidlib, pcb_toolid_t id); -int pcb_tool_select_highest(pcb_hidlib_t *hidlib); - -int pcb_tool_save(pcb_hidlib_t *hidlib); -int pcb_tool_restore(pcb_hidlib_t *hidlib); - -/* Called after GUI_INIT; registers all mouse cursors in the GUI */ -void pcb_tool_gui_init(void); - - -/**** Tool function wrappers; calling these will operate on the current tool - as defined in pcbhl_conf.editor.mode ****/ - -void pcb_tool_notify_mode(pcb_hidlib_t *hidlib); -void pcb_tool_release_mode(pcb_hidlib_t *hidlib); -void pcb_tool_adjust_attached_objects(pcb_hidlib_t *hl); -void pcb_tool_draw_attached(pcb_hidlib_t *hl); -pcb_bool pcb_tool_undo_act(pcb_hidlib_t *hl); -pcb_bool pcb_tool_redo_act(pcb_hidlib_t *hl); - - -/**** Low level, for internal use ****/ - -/* Get the tool pointer of a tool by id */ -#define pcb_tool_get(id) ((const pcb_tool_t *)*vtp0_get(&pcb_tools, id, 0)) - -#endif Index: trunk/src/Makefile.dep =================================================================== --- trunk/src/Makefile.dep (revision 29339) +++ trunk/src/Makefile.dep (revision 29340) @@ -308,7 +308,7 @@ ../src_3rd/genht/htsp.h ../src_3rd/genht/ht.h \ ../src_3rd/genvector/vtp0.h librnd/core/list_conf.h \ ../src_3rd/genlist/gentdlist_undef.h ../src_3rd/genlist/gentdlist_impl.h \ - ../src_3rd/genlist/gendlist.h librnd/core/color.h tool.h \ + ../src_3rd/genlist/gendlist.h librnd/core/color.h librnd/core/tool.h \ librnd/core/event.h librnd/core/hidlib.h librnd/core/hid.h \ librnd/core/error.h librnd/core/attrib.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h @@ -867,7 +867,7 @@ librnd/core/conf.h librnd/core/pcb-printf.h \ ../src_3rd/liblihata/lihata.h librnd/core/list_conf.h \ librnd/core/conf_hid.h librnd/core/vtc0.h ../src_plugins/ddraft/trim.c \ - undo_old.h ../src_plugins/ddraft/constraint.c crosshair.h tool.h \ + undo_old.h ../src_plugins/ddraft/constraint.c crosshair.h librnd/core/tool.h \ ../src_plugins/ddraft/constraint_gui.c librnd/core/hid_dad.h \ librnd/core/compat_misc.h librnd/core/hid_dad_spin.h \ ../src_plugins/ddraft/cli.c librnd/core/hid_inlines.h \ @@ -1231,7 +1231,7 @@ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ obj_pstk_list.h obj_pstk.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h draw.h librnd/core/event.h obj_subc.h plug_footprint.h \ - vtlibrary.h data.h tool.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ + vtlibrary.h data.h librnd/core/tool.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ librnd/core/hid_dad.h librnd/core/compat_misc.h librnd/core/hid_attrib.h \ librnd/core/hid_dad_spin.h librnd/core/hid_dad_tree.h \ librnd/core/hid_init.h ../src_3rd/puplug/puplug.h \ @@ -2981,7 +2981,7 @@ ../src_plugins/hid_lesstif/lesstif.h librnd/core/hid_cfg_input.h \ librnd/core/hid_cfg.h board.h vtroutestyle.h rats_patch.h board.h \ librnd/core/hidlib.h ../src_plugins/hid_lesstif/ltf_stdarg.h \ - librnd/core/event.h tool.h + librnd/core/event.h librnd/core/tool.h ../src_plugins/hid_lesstif/ltf_stdarg.o: \ ../src_plugins/hid_lesstif/ltf_stdarg.c \ ../src_plugins/hid_lesstif/ltf_stdarg.h \ @@ -3026,7 +3026,7 @@ librnd/core/hid_attrib.h librnd/core/hid_init.h librnd/core/hid_dad.h \ librnd/core/compat_misc.h librnd/core/hid_dad_spin.h \ librnd/core/actions.h ../src_plugins/hid_lesstif/ltf_stdarg.h \ - librnd/core/grid.h layer_vis.h tool.h \ + librnd/core/grid.h layer_vis.h librnd/core/tool.h \ ../src_plugins/hid_lesstif/wt_preview.h \ ../src_plugins/hid_lesstif/dlg_fileselect.h \ ../src_plugins/hid_lesstif/FillBox.h \ @@ -5232,7 +5232,7 @@ librnd/core/hidlib.h crosshair.h vtonpoint.h route.h conf_core.h \ librnd/core/conf.h librnd/core/pcb-printf.h \ ../src_3rd/liblihata/lihata.h ../src_3rd/genvector/vtp0.h \ - librnd/core/list_conf.h tool.h ../src_plugins/lib_gtk_common/in_mouse.h \ + librnd/core/list_conf.h librnd/core/tool.h ../src_plugins/lib_gtk_common/in_mouse.h \ librnd/core/hid_cfg_input.h librnd/core/hid_cfg.h \ ../src_plugins/lib_gtk_common/pcb_gtk.h \ ../src_plugins/lib_gtk_common/compat.h \ @@ -5893,7 +5893,7 @@ librnd/core/hid_dad.h librnd/core/compat_misc.h librnd/core/hid_attrib.h \ ../src_3rd/genlist/gendlist.h librnd/core/color.h \ librnd/core/pcb-printf.h ../src_3rd/genvector/gds_char.h \ - librnd/core/hid_dad_spin.h tool.h ../src_3rd/genvector/vtp0.h board.h \ + librnd/core/hid_dad_spin.h librnd/core/tool.h ../src_3rd/genvector/vtp0.h board.h \ vtroutestyle.h layer.h librnd/core/globalconst.h obj_common.h flag.h \ data_parent.h obj_arc_list.h obj_arc.h \ ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ @@ -6942,7 +6942,7 @@ librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h data_it.h data.h \ - search.h tool.h flag_str.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ + search.h librnd/core/tool.h flag_str.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ find.h draw.h draw_wireframe.h librnd/core/plugins.h \ ../src_3rd/puplug/puplug.h ../src_3rd/puplug/libs.h \ ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ @@ -6979,7 +6979,7 @@ ../src_3rd/puplug/puplug.h ../src_3rd/puplug/libs.h \ ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/error.h librnd/core/actions.h \ - librnd/core/compat_misc.h tool.h + librnd/core/compat_misc.h librnd/core/tool.h ../src_plugins/shape/shape.o: ../src_plugins/shape/shape.c ../config.h \ librnd/config.h ../src_plugins/shape/shape.h board.h \ ../src_3rd/genht/htsp.h ../src_3rd/genht/ht.h \ @@ -7011,7 +7011,7 @@ librnd/core/compat_misc.h conf_core.h librnd/core/conf.h \ librnd/core/pcb-printf.h ../src_3rd/liblihata/lihata.h \ librnd/core/list_conf.h librnd/core/event.h obj_poly.h obj_poly_draw.h \ - draw.h rotate.h librnd/core/rotate.h tool.h \ + draw.h rotate.h librnd/core/rotate.h librnd/core/tool.h \ ../src_plugins/shape/shape_dialog.c librnd/core/hid_dad.h \ librnd/core/hid_attrib.h librnd/core/hid_dad_spin.h ../src_plugins/sketch_route/cdt/cdt.o: \ @@ -7113,7 +7113,7 @@ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/event.h \ list_common.h obj_line_list.h obj_pstk.h obj_pstk_inlines.h data.h \ - thermal.h librnd/poly/polygon1_gen.h obj_subc_parent.h search.h tool.h \ + thermal.h librnd/poly/polygon1_gen.h obj_subc_parent.h search.h librnd/core/tool.h \ layer_ui.h netlist.h ../src_plugins/sketch_route/sktypedefs.h \ ../src_plugins/sketch_route/wire.h \ ../src_plugins/sketch_route/cdt/typedefs.h \ @@ -7225,7 +7225,7 @@ ../src_3rd/genht/htpp.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ - ../src_3rd/puplug/error.h stub_stroke.h librnd/core/compat_misc.h tool.h \ + ../src_3rd/puplug/error.h stub_stroke.h librnd/core/compat_misc.h librnd/core/tool.h \ ../src_plugins/stroke/conf_internal.c \ ../src_plugins/stroke/stroke_conf.h \ ../src_plugins/stroke/stroke_conf_fields.h @@ -7285,7 +7285,7 @@ librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h \ - draw_wireframe.h search.h tool.h undo.h ../src_3rd/libuundo/uundo.h \ + draw_wireframe.h search.h librnd/core/tool.h undo.h ../src_3rd/libuundo/uundo.h \ undo_old.h obj_arc_draw.h draw.h ../src_plugins/tool_std/tool_arrow.o: \ ../src_plugins/tool_std/tool_arrow.c ../config.h librnd/config.h \ @@ -7314,7 +7314,7 @@ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h \ librnd/core/actions.h remove.h move.h search.h select.h operation.h \ - tool.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h extobj.h data.h \ + librnd/core/tool.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h extobj.h data.h \ obj_subc_parent.h draw.h ../src_plugins/tool_std/tool_buffer.o: \ ../src_plugins/tool_std/tool_buffer.c ../config.h librnd/config.h \ @@ -7342,7 +7342,7 @@ librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h \ - librnd/core/actions.h search.h tool.h undo.h ../src_3rd/libuundo/uundo.h \ + librnd/core/actions.h search.h librnd/core/tool.h undo.h ../src_3rd/libuundo/uundo.h \ undo_old.h ../src_plugins/tool_std/tool_copy.o: ../src_plugins/tool_std/tool_copy.c \ ../config.h librnd/config.h board.h ../src_3rd/genht/htsp.h \ @@ -7361,7 +7361,7 @@ librnd/core/hidlib.h move.h crosshair.h vtonpoint.h librnd/core/hid.h \ ../src_3rd/liblihata/dom.h ../src_3rd/liblihata/lihata.h \ ../src_3rd/liblihata/parser.h librnd/core/error.h route.h search.h \ - tool.h ../src_3rd/genvector/vtp0.h + librnd/core/tool.h ../src_3rd/genvector/vtp0.h ../src_plugins/tool_std/tool_insert.o: \ ../src_plugins/tool_std/tool_insert.c ../config.h librnd/config.h \ board.h ../src_3rd/genht/htsp.h ../src_3rd/genht/ht.h \ @@ -7381,7 +7381,7 @@ ../src_3rd/liblihata/dom.h ../src_3rd/liblihata/lihata.h \ ../src_3rd/liblihata/parser.h librnd/core/error.h route.h insert.h \ polygon.h librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h \ - librnd/poly/rtree2_compat.h search.h tool.h ../src_3rd/genvector/vtp0.h + librnd/poly/rtree2_compat.h search.h librnd/core/tool.h ../src_3rd/genvector/vtp0.h ../src_plugins/tool_std/tool_line.o: ../src_plugins/tool_std/tool_line.c \ ../config.h librnd/config.h conf_core.h librnd/core/conf.h \ librnd/core/global_typedefs.h librnd/core/pcb_bool.h \ @@ -7408,7 +7408,7 @@ librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h \ - draw_wireframe.h find.h obj_line.h obj_subc.h search.h tool.h undo.h \ + draw_wireframe.h find.h obj_line.h obj_subc.h search.h librnd/core/tool.h undo.h \ ../src_3rd/libuundo/uundo.h undo_old.h netlist.h obj_line_draw.h draw.h \ obj_pstk_draw.h obj_rat_draw.h route_draw.h \ ../src_plugins/lib_compat_help/pstk_compat.h obj_pstk.h @@ -7436,7 +7436,7 @@ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ - vtpadstack_t.h draw.h librnd/core/actions.h search.h tool.h \ + vtpadstack_t.h draw.h librnd/core/actions.h search.h librnd/core/tool.h \ ../src_plugins/tool_std/tool_lock.h ../src_plugins/tool_std/tool_move.o: ../src_plugins/tool_std/tool_move.c \ ../config.h librnd/config.h board.h ../src_3rd/genht/htsp.h \ @@ -7455,7 +7455,7 @@ librnd/core/hidlib.h move.h crosshair.h vtonpoint.h librnd/core/hid.h \ ../src_3rd/liblihata/dom.h ../src_3rd/liblihata/lihata.h \ ../src_3rd/liblihata/parser.h librnd/core/error.h route.h search.h \ - tool.h ../src_3rd/genvector/vtp0.h extobj.h data.h crosshair.h buffer.h \ + librnd/core/tool.h ../src_3rd/genvector/vtp0.h extobj.h data.h crosshair.h buffer.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h obj_rat_list.h \ obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ ../src_3rd/libminuid/libminuid.h librnd/poly/rtree2_compat.h \ @@ -7482,7 +7482,7 @@ obj_poly.h librnd/poly/polyarea.h route.h librnd/core/actions.h \ ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h polygon.h \ librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h \ - librnd/poly/rtree2_compat.h tool.h board.h vtroutestyle.h layer.h \ + librnd/poly/rtree2_compat.h librnd/core/tool.h board.h vtroutestyle.h layer.h \ obj_arc_list.h obj_arc.h obj_line_list.h obj_poly_list.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h layer_grp.h rats_patch.h \ board.h librnd/core/hidlib.h @@ -7507,7 +7507,7 @@ librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h \ librnd/poly/rtree2_compat.h search.h layer.h obj_arc_list.h obj_arc.h \ obj_line_list.h obj_poly_list.h obj_text_list.h obj_text.h font.h \ - ../src_3rd/genht/htip.h tool.h board.h vtroutestyle.h layer_grp.h \ + ../src_3rd/genht/htip.h librnd/core/tool.h board.h vtroutestyle.h layer_grp.h \ rats_patch.h board.h librnd/core/hidlib.h ../src_plugins/tool_std/tool_rectangle.o: \ ../src_plugins/tool_std/tool_rectangle.c ../config.h librnd/config.h \ @@ -7534,7 +7534,7 @@ ../src_3rd/libminuid/libminuid.h librnd/poly/rtree2_compat.h \ librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ - vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h tool.h \ + vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h librnd/core/tool.h \ undo.h ../src_3rd/libuundo/uundo.h undo_old.h obj_poly_draw.h draw.h ../src_plugins/tool_std/tool_remove.o: \ ../src_plugins/tool_std/tool_remove.c ../config.h librnd/config.h \ @@ -7556,7 +7556,7 @@ ../src_3rd/liblihata/lihata.h ../src_3rd/liblihata/parser.h \ librnd/core/error.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ undo.h ../src_3rd/libuundo/uundo.h undo_old.h remove.h search.h \ - obj_rat.h idpath.h tool.h ../src_3rd/genvector/vtp0.h crosshair.h \ + obj_rat.h idpath.h librnd/core/tool.h ../src_3rd/genvector/vtp0.h crosshair.h \ vtonpoint.h route.h ../src_plugins/tool_std/tool_rotate.o: \ ../src_plugins/tool_std/tool_rotate.c ../config.h librnd/config.h \ @@ -7579,7 +7579,7 @@ obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ obj_text.h font.h ../src_3rd/genht/htip.h layer_grp.h rats_patch.h \ board.h librnd/core/hidlib.h rotate.h librnd/core/rotate.h \ - librnd/core/compat_misc.h tool.h crosshair.h vtonpoint.h route.h + librnd/core/compat_misc.h librnd/core/tool.h crosshair.h vtonpoint.h route.h ../src_plugins/tool_std/tool_std.o: ../src_plugins/tool_std/tool_std.c \ ../config.h librnd/config.h conf_core.h librnd/core/conf.h \ librnd/core/global_typedefs.h librnd/core/pcb_bool.h \ @@ -7595,7 +7595,7 @@ librnd/core/color.h librnd/core/plugins.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h \ - ../src_3rd/puplug/error.h tool.h crosshair.h vtonpoint.h \ + ../src_3rd/puplug/error.h librnd/core/tool.h crosshair.h vtonpoint.h \ librnd/core/hid.h librnd/core/error.h librnd/core/attrib.h \ librnd/core/box.h librnd/core/math_helper.h librnd/core/misc_util.h \ obj_line.h ../src_3rd/genlist/gendlist.h obj_common.h flag.h \ @@ -7639,7 +7639,7 @@ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h librnd/core/actions.h \ - tool.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h obj_text_draw.h \ + librnd/core/tool.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h obj_text_draw.h \ draw.h ../src_plugins/tool_std/tool_thermal.o: \ ../src_plugins/tool_std/tool_thermal.c ../config.h librnd/config.h \ @@ -7667,7 +7667,7 @@ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ vtpadstack_t.h librnd/core/actions.h obj_pstk.h search.h thermal.h \ - librnd/poly/polygon1_gen.h tool.h + librnd/poly/polygon1_gen.h librnd/core/tool.h ../src_plugins/tool_std/tool_via.o: ../src_plugins/tool_std/tool_via.c \ ../config.h librnd/config.h conf_core.h librnd/core/conf.h \ librnd/core/global_typedefs.h librnd/core/pcb_bool.h \ @@ -7694,7 +7694,7 @@ librnd/poly/rtree2_compat.h librnd/poly/rtree.h \ ../src_3rd/genrtree/genrtree_api.h ht_subc.h ../src_3rd/genht/ht.h \ ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h vtpadstack.h \ - obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h tool.h \ + obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h librnd/core/tool.h \ ../src_plugins/tool_std/tool_thermal.h undo.h \ ../src_3rd/libuundo/uundo.h undo_old.h obj_pstk_draw.h draw.h \ ../src_plugins/lib_compat_help/pstk_compat.h obj_pstk.h @@ -7937,7 +7937,7 @@ librnd/core/hidlib_conf.h plug_io.h librnd/core/compat_misc.h \ librnd/core/actions.h librnd/core/paths.h undo.h \ ../src_3rd/libuundo/uundo.h undo_old.h draw.h librnd/core/event.h \ - librnd/core/safe_fs.h tool.h netlist.h defpcb_internal.c \ + librnd/core/safe_fs.h librnd/core/tool.h netlist.h defpcb_internal.c \ obj_pstk_inlines.h thermal.h librnd/poly/polygon1_gen.h brave.o: brave.c ../config.h librnd/config.h \ ../src_3rd/genvector/gds_char.h ../src_3rd/genvector/genvector_impl.h \ @@ -7991,7 +7991,7 @@ funchash_core.h librnd/core/funchash.h funchash_core_list.h obj_arc_op.h \ obj_line_op.h obj_text_op.h obj_subc_op.h obj_poly_op.h obj_pstk_op.h \ obj_rat_op.h librnd/core/event.h librnd/core/safe_fs.h \ - librnd/core/actions.h tool.h extobj.h obj_subc_parent.h \ + librnd/core/actions.h librnd/core/tool.h extobj.h obj_subc_parent.h \ librnd/core/hid_dad.h librnd/core/hid_attrib.h \ librnd/core/hid_dad_spin.h build_run.o: build_run.c ../config.h librnd/config.h \ @@ -8100,7 +8100,7 @@ librnd/core/conf.h librnd/core/pcb-printf.h \ ../src_3rd/liblihata/lihata.h ../src_3rd/genvector/vtp0.h \ librnd/core/list_conf.h librnd/core/hidlib_conf.h funchash_core.h \ - librnd/core/funchash.h funchash_core_list.h route_style.h tool.h + librnd/core/funchash.h funchash_core_list.h route_style.h librnd/core/tool.h conf_core.o: conf_core.c ../config.h librnd/config.h librnd/core/conf.h \ librnd/core/global_typedefs.h librnd/core/pcb_bool.h \ librnd/core/pcb-printf.h ../src_3rd/genvector/gds_char.h \ @@ -8149,7 +8149,7 @@ ../src_3rd/libuundo/uundo.h undo_old.h librnd/core/event.h \ librnd/core/grid.h stub_stroke.h obj_line_draw.h obj_arc_draw.h \ obj_text_draw.h obj_pstk_draw.h route_draw.h obj_arc_ui.h \ - obj_subc_parent.h tool.h + obj_subc_parent.h librnd/core/tool.h data.o: data.c ../config.h librnd/config.h board.h \ ../src_3rd/genht/htsp.h ../src_3rd/genht/ht.h \ librnd/core/global_typedefs.h librnd/core/pcb_bool.h vtroutestyle.h \ @@ -8277,7 +8277,7 @@ librnd/core/hid_dad_spin.h search.h layer.h obj_common.h flag.h \ data_parent.h obj_arc_list.h obj_arc.h obj_line_list.h obj_line.h \ obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ - obj_text.h font.h ../src_3rd/genht/htip.h tool.h extobj.h board.h \ + obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/tool.h extobj.h board.h \ vtroutestyle.h layer_grp.h rats_patch.h librnd/core/hidlib.h data.h \ crosshair.h vtonpoint.h route.h buffer.h obj_rat_list.h obj_rat.h \ idpath.h obj_subc_list.h obj_subc.h ../src_3rd/libminuid/libminuid.h \ @@ -8316,7 +8316,7 @@ librnd/core/actions.h librnd/core/compat_misc.h librnd/core/hid_init.h \ ../src_3rd/puplug/puplug.h ../src_3rd/puplug/libs.h \ ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ - ../src_3rd/puplug/libs.h layer_vis.h librnd/core/safe_fs.h tool.h \ + ../src_3rd/puplug/libs.h layer_vis.h librnd/core/safe_fs.h librnd/core/tool.h \ netlist.h find.o: find.c ../config.h librnd/config.h find.h \ ../src_3rd/genvector/vtp0.h ../src_3rd/genvector/genvector_impl.h \ @@ -8417,7 +8417,7 @@ ../src_3rd/libminuid/libminuid.h librnd/poly/rtree2_compat.h \ librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ - vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h tool.h \ + vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/tool.h \ librnd/core/grid.h undo.h ../src_3rd/libuundo/uundo.h undo_old.h \ funchash_core.h librnd/core/funchash.h funchash_core_list.h change.h \ draw.h search.h find.h stub_stroke.h librnd/core/actions.h \ @@ -8467,7 +8467,7 @@ obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ librnd/core/math_helper.h librnd/core/misc_util.h \ ../src_3rd/genvector/gds_char.h layer_grp.h rats_patch.h \ - librnd/core/hidlib.h tool.h ../src_3rd/genvector/vtp0.h + librnd/core/hidlib.h librnd/core/tool.h ../src_3rd/genvector/vtp0.h ht_subc.o: ht_subc.c ../config.h librnd/config.h obj_subc_list.h \ obj_subc.h ../src_3rd/genlist/gendlist.h \ ../src_3rd/libminuid/libminuid.h ../src_3rd/genht/htsp.h \ @@ -8689,7 +8689,7 @@ librnd/core/file_loaded.h flag_str.h librnd/core/plugins.h \ ../src_3rd/puplug/error.h plug_footprint.h vtlibrary.h plug_import.h \ librnd/core/event.h librnd/core/funchash.h conf_core.h \ - librnd/core/hidlib_conf.h layer_vis.h layer_ui.h pcb_minuid.h tool.h \ + librnd/core/hidlib_conf.h layer_vis.h layer_ui.h pcb_minuid.h librnd/core/tool.h \ netlist.h extobj.h obj_subc_parent.h draw.h librnd/core/pixmap.h \ librnd/core/actions.h actions_pcb.h librnd/core/hid_init.h \ librnd/core/compat_misc.h funchash_core.h funchash_core_list.h \ @@ -9297,7 +9297,7 @@ librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h board.h \ - vtroutestyle.h rats_patch.h librnd/core/hidlib.h tool.h change.h undo.h \ + vtroutestyle.h rats_patch.h librnd/core/hidlib.h librnd/core/tool.h change.h undo.h \ ../src_3rd/libuundo/uundo.h undo_old.h librnd/core/event.h \ funchash_core.h librnd/core/funchash.h funchash_core_list.h search.h \ draw.h move.h remove.h librnd/core/compat_misc.h layer_vis.h operation.h \ @@ -9491,7 +9491,7 @@ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h undo.h \ ../src_3rd/libuundo/uundo.h undo_old.h funchash_core.h \ - librnd/core/funchash.h funchash_core_list.h draw.h search.h tool.h \ + librnd/core/funchash.h funchash_core_list.h draw.h search.h librnd/core/tool.h \ librnd/core/actions.h rats_act.o: rats_act.c ../config.h librnd/config.h conf_core.h \ librnd/core/conf.h librnd/core/global_typedefs.h librnd/core/pcb_bool.h \ @@ -9598,7 +9598,7 @@ librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ ../src_3rd/genvector/vtp0.h vtpadstack.h obj_pstk_shape.h polygon.h \ - vtpadstack_t.h librnd/core/actions.h tool.h remove.h board.h \ + vtpadstack_t.h librnd/core/actions.h librnd/core/tool.h remove.h board.h \ vtroutestyle.h rats_patch.h librnd/core/hidlib.h funchash_core.h \ librnd/core/funchash.h funchash_core_list.h rotate.o: rotate.c ../config.h librnd/config.h board.h \ @@ -9759,7 +9759,7 @@ ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h undo.h \ ../src_3rd/libuundo/uundo.h undo_old.h funchash_core.h \ - librnd/core/funchash.h funchash_core_list.h tool.h select.h operation.h \ + librnd/core/funchash.h funchash_core_list.h librnd/core/tool.h select.h operation.h \ draw.h remove.h move.h librnd/core/grid.h librnd/core/hid_attrib.h \ librnd/core/compat_misc.h librnd/core/actions.h stub_draw.o: stub_draw.c ../config.h librnd/config.h stub_draw.h \ @@ -9806,34 +9806,6 @@ vtpadstack_t.h obj_pstk_inlines.h board.h vtroutestyle.h rats_patch.h \ librnd/core/hidlib.h obj_pinvia_therm.h funchash_core.h \ librnd/core/funchash.h funchash_core_list.h -tool.o: tool.c ../config.h librnd/config.h tool.h \ - ../src_3rd/genvector/vtp0.h ../src_3rd/genvector/genvector_impl.h \ - ../src_3rd/genvector/genvector_undef.h librnd/core/global_typedefs.h \ - librnd/core/pcb_bool.h board.h ../src_3rd/genht/htsp.h \ - ../src_3rd/genht/ht.h vtroutestyle.h librnd/core/unit.h \ - librnd/core/attrib.h layer.h librnd/core/globalconst.h \ - librnd/core/color.h obj_common.h flag.h data_parent.h obj_arc_list.h \ - obj_arc.h ../src_3rd/genlist/gendlist.h \ - ../src_3rd/genlist/gentdlist_impl.h ../src_3rd/genlist/gendlist.h \ - ../src_3rd/genlist/gentdlist_undef.h obj_line_list.h obj_line.h \ - obj_poly_list.h obj_poly.h librnd/poly/polyarea.h obj_text_list.h \ - obj_text.h font.h ../src_3rd/genht/htip.h librnd/core/box.h \ - librnd/core/math_helper.h librnd/core/misc_util.h \ - ../src_3rd/genvector/gds_char.h layer_grp.h rats_patch.h \ - librnd/core/hidlib.h librnd/core/hidlib_conf.h librnd/core/conf.h \ - librnd/core/pcb-printf.h ../src_3rd/liblihata/lihata.h \ - ../src_3rd/liblihata/dom.h ../src_3rd/liblihata/lihata.h \ - ../src_3rd/liblihata/parser.h librnd/core/list_conf.h conf_core.h \ - crosshair.h vtonpoint.h librnd/core/hid.h librnd/core/error.h route.h \ - data.h buffer.h ../src_3rd/libfungw/fungw.h ../src_3rd/genht/htpp.h \ - obj_rat_list.h obj_rat.h idpath.h obj_subc_list.h obj_subc.h \ - ../src_3rd/libminuid/libminuid.h librnd/poly/rtree2_compat.h \ - librnd/poly/rtree.h ../src_3rd/genrtree/genrtree_api.h ht_subc.h \ - ../src_3rd/genht/ht.h ../src_3rd/genht/hash.h obj_pstk_list.h obj_pstk.h \ - vtpadstack.h obj_pstk_shape.h polygon.h vtpadstack_t.h draw.h \ - librnd/core/event.h find.h librnd/core/grid.h undo.h \ - ../src_3rd/libuundo/uundo.h undo_old.h librnd/core/actions.h \ - librnd/core/conf_hid.h undo.o: undo.c ../config.h librnd/config.h \ ../src_3rd/libuundo/uundo_debug.h ../src_3rd/libuundo/uundo.h board.h \ ../src_3rd/genht/htsp.h ../src_3rd/genht/ht.h \ @@ -9891,7 +9863,7 @@ obj_pstk_shape.h polygon.h vtpadstack_t.h librnd/core/compat_misc.h \ funchash_core.h librnd/core/funchash.h funchash_core_list.h undo.h \ ../src_3rd/libuundo/uundo.h undo_old.h undo_act.h search.h \ - obj_line_draw.h draw.h tool.h + obj_line_draw.h draw.h librnd/core/tool.h undo_old.o: undo_old.c ../config.h librnd/config.h \ ../src_3rd/libuundo/uundo.h board.h ../src_3rd/genht/htsp.h \ ../src_3rd/genht/ht.h librnd/core/global_typedefs.h \ Index: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in (revision 29339) +++ trunk/src/Makefile.in (revision 29340) @@ -103,6 +103,7 @@ $(LIBRND)/core/plugins.o $(LIBRND)/core/pixmap.o $(LIBRND)/core/safe_fs.o + $(LIBRND)/core/tool.o $(LIBRND)/core/unit.o $(LIBRND)/core/vtc0.o @] @@ -236,7 +237,6 @@ stub_draw.o stub_stroke.o thermal.o - tool.o tool_logic.o undo.o undo_act.o Index: trunk/src/board.c =================================================================== --- trunk/src/board.c (revision 29339) +++ trunk/src/board.c (revision 29340) @@ -39,7 +39,7 @@ #include "draw.h" #include #include -#include "tool.h" +#include #include "layer.h" #include "netlist.h" Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 29339) +++ trunk/src/buffer.c (revision 29340) @@ -57,7 +57,7 @@ #include #include #include -#include "tool.h" +#include #include "extobj.h" #include Index: trunk/src/conf_act.c =================================================================== --- trunk/src/conf_act.c (revision 29339) +++ trunk/src/conf_act.c (revision 29340) @@ -32,7 +32,7 @@ #include "funchash_core.h" #include "route_style.h" #include -#include "tool.h" +#include static const char pcb_acts_Conf[] = "conf(set, path, value, [role], [policy]) - change a config setting to an absolute value\n" Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 29339) +++ trunk/src/crosshair.c (revision 29340) @@ -59,7 +59,7 @@ #include "obj_arc_ui.h" #include "obj_subc_parent.h" -#include "tool.h" +#include typedef struct { int x, y; Index: trunk/src/extobj_act.c =================================================================== --- trunk/src/extobj_act.c (revision 29339) +++ trunk/src/extobj_act.c (revision 29340) @@ -31,7 +31,7 @@ #include "funchash_core.h" #include #include "search.h" -#include "tool.h" +#include #include "extobj.h" Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 29339) +++ trunk/src/file_act.c (revision 29340) @@ -52,7 +52,7 @@ #include #include "layer_vis.h" #include -#include "tool.h" +#include #include "netlist.h" #include "plug_io.h" Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 29339) +++ trunk/src/gui_act.c (revision 29340) @@ -38,7 +38,7 @@ #include "conf_core.h" #include #include "data.h" -#include "tool.h" +#include #include #include #include "undo.h" @@ -61,7 +61,7 @@ #include #include "operation.h" #include "obj_subc_op.h" -#include "tool.h" +#include #include "route_style.h" #define CLONE_TYPES PCB_OBJ_LINE | PCB_OBJ_ARC | PCB_OBJ_POLY Index: trunk/src/hidlib_pcb.c =================================================================== --- trunk/src/hidlib_pcb.c (revision 29339) +++ trunk/src/hidlib_pcb.c (revision 29340) @@ -25,7 +25,7 @@ */ #include "board.h" -#include "tool.h" +#include void pcb_hidlib_adjust_attached_objects(pcb_hidlib_t *hl) { Index: trunk/src/librnd/core/hidlib.c =================================================================== --- trunk/src/librnd/core/hidlib.c (revision 29339) +++ trunk/src/librnd/core/hidlib.c (revision 29340) @@ -27,7 +27,7 @@ #include #include -#include "tool.h" +#include #include #include Index: trunk/src/librnd/core/tool.c =================================================================== --- trunk/src/librnd/core/tool.c (nonexistent) +++ trunk/src/librnd/core/tool.c (revision 29340) @@ -0,0 +1,257 @@ +/* + * COPYRIGHT + * + * pcb-rnd, interactive printed circuit board design + * Copyright (C) 2017,2019,2020 Tibor 'Igor2' Palinkas + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Contact: + * Project page: http://repo.hu/projects/pcb-rnd + * lead developer: http://repo.hu/projects/pcb-rnd/contact.html + * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") + */ + +#include "config.h" + +#include + +#include +#include +#include + +#define PCB_MAX_MODESTACK_DEPTH 16 /* maximum depth of mode stack */ + +vtp0_t pcb_tools; + +pcb_toolid_t pcb_tool_prev_id; +pcb_toolid_t pcb_tool_next_id; +static int save_position = 0; +static int save_stack[PCB_MAX_MODESTACK_DEPTH]; + +static void init_current_tool(void); +static void uninit_current_tool(void); + +static int tool_select_lock = 0; + +void pcb_tool_init(void) +{ + vtp0_init(&pcb_tools); +} + +void pcb_tool_uninit(void) +{ + while(vtp0_len(&pcb_tools) != 0) { + const pcb_tool_t *tool = pcb_tool_get(0); + pcb_message(PCB_MSG_WARNING, "Unregistered tool: %s of %s; check your plugins, fix them to unregister their tools!\n", tool->name, tool->cookie); + pcb_tool_unreg_by_cookie(tool->cookie); + } + vtp0_uninit(&pcb_tools); +} + +void pcb_tool_chg_mode(pcb_hidlib_t *hl) +{ + if ((hl != NULL) && (!tool_select_lock)) + pcb_tool_select_by_id(hl, pcbhl_conf.editor.mode); +} + +pcb_toolid_t pcb_tool_reg(pcb_tool_t *tool, const char *cookie) +{ + pcb_toolid_t id; + if (pcb_tool_lookup(tool->name) != PCB_TOOLID_INVALID) /* don't register two tools with the same name */ + return -1; + tool->cookie = cookie; + id = pcb_tools.used; + vtp0_append(&pcb_tools, (void *)tool); + if (pcb_gui != NULL) + pcb_gui->reg_mouse_cursor(pcb_gui, id, tool->cursor.name, tool->cursor.pixel, tool->cursor.mask); + pcb_event(NULL, PCB_EVENT_TOOL_REG, "p", tool); + return id; +} + +void pcb_tool_unreg_by_cookie(const char *cookie) +{ + pcb_toolid_t n; + for(n = 0; n < vtp0_len(&pcb_tools); n++) { + const pcb_tool_t *tool = (const pcb_tool_t *)pcb_tools.array[n]; + if (tool->cookie == cookie) { + vtp0_remove(&pcb_tools, n, 1); + n--; + } + } +} + +pcb_toolid_t pcb_tool_lookup(const char *name) +{ + pcb_toolid_t n; + for(n = 0; n < vtp0_len(&pcb_tools); n++) { + const pcb_tool_t *tool = (const pcb_tool_t *)pcb_tools.array[n]; + if (strcmp(tool->name, name) == 0) + return n; + } + return PCB_TOOLID_INVALID; +} + +int pcb_tool_select_by_name(pcb_hidlib_t *hidlib, const char *name) +{ + pcb_toolid_t id = pcb_tool_lookup(name); + if (id == PCB_TOOLID_INVALID) + return -1; + return pcb_tool_select_by_id(hidlib, id); +} + +int pcb_tool_select_by_id(pcb_hidlib_t *hidlib, pcb_toolid_t id) +{ + char id_s[32]; + static pcb_bool recursing = pcb_false; + int ok = 1; + + if ((id < 0) || (id > vtp0_len(&pcb_tools))) + return -1; + + /* protect the cursor while changing the mode + * perform some additional stuff depending on the new mode + * reset 'state' of attached objects + */ + if (recursing) + return -1; + + /* check if the UI logic allows picking that tool */ + pcb_event(hidlib, PCB_EVENT_TOOL_SELECT_PRE, "pi", &ok, id); + if (ok == 0) + id = pcbhl_conf.editor.mode; + + recursing = pcb_true; + + pcb_tool_prev_id = pcbhl_conf.editor.mode; + pcb_tool_next_id = id; + uninit_current_tool(); + sprintf(id_s, "%d", id); + tool_select_lock = 1; + pcb_conf_set(CFR_DESIGN, "editor/mode", -1, id_s, POL_OVERWRITE); + tool_select_lock = 0; + init_current_tool(); + + recursing = pcb_false; + + if (pcb_gui != NULL) + pcb_gui->set_mouse_cursor(pcb_gui, id); + return 0; +} + +int pcb_tool_select_highest(pcb_hidlib_t *hidlib) +{ + pcb_toolid_t n, bestn = PCB_TOOLID_INVALID; + unsigned int bestp = -1; + for(n = 0; n < vtp0_len(&pcb_tools) && (bestp > 0); n++) { + const pcb_tool_t *tool = (const pcb_tool_t *)pcb_tools.array[n]; + if (tool->priority < bestp) { + bestp = tool->priority; + bestn = n; + } + } + if (bestn == PCB_TOOLID_INVALID) + return -1; + return pcb_tool_select_by_id(hidlib, bestn); +} + +int pcb_tool_save(pcb_hidlib_t *hidlib) +{ + save_stack[save_position] = pcbhl_conf.editor.mode; + if (save_position < PCB_MAX_MODESTACK_DEPTH - 1) + save_position++; + else + return -1; + return 0; +} + +int pcb_tool_restore(pcb_hidlib_t *hidlib) +{ + if (save_position == 0) { + pcb_message(PCB_MSG_ERROR, "hace: underflow of restore mode\n"); + return -1; + } + return pcb_tool_select_by_id(hidlib, save_stack[--save_position]); +} + +void pcb_tool_gui_init(void) +{ + pcb_toolid_t n; + pcb_tool_t **tool; + + if (pcb_gui == NULL) + return; + + for(n = 0, tool = (pcb_tool_t **)pcb_tools.array; n < pcb_tools.used; n++,tool++) + if (*tool != NULL) + pcb_gui->reg_mouse_cursor(pcb_gui, n, (*tool)->cursor.name, (*tool)->cursor.pixel, (*tool)->cursor.mask); +} + +/**** current tool function wrappers ****/ +#define wrap(func, err_ret, prefix, args) \ + do { \ + const pcb_tool_t *tool; \ + if ((pcbhl_conf.editor.mode < 0) || (pcbhl_conf.editor.mode >= vtp0_len(&pcb_tools))) \ + { err_ret; } \ + tool = (const pcb_tool_t *)pcb_tools.array[pcbhl_conf.editor.mode]; \ + if (tool->func == NULL) \ + { err_ret; } \ + prefix tool->func args; \ + } while(0) + +#define wrap_void(func, args) wrap(func, return, ;, args) +#define wrap_retv(func, err_ret, args) wrap(func, err_ret, return, args) + +static void init_current_tool(void) +{ + wrap_void(init, ()); +} + +static void uninit_current_tool(void) +{ + wrap_void(uninit, ()); +} + +void pcb_tool_notify_mode(pcb_hidlib_t *hidlib) +{ + wrap_void(notify_mode, (hidlib)); +} + +void pcb_tool_release_mode(pcb_hidlib_t *hidlib) +{ + wrap_void(release_mode, (hidlib)); +} + +void pcb_tool_adjust_attached_objects(pcb_hidlib_t *hl) +{ + wrap_void(adjust_attached_objects, (hl)); +} + +void pcb_tool_draw_attached(pcb_hidlib_t *hl) +{ + wrap_void(draw_attached, (hl)); +} + +pcb_bool pcb_tool_undo_act(pcb_hidlib_t *hl) +{ + wrap_retv(undo_act, return pcb_true, (hl)); +} + +pcb_bool pcb_tool_redo_act(pcb_hidlib_t *hl) +{ + wrap_retv(redo_act, return pcb_true, (hl)); +} + + Index: trunk/src/librnd/core/tool.h =================================================================== --- trunk/src/librnd/core/tool.h (nonexistent) +++ trunk/src/librnd/core/tool.h (revision 29340) @@ -0,0 +1,124 @@ +/* + * COPYRIGHT + * + * pcb-rnd, interactive printed circuit board design + * Copyright (C) 2017,2020 Tibor 'Igor2' Palinkas + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Contact: + * Project page: http://repo.hu/projects/pcb-rnd + * lead developer: http://repo.hu/projects/pcb-rnd/contact.html + * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") + */ + +#ifndef PCB_TOOL_H +#define PCB_TOOL_H + +#include + +#include +#include + +typedef int pcb_toolid_t; +#define PCB_TOOLID_INVALID (-1) + +typedef struct pcb_tool_cursor_s { + const char *name; /* if no custom graphics is provided, use a stock cursor by name */ + const unsigned char *pixel; /* 32 bytes: 16*16 bitmap */ + const unsigned char *mask; /* 32 bytes: 16*16 mask (1 means draw pixel) */ +} pcb_tool_cursor_t; + +#define PCB_TOOL_CURSOR_NAMED(name) { name, NULL, NULL } +#define PCB_TOOL_CURSOR_XBM(pixel, mask) { NULL, pixel, mask } + +typedef enum pcb_tool_flags_e { + PCB_TLF_AUTO_TOOLBAR = 1 /* automatically insert in the toolbar if the menu file didn't do it */ +} pcb_tool_flags_t; + +typedef struct pcb_tool_s { + const char *name; /* textual name of the tool */ + const char *help; /* help/tooltip that explains the feature */ + const char *cookie; /* plugin cookie _pointer_ of the registrar (comparision is pointer based, not strcmp) */ + unsigned int priority; /* lower values are higher priorities; escaping mode will try to select the highest prio tool */ + const char **icon; /* XPM for the tool buttons */ + pcb_tool_cursor_t cursor; /* name of the mouse cursor to switch to when the tool is activated */ + pcb_tool_flags_t flags; + + /* tool implementation */ + void (*init)(void); + void (*uninit)(void); + void (*notify_mode)(pcb_hidlib_t *hl); + void (*release_mode)(pcb_hidlib_t *hl); + void (*adjust_attached_objects)(pcb_hidlib_t *hl); + void (*draw_attached)(pcb_hidlib_t *hl); + pcb_bool (*undo_act)(pcb_hidlib_t *hl); + pcb_bool (*redo_act)(pcb_hidlib_t *hl); + pcb_bool (*escape)(pcb_hidlib_t *hl); + + pcb_bool allow_when_drawing_ratlines; +} pcb_tool_t; + +extern vtp0_t pcb_tools; +extern pcb_bool pcb_tool_is_saved; +extern pcb_toolid_t pcb_tool_prev_id; +extern pcb_toolid_t pcb_tool_next_id; + +/* (un)initialize the tool subsystem */ +void pcb_tool_init(void); +void pcb_tool_uninit(void); + +/* call this when the mode (tool) config node changes */ +void pcb_tool_chg_mode(pcb_hidlib_t *hl); + +/* Insert a new tool in pcb_tools; returns -1 on failure */ +pcb_toolid_t pcb_tool_reg(pcb_tool_t *tool, const char *cookie); + +/* Unregister all tools that has matching cookie */ +void pcb_tool_unreg_by_cookie(const char *cookie); + +/* Return the ID of a tool by name; returns -1 on error */ +pcb_toolid_t pcb_tool_lookup(const char *name); + + +/* Select a tool by name, id or pick the highest prio tool; return 0 on success */ +int pcb_tool_select_by_name(pcb_hidlib_t *hidlib, const char *name); +int pcb_tool_select_by_id(pcb_hidlib_t *hidlib, pcb_toolid_t id); +int pcb_tool_select_highest(pcb_hidlib_t *hidlib); + +int pcb_tool_save(pcb_hidlib_t *hidlib); +int pcb_tool_restore(pcb_hidlib_t *hidlib); + +/* Called after GUI_INIT; registers all mouse cursors in the GUI */ +void pcb_tool_gui_init(void); + + +/**** Tool function wrappers; calling these will operate on the current tool + as defined in pcbhl_conf.editor.mode ****/ + +void pcb_tool_notify_mode(pcb_hidlib_t *hidlib); +void pcb_tool_release_mode(pcb_hidlib_t *hidlib); +void pcb_tool_adjust_attached_objects(pcb_hidlib_t *hl); +void pcb_tool_draw_attached(pcb_hidlib_t *hl); +pcb_bool pcb_tool_undo_act(pcb_hidlib_t *hl); +pcb_bool pcb_tool_redo_act(pcb_hidlib_t *hl); + + +/**** Low level, for internal use ****/ + +/* Get the tool pointer of a tool by id */ +#define pcb_tool_get(id) ((const pcb_tool_t *)*vtp0_get(&pcb_tools, id, 0)) + +#endif Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 29339) +++ trunk/src/main.c (revision 29340) @@ -64,7 +64,7 @@ #include "layer_ui.h" #include "obj_text.h" #include "pcb_minuid.h" -#include "tool.h" +#include #include #include "netlist.h" #include "extobj.h" Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 29339) +++ trunk/src/object_act.c (revision 29340) @@ -39,7 +39,7 @@ #include "data.h" #include "board.h" -#include "tool.h" +#include #include "change.h" #include #include "undo.h" Index: trunk/src/polygon_act.c =================================================================== --- trunk/src/polygon_act.c (revision 29339) +++ trunk/src/polygon_act.c (revision 29340) @@ -44,7 +44,7 @@ #include "draw.h" #include "search.h" #include "crosshair.h" -#include "tool.h" +#include #include #include "obj_poly.h" Index: trunk/src/remove_act.c =================================================================== --- trunk/src/remove_act.c (revision 29339) +++ trunk/src/remove_act.c (revision 29340) @@ -35,7 +35,7 @@ #include "config.h" #include "data.h" #include -#include "tool.h" +#include #include "remove.h" #include "board.h" #include "funchash_core.h" Index: trunk/src/select_act.c =================================================================== --- trunk/src/select_act.c (revision 29339) +++ trunk/src/select_act.c (revision 29340) @@ -40,7 +40,7 @@ #include "undo.h" #include "funchash_core.h" -#include "tool.h" +#include #include "select.h" #include "draw.h" #include "remove.h" Index: trunk/src/tool_logic.c =================================================================== --- trunk/src/tool_logic.c (revision 29339) +++ trunk/src/tool_logic.c (revision 29340) @@ -30,7 +30,7 @@ #include #include #include -#include "tool.h" +#include #include "board.h" #include "conf_core.h" Index: trunk/src/undo_act.c =================================================================== --- trunk/src/undo_act.c (revision 29339) +++ trunk/src/undo_act.c (revision 29340) @@ -48,7 +48,7 @@ #include "obj_line_draw.h" -#include "tool.h" +#include static const char pcb_acts_Atomic[] = "Atomic(Save|Restore|Close|Block)"; static const char pcb_acth_Atomic[] = "Save or restore the undo serial number."; Index: trunk/src_plugins/ddraft/constraint.c =================================================================== --- trunk/src_plugins/ddraft/constraint.c (revision 29339) +++ trunk/src_plugins/ddraft/constraint.c (revision 29340) @@ -28,7 +28,7 @@ #include "crosshair.h" #include "obj_line.h" -#include "tool.h" +#include typedef struct { double line_angle[32], move_angle[32]; Index: trunk/src_plugins/dialogs/dlg_library.c =================================================================== --- trunk/src_plugins/dialogs/dlg_library.c (revision 29339) +++ trunk/src_plugins/dialogs/dlg_library.c (revision 29340) @@ -41,7 +41,7 @@ #include #include "obj_subc.h" #include "plug_footprint.h" -#include "tool.h" +#include #include "undo.h" #include Index: trunk/src_plugins/hid_lesstif/library.c =================================================================== --- trunk/src_plugins/hid_lesstif/library.c (revision 29339) +++ trunk/src_plugins/hid_lesstif/library.c (revision 29340) @@ -19,7 +19,7 @@ #include "lesstif.h" #include "ltf_stdarg.h" #include -#include "tool.h" +#include extern pcb_hidlib_t *ltf_hidlib; Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 29339) +++ trunk/src_plugins/hid_lesstif/main.c (revision 29340) @@ -45,7 +45,7 @@ #include #include #include "layer_vis.h" -#include "tool.h" +#include #include "wt_preview.h" #include "dlg_fileselect.h" Index: trunk/src_plugins/lib_gtk_common/in_mouse.c =================================================================== --- trunk/src_plugins/lib_gtk_common/in_mouse.c (revision 29339) +++ trunk/src_plugins/lib_gtk_common/in_mouse.c (revision 29340) @@ -39,7 +39,7 @@ #include "board.h" #include "crosshair.h" #include "conf_core.h" -#include "tool.h" +#include #define GVT_DONT_UNDEF #include "in_mouse.h" Index: trunk/src_plugins/lib_hid_pcbui/toolbar.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/toolbar.c (revision 29339) +++ trunk/src_plugins/lib_hid_pcbui/toolbar.c (revision 29340) @@ -32,7 +32,7 @@ #include #include #include -#include "tool.h" +#include #include "board.h" #include Index: trunk/src_plugins/serpentine/serpentine.c =================================================================== --- trunk/src_plugins/serpentine/serpentine.c (revision 29339) +++ trunk/src_plugins/serpentine/serpentine.c (revision 29340) @@ -35,7 +35,7 @@ #include "data_it.h" #include #include "search.h" -#include "tool.h" +#include #include #include "flag_str.h" #include "undo.h" Index: trunk/src_plugins/shand_cmd/command.c =================================================================== --- trunk/src_plugins/shand_cmd/command.c (revision 29339) +++ trunk/src_plugins/shand_cmd/command.c (revision 29340) @@ -45,7 +45,7 @@ #include #include #include -#include "tool.h" +#include static const char pcb_acts_Help[] = "h"; static const char pcb_acth_Help[] = "Print a help message for commands."; Index: trunk/src_plugins/shape/shape.c =================================================================== --- trunk/src_plugins/shape/shape.c (revision 29339) +++ trunk/src_plugins/shape/shape.c (revision 29340) @@ -43,7 +43,7 @@ #include "obj_poly.h" #include "obj_poly_draw.h" #include "rotate.h" -#include "tool.h" +#include const char *pcb_shape_corner_name[] = {"Rn", "Ch", "Sq", NULL}; Index: trunk/src_plugins/sketch_route/sketch_route.c =================================================================== --- trunk/src_plugins/sketch_route/sketch_route.c (revision 29339) +++ trunk/src_plugins/sketch_route/sketch_route.c (revision 29340) @@ -45,7 +45,7 @@ #include "obj_subc_parent.h" #include #include "search.h" -#include "tool.h" +#include #include "layer_ui.h" #include "netlist.h" Index: trunk/src_plugins/stroke/stroke.c =================================================================== --- trunk/src_plugins/stroke/stroke.c (revision 29339) +++ trunk/src_plugins/stroke/stroke.c (revision 29340) @@ -39,7 +39,7 @@ #include #include "stub_stroke.h" #include -#include "tool.h" +#include #include "../src_plugins/stroke/conf_internal.c" #include "stroke_conf.h" Index: trunk/src_plugins/tool_std/tool_arc.c =================================================================== --- trunk/src_plugins/tool_std/tool_arc.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_arc.c (revision 29340) @@ -43,7 +43,7 @@ #include "draw.h" #include "draw_wireframe.h" #include "search.h" -#include "tool.h" +#include #include "undo.h" #include "obj_arc_draw.h" Index: trunk/src_plugins/tool_std/tool_arrow.c =================================================================== --- trunk/src_plugins/tool_std/tool_arrow.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_arrow.c (revision 29340) @@ -44,7 +44,7 @@ #include "move.h" #include "search.h" #include "select.h" -#include "tool.h" +#include #include "undo.h" #include "extobj.h" Index: trunk/src_plugins/tool_std/tool_buffer.c =================================================================== --- trunk/src_plugins/tool_std/tool_buffer.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_buffer.c (revision 29340) @@ -42,7 +42,7 @@ #include #include #include "search.h" -#include "tool.h" +#include #include "undo.h" void pcb_tool_buffer_init(void) Index: trunk/src_plugins/tool_std/tool_copy.c =================================================================== --- trunk/src_plugins/tool_std/tool_copy.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_copy.c (revision 29340) @@ -38,7 +38,7 @@ #include "move.h" #include "crosshair.h" #include "search.h" -#include "tool.h" +#include void pcb_tool_copy_uninit(void) { Index: trunk/src_plugins/tool_std/tool_insert.c =================================================================== --- trunk/src_plugins/tool_std/tool_insert.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_insert.c (revision 29340) @@ -39,7 +39,7 @@ #include "insert.h" #include "polygon.h" #include "search.h" -#include "tool.h" +#include static struct { Index: trunk/src_plugins/tool_std/tool_line.c =================================================================== --- trunk/src_plugins/tool_std/tool_line.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_line.c (revision 29340) @@ -46,7 +46,7 @@ #include "obj_line.h" #include "obj_subc.h" #include "search.h" -#include "tool.h" +#include #include "undo.h" #include "netlist.h" Index: trunk/src_plugins/tool_std/tool_lock.c =================================================================== --- trunk/src_plugins/tool_std/tool_lock.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_lock.c (revision 29340) @@ -40,7 +40,7 @@ #include "draw.h" #include #include "search.h" -#include "tool.h" +#include #include "tool_lock.h" #define PCB_OBJ_CLASS_LOCK (PCB_OBJ_PSTK | PCB_OBJ_LINE | PCB_OBJ_ARC | PCB_OBJ_POLY | PCB_OBJ_SUBC | PCB_OBJ_TEXT | PCB_OBJ_LOCKED) Index: trunk/src_plugins/tool_std/tool_move.c =================================================================== --- trunk/src_plugins/tool_std/tool_move.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_move.c (revision 29340) @@ -38,7 +38,7 @@ #include "move.h" #include "crosshair.h" #include "search.h" -#include "tool.h" +#include #include "extobj.h" Index: trunk/src_plugins/tool_std/tool_poly.c =================================================================== --- trunk/src_plugins/tool_std/tool_poly.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_poly.c (revision 29340) @@ -39,7 +39,7 @@ #include "crosshair.h" #include #include "polygon.h" -#include "tool.h" +#include void pcb_tool_poly_uninit(void) Index: trunk/src_plugins/tool_std/tool_polyhole.c =================================================================== --- trunk/src_plugins/tool_std/tool_polyhole.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_polyhole.c (revision 29340) @@ -40,7 +40,7 @@ #include #include "polygon.h" #include "search.h" -#include "tool.h" +#include void pcb_tool_polyhole_uninit(void) Index: trunk/src_plugins/tool_std/tool_rectangle.c =================================================================== --- trunk/src_plugins/tool_std/tool_rectangle.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_rectangle.c (revision 29340) @@ -39,7 +39,7 @@ #include "crosshair.h" #include "data.h" #include "draw.h" -#include "tool.h" +#include #include "undo.h" #include "obj_poly_draw.h" Index: trunk/src_plugins/tool_std/tool_remove.c =================================================================== --- trunk/src_plugins/tool_std/tool_remove.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_remove.c (revision 29340) @@ -41,7 +41,7 @@ #include "remove.h" #include "search.h" #include "obj_rat.h" -#include "tool.h" +#include #include "crosshair.h" Index: trunk/src_plugins/tool_std/tool_rotate.c =================================================================== --- trunk/src_plugins/tool_std/tool_rotate.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_rotate.c (revision 29340) @@ -38,7 +38,7 @@ #include #include "board.h" #include "rotate.h" -#include "tool.h" +#include #include "crosshair.h" Index: trunk/src_plugins/tool_std/tool_std.c =================================================================== --- trunk/src_plugins/tool_std/tool_std.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_std.c (revision 29340) @@ -31,7 +31,7 @@ #include "conf_core.h" #include -#include "tool.h" +#include #include "crosshair.h" #include "tool_arc.h" Index: trunk/src_plugins/tool_std/tool_text.c =================================================================== --- trunk/src_plugins/tool_std/tool_text.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_text.c (revision 29340) @@ -39,7 +39,7 @@ #include "data.h" #include "draw.h" #include -#include "tool.h" +#include #include "undo.h" #include "obj_text_draw.h" Index: trunk/src_plugins/tool_std/tool_thermal.c =================================================================== --- trunk/src_plugins/tool_std/tool_thermal.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_thermal.c (revision 29340) @@ -41,7 +41,7 @@ #include "obj_pstk.h" #include "search.h" #include "thermal.h" -#include "tool.h" +#include void pcb_tool_thermal_on_pstk(pcb_pstk_t *ps, unsigned long lid) { Index: trunk/src_plugins/tool_std/tool_via.c =================================================================== --- trunk/src_plugins/tool_std/tool_via.c (revision 29339) +++ trunk/src_plugins/tool_std/tool_via.c (revision 29340) @@ -42,7 +42,7 @@ #include #include "data.h" #include "draw.h" -#include "tool.h" +#include #include "tool_thermal.h" #include "undo.h"