Index: trunk/src/examples/psu.lht =================================================================== --- trunk/src/examples/psu.lht (revision 1075) +++ trunk/src/examples/psu.lht (revision 1076) @@ -42,6 +42,8 @@ ha:pen.3 { shape=circle; size=250; color=#2222BB; } # wire-nets ha:pen.5 { shape=circle; size=250; color=#991111; } # terminal ha:pen.8 { shape=circle; size=250; color=#119911; } # symbol decoration + ha:pen.13 { shape=circle; size=800; color=#2222BB; } # wire-net junctions + ha:group_ref.20 { x=10000; y=10000; rot=0; mirror=x; ref=/1/10 Index: trunk/src/libcschem/cnc_pen.h =================================================================== --- trunk/src/libcschem/cnc_pen.h (revision 1075) +++ trunk/src/libcschem/cnc_pen.h (revision 1076) @@ -41,7 +41,7 @@ csch_chdr_t hdr; csch_pen_shape_t shape; csch_coord_t size; /* diameter or edge length */ - pcb_color_t color; + rnd_color_t color; unsigned int dash; }; Index: trunk/src/libcschem/concrete.h =================================================================== --- trunk/src/libcschem/concrete.h (revision 1075) +++ trunk/src/libcschem/concrete.h (revision 1076) @@ -117,7 +117,7 @@ }; struct csch_sheet_s { - pcb_hidlib_t hidlib; + rnd_hidlib_t hidlib; csch_project_t *parent; csch_rtree_t dsply[CSCH_DSPLY_max]; /* IDs in screen coords, per display layer */ @@ -124,7 +124,7 @@ csch_cgrp_t direct, indirect; /* a sheet is really made of groups to keep the code simple */ /* (sheet attributes are in the direct, the indirect group is for the "local library") */ csch_oid_t dflt_pen; - pcb_color_t dflt_fill; + rnd_color_t dflt_fill; char *dflt_font, *dflt_font_size, *dflt_font_style; char *loadname; /* original file name */ Index: trunk/src/libcschem/library.c =================================================================== --- trunk/src/libcschem/library.c (revision 1075) +++ trunk/src/libcschem/library.c (revision 1076) @@ -34,7 +34,7 @@ #include "library.h" -void csch_lib_find_alloc(csch_lib_it_t *it, pcb_hidlib_t *hidlib, vts0_t *libs, const char *cwd) +void csch_lib_find_alloc(csch_lib_it_t *it, rnd_hidlib_t *hidlib, vts0_t *libs, const char *cwd) { int n; memset(it, 0, sizeof(csch_lib_it_t)); Index: trunk/src/libcschem/library.h =================================================================== --- trunk/src/libcschem/library.h (revision 1075) +++ trunk/src/libcschem/library.h (revision 1076) @@ -34,7 +34,7 @@ typedef struct { /* optional configuration */ - pcb_hidlib_t *hidlib; + rnd_hidlib_t *hidlib; vts0_t names; unsigned int case_insensitive:1; @@ -53,7 +53,7 @@ libs. If a directory contains multiple file names, return each. */ /* Create a new search in it */ -void csch_lib_find_alloc(csch_lib_it_t *it, pcb_hidlib_t *hidlib, vts0_t *libs, const char *cwd); +void csch_lib_find_alloc(csch_lib_it_t *it, rnd_hidlib_t *hidlib, vts0_t *libs, const char *cwd); /* Add a name to the search (name is not strdup'd so must be available until csch_lib_find_free() */ Index: trunk/src/libcschem/plug_io.c =================================================================== --- trunk/src/libcschem/plug_io.c (revision 1075) +++ trunk/src/libcschem/plug_io.c (revision 1076) @@ -164,7 +164,7 @@ } } - f = pcb_fopen(NULL, real_fn, "r"); + f = rnd_fopen(NULL, real_fn, "r"); if (f == NULL) { #warning TODO: error reporting free(real_fn); @@ -227,7 +227,7 @@ #warning TODO: error reporting return NULL; } - f = pcb_fopen(NULL, real_fn, "r"); + f = rnd_fopen(NULL, real_fn, "r"); if (f == NULL) { #warning TODO: error reporting free(real_fn); Index: trunk/src/libcschem/plug_io_act.c =================================================================== --- trunk/src/libcschem/plug_io_act.c (revision 1075) +++ trunk/src/libcschem/plug_io_act.c (revision 1076) @@ -49,15 +49,15 @@ if (pcb_strcasecmp(op, "sheet") == 0) { if (csch_io_load_sheet(..., name) != 0) { - pcb_message(PCB_MSG_ERROR, "Can not load file '%s'\n", name); + rnd_message(RND_MSG_ERROR, "Can not load file '%s'\n", name); PCB_ACT_IRES(-1); return 0; } - pcb_event(&camv.hidlib, CAMV_EVENT_LAYERS_CHANGED, NULL); + rnd_event(&camv.hidlib, CAMV_EVENT_LAYERS_CHANGED, NULL); } else if (pcb_strcasecmp(op, "project") == 0) { TODO("the actual project load"); - pcb_message(PCB_MSG_ERROR, "LoadFrom(project,...) not yet implemented\n"); + rnd_message(RND_MSG_ERROR, "LoadFrom(project,...) not yet implemented\n"); } else PCB_ACT_FAIL(LoadFrom); @@ -80,14 +80,14 @@ if (pcb_strcasecmp(op, "sheet") == 0) { if (csch_save_sheet(sheet, name, format) != 0) { - pcb_message(PCB_MSG_ERROR, "Can not save file '%s'\n", name); + rnd_message(RND_MSG_ERROR, "Can not save file '%s'\n", name); PCB_ACT_IRES(-1); return 0; } - pcb_event(&sheet->hidlib, CSCH_EVENT_LAYERS_CHANGED, NULL); + rnd_event(&sheet->hidlib, CSCH_EVENT_LAYERS_CHANGED, NULL); } else if (pcb_strcasecmp(op, "project") == 0) { - pcb_message(PCB_MSG_ERROR, "SaveTo(project,...) not yet implemented\n"); + rnd_message(RND_MSG_ERROR, "SaveTo(project,...) not yet implemented\n"); } else PCB_ACT_FAIL(SaveTo); Index: trunk/src/plugins/export_animator/export_animator.c =================================================================== --- trunk/src/plugins/export_animator/export_animator.c (revision 1075) +++ trunk/src/plugins/export_animator/export_animator.c (revision 1076) @@ -113,7 +113,7 @@ static int anim_export_sheet(const char *fn, const char *fmt, csch_sheet_t *src) { TODO("get hidlib as an arg") - pcb_hidlib_t *hidlib = NULL; + rnd_hidlib_t *hidlib = NULL; FILE *f; csch_grpo_iter_t it; ctx_t ctx; @@ -121,7 +121,7 @@ csch_coord_t mx, my; int n; - f = pcb_fopen(hidlib, fn, "w"); + f = rnd_fopen(hidlib, fn, "w"); if (f == NULL) return -1; Index: trunk/src/plugins/export_tedax/export_tedax.c =================================================================== --- trunk/src/plugins/export_tedax/export_tedax.c (revision 1075) +++ trunk/src/plugins/export_tedax/export_tedax.c (revision 1076) @@ -187,8 +187,8 @@ static int tdx_export_netlist(const char *fn, const char *fmt, csch_abstract_t *abs) { TODO("get hidlib as an arg") - pcb_hidlib_t *hidlib = NULL; - FILE *f = pcb_fopen(hidlib, fn, "w"); + rnd_hidlib_t *hidlib = NULL; + FILE *f = rnd_fopen(hidlib, fn, "w"); if (f == NULL) return -1; Index: trunk/src/plugins/gui/act.c =================================================================== --- trunk/src/plugins/gui/act.c (revision 1075) +++ trunk/src/plugins/gui/act.c (revision 1076) @@ -39,7 +39,7 @@ #define NOGUI() \ do { \ - if ((pcb_gui == NULL) || (!pcb_gui->gui)) { \ + if ((rnd_gui == NULL) || (!rnd_gui->gui)) { \ PCB_ACT_IRES(1); \ return 0; \ } \ Index: trunk/src/plugins/gui/layersel.c =================================================================== --- trunk/src/plugins/gui/layersel.c (revision 1075) +++ trunk/src/plugins/gui/layersel.c (revision 1076) @@ -67,7 +67,7 @@ { pcb_hid_attr_val_t hv; hv.lng = !!csch_layer_vis[lys->lid]; - pcb_gui->attr_dlg_set_value(lys->ls->sub.dlg_hid_ctx, lys->wvis, &hv); + rnd_gui->attr_dlg_set_value(lys->ls->sub.dlg_hid_ctx, lys->wvis, &hv); } static void layer_vis_cb(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) @@ -140,14 +140,14 @@ } } -void sch_rnd_layersel_gui_init_ev(pcb_hidlib_t *hidlib, void *user_data, int argc, pcb_event_arg_t argv[]) +void sch_rnd_layersel_gui_init_ev(rnd_hidlib_t *hidlib, void *user_data, int argc, pcb_event_arg_t argv[]) { - if ((PCB_HAVE_GUI_ATTR_DLG) && (pcb_gui->get_menu_cfg != NULL)) { + if ((RND_HAVE_GUI_ATTR_DLG) && (rnd_gui->get_menu_cfg != NULL)) { layersel_build(); } } -void sch_rnd_layersel_vis_chg_ev(pcb_hidlib_t *hidlib, void *user_data, int argc, pcb_event_arg_t argv[]) +void sch_rnd_layersel_vis_chg_ev(rnd_hidlib_t *hidlib, void *user_data, int argc, pcb_event_arg_t argv[]) { if ((!layersel.sub_inited) || (layersel.lock_vis > 0)) return; @@ -154,9 +154,9 @@ layersel_update_vis(&layersel); } -void sch_rnd_layersel_layer_chg_ev(pcb_hidlib_t *hidlib, void *user_data, int argc, pcb_event_arg_t argv[]) +void sch_rnd_layersel_layer_chg_ev(rnd_hidlib_t *hidlib, void *user_data, int argc, pcb_event_arg_t argv[]) { - if ((PCB_HAVE_GUI_ATTR_DLG) && (pcb_gui->get_menu_cfg != NULL) && (layersel.sub_inited)) { + if ((RND_HAVE_GUI_ATTR_DLG) && (rnd_gui->get_menu_cfg != NULL) && (layersel.sub_inited)) { pcb_hid_dock_leave(&layersel.sub); layersel.sub_inited = 0; layersel_build(); Index: trunk/src/plugins/gui/layersel.h =================================================================== --- trunk/src/plugins/gui/layersel.h (revision 1075) +++ trunk/src/plugins/gui/layersel.h (revision 1076) @@ -1,5 +1,5 @@ -void sch_rnd_layersel_gui_init_ev(pcb_hidlib_t *hidlib, void *user_data, int argc, pcb_event_arg_t argv[]); -void sch_rnd_layersel_vis_chg_ev(pcb_hidlib_t *hidlib, void *user_data, int argc, pcb_event_arg_t argv[]); -void sch_rnd_layersel_layer_chg_ev(pcb_hidlib_t *hidlib, void *user_data, int argc, pcb_event_arg_t argv[]); +void sch_rnd_layersel_gui_init_ev(rnd_hidlib_t *hidlib, void *user_data, int argc, pcb_event_arg_t argv[]); +void sch_rnd_layersel_vis_chg_ev(rnd_hidlib_t *hidlib, void *user_data, int argc, pcb_event_arg_t argv[]); +void sch_rnd_layersel_layer_chg_ev(rnd_hidlib_t *hidlib, void *user_data, int argc, pcb_event_arg_t argv[]); Index: trunk/src/plugins/gui/sch_rnd_gui.c =================================================================== --- trunk/src/plugins/gui/sch_rnd_gui.c (revision 1075) +++ trunk/src/plugins/gui/sch_rnd_gui.c (revision 1076) @@ -50,7 +50,7 @@ #define NOGUI() \ do { \ - if ((pcb_gui == NULL) || (!pcb_gui->gui)) { \ + if ((rnd_gui == NULL) || (!rnd_gui->gui)) { \ PCB_ACT_IRES(1); \ return 0; \ } \ @@ -63,7 +63,7 @@ const char pcb_acth_Popup[] = "Bring up the popup menu specified by MenuName, optionally modified with the object type under the cursor.\n"; fgw_error_t pcb_act_Popup(fgw_arg_t *res, int argc, fgw_arg_t *argv) { - pcb_hidlib_t *hidlib = PCB_ACT_HIDLIB; + rnd_hidlib_t *hidlib = PCB_ACT_HIDLIB; csch_sheet_t *sheet = (csch_sheet_t *)hidlib; char name[256], name2[256]; const char *tn = NULL, *a0, *a1 = NULL, *misc = "misc"; @@ -92,7 +92,7 @@ switch(ctx_sens) { case CTX_OBJ_TYPE: { - pcb_coord_t x, y; + rnd_coord_t x, y; csch_chdr_t *obj; csch_rtree_box_t q; @@ -122,9 +122,9 @@ pcb_trace("name=%s name2=%s\n", name, name2); if (*name != '\0') - r = pcb_gui->open_popup(pcb_gui, name); + r = rnd_gui->open_popup(rnd_gui, name); if ((r != 0) && (*name2 != '\0')) - r = pcb_gui->open_popup(pcb_gui, name2); + r = rnd_gui->open_popup(rnd_gui, name2); PCB_ACT_IRES(r); return 0; @@ -160,11 +160,11 @@ PCB_ACT_MAY_CONVARG(1, FGW_STR, Load, function = argv[1].val.str); if (pcb_strcasecmp(function, "Layer") == 0) - name = pcb_gui->fileselect(pcb_gui, "Load layer", "Import a layer from file", last_layer, NULL, NULL, "layer", PCB_HID_FSD_READ, NULL); + name = rnd_gui->fileselect(rnd_gui, "Load layer", "Import a layer from file", last_layer, NULL, NULL, "layer", PCB_HID_FSD_READ, NULL); else if (pcb_strcasecmp(function, "Project") == 0) - name = pcb_gui->fileselect(pcb_gui, "Load a project file", "load project (all layers) from file", last_project, ".lht", NULL, "project", PCB_HID_FSD_READ, NULL); + name = rnd_gui->fileselect(rnd_gui, "Load a project file", "load project (all layers) from file", last_project, ".lht", NULL, "project", PCB_HID_FSD_READ, NULL); else { - pcb_message(PCB_MSG_ERROR, "Invalid subcommand for Load(): '%s'\n", function); + rnd_message(RND_MSG_ERROR, "Invalid subcommand for Load(): '%s'\n", function); PCB_ACT_IRES(1); return 0; } @@ -204,11 +204,11 @@ PCB_ACT_MAY_CONVARG(1, FGW_STR, Save, function = argv[1].val.str); if (pcb_strcasecmp(function, "Sheet") == 0) - name = pcb_gui->fileselect(pcb_gui, "Save layer", "Save a sheet to file", last_layer, NULL, NULL, "layer", 0, NULL); + name = rnd_gui->fileselect(rnd_gui, "Save layer", "Save a sheet to file", last_layer, NULL, NULL, "layer", 0, NULL); else if (pcb_strcasecmp(function, "Project") == 0) - name = pcb_gui->fileselect(pcb_gui, "Save a project file", "save project (all layers) to file", last_project, ".lht", NULL, "project", 0, NULL); + name = rnd_gui->fileselect(rnd_gui, "Save a project file", "save project (all layers) to file", last_project, ".lht", NULL, "project", 0, NULL); else { - pcb_message(PCB_MSG_ERROR, "Invalid subcommand for Save(): '%s'\n", function); + rnd_message(RND_MSG_ERROR, "Invalid subcommand for Save(): '%s'\n", function); PCB_ACT_IRES(1); return 0; } @@ -225,7 +225,7 @@ } extern const char pcb_acts_Zoom_default[]; -extern fgw_error_t pcb_gui_act_zoom(fgw_arg_t *res, int argc, fgw_arg_t *argv); +extern fgw_error_t rnd_gui_act_zoom(fgw_arg_t *res, int argc, fgw_arg_t *argv); static const char pcb_acth_Zoom[] = "GUI zoom"; static pcb_action_t sch_rnd_gui_action_list[] = { @@ -232,8 +232,8 @@ {"Popup", pcb_act_Popup, pcb_acth_Popup, pcb_acts_Popup}, {"Load", pcb_act_Load, pcb_acth_Load, pcb_acts_Load}, {"Save", pcb_act_Save, pcb_acth_Save, pcb_acts_Save}, - {"Zoom", pcb_gui_act_zoom, pcb_acth_Zoom, pcb_acts_Zoom_default}, - {"ZoomTo", pcb_gui_act_zoom, pcb_acth_Zoom, pcb_acts_Zoom_default}, + {"Zoom", rnd_gui_act_zoom, pcb_acth_Zoom, pcb_acts_Zoom_default}, + {"ZoomTo", rnd_gui_act_zoom, pcb_acth_Zoom, pcb_acts_Zoom_default}, }; TODO("Remove these once librnd separation is finished and plugin headers are accessible") @@ -250,8 +250,8 @@ int pplg_init_gui(void) { - pcb_event_bind(PCB_EVENT_GUI_INIT, sch_rnd_layersel_gui_init_ev, NULL, layersel_cookie); - pcb_event_bind(CSCH_EVENT_LAYERS_CHANGED, sch_rnd_layersel_layer_chg_ev, NULL, layersel_cookie); + rnd_event_bind(RND_EVENT_GUI_INIT, sch_rnd_layersel_gui_init_ev, NULL, layersel_cookie); + rnd_event_bind(CSCH_EVENT_LAYERS_CHANGED, sch_rnd_layersel_layer_chg_ev, NULL, layersel_cookie); PCB_REGISTER_ACTIONS(sch_rnd_gui_action_list, sch_rnd_gui_cookie); rnd_toolbar_init(); return 0; Index: trunk/src/plugins/io_lihata/read.c =================================================================== --- trunk/src/plugins/io_lihata/read.c (revision 1075) +++ trunk/src/plugins/io_lihata/read.c (revision 1076) @@ -287,7 +287,7 @@ /*** atomic object parsing ***/ -static int parse_color(read_ctx_t *ctx, pcb_color_t *dst, const lht_node_t *src) +static int parse_color(read_ctx_t *ctx, rnd_color_t *dst, const lht_node_t *src) { char *end; unsigned long l; Index: trunk/src/plugins/io_lihata/write.c =================================================================== --- trunk/src/plugins/io_lihata/write.c (revision 1075) +++ trunk/src/plugins/io_lihata/write.c (revision 1076) @@ -300,7 +300,7 @@ write_ctx_t ctx; ctx.sheet = dst; - ctx.f = pcb_fopen((pcb_hidlib_t *)&dst->hidlib, fn, "w"); + ctx.f = rnd_fopen((rnd_hidlib_t *)&dst->hidlib, fn, "w"); if (ctx.f == NULL) return -1; Index: trunk/src/plugins/sch_dialogs/attribute_dialog.c =================================================================== --- trunk/src/plugins/sch_dialogs/attribute_dialog.c (revision 1075) +++ trunk/src/plugins/sch_dialogs/attribute_dialog.c (revision 1076) @@ -131,7 +131,7 @@ PCB_DAD_END(ctx->dlg); PCB_DAD_DEFSIZE(ctx->dlg, 400, 300); - PCB_DAD_NEW("AttributeDialog", ctx->dlg, "Attribute edit", ctx, pcb_false, attrdlg_close_cb); + PCB_DAD_NEW("AttributeDialog", ctx->dlg, "Attribute edit", ctx, rnd_false, attrdlg_close_cb); } @@ -141,7 +141,7 @@ const char pcb_acth_AttributeDialog[] = "Bring up the Attribute Editor Dialog for an object.\n"; fgw_error_t pcb_act_AttributeDialog(fgw_arg_t *res, int argc, fgw_arg_t *argv) { - pcb_hidlib_t *hidlib = PCB_ACT_HIDLIB; + rnd_hidlib_t *hidlib = PCB_ACT_HIDLIB; csch_sheet_t *sheet = (csch_sheet_t *)hidlib; const char *cmd; csch_chdr_t *obj = NULL; @@ -152,7 +152,7 @@ obj = csch_obj_clicked; } else if (strcmp(cmd, "object") == 0) { - pcb_coord_t x, y; + rnd_coord_t x, y; csch_rtree_box_t q; pcb_hid_get_coords("context sensitive AttributeDialog: select object", &x, &y, 0); @@ -165,7 +165,7 @@ attr_dlg(obj); if (obj == NULL) { - pcb_message(PCB_MSG_ERROR, "AttributeDialog: no such object\n"); + rnd_message(RND_MSG_ERROR, "AttributeDialog: no such object\n"); PCB_ACT_IRES(-1); return 0; } Index: trunk/src/plugins/std_tools/line_common.c =================================================================== --- trunk/src/plugins/std_tools/line_common.c (revision 1075) +++ trunk/src/plugins/std_tools/line_common.c (revision 1076) @@ -58,7 +58,7 @@ /* returns whether the line is finished */ -static int line_release(pcb_hidlib_t *hl) +static int line_release(rnd_hidlib_t *hl) { switch(csch_tool_line.clicked) { case 0: @@ -74,11 +74,11 @@ } } -static void line_adjust_attached_objects(pcb_hidlib_t *hl) +static void line_adjust_attached_objects(rnd_hidlib_t *hl) { if (csch_tool_line.clicked == 1) { csch_coord_t chx = P2C(csch_crosshair_x), chy = P2C(csch_crosshair_y); - if ((csch_tool_line.dir == CSCH_TOOL_LINEDIR_ALL) && pcb_gui->control_is_pressed(pcb_gui)) { + if ((csch_tool_line.dir == CSCH_TOOL_LINEDIR_ALL) && rnd_gui->control_is_pressed(rnd_gui)) { double rad = atan2(chy - csch_tool_line.y1, chy - csch_tool_line.x1); double deg = rad * PCB_RAD_TO_DEG; double len = pcb_distance(chx, chy, csch_tool_line.x1, csch_tool_line.y1); @@ -88,7 +88,7 @@ csch_tool_line.y2 = csch_tool_line.y1 + sin(rad) * len; } else { - csch_tool_line.dir_temp_inv = pcb_gui->shift_is_pressed(pcb_gui); + csch_tool_line.dir_temp_inv = rnd_gui->shift_is_pressed(rnd_gui); csch_tool_line.x2 = chx; csch_tool_line.y2 = chy; } @@ -96,7 +96,7 @@ } /* returns 1 if the segment is valid; idx is 0 or 1 */ -static int line_get_seg(pcb_hidlib_t *hl, int idx, csch_coord_t *x1, csch_coord_t *y1, csch_coord_t *x2, csch_coord_t *y2) +static int line_get_seg(rnd_hidlib_t *hl, int idx, csch_coord_t *x1, csch_coord_t *y1, csch_coord_t *x2, csch_coord_t *y2) { csch_tool_line_dir_t tmpdir = csch_tool_line.dir; if ((tmpdir == CSCH_TOOL_LINEDIR_HV) || (tmpdir == CSCH_TOOL_LINEDIR_VH)) { @@ -138,24 +138,24 @@ return 0; } -static void line_draw_attached(pcb_hidlib_t *hl) +static void line_draw_attached(rnd_hidlib_t *hl) { csch_coord_t x1, y1, x2, y2; - pcb_hid_set_line_cap(csch_crosshair_gc, pcb_cap_round); + rnd_hid_set_line_cap(csch_crosshair_gc, rnd_cap_round); #warning TODO: set pen - pcb_hid_set_line_width(csch_crosshair_gc, 1000); + rnd_hid_set_line_width(csch_crosshair_gc, 1000); switch(csch_tool_line.clicked) { case 0: /*pcb_printf("%mm %mm\n", csch_crosshair_x, csch_crosshair_y);*/ - pcb_render->draw_line(csch_crosshair_gc, csch_crosshair_x, csch_crosshair_y, csch_crosshair_x, csch_crosshair_y); + rnd_render->draw_line(csch_crosshair_gc, csch_crosshair_x, csch_crosshair_y, csch_crosshair_x, csch_crosshair_y); break; case 1: if (line_get_seg(hl, 0, &x1, &y1, &x2, &y2)) - pcb_render->draw_line(csch_crosshair_gc, C2P(x1), C2P(y1), C2P(x2), C2P(y2)); + rnd_render->draw_line(csch_crosshair_gc, C2P(x1), C2P(y1), C2P(x2), C2P(y2)); if (line_get_seg(hl, 1, &x1, &y1, &x2, &y2)) - pcb_render->draw_line(csch_crosshair_gc, C2P(x1), C2P(y1), C2P(x2), C2P(y2)); + rnd_render->draw_line(csch_crosshair_gc, C2P(x1), C2P(y1), C2P(x2), C2P(y2)); break; } } @@ -170,7 +170,7 @@ csch_tool_line.clicked = 0; } -static void line_create_all(pcb_hidlib_t *hl, csch_cgrp_t *parent, csch_oid_t pen_oid, int wirenet) +static void line_create_all(rnd_hidlib_t *hl, csch_cgrp_t *parent, csch_oid_t pen_oid, int wirenet) { csch_sheet_t *sheet = (csch_sheet_t *)hl; int n; Index: trunk/src/plugins/std_tools/tool_arrow.c =================================================================== --- trunk/src/plugins/std_tools/tool_arrow.c (revision 1075) +++ trunk/src/plugins/std_tools/tool_arrow.c (revision 1076) @@ -33,29 +33,29 @@ { } -static void tool_arrow_press(pcb_hidlib_t *hl) +static void tool_arrow_press(rnd_hidlib_t *hl) { } -static void tool_arrow_release(pcb_hidlib_t *hl) +static void tool_arrow_release(rnd_hidlib_t *hl) { } -static void tool_arrow_adjust_attached_objects(pcb_hidlib_t *hl) +static void tool_arrow_adjust_attached_objects(rnd_hidlib_t *hl) { } -static void tool_arrow_draw_attached(pcb_hidlib_t *hl) +static void tool_arrow_draw_attached(rnd_hidlib_t *hl) { } -pcb_bool tool_arrow_undo_act(pcb_hidlib_t *hl) +rnd_bool tool_arrow_undo_act(rnd_hidlib_t *hl) { } -pcb_bool tool_arrow_redo_act(pcb_hidlib_t *hl) +rnd_bool tool_arrow_redo_act(rnd_hidlib_t *hl) { } Index: trunk/src/plugins/std_tools/tool_line.c =================================================================== --- trunk/src/plugins/std_tools/tool_line.c (revision 1075) +++ trunk/src/plugins/std_tools/tool_line.c (revision 1076) @@ -36,7 +36,7 @@ line_uninit(); } -static void tool_line_press(pcb_hidlib_t *hl) +static void tool_line_press(rnd_hidlib_t *hl) { csch_sheet_t *sheet = (csch_sheet_t *)hl; if (csch_tool_line.clicked) { @@ -50,7 +50,7 @@ } } -static void tool_line_release(pcb_hidlib_t *hl) +static void tool_line_release(rnd_hidlib_t *hl) { if (line_release(hl)) { csch_sheet_t *sheet = (csch_sheet_t *)hl; @@ -59,23 +59,23 @@ } } -static void tool_line_adjust_attached_objects(pcb_hidlib_t *hl) +static void tool_line_adjust_attached_objects(rnd_hidlib_t *hl) { line_adjust_attached_objects(hl); } -static void tool_line_draw_attached(pcb_hidlib_t *hl) +static void tool_line_draw_attached(rnd_hidlib_t *hl) { line_draw_attached(hl); } -pcb_bool tool_line_undo_act(pcb_hidlib_t *hl) +rnd_bool tool_line_undo_act(rnd_hidlib_t *hl) { } -pcb_bool tool_line_redo_act(pcb_hidlib_t *hl) +rnd_bool tool_line_redo_act(rnd_hidlib_t *hl) { } Index: trunk/src/plugins/std_tools/tool_wirenet.c =================================================================== --- trunk/src/plugins/std_tools/tool_wirenet.c (revision 1075) +++ trunk/src/plugins/std_tools/tool_wirenet.c (revision 1076) @@ -36,11 +36,11 @@ line_uninit(); } -static void tool_wirenet_press(pcb_hidlib_t *hl) +static void tool_wirenet_press(rnd_hidlib_t *hl) { } -static void tool_wirenet_release(pcb_hidlib_t *hl) +static void tool_wirenet_release(rnd_hidlib_t *hl) { if (line_release(hl)) { csch_sheet_t *sheet = (csch_sheet_t *)hl; @@ -48,23 +48,23 @@ } } -static void tool_wirenet_adjust_attached_objects(pcb_hidlib_t *hl) +static void tool_wirenet_adjust_attached_objects(rnd_hidlib_t *hl) { line_adjust_attached_objects(hl); } -static void tool_wirenet_draw_attached(pcb_hidlib_t *hl) +static void tool_wirenet_draw_attached(rnd_hidlib_t *hl) { line_draw_attached(hl); } -pcb_bool tool_wirenet_undo_act(pcb_hidlib_t *hl) +rnd_bool tool_wirenet_undo_act(rnd_hidlib_t *hl) { } -pcb_bool tool_wirenet_redo_act(pcb_hidlib_t *hl) +rnd_bool tool_wirenet_redo_act(rnd_hidlib_t *hl) { } Index: trunk/src/sch-rnd/conf_core.h =================================================================== --- trunk/src/sch-rnd/conf_core.h (revision 1075) +++ trunk/src/sch-rnd/conf_core.h (revision 1076) @@ -6,11 +6,11 @@ typedef struct { struct rc { - CFT_BOOLEAN dummy; + RND_CFT_BOOLEAN dummy; } rc; struct appearance { struct color { - CFT_COLOR attached; + RND_CFT_COLOR attached; } color; } appearance; } conf_core_t; Index: trunk/src/sch-rnd/crosshair.c =================================================================== --- trunk/src/sch-rnd/crosshair.c (revision 1075) +++ trunk/src/sch-rnd/crosshair.c (revision 1076) @@ -37,29 +37,29 @@ #include "crosshair.h" -pcb_hid_gc_t csch_crosshair_gc; +rnd_hid_gc_t csch_crosshair_gc; csch_coord_t csch_crosshair_x, csch_crosshair_y; -void pcb_hidlib_adjust_attached_objects(pcb_hidlib_t *hl) +void rnd_hidlib_adjust_attached_objects(rnd_hidlib_t *hl) { - pcb_tool_adjust_attached(hl); + rnd_tool_adjust_attached(hl); } -void *pcb_hidlib_crosshair_suspend(pcb_hidlib_t *hl) +void *rnd_hidlib_crosshair_suspend(rnd_hidlib_t *hl) { return NULL; } -void pcb_hidlib_crosshair_restore(pcb_hidlib_t *hl, void *susp_data) +void rnd_hidlib_crosshair_restore(rnd_hidlib_t *hl, void *susp_data) { } -void pcb_hidlib_crosshair_move_to(pcb_hidlib_t *hl, pcb_coord_t abs_x, pcb_coord_t abs_y, int mouse_mot) +void rnd_hidlib_crosshair_move_to(rnd_hidlib_t *hl, rnd_coord_t abs_x, rnd_coord_t abs_y, int mouse_mot) { /* grid fit */ - abs_x = pcb_grid_fit(abs_x, hl->grid, hl->grid_ox); - abs_y = pcb_grid_fit(abs_y, hl->grid, hl->grid_ox); + abs_x = rnd_grid_fit(abs_x, hl->grid, hl->grid_ox); + abs_y = rnd_grid_fit(abs_y, hl->grid, hl->grid_ox); if ((abs_x == csch_crosshair_x) && (abs_y == csch_crosshair_y)) return; /* no change, don't waste CPU */ @@ -68,45 +68,45 @@ csch_crosshair_y = abs_y; /* update the GUI, emit events */ - pcb_gui->notify_crosshair_change(pcb_gui, pcb_false); - pcb_gui->set_crosshair(pcb_gui, abs_x, abs_y, 0); - pcb_tool_adjust_attached(hl); - pcb_gui->notify_crosshair_change(pcb_gui, pcb_true); + rnd_gui->notify_crosshair_change(rnd_gui, rnd_false); + rnd_gui->set_crosshair(rnd_gui, abs_x, abs_y, 0); + rnd_tool_adjust_attached(hl); + rnd_gui->notify_crosshair_change(rnd_gui, rnd_true); } -void pcbhl_draw_marks(pcb_hidlib_t *hidlib, pcb_bool inhibit_drawing_mode) +void rnd_draw_marks(rnd_hidlib_t *hidlib, rnd_bool inhibit_drawing_mode) { } -void pcbhl_draw_attached(pcb_hidlib_t *hidlib, pcb_bool inhibit_drawing_mode) +void rnd_draw_attached(rnd_hidlib_t *hidlib, rnd_bool inhibit_drawing_mode) { - pcb_render->set_drawing_mode(pcb_render, PCB_HID_COMP_RESET, 1, NULL); - pcb_render->set_drawing_mode(pcb_render, PCB_HID_COMP_POSITIVE_XOR, 1, NULL); + rnd_render->set_drawing_mode(rnd_render, RND_HID_COMP_RESET, 1, NULL); + rnd_render->set_drawing_mode(rnd_render, RND_HID_COMP_POSITIVE_XOR, 1, NULL); - pcb_render->set_color(csch_crosshair_gc, &conf_core.appearance.color.attached); - pcb_tool_draw_attached(hidlib); + rnd_render->set_color(csch_crosshair_gc, &conf_core.appearance.color.attached); + rnd_tool_draw_attached(hidlib); - pcb_render->set_drawing_mode(pcb_render, PCB_HID_COMP_FLUSH, 1, NULL); + rnd_render->set_drawing_mode(rnd_render, RND_HID_COMP_FLUSH, 1, NULL); } -void csch_notify_crosshair_change(pcb_hidlib_t *hl, pcb_bool changes_complete) +void csch_notify_crosshair_change(rnd_hidlib_t *hl, rnd_bool changes_complete) { - if (pcb_gui->notify_crosshair_change) - pcb_gui->notify_crosshair_change(pcb_gui, changes_complete); - pcb_event(hl, PCB_EVENT_CROSSHAIR_MOVE, "i", (int)changes_complete, NULL); + if (rnd_gui->notify_crosshair_change) + rnd_gui->notify_crosshair_change(rnd_gui, changes_complete); + rnd_event(hl, RND_EVENT_CROSSHAIR_MOVE, "i", (int)changes_complete, NULL); } void csch_crosshair_gui_init(void) { - csch_crosshair_gc = pcb_hid_make_gc(); - pcb_hid_set_draw_xor(csch_crosshair_gc, 1); + csch_crosshair_gc = rnd_hid_make_gc(); + rnd_hid_set_draw_xor(csch_crosshair_gc, 1); } void csch_crosshair_gui_uninit(void) { - pcb_hid_destroy_gc(csch_crosshair_gc); + rnd_hid_destroy_gc(csch_crosshair_gc); } Index: trunk/src/sch-rnd/crosshair.h =================================================================== --- trunk/src/sch-rnd/crosshair.h (revision 1075) +++ trunk/src/sch-rnd/crosshair.h (revision 1076) @@ -6,9 +6,9 @@ #include extern csch_coord_t csch_crosshair_x, csch_crosshair_y; -extern pcb_hid_gc_t csch_crosshair_gc; +extern rnd_hid_gc_t csch_crosshair_gc; -void csch_notify_crosshair_change(pcb_hidlib_t *hl, pcb_bool changes_complete); +void csch_notify_crosshair_change(rnd_hidlib_t *hl, rnd_bool changes_complete); void csch_crosshair_gui_init(void); void csch_crosshair_gui_uninit(void); Index: trunk/src/sch-rnd/draw.c =================================================================== --- trunk/src/sch-rnd/draw.c (revision 1075) +++ trunk/src/sch-rnd/draw.c (revision 1076) @@ -35,11 +35,11 @@ #include "draw.h" #warning TODO: REMOVE -extern pcb_hidlib_t *csch_hidlib; +extern rnd_hidlib_t *csch_hidlib; typedef struct { csch_sheet_t *sheet; - pcb_hid_gc_t gc; + rnd_hid_gc_t gc; } draw_ctx_t; static csch_rtree_dir_t draw_layer_obj(void *ctx_, void *obj_, const csch_rtree_box_t *box) @@ -52,17 +52,17 @@ case CSCH_CTYPE_LINE: { csch_line_t *l = (csch_line_t *)obj; - pcb_render->set_color(ctx->gc, &pen->color); + rnd_render->set_color(ctx->gc, &pen->color); #warning TODO: set these from the pen - pcb_hid_set_line_cap(ctx->gc, pcb_cap_round); - pcb_hid_set_line_width(ctx->gc, C2P(pen->size)); - pcb_gui->draw_line(ctx->gc, C2P(l->inst.c.p1.x), C2P(l->inst.c.p1.y), C2P(l->inst.c.p2.x), C2P(l->inst.c.p2.y)); + rnd_hid_set_line_cap(ctx->gc, rnd_cap_round); + rnd_hid_set_line_width(ctx->gc, C2P(pen->size)); + rnd_gui->draw_line(ctx->gc, C2P(l->inst.c.p1.x), C2P(l->inst.c.p1.y), C2P(l->inst.c.p2.x), C2P(l->inst.c.p2.y)); } break; } } -static void draw_layer(csch_sheet_t *sheet, csch_displayer_t layer, const csch_rtree_box_t *bbox, pcb_hid_gc_t gc) +static void draw_layer(csch_sheet_t *sheet, csch_displayer_t layer, const csch_rtree_box_t *bbox, rnd_hid_gc_t gc) { draw_ctx_t ctx; @@ -71,10 +71,10 @@ csch_rtree_search_obj(&sheet->dsply[layer], bbox, draw_layer_obj, &ctx); } -void pcbhl_expose_main(pcb_hid_t *hid, const pcb_hid_expose_ctx_t *region, pcb_xform_t *xform_caller) +void rnd_expose_main(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *region, rnd_xform_t *xform_caller) { csch_sheet_t *sheet = (csch_sheet_t *)csch_hidlib; - pcb_hid_gc_t gc; + rnd_hid_gc_t gc; int n; csch_rtree_box_t bb; @@ -81,27 +81,27 @@ bb.x1 = P2C(region->view.X1); bb.y1 = P2C(region->view.Y1); bb.x2 = P2C(region->view.X2); bb.y2 = P2C(region->view.Y2); - gc = pcb_render->make_gc(pcb_gui); + gc = rnd_render->make_gc(rnd_gui); - pcb_render->render_burst(pcb_render, PCB_HID_BURST_START, ®ion->view); - pcb_render->set_drawing_mode(pcb_render, PCB_HID_COMP_RESET, 1, ®ion->view); - pcb_render->set_drawing_mode(pcb_render, PCB_HID_COMP_POSITIVE, 1, ®ion->view); + rnd_render->render_burst(rnd_render, RND_HID_BURST_START, ®ion->view); + rnd_render->set_drawing_mode(rnd_render, RND_HID_COMP_RESET, 1, ®ion->view); + rnd_render->set_drawing_mode(rnd_render, RND_HID_COMP_POSITIVE, 1, ®ion->view); for(n = 0; n < CSCH_DSPLY_max; n++) if (csch_layer_vis[n]) draw_layer(sheet, n, &bb, gc); - pcb_render->set_drawing_mode(pcb_render, PCB_HID_COMP_FLUSH, 1, ®ion->view); - pcb_render->render_burst(pcb_render, PCB_HID_BURST_END, ®ion->view); - pcb_render->destroy_gc(gc); + rnd_render->set_drawing_mode(rnd_render, RND_HID_COMP_FLUSH, 1, ®ion->view); + rnd_render->render_burst(rnd_render, RND_HID_BURST_END, ®ion->view); + rnd_render->destroy_gc(gc); } -void pcbhl_expose_preview(pcb_hid_t *hid, const pcb_hid_expose_ctx_t *e) +void rnd_expose_preview(rnd_hid_t *hid, const rnd_hid_expose_ctx_t *e) { } -void sch_rnd_redraw(pcb_hidlib_t *target) +void sch_rnd_redraw(rnd_hidlib_t *target) { if ((target == NULL) || (target == csch_hidlib)) - pcb_gui->invalidate_all(pcb_gui); + rnd_gui->invalidate_all(rnd_gui); } Index: trunk/src/sch-rnd/draw.h =================================================================== --- trunk/src/sch-rnd/draw.h (revision 1075) +++ trunk/src/sch-rnd/draw.h (revision 1076) @@ -3,5 +3,5 @@ #define P2C(coord) ((coord) >> 10) /* redraw the entire screen */ -void sch_rnd_redraw(pcb_hidlib_t *target); +void sch_rnd_redraw(rnd_hidlib_t *target); Index: trunk/src/sch-rnd/sch-rnd.c =================================================================== --- trunk/src/sch-rnd/sch-rnd.c (revision 1075) +++ trunk/src/sch-rnd/sch-rnd.c (revision 1076) @@ -64,34 +64,34 @@ #warning TODO: REMOVE -pcb_hidlib_t *csch_hidlib; +rnd_hidlib_t *csch_hidlib; static const char *EXPERIMENTAL = "The code is in alpha testing state yet."; -const char *pcb_hidlib_default_embedded_menu = ""; +const char *rnd_hidlib_default_embedded_menu = ""; const char *pcb_conf_internal = ""; -const char *pcbhl_menu_file_paths[] = { "./", "~/.sch-rnd/", NULL }; -const char *pcbhl_menu_name_fmt = "sch-rnd-menu.lht"; +const char *rnd_menu_file_paths[] = { "./", "~/.sch-rnd/", NULL }; +const char *rnd_menu_name_fmt = "sch-rnd-menu.lht"; #define SCH_RND_VERSION "0.1.0" #define SCHSHAREDIR "/usr/share/sch-rnd" #define CONF_USER_DIR "~/.sch-rnd" -const char *pcbhl_conf_userdir_path = CONF_USER_DIR; -const char *pcphl_conf_user_path = CONF_USER_DIR "/sch-rnd-conf.lht"; +const char *rnd_conf_userdir_path = CONF_USER_DIR; +const char *rnd_pcphl_conf_user_path = CONF_USER_DIR "/sch-rnd-conf.lht"; #if 0 -const char *pcbhl_conf_sysdir_path = SCHSHAREDIR; -const char *pcbhl_conf_sys_path = SCHSHAREDIR "/sch-rnd-conf.lht"; +const char *rnd_conf_sysdir_path = SCHSHAREDIR; +const char *rnd_conf_sys_path = SCHSHAREDIR "/sch-rnd-conf.lht"; #else TODO("fix conf") /* temporary hack for running from ./ without internal version of the conf */ -const char *pcbhl_conf_sysdir_path = "./"; -const char *pcbhl_conf_sys_path = "./sch-rnd-conf.lht"; +const char *rnd_conf_sysdir_path = "./"; +const char *rnd_conf_sys_path = "./sch-rnd-conf.lht"; #endif -const char *pcbhl_app_package = "sch-rnd"; -const char *pcbhl_app_version = SCH_RND_VERSION; -const char *pcbhl_app_url = "http://repo.hu/projects/cschem"; +const char *rnd_app_package = "sch-rnd"; +const char *rnd_app_version = SCH_RND_VERSION; +const char *rnd_app_url = "http://repo.hu/projects/cschem"; void pcb_tool_gui_init(void) { @@ -107,13 +107,13 @@ static const char *plugin_name = "sch_dialogs"; int state = 0; loaded = 1; - pcb_message(PCB_MSG_DEBUG, "Loading GUI support plugin: '%s'\n", plugin_name); - puphand = pup_load(&pcb_pup, (const char **)pcb_pup_paths, plugin_name, 0, &state); + rnd_message(RND_MSG_DEBUG, "Loading GUI support plugin: '%s'\n", plugin_name); + puphand = pup_load(&rnd_pup, (const char **)rnd_pup_paths, plugin_name, 0, &state); if (puphand == NULL) - pcb_message(PCB_MSG_ERROR, "Error: failed to load GUI support plugin '%s'\n-> expect missing widgets and dialog boxes\n", plugin_name); + rnd_message(RND_MSG_ERROR, "Error: failed to load GUI support plugin '%s'\n-> expect missing widgets and dialog boxes\n", plugin_name); } if (!load && loaded && (puphand != NULL)) { - pup_unload(&pcb_pup, puphand, NULL); + pup_unload(&rnd_pup, puphand, NULL); loaded = 0; puphand = NULL; } @@ -149,7 +149,7 @@ res |= csch_compile_project(prj, &abs, 0); if (dump_abs) { - FILE *f = pcb_fopen(NULL, "ABS.txt", "w"); + FILE *f = rnd_fopen(NULL, "ABS.txt", "w"); csch_abstract_dump(&abs, f, ""); fclose(f); } @@ -190,15 +190,15 @@ { int n, res = 0, dump_abs = 0; const char *fmt = NULL, *exp_fmt = NULL; - pcbhl_main_args_t ga; + rnd_main_args_t ga; csch_sheet_t *def_sheet = NULL; - pcb_fix_locale_and_env(); + rnd_fix_locale_and_env(); csch_init(); - pcbhl_main_args_init(&ga, argc, sch_rnd_action_args); - pcb_hidlib_init1(conf_core_init); + rnd_main_args_init(&ga, argc, sch_rnd_action_args); + rnd_hidlib_init1(conf_core_init); csch_event_init_app(); for(n = 1; n < argc; n++) { char *cmd = argv[n], *arg = argv[n+1]; @@ -216,18 +216,18 @@ case 'f': fmt = arg; n++; continue; } } - n += pcbhl_main_args_add(&ga, argv[n], argv[n+1]); + n += rnd_main_args_add(&ga, argv[n], argv[n+1]); } - pcb_hidlib_init2(pup_buildins, sch_rnd_buildins); + rnd_hidlib_init2(pup_buildins, sch_rnd_buildins); gui_act_init(); sch_rnd_main_init(); - pcb_conf_set(CFR_CLI, "editor/view/flip_y", 0, "1", POL_OVERWRITE); + rnd_conf_set(RND_CFR_CLI, "editor/view/flip_y", 0, "1", RND_POL_OVERWRITE); - if (pcbhl_main_args_setup1(&ga) != 0) { + if (rnd_main_args_setup1(&ga) != 0) { sch_rnd_main_uninit(); - pcbhl_main_args_uninit(&ga); + rnd_main_args_uninit(&ga); exit(1); } @@ -236,9 +236,9 @@ TODO("action list"); /*#include "generated_lists.h"*/ - if (pcbhl_main_args_setup2(&ga, &res) != 0) { + if (rnd_main_args_setup2(&ga, &res) != 0) { sch_rnd_main_uninit(); - pcbhl_main_args_uninit(&ga); + rnd_main_args_uninit(&ga); exit(res); } @@ -248,7 +248,7 @@ prj = csch_load_project_by_sheet_name(fn); if (csch_project_load_sheet(prj, fn, fmt, &def_sheet) != 0) { csch_message(CSCH_MSG_ERROR, "Can not load file '%s' (specified on command line) for exporting or printing\n", fn); - pcbhl_log_print_uninit_errs("Export load error"); + rnd_log_print_uninit_errs("Export load error"); exit(1); } TODO("remove this:"); @@ -266,9 +266,9 @@ return 1; } - if (pcbhl_main_exported(&ga, &def_sheet->hidlib, 0)) { + if (rnd_main_exported(&ga, &def_sheet->hidlib, 0)) { sch_rnd_main_uninit(); - pcbhl_main_args_uninit(&ga); + rnd_main_args_uninit(&ga); exit(0); } @@ -280,10 +280,10 @@ csch_crosshair_gui_init(); - pcb_event(&def_sheet->hidlib, PCB_EVENT_BOARD_CHANGED, "i", 0); + rnd_event(&def_sheet->hidlib, RND_EVENT_BOARD_CHANGED, "i", 0); /* main loop */ - if (PCB_HAVE_GUI_ATTR_DLG) + if (RND_HAVE_GUI_ATTR_DLG) gui_support_plugins(1); if (EXPERIMENTAL != NULL) { csch_message(CSCH_MSG_ERROR, "******************************** IMPORTANT ********************************\n"); @@ -294,11 +294,11 @@ } csch_hidlib = &def_sheet->hidlib; - pcbhl_mainloop_interactive(&ga, &def_sheet->hidlib); + rnd_mainloop_interactive(&ga, &def_sheet->hidlib); csch_crosshair_gui_uninit(); sch_rnd_main_uninit(); - pcbhl_main_args_uninit(&ga); + rnd_main_args_uninit(&ga); return res; }