Index: trunk/src/hid_attrib.c =================================================================== --- trunk/src/hid_attrib.c (revision 26941) +++ trunk/src/hid_attrib.c (revision 26942) @@ -133,7 +133,7 @@ break; case PCB_HATT_COORD: if (a->value) - *(pcb_coord_t *) a->value = a->default_val.coord_value; + *(pcb_coord_t *) a->value = a->default_val.crd; break; case PCB_HATT_BOOL: if (a->value) @@ -190,7 +190,7 @@ if (a->value) *(pcb_coord_t *) a->value = pcb_get_value((*argv)[1], NULL, NULL, NULL); else - a->default_val.coord_value = pcb_get_value((*argv)[1], NULL, NULL, NULL); + a->default_val.crd = pcb_get_value((*argv)[1], NULL, NULL, NULL); (*argc)--; (*argv)++; break; Index: trunk/src/hid_attrib.h =================================================================== --- trunk/src/hid_attrib.h (revision 26941) +++ trunk/src/hid_attrib.h (revision 26942) @@ -13,7 +13,7 @@ long lng; const char *str; double dbl; - pcb_coord_t coord_value; + pcb_coord_t crd; pcb_color_t clr_value; void (*func)(); }; Index: trunk/src/hid_dad.h =================================================================== --- trunk/src/hid_dad.h (revision 26941) +++ trunk/src/hid_dad.h (revision 26942) @@ -483,7 +483,7 @@ table[table ## _len - 1].field.lng = (int)val; \ break; \ case PCB_HATT_COORD: \ - table[table ## _len - 1].field.coord_value = (pcb_coord_t)val; \ + table[table ## _len - 1].field.crd = (pcb_coord_t)val; \ break; \ case PCB_HATT_REAL: \ case PCB_HATT_PROGRESS: \ @@ -525,7 +525,7 @@ table[table ## _len - 1].field.lng = (int)val_; \ break; \ case PCB_HATT_COORD: \ - table[table ## _len - 1].field.coord_value = (pcb_coord_t)val_; \ + table[table ## _len - 1].field.crd = (pcb_coord_t)val_; \ break; \ case PCB_HATT_REAL: \ case PCB_HATT_PROGRESS: \ Index: trunk/src/hid_dad_spin.c =================================================================== --- trunk/src/hid_dad_spin.c (revision 26941) +++ trunk/src/hid_dad_spin.c (revision 26942) @@ -141,7 +141,7 @@ else unit = pcbhl_conf.editor.grid_unit; - pcb_snprintf(su->buf, sizeof(su->buf), "%$m*", unit->suffix, su->end->val.coord_value); + pcb_snprintf(su->buf, sizeof(su->buf), "%$m*", unit->suffix, su->end->val.crd); hv.str = su->buf; pcb_gui->attr_dlg_set_value(hid_ctx, su->wout, &hv); hv.lng = 0; @@ -246,13 +246,13 @@ if (str->val.str != NULL) succ = pcb_get_value_unit(str->val.str, NULL, 0, &v, &unit); if (!succ) { - v = end->val.coord_value; + v = end->val.crd; unit = pcbhl_conf.editor.grid_unit; } } else unit = spin->unit; - v = pcb_coord_to_unit(unit, end->val.coord_value); + v = pcb_coord_to_unit(unit, end->val.crd); step = pow(10, floor(log10(fabs(v)) - 1.0)); if (step <= 0.0) step = 1; @@ -292,9 +292,9 @@ sprintf(buf, "%f", end->val.dbl); break; case PCB_DAD_SPIN_COORD: - end->val.coord_value += step; - SPIN_CLAMP(end->val.coord_value); - gen_str_coord(spin, end->val.coord_value, buf, sizeof(buf)); + end->val.crd += step; + SPIN_CLAMP(end->val.crd); + gen_str_coord(spin, end->val.crd, buf, sizeof(buf)); break; } @@ -368,7 +368,7 @@ warn = "Invalid coord value or unit - result is truncated"; if (!spin->no_unit_chg) spin->unit = unit; - end->val.coord_value = d; + end->val.crd = d; break; default: pcb_trace("INTERNAL ERROR: spin_set_num\n"); } @@ -413,7 +413,7 @@ spin->set_writeback_lock--; succ = pcb_get_value_unit(str->val.str, &absolute, 0, &d, &unit); if (succ) - end->val.coord_value = d; + end->val.crd = d; free(tmp); } break; @@ -473,7 +473,7 @@ str->val.str = pcb_strdup_printf("%f", d); break; case PCB_DAD_SPIN_COORD: - attr->val.coord_value = c; + attr->val.crd = c; spin->unit = NULL; free((char *)str->val.str); str->val.str = gen_str_coord(spin, c, NULL, 0); @@ -522,9 +522,9 @@ end->val.dbl = val->dbl; break; case PCB_DAD_SPIN_COORD: - if (val->coord_value == end->val.coord_value) + if (val->crd == end->val.crd) return 0; - end->val.coord_value = val->coord_value; + end->val.crd = val->crd; break; } do_step(hid_ctx, spin, str, end, 0); /* cheap conversion + error checks */ Index: trunk/src_plugins/ddraft/constraint_gui.c =================================================================== --- trunk/src_plugins/ddraft/constraint_gui.c (revision 26941) +++ trunk/src_plugins/ddraft/constraint_gui.c (revision 26942) @@ -76,7 +76,7 @@ #define c2g_coord(name) \ do { \ - PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.name, coord_value, cons.name); \ + PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.name, crd, cons.name); \ } while(0) /* copy all cons fields into the GUI struct */ @@ -130,12 +130,12 @@ g2c_array(line_angle, strtod(curr, &end)); g2c_scalar(line_angle_mod, dbl); g2c_array(line_length, pcb_get_value(curr, NULL, NULL, &succ)); - g2c_scalar(line_length_mod, coord_value); + g2c_scalar(line_length_mod, crd); g2c_array(move_angle, strtod(curr, &end)); g2c_scalar(move_angle_mod, dbl); g2c_array(move_length, pcb_get_value(curr, NULL, NULL, &succ)); - g2c_scalar(move_length_mod, coord_value); + g2c_scalar(move_length_mod, crd); } static void reset_line(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) @@ -143,7 +143,7 @@ PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.line_angle, str, pcb_strdup("")); PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.line_angle_mod, dbl, 0); PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.line_length, str, pcb_strdup("")); - PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.line_length_mod, coord_value, 0); + PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.line_length_mod, crd, 0); gui2cons(hid_ctx, caller_data, attr); } @@ -152,7 +152,7 @@ PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.move_angle, str, pcb_strdup("")); PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.move_angle_mod, dbl, 0); PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.move_length, str, pcb_strdup("")); - PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.move_length_mod, coord_value, 0); + PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.move_length_mod, crd, 0); gui2cons(hid_ctx, caller_data, attr); } Index: trunk/src_plugins/dialogs/dlg_export.c =================================================================== --- trunk/src_plugins/dialogs/dlg_export.c (revision 26941) +++ trunk/src_plugins/dialogs/dlg_export.c (revision 26942) @@ -200,7 +200,7 @@ case PCB_HATT_COORD: PCB_DAD_COORD(export_ctx.dlg, opts[i].name); PCB_DAD_MINMAX(export_ctx.dlg, opts[i].min_val, opts[i].max_val); - PCB_DAD_DEFAULT_NUM(export_ctx.dlg, opts[i].default_val.coord_value); + PCB_DAD_DEFAULT_NUM(export_ctx.dlg, opts[i].default_val.crd); break; case PCB_HATT_INTEGER: PCB_DAD_INTEGER(export_ctx.dlg, opts[i].name); Index: trunk/src_plugins/dialogs/dlg_lib_pstk.c =================================================================== --- trunk/src_plugins/dialogs/dlg_lib_pstk.c (revision 26941) +++ trunk/src_plugins/dialogs/dlg_lib_pstk.c (revision 26942) @@ -182,7 +182,7 @@ x2 = ctx->drawbox.X2; y2 = ctx->drawbox.Y2; - grid = ctx->dlg[ctx->wgrid].val.coord_value; + grid = ctx->dlg[ctx->wgrid].val.crd; for(x = 0; x < x2; x += grid) pcb_gui->draw_line(gc, x, y1, x, y2); for(x = -grid; x > x1; x -= grid) Index: trunk/src_plugins/dialogs/dlg_library_param.c =================================================================== --- trunk/src_plugins/dialogs/dlg_library_param.c (revision 26941) +++ trunk/src_plugins/dialogs/dlg_library_param.c (revision 26942) @@ -83,7 +83,7 @@ break; case PCB_HATT_COORD: case PCB_HATT_END: /* compound widget for the spinbox! */ - hv.coord_value = pcb_get_value_ex(val, NULL, NULL, NULL, "mil", NULL); + hv.crd = pcb_get_value_ex(val, NULL, NULL, NULL, "mil", NULL); break; default: assert(!"set_attr() can't set non-data field!\n"); @@ -292,7 +292,7 @@ case PCB_HATT_COORD: case PCB_HATT_END: val = buff; - pcb_snprintf(buff, sizeof(buff), "%$$mH", a->val.coord_value); + pcb_snprintf(buff, sizeof(buff), "%$$mH", a->val.crd); break; default:; } Index: trunk/src_plugins/dialogs/dlg_padstack.c =================================================================== --- trunk/src_plugins/dialogs/dlg_padstack.c (revision 26941) +++ trunk/src_plugins/dialogs/dlg_padstack.c (revision 26942) @@ -84,7 +84,7 @@ prn = proto->name; pcb_snprintf(tmp, sizeof(tmp), "#%ld:%d (%s)", (long int)pse->ps->proto, pse->ps->protoi, prn); PCB_DAD_SET_VALUE(hid_ctx, pse->proto_id, str, tmp); - PCB_DAD_SET_VALUE(hid_ctx, pse->clearance, coord_value, pse->ps->Clearance); + PCB_DAD_SET_VALUE(hid_ctx, pse->clearance, crd, pse->ps->Clearance); PCB_DAD_SET_VALUE(hid_ctx, pse->rot, dbl, pse->ps->rot); PCB_DAD_SET_VALUE(hid_ctx, pse->xmirror, lng, pse->ps->xmirror); PCB_DAD_SET_VALUE(hid_ctx, pse->smirror, lng, pse->ps->smirror); @@ -126,12 +126,12 @@ strcpy(tmp, ""); } PCB_DAD_SET_VALUE(hid_ctx, pse->proto_info[n], str, tmp); - PCB_DAD_SET_VALUE(hid_ctx, pse->proto_clr[n], coord_value, shape->clearance); + PCB_DAD_SET_VALUE(hid_ctx, pse->proto_clr[n], crd, shape->clearance); } else { PCB_DAD_SET_VALUE(hid_ctx, pse->proto_shape[n], str, ""); PCB_DAD_SET_VALUE(hid_ctx, pse->proto_info[n], str, ""); - PCB_DAD_SET_VALUE(hid_ctx, pse->proto_clr[n], coord_value, 0); + PCB_DAD_SET_VALUE(hid_ctx, pse->proto_clr[n], crd, 0); } } @@ -170,7 +170,7 @@ free((char *)pse->attrs[pse->prname].val.str); pse->attrs[pse->prname].val.str = NULL; PCB_DAD_SET_VALUE(hid_ctx, pse->prname, str, pcb_strdup(proto->name == NULL ? "" : proto->name)); - PCB_DAD_SET_VALUE(hid_ctx, pse->hdia, coord_value, proto->hdia); + PCB_DAD_SET_VALUE(hid_ctx, pse->hdia, crd, proto->hdia); PCB_DAD_SET_VALUE(hid_ctx, pse->hplated, lng, proto->hplated); PCB_DAD_SET_VALUE(hid_ctx, pse->htop_val, lng, proto->htop); PCB_DAD_SET_VALUE(hid_ctx, pse->hbot_val, lng, proto->hbottom); @@ -261,7 +261,7 @@ sm = pse->attrs[pse->smirror].val.lng; pcb_pstk_change_instance(pse->ps, NULL, - &pse->attrs[pse->clearance].val.coord_value, + &pse->attrs[pse->clearance].val.crd, &pse->attrs[pse->rot].val.dbl, &xm, &sm); pse->attrs[pse->xmirror].val.lng = xm; @@ -315,7 +315,7 @@ if (proto != NULL) { int hp = pse->attrs[pse->hplated].val.lng, ht = pse->attrs[pse->htop_val].val.lng, hb = pse->attrs[pse->hbot_val].val.lng; - pcb_pstk_proto_change_hole(proto, &hp, &pse->attrs[pse->hdia].val.coord_value, &ht, &hb); + pcb_pstk_proto_change_hole(proto, &hp, &pse->attrs[pse->hdia].val.crd, &ht, &hb); pse->attrs[pse->hplated].val.lng = hp; pse->attrs[pse->htop_val].val.lng = ht; pse->attrs[pse->hbot_val].val.lng = hb; @@ -361,7 +361,7 @@ pcb_pstkop_clip(&ctx, pse->ps); for(n = 0; n < proto->tr.used; n++) - pcb_pstk_shape_clr_grow(&proto->tr.array[n].shape[sidx], pcb_true, pse->attrs[pse->proto_clr[idx]].val.coord_value); + pcb_pstk_shape_clr_grow(&proto->tr.array[n].shape[sidx], pcb_true, pse->attrs[pse->proto_clr[idx]].val.crd); ctx.clip.clear = 1; ctx.clip.restore = 0; @@ -521,7 +521,7 @@ pcb_pstk_proto_t *proto = pcb_pstk_get_proto(pse->ps); pcb_pstk_tshape_t *ts = &proto->tr.array[0]; int n, dst_idx = pcb_pstk_get_shape_idx(ts, pcb_proto_layers[pse->editing_shape].mask, pcb_proto_layers[pse->editing_shape].comb); - pcb_coord_t bloat = pse->shape_chg[pse->amount].val.coord_value; + pcb_coord_t bloat = pse->shape_chg[pse->amount].val.crd; if (bloat <= 0) return; @@ -695,7 +695,7 @@ int shape = pse->attrs[pse->gen_shp].val.lng; int expose = pse->attrs[pse->gen_expose].val.lng; int paste = pse->attrs[pse->gen_paste].val.lng; - pcb_coord_t size = pse->attrs[pse->gen_size].val.coord_value; + pcb_coord_t size = pse->attrs[pse->gen_size].val.crd; pcb_layer_type_t lyt = sides_lyt[sides]; pcb_pstk_tshape_t *ts; pcb_cardinal_t pid; @@ -718,7 +718,7 @@ if (lyt & PCB_LYT_BOTTOM) pse_drv_shape(&proto, ts, PCB_LYT_BOTTOM, paste); } - proto.hdia = pse->attrs[pse->gen_drill].val.coord_value; + proto.hdia = pse->attrs[pse->gen_drill].val.crd; proto.hplated = 1; pcb_pstk_proto_update(&proto); Index: trunk/src_plugins/dialogs/dlg_pref.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref.c (revision 26941) +++ trunk/src_plugins/dialogs/dlg_pref.c (revision 26942) @@ -62,7 +62,7 @@ { switch(cn->type) { case CFN_COORD: - PCB_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, item->wid, coord_value, cn->val.coord[0]); + PCB_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, item->wid, crd, cn->val.coord[0]); break; case CFN_BOOLEAN: case CFN_INTEGER: @@ -89,8 +89,8 @@ ctx->conf_lock = item; switch(cn->type) { case CFN_COORD: - if (cn->val.coord[0] != attr->val.coord_value) - conf_setf(ctx->role, item->confpath, -1, "%.8$mm", attr->val.coord_value); + if (cn->val.coord[0] != attr->val.crd) + conf_setf(ctx->role, item->confpath, -1, "%.8$mm", attr->val.crd); break; case CFN_BOOLEAN: case CFN_INTEGER: Index: trunk/src_plugins/dialogs/dlg_pref_confedit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 26941) +++ trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 26942) @@ -74,7 +74,7 @@ pcb_gui->attr_dlg_set_value(ctx->dlg_hid_ctx, ctx->wnewval, &hv); break; case CFN_COORD: - hv.coord_value = pcb_get_value(val, NULL, NULL, NULL); + hv.crd = pcb_get_value(val, NULL, NULL, NULL); pcb_gui->attr_dlg_set_value(ctx->dlg_hid_ctx, ctx->wnewval, &hv); break; case CFN_UNIT: @@ -130,7 +130,7 @@ case CFN_BOOLEAN: case CFN_INTEGER: sprintf(buf, "%ld", attr->val.lng); break; case CFN_REAL: sprintf(buf, "%f", attr->val.dbl); break; - case CFN_COORD: pcb_snprintf(buf, sizeof(buf), "%.08$mH", attr->val.coord_value); break; + case CFN_COORD: pcb_snprintf(buf, sizeof(buf), "%.08$mH", attr->val.crd); break; case CFN_UNIT: if ((attr->val.lng < 0) || (attr->val.lng >= pcb_get_n_units(0))) return; Index: trunk/src_plugins/dialogs/dlg_pref_sizes.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_sizes.c (revision 26941) +++ trunk/src_plugins/dialogs/dlg_pref_sizes.c (revision 26942) @@ -36,8 +36,8 @@ { if (ctx->sizes.lock) return; - 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); + PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->sizes.wwidth, crd, PCB->hidlib.size_x); + PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->sizes.wheight, crd, PCB->hidlib.size_y); } /* Dialog box to actual board size */ @@ -46,8 +46,8 @@ pref_ctx_t *ctx = caller_data; ctx->sizes.lock++; - if ((PCB->hidlib.size_x != ctx->dlg[ctx->sizes.wwidth].val.coord_value) || (PCB->hidlib.size_y != ctx->dlg[ctx->sizes.wheight].val.coord_value)) - pcb_board_resize(ctx->dlg[ctx->sizes.wwidth].val.coord_value, ctx->dlg[ctx->sizes.wheight].val.coord_value); + if ((PCB->hidlib.size_x != ctx->dlg[ctx->sizes.wwidth].val.crd) || (PCB->hidlib.size_y != ctx->dlg[ctx->sizes.wheight].val.crd)) + pcb_board_resize(ctx->dlg[ctx->sizes.wwidth].val.crd, ctx->dlg[ctx->sizes.wheight].val.crd); ctx->sizes.lock--; } Index: trunk/src_plugins/dialogs/dlg_search_edit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_search_edit.c (revision 26941) +++ trunk/src_plugins/dialogs/dlg_search_edit.c (revision 26942) @@ -59,7 +59,7 @@ ctx->se.right = pcb_strdup_printf("%f", attr->val.dbl); break; case RIGHT_COORD: - ctx->se.right = pcb_strdup_printf("%$mm", attr->val.coord_value); + ctx->se.right = pcb_strdup_printf("%$mm", attr->val.crd); break; case RIGHT_CONST: case RIGHT_max: @@ -176,7 +176,7 @@ set_right(ctx, &ctx->dlg[ctx->wright[s->expr->rtype]]); break; case RIGHT_COORD: - hv.coord_value = pcb_get_value_ex(hv.str, NULL, NULL, NULL, "mm", NULL); + hv.crd = pcb_get_value_ex(hv.str, NULL, NULL, NULL, "mm", NULL); pcb_gui->attr_dlg_set_value(ctx->dlg_hid_ctx, ctx->wright[s->expr->rtype], &hv); if (empty) set_right(ctx, &ctx->dlg[ctx->wright[s->expr->rtype]]); Index: trunk/src_plugins/dialogs/dlg_test.c =================================================================== --- trunk/src_plugins/dialogs/dlg_test.c (revision 26941) +++ trunk/src_plugins/dialogs/dlg_test.c (revision 26942) @@ -305,7 +305,7 @@ hv.lng = 42; hv.dbl = 42.0; - hv.coord_value = PCB_MM_TO_COORD(42); + hv.crd = PCB_MM_TO_COORD(42); pcb_gui->attr_dlg_set_value(hid_ctx, ctx->wspin_int, &hv); pcb_gui->attr_dlg_set_value(hid_ctx, ctx->wspin_double, &hv); @@ -324,7 +324,7 @@ pcb_gui->attr_dlg_set_value(hid_ctx, ctx->wspout_int, &hv); sprintf(tmp, "%f", ctx->dlg[ctx->wspin_double].val.dbl); pcb_gui->attr_dlg_set_value(hid_ctx, ctx->wspout_double, &hv); - pcb_snprintf(tmp, sizeof(tmp), "%mm\n%ml", ctx->dlg[ctx->wspin_coord].val.coord_value, ctx->dlg[ctx->wspin_coord].val.coord_value); + pcb_snprintf(tmp, sizeof(tmp), "%mm\n%ml", ctx->dlg[ctx->wspin_coord].val.crd, ctx->dlg[ctx->wspin_coord].val.crd); pcb_gui->attr_dlg_set_value(hid_ctx, ctx->wspout_coord, &hv); } Index: trunk/src_plugins/export_dsn/dsn.c =================================================================== --- trunk/src_plugins/export_dsn/dsn.c (revision 26941) +++ trunk/src_plugins/export_dsn/dsn.c (revision 26942) @@ -581,10 +581,10 @@ if (!dsn_filename) dsn_filename = "pcb-out.dsn"; - trackwidth = options[HA_trackwidth].coord_value; - clearance = options[HA_clearance].coord_value; - viawidth = options[HA_viawidth].coord_value; - viadrill = options[HA_viadrill].coord_value; + trackwidth = options[HA_trackwidth].crd; + clearance = options[HA_clearance].crd; + viawidth = options[HA_viawidth].crd; + viadrill = options[HA_viadrill].crd; PrintSPECCTRA(); } Index: trunk/src_plugins/export_openems/export_openems.c =================================================================== --- trunk/src_plugins/export_openems/export_openems.c (revision 26941) +++ trunk/src_plugins/export_openems/export_openems.c (revision 26942) @@ -166,8 +166,8 @@ pcb_derive_default_filename(PCB->hidlib.filename, &openems_attribute_list[HA_openemsfile], suffix); if (mesh != NULL) { - openems_attribute_list[HA_def_substrate_thick].default_val.coord_value = mesh->def_subs_thick; - openems_attribute_list[HA_def_copper_thick].default_val.coord_value = mesh->def_copper_thick; + openems_attribute_list[HA_def_substrate_thick].default_val.crd = mesh->def_subs_thick; + openems_attribute_list[HA_def_copper_thick].default_val.crd = mesh->def_copper_thick; } TODO(": when export dialogs change into DAD, this hack to convert the strings to allocated ones will not be needed anymore") @@ -252,7 +252,7 @@ if (is_str) pcb_fprintf(ctx->f, "%s", ctx->options[opt].str); else - pcb_fprintf(ctx->f, "%mm", ctx->options[opt].coord_value); + pcb_fprintf(ctx->f, "%mm", ctx->options[opt].crd); } static void openems_write_layers(wctx_t *ctx) Index: trunk/src_plugins/export_openems/mesh.c =================================================================== --- trunk/src_plugins/export_openems/mesh.c (revision 26941) +++ trunk/src_plugins/export_openems/mesh.c (revision 26942) @@ -57,9 +57,9 @@ { int n; PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.pml, lng, mesh.pml); - PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.dens_obj, coord_value, PCB_MM_TO_COORD(0.15)); - PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.dens_gap, coord_value, PCB_MM_TO_COORD(0.5)); - PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.min_space, coord_value, PCB_MM_TO_COORD(0.1)); + PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.dens_obj, crd, PCB_MM_TO_COORD(0.15)); + PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.dens_gap, crd, PCB_MM_TO_COORD(0.5)); + PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.min_space, crd, PCB_MM_TO_COORD(0.1)); PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.smooth, lng, 1); PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.noimpl, lng, 0); PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.hor, lng, 1); @@ -66,13 +66,13 @@ PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.ver, lng, 1); TODO("enum lookup"); PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.subslines, lng, 3); - PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.def_subs_thick, coord_value, PCB_MM_TO_COORD(1.5)); -/* PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.def_copper_thick, coord_value, PCB_MM_TO_COORD(1.5));*/ + PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.def_subs_thick, crd, PCB_MM_TO_COORD(1.5)); +/* PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.def_copper_thick, crd, PCB_MM_TO_COORD(1.5));*/ PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.air_top, lng, 1); PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.air_bot, lng, 1); - PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.dens_air, coord_value, PCB_MM_TO_COORD(0.7)); + PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.dens_air, crd, PCB_MM_TO_COORD(0.7)); PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.smoothz, lng, 1); - PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.max_air, coord_value, PCB_MM_TO_COORD(4)); + PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.max_air, crd, PCB_MM_TO_COORD(4)); for(n = 0; n < 6; n++) { const char **a; int i; @@ -87,9 +87,9 @@ { int n; mesh.pml = ia.dlg[ia.pml].val.lng; - mesh.dens_obj = ia.dlg[ia.dens_obj].val.coord_value; - mesh.dens_gap = ia.dlg[ia.dens_gap].val.coord_value; - mesh.min_space = ia.dlg[ia.min_space].val.coord_value; + mesh.dens_obj = ia.dlg[ia.dens_obj].val.crd; + mesh.dens_gap = ia.dlg[ia.dens_gap].val.crd; + mesh.min_space = ia.dlg[ia.min_space].val.crd; mesh.smooth = ia.dlg[ia.smooth].val.lng; mesh.noimpl = ia.dlg[ia.noimpl].val.lng; mesh.hor = ia.dlg[ia.hor].val.lng; @@ -96,13 +96,13 @@ mesh.ver = ia.dlg[ia.ver].val.lng; TODO("enum lookup"); mesh.subslines = ia.dlg[ia.subslines].val.lng; - mesh.def_subs_thick = ia.dlg[ia.def_subs_thick].val.coord_value; - mesh.def_copper_thick = ia.dlg[ia.def_copper_thick].val.coord_value; + mesh.def_subs_thick = ia.dlg[ia.def_subs_thick].val.crd; + mesh.def_copper_thick = ia.dlg[ia.def_copper_thick].val.crd; mesh.air_top = ia.dlg[ia.air_top].val.lng; mesh.air_bot = ia.dlg[ia.air_top].val.lng; - mesh.dens_air = ia.dlg[ia.dens_air].val.coord_value; + mesh.dens_air = ia.dlg[ia.dens_air].val.crd; mesh.smoothz = ia.dlg[ia.smoothz].val.lng; - mesh.max_air = ia.dlg[ia.max_air].val.coord_value; + mesh.max_air = ia.dlg[ia.max_air].val.crd; for(n = 0; n < 6; n++) mesh.bnd[n] = bnds[ia.dlg[ia.bnd[n]].val.lng]; } @@ -119,7 +119,7 @@ #define SAVE_INT(name) \ pcb_append_printf(dst, "%s " #name" = %d\n", prefix, (int)me->dlg[me->name].val.lng); #define SAVE_COORD(name) \ - pcb_append_printf(dst, "%s " #name" = %.08$$mm\n", prefix, (pcb_coord_t)me->dlg[me->name].val.coord_value); + pcb_append_printf(dst, "%s " #name" = %.08$$mm\n", prefix, (pcb_coord_t)me->dlg[me->name].val.crd); void pcb_mesh_save(const mesh_dlg_t *me, gds_t *dst, const char *prefix) { int n; @@ -205,7 +205,7 @@ pcb_message(PCB_MSG_ERROR, "Invalid mesh coord: " #name "\n"); \ return -1; \ } \ - PCB_DAD_SET_VALUE(me->dlg_hid_ctx, me->name, coord_value, (pcb_coord_t)v); \ + PCB_DAD_SET_VALUE(me->dlg_hid_ctx, me->name, crd, (pcb_coord_t)v); \ } \ } while(0) @@ -654,11 +654,11 @@ if (ia.dlg[ia.air_top].val.lng) { if (ia.dlg[ia.smoothz].val.lng) { - mesh_auto_add_smooth(&mesh->line[PCB_MESH_Z].result, ytop - ia.dlg[ia.max_air].val.coord_value, ytop, - ia.dlg[ia.dens_air].val.coord_value, ia.dlg[ia.dens_air].val.coord_value, top_dens); + mesh_auto_add_smooth(&mesh->line[PCB_MESH_Z].result, ytop - ia.dlg[ia.max_air].val.crd, ytop, + ia.dlg[ia.dens_air].val.crd, ia.dlg[ia.dens_air].val.crd, top_dens); } else { - for(y = ytop; y > ytop - ia.dlg[ia.max_air].val.coord_value ; y -= ia.dlg[ia.dens_air].val.coord_value) + for(y = ytop; y > ytop - ia.dlg[ia.max_air].val.crd ; y -= ia.dlg[ia.dens_air].val.crd) mesh_add_result(mesh, PCB_MESH_Z, y); } } @@ -665,11 +665,11 @@ if (ia.dlg[ia.air_bot].val.lng) { if (ia.dlg[ia.smoothz].val.lng) { - mesh_auto_add_smooth(&mesh->line[PCB_MESH_Z].result, ybottom, ybottom + ia.dlg[ia.max_air].val.coord_value, - bottom_dens, ia.dlg[ia.dens_air].val.coord_value, ia.dlg[ia.dens_air].val.coord_value); + mesh_auto_add_smooth(&mesh->line[PCB_MESH_Z].result, ybottom, ybottom + ia.dlg[ia.max_air].val.crd, + bottom_dens, ia.dlg[ia.dens_air].val.crd, ia.dlg[ia.dens_air].val.crd); } else { - for(y = ybottom; y < ybottom + ia.dlg[ia.max_air].val.coord_value ; y += ia.dlg[ia.dens_air].val.coord_value) + for(y = ybottom; y < ybottom + ia.dlg[ia.max_air].val.crd ; y += ia.dlg[ia.dens_air].val.crd) mesh_add_result(mesh, PCB_MESH_Z, y); } } Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 26941) +++ trunk/src_plugins/export_ps/ps.c (revision 26942) @@ -530,7 +530,7 @@ global.f = the_file; global.drill_helper = options[HA_drillhelper].lng; - global.drill_helper_size = options[HA_drillhelpersize].coord_value; + global.drill_helper_size = options[HA_drillhelpersize].crd; global.align_marks = options[HA_alignmarks].lng; global.outline = options[HA_outline].lng; global.mirror = options[HA_mirror].lng; Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 26941) +++ trunk/src_plugins/hid_lesstif/main.c (revision 26942) @@ -1723,7 +1723,7 @@ r->resource_type = XmStrCast(XtRPCBCoord); r->default_type = XmStrCast(XtRPCBCoord); r->resource_size = sizeof(pcb_coord_t); - r->default_addr = &(a->default_val.coord_value); + r->default_addr = &(a->default_val.crd); rcount++; break; case PCB_HATT_REAL: @@ -1804,7 +1804,7 @@ if (a->value) *(pcb_coord_t *) a->value = v->c; else - a->default_val.coord_value = v->c; + a->default_val.crd = v->c; rcount++; break; case PCB_HATT_BOOL: Index: trunk/src_plugins/lib_hid_common/act_dad.c =================================================================== --- trunk/src_plugins/lib_hid_common/act_dad.c (revision 26941) +++ trunk/src_plugins/lib_hid_common/act_dad.c (revision 26942) @@ -458,7 +458,7 @@ switch(dad->dlg[wid].type) { case PCB_HATT_COORD: PCB_ACT_CONVARG(4, FGW_COORD, dad, c = fgw_coord(&argv[4])); - PCB_DAD_SET_VALUE(dad->dlg_hid_ctx, wid, coord_value, c); + PCB_DAD_SET_VALUE(dad->dlg_hid_ctx, wid, crd, c); break; case PCB_HATT_REAL: case PCB_HATT_PROGRESS: @@ -502,11 +502,11 @@ return FGW_ERR_NOT_FOUND; } res->type = FGW_DOUBLE; - res->val.nat_double = pcb_coord_to_unit(u, dad->dlg[wid].val.coord_value); + res->val.nat_double = pcb_coord_to_unit(u, dad->dlg[wid].val.crd); } else { res->type = FGW_COORD; - fgw_coord(res) = dad->dlg[wid].val.coord_value; + fgw_coord(res) = dad->dlg[wid].val.crd; } break; case PCB_HATT_INTEGER: Index: trunk/src_plugins/lib_hid_pcbui/routest_dlg.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/routest_dlg.c (revision 26941) +++ trunk/src_plugins/lib_hid_pcbui/routest_dlg.c (revision 26942) @@ -76,22 +76,22 @@ hv.str = rst->name; pcb_gui->attr_dlg_set_value(rstdlg_ctx.dlg_hid_ctx, rstdlg_ctx.wname, &hv); - hv.coord_value = rst->Thick; + hv.crd = rst->Thick; pcb_gui->attr_dlg_set_value(rstdlg_ctx.dlg_hid_ctx, rstdlg_ctx.wlineth, &hv); - hv.coord_value = rst->textt; + hv.crd = rst->textt; pcb_gui->attr_dlg_set_value(rstdlg_ctx.dlg_hid_ctx, rstdlg_ctx.wtxtth, &hv); - hv.coord_value = rst->texts; + hv.crd = rst->texts; pcb_gui->attr_dlg_set_value(rstdlg_ctx.dlg_hid_ctx, rstdlg_ctx.wtxtscale, &hv); - hv.coord_value = rst->Clearance; + hv.crd = rst->Clearance; pcb_gui->attr_dlg_set_value(rstdlg_ctx.dlg_hid_ctx, rstdlg_ctx.wclr, &hv); - hv.coord_value = rst->Hole; + hv.crd = rst->Hole; pcb_gui->attr_dlg_set_value(rstdlg_ctx.dlg_hid_ctx, rstdlg_ctx.wviahole, &hv); - hv.coord_value = rst->Diameter; + hv.crd = rst->Diameter; pcb_gui->attr_dlg_set_value(rstdlg_ctx.dlg_hid_ctx, rstdlg_ctx.wviaring, &hv); pcb_dad_tree_clear(tree); @@ -132,17 +132,17 @@ strncpy(rst->name, s, sizeof(rst->name)); } else if (idx == rstdlg_ctx.wlineth) - rst->Thick = attr->val.coord_value; + rst->Thick = attr->val.crd; else if (idx == rstdlg_ctx.wtxtth) - rst->textt = attr->val.coord_value; + rst->textt = attr->val.crd; else if (idx == rstdlg_ctx.wtxtscale) - rst->texts = attr->val.coord_value; + rst->texts = attr->val.crd; else if (idx == rstdlg_ctx.wclr) - rst->Clearance = attr->val.coord_value; + rst->Clearance = attr->val.crd; else if (idx == rstdlg_ctx.wviahole) - rst->Hole = attr->val.coord_value; + rst->Hole = attr->val.crd; else if (idx == rstdlg_ctx.wviaring) - rst->Diameter = attr->val.coord_value; + rst->Diameter = attr->val.crd; else { pcb_message(PCB_MSG_ERROR, "Internal error: route style field does not exist"); return; Index: trunk/src_plugins/lib_polyhelp/polyhelp.c =================================================================== --- trunk/src_plugins/lib_polyhelp/polyhelp.c (revision 26941) +++ trunk/src_plugins/lib_polyhelp/polyhelp.c (revision 26942) @@ -408,7 +408,7 @@ return -1; } - *period = dlg[wspc].val.coord_value; + *period = dlg[wspc].val.crd; if (dlg[wcont].val.lng) *want_contour = 1; *dir = 0; Index: trunk/src_plugins/propedit/propdlg.c =================================================================== --- trunk/src_plugins/propedit/propdlg.c (revision 26941) +++ trunk/src_plugins/propedit/propdlg.c (revision 26942) @@ -223,7 +223,7 @@ memset(&hv, 0, sizeof(hv)); switch(p->type) { case PCB_PROPT_STRING: hv.str = pcb_strdup(pv->string == NULL ? "" : pv->string); break; - case PCB_PROPT_COORD: hv.coord_value = pv->coord; break; + case PCB_PROPT_COORD: hv.crd = pv->coord; break; case PCB_PROPT_ANGLE: hv.dbl = pv->angle; break; case PCB_PROPT_BOOL: case PCB_PROPT_INT: hv.lng = pv->i; break; @@ -322,7 +322,7 @@ sctx.s = ctx->dlg[ctx->wedit[p->type]].val.str; break; case PCB_PROPT_COORD: - sctx.c = ctx->dlg[ctx->wedit[p->type]].val.coord_value; + sctx.c = ctx->dlg[ctx->wedit[p->type]].val.crd; sctx.c_absolute = ctx->dlg[ctx->wabs[p->type]].val.lng; sctx.c_valid = 1; break; Index: trunk/src_plugins/shape/shape_dialog.c =================================================================== --- trunk/src_plugins/shape/shape_dialog.c (revision 26941) +++ trunk/src_plugins/shape/shape_dialog.c (revision 26942) @@ -50,7 +50,7 @@ /* elliptical logics */ if (!shp->dlg[shp->pell].val.lng) { pcb_gui->attr_dlg_widget_state(hid_ctx, shp->pry, pcb_false); - PCB_DAD_SET_VALUE(hid_ctx, shp->pry, coord_value, shp->dlg[shp->prx].val.coord_value); + PCB_DAD_SET_VALUE(hid_ctx, shp->pry, crd, shp->dlg[shp->prx].val.crd); } else pcb_gui->attr_dlg_widget_state(hid_ctx, shp->pry, pcb_true); @@ -58,9 +58,9 @@ del_obj(shp); shp->obj = (pcb_any_obj_t *)regpoly_place( shp->data, shp->layer, shp->dlg[shp->corners].val.lng, - shp->dlg[shp->prx].val.coord_value, shp->dlg[shp->pry].val.coord_value, + shp->dlg[shp->prx].val.crd, shp->dlg[shp->pry].val.crd, shp->dlg[shp->prot].val.dbl, - shp->dlg[shp->pcx].val.coord_value, shp->dlg[shp->pcy].val.coord_value); + shp->dlg[shp->pcx].val.crd, shp->dlg[shp->pcy].val.crd); } static void shp_chg_roundrect(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) @@ -72,7 +72,7 @@ /* elliptical logics */ if (!shp->dlg[shp->rell].val.lng) { pcb_gui->attr_dlg_widget_state(hid_ctx, shp->ry, pcb_false); - PCB_DAD_SET_VALUE(hid_ctx, shp->ry, coord_value, shp->dlg[shp->rx].val.coord_value); + PCB_DAD_SET_VALUE(hid_ctx, shp->ry, crd, shp->dlg[shp->rx].val.crd); } else pcb_gui->attr_dlg_widget_state(hid_ctx, shp->ry, pcb_true); @@ -80,7 +80,7 @@ /* rectangular logics */ if (!shp->dlg[shp->rrect].val.lng) { pcb_gui->attr_dlg_widget_state(hid_ctx, shp->h, pcb_false); - PCB_DAD_SET_VALUE(hid_ctx, shp->h, coord_value, shp->dlg[shp->w].val.coord_value); + PCB_DAD_SET_VALUE(hid_ctx, shp->h, crd, shp->dlg[shp->w].val.crd); } else pcb_gui->attr_dlg_widget_state(hid_ctx, shp->h, pcb_true); @@ -91,10 +91,10 @@ del_obj(shp); shp->obj = (pcb_any_obj_t *)roundrect_place( shp->data, shp->layer, - shp->dlg[shp->w].val.coord_value, shp->dlg[shp->h].val.coord_value, - shp->dlg[shp->rx].val.coord_value, shp->dlg[shp->ry].val.coord_value, + shp->dlg[shp->w].val.crd, shp->dlg[shp->h].val.crd, + shp->dlg[shp->rx].val.crd, shp->dlg[shp->ry].val.crd, shp->dlg[shp->rrot].val.dbl, - shp->dlg[shp->rcx].val.coord_value, shp->dlg[shp->rcy].val.coord_value, + shp->dlg[shp->rcx].val.crd, shp->dlg[shp->rcy].val.crd, corner, shp->dlg[shp->rres].val.dbl); } @@ -101,7 +101,7 @@ static void shp_chg_circle(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { ctx_t *shp = caller_data; - pcb_coord_t dia = shp->dlg[shp->dia].val.coord_value; + pcb_coord_t dia = shp->dlg[shp->dia].val.crd; if ((dia < 1) || (dia > (PCB->hidlib.size_x + PCB->hidlib.size_y)/4)) { pcb_message(PCB_MSG_ERROR, "Invalid diameter.\n"); @@ -111,7 +111,7 @@ shp->obj = (pcb_any_obj_t *)circle_place( shp->data, shp->layer, dia, - shp->dlg[shp->ccx].val.coord_value, shp->dlg[shp->ccy].val.coord_value); + shp->dlg[shp->ccx].val.crd, shp->dlg[shp->ccy].val.crd); } @@ -382,7 +382,7 @@ PCB_DAD_END(shp->dlg); PCB_DAD_NEW("shape", shp->dlg, "dlg_shape", shp, modal, shp_close_cb); - PCB_DAD_SET_VALUE(shp->dlg_hid_ctx, shp->dia, coord_value, PCB_MM_TO_COORD(25.4)); /* suppress a runtime warning on invalid dia (zero) */ + PCB_DAD_SET_VALUE(shp->dlg_hid_ctx, shp->dia, crd, PCB_MM_TO_COORD(25.4)); /* suppress a runtime warning on invalid dia (zero) */ shp_chg_circle(shp->dlg_hid_ctx, shp, NULL); shp_chg_roundrect(shp->dlg_hid_ctx, shp, NULL); shp_chg_regpoly(shp->dlg_hid_ctx, shp, NULL); /* has to be the last */