Index: trunk/src/board.c =================================================================== --- trunk/src/board.c (revision 24882) +++ trunk/src/board.c (revision 24883) @@ -90,7 +90,7 @@ /* 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 = conf_core.editor.grid; - ptr->MaxHeight = ptr->MaxWidth = PCB_MM_TO_COORD(20); /* should be overriden by the default design */ + 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(); ptr->ThermScale = 0.5; @@ -259,8 +259,8 @@ void pcb_board_resize(pcb_coord_t Width, pcb_coord_t Height) { - PCB->MaxWidth = Width; - PCB->MaxHeight = Height; + PCB->hidlib.size_x = Width; + PCB->hidlib.size_y = Height; /* crosshair range is different if pastebuffer-mode * is enabled @@ -374,13 +374,13 @@ if (pcb_data_bbox(&b, pcb->Data, pcb_false) == NULL) return -1; - if ((b.X2 - b.X1) > pcb->MaxWidth) { - pcb->MaxWidth = b.X2 - b.X1; + if ((b.X2 - b.X1) > pcb->hidlib.size_x) { + pcb->hidlib.size_x = b.X2 - b.X1; chg++; } - if ((b.Y2 - b.Y1) > pcb->MaxHeight) { - pcb->MaxHeight = b.Y2 - b.Y1; + if ((b.Y2 - b.Y1) > pcb->hidlib.size_y) { + pcb->hidlib.size_y = b.Y2 - b.Y1; chg++; } Index: trunk/src/board.h =================================================================== --- trunk/src/board.h (revision 24882) +++ trunk/src/board.h (revision 24883) @@ -81,7 +81,6 @@ pcb_bool RatDraw; /* we're drawing rats */ pcb_bool loose_subc; /* when set, subc parts are not locked into the subc */ - pcb_coord_t MaxWidth, MaxHeight; /* board dimensions (drawing area extents) */ double ThermScale; /* scale factor used with thermals */ @@ -129,7 +128,7 @@ void pcb_board_count_slots(pcb_board_t *pcb, int *plated, int *unplated, const pcb_box_t *within_area); #define PCB_SWAP_X(x) (PCB_SWAP_SIGN_X(x)) -#define PCB_SWAP_Y(y) (PCB->MaxHeight +PCB_SWAP_SIGN_Y(y)) +#define PCB_SWAP_Y(y) (PCB->hidlib.size_y +PCB_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)) Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 24882) +++ trunk/src/buffer.c (revision 24883) @@ -501,7 +501,7 @@ /* this results in saving flipped (bottom-side) footprints whenlooking at the board from the bottom */ PCB_SUBC_LOOP(Buffer->Data); { - pcb_subc_change_side(subc, /*2 * pcb_crosshair.Y - PCB->MaxHeight*/0); + pcb_subc_change_side(subc, /*2 * pcb_crosshair.Y - PCB->hidlib.size_y*/0); } PCB_END_LOOP; #endif Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 24882) +++ trunk/src/crosshair.c (revision 24883) @@ -1022,8 +1022,8 @@ { pcb_crosshair.MinX = MAX(0, MinX); pcb_crosshair.MinY = MAX(0, MinY); - pcb_crosshair.MaxX = MIN(PCB->MaxWidth, MaxX); - pcb_crosshair.MaxY = MIN(PCB->MaxHeight, MaxY); + pcb_crosshair.MaxX = MIN(PCB->hidlib.size_x, MaxX); + pcb_crosshair.MaxY = MIN(PCB->hidlib.size_y, MaxY); /* force update of position */ pcb_crosshair_move_relative(0, 0); @@ -1060,8 +1060,8 @@ /* set default limits */ pcb_crosshair.MinX = pcb_crosshair.MinY = 0; - pcb_crosshair.MaxX = PCB->MaxWidth; - pcb_crosshair.MaxY = PCB->MaxHeight; + pcb_crosshair.MaxX = PCB->hidlib.size_x; + pcb_crosshair.MaxY = PCB->hidlib.size_y; /* Initialize the onpoint data. */ memset(&pcb_crosshair.onpoint_objs, 0, sizeof(vtop_t)); @@ -1088,12 +1088,12 @@ if (pcb_set_buffer_bbox(PCB_PASTEBUFFER) == 0) { pcb_crosshair_set_range(PCB_PASTEBUFFER->X - PCB_PASTEBUFFER->bbox_naked.X1, PCB_PASTEBUFFER->Y - PCB_PASTEBUFFER->bbox_naked.Y1, - PCB->MaxWidth - + PCB->hidlib.size_x - (PCB_PASTEBUFFER->bbox_naked.X2 - PCB_PASTEBUFFER->X), - PCB->MaxHeight - (PCB_PASTEBUFFER->bbox_naked.Y2 - PCB_PASTEBUFFER->Y)); + PCB->hidlib.size_y - (PCB_PASTEBUFFER->bbox_naked.Y2 - PCB_PASTEBUFFER->Y)); } else /* failed to calculate the bounding box of the buffer, it's probably a single-object move, allow the whole page */ - pcb_crosshair_set_range(0, 0, PCB->MaxWidth, PCB->MaxHeight); + pcb_crosshair_set_range(0, 0, PCB->hidlib.size_x, PCB->hidlib.size_y); } } Index: trunk/src/draw_composite.c =================================================================== --- trunk/src/draw_composite.c (revision 24882) +++ trunk/src/draw_composite.c (revision 24883) @@ -43,7 +43,7 @@ { pcb_gui->set_color(pcb_draw_out.fgGC, ctx->color); if (ctx->info->drawn_area == NULL) - pcb_gui->fill_rect(pcb_draw_out.fgGC, 0, 0, ctx->info->pcb->MaxWidth, ctx->info->pcb->MaxHeight); + pcb_gui->fill_rect(pcb_draw_out.fgGC, 0, 0, ctx->info->pcb->hidlib.size_x, ctx->info->pcb->hidlib.size_y); else pcb_gui->fill_rect(pcb_draw_out.fgGC, ctx->info->drawn_area->X1, ctx->info->drawn_area->Y1, ctx->info->drawn_area->X2, ctx->info->drawn_area->Y2); } Index: trunk/src/draw_ly_spec.c =================================================================== --- trunk/src/draw_ly_spec.c (revision 24882) +++ trunk/src/draw_ly_spec.c (revision 24883) @@ -270,7 +270,7 @@ pcb_gui->set_color(pcb_draw_out.fgGC, &PCB->Data->Layer[goutl->lid[0]].meta.real.color); pcb_hid_set_line_cap(pcb_draw_out.fgGC, pcb_cap_round); pcb_hid_set_line_width(pcb_draw_out.fgGC, conf_core.design.min_wid); - pcb_gui->draw_rect(pcb_draw_out.fgGC, 0, 0, PCB->MaxWidth, PCB->MaxHeight); + pcb_gui->draw_rect(pcb_draw_out.fgGC, 0, 0, PCB->hidlib.size_x, PCB->hidlib.size_y); pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, pcb_draw_out.direct, info->drawn_area); pcb_gui->end_layer(); Index: trunk/src/file_act.c =================================================================== --- trunk/src/file_act.c (revision 24882) +++ trunk/src/file_act.c (revision 24883) @@ -157,8 +157,8 @@ PCB->Name = name; pcb_layervis_reset_stack(); - pcb_crosshair_set_range(0, 0, PCB->MaxWidth, PCB->MaxHeight); - pcb_center_display(PCB->MaxWidth / 2, PCB->MaxHeight / 2); + pcb_crosshair_set_range(0, 0, PCB->hidlib.size_x, PCB->hidlib.size_y); + pcb_center_display(PCB->hidlib.size_x / 2, PCB->hidlib.size_y / 2); pcb_redraw(); pcb_board_changed(0); pcb_notify_crosshair_change(pcb_true); Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 24882) +++ trunk/src/gui_act.c (revision 24883) @@ -976,10 +976,10 @@ const char *a1, *a2, *a3; extra_units_x[0].scale = PCB->hidlib.grid; - extra_units_x[2].scale = PCB->MaxWidth; + extra_units_x[2].scale = PCB->hidlib.size_x; extra_units_y[0].scale = PCB->hidlib.grid; - extra_units_y[2].scale = PCB->MaxHeight; + extra_units_y[2].scale = PCB->hidlib.size_y; pcb_gui->get_view_size(&view_width, &view_height); Index: trunk/src/hidlib.h =================================================================== --- trunk/src/hidlib.h (revision 24882) +++ trunk/src/hidlib.h (revision 24883) @@ -29,6 +29,7 @@ struct pcb_hidlib_s { pcb_coord_t grid; /* grid resolution */ pcb_coord_t grid_ox, grid_oy; /* grid offset */ + pcb_coord_t size_x, size_y; /* drawing area extents (or board dimensions) */ }; /* optional: if non-NULL, called back to determine the file name or project Index: trunk/src/obj_subc.c =================================================================== --- trunk/src/obj_subc.c (revision 24882) +++ trunk/src/obj_subc.c (revision 24883) @@ -1074,7 +1074,7 @@ pcb_undo_inc_serial(); last = pcb_undo_serial(); TODO("subc: should not depend on crosshair, because of automatic/scripted placement; test case 1: load subc footprint in buffer, swap side to bottom, place; test case 2: bug_files/cmd_element, execute the cmd while being on the bottom side, without crosshair set subcircuits catapult to negative y") - pcb_subc_change_side(sc, 2 * pcb_crosshair.Y - PCB->MaxHeight); + pcb_subc_change_side(sc, 2 * pcb_crosshair.Y - PCB->hidlib.size_y); pcb_undo_truncate_from(last); } @@ -1163,7 +1163,7 @@ PCB_SUBC_LOOP(PCB->Data); { if (PCB_FLAG_TEST(PCB_FLAG_SELECTED, subc)) { - change |= pcb_subc_change_side(subc, 2 * pcb_crosshair.Y - PCB->MaxHeight); + change |= pcb_subc_change_side(subc, 2 * pcb_crosshair.Y - PCB->hidlib.size_y); } } PCB_END_LOOP; @@ -1966,7 +1966,7 @@ } if (dst_on_bottom != src_on_bottom) - pcb_subc_change_side(placed, 2 * oy - PCB->MaxHeight); + pcb_subc_change_side(placed, 2 * oy - PCB->hidlib.size_y); pcb_undo_freeze_add(); pcb_subc_select(pcb, placed, (flags & PCB_FLAG_SELECTED) ? PCB_CHGFLG_SET : PCB_CHGFLG_CLEAR, 0); Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 24882) +++ trunk/src/object_act.c (revision 24883) @@ -176,7 +176,7 @@ *dx += pcb->hidlib.grid; /* Figure out if this row has room. If not, start a new row */ - if (GAP + obj->BoundingBox.X2 + *dx > pcb->MaxWidth) { + if (GAP + obj->BoundingBox.X2 + *dx > pcb->hidlib.size_x) { *miny = *maxy + GAP; *minx = GAP; } @@ -199,7 +199,7 @@ *minx = newx2 + GAP; if (*maxy < newy2) { *maxy = newy2; - if (*maxy > PCB->MaxHeight - GAP) { + if (*maxy > PCB->hidlib.size_y - GAP) { *maxy = GAP; pcb_message(PCB_MSG_WARNING, "The board is too small for hosting all subcircuits,\ndiesperse restarted from the top.\nExpect overlapping subcircuits\n"); } @@ -266,7 +266,7 @@ if ((pcb_search_screen(pcb_crosshair.X, pcb_crosshair.Y, PCB_OBJ_SUBC, &ptrtmp, &ptrtmp, &ptrtmp)) != PCB_OBJ_VOID) { pcb_subc_t *subc = (pcb_subc_t *)ptrtmp; pcb_undo_freeze_serial(); - pcb_subc_change_side(subc, 2 * pcb_crosshair.Y - PCB->MaxHeight); + pcb_subc_change_side(subc, 2 * pcb_crosshair.Y - PCB->hidlib.size_y); pcb_undo_unfreeze_serial(); pcb_undo_inc_serial(); pcb_draw(); @@ -492,9 +492,9 @@ return 0; } - nx = PCB->MaxWidth / 2; - ny = PCB->MaxHeight / 2; - d = MIN(PCB->MaxWidth, PCB->MaxHeight) / 10; + nx = PCB->hidlib.size_x / 2; + ny = PCB->hidlib.size_y / 2; + d = MIN(PCB->hidlib.size_x, PCB->hidlib.size_y) / 10; nx = parse_layout_attribute_units("import::newX", nx); ny = parse_layout_attribute_units("import::newY", ny); @@ -507,12 +507,12 @@ if (nx < 0) nx = 0; - if (nx >= PCB->MaxWidth) - nx = PCB->MaxWidth - 1; + if (nx >= PCB->hidlib.size_x) + nx = PCB->hidlib.size_x - 1; if (ny < 0) ny = 0; - if (ny >= PCB->MaxHeight) - ny = PCB->MaxHeight - 1; + if (ny >= PCB->hidlib.size_y) + ny = PCB->hidlib.size_y - 1; /* Place components onto center of board. */ pcb_crosshair.Y = ny; /* flipping side depends on the crosshair unfortunately */ @@ -553,7 +553,7 @@ pcb_coord_t pcx = 0, pcy = 0; pcb_subc_get_origin(psc, &pcx, &pcy); if (!orig_on_top) - pcb_subc_change_side(psc, pcy * 2 - PCB->MaxHeight); + pcb_subc_change_side(psc, pcy * 2 - PCB->hidlib.size_y); if (orig_rot != 0) { double cosa, sina; cosa = cos(orig_rot / PCB_RAD_TO_DEG); Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 24882) +++ trunk/src/plug_io.c (revision 24883) @@ -500,11 +500,11 @@ pcb_board_new_postproc(PCB, 0); if (how == 0) { /* update cursor location */ - pcb_crosshair.X = PCB->MaxWidth/2; - pcb_crosshair.Y = PCB->MaxHeight/2; + pcb_crosshair.X = PCB->hidlib.size_x/2; + pcb_crosshair.Y = PCB->hidlib.size_y/2; /* update cursor confinement and output area (scrollbars) */ - pcb_board_resize(PCB->MaxWidth, PCB->MaxHeight); + pcb_board_resize(PCB->hidlib.size_x, PCB->hidlib.size_y); } /* have to be called after pcb_board_resize() so vis update is after a board changed update */ Index: trunk/src/tool.c =================================================================== --- trunk/src/tool.c (revision 24882) +++ trunk/src/tool.c (revision 24883) @@ -300,8 +300,8 @@ pcb_obj_get_bbox_naked(pcb_crosshair.AttachedObject.Type, pcb_crosshair.AttachedObject.Ptr1, pcb_crosshair.AttachedObject.Ptr2, pcb_crosshair.AttachedObject.Ptr3, &box); pcb_crosshair_set_range(pcb_crosshair.AttachedObject.X - box.X1, pcb_crosshair.AttachedObject.Y - box.Y1, - PCB->MaxWidth - (box.X2 - pcb_crosshair.AttachedObject.X), - PCB->MaxHeight - (box.Y2 - pcb_crosshair.AttachedObject.Y)); + PCB->hidlib.size_x - (box.X2 - pcb_crosshair.AttachedObject.X), + PCB->hidlib.size_y - (box.Y2 - pcb_crosshair.AttachedObject.Y)); /* get all attached objects if necessary */ if (do_rubberband && conf_core.editor.rubber_band_mode) Index: trunk/src/tool_buffer.c =================================================================== --- trunk/src/tool_buffer.c (revision 24882) +++ trunk/src/tool_buffer.c (revision 24883) @@ -52,7 +52,7 @@ void pcb_tool_buffer_uninit(void) { - pcb_crosshair_set_range(0, 0, PCB->MaxWidth, PCB->MaxHeight); + pcb_crosshair_set_range(0, 0, PCB->hidlib.size_x, PCB->hidlib.size_y); } void pcb_tool_buffer_notify_mode(void) Index: trunk/src/tool_move.c =================================================================== --- trunk/src/tool_move.c (revision 24882) +++ trunk/src/tool_move.c (revision 24883) @@ -88,7 +88,7 @@ /* reset identifiers */ pcb_crosshair.AttachedObject.Type = PCB_OBJ_VOID; pcb_crosshair.AttachedObject.State = PCB_CH_STATE_FIRST; - pcb_crosshair_set_range(0, 0, PCB->MaxWidth, PCB->MaxHeight); + pcb_crosshair_set_range(0, 0, PCB->hidlib.size_x, PCB->hidlib.size_y); break; } } Index: trunk/src_plugins/ar_cpcb/ar_cpcb.c =================================================================== --- trunk/src_plugins/ar_cpcb/ar_cpcb.c (revision 24882) +++ trunk/src_plugins/ar_cpcb/ar_cpcb.c (revision 24883) @@ -255,7 +255,7 @@ htpp_entry_t *e; /* print dims */ - pcb_fprintf(f, "(%d %d %d)\n", (int)(PCB_COORD_TO_MM(pcb->MaxWidth)+0.5), (int)(PCB_COORD_TO_MM(pcb->MaxHeight)+0.5), stack->maxlayer); + pcb_fprintf(f, "(%d %d %d)\n", (int)(PCB_COORD_TO_MM(pcb->hidlib.size_x)+0.5), (int)(PCB_COORD_TO_MM(pcb->hidlib.size_y)+0.5), stack->maxlayer); /* print tracks */ for(e = htpp_first(&nmap->netmap.n2o); e != NULL; e = htpp_next(&nmap->netmap.n2o, e)) { Index: trunk/src_plugins/autocrop/autocrop.c =================================================================== --- trunk/src_plugins/autocrop/autocrop.c (revision 24882) +++ trunk/src_plugins/autocrop/autocrop.c (revision 24883) @@ -54,7 +54,7 @@ w = ((box.X2 + dx) / PCB->hidlib.grid + 2) * PCB->hidlib.grid; h = ((box.Y2 + dy) / PCB->hidlib.grid + 2) * PCB->hidlib.grid; - if ((dx == 0) && (dy == 0) && (w == PCB->MaxWidth) && (h == PCB->MaxHeight)) + if ((dx == 0) && (dy == 0) && (w == PCB->hidlib.size_x) && (h == PCB->hidlib.size_y)) return 0; pcb_draw_inhibit_inc(); Index: trunk/src_plugins/autoplace/autoplace.c =================================================================== --- trunk/src_plugins/autoplace/autoplace.c (revision 24882) +++ trunk/src_plugins/autoplace/autoplace.c (revision 24883) @@ -281,8 +281,8 @@ ni.search_dir = search_direction; bbox.X1 = bbox.Y1 = 0; - bbox.X2 = PCB->MaxWidth; - bbox.Y2 = PCB->MaxHeight; + bbox.X2 = PCB->hidlib.size_x; + bbox.Y2 = PCB->hidlib.size_y; /* rotate so that we can use the 'north' case for everything */ PCB_BOX_ROTATE_TO_NORTH(bbox, search_direction); PCB_BOX_ROTATE_TO_NORTH(ni.trap, search_direction); @@ -590,8 +590,8 @@ case 0: { /* shift! */ pcb_coord_t grid; - double scaleX = PCB_CLAMP(sqrt(T), PCB_MIL_TO_COORD(2.5), PCB->MaxWidth / 3); - double scaleY = PCB_CLAMP(sqrt(T), PCB_MIL_TO_COORD(2.5), PCB->MaxHeight / 3); + 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); pt.which = SHIFT; pt.DX = scaleX * 2 * ((((double) pcb_rand()) / RAND_MAX) - 0.5); pt.DY = scaleY * 2 * ((((double) pcb_rand()) / RAND_MAX) - 0.5); @@ -604,9 +604,9 @@ { pcb_subc_t *s = (pcb_subc_t *)pt.comp; pt.DX = MAX(pt.DX, -s->BoundingBox.X1); - pt.DX = MIN(pt.DX, PCB->MaxWidth - s->BoundingBox.X2); + pt.DX = MIN(pt.DX, PCB->hidlib.size_x - s->BoundingBox.X2); pt.DY = MAX(pt.DY, -s->BoundingBox.Y1); - pt.DY = MIN(pt.DY, PCB->MaxHeight - s->BoundingBox.Y2); + pt.DY = MIN(pt.DY, PCB->hidlib.size_y - s->BoundingBox.Y2); } /* all done but the movin' */ break; Index: trunk/src_plugins/autoroute/autoroute.c =================================================================== --- trunk/src_plugins/autoroute/autoroute.c (revision 24882) +++ trunk/src_plugins/autoroute/autoroute.c (revision 24883) @@ -1169,8 +1169,8 @@ rd->max_keep = conf_core.design.clearance; /* create styles structures */ bbox.X1 = bbox.Y1 = 0; - bbox.X2 = PCB->MaxWidth; - bbox.Y2 = PCB->MaxHeight; + bbox.X2 = PCB->hidlib.size_x; + bbox.Y2 = PCB->hidlib.size_y; for (i = 0; i < rd->max_styles + 1; i++) { pcb_route_style_t *style = (i < rd->max_styles) ? &PCB->RouteStyle.array[i] : &rd->defaultstyle; rd->styles[i] = style; @@ -2083,8 +2083,8 @@ case PCB_ANY_DIR: ans.inflated.X1 = (e->rb->came_from == PCB_EAST ? ans.orig.X1 : 0); ans.inflated.Y1 = (e->rb->came_from == PCB_SOUTH ? ans.orig.Y1 : 0); - ans.inflated.X2 = (e->rb->came_from == PCB_WEST ? ans.orig.X2 : PCB->MaxWidth); - ans.inflated.Y2 = (e->rb->came_from == PCB_NORTH ? ans.orig.Y2 : PCB->MaxHeight); + ans.inflated.X2 = (e->rb->came_from == PCB_WEST ? ans.orig.X2 : PCB->hidlib.size_x); + ans.inflated.Y2 = (e->rb->came_from == PCB_NORTH ? ans.orig.Y2 : PCB->hidlib.size_y); if (e->rb->came_from == PCB_NORTH) ans.done = noshrink = _SOUTH; else if (e->rb->came_from == PCB_EAST) @@ -2108,7 +2108,7 @@ ans.done = _SOUTH + _WEST; noshrink = 0; ans.inflated.X1 = box->X1 - ans.bloat; - ans.inflated.X2 = PCB->MaxWidth; + ans.inflated.X2 = PCB->hidlib.size_x; ans.inflated.Y2 = box->Y2 + ans.bloat; ans.inflated.Y1 = 0; break; @@ -2118,14 +2118,14 @@ ans.inflated.Y1 = box->Y1 - ans.bloat; ans.inflated.Y2 = box->Y2 + ans.bloat; ans.inflated.X1 = box->X1; - ans.inflated.X2 = PCB->MaxWidth; + ans.inflated.X2 = PCB->hidlib.size_x; break; case PCB_SE: ans.done = _NORTH + _WEST; noshrink = 0; ans.inflated.X1 = box->X1 - ans.bloat; - ans.inflated.X2 = PCB->MaxWidth; - ans.inflated.Y2 = PCB->MaxHeight; + ans.inflated.X2 = PCB->hidlib.size_x; + ans.inflated.Y2 = PCB->hidlib.size_y; ans.inflated.Y1 = box->Y1 - ans.bloat; break; case PCB_SOUTH: @@ -2134,7 +2134,7 @@ ans.inflated.X1 = box->X1 - ans.bloat; ans.inflated.X2 = box->X2 + ans.bloat; ans.inflated.Y1 = box->Y1; - ans.inflated.Y2 = PCB->MaxHeight; + ans.inflated.Y2 = PCB->hidlib.size_y; break; case PCB_SW: ans.done = _NORTH + _EAST; @@ -2141,7 +2141,7 @@ noshrink = 0; ans.inflated.X1 = 0; ans.inflated.X2 = box->X2 + ans.bloat; - ans.inflated.Y2 = PCB->MaxHeight; + ans.inflated.Y2 = PCB->hidlib.size_y; ans.inflated.Y1 = box->Y1 - ans.bloat; break; case PCB_WEST: @@ -2176,11 +2176,11 @@ else ans.done |= _NORTH; if (ans.e && !boink_box(ans.e, &ans, PCB_EAST)) - ans.inflated.X2 = PCB->MaxWidth; + ans.inflated.X2 = PCB->hidlib.size_x; else ans.done |= _EAST; if (ans.s && !boink_box(ans.s, &ans, PCB_SOUTH)) - ans.inflated.Y2 = PCB->MaxHeight; + ans.inflated.Y2 = PCB->hidlib.size_y; else ans.done |= _SOUTH; if (ans.w && !boink_box(ans.w, &ans, PCB_WEST)) @@ -2297,13 +2297,13 @@ case PCB_EAST: b.X1 = b.X2; b.X2++; - if (b.X2 >= PCB->MaxWidth - AutoRouteParameters.bloat) + if (b.X2 >= PCB->hidlib.size_x - AutoRouteParameters.bloat) return; /* off board edge */ break; case PCB_SOUTH: b.Y1 = b.Y2; b.Y2++; - if (b.Y2 >= PCB->MaxHeight - AutoRouteParameters.bloat) + if (b.Y2 >= PCB->hidlib.size_y - AutoRouteParameters.bloat) return; /* off board edge */ break; case PCB_WEST: @@ -2313,25 +2313,25 @@ return; /* off board edge */ break; case PCB_NE: - if (b.Y1 <= AutoRouteParameters.bloat + 1 && b.X2 >= PCB->MaxWidth - AutoRouteParameters.bloat - 1) + if (b.Y1 <= AutoRouteParameters.bloat + 1 && b.X2 >= PCB->hidlib.size_x - AutoRouteParameters.bloat - 1) return; /* off board edge */ if (b.Y1 <= AutoRouteParameters.bloat + 1) dir = PCB_EAST; /* north off board edge */ - if (b.X2 >= PCB->MaxWidth - AutoRouteParameters.bloat - 1) + if (b.X2 >= PCB->hidlib.size_x - AutoRouteParameters.bloat - 1) dir = PCB_NORTH; /* east off board edge */ break; case PCB_SE: - if (b.Y2 >= PCB->MaxHeight - AutoRouteParameters.bloat - 1 && b.X2 >= PCB->MaxWidth - AutoRouteParameters.bloat - 1) + if (b.Y2 >= PCB->hidlib.size_y - AutoRouteParameters.bloat - 1 && b.X2 >= PCB->hidlib.size_x - AutoRouteParameters.bloat - 1) return; /* off board edge */ - if (b.Y2 >= PCB->MaxHeight - AutoRouteParameters.bloat - 1) + if (b.Y2 >= PCB->hidlib.size_y - AutoRouteParameters.bloat - 1) dir = PCB_EAST; /* south off board edge */ - if (b.X2 >= PCB->MaxWidth - AutoRouteParameters.bloat - 1) + if (b.X2 >= PCB->hidlib.size_x - AutoRouteParameters.bloat - 1) dir = PCB_SOUTH; /* east off board edge */ break; case PCB_SW: - if (b.Y2 >= PCB->MaxHeight - AutoRouteParameters.bloat - 1 && b.X1 <= AutoRouteParameters.bloat + 1) + if (b.Y2 >= PCB->hidlib.size_y - AutoRouteParameters.bloat - 1 && b.X1 <= AutoRouteParameters.bloat + 1) return; /* off board edge */ - if (b.Y2 >= PCB->MaxHeight - AutoRouteParameters.bloat - 1) + if (b.Y2 >= PCB->hidlib.size_y - AutoRouteParameters.bloat - 1) dir = PCB_WEST; /* south off board edge */ if (b.X1 <= AutoRouteParameters.bloat + 1) dir = PCB_SOUTH; /* west off board edge */ Index: trunk/src_plugins/diag/integrity.c =================================================================== --- trunk/src_plugins/diag/integrity.c (revision 24882) +++ trunk/src_plugins/diag/integrity.c (revision 24883) @@ -116,7 +116,7 @@ if ((subc->BoundingBox.X2 < 0) || (subc->BoundingBox.Y2 < 0)) pcb_message(PCB_MSG_ERROR, CHK "subc %ld is on negative coordinates; its bottom right corner is %$mm;%$mm\n", subc->ID, subc->BoundingBox.X2, subc->BoundingBox.Y2); - if ((subc->BoundingBox.X1 > PCB->MaxWidth) || (subc->BoundingBox.Y1 > PCB->MaxHeight)) + if ((subc->BoundingBox.X1 > PCB->hidlib.size_x) || (subc->BoundingBox.Y1 > PCB->hidlib.size_y)) pcb_message(PCB_MSG_ERROR, CHK "subc %ld is olost beyond board extents; its top left corner is %$mm;%$mm\n", subc->ID, subc->BoundingBox.X1, subc->BoundingBox.Y1); if ((arefdes == NULL) && (subc->refdes == NULL)) Index: trunk/src_plugins/dialogs/dlg_netlist.c =================================================================== --- trunk/src_plugins/dialogs/dlg_netlist.c (revision 24882) +++ trunk/src_plugins/dialogs/dlg_netlist.c (revision 24883) @@ -312,8 +312,8 @@ netlist_ctx.bb_prv.X1 = 0; netlist_ctx.bb_prv.Y1 = 0; - netlist_ctx.bb_prv.X2 = pcb->MaxWidth; - netlist_ctx.bb_prv.Y2 = pcb->MaxHeight; + netlist_ctx.bb_prv.X2 = pcb->hidlib.size_x; + netlist_ctx.bb_prv.Y2 = pcb->hidlib.size_y; netlist_ctx.pcb = pcb; PCB_DAD_BEGIN_VBOX(netlist_ctx.dlg); /* layout */ Index: trunk/src_plugins/dialogs/dlg_pref_sizes.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_sizes.c (revision 24882) +++ trunk/src_plugins/dialogs/dlg_pref_sizes.c (revision 24883) @@ -36,8 +36,8 @@ { if (ctx->sizes.lock) return; - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->sizes.wwidth, coord_value, PCB->MaxWidth); - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->sizes.wheight, coord_value, PCB->MaxHeight); + PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->sizes.wwidth, coord_value, PCB->hidlib.size_x); + PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->sizes.wheight, coord_value, PCB->hidlib.size_y); } /* Dialog box to actual board size */ @@ -46,7 +46,7 @@ pref_ctx_t *ctx = caller_data; ctx->sizes.lock++; - if ((PCB->MaxWidth != ctx->dlg[ctx->sizes.wwidth].default_val.coord_value) || (PCB->MaxHeight != ctx->dlg[ctx->sizes.wheight].default_val.coord_value)) + if ((PCB->hidlib.size_x != ctx->dlg[ctx->sizes.wwidth].default_val.coord_value) || (PCB->hidlib.size_y != ctx->dlg[ctx->sizes.wheight].default_val.coord_value)) pcb_board_resize(ctx->dlg[ctx->sizes.wwidth].default_val.coord_value, ctx->dlg[ctx->sizes.wheight].default_val.coord_value); ctx->sizes.lock--; } @@ -99,13 +99,13 @@ PCB_DAD_COORD(ctx->dlg, ""); ctx->sizes.wwidth = PCB_DAD_CURRENT(ctx->dlg); PCB_DAD_MINMAX(ctx->dlg, PCB_MM_TO_COORD(1), PCB_MAX_COORD); - PCB_DAD_DEFAULT_NUM(ctx->dlg, PCB->MaxWidth); + PCB_DAD_DEFAULT_NUM(ctx->dlg, PCB->hidlib.size_x); PCB_DAD_CHANGE_CB(ctx->dlg, pref_sizes_dlg2brd); PCB_DAD_LABEL(ctx->dlg, "Height="); PCB_DAD_COORD(ctx->dlg, ""); ctx->sizes.wheight = PCB_DAD_CURRENT(ctx->dlg); PCB_DAD_MINMAX(ctx->dlg, PCB_MM_TO_COORD(1), PCB_MAX_COORD); - PCB_DAD_DEFAULT_NUM(ctx->dlg, PCB->MaxHeight); + PCB_DAD_DEFAULT_NUM(ctx->dlg, PCB->hidlib.size_y); PCB_DAD_CHANGE_CB(ctx->dlg, pref_sizes_dlg2brd); PCB_DAD_END(ctx->dlg); Index: trunk/src_plugins/draw_fab/draw_fab.c =================================================================== --- trunk/src_plugins/draw_fab/draw_fab.c (revision 24882) +++ trunk/src_plugins/draw_fab/draw_fab.c (revision 24883) @@ -196,7 +196,7 @@ PCB_END_LOOP; if (!found) { pcb_hid_set_line_width(gc, FAB_LINE_W); - text_at(info, gc, PCB->MaxWidth / 2, PCB->MaxHeight + PCB_MIL_TO_COORD(20), 1, "Board outline is the centerline of this path"); + text_at(info, gc, PCB->hidlib.size_x / 2, PCB->hidlib.size_y + PCB_MIL_TO_COORD(20), 1, "Board outline is the centerline of this path"); } } @@ -307,18 +307,18 @@ } if (!found) { pcb_hid_set_line_width(gc, PCB_MIL_TO_COORD(10)); - pcb_gui->draw_line(gc, 0, 0, PCB->MaxWidth, 0); - pcb_gui->draw_line(gc, 0, 0, 0, PCB->MaxHeight); - pcb_gui->draw_line(gc, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight); - pcb_gui->draw_line(gc, 0, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight); + pcb_gui->draw_line(gc, 0, 0, PCB->hidlib.size_x, 0); + pcb_gui->draw_line(gc, 0, 0, 0, PCB->hidlib.size_y); + pcb_gui->draw_line(gc, PCB->hidlib.size_x, 0, PCB->hidlib.size_x, PCB->hidlib.size_y); + pcb_gui->draw_line(gc, 0, PCB->hidlib.size_y, PCB->hidlib.size_x, PCB->hidlib.size_y); /*FPrintOutline (); */ pcb_hid_set_line_width(gc, FAB_LINE_W); text_at(info, gc, PCB_MIL_TO_COORD(2000), yoff, 0, - "Maximum Dimensions: %f mils wide, %f mils high", PCB_COORD_TO_MIL(PCB->MaxWidth), PCB_COORD_TO_MIL(PCB->MaxHeight)); - text_at(info, gc, PCB->MaxWidth / 2, PCB->MaxHeight + PCB_MIL_TO_COORD(20), 1, + "Maximum Dimensions: %f mils wide, %f mils high", PCB_COORD_TO_MIL(PCB->hidlib.size_x), PCB_COORD_TO_MIL(PCB->hidlib.size_y)); + text_at(info, gc, PCB->hidlib.size_x / 2, PCB->hidlib.size_y + PCB_MIL_TO_COORD(20), 1, "Board outline is the centerline of this %f mil" " rectangle - 0,0 to %f,%f mils", - PCB_COORD_TO_MIL(FAB_LINE_W), PCB_COORD_TO_MIL(PCB->MaxWidth), PCB_COORD_TO_MIL(PCB->MaxHeight)); + PCB_COORD_TO_MIL(FAB_LINE_W), PCB_COORD_TO_MIL(PCB->hidlib.size_x), PCB_COORD_TO_MIL(PCB->hidlib.size_y)); } yoff -= TEXT_LINE; Index: trunk/src_plugins/drc_orig/drc_orig.c =================================================================== --- trunk/src_plugins/drc_orig/drc_orig.c (revision 24882) +++ trunk/src_plugins/drc_orig/drc_orig.c (revision 24883) @@ -368,15 +368,15 @@ const char *message = NULL; pcb_coord_t measured, required; - if (o->BoundingBox.X1 > PCB->MaxWidth) { + if (o->BoundingBox.X1 > PCB->hidlib.size_x) { message = "Beyond the drawing area, to the right"; measured = o->BoundingBox.X1; - required = PCB->MaxWidth; + required = PCB->hidlib.size_x; } - else if (o->BoundingBox.Y1 > PCB->MaxHeight) { + else if (o->BoundingBox.Y1 > PCB->hidlib.size_y) { message = "Beyond the drawing area, to the bottom"; measured = o->BoundingBox.Y1; - required = PCB->MaxHeight; + required = PCB->hidlib.size_y; } else if (o->BoundingBox.X2 < 0) { message = "Beyond the drawing area, to the left"; Index: trunk/src_plugins/export_bboard/bboard.c =================================================================== --- trunk/src_plugins/export_bboard/bboard.c (revision 24882) +++ trunk/src_plugins/export_bboard/bboard.c (revision 24883) @@ -521,7 +521,7 @@ group_data[pcb_layer_get_group(PCB, i)].draw = 1; } - bboard_init_board_cairo(PCB->MaxWidth, PCB->MaxHeight, bboard_bgcolor, options[HA_antialias].int_value); + bboard_init_board_cairo(PCB->hidlib.size_x, PCB->hidlib.size_y, bboard_bgcolor, options[HA_antialias].int_value); TODO("subc: rewrite") #if 0 Index: trunk/src_plugins/export_dsn/dsn.c =================================================================== --- trunk/src_plugins/export_dsn/dsn.c (revision 24882) +++ trunk/src_plugins/export_dsn/dsn.c (revision 24883) @@ -149,7 +149,7 @@ /* PCB outline */ pcb_fprintf(fp, " (boundary\n"); - pcb_fprintf(fp, " (rect pcb 0.0 0.0 %.6mm %.6mm)\n", PCB->MaxWidth, PCB->MaxHeight); + pcb_fprintf(fp, " (rect pcb 0.0 0.0 %.6mm %.6mm)\n", PCB->hidlib.size_x, PCB->hidlib.size_y); pcb_fprintf(fp, " )\n"); pcb_fprintf(fp, " (via via_%ld_%ld)\n", viawidth, viadrill); @@ -186,7 +186,7 @@ else ename = pcb_strdup("null"); pcb_fprintf(fp, " (component %d\n", subc->ID); - pcb_fprintf(fp, " (place \"%s\" %.6mm %.6mm %s 0 (PN 0))\n", ename, ox, PCB->MaxHeight - oy, side); + pcb_fprintf(fp, " (place \"%s\" %.6mm %.6mm %s 0 (PN 0))\n", ename, ox, PCB->hidlib.size_y - oy, side); pcb_fprintf(fp, " )\n"); free(ename); } @@ -196,7 +196,7 @@ PCB_PADSTACK_LOOP(PCB->Data); { /* add mounting holes */ pcb_fprintf(fp, " (component %d\n", padstack->ID); - pcb_fprintf(fp, " (place %d %.6mm %.6mm %s 0 (PN 0))\n", padstack->ID, padstack->x, (PCB->MaxHeight - padstack->y), "front"); + pcb_fprintf(fp, " (place %d %.6mm %.6mm %s 0 (PN 0))\n", padstack->ID, padstack->x, (PCB->hidlib.size_y - padstack->y), "front"); pcb_fprintf(fp, " )\n"); } PCB_END_LOOP; @@ -492,8 +492,8 @@ { pcb_fprintf(fp, " (wire (path %d__%s %.6mm %.6mm %.6mm %.6mm %.6mm)\n", GRP_NAME(g), line->Thickness, - line->Point1.X, (PCB->MaxHeight - line->Point1.Y), - line->Point2.X, (PCB->MaxHeight - line->Point2.Y)); + line->Point1.X, (PCB->hidlib.size_y - line->Point1.Y), + line->Point2.X, (PCB->hidlib.size_y - line->Point2.Y)); fprintf(fp, " (type protect))\n"); } PCB_END_LOOP; Index: trunk/src_plugins/export_dxf/dxf.c =================================================================== --- trunk/src_plugins/export_dxf/dxf.c (revision 24882) +++ trunk/src_plugins/export_dxf/dxf.c (revision 24883) @@ -220,8 +220,8 @@ hectx.view.X1 = 0; hectx.view.Y1 = 0; - hectx.view.X2 = PCB->MaxWidth; - hectx.view.Y2 = PCB->MaxHeight; + hectx.view.X2 = PCB->hidlib.size_x; + hectx.view.Y2 = PCB->hidlib.size_y; memcpy(saved_layer_stack, pcb_layer_stack, sizeof(pcb_layer_stack)); @@ -246,7 +246,7 @@ if (strcmp(name, "extmin") == 0) fprintf(f, "10\n0\n20\n0\n30\n0\n"); else if (strcmp(name, "extmax") == 0) - pcb_fprintf(f, "10\n%mm\n20\n0\n30\n%mm\n", PCB->MaxWidth, PCB->MaxHeight); + pcb_fprintf(f, "10\n%mm\n20\n0\n30\n%mm\n", PCB->hidlib.size_x, PCB->hidlib.size_y); else if (strcmp(name, "layers") == 0) { const char **s; for(s = layer_names; *s != NULL; s++) Index: trunk/src_plugins/export_dxf/dxf_draw.c =================================================================== --- trunk/src_plugins/export_dxf/dxf_draw.c (revision 24882) +++ trunk/src_plugins/export_dxf/dxf_draw.c (revision 24883) @@ -25,7 +25,7 @@ */ #define TRX(x) (x) -#define TRY(y) (PCB->MaxHeight - (y)) +#define TRY(y) (PCB->hidlib.size_y - (y)) static void dxf_draw_handle(dxf_ctx_t *ctx) { Index: trunk/src_plugins/export_excellon/excellon.c =================================================================== --- trunk/src_plugins/export_excellon/excellon.c (revision 24882) +++ trunk/src_plugins/export_excellon/excellon.c (revision 24883) @@ -25,7 +25,7 @@ conf_excellon_t conf_excellon; #define excellonDrX(pcb, x) ((pcb_coord_t) (x)) -#define excellonDrY(pcb, y) ((pcb_coord_t) ((pcb)->MaxHeight - (y))) +#define excellonDrY(pcb, y) ((pcb_coord_t) ((pcb)->hidlib.size_y - (y))) typedef struct { const char *hdr1; @@ -240,8 +240,8 @@ ctx.view.X1 = 0; ctx.view.Y1 = 0; - ctx.view.X2 = PCB->MaxWidth; - ctx.view.Y2 = PCB->MaxHeight; + ctx.view.X2 = PCB->hidlib.size_x; + ctx.view.Y2 = PCB->hidlib.size_y; lastwidth = -1; finding_apertures = 1; Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 24882) +++ trunk/src_plugins/export_gcode/gcode.c (revision 24883) @@ -311,8 +311,8 @@ buf = gcode_get_png_name(basename, suffix); - h = pcb_to_gcode(PCB->MaxHeight); - w = pcb_to_gcode(PCB->MaxWidth); + h = pcb_to_gcode(PCB->hidlib.size_y); + w = pcb_to_gcode(PCB->hidlib.size_x); /* Nelma only works with true color images */ gcode_im = gdImageCreate(w, h); @@ -346,8 +346,8 @@ ctx.view.X1 = 0; ctx.view.Y1 = 0; - ctx.view.X2 = PCB->MaxWidth; - ctx.view.Y2 = PCB->MaxHeight; + ctx.view.X2 = PCB->hidlib.size_x; + ctx.view.Y2 = PCB->hidlib.size_y; linewidth = -1; lastbrush = (gdImagePtr) ((void *) -1); @@ -465,9 +465,9 @@ fprintf(gcode_f2, "(%d dpi)\n", gcode_dpi); fprintf(gcode_f2, "(Unit: %s)\n", metric ? "mm" : "inch"); if (metric) - pcb_fprintf(gcode_f2, "(Board size: %.2mmx%.2mm mm)", PCB->MaxWidth, PCB->MaxHeight); + pcb_fprintf(gcode_f2, "(Board size: %.2mmx%.2mm mm)", PCB->hidlib.size_x, PCB->hidlib.size_y); else - pcb_fprintf(gcode_f2, "(Board size: %.2mix%.2mi inches)", PCB->MaxWidth, PCB->MaxHeight); + pcb_fprintf(gcode_f2, "(Board size: %.2mix%.2mi inches)", PCB->hidlib.size_x, PCB->hidlib.size_y); fprintf(gcode_f2, "#100=%f (safe Z)\n", gcode_safeZ); fprintf(gcode_f2, "#101=%f (cutting depth)\n", gcode_cutdepth); fprintf(gcode_f2, "(---------------------------------)\n"); @@ -512,9 +512,9 @@ fprintf(gcode_f2, "( %s )\n", filename); fprintf(gcode_f2, "(Unit: %s)\n", metric ? "mm" : "inch"); if (metric) - pcb_fprintf(gcode_f2, "(Board size: %.2mmx%.2mm mm)", PCB->MaxWidth, PCB->MaxHeight); + pcb_fprintf(gcode_f2, "(Board size: %.2mmx%.2mm mm)", PCB->hidlib.size_x, PCB->hidlib.size_y); else - pcb_fprintf(gcode_f2, "(Board size: %.2mix%.2mi inches)", PCB->MaxWidth, PCB->MaxHeight); + pcb_fprintf(gcode_f2, "(Board size: %.2mix%.2mi inches)", PCB->hidlib.size_x, PCB->hidlib.size_y); fprintf(gcode_f2, "#100=%f (safe Z)\n", gcode_safeZ); fprintf(gcode_f2, "#101=%f (drill depth)\n", gcode_drilldepth); fprintf(gcode_f2, "(---------------------------------)\n"); @@ -830,8 +830,8 @@ drill = (struct drill_struct *) realloc(drill, (nmax_drill + 100) * sizeof(struct drill_struct)); nmax_drill += 100; } - drill[n_drill].x = PCB_COORD_TO_INCH(PCB->MaxWidth - cx); /* convert to inch, flip: will drill from bottom side */ - drill[n_drill].y = PCB_COORD_TO_INCH(PCB->MaxHeight - cy); /* PCB reverses y axis */ + drill[n_drill].x = PCB_COORD_TO_INCH(PCB->hidlib.size_x - cx); /* convert to inch, flip: will drill from bottom side */ + drill[n_drill].y = PCB_COORD_TO_INCH(PCB->hidlib.size_y - cy); /* PCB reverses y axis */ n_drill++; /* printf("Circle %d %d\n",cx,cy); */ } Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 24882) +++ trunk/src_plugins/export_gerber/gerber.c (revision 24883) @@ -78,7 +78,7 @@ /* These are for films */ #define gerberX(pcb, x) ((pcb_coord_t) (x)) -#define gerberY(pcb, y) ((pcb_coord_t) ((pcb)->MaxHeight - (y))) +#define gerberY(pcb, y) ((pcb_coord_t) ((pcb)->hidlib.size_y - (y))) #define gerberXOffset(pcb, x) ((pcb_coord_t) (x)) #define gerberYOffset(pcb, y) ((pcb_coord_t) (-(y))) @@ -604,8 +604,8 @@ ctx.view.X1 = 0; ctx.view.Y1 = 0; - ctx.view.X2 = PCB->MaxWidth; - ctx.view.Y2 = PCB->MaxHeight; + ctx.view.X2 = PCB->hidlib.size_x; + ctx.view.Y2 = PCB->hidlib.size_y; pagecount = 1; reset_apertures(); @@ -802,7 +802,7 @@ fprintf(f, "G04 For: %s *\r\n", pcb_author()); fprintf(f, "G04 Format: Gerber/RS-274X *\r\n"); - pcb_fprintf(f, "G04 PCB-Dimensions: %[4] %[4] *\r\n", PCB->MaxWidth, PCB->MaxHeight); + pcb_fprintf(f, "G04 PCB-Dimensions: %[4] %[4] *\r\n", PCB->hidlib.size_x, PCB->hidlib.size_y); fprintf(f, "G04 PCB-Coordinate-Origin: lower left *\r\n"); /* Unit and coord format */ @@ -858,10 +858,10 @@ pcb_hid_set_line_width(gc, conf_core.design.min_wid); else pcb_hid_set_line_width(gc, AUTO_OUTLINE_WIDTH); - pcb_gui->draw_line(gc, 0, 0, PCB->MaxWidth, 0); - pcb_gui->draw_line(gc, 0, 0, 0, PCB->MaxHeight); - pcb_gui->draw_line(gc, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight); - pcb_gui->draw_line(gc, 0, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight); + pcb_gui->draw_line(gc, 0, 0, PCB->hidlib.size_x, 0); + pcb_gui->draw_line(gc, 0, 0, 0, PCB->hidlib.size_y); + pcb_gui->draw_line(gc, PCB->hidlib.size_x, 0, PCB->hidlib.size_x, PCB->hidlib.size_y); + pcb_gui->draw_line(gc, 0, PCB->hidlib.size_y, PCB->hidlib.size_x, PCB->hidlib.size_y); pcb_hid_destroy_gc(gc); } } Index: trunk/src_plugins/export_ipcd356/ipcd356.c =================================================================== --- trunk/src_plugins/export_ipcd356/ipcd356.c (revision 24882) +++ trunk/src_plugins/export_ipcd356/ipcd356.c (revision 24883) @@ -187,7 +187,7 @@ line[41] = 'X'; fill_field_coord(ctx, line, 42, 48, t->cx, 1, "X coord"); line[49] = 'Y'; - fill_field_coord(ctx, line, 50, 56, PCB->MaxHeight - t->cy, 1, "Y coord"); + fill_field_coord(ctx, line, 50, 56, PCB->hidlib.size_y - t->cy, 1, "Y coord"); line[57] = 'X'; fill_field_coord(ctx, line, 58, 61, t->width, 0, "width"); Index: trunk/src_plugins/export_openems/export_openems.c =================================================================== --- trunk/src_plugins/export_openems/export_openems.c (revision 24882) +++ trunk/src_plugins/export_openems/export_openems.c (revision 24883) @@ -345,9 +345,9 @@ else { /* rectangular board size */ pcb_fprintf(ctx->f, "outline_xy(1, 1) = 0; outline_xy(2, 1) = 0;\n"); - pcb_fprintf(ctx->f, "outline_xy(1, 2) = %mm; outline_xy(2, 2) = 0;\n", ctx->pcb->MaxWidth); - pcb_fprintf(ctx->f, "outline_xy(1, 3) = %mm; outline_xy(2, 3) = %mm;\n", ctx->pcb->MaxWidth, -ctx->pcb->MaxHeight); - pcb_fprintf(ctx->f, "outline_xy(1, 4) = 0; outline_xy(2, 4) = %mm;\n", -ctx->pcb->MaxHeight); + pcb_fprintf(ctx->f, "outline_xy(1, 2) = %mm; outline_xy(2, 2) = 0;\n", ctx->pcb->hidlib.size_x); + pcb_fprintf(ctx->f, "outline_xy(1, 3) = %mm; outline_xy(2, 3) = %mm;\n", ctx->pcb->hidlib.size_x, -ctx->pcb->hidlib.size_y); + pcb_fprintf(ctx->f, "outline_xy(1, 4) = 0; outline_xy(2, 4) = %mm;\n", -ctx->pcb->hidlib.size_y); } /* create all substrate layers using this polygon*/ @@ -604,8 +604,8 @@ ctx.view.X1 = 0; ctx.view.Y1 = 0; - ctx.view.X2 = PCB->MaxWidth; - ctx.view.Y2 = PCB->MaxHeight; + ctx.view.X2 = PCB->hidlib.size_x; + ctx.view.Y2 = PCB->hidlib.size_y; f = the_file; Index: trunk/src_plugins/export_openems/mesh.c =================================================================== --- trunk/src_plugins/export_openems/mesh.c (revision 24882) +++ trunk/src_plugins/export_openems/mesh.c (revision 24883) @@ -560,7 +560,7 @@ r = vtr0_alloc_append(&mesh->line[dir].dens, 1); r->begin = mesh->line[dir].dens.array[vtr0_len(&mesh->line[dir].dens)-2].end; - r->end = (dir == PCB_MESH_HORIZONTAL) ? PCB->MaxHeight : PCB->MaxWidth; + r->end = (dir == PCB_MESH_HORIZONTAL) ? PCB->hidlib.size_y : PCB->hidlib.size_x; r->data[0].c = mesh->dens_gap; @@ -728,7 +728,7 @@ mesh_trace("\n"); mesh_trace("%s result:\n", dir == PCB_MESH_HORIZONTAL ? "horizontal" : "vertical"); - end = (dir == PCB_MESH_HORIZONTAL) ? PCB->MaxWidth : PCB->MaxHeight; + end = (dir == PCB_MESH_HORIZONTAL) ? PCB->hidlib.size_x : PCB->hidlib.size_y; for(n = 0; n < vtc0_len(&mesh->line[dir].result); n++) { mesh_trace(" %mm", mesh->line[dir].result.array[n]); mesh_draw_line(mesh, dir, mesh->line[dir].result.array[n], 0, end, PCB_MM_TO_COORD(0.03)); @@ -742,9 +742,9 @@ { int n; pcb_layergrp_id_t gid; - pcb_coord_t x0 = PCB->MaxWidth/15, y0 = PCB->MaxHeight/3, y = y0, y2; - pcb_coord_t xl = PCB->MaxWidth/5; /* board left */ - pcb_coord_t xr = PCB->MaxWidth/5*3; /* board right */ + pcb_coord_t x0 = PCB->hidlib.size_x/15, y0 = PCB->hidlib.size_y/3, y = y0, y2; + pcb_coord_t xl = PCB->hidlib.size_x/5; /* board left */ + pcb_coord_t xr = PCB->hidlib.size_x/5*3; /* board right */ pcb_coord_t spen = PCB_MM_TO_COORD(0.3), cpen = PCB_MM_TO_COORD(0.2), mpen = PCB_MM_TO_COORD(0.03); int mag = 2; @@ -770,7 +770,7 @@ for(n = 0; n < vtc0_len(&mesh->line[PCB_MESH_Z].result); n++) { pcb_coord_t y = y0+mesh->line[PCB_MESH_Z].result.array[n]*mag; mesh_trace(" %mm", y); - pcb_line_new(mesh->ui_layer_z, 0, y, PCB->MaxWidth, y, mpen, 0, pcb_no_flags()); + pcb_line_new(mesh->ui_layer_z, 0, y, PCB->hidlib.size_x, y, mpen, 0, pcb_no_flags()); } mesh_trace("\n"); return 0; @@ -892,7 +892,7 @@ /* right edge, after the last known line */ if (!mesh->noimpl) { c1 = mesh->line[dir].edge.array[vtc0_len(&mesh->line[dir].edge)-1]; - c2 = (dir == PCB_MESH_HORIZONTAL) ? PCB->MaxHeight : PCB->MaxWidth; + c2 = (dir == PCB_MESH_HORIZONTAL) ? PCB->hidlib.size_y : PCB->hidlib.size_x; mesh_find_range(&mesh->line[dir].dens, (c1+c2)/2, &d, &d1, &d2); if (mesh->smooth) mesh_auto_add_smooth(&mesh->line[dir].result, c1, c2, d1, d, d2); Index: trunk/src_plugins/export_openscad/export_openscad.c =================================================================== --- trunk/src_plugins/export_openscad/export_openscad.c (revision 24882) +++ trunk/src_plugins/export_openscad/export_openscad.c (revision 24883) @@ -147,8 +147,8 @@ ctx.view.X1 = 0; ctx.view.Y1 = 0; - ctx.view.X2 = PCB->MaxWidth; - ctx.view.Y2 = PCB->MaxHeight; + ctx.view.X2 = PCB->hidlib.size_x; + ctx.view.Y2 = PCB->hidlib.size_y; f = the_file; Index: trunk/src_plugins/export_openscad/scad_draw.c =================================================================== --- trunk/src_plugins/export_openscad/scad_draw.c (revision 24882) +++ trunk/src_plugins/export_openscad/scad_draw.c (revision 24883) @@ -28,7 +28,7 @@ #include "plug_io.h" #define TRX_(x) (x) -#define TRY_(y) (PCB->MaxHeight - (y)) +#define TRY_(y) (PCB->hidlib.size_y - (y)) #define TRX(x) #define TRY(y) y = TRY_(y) @@ -87,9 +87,9 @@ if (start == NULL) { poly = pcb_poly_alloc(PCB->Data->Layer); pcb_poly_point_new(poly, 0, 0); - pcb_poly_point_new(poly, PCB->MaxWidth, 0); - pcb_poly_point_new(poly, PCB->MaxWidth, PCB->MaxHeight); - pcb_poly_point_new(poly, 0, PCB->MaxHeight); + pcb_poly_point_new(poly, PCB->hidlib.size_x, 0); + pcb_poly_point_new(poly, PCB->hidlib.size_x, PCB->hidlib.size_y); + pcb_poly_point_new(poly, 0, PCB->hidlib.size_y); } else { poly = pcb_topoly_conn(PCB, start, PCB_TOPOLY_FLOATING); Index: trunk/src_plugins/export_png/png.c =================================================================== --- trunk/src_plugins/export_png/png.c (revision 24882) +++ trunk/src_plugins/export_png/png.c (revision 24883) @@ -86,12 +86,12 @@ static int show_solder_side; #define SCALE(w) ((int)pcb_round((w)/scale)) #define SCALE_X(x) ((int)pcb_hack_round(((x) - x_shift)/scale)) -#define SCALE_Y(y) ((int)pcb_hack_round(((show_solder_side ? (PCB->MaxHeight-(y)) : (y)) - y_shift)/scale)) +#define SCALE_Y(y) ((int)pcb_hack_round(((show_solder_side ? (PCB->hidlib.size_y-(y)) : (y)) - y_shift)/scale)) #define SWAP_IF_SOLDER(a,b) do { int c; if (show_solder_side) { c=a; a=b; b=c; }} while (0) /* Used to detect non-trivial outlines */ -#define NOT_EDGE_X(x) ((x) != 0 && (x) != PCB->MaxWidth) -#define NOT_EDGE_Y(y) ((y) != 0 && (y) != PCB->MaxHeight) +#define NOT_EDGE_X(x) ((x) != 0 && (x) != PCB->hidlib.size_x) +#define NOT_EDGE_Y(y) ((y) != 0 && (y) != PCB->hidlib.size_y) #define NOT_EDGE(x,y) (NOT_EDGE_X(x) || NOT_EDGE_Y(y)) static void png_fill_circle(pcb_hid_gc_t gc, pcb_coord_t cx, pcb_coord_t cy, pcb_coord_t radius); @@ -888,8 +888,8 @@ region.X1 = 0; region.Y1 = 0; - region.X2 = PCB->MaxWidth; - region.Y2 = PCB->MaxHeight; + region.X2 = PCB->hidlib.size_x; + region.Y2 = PCB->hidlib.size_y; png_options = options; if (options[HA_only_visible].int_value) @@ -1039,8 +1039,8 @@ else { x_shift = 0; y_shift = 0; - h = PCB->MaxHeight; - w = PCB->MaxWidth; + h = PCB->hidlib.size_y; + w = PCB->hidlib.size_x; } /* @@ -1680,11 +1680,11 @@ /* Special case - lines drawn along the bottom or right edges are brought in by a pixel to make sure we have contiguous outlines. */ - if (x1 == PCB->MaxWidth && x2 == PCB->MaxWidth) { + if (x1 == PCB->hidlib.size_x && x2 == PCB->hidlib.size_x) { x1o = -1; x2o = -1; } - if (y1 == PCB->MaxHeight && y2 == PCB->MaxHeight) { + if (y1 == PCB->hidlib.size_y && y2 == PCB->hidlib.size_y) { y1o = -1; y2o = -1; } Index: trunk/src_plugins/export_ps/eps.c =================================================================== --- trunk/src_plugins/export_ps/eps.c (revision 24882) +++ trunk/src_plugins/export_ps/eps.c (revision 24883) @@ -258,8 +258,8 @@ region.X1 = 0; region.Y1 = 0; - region.X2 = PCB->MaxWidth; - region.Y2 = PCB->MaxHeight; + region.X2 = PCB->hidlib.size_x; + region.Y2 = PCB->hidlib.size_y; if (options[HA_only_visible].int_value) bounds = pcb_data_bbox(&tmp, PCB->Data, pcb_false); Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 24882) +++ trunk/src_plugins/export_ps/ps.c (revision 24883) @@ -558,13 +558,13 @@ if (global.fillpage) { double zx, zy; - if (PCB->MaxWidth > PCB->MaxHeight) { - zx = global.ps_height / PCB->MaxWidth; - zy = global.ps_width / PCB->MaxHeight; + if (PCB->hidlib.size_x > PCB->hidlib.size_y) { + zx = global.ps_height / PCB->hidlib.size_x; + zy = global.ps_width / PCB->hidlib.size_y; } else { - zx = global.ps_height / PCB->MaxHeight; - zy = global.ps_width / PCB->MaxWidth; + zx = global.ps_height / PCB->hidlib.size_y; + zy = global.ps_width / PCB->hidlib.size_x; } global.scale_factor *= MIN(zx, zy); } @@ -580,8 +580,8 @@ global.exps.view.X1 = 0; global.exps.view.Y1 = 0; - global.exps.view.X2 = PCB->MaxWidth; - global.exps.view.Y2 = PCB->MaxHeight; + global.exps.view.X2 = PCB->hidlib.size_x; + global.exps.view.Y2 = PCB->hidlib.size_y; if ((!global.multi_file && !global.multi_file_cam) && (options[HA_toc].int_value)) { /* %%Page DSC requires both a label and an ordinal */ @@ -845,7 +845,7 @@ pcb_fprintf(global.f, "72 72 scale %mi %mi translate\n", global.media_width / 2, global.media_height / 2); boffset = global.media_height / 2; - if (PCB->MaxWidth > PCB->MaxHeight) { + if (PCB->hidlib.size_x > PCB->hidlib.size_y) { fprintf(global.f, "90 rotate\n"); boffset = global.media_width / 2; fprintf(global.f, "%g %g scale %% calibration\n", global.calibration_y, global.calibration_x); @@ -857,7 +857,7 @@ fprintf(global.f, "1 -1 scale\n"); fprintf(global.f, "%g dup neg scale\n", PCB_LAYER_IS_FAB(flags, purpi) ? 1.0 : global.scale_factor); - pcb_fprintf(global.f, "%mi %mi translate\n", -PCB->MaxWidth / 2, -PCB->MaxHeight / 2); + pcb_fprintf(global.f, "%mi %mi translate\n", -PCB->hidlib.size_x / 2, -PCB->hidlib.size_y / 2); /* Keep the drill list from falling off the left edge of the paper, * even if it means some of the board falls off the right edge. @@ -864,7 +864,7 @@ * If users don't want to make smaller boards, or use fewer drill * sizes, they can always ignore this sheet. */ if (PCB_LAYER_IS_FAB(flags, purpi)) { - pcb_coord_t natural = boffset - PCB_MIL_TO_COORD(500) - PCB->MaxHeight / 2; + pcb_coord_t natural = boffset - PCB_MIL_TO_COORD(500) - PCB->hidlib.size_y / 2; pcb_coord_t needed = pcb_stub_draw_fab_overhang(); pcb_fprintf(global.f, "%% PrintFab overhang natural %mi, needed %mi\n", natural, needed); if (needed > natural) @@ -886,15 +886,15 @@ "0 setgray %mi setlinewidth 0 0 moveto 0 " "%mi lineto %mi %mi lineto %mi 0 lineto closepath %s\n", conf_core.design.min_wid, - PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight, PCB->MaxWidth, global.invert ? "fill" : "stroke"); + PCB->hidlib.size_y, PCB->hidlib.size_x, PCB->hidlib.size_y, PCB->hidlib.size_x, global.invert ? "fill" : "stroke"); } } if (global.align_marks) { corner(global.f, 0, 0, -1, -1); - corner(global.f, PCB->MaxWidth, 0, 1, -1); - corner(global.f, PCB->MaxWidth, PCB->MaxHeight, 1, 1); - corner(global.f, 0, PCB->MaxHeight, -1, 1); + corner(global.f, PCB->hidlib.size_x, 0, 1, -1); + corner(global.f, PCB->hidlib.size_x, PCB->hidlib.size_y, 1, 1); + corner(global.f, 0, PCB->hidlib.size_y, -1, 1); } global.linewidth = -1; Index: trunk/src_plugins/export_stat/stat.c =================================================================== --- trunk/src_plugins/export_stat/stat.c (revision 24882) +++ trunk/src_plugins/export_stat/stat.c (revision 24883) @@ -337,8 +337,8 @@ height = bb.Y2 - bb.Y1; } else { - width = PCB->MaxWidth; - height = PCB->MaxHeight; + width = PCB->hidlib.size_x; + height = PCB->hidlib.size_y; } fprintf(f, " ha:board {\n"); Index: trunk/src_plugins/export_svg/svg.c =================================================================== --- trunk/src_plugins/export_svg/svg.c (revision 24882) +++ trunk/src_plugins/export_svg/svg.c (revision 24883) @@ -187,7 +187,7 @@ #define TRY(y) \ do { \ if (flip) \ - y = PCB->MaxHeight - y; \ + y = PCB->hidlib.size_y - y; \ } while(0) @@ -214,8 +214,8 @@ ctx.view.X1 = 0; ctx.view.Y1 = 0; - ctx.view.X2 = PCB->MaxWidth; - ctx.view.Y2 = PCB->MaxHeight; + ctx.view.X2 = PCB->hidlib.size_x; + ctx.view.Y2 = PCB->hidlib.size_y; f = the_file; @@ -243,7 +243,7 @@ if (photo_mode) { pcb_fprintf(f, "\n", - 0, 0, PCB->MaxWidth, PCB->MaxHeight, board_color); + 0, 0, PCB->hidlib.size_x, PCB->hidlib.size_y, board_color); } opacity = options[HA_opacity].int_value; @@ -286,8 +286,8 @@ pcb_coord_t w, h, x1, y1, x2, y2; fprintf(f, "\n"); - w = PCB->MaxWidth; - h = PCB->MaxHeight; + w = PCB->hidlib.size_x; + h = PCB->hidlib.size_y; while((w < PCB_MM_TO_COORD(1024)) && (h < PCB_MM_TO_COORD(1024))) { w *= 2; h *= 2; @@ -295,8 +295,8 @@ x1 = PCB_MM_TO_COORD(2); y1 = PCB_MM_TO_COORD(2); - x2 = PCB->MaxWidth; - y2 = PCB->MaxHeight; + x2 = PCB->hidlib.size_x; + y2 = PCB->hidlib.size_y; x2 += PCB_MM_TO_COORD(5); y2 += PCB_MM_TO_COORD(5); pcb_fprintf(f, "\n", w, h, x1, y1, x2, y2); @@ -481,7 +481,7 @@ pcb_append_printf(&snormal, "\n"); pcb_append_printf(&snormal, "\n"); pcb_append_printf(&snormal, "\n", comp_cnt); - pcb_append_printf(&sclip, "\n", comp_cnt, PCB->MaxWidth, PCB->MaxHeight); + pcb_append_printf(&sclip, "\n", comp_cnt, PCB->hidlib.size_x, PCB->hidlib.size_y); break; case PCB_HID_COMP_POSITIVE: Index: trunk/src_plugins/export_xy/xy.c =================================================================== --- trunk/src_plugins/export_xy/xy.c (revision 24882) +++ trunk/src_plugins/export_xy/xy.c (revision 24883) @@ -363,12 +363,12 @@ } if (strncmp(*input, "boardw%", 7) == 0) { *input += 7; - pcb_append_printf(s, "%m+%mN", xy_unit->allow, PCB->MaxWidth); + pcb_append_printf(s, "%m+%mN", xy_unit->allow, PCB->hidlib.size_x); return 0; } if (strncmp(*input, "boardh%", 7) == 0) { *input += 7; - pcb_append_printf(s, "%m+%mN", xy_unit->allow, PCB->MaxHeight); + pcb_append_printf(s, "%m+%mN", xy_unit->allow, PCB->hidlib.size_y); return 0; } if (strncmp(*input, "subc.", 5) == 0) { @@ -638,7 +638,7 @@ *x = *x - ctx->ox; } else - *y = PCB->MaxHeight - *y; + *y = PCB->hidlib.size_y - *y; } typedef struct { Index: trunk/src_plugins/fontmode/fontmode.c =================================================================== --- trunk/src_plugins/fontmode/fontmode.c (revision 24882) +++ trunk/src_plugins/fontmode/fontmode.c (revision 24883) @@ -121,8 +121,8 @@ conf_set_design("design/text_font_id", "%s", "0"); - PCB->MaxWidth = CELL_SIZE * 18; - PCB->MaxHeight = CELL_SIZE * ((PCB_MAX_FONTPOSITION + 15) / 16 + 2); + PCB->hidlib.size_x = CELL_SIZE * 18; + PCB->hidlib.size_y = CELL_SIZE * ((PCB_MAX_FONTPOSITION + 15) / 16 + 2); PCB->hidlib.grid = PCB_MIL_TO_COORD(5); /* create the layer stack and logical layers */ @@ -215,11 +215,11 @@ for (l = 0; l < 16; l++) { int x = (l + 1) * CELL_SIZE; - pcb_line_new_merge(lgrid, x, 0, x, PCB->MaxHeight, PCB_MIL_TO_COORD(1), PCB_MIL_TO_COORD(1), pcb_no_flags()); + pcb_line_new_merge(lgrid, x, 0, x, PCB->hidlib.size_y, PCB_MIL_TO_COORD(1), PCB_MIL_TO_COORD(1), pcb_no_flags()); } for (l = 0; l <= PCB_MAX_FONTPOSITION / 16 + 1; l++) { int y = (l + 1) * CELL_SIZE; - pcb_line_new_merge(lgrid, 0, y, PCB->MaxWidth, y, PCB_MIL_TO_COORD(1), PCB_MIL_TO_COORD(1), pcb_no_flags()); + pcb_line_new_merge(lgrid, 0, y, PCB->hidlib.size_x, y, PCB_MIL_TO_COORD(1), PCB_MIL_TO_COORD(1), pcb_no_flags()); } PCB_ACT_IRES(0); return 0; Index: trunk/src_plugins/hid_batch/batch.c =================================================================== --- trunk/src_plugins/hid_batch/batch.c (revision 24882) +++ trunk/src_plugins/hid_batch/batch.c (revision 24883) @@ -127,7 +127,7 @@ return 0; } printf("Filename: %s\n", PCB->Filename); - pcb_printf("Size: %ml x %ml mils, %mm x %mm mm\n", PCB->MaxWidth, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight); + pcb_printf("Size: %ml x %ml mils, %mm x %mm mm\n", PCB->hidlib.size_x, PCB->hidlib.size_y, PCB->hidlib.size_x, PCB->hidlib.size_y); for (i = 0; i < PCB_MAX_LAYER; i++) { pcb_layergrp_id_t lg = pcb_layer_get_group(PCB, i); unsigned int gflg = pcb_layergrp_flags(PCB, lg); @@ -288,8 +288,8 @@ static void batch_get_view_size(pcb_coord_t *width, pcb_coord_t *height) { - *width = PCB->MaxWidth; - *height = PCB->MaxHeight; + *width = PCB->hidlib.size_x; + *height = PCB->hidlib.size_y; } static void batch_set_crosshair(pcb_coord_t x, pcb_coord_t y, int action) Index: trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c =================================================================== --- trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 24882) +++ trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 24883) @@ -185,8 +185,8 @@ x1 = pcb_grid_fit(MAX(0, SIDE_X(gport->view.x0)), PCB->hidlib.grid, PCB->hidlib.grid_ox); y1 = pcb_grid_fit(MAX(0, SIDE_Y(gport->view.y0)), PCB->hidlib.grid, PCB->hidlib.grid_oy); - x2 = pcb_grid_fit(MIN(PCB->MaxWidth, SIDE_X(gport->view.x0 + gport->view.width - 1)), PCB->hidlib.grid, PCB->hidlib.grid_ox); - y2 = pcb_grid_fit(MIN(PCB->MaxHeight, SIDE_Y(gport->view.y0 + gport->view.height - 1)), PCB->hidlib.grid, PCB->hidlib.grid_oy); + x2 = pcb_grid_fit(MIN(PCB->hidlib.size_x, SIDE_X(gport->view.x0 + gport->view.width - 1)), PCB->hidlib.grid, PCB->hidlib.grid_ox); + y2 = pcb_grid_fit(MIN(PCB->hidlib.size_y, SIDE_Y(gport->view.y0 + gport->view.height - 1)), PCB->hidlib.grid, PCB->hidlib.grid_oy); grd = PCB->hidlib.grid; @@ -378,8 +378,8 @@ src_y = 0; } - w = PCB->MaxWidth / gport->view.coord_per_px; - h = PCB->MaxHeight / gport->view.coord_per_px; + w = PCB->hidlib.size_x / gport->view.coord_per_px; + h = PCB->hidlib.size_y / gport->view.coord_per_px; src_x = src_x / gport->view.coord_per_px; src_y = src_y / gport->view.coord_per_px; dst_x = dst_x / gport->view.coord_per_px; @@ -1096,15 +1096,15 @@ ctx.view.X2 = MAX(Px(priv->clip_rect.x), Px(priv->clip_rect.x + priv->clip_rect.width + 1)); ctx.view.Y2 = MAX(Py(priv->clip_rect.y), Py(priv->clip_rect.y + priv->clip_rect.height + 1)); - ctx.view.X1 = MAX(0, MIN(PCB->MaxWidth, ctx.view.X1)); - ctx.view.X2 = MAX(0, MIN(PCB->MaxWidth, ctx.view.X2)); - ctx.view.Y1 = MAX(0, MIN(PCB->MaxHeight, ctx.view.Y1)); - ctx.view.Y2 = MAX(0, MIN(PCB->MaxHeight, ctx.view.Y2)); + ctx.view.X1 = MAX(0, MIN(PCB->hidlib.size_x, ctx.view.X1)); + ctx.view.X2 = MAX(0, MIN(PCB->hidlib.size_x, ctx.view.X2)); + ctx.view.Y1 = MAX(0, MIN(PCB->hidlib.size_y, ctx.view.Y1)); + ctx.view.Y2 = MAX(0, MIN(PCB->hidlib.size_y, ctx.view.Y2)); eleft = Vx(0); - eright = Vx(PCB->MaxWidth); + eright = Vx(PCB->hidlib.size_x); etop = Vy(0); - ebottom = Vy(PCB->MaxHeight); + ebottom = Vy(PCB->hidlib.size_y); if (eleft > eright) { int tmp = eleft; eleft = eright; Index: trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c =================================================================== --- trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 24882) +++ trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 24883) @@ -157,7 +157,7 @@ glTranslatef(0.0f, 0.0f, -Z_NEAR); glScalef((conf_core.editor.view.flip_x ? -1. : 1.) / gport->view.coord_per_px, (conf_core.editor.view.flip_y ? -1. : 1.) / gport->view.coord_per_px, ((conf_core.editor.view.flip_x == conf_core.editor.view.flip_y) ? 1. : -1.) / gport->view.coord_per_px); - glTranslatef(conf_core.editor.view.flip_x ? gport->view.x0 - PCB->MaxWidth : -gport->view.x0, conf_core.editor.view.flip_y ? gport->view.y0 - PCB->MaxHeight : -gport->view.y0, 0); + glTranslatef(conf_core.editor.view.flip_x ? gport->view.x0 - PCB->hidlib.size_x : -gport->view.x0, conf_core.editor.view.flip_y ? gport->view.y0 - PCB->hidlib.size_y : -gport->view.y0, 0); /* Put the renderer into a good state so that any drawing is done in standard mode */ @@ -286,11 +286,11 @@ glTexCoord2d(0., 0.); glVertex3i(0, 0, 0); glTexCoord2d(1., 0.); - glVertex3i(PCB->MaxWidth, 0, 0); + glVertex3i(PCB->hidlib.size_x, 0, 0); glTexCoord2d(1., 1.); - glVertex3i(PCB->MaxWidth, PCB->MaxHeight, 0); + glVertex3i(PCB->hidlib.size_x, PCB->hidlib.size_y, 0); glTexCoord2d(0., 1.); - glVertex3i(0, PCB->MaxHeight, 0); + glVertex3i(0, PCB->hidlib.size_y, 0); glEnd(); glDisable(GL_TEXTURE_2D); @@ -636,9 +636,9 @@ static void pcb_gl_draw_right_cross(GLint x, GLint y, GLint z) { glVertex3i(x, 0, z); - glVertex3i(x, PCB->MaxHeight, z); + glVertex3i(x, PCB->hidlib.size_y, z); glVertex3i(0, y, z); - glVertex3i(PCB->MaxWidth, y, z); + glVertex3i(PCB->hidlib.size_x, y, z); } static void pcb_gl_draw_slanted_cross(GLint x, GLint y, GLint z) @@ -645,25 +645,25 @@ { GLint x0, y0, x1, y1; - x0 = x + (PCB->MaxHeight - y); - x0 = MAX(0, MIN(x0, PCB->MaxWidth)); + x0 = x + (PCB->hidlib.size_y - y); + x0 = MAX(0, MIN(x0, PCB->hidlib.size_x)); x1 = x - y; - x1 = MAX(0, MIN(x1, PCB->MaxWidth)); - y0 = y + (PCB->MaxWidth - x); - y0 = MAX(0, MIN(y0, PCB->MaxHeight)); + x1 = MAX(0, MIN(x1, PCB->hidlib.size_x)); + y0 = y + (PCB->hidlib.size_x - x); + y0 = MAX(0, MIN(y0, PCB->hidlib.size_y)); y1 = y - x; - y1 = MAX(0, MIN(y1, PCB->MaxHeight)); + y1 = MAX(0, MIN(y1, PCB->hidlib.size_y)); glVertex3i(x0, y0, z); glVertex3i(x1, y1, z); - x0 = x - (PCB->MaxHeight - y); - x0 = MAX(0, MIN(x0, PCB->MaxWidth)); + x0 = x - (PCB->hidlib.size_y - y); + x0 = MAX(0, MIN(x0, PCB->hidlib.size_x)); x1 = x + y; - x1 = MAX(0, MIN(x1, PCB->MaxWidth)); + x1 = MAX(0, MIN(x1, PCB->hidlib.size_x)); y0 = y + x; - y0 = MAX(0, MIN(y0, PCB->MaxHeight)); - y1 = y - (PCB->MaxWidth - x); - y1 = MAX(0, MIN(y1, PCB->MaxHeight)); + y0 = MAX(0, MIN(y0, PCB->hidlib.size_y)); + y1 = y - (PCB->hidlib.size_x - x); + y1 = MAX(0, MIN(y1, PCB->hidlib.size_y)); glVertex3i(x0, y0, z); glVertex3i(x1, y1, z); } @@ -673,47 +673,47 @@ GLint x0, y0, x1, y1; gdouble tan60 = sqrt(3); - x0 = x + (PCB->MaxHeight - y) / tan60; - x0 = MAX(0, MIN(x0, PCB->MaxWidth)); + x0 = x + (PCB->hidlib.size_y - y) / tan60; + x0 = MAX(0, MIN(x0, PCB->hidlib.size_x)); x1 = x - y / tan60; - x1 = MAX(0, MIN(x1, PCB->MaxWidth)); - y0 = y + (PCB->MaxWidth - x) * tan60; - y0 = MAX(0, MIN(y0, PCB->MaxHeight)); + x1 = MAX(0, MIN(x1, PCB->hidlib.size_x)); + y0 = y + (PCB->hidlib.size_x - x) * tan60; + y0 = MAX(0, MIN(y0, PCB->hidlib.size_y)); y1 = y - x * tan60; - y1 = MAX(0, MIN(y1, PCB->MaxHeight)); + y1 = MAX(0, MIN(y1, PCB->hidlib.size_y)); glVertex3i(x0, y0, z); glVertex3i(x1, y1, z); - x0 = x + (PCB->MaxHeight - y) * tan60; - x0 = MAX(0, MIN(x0, PCB->MaxWidth)); + x0 = x + (PCB->hidlib.size_y - y) * tan60; + x0 = MAX(0, MIN(x0, PCB->hidlib.size_x)); x1 = x - y * tan60; - x1 = MAX(0, MIN(x1, PCB->MaxWidth)); - y0 = y + (PCB->MaxWidth - x) / tan60; - y0 = MAX(0, MIN(y0, PCB->MaxHeight)); + x1 = MAX(0, MIN(x1, PCB->hidlib.size_x)); + y0 = y + (PCB->hidlib.size_x - x) / tan60; + y0 = MAX(0, MIN(y0, PCB->hidlib.size_y)); y1 = y - x / tan60; - y1 = MAX(0, MIN(y1, PCB->MaxHeight)); + y1 = MAX(0, MIN(y1, PCB->hidlib.size_y)); glVertex3i(x0, y0, z); glVertex3i(x1, y1, z); - x0 = x - (PCB->MaxHeight - y) / tan60; - x0 = MAX(0, MIN(x0, PCB->MaxWidth)); + x0 = x - (PCB->hidlib.size_y - y) / tan60; + x0 = MAX(0, MIN(x0, PCB->hidlib.size_x)); x1 = x + y / tan60; - x1 = MAX(0, MIN(x1, PCB->MaxWidth)); + x1 = MAX(0, MIN(x1, PCB->hidlib.size_x)); y0 = y + x * tan60; - y0 = MAX(0, MIN(y0, PCB->MaxHeight)); - y1 = y - (PCB->MaxWidth - x) * tan60; - y1 = MAX(0, MIN(y1, PCB->MaxHeight)); + y0 = MAX(0, MIN(y0, PCB->hidlib.size_y)); + y1 = y - (PCB->hidlib.size_x - x) * tan60; + y1 = MAX(0, MIN(y1, PCB->hidlib.size_y)); glVertex3i(x0, y0, z); glVertex3i(x1, y1, z); - x0 = x - (PCB->MaxHeight - y) * tan60; - x0 = MAX(0, MIN(x0, PCB->MaxWidth)); + x0 = x - (PCB->hidlib.size_y - y) * tan60; + x0 = MAX(0, MIN(x0, PCB->hidlib.size_x)); x1 = x + y * tan60; - x1 = MAX(0, MIN(x1, PCB->MaxWidth)); + x1 = MAX(0, MIN(x1, PCB->hidlib.size_x)); y0 = y + x / tan60; - y0 = MAX(0, MIN(y0, PCB->MaxHeight)); - y1 = y - (PCB->MaxWidth - x) / tan60; - y1 = MAX(0, MIN(y1, PCB->MaxHeight)); + y0 = MAX(0, MIN(y0, PCB->hidlib.size_y)); + y1 = y - (PCB->hidlib.size_x - x) / tan60; + y1 = MAX(0, MIN(y1, PCB->hidlib.size_y)); glVertex3i(x0, y0, z); glVertex3i(x1, y1, z); } @@ -928,10 +928,10 @@ ctx.view.Y1 = MIN(Py(ev->area.y), Py(ev->area.y + ev->area.height + 1)); ctx.view.Y2 = MAX(Py(ev->area.y), Py(ev->area.y + ev->area.height + 1)); - ctx.view.X1 = MAX(0, MIN(PCB->MaxWidth, ctx.view.X1)); - ctx.view.X2 = MAX(0, MIN(PCB->MaxWidth, ctx.view.X2)); - ctx.view.Y1 = MAX(0, MIN(PCB->MaxHeight, ctx.view.Y1)); - ctx.view.Y2 = MAX(0, MIN(PCB->MaxHeight, ctx.view.Y2)); + ctx.view.X1 = MAX(0, MIN(PCB->hidlib.size_x, ctx.view.X1)); + ctx.view.X2 = MAX(0, MIN(PCB->hidlib.size_x, ctx.view.X2)); + ctx.view.Y1 = MAX(0, MIN(PCB->hidlib.size_y, ctx.view.Y1)); + ctx.view.Y2 = MAX(0, MIN(PCB->hidlib.size_y, ctx.view.Y2)); gtk2gl_color(&off_c, &priv->offlimits_color); gtk2gl_color(&bg_c, &priv->bg_color); @@ -939,15 +939,15 @@ 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, &off_c); glScalef((conf_core.editor.view.flip_x ? -1. : 1.) / port->view.coord_per_px, (conf_core.editor.view.flip_y ? -1. : 1.) / port->view.coord_per_px, ((conf_core.editor.view.flip_x == conf_core.editor.view.flip_y) ? 1. : -1.) / port->view.coord_per_px); - glTranslatef(conf_core.editor.view.flip_x ? port->view.x0 - PCB->MaxWidth : -port->view.x0, conf_core.editor.view.flip_y ? port->view.y0 - PCB->MaxHeight : -port->view.y0, 0); + glTranslatef(conf_core.editor.view.flip_x ? port->view.x0 - PCB->hidlib.size_x : -port->view.x0, conf_core.editor.view.flip_y ? port->view.y0 - PCB->hidlib.size_y : -port->view.y0, 0); /* Draw PCB background, before PCB primitives */ glColor3f(bg_c.red, bg_c.green, bg_c.blue); glBegin(GL_QUADS); glVertex3i(0, 0, 0); - glVertex3i(PCB->MaxWidth, 0, 0); - glVertex3i(PCB->MaxWidth, PCB->MaxHeight, 0); - glVertex3i(0, PCB->MaxHeight, 0); + glVertex3i(PCB->hidlib.size_x, 0, 0); + glVertex3i(PCB->hidlib.size_x, PCB->hidlib.size_y, 0); + glVertex3i(0, PCB->hidlib.size_y, 0); glEnd(); ghid_gl_draw_bg_image(); @@ -1085,7 +1085,7 @@ ghid_gl_invalidate_current_gc(); glPushMatrix(); glScalef((conf_core.editor.view.flip_x ? -1. : 1.) / gport->view.coord_per_px, (conf_core.editor.view.flip_y ? -1. : 1.) / gport->view.coord_per_px, 1); - glTranslatef(conf_core.editor.view.flip_x ? gport->view.x0 - PCB->MaxWidth : -gport->view.x0, conf_core.editor.view.flip_y ? gport->view.y0 - PCB->MaxHeight : -gport->view.y0, 0); + glTranslatef(conf_core.editor.view.flip_x ? gport->view.x0 - PCB->hidlib.size_x : -gport->view.x0, conf_core.editor.view.flip_y ? gport->view.y0 - PCB->hidlib.size_y : -gport->view.y0, 0); expcall(>k2_gl_hid, ctx); Index: trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c =================================================================== --- trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 24882) +++ trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 24883) @@ -309,8 +309,8 @@ x1 = pcb_grid_fit(MAX(0, SIDE_X(gport->view.x0)), PCB->hidlib.grid, PCB->hidlib.grid_ox); y1 = pcb_grid_fit(MAX(0, SIDE_Y(gport->view.y0)), PCB->hidlib.grid, PCB->hidlib.grid_oy); - x2 = pcb_grid_fit(MIN(PCB->MaxWidth, SIDE_X(gport->view.x0 + gport->view.width - 1)), PCB->hidlib.grid, PCB->hidlib.grid_ox); - y2 = pcb_grid_fit(MIN(PCB->MaxHeight, SIDE_Y(gport->view.y0 + gport->view.height - 1)), PCB->hidlib.grid, PCB->hidlib.grid_oy); + x2 = pcb_grid_fit(MIN(PCB->hidlib.size_x, SIDE_X(gport->view.x0 + gport->view.width - 1)), PCB->hidlib.grid, PCB->hidlib.grid_ox); + y2 = pcb_grid_fit(MIN(PCB->hidlib.size_y, SIDE_Y(gport->view.y0 + gport->view.height - 1)), PCB->hidlib.grid, PCB->hidlib.grid_oy); grd = PCB->hidlib.grid; @@ -530,8 +530,8 @@ src_y = 0; } - w = PCB->MaxWidth / gport->view.coord_per_px; - h = PCB->MaxHeight / gport->view.coord_per_px; + w = PCB->hidlib.size_x / gport->view.coord_per_px; + h = PCB->hidlib.size_y / gport->view.coord_per_px; src_x = src_x / gport->view.coord_per_px; src_y = src_y / gport->view.coord_per_px; dst_x = dst_x / gport->view.coord_per_px; @@ -1083,15 +1083,15 @@ ctx.view.X2 = MAX(Px(priv->clip_rect.x), Px(priv->clip_rect.x + priv->clip_rect.width + 1)); ctx.view.Y2 = MAX(Py(priv->clip_rect.y), Py(priv->clip_rect.y + priv->clip_rect.height + 1)); - ctx.view.X1 = MAX(0, MIN(PCB->MaxWidth, ctx.view.X1)); - ctx.view.X2 = MAX(0, MIN(PCB->MaxWidth, ctx.view.X2)); - ctx.view.Y1 = MAX(0, MIN(PCB->MaxHeight, ctx.view.Y1)); - ctx.view.Y2 = MAX(0, MIN(PCB->MaxHeight, ctx.view.Y2)); + ctx.view.X1 = MAX(0, MIN(PCB->hidlib.size_x, ctx.view.X1)); + ctx.view.X2 = MAX(0, MIN(PCB->hidlib.size_x, ctx.view.X2)); + ctx.view.Y1 = MAX(0, MIN(PCB->hidlib.size_y, ctx.view.Y1)); + ctx.view.Y2 = MAX(0, MIN(PCB->hidlib.size_y, ctx.view.Y2)); eleft = Vx(0); - eright = Vx(PCB->MaxWidth); + eright = Vx(PCB->hidlib.size_x); etop = Vy(0); - ebottom = Vy(PCB->MaxHeight); + ebottom = Vy(PCB->hidlib.size_y); if (eleft > eright) { int tmp = eleft; eleft = eright; Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 24882) +++ trunk/src_plugins/hid_lesstif/main.c (revision 24883) @@ -177,7 +177,7 @@ } /* This is the size of the current PCB work area. */ -/* Use PCB->MaxWidth, PCB->MaxHeight. */ +/* Use PCB->hidlib.size_x, PCB->hidlib.size_y. */ /* static int pcb_width, pcb_height; */ static int use_private_colormap = 0; static int stdin_listen = 0; @@ -351,18 +351,18 @@ { if (work_area == 0) return; - /*pcb_printf("PCB Changed! %$mD\n", PCB->MaxWidth, PCB->MaxHeight); */ + /*pcb_printf("PCB Changed! %$mD\n", PCB->hidlib.size_x, PCB->hidlib.size_y); */ stdarg_n = 0; stdarg(XmNminimum, 0); stdarg(XmNvalue, 0); - stdarg(XmNsliderSize, PCB->MaxWidth ? PCB->MaxWidth : 1); - stdarg(XmNmaximum, PCB->MaxWidth ? PCB->MaxWidth : 1); + stdarg(XmNsliderSize, PCB->hidlib.size_x ? PCB->hidlib.size_x : 1); + stdarg(XmNmaximum, PCB->hidlib.size_x ? PCB->hidlib.size_x : 1); XtSetValues(hscroll, stdarg_args, stdarg_n); stdarg_n = 0; stdarg(XmNminimum, 0); stdarg(XmNvalue, 0); - stdarg(XmNsliderSize, PCB->MaxHeight ? PCB->MaxHeight : 1); - stdarg(XmNmaximum, PCB->MaxHeight ? PCB->MaxHeight : 1); + stdarg(XmNsliderSize, PCB->hidlib.size_y ? PCB->hidlib.size_y : 1); + stdarg(XmNmaximum, PCB->hidlib.size_y ? PCB->hidlib.size_y : 1); XtSetValues(vscroll, stdarg_args, stdarg_n); zoom_max(); @@ -783,8 +783,8 @@ ctx.view.X1 = 0; ctx.view.Y1 = 0; - ctx.view.X2 = PCB->MaxWidth; - ctx.view.Y2 = PCB->MaxHeight; + ctx.view.X2 = PCB->hidlib.size_x; + ctx.view.Y2 = PCB->hidlib.size_y; pixmap = window; XSync(display, 0); @@ -961,8 +961,8 @@ { int x, y, w, h; double xscale, yscale; - int pcbwidth = PCB->MaxWidth / view_zoom; - int pcbheight = PCB->MaxHeight / view_zoom; + int pcbwidth = PCB->hidlib.size_x / view_zoom; + int pcbheight = PCB->hidlib.size_y / view_zoom; if (!window || !bg) return; @@ -979,8 +979,8 @@ w = MIN(view_width, pcbwidth); h = MIN(view_height, pcbheight); - xscale = (double) bg_w / PCB->MaxWidth; - yscale = (double) bg_h / PCB->MaxHeight; + xscale = (double) bg_w / PCB->hidlib.size_x; + yscale = (double) bg_h / PCB->hidlib.size_y; for (y = 0; y < h; y++) { int pr = Py(y); @@ -1023,17 +1023,17 @@ void lesstif_pan_fixup() { - if (view_left_x > PCB->MaxWidth + (view_width * view_zoom)) - view_left_x = PCB->MaxWidth + (view_width * view_zoom); - if (view_top_y > PCB->MaxHeight + (view_height * view_zoom)) - view_top_y = PCB->MaxHeight + (view_height * view_zoom); + if (view_left_x > PCB->hidlib.size_x + (view_width * view_zoom)) + view_left_x = PCB->hidlib.size_x + (view_width * view_zoom); + if (view_top_y > PCB->hidlib.size_y + (view_height * view_zoom)) + view_top_y = PCB->hidlib.size_y + (view_height * view_zoom); if (view_left_x < -(view_width * view_zoom)) view_left_x = -(view_width * view_zoom); if (view_top_y < -(view_height * view_zoom)) view_top_y = -(view_height * view_zoom); - set_scroll(hscroll, view_left_x, view_width, PCB->MaxWidth); - set_scroll(vscroll, view_top_y, view_height, PCB->MaxHeight); + set_scroll(hscroll, view_left_x, view_width, PCB->hidlib.size_x); + set_scroll(vscroll, view_top_y, view_height, PCB->hidlib.size_y); lesstif_invalidate_all(); } @@ -1040,12 +1040,12 @@ static void zoom_max() { - double new_zoom = PCB->MaxWidth / view_width; - if (new_zoom < PCB->MaxHeight / view_height) - new_zoom = PCB->MaxHeight / view_height; + double new_zoom = PCB->hidlib.size_x / view_width; + if (new_zoom < PCB->hidlib.size_y / view_height) + new_zoom = PCB->hidlib.size_y / view_height; - view_left_x = -(view_width * new_zoom - PCB->MaxWidth) / 2; - view_top_y = -(view_height * new_zoom - PCB->MaxHeight) / 2; + view_left_x = -(view_width * new_zoom - PCB->hidlib.size_x) / 2; + view_top_y = -(view_height * new_zoom - PCB->hidlib.size_y) / 2; view_zoom = new_zoom; pcb_pixel_slop = view_zoom; lesstif_pan_fixup(); @@ -1068,9 +1068,9 @@ if (conf_core.editor.view.flip_y) yfrac = 1 - yfrac; - max_zoom = PCB->MaxWidth / view_width; - if (max_zoom < PCB->MaxHeight / view_height) - max_zoom = PCB->MaxHeight / view_height; + max_zoom = PCB->hidlib.size_x / view_width; + if (max_zoom < PCB->hidlib.size_y / view_height) + max_zoom = PCB->hidlib.size_y / view_height; max_zoom *= MAX_ZOOM_SCALE; @@ -1140,12 +1140,12 @@ proportional to the cursor position in the window (like the Xaw thumb panner) */ if (pan_thumb_mode) { - opx = x * PCB->MaxWidth / view_width; - opy = y * PCB->MaxHeight / view_height; + opx = x * PCB->hidlib.size_x / view_width; + opy = y * PCB->hidlib.size_y / view_height; if (conf_core.editor.view.flip_x) - opx = PCB->MaxWidth - opx; + opx = PCB->hidlib.size_x - opx; if (conf_core.editor.view.flip_y) - opy = PCB->MaxHeight - opy; + opy = PCB->hidlib.size_y - opy; view_left_x = opx - view_width / 2 * view_zoom; view_top_y = opy - view_height / 2 * view_zoom; lesstif_pan_fixup(); @@ -1699,7 +1699,7 @@ stdarg_n = 0; stdarg(XmNorientation, XmVERTICAL); stdarg(XmNprocessingDirection, XmMAX_ON_BOTTOM); - stdarg(XmNmaximum, PCB->MaxHeight ? PCB->MaxHeight : 1); + stdarg(XmNmaximum, PCB->hidlib.size_y ? PCB->hidlib.size_y : 1); vscroll = XmCreateScrollBar(mainwind, XmStrCast("vscroll"), stdarg_args, stdarg_n); XtAddCallback(vscroll, XmNvalueChangedCallback, (XtCallbackProc) scroll_callback, (XtPointer) & view_top_y); XtAddCallback(vscroll, XmNdragCallback, (XtCallbackProc) scroll_callback, (XtPointer) & view_top_y); @@ -1707,7 +1707,7 @@ stdarg_n = 0; stdarg(XmNorientation, XmHORIZONTAL); - stdarg(XmNmaximum, PCB->MaxWidth ? PCB->MaxWidth : 1); + stdarg(XmNmaximum, PCB->hidlib.size_x ? PCB->hidlib.size_x : 1); hscroll = XmCreateScrollBar(mainwind, XmStrCast("hscroll"), stdarg_args, stdarg_n); XtAddCallback(hscroll, XmNvalueChangedCallback, (XtCallbackProc) scroll_callback, (XtPointer) & view_left_x); XtAddCallback(hscroll, XmNdragCallback, (XtCallbackProc) scroll_callback, (XtPointer) & view_left_x); @@ -2332,13 +2332,13 @@ XSetForeground(display, bg_gc, bgcolor); XFillRectangle(display, main_pixmap, bg_gc, 0, 0, mx, my); - if (ctx.view.X1 < 0 || ctx.view.Y1 < 0 || ctx.view.X2 > PCB->MaxWidth || ctx.view.Y2 > PCB->MaxHeight) { + if (ctx.view.X1 < 0 || ctx.view.Y1 < 0 || ctx.view.X2 > PCB->hidlib.size_x || ctx.view.Y2 > PCB->hidlib.size_y) { int leftmost, rightmost, topmost, bottommost; leftmost = Vx(0); - rightmost = Vx(PCB->MaxWidth); + rightmost = Vx(PCB->hidlib.size_x); topmost = Vy(0); - bottommost = Vy(PCB->MaxHeight); + bottommost = Vy(PCB->hidlib.size_y); if (leftmost > rightmost) { int t = leftmost; leftmost = rightmost; @@ -2693,7 +2693,7 @@ void lesstif_invalidate_all(void) { - lesstif_invalidate_lr(0, PCB->MaxWidth, 0, PCB->MaxHeight); + lesstif_invalidate_lr(0, PCB->hidlib.size_x, 0, PCB->hidlib.size_y); } static void lesstif_notify_crosshair_change(pcb_bool changes_complete) Index: trunk/src_plugins/hid_remote/remote.c =================================================================== --- trunk/src_plugins/hid_remote/remote.c (revision 24882) +++ trunk/src_plugins/hid_remote/remote.c (revision 24883) @@ -96,13 +96,13 @@ ctx.view.X1 = 0; ctx.view.Y1 = 0; - ctx.view.X2 = PCB->MaxWidth; - ctx.view.Y2 = PCB->MaxHeight; + ctx.view.X2 = PCB->hidlib.size_x; + ctx.view.Y2 = PCB->hidlib.size_y; TODO(": wait for a connection?") remote_proto_send_ver(); remote_proto_send_unit(); - remote_proto_send_brddim(PCB->MaxWidth, PCB->MaxHeight); + remote_proto_send_brddim(PCB->hidlib.size_x, PCB->hidlib.size_y); remote_send_all_layers(); if (remote_proto_send_ready() != 0) exit(1); Index: trunk/src_plugins/import_dsn/dsn.c =================================================================== --- trunk/src_plugins/import_dsn/dsn.c (revision 24882) +++ trunk/src_plugins/import_dsn/dsn.c (revision 24883) @@ -127,8 +127,8 @@ return; (*nlines)++; if (pn > 0) { - /*pcb_line_t *line = */pcb_line_new_merge(layer, lx, PCB->MaxHeight - ly, - x, PCB->MaxHeight - y, thick, clear, pcb_flag_make(PCB_FLAG_AUTO | PCB_FLAG_CLEARLINE)); + /*pcb_line_t *line = */pcb_line_new_merge(layer, lx, PCB->hidlib.size_y - ly, + x, PCB->hidlib.size_y - y, thick, clear, pcb_flag_make(PCB_FLAG_AUTO | PCB_FLAG_CLEARLINE)); /* pcb_poly_clear_from_poly(PCB->Data, PCB_OBJ_LINE, layer, line);*/ /* pcb_printf("LINE: %$mm %$mm .. %$mm %$mm\n", lx, ly, x, y);*/ } @@ -196,7 +196,7 @@ } { - pcb_pstk_t *ps = pcb_pstk_new_compat_via(PCB->Data, -1, x, PCB->MaxHeight - y, drill, dia, clear, 0, PCB_PSTK_COMPAT_ROUND, 1); + pcb_pstk_t *ps = pcb_pstk_new_compat_via(PCB->Data, -1, x, PCB->hidlib.size_y - y, drill, dia, clear, 0, PCB_PSTK_COMPAT_ROUND, 1); PCB_FLAG_SET(PCB_FLAG_AUTO, ps); } } Index: trunk/src_plugins/import_ipcd356/ipcd356.c =================================================================== --- trunk/src_plugins/import_ipcd356/ipcd356.c (revision 24882) +++ trunk/src_plugins/import_ipcd356/ipcd356.c (revision 24883) @@ -269,8 +269,8 @@ } } - y = pcb->MaxHeight - tf->cy; - if ((y < 0) || (y > pcb->MaxHeight) || (tf->cx < 0) || (tf->cx > pcb->MaxWidth)) + y = pcb->hidlib.size_y - tf->cy; + if ((y < 0) || (y > pcb->hidlib.size_y) || (tf->cx < 0) || (tf->cx > pcb->hidlib.size_x)) pcb_message(PCB_MSG_WARNING, "Test feature ended up out of the board extents in %s:%ld - board too small please use autocrop()\n", fn, lineno); ps = pcb_pstk_new_from_shape(data, tf->cx, y, tf->hole, tf->is_plated, conf_core.design.bloat, sh); Index: trunk/src_plugins/io_autotrax/read.c =================================================================== --- trunk/src_plugins/io_autotrax/read.c (revision 24882) +++ trunk/src_plugins/io_autotrax/read.c (revision 24883) @@ -1162,8 +1162,8 @@ } if (box != NULL) { - Ptr->MaxWidth = box->X2; - Ptr->MaxHeight = box->Y2; + Ptr->hidlib.size_x = box->X2; + Ptr->hidlib.size_y = box->Y2; } else pcb_message(PCB_MSG_ERROR, "Can not determine board extents - empty board?\n"); Index: trunk/src_plugins/io_autotrax/write.c =================================================================== --- trunk/src_plugins/io_autotrax/write.c (revision 24882) +++ trunk/src_plugins/io_autotrax/write.c (revision 24883) @@ -221,7 +221,7 @@ TODO(": add checks for thermals: only gnd/pwr can have them, warn for others") pcb_fprintf(ctx->f, "%.0ml %.0ml %.0ml %.0ml %d %.0ml 1 %d\r\n", - x+dx, PCB->MaxHeight - (y+dy), w, h, + x+dx, PCB->hidlib.size_y - (y+dy), w, h, ashape, drill_dia, alayer); fputs(name, ctx->f); @@ -247,7 +247,7 @@ static int wrax_line(wctx_t *ctx, pcb_line_t *line, pcb_cardinal_t layer, pcb_coord_t dx, pcb_coord_t dy) { int user_routed = 1; - pcb_fprintf(ctx->f, "%.0ml %.0ml %.0ml %.0ml %.0ml %d %d\r\n", line->Point1.X+dx, PCB->MaxHeight - (line->Point1.Y+dy), line->Point2.X+dx, PCB->MaxHeight - (line->Point2.Y+dy), line->Thickness, layer, user_routed); + pcb_fprintf(ctx->f, "%.0ml %.0ml %.0ml %.0ml %.0ml %d %d\r\n", line->Point1.X+dx, PCB->hidlib.size_y - (line->Point1.Y+dy), line->Point2.X+dx, PCB->hidlib.size_y - (line->Point2.Y+dy), line->Thickness, layer, user_routed); return 0; } @@ -255,7 +255,7 @@ static int wrax_pline_segment(wctx_t *ctx, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t Thickness, pcb_cardinal_t layer) { int user_routed = 1; - pcb_fprintf(ctx->f, "FT\r\n%.0ml %.0ml %.0ml %.0ml %.0ml %d %d\r\n", x1, PCB->MaxHeight - y1, x2, PCB->MaxHeight - y2, Thickness, layer, user_routed); + pcb_fprintf(ctx->f, "FT\r\n%.0ml %.0ml %.0ml %.0ml %.0ml %d %d\r\n", x1, PCB->hidlib.size_y - y1, x2, PCB->hidlib.size_y - y2, Thickness, layer, user_routed); return 0; } @@ -340,7 +340,7 @@ else { radius = arc->Width; } - pcb_fprintf(ctx->f, "%.0ml %.0ml %.0ml %d %.0ml %d\r\n", arc->X+dx, PCB->MaxHeight - (arc->Y+dy), radius, pcb_rnd_arc_to_autotrax_segments(arc->StartAngle, arc->Delta), arc->Thickness, current_layer); + pcb_fprintf(ctx->f, "%.0ml %.0ml %.0ml %d %.0ml %d\r\n", arc->X+dx, PCB->hidlib.size_y - (arc->Y+dy), radius, pcb_rnd_arc_to_autotrax_segments(arc->StartAngle, arc->Delta), arc->Thickness, current_layer); return 0; } @@ -469,7 +469,7 @@ else if (direction == 0) /*normal text */ rotation = 0; - pcb_fprintf(ctx->f, "%.0ml %.0ml %.0ml %d %.0ml %d\r\n", text->X+dx, PCB->MaxHeight - (text->Y+dy), textHeight, rotation + autotrax_mirrored, strokeThickness, current_layer); + pcb_fprintf(ctx->f, "%.0ml %.0ml %.0ml %d %.0ml %d\r\n", text->X+dx, PCB->hidlib.size_y - (text->Y+dy), textHeight, rotation + autotrax_mirrored, strokeThickness, current_layer); for(index = 0; index < 32; index++) { if (text->TextString[index] == '\0') index = 32; @@ -506,7 +506,7 @@ TODO(": rename these variables to something more expressive") TODO(": instead of hardwiring coords, just read existing dyntex coords") xPos = (box->X1 + box->X2) / 2; - yPos = PCB->MaxHeight - (box->Y1 - text_offset); + yPos = PCB->hidlib.size_y - (box->Y1 - text_offset); yPos2 = yPos - PCB_MIL_TO_COORD(200); yPos3 = yPos2 - PCB_MIL_TO_COORD(200); @@ -580,7 +580,7 @@ if (maxy < polygon->Points[i].Y) maxy = polygon->Points[i].Y; } - pcb_fprintf(ctx->f, "%cF\r\n%.0ml %.0ml %.0ml %.0ml %d\r\n", (in_subc ? 'C' : 'F'), minx+dx, PCB->MaxHeight - (miny+dy), maxx+dx, PCB->MaxHeight - (maxy+dy), current_layer); + pcb_fprintf(ctx->f, "%cF\r\n%.0ml %.0ml %.0ml %.0ml %d\r\n", (in_subc ? 'C' : 'F'), minx+dx, PCB->hidlib.size_y - (miny+dy), maxx+dx, PCB->hidlib.size_y - (maxy+dy), current_layer); local_flag |= 1; /* here we need to test for non rectangular polygons to flag imperfect export to easy/autotrax @@ -680,7 +680,7 @@ fputs("PCB FILE 4\r\n", FP); /*autotrax header */ /* we sort out if the layout dimensions exceed the autotrax maxima */ - if (PCB_COORD_TO_MIL(PCB->MaxWidth) > max_width_mil || PCB_COORD_TO_MIL(PCB->MaxHeight) > max_height_mil) { + if (PCB_COORD_TO_MIL(PCB->hidlib.size_x) > max_width_mil || PCB_COORD_TO_MIL(PCB->hidlib.size_y) > max_height_mil) { pcb_message(PCB_MSG_ERROR, "Layout size exceeds protel autotrax 32000 mil x 32000 mil maximum."); return -1; } Index: trunk/src_plugins/io_dsn/read.c =================================================================== --- trunk/src_plugins/io_dsn/read.c (revision 24882) +++ trunk/src_plugins/io_dsn/read.c (revision 24883) @@ -486,8 +486,8 @@ if ((ctx->bbox.X1 < 0) || (ctx->bbox.Y1 < 0)) pcb_message(PCB_MSG_WARNING, "Negative coordinates on input - you may want to execute autocrop()\n"); - ctx->pcb->MaxWidth = ctx->bbox.X2 - ctx->bbox.X1; - ctx->pcb->MaxHeight = ctx->bbox.Y2 - ctx->bbox.Y1; + ctx->pcb->hidlib.size_x = ctx->bbox.X2 - ctx->bbox.X1; + ctx->pcb->hidlib.size_y = ctx->bbox.Y2 - ctx->bbox.Y1; if (!ctx->has_pcb_boundary) { ctx->bbox.X1 = ctx->bbox.Y1 = ctx->bbox.X2 = ctx->bbox.Y2 = 0; @@ -1569,7 +1569,7 @@ if (mirror_first) { if (need_mirror) - pcb_subc_change_side(nsc, crd[1] * 2 - PCB->MaxHeight); + 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); } @@ -1577,7 +1577,7 @@ 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); if (need_mirror) - pcb_subc_change_side(nsc, crd[1] * 2 - PCB->MaxHeight); + pcb_subc_change_side(nsc, crd[1] * 2 - PCB->hidlib.size_y); } } Index: trunk/src_plugins/io_dsn/write.c =================================================================== --- trunk/src_plugins/io_dsn/write.c (revision 24882) +++ trunk/src_plugins/io_dsn/write.c (revision 24883) @@ -66,7 +66,7 @@ } #define COORDX(x) (x) -#define COORDY(y) (PCB->MaxHeight - (y)) +#define COORDY(y) (PCB->hidlib.size_y - (y)) static int dsn_write_structure(dsn_write_t *wctx) { Index: trunk/src_plugins/io_eagle/read.c =================================================================== --- trunk/src_plugins/io_eagle/read.c (revision 24882) +++ trunk/src_plugins/io_eagle/read.c (revision 24883) @@ -479,10 +479,10 @@ static void size_bump(read_state_t *st, pcb_coord_t x, pcb_coord_t y) { - if (x > st->pcb->MaxWidth) - st->pcb->MaxWidth = x; - if (y > st->pcb->MaxHeight) - st->pcb->MaxHeight = y; + if (x > st->pcb->hidlib.size_x) + st->pcb->hidlib.size_x = x; + if (y > st->pcb->hidlib.size_y) + st->pcb->hidlib.size_y = y; } /* Convert eagle Rxxx to degrees. Binary n*1024 string converted to Rxxx in eagle_bin.c */ @@ -1425,7 +1425,7 @@ } if (back) - pcb_subc_change_side(new_subc, 2 * y - st->pcb->MaxHeight); + pcb_subc_change_side(new_subc, 2 * y - st->pcb->hidlib.size_y); size_bump(st, new_subc->BoundingBox.X2, new_subc->BoundingBox.Y2); } Index: trunk/src_plugins/io_hyp/hyp_y.c =================================================================== --- trunk/src_plugins/io_hyp/hyp_y.c (revision 24882) +++ trunk/src_plugins/io_hyp/hyp_y.c (revision 24883) @@ -1,8 +1,9 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ +/* A Bison parser, made by GNU Bison 3.3.2. */ /* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,11 +41,14 @@ define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "3.0.2" +#define YYBISON_VERSION "3.3.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -70,15 +74,16 @@ #define yylval hyylval #define yychar hyychar -/* Copy the first part of user declarations. */ -#line 76 "hyp_y.c" /* yacc.c:339 */ - # ifndef YY_NULLPTR -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif # else -# define YY_NULLPTR 0 +# define YY_NULLPTR ((void*)0) # endif # endif @@ -110,11 +115,11 @@ extern int hyydebug; #endif /* "%code requires" blocks. */ -#line 21 "hyp_y.y" /* yacc.c:355 */ +#line 21 "hyp_y.y" /* yacc.c:352 */ #include "parser.h" -#line 118 "hyp_y.c" /* yacc.c:355 */ +#line 123 "hyp_y.c" /* yacc.c:352 */ /* Token type. */ #ifndef HYYTOKENTYPE @@ -227,10 +232,10 @@ /* Value type. */ #if ! defined HYYSTYPE && ! defined HYYSTYPE_IS_DECLARED -typedef union HYYSTYPE HYYSTYPE; + union HYYSTYPE { -#line 30 "hyp_y.y" /* yacc.c:355 */ +#line 30 "hyp_y.y" /* yacc.c:352 */ int boolval; int intval; @@ -237,8 +242,10 @@ double floatval; char* strval; -#line 241 "hyp_y.c" /* yacc.c:355 */ +#line 246 "hyp_y.c" /* yacc.c:352 */ }; + +typedef union HYYSTYPE HYYSTYPE; # define HYYSTYPE_IS_TRIVIAL 1 # define HYYSTYPE_IS_DECLARED 1 #endif @@ -250,8 +257,8 @@ #endif /* !YY_HYY_HYP_Y_H_INCLUDED */ -/* Copy the second part of user declarations. */ -#line 37 "hyp_y.y" /* yacc.c:358 */ +/* Second part of user prologue. */ +#line 37 "hyp_y.y" /* yacc.c:354 */ #include #include @@ -272,7 +279,7 @@ static parse_param h; -#line 276 "hyp_y.c" /* yacc.c:358 */ +#line 283 "hyp_y.c" /* yacc.c:354 */ #ifdef short # undef short @@ -293,13 +300,13 @@ #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else -typedef unsigned short int yytype_uint16; +typedef unsigned short yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else -typedef short int yytype_int16; +typedef short yytype_int16; #endif #ifndef YYSIZE_T @@ -311,7 +318,7 @@ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else -# define YYSIZE_T unsigned int +# define YYSIZE_T unsigned # endif #endif @@ -347,15 +354,6 @@ # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif -#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) -# endif -#endif - /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -363,7 +361,7 @@ # define YYUSE(E) /* empty */ #endif -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ @@ -525,16 +523,16 @@ /* YYNSTATES -- Number of states. */ #define YYNSTATES 620 -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 358 +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ + as returned by yylex. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -1204,22 +1202,22 @@ #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) /* Error token number */ #define YYTERROR 1 @@ -1259,37 +1257,37 @@ } while (0) -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { - FILE *yyo = yyoutput; - YYUSE (yyo); + FILE *yyoutput = yyo; + YYUSE (yyoutput); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); + YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); } -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) { - YYFPRINTF (yyoutput, "%s %s (", + YYFPRINTF (yyo, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); + yy_symbol_value_print (yyo, yytype, yyvaluep); + YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. @@ -1323,7 +1321,7 @@ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { - unsigned long int yylno = yyrline[yyrule]; + unsigned long yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", @@ -1334,7 +1332,7 @@ YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) + &yyvsp[(yyi + 1) - (yynrhs)] ); YYFPRINTF (stderr, "\n"); } @@ -1438,7 +1436,10 @@ case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; - /* Fall through. */ + else + goto append; + + append: default: if (yyres) yyres[yyn] = *yyp; @@ -1456,7 +1457,7 @@ if (! yyres) return yystrlen (yystr); - return yystpcpy (yyres, yystr) - yyres; + return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); } # endif @@ -1534,10 +1535,10 @@ yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else return 2; - yysize = yysize1; } } } @@ -1549,6 +1550,7 @@ case N: \ yyformat = S; \ break + default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); @@ -1560,9 +1562,10 @@ { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else return 2; - yysize = yysize1; } if (*yymsg_alloc < yysize) @@ -1688,23 +1691,31 @@ yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; + /*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | +| yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ - yynewstate: +yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; - yysetstate: - *yyssp = yystate; +/*--------------------------------------------------------------------. +| yynewstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + *yyssp = (yytype_int16) yystate; + if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + goto yyexhaustedlab; +#else { /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); -#ifdef yyoverflow +# if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into @@ -1720,14 +1731,10 @@ &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); - yyss = yyss1; yyvs = yyvs1; } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else +# else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; @@ -1743,22 +1750,22 @@ goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif -#endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1767,11 +1774,11 @@ goto yybackup; + /*-----------. | yybackup. | `-----------*/ yybackup: - /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ @@ -1844,7 +1851,7 @@ /*-----------------------------. -| yyreduce -- Do a reduction. | +| yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ @@ -1865,949 +1872,949 @@ switch (yyn) { case 19: -#line 151 "hyp_y.y" /* yacc.c:1646 */ +#line 151 "hyp_y.y" /* yacc.c:1652 */ { if (exec_board_file(&h)) YYERROR; } -#line 1871 "hyp_y.c" /* yacc.c:1646 */ +#line 1878 "hyp_y.c" /* yacc.c:1652 */ break; case 21: -#line 156 "hyp_y.y" /* yacc.c:1646 */ +#line 156 "hyp_y.y" /* yacc.c:1652 */ { h.vers = yylval.floatval; } -#line 1877 "hyp_y.c" /* yacc.c:1646 */ +#line 1884 "hyp_y.c" /* yacc.c:1652 */ break; case 22: -#line 156 "hyp_y.y" /* yacc.c:1646 */ +#line 156 "hyp_y.y" /* yacc.c:1652 */ { if (exec_version(&h)) YYERROR; } -#line 1883 "hyp_y.c" /* yacc.c:1646 */ +#line 1890 "hyp_y.c" /* yacc.c:1652 */ break; case 23: -#line 161 "hyp_y.y" /* yacc.c:1646 */ +#line 161 "hyp_y.y" /* yacc.c:1652 */ { if (exec_data_mode(&h)) YYERROR; } -#line 1889 "hyp_y.c" /* yacc.c:1646 */ +#line 1896 "hyp_y.c" /* yacc.c:1652 */ break; case 24: -#line 164 "hyp_y.y" /* yacc.c:1646 */ +#line 164 "hyp_y.y" /* yacc.c:1652 */ { h.detailed = pcb_false; } -#line 1895 "hyp_y.c" /* yacc.c:1646 */ +#line 1902 "hyp_y.c" /* yacc.c:1652 */ break; case 25: -#line 165 "hyp_y.y" /* yacc.c:1646 */ +#line 165 "hyp_y.y" /* yacc.c:1652 */ { h.detailed = pcb_true; } -#line 1901 "hyp_y.c" /* yacc.c:1646 */ +#line 1908 "hyp_y.c" /* yacc.c:1652 */ break; case 26: -#line 170 "hyp_y.y" /* yacc.c:1646 */ +#line 170 "hyp_y.y" /* yacc.c:1652 */ { if (exec_units(&h)) YYERROR; } -#line 1907 "hyp_y.c" /* yacc.c:1646 */ +#line 1914 "hyp_y.c" /* yacc.c:1652 */ break; case 27: -#line 173 "hyp_y.y" /* yacc.c:1646 */ +#line 173 "hyp_y.y" /* yacc.c:1652 */ { h.unit_system_english = pcb_true; } -#line 1913 "hyp_y.c" /* yacc.c:1646 */ +#line 1920 "hyp_y.c" /* yacc.c:1652 */ break; case 28: -#line 174 "hyp_y.y" /* yacc.c:1646 */ +#line 174 "hyp_y.y" /* yacc.c:1652 */ { h.unit_system_english = pcb_false; } -#line 1919 "hyp_y.c" /* yacc.c:1646 */ +#line 1926 "hyp_y.c" /* yacc.c:1652 */ break; case 29: -#line 177 "hyp_y.y" /* yacc.c:1646 */ +#line 177 "hyp_y.y" /* yacc.c:1652 */ { h.metal_thickness_weight = pcb_true; } -#line 1925 "hyp_y.c" /* yacc.c:1646 */ +#line 1932 "hyp_y.c" /* yacc.c:1652 */ break; case 30: -#line 178 "hyp_y.y" /* yacc.c:1646 */ +#line 178 "hyp_y.y" /* yacc.c:1652 */ { h.metal_thickness_weight = pcb_false; } -#line 1931 "hyp_y.c" /* yacc.c:1646 */ +#line 1938 "hyp_y.c" /* yacc.c:1652 */ break; case 31: -#line 182 "hyp_y.y" /* yacc.c:1646 */ +#line 182 "hyp_y.y" /* yacc.c:1652 */ { h.default_plane_separation = yylval.floatval; } -#line 1937 "hyp_y.c" /* yacc.c:1646 */ +#line 1944 "hyp_y.c" /* yacc.c:1652 */ break; case 32: -#line 182 "hyp_y.y" /* yacc.c:1646 */ +#line 182 "hyp_y.y" /* yacc.c:1652 */ { if (exec_plane_sep(&h)) YYERROR; } -#line 1943 "hyp_y.c" /* yacc.c:1646 */ +#line 1950 "hyp_y.c" /* yacc.c:1652 */ break; case 38: -#line 196 "hyp_y.y" /* yacc.c:1646 */ +#line 196 "hyp_y.y" /* yacc.c:1652 */ { hyyerror("warning: missing ')'"); } -#line 1949 "hyp_y.c" /* yacc.c:1646 */ +#line 1956 "hyp_y.c" /* yacc.c:1652 */ break; case 43: -#line 206 "hyp_y.y" /* yacc.c:1646 */ +#line 206 "hyp_y.y" /* yacc.c:1652 */ { if (exec_perimeter_segment(&h)) YYERROR; } -#line 1955 "hyp_y.c" /* yacc.c:1646 */ +#line 1962 "hyp_y.c" /* yacc.c:1652 */ break; case 44: -#line 209 "hyp_y.y" /* yacc.c:1646 */ +#line 209 "hyp_y.y" /* yacc.c:1652 */ { if (exec_perimeter_arc(&h)) YYERROR; } -#line 1961 "hyp_y.c" /* yacc.c:1646 */ +#line 1968 "hyp_y.c" /* yacc.c:1652 */ break; case 45: -#line 212 "hyp_y.y" /* yacc.c:1646 */ +#line 212 "hyp_y.y" /* yacc.c:1652 */ { h.name = yylval.strval; } -#line 1967 "hyp_y.c" /* yacc.c:1646 */ +#line 1974 "hyp_y.c" /* yacc.c:1652 */ break; case 46: -#line 212 "hyp_y.y" /* yacc.c:1646 */ +#line 212 "hyp_y.y" /* yacc.c:1652 */ { h.value = yylval.strval; } -#line 1973 "hyp_y.c" /* yacc.c:1646 */ +#line 1980 "hyp_y.c" /* yacc.c:1652 */ break; case 47: -#line 212 "hyp_y.y" /* yacc.c:1646 */ +#line 212 "hyp_y.y" /* yacc.c:1652 */ { if (exec_board_attribute(&h)) YYERROR; } -#line 1979 "hyp_y.c" /* yacc.c:1646 */ +#line 1986 "hyp_y.c" /* yacc.c:1652 */ break; case 56: -#line 231 "hyp_y.y" /* yacc.c:1646 */ +#line 231 "hyp_y.y" /* yacc.c:1652 */ { if (exec_options(&h)) YYERROR; } -#line 1985 "hyp_y.c" /* yacc.c:1646 */ +#line 1992 "hyp_y.c" /* yacc.c:1652 */ break; case 57: -#line 234 "hyp_y.y" /* yacc.c:1646 */ +#line 234 "hyp_y.y" /* yacc.c:1652 */ { h.use_die_for_metal = yylval.boolval; } -#line 1991 "hyp_y.c" /* yacc.c:1646 */ +#line 1998 "hyp_y.c" /* yacc.c:1652 */ break; case 60: -#line 239 "hyp_y.y" /* yacc.c:1646 */ +#line 239 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 1997 "hyp_y.c" /* yacc.c:1646 */ +#line 2004 "hyp_y.c" /* yacc.c:1652 */ break; case 61: -#line 239 "hyp_y.y" /* yacc.c:1646 */ +#line 239 "hyp_y.y" /* yacc.c:1652 */ { if (exec_signal(&h)) YYERROR; } -#line 2003 "hyp_y.c" /* yacc.c:1646 */ +#line 2010 "hyp_y.c" /* yacc.c:1652 */ break; case 66: -#line 248 "hyp_y.y" /* yacc.c:1646 */ +#line 248 "hyp_y.y" /* yacc.c:1652 */ { h.bulk_resistivity = yylval.floatval; h.bulk_resistivity_set = pcb_true; } -#line 2009 "hyp_y.c" /* yacc.c:1646 */ +#line 2016 "hyp_y.c" /* yacc.c:1652 */ break; case 74: -#line 258 "hyp_y.y" /* yacc.c:1646 */ +#line 258 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 2015 "hyp_y.c" /* yacc.c:1646 */ +#line 2022 "hyp_y.c" /* yacc.c:1652 */ break; case 75: -#line 258 "hyp_y.y" /* yacc.c:1646 */ +#line 258 "hyp_y.y" /* yacc.c:1652 */ { if (exec_dielectric(&h)) YYERROR; } -#line 2021 "hyp_y.c" /* yacc.c:1646 */ +#line 2028 "hyp_y.c" /* yacc.c:1652 */ break; case 79: -#line 266 "hyp_y.y" /* yacc.c:1646 */ +#line 266 "hyp_y.y" /* yacc.c:1652 */ { h.epsilon_r = yylval.floatval; h.epsilon_r_set = pcb_true; } -#line 2027 "hyp_y.c" /* yacc.c:1646 */ +#line 2034 "hyp_y.c" /* yacc.c:1652 */ break; case 86: -#line 276 "hyp_y.y" /* yacc.c:1646 */ +#line 276 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 2033 "hyp_y.c" /* yacc.c:1646 */ +#line 2040 "hyp_y.c" /* yacc.c:1652 */ break; case 87: -#line 276 "hyp_y.y" /* yacc.c:1646 */ +#line 276 "hyp_y.y" /* yacc.c:1652 */ { if (exec_plane(&h)) YYERROR; } -#line 2039 "hyp_y.c" /* yacc.c:1646 */ +#line 2046 "hyp_y.c" /* yacc.c:1652 */ break; case 91: -#line 284 "hyp_y.y" /* yacc.c:1646 */ +#line 284 "hyp_y.y" /* yacc.c:1652 */ { h.bulk_resistivity = yylval.floatval; h.bulk_resistivity_set = pcb_true; } -#line 2045 "hyp_y.c" /* yacc.c:1646 */ +#line 2052 "hyp_y.c" /* yacc.c:1652 */ break; case 99: -#line 294 "hyp_y.y" /* yacc.c:1646 */ +#line 294 "hyp_y.y" /* yacc.c:1652 */ { h.thickness = yylval.floatval; h.thickness_set = pcb_true; } -#line 2051 "hyp_y.c" /* yacc.c:1646 */ +#line 2058 "hyp_y.c" /* yacc.c:1652 */ break; case 100: -#line 297 "hyp_y.y" /* yacc.c:1646 */ +#line 297 "hyp_y.y" /* yacc.c:1652 */ { h.plating_thickness = yylval.floatval; h.plating_thickness_set = pcb_true; } -#line 2057 "hyp_y.c" /* yacc.c:1646 */ +#line 2064 "hyp_y.c" /* yacc.c:1652 */ break; case 101: -#line 300 "hyp_y.y" /* yacc.c:1646 */ +#line 300 "hyp_y.y" /* yacc.c:1652 */ { h.bulk_resistivity = yylval.floatval; h.bulk_resistivity_set = pcb_true; } -#line 2063 "hyp_y.c" /* yacc.c:1646 */ +#line 2070 "hyp_y.c" /* yacc.c:1652 */ break; case 102: -#line 303 "hyp_y.y" /* yacc.c:1646 */ +#line 303 "hyp_y.y" /* yacc.c:1652 */ { h.temperature_coefficient = yylval.floatval; h.temperature_coefficient_set = pcb_true; } -#line 2069 "hyp_y.c" /* yacc.c:1646 */ +#line 2076 "hyp_y.c" /* yacc.c:1652 */ break; case 103: -#line 306 "hyp_y.y" /* yacc.c:1646 */ +#line 306 "hyp_y.y" /* yacc.c:1652 */ { h.epsilon_r = yylval.floatval; h.epsilon_r_set = pcb_true; } -#line 2075 "hyp_y.c" /* yacc.c:1646 */ +#line 2082 "hyp_y.c" /* yacc.c:1652 */ break; case 104: -#line 309 "hyp_y.y" /* yacc.c:1646 */ +#line 309 "hyp_y.y" /* yacc.c:1652 */ { h.loss_tangent = yylval.floatval; h.loss_tangent_set = pcb_true; } -#line 2081 "hyp_y.c" /* yacc.c:1646 */ +#line 2088 "hyp_y.c" /* yacc.c:1652 */ break; case 105: -#line 312 "hyp_y.y" /* yacc.c:1646 */ +#line 312 "hyp_y.y" /* yacc.c:1652 */ { h.layer_name = yylval.strval; h.layer_name_set = pcb_true; } -#line 2087 "hyp_y.c" /* yacc.c:1646 */ +#line 2094 "hyp_y.c" /* yacc.c:1652 */ break; case 106: -#line 315 "hyp_y.y" /* yacc.c:1646 */ +#line 315 "hyp_y.y" /* yacc.c:1652 */ { h.material_name = yylval.strval; h.material_name_set = pcb_true; } -#line 2093 "hyp_y.c" /* yacc.c:1646 */ +#line 2100 "hyp_y.c" /* yacc.c:1652 */ break; case 107: -#line 318 "hyp_y.y" /* yacc.c:1646 */ +#line 318 "hyp_y.y" /* yacc.c:1652 */ { h.plane_separation = yylval.floatval; h.plane_separation_set = pcb_true; } -#line 2099 "hyp_y.c" /* yacc.c:1646 */ +#line 2106 "hyp_y.c" /* yacc.c:1652 */ break; case 108: -#line 321 "hyp_y.y" /* yacc.c:1646 */ +#line 321 "hyp_y.y" /* yacc.c:1652 */ { h.conformal = yylval.boolval; h.conformal_set = pcb_true; } -#line 2105 "hyp_y.c" /* yacc.c:1646 */ +#line 2112 "hyp_y.c" /* yacc.c:1652 */ break; case 109: -#line 324 "hyp_y.y" /* yacc.c:1646 */ +#line 324 "hyp_y.y" /* yacc.c:1652 */ { h.prepreg = yylval.boolval; h.prepreg_set = pcb_true; } -#line 2111 "hyp_y.c" /* yacc.c:1646 */ +#line 2118 "hyp_y.c" /* yacc.c:1652 */ break; case 114: -#line 337 "hyp_y.y" /* yacc.c:1646 */ +#line 337 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 2117 "hyp_y.c" /* yacc.c:1646 */ +#line 2124 "hyp_y.c" /* yacc.c:1652 */ break; case 115: -#line 337 "hyp_y.y" /* yacc.c:1646 */ +#line 337 "hyp_y.y" /* yacc.c:1652 */ { h.device_type = yylval.strval; } -#line 2123 "hyp_y.c" /* yacc.c:1646 */ +#line 2130 "hyp_y.c" /* yacc.c:1652 */ break; case 116: -#line 337 "hyp_y.y" /* yacc.c:1646 */ +#line 337 "hyp_y.y" /* yacc.c:1652 */ { h.ref = yylval.strval; } -#line 2129 "hyp_y.c" /* yacc.c:1646 */ +#line 2136 "hyp_y.c" /* yacc.c:1652 */ break; case 117: -#line 337 "hyp_y.y" /* yacc.c:1646 */ +#line 337 "hyp_y.y" /* yacc.c:1652 */ { if (exec_devices(&h)) YYERROR; } -#line 2135 "hyp_y.c" /* yacc.c:1646 */ +#line 2142 "hyp_y.c" /* yacc.c:1652 */ break; case 125: -#line 356 "hyp_y.y" /* yacc.c:1646 */ +#line 356 "hyp_y.y" /* yacc.c:1652 */ { h.name = yylval.strval; h.name_set = pcb_true; } -#line 2141 "hyp_y.c" /* yacc.c:1646 */ +#line 2148 "hyp_y.c" /* yacc.c:1652 */ break; case 128: -#line 364 "hyp_y.y" /* yacc.c:1646 */ +#line 364 "hyp_y.y" /* yacc.c:1652 */ { h.value_float = yylval.floatval; h.value_float_set = pcb_true; } -#line 2147 "hyp_y.c" /* yacc.c:1646 */ +#line 2154 "hyp_y.c" /* yacc.c:1652 */ break; case 129: -#line 367 "hyp_y.y" /* yacc.c:1646 */ +#line 367 "hyp_y.y" /* yacc.c:1652 */ { h.value_string = yylval.strval; h.value_string_set = pcb_true; } -#line 2153 "hyp_y.c" /* yacc.c:1646 */ +#line 2160 "hyp_y.c" /* yacc.c:1652 */ break; case 130: -#line 370 "hyp_y.y" /* yacc.c:1646 */ +#line 370 "hyp_y.y" /* yacc.c:1652 */ { h.package = yylval.strval; h.package_set = pcb_true; } -#line 2159 "hyp_y.c" /* yacc.c:1646 */ +#line 2166 "hyp_y.c" /* yacc.c:1652 */ break; case 134: -#line 382 "hyp_y.y" /* yacc.c:1646 */ +#line 382 "hyp_y.y" /* yacc.c:1652 */ { if (exec_supplies(&h)) YYERROR; } -#line 2165 "hyp_y.c" /* yacc.c:1646 */ +#line 2172 "hyp_y.c" /* yacc.c:1652 */ break; case 136: -#line 386 "hyp_y.y" /* yacc.c:1646 */ +#line 386 "hyp_y.y" /* yacc.c:1652 */ { h.voltage_specified = yylval.boolval; } -#line 2171 "hyp_y.c" /* yacc.c:1646 */ +#line 2178 "hyp_y.c" /* yacc.c:1652 */ break; case 137: -#line 389 "hyp_y.y" /* yacc.c:1646 */ +#line 389 "hyp_y.y" /* yacc.c:1652 */ { h.conversion = yylval.boolval; } -#line 2177 "hyp_y.c" /* yacc.c:1646 */ +#line 2184 "hyp_y.c" /* yacc.c:1652 */ break; case 138: -#line 394 "hyp_y.y" /* yacc.c:1646 */ +#line 394 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 2183 "hyp_y.c" /* yacc.c:1646 */ +#line 2190 "hyp_y.c" /* yacc.c:1652 */ break; case 139: -#line 394 "hyp_y.y" /* yacc.c:1646 */ +#line 394 "hyp_y.y" /* yacc.c:1652 */ { h.padstack_name = yylval.strval; h.padstack_name_set = pcb_true; } -#line 2189 "hyp_y.c" /* yacc.c:1646 */ +#line 2196 "hyp_y.c" /* yacc.c:1652 */ break; case 140: -#line 394 "hyp_y.y" /* yacc.c:1646 */ +#line 394 "hyp_y.y" /* yacc.c:1652 */ { if (exec_pstk_end(&h)) YYERROR; } -#line 2195 "hyp_y.c" /* yacc.c:1646 */ +#line 2202 "hyp_y.c" /* yacc.c:1652 */ break; case 141: -#line 397 "hyp_y.y" /* yacc.c:1646 */ +#line 397 "hyp_y.y" /* yacc.c:1652 */ { h.drill_size = yylval.floatval; h.drill_size_set = pcb_true; } -#line 2201 "hyp_y.c" /* yacc.c:1646 */ +#line 2208 "hyp_y.c" /* yacc.c:1652 */ break; case 147: -#line 406 "hyp_y.y" /* yacc.c:1646 */ +#line 406 "hyp_y.y" /* yacc.c:1652 */ { h.layer_name = yylval.strval; h.layer_name_set = pcb_true; } -#line 2207 "hyp_y.c" /* yacc.c:1646 */ +#line 2214 "hyp_y.c" /* yacc.c:1652 */ break; case 148: -#line 406 "hyp_y.y" /* yacc.c:1646 */ +#line 406 "hyp_y.y" /* yacc.c:1652 */ { if (exec_pstk_element(&h)) YYERROR; new_record(); } -#line 2213 "hyp_y.c" /* yacc.c:1646 */ +#line 2220 "hyp_y.c" /* yacc.c:1652 */ break; case 150: -#line 410 "hyp_y.y" /* yacc.c:1646 */ +#line 410 "hyp_y.y" /* yacc.c:1652 */ { h.pad_shape = yylval.floatval; } -#line 2219 "hyp_y.c" /* yacc.c:1646 */ +#line 2226 "hyp_y.c" /* yacc.c:1652 */ break; case 152: -#line 411 "hyp_y.y" /* yacc.c:1646 */ +#line 411 "hyp_y.y" /* yacc.c:1652 */ { h.pad_shape = -1; } -#line 2225 "hyp_y.c" /* yacc.c:1646 */ +#line 2232 "hyp_y.c" /* yacc.c:1652 */ break; case 153: -#line 415 "hyp_y.y" /* yacc.c:1646 */ +#line 415 "hyp_y.y" /* yacc.c:1652 */ { h.pad_sx = yylval.floatval; } -#line 2231 "hyp_y.c" /* yacc.c:1646 */ +#line 2238 "hyp_y.c" /* yacc.c:1652 */ break; case 154: -#line 415 "hyp_y.y" /* yacc.c:1646 */ +#line 415 "hyp_y.y" /* yacc.c:1652 */ { h.pad_sy = yylval.floatval; } -#line 2237 "hyp_y.c" /* yacc.c:1646 */ +#line 2244 "hyp_y.c" /* yacc.c:1652 */ break; case 155: -#line 415 "hyp_y.y" /* yacc.c:1646 */ +#line 415 "hyp_y.y" /* yacc.c:1652 */ { h.pad_angle = yylval.floatval; } -#line 2243 "hyp_y.c" /* yacc.c:1646 */ +#line 2250 "hyp_y.c" /* yacc.c:1652 */ break; case 157: -#line 419 "hyp_y.y" /* yacc.c:1646 */ +#line 419 "hyp_y.y" /* yacc.c:1652 */ { h.pad_type = PAD_TYPE_METAL; h.pad_type_set = pcb_true; } -#line 2249 "hyp_y.c" /* yacc.c:1646 */ +#line 2256 "hyp_y.c" /* yacc.c:1652 */ break; case 158: -#line 420 "hyp_y.y" /* yacc.c:1646 */ +#line 420 "hyp_y.y" /* yacc.c:1652 */ { h.pad_type = PAD_TYPE_ANTIPAD; h.pad_type_set = pcb_true; } -#line 2255 "hyp_y.c" /* yacc.c:1646 */ +#line 2262 "hyp_y.c" /* yacc.c:1652 */ break; case 159: -#line 421 "hyp_y.y" /* yacc.c:1646 */ +#line 421 "hyp_y.y" /* yacc.c:1652 */ { h.thermal_clear_shape = yylval.floatval; } -#line 2261 "hyp_y.c" /* yacc.c:1646 */ +#line 2268 "hyp_y.c" /* yacc.c:1652 */ break; case 160: -#line 422 "hyp_y.y" /* yacc.c:1646 */ +#line 422 "hyp_y.y" /* yacc.c:1652 */ { h.thermal_clear_sx = yylval.floatval; } -#line 2267 "hyp_y.c" /* yacc.c:1646 */ +#line 2274 "hyp_y.c" /* yacc.c:1652 */ break; case 161: -#line 423 "hyp_y.y" /* yacc.c:1646 */ +#line 423 "hyp_y.y" /* yacc.c:1652 */ { h.thermal_clear_sy = yylval.floatval; } -#line 2273 "hyp_y.c" /* yacc.c:1646 */ +#line 2280 "hyp_y.c" /* yacc.c:1652 */ break; case 162: -#line 424 "hyp_y.y" /* yacc.c:1646 */ +#line 424 "hyp_y.y" /* yacc.c:1652 */ { h.thermal_clear_angle = yylval.floatval; } -#line 2279 "hyp_y.c" /* yacc.c:1646 */ +#line 2286 "hyp_y.c" /* yacc.c:1652 */ break; case 163: -#line 425 "hyp_y.y" /* yacc.c:1646 */ +#line 425 "hyp_y.y" /* yacc.c:1652 */ { h.pad_type = PAD_TYPE_THERMAL_RELIEF; h.pad_type_set = pcb_true; } -#line 2285 "hyp_y.c" /* yacc.c:1646 */ +#line 2292 "hyp_y.c" /* yacc.c:1652 */ break; case 164: -#line 431 "hyp_y.y" /* yacc.c:1646 */ +#line 431 "hyp_y.y" /* yacc.c:1652 */ { h.net_name = yylval.strval; if (exec_net(&h)) YYERROR; } -#line 2291 "hyp_y.c" /* yacc.c:1646 */ +#line 2298 "hyp_y.c" /* yacc.c:1652 */ break; case 166: -#line 434 "hyp_y.y" /* yacc.c:1646 */ +#line 434 "hyp_y.y" /* yacc.c:1652 */ { if (exec_net_plane_separation(&h)) YYERROR; } -#line 2297 "hyp_y.c" /* yacc.c:1646 */ +#line 2304 "hyp_y.c" /* yacc.c:1652 */ break; case 170: -#line 440 "hyp_y.y" /* yacc.c:1646 */ +#line 440 "hyp_y.y" /* yacc.c:1652 */ { hyyerror("warning: empty net"); } -#line 2303 "hyp_y.c" /* yacc.c:1646 */ +#line 2310 "hyp_y.c" /* yacc.c:1652 */ break; case 186: -#line 463 "hyp_y.y" /* yacc.c:1646 */ +#line 463 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 2309 "hyp_y.c" /* yacc.c:1646 */ +#line 2316 "hyp_y.c" /* yacc.c:1652 */ break; case 187: -#line 463 "hyp_y.y" /* yacc.c:1646 */ +#line 463 "hyp_y.y" /* yacc.c:1652 */ { if (exec_seg(&h)) YYERROR; } -#line 2315 "hyp_y.c" /* yacc.c:1646 */ +#line 2322 "hyp_y.c" /* yacc.c:1652 */ break; case 188: -#line 466 "hyp_y.y" /* yacc.c:1646 */ +#line 466 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 2321 "hyp_y.c" /* yacc.c:1646 */ +#line 2328 "hyp_y.c" /* yacc.c:1652 */ break; case 189: -#line 466 "hyp_y.y" /* yacc.c:1646 */ +#line 466 "hyp_y.y" /* yacc.c:1652 */ { if (exec_arc(&h)) YYERROR; } -#line 2327 "hyp_y.c" /* yacc.c:1646 */ +#line 2334 "hyp_y.c" /* yacc.c:1652 */ break; case 194: -#line 479 "hyp_y.y" /* yacc.c:1646 */ +#line 479 "hyp_y.y" /* yacc.c:1652 */ { h.width = yylval.floatval; h.width_set = pcb_true; } -#line 2333 "hyp_y.c" /* yacc.c:1646 */ +#line 2340 "hyp_y.c" /* yacc.c:1652 */ break; case 195: -#line 482 "hyp_y.y" /* yacc.c:1646 */ +#line 482 "hyp_y.y" /* yacc.c:1652 */ { h.left_plane_separation = yylval.floatval; h.left_plane_separation_set = pcb_true; } -#line 2339 "hyp_y.c" /* yacc.c:1646 */ +#line 2346 "hyp_y.c" /* yacc.c:1652 */ break; case 196: -#line 485 "hyp_y.y" /* yacc.c:1646 */ +#line 485 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 2345 "hyp_y.c" /* yacc.c:1646 */ +#line 2352 "hyp_y.c" /* yacc.c:1652 */ break; case 197: -#line 485 "hyp_y.y" /* yacc.c:1646 */ +#line 485 "hyp_y.y" /* yacc.c:1652 */ { if (exec_via(&h)) YYERROR; } -#line 2351 "hyp_y.c" /* yacc.c:1646 */ +#line 2358 "hyp_y.c" /* yacc.c:1652 */ break; case 201: -#line 496 "hyp_y.y" /* yacc.c:1646 */ +#line 496 "hyp_y.y" /* yacc.c:1652 */ { h.drill_size = yylval.floatval; h.drill_size_set = pcb_true; } -#line 2357 "hyp_y.c" /* yacc.c:1646 */ +#line 2364 "hyp_y.c" /* yacc.c:1652 */ break; case 204: -#line 499 "hyp_y.y" /* yacc.c:1646 */ +#line 499 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad_shape = yylval.strval; h.via_pad_shape_set = pcb_true; } -#line 2363 "hyp_y.c" /* yacc.c:1646 */ +#line 2370 "hyp_y.c" /* yacc.c:1652 */ break; case 205: -#line 500 "hyp_y.y" /* yacc.c:1646 */ +#line 500 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad_sx = yylval.floatval; h.via_pad_sx_set = pcb_true; } -#line 2369 "hyp_y.c" /* yacc.c:1646 */ +#line 2376 "hyp_y.c" /* yacc.c:1652 */ break; case 206: -#line 501 "hyp_y.y" /* yacc.c:1646 */ +#line 501 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad_sy = yylval.floatval; h.via_pad_sy_set = pcb_true; } -#line 2375 "hyp_y.c" /* yacc.c:1646 */ +#line 2382 "hyp_y.c" /* yacc.c:1652 */ break; case 207: -#line 502 "hyp_y.y" /* yacc.c:1646 */ +#line 502 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad_angle = yylval.floatval; h.via_pad_angle_set = pcb_true; } -#line 2381 "hyp_y.c" /* yacc.c:1646 */ +#line 2388 "hyp_y.c" /* yacc.c:1652 */ break; case 208: -#line 503 "hyp_y.y" /* yacc.c:1646 */ +#line 503 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad1_shape = yylval.strval; h.via_pad1_shape_set = pcb_true; } -#line 2387 "hyp_y.c" /* yacc.c:1646 */ +#line 2394 "hyp_y.c" /* yacc.c:1652 */ break; case 209: -#line 504 "hyp_y.y" /* yacc.c:1646 */ +#line 504 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad1_sx = yylval.floatval; h.via_pad1_sx_set = pcb_true; } -#line 2393 "hyp_y.c" /* yacc.c:1646 */ +#line 2400 "hyp_y.c" /* yacc.c:1652 */ break; case 210: -#line 505 "hyp_y.y" /* yacc.c:1646 */ +#line 505 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad1_sy = yylval.floatval; h.via_pad1_sy_set = pcb_true; } -#line 2399 "hyp_y.c" /* yacc.c:1646 */ +#line 2406 "hyp_y.c" /* yacc.c:1652 */ break; case 211: -#line 506 "hyp_y.y" /* yacc.c:1646 */ +#line 506 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad1_angle = yylval.floatval; h.via_pad1_angle_set = pcb_true; } -#line 2405 "hyp_y.c" /* yacc.c:1646 */ +#line 2412 "hyp_y.c" /* yacc.c:1652 */ break; case 212: -#line 507 "hyp_y.y" /* yacc.c:1646 */ +#line 507 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad2_shape = yylval.strval; h.via_pad2_shape_set = pcb_true; } -#line 2411 "hyp_y.c" /* yacc.c:1646 */ +#line 2418 "hyp_y.c" /* yacc.c:1652 */ break; case 213: -#line 508 "hyp_y.y" /* yacc.c:1646 */ +#line 508 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad2_sx = yylval.floatval; h.via_pad2_sx_set = pcb_true; } -#line 2417 "hyp_y.c" /* yacc.c:1646 */ +#line 2424 "hyp_y.c" /* yacc.c:1652 */ break; case 214: -#line 509 "hyp_y.y" /* yacc.c:1646 */ +#line 509 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad2_sy = yylval.floatval; h.via_pad2_sy_set = pcb_true; } -#line 2423 "hyp_y.c" /* yacc.c:1646 */ +#line 2430 "hyp_y.c" /* yacc.c:1652 */ break; case 215: -#line 510 "hyp_y.y" /* yacc.c:1646 */ +#line 510 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad2_angle = yylval.floatval; h.via_pad2_angle_set = pcb_true; } -#line 2429 "hyp_y.c" /* yacc.c:1646 */ +#line 2436 "hyp_y.c" /* yacc.c:1652 */ break; case 216: -#line 514 "hyp_y.y" /* yacc.c:1646 */ +#line 514 "hyp_y.y" /* yacc.c:1652 */ { h.padstack_name = yylval.strval; h.padstack_name_set = pcb_true; } -#line 2435 "hyp_y.c" /* yacc.c:1646 */ +#line 2442 "hyp_y.c" /* yacc.c:1652 */ break; case 217: -#line 517 "hyp_y.y" /* yacc.c:1646 */ +#line 517 "hyp_y.y" /* yacc.c:1652 */ { h.layer1_name = yylval.strval; h.layer1_name_set = pcb_true; } -#line 2441 "hyp_y.c" /* yacc.c:1646 */ +#line 2448 "hyp_y.c" /* yacc.c:1652 */ break; case 218: -#line 520 "hyp_y.y" /* yacc.c:1646 */ +#line 520 "hyp_y.y" /* yacc.c:1652 */ { h.layer2_name = yylval.strval; h.layer2_name_set = pcb_true; } -#line 2447 "hyp_y.c" /* yacc.c:1646 */ +#line 2454 "hyp_y.c" /* yacc.c:1652 */ break; case 219: -#line 523 "hyp_y.y" /* yacc.c:1646 */ +#line 523 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 2453 "hyp_y.c" /* yacc.c:1646 */ +#line 2460 "hyp_y.c" /* yacc.c:1652 */ break; case 220: -#line 523 "hyp_y.y" /* yacc.c:1646 */ +#line 523 "hyp_y.y" /* yacc.c:1652 */ { if (exec_pin(&h)) YYERROR; } -#line 2459 "hyp_y.c" /* yacc.c:1646 */ +#line 2466 "hyp_y.c" /* yacc.c:1652 */ break; case 225: -#line 536 "hyp_y.y" /* yacc.c:1646 */ +#line 536 "hyp_y.y" /* yacc.c:1652 */ { h.pin_reference = yylval.strval; h.pin_reference_set = pcb_true; } -#line 2465 "hyp_y.c" /* yacc.c:1646 */ +#line 2472 "hyp_y.c" /* yacc.c:1652 */ break; case 226: -#line 539 "hyp_y.y" /* yacc.c:1646 */ +#line 539 "hyp_y.y" /* yacc.c:1652 */ { h.pin_function = PIN_SIM_OUT; h.pin_function_set = pcb_true; } -#line 2471 "hyp_y.c" /* yacc.c:1646 */ +#line 2478 "hyp_y.c" /* yacc.c:1652 */ break; case 227: -#line 540 "hyp_y.y" /* yacc.c:1646 */ +#line 540 "hyp_y.y" /* yacc.c:1652 */ { h.pin_function = PIN_SIM_IN; h.pin_function_set = pcb_true; } -#line 2477 "hyp_y.c" /* yacc.c:1646 */ +#line 2484 "hyp_y.c" /* yacc.c:1652 */ break; case 228: -#line 541 "hyp_y.y" /* yacc.c:1646 */ +#line 541 "hyp_y.y" /* yacc.c:1652 */ { h.pin_function = PIN_SIM_BOTH; h.pin_function_set = pcb_true; } -#line 2483 "hyp_y.c" /* yacc.c:1646 */ +#line 2490 "hyp_y.c" /* yacc.c:1652 */ break; case 229: -#line 542 "hyp_y.y" /* yacc.c:1646 */ +#line 542 "hyp_y.y" /* yacc.c:1652 */ { h.pin_function = PIN_SIM_BOTH; h.pin_function_set = pcb_true; hyyerror("warning: SIM_BOTH assumed"); } -#line 2489 "hyp_y.c" /* yacc.c:1646 */ +#line 2496 "hyp_y.c" /* yacc.c:1652 */ break; case 230: -#line 546 "hyp_y.y" /* yacc.c:1646 */ +#line 546 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 2495 "hyp_y.c" /* yacc.c:1646 */ +#line 2502 "hyp_y.c" /* yacc.c:1652 */ break; case 231: -#line 546 "hyp_y.y" /* yacc.c:1646 */ +#line 546 "hyp_y.y" /* yacc.c:1652 */ { if (exec_pad(&h)) YYERROR; } -#line 2501 "hyp_y.c" /* yacc.c:1646 */ +#line 2508 "hyp_y.c" /* yacc.c:1652 */ break; case 235: -#line 555 "hyp_y.y" /* yacc.c:1646 */ +#line 555 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad_shape = yylval.strval; h.via_pad_shape_set = pcb_true; } -#line 2507 "hyp_y.c" /* yacc.c:1646 */ +#line 2514 "hyp_y.c" /* yacc.c:1652 */ break; case 236: -#line 556 "hyp_y.y" /* yacc.c:1646 */ +#line 556 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad_sx = yylval.floatval; h.via_pad_sx_set = pcb_true; } -#line 2513 "hyp_y.c" /* yacc.c:1646 */ +#line 2520 "hyp_y.c" /* yacc.c:1652 */ break; case 237: -#line 557 "hyp_y.y" /* yacc.c:1646 */ +#line 557 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad_sy = yylval.floatval; h.via_pad_sy_set = pcb_true; } -#line 2519 "hyp_y.c" /* yacc.c:1646 */ +#line 2526 "hyp_y.c" /* yacc.c:1652 */ break; case 238: -#line 558 "hyp_y.y" /* yacc.c:1646 */ +#line 558 "hyp_y.y" /* yacc.c:1652 */ { h.via_pad_angle = yylval.floatval; h.via_pad_angle_set = pcb_true; } -#line 2525 "hyp_y.c" /* yacc.c:1646 */ +#line 2532 "hyp_y.c" /* yacc.c:1652 */ break; case 239: -#line 562 "hyp_y.y" /* yacc.c:1646 */ +#line 562 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 2531 "hyp_y.c" /* yacc.c:1646 */ +#line 2538 "hyp_y.c" /* yacc.c:1652 */ break; case 240: -#line 562 "hyp_y.y" /* yacc.c:1646 */ +#line 562 "hyp_y.y" /* yacc.c:1652 */ { if (exec_useg(&h)) YYERROR; } -#line 2537 "hyp_y.c" /* yacc.c:1646 */ +#line 2544 "hyp_y.c" /* yacc.c:1652 */ break; case 243: -#line 570 "hyp_y.y" /* yacc.c:1646 */ +#line 570 "hyp_y.y" /* yacc.c:1652 */ { h.zlayer_name = yylval.strval; h.zlayer_name_set = pcb_true; } -#line 2543 "hyp_y.c" /* yacc.c:1646 */ +#line 2550 "hyp_y.c" /* yacc.c:1652 */ break; case 244: -#line 571 "hyp_y.y" /* yacc.c:1646 */ +#line 571 "hyp_y.y" /* yacc.c:1652 */ { h.width = yylval.floatval; } -#line 2549 "hyp_y.c" /* yacc.c:1646 */ +#line 2556 "hyp_y.c" /* yacc.c:1652 */ break; case 245: -#line 572 "hyp_y.y" /* yacc.c:1646 */ +#line 572 "hyp_y.y" /* yacc.c:1652 */ { h.length = yylval.floatval; } -#line 2555 "hyp_y.c" /* yacc.c:1646 */ +#line 2562 "hyp_y.c" /* yacc.c:1652 */ break; case 247: -#line 577 "hyp_y.y" /* yacc.c:1646 */ +#line 577 "hyp_y.y" /* yacc.c:1652 */ { h.impedance = yylval.floatval; h.impedance_set = pcb_true; } -#line 2561 "hyp_y.c" /* yacc.c:1646 */ +#line 2568 "hyp_y.c" /* yacc.c:1652 */ break; case 248: -#line 578 "hyp_y.y" /* yacc.c:1646 */ +#line 578 "hyp_y.y" /* yacc.c:1652 */ { h.delay = yylval.floatval; } -#line 2567 "hyp_y.c" /* yacc.c:1646 */ +#line 2574 "hyp_y.c" /* yacc.c:1652 */ break; case 250: -#line 582 "hyp_y.y" /* yacc.c:1646 */ +#line 582 "hyp_y.y" /* yacc.c:1652 */ { h.resistance = yylval.floatval; h.resistance_set = pcb_true;} -#line 2573 "hyp_y.c" /* yacc.c:1646 */ +#line 2580 "hyp_y.c" /* yacc.c:1652 */ break; case 253: -#line 588 "hyp_y.y" /* yacc.c:1646 */ +#line 588 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 2579 "hyp_y.c" /* yacc.c:1646 */ +#line 2586 "hyp_y.c" /* yacc.c:1652 */ break; case 254: -#line 588 "hyp_y.y" /* yacc.c:1646 */ +#line 588 "hyp_y.y" /* yacc.c:1652 */ { if (exec_polygon_begin(&h)) YYERROR; } -#line 2585 "hyp_y.c" /* yacc.c:1646 */ +#line 2592 "hyp_y.c" /* yacc.c:1652 */ break; case 255: -#line 589 "hyp_y.y" /* yacc.c:1646 */ +#line 589 "hyp_y.y" /* yacc.c:1652 */ { if (exec_polygon_end(&h)) YYERROR; } -#line 2591 "hyp_y.c" /* yacc.c:1646 */ +#line 2598 "hyp_y.c" /* yacc.c:1652 */ break; case 262: -#line 604 "hyp_y.y" /* yacc.c:1646 */ +#line 604 "hyp_y.y" /* yacc.c:1652 */ { h.id = yylval.intval; h.id_set = pcb_true; } -#line 2597 "hyp_y.c" /* yacc.c:1646 */ +#line 2604 "hyp_y.c" /* yacc.c:1652 */ break; case 263: -#line 608 "hyp_y.y" /* yacc.c:1646 */ +#line 608 "hyp_y.y" /* yacc.c:1652 */ { h.polygon_type = POLYGON_TYPE_POUR; h.polygon_type_set = pcb_true; } -#line 2603 "hyp_y.c" /* yacc.c:1646 */ +#line 2610 "hyp_y.c" /* yacc.c:1652 */ break; case 264: -#line 609 "hyp_y.y" /* yacc.c:1646 */ +#line 609 "hyp_y.y" /* yacc.c:1652 */ { h.polygon_type = POLYGON_TYPE_PLANE; h.polygon_type_set = pcb_true; } -#line 2609 "hyp_y.c" /* yacc.c:1646 */ +#line 2616 "hyp_y.c" /* yacc.c:1652 */ break; case 265: -#line 610 "hyp_y.y" /* yacc.c:1646 */ +#line 610 "hyp_y.y" /* yacc.c:1652 */ { h.polygon_type = POLYGON_TYPE_COPPER; h.polygon_type_set = pcb_true; } -#line 2615 "hyp_y.c" /* yacc.c:1646 */ +#line 2622 "hyp_y.c" /* yacc.c:1652 */ break; case 266: -#line 614 "hyp_y.y" /* yacc.c:1646 */ +#line 614 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 2621 "hyp_y.c" /* yacc.c:1646 */ +#line 2628 "hyp_y.c" /* yacc.c:1652 */ break; case 267: -#line 614 "hyp_y.y" /* yacc.c:1646 */ +#line 614 "hyp_y.y" /* yacc.c:1652 */ { if (exec_polyvoid_begin(&h)) YYERROR; } -#line 2627 "hyp_y.c" /* yacc.c:1646 */ +#line 2634 "hyp_y.c" /* yacc.c:1652 */ break; case 268: -#line 615 "hyp_y.y" /* yacc.c:1646 */ +#line 615 "hyp_y.y" /* yacc.c:1652 */ { if (exec_polyvoid_end(&h)) YYERROR; } -#line 2633 "hyp_y.c" /* yacc.c:1646 */ +#line 2640 "hyp_y.c" /* yacc.c:1652 */ break; case 269: -#line 618 "hyp_y.y" /* yacc.c:1646 */ +#line 618 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 2639 "hyp_y.c" /* yacc.c:1646 */ +#line 2646 "hyp_y.c" /* yacc.c:1652 */ break; case 270: -#line 618 "hyp_y.y" /* yacc.c:1646 */ +#line 618 "hyp_y.y" /* yacc.c:1652 */ { if (exec_polyline_begin(&h)) YYERROR; } -#line 2645 "hyp_y.c" /* yacc.c:1646 */ +#line 2652 "hyp_y.c" /* yacc.c:1652 */ break; case 271: -#line 619 "hyp_y.y" /* yacc.c:1646 */ +#line 619 "hyp_y.y" /* yacc.c:1652 */ { if (exec_polyline_end(&h)) YYERROR; } -#line 2651 "hyp_y.c" /* yacc.c:1646 */ +#line 2658 "hyp_y.c" /* yacc.c:1652 */ break; case 276: -#line 629 "hyp_y.y" /* yacc.c:1646 */ +#line 629 "hyp_y.y" /* yacc.c:1652 */ { hyyerror("warning: unexpected ')'"); } -#line 2657 "hyp_y.c" /* yacc.c:1646 */ +#line 2664 "hyp_y.c" /* yacc.c:1652 */ break; case 278: -#line 634 "hyp_y.y" /* yacc.c:1646 */ +#line 634 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 2663 "hyp_y.c" /* yacc.c:1646 */ +#line 2670 "hyp_y.c" /* yacc.c:1652 */ break; case 279: -#line 634 "hyp_y.y" /* yacc.c:1646 */ +#line 634 "hyp_y.y" /* yacc.c:1652 */ { if (exec_line(&h)) YYERROR; } -#line 2669 "hyp_y.c" /* yacc.c:1646 */ +#line 2676 "hyp_y.c" /* yacc.c:1652 */ break; case 280: -#line 637 "hyp_y.y" /* yacc.c:1646 */ +#line 637 "hyp_y.y" /* yacc.c:1652 */ { new_record(); } -#line 2675 "hyp_y.c" /* yacc.c:1646 */ +#line 2682 "hyp_y.c" /* yacc.c:1652 */ break; case 281: -#line 637 "hyp_y.y" /* yacc.c:1646 */ +#line 637 "hyp_y.y" /* yacc.c:1652 */ { if (exec_curve(&h)) YYERROR; } -#line 2681 "hyp_y.c" /* yacc.c:1646 */ +#line 2688 "hyp_y.c" /* yacc.c:1652 */ break; case 282: -#line 640 "hyp_y.y" /* yacc.c:1646 */ +#line 640 "hyp_y.y" /* yacc.c:1652 */ { h.name = yylval.strval; } -#line 2687 "hyp_y.c" /* yacc.c:1646 */ +#line 2694 "hyp_y.c" /* yacc.c:1652 */ break; case 283: -#line 640 "hyp_y.y" /* yacc.c:1646 */ +#line 640 "hyp_y.y" /* yacc.c:1652 */ { h.value = yylval.strval; } -#line 2693 "hyp_y.c" /* yacc.c:1646 */ +#line 2700 "hyp_y.c" /* yacc.c:1652 */ break; case 284: -#line 640 "hyp_y.y" /* yacc.c:1646 */ +#line 640 "hyp_y.y" /* yacc.c:1652 */ { if (exec_net_attribute(&h)) YYERROR; } -#line 2699 "hyp_y.c" /* yacc.c:1646 */ +#line 2706 "hyp_y.c" /* yacc.c:1652 */ break; case 285: -#line 645 "hyp_y.y" /* yacc.c:1646 */ +#line 645 "hyp_y.y" /* yacc.c:1652 */ { h.net_class_name = yylval.strval; if (exec_net_class(&h)) YYERROR; } -#line 2705 "hyp_y.c" /* yacc.c:1646 */ +#line 2712 "hyp_y.c" /* yacc.c:1652 */ break; case 294: -#line 664 "hyp_y.y" /* yacc.c:1646 */ +#line 664 "hyp_y.y" /* yacc.c:1652 */ { h.net_name = yylval.strval; } -#line 2711 "hyp_y.c" /* yacc.c:1646 */ +#line 2718 "hyp_y.c" /* yacc.c:1652 */ break; case 295: -#line 664 "hyp_y.y" /* yacc.c:1646 */ +#line 664 "hyp_y.y" /* yacc.c:1652 */ { if (exec_net_class_element(&h)) YYERROR; } -#line 2717 "hyp_y.c" /* yacc.c:1646 */ +#line 2724 "hyp_y.c" /* yacc.c:1652 */ break; case 296: -#line 667 "hyp_y.y" /* yacc.c:1646 */ +#line 667 "hyp_y.y" /* yacc.c:1652 */ { h.name = yylval.strval; } -#line 2723 "hyp_y.c" /* yacc.c:1646 */ +#line 2730 "hyp_y.c" /* yacc.c:1652 */ break; case 297: -#line 667 "hyp_y.y" /* yacc.c:1646 */ +#line 667 "hyp_y.y" /* yacc.c:1652 */ { h.value = yylval.strval; } -#line 2729 "hyp_y.c" /* yacc.c:1646 */ +#line 2736 "hyp_y.c" /* yacc.c:1652 */ break; case 298: -#line 667 "hyp_y.y" /* yacc.c:1646 */ +#line 667 "hyp_y.y" /* yacc.c:1652 */ { if (exec_net_class_attribute(&h)) YYERROR; } -#line 2735 "hyp_y.c" /* yacc.c:1646 */ +#line 2742 "hyp_y.c" /* yacc.c:1652 */ break; case 299: -#line 672 "hyp_y.y" /* yacc.c:1646 */ +#line 672 "hyp_y.y" /* yacc.c:1652 */ { if (exec_end(&h)) YYERROR; } -#line 2741 "hyp_y.c" /* yacc.c:1646 */ +#line 2748 "hyp_y.c" /* yacc.c:1652 */ break; case 300: -#line 677 "hyp_y.y" /* yacc.c:1646 */ +#line 677 "hyp_y.y" /* yacc.c:1652 */ { h.key = yylval.strval; } -#line 2747 "hyp_y.c" /* yacc.c:1646 */ +#line 2754 "hyp_y.c" /* yacc.c:1652 */ break; case 301: -#line 677 "hyp_y.y" /* yacc.c:1646 */ +#line 677 "hyp_y.y" /* yacc.c:1652 */ { if (exec_key(&h)) YYERROR; } -#line 2753 "hyp_y.c" /* yacc.c:1646 */ +#line 2760 "hyp_y.c" /* yacc.c:1652 */ break; case 302: -#line 682 "hyp_y.y" /* yacc.c:1646 */ +#line 682 "hyp_y.y" /* yacc.c:1652 */ { h.x = yylval.floatval; } -#line 2759 "hyp_y.c" /* yacc.c:1646 */ +#line 2766 "hyp_y.c" /* yacc.c:1652 */ break; case 303: -#line 682 "hyp_y.y" /* yacc.c:1646 */ +#line 682 "hyp_y.y" /* yacc.c:1652 */ { h.y = yylval.floatval; } -#line 2765 "hyp_y.c" /* yacc.c:1646 */ +#line 2772 "hyp_y.c" /* yacc.c:1652 */ break; case 304: -#line 685 "hyp_y.y" /* yacc.c:1646 */ +#line 685 "hyp_y.y" /* yacc.c:1652 */ { h.x1 = yylval.floatval; } -#line 2771 "hyp_y.c" /* yacc.c:1646 */ +#line 2778 "hyp_y.c" /* yacc.c:1652 */ break; case 305: -#line 685 "hyp_y.y" /* yacc.c:1646 */ +#line 685 "hyp_y.y" /* yacc.c:1652 */ { h.y1 = yylval.floatval; } -#line 2777 "hyp_y.c" /* yacc.c:1646 */ +#line 2784 "hyp_y.c" /* yacc.c:1652 */ break; case 306: -#line 688 "hyp_y.y" /* yacc.c:1646 */ +#line 688 "hyp_y.y" /* yacc.c:1652 */ { h.x2 = yylval.floatval; } -#line 2783 "hyp_y.c" /* yacc.c:1646 */ +#line 2790 "hyp_y.c" /* yacc.c:1652 */ break; case 307: -#line 688 "hyp_y.y" /* yacc.c:1646 */ +#line 688 "hyp_y.y" /* yacc.c:1652 */ { h.y2 = yylval.floatval; } -#line 2789 "hyp_y.c" /* yacc.c:1646 */ +#line 2796 "hyp_y.c" /* yacc.c:1652 */ break; case 309: -#line 694 "hyp_y.y" /* yacc.c:1646 */ +#line 694 "hyp_y.y" /* yacc.c:1652 */ { h.xc = yylval.floatval; } -#line 2795 "hyp_y.c" /* yacc.c:1646 */ +#line 2802 "hyp_y.c" /* yacc.c:1652 */ break; case 310: -#line 694 "hyp_y.y" /* yacc.c:1646 */ +#line 694 "hyp_y.y" /* yacc.c:1652 */ { h.yc = yylval.floatval; } -#line 2801 "hyp_y.c" /* yacc.c:1646 */ +#line 2808 "hyp_y.c" /* yacc.c:1652 */ break; case 311: -#line 694 "hyp_y.y" /* yacc.c:1646 */ +#line 694 "hyp_y.y" /* yacc.c:1652 */ { h.r = yylval.floatval; } -#line 2807 "hyp_y.c" /* yacc.c:1646 */ +#line 2814 "hyp_y.c" /* yacc.c:1652 */ break; -#line 2811 "hyp_y.c" /* yacc.c:1646 */ +#line 2818 "hyp_y.c" /* yacc.c:1652 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2832,15 +2839,14 @@ /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - goto yynewstate; @@ -2922,13 +2928,11 @@ | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); @@ -2989,6 +2993,7 @@ yyresult = 0; goto yyreturn; + /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ @@ -2996,6 +3001,7 @@ yyresult = 1; goto yyreturn; + #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | @@ -3006,6 +3012,10 @@ /* Fall through. */ #endif + +/*-----------------------------------------------------. +| yyreturn -- parsing is finished, return the result. | +`-----------------------------------------------------*/ yyreturn: if (yychar != YYEMPTY) { @@ -3035,7 +3045,7 @@ #endif return yyresult; } -#line 696 "hyp_y.y" /* yacc.c:1906 */ +#line 696 "hyp_y.y" /* yacc.c:1918 */ /* Index: trunk/src_plugins/io_hyp/hyp_y.h =================================================================== --- trunk/src_plugins/io_hyp/hyp_y.h (revision 24882) +++ trunk/src_plugins/io_hyp/hyp_y.h (revision 24883) @@ -1,8 +1,9 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ +/* A Bison parser, made by GNU Bison 3.3.2. */ /* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +31,9 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + #ifndef YY_HYY_HYP_Y_H_INCLUDED # define YY_HYY_HYP_Y_H_INCLUDED /* Debug traces. */ @@ -48,11 +52,11 @@ extern int hyydebug; #endif /* "%code requires" blocks. */ -#line 21 "hyp_y.y" /* yacc.c:1909 */ +#line 21 "hyp_y.y" /* yacc.c:1921 */ #include "parser.h" -#line 56 "hyp_y.h" /* yacc.c:1909 */ +#line 60 "hyp_y.h" /* yacc.c:1921 */ /* Token type. */ #ifndef HYYTOKENTYPE @@ -165,10 +169,10 @@ /* Value type. */ #if ! defined HYYSTYPE && ! defined HYYSTYPE_IS_DECLARED -typedef union HYYSTYPE HYYSTYPE; + union HYYSTYPE { -#line 30 "hyp_y.y" /* yacc.c:1909 */ +#line 30 "hyp_y.y" /* yacc.c:1921 */ int boolval; int intval; @@ -175,8 +179,10 @@ double floatval; char* strval; -#line 179 "hyp_y.h" /* yacc.c:1909 */ +#line 183 "hyp_y.h" /* yacc.c:1921 */ }; + +typedef union HYYSTYPE HYYSTYPE; # define HYYSTYPE_IS_TRIVIAL 1 # define HYYSTYPE_IS_DECLARED 1 #endif Index: trunk/src_plugins/io_hyp/parser.c =================================================================== --- trunk/src_plugins/io_hyp/parser.c (revision 24882) +++ trunk/src_plugins/io_hyp/parser.c (revision 24883) @@ -650,11 +650,11 @@ } } - width = max(PCB->MaxWidth, x_max - x_min + slack); - height = max(PCB->MaxHeight, y_max - y_min + slack); + width = max(PCB->hidlib.size_x, x_max - x_min + slack); + height = max(PCB->hidlib.size_y, y_max - y_min + slack); /* resize if board too small */ - if ((width > PCB->MaxWidth) || (height > PCB->MaxHeight)) + if ((width > PCB->hidlib.size_x) || (height > PCB->hidlib.size_y)) pcb_board_resize(width, height); return; Index: trunk/src_plugins/io_hyp/write.c =================================================================== --- trunk/src_plugins/io_hyp/write.c (revision 24882) +++ trunk/src_plugins/io_hyp/write.c (revision 24883) @@ -59,7 +59,7 @@ /* pcb-rnd y-axis points down; hyperlynx y-axis points up */ static pcb_coord_t flip(pcb_coord_t y) { - return (PCB->MaxHeight - y); + return (PCB->hidlib.size_y - y); } static void hyp_grp_init(hyp_wr_t *wr) @@ -371,10 +371,10 @@ if (!has_outline) { /* implicit outline */ fprintf(wr->f, "* implicit outline derived from board width and height\n"); - write_pr_line(wr, 0, 0, PCB->MaxWidth, 0); - write_pr_line(wr, 0, 0, 0, PCB->MaxHeight); - write_pr_line(wr, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight); - write_pr_line(wr, 0, PCB->MaxHeight, PCB->MaxWidth, PCB->MaxHeight); + write_pr_line(wr, 0, 0, PCB->hidlib.size_x, 0); + write_pr_line(wr, 0, 0, 0, PCB->hidlib.size_y); + write_pr_line(wr, PCB->hidlib.size_x, 0, PCB->hidlib.size_x, PCB->hidlib.size_y); + write_pr_line(wr, 0, PCB->hidlib.size_y, PCB->hidlib.size_x, PCB->hidlib.size_y); } else { /* explicit outline */ for(i = 0, g = PCB->LayerGroups.grp; i < PCB->LayerGroups.len; i++,g++) { Index: trunk/src_plugins/io_kicad/read.c =================================================================== --- trunk/src_plugins/io_kicad/read.c (revision 24882) +++ trunk/src_plugins/io_kicad/read.c (revision 24883) @@ -545,8 +545,8 @@ int n; for(n = 0; n < DIM_max; n++) { if (st->dim_valid[n]) { - st->pcb->MaxWidth = st->width[n]; - st->pcb->MaxHeight = st->height[n]; + st->pcb->hidlib.size_x = st->width[n]; + st->pcb->hidlib.size_y = st->height[n]; return 0; } } Index: trunk/src_plugins/io_kicad/write.c =================================================================== --- trunk/src_plugins/io_kicad/write.c (revision 24882) +++ trunk/src_plugins/io_kicad/write.c (revision 24883) @@ -843,22 +843,22 @@ TODO(": rewrite this: rather have a table and a loop that hardwired calculations in code") /* we sort out the needed kicad sheet size here, using A4, A3, A2, A1 or A0 size as needed */ - if (PCB_COORD_TO_MIL(PCB->MaxWidth) > A4WidthMil || PCB_COORD_TO_MIL(PCB->MaxHeight) > A4HeightMil) { + if (PCB_COORD_TO_MIL(PCB->hidlib.size_x) > A4WidthMil || PCB_COORD_TO_MIL(PCB->hidlib.size_y) > A4HeightMil) { sheetHeight = A4WidthMil; /* 11.7" */ sheetWidth = 2 * A4HeightMil; /* 16.5" */ paperSize = 3; /* this is A3 size */ } - if (PCB_COORD_TO_MIL(PCB->MaxWidth) > sheetWidth || PCB_COORD_TO_MIL(PCB->MaxHeight) > sheetHeight) { + if (PCB_COORD_TO_MIL(PCB->hidlib.size_x) > sheetWidth || PCB_COORD_TO_MIL(PCB->hidlib.size_y) > sheetHeight) { sheetHeight = 2 * A4HeightMil; /* 16.5" */ sheetWidth = 2 * A4WidthMil; /* 23.4" */ paperSize = 2; /* this is A2 size */ } - if (PCB_COORD_TO_MIL(PCB->MaxWidth) > sheetWidth || PCB_COORD_TO_MIL(PCB->MaxHeight) > sheetHeight) { + if (PCB_COORD_TO_MIL(PCB->hidlib.size_x) > sheetWidth || PCB_COORD_TO_MIL(PCB->hidlib.size_y) > sheetHeight) { sheetHeight = 2 * A4WidthMil; /* 23.4" */ sheetWidth = 4 * A4HeightMil; /* 33.1" */ paperSize = 1; /* this is A1 size */ } - if (PCB_COORD_TO_MIL(PCB->MaxWidth) > sheetWidth || PCB_COORD_TO_MIL(PCB->MaxHeight) > sheetHeight) { + if (PCB_COORD_TO_MIL(PCB->hidlib.size_x) > sheetWidth || PCB_COORD_TO_MIL(PCB->hidlib.size_y) > sheetHeight) { sheetHeight = 4 * A4HeightMil; /* 33.1" */ sheetWidth = 4 * A4WidthMil; /* 46.8" */ paperSize = 0; /* this is A0 size; where would you get it made ?!?! */ @@ -870,20 +870,20 @@ pcb_coord_t LayoutYOffset; /* we now sort out the offsets for centring the layout in the chosen sheet size here */ - if (sheetWidth > PCB_COORD_TO_MIL(PCB->MaxWidth)) { /* usually A4, bigger if needed */ + if (sheetWidth > PCB_COORD_TO_MIL(PCB->hidlib.size_x)) { /* usually A4, bigger if needed */ /* fprintf(ctx->f, "%d ", sheetWidth); legacy kicad: elements decimils, sheet size mils */ - LayoutXOffset = PCB_MIL_TO_COORD(sheetWidth) / 2 - PCB->MaxWidth / 2; + LayoutXOffset = PCB_MIL_TO_COORD(sheetWidth) / 2 - PCB->hidlib.size_x / 2; } else { /* the layout is bigger than A0; most unlikely, but... */ - /* pcb_fprintf(ctx->f, "%.0ml ", PCB->MaxWidth); */ + /* pcb_fprintf(ctx->f, "%.0ml ", PCB->hidlib.size_x); */ LayoutXOffset = 0; } - if (sheetHeight > PCB_COORD_TO_MIL(PCB->MaxHeight)) { + if (sheetHeight > PCB_COORD_TO_MIL(PCB->hidlib.size_y)) { /* fprintf(ctx->f, "%d", sheetHeight); */ - LayoutYOffset = PCB_MIL_TO_COORD(sheetHeight) / 2 - PCB->MaxHeight / 2; + LayoutYOffset = PCB_MIL_TO_COORD(sheetHeight) / 2 - PCB->hidlib.size_y / 2; } else { /* the layout is bigger than A0; most unlikely, but... */ - /* pcb_fprintf(ctx->f, "%.0ml", PCB->MaxHeight); */ + /* pcb_fprintf(ctx->f, "%.0ml", PCB->hidlib.size_y); */ LayoutYOffset = 0; } @@ -899,21 +899,21 @@ fprintf(ctx->f, "%*s", ind, ""); pcb_fprintf(ctx->f, "(gr_line (start %.3mm %.3mm) (end %.3mm %.3mm) (layer %s) (width %.3mm))\n", ctx->ox, ctx->oy, - ctx->pcb->MaxWidth + ctx->ox, ctx->oy, + ctx->pcb->hidlib.size_x + ctx->ox, ctx->oy, lynam, thick); fprintf(ctx->f, "%*s", ind, ""); pcb_fprintf(ctx->f, "(gr_line (start %.3mm %.3mm) (end %.3mm %.3mm) (layer %s) (width %.3mm))\n", - ctx->pcb->MaxWidth + ctx->ox, ctx->oy, - ctx->pcb->MaxWidth + ctx->ox, ctx->pcb->MaxHeight + ctx->oy, + ctx->pcb->hidlib.size_x + ctx->ox, ctx->oy, + ctx->pcb->hidlib.size_x + ctx->ox, ctx->pcb->hidlib.size_y + ctx->oy, lynam, thick); fprintf(ctx->f, "%*s", ind, ""); pcb_fprintf(ctx->f, "(gr_line (start %.3mm %.3mm) (end %.3mm %.3mm) (layer %s) (width %.3mm))\n", - ctx->pcb->MaxWidth + ctx->ox, ctx->pcb->MaxHeight + ctx->oy, - ctx->ox, ctx->pcb->MaxHeight + ctx->oy, + ctx->pcb->hidlib.size_x + ctx->ox, ctx->pcb->hidlib.size_y + ctx->oy, + ctx->ox, ctx->pcb->hidlib.size_y + ctx->oy, lynam, thick); fprintf(ctx->f, "%*s", ind, ""); pcb_fprintf(ctx->f, "(gr_line (start %.3mm %.3mm) (end %.3mm %.3mm) (layer %s) (width %.3mm))\n", - ctx->ox, ctx->pcb->MaxHeight + ctx->oy, + ctx->ox, ctx->pcb->hidlib.size_y + ctx->oy, ctx->ox, ctx->oy, lynam, thick); } Index: trunk/src_plugins/io_kicad_legacy/write.c =================================================================== --- trunk/src_plugins/io_kicad_legacy/write.c (revision 24882) +++ trunk/src_plugins/io_kicad_legacy/write.c (revision 24883) @@ -725,22 +725,22 @@ TODO(": se this from io_kicad, do not duplicate the code here") /* we sort out the needed kicad sheet size here, using A4, A3, A2, A1 or A0 size as needed */ - if (PCB_COORD_TO_MIL(PCB->MaxWidth) > A4WidthMil || PCB_COORD_TO_MIL(PCB->MaxHeight) > A4HeightMil) { + if (PCB_COORD_TO_MIL(PCB->hidlib.size_x) > A4WidthMil || PCB_COORD_TO_MIL(PCB->hidlib.size_y) > A4HeightMil) { sheetHeight = A4WidthMil; /* 11.7" */ sheetWidth = 2 * A4HeightMil; /* 16.5" */ paperSize = 3; /* this is A3 size */ } - if (PCB_COORD_TO_MIL(PCB->MaxWidth) > sheetWidth || PCB_COORD_TO_MIL(PCB->MaxHeight) > sheetHeight) { + if (PCB_COORD_TO_MIL(PCB->hidlib.size_x) > sheetWidth || PCB_COORD_TO_MIL(PCB->hidlib.size_y) > sheetHeight) { sheetHeight = 2 * A4HeightMil; /* 16.5" */ sheetWidth = 2 * A4WidthMil; /* 23.4" */ paperSize = 2; /* this is A2 size */ } - if (PCB_COORD_TO_MIL(PCB->MaxWidth) > sheetWidth || PCB_COORD_TO_MIL(PCB->MaxHeight) > sheetHeight) { + if (PCB_COORD_TO_MIL(PCB->hidlib.size_x) > sheetWidth || PCB_COORD_TO_MIL(PCB->hidlib.size_y) > sheetHeight) { sheetHeight = 2 * A4WidthMil; /* 23.4" */ sheetWidth = 4 * A4HeightMil; /* 33.1" */ paperSize = 1; /* this is A1 size */ } - if (PCB_COORD_TO_MIL(PCB->MaxWidth) > sheetWidth || PCB_COORD_TO_MIL(PCB->MaxHeight) > sheetHeight) { + if (PCB_COORD_TO_MIL(PCB->hidlib.size_x) > sheetWidth || PCB_COORD_TO_MIL(PCB->hidlib.size_y) > sheetHeight) { sheetHeight = 4 * A4HeightMil; /* 33.1" */ sheetWidth = 4 * A4WidthMil; /* 46.8" */ paperSize = 0; /* this is A0 size; where would you get it made ?!?! */ @@ -748,20 +748,20 @@ fprintf(FP, "Sheet A%d ", paperSize); /* we now sort out the offsets for centring the layout in the chosen sheet size here */ - if (sheetWidth > PCB_COORD_TO_MIL(PCB->MaxWidth)) { /* usually A4, bigger if needed */ + if (sheetWidth > PCB_COORD_TO_MIL(PCB->hidlib.size_x)) { /* usually A4, bigger if needed */ fprintf(FP, "%d ", sheetWidth); /* legacy kicad: elements decimils, sheet size mils */ - LayoutXOffset = PCB_MIL_TO_COORD(sheetWidth) / 2 - PCB->MaxWidth / 2; + LayoutXOffset = PCB_MIL_TO_COORD(sheetWidth) / 2 - PCB->hidlib.size_x / 2; } else { /* the layout is bigger than A0; most unlikely, but... */ - pcb_fprintf(FP, "%.0ml ", PCB->MaxWidth); + pcb_fprintf(FP, "%.0ml ", PCB->hidlib.size_x); LayoutXOffset = 0; } - if (sheetHeight > PCB_COORD_TO_MIL(PCB->MaxHeight)) { + if (sheetHeight > PCB_COORD_TO_MIL(PCB->hidlib.size_y)) { fprintf(FP, "%d", sheetHeight); - LayoutYOffset = PCB_MIL_TO_COORD(sheetHeight) / 2 - PCB->MaxHeight / 2; + LayoutYOffset = PCB_MIL_TO_COORD(sheetHeight) / 2 - PCB->hidlib.size_y / 2; } else { /* the layout is bigger than A0; most unlikely, but... */ - pcb_fprintf(FP, "%.0ml", PCB->MaxHeight); + pcb_fprintf(FP, "%.0ml", PCB->hidlib.size_y); LayoutYOffset = 0; } fputs("\n", FP); @@ -872,19 +872,19 @@ } else { /* no outline layer per se, export the board margins instead - obviously some scope to reduce redundant code... */ fputs("$DRAWSEGMENT\n", FP); - pcb_fprintf(FP, "Po 0 %.0mk %.0mk %.0mk %.0mk %.0mk\n", PCB->MaxWidth / 2 - LayoutXOffset, PCB->MaxHeight / 2 - LayoutYOffset, PCB->MaxWidth / 2 + LayoutXOffset, PCB->MaxHeight / 2 - LayoutYOffset, outlineThickness); + pcb_fprintf(FP, "Po 0 %.0mk %.0mk %.0mk %.0mk %.0mk\n", PCB->hidlib.size_x / 2 - LayoutXOffset, PCB->hidlib.size_y / 2 - LayoutYOffset, PCB->hidlib.size_x / 2 + LayoutXOffset, PCB->hidlib.size_y / 2 - LayoutYOffset, outlineThickness); pcb_fprintf(FP, "De %d 0 0 0 0\n", currentKicadLayer); fputs("$EndDRAWSEGMENT\n", FP); fputs("$DRAWSEGMENT\n", FP); - pcb_fprintf(FP, "Po 0 %.0mk %.0mk %.0mk %.0mk %.0mk\n", PCB->MaxWidth / 2 + LayoutXOffset, PCB->MaxHeight / 2 - LayoutYOffset, PCB->MaxWidth / 2 + LayoutXOffset, PCB->MaxHeight / 2 + LayoutYOffset, outlineThickness); + pcb_fprintf(FP, "Po 0 %.0mk %.0mk %.0mk %.0mk %.0mk\n", PCB->hidlib.size_x / 2 + LayoutXOffset, PCB->hidlib.size_y / 2 - LayoutYOffset, PCB->hidlib.size_x / 2 + LayoutXOffset, PCB->hidlib.size_y / 2 + LayoutYOffset, outlineThickness); pcb_fprintf(FP, "De %d 0 0 0 0\n", currentKicadLayer); fputs("$EndDRAWSEGMENT\n", FP); fputs("$DRAWSEGMENT\n", FP); - pcb_fprintf(FP, "Po 0 %.0mk %.0mk %.0mk %.0mk %.0mk\n", PCB->MaxWidth / 2 + LayoutXOffset, PCB->MaxHeight / 2 + LayoutYOffset, PCB->MaxWidth / 2 - LayoutXOffset, PCB->MaxHeight / 2 + LayoutYOffset, outlineThickness); + pcb_fprintf(FP, "Po 0 %.0mk %.0mk %.0mk %.0mk %.0mk\n", PCB->hidlib.size_x / 2 + LayoutXOffset, PCB->hidlib.size_y / 2 + LayoutYOffset, PCB->hidlib.size_x / 2 - LayoutXOffset, PCB->hidlib.size_y / 2 + LayoutYOffset, outlineThickness); pcb_fprintf(FP, "De %d 0 0 0 0\n", currentKicadLayer); fputs("$EndDRAWSEGMENT\n", FP); fputs("$DRAWSEGMENT\n", FP); - pcb_fprintf(FP, "Po 0 %.0mk %.0mk %.0mk %.0mk %.0mk\n", PCB->MaxWidth / 2 - LayoutXOffset, PCB->MaxHeight / 2 + LayoutYOffset, PCB->MaxWidth / 2 - LayoutXOffset, PCB->MaxHeight / 2 - LayoutYOffset, outlineThickness); + pcb_fprintf(FP, "Po 0 %.0mk %.0mk %.0mk %.0mk %.0mk\n", PCB->hidlib.size_x / 2 - LayoutXOffset, PCB->hidlib.size_y / 2 + LayoutYOffset, PCB->hidlib.size_x / 2 - LayoutXOffset, PCB->hidlib.size_y / 2 - LayoutYOffset, outlineThickness); pcb_fprintf(FP, "De %d 0 0 0 0\n", currentKicadLayer); fputs("$EndDRAWSEGMENT\n", FP); } Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 24882) +++ trunk/src_plugins/io_lihata/read.c (revision 24883) @@ -419,8 +419,8 @@ grp = lht_dom_hash_get(nd, "size"); if ((grp != NULL) && (grp->type == LHT_HASH)) { - err |= parse_coord(&pcb->MaxWidth, hash_get(grp, "x", 0)); - err |= parse_coord(&pcb->MaxHeight, hash_get(grp, "y", 0)); + err |= parse_coord(&pcb->hidlib.size_x, hash_get(grp, "x", 0)); + err |= parse_coord(&pcb->hidlib.size_y, hash_get(grp, "y", 0)); err |= parse_coord_conf("design/poly_isle_area", hash_get(grp, "isle_area_nm2", 1)); err |= parse_double(&pcb->ThermScale, hash_get(grp, "thermal_scale", 1)); if (err != 0) Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 24882) +++ trunk/src_plugins/io_lihata/write.c (revision 24883) @@ -145,8 +145,8 @@ grp = lht_dom_node_alloc(LHT_HASH, "size"); lht_dom_hash_put(meta, grp); - lht_dom_hash_put(grp, build_textf("x", CFMT, pcb->MaxWidth)); - lht_dom_hash_put(grp, build_textf("y", CFMT, pcb->MaxHeight)); + lht_dom_hash_put(grp, build_textf("x", CFMT, pcb->hidlib.size_x)); + lht_dom_hash_put(grp, build_textf("y", CFMT, pcb->hidlib.size_y)); if (wrver < 5) { lht_dom_hash_put(grp, build_textf("isle_area_nm2", "%f", conf_core.design.poly_isle_area)); } Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 24882) +++ trunk/src_plugins/io_pcb/file.c (revision 24883) @@ -289,7 +289,7 @@ fputs("\nPCB[", FP); pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB->Name)); - pcb_fprintf(FP, " %[0] %[0]]\n\n", PCB->MaxWidth, PCB->MaxHeight); + 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, conf_core.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 */ @@ -759,8 +759,8 @@ pcb_data_bbox(&dbb, yyPCB->Data, pcb_false); pcb_data_normalize_(yyPCB->Data, &dbb); PCB = pcb_save; - yyPCB->MaxWidth = dbb.X2*2; - yyPCB->MaxHeight = dbb.Y2*2; + yyPCB->hidlib.size_x = dbb.X2*2; + yyPCB->hidlib.size_y = dbb.Y2*2; yyPCB->is_footprint = 1; /* opening a footprint: we don't have a layer stack; make sure top and bottom copper exist */ Index: trunk/src_plugins/io_pcb/parse_y.c =================================================================== --- trunk/src_plugins/io_pcb/parse_y.c (revision 24882) +++ trunk/src_plugins/io_pcb/parse_y.c (revision 24883) @@ -1966,8 +1966,8 @@ #line 305 "parse_y.y" /* yacc.c:1652 */ { yyPCB->Name = (yyvsp[-1].string); - yyPCB->MaxWidth = PCB_MAX_COORD; - yyPCB->MaxHeight = PCB_MAX_COORD; + yyPCB->hidlib.size_x = PCB_MAX_COORD; + yyPCB->hidlib.size_y = PCB_MAX_COORD; old_fmt = 1; } #line 1974 "parse_y.c" /* yacc.c:1652 */ @@ -1977,8 +1977,8 @@ #line 312 "parse_y.y" /* yacc.c:1652 */ { yyPCB->Name = (yyvsp[-3].string); - yyPCB->MaxWidth = OU ((yyvsp[-2].measure)); - yyPCB->MaxHeight = OU ((yyvsp[-1].measure)); + yyPCB->hidlib.size_x = OU ((yyvsp[-2].measure)); + yyPCB->hidlib.size_y = OU ((yyvsp[-1].measure)); old_fmt = 1; } #line 1985 "parse_y.c" /* yacc.c:1652 */ @@ -1988,8 +1988,8 @@ #line 319 "parse_y.y" /* yacc.c:1652 */ { yyPCB->Name = (yyvsp[-3].string); - yyPCB->MaxWidth = NU ((yyvsp[-2].measure)); - yyPCB->MaxHeight = NU ((yyvsp[-1].measure)); + yyPCB->hidlib.size_x = NU ((yyvsp[-2].measure)); + yyPCB->hidlib.size_y = NU ((yyvsp[-1].measure)); old_fmt = 0; } #line 1996 "parse_y.c" /* yacc.c:1652 */ Index: trunk/src_plugins/io_pcb/parse_y.y =================================================================== --- trunk/src_plugins/io_pcb/parse_y.y (revision 24882) +++ trunk/src_plugins/io_pcb/parse_y.y (revision 24883) @@ -304,22 +304,22 @@ : T_PCB '(' STRING ')' { yyPCB->Name = $3; - yyPCB->MaxWidth = PCB_MAX_COORD; - yyPCB->MaxHeight = PCB_MAX_COORD; + yyPCB->hidlib.size_x = PCB_MAX_COORD; + yyPCB->hidlib.size_y = PCB_MAX_COORD; old_fmt = 1; } | T_PCB '(' STRING measure measure ')' { yyPCB->Name = $3; - yyPCB->MaxWidth = OU ($4); - yyPCB->MaxHeight = OU ($5); + yyPCB->hidlib.size_x = OU ($4); + yyPCB->hidlib.size_y = OU ($5); old_fmt = 1; } | T_PCB '[' STRING measure measure ']' { yyPCB->Name = $3; - yyPCB->MaxWidth = NU ($4); - yyPCB->MaxHeight = NU ($5); + yyPCB->hidlib.size_x = NU ($4); + yyPCB->hidlib.size_y = NU ($5); old_fmt = 0; } ; Index: trunk/src_plugins/io_tedax/tboard.c =================================================================== --- trunk/src_plugins/io_tedax/tboard.c (revision 24882) +++ trunk/src_plugins/io_tedax/tboard.c (revision 24883) @@ -149,7 +149,7 @@ fprintf(f, "\nbegin board v1 "); tedax_fprint_escape(f, pcb->Name); fputc('\n', f); - pcb_fprintf(f, " drawing_area 0 0 %.06mm %.06mm\n", pcb->MaxWidth, pcb->MaxHeight); + pcb_fprintf(f, " drawing_area 0 0 %.06mm %.06mm\n", pcb->hidlib.size_x, pcb->hidlib.size_y); for(n = 0, a = pcb->Attributes.List; n < pcb->Attributes.Number; n++,a++) { pcb_fprintf(f, " attr "); tedax_fprint_escape(f, a->name); @@ -379,8 +379,8 @@ if (!succ) errexit("Invalid y2 coord in drawing_area\n"); if ((x1 >= x2) || (y1 >= y2)) errexit("Invalid (unordered, negative box) drawing area\n"); if ((x1 < 0) || (y1 < 0)) pcb_message(PCB_MSG_WARNING, "drawing_area starts at negative coords; some objects may not display;\nyou may want to run autocrop()\n"); - PCB->MaxWidth = x2 - x1; - PCB->MaxHeight = y2 - y1; + PCB->hidlib.size_x = x2 - x1; + PCB->hidlib.size_y = y2 - y1; } else if (strcmp(argv[0], "attr") == 0) { reqarg("attr", 3); Index: trunk/src_plugins/lib_gtk_common/ui_zoompan.c =================================================================== --- trunk/src_plugins/lib_gtk_common/ui_zoompan.c (revision 24882) +++ trunk/src_plugins/lib_gtk_common/ui_zoompan.c (revision 24883) @@ -76,8 +76,8 @@ v->y0 = MAX(-v->height, v->y0); if (v->use_max_pcb) { - v->x0 = MIN(v->x0, PCB->MaxWidth); - v->y0 = MIN(v->y0, PCB->MaxHeight); + v->x0 = MIN(v->x0, PCB->hidlib.size_x); + v->y0 = MIN(v->y0, PCB->hidlib.size_y); } else { assert(v->max_width > 0); @@ -211,7 +211,7 @@ void pcb_gtk_zoom_view_fit(pcb_gtk_view_t *v) { pcb_gtk_pan_view_abs(v, SIDE_X(0), SIDE_Y(0), 0, 0); - ghid_zoom_view_abs(v, SIDE_X(0), SIDE_Y(0), MAX(PCB->MaxWidth / v->canvas_width, PCB->MaxHeight / v->canvas_height)); + ghid_zoom_view_abs(v, SIDE_X(0), SIDE_Y(0), MAX(PCB->hidlib.size_x / v->canvas_width, PCB->hidlib.size_y / v->canvas_height)); } static void pcb_gtk_flip_view(pcb_gtk_view_t *v, pcb_coord_t center_x, pcb_coord_t center_y, pcb_bool flip_x, pcb_bool flip_y) Index: trunk/src_plugins/lib_gtk_common/ui_zoompan.h =================================================================== --- trunk/src_plugins/lib_gtk_common/ui_zoompan.h (revision 24882) +++ trunk/src_plugins/lib_gtk_common/ui_zoompan.h (revision 24883) @@ -45,8 +45,8 @@ #define FROM_PCB_UNITS(v) pcb_coord_to_unit(conf_core.editor.grid_unit, v) #define TO_PCB_UNITS(v) pcb_unit_to_coord(conf_core.editor.grid_unit, v) -#define SIDE_X(x) ((conf_core.editor.view.flip_x ? PCB->MaxWidth - (x) : (x))) -#define SIDE_Y(y) ((conf_core.editor.view.flip_y ? PCB->MaxHeight - (y) : (y))) +#define SIDE_X(x) ((conf_core.editor.view.flip_x ? PCB->hidlib.size_x - (x) : (x))) +#define SIDE_Y(y) ((conf_core.editor.view.flip_y ? PCB->hidlib.size_y - (y) : (y))) #define DRAW_X(view, x) (gint)((SIDE_X(x) - (view)->x0) / (view)->coord_per_px) #define DRAW_Y(view, y) (gint)((SIDE_Y(y) - (view)->y0) / (view)->coord_per_px) Index: trunk/src_plugins/lib_gtk_common/wt_preview.c =================================================================== --- trunk/src_plugins/lib_gtk_common/wt_preview.c (revision 24882) +++ trunk/src_plugins/lib_gtk_common/wt_preview.c (revision 24883) @@ -530,10 +530,10 @@ pcb_coord_t tmp; /* just in case the size has changed meanwhile */ - p->view.height = PCB->MaxHeight; - p->view.width = PCB->MaxWidth; - p->view.max_height = PCB->MaxHeight; - p->view.max_width = PCB->MaxWidth; + p->view.height = PCB->hidlib.size_y; + p->view.width = PCB->hidlib.size_x; + p->view.max_height = PCB->hidlib.size_y; + p->view.max_width = PCB->hidlib.size_x; p->view.canvas_width = canvas_width; p->view.canvas_height = canvas_height; Index: trunk/src_plugins/lib_gtk_hid/common.c =================================================================== --- trunk/src_plugins/lib_gtk_hid/common.c (revision 24882) +++ trunk/src_plugins/lib_gtk_hid/common.c (revision 24883) @@ -25,8 +25,8 @@ */ pcb_gtk_zoom_post(&gport->view); - pcb_gtk_zoom_adjustment(gtk_range_get_adjustment(GTK_RANGE(tw->h_range)), gport->view.width, PCB->MaxWidth); - pcb_gtk_zoom_adjustment(gtk_range_get_adjustment(GTK_RANGE(tw->v_range)), gport->view.height, PCB->MaxHeight); + pcb_gtk_zoom_adjustment(gtk_range_get_adjustment(GTK_RANGE(tw->h_range)), gport->view.width, PCB->hidlib.size_x); + pcb_gtk_zoom_adjustment(gtk_range_get_adjustment(GTK_RANGE(tw->v_range)), gport->view.height, PCB->hidlib.size_y); } void ghid_note_event_location(GdkEventButton *ev) Index: trunk/src_plugins/lib_gtk_hid/coord_conv.h =================================================================== --- trunk/src_plugins/lib_gtk_hid/coord_conv.h (revision 24882) +++ trunk/src_plugins/lib_gtk_hid/coord_conv.h (revision 24883) @@ -7,7 +7,7 @@ { double rv; if (conf_core.editor.view.flip_x) - rv = (PCB->MaxWidth - x - gport->view.x0) / gport->view.coord_per_px + 0.5; + rv = (PCB->hidlib.size_x - x - gport->view.x0) / gport->view.coord_per_px + 0.5; else rv = (x - gport->view.x0) / gport->view.coord_per_px + 0.5; return pcb_round(rv); @@ -17,7 +17,7 @@ { double rv; if (conf_core.editor.view.flip_y) - rv = (PCB->MaxHeight - y - gport->view.y0) / gport->view.coord_per_px + 0.5; + rv = (PCB->hidlib.size_y - y - gport->view.y0) / gport->view.coord_per_px + 0.5; else rv = (y - gport->view.y0) / gport->view.coord_per_px + 0.5; return pcb_round(rv); @@ -32,7 +32,7 @@ { double rv; if (conf_core.editor.view.flip_x) - rv = (PCB->MaxWidth - x - gport->view.x0) / gport->view.coord_per_px; + rv = (PCB->hidlib.size_x - x - gport->view.x0) / gport->view.coord_per_px; else rv = (x - gport->view.x0) / gport->view.coord_per_px; return rv; @@ -42,7 +42,7 @@ { double rv; if (conf_core.editor.view.flip_y) - rv = (PCB->MaxHeight - y - gport->view.y0) / gport->view.coord_per_px; + rv = (PCB->hidlib.size_y - y - gport->view.y0) / gport->view.coord_per_px; else rv = (y - gport->view.y0) / gport->view.coord_per_px; return rv; @@ -57,7 +57,7 @@ { pcb_coord_t rv = x * gport->view.coord_per_px + gport->view.x0; if (conf_core.editor.view.flip_x) - rv = PCB->MaxWidth - (x * gport->view.coord_per_px + gport->view.x0); + rv = PCB->hidlib.size_x - (x * gport->view.coord_per_px + gport->view.x0); return rv; } @@ -65,7 +65,7 @@ { pcb_coord_t rv = y * gport->view.coord_per_px + gport->view.y0; if (conf_core.editor.view.flip_y) - rv = PCB->MaxHeight - (y * gport->view.coord_per_px + gport->view.y0); + rv = PCB->hidlib.size_y - (y * gport->view.coord_per_px + gport->view.y0); return rv; } Index: trunk/src_plugins/lib_hid_gl/hidgl.c =================================================================== --- trunk/src_plugins/lib_hid_gl/hidgl.c (revision 24882) +++ trunk/src_plugins/lib_hid_gl/hidgl.c (revision 24883) @@ -228,8 +228,8 @@ x1 = pcb_grid_fit(MAX(0, drawn_area->X1), PCB->hidlib.grid, PCB->hidlib.grid_ox); y1 = pcb_grid_fit(MAX(0, drawn_area->Y1), PCB->hidlib.grid, PCB->hidlib.grid_oy); - x2 = pcb_grid_fit(MIN(PCB->MaxWidth, drawn_area->X2), PCB->hidlib.grid, PCB->hidlib.grid_ox); - y2 = pcb_grid_fit(MIN(PCB->MaxHeight, drawn_area->Y2), PCB->hidlib.grid, PCB->hidlib.grid_oy); + x2 = pcb_grid_fit(MIN(PCB->hidlib.size_x, drawn_area->X2), PCB->hidlib.grid, PCB->hidlib.grid_ox); + y2 = pcb_grid_fit(MIN(PCB->hidlib.size_y, drawn_area->Y2), PCB->hidlib.grid, PCB->hidlib.grid_oy); if (x1 > x2) { pcb_coord_t tmp = x1; Index: trunk/src_plugins/lib_polyhelp/topoly.c =================================================================== --- trunk/src_plugins/lib_polyhelp/topoly.c (revision 24882) +++ trunk/src_plugins/lib_polyhelp/topoly.c (revision 24883) @@ -289,7 +289,7 @@ pcb_layer_t *layer; pcb_any_obj_t *best = NULL; pcb_coord_t x, y; - double bestd = (double)pcb->MaxHeight*(double)pcb->MaxHeight + (double)pcb->MaxWidth*(double)pcb->MaxWidth; + double bestd = (double)pcb->hidlib.size_y*(double)pcb->hidlib.size_y + (double)pcb->hidlib.size_x*(double)pcb->hidlib.size_x; for(lid = 0; lid < pcb->Data->LayerN; lid++) { if (!PCB_LAYER_IS_OUTLINE(pcb_layer_flags(PCB, lid), pcb_layer_purpose(PCB, lid, NULL))) Index: trunk/src_plugins/millpath/toolpath.c =================================================================== --- trunk/src_plugins/millpath/toolpath.c (revision 24882) +++ trunk/src_plugins/millpath/toolpath.c (revision 24883) @@ -188,7 +188,7 @@ result->fill = pcb_poly_new_from_rectangle(result->res_ply, otlbb.X1, otlbb.Y1, otlbb.X2, otlbb.Y2, 0, pcb_flag_make(PCB_FLAG_FULLPOLY)); } else - result->fill = pcb_poly_new_from_rectangle(result->res_ply, 0, 0, pcb->MaxWidth, pcb->MaxHeight, 0, pcb_flag_make(PCB_FLAG_FULLPOLY)); + result->fill = pcb_poly_new_from_rectangle(result->res_ply, 0, 0, pcb->hidlib.size_x, pcb->hidlib.size_y, 0, pcb_flag_make(PCB_FLAG_FULLPOLY)); pcb_poly_init_clip(pcb->Data, result->res_ply, result->fill); Index: trunk/src_plugins/propedit/propsel.c =================================================================== --- trunk/src_plugins/propedit/propsel.c (revision 24882) +++ trunk/src_plugins/propedit/propsel.c (revision 24883) @@ -116,8 +116,8 @@ static void map_board(pcb_propedit_t *ctx, pcb_board_t *pcb) { map_add_prop(ctx, "p/board/name", String, pcb->Name); - map_add_prop(ctx, "p/board/width", pcb_coord_t, pcb->MaxWidth); - map_add_prop(ctx, "p/board/height", pcb_coord_t, pcb->MaxHeight); + map_add_prop(ctx, "p/board/width", pcb_coord_t, pcb->hidlib.size_x); + map_add_prop(ctx, "p/board/height", pcb_coord_t, pcb->hidlib.size_y); map_attr(ctx, &pcb->Attributes); } @@ -331,10 +331,10 @@ (pcb_board_change_name(pcb_strdup(st->s)))) DONE; if (st->c_valid && (strcmp(pn, "width") == 0) && - brd_resize(st->c, PCB->MaxHeight)) DONE; + brd_resize(st->c, PCB->hidlib.size_y)) DONE; if (st->c_valid && (strcmp(pn, "height") == 0) && - brd_resize(PCB->MaxWidth,st->c)) DONE; + brd_resize(PCB->hidlib.size_x,st->c)) DONE; } } Index: trunk/src_plugins/shape/shape.c =================================================================== --- trunk/src_plugins/shape/shape.c (revision 24882) +++ trunk/src_plugins/shape/shape.c (revision 24883) @@ -561,7 +561,7 @@ return 0; } - if ((dia < 1) || (dia > (PCB->MaxWidth + PCB->MaxHeight)/4)) { + if ((dia < 1) || (dia > (PCB->hidlib.size_x + PCB->hidlib.size_y)/4)) { pcb_message(PCB_MSG_ERROR, "circle(): invalid diameter\n"); PCB_ACT_IRES(1); return 0; Index: trunk/src_plugins/shape/shape_dialog.c =================================================================== --- trunk/src_plugins/shape/shape_dialog.c (revision 24882) +++ trunk/src_plugins/shape/shape_dialog.c (revision 24883) @@ -103,7 +103,7 @@ ctx_t *shp = caller_data; pcb_coord_t dia = shp->dlg[shp->dia].default_val.coord_value; - if ((dia < 1) || (dia > (PCB->MaxWidth + PCB->MaxHeight)/4)) { + if ((dia < 1) || (dia > (PCB->hidlib.size_x + PCB->hidlib.size_y)/4)) { pcb_message(PCB_MSG_ERROR, "Invalid diameter.\n"); return; } Index: trunk/src_plugins/sketch_route/sketch_route.c =================================================================== --- trunk/src_plugins/sketch_route/sketch_route.c (revision 24882) +++ trunk/src_plugins/sketch_route/sketch_route.c (revision 24883) @@ -695,7 +695,7 @@ char name[256]; sk->cdt = malloc(sizeof(cdt_t)); - cdt_init(sk->cdt, 0, 0, PCB->MaxWidth, -PCB->MaxHeight); + cdt_init(sk->cdt, 0, 0, PCB->hidlib.size_x, -PCB->hidlib.size_y); htpp_init(&sk->terminals, ptrhash, ptrkeyeq); sk->wires.elem_constructor = vtwire_constructor; sk->wires.elem_destructor = vtwire_destructor; @@ -708,7 +708,7 @@ sk->spoke_tree = pcb_r_create_tree(); - bbox.X1 = 0; bbox.Y1 = 0; bbox.X2 = PCB->MaxWidth; bbox.Y2 = PCB->MaxHeight; + bbox.X1 = 0; bbox.Y1 = 0; bbox.X2 = PCB->hidlib.size_x; bbox.Y2 = PCB->hidlib.size_y; info.layer = layer; info.sk = sk; pcb_r_search(PCB->Data->padstack_tree, &bbox, NULL, r_search_cb, &info, NULL); Index: trunk/src_plugins/smartdisperse/smartdisperse.c =================================================================== --- trunk/src_plugins/smartdisperse/smartdisperse.c (revision 24882) +++ trunk/src_plugins/smartdisperse/smartdisperse.c (revision 24883) @@ -65,7 +65,7 @@ dx += PCB->hidlib.grid; /* Figure out if this row has room. If not, start a new row */ - if (minx != GAP && GAP + sc->BoundingBox.X2 + dx > PCB->MaxWidth) { + if (minx != GAP && GAP + sc->BoundingBox.X2 + dx > PCB->hidlib.size_x) { miny = maxy + GAP; minx = GAP; place_subc(sc); /* recurse can't loop, now minx==GAP */ Index: trunk/src_plugins/stroke/stroke.c =================================================================== --- trunk/src_plugins/stroke/stroke.c (revision 24882) +++ trunk/src_plugins/stroke/stroke.c (revision 24883) @@ -47,8 +47,8 @@ conf_stroke_t conf_stroke; -#define SIDE_X(x) ((conf_core.editor.view.flip_x ? PCB->MaxWidth - (x) : (x))) -#define SIDE_Y(y) ((conf_core.editor.view.flip_y ? PCB->MaxHeight - (y) : (y))) +#define SIDE_X(x) ((conf_core.editor.view.flip_x ? PCB->hidlib.size_x - (x) : (x))) +#define SIDE_Y(y) ((conf_core.editor.view.flip_y ? PCB->hidlib.size_y - (y) : (y))) static const char *pcb_stroke_cookie = "stroke plugin";