Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 25207) +++ trunk/src/file_act.c (revision 25208) @@ -75,7 +75,7 @@ case F_Footprint: pcb_notify_crosshair_change(pcb_false); if (pcb_buffer_load_footprint(PCB_PASTEBUFFER, name, format)) - pcb_tool_select_by_id(PCB_MODE_PASTE_BUFFER); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_PASTE_BUFFER); pcb_notify_crosshair_change(pcb_true); break; @@ -82,7 +82,7 @@ case F_LayoutToBuffer: pcb_notify_crosshair_change(pcb_false); if (pcb_buffer_load_layout(PCB, PCB_PASTEBUFFER, name, format)) - pcb_tool_select_by_id(PCB_MODE_PASTE_BUFFER); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_PASTE_BUFFER); pcb_notify_crosshair_change(pcb_true); break; Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 25207) +++ trunk/src/gui_act.c (revision 25208) @@ -398,32 +398,32 @@ pcb_notify_crosshair_change(pcb_false); switch(fgw_keyword(&argv[1])) { case F_Arc: - pcb_tool_select_by_id(PCB_MODE_ARC); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARC); break; case F_Arrow: case F_None: - pcb_tool_select_by_id(PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); break; case F_Copy: - pcb_tool_select_by_id(PCB_MODE_COPY); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_COPY); break; case F_InsertPoint: - pcb_tool_select_by_id(PCB_MODE_INSERT_POINT); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_INSERT_POINT); break; case F_Line: - pcb_tool_select_by_id(PCB_MODE_LINE); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_LINE); break; case F_Lock: - pcb_tool_select_by_id(PCB_MODE_LOCK); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_LOCK); break; case F_Move: - pcb_tool_select_by_id(PCB_MODE_MOVE); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_MOVE); break; case F_Cancel: { int saved_mode = conf_core.editor.mode; - pcb_tool_select_by_id(PCB_MODE_ARROW); - pcb_tool_select_by_id(saved_mode); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, saved_mode); } break; case F_Escape: @@ -440,54 +440,54 @@ case PCB_MODE_RUBBERBAND_MOVE: case PCB_MODE_THERMAL: case PCB_MODE_LOCK: - pcb_tool_select_by_id(PCB_MODE_ARROW); - pcb_tool_select_by_id(PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); pcb_tool_note.Hit = pcb_tool_note.Click = 0; /* if the mouse button is still pressed, don't start selecting a box */ break; case PCB_MODE_LINE: if (pcb_crosshair.AttachedLine.State == PCB_CH_STATE_FIRST) { - pcb_tool_select_by_id(PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); } else { - pcb_tool_select_by_id(PCB_MODE_ARROW); - pcb_tool_select_by_id(PCB_MODE_LINE); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_LINE); } break; case PCB_MODE_RECTANGLE: if (pcb_crosshair.AttachedBox.State == PCB_CH_STATE_FIRST) - pcb_tool_select_by_id(PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); else { - pcb_tool_select_by_id(PCB_MODE_ARROW); - pcb_tool_select_by_id(PCB_MODE_RECTANGLE); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_RECTANGLE); } break; case PCB_MODE_POLYGON: if (pcb_crosshair.AttachedLine.State == PCB_CH_STATE_FIRST) - pcb_tool_select_by_id(PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); else { - pcb_tool_select_by_id(PCB_MODE_ARROW); - pcb_tool_select_by_id(PCB_MODE_POLYGON); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_POLYGON); } break; case PCB_MODE_POLYGON_HOLE: if (pcb_crosshair.AttachedLine.State == PCB_CH_STATE_FIRST) - pcb_tool_select_by_id(PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); else { - pcb_tool_select_by_id(PCB_MODE_ARROW); - pcb_tool_select_by_id(PCB_MODE_POLYGON_HOLE); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_POLYGON_HOLE); } break; case PCB_MODE_ARC: if (pcb_crosshair.AttachedBox.State == PCB_CH_STATE_FIRST) - pcb_tool_select_by_id(PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); else { - pcb_tool_select_by_id(PCB_MODE_ARROW); - pcb_tool_select_by_id(PCB_MODE_ARC); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARC); } break; @@ -501,16 +501,16 @@ break; case F_Notify: - pcb_notify_mode(); + pcb_notify_mode(&PCB->hidlib); break; case F_PasteBuffer: - pcb_tool_select_by_id(PCB_MODE_PASTE_BUFFER); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_PASTE_BUFFER); break; case F_Polygon: - pcb_tool_select_by_id(PCB_MODE_POLYGON); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_POLYGON); break; case F_PolygonHole: - pcb_tool_select_by_id(PCB_MODE_POLYGON_HOLE); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_POLYGON_HOLE); break; case F_Release: if ((pcb_mid_stroke) && (conf_core.editor.enable_stroke) && (pcb_stub_stroke_finish() == 0)) { @@ -517,19 +517,19 @@ /* Ugly hack: returning 1 here will break execution of the action script, so actions after this one could do things that would be executed only after non-recognized gestures */ - pcb_release_mode(); + pcb_release_mode(&PCB->hidlib); return 1; } - pcb_release_mode(); + pcb_release_mode(&PCB->hidlib); break; case F_Remove: - pcb_tool_select_by_id(PCB_MODE_REMOVE); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_REMOVE); break; case F_Rectangle: - pcb_tool_select_by_id(PCB_MODE_RECTANGLE); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_RECTANGLE); break; case F_Rotate: - pcb_tool_select_by_id(PCB_MODE_ROTATE); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ROTATE); break; case F_Stroke: if (conf_core.editor.enable_stroke) { @@ -539,36 +539,36 @@ /* Handle middle mouse button restarts of drawing mode. If not in a drawing mode, middle mouse button will select objects. */ if (conf_core.editor.mode == PCB_MODE_LINE && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST) - pcb_tool_select_by_id(PCB_MODE_LINE); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_LINE); else if (conf_core.editor.mode == PCB_MODE_ARC && pcb_crosshair.AttachedBox.State != PCB_CH_STATE_FIRST) - pcb_tool_select_by_id(PCB_MODE_ARC); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARC); else if (conf_core.editor.mode == PCB_MODE_RECTANGLE && pcb_crosshair.AttachedBox.State != PCB_CH_STATE_FIRST) - pcb_tool_select_by_id(PCB_MODE_RECTANGLE); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_RECTANGLE); else if (conf_core.editor.mode == PCB_MODE_POLYGON && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST) - pcb_tool_select_by_id(PCB_MODE_POLYGON); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_POLYGON); else { - pcb_tool_save(); + pcb_tool_save(&PCB->hidlib); pcb_tool_is_saved = pcb_true; - pcb_tool_select_by_id(PCB_MODE_ARROW); - pcb_notify_mode(); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); + pcb_notify_mode(&PCB->hidlib); } break; case F_Text: - pcb_tool_select_by_id(PCB_MODE_TEXT); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_TEXT); break; case F_Thermal: - pcb_tool_select_by_id(PCB_MODE_THERMAL); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_THERMAL); break; case F_Via: - pcb_tool_select_by_id(PCB_MODE_VIA); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_VIA); break; case F_Restore: /* restore the last saved tool */ - pcb_tool_restore(); + pcb_tool_restore(&PCB->hidlib); break; case F_Save: /* save currently selected tool */ - pcb_tool_save(); + pcb_tool_save(&PCB->hidlib); break; } pcb_notify_crosshair_change(pcb_true); @@ -865,7 +865,7 @@ set_same_(((pcb_line_t *) ptr2)->Thickness, -1, -1, ((pcb_line_t *) ptr2)->Clearance / 2, NULL); layer = (pcb_layer_t *) ptr1; if (conf_core.editor.mode != PCB_MODE_LINE) - pcb_tool_select_by_id(PCB_MODE_LINE); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_LINE); pcb_notify_crosshair_change(pcb_true); pcb_event(&PCB->hidlib, PCB_EVENT_ROUTE_STYLES_CHANGED, NULL); break; @@ -875,7 +875,7 @@ set_same_(((pcb_arc_t *) ptr2)->Thickness, -1, -1, ((pcb_arc_t *) ptr2)->Clearance / 2, NULL); layer = (pcb_layer_t *) ptr1; if (conf_core.editor.mode != PCB_MODE_ARC) - pcb_tool_select_by_id(PCB_MODE_ARC); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARC); pcb_notify_crosshair_change(pcb_true); pcb_event(&PCB->hidlib, PCB_EVENT_ROUTE_STYLES_CHANGED, NULL); break; Index: trunk/src/hid.h =================================================================== --- trunk/src/hid.h (revision 25207) +++ trunk/src/hid.h (revision 25208) @@ -556,6 +556,10 @@ /* optional: called by core when the global hidlib context changes (e.g. board changed) */ void (*set_hidlib)(pcb_hidlib_t *hidlib); + + /* Change the mouse cursor to a named cursor e.g. after the tool has changed. + The list of cursors names available may depend on the HID. */ + void (*set_mouse_cursor)(pcb_hidlib_t *hidlib, const char *name); }; /* One of these functions (in the common code) will be called whenever the GUI Index: trunk/src/hid_nogui.c =================================================================== --- trunk/src/hid_nogui.c (revision 25207) +++ trunk/src/hid_nogui.c (revision 25208) @@ -464,6 +464,10 @@ } +static void nogui_set_mouse_cursor(pcb_hidlib_t *hidlib, const char *name) +{ +} + void pcb_hid_nogui_init(pcb_hid_t * hid) { hid->get_export_options = nogui_get_export_options; @@ -509,6 +513,7 @@ hid->clip_set = nogui_clip_set; hid->clip_get = nogui_clip_get; hid->clip_free = nogui_clip_free; + hid->set_mouse_cursor = nogui_set_mouse_cursor; } Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 25207) +++ trunk/src/main.c (revision 25208) @@ -639,7 +639,7 @@ InitHandler(); pcb_init_buffers(PCB); - pcb_tool_select_by_id(PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); if (command_line_pcb) { if (pcb_load_pcb(command_line_pcb, NULL, pcb_true, 0) != 0) { @@ -701,7 +701,7 @@ pcb_gui->parse_arguments(&hid_argc, &hid_argv); if (pcb_gui->gui) pcb_crosshair_init(); - pcb_tool_select_by_id(PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); pcb_event(&PCB->hidlib, PCB_EVENT_LIBRARY_CHANGED, NULL); } } while(pcb_gui != NULL); Index: trunk/src/remove_act.c =================================================================== --- trunk/src/remove_act.c (revision 25207) +++ trunk/src/remove_act.c (revision 25208) @@ -55,10 +55,10 @@ switch(id) { case F_Object: pcb_hid_get_coords("Click on object to delete", &pcb_tool_note.X, &pcb_tool_note.Y, 0); - pcb_tool_save(); - pcb_tool_select_by_id(PCB_MODE_REMOVE); - pcb_notify_mode(); - pcb_tool_restore(); + pcb_tool_save(&PCB->hidlib); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_REMOVE); + pcb_notify_mode(&PCB->hidlib); + pcb_tool_restore(&PCB->hidlib); break; case F_Selected: pcb_remove_selected(pcb_false); Index: trunk/src/tool.c =================================================================== --- trunk/src/tool.c (revision 25207) +++ trunk/src/tool.c (revision 25208) @@ -100,15 +100,15 @@ return PCB_TOOLID_INVALID; } -int pcb_tool_select_by_name(const char *name) +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(id); + return pcb_tool_select_by_id(hidlib, id); } -int pcb_tool_select_by_id(pcb_toolid_t 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; @@ -144,10 +144,12 @@ pcb_notify_crosshair_change(pcb_false); pcb_crosshair_move_relative(0, 0); pcb_notify_crosshair_change(pcb_true); + if (pcb_gui != NULL) + pcb_gui->set_mouse_cursor(hidlib, "TODO"); return 0; } -int pcb_tool_select_highest(void) +int pcb_tool_select_highest(pcb_hidlib_t *hidlib) { pcb_toolid_t n, bestn = PCB_TOOLID_INVALID; unsigned int bestp = -1; @@ -160,10 +162,10 @@ } if (bestn == PCB_TOOLID_INVALID) return -1; - return pcb_tool_select_by_id(bestn); + return pcb_tool_select_by_id(hidlib, bestn); } -int pcb_tool_save(void) +int pcb_tool_save(pcb_hidlib_t *hidlib) { save_stack[save_position] = conf_core.editor.mode; if (save_position < PCB_MAX_MODESTACK_DEPTH - 1) @@ -173,13 +175,13 @@ return 0; } -int pcb_tool_restore(void) +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(save_stack[--save_position]); + return pcb_tool_select_by_id(hidlib, save_stack[--save_position]); } /**** current tool function wrappers ****/ @@ -212,7 +214,7 @@ wrap_void(notify_mode, ()); } -void pcb_tool_release_mode(void) +void pcb_tool_release_mode(pcb_hidlib_t *hidlib) { wrap_void(release_mode, ()); } @@ -394,20 +396,20 @@ /*** old helpers ***/ -void pcb_release_mode(void) +void pcb_release_mode(pcb_hidlib_t *hidlib) { if (pcb_crosshair.click_cmd_entry_active && (pcb_cli_mouse(0) == 0)) return; - pcb_tool_release_mode(); + pcb_tool_release_mode(hidlib); if (pcb_tool_is_saved) - pcb_tool_restore(); + pcb_tool_restore(hidlib); pcb_tool_is_saved = pcb_false; pcb_draw(); } -void pcb_notify_mode(void) +void pcb_notify_mode(pcb_hidlib_t *hidlib) { if (pcb_crosshair.click_cmd_entry_active && (pcb_cli_mouse(1) == 0)) return; Index: trunk/src/tool.h =================================================================== --- trunk/src/tool.h (revision 25207) +++ trunk/src/tool.h (revision 25208) @@ -91,18 +91,17 @@ /* Select a tool by name, id or pick the highest prio tool; return 0 on success */ -int pcb_tool_select_by_name(const char *name); -int pcb_tool_select_by_id(pcb_toolid_t id); -int pcb_tool_select_highest(void); +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(void); -int pcb_tool_restore(void); +int pcb_tool_save(pcb_hidlib_t *hidlib); +int pcb_tool_restore(pcb_hidlib_t *hidlib); /**** Tool function wrappers; calling these will operate on the current tool as defined in conf_core.editor.mode ****/ void pcb_tool_notify_mode(void); -void pcb_tool_release_mode(void); void pcb_tool_adjust_attached_objects(void); void pcb_tool_draw_attached(void); pcb_bool pcb_tool_undo_act(void); @@ -137,9 +136,9 @@ /* does what's appropriate for the current mode setting (when clicked). This normally means creation of an object at the current crosshair location. new created objects are added to the create undo list of course */ -void pcb_notify_mode(void); +void pcb_notify_mode(pcb_hidlib_t *hidlib); -void pcb_release_mode(void); +void pcb_release_mode(pcb_hidlib_t *hidlib); /**** Low level, for internal use ****/ Index: trunk/src/tool_arrow.c =================================================================== --- trunk/src/tool_arrow.c (revision 25207) +++ trunk/src/tool_arrow.c (revision 25208) @@ -72,16 +72,16 @@ pcb_buffer_add_selected(PCB, PCB_PASTEBUFFER, pcb_tool_note.X, pcb_tool_note.Y, pcb_true); pcb_undo_save_serial(); pcb_remove_selected(pcb_false); - pcb_tool_save(); + pcb_tool_save(&PCB->hidlib); pcb_tool_is_saved = pcb_true; - pcb_tool_select_by_id(PCB_MODE_PASTE_BUFFER); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_PASTE_BUFFER); } else if (pcb_tool_note.Hit && !pcb_gui->shift_is_pressed()) { pcb_box_t box; - pcb_tool_save(); + pcb_tool_save(&PCB->hidlib); pcb_tool_is_saved = pcb_true; - pcb_tool_select_by_id(pcb_gui->control_is_pressed()? PCB_MODE_COPY : PCB_MODE_MOVE); + pcb_tool_select_by_id(&PCB->hidlib, pcb_gui->control_is_pressed()? PCB_MODE_COPY : PCB_MODE_MOVE); pcb_crosshair.AttachedObject.Ptr1 = pcb_tool_note.ptr1; pcb_crosshair.AttachedObject.Ptr2 = pcb_tool_note.ptr2; pcb_crosshair.AttachedObject.Ptr3 = pcb_tool_note.ptr3; Index: trunk/src/tool_line.c =================================================================== --- trunk/src/tool_line.c (revision 25207) +++ trunk/src/tool_line.c (revision 25208) @@ -154,7 +154,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_id(PCB_MODE_LINE); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_LINE); return; } Index: trunk/src_plugins/ddraft/cli_line.c =================================================================== --- trunk/src_plugins/ddraft/cli_line.c (revision 25207) +++ trunk/src_plugins/ddraft/cli_line.c (revision 25208) @@ -63,7 +63,7 @@ pcb_ddraft_attached_reset(); if (pcb_tool_next_id != pcb_ddraft_tool) - pcb_tool_select_by_id(pcb_ddraft_tool); + pcb_tool_select_by_id(&PCB->hidlib, pcb_ddraft_tool); pcb_trace("line e: '%s':%d\n", line, cursor); memset(&box, 0, sizeof(box)); Index: trunk/src_plugins/hid_lesstif/library.c =================================================================== --- trunk/src_plugins/hid_lesstif/library.c (revision 25207) +++ trunk/src_plugins/hid_lesstif/library.c (revision 25208) @@ -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_id(PCB_MODE_PASTE_BUFFER); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_PASTE_BUFFER); } static int build_library_dialog() Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 25207) +++ trunk/src_plugins/hid_lesstif/main.c (revision 25208) @@ -3252,7 +3252,11 @@ cmd_is_active = 1; } +static void ltf_set_mouse_cursor(pcb_hidlib_t *hidlib, const char *name) +{ +} + void lesstif_create_menu(const char *menu, const pcb_menu_prop_t *props); int lesstif_remove_menu(const char *menu); int lesstif_remove_menu_node(lht_node_t *node); @@ -3361,6 +3365,7 @@ lesstif_hid.view_get = ltf_view_get; lesstif_hid.open_command = ltf_open_command; lesstif_hid.open_popup = ltf_open_popup; + lesstif_hid.set_mouse_cursor = ltf_set_mouse_cursor; lesstif_hid.set_hidlib = ltf_set_hidlib; Index: trunk/src_plugins/lib_gtk_common/dlg_library.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_library.c (revision 25207) +++ trunk/src_plugins/lib_gtk_common/dlg_library.c (revision 25208) @@ -258,9 +258,9 @@ return; fullp = entry->data.fp.loc_info; } - pcb_tool_select_by_id(PCB_MODE_ARROW); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_ARROW); if (pcb_buffer_load_footprint(PCB_PASTEBUFFER, name == NULL ? fullp : name, NULL)) - pcb_tool_select_by_id(PCB_MODE_PASTE_BUFFER); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_PASTE_BUFFER); /* update the preview with new symbol data */ if (PCB_PASTEBUFFER->Data != NULL) { Index: trunk/src_plugins/lib_gtk_hid/glue_hid.c =================================================================== --- trunk/src_plugins/lib_gtk_hid/glue_hid.c (revision 25207) +++ trunk/src_plugins/lib_gtk_hid/glue_hid.c (revision 25208) @@ -547,6 +547,11 @@ ghid_sync_with_new_layout(&ghidgui->topwin); } +static void ghid_set_mouse_cursor(pcb_hidlib_t *hidlib, const char *name) +{ + +} + void ghid_glue_hid_init(pcb_hid_t *dst) { memset(dst, 0, sizeof(pcb_hid_t)); @@ -617,6 +622,7 @@ dst->view_get = ghid_view_get; dst->open_command = ghid_open_command; dst->open_popup = ghid_open_popup; + dst->set_mouse_cursor = ghid_set_mouse_cursor; dst->set_hidlib = ghid_set_hidlib; Index: trunk/src_plugins/lib_hid_pcbui/toolbar.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/toolbar.c (revision 25207) +++ trunk/src_plugins/lib_hid_pcbui/toolbar.c (revision 25208) @@ -32,6 +32,7 @@ #include "hid_cfg.h" #include "hid_dad.h" #include "tool.h" +#include "board.h" #include "conf_core.h" #include "toolbar.h" @@ -71,7 +72,7 @@ return; tid = (int)attr->user_data; - pcb_tool_select_by_id(tid); + pcb_tool_select_by_id(&PCB->hidlib, tid); } static void toolbar_create_static(pcb_hid_cfg_t *cfg) Index: trunk/src_plugins/serpentine/serpentine.c =================================================================== --- trunk/src_plugins/serpentine/serpentine.c (revision 25207) +++ trunk/src_plugins/serpentine/serpentine.c (revision 25208) @@ -429,7 +429,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("serpentine"); + pcb_tool_select_by_name(&PCB->hidlib, "serpentine"); PCB_ACT_IRES(0); return 0; } Index: trunk/src_plugins/shand_cmd/command.c =================================================================== --- trunk/src_plugins/shand_cmd/command.c (revision 25207) +++ trunk/src_plugins/shand_cmd/command.c (revision 25208) @@ -93,7 +93,7 @@ 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_id(PCB_MODE_PASTE_BUFFER); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_PASTE_BUFFER); PCB_ACT_IRES(0); return 0; @@ -110,7 +110,7 @@ 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_id(PCB_MODE_PASTE_BUFFER); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_PASTE_BUFFER); PCB_ACT_IRES(0); return 0; Index: trunk/src_plugins/shape/shape.c =================================================================== --- trunk/src_plugins/shape/shape.c (revision 25207) +++ trunk/src_plugins/shape/shape.c (revision 25208) @@ -218,7 +218,7 @@ pcb_r_delete_entry(CURRENT->polygon_tree, (pcb_box_t *)p); pcb_poly_free_fields(p); pcb_poly_free(p); - pcb_tool_select_by_id(PCB_MODE_PASTE_BUFFER); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_PASTE_BUFFER); } return p; } @@ -266,7 +266,7 @@ pcb_copy_obj_to_buffer(PCB, data, PCB->Data, PCB_OBJ_LINE, CURRENT, l, l); pcb_r_delete_entry(CURRENT->line_tree, (pcb_box_t *)l); pcb_line_free(l); - pcb_tool_select_by_id(PCB_MODE_PASTE_BUFFER); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_PASTE_BUFFER); } } return l; Index: trunk/src_plugins/sketch_route/sketch_route.c =================================================================== --- trunk/src_plugins/sketch_route/sketch_route.c (revision 25207) +++ trunk/src_plugins/sketch_route/sketch_route.c (revision 25208) @@ -1125,7 +1125,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("skline"); + pcb_tool_select_by_name(&PCB->hidlib, "skline"); PCB_ACT_IRES(0); return 0; Index: trunk/src_plugins/stroke/stroke.c =================================================================== --- trunk/src_plugins/stroke/stroke.c (revision 25207) +++ trunk/src_plugins/stroke/stroke.c (revision 25208) @@ -131,11 +131,11 @@ } else if (pcb_strcasecmp(cmd, "stopline") == 0) { if (conf_core.editor.mode == PCB_MODE_LINE) - pcb_tool_select_by_id(PCB_MODE_LINE); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_LINE); else if (conf_core.editor.mode == PCB_MODE_POLYGON) - pcb_tool_select_by_id(PCB_MODE_POLYGON); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_POLYGON); else if (conf_core.editor.mode == PCB_MODE_POLYGON_HOLE) - pcb_tool_select_by_id(PCB_MODE_POLYGON_HOLE); + pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_POLYGON_HOLE); } else PCB_ACT_FAIL(stroke);