Index: trunk/doc/conf/tree/editor.html =================================================================== --- trunk/doc/conf/tree/editor.html (revision 31001) +++ trunk/doc/conf/tree/editor.html (revision 31002) @@ -58,6 +58,6 @@ draw_grid rnd_cfn_boolean 0 [hidlib] draw grid points auto_place rnd_cfn_boolean 0 [hidlib] force placement of GUI windows (dialogs), trying to override the window manager fullscreen rnd_cfn_boolean 0 [hidlib] hide widgets to make more room for the drawing - crosshair_shape_idx rnd_cfn_integer 0 [hidlib] crosshair shape as defined in pcb_crosshair_shape_e + crosshair_shape_idx rnd_cfn_integer 0 [hidlib] crosshair shape as defined in rnd_crosshair_shape_e enable_stroke rnd_cfn_boolean 0 [hidlib] Enable libstroke gestures on middle mouse button when non-zero Index: trunk/src/board.c =================================================================== --- trunk/src/board.c (revision 31001) +++ trunk/src/board.c (revision 31002) @@ -91,7 +91,7 @@ ptr->RatDraw = pcb_false; /* NOTE: we used to set all the pcb flags on ptr here, but we don't need to do that anymore due to the new conf system */ - ptr->hidlib.grid = pcbhl_conf.editor.grid; + ptr->hidlib.grid = rnd_conf.editor.grid; ptr->hidlib.size_y = ptr->hidlib.size_x = PCB_MM_TO_COORD(20); /* should be overriden by the default design */ ptr->ID = pcb_create_ID_get(); Index: trunk/src/board.h =================================================================== --- trunk/src/board.h (revision 31001) +++ trunk/src/board.h (revision 31002) @@ -121,11 +121,11 @@ void pcb_board_count_holes(pcb_board_t *pcb, int *plated, int *unplated, const rnd_rnd_box_t *within_area); void pcb_board_count_slots(pcb_board_t *pcb, int *plated, int *unplated, const rnd_rnd_box_t *within_area); -#define PCB_SWAP_X(x) (PCB_SWAP_SIGN_X(x)) -#define PCB_SWAP_Y(y) (PCB->hidlib.size_y +PCB_SWAP_SIGN_Y(y)) +#define PCB_SWAP_X(x) (RND_SWAP_SIGN_X(x)) +#define PCB_SWAP_Y(y) (PCB->hidlib.size_y +RND_SWAP_SIGN_Y(y)) -#define PCB_CSWAP_X(x, w, cond) ((cond) ? (PCB_SWAP_SIGN_X(x)) : (x)) -#define PCB_CSWAP_Y(y, h, cond) ((cond) ? (h+PCB_SWAP_SIGN_Y(y)) : (y)) +#define PCB_CSWAP_X(x, w, cond) ((cond) ? (RND_SWAP_SIGN_X(x)) : (x)) +#define PCB_CSWAP_Y(y, h, cond) ((cond) ? (h+RND_SWAP_SIGN_Y(y)) : (y)) /* Conditionally allow subc parts to be reached directly in search masks */ #define PCB_LOOSE_SUBC(pcb) ((pcb)->loose_subc ? PCB_OBJ_SUBC_PART : 0) Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 31001) +++ trunk/src/crosshair.c (revision 31002) @@ -146,14 +146,14 @@ arc.X = pcb_crosshair.AttachedBox.Point1.X; arc.Y = pcb_crosshair.AttachedBox.Point1.Y; if (PCB_XOR(pcb_crosshair.AttachedBox.otherway, coord_abs(wy) > coord_abs(wx))) { - arc.X = pcb_crosshair.AttachedBox.Point1.X + coord_abs(wy) * PCB_SGNZ(wx); + arc.X = pcb_crosshair.AttachedBox.Point1.X + coord_abs(wy) * RND_SGNZ(wx); sa = (wx >= 0) ? 0 : 180; - dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? 90 : -90; + dir = (RND_SGNZ(wx) == RND_SGNZ(wy)) ? 90 : -90; } else { - arc.Y = pcb_crosshair.AttachedBox.Point1.Y + coord_abs(wx) * PCB_SGNZ(wy); + arc.Y = pcb_crosshair.AttachedBox.Point1.Y + coord_abs(wx) * RND_SGNZ(wy); sa = (wy >= 0) ? -90 : 90; - dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? -90 : 90; + dir = (RND_SGNZ(wx) == RND_SGNZ(wy)) ? -90 : 90; wy = wx; } wy = coord_abs(wy); @@ -605,10 +605,10 @@ pcb_arc_t *arc = (pcb_arc_t *) box; rnd_coord_t p1x, p1y, p2x, p2y; - p1x = arc->X - arc->Width * cos(PCB_TO_RADIANS(arc->StartAngle)); - p1y = arc->Y + arc->Height * sin(PCB_TO_RADIANS(arc->StartAngle)); - p2x = arc->X - arc->Width * cos(PCB_TO_RADIANS(arc->StartAngle + arc->Delta)); - p2y = arc->Y + arc->Height * sin(PCB_TO_RADIANS(arc->StartAngle + arc->Delta)); + p1x = arc->X - arc->Width * cos(RND_TO_RADIANS(arc->StartAngle)); + p1y = arc->Y + arc->Height * sin(RND_TO_RADIANS(arc->StartAngle)); + p2x = arc->X - arc->Width * cos(RND_TO_RADIANS(arc->StartAngle + arc->Delta)); + p2y = arc->Y + arc->Height * sin(RND_TO_RADIANS(arc->StartAngle + arc->Delta)); /* printf("p1=%ld;%ld p2=%ld;%ld info=%ld;%ld\n", p1x, p1y, p2x, p2y, info->X, info->Y); */ @@ -753,7 +753,7 @@ double sq_dist; /* avoid snapping to an object if it is in the same subc */ - if ((snapo != NULL) && (pcbhl_conf.editor.mode == pcb_crosshair.tool_move) && (pcb_crosshair.AttachedObject.Type == PCB_OBJ_SUBC)) { + if ((snapo != NULL) && (rnd_conf.editor.mode == pcb_crosshair.tool_move) && (pcb_crosshair.AttachedObject.Type == PCB_OBJ_SUBC)) { pcb_any_obj_t *parent = (pcb_any_obj_t *)pcb_obj_parent_subc(snapo); int n; rnd_cardinal_t parent_id = snapo->ID; @@ -780,8 +780,8 @@ * the same layer), and when moving a line end-point * (but don't snap to the same line) */ - if ((pcbhl_conf.editor.mode == pcb_crosshair.tool_line && PCB_CURRLAYER(pcb) == layer) || - (pcbhl_conf.editor.mode == pcb_crosshair.tool_move + if ((rnd_conf.editor.mode == pcb_crosshair.tool_line && PCB_CURRLAYER(pcb) == layer) || + (rnd_conf.editor.mode == pcb_crosshair.tool_move && pcb_crosshair.AttachedObject.Type == PCB_OBJ_LINE_POINT && pcb_crosshair.AttachedObject.Ptr1 == layer && pcb_crosshair.AttachedObject.Ptr2 != line)) @@ -874,8 +874,8 @@ struct snap_data snap_data; int ans; - PCB->hidlib.ch_x = pcb_crosshair.X = PCB_CLAMP(X, -PCB->hidlib.size_x/2, PCB->hidlib.size_x*3/2); - PCB->hidlib.ch_y = pcb_crosshair.Y = PCB_CLAMP(Y, -PCB->hidlib.size_y/2, PCB->hidlib.size_y*3/2); + PCB->hidlib.ch_x = pcb_crosshair.X = RND_CLAMP(X, -PCB->hidlib.size_x/2, PCB->hidlib.size_x*3/2); + PCB->hidlib.ch_y = pcb_crosshair.Y = RND_CLAMP(Y, -PCB->hidlib.size_y/2, PCB->hidlib.size_y*3/2); nearest_grid_x = rnd_grid_fit(pcb_crosshair.X, PCB->hidlib.grid, PCB->hidlib.grid_ox); nearest_grid_y = rnd_grid_fit(pcb_crosshair.Y, PCB->hidlib.grid, PCB->hidlib.grid_oy); @@ -883,7 +883,7 @@ if (pcb_marked.status && conf_core.editor.orthogonal_moves) { rnd_coord_t dx = pcb_crosshair.X - hidlib->tool_grabbed.X; rnd_coord_t dy = pcb_crosshair.Y - hidlib->tool_grabbed.Y; - if (PCB_ABS(dx) > PCB_ABS(dy)) + if (RND_ABS(dx) > RND_ABS(dy)) nearest_grid_y = hidlib->tool_grabbed.Y; else nearest_grid_x = hidlib->tool_grabbed.X; @@ -912,7 +912,7 @@ ans = pcb_search_grid_slop(pcb_crosshair.X, pcb_crosshair.Y, PCB_OBJ_PSTK | PCB_OBJ_SUBC_PART, &ptr1, &ptr2, &ptr3); /* Avoid snapping padstack to any other padstack */ - if (pcbhl_conf.editor.mode == pcb_crosshair.tool_move && pcb_crosshair.AttachedObject.Type == PCB_OBJ_PSTK && (ans & PCB_OBJ_PSTK)) + if (rnd_conf.editor.mode == pcb_crosshair.tool_move && pcb_crosshair.AttachedObject.Type == PCB_OBJ_PSTK && (ans & PCB_OBJ_PSTK)) ans = PCB_OBJ_VOID; if (ans != PCB_OBJ_VOID) { @@ -983,7 +983,7 @@ if (conf_core.editor.highlight_on_point) onpoint_work(&pcb_crosshair, pcb_crosshair.X, pcb_crosshair.Y); - if (pcbhl_conf.editor.mode == pcb_crosshair.tool_arrow) { + if (rnd_conf.editor.mode == pcb_crosshair.tool_arrow) { ans = pcb_search_grid_slop(pcb_crosshair.X, pcb_crosshair.Y, PCB_OBJ_LINE_POINT, &ptr1, &ptr2, &ptr3); if (ans == PCB_OBJ_VOID) { if ((rnd_gui != NULL) && (rnd_gui->point_cursor != NULL)) @@ -995,7 +995,7 @@ } } - if (pcbhl_conf.editor.mode == pcb_crosshair.tool_line && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST && conf_core.editor.auto_drc) + if (rnd_conf.editor.mode == pcb_crosshair.tool_line && pcb_crosshair.AttachedLine.State != PCB_CH_STATE_FIRST && conf_core.editor.auto_drc) pcb_line_enforce_drc(PCB); rnd_gui->set_crosshair(rnd_gui, pcb_crosshair.X, pcb_crosshair.Y, HID_SC_DO_NOTHING); @@ -1056,7 +1056,7 @@ { pcb_crosshair.GC = rnd_hid_make_gc(); - rnd_render->set_color(pcb_crosshair.GC, &pcbhl_conf.appearance.color.cross); + rnd_render->set_color(pcb_crosshair.GC, &rnd_conf.appearance.color.cross); rnd_hid_set_draw_xor(pcb_crosshair.GC, 1); rnd_hid_set_line_cap(pcb_crosshair.GC, rnd_cap_round); rnd_hid_set_line_width(pcb_crosshair.GC, 1); Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 31001) +++ trunk/src/draw.c (revision 31002) @@ -110,7 +110,7 @@ { /* TODO: we need a real geo lib... using double here is plain wrong */ double dx = x2-x1, dy = y2-y1; - double len_mnt = PCB_ABS(dx) + PCB_ABS(dy); + double len_mnt = RND_ABS(dx) + RND_ABS(dy); int n; rnd_coord_t minlen = rnd_render->coord_per_pix * 8; @@ -1212,8 +1212,8 @@ /* vert flip magic: make sure the offset is in-line with the flip and our sick y coords for vertical */ #define PCB_TERM_LABEL_SETUP(label) \ - rnd_bool flip_x = pcbhl_conf.editor.view.flip_x; \ - rnd_bool flip_y = pcbhl_conf.editor.view.flip_y; \ + rnd_bool flip_x = rnd_conf.editor.view.flip_x; \ + rnd_bool flip_y = rnd_conf.editor.view.flip_y; \ pcb_font_t *font = pcb_font(PCB, 0, 0); \ rnd_coord_t w, h, dx, dy; \ if (vert) { \ @@ -1261,8 +1261,8 @@ rnd_rnd_box_t b; PCB_TERM_LABEL_SETUP((const unsigned char *)label); - dx = PCB_ABS(dx); - dy = PCB_ABS(dy); + dx = RND_ABS(dx); + dy = RND_ABS(dy); b.X1 = ox - dx - margin; b.X2 = ox + dx + margin; b.Y1 = oy - dy - margin; Index: trunk/src/draw_wireframe.h =================================================================== --- trunk/src/draw_wireframe.h (revision 31001) +++ trunk/src/draw_wireframe.h (revision 31002) @@ -63,7 +63,7 @@ if((x1 != x2) || (y1 != y2)) { double dx = x2 - x1; double dy = y2 - y1; - double h = 0.5 * thick / sqrt(PCB_SQUARE(dx) + PCB_SQUARE(dy)); + double h = 0.5 * thick / sqrt(RND_SQUARE(dx) + RND_SQUARE(dy)); rnd_coord_t ox = dy * h + 0.5 * SGN(dy); rnd_coord_t oy = -(dx * h + 0.5 * SGN(dx)); if (square) { Index: trunk/src/drc.c =================================================================== --- trunk/src/drc.c (revision 31001) +++ trunk/src/drc.c (revision 31002) @@ -96,12 +96,12 @@ for(v = pcb_view_list_first(lst); v != NULL; v = pcb_view_list_next(v)) { printf("%ld: %s: %s\n", v->uid, v->type, v->title); if (v->have_bbox) - pcb_printf("%m+within %$m4\n", pcbhl_conf.editor.grid_unit->allow, v->bbox.X1, v->bbox.Y1, v->bbox.X2, v->bbox.Y2); + pcb_printf("%m+within %$m4\n", rnd_conf.editor.grid_unit->allow, v->bbox.X1, v->bbox.Y1, v->bbox.X2, v->bbox.Y2); if (v->have_xy) - pcb_printf("%m+at %$m2\n", pcbhl_conf.editor.grid_unit->allow, v->x, v->y); - pcb_printf("%m+required value %$mS\n", pcbhl_conf.editor.grid_unit->allow, v->data.drc.required_value); + pcb_printf("%m+at %$m2\n", rnd_conf.editor.grid_unit->allow, v->x, v->y); + pcb_printf("%m+required value %$mS\n", rnd_conf.editor.grid_unit->allow, v->data.drc.required_value); if (v->data.drc.have_measured) - pcb_printf("%m+measured value %$mS\n", pcbhl_conf.editor.grid_unit->allow, v->data.drc.measured_value); + pcb_printf("%m+measured value %$mS\n", rnd_conf.editor.grid_unit->allow, v->data.drc.measured_value); printf("%s\n\n", v->description); } } @@ -110,12 +110,12 @@ for(v = pcb_view_list_first(lst); v != NULL; v = pcb_view_list_next(v)) { rnd_message(RND_MSG_INFO, "%ld: %s: %s\n", v->uid, v->type, v->title); if (v->have_bbox) - rnd_message(RND_MSG_INFO, "%m+within %$m4\n", pcbhl_conf.editor.grid_unit->allow, v->bbox.X1, v->bbox.Y1, v->bbox.X2, v->bbox.Y2); + rnd_message(RND_MSG_INFO, "%m+within %$m4\n", rnd_conf.editor.grid_unit->allow, v->bbox.X1, v->bbox.Y1, v->bbox.X2, v->bbox.Y2); if (v->have_xy) - rnd_message(RND_MSG_INFO, "%m+at %$m2\n", pcbhl_conf.editor.grid_unit->allow, v->x, v->y); - pcb_printf("%m+required value %$mS\n", pcbhl_conf.editor.grid_unit->allow, v->data.drc.required_value); + rnd_message(RND_MSG_INFO, "%m+at %$m2\n", rnd_conf.editor.grid_unit->allow, v->x, v->y); + pcb_printf("%m+required value %$mS\n", rnd_conf.editor.grid_unit->allow, v->data.drc.required_value); if (v->data.drc.have_measured) - rnd_message(RND_MSG_INFO, "%m+measured value %$mS\n", pcbhl_conf.editor.grid_unit->allow, v->data.drc.measured_value); + rnd_message(RND_MSG_INFO, "%m+measured value %$mS\n", rnd_conf.editor.grid_unit->allow, v->data.drc.measured_value); rnd_message(RND_MSG_INFO, "%s\n\n", v->description); } } @@ -176,7 +176,7 @@ rnd_PCB_ACT_MAY_CONVARG(2, FGW_STR, IOIncompatList, aauto = argv[2].val.str); if ((aauto != NULL) && (strcmp(aauto, "auto") == 0)) { - if (pcbhl_conf.rc.quiet && !RND_HAVE_GUI_ATTR_DLG) { + if (rnd_conf.rc.quiet && !RND_HAVE_GUI_ATTR_DLG) { /* if not explicitly asked for a listing style and we are on CLI and quiet is set, don't print anything */ RND_ACT_IRES(0); return 0; Index: trunk/src/find_geo.c =================================================================== --- trunk/src/find_geo.c (revision 31001) +++ trunk/src/find_geo.c (revision 31002) @@ -107,7 +107,7 @@ static int radius_crosses_arc(double x, double y, pcb_arc_t *arc) { - double alpha = atan2(y - arc->Y, -x + arc->X) * PCB_RAD_TO_DEG; + double alpha = atan2(y - arc->Y, -x + arc->X) * RND_RAD_TO_DEG; rnd_angle_t sa = arc->StartAngle, d = arc->Delta; normalize_angles(&sa, &d); @@ -120,10 +120,10 @@ static void get_arc_ends(rnd_coord_t * box, pcb_arc_t *arc) { - box[0] = arc->X - arc->Width * cos(PCB_M180 * arc->StartAngle); - box[1] = arc->Y + arc->Height * sin(PCB_M180 * arc->StartAngle); - box[2] = arc->X - arc->Width * cos(PCB_M180 * (arc->StartAngle + arc->Delta)); - box[3] = arc->Y + arc->Height * sin(PCB_M180 * (arc->StartAngle + arc->Delta)); + box[0] = arc->X - arc->Width * cos(RND_M180 * arc->StartAngle); + box[1] = arc->Y + arc->Height * sin(RND_M180 * arc->StartAngle); + box[2] = arc->X - arc->Width * cos(RND_M180 * (arc->StartAngle + arc->Delta)); + box[3] = arc->Y + arc->Height * sin(RND_M180 * (arc->StartAngle + arc->Delta)); } /* --------------------------------------------------------------------------- @@ -847,7 +847,7 @@ dx = x2 - x1; dy = y2 - y1; - l = sqrt(PCB_SQUARE(dx) + PCB_SQUARE(dy)); + l = sqrt(RND_SQUARE(dx) + RND_SQUARE(dy)); h = 0.5 * thick / l; ox = dy * h + 0.5 * SGN(dy); oy = -(dx * h + 0.5 * SGN(dx)); Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 31001) +++ trunk/src/gui_act.c (revision 31002) @@ -80,20 +80,20 @@ static const char pcb_acth_Display[] = "Several display-related actions."; /* DOC: display.html */ -static enum pcb_crosshair_shape_e CrosshairShapeIncrement(enum pcb_crosshair_shape_e shape) +static enum rnd_crosshair_shape_e CrosshairShapeIncrement(enum rnd_crosshair_shape_e shape) { switch (shape) { - case pcb_ch_shape_basic: - shape = pcb_ch_shape_union_jack; + case rnd_ch_shape_basic: + shape = rnd_ch_shape_union_jack; break; - case pcb_ch_shape_union_jack: - shape = pcb_ch_shape_dozen; + case rnd_ch_shape_union_jack: + shape = rnd_ch_shape_dozen; break; - case pcb_ch_shape_dozen: - shape = pcb_ch_shape_NUM; + case rnd_ch_shape_dozen: + shape = rnd_ch_shape_NUM; break; - case pcb_ch_shape_NUM: - shape = pcb_ch_shape_basic; + case rnd_ch_shape_NUM: + shape = rnd_ch_shape_basic; break; } return shape; @@ -162,8 +162,8 @@ case F_CycleCrosshair: rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, pcb_false); - rnd_conf_setf(RND_CFR_CLI, "editor/crosshair_shape_idx", 0, "%d", CrosshairShapeIncrement(pcbhl_conf.editor.crosshair_shape_idx)); - if (pcb_ch_shape_NUM == pcbhl_conf.editor.crosshair_shape_idx) + rnd_conf_setf(RND_CFR_CLI, "editor/crosshair_shape_idx", 0, "%d", CrosshairShapeIncrement(rnd_conf.editor.crosshair_shape_idx)); + if (rnd_ch_shape_NUM == rnd_conf.editor.crosshair_shape_idx) rnd_conf_set(RND_CFR_CLI, "editor/crosshair_shape_idx", 0, "0", RND_POL_OVERWRITE); rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, pcb_true); break; @@ -246,7 +246,7 @@ case F_ToggleAutoDRC: rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, pcb_false); rnd_conf_toggle_editor(auto_drc); - if (conf_core.editor.auto_drc && pcbhl_conf.editor.mode == pcb_crosshair.tool_line) { + if (conf_core.editor.auto_drc && rnd_conf.editor.mode == pcb_crosshair.tool_line) { if (pcb_data_clear_flag(PCB->Data, PCB_FLAG_FOUND, 1, 1) > 0) { pcb_undo_inc_serial(); pcb_draw(); @@ -293,7 +293,7 @@ RND_ACT_HIDLIB->grid = 1; if (pcb_crosshair_move_absolute(pcb_crosshair.X, pcb_crosshair.Y)) rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, pcb_true); /* first notify was in MoveCrosshairAbs */ - pcb_hidlib_set_grid(RND_ACT_HIDLIB, oldGrid, pcb_true, pcb_crosshair.X, pcb_crosshair.Y); + rnd_hidlib_set_grid(RND_ACT_HIDLIB, oldGrid, pcb_true, pcb_crosshair.X, pcb_crosshair.Y); rnd_grid_inval(); } break; @@ -365,7 +365,7 @@ } RND_ACT_HIDLIB->grid_ox = pcb_get_value(argv[2].val.str, NULL, NULL, NULL); RND_ACT_HIDLIB->grid_oy = pcb_get_value(argv[3].val.str, NULL, NULL, NULL); - if (pcbhl_conf.editor.draw_grid) + if (rnd_conf.editor.draw_grid) rnd_hid_redraw(PCB); } break; @@ -591,7 +591,7 @@ rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, pcb_false); set_same_(((pcb_line_t *) ptr2)->Thickness, -1, -1, ((pcb_line_t *) ptr2)->Clearance / 2, NULL); layer = (pcb_layer_t *) ptr1; - if (pcbhl_conf.editor.mode != pcb_crosshair.tool_line) + if (rnd_conf.editor.mode != pcb_crosshair.tool_line) pcb_tool_select_by_name(RND_ACT_HIDLIB, "line"); rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, pcb_true); rnd_event(RND_ACT_HIDLIB, PCB_EVENT_ROUTE_STYLES_CHANGED, NULL); @@ -601,7 +601,7 @@ rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, pcb_false); set_same_(((pcb_arc_t *) ptr2)->Thickness, -1, -1, ((pcb_arc_t *) ptr2)->Clearance / 2, NULL); layer = (pcb_layer_t *) ptr1; - if (pcbhl_conf.editor.mode != pcb_crosshair.tool_arc) + if (rnd_conf.editor.mode != pcb_crosshair.tool_arc) pcb_tool_select_by_name(RND_ACT_HIDLIB, "arc"); rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, pcb_true); rnd_event(RND_ACT_HIDLIB, PCB_EVENT_ROUTE_STYLES_CHANGED, NULL); Index: trunk/src/insert.c =================================================================== --- trunk/src/insert.c (revision 31001) +++ trunk/src/insert.c (revision 31002) @@ -119,10 +119,10 @@ else { m = (double) (pcb_crosshair.Y - line->Point1.Y) / (pcb_crosshair.X - line->Point1.X); m1 = 0; - if (m > PCB_TAN_30_DEGREE) - m1 = (m > PCB_TAN_60_DEGREE) ? 2 : 1; - else if (m < -PCB_TAN_30_DEGREE) - m1 = (m < -PCB_TAN_60_DEGREE) ? 2 : -1; + if (m > RND_TAN_30_DEGREE) + m1 = (m > RND_TAN_60_DEGREE) ? 2 : 1; + else if (m < -RND_TAN_30_DEGREE) + m1 = (m < -RND_TAN_60_DEGREE) ? 2 : -1; } if (pcb_crosshair.X == line->Point2.X) m2 = 2; /* 2 signals infinite slope */ @@ -129,10 +129,10 @@ else { m = (double) (pcb_crosshair.Y - line->Point2.Y) / (pcb_crosshair.X - line->Point2.X); m2 = 0; - if (m > PCB_TAN_30_DEGREE) - m2 = (m > PCB_TAN_60_DEGREE) ? 2 : 1; - else if (m < -PCB_TAN_30_DEGREE) - m2 = (m < -PCB_TAN_60_DEGREE) ? 2 : -1; + if (m > RND_TAN_30_DEGREE) + m2 = (m > RND_TAN_60_DEGREE) ? 2 : 1; + else if (m < -RND_TAN_30_DEGREE) + m2 = (m < -RND_TAN_60_DEGREE) ? 2 : -1; } if (m1 == m2) { InsertedPoint.X = line->Point1.X; Index: trunk/src/librnd/core/actions.c =================================================================== --- trunk/src/librnd/core/actions.c (revision 31001) +++ trunk/src/librnd/core/actions.c (revision 31002) @@ -287,7 +287,7 @@ const rnd_action_t *old_action; hid_cookie_action_t *ca = f->reg_data; - if (pcbhl_conf.rc.verbose) { + if (rnd_conf.rc.verbose) { fprintf(stderr, "Action: \033[34m%s(", f->name); for (i = 0; i < argc; i++) fprintf(stderr, "%s%s", i ? "," : "", (argv[i].type & FGW_STR) == FGW_STR ? argv[i].val.str : ""); @@ -529,12 +529,12 @@ static char prompt[128]; int blen, slen, len; - if ((pcbhl_conf.rc.cli_prompt != NULL) && (*pcbhl_conf.rc.cli_prompt != '\0')) - base = pcbhl_conf.rc.cli_prompt; - else if ((pcbhl_conf.rc.cli_backend == NULL) || (*pcbhl_conf.rc.cli_backend == '\0')) + if ((rnd_conf.rc.cli_prompt != NULL) && (*rnd_conf.rc.cli_prompt != '\0')) + base = rnd_conf.rc.cli_prompt; + else if ((rnd_conf.rc.cli_backend == NULL) || (*rnd_conf.rc.cli_backend == '\0')) base = "action"; else - base = pcbhl_conf.rc.cli_backend; + base = rnd_conf.rc.cli_backend; if ((suffix == NULL) || (*suffix == '\0')) return base; @@ -570,8 +570,8 @@ int rnd_cli_enter(const char *backend, const char *prompt) { - cli_push(pcbhl_conf.rc.cli_backend); - cli_push(pcbhl_conf.rc.cli_prompt); + cli_push(rnd_conf.rc.cli_backend); + cli_push(rnd_conf.rc.cli_prompt); if (rnd_conf_set(RND_CFR_CLI, "rc/cli_backend", 0, backend, RND_POL_OVERWRITE) != 0) return -1; @@ -602,11 +602,11 @@ fgw_func_t *f; /* no backend: let the original action work */ - if ((pcbhl_conf.rc.cli_backend == NULL) || (*pcbhl_conf.rc.cli_backend == '\0')) + if ((rnd_conf.rc.cli_backend == NULL) || (*rnd_conf.rc.cli_backend == '\0')) return -1; /* backend: let the backend action handle it */ - a = rnd_find_action(pcbhl_conf.rc.cli_backend, &f); + a = rnd_find_action(rnd_conf.rc.cli_backend, &f); if (!a) return -1; @@ -681,15 +681,15 @@ const char *end; /* no backend or forced action mode: classic pcb-rnd action parse */ - if (force_action_mode || (pcbhl_conf.rc.cli_backend == NULL) || (*pcbhl_conf.rc.cli_backend == '\0')) { + if (force_action_mode || (rnd_conf.rc.cli_backend == NULL) || (*rnd_conf.rc.cli_backend == '\0')) { rnd_event(NULL, RND_EVENT_CLI_ENTER, "s", str_); return hid_parse_actionstring(hl, str_, pcb_false); } /* backend: let the backend action handle it */ - a = rnd_find_action(pcbhl_conf.rc.cli_backend, &f); + a = rnd_find_action(rnd_conf.rc.cli_backend, &f); if (!a) { - rnd_message(RND_MSG_ERROR, "cli: no action %s; leaving mode\n", pcbhl_conf.rc.cli_backend); + rnd_message(RND_MSG_ERROR, "cli: no action %s; leaving mode\n", rnd_conf.rc.cli_backend); rnd_cli_leave(); return -1; } Index: trunk/src/librnd/core/conf.h =================================================================== --- trunk/src/librnd/core/conf.h (revision 31001) +++ trunk/src/librnd/core/conf.h (revision 31002) @@ -345,13 +345,13 @@ rnd_conf_set_editor(field, !conf_core.editor.field) #define rnd_conf_toggle_heditor(field) \ - rnd_conf_set_editor(field, !pcbhl_conf.editor.field) + rnd_conf_set_editor(field, !rnd_conf.editor.field) #define rnd_conf_toggle_editor_(sfield, field) \ rnd_conf_set_editor_("editor/" sfield, !conf_core.editor.field) #define rnd_conf_toggle_heditor_(sfield, field) \ - rnd_conf_set_editor_("editor/" sfield, !pcbhl_conf.editor.field) + rnd_conf_set_editor_("editor/" sfield, !rnd_conf.editor.field) /* For temporary modification/restoration of variables (hack) */ #define rnd_conf_force_set_bool(var, val) *((RND_CFT_BOOLEAN *)(&var)) = val Index: trunk/src/librnd/core/conf_act.c =================================================================== --- trunk/src/librnd/core/conf_act.c (revision 31001) +++ trunk/src/librnd/core/conf_act.c (revision 31002) @@ -155,7 +155,7 @@ n = rnd_conf_get_field(a1); if (n == NULL) { - if (pcbhl_conf.rc.verbose) + if (rnd_conf.rc.verbose) rnd_message(RND_MSG_ERROR, "Invalid conf field '%s' in iseq: no such path\n", path); return FGW_ERR_ARG_CONV; } @@ -242,7 +242,7 @@ id = pcb_tool_lookup(dst); if (id >= 0) { - RND_ACT_IRES(pcbhl_conf.editor.mode == id); + RND_ACT_IRES(rnd_conf.editor.mode == id); return 0; } RND_ACT_IRES(-1); @@ -277,7 +277,7 @@ { const char *expected; RND_PCB_ACT_CONVARG(1, FGW_STR, ChkGridUnits, expected = argv[1].val.str); - RND_ACT_IRES(strcmp(pcbhl_conf.editor.grid_unit->suffix, expected) == 0); + RND_ACT_IRES(strcmp(rnd_conf.editor.grid_unit->suffix, expected) == 0); return 0; } @@ -307,9 +307,9 @@ } rnd_grid_inval(); if (val[0] == '*') - pcb_hidlib_set_grid(RND_ACT_HIDLIB, rnd_round(RND_ACT_HIDLIB->grid * d), pcb_false, 0, 0); + rnd_hidlib_set_grid(RND_ACT_HIDLIB, rnd_round(RND_ACT_HIDLIB->grid * d), pcb_false, 0, 0); else - pcb_hidlib_set_grid(RND_ACT_HIDLIB, rnd_round(RND_ACT_HIDLIB->grid / d), pcb_false, 0, 0); + rnd_hidlib_set_grid(RND_ACT_HIDLIB, rnd_round(RND_ACT_HIDLIB->grid / d), pcb_false, 0, 0); return 0; } @@ -317,15 +317,15 @@ rnd_grid_inval(); if (absolute) - pcb_hidlib_set_grid(RND_ACT_HIDLIB, value, pcb_false, 0, 0); + rnd_hidlib_set_grid(RND_ACT_HIDLIB, value, pcb_false, 0, 0); else { /* On the way down, until the minimum unit (1) */ if ((value + RND_ACT_HIDLIB->grid) < 1) - pcb_hidlib_set_grid(RND_ACT_HIDLIB, 1, pcb_false, 0, 0); + rnd_hidlib_set_grid(RND_ACT_HIDLIB, 1, pcb_false, 0, 0); else if (RND_ACT_HIDLIB->grid == 1) - pcb_hidlib_set_grid(RND_ACT_HIDLIB, value, pcb_false, 0, 0); + rnd_hidlib_set_grid(RND_ACT_HIDLIB, value, pcb_false, 0, 0); else - pcb_hidlib_set_grid(RND_ACT_HIDLIB, value + RND_ACT_HIDLIB->grid, pcb_false, 0, 0); + rnd_hidlib_set_grid(RND_ACT_HIDLIB, value + RND_ACT_HIDLIB->grid, pcb_false, 0, 0); } return 0; } @@ -343,7 +343,7 @@ RND_ACT_IRES(0); new_unit = get_unit_struct(name); - pcb_hidlib_set_unit(RND_ACT_HIDLIB, new_unit); + rnd_hidlib_set_unit(RND_ACT_HIDLIB, new_unit); return 0; } Index: trunk/src/librnd/core/conf_hid.c =================================================================== --- trunk/src/librnd/core/conf_hid.c (revision 31001) +++ trunk/src/librnd/core/conf_hid.c (revision 31002) @@ -156,10 +156,10 @@ *tag = NULL; *popup = 0; switch(level) { - case RND_MSG_DEBUG: *tag = pcbhl_conf.appearance.loglevels.debug_tag; *popup = pcbhl_conf.appearance.loglevels.debug_popup; break; - case RND_MSG_INFO: *tag = pcbhl_conf.appearance.loglevels.info_tag; *popup = pcbhl_conf.appearance.loglevels.info_popup; break; - case RND_MSG_WARNING: *tag = pcbhl_conf.appearance.loglevels.warning_tag; *popup = pcbhl_conf.appearance.loglevels.warning_popup; break; - case RND_MSG_ERROR: *tag = pcbhl_conf.appearance.loglevels.error_tag; *popup = pcbhl_conf.appearance.loglevels.error_popup; break; + case RND_MSG_DEBUG: *tag = rnd_conf.appearance.loglevels.debug_tag; *popup = rnd_conf.appearance.loglevels.debug_popup; break; + case RND_MSG_INFO: *tag = rnd_conf.appearance.loglevels.info_tag; *popup = rnd_conf.appearance.loglevels.info_popup; break; + case RND_MSG_WARNING: *tag = rnd_conf.appearance.loglevels.warning_tag; *popup = rnd_conf.appearance.loglevels.warning_popup; break; + case RND_MSG_ERROR: *tag = rnd_conf.appearance.loglevels.error_tag; *popup = rnd_conf.appearance.loglevels.error_popup; break; break; } } Index: trunk/src/librnd/core/error.c =================================================================== --- trunk/src/librnd/core/error.c (revision 31001) +++ trunk/src/librnd/core/error.c (revision 31002) @@ -57,11 +57,11 @@ gds_t tmp; rnd_logline_t *line; - if ((rnd_gui == NULL) || (pcbhl_conf.rc.dup_log_to_stderr)) { - if (pcbhl_conf.rc.quiet) + if ((rnd_gui == NULL) || (rnd_conf.rc.dup_log_to_stderr)) { + if (rnd_conf.rc.quiet) min_level = RND_MSG_ERROR; - if ((level >= min_level) || (pcbhl_conf.rc.verbose)) { + if ((level >= min_level) || (rnd_conf.rc.verbose)) { va_start(args, Format); pcb_vfprintf(stderr, Format, args); va_end(args); Index: trunk/src/librnd/core/grid.c =================================================================== --- trunk/src/librnd/core/grid.c (revision 31001) +++ trunk/src/librnd/core/grid.c (revision 31002) @@ -167,9 +167,9 @@ void rnd_grid_set(rnd_hidlib_t *hidlib, const rnd_grid_t *src) { - pcb_hidlib_set_grid(hidlib, src->size, pcb_true, src->ox, src->oy); + rnd_hidlib_set_grid(hidlib, src->size, pcb_true, src->ox, src->oy); if (src->unit != NULL) - pcb_hidlib_set_unit(hidlib, src->unit); + rnd_hidlib_set_unit(hidlib, src->unit); } void rnd_grid_free(rnd_grid_t *dst) @@ -182,7 +182,7 @@ { const rnd_conf_listitem_t *li; rnd_grid_t g; - int max = rnd_conflist_length((rnd_conflist_t *)&pcbhl_conf.editor.grids); + int max = rnd_conflist_length((rnd_conflist_t *)&rnd_conf.editor.grids); if (dst < 0) dst = 0; @@ -193,7 +193,7 @@ rnd_conf_setf(RND_CFR_DESIGN, "editor/grids_idx", -1, "%d", dst); - li = rnd_conflist_nth((rnd_conflist_t *)&pcbhl_conf.editor.grids, dst); + li = rnd_conflist_nth((rnd_conflist_t *)&rnd_conf.editor.grids, dst); /* clamp */ if (li == NULL) return pcb_false; @@ -208,7 +208,7 @@ pcb_bool_t rnd_grid_list_step(rnd_hidlib_t *hidlib, int stp) { - int dst = pcbhl_conf.editor.grids_idx; + int dst = rnd_conf.editor.grids_idx; if (dst < 0) dst = -dst-1; return rnd_grid_list_jump(hidlib, dst + stp); @@ -216,7 +216,7 @@ void rnd_grid_inval(void) { - if (pcbhl_conf.editor.grids_idx > 0) - rnd_conf_setf(RND_CFR_DESIGN, "editor/grids_idx", -1, "%d", -1 - pcbhl_conf.editor.grids_idx); + if (rnd_conf.editor.grids_idx > 0) + rnd_conf_setf(RND_CFR_DESIGN, "editor/grids_idx", -1, "%d", -1 - rnd_conf.editor.grids_idx); } Index: trunk/src/librnd/core/gui_act.c =================================================================== --- trunk/src/librnd/core/gui_act.c (revision 31001) +++ trunk/src/librnd/core/gui_act.c (revision 31002) @@ -115,7 +115,7 @@ rnd_PCB_ACT_MAY_CONVARG(1, FGW_STR, FullScreen, cmd = argv[1].val.str); if ((cmd == NULL) || (rnd_strcasecmp(cmd, "Toggle") == 0)) - rnd_conf_setf(RND_CFR_DESIGN, "editor/fullscreen", -1, "%d", !pcbhl_conf.editor.fullscreen, RND_POL_OVERWRITE); + rnd_conf_setf(RND_CFR_DESIGN, "editor/fullscreen", -1, "%d", !rnd_conf.editor.fullscreen, RND_POL_OVERWRITE); else if (rnd_strcasecmp(cmd, "On") == 0) rnd_conf_set(RND_CFR_DESIGN, "editor/fullscreen", -1, "1", RND_POL_OVERWRITE); else if (rnd_strcasecmp(cmd, "Off") == 0) @@ -182,8 +182,8 @@ if (rnd_strcasecmp(a3, "grid") == 0) { char *end; - dx = strtod(a1, &end) * pcbhl_conf.editor.grid; - dy = strtod(a2, &end) * pcbhl_conf.editor.grid; + dx = strtod(a1, &end) * rnd_conf.editor.grid; + dy = strtod(a2, &end) * rnd_conf.editor.grid; } else { dx = pcb_get_value_ex(a1, a3, NULL, extra_units_x, "", NULL); @@ -194,11 +194,11 @@ if ((rnd_gui != NULL) && (rnd_gui->view_get != NULL)) { rnd_rnd_box_t viewbox; rnd_gui->view_get(rnd_gui, &viewbox); - if (pcbhl_conf.editor.view.flip_x) + if (rnd_conf.editor.view.flip_x) dx = viewbox.X2 - dx; else dx += viewbox.X1; - if (pcbhl_conf.editor.view.flip_y) + if (rnd_conf.editor.view.flip_y) dy = viewbox.Y2 - dy; else dy += viewbox.Y1; Index: trunk/src/librnd/core/hid_cfg.c =================================================================== --- trunk/src/librnd/core/hid_cfg.c (revision 31001) +++ trunk/src/librnd/core/hid_cfg.c (revision 31002) @@ -138,9 +138,9 @@ embedded_fallback = rnd_hidlib_default_embedded_menu; /* override HID defaults with the configured path */ - if ((pcbhl_conf.rc.menu_file != NULL) && (*pcbhl_conf.rc.menu_file != '\0')) { - fn = pcbhl_conf.rc.menu_file; - exact_fn = (strchr(pcbhl_conf.rc.menu_file, '/') != NULL); + if ((rnd_conf.rc.menu_file != NULL) && (*rnd_conf.rc.menu_file != '\0')) { + fn = rnd_conf.rc.menu_file; + exact_fn = (strchr(rnd_conf.rc.menu_file, '/') != NULL); } if (!exact_fn) { Index: trunk/src/librnd/core/hid_cfg_input.c =================================================================== --- trunk/src/librnd/core/hid_cfg_input.c (revision 31001) +++ trunk/src/librnd/core/hid_cfg_input.c (revision 31002) @@ -183,10 +183,10 @@ void rnd_hid_cfg_mouse_action(rnd_hidlib_t *hl, rnd_hid_cfg_mouse_t *mouse, rnd_hid_cfg_mod_t button_and_mask, rnd_bool cmd_entry_active) { - pcbhl_conf.temp.click_cmd_entry_active = cmd_entry_active; + rnd_conf.temp.click_cmd_entry_active = cmd_entry_active; rnd_hid_cfg_action(hl, find_best_action(mouse, button_and_mask)); rnd_event(NULL, RND_EVENT_USER_INPUT_POST, NULL); - pcbhl_conf.temp.click_cmd_entry_active = 0; + rnd_conf.temp.click_cmd_entry_active = 0; } Index: trunk/src/librnd/core/hid_dad_spin.c =================================================================== --- trunk/src/librnd/core/hid_dad_spin.c (revision 31001) +++ trunk/src/librnd/core/hid_dad_spin.c (revision 31002) @@ -114,7 +114,7 @@ if (spin->unit != NULL) unit = spin->unit; else - unit = pcbhl_conf.editor.grid_unit; + unit = rnd_conf.editor.grid_unit; if (buf != NULL) { pcb_snprintf(buf, buflen, "%$m*", unit->suffix, c); return buf; @@ -143,11 +143,11 @@ else if ((!is_globbing) && (unum >= 0) && (unum < pcb_get_n_units(0))) unit = &pcb_units[unum]; else - unit = pcbhl_conf.editor.grid_unit; + unit = rnd_conf.editor.grid_unit; if (is_globbing && su->dlg[su->wglob].val.lng) { /* global ticked in: also set the unit by force */ - unum = pcbhl_conf.editor.grid_unit - pcb_units; + unum = rnd_conf.editor.grid_unit - pcb_units; hv.lng = unum; rnd_gui->attr_dlg_set_value(hid_ctx, su->wunit, &hv); } @@ -173,7 +173,7 @@ memset(&ctx, 0, sizeof(ctx)); ctx.end = end; - def_unit = spin->unit == NULL ? pcbhl_conf.editor.grid_unit : spin->unit; + def_unit = spin->unit == NULL ? rnd_conf.editor.grid_unit : spin->unit; RND_DAD_BEGIN_VBOX(ctx.dlg); RND_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); @@ -276,7 +276,7 @@ succ = pcb_get_value_unit(str->val.str, NULL, 0, &v, &unit); if (!succ) { v = end->val.crd; - unit = pcbhl_conf.editor.grid_unit; + unit = rnd_conf.editor.grid_unit; } } else @@ -440,7 +440,7 @@ while(isspace(*ends)) ends++; if (*ends == '\0') { rnd_hid_attr_val_t hv; - char *tmp = pcb_concat(inval, " ", pcbhl_conf.editor.grid_unit->suffix, NULL); + char *tmp = pcb_concat(inval, " ", rnd_conf.editor.grid_unit->suffix, NULL); changed = 1; hv.str = tmp; Index: trunk/src/librnd/core/hid_init.c =================================================================== --- trunk/src/librnd/core/hid_init.c (revision 31001) +++ trunk/src/librnd/core/hid_init.c (revision 31002) @@ -90,11 +90,11 @@ rnd_render = rnd_gui = rnd_hid_nogui_get_hid(); TODO("make this configurable - add to conf_board_ignores avoid plugin injection") - tmp = pcb_concat(pcbhl_conf.rc.path.exec_prefix, RND_DIR_SEPARATOR_S, "lib", RND_DIR_SEPARATOR_S, "pcb-rnd", RND_DIR_SEPARATOR_S, "plugins", RND_DIR_SEPARATOR_S, HOST, NULL); + tmp = pcb_concat(rnd_conf.rc.path.exec_prefix, RND_DIR_SEPARATOR_S, "lib", RND_DIR_SEPARATOR_S, "pcb-rnd", RND_DIR_SEPARATOR_S, "plugins", RND_DIR_SEPARATOR_S, HOST, NULL); pcb_plugin_add_dir(tmp); free(tmp); - tmp = pcb_concat(pcbhl_conf.rc.path.exec_prefix, RND_DIR_SEPARATOR_S, "lib", RND_DIR_SEPARATOR_S, "pcb-rnd", RND_DIR_SEPARATOR_S, "plugins", NULL); + tmp = pcb_concat(rnd_conf.rc.path.exec_prefix, RND_DIR_SEPARATOR_S, "lib", RND_DIR_SEPARATOR_S, "pcb-rnd", RND_DIR_SEPARATOR_S, "plugins", NULL); pcb_plugin_add_dir(tmp); free(tmp); @@ -106,13 +106,13 @@ pcb_plugin_add_dir(tmp); free(tmp); - /* pcbhl_conf.rc.path.home is set by the conf_core immediately on startup */ - if (pcbhl_conf.rc.path.home != NULL) { - tmp = pcb_concat(pcbhl_conf.rc.path.home, RND_DIR_SEPARATOR_S, rnd_conf_dot_dir, RND_DIR_SEPARATOR_S, "plugins", RND_DIR_SEPARATOR_S, HOST, NULL); + /* rnd_conf.rc.path.home is set by the conf_core immediately on startup */ + if (rnd_conf.rc.path.home != NULL) { + tmp = pcb_concat(rnd_conf.rc.path.home, RND_DIR_SEPARATOR_S, rnd_conf_dot_dir, RND_DIR_SEPARATOR_S, "plugins", RND_DIR_SEPARATOR_S, HOST, NULL); pcb_plugin_add_dir(tmp); free(tmp); - tmp = pcb_concat(pcbhl_conf.rc.path.home, RND_DIR_SEPARATOR_S, rnd_conf_dot_dir, RND_DIR_SEPARATOR_S, "plugins", NULL); + tmp = pcb_concat(rnd_conf.rc.path.home, RND_DIR_SEPARATOR_S, rnd_conf_dot_dir, RND_DIR_SEPARATOR_S, "plugins", NULL); pcb_plugin_add_dir(tmp); free(tmp); } @@ -276,7 +276,7 @@ const char *rnd_hid_export_fn(const char *filename) { - if (pcbhl_conf.rc.export_basename) { + if (rnd_conf.rc.export_basename) { const char *outfn = strrchr(filename, RND_DIR_SEPARATOR_C); if (outfn == NULL) return filename; @@ -299,7 +299,7 @@ void pcbhl_conf_postproc(void) { - rnd_conf_force_set_str(pcbhl_conf.rc.path.home, get_homedir()); rnd_conf_ro("rc/path/home"); + rnd_conf_force_set_str(rnd_conf.rc.path.home, get_homedir()); rnd_conf_ro("rc/path/home"); } void rnd_hidlib_init1(void (*conf_core_init)(void)) @@ -309,7 +309,7 @@ rnd_conf_init(); conf_core_init(); pcbhl_conf_postproc(); - pcb_hidlib_conf_init(); + rnd_hidlib_conf_init(); rnd_hidlib_event_init(); pcb_hid_dlg_init(); rnd_hid_init(); @@ -399,11 +399,11 @@ { rnd_conf_listitem_t *apg = NULL; - if ((autopick_gui >= 0) && (pcbhl_conf.rc.hid_fallback)) { /* start from the GUI we are initializing first */ + if ((autopick_gui >= 0) && (rnd_conf.rc.hid_fallback)) { /* start from the GUI we are initializing first */ int n; const char *g; - rnd_conf_loop_list_str(&pcbhl_conf.rc.preferred_gui, apg, g, n) { + rnd_conf_loop_list_str(&rnd_conf.rc.preferred_gui, apg, g, n) { if (n == autopick_gui) break; } @@ -422,7 +422,7 @@ } fprintf(stderr, "Failed to initialize HID %s (recoverable)\n", rnd_gui->name); if (apg == NULL) { - if (pcbhl_conf.rc.hid_fallback) { + if (rnd_conf.rc.hid_fallback) { ran_out_of_hids:; rnd_message(RND_MSG_ERROR, "Tried all available HIDs, all failed, giving up.\n"); } @@ -633,7 +633,7 @@ rnd_conf_listitem_t *i; rnd_render = rnd_gui = NULL; - rnd_conf_loop_list_str(&pcbhl_conf.rc.preferred_gui, i, g, ga->autopick_gui) { + rnd_conf_loop_list_str(&rnd_conf.rc.preferred_gui, i, g, ga->autopick_gui) { rnd_render = rnd_gui = rnd_hid_find_gui(g); if (rnd_gui != NULL) break; Index: trunk/src/librnd/core/hid_nogui.c =================================================================== --- trunk/src/librnd/core/hid_nogui.c (revision 31001) +++ trunk/src/librnd/core/hid_nogui.c (revision 31002) @@ -262,7 +262,7 @@ rnd_PCB_ACT_MAY_CONVARG(2, FGW_STR, cli_PromptFor, default_str = argv[2].val.str); rnd_PCB_ACT_MAY_CONVARG(3, FGW_STR, cli_PromptFor, title = argv[3].val.str); - if (!pcbhl_conf.rc.quiet) { + if (!rnd_conf.rc.quiet) { char *tmp; if (title != NULL) printf("*** %s ***\n", title); @@ -293,7 +293,7 @@ int n, ret; res->type = FGW_INT; - if (pcbhl_conf.rc.quiet) { + if (rnd_conf.rc.quiet) { cancel:; res->val.nat_int = -1; return 0; @@ -335,7 +335,7 @@ { char *answer; - if (pcbhl_conf.rc.quiet) + if (rnd_conf.rc.quiet) return rnd_strdup(""); if (default_file) @@ -392,15 +392,15 @@ static double nextt; double now; - if (pcbhl_conf.rc.quiet) + if (rnd_conf.rc.quiet) return 0; if (message == NULL) { - if ((on) && (pcbhl_conf.rc.verbose >= RND_MSG_INFO)) + if ((on) && (rnd_conf.rc.verbose >= RND_MSG_INFO)) fprintf(stderr, "progress: finished\n"); on = 0; } else { - if ((pcbhl_conf.rc.verbose >= RND_MSG_INFO) || (rnd_gui != &nogui_hid)) { + if ((rnd_conf.rc.verbose >= RND_MSG_INFO) || (rnd_gui != &nogui_hid)) { now = rnd_dtime(); if (now >= nextt) { fprintf(stderr, "progress: %ld/%ld %s\n", so_far, total, message); Index: trunk/src/librnd/core/hidlib.c =================================================================== --- trunk/src/librnd/core/hidlib.c (revision 31001) +++ trunk/src/librnd/core/hidlib.c (revision 31002) @@ -44,7 +44,7 @@ static void hidlib_gui_init_ev(rnd_hidlib_t *hidlib, void *user_data, int argc, rnd_event_arg_t argv[]) { rnd_tool_gui_init(); - rnd_gui->set_mouse_cursor(rnd_gui, pcbhl_conf.editor.mode); /* make sure the mouse cursor is set up now that it is registered */ + rnd_gui->set_mouse_cursor(rnd_gui, rnd_conf.editor.mode); /* make sure the mouse cursor is set up now that it is registered */ } void rnd_log_print_uninit_errs(const char *title) @@ -53,7 +53,7 @@ int printed = 0; for(n = from; n != NULL; n = n->next) { - if ((n->level >= RND_MSG_INFO) || pcbhl_conf.rc.verbose) { + if ((n->level >= RND_MSG_INFO) || rnd_conf.rc.verbose) { if (!printed) fprintf(stderr, "*** %s:\n", title); fprintf(stderr, "%s", n->str); Index: trunk/src/librnd/core/hidlib_conf.c =================================================================== --- trunk/src/librnd/core/hidlib_conf.c (revision 31001) +++ trunk/src/librnd/core/hidlib_conf.c (revision 31002) @@ -36,14 +36,14 @@ #define PCB_MAX_GRID PCB_MIL_TO_COORD(1000) -pcbhl_conf_t pcbhl_conf; +rnd_conf_t rnd_conf; -int pcb_hidlib_conf_init() +int rnd_hidlib_conf_init() { int cnt = 0; #define conf_reg(field,isarray,type_name,cpath,cname,desc,flags) \ - rnd_conf_reg_field(pcbhl_conf, field,isarray,type_name,cpath,cname,desc,flags); + rnd_conf_reg_field(rnd_conf, field,isarray,type_name,cpath,cname,desc,flags); #include return cnt; @@ -50,7 +50,7 @@ } /* sets cursor grid with respect to grid offset values */ -void pcb_hidlib_set_grid(rnd_hidlib_t *hidlib, rnd_coord_t Grid, rnd_bool align, rnd_coord_t ox, rnd_coord_t oy) +void rnd_hidlib_set_grid(rnd_hidlib_t *hidlib, rnd_coord_t Grid, rnd_bool align, rnd_coord_t ox, rnd_coord_t oy) { if (Grid >= 1 && Grid <= PCB_MAX_GRID) { if (align) { @@ -59,12 +59,12 @@ } hidlib->grid = Grid; rnd_conf_set_design("editor/grid", "%$mS", Grid); - if (pcbhl_conf.editor.draw_grid) + if (rnd_conf.editor.draw_grid) rnd_gui->invalidate_all(rnd_gui); } } -void pcb_hidlib_set_unit(rnd_hidlib_t *hidlib, const rnd_unit_t *new_unit) +void rnd_hidlib_set_unit(rnd_hidlib_t *hidlib, const rnd_unit_t *new_unit) { if (new_unit != NULL && new_unit->allow != PCB_UNIT_NO_PRINT) rnd_conf_set(RND_CFR_DESIGN, "editor/grid_unit", -1, new_unit->suffix, RND_POL_OVERWRITE); Index: trunk/src/librnd/core/hidlib_conf.h =================================================================== --- trunk/src/librnd/core/hidlib_conf.h (revision 31001) +++ trunk/src/librnd/core/hidlib_conf.h (revision 31002) @@ -24,17 +24,17 @@ * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") */ -#ifndef PCB_HIDLIB_CONF_H -#define PCB_HIDLIB_CONF_H +#ifndef RND_HIDLIB_CONF_H +#define RND_HIDLIB_CONF_H #include #include -enum pcb_crosshair_shape_e { - pcb_ch_shape_basic = 0, /* 4-ray */ - pcb_ch_shape_union_jack = 1, /* 8-ray */ - pcb_ch_shape_dozen = 2, /* 12-ray */ - pcb_ch_shape_NUM +enum rnd_crosshair_shape_e { + rnd_ch_shape_basic = 0, /* 4-ray */ + rnd_ch_shape_union_jack = 1, /* 8-ray */ + rnd_ch_shape_dozen = 2, /* 12-ray */ + rnd_ch_shape_NUM }; /* to @conf_gen.sh: begin hidlib */ @@ -93,7 +93,7 @@ RND_CFT_BOOLEAN draw_grid; /* draw grid points */ RND_CFT_BOOLEAN auto_place; /* force placement of GUI windows (dialogs), trying to override the window manager */ RND_CFT_BOOLEAN fullscreen; /* hide widgets to make more room for the drawing */ - RND_CFT_INTEGER crosshair_shape_idx; /* crosshair shape as defined in pcb_crosshair_shape_e */ + RND_CFT_INTEGER crosshair_shape_idx; /* crosshair shape as defined in rnd_crosshair_shape_e */ RND_CFT_BOOLEAN enable_stroke; /* Enable libstroke gestures on middle mouse button when non-zero */ const struct { @@ -102,18 +102,18 @@ } view; } editor; -} pcbhl_conf_t; +} rnd_conf_t; /* to @conf_gen.sh: end hidlib */ -extern pcbhl_conf_t pcbhl_conf; +extern rnd_conf_t rnd_conf; -int pcb_hidlib_conf_init(); +int rnd_hidlib_conf_init(); /* sets cursor grid with respect to grid spacing, offset and unit values */ -void pcb_hidlib_set_grid(rnd_hidlib_t *hidlib, rnd_coord_t Grid, rnd_bool align, rnd_coord_t ox, rnd_coord_t oy); -void pcb_hidlib_set_unit(rnd_hidlib_t *hidlib, const rnd_unit_t *new_unit); +void rnd_hidlib_set_grid(rnd_hidlib_t *hidlib, rnd_coord_t Grid, rnd_bool align, rnd_coord_t ox, rnd_coord_t oy); +void rnd_hidlib_set_unit(rnd_hidlib_t *hidlib, const rnd_unit_t *new_unit); #endif Index: trunk/src/librnd/core/math_helper.h =================================================================== --- trunk/src/librnd/core/math_helper.h (revision 31001) +++ trunk/src/librnd/core/math_helper.h (revision 31002) @@ -37,19 +37,19 @@ #ifndef M_SQRT1_2 #define M_SQRT1_2 0.707106781 /* 1/sqrt(2) */ #endif -#define PCB_M180 (M_PI/180.0) -#define PCB_RAD_TO_DEG (180.0/M_PI) -#define PCB_TAN_22_5_DEGREE_2 0.207106781 /* 0.5*tan(22.5) */ -#define PCB_COS_22_5_DEGREE 0.923879533 /* cos(22.5) */ -#define PCB_TAN_30_DEGREE 0.577350269 /* tan(30) */ -#define PCB_TAN_60_DEGREE 1.732050808 /* tan(60) */ -#define PCB_LN_2_OVER_2 0.346573590 -#define PCB_TO_RADIANS(degrees) (PCB_M180 * (degrees)) -#define PCB_SQRT2 1.41421356237309504880 /* sqrt(2) */ +#define RND_M180 (M_PI/180.0) +#define RND_RAD_TO_DEG (180.0/M_PI) +#define RND_TAN_22_5_DEGREE_2 0.207106781 /* 0.5*tan(22.5) */ +#define RND_COS_22_5_DEGREE 0.923879533 /* cos(22.5) */ +#define RND_TAN_30_DEGREE 0.577350269 /* tan(30) */ +#define RND_TAN_60_DEGREE 1.732050808 /* tan(60) */ +#define RND_LN_2_OVER_2 0.346573590 +#define RND_TO_RADIANS(degrees) (RND_M180 * (degrees)) +#define RND_SQRT2 1.41421356237309504880 /* sqrt(2) */ -#define PCB_CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) -#define PCB_ABS(a) (((a) < 0) ? -(a) : (a)) -#define PCB_SQUARE(x) ((float) (x) * (float) (x)) +#define RND_CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) +#define RND_ABS(a) (((a) < 0) ? -(a) : (a)) +#define RND_SQUARE(x) ((float) (x) * (float) (x)) /* --------------------------------------------------------------------------- * misc macros, some might already be defined by @@ -61,10 +61,10 @@ #ifndef SGN #define SGN(a) ((a) >0 ? 1 : ((a) == 0 ? 0 : -1)) #endif -#define PCB_SGNZ(a) ((a) >=0 ? 1 : -1) -#define PCB_MAKE_MIN(a,b) if ((b) < (a)) (a) = (b) -#define PCB_MAKE_MAX(a,b) if ((b) > (a)) (a) = (b) +#define RND_SGNZ(a) ((a) >=0 ? 1 : -1) +#define RND_MAKE_MIN(a,b) if ((b) < (a)) (a) = (b) +#define RND_MAKE_MAX(a,b) if ((b) > (a)) (a) = (b) -#define PCB_SWAP_SIGN_X(x) (x) -#define PCB_SWAP_SIGN_Y(y) (-(y)) +#define RND_SWAP_SIGN_X(x) (x) +#define RND_SWAP_SIGN_Y(y) (-(y)) Index: trunk/src/librnd/core/paths.c =================================================================== --- trunk/src/librnd/core/paths.c (revision 31001) +++ trunk/src/librnd/core/paths.c (revision 31002) @@ -151,11 +151,11 @@ #endif if ((*template == '~') && (flags & PCB_SUBST_HOME)) { - if (pcbhl_conf.rc.path.home == NULL) { + if (rnd_conf.rc.path.home == NULL) { rnd_message(RND_MSG_ERROR, "pcb_strdup_subst(): can't resolve home dir required for path %s\n", template); goto error; } - gds_append_str(s, pcbhl_conf.rc.path.home); + gds_append_str(s, rnd_conf.rc.path.home); template++; } Index: trunk/src/librnd/core/tool.c =================================================================== --- trunk/src/librnd/core/tool.c (revision 31001) +++ trunk/src/librnd/core/tool.c (revision 31002) @@ -70,7 +70,7 @@ void pcb_tool_chg_mode(rnd_hidlib_t *hl) { if ((hl != NULL) && (!tool_select_lock)) - pcb_tool_select_by_id(hl, pcbhl_conf.editor.mode); + pcb_tool_select_by_id(hl, rnd_conf.editor.mode); } pcb_toolid_t pcb_tool_reg(pcb_tool_t *tool, const char *cookie) @@ -137,11 +137,11 @@ /* check if the UI logic allows picking that tool */ rnd_event(hidlib, RND_EVENT_TOOL_SELECT_PRE, "pi", &ok, id); if (ok == 0) - id = pcbhl_conf.editor.mode; + id = rnd_conf.editor.mode; recursing = pcb_true; - pcb_tool_prev_id = pcbhl_conf.editor.mode; + pcb_tool_prev_id = rnd_conf.editor.mode; pcb_tool_next_id = id; uninit_current_tool(); sprintf(id_s, "%d", id); @@ -175,7 +175,7 @@ int pcb_tool_save(rnd_hidlib_t *hidlib) { - save_stack[save_position] = pcbhl_conf.editor.mode; + save_stack[save_position] = rnd_conf.editor.mode; if (save_position < PCB_MAX_MODESTACK_DEPTH - 1) save_position++; else @@ -209,9 +209,9 @@ #define wrap(func, err_ret, prefix, args) \ do { \ const pcb_tool_t *tool; \ - if ((pcbhl_conf.editor.mode < 0) || (pcbhl_conf.editor.mode >= vtp0_len(&pcb_tools))) \ + if ((rnd_conf.editor.mode < 0) || (rnd_conf.editor.mode >= vtp0_len(&pcb_tools))) \ { err_ret; } \ - tool = (const pcb_tool_t *)pcb_tools.array[pcbhl_conf.editor.mode]; \ + tool = (const pcb_tool_t *)pcb_tools.array[rnd_conf.editor.mode]; \ if (tool->func == NULL) \ { err_ret; } \ prefix tool->func args; \ @@ -262,7 +262,7 @@ static void do_release(rnd_hidlib_t *hidlib) { - if (pcbhl_conf.temp.click_cmd_entry_active && (rnd_cli_mouse(hidlib, 0) == 0)) + if (rnd_conf.temp.click_cmd_entry_active && (rnd_cli_mouse(hidlib, 0) == 0)) return; hidlib->tool_grabbed.status = pcb_false; @@ -277,7 +277,7 @@ void pcb_tool_do_press(rnd_hidlib_t *hidlib) { - if (pcbhl_conf.temp.click_cmd_entry_active && (rnd_cli_mouse(hidlib, 1) == 0)) + if (rnd_conf.temp.click_cmd_entry_active && (rnd_cli_mouse(hidlib, 1) == 0)) return; hidlib->tool_grabbed.X = hidlib->tool_x; @@ -306,12 +306,12 @@ hidlib->tool_y = hidlib->ch_y; rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, pcb_false); if (rnd_strcasecmp(cmd, "Cancel") == 0) { - pcb_tool_select_by_id(RND_ACT_HIDLIB, pcbhl_conf.editor.mode); + pcb_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(pcbhl_conf.editor.mode); + t = pcb_tool_get(rnd_conf.editor.mode); if ((t == NULL) || (t->escape == NULL)) { pcb_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 */ @@ -323,7 +323,7 @@ pcb_tool_do_press(RND_ACT_HIDLIB); } else if (rnd_strcasecmp(cmd, "Release") == 0) { - if (pcbhl_conf.editor.enable_stroke) { + if (rnd_conf.editor.enable_stroke) { int handled = 0; rnd_event(RND_ACT_HIDLIB, RND_EVENT_STROKE_FINISH, "p", &handled); if (handled) { @@ -338,7 +338,7 @@ do_release(RND_ACT_HIDLIB); } else if (rnd_strcasecmp(cmd, "Stroke") == 0) { - if (pcbhl_conf.editor.enable_stroke) + if (rnd_conf.editor.enable_stroke) rnd_event(RND_ACT_HIDLIB, RND_EVENT_STROKE_START, "cc", hidlib->tool_x, hidlib->tool_y); else goto escape; /* Right mouse button restarts drawing mode. */ Index: trunk/src/librnd/core/tool.h =================================================================== --- trunk/src/librnd/core/tool.h (revision 31001) +++ trunk/src/librnd/core/tool.h (revision 31002) @@ -106,7 +106,7 @@ /**** Tool function wrappers; calling these will operate on the current tool - as defined in pcbhl_conf.editor.mode ****/ + as defined in rnd_conf.editor.mode ****/ void pcb_tool_press(rnd_hidlib_t *hidlib); void pcb_tool_release(rnd_hidlib_t *hidlib); Index: trunk/src/librnd/pcb_compat.h =================================================================== --- trunk/src/librnd/pcb_compat.h (revision 31001) +++ trunk/src/librnd/pcb_compat.h (revision 31002) @@ -962,3 +962,30 @@ #define pcbhl_app_url rnd_app_url #define pcb_hidcore_crosshair_move_to rnd_hidcore_crosshair_move_to #define pcb_hidlib_default_embedded_menu rnd_hidlib_default_embedded_menu +#define pcb_crosshair_shape_e rnd_crosshair_shape_e +#define pcb_ch_shape_basic rnd_ch_shape_basic +#define pcb_ch_shape_union_jack rnd_ch_shape_union_jack +#define pcb_ch_shape_dozen rnd_ch_shape_dozen +#define pcb_ch_shape_NUM rnd_ch_shape_NUM +#define pcbhl_conf_t rnd_conf_t +#define pcbhl_conf rnd_conf +#define pcb_hidlib_conf_init rnd_hidlib_conf_init +#define pcb_hidlib_set_grid rnd_hidlib_set_grid +#define pcb_hidlib_set_unit rnd_hidlib_set_unit +#define PCB_M180 RND_M180 +#define PCB_RAD_TO_DEG RND_RAD_TO_DEG +#define PCB_TAN_22_5_DEGREE_2 RND_TAN_22_5_DEGREE_2 +#define PCB_COS_22_5_DEGREE RND_COS_22_5_DEGREE +#define PCB_TAN_30_DEGREE RND_TAN_30_DEGREE +#define PCB_TAN_60_DEGREE RND_TAN_60_DEGREE +#define PCB_LN_2_OVER_2 RND_LN_2_OVER_2 +#define PCB_TO_RADIANS RND_TO_RADIANS +#define PCB_SQRT2 RND_SQRT2 +#define PCB_CLAMP RND_CLAMP +#define PCB_ABS RND_ABS +#define PCB_SQUARE RND_SQUARE +#define PCB_SGNZ RND_SGNZ +#define PCB_MAKE_MIN RND_MAKE_MIN +#define PCB_MAKE_MAX RND_MAKE_MAX +#define PCB_SWAP_SIGN_X RND_SWAP_SIGN_X +#define PCB_SWAP_SIGN_Y RND_SWAP_SIGN_Y Index: trunk/src/librnd/poly/polyarea.c =================================================================== --- trunk/src/librnd/poly/polyarea.c (revision 31001) +++ trunk/src/librnd/poly/polyarea.c (revision 31002) @@ -1814,10 +1814,10 @@ b = bpa; while ((b = b->f) != bpa) { rnd_rnd_box_t *b_box = (rnd_rnd_box_t *) b->contours; - PCB_MAKE_MIN(box.X1, b_box->X1); - PCB_MAKE_MIN(box.Y1, b_box->Y1); - PCB_MAKE_MAX(box.X2, b_box->X2); - PCB_MAKE_MAX(box.Y2, b_box->Y2); + RND_MAKE_MIN(box.X1, b_box->X1); + RND_MAKE_MIN(box.Y1, b_box->Y1); + RND_MAKE_MAX(box.X2, b_box->X2); + RND_MAKE_MAX(box.Y2, b_box->Y2); } if (del_inside) { @@ -2369,7 +2369,7 @@ } while ((c = (p = c)->next) != C->head); } - C->area = PCB_ABS(area); + C->area = RND_ABS(area); if (C->Count > 2) C->Flags.orient = ((area < 0) ? PCB_PLF_INV : PCB_PLF_DIR); C->tree = (rnd_rtree_t *) pcb_poly_make_edge_tree(C); @@ -3419,14 +3419,14 @@ double ox, oy, dx, dy, l; /* Cheap: if either line endpoint is within the circle, we sure have an intersection */ - if ((PCB_SQUARE(s->v->point[0] - ctx->cx) + PCB_SQUARE(s->v->point[1] - ctx->cy)) <= ctx->r2) + if ((RND_SQUARE(s->v->point[0] - ctx->cx) + RND_SQUARE(s->v->point[1] - ctx->cy)) <= ctx->r2) return PCB_R_DIR_CANCEL; /* found */ - if ((PCB_SQUARE(s->v->next->point[0] - ctx->cx) + PCB_SQUARE(s->v->next->point[1] - ctx->cy)) <= ctx->r2) + if ((RND_SQUARE(s->v->next->point[0] - ctx->cx) + RND_SQUARE(s->v->next->point[1] - ctx->cy)) <= ctx->r2) return PCB_R_DIR_CANCEL; /* found */ dx = s->v->point[0] - s->v->next->point[0]; dy = s->v->point[1] - s->v->next->point[1]; - l = sqrt(PCB_SQUARE(dx) + PCB_SQUARE(dy)); + l = sqrt(RND_SQUARE(dx) + RND_SQUARE(dy)); ox = -dy / l * (double)ctx->r; oy = dx / l * (double)ctx->r; Index: trunk/src/librnd/poly/polygon1_gen.c =================================================================== --- trunk/src/librnd/poly/polygon1_gen.c (revision 31001) +++ trunk/src/librnd/poly/polygon1_gen.c (revision 31002) @@ -120,20 +120,20 @@ ang = astart; da = (1.0 * adelta) / segs; radius_adj = (M_PI * da / 360) * (M_PI * da / 360) / 2; - v[0] = cx - rx * cos(ang * PCB_M180); - v[1] = cy + ry * sin(ang * PCB_M180); + v[0] = cx - rx * cos(ang * RND_M180); + v[1] = cy + ry * sin(ang * RND_M180); if ((contour = pcb_poly_contour_new(v)) == NULL) return 0; for (i = 0; i < segs - 1; i++) { ang += da; - v[0] = cx - rx * cos(ang * PCB_M180); - v[1] = cy + ry * sin(ang * PCB_M180); + v[0] = cx - rx * cos(ang * RND_M180); + v[1] = cy + ry * sin(ang * RND_M180); pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); } /* find last point */ ang = astart + adelta; - v[0] = cx - rx * cos(ang * PCB_M180) * (1 - radius_adj); - v[1] = cy + ry * sin(ang * PCB_M180) * (1 - radius_adj); + v[0] = cx - rx * cos(ang * RND_M180) * (1 - radius_adj); + v[1] = cy + ry * sin(ang * RND_M180) * (1 - radius_adj); /* add the round cap at the end */ if (end_caps) @@ -144,8 +144,8 @@ ry = (width + half) * (1 + radius_adj); da = -da; for (i = 0; i < segs; i++) { - v[0] = cx - rx * cos(ang * PCB_M180); - v[1] = cy + ry * sin(ang * PCB_M180); + v[0] = cx - rx * cos(ang * RND_M180); + v[1] = cy + ry * sin(ang * RND_M180); pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); ang += da; } @@ -152,8 +152,8 @@ /* explicitly draw the last point if the manhattan-distance is large enough */ ang = astart; - v2[0] = cx - rx * cos(ang * PCB_M180) * (1 - radius_adj); - v2[1] = cy + ry * sin(ang * PCB_M180) * (1 - radius_adj); + v2[0] = cx - rx * cos(ang * RND_M180) * (1 - radius_adj); + v2[1] = cy + ry * sin(ang * RND_M180) * (1 - radius_adj); edx = (v[0] - v2[0]); edy = (v[1] - v2[1]); if (edx < 0) edx = -edx; @@ -208,36 +208,36 @@ TODO(": rewrite this to use the same table as the square/oct pin draw function") /* point 7 */ v[0] = x + ROUND(radius * 0.5) * xm[7]; - v[1] = y + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[7]; + v[1] = y + ROUND(radius * RND_TAN_22_5_DEGREE_2) * ym[7]; if ((contour = pcb_poly_contour_new(v)) == NULL) return NULL; /* point 6 */ - v[0] = x + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[6]; + v[0] = x + ROUND(radius * RND_TAN_22_5_DEGREE_2) * xm[6]; v[1] = y + ROUND(radius * 0.5) * ym[6]; pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); /* point 5 */ - v[0] = x - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[5]; + v[0] = x - ROUND(radius * RND_TAN_22_5_DEGREE_2) * xm[5]; v[1] = y + ROUND(radius * 0.5) * ym[5]; pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); /* point 4 */ v[0] = x - ROUND(radius * 0.5) * xm[4]; - v[1] = y + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[4]; + v[1] = y + ROUND(radius * RND_TAN_22_5_DEGREE_2) * ym[4]; pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); /* point 3 */ v[0] = x - ROUND(radius * 0.5) * xm[3]; - v[1] = y - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[3]; + v[1] = y - ROUND(radius * RND_TAN_22_5_DEGREE_2) * ym[3]; pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); /* point 2 */ - v[0] = x - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[2]; + v[0] = x - ROUND(radius * RND_TAN_22_5_DEGREE_2) * xm[2]; v[1] = y - ROUND(radius * 0.5) * ym[2]; pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); /* point 1 */ - v[0] = x + ROUND(radius * PCB_TAN_22_5_DEGREE_2) * xm[1]; + v[0] = x + ROUND(radius * RND_TAN_22_5_DEGREE_2) * xm[1]; v[1] = y - ROUND(radius * 0.5) * ym[1]; pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); /* point 0 */ v[0] = x + ROUND(radius * 0.5) * xm[0]; - v[1] = y - ROUND(radius * PCB_TAN_22_5_DEGREE_2) * ym[0]; + v[1] = y - ROUND(radius * RND_TAN_22_5_DEGREE_2) * ym[0]; pcb_poly_vertex_include(contour->head->prev, pcb_poly_node_create(v)); return pcb_poly_from_contour(contour); } @@ -357,7 +357,7 @@ if (thick <= 0) return NULL; half = (thick + 1) / 2; - d = sqrt(PCB_SQUARE(x1 - x2) + PCB_SQUARE(y1 - y2)); + d = sqrt(RND_SQUARE(x1 - x2) + RND_SQUARE(y1 - y2)); if (!square) if (d == 0) /* line is a point */ return pcb_poly_from_circle(x1, y1, half); Index: trunk/src/obj_arc.c =================================================================== --- trunk/src/obj_arc.c (revision 31001) +++ trunk/src/obj_arc.c (revision 31002) @@ -110,7 +110,7 @@ /* first put angles into standard form: * ang1 < ang2, both angles between 0 and 720 */ - delta = PCB_CLAMP(Arc->Delta, -360, 360); + delta = RND_CLAMP(Arc->Delta, -360, 360); if (delta > 0) { ang1 = pcb_normalize_angle(Arc->StartAngle); @@ -127,10 +127,10 @@ ang2 = ang1 + 360; /* calculate sines, cosines */ - sa1 = sin(PCB_M180 * ang1); - ca1 = cos(PCB_M180 * ang1); - sa2 = sin(PCB_M180 * ang2); - ca2 = cos(PCB_M180 * ang2); + sa1 = sin(RND_M180 * ang1); + ca1 = cos(RND_M180 * ang1); + sa2 = sin(RND_M180 * ang2); + ca2 = cos(RND_M180 * ang2); minx = MIN(ca1, ca2); maxx = MAX(ca1, ca2); @@ -950,7 +950,7 @@ { double da, ea, la; - da = PCB_CLAMP(arc->Delta, -360, 360); + da = RND_CLAMP(arc->Delta, -360, 360); ea = arc->StartAngle + da; while(ea < -360) ea += 360; while(ea > +360) ea -= 360; @@ -957,8 +957,8 @@ la = (arc->StartAngle+ea)/2.0; - *x0 = rnd_round((double)arc->X - (double)arc->Width * cos(la * PCB_M180)); - *y0 = rnd_round((double)arc->Y + (double)arc->Height * sin(la * PCB_M180)); + *x0 = rnd_round((double)arc->X - (double)arc->Width * cos(la * RND_M180)); + *y0 = rnd_round((double)arc->Y + (double)arc->Height * sin(la * RND_M180)); *vert = (((la < 45) && (la > -45)) || ((la > 135) && (la < 225))); } @@ -1002,7 +1002,7 @@ if (step < 0) step = -step; ea2 = ea - step/3; for(a = arc->StartAngle; a < ea2; a += step) - if (cb(uctx, rnd_round((double)arc->X - (double)arc->Width * cos(a * PCB_M180)), rnd_round((double)arc->Y + (double)arc->Height * sin(a * PCB_M180))) != 0) + if (cb(uctx, rnd_round((double)arc->X - (double)arc->Width * cos(a * RND_M180)), rnd_round((double)arc->Y + (double)arc->Height * sin(a * RND_M180))) != 0) return; } else { @@ -1009,11 +1009,11 @@ if (step > 0) step = +step; ea2 = ea + step/3; for(a = sa; a > ea2; a -= step) - if (cb(uctx, rnd_round((double)arc->X - (double)arc->Width * cos(a * PCB_M180)), rnd_round((double)arc->Y + (double)arc->Height * sin(a * PCB_M180))) != 0) + if (cb(uctx, rnd_round((double)arc->X - (double)arc->Width * cos(a * RND_M180)), rnd_round((double)arc->Y + (double)arc->Height * sin(a * RND_M180))) != 0) return; } - cb(uctx, rnd_round((double)arc->X - (double)arc->Width * cos(ea * PCB_M180)), rnd_round((double)arc->Y + (double)arc->Height * sin(ea * PCB_M180))); + cb(uctx, rnd_round((double)arc->X - (double)arc->Width * cos(ea * RND_M180)), rnd_round((double)arc->Y + (double)arc->Height * sin(ea * RND_M180))); } void pcb_arc_name_invalidate_draw(pcb_arc_t *arc) Index: trunk/src/obj_common.c =================================================================== --- trunk/src/obj_common.c (revision 31001) +++ trunk/src/obj_common.c (revision 31002) @@ -301,7 +301,7 @@ { pcb_xform_mx_t tr; - deg /= PCB_RAD_TO_DEG; + deg /= RND_RAD_TO_DEG; tr[0] = cos(deg); tr[1] = sin(deg); Index: trunk/src/obj_gfx.c =================================================================== --- trunk/src/obj_gfx.c (revision 31001) +++ trunk/src/obj_gfx.c (revision 31002) @@ -126,7 +126,7 @@ gfx->cox[2] = rnd_round((double)gfx->cx - rx); gfx->coy[2] = rnd_round((double)gfx->cy - ry); gfx->cox[3] = rnd_round((double)gfx->cx + rx); gfx->coy[3] = rnd_round((double)gfx->cy - ry); if (gfx->rot != 0.0) { - a = gfx->rot / PCB_RAD_TO_DEG; + a = gfx->rot / RND_RAD_TO_DEG; cosa = cos(a); sina = sin(a); for(n = 0; n < 4; n++) Index: trunk/src/obj_line_drcenf.c =================================================================== --- trunk/src/obj_line_drcenf.c (revision 31001) +++ trunk/src/obj_line_drcenf.c (revision 31002) @@ -90,10 +90,10 @@ else { m = (double) dy / dx; direction = 2; - if (m > PCB_TAN_30_DEGREE) - direction = m > PCB_TAN_60_DEGREE ? 0 : 1; - else if (m < -PCB_TAN_30_DEGREE) - direction = m < -PCB_TAN_60_DEGREE ? 0 : 3; + if (m > RND_TAN_30_DEGREE) + direction = m > RND_TAN_60_DEGREE ? 0 : 1; + else if (m < -RND_TAN_30_DEGREE) + direction = m < -RND_TAN_60_DEGREE ? 0 : 3; } if (dx < 0) direction += 4; Index: trunk/src/obj_poly.c =================================================================== --- trunk/src/obj_poly.c (revision 31001) +++ trunk/src/obj_poly.c (revision 31002) @@ -378,10 +378,10 @@ PCB_POLY_POINT_LOOP(Polygon); { - PCB_MAKE_MIN(Polygon->bbox_naked.X1, point->X); - PCB_MAKE_MIN(Polygon->bbox_naked.Y1, point->Y); - PCB_MAKE_MAX(Polygon->bbox_naked.X2, point->X); - PCB_MAKE_MAX(Polygon->bbox_naked.Y2, point->Y); + RND_MAKE_MIN(Polygon->bbox_naked.X1, point->X); + RND_MAKE_MIN(Polygon->bbox_naked.Y1, point->Y); + RND_MAKE_MAX(Polygon->bbox_naked.X2, point->X); + RND_MAKE_MAX(Polygon->bbox_naked.Y2, point->Y); } PCB_END_LOOP; Index: trunk/src/obj_poly_draw_helper.c =================================================================== --- trunk/src/obj_poly_draw_helper.c (revision 31001) +++ trunk/src/obj_poly_draw_helper.c (revision 31002) @@ -51,10 +51,10 @@ #define vert_opt_loop1(v, force, skip_stmt) \ this_x = v->point[0]; \ this_y = v->point[1]; \ - if ((!force) && (PCB_ABS(this_x - last_x) < mindist) && (PCB_ABS(this_y - last_y) < mindist)) { \ + if ((!force) && (RND_ABS(this_x - last_x) < mindist) && (RND_ABS(this_y - last_y) < mindist)) { \ next_x = v->next->point[0]; \ next_y = v->next->point[1]; \ - if ((PCB_ABS(this_x - next_x) < mindist) && (PCB_ABS(this_y - next_y) < mindist)) \ + if ((RND_ABS(this_x - next_x) < mindist) && (RND_ABS(this_y - next_y) < mindist)) \ { skip_stmt; } \ } \ Index: trunk/src/obj_pstk_proto.c =================================================================== --- trunk/src/obj_pstk_proto.c (revision 31001) +++ trunk/src/obj_pstk_proto.c (revision 31002) @@ -577,7 +577,7 @@ void pcb_pstk_tshape_rot(pcb_pstk_tshape_t *ts, double angle) { int n; - double cosa = cos(angle / PCB_RAD_TO_DEG), sina = sin(angle / PCB_RAD_TO_DEG); + double cosa = cos(angle / RND_RAD_TO_DEG), sina = sin(angle / RND_RAD_TO_DEG); for(n = 0; n < ts->len; n++) pcb_pstk_shape_rot(&ts->shape[n], sina, cosa, angle); Index: trunk/src/obj_subc.c =================================================================== --- trunk/src/obj_subc.c (revision 31001) +++ trunk/src/obj_subc.c (revision 31002) @@ -275,7 +275,7 @@ if ((pcb_subc_cache_update(sc) != 0) || (sc->aux_cache[PCB_SUBCH_X] == NULL)) return -1; - r = -1 * PCB_RAD_TO_DEG * atan2(sc->aux_cache[PCB_SUBCH_X]->Point2.Y - sc->aux_cache[PCB_SUBCH_X]->Point1.Y, sc->aux_cache[PCB_SUBCH_X]->Point2.X - sc->aux_cache[PCB_SUBCH_X]->Point1.X); + r = -1 * RND_RAD_TO_DEG * atan2(sc->aux_cache[PCB_SUBCH_X]->Point2.Y - sc->aux_cache[PCB_SUBCH_X]->Point1.Y, sc->aux_cache[PCB_SUBCH_X]->Point2.X - sc->aux_cache[PCB_SUBCH_X]->Point1.X); /* ugly hack to get round angles where possible: if error to a round angle is less than 1/10000, it was meant to be round, just got ruined by @@ -328,7 +328,7 @@ res = -1; } - rr = tr->rot / PCB_RAD_TO_DEG; + rr = tr->rot / RND_RAD_TO_DEG; if (neg) { tr->rot = -tr->rot; @@ -484,8 +484,8 @@ sn = 0; } else { - cs = cos(rot/PCB_RAD_TO_DEG); - sn = sin(rot/PCB_RAD_TO_DEG); + cs = cos(rot/RND_RAD_TO_DEG); + sn = sin(rot/RND_RAD_TO_DEG); } if (bottom) { @@ -715,7 +715,7 @@ { rnd_coord_t s = on_bottom ? -PCB_EMARK_SIZE : PCB_EMARK_SIZE; - if (pcbhl_conf.editor.view.flip_x) + if (rnd_conf.editor.view.flip_x) lx += PCB_EMARK_SIZE*1.5; else lx -= PCB_EMARK_SIZE*1.5; @@ -1990,9 +1990,9 @@ if (locked) { int on_bottom = 0; pcb_subc_get_side(subc, &on_bottom); - if (pcbhl_conf.editor.view.flip_x) + if (rnd_conf.editor.view.flip_x) on_bottom = !on_bottom; - pcb_subc_draw_locked(pcb_draw_out.fgGC, subc, pcbhl_conf.editor.view.flip_x ? bb->X1 : bb->X2, on_bottom ? bb->Y1 : bb->Y2, on_bottom); + pcb_subc_draw_locked(pcb_draw_out.fgGC, subc, rnd_conf.editor.view.flip_x ? bb->X1 : bb->X2, on_bottom ? bb->Y1 : bb->Y2, on_bottom); } if (freq >= 0) { @@ -2034,7 +2034,7 @@ dx = font->MaxWidth/2; dy = font->MaxHeight/2; - if (pcbhl_conf.editor.view.flip_x) { + if (rnd_conf.editor.view.flip_x) { x0 = bb->X2; dx = -dx; } @@ -2041,7 +2041,7 @@ else x0 = bb->X1; - if (pcbhl_conf.editor.view.flip_y) { + if (rnd_conf.editor.view.flip_y) { y0 = bb->Y2; dy = -dy; } @@ -2332,7 +2332,7 @@ if (rot != 0) { if (dst_on_bottom != src_on_bottom) rot = -rot; - pcb_subc_rotate(placed, ox, oy, cos(rot / PCB_RAD_TO_DEG), sin(rot / PCB_RAD_TO_DEG), rot); + pcb_subc_rotate(placed, ox, oy, cos(rot / RND_RAD_TO_DEG), sin(rot / RND_RAD_TO_DEG), rot); } if (dst_on_bottom != src_on_bottom) Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 31001) +++ trunk/src/object_act.c (revision 31002) @@ -579,7 +579,7 @@ rnd_actionv_bin(&plc->pcb->hidlib, "viewlist", &res, 4, args); plc->remlst = NULL; } - if ((number_of_footprints_not_found > 0) && (!pcbhl_conf.rc.quiet)) + if ((number_of_footprints_not_found > 0) && (!rnd_conf.rc.quiet)) rnd_message(RND_MSG_ERROR, "Footprint import: not all requested footprints were found.\nSee the message log above for details\n"); } @@ -643,11 +643,11 @@ argc = 4; /* turn of flip to avoid mirror/rotat confusion */ - fx = pcbhl_conf.editor.view.flip_x; - fy = pcbhl_conf.editor.view.flip_y; + fx = rnd_conf.editor.view.flip_x; + fy = rnd_conf.editor.view.flip_y; fs = conf_core.editor.show_solder_side; - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_x, 0); - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_y, 0); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_x, 0); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_y, 0); rnd_conf_force_set_bool(conf_core.editor.show_solder_side, 0); #ifdef DEBUG @@ -715,8 +715,8 @@ pcb_subc_change_side(psc, pcy * 2 - RND_ACT_HIDLIB->size_y); if (orig_rot != 0) { double cosa, sina; - cosa = cos(orig_rot / PCB_RAD_TO_DEG); - sina = sin(orig_rot / PCB_RAD_TO_DEG); + cosa = cos(orig_rot / RND_RAD_TO_DEG); + sina = sin(orig_rot / RND_RAD_TO_DEG); pcb_subc_rotate(psc, pcx, pcy, cosa, sina, orig_rot); } @@ -753,8 +753,8 @@ printf(" ... Leaving pcb_act_ElementList.\n"); #endif - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_x, fx); - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_y, fy); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_x, fx); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_y, fy); rnd_conf_force_set_bool(conf_core.editor.show_solder_side, fs); RND_ACT_IRES(0); Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 31001) +++ trunk/src/polygon.c (revision 31002) @@ -1070,13 +1070,13 @@ u = ((X - ptr1->X) * dx + (Y - ptr1->Y) * dy) / (dx * dx + dy * dy); if (u < 0.0) { /* ptr1 is closest point */ - u = PCB_SQUARE(X - ptr1->X) + PCB_SQUARE(Y - ptr1->Y); + u = RND_SQUARE(X - ptr1->X) + RND_SQUARE(Y - ptr1->Y); } else if (u > 1.0) { /* ptr2 is closest point */ - u = PCB_SQUARE(X - ptr2->X) + PCB_SQUARE(Y - ptr2->Y); + u = RND_SQUARE(X - ptr2->X) + RND_SQUARE(Y - ptr2->Y); } else { /* projected intersection is closest point */ - u = PCB_SQUARE(X - ptr1->X * (1.0 - u) - u * ptr2->X) + PCB_SQUARE(Y - ptr1->Y * (1.0 - u) - u * ptr2->Y); + u = RND_SQUARE(X - ptr1->X * (1.0 - u) - u * ptr2->X) + RND_SQUARE(Y - ptr1->Y * (1.0 - u) - u * ptr2->Y); } if (u < mindistance) { mindistance = u; Index: trunk/src/polygon_act.c =================================================================== --- trunk/src/polygon_act.c (revision 31001) +++ trunk/src/polygon_act.c (revision 31002) @@ -98,7 +98,7 @@ RND_PCB_ACT_CONVARG(1, FGW_KEYWORD, Polygon, op = fgw_keyword(&argv[1])); - if ((argc > 1) && ((pcbhl_conf.editor.mode == pcb_crosshair.tool_poly) || (pcbhl_conf.editor.mode == pcb_crosshair.tool_poly_hole))) { + if ((argc > 1) && ((rnd_conf.editor.mode == pcb_crosshair.tool_poly) || (rnd_conf.editor.mode == pcb_crosshair.tool_poly_hole))) { rnd_hid_notify_crosshair_change(RND_ACT_HIDLIB, pcb_false); switch(op) { /* close open polygon if possible */ Index: trunk/src/rats_act.c =================================================================== --- trunk/src/rats_act.c (revision 31001) +++ trunk/src/rats_act.c (revision 31002) @@ -76,13 +76,13 @@ pcb_board_set_changed_flag(pcb_true); break; case F_Close: - small = PCB_SQUARE(RND_MAX_COORD); + small = RND_SQUARE(RND_MAX_COORD); shorty = NULL; PCB_RAT_LOOP(PCB->Data); { if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, line)) continue; - len = PCB_SQUARE(line->Point1.X - line->Point2.X) + PCB_SQUARE(line->Point1.Y - line->Point2.Y); + len = RND_SQUARE(line->Point1.X - line->Point2.X) + RND_SQUARE(line->Point1.Y - line->Point2.Y); if (len < small) { small = len; shorty = line; Index: trunk/src/route.c =================================================================== --- trunk/src/route.c (revision 31001) +++ trunk/src/route.c (revision 31002) @@ -133,8 +133,8 @@ p_object->layer = layer; p_object->type = PCB_OBJ_ARC; - p_route->end_point.X = rnd_round((double)center->X - ((double)radius * cos((start_angle + delta) * PCB_M180))); - p_route->end_point.Y = rnd_round((double)center->Y + ((double)radius * sin((start_angle + delta) * PCB_M180))); + p_route->end_point.X = rnd_round((double)center->X - ((double)radius * cos((start_angle + delta) * RND_M180))); + p_route->end_point.Y = rnd_round((double)center->Y + ((double)radius * sin((start_angle + delta) * RND_M180))); } @@ -200,8 +200,8 @@ p_out_obj->point1.X = xc; p_out_obj->point1.Y = yc; - p_out_obj->start_angle = start * PCB_RAD_TO_DEG; /* Start Angle */ - p_out_obj->delta_angle = delta * PCB_RAD_TO_DEG; /* Delta Angle */ + p_out_obj->start_angle = start * RND_RAD_TO_DEG; /* Start Angle */ + p_out_obj->delta_angle = delta * RND_RAD_TO_DEG; /* Delta Angle */ p_out_obj->radius = r; if (p_endpoint1) { @@ -244,10 +244,10 @@ else { m = (double)dy / dx; direction = 2; - if (m > PCB_TAN_30_DEGREE) - direction = m > PCB_TAN_60_DEGREE ? 0 : 1; - else if (m < -PCB_TAN_30_DEGREE) - direction = m < -PCB_TAN_60_DEGREE ? 0 : 3; + if (m > RND_TAN_30_DEGREE) + direction = m > RND_TAN_60_DEGREE ? 0 : 1; + else if (m < -RND_TAN_30_DEGREE) + direction = m < -RND_TAN_60_DEGREE ? 0 : 3; } if (dx < 0) @@ -707,10 +707,10 @@ delta = -delta; } - x1 = x - (cos(PCB_M180 * start_angle) * radius); - y1 = y + (sin(PCB_M180 * start_angle) * radius); - x2 = x - (cos(PCB_M180 * (start_angle + delta)) * radius); - y2 = y + (sin(PCB_M180 * (start_angle + delta)) * radius); + x1 = x - (cos(RND_M180 * start_angle) * radius); + y1 = y + (sin(RND_M180 * start_angle) * radius); + x2 = x - (cos(RND_M180 * (start_angle + delta)) * radius); + y2 = y + (sin(RND_M180 * (start_angle + delta)) * radius); rnd_render->draw_arc(GC, x, y, radius + wid, radius + wid, start_angle, delta); if (wid > rnd_pixel_slop) { Index: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 31001) +++ trunk/src/search.c (revision 31002) @@ -573,7 +573,7 @@ info.ptr1 = (void **) subc; info.ptr2 = (void **) Dummy1; info.ptr3 = (void **) Dummy2; - info.area = PCB_SQUARE(RND_MAX_COORD); + info.area = RND_SQUARE(RND_MAX_COORD); info.BackToo = (BackToo && PCB->InvisibleObjectsOn); info.objst = objst; info.req_flag = req_flag; @@ -1068,7 +1068,7 @@ /* Calculate angle of point from arc center */ double p_dist = rnd_distance(X, Y, Arc->X, Arc->Y); double p_cos = (X - Arc->X) / p_dist; - rnd_angle_t p_ang = acos(p_cos) * PCB_RAD_TO_DEG; + rnd_angle_t p_ang = acos(p_cos) * RND_RAD_TO_DEG; rnd_angle_t ang1, ang2; #define angle_in_range(r1, r2, ang) (((ang) >= (r1)) && ((ang) <= (r2))) @@ -1099,13 +1099,13 @@ either. */ if (!angle_in_range(ang1, ang2, p_ang) && !angle_in_range(ang1, ang2, p_ang+360)) { rnd_coord_t ArcX, ArcY; - ArcX = Arc->X + Arc->Width * cos((Arc->StartAngle + 180) / PCB_RAD_TO_DEG); - ArcY = Arc->Y - Arc->Height * sin((Arc->StartAngle + 180) / PCB_RAD_TO_DEG); + ArcX = Arc->X + Arc->Width * cos((Arc->StartAngle + 180) / RND_RAD_TO_DEG); + ArcY = Arc->Y - Arc->Height * sin((Arc->StartAngle + 180) / RND_RAD_TO_DEG); if (rnd_distance(X, Y, ArcX, ArcY) < Radius + Arc->Thickness / 2) return pcb_true; - ArcX = Arc->X + Arc->Width * cos((Arc->StartAngle + Arc->Delta + 180) / PCB_RAD_TO_DEG); - ArcY = Arc->Y - Arc->Height * sin((Arc->StartAngle + Arc->Delta + 180) / PCB_RAD_TO_DEG); + ArcX = Arc->X + Arc->Width * cos((Arc->StartAngle + Arc->Delta + 180) / RND_RAD_TO_DEG); + ArcY = Arc->Y - Arc->Height * sin((Arc->StartAngle + Arc->Delta + 180) / RND_RAD_TO_DEG); if (rnd_distance(X, Y, ArcX, ArcY) < Radius + Arc->Thickness / 2) return pcb_true; return pcb_false; Index: trunk/src/select.c =================================================================== --- trunk/src/select.c (revision 31001) +++ trunk/src/select.c (revision 31002) @@ -176,9 +176,9 @@ /* If board view is flipped, box coords need to be flipped too to reflect the on-screen direction of draw */ - if (pcbhl_conf.editor.view.flip_x) + if (rnd_conf.editor.view.flip_x) swap(Box->X1, Box->X2); - if (pcbhl_conf.editor.view.flip_y) + if (rnd_conf.editor.view.flip_y) swap(Box->Y1, Box->Y2); if ((force_pos) || (conf_core.editor.selection.disable_negative)) { @@ -223,7 +223,7 @@ long int *list = NULL; fix_box_dir(Box, 0); -/*pcb_printf("box: %mm %mm - %mm %mm [ %d ] %d %d\n", Box->X1, Box->Y1, Box->X2, Box->Y2, PCB_IS_BOX_NEGATIVE(Box), pcbhl_conf.editor.view.flip_x, pcbhl_conf.editor.view.flip_y);*/ +/*pcb_printf("box: %mm %mm - %mm %mm [ %d ] %d %d\n", Box->X1, Box->Y1, Box->X2, Box->Y2, PCB_IS_BOX_NEGATIVE(Box), rnd_conf.editor.view.flip_x, rnd_conf.editor.view.flip_y);*/ /* append an object to the return list OR set the flag if there's no list */ #define append(undo_type, p1, obj) \ Index: trunk/src/thermal.c =================================================================== --- trunk/src/thermal.c (revision 31001) +++ trunk/src/thermal.c (revision 31002) @@ -123,8 +123,8 @@ double sa, ea, da; pcb_arc_t atmp; - sa = atan2(-(e1y - cy), e1x - cx) * PCB_RAD_TO_DEG + 180.0; - ea = atan2(-(e2y - cy), e2x - cx) * PCB_RAD_TO_DEG + 180.0; + sa = atan2(-(e1y - cy), e1x - cx) * RND_RAD_TO_DEG + 180.0; + ea = atan2(-(e2y - cy), e2x - cx) * RND_RAD_TO_DEG + 180.0; /* rnd_trace("sa=%f ea=%f diff=%f\n", sa, ea, ea-sa);*/ Index: trunk/src/tool_logic.c =================================================================== --- trunk/src/tool_logic.c (revision 31001) +++ trunk/src/tool_logic.c (revision 31002) @@ -97,7 +97,7 @@ 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(pcbhl_conf.editor.mode)->user_flags & PCB_TLF_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"); was_rat = PCB->RatDraw; } Index: trunk/src_plugins/autoplace/autoplace.c =================================================================== --- trunk/src_plugins/autoplace/autoplace.c (revision 31001) +++ trunk/src_plugins/autoplace/autoplace.c (revision 31002) @@ -353,10 +353,10 @@ rnd_coord_t X, Y; obj = pcb_term_find_name(PCB, PCB->Data, PCB_LYT_COPPER, t->refdes, t->term, NULL, NULL); pcb_obj_center(obj, &X, &Y); - PCB_MAKE_MIN(minx, X); - PCB_MAKE_MAX(maxx, X); - PCB_MAKE_MIN(miny, Y); - PCB_MAKE_MAX(maxy, Y); + RND_MAKE_MIN(minx, X); + RND_MAKE_MAX(maxx, X); + RND_MAKE_MIN(miny, Y); + RND_MAKE_MAX(maxy, Y); if (!pstk_ispad((pcb_pstk_t *)obj)) allpads = pcb_false; if (obj_layergrp(obj) != thegroup) @@ -541,10 +541,10 @@ rnd_coord_t maxX = -RND_MAX_COORD, maxY = -RND_MAX_COORD; PCB_SUBC_LOOP(PCB->Data); { - PCB_MAKE_MIN(minX, subc->BoundingBox.X1); - PCB_MAKE_MIN(minY, subc->BoundingBox.Y1); - PCB_MAKE_MAX(maxX, subc->BoundingBox.X2); - PCB_MAKE_MAX(maxY, subc->BoundingBox.Y2); + RND_MAKE_MIN(minX, subc->BoundingBox.X1); + RND_MAKE_MIN(minY, subc->BoundingBox.Y1); + RND_MAKE_MAX(maxX, subc->BoundingBox.X2); + RND_MAKE_MAX(maxY, subc->BoundingBox.Y2); } PCB_END_LOOP; if (minX < maxX && minY < maxY) @@ -603,8 +603,8 @@ case 0: { /* shift! */ rnd_coord_t grid; - double scaleX = PCB_CLAMP(sqrt(T), PCB_MIL_TO_COORD(2.5), PCB->hidlib.size_x / 3); - double scaleY = PCB_CLAMP(sqrt(T), PCB_MIL_TO_COORD(2.5), PCB->hidlib.size_y / 3); + double scaleX = RND_CLAMP(sqrt(T), PCB_MIL_TO_COORD(2.5), PCB->hidlib.size_x / 3); + double scaleY = RND_CLAMP(sqrt(T), PCB_MIL_TO_COORD(2.5), PCB->hidlib.size_y / 3); pt.which = SHIFT; pt.DX = scaleX * 2 * ((((double) rnd_rand()) / RAND_MAX) - 0.5); pt.DY = scaleY * 2 * ((((double) rnd_rand()) / RAND_MAX) - 0.5); Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 31001) +++ trunk/src_plugins/autoroute/autoroute.c (revision 31002) @@ -890,9 +890,9 @@ pcb_line_t fake_line = *line; rnd_coord_t dx = (line->Point2.X - line->Point1.X); rnd_coord_t dy = (line->Point2.Y - line->Point1.Y); - int segs = MAX(PCB_ABS(dx), PCB_ABS(dy)) / (4 * rd->max_bloat + 1); + int segs = MAX(RND_ABS(dx), RND_ABS(dy)) / (4 * rd->max_bloat + 1); int qq; - segs = PCB_CLAMP(segs, 1, 32); /* don't go too crazy */ + segs = RND_CLAMP(segs, 1, 32); /* don't go too crazy */ dx /= segs; dy /= segs; for (qq = 0; qq < segs - 1; qq++) { @@ -953,9 +953,9 @@ pcb_line_t fake_line = *line; rnd_coord_t dx = (line->Point2.X - line->Point1.X); rnd_coord_t dy = (line->Point2.Y - line->Point1.Y); - int segs = MAX(PCB_ABS(dx), PCB_ABS(dy)) / (4 * BLOAT(rd->styles[j]) + 1); + int segs = MAX(RND_ABS(dx), RND_ABS(dy)) / (4 * BLOAT(rd->styles[j]) + 1); int qq; - segs = PCB_CLAMP(segs, 1, 32); /* don't go too crazy */ + segs = RND_CLAMP(segs, 1, 32); /* don't go too crazy */ dx /= segs; dy /= segs; for (qq = 0; qq < segs - 1; qq++) { @@ -1284,7 +1284,7 @@ x_dist *= x_cost[point_layer]; y_dist *= y_cost[point_layer]; /* cost is proportional to orthogonal distance. */ - r = PCB_ABS(x_dist) + PCB_ABS(y_dist); + r = RND_ABS(x_dist) + RND_ABS(y_dist); if (p1->X != p2->X && p1->Y != p2->Y) r += AutoRouteParameters.JogPenalty; return r; @@ -1310,8 +1310,8 @@ c1 = p2.X - p->X; c2 = p2.Y - p->Y; - c1 = PCB_ABS(c1); - c2 = PCB_ABS(c2); + c1 = RND_ABS(c1); + c2 = RND_ABS(c2); if (c1 < c2) return c1 * AutoRouteParameters.MinPenalty + c2; else @@ -1345,12 +1345,12 @@ trial += AutoRouteParameters.JogPenalty; /* special case for defered via searching */ if (point_layer > pcb_max_group(PCB) || point_layer == rb->group) - return trial + PCB_ABS(p2.X - p->X) + PCB_ABS(p2.Y - p->Y); + return trial + RND_ABS(p2.X - p->X) + RND_ABS(p2.Y - p->Y); /* if this target is only a via away, then the via is cheaper than the congestion */ if (p->X == p2.X && p->Y == p2.Y) return trial + 1; trial += AutoRouteParameters.ViaCost; - trial += PCB_ABS(p2.X - p->X) + PCB_ABS(p2.Y - p->Y); + trial += RND_ABS(p2.X - p->X) + RND_ABS(p2.Y - p->Y); return trial; } @@ -3011,7 +3011,7 @@ return; /* but not this! */ rb = (routebox_t *) malloc(sizeof(*rb)); memset((void *) rb, 0, sizeof(*rb)); - assert(is_45 ? (PCB_ABS(qX2 - qX1) == PCB_ABS(qY2 - qY1)) /* line must be 45-degrees */ + assert(is_45 ? (RND_ABS(qX2 - qX1) == RND_ABS(qY2 - qY1)) /* line must be 45-degrees */ : (qX1 == qX2 || qY1 == qY2) /* line must be ortho */ ); init_const_box(rb, /*X1 */ MIN(qX1, qX2) - qhthick, @@ -3108,7 +3108,7 @@ } else { /* draw 45-degree path across knee */ - rnd_coord_t len45 = MIN(PCB_ABS(start.X - end.X), PCB_ABS(start.Y - end.Y)); + rnd_coord_t len45 = MIN(RND_ABS(start.X - end.X), RND_ABS(start.Y - end.Y)); rnd_cheap_point_t kneestart = knee, kneeend = knee; if (kneestart.X == start.X) kneestart.Y += (kneestart.Y > start.Y) ? -len45 : len45; @@ -4214,10 +4214,10 @@ rnd_rnd_box_t bb = shrink_routebox(net); LIST_LOOP(net, same_net, p); { - PCB_MAKE_MIN(bb.X1, p->sbox.X1); - PCB_MAKE_MIN(bb.Y1, p->sbox.Y1); - PCB_MAKE_MAX(bb.X2, p->sbox.X2); - PCB_MAKE_MAX(bb.Y2, p->sbox.Y2); + RND_MAKE_MIN(bb.X1, p->sbox.X1); + RND_MAKE_MIN(bb.Y1, p->sbox.Y1); + RND_MAKE_MAX(bb.X2, p->sbox.X2); + RND_MAKE_MAX(bb.Y2, p->sbox.Y2); } PCB_END_LOOP; area = (double) (bb.X2 - bb.X1) * (bb.Y2 - bb.Y1); Index: trunk/src_plugins/autoroute/mtspace.c =================================================================== --- trunk/src_plugins/autoroute/mtspace.c (revision 31001) +++ trunk/src_plugins/autoroute/mtspace.c (revision 31002) @@ -198,7 +198,7 @@ rnd_cheap_point_t p = *desired; assert(desired); rnd_closest_cheap_point_in_box(&p, newone); - rnd_heap_insert(heap, PCB_ABS(p.X - desired->X) + (p.Y - desired->Y), newone); + rnd_heap_insert(heap, RND_ABS(p.X - desired->X) + (p.Y - desired->Y), newone); } static inline void append(struct query_closure *qc, rnd_rnd_box_t * newone) Index: trunk/src_plugins/ddraft/centgeo.c =================================================================== --- trunk/src_plugins/ddraft/centgeo.c (revision 31001) +++ trunk/src_plugins/ddraft/centgeo.c (revision 31002) @@ -273,7 +273,7 @@ void pcb_carc_offs(pcb_arc_t *arc, double offs, rnd_coord_t *dstx, rnd_coord_t *dsty) { - double ang = (arc->StartAngle + offs * arc->Delta) / PCB_RAD_TO_DEG; + double ang = (arc->StartAngle + offs * arc->Delta) / RND_RAD_TO_DEG; *dstx = arc->X + cos(ang) * arc->Width; *dsty = arc->Y - sin(ang) * arc->Height; @@ -286,7 +286,7 @@ /* won't work with elliptical arc - see also pcb_is_point_on_arc */ dy = (double)(py - arc->Y) / (double)arc->Height; dx = (double)(px - arc->X) / (double)arc->Width; - ang = (-atan2(dy, dx)) * PCB_RAD_TO_DEG + 180; + ang = (-atan2(dy, dx)) * RND_RAD_TO_DEG + 180; end = arc->StartAngle + arc->Delta; /* normalize the angle: there are multiple ways an arc can cover the same @@ -313,10 +313,10 @@ static void get_arc_ends(rnd_coord_t *box, pcb_arc_t *arc) { - box[0] = arc->X - arc->Width * cos(PCB_M180 * arc->StartAngle); - box[1] = arc->Y + arc->Height * sin(PCB_M180 * arc->StartAngle); - box[2] = arc->X - arc->Width * cos(PCB_M180 * (arc->StartAngle + arc->Delta)); - box[3] = arc->Y + arc->Height * sin(PCB_M180 * (arc->StartAngle + arc->Delta)); + box[0] = arc->X - arc->Width * cos(RND_M180 * arc->StartAngle); + box[1] = arc->Y + arc->Height * sin(RND_M180 * arc->StartAngle); + box[2] = arc->X - arc->Width * cos(RND_M180 * (arc->StartAngle + arc->Delta)); + box[3] = arc->Y + arc->Height * sin(RND_M180 * (arc->StartAngle + arc->Delta)); } /* reduce arc start angle and delta to 0..360 */ @@ -333,7 +333,7 @@ static int radius_crosses_arc(double x, double y, pcb_arc_t *arc) { - double alpha = atan2(y - arc->Y, -x + arc->X) * PCB_RAD_TO_DEG; + double alpha = atan2(y - arc->Y, -x + arc->X) * RND_RAD_TO_DEG; rnd_angle_t sa = arc->StartAngle, d = arc->Delta; normalize_angles(&sa, &d); Index: trunk/src_plugins/ddraft/cli.c =================================================================== --- trunk/src_plugins/ddraft/cli.c (revision 31001) +++ trunk/src_plugins/ddraft/cli.c (revision 31002) @@ -202,7 +202,7 @@ } memcpy(tmp, s, sep-s); tmp[sep-s] = '\0'; - dst[i-1].x = pcb_get_value_ex(tmp, NULL, NULL, NULL, pcbhl_conf.editor.grid_unit->suffix, &succ); + dst[i-1].x = pcb_get_value_ex(tmp, NULL, NULL, NULL, rnd_conf.editor.grid_unit->suffix, &succ); if (!succ) dst[i-1].invalid = 1; @@ -213,12 +213,12 @@ } memcpy(tmp, sep, next-sep); tmp[next-sep] = '\0'; - dst[i-1].y = pcb_get_value_ex(tmp, NULL, NULL, NULL, pcbhl_conf.editor.grid_unit->suffix, &succ); + dst[i-1].y = pcb_get_value_ex(tmp, NULL, NULL, NULL, rnd_conf.editor.grid_unit->suffix, &succ); if (!succ) dst[i-1].invalid = 1; break; case CLI_DIST: - dst[i-1].dist = pcb_get_value_ex(s, NULL, NULL, NULL, pcbhl_conf.editor.grid_unit->suffix, &succ); + dst[i-1].dist = pcb_get_value_ex(s, NULL, NULL, NULL, rnd_conf.editor.grid_unit->suffix, &succ); dst[i-1].invalid = !succ; dst[i-1].end = next - line; break; @@ -413,8 +413,8 @@ goto over; apply:; if (have_angle && have_dist) { - x += cos(angle / PCB_RAD_TO_DEG) * dist; - y += sin(angle / PCB_RAD_TO_DEG) * dist; + x += cos(angle / RND_RAD_TO_DEG) * dist; + y += sin(angle / RND_RAD_TO_DEG) * dist; have_angle = have_dist = 0; moved = 1; } @@ -431,7 +431,7 @@ c[2] = rnd_round(x); c[3] = rnd_round(y); } - angle = atan2(y - ly, x - lx) * PCB_RAD_TO_DEG; + angle = atan2(y - ly, x - lx) * RND_RAD_TO_DEG; lx = x; ly = y; len++; Index: trunk/src_plugins/ddraft/cli_line.c =================================================================== --- trunk/src_plugins/ddraft/cli_line.c (revision 31001) +++ trunk/src_plugins/ddraft/cli_line.c (revision 31002) @@ -166,7 +166,7 @@ return 0; } replace=1; - pcb_snprintf(buff, sizeof(buff), "<%f", atan2(pcb_crosshair.Y - oy, pcb_crosshair.X - ox) * PCB_RAD_TO_DEG); + pcb_snprintf(buff, sizeof(buff), "<%f", atan2(pcb_crosshair.Y - oy, pcb_crosshair.X - ox) * RND_RAD_TO_DEG); break; case CLI_DIST: res = get_rel_coord(argc, argv, argn, &ox, &oy); Index: trunk/src_plugins/ddraft/constraint.c =================================================================== --- trunk/src_plugins/ddraft/constraint.c (revision 31001) +++ trunk/src_plugins/ddraft/constraint.c (revision 31002) @@ -46,7 +46,7 @@ double diff, ang, best_diff, target_ang; int n, best; - ang = atan2(y2 - y1, x2 - x1) * PCB_RAD_TO_DEG; + ang = atan2(y2 - y1, x2 - x1) * RND_RAD_TO_DEG; if (anglen > 0) { /* find the best matching constraint angle */ @@ -73,7 +73,7 @@ if (angle_mod > 0) target_ang = floor(target_ang / angle_mod) * angle_mod; - target_ang /= PCB_RAD_TO_DEG; + target_ang /= RND_RAD_TO_DEG; *out_ang = target_ang; return 0; } Index: trunk/src_plugins/ddraft/ddraft.c =================================================================== --- trunk/src_plugins/ddraft/ddraft.c (revision 31001) +++ trunk/src_plugins/ddraft/ddraft.c (revision 31002) @@ -365,7 +365,7 @@ } cons.line_angle_len = 2; - cons.line_angle[0] = atan2(dy, dx) * PCB_RAD_TO_DEG; + cons.line_angle[0] = atan2(dy, dx) * RND_RAD_TO_DEG; if (actname[1] == 'e') /* perp */ cons.line_angle[0] += 90; cons.line_angle[1] = fmod(cons.line_angle[0]+180, 360); @@ -433,8 +433,8 @@ base = atan2(arc->Y - line->point1.Y, arc->X - line->point1.X); cons.line_angle_len = 2; - cons.line_angle[0] = (base + asin(r / d)) * PCB_RAD_TO_DEG; - cons.line_angle[1] = (base + asin(-r / d)) * PCB_RAD_TO_DEG; + cons.line_angle[0] = (base + asin(r / d)) * RND_RAD_TO_DEG; + cons.line_angle[1] = (base + asin(-r / d)) * RND_RAD_TO_DEG; cons_changed(); RND_ACT_IRES(0); @@ -521,7 +521,7 @@ { static int ddraft_tool_selected = 0; - if (pcbhl_conf.editor.mode == pcb_ddraft_tool) { + if (rnd_conf.editor.mode == pcb_ddraft_tool) { if (!ddraft_tool_selected) { ddraft_tool_selected = 1; rnd_cli_enter("ddraft", "ddraft"); Index: trunk/src_plugins/dialogs/dlg_loadsave.c =================================================================== --- trunk/src_plugins/dialogs/dlg_loadsave.c (revision 31001) +++ trunk/src_plugins/dialogs/dlg_loadsave.c (revision 31002) @@ -85,7 +85,7 @@ } if (name != NULL) { - if (pcbhl_conf.rc.verbose) + if (rnd_conf.rc.verbose) fprintf(stderr, "Load: Calling LoadFrom(%s, %s)\n", function, name); rnd_actionva(RND_ACT_HIDLIB, "LoadFrom", function, name, NULL); free(name); @@ -586,7 +586,7 @@ } - if (pcbhl_conf.rc.verbose) + if (rnd_conf.rc.verbose) fprintf(stderr, "Save: Calling SaveTo(%s, %s)\n", function, final_name); if (rnd_strcasecmp(function, "PasteBuffer") == 0) { Index: trunk/src_plugins/dialogs/dlg_pref_win.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_win.c (revision 31001) +++ trunk/src_plugins/dialogs/dlg_pref_win.c (revision 31002) @@ -38,7 +38,7 @@ static void pref_win_brd2dlg(pref_ctx_t *ctx) { - RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wmaster, lng, pcbhl_conf.editor.auto_place); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wmaster, lng, rnd_conf.editor.auto_place); RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wboard, lng, dialogs_conf.plugins.dialogs.auto_save_window_geometry.to_design); RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wproject, lng, dialogs_conf.plugins.dialogs.auto_save_window_geometry.to_project); RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wuser, lng, dialogs_conf.plugins.dialogs.auto_save_window_geometry.to_user); Index: trunk/src_plugins/dialogs/dlg_view.c =================================================================== --- trunk/src_plugins/dialogs/dlg_view.c (revision 31001) +++ trunk/src_plugins/dialogs/dlg_view.c (revision 31002) @@ -175,9 +175,9 @@ break; case PCB_VIEW_DRC: if (v->data.drc.have_measured) - RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wmeasure, str, pcb_strdup_printf("DRC: %m+required: %$ms\nmeasured: %$ms\n", pcbhl_conf.editor.grid_unit->allow, v->data.drc.required_value, v->data.drc.measured_value)); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wmeasure, str, pcb_strdup_printf("DRC: %m+required: %$ms\nmeasured: %$ms\n", rnd_conf.editor.grid_unit->allow, v->data.drc.required_value, v->data.drc.measured_value)); else - RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wmeasure, str, pcb_strdup_printf("DRC: %m+required: %$ms\n", pcbhl_conf.editor.grid_unit->allow, v->data.drc.required_value)); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wmeasure, str, pcb_strdup_printf("DRC: %m+required: %$ms\n", rnd_conf.editor.grid_unit->allow, v->data.drc.required_value)); break; } } Index: trunk/src_plugins/djopt/djopt.c =================================================================== --- trunk/src_plugins/djopt/djopt.c (revision 31001) +++ trunk/src_plugins/djopt/djopt.c (revision 31002) @@ -240,7 +240,7 @@ { if (n <= 0) return 0; - return n - n % (pcbhl_conf.editor.grid); + return n - n % (rnd_conf.editor.grid); } /* Avoid commonly used names. */ @@ -1357,9 +1357,9 @@ len = c->x + max; break; } - if (snap && max > pcbhl_conf.editor.grid) { + if (snap && max > rnd_conf.editor.grid) { if (pull < 0) - len += pcbhl_conf.editor.grid - 1; + len += rnd_conf.editor.grid - 1; len = gridsnap(len); } if ((fdir == RIGHT && len == cs[0]->y) || (fdir == DOWN && len == cs[0]->x)) @@ -1995,13 +1995,13 @@ } #if 0 - if (dist < pcbhl_conf.editor.grid) { + if (dist < rnd_conf.editor.grid) { c->miter = 0; progress = 1; continue; } - dist -= dist % pcbhl_conf.editor.grid; + dist -= dist % rnd_conf.editor.grid; #endif if (dist <= 0) { c->miter = 0; Index: trunk/src_plugins/draw_csect/draw_csect.c =================================================================== --- trunk/src_plugins/draw_csect/draw_csect.c (revision 31001) +++ trunk/src_plugins/draw_csect/draw_csect.c (revision 31002) @@ -54,8 +54,8 @@ static const char *COLOR_MISC_ = "#e0e000"; static const char *COLOR_OUTLINE_ = "#000000"; -#define COLOR_ANNOT pcbhl_conf.appearance.color.grid -#define COLOR_BG pcbhl_conf.appearance.color.background +#define COLOR_ANNOT rnd_conf.appearance.color.grid +#define COLOR_BG rnd_conf.appearance.color.background static rnd_color_t COLOR_COPPER, COLOR_SUBSTRATE, COLOR_SILK, COLOR_MASK, Index: trunk/src_plugins/draw_fab/draw_fab.c =================================================================== --- trunk/src_plugins/draw_fab/draw_fab.c (revision 31001) +++ trunk/src_plugins/draw_fab/draw_fab.c (revision 31002) @@ -207,7 +207,7 @@ char utcTime[64]; AllDrills = drill_get_info(PCB->Data); - if (pcbhl_conf.editor.grid_unit->family == PCB_UNIT_IMPERIAL) + if (rnd_conf.editor.grid_unit->family == PCB_UNIT_IMPERIAL) drill_round_info(AllDrills, PCB_MIL_TO_COORD(1)); else drill_round_info(AllDrills, PCB_MM_TO_COORD(0.01)); @@ -263,12 +263,12 @@ text_at(info, gc, PCB_MIL_TO_COORD(980), yoff, PCB_MIL_TO_COORD(2), "%d", drill->UnplatedCount); } rnd_render->set_color(gc, &conf_core.appearance.color.element); - if (pcbhl_conf.editor.grid_unit->family == PCB_UNIT_IMPERIAL) + if (rnd_conf.editor.grid_unit->family == PCB_UNIT_IMPERIAL) text_at(info, gc, PCB_MIL_TO_COORD(450), yoff, PCB_MIL_TO_COORD(2), "%0.3f", PCB_COORD_TO_INCH(drill->DrillSize)); else text_at(info, gc, PCB_MIL_TO_COORD(450), yoff, PCB_MIL_TO_COORD(2), "%1.2f", PCB_COORD_TO_MM(drill->DrillSize)); if (plated_sym != -1 && unplated_sym != -1) { - if (pcbhl_conf.editor.grid_unit->family == PCB_UNIT_IMPERIAL) + if (rnd_conf.editor.grid_unit->family == PCB_UNIT_IMPERIAL) text_at(info, gc, PCB_MIL_TO_COORD(450), yoff + TEXT_LINE, PCB_MIL_TO_COORD(2), "%0.3f", PCB_COORD_TO_INCH(drill->DrillSize)); else text_at(info, gc, PCB_MIL_TO_COORD(450), yoff + TEXT_LINE, PCB_MIL_TO_COORD(2), "%1.2f", PCB_COORD_TO_MM(drill->DrillSize)); @@ -280,7 +280,7 @@ rnd_render->set_color(gc, &conf_core.appearance.color.element); text_at(info, gc, 0, yoff, PCB_MIL_TO_COORD(9), "Symbol"); - if (pcbhl_conf.editor.grid_unit->family == PCB_UNIT_IMPERIAL) + if (rnd_conf.editor.grid_unit->family == PCB_UNIT_IMPERIAL) text_at(info, gc, PCB_MIL_TO_COORD(410), yoff, PCB_MIL_TO_COORD(9), "Diam. (Inch)"); else text_at(info, gc, PCB_MIL_TO_COORD(410), yoff, PCB_MIL_TO_COORD(9), "Diam. (mm)"); Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 31001) +++ trunk/src_plugins/export_gerber/gerber.c (revision 31002) @@ -105,7 +105,7 @@ break; case OCTAGON: pcb_fprintf(f, "%%AMOCT%d*5,0,8,0,0,%[5],22.5*%%\r\n" - "%%ADD%dOCT%d*%%\r\n", aptr->dCode, (rnd_coord_t) ((double) aptr->width / PCB_COS_22_5_DEGREE), aptr->dCode, aptr->dCode); + "%%ADD%dOCT%d*%%\r\n", aptr->dCode, (rnd_coord_t) ((double) aptr->width / RND_COS_22_5_DEGREE), aptr->dCode, aptr->dCode); break; } } @@ -347,7 +347,7 @@ if (!fnbase) fnbase = "pcb-out"; - verbose = options[HA_verbose].lng || pcbhl_conf.rc.verbose; + verbose = options[HA_verbose].lng || rnd_conf.rc.verbose; all_layers = options[HA_all_layers].lng; copy_outline_mode = options[HA_copy_outline].lng; @@ -887,8 +887,8 @@ } - arcStartX = cx - width * cos(PCB_TO_RADIANS(start_angle)); - arcStartY = cy + height * sin(PCB_TO_RADIANS(start_angle)); + arcStartX = cx - width * cos(RND_TO_RADIANS(start_angle)); + arcStartY = cy + height * sin(RND_TO_RADIANS(start_angle)); if (fabs(delta_angle) < 0.01) { gerber_draw_line(gc, arcStartX, arcStartY, arcStartX, arcStartY); @@ -920,8 +920,8 @@ angle = start_angle; while (nsteps > 0) { nsteps--; - x1 = cx - width * cos(PCB_TO_RADIANS(angle + step)); - y1 = cy + height * sin(PCB_TO_RADIANS(angle + step)); + x1 = cx - width * cos(RND_TO_RADIANS(angle + step)); + y1 = cy + height * sin(RND_TO_RADIANS(angle + step)); gerber_draw_line(gc, x0, y0, x1, y1); x0 = x1; y0 = y1; @@ -930,8 +930,8 @@ return; } - arcStopX = cx - width * cos(PCB_TO_RADIANS(start_angle + delta_angle)); - arcStopY = cy + height * sin(PCB_TO_RADIANS(start_angle + delta_angle)); + arcStopX = cx - width * cos(RND_TO_RADIANS(start_angle + delta_angle)); + arcStopY = cy + height * sin(RND_TO_RADIANS(start_angle + delta_angle)); if (arcStartX != lastX) { m = pcb_true; lastX = arcStartX; Index: trunk/src_plugins/export_ipcd356/ipcd356.c =================================================================== --- trunk/src_plugins/export_ipcd356/ipcd356.c (revision 31001) +++ trunk/src_plugins/export_ipcd356/ipcd356.c (revision 31002) @@ -337,7 +337,7 @@ t.cx = (line->Point1.X + line->Point2.X) / 2; t.cy = (line->Point1.Y + line->Point2.Y) / 2; t.width = t.height = line->Thickness; - t.rot = atan2(line->Point2.Y - line->Point1.Y, line->Point2.X - line->Point1.X) * PCB_RAD_TO_DEG; + t.rot = atan2(line->Point2.Y - line->Point1.Y, line->Point2.X - line->Point1.X) * RND_RAD_TO_DEG; ipcd356_write_feature(ctx, &t); } @@ -375,7 +375,7 @@ ctx.pcb = pcb; ctx.f = f; - ctx.is_mil = (strcmp(pcbhl_conf.editor.grid_unit->suffix, "mil") == 0); + ctx.is_mil = (strcmp(rnd_conf.editor.grid_unit->suffix, "mil") == 0); ipcd356_write_head(&ctx); PCB_SUBC_LOOP(pcb->Data); { Index: trunk/src_plugins/export_openscad/export_openscad.c =================================================================== --- trunk/src_plugins/export_openscad/export_openscad.c (revision 31001) +++ trunk/src_plugins/export_openscad/export_openscad.c (revision 31002) @@ -509,7 +509,7 @@ cap_style = "rc"; pcb_fprintf(f, " pcb_line_%s(%mm, %mm, %mm, %f, %mm, %f);\n", cap_style, - x1, y1, (rnd_coord_t)rnd_round(length), angle * PCB_RAD_TO_DEG, gc->width, effective_layer_thickness); + x1, y1, (rnd_coord_t)rnd_round(length), angle * RND_RAD_TO_DEG, gc->width, effective_layer_thickness); } static void openscad_draw_rect(rnd_hid_gc_t gc, rnd_coord_t x1, rnd_coord_t y1, rnd_coord_t x2, rnd_coord_t y2) @@ -544,8 +544,8 @@ TODO("use the central arc approximation instead"); for(first = 1, a = start_angle; step > 0 ? (a < end_angle) : (a > end_angle); a += step) { - x = (double)cx + cos((180-a) / PCB_RAD_TO_DEG) * (double)width; - y = (double)cy + sin((180-a) / PCB_RAD_TO_DEG) * (double)height; + x = (double)cx + cos((180-a) / RND_RAD_TO_DEG) * (double)width; + y = (double)cy + sin((180-a) / RND_RAD_TO_DEG) * (double)height; if (!first) { fprintf(f, "\t"); openscad_draw_line(gc, lx, ly, x, y); @@ -555,8 +555,8 @@ first = 0; } if (!first) { - x = (double)cx + cos((180 - end_angle) / PCB_RAD_TO_DEG) * (double)width; - y = (double)cy + sin((180 - end_angle) / PCB_RAD_TO_DEG) * (double)height; + x = (double)cx + cos((180 - end_angle) / RND_RAD_TO_DEG) * (double)width; + y = (double)cy + sin((180 - end_angle) / RND_RAD_TO_DEG) * (double)height; fprintf(f, "\t"); openscad_draw_line(gc, lx, ly, x, y); } Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 31001) +++ trunk/src_plugins/export_ps/ps.c (revision 31002) @@ -534,7 +534,7 @@ global.automirror = options[HA_automirror].lng; global.incolor = options[HA_color].lng; global.invert = options[HA_psinvert].lng; - global.fade_ratio = PCB_CLAMP(options[HA_psfade].dbl, 0, 1); + global.fade_ratio = RND_CLAMP(options[HA_psfade].dbl, 0, 1); global.media_idx = options[HA_media].lng; global.media_width = pcb_media_data[global.media_idx].width; global.media_height = pcb_media_data[global.media_idx].height; Index: trunk/src_plugins/export_xy/xy.c =================================================================== --- trunk/src_plugins/export_xy/xy.c (revision 31001) +++ trunk/src_plugins/export_xy/xy.c (revision 31002) @@ -139,8 +139,8 @@ /* set default unit and filename */ if (xy_options[HA_unit].default_val.lng == last_unit_value) { - if (pcbhl_conf.editor.grid_unit) - xy_options[HA_unit].default_val.lng = pcbhl_conf.editor.grid_unit->index; + if (rnd_conf.editor.grid_unit) + xy_options[HA_unit].default_val.lng = rnd_conf.editor.grid_unit->index; else xy_options[HA_unit].default_val.lng = get_unit_struct("mil")->index; last_unit_value = xy_options[HA_unit].default_val.lng; @@ -301,7 +301,7 @@ } sc_rot0 = pcb_subc_dup_at(NULL, tmp, ctx->subc, 0, 0, 0); - ang = ctx->theta / PCB_RAD_TO_DEG; + ang = ctx->theta / RND_RAD_TO_DEG; pcb_subc_rotate(sc_rot0, 0, 0, cos(ang), sin(ang), ctx->theta); save = ctx->subc; Index: trunk/src_plugins/exto_std/bus.c =================================================================== --- trunk/src_plugins/exto_std/bus.c (revision 31001) +++ trunk/src_plugins/exto_std/bus.c (revision 31002) @@ -176,7 +176,7 @@ if (c1) { double a0 = atan2(l->Point1.Y - l->Point2.Y, l->Point1.X - l->Point2.X); -/*rnd_trace("c1 a0=%f a1=%f\n", a0 * PCB_RAD_TO_DEG, a1 * PCB_RAD_TO_DEG);*/ +/*rnd_trace("c1 a0=%f a1=%f\n", a0 * RND_RAD_TO_DEG, a1 * RND_RAD_TO_DEG);*/ a1 = a1 - a0; tune1 = tan(a1/2.0); } @@ -185,7 +185,7 @@ if (c2) { double a0 = atan2(l->Point2.Y - l->Point1.Y, l->Point2.X - l->Point1.X); -/*rnd_trace("c1 a0=%f a2=%f\n", a0 * PCB_RAD_TO_DEG, a2 * PCB_RAD_TO_DEG);*/ +/*rnd_trace("c1 a0=%f a2=%f\n", a0 * RND_RAD_TO_DEG, a2 * RND_RAD_TO_DEG);*/ a2 = a2 - a0; tune2 = tan(a2/2.0); } @@ -192,7 +192,7 @@ else tune2 = 0; -/* rnd_trace("tune: %f:%f %f:%f\n", a1 * PCB_RAD_TO_DEG, tune1, a2 * PCB_RAD_TO_DEG, tune2);*/ +/* rnd_trace("tune: %f:%f %f:%f\n", a1 * RND_RAD_TO_DEG, tune1, a2 * RND_RAD_TO_DEG, tune2);*/ for(n = 0; n < bus->width; n++,o-=bus->pitch) { double o2 = -o; Index: trunk/src_plugins/exto_std/dimension.c =================================================================== --- trunk/src_plugins/exto_std/dimension.c (revision 31001) +++ trunk/src_plugins/exto_std/dimension.c (revision 31002) @@ -221,10 +221,10 @@ ty = t->BoundingBox.Y2 - t->BoundingBox.Y1; ang = atan2(-dim->dy, dim->dx) + M_PI; - deg = ang * PCB_RAD_TO_DEG; + deg = ang * RND_RAD_TO_DEG; if ((deg > 135) && (deg < 315)) { ang = ang-M_PI; - deg = ang * PCB_RAD_TO_DEG; + deg = ang * RND_RAD_TO_DEG; rotsign = -1; } else Index: trunk/src_plugins/hid_batch/batch.c =================================================================== --- trunk/src_plugins/hid_batch/batch.c (revision 31001) +++ trunk/src_plugins/hid_batch/batch.c (revision 31002) @@ -81,7 +81,7 @@ static void log_append(rnd_logline_t *line) { - if ((line->level < RND_MSG_INFO) && !pcbhl_conf.rc.verbose) + if ((line->level < RND_MSG_INFO) && !rnd_conf.rc.verbose) return; if ((line->prev == NULL) || (line->prev->str[line->prev->len-1] == '\n')) { @@ -129,7 +129,7 @@ log_import(); - if ((interactive) && (!pcbhl_conf.rc.quiet)) { + if ((interactive) && (!rnd_conf.rc.quiet)) { printf("Entering %s version %s batch mode.\n", rnd_app_package, rnd_app_version); printf("See %s for project information\n", rnd_app_url); } @@ -136,7 +136,7 @@ batch_stay = 1; while (batch_stay) { - if ((interactive) && (!pcbhl_conf.rc.quiet)) { + if ((interactive) && (!rnd_conf.rc.quiet)) { printf("%s:%s> ", prompt, rnd_cli_prompt(NULL)); fflush(stdout); } Index: trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c =================================================================== --- trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 31001) +++ trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 31002) @@ -124,7 +124,7 @@ rv = g_new0(rnd_hid_gc_s, 1); rv->me_pointer = >k2_gdk_hid; - rv->pcolor = pcbhl_conf.appearance.color.background; + rv->pcolor = rnd_conf.appearance.color.background; return rv; } @@ -271,7 +271,7 @@ if (!pcb_conf_hid_gtk.plugins.hid_gtk.local_grid.enable) return; - if ((Vz(hidlib->grid) < RND_MIN_GRID_DISTANCE) || (!pcbhl_conf.editor.draw_grid)) + if ((Vz(hidlib->grid) < RND_MIN_GRID_DISTANCE) || (!rnd_conf.editor.draw_grid)) return; /* cx and cy are the actual cursor snapped to wherever - round them to the nearest real grid point */ @@ -292,13 +292,13 @@ grid_local_have_old = 0; - if (!pcbhl_conf.editor.draw_grid) + if (!rnd_conf.editor.draw_grid) return; if (colormap == NULL) colormap = gtk_widget_get_colormap(ghidgui->port.top_window); if (!priv->grid_gc) { - if (gdk_color_parse(pcbhl_conf.appearance.color.grid.str, &priv->grid_color)) { + if (gdk_color_parse(rnd_conf.appearance.color.grid.str, &priv->grid_color)) { priv->grid_color.red ^= priv->bg_color.red; priv->grid_color.green ^= priv->bg_color.green; priv->grid_color.blue ^= priv->bg_color.blue; @@ -448,7 +448,7 @@ render_priv_t *priv = ghidgui->port.render_priv; /* The color grid is combined with background color */ - map_color(&pcbhl_conf.appearance.color.grid, &priv->grid_color); + map_color(&rnd_conf.appearance.color.grid, &priv->grid_color); priv->grid_color.red = (priv->grid_color.red ^ priv->bg_color.red) & 0xffff; priv->grid_color.green = (priv->grid_color.green ^ priv->bg_color.green) & 0xffff; priv->grid_color.blue = (priv->grid_color.blue ^ priv->bg_color.blue) & 0xffff; @@ -463,17 +463,17 @@ { render_priv_t *priv = ghidgui->port.render_priv; - if (((RND_CFT_COLOR *)cfg->val.color == &pcbhl_conf.appearance.color.background) && priv->bg_gc) { + if (((RND_CFT_COLOR *)cfg->val.color == &rnd_conf.appearance.color.background) && priv->bg_gc) { if (map_color(&cfg->val.color[0], &priv->bg_color)) { gdk_gc_set_foreground(priv->bg_gc, &priv->bg_color); set_special_grid_color(); } } - else if (((RND_CFT_COLOR *)cfg->val.color == &pcbhl_conf.appearance.color.off_limit) && priv->offlimits_gc) { + else if (((RND_CFT_COLOR *)cfg->val.color == &rnd_conf.appearance.color.off_limit) && priv->offlimits_gc) { if (map_color(&cfg->val.color[0], &priv->offlimits_color)) gdk_gc_set_foreground(priv->offlimits_gc, &priv->offlimits_color); } - else if (((RND_CFT_COLOR *)cfg->val.color == &pcbhl_conf.appearance.color.grid) && priv->grid_gc) { + else if (((RND_CFT_COLOR *)cfg->val.color == &rnd_conf.appearance.color.grid) && priv->grid_gc) { if (map_color(&cfg->val.color[0], &priv->grid_color)) set_special_grid_color(); } @@ -692,11 +692,11 @@ delta_angle = 360; } - if (pcbhl_conf.editor.view.flip_x) { + if (rnd_conf.editor.view.flip_x) { start_angle = 180 - start_angle; delta_angle = -delta_angle; } - if (pcbhl_conf.editor.view.flip_y) { + if (rnd_conf.editor.view.flip_y) { start_angle = -start_angle; delta_angle = -delta_angle; } @@ -878,7 +878,7 @@ points = (GdkPoint *) realloc(points, npoints * sizeof(GdkPoint)); } for (len = i = 0; i < n_coords; i++) { - if ((i != n_coords-1) && (PCB_ABS(x[i] - lastx) < mindist) && (PCB_ABS(y[i] - lasty) < mindist)) { + if ((i != n_coords-1) && (RND_ABS(x[i] - lastx) < mindist) && (RND_ABS(y[i] - lasty) < mindist)) { lsx = x[i]; lsy = y[i]; sup = 1; @@ -937,7 +937,7 @@ points = (GdkPoint *) realloc(points, npoints * sizeof(GdkPoint)); } for (len = i = 0; i < n_coords; i++) { - if ((i != n_coords-1) && (PCB_ABS(x[i] - lastx) < mindist) && (PCB_ABS(y[i] - lasty) < mindist)) { + if ((i != n_coords-1) && (RND_ABS(x[i] - lastx) < mindist) && (RND_ABS(y[i] - lasty) < mindist)) { lsx = x[i]; lsy = y[i]; sup = 1; @@ -1304,14 +1304,14 @@ static void draw_crosshair(GdkGC *xor_gc, gint x, gint y) { - static enum pcb_crosshair_shape_e prev = pcb_ch_shape_basic; + static enum rnd_crosshair_shape_e prev = rnd_ch_shape_basic; draw_right_cross(xor_gc, x, y); - if (prev == pcb_ch_shape_union_jack) + if (prev == rnd_ch_shape_union_jack) draw_slanted_cross(xor_gc, x, y); - if (prev == pcb_ch_shape_dozen) + if (prev == rnd_ch_shape_dozen) draw_dozen_cross(xor_gc, x, y); - prev = pcbhl_conf.editor.crosshair_shape_idx; + prev = rnd_conf.editor.crosshair_shape_idx; } static void show_crosshair(gboolean paint_new_location) @@ -1330,14 +1330,14 @@ return; } - if (!xor_gc || (cross_color_packed != pcbhl_conf.appearance.color.cross.packed)) { + if (!xor_gc || (cross_color_packed != rnd_conf.appearance.color.cross.packed)) { xor_gc = gdk_gc_new(window); gdk_gc_copy(xor_gc, style->white_gc); gdk_gc_set_function(xor_gc, GDK_XOR); gdk_gc_set_clip_origin(xor_gc, 0, 0); set_clip(priv, xor_gc); - map_color(&pcbhl_conf.appearance.color.cross, &cross_color); - cross_color_packed = pcbhl_conf.appearance.color.cross.packed; + map_color(&rnd_conf.appearance.color.cross, &cross_color); + cross_color_packed = rnd_conf.appearance.color.cross.packed; } x = Vx(ghidgui->port.view.crosshair_x); y = Vy(ghidgui->port.view.crosshair_y); @@ -1390,13 +1390,13 @@ if (!done_once) { priv->bg_gc = gdk_gc_new(priv->out_pixel); - if (!map_color(&pcbhl_conf.appearance.color.background, &priv->bg_color)) + if (!map_color(&rnd_conf.appearance.color.background, &priv->bg_color)) map_color(rnd_color_white, &priv->bg_color); gdk_gc_set_foreground(priv->bg_gc, &priv->bg_color); gdk_gc_set_clip_origin(priv->bg_gc, 0, 0); priv->offlimits_gc = gdk_gc_new(priv->out_pixel); - if (!map_color(&pcbhl_conf.appearance.color.off_limit, &priv->offlimits_color)) + if (!map_color(&rnd_conf.appearance.color.off_limit, &priv->offlimits_color)) map_color(rnd_color_white, &priv->offlimits_color); gdk_gc_set_foreground(priv->offlimits_gc, &priv->offlimits_color); gdk_gc_set_clip_origin(priv->offlimits_gc, 0, 0); Index: trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c =================================================================== --- trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 31001) +++ trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 31002) @@ -144,8 +144,8 @@ glLoadIdentity(); glTranslatef(0.0f, 0.0f, -Z_NEAR); - glScalef((pcbhl_conf.editor.view.flip_x ? -1. : 1.) / ghidgui->port.view.coord_per_px, (pcbhl_conf.editor.view.flip_y ? -1. : 1.) / ghidgui->port.view.coord_per_px, ((pcbhl_conf.editor.view.flip_x == pcbhl_conf.editor.view.flip_y) ? 1. : -1.) / ghidgui->port.view.coord_per_px); - glTranslatef(pcbhl_conf.editor.view.flip_x ? ghidgui->port.view.x0 - hidlib->size_x : -ghidgui->port.view.x0, pcbhl_conf.editor.view.flip_y ? ghidgui->port.view.y0 - hidlib->size_y : -ghidgui->port.view.y0, 0); + glScalef((rnd_conf.editor.view.flip_x ? -1. : 1.) / ghidgui->port.view.coord_per_px, (rnd_conf.editor.view.flip_y ? -1. : 1.) / ghidgui->port.view.coord_per_px, ((rnd_conf.editor.view.flip_x == rnd_conf.editor.view.flip_y) ? 1. : -1.) / ghidgui->port.view.coord_per_px); + glTranslatef(rnd_conf.editor.view.flip_x ? ghidgui->port.view.x0 - hidlib->size_x : -ghidgui->port.view.x0, rnd_conf.editor.view.flip_y ? ghidgui->port.view.y0 - hidlib->size_y : -ghidgui->port.view.y0, 0); /* Put the renderer into a good state so that any drawing is done in standard mode */ @@ -175,7 +175,7 @@ rv = g_new0(rnd_hid_gc_s, 1); rv->me_pointer = >k2_gl_hid; - rv->pcolor = &pcbhl_conf.appearance.color.background; + rv->pcolor = &rnd_conf.appearance.color.background; rv->alpha_mult = 1.0; return rv; } @@ -192,7 +192,7 @@ { render_priv_t *priv = ghidgui->port.render_priv; - if ((Vz(hidlib->grid) < RND_MIN_GRID_DISTANCE) || (!pcbhl_conf.editor.draw_grid)) + if ((Vz(hidlib->grid) < RND_MIN_GRID_DISTANCE) || (!rnd_conf.editor.draw_grid)) return; glEnable(GL_COLOR_LOGIC_OP); @@ -264,13 +264,13 @@ { render_priv_t *priv = ghidgui->port.render_priv; - if (((RND_CFT_COLOR *) cfg->val.color == &pcbhl_conf.appearance.color.background)) { + if (((RND_CFT_COLOR *) cfg->val.color == &rnd_conf.appearance.color.background)) { priv->bg_color = cfg->val.color[0]; } - else if ((RND_CFT_COLOR *)cfg->val.color == &pcbhl_conf.appearance.color.off_limit) { + else if ((RND_CFT_COLOR *)cfg->val.color == &rnd_conf.appearance.color.off_limit) { priv->offlimits_color = cfg->val.color[0]; } - else if (((RND_CFT_COLOR *)cfg->val.color == &pcbhl_conf.appearance.color.grid)) { + else if (((RND_CFT_COLOR *)cfg->val.color == &rnd_conf.appearance.color.grid)) { priv->grid_color = cfg->val.color[0]; set_special_grid_color(); } @@ -311,7 +311,7 @@ r = priv->offlimits_color.fr; g = priv->offlimits_color.fg; b = priv->offlimits_color.fb; - a = pcbhl_conf.appearance.drill_alpha; + a = rnd_conf.appearance.drill_alpha; } else { pcb_gtk_color_cache_t *cc; @@ -351,7 +351,7 @@ g = cc->green; b = cc->blue; } - a = pcbhl_conf.appearance.layer_alpha; + a = rnd_conf.appearance.layer_alpha; } if (1) { double maxi, mult; @@ -585,17 +585,17 @@ static void pcb_gl_draw_crosshair(rnd_hidlib_t *hidlib, GLint x, GLint y, GLint z, rnd_coord_t minx, rnd_coord_t miny, rnd_coord_t maxx, rnd_coord_t maxy) { - static enum pcb_crosshair_shape_e prev = pcb_ch_shape_basic; + static enum rnd_crosshair_shape_e prev = rnd_ch_shape_basic; if (!ghidgui->topwin.active || !ghidgui->port.view.has_entered) return; pcb_gl_draw_right_cross(hidlib, x, y, z, minx, miny, maxx, maxy); - if (prev == pcb_ch_shape_union_jack) + if (prev == rnd_ch_shape_union_jack) pcb_gl_draw_slanted_cross(hidlib, x, y, z, minx, miny, maxx, maxy); - if (prev == pcb_ch_shape_dozen) + if (prev == rnd_ch_shape_dozen) pcb_gl_draw_dozen_cross(hidlib, x, y, z, minx, miny, maxx, maxy); - prev = pcbhl_conf.editor.crosshair_shape_idx; + prev = rnd_conf.editor.crosshair_shape_idx; } static void ghid_gl_show_crosshair(rnd_hidlib_t *hidlib, gboolean paint_new_location, rnd_coord_t minx, rnd_coord_t miny, rnd_coord_t maxx, rnd_coord_t maxy) @@ -608,10 +608,10 @@ if (!paint_new_location) return; - if (!done_once || (cross_color_packed != pcbhl_conf.appearance.color.cross.packed)) { + if (!done_once || (cross_color_packed != rnd_conf.appearance.color.cross.packed)) { done_once = 1; - map_color(&pcbhl_conf.appearance.color.cross, &cross_color); - cross_color_packed = pcbhl_conf.appearance.color.cross.packed; + map_color(&rnd_conf.appearance.color.cross, &cross_color); + cross_color_packed = rnd_conf.appearance.color.cross.packed; } x = ghidgui->port.view.crosshair_x; y = ghidgui->port.view.crosshair_y; @@ -674,9 +674,9 @@ ghidgui->port.drawing_allowed = pcb_true; if (!done_once) { - priv->bg_color = pcbhl_conf.appearance.color.background; - priv->offlimits_color = pcbhl_conf.appearance.color.off_limit; - priv->grid_color = pcbhl_conf.appearance.color.grid; + priv->bg_color = rnd_conf.appearance.color.background; + priv->offlimits_color = rnd_conf.appearance.color.off_limit; + priv->grid_color = rnd_conf.appearance.color.grid; set_special_grid_color(); done_once = 1; } @@ -768,8 +768,8 @@ pcb_gl_draw_expose_init(>k2_gl_hid, allocation.width, allocation.height, ev->area.x, allocation.height - ev->area.height - ev->area.y, ev->area.width, ev->area.height, &priv->offlimits_color); - glScalef((pcbhl_conf.editor.view.flip_x ? -1. : 1.) / port->view.coord_per_px, (pcbhl_conf.editor.view.flip_y ? -1. : 1.) / port->view.coord_per_px, ((pcbhl_conf.editor.view.flip_x == pcbhl_conf.editor.view.flip_y) ? 1. : -1.) / port->view.coord_per_px); - glTranslatef(pcbhl_conf.editor.view.flip_x ? port->view.x0 - hidlib->size_x : -port->view.x0, pcbhl_conf.editor.view.flip_y ? port->view.y0 - hidlib->size_y : -port->view.y0, 0); + glScalef((rnd_conf.editor.view.flip_x ? -1. : 1.) / port->view.coord_per_px, (rnd_conf.editor.view.flip_y ? -1. : 1.) / port->view.coord_per_px, ((rnd_conf.editor.view.flip_x == rnd_conf.editor.view.flip_y) ? 1. : -1.) / port->view.coord_per_px); + glTranslatef(rnd_conf.editor.view.flip_x ? port->view.x0 - hidlib->size_x : -port->view.x0, rnd_conf.editor.view.flip_y ? port->view.y0 - hidlib->size_y : -port->view.y0, 0); /* Draw PCB background, before PCB primitives */ glColor3f(priv->bg_color.fr, priv->bg_color.fg, priv->bg_color.fb); @@ -895,8 +895,8 @@ /* call the drawing routine */ ghid_gl_invalidate_current_gc(); glPushMatrix(); - glScalef((pcbhl_conf.editor.view.flip_x ? -1. : 1.) / ghidgui->port.view.coord_per_px, (pcbhl_conf.editor.view.flip_y ? -1. : 1.) / ghidgui->port.view.coord_per_px, 1); - glTranslatef(pcbhl_conf.editor.view.flip_x ? ghidgui->port.view.x0 - hidlib->size_x : -ghidgui->port.view.x0, pcbhl_conf.editor.view.flip_y ? ghidgui->port.view.y0 - hidlib->size_y : -ghidgui->port.view.y0, 0); + glScalef((rnd_conf.editor.view.flip_x ? -1. : 1.) / ghidgui->port.view.coord_per_px, (rnd_conf.editor.view.flip_y ? -1. : 1.) / ghidgui->port.view.coord_per_px, 1); + glTranslatef(rnd_conf.editor.view.flip_x ? ghidgui->port.view.x0 - hidlib->size_x : -ghidgui->port.view.x0, rnd_conf.editor.view.flip_y ? ghidgui->port.view.y0 - hidlib->size_y : -ghidgui->port.view.y0, 0); rnd_gui->coord_per_pix = ghidgui->port.view.coord_per_px; expcall(>k2_gl_hid, ctx); Index: trunk/src_plugins/hid_lesstif/dialogs.c =================================================================== --- trunk/src_plugins/hid_lesstif/dialogs.c (revision 31001) +++ trunk/src_plugins/hid_lesstif/dialogs.c (revision 31002) @@ -49,7 +49,7 @@ rnd_event(ltf_hidlib, RND_EVENT_DAD_NEW_DIALOG, "psp", NULL, id, plc); - if (pcbhl_conf.editor.auto_place) { + if (rnd_conf.editor.auto_place) { if ((plc[2] > 0) && (plc[3] > 0) && (plc[0] >= 0) && (plc[1] >= 0)) { XMoveResizeWindow(dsp, w, plc[0], plc[1], plc[2], plc[3]); } Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 31001) +++ trunk/src_plugins/hid_lesstif/main.c (revision 31002) @@ -78,7 +78,7 @@ /* How big the viewport can be relative to the pcb size. */ #define MAX_ZOOM_SCALE 10 -#define UUNIT pcbhl_conf.editor.grid_unit->allow +#define UUNIT rnd_conf.editor.grid_unit->allow typedef struct rnd_hid_gc_s { rnd_core_gc_t core_gc; @@ -295,7 +295,7 @@ static inline int Vx(rnd_coord_t x) { int rv = (x - view_left_x) / view_zoom + 0.5; - if (pcbhl_conf.editor.view.flip_x) + if (rnd_conf.editor.view.flip_x) rv = view_width - rv; return rv; } @@ -303,7 +303,7 @@ static inline int Vy(rnd_coord_t y) { int rv = (y - view_top_y) / view_zoom + 0.5; - if (pcbhl_conf.editor.view.flip_y) + if (rnd_conf.editor.view.flip_y) rv = view_height - rv; return rv; } @@ -320,7 +320,7 @@ static inline rnd_coord_t Px(int x) { - if (pcbhl_conf.editor.view.flip_x) + if (rnd_conf.editor.view.flip_x) x = view_width - x; return x * view_zoom + view_left_x; } @@ -327,7 +327,7 @@ static inline rnd_coord_t Py(int y) { - if (pcbhl_conf.editor.view.flip_y) + if (rnd_conf.editor.view.flip_y) y = view_height - y; return y * view_zoom + view_top_y; } @@ -874,9 +874,9 @@ xfrac = (double) x / (double) view_width; yfrac = (double) y / (double) view_height; - if (pcbhl_conf.editor.view.flip_x) + if (rnd_conf.editor.view.flip_x) xfrac = 1 - xfrac; - if (pcbhl_conf.editor.view.flip_y) + if (rnd_conf.editor.view.flip_y) yfrac = 1 - yfrac; max_zoom = ltf_hidlib->size_x / view_width; @@ -946,9 +946,9 @@ if (pan_thumb_mode) { opx = x * ltf_hidlib->size_x / view_width; opy = y * ltf_hidlib->size_y / view_height; - if (pcbhl_conf.editor.view.flip_x) + if (rnd_conf.editor.view.flip_x) opx = ltf_hidlib->size_x - opx; - if (pcbhl_conf.editor.view.flip_y) + if (rnd_conf.editor.view.flip_y) opy = ltf_hidlib->size_y - opy; view_left_x = opx - view_width / 2 * view_zoom; view_top_y = opy - view_height / 2 * view_zoom; @@ -968,11 +968,11 @@ /* continued drag, we calculate how far we've moved the cursor and set the position accordingly. */ else { - if (pcbhl_conf.editor.view.flip_x) + if (rnd_conf.editor.view.flip_x) view_left_x = opx + (x - ox) * view_zoom; else view_left_x = opx - (x - ox) * view_zoom; - if (pcbhl_conf.editor.view.flip_y) + if (rnd_conf.editor.view.flip_y) view_top_y = opy + (y - oy) * view_zoom; else view_top_y = opy - (y - oy) * view_zoom; @@ -1190,9 +1190,9 @@ static void draw_crosshair(GC xor_gc, int x, int y, int view_width, int view_height) { draw_right_cross(xor_gc, x, y, view_width, view_height); - if (pcbhl_conf.editor.crosshair_shape_idx == pcb_ch_shape_union_jack) + if (rnd_conf.editor.crosshair_shape_idx == rnd_ch_shape_union_jack) draw_slanted_cross(xor_gc, x, y, view_width, view_height); - if (pcbhl_conf.editor.crosshair_shape_idx == pcb_ch_shape_dozen) + if (rnd_conf.editor.crosshair_shape_idx == rnd_ch_shape_dozen) draw_dozen_cross(xor_gc, x, y, view_width, view_height); } @@ -1206,12 +1206,12 @@ if (!crosshair_in_window || !window) return; - if ((xor_gc == 0) || (cross_color_packed != pcbhl_conf.appearance.color.cross.packed)) { - crosshair_color = lesstif_parse_color(&pcbhl_conf.appearance.color.cross); + if ((xor_gc == 0) || (cross_color_packed != rnd_conf.appearance.color.cross.packed)) { + crosshair_color = lesstif_parse_color(&rnd_conf.appearance.color.cross); xor_gc = XCreateGC(display, window, 0, 0); XSetFunction(display, xor_gc, GXxor); XSetForeground(display, xor_gc, crosshair_color); - cross_color_packed = pcbhl_conf.appearance.color.cross.packed; + cross_color_packed = rnd_conf.appearance.color.cross.packed; } if (show == showing) return; @@ -1321,8 +1321,8 @@ view_width = width; view_height = height; - offlimit_color = lesstif_parse_color(&pcbhl_conf.appearance.color.off_limit); - grid_color = lesstif_parse_color(&pcbhl_conf.appearance.color.grid); + offlimit_color = lesstif_parse_color(&rnd_conf.appearance.color.off_limit); + grid_color = lesstif_parse_color(&rnd_conf.appearance.color.grid); bg_gc = XCreateGC(display, window, 0, 0); XSetForeground(display, bg_gc, bgcolor); @@ -1331,7 +1331,7 @@ #ifdef RND_HAVE_XRENDER if (use_xrender) { - double l_alpha = pcbhl_conf.appearance.layer_alpha; + double l_alpha = rnd_conf.appearance.layer_alpha; XRenderPictureAttributes pa; XRenderColor a = { 0, 0, 0, 0x8000}; @@ -1448,7 +1448,7 @@ XtManageChild(work_area_frame); stdarg_n = 0; - stdarg_do_color(&pcbhl_conf.appearance.color.background, XmNbackground); + stdarg_do_color(&rnd_conf.appearance.color.background, XmNbackground); work_area = XmCreateDrawingArea(work_area_frame, XmStrCast("work_area"), stdarg_args, stdarg_n); XtManageChild(work_area); XtAddCallback(work_area, XmNexposeCallback, (XtCallbackProc) work_area_first_expose, 0); @@ -1881,7 +1881,7 @@ int n; static GC grid_gc = 0; - if (!pcbhl_conf.editor.draw_grid) + if (!rnd_conf.editor.draw_grid) return; if (Vz(ltf_hidlib->grid) < RND_MIN_GRID_DISTANCE) return; @@ -1890,7 +1890,7 @@ XSetFunction(display, grid_gc, GXxor); XSetForeground(display, grid_gc, grid_color); } - if (pcbhl_conf.editor.view.flip_x) { + if (rnd_conf.editor.view.flip_x) { x2 = rnd_grid_fit(Px(0), ltf_hidlib->grid, ltf_hidlib->grid_ox); x1 = rnd_grid_fit(Px(view_width), ltf_hidlib->grid, ltf_hidlib->grid_ox); if (Vx(x2) < 0) @@ -1906,7 +1906,7 @@ if (Vx(x2) >= view_width) x2 -= ltf_hidlib->grid; } - if (pcbhl_conf.editor.view.flip_y) { + if (rnd_conf.editor.view.flip_y) { y2 = rnd_grid_fit(Py(0), ltf_hidlib->grid, ltf_hidlib->grid_oy); y1 = rnd_grid_fit(Py(view_height), ltf_hidlib->grid, ltf_hidlib->grid_oy); if (Vy(y2) < 0) @@ -1959,12 +1959,12 @@ ctx.view.Y1 = Py(0); ctx.view.X2 = Px(view_width); ctx.view.Y2 = Py(view_height); - if (pcbhl_conf.editor.view.flip_x) { + if (rnd_conf.editor.view.flip_x) { rnd_coord_t tmp = ctx.view.X1; ctx.view.X1 = ctx.view.X2; ctx.view.X2 = tmp; } - if (pcbhl_conf.editor.view.flip_y) { + if (rnd_conf.editor.view.flip_y) { rnd_coord_t tmp = ctx.view.Y1; ctx.view.Y1 = ctx.view.Y2; ctx.view.Y2 = tmp; @@ -2039,14 +2039,14 @@ static int c_x = -2, c_y = -2; static rnd_mark_t saved_mark; static const rnd_unit_t *old_grid_unit = NULL; - if (crosshair_x != c_x || crosshair_y != c_y || pcbhl_conf.editor.grid_unit != old_grid_unit || memcmp(&saved_mark, &pcb_marked, sizeof(rnd_mark_t))) { + if (crosshair_x != c_x || crosshair_y != c_y || rnd_conf.editor.grid_unit != old_grid_unit || memcmp(&saved_mark, &pcb_marked, sizeof(rnd_mark_t))) { c_x = crosshair_x; c_y = crosshair_y; memcpy(&saved_mark, &pcb_marked, sizeof(rnd_mark_t)); - if (old_grid_unit != pcbhl_conf.editor.grid_unit) - old_grid_unit = pcbhl_conf.editor.grid_unit; + if (old_grid_unit != rnd_conf.editor.grid_unit) + old_grid_unit = rnd_conf.editor.grid_unit; } } @@ -2412,11 +2412,11 @@ delta_angle = 360; } - if (pcbhl_conf.editor.view.flip_x) { + if (rnd_conf.editor.view.flip_x) { start_angle = 180 - start_angle; delta_angle = -delta_angle; } - if (pcbhl_conf.editor.view.flip_y) { + if (rnd_conf.editor.view.flip_y) { start_angle = -start_angle; delta_angle = -delta_angle; } @@ -2621,11 +2621,11 @@ unsigned int keys_buttons; int pos_x, pos_y, root_x, root_y; XQueryPointer(display, window, &root, &child, &root_x, &root_y, &pos_x, &pos_y, &keys_buttons); - if (pcbhl_conf.editor.view.flip_x) + if (rnd_conf.editor.view.flip_x) view_left_x = x - (view_width - pos_x) * view_zoom; else view_left_x = x - pos_x * view_zoom; - if (pcbhl_conf.editor.view.flip_y) + if (rnd_conf.editor.view.flip_y) view_top_y = y - (view_height - pos_y) * view_zoom; else view_top_y = y - pos_y * view_zoom; Index: trunk/src_plugins/hid_lesstif/wt_preview.c =================================================================== --- trunk/src_plugins/hid_lesstif/wt_preview.c (revision 31001) +++ trunk/src_plugins/hid_lesstif/wt_preview.c (revision 31002) @@ -73,11 +73,11 @@ { rnd_coord_t x, y; - if (pcbhl_conf.editor.view.flip_x) + if (rnd_conf.editor.view.flip_x) px = pd->v_width - px; x = rnd_round((double)px * pd->zoom + (double)pd->x1); - if (pcbhl_conf.editor.view.flip_y) + if (rnd_conf.editor.view.flip_y) py = pd->v_height - py; y = rnd_round((double)py * pd->zoom + (double)pd->y1); @@ -109,8 +109,8 @@ save_vz = view_zoom; save_vw = view_width; save_vh = view_height; - save_fx = pcbhl_conf.editor.view.flip_x; - save_fy = pcbhl_conf.editor.view.flip_y; + save_fx = rnd_conf.editor.view.flip_x; + save_fy = rnd_conf.editor.view.flip_y; save_px = main_pixmap; save_main_px = main_pixmap; save_mask_px = mask_pixmap; @@ -125,8 +125,8 @@ view_zoom = pd->zoom; view_width = pd->x2; view_height = pd->y2; - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_x, 0); - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_y, 0); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_x, 0); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_y, 0); XFillRectangle(display, pixmap, bg_gc, 0, 0, pd->v_width, pd->v_height); @@ -154,8 +154,8 @@ mask_bitmap = save_mask_bm; pixmap = save_px; rnd_gui->coord_per_pix = save_cpp; - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_x, save_fx); - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_y, save_fy); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_x, save_fx); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_y, save_fy); pd->expose_lock = 0; } Index: trunk/src_plugins/import_edif/edif.c =================================================================== --- trunk/src_plugins/import_edif/edif.c (revision 31001) +++ trunk/src_plugins/import_edif/edif.c (revision 31002) @@ -5910,7 +5910,7 @@ cc = (ContextCar *) Malloc(sizeof(ContextCar)); cc->Next = cxt->Context; (cxt->Context = cc)->Context = - FindContext(PCB_ABS(BinderDef[i].Follower[j])); + FindContext(RND_ABS(BinderDef[i].Follower[j])); cc->u.Single = BinderDef[i].Follower[j] < 0; } } Index: trunk/src_plugins/import_edif/edif.y =================================================================== --- trunk/src_plugins/import_edif/edif.y (revision 31001) +++ trunk/src_plugins/import_edif/edif.y (revision 31002) @@ -4112,7 +4112,7 @@ cc = (ContextCar *) Malloc(sizeof(ContextCar)); cc->Next = cxt->Context; (cxt->Context = cc)->Context = - FindContext(PCB_ABS(BinderDef[i].Follower[j])); + FindContext(RND_ABS(BinderDef[i].Follower[j])); cc->u.Single = BinderDef[i].Follower[j] < 0; } } Index: trunk/src_plugins/io_dsn/read.c =================================================================== --- trunk/src_plugins/io_dsn/read.c (revision 31001) +++ trunk/src_plugins/io_dsn/read.c (revision 31002) @@ -1571,11 +1571,11 @@ if (need_mirror) pcb_subc_change_side(nsc, crd[1] * 2 - PCB->hidlib.size_y); if (rot != 0.0) - pcb_subc_rotate(nsc, crd[0], crd[1], cos(rot / PCB_RAD_TO_DEG), sin(rot / PCB_RAD_TO_DEG), rot); + pcb_subc_rotate(nsc, crd[0], crd[1], cos(rot / RND_RAD_TO_DEG), sin(rot / RND_RAD_TO_DEG), rot); } else { if (rot != 0.0) - pcb_subc_rotate(nsc, crd[0], crd[1], cos(rot / PCB_RAD_TO_DEG), sin(rot / PCB_RAD_TO_DEG), rot); + pcb_subc_rotate(nsc, crd[0], crd[1], cos(rot / RND_RAD_TO_DEG), sin(rot / RND_RAD_TO_DEG), rot); if (need_mirror) pcb_subc_change_side(nsc, crd[1] * 2 - PCB->hidlib.size_y); } Index: trunk/src_plugins/io_eagle/eagle_bin.c =================================================================== --- trunk/src_plugins/io_eagle/eagle_bin.c (revision 31001) +++ trunk/src_plugins/io_eagle/eagle_bin.c (revision 31002) @@ -1470,7 +1470,7 @@ x3 = (x1+x2)/2; y3 = (y1+y2)/2; - if (PCB_ABS(x2-x1) < PCB_ABS(y2-y1)) { + if (RND_ABS(x2-x1) < RND_ABS(y2-y1)) { cx = c; cy = (long)((x3-cx)*(x2-x1)/(double)((y2-y1)) + y3); } else { @@ -1500,8 +1500,8 @@ } else { delta_x = (double)(x1 - cx); delta_y = (double)(y1 - cy); - theta_1 = PCB_RAD_TO_DEG*atan2(-delta_y, delta_x); - theta_2 = PCB_RAD_TO_DEG*atan2(-(y2 - cy), (x2 - cx)); + theta_1 = RND_RAD_TO_DEG*atan2(-delta_y, delta_x); + theta_2 = RND_RAD_TO_DEG*atan2(-(y2 - cy), (x2 - cx)); theta_1 = 180 - theta_1; /* eagle coord system */ theta_2 = 180 - theta_2; /* eagle coord system */ Index: trunk/src_plugins/io_eagle/read.c =================================================================== --- trunk/src_plugins/io_eagle/read.c (revision 31001) +++ trunk/src_plugins/io_eagle/read.c (revision 31002) @@ -675,7 +675,7 @@ sidelen = sqrt(sidex * sidex + sidey * sidey); nx = -sidey / sidelen; ny = sidex / sidelen; - r = (sidelen / 2) / tan(curvang / PCB_RAD_TO_DEG / 2.0); + r = (sidelen / 2) / tan(curvang / RND_RAD_TO_DEG / 2.0); cx = rnd_round(midx + nx * r); cy = rnd_round(midy + ny * r); /* rnd_trace("curve mid: %mm;%mm center: %mm;%mm\n", midx, midy, cx, cy);*/ @@ -683,8 +683,8 @@ dx = x1 - cx; dy = y1 - cy; r = sqrt(dx * dx + dy * dy); - sa = 180.0 - atan2(y1 - cy, x1 - cx) * PCB_RAD_TO_DEG; - ea = 180.0 - atan2(y2 - cy, x2 - cx) * PCB_RAD_TO_DEG; + sa = 180.0 - atan2(y1 - cy, x1 - cx) * RND_RAD_TO_DEG; + ea = 180.0 - atan2(y2 - cy, x2 - cx) * RND_RAD_TO_DEG; da = ea - sa; /* rnd_trace(" r=%mm %f %f -> %f\n", (rnd_coord_t)r, sa, ea, da);*/ arc = pcb_arc_new(ly, cx, cy, r, r, sa, da, th, st->md_wire_wire*2, pcb_flag_make(PCB_FLAG_CLEARLINE), 0); @@ -881,7 +881,7 @@ if (rot != 0) { int n; - double sina = sin(-(double)rot / PCB_RAD_TO_DEG), cosa = cos(-(double)rot / PCB_RAD_TO_DEG); + double sina = sin(-(double)rot / RND_RAD_TO_DEG), cosa = cos(-(double)rot / RND_RAD_TO_DEG); for(n = 0; n < sizeof(shapes)/sizeof(shapes[0]); n++) { if (shapes[n].layer_mask == 0) break; @@ -1194,7 +1194,7 @@ } else if (moduleRotation != 0) { double rot = moduleRotation; - pcb_subc_rotate(subc, moduleX, moduleY, cos(rot/PCB_RAD_TO_DEG), sin(rot/PCB_RAD_TO_DEG), rot); + pcb_subc_rotate(subc, moduleX, moduleY, cos(rot/RND_RAD_TO_DEG), sin(rot/RND_RAD_TO_DEG), rot); } #endif @@ -1465,8 +1465,8 @@ else { double sina, cosa; ang = -ang; - sina = sin(ang / PCB_RAD_TO_DEG); - cosa = cos(ang / PCB_RAD_TO_DEG); + sina = sin(ang / RND_RAD_TO_DEG); + cosa = cos(ang / RND_RAD_TO_DEG); pcb_subc_rotate(new_subc, x, y, cosa, sina, ang); } } Index: trunk/src_plugins/io_kicad/read.c =================================================================== --- trunk/src_plugins/io_kicad/read.c (revision 31001) +++ trunk/src_plugins/io_kicad/read.c (revision 31002) @@ -2525,7 +2525,7 @@ pcb_subc_rotate90(subc, mod_x, mod_y, mod_rot); } else if (mod_rot != 0) - pcb_subc_rotate(subc, mod_x, mod_y, cos(mod_rot/PCB_RAD_TO_DEG), sin(mod_rot/PCB_RAD_TO_DEG), mod_rot); + pcb_subc_rotate(subc, mod_x, mod_y, cos(mod_rot/RND_RAD_TO_DEG), sin(mod_rot/RND_RAD_TO_DEG), mod_rot); st->subc_rot = 0.0; st->last_sc = subc; Index: trunk/src_plugins/io_mentor_cell/read.c =================================================================== --- trunk/src_plugins/io_mentor_cell/read.c (revision 31001) +++ trunk/src_plugins/io_mentor_cell/read.c (revision 31002) @@ -387,9 +387,9 @@ srx = -(sx - cx); sry = sy - cy; /* Since angle = 0 is towards -x, change sign to x part */ erx = -(ex - cx); ery = ey - cy; /* Since angle = 0 is towards -x, change sign to x part */ - *sa = atan2(sry, srx) * PCB_RAD_TO_DEG; + *sa = atan2(sry, srx) * RND_RAD_TO_DEG; *sa = pcb_normalize_angle(360 + *sa); /* normalize angle between 0 and 359 */ - ea = atan2(ery, erx) * PCB_RAD_TO_DEG; + ea = atan2(ery, erx) * RND_RAD_TO_DEG; ea = pcb_normalize_angle(360 + ea); /* normalize angle between 0 and 359 */ if (*r < 0) { @@ -639,7 +639,7 @@ "Consider rotation, using:" " pcb_rotate(rnd_coord_t * x, rnd_coord_t * y, rnd_coord_t cx, rnd_coord_t cy, double cosa, double sina)" "Maybe:" - " double sina = sin(-(double)rot / PCB_RAD_TO_DEG), cosa = cos(-(double)rot / PCB_RAD_TO_DEG);"); + " double sina = sin(-(double)rot / RND_RAD_TO_DEG), cosa = cos(-(double)rot / RND_RAD_TO_DEG);"); if (strcmp(tmp->argv[1], "Top") == 0) { y1 = ty+height; y2 = ty; } Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 31001) +++ trunk/src_plugins/io_pcb/file.c (revision 31002) @@ -292,7 +292,7 @@ fputs("\nPCB[", FP); pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB->hidlib.name)); pcb_fprintf(FP, " %[0] %[0]]\n\n", PCB->hidlib.size_x, PCB->hidlib.size_y); - pcb_fprintf(FP, "Grid[%[0] %[0] %[0] %d]\n", PCB->hidlib.grid, PCB->hidlib.grid_ox, PCB->hidlib.grid_oy, pcbhl_conf.editor.draw_grid); + pcb_fprintf(FP, "Grid[%[0] %[0] %[0] %d]\n", PCB->hidlib.grid, PCB->hidlib.grid_ox, PCB->hidlib.grid_oy, rnd_conf.editor.draw_grid); pcb_fprintf(FP, "Cursor[%[0] %[0] 1000]\n", pcb_crosshair.X, pcb_crosshair.Y); /* PolyArea should be output in square cmils, no suffix */ fprintf(FP, "PolyArea[%s]\n", c_dtostr(PCB_COORD_TO_MIL(PCB_COORD_TO_MIL(conf_core.design.poly_isle_area) * 100) * 100)); Index: trunk/src_plugins/jostle/jostle.c =================================================================== --- trunk/src_plugins/jostle/jostle.c (revision 31001) +++ trunk/src_plugins/jostle/jostle.c (revision 31002) @@ -139,10 +139,10 @@ first = 0; } else { - PCB_MAKE_MIN(box.X1, pa->xmin); - PCB_MAKE_MAX(box.X2, pa->xmax + 1); - PCB_MAKE_MIN(box.Y1, pa->ymin); - PCB_MAKE_MAX(box.Y2, pa->ymax + 1); + RND_MAKE_MIN(box.X1, pa->xmin); + RND_MAKE_MAX(box.X2, pa->xmax + 1); + RND_MAKE_MIN(box.Y1, pa->ymin); + RND_MAKE_MAX(box.Y2, pa->ymax + 1); } } while ((n = n->f) != a); return box; Index: trunk/src_plugins/lib_compat_help/pstk_compat.c =================================================================== --- trunk/src_plugins/lib_compat_help/pstk_compat.c (revision 31001) +++ trunk/src_plugins/lib_compat_help/pstk_compat.c (revision 31002) @@ -47,21 +47,21 @@ pcb_poly_square_pin_factors(style, xm, ym); dst->x[7] = x0 + rnd_round(rx * 0.5) * xm[7]; - dst->y[7] = y0 + rnd_round(ry * PCB_TAN_22_5_DEGREE_2) * ym[7]; - dst->x[6] = x0 + rnd_round(rx * PCB_TAN_22_5_DEGREE_2) * xm[6]; + dst->y[7] = y0 + rnd_round(ry * RND_TAN_22_5_DEGREE_2) * ym[7]; + dst->x[6] = x0 + rnd_round(rx * RND_TAN_22_5_DEGREE_2) * xm[6]; dst->y[6] = y0 + rnd_round(ry * 0.5) * ym[6]; - dst->x[5] = x0 - rnd_round(rx * PCB_TAN_22_5_DEGREE_2) * xm[5]; + dst->x[5] = x0 - rnd_round(rx * RND_TAN_22_5_DEGREE_2) * xm[5]; dst->y[5] = y0 + rnd_round(ry * 0.5) * ym[5]; dst->x[4] = x0 - rnd_round(rx * 0.5) * xm[4]; - dst->y[4] = y0 + rnd_round(ry * PCB_TAN_22_5_DEGREE_2) * ym[4]; + dst->y[4] = y0 + rnd_round(ry * RND_TAN_22_5_DEGREE_2) * ym[4]; dst->x[3] = x0 - rnd_round(rx * 0.5) * xm[3]; - dst->y[3] = y0 - rnd_round(ry * PCB_TAN_22_5_DEGREE_2) * ym[3]; - dst->x[2] = x0 - rnd_round(rx * PCB_TAN_22_5_DEGREE_2) * xm[2]; + dst->y[3] = y0 - rnd_round(ry * RND_TAN_22_5_DEGREE_2) * ym[3]; + dst->x[2] = x0 - rnd_round(rx * RND_TAN_22_5_DEGREE_2) * xm[2]; dst->y[2] = y0 - rnd_round(ry * 0.5) * ym[2]; - dst->x[1] = x0 + rnd_round(rx * PCB_TAN_22_5_DEGREE_2) * xm[1]; + dst->x[1] = x0 + rnd_round(rx * RND_TAN_22_5_DEGREE_2) * xm[1]; dst->y[1] = y0 - rnd_round(ry * 0.5) * ym[1]; dst->x[0] = x0 + rnd_round(rx * 0.5) * xm[0]; - dst->y[0] = y0 - rnd_round(ry * PCB_TAN_22_5_DEGREE_2) * ym[0]; + dst->y[0] = y0 - rnd_round(ry * RND_TAN_22_5_DEGREE_2) * ym[0]; } /* emulate the old 'square flag' feature */ @@ -218,7 +218,7 @@ } /* must be axis aligned */ - a = atan2(shp->data.poly.y[3] - shp->data.poly.y[0], shp->data.poly.x[3] - shp->data.poly.x[0]) * PCB_RAD_TO_DEG; + a = atan2(shp->data.poly.y[3] - shp->data.poly.y[0], shp->data.poly.x[3] - shp->data.poly.x[0]) * RND_RAD_TO_DEG; if (fmod(a, 90.0) > 0.1) return PCB_PSTK_COMPAT_INVALID; @@ -242,21 +242,21 @@ /* compensate for the octagon shape */ x[7] /= 0.5; - y[7] /= PCB_TAN_22_5_DEGREE_2; - x[6] /= PCB_TAN_22_5_DEGREE_2; + y[7] /= RND_TAN_22_5_DEGREE_2; + x[6] /= RND_TAN_22_5_DEGREE_2; y[6] /= 0.5; - x[5] /= PCB_TAN_22_5_DEGREE_2; + x[5] /= RND_TAN_22_5_DEGREE_2; y[5] /= 0.5; x[4] /= 0.5; - y[4] /= PCB_TAN_22_5_DEGREE_2; + y[4] /= RND_TAN_22_5_DEGREE_2; x[3] /= 0.5; - y[3] /= PCB_TAN_22_5_DEGREE_2; - x[2] /= PCB_TAN_22_5_DEGREE_2; + y[3] /= RND_TAN_22_5_DEGREE_2; + x[2] /= RND_TAN_22_5_DEGREE_2; y[2] /= 0.5; - x[1] /= PCB_TAN_22_5_DEGREE_2; + x[1] /= RND_TAN_22_5_DEGREE_2; y[1] /= 0.5; x[0] /= 0.5; - y[0] /= PCB_TAN_22_5_DEGREE_2; + y[0] /= RND_TAN_22_5_DEGREE_2; /* check min distances */ for(n = 0; n < 8; n++) { @@ -389,10 +389,10 @@ /* all copper sizes must be the same, all mask sizes must be the same */ for(n = 0; n < tshp->len; n++) { - if ((tshp->shape[n].layer_mask & PCB_LYT_COPPER) && (PCB_ABS(old_dia[n] - old_dia[coppern]) > 10)) + if ((tshp->shape[n].layer_mask & PCB_LYT_COPPER) && (RND_ABS(old_dia[n] - old_dia[coppern]) > 10)) return pcb_false; if (maskn >= 0) - if ((tshp->shape[n].layer_mask & PCB_LYT_MASK) && (PCB_ABS(old_dia[n] - old_dia[maskn]) > 10)) + if ((tshp->shape[n].layer_mask & PCB_LYT_MASK) && (RND_ABS(old_dia[n] - old_dia[maskn]) > 10)) return pcb_false; } Index: trunk/src_plugins/lib_gtk_common/bu_command.c =================================================================== --- trunk/src_plugins/lib_gtk_common/bu_command.c (revision 31001) +++ trunk/src_plugins/lib_gtk_common/bu_command.c (revision 31002) @@ -160,7 +160,7 @@ ctx->command_entered = NULL; /* We are aborting */ /* Hide the host widget in full screen - not enough if only the entry is gone */ - if (pcbhl_conf.editor.fullscreen) { + if (rnd_conf.editor.fullscreen) { gtk_widget_hide(gtk_widget_get_parent(ctx->command_combo_box)); gtk_widget_hide(gtk_widget_get_parent(ctx->prompt_label)); } @@ -186,7 +186,7 @@ ctx->command_entry_status_line_active = TRUE; gtk_entry_set_text(ctx->command_entry, command ? command : ""); - if (pcbhl_conf.editor.fullscreen) + if (rnd_conf.editor.fullscreen) gtk_widget_show(gtk_widget_get_parent(ctx->command_combo_box)); gtk_widget_show(ctx->command_combo_box); @@ -216,7 +216,7 @@ g_signal_handler_disconnect(ctx->command_entry, escape_sig2_id); /* Hide/show the widgets */ - if (pcbhl_conf.editor.fullscreen) { + if (rnd_conf.editor.fullscreen) { gtk_widget_hide(gtk_widget_get_parent(ctx->command_combo_box)); gtk_widget_hide(gtk_widget_get_parent(ctx->prompt_label)); } Index: trunk/src_plugins/lib_gtk_common/coord_conv.h =================================================================== --- trunk/src_plugins/lib_gtk_common/coord_conv.h (revision 31001) +++ trunk/src_plugins/lib_gtk_common/coord_conv.h (revision 31002) @@ -6,7 +6,7 @@ static inline int Vx(rnd_coord_t x) { double rv; - if (pcbhl_conf.editor.view.flip_x) + if (rnd_conf.editor.view.flip_x) rv = (ghidgui->port.view.ctx->hidlib->size_x - x - ghidgui->port.view.x0) / ghidgui->port.view.coord_per_px + 0.5; else rv = (x - ghidgui->port.view.x0) / ghidgui->port.view.coord_per_px + 0.5; @@ -16,7 +16,7 @@ static inline int Vy(rnd_coord_t y) { double rv; - if (pcbhl_conf.editor.view.flip_y) + if (rnd_conf.editor.view.flip_y) rv = (ghidgui->port.view.ctx->hidlib->size_y - y - ghidgui->port.view.y0) / ghidgui->port.view.coord_per_px + 0.5; else rv = (y - ghidgui->port.view.y0) / ghidgui->port.view.coord_per_px + 0.5; @@ -31,7 +31,7 @@ static inline double Vxd(rnd_coord_t x) { double rv; - if (pcbhl_conf.editor.view.flip_x) + if (rnd_conf.editor.view.flip_x) rv = (ghidgui->port.view.ctx->hidlib->size_x - x - ghidgui->port.view.x0) / ghidgui->port.view.coord_per_px; else rv = (x - ghidgui->port.view.x0) / ghidgui->port.view.coord_per_px; @@ -41,7 +41,7 @@ static inline double Vyd(rnd_coord_t y) { double rv; - if (pcbhl_conf.editor.view.flip_y) + if (rnd_conf.editor.view.flip_y) rv = (ghidgui->port.view.ctx->hidlib->size_y - y - ghidgui->port.view.y0) / ghidgui->port.view.coord_per_px; else rv = (y - ghidgui->port.view.y0) / ghidgui->port.view.coord_per_px; @@ -56,7 +56,7 @@ static inline rnd_coord_t Px(int x) { rnd_coord_t rv = x * ghidgui->port.view.coord_per_px + ghidgui->port.view.x0; - if (pcbhl_conf.editor.view.flip_x) + if (rnd_conf.editor.view.flip_x) rv = ghidgui->port.view.ctx->hidlib->size_x - (x * ghidgui->port.view.coord_per_px + ghidgui->port.view.x0); return rv; } @@ -64,7 +64,7 @@ static inline rnd_coord_t Py(int y) { rnd_coord_t rv = y * ghidgui->port.view.coord_per_px + ghidgui->port.view.y0; - if (pcbhl_conf.editor.view.flip_y) + if (rnd_conf.editor.view.flip_y) rv = ghidgui->port.view.ctx->hidlib->size_y - (y * ghidgui->port.view.coord_per_px + ghidgui->port.view.y0); return rv; } @@ -78,7 +78,7 @@ static inline int pcb_gtk_1dot(rnd_coord_t penwidth, rnd_coord_t x1, rnd_coord_t y1, rnd_coord_t x2, rnd_coord_t y2) { double minw = ghidgui->port.view.coord_per_px; - double dx = PCB_ABS(x1-x2) + penwidth, dy = PCB_ABS(y1-y2) + penwidth; + double dx = RND_ABS(x1-x2) + penwidth, dy = RND_ABS(y1-y2) + penwidth; return ((dx < minw) && (dy < minw)); } Index: trunk/src_plugins/lib_gtk_common/dlg_attribute.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_attribute.c (revision 31001) +++ trunk/src_plugins/lib_gtk_common/dlg_attribute.c (revision 31002) @@ -804,7 +804,7 @@ gtk_window_set_role(GTK_WINDOW(ctx->dialog), id); gtk_window_set_modal(GTK_WINDOW(ctx->dialog), modal); - if (pcbhl_conf.editor.auto_place) { + if (rnd_conf.editor.auto_place) { if ((plc[2] > 0) && (plc[3] > 0)) gtk_window_resize(GTK_WINDOW(ctx->dialog), plc[2], plc[3]); if ((plc[0] >= 0) && (plc[1] >= 0)) Index: trunk/src_plugins/lib_gtk_common/dlg_topwin.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_topwin.c (revision 31001) +++ trunk/src_plugins/lib_gtk_common/dlg_topwin.c (revision 31002) @@ -252,7 +252,7 @@ static void fullscreen_cb(GtkButton *btn, void *data) { - rnd_conf_setf(RND_CFR_DESIGN, "editor/fullscreen", -1, "%d", !pcbhl_conf.editor.fullscreen, RND_POL_OVERWRITE); + rnd_conf_setf(RND_CFR_DESIGN, "editor/fullscreen", -1, "%d", !rnd_conf.editor.fullscreen, RND_POL_OVERWRITE); } /* XPM */ @@ -547,7 +547,7 @@ void ghid_fullscreen_apply(pcb_gtk_topwin_t *tw) { - if (pcbhl_conf.editor.fullscreen) { + if (rnd_conf.editor.fullscreen) { gtk_widget_hide(tw->left_toolbar); gtk_widget_hide(tw->top_hbox); if (!tw->cmd.command_entry_status_line_active) Index: trunk/src_plugins/lib_gtk_common/glue_hid.c =================================================================== --- trunk/src_plugins/lib_gtk_common/glue_hid.c (revision 31001) +++ trunk/src_plugins/lib_gtk_common/glue_hid.c (revision 31002) @@ -204,7 +204,7 @@ rnd_event(hidlib, RND_EVENT_DAD_NEW_DIALOG, "psp", NULL, id, plc); - if (pcbhl_conf.editor.auto_place) { + if (rnd_conf.editor.auto_place) { if ((plc[2] > 0) && (plc[3] > 0)) gtk_window_resize(GTK_WINDOW(dialog), plc[2], plc[3]); if ((plc[0] >= 0) && (plc[1] >= 0)) @@ -631,7 +631,7 @@ if (pixmap->hid_data == NULL) ghid_init_pixmap(hid, pixmap); if (pixmap->hid_data != NULL) { - double rsx, rsy, ca = cos(pixmap->tr_rot / PCB_RAD_TO_DEG), sa = sin(pixmap->tr_rot / PCB_RAD_TO_DEG); + double rsx, rsy, ca = cos(pixmap->tr_rot / RND_RAD_TO_DEG), sa = sin(pixmap->tr_rot / RND_RAD_TO_DEG); rsx = (double)sx * ca + (double)sy * sa; rsy = (double)sy * ca + (double)sx * sa; rnd_trace("GUI scale: %mm %mm -> %mm %mm\n", sx, sy, (rnd_coord_t)rsx, (rnd_coord_t)rsy); Index: trunk/src_plugins/lib_gtk_common/ui_zoompan.c =================================================================== --- trunk/src_plugins/lib_gtk_common/ui_zoompan.c (revision 31001) +++ trunk/src_plugins/lib_gtk_common/ui_zoompan.c (revision 31002) @@ -188,8 +188,8 @@ yf = (y2 - y1) / v->canvas_height; v->coord_per_px = (xf > yf ? xf : yf); - v->x0 = SIDE_X(v, pcbhl_conf.editor.view.flip_x ? x2 : x1); - v->y0 = SIDE_Y(v, pcbhl_conf.editor.view.flip_y ? y2 : y1); + v->x0 = SIDE_X(v, rnd_conf.editor.view.flip_x ? x2 : x1); + v->y0 = SIDE_Y(v, rnd_conf.editor.view.flip_y ? y2 : y1); uiz_pan_common(v); if (setch) { Index: trunk/src_plugins/lib_gtk_common/ui_zoompan.h =================================================================== --- trunk/src_plugins/lib_gtk_common/ui_zoompan.h (revision 31001) +++ trunk/src_plugins/lib_gtk_common/ui_zoompan.h (revision 31002) @@ -32,8 +32,8 @@ #include -#define SIDE_X_(hidlib, x) ((pcbhl_conf.editor.view.flip_x ? hidlib->size_x - (x) : (x))) -#define SIDE_Y_(hidlib, y) ((pcbhl_conf.editor.view.flip_y ? hidlib->size_y - (y) : (y))) +#define SIDE_X_(hidlib, x) ((rnd_conf.editor.view.flip_x ? hidlib->size_x - (x) : (x))) +#define SIDE_Y_(hidlib, y) ((rnd_conf.editor.view.flip_y ? hidlib->size_y - (y) : (y))) #define SIDE_X(v, x) SIDE_X_((v)->ctx->hidlib, (x)) #define SIDE_Y(v, y) SIDE_Y_((v)->ctx->hidlib, (y)) Index: trunk/src_plugins/lib_gtk_common/wt_preview.c =================================================================== --- trunk/src_plugins/lib_gtk_common/wt_preview.c (revision 31001) +++ trunk/src_plugins/lib_gtk_common/wt_preview.c (revision 31002) @@ -230,15 +230,15 @@ preview->expose_data.view.Y1 = preview->y_min; preview->expose_data.view.X2 = preview->x_max; preview->expose_data.view.Y2 = preview->y_max; - save_fx = pcbhl_conf.editor.view.flip_x; - save_fy = pcbhl_conf.editor.view.flip_y; - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_x, 0); - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_y, 0); + save_fx = rnd_conf.editor.view.flip_x; + save_fy = rnd_conf.editor.view.flip_y; + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_x, 0); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_y, 0); res = preview->expose(widget, ev, rnd_expose_preview, &preview->expose_data); - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_x, save_fx); - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_y, save_fy); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_x, save_fx); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_y, save_fy); return res; } @@ -359,15 +359,15 @@ int save_fx, save_fy; gboolean r; - save_fx = pcbhl_conf.editor.view.flip_x; - save_fy = pcbhl_conf.editor.view.flip_y; - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_x, 0); - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_y, 0); + save_fx = rnd_conf.editor.view.flip_x; + save_fy = rnd_conf.editor.view.flip_y; + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_x, 0); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_y, 0); r = button_press_(w, btn); - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_x, save_fx); - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_y, save_fy); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_x, save_fx); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_y, save_fy); return r; } @@ -397,10 +397,10 @@ void *draw_data = NULL; int save_fx, save_fy; - save_fx = pcbhl_conf.editor.view.flip_x; - save_fy = pcbhl_conf.editor.view.flip_y; - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_x, 0); - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_y, 0); + save_fx = rnd_conf.editor.view.flip_x; + save_fy = rnd_conf.editor.view.flip_y; + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_x, 0); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_y, 0); draw_data = preview->expose_data.draw_data; @@ -424,8 +424,8 @@ default:; } - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_x, save_fx); - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_y, save_fy); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_x, save_fx); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_y, save_fy); return FALSE; } @@ -438,10 +438,10 @@ gint wx, wy; void *draw_data = NULL; - save_fx = pcbhl_conf.editor.view.flip_x; - save_fy = pcbhl_conf.editor.view.flip_y; - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_x, 0); - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_y, 0); + save_fx = rnd_conf.editor.view.flip_x; + save_fy = rnd_conf.editor.view.flip_y; + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_x, 0); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_y, 0); draw_data = preview->expose_data.draw_data; @@ -459,8 +459,8 @@ gtk_widget_queue_draw(w); } - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_x, save_fx); - rnd_conf_force_set_bool(pcbhl_conf.editor.view.flip_y, save_fy); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_x, save_fx); + rnd_conf_force_set_bool(rnd_conf.editor.view.flip_y, save_fy); return FALSE; } Index: trunk/src_plugins/lib_hid_common/toolbar.c =================================================================== --- trunk/src_plugins/lib_hid_common/toolbar.c (revision 31001) +++ trunk/src_plugins/lib_hid_common/toolbar.c (revision 31002) @@ -62,7 +62,7 @@ int st, wid = toolbar.tid2wid.array[tid]; if (wid == 0) continue; - st = (tid == pcbhl_conf.editor.mode) ? 2 : 1; + st = (tid == rnd_conf.editor.mode) ? 2 : 1; rnd_gui->attr_dlg_widget_state(toolbar.sub.dlg_hid_ctx, wid, st); } toolbar.lock = 0; Index: trunk/src_plugins/lib_hid_pcbui/act.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/act.c (revision 31001) +++ trunk/src_plugins/lib_hid_pcbui/act.c (revision 31002) @@ -127,7 +127,7 @@ xoffs = 0; break; case 'v': case 'V': - if (!pcbhl_conf.editor.view.flip_y) + if (!rnd_conf.editor.view.flip_y) yoffs = -yoffs; else yoffs = 0; @@ -135,7 +135,7 @@ break; case 'r': case 'R': xoffs = 0; - if (!pcbhl_conf.editor.view.flip_y) + if (!rnd_conf.editor.view.flip_y) yoffs = -yoffs; else yoffs = 0; Index: trunk/src_plugins/lib_hid_pcbui/layer_menu.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/layer_menu.c (revision 31001) +++ trunk/src_plugins/lib_hid_pcbui/layer_menu.c (revision 31002) @@ -142,7 +142,7 @@ pcb_layer_type_t lyt = pcb_layer_flags_(l); props.background = &l->meta.real.color; - props.foreground = &pcbhl_conf.appearance.color.background; + props.foreground = &rnd_conf.appearance.color.background; props.checked = chk; if (ctx->view) { sprintf(act, "ToggleView(%ld)", lid+1); Index: trunk/src_plugins/lib_hid_pcbui/status.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/status.c (revision 31001) +++ trunk/src_plugins/lib_hid_pcbui/status.c (revision 31002) @@ -82,7 +82,7 @@ "grid=%$mS " "line=%mS (%s%s) " "kbd=%s", - pcbhl_conf.editor.grid_unit->allow, conf_core.editor.show_solder_side ? "bottom" : "top", + rnd_conf.editor.grid_unit->allow, conf_core.editor.show_solder_side ? "bottom" : "top", PCB->hidlib.grid, conf_core.design.line_thickness, flag, conf_core.editor.rubber_band_mode ? ",R" : "", kbd); @@ -111,7 +111,7 @@ unit_mm = get_unit_struct("mm"); unit_mil = get_unit_struct("mil"); } - if (pcbhl_conf.editor.grid_unit == unit_mm) + if (rnd_conf.editor.grid_unit == unit_mm) unit_inv = unit_mil; else unit_inv = unit_mm; @@ -173,12 +173,12 @@ /* coordinate readout (right side box) */ if (conf_core.appearance.compact) { status.buf.used = 0; - pcb_append_printf(&status.buf, "%m+%-mS", pcbhl_conf.editor.grid_unit->allow, pcb_crosshair.X); + pcb_append_printf(&status.buf, "%m+%-mS", rnd_conf.editor.grid_unit->allow, pcb_crosshair.X); hv.str = status.buf.array; rnd_gui->attr_dlg_set_value(status.rdsub.dlg_hid_ctx, status.wrd2[0], &hv); status.buf.used = 0; - pcb_append_printf(&status.buf, "%m+%-mS", pcbhl_conf.editor.grid_unit->allow, pcb_crosshair.Y); + pcb_append_printf(&status.buf, "%m+%-mS", rnd_conf.editor.grid_unit->allow, pcb_crosshair.Y); hv.str = status.buf.array; rnd_gui->attr_dlg_set_value(status.rdsub.dlg_hid_ctx, status.wrd2[1], &hv); rnd_gui->attr_dlg_widget_hide(status.rdsub.dlg_hid_ctx, status.wrd2[1], 0); @@ -185,7 +185,7 @@ } else { status.buf.used = 0; - pcb_append_printf(&status.buf, "%m+%-mS %-mS", pcbhl_conf.editor.grid_unit->allow, pcb_crosshair.X, pcb_crosshair.Y); + pcb_append_printf(&status.buf, "%m+%-mS %-mS", rnd_conf.editor.grid_unit->allow, pcb_crosshair.X, pcb_crosshair.Y); hv.str = status.buf.array; rnd_gui->attr_dlg_set_value(status.rdsub.dlg_hid_ctx, status.wrd2[0], &hv); rnd_gui->attr_dlg_widget_hide(status.rdsub.dlg_hid_ctx, status.wrd2[1], 1); @@ -199,14 +199,14 @@ rnd_coord_t dx = pcb_crosshair.X - pcb_marked.X; rnd_coord_t dy = pcb_crosshair.Y - pcb_marked.Y; rnd_coord_t r = rnd_distance(pcb_crosshair.X, pcb_crosshair.Y, pcb_marked.X, pcb_marked.Y); - double a = atan2(dy, dx) * PCB_RAD_TO_DEG; + double a = atan2(dy, dx) * RND_RAD_TO_DEG; s1 = status.buf.array; - pcb_append_printf(&status.buf, "%m+r %-mS%c", pcbhl_conf.editor.grid_unit->allow, r, sep); + pcb_append_printf(&status.buf, "%m+r %-mS%c", rnd_conf.editor.grid_unit->allow, r, sep); s2 = status.buf.array + status.buf.used; pcb_append_printf(&status.buf, "phi %-.1f%c", a, sep); s3 = status.buf.array + status.buf.used; - pcb_append_printf(&status.buf, "%m+ %-mS %-mS", pcbhl_conf.editor.grid_unit->allow, dx, dy); + pcb_append_printf(&status.buf, "%m+ %-mS %-mS", rnd_conf.editor.grid_unit->allow, dx, dy); } else { pcb_append_printf(&status.buf, "r __.__%cphi __._%c__.__ __.__", sep, sep, sep); @@ -230,10 +230,10 @@ rnd_gui->attr_dlg_widget_hide(status.rdsub.dlg_hid_ctx, status.wrd1[2], 1); } - if (status.last_unit != pcbhl_conf.editor.grid_unit) { + if (status.last_unit != rnd_conf.editor.grid_unit) { status.lock++; - status.last_unit = pcbhl_conf.editor.grid_unit; - hv.str = pcbhl_conf.editor.grid_unit->suffix; + status.last_unit = rnd_conf.editor.grid_unit; + hv.str = rnd_conf.editor.grid_unit->suffix; rnd_gui->attr_dlg_set_value(status.rdsub.dlg_hid_ctx, status.wrdunit, &hv); status.lock--; } @@ -241,7 +241,7 @@ static void unit_change_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) { - if (pcbhl_conf.editor.grid_unit == get_unit_struct("mm")) + if (rnd_conf.editor.grid_unit == get_unit_struct("mm")) rnd_actionva(&PCB->hidlib, "SetUnits", "mil", NULL); else rnd_actionva(&PCB->hidlib, "SetUnits", "mm", NULL); Index: trunk/src_plugins/lib_netmap/placement.c =================================================================== --- trunk/src_plugins/lib_netmap/placement.c (revision 31001) +++ trunk/src_plugins/lib_netmap/placement.c (revision 31002) @@ -56,7 +56,7 @@ pcb_subc_move(proto, tr.ox, tr.oy, 1); if (tr.rot != 0) { - double rr = tr.rot / PCB_RAD_TO_DEG; + double rr = tr.rot / RND_RAD_TO_DEG; pcb_subc_rotate(proto, 0, 0, cos(rr), sin(rr), tr.rot); } if (tr.on_bottom) { Index: trunk/src_plugins/propedit/propsel.c =================================================================== --- trunk/src_plugins/propedit/propsel.c (revision 31001) +++ trunk/src_plugins/propedit/propsel.c (revision 31002) @@ -1003,7 +1003,7 @@ { switch(type) { case PCB_PROPT_STRING: return val->string == NULL ? rnd_strdup("") : rnd_strdup(val->string); - case PCB_PROPT_COORD: return pcb_strdup_printf("%m+%.02mS", pcbhl_conf.editor.grid_unit->allow, val->coord); + case PCB_PROPT_COORD: return pcb_strdup_printf("%m+%.02mS", rnd_conf.editor.grid_unit->allow, val->coord); case PCB_PROPT_ANGLE: return pcb_strdup_printf("%f", val->angle); case PCB_PROPT_INT: return pcb_strdup_printf("%d", val->i); case PCB_PROPT_BOOL: return rnd_strdup(val->i ? "true" : "false"); Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 31001) +++ trunk/src_plugins/report/report.c (revision 31002) @@ -76,7 +76,7 @@ "Report(AllNetLengths, [unit])"; static const char pcb_acth_Report[] = "Produce various report."; -#define USER_UNITMASK (pcbhl_conf.editor.grid_unit->allow) +#define USER_UNITMASK (rnd_conf.editor.grid_unit->allow) typedef struct rdialog_ctx_s { @@ -127,7 +127,7 @@ sprintf(stringlist, "There are %d different drill sizes used in this layout, %d holes total\n\n" "Drill Diam. (%s)\t# of Pins\t# of Vias\t# of Elements\t# Unplated\n", - AllDrills->DrillN, total_drills, pcbhl_conf.editor.grid_unit->suffix); + AllDrills->DrillN, total_drills, rnd_conf.editor.grid_unit->suffix); thestring = stringlist; while (*thestring != '\0') thestring++; @@ -134,7 +134,7 @@ for (n = 0; n < AllDrills->DrillN; n++) { pcb_sprintf(thestring, "%10m*\t\t\t%d\t\t%d\t\t%d\t\t\t\t%d\n", - pcbhl_conf.editor.grid_unit->suffix, + rnd_conf.editor.grid_unit->suffix, AllDrills->Drill[n].DrillSize, AllDrills->Drill[n].PinCount, AllDrills->Drill[n].ViaCount, AllDrills->Drill[n].ElementN, AllDrills->Drill[n].UnplatedCount); @@ -268,7 +268,7 @@ pcb_r_dump_tree(poly->parent.layer->polygon_tree, 0); #endif - aunit = pcbhl_conf.editor.grid_unit->suffix; + aunit = rnd_conf.editor.grid_unit->suffix; if (aunit[1] == 'm') u = PCB_MM_TO_COORD(1); else @@ -545,7 +545,7 @@ if (term != NULL) { char buf[50]; - const char *units_name = pcbhl_conf.editor.grid_unit->suffix; + const char *units_name = rnd_conf.editor.grid_unit->suffix; rnd_coord_t length; rnd_coord_t x = 0, y = 0; gds_t err; @@ -610,7 +610,7 @@ char buf[50]; const char *netname = net_name_found(PCB); - pcb_snprintf(buf, sizeof(buf), "%$m*", pcbhl_conf.editor.grid_unit->suffix, length); + pcb_snprintf(buf, sizeof(buf), "%$m*", rnd_conf.editor.grid_unit->suffix, length); if (netname) rnd_message(RND_MSG_INFO, "Net \"%s\" length: %s\n", netname, buf); else @@ -748,7 +748,7 @@ { char buf[50]; - pcb_snprintf(buf, sizeof(buf), "%$m*", pcbhl_conf.editor.grid_unit->suffix, length); + pcb_snprintf(buf, sizeof(buf), "%$m*", rnd_conf.editor.grid_unit->suffix, length); if (netname) rnd_message(RND_MSG_INFO, "Net \"%s\" length: %s\n", netname, buf); else Index: trunk/src_plugins/rubberband_orig/rubberband.c =================================================================== --- trunk/src_plugins/rubberband_orig/rubberband.c (revision 31001) +++ trunk/src_plugins/rubberband_orig/rubberband.c (revision 31002) @@ -229,7 +229,7 @@ if (i->radius < 0) rad = 0; /* require exact match */ else - rad = PCB_SQUARE(i->radius + t); + rad = RND_SQUARE(i->radius + t); x = (i->X - line->Point1.X); x *= x; @@ -318,7 +318,7 @@ if (i->radius < 0) rad = 0; /* require exact match */ else - rad = PCB_SQUARE(i->radius + t); + rad = RND_SQUARE(i->radius + t); x = (i->X - ex1); x *= x; Index: trunk/src_plugins/script/script.c =================================================================== --- trunk/src_plugins/script/script.c (revision 31001) +++ trunk/src_plugins/script/script.c (revision 31002) @@ -83,7 +83,7 @@ gds_t fn; gds_init(&fn); - gds_append_str(&fn, pcbhl_conf.rc.path.home); + gds_append_str(&fn, rnd_conf.rc.path.home); gds_append(&fn, RND_DIR_SEPARATOR_C); gds_append_str(&fn, DOT_PCB_RND); pcb_mkdir(NULL, fn.array, 0755); @@ -172,7 +172,7 @@ goto err; } - fn = pcb_concat(pcbhl_conf.rc.path.home, RND_DIR_SEPARATOR_S, DOT_PCB_RND, RND_DIR_SEPARATOR_S, SCRIPT_PERS, RND_DIR_SEPARATOR_S, script_persistency_id, NULL); + fn = pcb_concat(rnd_conf.rc.path.home, RND_DIR_SEPARATOR_S, DOT_PCB_RND, RND_DIR_SEPARATOR_S, SCRIPT_PERS, RND_DIR_SEPARATOR_S, script_persistency_id, NULL); if (strcmp(cmd, "remove") == 0) { RND_ACT_IRES(pcb_remove(NULL, fn)); @@ -250,7 +250,7 @@ { if (*fn != '~') return rnd_strdup(fn); - return pcb_strdup_printf("%s%c%s", pcbhl_conf.rc.path.home, RND_DIR_SEPARATOR_C, fn+1); + return pcb_strdup_printf("%s%c%s", rnd_conf.rc.path.home, RND_DIR_SEPARATOR_C, fn+1); } int pcb_script_load(const char *id, const char *fn, const char *lang) Index: trunk/src_plugins/serpentine/serpentine.c =================================================================== --- trunk/src_plugins/serpentine/serpentine.c (revision 31001) +++ trunk/src_plugins/serpentine/serpentine.c (revision 31002) @@ -164,8 +164,8 @@ end.X = ex; end.Y = ey; - angle_n = (0.0-(atan2(ny, nx) / PCB_M180)); - angle_l = (0.0-(atan2(ly, lx) / PCB_M180)); + angle_n = (0.0-(atan2(ny, nx) / RND_M180)); + angle_l = (0.0-(atan2(ly, lx) / RND_M180)); /* Calculate Amplitude */ amplitude = nd; Index: trunk/src_plugins/shape/shape.c =================================================================== --- trunk/src_plugins/shape/shape.c (revision 31001) +++ trunk/src_plugins/shape/shape.c (revision 31002) @@ -76,8 +76,8 @@ return NULL; if (rot_deg != 0.0) { - cosra = cos(rot_deg / PCB_RAD_TO_DEG); - sinra = sin(rot_deg / PCB_RAD_TO_DEG); + cosra = cos(rot_deg / RND_RAD_TO_DEG); + sinra = sin(rot_deg / RND_RAD_TO_DEG); } for(n = 0,a = 0; n < corners; n++,a+=da) { @@ -153,8 +153,8 @@ return NULL; if (rot_deg != 0.0) { - cosra = cos(rot_deg / PCB_RAD_TO_DEG); - sinra = sin(rot_deg / PCB_RAD_TO_DEG); + cosra = cos(rot_deg / RND_RAD_TO_DEG); + sinra = sin(rot_deg / RND_RAD_TO_DEG); need_rot = 1; } else Index: trunk/src_plugins/stroke/stroke.c =================================================================== --- trunk/src_plugins/stroke/stroke.c (revision 31001) +++ trunk/src_plugins/stroke/stroke.c (revision 31002) @@ -48,8 +48,8 @@ conf_stroke_t conf_stroke; -#define SIDE_X(hl, x) ((pcbhl_conf.editor.view.flip_x ? hl->size_x - (x) : (x))) -#define SIDE_Y(hl, y) ((pcbhl_conf.editor.view.flip_y ? hl->size_y - (y) : (y))) +#define SIDE_X(hl, x) ((rnd_conf.editor.view.flip_x ? hl->size_x - (x) : (x))) +#define SIDE_Y(hl, y) ((rnd_conf.editor.view.flip_y ? hl->size_y - (y) : (y))) static const char *pcb_stroke_cookie = "stroke plugin"; Index: trunk/src_plugins/tool_std/tool_arc.c =================================================================== --- trunk/src_plugins/tool_std/tool_arc.c (revision 31001) +++ trunk/src_plugins/tool_std/tool_arc.c (revision 31002) @@ -95,14 +95,14 @@ wy = hl->tool_y - pcb_crosshair.AttachedBox.Point1.Y; rnd_trace("arc: %mm %mm wh %mm %mm\n", hl->tool_x, hl->tool_y, wx, wy); if (PCB_XOR(pcb_crosshair.AttachedBox.otherway, coord_abs(wy) > coord_abs(wx))) { - pcb_crosshair.AttachedBox.Point2.X = pcb_crosshair.AttachedBox.Point1.X + coord_abs(wy) * PCB_SGNZ(wx); + pcb_crosshair.AttachedBox.Point2.X = pcb_crosshair.AttachedBox.Point1.X + coord_abs(wy) * RND_SGNZ(wx); sa = (wx >= 0) ? 0 : 180; - dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? 90 : -90; + dir = (RND_SGNZ(wx) == RND_SGNZ(wy)) ? 90 : -90; } else { - pcb_crosshair.AttachedBox.Point2.Y = pcb_crosshair.AttachedBox.Point1.Y + coord_abs(wx) * PCB_SGNZ(wy); + pcb_crosshair.AttachedBox.Point2.Y = pcb_crosshair.AttachedBox.Point1.Y + coord_abs(wx) * RND_SGNZ(wy); sa = (wy >= 0) ? -90 : 90; - dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? -90 : 90; + dir = (RND_SGNZ(wx) == RND_SGNZ(wy)) ? -90 : 90; wy = wx; } if (coord_abs(wy) > 0 && (arc = pcb_arc_new(pcb_loose_subc_layer(pcb, PCB_CURRLAYER(pcb), pcb_true), Index: trunk/tests/conf/conftest.c =================================================================== --- trunk/tests/conf/conftest.c (revision 31001) +++ trunk/tests/conf/conftest.c (revision 31002) @@ -352,7 +352,7 @@ rnd_conf_init(); conf_core_init(); - pcb_hidlib_conf_init(); + rnd_hidlib_conf_init(); rnd_conf_reset(RND_CFR_SYSTEM, "
"); rnd_conf_reset(RND_CFR_USER, "
"); Index: trunk/util/gsch2pcb-rnd/gsch2pcb.c =================================================================== --- trunk/util/gsch2pcb-rnd/gsch2pcb.c (revision 31001) +++ trunk/util/gsch2pcb-rnd/gsch2pcb.c (revision 31002) @@ -270,7 +270,7 @@ load_project("/etc/gsch2pcb"); load_project("/usr/local/etc/gsch2pcb"); - path = pcb_concat(pcbhl_conf.rc.path.home, RND_DIR_SEPARATOR_S, ".gEDA", RND_DIR_SEPARATOR_S, "gsch2pcb", NULL); + path = pcb_concat(rnd_conf.rc.path.home, RND_DIR_SEPARATOR_S, ".gEDA", RND_DIR_SEPARATOR_S, "gsch2pcb", NULL); load_project(path); free(path); @@ -401,7 +401,7 @@ rnd_file_loaded_init(); rnd_conf_init(); conf_core_init(); - pcb_hidlib_conf_init(); + rnd_hidlib_conf_init(); gadl_list_init(&schematics, sizeof(char *), NULL, NULL); gadl_list_init(&extra_gnetlist_arg_list, sizeof(char *), NULL, NULL);