Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 31018) +++ trunk/src/buffer.c (revision 31019) @@ -1112,7 +1112,7 @@ RND_ACT_IRES(-1); } else - pcb_tool_select_by_name(RND_ACT_HIDLIB, "buffer"); + rnd_tool_select_by_name(RND_ACT_HIDLIB, "buffer"); break; case F_Save: Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 31018) +++ trunk/src/crosshair.c (revision 31019) @@ -494,7 +494,7 @@ } rnd_render->set_color(pcb_crosshair.GC, &conf_core.appearance.color.attached); - pcb_tool_draw_attached(hidlib); + rnd_tool_draw_attached(hidlib); /* an attached box does not depend on a special mode */ if (pcb_crosshair.AttachedBox.State == PCB_CH_STATE_SECOND || pcb_crosshair.AttachedBox.State == PCB_CH_STATE_THIRD) { @@ -1124,7 +1124,7 @@ { if (pcb_crosshair_move_absolute(ev_x, ev_y)) { /* update object position and cursor location */ - pcb_tool_adjust_attached(&PCB->hidlib); + rnd_tool_adjust_attached(&PCB->hidlib); rnd_event(&PCB->hidlib, PCB_EVENT_DRAW_CROSSHAIR_CHATT, NULL); rnd_hid_notify_crosshair_change(&PCB->hidlib, rnd_true); } Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 31018) +++ trunk/src/file_act.c (revision 31019) @@ -78,7 +78,7 @@ case F_Footprint: rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, rnd_false); if (pcb_buffer_load_footprint(PCB_PASTEBUFFER, name, format)) - pcb_tool_select_by_name(RND_ACT_HIDLIB, "buffer"); + rnd_tool_select_by_name(RND_ACT_HIDLIB, "buffer"); rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, rnd_true); break; @@ -85,7 +85,7 @@ case F_LayoutToBuffer: rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, rnd_false); if (pcb_buffer_load_layout(PCB, PCB_PASTEBUFFER, name, format)) - pcb_tool_select_by_name(RND_ACT_HIDLIB, "buffer"); + rnd_tool_select_by_name(RND_ACT_HIDLIB, "buffer"); rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, rnd_true); break; Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 31018) +++ trunk/src/gui_act.c (revision 31019) @@ -144,7 +144,7 @@ /* toggle line-adjust flag */ case F_ToggleAllDirections: rnd_conf_toggle_editor(all_direction_lines); - pcb_tool_adjust_attached(RND_ACT_HIDLIB); + rnd_tool_adjust_attached(RND_ACT_HIDLIB); break; case F_CycleClip: @@ -156,7 +156,7 @@ else { rnd_conf_setf(RND_CFR_DESIGN,"editor/line_refraction",-1,"%d",(conf_core.editor.line_refraction +1) % 3); } - pcb_tool_adjust_attached(RND_ACT_HIDLIB); + rnd_tool_adjust_attached(RND_ACT_HIDLIB); rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, rnd_true); break; @@ -592,7 +592,7 @@ set_same_(((pcb_line_t *) ptr2)->Thickness, -1, -1, ((pcb_line_t *) ptr2)->Clearance / 2, NULL); layer = (pcb_layer_t *) ptr1; if (rnd_conf.editor.mode != pcb_crosshair.tool_line) - pcb_tool_select_by_name(RND_ACT_HIDLIB, "line"); + rnd_tool_select_by_name(RND_ACT_HIDLIB, "line"); rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, rnd_true); rnd_event(RND_ACT_HIDLIB, PCB_EVENT_ROUTE_STYLES_CHANGED, NULL); break; @@ -602,7 +602,7 @@ set_same_(((pcb_arc_t *) ptr2)->Thickness, -1, -1, ((pcb_arc_t *) ptr2)->Clearance / 2, NULL); layer = (pcb_layer_t *) ptr1; if (rnd_conf.editor.mode != pcb_crosshair.tool_arc) - pcb_tool_select_by_name(RND_ACT_HIDLIB, "arc"); + rnd_tool_select_by_name(RND_ACT_HIDLIB, "arc"); rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, rnd_true); rnd_event(RND_ACT_HIDLIB, PCB_EVENT_ROUTE_STYLES_CHANGED, NULL); break; Index: trunk/src/hidlib_pcb.c =================================================================== --- trunk/src/hidlib_pcb.c (revision 31018) +++ trunk/src/hidlib_pcb.c (revision 31019) @@ -29,5 +29,5 @@ void rnd_hidlib_adjust_attached_objects(rnd_hidlib_t *hl) { - pcb_tool_adjust_attached(hl); + rnd_tool_adjust_attached(hl); } Index: trunk/src/librnd/core/conf_act.c =================================================================== --- trunk/src/librnd/core/conf_act.c (revision 31018) +++ trunk/src/librnd/core/conf_act.c (revision 31019) @@ -236,11 +236,11 @@ static fgw_error_t pcb_act_ChkMode(fgw_arg_t *res, int argc, fgw_arg_t *argv) { const char *dst; - pcb_toolid_t id; + rnd_toolid_t id; RND_PCB_ACT_CONVARG(1, FGW_STR, ChkMode, dst = argv[1].val.str); - id = pcb_tool_lookup(dst); + id = rnd_tool_lookup(dst); if (id >= 0) { RND_ACT_IRES(rnd_conf.editor.mode == id); return 0; Index: trunk/src/librnd/core/tool.c =================================================================== --- trunk/src/librnd/core/tool.c (revision 31018) +++ trunk/src/librnd/core/tool.c (revision 31019) @@ -38,12 +38,12 @@ #define PCB_MAX_MODESTACK_DEPTH 16 /* maximum depth of mode stack */ -rnd_bool pcb_tool_is_saved = rnd_false; +rnd_bool rnd_tool_is_saved = rnd_false; -vtp0_t pcb_tools; +vtp0_t rnd_tools; -pcb_toolid_t pcb_tool_prev_id; -pcb_toolid_t pcb_tool_next_id; +rnd_toolid_t rnd_tool_prev_id; +rnd_toolid_t rnd_tool_next_id; static int save_position = 0; static int save_stack[PCB_MAX_MODESTACK_DEPTH]; @@ -52,35 +52,35 @@ static int tool_select_lock = 0; -void pcb_tool_init(void) +void rnd_tool_init(void) { - vtp0_init(&pcb_tools); + vtp0_init(&rnd_tools); } -void pcb_tool_uninit(void) +void rnd_tool_uninit(void) { - while(vtp0_len(&pcb_tools) != 0) { - const pcb_tool_t *tool = pcb_tool_get(0); + while(vtp0_len(&rnd_tools) != 0) { + const pcb_tool_t *tool = rnd_tool_get(0); rnd_message(RND_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); + rnd_tool_unreg_by_cookie(tool->cookie); } - vtp0_uninit(&pcb_tools); + vtp0_uninit(&rnd_tools); } -void pcb_tool_chg_mode(rnd_hidlib_t *hl) +void rnd_tool_chg_mode(rnd_hidlib_t *hl) { if ((hl != NULL) && (!tool_select_lock)) - pcb_tool_select_by_id(hl, rnd_conf.editor.mode); + rnd_tool_select_by_id(hl, rnd_conf.editor.mode); } -pcb_toolid_t pcb_tool_reg(pcb_tool_t *tool, const char *cookie) +rnd_toolid_t rnd_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 */ + rnd_toolid_t id; + if (rnd_tool_lookup(tool->name) != RND_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); + id = rnd_tools.used; + vtp0_append(&rnd_tools, (void *)tool); if (rnd_gui != NULL) rnd_gui->reg_mouse_cursor(rnd_gui, id, tool->cursor.name, tool->cursor.pixel, tool->cursor.mask); rnd_event(NULL, RND_EVENT_TOOL_REG, "p", tool); @@ -87,44 +87,44 @@ return id; } -void pcb_tool_unreg_by_cookie(const char *cookie) +void rnd_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]; + rnd_toolid_t n; + for(n = 0; n < vtp0_len(&rnd_tools); n++) { + const pcb_tool_t *tool = (const pcb_tool_t *)rnd_tools.array[n]; if (tool->cookie == cookie) { - vtp0_remove(&pcb_tools, n, 1); + vtp0_remove(&rnd_tools, n, 1); n--; } } } -pcb_toolid_t pcb_tool_lookup(const char *name) +rnd_toolid_t rnd_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]; + rnd_toolid_t n; + for(n = 0; n < vtp0_len(&rnd_tools); n++) { + const pcb_tool_t *tool = (const pcb_tool_t *)rnd_tools.array[n]; if (strcmp(tool->name, name) == 0) return n; } - return PCB_TOOLID_INVALID; + return RND_TOOLID_INVALID; } -int pcb_tool_select_by_name(rnd_hidlib_t *hidlib, const char *name) +int rnd_tool_select_by_name(rnd_hidlib_t *hidlib, const char *name) { - pcb_toolid_t id = pcb_tool_lookup(name); - if (id == PCB_TOOLID_INVALID) + rnd_toolid_t id = rnd_tool_lookup(name); + if (id == RND_TOOLID_INVALID) return -1; - return pcb_tool_select_by_id(hidlib, id); + return rnd_tool_select_by_id(hidlib, id); } -int pcb_tool_select_by_id(rnd_hidlib_t *hidlib, pcb_toolid_t id) +int rnd_tool_select_by_id(rnd_hidlib_t *hidlib, rnd_toolid_t id) { char id_s[32]; static rnd_bool recursing = rnd_false; int ok = 1; - if ((id < 0) || (id > vtp0_len(&pcb_tools))) + if ((id < 0) || (id > vtp0_len(&rnd_tools))) return -1; /* protect the cursor while changing the mode @@ -141,8 +141,8 @@ recursing = rnd_true; - pcb_tool_prev_id = rnd_conf.editor.mode; - pcb_tool_next_id = id; + rnd_tool_prev_id = rnd_conf.editor.mode; + rnd_tool_next_id = id; uninit_current_tool(); sprintf(id_s, "%d", id); tool_select_lock = 1; @@ -157,23 +157,23 @@ return 0; } -int pcb_tool_select_highest(rnd_hidlib_t *hidlib) +int rnd_tool_select_highest(rnd_hidlib_t *hidlib) { - pcb_toolid_t n, bestn = PCB_TOOLID_INVALID; + rnd_toolid_t n, bestn = RND_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]; + for(n = 0; n < vtp0_len(&rnd_tools) && (bestp > 0); n++) { + const pcb_tool_t *tool = (const pcb_tool_t *)rnd_tools.array[n]; if (tool->priority < bestp) { bestp = tool->priority; bestn = n; } } - if (bestn == PCB_TOOLID_INVALID) + if (bestn == RND_TOOLID_INVALID) return -1; - return pcb_tool_select_by_id(hidlib, bestn); + return rnd_tool_select_by_id(hidlib, bestn); } -int pcb_tool_save(rnd_hidlib_t *hidlib) +int rnd_tool_save(rnd_hidlib_t *hidlib) { save_stack[save_position] = rnd_conf.editor.mode; if (save_position < PCB_MAX_MODESTACK_DEPTH - 1) @@ -183,24 +183,24 @@ return 0; } -int pcb_tool_restore(rnd_hidlib_t *hidlib) +int rnd_tool_restore(rnd_hidlib_t *hidlib) { if (save_position == 0) { rnd_message(RND_MSG_ERROR, "hace: underflow of restore mode\n"); return -1; } - return pcb_tool_select_by_id(hidlib, save_stack[--save_position]); + return rnd_tool_select_by_id(hidlib, save_stack[--save_position]); } void rnd_tool_gui_init(void) { - pcb_toolid_t n; + rnd_toolid_t n; pcb_tool_t **tool; if (rnd_gui == NULL) return; - for(n = 0, tool = (pcb_tool_t **)pcb_tools.array; n < pcb_tools.used; n++,tool++) + for(n = 0, tool = (pcb_tool_t **)rnd_tools.array; n < rnd_tools.used; n++,tool++) if (*tool != NULL) rnd_gui->reg_mouse_cursor(rnd_gui, n, (*tool)->cursor.name, (*tool)->cursor.pixel, (*tool)->cursor.mask); } @@ -209,9 +209,9 @@ #define wrap(func, err_ret, prefix, args) \ do { \ const pcb_tool_t *tool; \ - if ((rnd_conf.editor.mode < 0) || (rnd_conf.editor.mode >= vtp0_len(&pcb_tools))) \ + if ((rnd_conf.editor.mode < 0) || (rnd_conf.editor.mode >= vtp0_len(&rnd_tools))) \ { err_ret; } \ - tool = (const pcb_tool_t *)pcb_tools.array[rnd_conf.editor.mode]; \ + tool = (const pcb_tool_t *)rnd_tools.array[rnd_conf.editor.mode]; \ if (tool->func == NULL) \ { err_ret; } \ prefix tool->func args; \ @@ -230,32 +230,32 @@ wrap_void(uninit, ()); } -void pcb_tool_press(rnd_hidlib_t *hidlib) +void rnd_tool_press(rnd_hidlib_t *hidlib) { wrap_void(press, (hidlib)); } -void pcb_tool_release(rnd_hidlib_t *hidlib) +void rnd_tool_release(rnd_hidlib_t *hidlib) { wrap_void(release, (hidlib)); } -void pcb_tool_adjust_attached(rnd_hidlib_t *hl) +void rnd_tool_adjust_attached(rnd_hidlib_t *hl) { wrap_void(adjust_attached, (hl)); } -void pcb_tool_draw_attached(rnd_hidlib_t *hl) +void rnd_tool_draw_attached(rnd_hidlib_t *hl) { wrap_void(draw_attached, (hl)); } -rnd_bool pcb_tool_undo_act(rnd_hidlib_t *hl) +rnd_bool rnd_tool_undo_act(rnd_hidlib_t *hl) { wrap_retv(undo_act, return rnd_true, (hl)); } -rnd_bool pcb_tool_redo_act(rnd_hidlib_t *hl) +rnd_bool rnd_tool_redo_act(rnd_hidlib_t *hl) { wrap_retv(redo_act, return rnd_true, (hl)); } @@ -267,15 +267,15 @@ hidlib->tool_grabbed.status = rnd_false; - pcb_tool_release(hidlib); + rnd_tool_release(hidlib); - if (pcb_tool_is_saved) - pcb_tool_restore(hidlib); - pcb_tool_is_saved = rnd_false; + if (rnd_tool_is_saved) + rnd_tool_restore(hidlib); + rnd_tool_is_saved = rnd_false; rnd_event(hidlib, RND_EVENT_TOOL_RELEASE, NULL); } -void pcb_tool_do_press(rnd_hidlib_t *hidlib) +void rnd_tool_do_press(rnd_hidlib_t *hidlib) { if (rnd_conf.temp.click_cmd_entry_active && (rnd_cli_mouse(hidlib, 1) == 0)) return; @@ -283,7 +283,7 @@ hidlib->tool_grabbed.X = hidlib->tool_x; hidlib->tool_grabbed.Y = hidlib->tool_y; - pcb_tool_press(hidlib); + rnd_tool_press(hidlib); rnd_event(hidlib, RND_EVENT_TOOL_PRESS, NULL); } @@ -306,14 +306,14 @@ hidlib->tool_y = hidlib->ch_y; rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, rnd_false); if (rnd_strcasecmp(cmd, "Cancel") == 0) { - pcb_tool_select_by_id(RND_ACT_HIDLIB, rnd_conf.editor.mode); + rnd_tool_select_by_id(RND_ACT_HIDLIB, rnd_conf.editor.mode); } else if (rnd_strcasecmp(cmd, "Escape") == 0) { const pcb_tool_t *t; escape:; - t = pcb_tool_get(rnd_conf.editor.mode); + t = rnd_tool_get(rnd_conf.editor.mode); if ((t == NULL) || (t->escape == NULL)) { - pcb_tool_select_by_name(RND_ACT_HIDLIB, "arrow"); + rnd_tool_select_by_name(RND_ACT_HIDLIB, "arrow"); hidlib->tool_hit = hidlib->tool_click = 0; /* if the mouse button is still pressed, don't start selecting a box */ } else @@ -320,7 +320,7 @@ t->escape(RND_ACT_HIDLIB); } else if ((rnd_strcasecmp(cmd, "Press") == 0) || (rnd_strcasecmp(cmd, "Notify") == 0)) { - pcb_tool_do_press(RND_ACT_HIDLIB); + rnd_tool_do_press(RND_ACT_HIDLIB); } else if (rnd_strcasecmp(cmd, "Release") == 0) { if (rnd_conf.editor.enable_stroke) { @@ -344,13 +344,13 @@ goto escape; /* Right mouse button restarts drawing mode. */ } else if (rnd_strcasecmp(cmd, "Restore") == 0) { /* restore the last saved tool */ - pcb_tool_restore(RND_ACT_HIDLIB); + rnd_tool_restore(RND_ACT_HIDLIB); } else if (rnd_strcasecmp(cmd, "Save") == 0) { /* save currently selected tool */ - pcb_tool_save(RND_ACT_HIDLIB); + rnd_tool_save(RND_ACT_HIDLIB); } else { - if (pcb_tool_select_by_name(RND_ACT_HIDLIB, cmd) != 0) + if (rnd_tool_select_by_name(RND_ACT_HIDLIB, cmd) != 0) rnd_message(RND_MSG_ERROR, "No such tool: '%s'\n", cmd); } rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, rnd_true); Index: trunk/src/librnd/core/tool.h =================================================================== --- trunk/src/librnd/core/tool.h (revision 31018) +++ trunk/src/librnd/core/tool.h (revision 31019) @@ -24,8 +24,8 @@ * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") */ -#ifndef PCB_TOOL_H -#define PCB_TOOL_H +#ifndef RND_TOOL_H +#define RND_TOOL_H #include @@ -32,21 +32,21 @@ #include #include -typedef int pcb_toolid_t; -#define PCB_TOOLID_INVALID (-1) +typedef int rnd_toolid_t; +#define RND_TOOLID_INVALID (-1) -typedef struct pcb_tool_cursor_s { +typedef struct rnd_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; +} rnd_tool_cursor_t; -#define PCB_TOOL_CURSOR_NAMED(name) { name, NULL, NULL } -#define PCB_TOOL_CURSOR_XBM(pixel, mask) { NULL, pixel, mask } +#define RND_TOOL_CURSOR_NAMED(name) { name, NULL, NULL } +#define RND_TOOL_CURSOR_XBM(pixel, mask) { NULL, pixel, mask } -typedef enum pcb_tool_flags_e { +typedef enum rnd_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; +} rnd_tool_flags_t; typedef struct pcb_tool_s { const char *name; /* textual name of the tool */ @@ -54,8 +54,8 @@ 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; + rnd_tool_cursor_t cursor; /* name of the mouse cursor to switch to when the tool is activated */ + rnd_tool_flags_t flags; /* tool implementation */ void (*init)(void); @@ -71,35 +71,35 @@ unsigned long user_flags; } pcb_tool_t; -extern vtp0_t pcb_tools; -extern pcb_toolid_t pcb_tool_prev_id; -extern pcb_toolid_t pcb_tool_next_id; -extern rnd_bool pcb_tool_is_saved; +extern vtp0_t rnd_tools; +extern rnd_toolid_t rnd_tool_prev_id; +extern rnd_toolid_t rnd_tool_next_id; +extern rnd_bool rnd_tool_is_saved; /* (un)initialize the tool subsystem */ -void pcb_tool_init(void); -void pcb_tool_uninit(void); +void rnd_tool_init(void); +void rnd_tool_uninit(void); /* call this when the mode (tool) config node changes */ -void pcb_tool_chg_mode(rnd_hidlib_t *hl); +void rnd_tool_chg_mode(rnd_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); +/* Insert a new tool in rnd_tools; returns -1 on failure */ +rnd_toolid_t rnd_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); +void rnd_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); +rnd_toolid_t rnd_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(rnd_hidlib_t *hidlib, const char *name); -int pcb_tool_select_by_id(rnd_hidlib_t *hidlib, pcb_toolid_t id); -int pcb_tool_select_highest(rnd_hidlib_t *hidlib); +int rnd_tool_select_by_name(rnd_hidlib_t *hidlib, const char *name); +int rnd_tool_select_by_id(rnd_hidlib_t *hidlib, rnd_toolid_t id); +int rnd_tool_select_highest(rnd_hidlib_t *hidlib); -int pcb_tool_save(rnd_hidlib_t *hidlib); -int pcb_tool_restore(rnd_hidlib_t *hidlib); +int rnd_tool_save(rnd_hidlib_t *hidlib); +int rnd_tool_restore(rnd_hidlib_t *hidlib); /* Called after GUI_INIT; registers all mouse cursors in the GUI */ void rnd_tool_gui_init(void); @@ -108,20 +108,20 @@ /**** Tool function wrappers; calling these will operate on the current tool as defined in rnd_conf.editor.mode ****/ -void pcb_tool_press(rnd_hidlib_t *hidlib); -void pcb_tool_release(rnd_hidlib_t *hidlib); -void pcb_tool_adjust_attached(rnd_hidlib_t *hl); -void pcb_tool_draw_attached(rnd_hidlib_t *hl); -rnd_bool pcb_tool_undo_act(rnd_hidlib_t *hl); -rnd_bool pcb_tool_redo_act(rnd_hidlib_t *hl); +void rnd_tool_press(rnd_hidlib_t *hidlib); +void rnd_tool_release(rnd_hidlib_t *hidlib); +void rnd_tool_adjust_attached(rnd_hidlib_t *hl); +void rnd_tool_draw_attached(rnd_hidlib_t *hl); +rnd_bool rnd_tool_undo_act(rnd_hidlib_t *hl); +rnd_bool rnd_tool_redo_act(rnd_hidlib_t *hl); /* fake a click */ -void pcb_tool_do_press(rnd_hidlib_t *hidlib); +void rnd_tool_do_press(rnd_hidlib_t *hidlib); /**** 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)) +#define rnd_tool_get(id) ((const pcb_tool_t *)*vtp0_get(&rnd_tools, id, 0)) #endif Index: trunk/src/librnd/pcb_compat.h =================================================================== --- trunk/src/librnd/pcb_compat.h (revision 31018) +++ trunk/src/librnd/pcb_compat.h (revision 31019) @@ -1107,3 +1107,36 @@ #define pcb_opendir rnd_opendir #define pcb_readdir rnd_readdir #define pcb_closedir rnd_closedir +#define pcb_toolid_t rnd_toolid_t +#define PCB_TOOLID_INVALID RND_TOOLID_INVALID +#define pcb_tool_cursor_s rnd_tool_cursor_s +#define pcb_tool_cursor_t rnd_tool_cursor_t +#define pcb_tool_flags_e rnd_tool_flags_e +#define pcb_tool_flags_t rnd_tool_flags_t +#define PCB_TOOL_CURSOR_NAMED RND_TOOL_CURSOR_NAMED +#define PCB_TOOL_CURSOR_XBM RND_TOOL_CURSOR_XBM +#define pcb_tool_s rnd_tool_s +#define pcb_tool_t rnd_tool_t +#define pcb_tools rnd_tools +#define pcb_tool_prev_id rnd_tool_prev_id +#define pcb_tool_next_id rnd_tool_next_id +#define pcb_tool_is_saved rnd_tool_is_saved +#define pcb_tool_init rnd_tool_init +#define pcb_tool_uninit rnd_tool_uninit +#define pcb_tool_chg_mode rnd_tool_chg_mode +#define pcb_tool_reg rnd_tool_reg +#define pcb_tool_unreg_by_cookie rnd_tool_unreg_by_cookie +#define pcb_tool_lookup rnd_tool_lookup +#define pcb_tool_select_by_name rnd_tool_select_by_name +#define pcb_tool_select_by_id rnd_tool_select_by_id +#define pcb_tool_select_highest rnd_tool_select_highest +#define pcb_tool_save rnd_tool_save +#define pcb_tool_restore rnd_tool_restore +#define pcb_tool_press rnd_tool_press +#define pcb_tool_release rnd_tool_release +#define pcb_tool_adjust_attached rnd_tool_adjust_attached +#define pcb_tool_draw_attached rnd_tool_draw_attached +#define pcb_tool_undo_act rnd_tool_undo_act +#define pcb_tool_redo_act rnd_tool_redo_act +#define pcb_tool_do_press rnd_tool_do_press +#define pcb_tool_get rnd_tool_get Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 31018) +++ trunk/src/main.c (revision 31019) @@ -359,7 +359,7 @@ pcb_io_uninit(); pcb_fp_uninit(); pcb_fp_host_uninit(); - pcb_tool_uninit(); + rnd_tool_uninit(); pcb_poly_uninit(); rnd_log_print_uninit_errs("Log produced during uninitialization"); @@ -439,7 +439,7 @@ /* optionally: handle extra arguments, not processed by the hidlib, here */ n += rnd_main_args_add(&ga, argv[n], argv[n+1]); } - pcb_tool_init(); + rnd_tool_init(); pcb_tool_logic_init(); rnd_hidlib_init2(pup_buildins, NULL); @@ -564,7 +564,7 @@ rnd_message(RND_MSG_ERROR, "%s\n", EXPERIMENTAL); rnd_message(RND_MSG_ERROR, "******************************** IMPORTANT ********************************\n"); } - pcb_tool_select_by_name(&PCB->hidlib, "arrow"); + rnd_tool_select_by_name(&PCB->hidlib, "arrow"); rnd_event(&PCB->hidlib, PCB_EVENT_LIBRARY_CHANGED, NULL); rnd_mainloop_interactive(&ga, &PCB->hidlib); Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 31018) +++ trunk/src/plug_io.c (revision 31019) @@ -606,7 +606,7 @@ #endif conf_core.temp.rat_warn = rnd_true; /* make sure the first click can remove warnings */ - pcb_tool_select_by_name(&PCB->hidlib, "arrow"); + rnd_tool_select_by_name(&PCB->hidlib, "arrow"); return 0; } Index: trunk/src/remove_act.c =================================================================== --- trunk/src/remove_act.c (revision 31018) +++ trunk/src/remove_act.c (revision 31019) @@ -74,10 +74,10 @@ else { /* interactive remove */ rnd_hidlib_t *hidlib = RND_ACT_HIDLIB; rnd_hid_get_coords("Click on object to delete", &hidlib->tool_x, &hidlib->tool_y, 0); - pcb_tool_save(RND_ACT_HIDLIB); - pcb_tool_select_by_name(RND_ACT_HIDLIB, "remove"); - pcb_tool_do_press(RND_ACT_HIDLIB); - pcb_tool_restore(RND_ACT_HIDLIB); + rnd_tool_save(RND_ACT_HIDLIB); + rnd_tool_select_by_name(RND_ACT_HIDLIB, "remove"); + rnd_tool_do_press(RND_ACT_HIDLIB); + rnd_tool_restore(RND_ACT_HIDLIB); } break; case F_Selected: Index: trunk/src/tool_logic.c =================================================================== --- trunk/src/tool_logic.c (revision 31018) +++ trunk/src/tool_logic.c (revision 31019) @@ -54,7 +54,7 @@ int *ok = argv[1].d.p; int id = argv[2].d.i; pcb_board_t *pcb = (pcb_board_t *)hidlib; - if (pcb->RatDraw && !(pcb_tool_get(id)->user_flags & PCB_TLF_RAT)) { + if (pcb->RatDraw && !(rnd_tool_get(id)->user_flags & PCB_TLF_RAT)) { rnd_message(RND_MSG_WARNING, "That tool can not be used on the rat layer!\n"); *ok = 0; } @@ -62,7 +62,7 @@ static void tool_logic_chg_mode(rnd_conf_native_t *cfg, int arr_idx) { - pcb_tool_chg_mode(&PCB->hidlib); + rnd_tool_chg_mode(&PCB->hidlib); } @@ -97,8 +97,8 @@ static void tool_logic_chg_layer(rnd_hidlib_t *hidlib, void *user_data, int argc, rnd_event_arg_t argv[]) { static int was_rat; - if (PCB->RatDraw && !was_rat && !(pcb_tool_get(rnd_conf.editor.mode)->user_flags & PCB_TLF_RAT)) - pcb_tool_select_by_name(&PCB->hidlib, "line"); + if (PCB->RatDraw && !was_rat && !(rnd_tool_get(rnd_conf.editor.mode)->user_flags & PCB_TLF_RAT)) + rnd_tool_select_by_name(&PCB->hidlib, "line"); was_rat = PCB->RatDraw; } Index: trunk/src/undo_act.c =================================================================== --- trunk/src/undo_act.c (revision 31018) +++ trunk/src/undo_act.c (revision 31019) @@ -104,7 +104,7 @@ rnd_PCB_ACT_MAY_CONVARG(1, FGW_STR, Undo, function = argv[1].val.str); if (!function || !*function) { rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, rnd_false); - if (pcb_tool_undo_act(RND_ACT_HIDLIB)) + if (rnd_tool_undo_act(RND_ACT_HIDLIB)) if (pcb_undo(rnd_true) == 0) pcb_board_set_changed_flag(rnd_true); } @@ -135,7 +135,7 @@ fgw_error_t pcb_act_Redo(fgw_arg_t *res, int argc, fgw_arg_t *argv) { rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, rnd_false); - if (pcb_tool_redo_act(RND_ACT_HIDLIB)) + if (rnd_tool_redo_act(RND_ACT_HIDLIB)) if (pcb_redo(rnd_true)) pcb_board_set_changed_flag(rnd_true); rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, rnd_true); Index: trunk/src_plugins/ddraft/cli.c =================================================================== --- trunk/src_plugins/ddraft/cli.c (revision 31018) +++ trunk/src_plugins/ddraft/cli.c (revision 31019) @@ -505,7 +505,7 @@ if (argc == 1) { rnd_cli_enter("ddraft", "ddraft"); - pcb_tool_select_by_id(&PCB->hidlib, pcb_ddraft_tool); + rnd_tool_select_by_id(&PCB->hidlib, pcb_ddraft_tool); RND_ACT_IRES(0); return 0; } Index: trunk/src_plugins/ddraft/cli_line.c =================================================================== --- trunk/src_plugins/ddraft/cli_line.c (revision 31018) +++ trunk/src_plugins/ddraft/cli_line.c (revision 31019) @@ -62,8 +62,8 @@ pcb_ddraft_attached_reset(); - if (pcb_tool_next_id != pcb_ddraft_tool) - pcb_tool_select_by_id(&PCB->hidlib, pcb_ddraft_tool); + if (rnd_tool_next_id != pcb_ddraft_tool) + rnd_tool_select_by_id(&PCB->hidlib, pcb_ddraft_tool); rnd_trace("line e: '%s':%d\n", line, cursor); memset(&box, 0, sizeof(box)); Index: trunk/src_plugins/ddraft/ddraft.c =================================================================== --- trunk/src_plugins/ddraft/ddraft.c (revision 31018) +++ trunk/src_plugins/ddraft/ddraft.c (revision 31019) @@ -503,7 +503,7 @@ static pcb_tool_t tool_ddraft = { "ddraft", "2 dimensional drafting", - NULL, 1000, ddraft_xpm, PCB_TOOL_CURSOR_NAMED(NULL), 1, + NULL, 1000, ddraft_xpm, RND_TOOL_CURSOR_NAMED(NULL), 1, NULL, NULL, NULL, @@ -541,7 +541,7 @@ rnd_conf_hid_unreg(ddraft_cookie); rnd_event_unbind_allcookie(ddraft_cookie); rnd_remove_actions_by_cookie(ddraft_cookie); - pcb_tool_unreg_by_cookie(ddraft_cookie); + rnd_tool_unreg_by_cookie(ddraft_cookie); } static const rnd_conf_hid_callbacks_t conf_cbs_adl = { NULL, cons_gui_confchg, NULL, NULL }; @@ -557,7 +557,7 @@ RND_REGISTER_ACTIONS(ddraft_action_list, ddraft_cookie) rnd_event_bind(PCB_EVENT_DRAW_CROSSHAIR_CHATT, cnst_enforce, NULL, ddraft_cookie); - pcb_ddraft_tool = pcb_tool_reg(&tool_ddraft, ddraft_cookie); + pcb_ddraft_tool = rnd_tool_reg(&tool_ddraft, ddraft_cookie); confid = rnd_conf_hid_reg(ddraft_cookie, NULL); cn = rnd_conf_get_field("editor/all_direction_lines"); Index: trunk/src_plugins/dialogs/dlg_library.c =================================================================== --- trunk/src_plugins/dialogs/dlg_library.c (revision 31018) +++ trunk/src_plugins/dialogs/dlg_library.c (revision 31019) @@ -183,7 +183,7 @@ static void timed_update_preview_(library_ctx_t *ctx, const char *otext) { if (pcb_buffer_load_footprint(PCB_PASTEBUFFER, otext, NULL)) { - pcb_tool_select_by_name(&PCB->hidlib, "buffer"); + rnd_tool_select_by_name(&PCB->hidlib, "buffer"); if (pcb_subclist_length(&PCB_PASTEBUFFER->Data->subc) != 0) library_update_preview(ctx, pcb_subclist_first(&PCB_PASTEBUFFER->Data->subc), NULL); rnd_gui->invalidate_all(rnd_gui); @@ -357,7 +357,7 @@ } else { if (pcb_buffer_load_footprint(PCB_PASTEBUFFER, l->data.fp.loc_info, NULL)) { - pcb_tool_select_by_name(&PCB->hidlib, "buffer"); + rnd_tool_select_by_name(&PCB->hidlib, "buffer"); if (pcb_subclist_length(&PCB_PASTEBUFFER->Data->subc) != 0) library_update_preview(ctx, pcb_subclist_first(&PCB_PASTEBUFFER->Data->subc), l); update_edit_button(ctx); Index: trunk/src_plugins/hid_lesstif/library.c =================================================================== --- trunk/src_plugins/hid_lesstif/library.c (revision 31018) +++ trunk/src_plugins/hid_lesstif/library.c (revision 31019) @@ -69,7 +69,7 @@ pcb_fplibrary_t *e = picks.array[last_pick]; e = &e->data.dir.children.array[cbs->item_position - 1]; if (pcb_buffer_load_footprint(PCB_PASTEBUFFER, e->data.fp.loc_info, NULL)) - pcb_tool_select_by_name(&PCB->hidlib, "buffer"); + rnd_tool_select_by_name(&PCB->hidlib, "buffer"); } static int build_library_dialog() Index: trunk/src_plugins/lib_hid_common/toolbar.c =================================================================== --- trunk/src_plugins/lib_hid_common/toolbar.c (revision 31018) +++ trunk/src_plugins/lib_hid_common/toolbar.c (revision 31019) @@ -51,7 +51,7 @@ static void toolbar_pcb2dlg() { - pcb_toolid_t tid; + rnd_toolid_t tid; if (!toolbar.sub_inited) return; @@ -76,10 +76,10 @@ return; tid = (ptrdiff_t)attr->user_data; - pcb_tool_select_by_id(rnd_gui->get_dad_hidlib(hid_ctx), tid); + rnd_tool_select_by_id(rnd_gui->get_dad_hidlib(hid_ctx), tid); } -static void toolbar_create_tool(pcb_toolid_t tid, pcb_tool_t *tool, const char *menufile_help) +static void toolbar_create_tool(rnd_toolid_t tid, pcb_tool_t *tool, const char *menufile_help) { int wid; const char *help = tool->help; @@ -106,7 +106,7 @@ if ((ts != NULL) && (ts->type == LHT_LIST)) { for(t = ts->data.list.first; t != NULL; t = t->next) { - pcb_toolid_t tid = pcb_tool_lookup(t->name); + rnd_toolid_t tid = rnd_tool_lookup(t->name); pcb_tool_t **tool; const char *mf_help; lht_node_t *nhelp; @@ -113,7 +113,7 @@ lht_err_t err; - tool = (pcb_tool_t **)vtp0_get(&pcb_tools, tid, 0); + tool = (pcb_tool_t **)vtp0_get(&rnd_tools, tid, 0); if ((tid < 0) || (tool == NULL)) { rnd_message(RND_MSG_ERROR, "toolbar: tool '%s' not found (referenced from the menu file %s:%d)\n", t->name, t->file_name, t->line); continue; @@ -136,8 +136,8 @@ static void toolbar_create_dyn_all(void) { pcb_tool_t **t; - pcb_toolid_t tid; - for(tid = 0, t = (pcb_tool_t **)pcb_tools.array; tid < pcb_tools.used; tid++,t++) { + rnd_toolid_t tid; + for(tid = 0, t = (pcb_tool_t **)rnd_tools.array; tid < rnd_tools.used; tid++,t++) { int *wid = vti0_get(&toolbar.tid2wid, tid, 0); if (((*t)->flags & PCB_TLF_AUTO_TOOLBAR) == 0) continue; /* static or inivisible */ @@ -189,7 +189,7 @@ { if ((toolbar.sub_inited) && (argv[1].type == RND_EVARG_PTR)) { pcb_tool_t *tool = argv[1].d.p; - pcb_toolid_t tid = pcb_tool_lookup(tool->name); + rnd_toolid_t tid = rnd_tool_lookup(tool->name); if ((tool->flags & PCB_TLF_AUTO_TOOLBAR) != 0) { int *wid = vti0_get(&toolbar.tid2wid, tid, 0); if ((wid != NULL) && (*wid != 0)) Index: trunk/src_plugins/serpentine/serpentine.c =================================================================== --- trunk/src_plugins/serpentine/serpentine.c (revision 31018) +++ trunk/src_plugins/serpentine/serpentine.c (revision 31019) @@ -408,7 +408,7 @@ static pcb_tool_t tool_serpentine = { "serpentine", "experimental", - NULL, 100, NULL, PCB_TOOL_CURSOR_NAMED(NULL), 0, + NULL, 100, NULL, RND_TOOL_CURSOR_NAMED(NULL), 0, tool_serpentine_init, tool_serpentine_uninit, tool_serpentine_notify_mode, @@ -430,7 +430,7 @@ static const char pcb_acth_serpentine[] = "Tool for drawing serpentines"; fgw_error_t pcb_act_serpentine(fgw_arg_t *res, int argc, fgw_arg_t *argv) { - pcb_tool_select_by_name(&PCB->hidlib, "serpentine"); + rnd_tool_select_by_name(&PCB->hidlib, "serpentine"); RND_ACT_IRES(0); return 0; } @@ -445,7 +445,7 @@ void pplg_uninit_serpentine(void) { rnd_remove_actions_by_cookie(serpentine_cookie); - pcb_tool_unreg_by_cookie(serpentine_cookie); + rnd_tool_unreg_by_cookie(serpentine_cookie); rnd_conf_unreg_fields("plugins/serpentine/"); } @@ -457,7 +457,7 @@ rnd_conf_reg_field(conf_serpentine, field,isarray,type_name,cpath,cname,desc,flags); #include "serpentine_conf_fields.h" - pcb_tool_reg(&tool_serpentine, serpentine_cookie); + rnd_tool_reg(&tool_serpentine, serpentine_cookie); return 0; } Index: trunk/src_plugins/shand_cmd/command.c =================================================================== --- trunk/src_plugins/shand_cmd/command.c (revision 31018) +++ trunk/src_plugins/shand_cmd/command.c (revision 31019) @@ -94,7 +94,7 @@ RND_PCB_ACT_CONVARG(1, FGW_STR, LoadElementToBuffer, filename = argv[1].val.str); if (pcb_buffer_load_footprint(PCB_PASTEBUFFER, filename, NULL)) - pcb_tool_select_by_name(&PCB->hidlib, "buffer"); + rnd_tool_select_by_name(&PCB->hidlib, "buffer"); RND_ACT_IRES(0); return 0; @@ -111,7 +111,7 @@ rnd_PCB_ACT_MAY_CONVARG(2, FGW_STR, LoadLayoutToBuffer, format = argv[2].val.str); if (pcb_buffer_load_layout(PCB, PCB_PASTEBUFFER, filename, format)) - pcb_tool_select_by_name(&PCB->hidlib, "buffer"); + rnd_tool_select_by_name(&PCB->hidlib, "buffer"); RND_ACT_IRES(0); return 0; Index: trunk/src_plugins/shape/shape.c =================================================================== --- trunk/src_plugins/shape/shape.c (revision 31018) +++ trunk/src_plugins/shape/shape.c (revision 31019) @@ -255,7 +255,7 @@ pcb_r_delete_entry(PCB_CURRLAYER(PCB)->polygon_tree, (rnd_rnd_box_t *)p); pcb_poly_free_fields(p); pcb_poly_free(p); - pcb_tool_select_by_name(&PCB->hidlib, "buffer"); + rnd_tool_select_by_name(&PCB->hidlib, "buffer"); } return p; } @@ -303,7 +303,7 @@ pcb_copy_obj_to_buffer(PCB, data, PCB->Data, PCB_OBJ_LINE, PCB_CURRLAYER(PCB), l, l); pcb_r_delete_entry(PCB_CURRLAYER(PCB)->line_tree, (rnd_rnd_box_t *)l); pcb_line_free(l); - pcb_tool_select_by_name(&PCB->hidlib, "buffer"); + rnd_tool_select_by_name(&PCB->hidlib, "buffer"); } } return l; Index: trunk/src_plugins/sketch_route/sketch_route.c =================================================================== --- trunk/src_plugins/sketch_route/sketch_route.c (revision 31018) +++ trunk/src_plugins/sketch_route/sketch_route.c (revision 31019) @@ -1124,7 +1124,7 @@ static pcb_tool_t tool_skline = { "skline", "convert a free-hand sketch of a route to traces", - NULL, 100, skroute_xpm, PCB_TOOL_CURSOR_NAMED(NULL), PCB_TLF_AUTO_TOOLBAR, + NULL, 100, skroute_xpm, RND_TOOL_CURSOR_NAMED(NULL), PCB_TLF_AUTO_TOOLBAR, tool_skline_init, tool_skline_uninit, tool_skline_notify_mode, @@ -1155,7 +1155,7 @@ static const char pcb_acth_skline[] = "Tool for drawing sketch lines"; fgw_error_t pcb_act_skline(fgw_arg_t *res, int argc, fgw_arg_t *argv) { - pcb_tool_select_by_name(&PCB->hidlib, "skline"); + rnd_tool_select_by_name(&PCB->hidlib, "skline"); RND_ACT_IRES(0); return 0; @@ -1181,7 +1181,7 @@ void pplg_uninit_sketch_route(void) { rnd_remove_actions_by_cookie(pcb_sketch_route_cookie); - pcb_tool_unreg_by_cookie(pcb_sketch_route_cookie); /* should be done before pcb_tool_uninit, somehow */ + rnd_tool_unreg_by_cookie(pcb_sketch_route_cookie); /* should be done before pcb_tool_uninit, somehow */ sketches_uninit(); } @@ -1190,7 +1190,7 @@ RND_API_CHK_VER; RND_REGISTER_ACTIONS(sketch_route_action_list, pcb_sketch_route_cookie) - pcb_tool_reg(&tool_skline, pcb_sketch_route_cookie); + rnd_tool_reg(&tool_skline, pcb_sketch_route_cookie); return 0; } Index: trunk/src_plugins/tool_std/tool_arc.c =================================================================== --- trunk/src_plugins/tool_std/tool_arc.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_arc.c (revision 31019) @@ -52,12 +52,12 @@ void pcb_tool_arc_init(void) { rnd_hid_notify_crosshair_change(&PCB->hidlib, rnd_false); - if (pcb_tool_prev_id == pcb_crosshair.tool_line && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST) { + if (rnd_tool_prev_id == pcb_crosshair.tool_line && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST) { pcb_crosshair.AttachedLine.State = PCB_CH_STATE_FIRST; pcb_crosshair.AttachedBox.State = PCB_CH_STATE_SECOND; pcb_crosshair.AttachedBox.Point1.X = pcb_crosshair.AttachedBox.Point2.X = pcb_crosshair.AttachedLine.Point1.X; pcb_crosshair.AttachedBox.Point1.Y = pcb_crosshair.AttachedBox.Point2.Y = pcb_crosshair.AttachedLine.Point1.Y; - pcb_tool_adjust_attached(NULL); + rnd_tool_adjust_attached(NULL); } rnd_hid_notify_crosshair_change(&PCB->hidlib, rnd_true); } @@ -66,7 +66,7 @@ { rnd_hid_notify_crosshair_change(&PCB->hidlib, rnd_false); pcb_added_lines = 0; - if (pcb_tool_next_id != pcb_crosshair.tool_line) { + if (rnd_tool_next_id != pcb_crosshair.tool_line) { pcb_crosshair.AttachedBox.State = PCB_CH_STATE_FIRST; if (!pcb_marked.user_placed) pcb_crosshair_set_local_ref(0, 0, rnd_false); @@ -186,7 +186,7 @@ pcb_arc_get_end((pcb_arc_t *) ptr2, 0, &pcb_crosshair.AttachedBox.Point2.X, &pcb_crosshair.AttachedBox.Point2.Y); pcb_crosshair.AttachedBox.Point1.X = pcb_crosshair.AttachedBox.Point2.X; pcb_crosshair.AttachedBox.Point1.Y = pcb_crosshair.AttachedBox.Point2.Y; - pcb_tool_adjust_attached(hl); + rnd_tool_adjust_attached(hl); if (--pcb_added_lines == 0) pcb_crosshair.AttachedBox.State = PCB_CH_STATE_SECOND; } @@ -196,9 +196,9 @@ void pcb_tool_arc_escape(rnd_hidlib_t *hl) { if (pcb_crosshair.AttachedLine.State == PCB_CH_STATE_FIRST) - pcb_tool_select_by_name(hl, "arrow"); + rnd_tool_select_by_name(hl, "arrow"); else - pcb_tool_select_by_name(hl, "arc"); + rnd_tool_select_by_name(hl, "arc"); } /* XPM */ @@ -233,7 +233,7 @@ }; pcb_tool_t pcb_tool_arc = { - "arc", NULL, NULL, 100, arc_icon, PCB_TOOL_CURSOR_NAMED("question_arrow"), 0, + "arc", NULL, NULL, 100, arc_icon, RND_TOOL_CURSOR_NAMED("question_arrow"), 0, pcb_tool_arc_init, pcb_tool_arc_uninit, pcb_tool_arc_notify_mode, Index: trunk/src_plugins/tool_std/tool_arrow.c =================================================================== --- trunk/src_plugins/tool_std/tool_arrow.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_arrow.c (revision 31019) @@ -78,17 +78,17 @@ pcb_buffer_add_selected(pcb, PCB_PASTEBUFFER, hl->tool_x, hl->tool_y, rnd_true, rnd_true); pcb_undo_save_serial(); pcb_remove_selected(rnd_false); - pcb_tool_save(hl); - pcb_tool_is_saved = rnd_true; - pcb_tool_select_by_name(hl, "buffer"); + rnd_tool_save(hl); + rnd_tool_is_saved = rnd_true; + rnd_tool_select_by_name(hl, "buffer"); } else if (hl->tool_hit && !rnd_gui->shift_is_pressed(rnd_gui)) { rnd_rnd_box_t box; hl->tool_grabbed.status = rnd_true; - pcb_tool_save(hl); - pcb_tool_is_saved = rnd_true; - pcb_tool_select_by_name(hl, rnd_gui->control_is_pressed(rnd_gui)? "copy" : "move"); + rnd_tool_save(hl); + rnd_tool_is_saved = rnd_true; + rnd_tool_select_by_name(hl, rnd_gui->control_is_pressed(rnd_gui)? "copy" : "move"); pcb_crosshair.AttachedObject.Ptr1 = pcb_crosshair_note.ptr1; pcb_crosshair.AttachedObject.Ptr2 = pcb_crosshair_note.ptr2; pcb_crosshair.AttachedObject.Ptr3 = pcb_crosshair_note.ptr3; @@ -269,7 +269,7 @@ }; pcb_tool_t pcb_tool_arrow = { - "arrow", NULL, NULL, 10, arrow_icon, PCB_TOOL_CURSOR_NAMED("left_ptr"), 0, + "arrow", NULL, NULL, 10, arrow_icon, RND_TOOL_CURSOR_NAMED("left_ptr"), 0, NULL, pcb_tool_arrow_uninit, pcb_tool_arrow_notify_mode, Index: trunk/src_plugins/tool_std/tool_buffer.c =================================================================== --- trunk/src_plugins/tool_std/tool_buffer.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_buffer.c (revision 31019) @@ -130,7 +130,7 @@ }; pcb_tool_t pcb_tool_buffer = { - "buffer", NULL, NULL, 100, buf_icon, PCB_TOOL_CURSOR_NAMED("hand"), 0, + "buffer", NULL, NULL, 100, buf_icon, RND_TOOL_CURSOR_NAMED("hand"), 0, pcb_tool_buffer_init, pcb_tool_buffer_uninit, pcb_tool_buffer_notify_mode, Index: trunk/src_plugins/tool_std/tool_copy.c =================================================================== --- trunk/src_plugins/tool_std/tool_copy.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_copy.c (revision 31019) @@ -120,7 +120,7 @@ } pcb_tool_t pcb_tool_copy = { - "copy", NULL, NULL, 100, NULL, PCB_TOOL_CURSOR_NAMED("crosshair"), 0, + "copy", NULL, NULL, 100, NULL, RND_TOOL_CURSOR_NAMED("crosshair"), 0, NULL, pcb_tool_copy_uninit, pcb_tool_copy_notify_mode, Index: trunk/src_plugins/tool_std/tool_insert.c =================================================================== --- trunk/src_plugins/tool_std/tool_insert.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_insert.c (revision 31019) @@ -186,7 +186,7 @@ }; pcb_tool_t pcb_tool_insert = { - "insert", NULL, NULL, 100, ins_icon, PCB_TOOL_CURSOR_NAMED("dotbox"), 0, + "insert", NULL, NULL, 100, ins_icon, RND_TOOL_CURSOR_NAMED("dotbox"), 0, NULL, pcb_tool_insert_uninit, pcb_tool_insert_notify_mode, Index: trunk/src_plugins/tool_std/tool_line.c =================================================================== --- trunk/src_plugins/tool_std/tool_line.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_line.c (revision 31019) @@ -65,12 +65,12 @@ void pcb_tool_line_init(void) { rnd_hid_notify_crosshair_change(&PCB->hidlib, rnd_false); - if (pcb_tool_prev_id == pcb_crosshair.tool_arc && pcb_crosshair.AttachedBox.State != PCB_CH_STATE_FIRST) { + if (rnd_tool_prev_id == pcb_crosshair.tool_arc && pcb_crosshair.AttachedBox.State != PCB_CH_STATE_FIRST) { pcb_crosshair.AttachedBox.State = PCB_CH_STATE_FIRST; pcb_crosshair.AttachedLine.State = PCB_CH_STATE_SECOND; pcb_crosshair.AttachedLine.Point1.X = pcb_crosshair.AttachedLine.Point2.X = pcb_crosshair.AttachedBox.Point1.X; pcb_crosshair.AttachedLine.Point1.Y = pcb_crosshair.AttachedLine.Point2.Y = pcb_crosshair.AttachedBox.Point1.Y; - pcb_tool_adjust_attached(NULL); + rnd_tool_adjust_attached(NULL); } else { if (conf_core.editor.auto_drc) { @@ -88,7 +88,7 @@ rnd_hid_notify_crosshair_change(&PCB->hidlib, rnd_false); pcb_added_lines = 0; pcb_route_reset(&pcb_crosshair.Route); - if (pcb_tool_next_id != pcb_crosshair.tool_arc) { + if (rnd_tool_next_id != pcb_crosshair.tool_arc) { pcb_crosshair.AttachedLine.State = PCB_CH_STATE_FIRST; if (!pcb_marked.user_placed) pcb_crosshair_set_local_ref(0, 0, rnd_false); @@ -158,7 +158,7 @@ * the file after saving. */ if (pcb_crosshair.X == pcb_crosshair.AttachedLine.Point1.X && pcb_crosshair.Y == pcb_crosshair.AttachedLine.Point1.Y) { - pcb_tool_select_by_name(hl, "line"); + rnd_tool_select_by_name(hl, "line"); return; } @@ -441,7 +441,7 @@ pcb_crosshair.AttachedLine.Point1.Y = pcb_crosshair.AttachedLine.Point2.Y = ptr2->Point2.Y; } pcb_crosshair_grid_fit(pcb_crosshair.X, pcb_crosshair.Y); - pcb_tool_adjust_attached(hl); + rnd_tool_adjust_attached(hl); if (--pcb_added_lines == 0) { pcb_crosshair.AttachedLine.State = PCB_CH_STATE_SECOND; last_layer = PCB_CURRLAYER(pcb); @@ -478,9 +478,9 @@ void pcb_tool_line_escape(rnd_hidlib_t *hl) { if (pcb_crosshair.AttachedLine.State == PCB_CH_STATE_FIRST) - pcb_tool_select_by_name(hl, "arrow"); + rnd_tool_select_by_name(hl, "arrow"); else - pcb_tool_select_by_name(hl, "line"); + rnd_tool_select_by_name(hl, "line"); } /* XPM */ @@ -517,7 +517,7 @@ pcb_tool_t pcb_tool_line = { - "line", NULL, NULL, 100, line_icon, PCB_TOOL_CURSOR_NAMED("pencil"), 0, + "line", NULL, NULL, 100, line_icon, RND_TOOL_CURSOR_NAMED("pencil"), 0, pcb_tool_line_init, pcb_tool_line_uninit, pcb_tool_line_notify_mode, Index: trunk/src_plugins/tool_std/tool_lock.c =================================================================== --- trunk/src_plugins/tool_std/tool_lock.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_lock.c (revision 31019) @@ -120,7 +120,7 @@ 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f}; pcb_tool_t pcb_tool_lock = { - "lock", NULL, NULL, 100, lock_icon, PCB_TOOL_CURSOR_XBM(lockIcon_bits, lockMask_bits), 0, + "lock", NULL, NULL, 100, lock_icon, RND_TOOL_CURSOR_XBM(lockIcon_bits, lockMask_bits), 0, NULL, NULL, pcb_tool_lock_notify_mode, Index: trunk/src_plugins/tool_std/tool_move.c =================================================================== --- trunk/src_plugins/tool_std/tool_move.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_move.c (revision 31019) @@ -129,7 +129,7 @@ } pcb_tool_t pcb_tool_move = { - "move", NULL, NULL, 100, NULL, PCB_TOOL_CURSOR_NAMED("crosshair"), 0, + "move", NULL, NULL, 100, NULL, RND_TOOL_CURSOR_NAMED("crosshair"), 0, NULL, pcb_tool_move_uninit, pcb_tool_move_notify_mode, Index: trunk/src_plugins/tool_std/tool_poly.c =================================================================== --- trunk/src_plugins/tool_std/tool_poly.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_poly.c (revision 31019) @@ -153,9 +153,9 @@ void pcb_tool_poly_escape(rnd_hidlib_t *hl) { if (pcb_crosshair.AttachedLine.State == PCB_CH_STATE_FIRST) - pcb_tool_select_by_name(hl, "arrow"); + rnd_tool_select_by_name(hl, "arrow"); else - pcb_tool_select_by_name(hl, "poly"); + rnd_tool_select_by_name(hl, "poly"); } /* XPM */ @@ -190,7 +190,7 @@ }; pcb_tool_t pcb_tool_poly = { - "poly", NULL, NULL, 100, poly_icon, PCB_TOOL_CURSOR_NAMED("up_arrow"), 0, + "poly", NULL, NULL, 100, poly_icon, RND_TOOL_CURSOR_NAMED("up_arrow"), 0, NULL, pcb_tool_poly_uninit, pcb_tool_poly_notify_mode, Index: trunk/src_plugins/tool_std/tool_polyhole.c =================================================================== --- trunk/src_plugins/tool_std/tool_polyhole.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_polyhole.c (revision 31019) @@ -183,9 +183,9 @@ void pcb_tool_polyhole_escape(rnd_hidlib_t *hl) { if (pcb_crosshair.AttachedLine.State == PCB_CH_STATE_FIRST) - pcb_tool_select_by_name(hl, "arrow"); + rnd_tool_select_by_name(hl, "arrow"); else - pcb_tool_select_by_name(hl, "polyhole"); + rnd_tool_select_by_name(hl, "polyhole"); } /* XPM */ @@ -219,7 +219,7 @@ pcb_tool_t pcb_tool_polyhole = { - "polyhole", NULL, NULL, 100, polyhole_icon, PCB_TOOL_CURSOR_NAMED("up_arrow"), 0, + "polyhole", NULL, NULL, 100, polyhole_icon, RND_TOOL_CURSOR_NAMED("up_arrow"), 0, NULL, pcb_tool_polyhole_uninit, pcb_tool_polyhole_notify_mode, Index: trunk/src_plugins/tool_std/tool_rectangle.c =================================================================== --- trunk/src_plugins/tool_std/tool_rectangle.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_rectangle.c (revision 31019) @@ -118,9 +118,9 @@ void pcb_tool_rectangle_escape(rnd_hidlib_t *hl) { if (pcb_crosshair.AttachedLine.State == PCB_CH_STATE_FIRST) - pcb_tool_select_by_name(hl, "arrow"); + rnd_tool_select_by_name(hl, "arrow"); else - pcb_tool_select_by_name(hl, "rectangle"); + rnd_tool_select_by_name(hl, "rectangle"); } /* XPM */ @@ -156,7 +156,7 @@ pcb_tool_t pcb_tool_rectangle = { - "rectangle", NULL, NULL, 100, rect_icon, PCB_TOOL_CURSOR_NAMED("ul_angle"), 0, + "rectangle", NULL, NULL, 100, rect_icon, RND_TOOL_CURSOR_NAMED("ul_angle"), 0, NULL, pcb_tool_rectangle_uninit, pcb_tool_rectangle_notify_mode, Index: trunk/src_plugins/tool_std/tool_remove.c =================================================================== --- trunk/src_plugins/tool_std/tool_remove.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_remove.c (revision 31019) @@ -117,7 +117,7 @@ }; pcb_tool_t pcb_tool_remove = { - "remove", NULL, NULL, 100, del_icon, PCB_TOOL_CURSOR_NAMED("pirate"), 0, + "remove", NULL, NULL, 100, del_icon, RND_TOOL_CURSOR_NAMED("pirate"), 0, NULL, NULL, pcb_tool_remove_notify_mode, Index: trunk/src_plugins/tool_std/tool_rotate.c =================================================================== --- trunk/src_plugins/tool_std/tool_rotate.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_rotate.c (revision 31019) @@ -96,7 +96,7 @@ 0x1f, 0x60, 0x3b, 0x30, 0xe1, 0x3f, 0xc0, 0x0f}; pcb_tool_t pcb_tool_rotate = { - "rotate", NULL, NULL, 100, rot_icon, PCB_TOOL_CURSOR_XBM(rotateIcon_bits, rotateMask_bits), 0, + "rotate", NULL, NULL, 100, rot_icon, RND_TOOL_CURSOR_XBM(rotateIcon_bits, rotateMask_bits), 0, NULL, NULL, pcb_tool_rotate_notify_mode, Index: trunk/src_plugins/tool_std/tool_std.c =================================================================== --- trunk/src_plugins/tool_std/tool_std.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_std.c (revision 31019) @@ -54,7 +54,7 @@ void pplg_uninit_tool_std(void) { - pcb_tool_unreg_by_cookie(pcb_tool_std_cookie); + rnd_tool_unreg_by_cookie(pcb_tool_std_cookie); } int pplg_init_tool_std(void) @@ -61,22 +61,22 @@ { RND_API_CHK_VER; - pcb_crosshair.tool_arc = pcb_tool_reg(&pcb_tool_arc, pcb_tool_std_cookie); - pcb_crosshair.tool_arrow = pcb_tool_reg(&pcb_tool_arrow, pcb_tool_std_cookie); - pcb_tool_reg(&pcb_tool_buffer, pcb_tool_std_cookie); - pcb_tool_reg(&pcb_tool_copy, pcb_tool_std_cookie); - pcb_tool_reg(&pcb_tool_insert, pcb_tool_std_cookie); - pcb_crosshair.tool_line = pcb_tool_reg(&pcb_tool_line, pcb_tool_std_cookie); - pcb_tool_reg(&pcb_tool_lock, pcb_tool_std_cookie); - pcb_crosshair.tool_move = pcb_tool_reg(&pcb_tool_move, pcb_tool_std_cookie); - pcb_crosshair.tool_poly = pcb_tool_reg(&pcb_tool_poly, pcb_tool_std_cookie); - pcb_crosshair.tool_poly_hole = pcb_tool_reg(&pcb_tool_polyhole, pcb_tool_std_cookie); - pcb_tool_reg(&pcb_tool_rectangle, pcb_tool_std_cookie); - pcb_tool_reg(&pcb_tool_remove, pcb_tool_std_cookie); - pcb_tool_reg(&pcb_tool_rotate, pcb_tool_std_cookie); - pcb_tool_reg(&pcb_tool_text, pcb_tool_std_cookie); - pcb_tool_reg(&pcb_tool_thermal, pcb_tool_std_cookie); - pcb_tool_reg(&pcb_tool_via, pcb_tool_std_cookie); + pcb_crosshair.tool_arc = rnd_tool_reg(&pcb_tool_arc, pcb_tool_std_cookie); + pcb_crosshair.tool_arrow = rnd_tool_reg(&pcb_tool_arrow, pcb_tool_std_cookie); + rnd_tool_reg(&pcb_tool_buffer, pcb_tool_std_cookie); + rnd_tool_reg(&pcb_tool_copy, pcb_tool_std_cookie); + rnd_tool_reg(&pcb_tool_insert, pcb_tool_std_cookie); + pcb_crosshair.tool_line = rnd_tool_reg(&pcb_tool_line, pcb_tool_std_cookie); + rnd_tool_reg(&pcb_tool_lock, pcb_tool_std_cookie); + pcb_crosshair.tool_move = rnd_tool_reg(&pcb_tool_move, pcb_tool_std_cookie); + pcb_crosshair.tool_poly = rnd_tool_reg(&pcb_tool_poly, pcb_tool_std_cookie); + pcb_crosshair.tool_poly_hole = rnd_tool_reg(&pcb_tool_polyhole, pcb_tool_std_cookie); + rnd_tool_reg(&pcb_tool_rectangle, pcb_tool_std_cookie); + rnd_tool_reg(&pcb_tool_remove, pcb_tool_std_cookie); + rnd_tool_reg(&pcb_tool_rotate, pcb_tool_std_cookie); + rnd_tool_reg(&pcb_tool_text, pcb_tool_std_cookie); + rnd_tool_reg(&pcb_tool_thermal, pcb_tool_std_cookie); + rnd_tool_reg(&pcb_tool_via, pcb_tool_std_cookie); return 0; } Index: trunk/src_plugins/tool_std/tool_text.c =================================================================== --- trunk/src_plugins/tool_std/tool_text.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_text.c (revision 31019) @@ -125,7 +125,7 @@ }; pcb_tool_t pcb_tool_text = { - "text", NULL, NULL, 100, text_icon, PCB_TOOL_CURSOR_NAMED("xterm"), 0, + "text", NULL, NULL, 100, text_icon, RND_TOOL_CURSOR_NAMED("xterm"), 0, NULL, NULL, pcb_tool_text_notify_mode, Index: trunk/src_plugins/tool_std/tool_thermal.c =================================================================== --- trunk/src_plugins/tool_std/tool_thermal.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_thermal.c (revision 31019) @@ -133,7 +133,7 @@ }; pcb_tool_t pcb_tool_thermal = { - "thermal", NULL, NULL, 100, thrm_icon, PCB_TOOL_CURSOR_NAMED("iron_cross"), 0, + "thermal", NULL, NULL, 100, thrm_icon, RND_TOOL_CURSOR_NAMED("iron_cross"), 0, NULL, NULL, pcb_tool_thermal_notify_mode, Index: trunk/src_plugins/tool_std/tool_via.c =================================================================== --- trunk/src_plugins/tool_std/tool_via.c (revision 31018) +++ trunk/src_plugins/tool_std/tool_via.c (revision 31019) @@ -136,7 +136,7 @@ }; pcb_tool_t pcb_tool_via = { - "via", NULL, NULL, 100, via_icon, PCB_TOOL_CURSOR_NAMED(NULL), 0, + "via", NULL, NULL, 100, via_icon, RND_TOOL_CURSOR_NAMED(NULL), 0, NULL, NULL, pcb_tool_via_notify_mode,