Index: trunk/src/brave.c =================================================================== --- trunk/src/brave.c (revision 26936) +++ trunk/src/brave.c (revision 26937) @@ -153,7 +153,7 @@ { desc_t *d; for(d = desc; d->name != NULL; d++) - brave_set(d->bit, attrs[d->widget].default_val.int_value); + brave_set(d->bit, attrs[d->widget].val.int_value); } /* If a checkbox changes, do the conversion forth and back to ensure sync */ Index: trunk/src/error.c =================================================================== --- trunk/src/error.c (revision 26936) +++ trunk/src/error.c (revision 26937) @@ -233,7 +233,7 @@ wfmt = PCB_DAD_CURRENT(fmtsub.dlg); fn = pcb_gui->fileselect(pcb_gui, "Export log", NULL, "log.txt", NULL, NULL, "log", PCB_HID_FSD_MAY_NOT_EXIST, &fmtsub); if (fn != NULL) { - ret = pcb_log_export(NULL, fn, (fmtsub.dlg[wfmt].default_val.int_value == 1)); + ret = pcb_log_export(NULL, fn, (fmtsub.dlg[wfmt].val.int_value == 1)); if (ret != 0) pcb_message(PCB_MSG_ERROR, "Failed to export log to '%s'\n", fn); free(fn); Index: trunk/src/hid_attrib.h =================================================================== --- trunk/src/hid_attrib.h (revision 26936) +++ trunk/src/hid_attrib.h (revision 26937) @@ -189,7 +189,7 @@ const char *help_text; pcb_hids_t type; double min_val, max_val; /* for integer and real */ - pcb_hid_attr_val_t default_val; /* Also actual value for global attributes. */ + pcb_hid_attr_val_t val; /* Also actual value for global attributes. */ /* NULL terminated list of values for a PCB_HATT_ENUM; Also (ab)used as (pcb_hid_tree_t *) for a PCB_HATT_TREE and for PCB_HATT_PICTURE & PCB_HATT_PICBUTTON */ Index: trunk/src/hid_dad.h =================================================================== --- trunk/src/hid_dad.h (revision 26936) +++ trunk/src/hid_dad.h (revision 26937) @@ -210,14 +210,14 @@ #define PCB_DAD_BUTTON(table, text) \ do { \ PCB_DAD_ALLOC(table, PCB_HATT_BUTTON); \ - table[table ## _len - 1].default_val.str_value = text; \ + table[table ## _len - 1].val.str_value = text; \ } while(0) #define PCB_DAD_BUTTON_CLOSE(table, text, retval) \ do { \ PCB_DAD_ALLOC(table, PCB_HATT_BUTTON); \ - table[table ## _len - 1].default_val.str_value = text; \ - table[table ## _len - 1].default_val.int_value = retval; \ + table[table ## _len - 1].val.str_value = text; \ + table[table ## _len - 1].val.int_value = retval; \ table[table ## _len - 1].enumerations = (const char **)(&table ## _ret_override); \ PCB_DAD_CHANGE_CB(table, pcb_hid_dad_close_cb); \ } while(0) @@ -298,13 +298,13 @@ #define PCB_DAD_BEGIN_HPANE(table) \ do { \ PCB_DAD_BEGIN(table, PCB_HATT_BEGIN_HPANE); \ - table[table ## _len - 1].default_val.real_value = 0.5; \ + table[table ## _len - 1].val.real_value = 0.5; \ } while(0) #define PCB_DAD_BEGIN_VPANE(table) \ do { \ PCB_DAD_BEGIN(table, PCB_HATT_BEGIN_VPANE); \ - table[table ## _len - 1].default_val.real_value = 0.5; \ + table[table ## _len - 1].val.real_value = 0.5; \ } while(0) #define PCB_DAD_TREE(table, cols, first_col_is_tree, opt_header) \ @@ -353,7 +353,7 @@ table[table ## _len-1].type = __opt__->type; \ table[table ## _len-1].min_val = __opt__->min_val; \ table[table ## _len-1].max_val = __opt__->max_val; \ - table[table ## _len-1].default_val = __opt__->default_val; \ + table[table ## _len-1].val = __opt__->default_val; \ table[table ## _len-1].enumerations = __opt__->enumerations; \ PCB_DAD_UPDATE_INTERNAL(table, table ## _len-1); \ } while(0) @@ -382,7 +382,7 @@ } \ } while(0) -#define PCB_DAD_DEFAULT_PTR(table, val) \ +#define PCB_DAD_DEFAULT_PTR(table, val_) \ do {\ switch(table[table ## _len - 1].type) { \ case PCB_HATT_BEGIN_COMPOUND: \ @@ -390,17 +390,17 @@ { \ pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)table[table ## _len - 1].enumerations; \ if ((cmp != NULL) && (cmp->set_val_ptr != NULL)) \ - cmp->set_val_ptr(&table[table ## _len - 1], (void *)(val)); \ + cmp->set_val_ptr(&table[table ## _len - 1], (void *)(val_)); \ else \ assert(0); \ } \ break; \ default: \ - PCB_DAD_SET_ATTR_FIELD_PTR(table, default_val, val); \ + PCB_DAD_SET_ATTR_FIELD_PTR(table, val, val_); \ } \ } while(0) -#define PCB_DAD_DEFAULT_NUM(table, val) \ +#define PCB_DAD_DEFAULT_NUM(table, val_) \ do {\ switch(table[table ## _len - 1].type) { \ case PCB_HATT_BEGIN_COMPOUND: \ @@ -408,22 +408,22 @@ { \ pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)table[table ## _len - 1].enumerations; \ if ((cmp != NULL) && (cmp->set_val_num != NULL)) \ - cmp->set_val_num(&table[table ## _len - 1], (long)(val), (double)(val), (pcb_coord_t)(val)); \ + cmp->set_val_num(&table[table ## _len - 1], (long)(val_), (double)(val_), (pcb_coord_t)(val_)); \ else \ assert(0); \ } \ break; \ default: \ - PCB_DAD_SET_ATTR_FIELD_NUM(table, default_val, val); \ + PCB_DAD_SET_ATTR_FIELD_NUM(table, val, val_); \ } \ } while(0); /* safe way to call gui->attr_dlg_set_value() - resets the unused fields */ -#define PCB_DAD_SET_VALUE(hid_ctx, wid, field, val) \ +#define PCB_DAD_SET_VALUE(hid_ctx, wid, field, val_) \ do { \ pcb_hid_attr_val_t __val__; \ memset(&__val__, 0, sizeof(__val__)); \ - __val__.field = val; \ + __val__.field = val_; \ pcb_gui->attr_dlg_set_value(hid_ctx, wid, &__val__); \ } while(0) @@ -512,7 +512,7 @@ } \ } while(0) -#define PCB_DAD_SET_ATTR_FIELD_NUM(table, field, val) \ +#define PCB_DAD_SET_ATTR_FIELD_NUM(table, field, val_) \ do { \ switch(table[table ## _len - 1].type) { \ case PCB_HATT_LABEL: \ @@ -522,16 +522,16 @@ case PCB_HATT_BOOL: \ case PCB_HATT_ENUM: \ case PCB_HATT_BEGIN_TABBED: \ - table[table ## _len - 1].field.int_value = (int)val; \ + table[table ## _len - 1].field.int_value = (int)val_; \ break; \ case PCB_HATT_COORD: \ - table[table ## _len - 1].field.coord_value = (pcb_coord_t)val; \ + table[table ## _len - 1].field.coord_value = (pcb_coord_t)val_; \ break; \ case PCB_HATT_REAL: \ case PCB_HATT_PROGRESS: \ case PCB_HATT_BEGIN_HPANE: \ case PCB_HATT_BEGIN_VPANE: \ - table[table ## _len - 1].field.real_value = (double)val; \ + table[table ## _len - 1].field.real_value = (double)val_; \ break; \ case PCB_HATT_STRING: \ case PCB_HATT_TEXT: \ @@ -553,7 +553,7 @@ { \ pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)table[table ## _len - 1].enumerations; \ if ((cmp != NULL) && (cmp->set_field_num != NULL)) \ - cmp->set_field_num(&table[table ## _len - 1], #field, (long)(val), (double)(val), (pcb_coord_t)(val)); \ + cmp->set_field_num(&table[table ## _len - 1], #field, (long)(val_), (double)(val_), (pcb_coord_t)(val_)); \ else \ assert(0); \ } \ @@ -561,7 +561,7 @@ } \ } while(0) -#define PCB_DAD_SET_ATTR_FIELD_PTR(table, field, val) \ +#define PCB_DAD_SET_ATTR_FIELD_PTR(table, field, val_) \ do { \ switch(table[table ## _len - 1].type) { \ case PCB_HATT_LABEL: \ @@ -581,9 +581,9 @@ case PCB_HATT_UNIT: \ { \ int __n__, __v__ = pcb_get_n_units(0); \ - if (val != NULL) { \ + if (val_ != NULL) { \ for(__n__ = 0; __n__ < __v__; __n__++) { \ - if (&pcb_units[__n__] == (pcb_unit_t *)(val)) { \ + if (&pcb_units[__n__] == (pcb_unit_t *)(val_)) { \ table[table ## _len - 1].field.int_value = __n__; \ break; \ } \ @@ -595,10 +595,10 @@ case PCB_HATT_TEXT: \ case PCB_HATT_BUTTON: \ case PCB_HATT_TREE: \ - table[table ## _len - 1].field.str_value = (char *)val; \ + table[table ## _len - 1].field.str_value = (char *)val_; \ break; \ case PCB_HATT_COLOR: \ - table[table ## _len - 1].field.clr_value = *((pcb_color_t *)val); \ + table[table ## _len - 1].field.clr_value = *((pcb_color_t *)val_); \ break; \ case PCB_HATT_BEGIN_HBOX: \ case PCB_HATT_BEGIN_VBOX: \ @@ -612,7 +612,7 @@ { \ pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)table[table ## _len - 1].enumerations; \ if ((cmp != NULL) && (cmp->set_field_ptr != NULL)) \ - cmp->set_field_ptr(&table[table ## _len - 1], #field, (void *)(val)); \ + cmp->set_field_ptr(&table[table ## _len - 1], #field, (void *)(val_)); \ else \ assert(0); \ } \ Index: trunk/src/hid_dad_spin.c =================================================================== --- trunk/src/hid_dad_spin.c (revision 26936) +++ trunk/src/hid_dad_spin.c (revision 26937) @@ -92,7 +92,7 @@ end->changed = 1; /* determine whether textual input is empty and indicate that in the compound end widget */ - s = str->default_val.str_value; + s = str->val.str_value; if (s == NULL) s = ""; while(isspace(*s)) s++; end->empty = (*s == '\0'); @@ -134,14 +134,14 @@ pcb_hid_attr_val_t hv; spin_unit_t *su = (spin_unit_t *)caller_data; const pcb_unit_t *unit; - int unum = su->dlg[su->wunit].default_val.int_value; + int unum = su->dlg[su->wunit].val.int_value; - if ((!su->dlg[su->wglob].default_val.int_value) && (unum >= 0) && (unum < pcb_get_n_units(0))) + if ((!su->dlg[su->wglob].val.int_value) && (unum >= 0) && (unum < pcb_get_n_units(0))) unit = &pcb_units[unum]; else unit = pcbhl_conf.editor.grid_unit; - pcb_snprintf(su->buf, sizeof(su->buf), "%$m*", unit->suffix, su->end->default_val.coord_value); + pcb_snprintf(su->buf, sizeof(su->buf), "%$m*", unit->suffix, su->end->val.coord_value); hv.str_value = su->buf; pcb_gui->attr_dlg_set_value(hid_ctx, su->wout, &hv); hv.int_value = 0; @@ -166,7 +166,7 @@ PCB_DAD_BEGIN_TABLE(ctx.dlg, 2); PCB_DAD_COMPFLAG(ctx.dlg, PCB_HATF_FRAME); PCB_DAD_LABEL(ctx.dlg, "Original:"); - PCB_DAD_LABEL(ctx.dlg, str->default_val.str_value); + PCB_DAD_LABEL(ctx.dlg, str->val.str_value); PCB_DAD_LABEL(ctx.dlg, "With new unit:"); PCB_DAD_LABEL(ctx.dlg, ""); ctx.wout = PCB_DAD_CURRENT(ctx.dlg); @@ -208,14 +208,14 @@ PCB_DAD_AUTORUN("unit", ctx.dlg, "spinbox coord unit change", &ctx, dlgfail); if ((dlgfail == 0) && (ctx.valid)) { pcb_hid_attr_val_t hv; - int unum = ctx.dlg[ctx.wunit].default_val.int_value; + int unum = ctx.dlg[ctx.wunit].val.int_value; - if ((!ctx.dlg[ctx.wglob].default_val.int_value) && (unum >= 0) && (unum < pcb_get_n_units(0))) + if ((!ctx.dlg[ctx.wglob].val.int_value) && (unum >= 0) && (unum < pcb_get_n_units(0))) spin->unit = &pcb_units[unum]; else spin->unit = NULL; - spin->no_unit_chg = ctx.dlg[ctx.wstick].default_val.int_value; + spin->no_unit_chg = ctx.dlg[ctx.wstick].val.int_value; hv.str_value = pcb_strdup(ctx.buf); pcb_gui->attr_dlg_set_value(spin_hid_ctx, spin->wstr, &hv); } @@ -233,26 +233,26 @@ switch(spin->type) { case PCB_DAD_SPIN_INT: - step = pow(10, floor(log10(fabs((double)end->default_val.int_value)) - 1.0)); + step = pow(10, floor(log10(fabs((double)end->val.int_value)) - 1.0)); if (step < 1) step = 1; break; case PCB_DAD_SPIN_DOUBLE: - step = pow(10, floor(log10(fabs((double)end->default_val.real_value)) - 1.0)); + step = pow(10, floor(log10(fabs((double)end->val.real_value)) - 1.0)); break; case PCB_DAD_SPIN_COORD: if (spin->unit == NULL) { pcb_bool succ = 0; - if (str->default_val.str_value != NULL) - succ = pcb_get_value_unit(str->default_val.str_value, NULL, 0, &v, &unit); + if (str->val.str_value != NULL) + succ = pcb_get_value_unit(str->val.str_value, NULL, 0, &v, &unit); if (!succ) { - v = end->default_val.coord_value; + v = end->val.coord_value; unit = pcbhl_conf.editor.grid_unit; } } else unit = spin->unit; - v = pcb_coord_to_unit(unit, end->default_val.coord_value); + v = pcb_coord_to_unit(unit, end->val.coord_value); step = pow(10, floor(log10(fabs(v)) - 1.0)); if (step <= 0.0) step = 1; @@ -282,19 +282,19 @@ switch(spin->type) { case PCB_DAD_SPIN_INT: - end->default_val.int_value += step; - SPIN_CLAMP(end->default_val.int_value); - sprintf(buf, "%d", end->default_val.int_value); + end->val.int_value += step; + SPIN_CLAMP(end->val.int_value); + sprintf(buf, "%d", end->val.int_value); break; case PCB_DAD_SPIN_DOUBLE: - end->default_val.real_value += step; - SPIN_CLAMP(end->default_val.real_value); - sprintf(buf, "%f", end->default_val.real_value); + end->val.real_value += step; + SPIN_CLAMP(end->val.real_value); + sprintf(buf, "%f", end->val.real_value); break; case PCB_DAD_SPIN_COORD: - end->default_val.coord_value += step; - SPIN_CLAMP(end->default_val.coord_value); - gen_str_coord(spin, end->default_val.coord_value, buf, sizeof(buf)); + end->val.coord_value += step; + SPIN_CLAMP(end->val.coord_value); + gen_str_coord(spin, end->val.coord_value, buf, sizeof(buf)); break; } @@ -347,21 +347,21 @@ switch(spin->type) { case PCB_DAD_SPIN_INT: - l = strtol(str->default_val.str_value, &ends, 10); + l = strtol(str->val.str_value, &ends, 10); SPIN_CLAMP(l); if (*ends != '\0') warn = "Invalid integer - result is truncated"; - end->default_val.int_value = l; + end->val.int_value = l; break; case PCB_DAD_SPIN_DOUBLE: - d = strtod(str->default_val.str_value, &ends); + d = strtod(str->val.str_value, &ends); SPIN_CLAMP(d); if (*ends != '\0') warn = "Invalid numeric - result is truncated"; - end->default_val.real_value = d; + end->val.real_value = d; break; case PCB_DAD_SPIN_COORD: - succ = pcb_get_value_unit(str->default_val.str_value, &absolute, 0, &d, &unit); + succ = pcb_get_value_unit(str->val.str_value, &absolute, 0, &d, &unit); if (succ) SPIN_CLAMP(d); else @@ -368,7 +368,7 @@ warn = "Invalid coord value or unit - result is truncated"; if (!spin->no_unit_chg) spin->unit = unit; - end->default_val.coord_value = d; + end->val.coord_value = d; break; default: pcb_trace("INTERNAL ERROR: spin_set_num\n"); } @@ -394,7 +394,7 @@ switch(spin->type) { case PCB_DAD_SPIN_COORD: - inval = str->default_val.str_value; + inval = str->val.str_value; while(isspace(*inval)) inval++; if (*inval == '\0') inval = "0"; @@ -411,9 +411,9 @@ spin->set_writeback_lock++; pcb_gui->attr_dlg_set_value(hid_ctx, spin->wstr, &hv); spin->set_writeback_lock--; - succ = pcb_get_value_unit(str->default_val.str_value, &absolute, 0, &d, &unit); + succ = pcb_get_value_unit(str->val.str_value, &absolute, 0, &d, &unit); if (succ) - end->default_val.coord_value = d; + end->val.coord_value = d; free(tmp); } break; @@ -463,20 +463,20 @@ switch(spin->type) { case PCB_DAD_SPIN_INT: - attr->default_val.int_value = l; - free((char *)str->default_val.str_value); - str->default_val.str_value = pcb_strdup_printf("%ld", l); + attr->val.int_value = l; + free((char *)str->val.str_value); + str->val.str_value = pcb_strdup_printf("%ld", l); break; case PCB_DAD_SPIN_DOUBLE: - attr->default_val.real_value = d; - free((char *)str->default_val.str_value); - str->default_val.str_value = pcb_strdup_printf("%f", d); + attr->val.real_value = d; + free((char *)str->val.str_value); + str->val.str_value = pcb_strdup_printf("%f", d); break; case PCB_DAD_SPIN_COORD: - attr->default_val.coord_value = c; + attr->val.coord_value = c; spin->unit = NULL; - free((char *)str->default_val.str_value); - str->default_val.str_value = gen_str_coord(spin, c, NULL, 0); + free((char *)str->val.str_value); + str->val.str_value = gen_str_coord(spin, c, NULL, 0); break; default: pcb_trace("INTERNAL ERROR: spin_set_num\n"); } @@ -512,19 +512,19 @@ /* do not modify the text field if the value is the same */ switch(spin->type) { case PCB_DAD_SPIN_INT: - if (val->int_value == end->default_val.int_value) + if (val->int_value == end->val.int_value) return 0; - end->default_val.int_value = val->int_value; + end->val.int_value = val->int_value; break; case PCB_DAD_SPIN_DOUBLE: - if (val->real_value == end->default_val.real_value) + if (val->real_value == end->val.real_value) return 0; - end->default_val.real_value = val->real_value; + end->val.real_value = val->real_value; break; case PCB_DAD_SPIN_COORD: - if (val->coord_value == end->default_val.coord_value) + if (val->coord_value == end->val.coord_value) return 0; - end->default_val.coord_value = val->coord_value; + end->val.coord_value = val->coord_value; break; } do_step(hid_ctx, spin, str, end, 0); /* cheap conversion + error checks */ Index: trunk/src/hid_dad_tree.c =================================================================== --- trunk/src/hid_dad_tree.c (revision 26936) +++ trunk/src/hid_dad_tree.c (revision 26937) @@ -97,7 +97,7 @@ void pcb_hid_dad_close_cb(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { pcb_dad_retovr_t **retovr = (pcb_dad_retovr_t **)attr->enumerations; - pcb_hid_dad_close(hid_ctx, *retovr, attr->default_val.int_value); + pcb_hid_dad_close(hid_ctx, *retovr, attr->val.int_value); } int pcb_hid_dad_run(void *hid_ctx, pcb_dad_retovr_t *retovr) Index: trunk/src/hid_dad_unit.c =================================================================== --- trunk/src/hid_dad_unit.c (revision 26936) +++ trunk/src/hid_dad_unit.c (revision 26937) @@ -38,10 +38,10 @@ pcb_hid_dad_unit_t *unit = (pcb_hid_dad_unit_t *)attr->user_data; pcb_hid_attribute_t *enu = attr; pcb_hid_attribute_t *end = attr - unit->wenum + unit->cmp.wend; - const pcb_unit_t *u = get_unit_by_suffix(enu->enumerations[enu->default_val.int_value]); + const pcb_unit_t *u = get_unit_by_suffix(enu->enumerations[enu->val.int_value]); int unit_id = u == NULL ? -1 : u - pcb_units; - end->default_val.int_value = unit_id; + end->val.int_value = unit_id; end->changed = 1; if (end->change_cb != NULL) end->change_cb(hid_ctx, caller_data, end); @@ -56,8 +56,8 @@ for(l = 0; enu->enumerations[l] != NULL; l++) { if (strcmp(target, enu->enumerations[l]) == 0) { - enu->default_val.int_value = l; - attr->default_val.int_value = l; + enu->val.int_value = l; + attr->val.int_value = l; } } } @@ -93,7 +93,7 @@ pcb_hid_dad_unit_t *unit = (pcb_hid_dad_unit_t *)end->enumerations; if (pcb_gui->attr_dlg_set_value(hid_ctx, unit->wenum, val) != 0) return -1; - end->default_val.int_value = val->int_value; + end->val.int_value = val->int_value; return 0; } Index: trunk/src_plugins/cam/cam_gui.c =================================================================== --- trunk/src_plugins/cam/cam_gui.c (revision 26936) +++ trunk/src_plugins/cam/cam_gui.c (revision 26937) @@ -136,7 +136,7 @@ pcb_hid_row_t *r; char *cell[3], *cursor_path = NULL; - cam_parse_opt_outfile(&ctx->cam, ctx->dlg[ctx->woutfile].default_val.str_value); + cam_parse_opt_outfile(&ctx->cam, ctx->dlg[ctx->woutfile].val.str_value); hv.str_value = ctx->cam.prefix == NULL ? "" : ctx->cam.prefix; pcb_gui->attr_dlg_set_value(ctx->dlg_hid_ctx, ctx->wprefix, &hv); @@ -182,7 +182,7 @@ attr = &ctx->dlg[ctx->wjobs]; tree = (pcb_hid_tree_t *)attr->enumerations; - text = attr_inp->default_val.str_value; + text = attr_inp->val.str_value; pcb_dad_tree_hide_all(tree, &tree->rows, 1); pcb_dad_tree_unhide_filter(tree, &tree->rows, 0, text); @@ -196,7 +196,7 @@ pcb_hid_row_t *row = pcb_dad_tree_get_selected(attr); if (row != NULL) { - const char *outfile = ctx->dlg[ctx->woutfile].default_val.str_value; + const char *outfile = ctx->dlg[ctx->woutfile].val.str_value; char *tmp = pcb_strdup_printf("outfile=%s", outfile); pcb_actionl("cam", "call", row->cell[0], tmp, NULL); free(tmp); Index: trunk/src_plugins/ddraft/constraint_gui.c =================================================================== --- trunk/src_plugins/ddraft/constraint_gui.c (revision 26936) +++ trunk/src_plugins/ddraft/constraint_gui.c (revision 26937) @@ -97,7 +97,7 @@ #define g2c_array(name, conv) \ do { \ - const char *inp = cnstgui_ctx.dlg[cnstgui_ctx.name].default_val.str_value; \ + const char *inp = cnstgui_ctx.dlg[cnstgui_ctx.name].val.str_value; \ char *curr, *next; \ cons.name ## _len = 0; \ if (inp == NULL) break; \ @@ -117,7 +117,7 @@ #define g2c_scalar(name, valty) \ do { \ - cons.name = cnstgui_ctx.dlg[cnstgui_ctx.name].default_val.valty; \ + cons.name = cnstgui_ctx.dlg[cnstgui_ctx.name].val.valty; \ } while(0) @@ -189,7 +189,7 @@ return; cnstgui_ctx.inhibit_confchg++; - nv = (cnstgui_ctx.dlg[cnstgui_ctx.alldir].default_val.int_value) ? "1" : "0"; + nv = (cnstgui_ctx.dlg[cnstgui_ctx.alldir].val.int_value) ? "1" : "0"; conf_set(CFR_DESIGN, "editor/all_direction_lines", -1, nv, POL_OVERWRITE); cnstgui_ctx.inhibit_confchg--; } Index: trunk/src_plugins/dialogs/dlg_export.c =================================================================== --- trunk/src_plugins/dialogs/dlg_export.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_export.c (revision 26937) @@ -63,7 +63,7 @@ exp_attr = export_ctx->exp_attr[id]; for(n = 0; n < numo; n++) { int src = exp_attr[n]; - memcpy(&r[n], &(export_ctx->dlg[src].default_val), sizeof(pcb_hid_attr_val_t)); + memcpy(&r[n], &(export_ctx->dlg[src].val), sizeof(pcb_hid_attr_val_t)); } return r; } @@ -112,10 +112,10 @@ for(n = 0; n < ctx->len; n++) { int *exp_attr = export_ctx.exp_attr[n]; int numo = export_ctx.numo[n]; - pcb_export_opt_t *attrs = export_ctx.ea[n]; + pcb_export_opt_t *opts = export_ctx.ea[n]; for(i = 0; i < numo; i++) - memcpy(&attrs[i].default_val, &ctx->dlg[exp_attr[i]].default_val, sizeof(pcb_hid_attr_val_t)); + memcpy(&opts[i].default_val, &ctx->dlg[exp_attr[i]].val, sizeof(pcb_hid_attr_val_t)); } } Index: trunk/src_plugins/dialogs/dlg_flag_edit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_flag_edit.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_flag_edit.c (revision 26937) @@ -58,9 +58,9 @@ for(n = 0; n < ctx->len; n++) { int wid = ctx->wid[n]; - if ((ctx->attrs[wid].default_val.int_value) && (!PCB_FLAG_TEST(ctx->flag_bit[n], ctx->obj))) + if ((ctx->attrs[wid].val.int_value) && (!PCB_FLAG_TEST(ctx->flag_bit[n], ctx->obj))) set |= ctx->flag_bit[n]; - else if (!(ctx->attrs[wid].default_val.int_value) && PCB_FLAG_TEST(ctx->flag_bit[n], ctx->obj)) + else if (!(ctx->attrs[wid].val.int_value) && PCB_FLAG_TEST(ctx->flag_bit[n], ctx->obj)) clr |= ctx->flag_bit[n]; } Index: trunk/src_plugins/dialogs/dlg_layer_binding.c =================================================================== --- trunk/src_plugins/dialogs/dlg_layer_binding.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_layer_binding.c (revision 26937) @@ -115,10 +115,10 @@ #define layer_name_mismatch(w, layer) \ -((ctx->attrs[w->name].default_val.str_value == NULL) || (strcmp(layer->name, ctx->attrs[w->name].default_val.str_value) != 0)) +((ctx->attrs[w->name].val.str_value == NULL) || (strcmp(layer->name, ctx->attrs[w->name].val.str_value) != 0)) #define layer_purpose_mismatch(w, layer) \ -((ctx->attrs[w->purpose].default_val.str_value == NULL) || (layer->meta.bound.purpose == NULL) || (strcmp(layer->meta.bound.purpose, ctx->attrs[w->purpose].default_val.str_value) != 0)) +((ctx->attrs[w->purpose].val.str_value == NULL) || (layer->meta.bound.purpose == NULL) || (strcmp(layer->meta.bound.purpose, ctx->attrs[w->purpose].val.str_value) != 0)) static void lb_data2dialog(void *hid_ctx, lb_ctx_t *ctx) { @@ -193,11 +193,11 @@ if (layer_name_mismatch(w, layer)) { free((char *)layer->name); - layer->name = pcb_strdup(ctx->attrs[w->name].default_val.str_value); + layer->name = pcb_strdup(ctx->attrs[w->name].val.str_value); } if (layer_purpose_mismatch(w, layer)) { - const char *purp = ctx->attrs[w->purpose].default_val.str_value; + const char *purp = ctx->attrs[w->purpose].val.str_value; free((char *)layer->meta.bound.purpose); if ((purp == NULL) || (*purp == '\0')) layer->meta.bound.purpose = NULL; @@ -205,8 +205,8 @@ layer->meta.bound.purpose = pcb_strdup(purp); } - layer->comb = ctx->attrs[w->comp].default_val.int_value; - get_ly_type(ctx->attrs[w->type].default_val.int_value, ctx->attrs[w->side].default_val.int_value, ctx->attrs[w->offs].default_val.int_value, &layer->meta.bound.type, &layer->meta.bound.stack_offs); + layer->comb = ctx->attrs[w->comp].val.int_value; + get_ly_type(ctx->attrs[w->type].val.int_value, ctx->attrs[w->side].val.int_value, ctx->attrs[w->offs].val.int_value, &layer->meta.bound.type, &layer->meta.bound.stack_offs); /* enforce some sanity rules */ if (layer->meta.bound.type & PCB_LYT_BOUNDARY) { Index: trunk/src_plugins/dialogs/dlg_layer_flags.c =================================================================== --- trunk/src_plugins/dialogs/dlg_layer_flags.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_layer_flags.c (revision 26937) @@ -65,20 +65,20 @@ PCB_DAD_END(dlg); - dlg[wname].default_val.str_value = pcb_strdup(ly->name); - dlg[wsub].default_val.int_value = ly->comb & PCB_LYC_SUB; - dlg[wauto].default_val.int_value = ly->comb & PCB_LYC_AUTO; + dlg[wname].val.str_value = pcb_strdup(ly->name); + dlg[wsub].val.int_value = ly->comb & PCB_LYC_SUB; + dlg[wauto].val.int_value = ly->comb & PCB_LYC_AUTO; PCB_DAD_AUTORUN("layer_prop", dlg, "Properties of a logical layer", NULL, failed); if (failed == 0) { pcb_layer_combining_t comb = 0; - if (strcmp(ly->name, dlg[wname].default_val.str_value) != 0) { - ar |= pcb_layer_rename_(ly, (char *)dlg[wname].default_val.str_value); + if (strcmp(ly->name, dlg[wname].val.str_value) != 0) { + ar |= pcb_layer_rename_(ly, (char *)dlg[wname].val.str_value); pcb_board_set_changed_flag(pcb_true); } - if (dlg[wsub].default_val.int_value) comb |= PCB_LYC_SUB; - if (dlg[wauto].default_val.int_value) comb |= PCB_LYC_AUTO; + if (dlg[wsub].val.int_value) comb |= PCB_LYC_SUB; + if (dlg[wauto].val.int_value) comb |= PCB_LYC_AUTO; if (ly->comb != comb) { ly->comb = comb; pcb_board_set_changed_flag(pcb_true); @@ -143,47 +143,47 @@ PCB_DAD_END(dlg); - dlg[wname].default_val.str_value = pcb_strdup(g->name); - dlg[wtype].default_val.int_value = orig_type = pcb_ly_type2enum(g->ltype); - dlg[wpurp].default_val.str_value = pcb_strdup(g->purpose == NULL ? "" : g->purpose); + dlg[wname].val.str_value = pcb_strdup(g->name); + dlg[wtype].val.int_value = orig_type = pcb_ly_type2enum(g->ltype); + dlg[wpurp].val.str_value = pcb_strdup(g->purpose == NULL ? "" : g->purpose); if (!omit_loc) - dlg[wloc].default_val.int_value = def_loc; + dlg[wloc].val.int_value = def_loc; if (!omit_loc) { pcb_layer_type_t loc = g->ltype & PCB_LYT_ANYWHERE; - dlg[wloc].default_val.int_value = 3; + dlg[wloc].val.int_value = 3; if (loc != 0) { for(n = 0; ltypes[n] != NULL; n++) { if ((loc & ltype_bits[n]) == loc) { - dlg[wloc].default_val.int_value = n; + dlg[wloc].val.int_value = n; break; } } } - orig_loc = dlg[wloc].default_val.int_value; + orig_loc = dlg[wloc].val.int_value; } PCB_DAD_AUTORUN("layer_grp_prop", dlg, "Edit the properties of a layer group (physical layer)", NULL, failed); if (failed == 0) { - if (strcmp(g->name, dlg[wname].default_val.str_value) != 0) { - ar |= pcb_layergrp_rename_(g, (char *)dlg[wname].default_val.str_value); - dlg[wname].default_val.str_value = NULL; + if (strcmp(g->name, dlg[wname].val.str_value) != 0) { + ar |= pcb_layergrp_rename_(g, (char *)dlg[wname].val.str_value); + dlg[wname].val.str_value = NULL; pcb_board_set_changed_flag(pcb_true); } - if (dlg[wtype].default_val.int_value != orig_type) { + if (dlg[wtype].val.int_value != orig_type) { pcb_layer_type_t lyt = 0; - pcb_get_ly_type_(dlg[wtype].default_val.int_value, &lyt); + pcb_get_ly_type_(dlg[wtype].val.int_value, &lyt); g->ltype &= ~PCB_LYT_ANYTHING; g->ltype |= lyt; changed = 1; } - if ((!omit_loc) && (dlg[wloc].default_val.int_value != orig_loc)) { + if ((!omit_loc) && (dlg[wloc].val.int_value != orig_loc)) { if (PCB_LAYER_SIDED(g->ltype)) { g->ltype &= ~PCB_LYT_ANYWHERE; - if (dlg[wloc].default_val.int_value >= 0) - g->ltype |= ltype_bits[dlg[wloc].default_val.int_value]; + if (dlg[wloc].val.int_value >= 0) + g->ltype |= ltype_bits[dlg[wloc].val.int_value]; changed = 1; } else @@ -190,17 +190,17 @@ pcb_message(PCB_MSG_ERROR, "Ignoring location - for this layer group type it is determined by the stackup\n"); } - if (dlg[wpurp].default_val.str_value == NULL) { + if (dlg[wpurp].val.str_value == NULL) { if (g->purpose != NULL) { pcb_layergrp_set_purpose__(g, NULL); changed = 1; } } - else if ((g->purpose == NULL) || (strcmp(g->purpose, dlg[wpurp].default_val.str_value) != 0)) { - if (*dlg[wpurp].default_val.str_value == '\0') + else if ((g->purpose == NULL) || (strcmp(g->purpose, dlg[wpurp].val.str_value) != 0)) { + if (*dlg[wpurp].val.str_value == '\0') pcb_layergrp_set_purpose__(g, NULL); else - pcb_layergrp_set_purpose__(g, pcb_strdup(dlg[wpurp].default_val.str_value)); + pcb_layergrp_set_purpose__(g, pcb_strdup(dlg[wpurp].val.str_value)); changed = 1; } Index: trunk/src_plugins/dialogs/dlg_lib_pstk.c =================================================================== --- trunk/src_plugins/dialogs/dlg_lib_pstk.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_lib_pstk.c (revision 26937) @@ -169,7 +169,7 @@ /* draw the shapes */ for(n = 0; n < pcb_proto_num_layers; n++) - layers[n] = !!ctx->dlg[ctx->wlayerv[n]].default_val.int_value + !!ctx->dlg[ctx->wlayerc[n]].default_val.int_value; + layers[n] = !!ctx->dlg[ctx->wlayerv[n]].val.int_value + !!ctx->dlg[ctx->wlayerc[n]].val.int_value; pcb_pstk_draw_preview(PCB, &ps, layers, 0, 0, &e->view); @@ -182,7 +182,7 @@ x2 = ctx->drawbox.X2; y2 = ctx->drawbox.Y2; - grid = ctx->dlg[ctx->wgrid].default_val.coord_value; + grid = ctx->dlg[ctx->wgrid].val.coord_value; for(x = 0; x < x2; x += grid) pcb_gui->draw_line(gc, x, y1, x, y2); for(x = -grid; x > x1; x -= grid) @@ -277,7 +277,7 @@ attr = &ctx->dlg[ctx->wlist]; tree = (pcb_hid_tree_t *)attr->enumerations; - text = attr_inp->default_val.str_value; + text = attr_inp->val.str_value; if ((text == NULL) || (*text == '\0')) { for(r = gdl_first(&tree->rows); r != NULL; r = gdl_next(&tree->rows, r)) Index: trunk/src_plugins/dialogs/dlg_library.c =================================================================== --- trunk/src_plugins/dialogs/dlg_library.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_library.c (revision 26937) @@ -182,7 +182,7 @@ static void timed_update_preview_cb(pcb_hidval_t user_data) { library_ctx_t *ctx = user_data.ptr; - const char *otext = ctx->dlg[ctx->wfilt].default_val.str_value; + const char *otext = ctx->dlg[ctx->wfilt].val.str_value; if (pcb_buffer_load_footprint(PCB_PASTEBUFFER, otext, NULL)) { pcb_tool_select_by_id(&PCB->hidlib, PCB_MODE_PASTE_BUFFER); @@ -213,7 +213,7 @@ static void update_edit_button(library_ctx_t *ctx) { - const char *otext = ctx->dlg[ctx->wfilt].default_val.str_value; + const char *otext = ctx->dlg[ctx->wfilt].val.str_value; pcb_gui->attr_dlg_widget_state(ctx->dlg_hid_ctx, ctx->wedit, !ctx->pactive && (otext != NULL) && (strchr(otext, '(') != NULL)); } @@ -378,7 +378,7 @@ attr = &ctx->dlg[ctx->wtree]; tree = (pcb_hid_tree_t *)attr->enumerations; - otext = attr_inp->default_val.str_value; + otext = attr_inp->val.str_value; text = pcb_strdup(otext); have_filter_text = (*text != '\0'); @@ -478,7 +478,7 @@ library_ctx_t *ctx = caller_data; pcb_hid_attribute_t *attr; pcb_hid_row_t *r, *rnew; - const char *otext = ctx->dlg[ctx->wfilt].default_val.str_value; + const char *otext = ctx->dlg[ctx->wfilt].val.str_value; char *name, *sep; int namelen; Index: trunk/src_plugins/dialogs/dlg_library_param.c =================================================================== --- trunk/src_plugins/dialogs/dlg_library_param.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_library_param.c (revision 26937) @@ -279,7 +279,7 @@ case PCB_HATT_BEGIN_TABLE: continue; case PCB_HATT_ENUM: - val = a->enumerations[a->default_val.int_value]; + val = a->enumerations[a->val.int_value]; if (val != NULL) { desc = strstr((char *)val, " ("); if (desc != NULL) @@ -287,12 +287,12 @@ } break; case PCB_HATT_STRING: - val = a->default_val.str_value; + val = a->val.str_value; break; case PCB_HATT_COORD: case PCB_HATT_END: val = buff; - pcb_snprintf(buff, sizeof(buff), "%$$mH", a->default_val.coord_value); + pcb_snprintf(buff, sizeof(buff), "%$$mH", a->val.coord_value); break; default:; } @@ -433,7 +433,7 @@ static void library_param_fillin(library_ctx_t *ctx, pcb_fplibrary_t *l) { pcb_hid_attr_val_t hv; - const char *filter_txt = ctx->dlg[ctx->wfilt].default_val.str_value; + const char *filter_txt = ctx->dlg[ctx->wfilt].val.str_value; if (filter_txt == NULL) { Index: trunk/src_plugins/dialogs/dlg_loadsave.c =================================================================== --- trunk/src_plugins/dialogs/dlg_loadsave.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_loadsave.c (revision 26937) @@ -116,7 +116,7 @@ static void update_opts(save_t *save) { pcb_hid_attr_val_t hv; - int selection = save->fmtsub->dlg[save->wfmt].default_val.int_value; + int selection = save->fmtsub->dlg[save->wfmt].val.int_value; hv.int_value = save->opt_tab[selection]; pcb_gui->attr_dlg_set_value(save->fmtsub->dlg_hid_ctx, save->wopts, &hv); @@ -129,7 +129,7 @@ char *bn, *fn, *s; const char *ext; pcb_event_arg_t res, argv[4]; - int selection = attr->default_val.int_value; + int selection = attr->val.int_value; pcb_hid_attr_val_t hv; if ((save->avail == NULL) || save->fmt_chg_lock) @@ -184,7 +184,7 @@ pcb_hid_dad_subdialog_t *fmtsub = caller_data; save_t *save = fmtsub->sub_ctx; - if (save->fmtsub->dlg[save->wguess].default_val.int_value) { + if (save->fmtsub->dlg[save->wguess].val.int_value) { /* when guess is activated, make sure to recalculate the guess whatever the format or the last file name was - this closes out all corner cases with initial format mismatching the file name and multiple formats for @@ -234,7 +234,7 @@ save->timer = pcb_gui->add_timer(pcb_gui, save_timer, 300, user_data); - if ((save->fmtsub->parent_poke != NULL) && (save->fmtsub->dlg_hid_ctx != NULL) && (save->fmtsub->dlg[save->wguess].default_val.int_value)) { + if ((save->fmtsub->parent_poke != NULL) && (save->fmtsub->dlg_hid_ctx != NULL) && (save->fmtsub->dlg[save->wguess].val.int_value)) { pcb_event_arg_t res; char *end; @@ -252,7 +252,7 @@ save_t *save = sub->sub_ctx; int n, i; char *seen; - int tab_selection = save->opt_tab[save->fmtsub->dlg[save->wfmt].default_val.int_value]; + int tab_selection = save->opt_tab[save->fmtsub->dlg[save->wfmt].val.int_value]; seen = calloc(1, save->tabs); for(n = 1; n < save->tabs; n++) { Index: trunk/src_plugins/dialogs/dlg_padstack.c =================================================================== --- trunk/src_plugins/dialogs/dlg_padstack.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_padstack.c (revision 26937) @@ -167,8 +167,8 @@ } PCB_DAD_SET_VALUE(hid_ctx, pse->hole_header, str_value, s); - free((char *)pse->attrs[pse->prname].default_val.str_value); - pse->attrs[pse->prname].default_val.str_value = NULL; + free((char *)pse->attrs[pse->prname].val.str_value); + pse->attrs[pse->prname].val.str_value = NULL; PCB_DAD_SET_VALUE(hid_ctx, pse->prname, str_value, 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->hplated, int_value, proto->hplated); @@ -258,10 +258,10 @@ pcb_pstk_change_instance(pse->ps, NULL, - &pse->attrs[pse->clearance].default_val.coord_value, - &pse->attrs[pse->rot].default_val.real_value, - &pse->attrs[pse->xmirror].default_val.int_value, - &pse->attrs[pse->smirror].default_val.int_value); + &pse->attrs[pse->clearance].val.coord_value, + &pse->attrs[pse->rot].val.real_value, + &pse->attrs[pse->xmirror].val.int_value, + &pse->attrs[pse->smirror].val.int_value); lock++; pse_ps2dlg(hid_ctx, pse); /* to get calculated text fields updated */ @@ -276,7 +276,7 @@ pse_t *pse = caller_data; pcb_pstk_proto_t *proto = pcb_pstk_get_proto(pse->ps); static int lock = 0; - const char *new_name = pse->attrs[pse->prname].default_val.str_value; + const char *new_name = pse->attrs[pse->prname].val.str_value; if ((lock != 0) || (proto == NULL)) return; @@ -311,10 +311,10 @@ if (proto != NULL) { pcb_pstk_proto_change_hole(proto, - &pse->attrs[pse->hplated].default_val.int_value, - &pse->attrs[pse->hdia].default_val.coord_value, - &pse->attrs[pse->htop_val].default_val.int_value, - &pse->attrs[pse->hbot_val].default_val.int_value); + &pse->attrs[pse->hplated].val.int_value, + &pse->attrs[pse->hdia].val.coord_value, + &pse->attrs[pse->htop_val].val.int_value, + &pse->attrs[pse->hbot_val].val.int_value); } lock++; @@ -357,7 +357,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]].default_val.coord_value); + pcb_pstk_shape_clr_grow(&proto->tr.array[n].shape[sidx], pcb_true, pse->attrs[pse->proto_clr[idx]].val.coord_value); ctx.clip.clear = 1; ctx.clip.restore = 0; @@ -447,7 +447,7 @@ pse_t *pse = caller_data; pcb_pstk_proto_t *proto = pcb_pstk_get_proto(pse->ps); pcb_pstk_tshape_t *ts = &proto->tr.array[0]; - int from = pse->shape_chg[pse->copy_from].default_val.int_value; + int from = pse->shape_chg[pse->copy_from].val.int_value; int dst_idx; int src_idx; @@ -481,7 +481,7 @@ pse_t *pse = caller_data; pcb_pstk_proto_t *proto = pcb_pstk_get_proto(pse->ps); pcb_pstk_tshape_t *ts = &proto->tr.array[0]; - int from = pse->shape_chg[pse->copy_from].default_val.int_value; + int from = pse->shape_chg[pse->copy_from].val.int_value; int dst_idx; int src_idx; @@ -517,7 +517,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].default_val.coord_value; + pcb_coord_t bloat = pse->shape_chg[pse->amount].val.coord_value; if (bloat <= 0) return; @@ -687,11 +687,11 @@ int err = 0; pse_t *pse = caller_data; pcb_pstk_proto_t proto; - int sides = pse->attrs[pse->gen_sides].default_val.int_value; - int shape = pse->attrs[pse->gen_shp].default_val.int_value; - int expose = pse->attrs[pse->gen_expose].default_val.int_value; - int paste = pse->attrs[pse->gen_paste].default_val.int_value; - pcb_coord_t size = pse->attrs[pse->gen_size].default_val.coord_value; + int sides = pse->attrs[pse->gen_sides].val.int_value; + int shape = pse->attrs[pse->gen_shp].val.int_value; + int expose = pse->attrs[pse->gen_expose].val.int_value; + int paste = pse->attrs[pse->gen_paste].val.int_value; + pcb_coord_t size = pse->attrs[pse->gen_size].val.coord_value; pcb_layer_type_t lyt = sides_lyt[sides]; pcb_pstk_tshape_t *ts; pcb_cardinal_t pid; @@ -714,7 +714,7 @@ if (lyt & PCB_LYT_BOTTOM) pse_drv_shape(&proto, ts, PCB_LYT_BOTTOM, paste); } - proto.hdia = pse->attrs[pse->gen_drill].default_val.coord_value; + proto.hdia = pse->attrs[pse->gen_drill].val.coord_value; proto.hplated = 1; pcb_pstk_proto_update(&proto); @@ -966,7 +966,7 @@ PCB_DAD_SET_VALUE(dlg_hid_ctx, pse->tab, int_value, target_tab); PCB_DAD_RUN(dlg); - free((char *)pse->attrs[pse->prname].default_val.str_value); + free((char *)pse->attrs[pse->prname].val.str_value); PCB_DAD_FREE(dlg); } Index: trunk/src_plugins/dialogs/dlg_pref.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_pref.c (revision 26937) @@ -89,21 +89,21 @@ ctx->conf_lock = item; switch(cn->type) { case CFN_COORD: - if (cn->val.coord[0] != attr->default_val.coord_value) - conf_setf(ctx->role, item->confpath, -1, "%.8$mm", attr->default_val.coord_value); + if (cn->val.coord[0] != attr->val.coord_value) + conf_setf(ctx->role, item->confpath, -1, "%.8$mm", attr->val.coord_value); break; case CFN_BOOLEAN: case CFN_INTEGER: - if (cn->val.integer[0] != attr->default_val.int_value) - conf_setf(ctx->role, item->confpath, -1, "%d", attr->default_val.int_value); + if (cn->val.integer[0] != attr->val.int_value) + conf_setf(ctx->role, item->confpath, -1, "%d", attr->val.int_value); break; case CFN_REAL: - if (cn->val.real[0] != attr->default_val.real_value) - conf_setf(ctx->role, item->confpath, -1, "%f", attr->default_val.real_value); + if (cn->val.real[0] != attr->val.real_value) + conf_setf(ctx->role, item->confpath, -1, "%f", attr->val.real_value); break; case CFN_STRING: - if (strcmp(cn->val.string[0], attr->default_val.str_value) != 0) - conf_set(ctx->role, item->confpath, -1, attr->default_val.str_value, POL_OVERWRITE); + if (strcmp(cn->val.string[0], attr->val.str_value) != 0) + conf_set(ctx->role, item->confpath, -1, attr->val.str_value, POL_OVERWRITE); break; default: pcb_message(PCB_MSG_ERROR, "pcb_pref_dlg2conf_item(): widget type not handled\n"); } @@ -166,7 +166,7 @@ PCB_DAD_REAL(ctx->dlg, ""); item->wid = PCB_DAD_CURRENT(ctx->dlg); PCB_DAD_MINMAX(ctx->dlg, 0, INT_MAX); - ctx->dlg[item->wid].default_val.real_value = cn->val.real[0]; + ctx->dlg[item->wid].val.real_value = cn->val.real[0]; PCB_DAD_HELP(ctx->dlg, cn->description); PCB_DAD_CHANGE_CB(ctx->dlg, change_cb); break; @@ -173,7 +173,7 @@ case CFN_STRING: PCB_DAD_STRING(ctx->dlg); item->wid = PCB_DAD_CURRENT(ctx->dlg); - ctx->dlg[item->wid].default_val.str_value = pcb_strdup(cn->val.string[0]); + ctx->dlg[item->wid].val.str_value = pcb_strdup(cn->val.string[0]); PCB_DAD_HELP(ctx->dlg, cn->description); PCB_DAD_CHANGE_CB(ctx->dlg, change_cb); break; @@ -208,7 +208,7 @@ static void pref_role_cb(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { pref_ctx_t *ctx = caller_data; - ctx->role = roles[attr->default_val.int_value]; + ctx->role = roles[attr->val.int_value]; } static void pref_close_cb(void *caller_data, pcb_hid_attr_ev_t ev) Index: trunk/src_plugins/dialogs/dlg_pref_board.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_board.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_pref_board.c (revision 26937) @@ -48,7 +48,7 @@ double newtherm; pref_ctx_t *ctx = caller_data; - newname = PCB_EMPTY(ctx->dlg[ctx->board.wname].default_val.str_value); + newname = PCB_EMPTY(ctx->dlg[ctx->board.wname].val.str_value); oldname = PCB_EMPTY(PCB->hidlib.name); if (strcmp(oldname, newname) != 0) { free(PCB->hidlib.name); @@ -56,7 +56,7 @@ changed = 1; } - newtherm = ctx->dlg[ctx->board.wthermscale].default_val.real_value; + newtherm = ctx->dlg[ctx->board.wthermscale].val.real_value; if (PCB->ThermScale != newtherm) { PCB->ThermScale = newtherm; changed = 1; @@ -85,13 +85,13 @@ PCB_DAD_LABEL(ctx->dlg, "Board name"); PCB_DAD_STRING(ctx->dlg); ctx->board.wname = PCB_DAD_CURRENT(ctx->dlg); - ctx->dlg[ctx->board.wname].default_val.str_value = pcb_strdup(PCB_EMPTY(PCB->hidlib.name)); + ctx->dlg[ctx->board.wname].val.str_value = pcb_strdup(PCB_EMPTY(PCB->hidlib.name)); PCB_DAD_CHANGE_CB(ctx->dlg, pref_board_dlg2brd); PCB_DAD_LABEL(ctx->dlg, "Thermal scale"); PCB_DAD_REAL(ctx->dlg, ""); ctx->board.wthermscale = PCB_DAD_CURRENT(ctx->dlg); PCB_DAD_MINMAX(ctx->dlg, 0.01, 100); - ctx->dlg[ctx->board.wthermscale].default_val.real_value = PCB->ThermScale; + ctx->dlg[ctx->board.wthermscale].val.real_value = PCB->ThermScale; PCB_DAD_CHANGE_CB(ctx->dlg, pref_board_dlg2brd); PCB_DAD_LABEL(ctx->dlg, "Type"); PCB_DAD_LABEL(ctx->dlg, ""); Index: trunk/src_plugins/dialogs/dlg_pref_color.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_color.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_pref_color.c (revision 26937) @@ -73,7 +73,7 @@ { pref_ctx_t *ctx = caller_data; const char *path = attr->user_data; - conf_setf(ctx->role, path, -1, "%s", attr->default_val.clr_value.str); + conf_setf(ctx->role, path, -1, "%s", attr->val.clr_value.str); pcb_gui->invalidate_all(pcb_gui); } @@ -81,7 +81,7 @@ { pref_ctx_t *ctx = caller_data; int idx = (int *)attr->user_data - ctx->color.wlayer; - conf_setf(ctx->role, "appearance/color/layer", idx, "%s", attr->default_val.clr_value.str); + conf_setf(ctx->role, "appearance/color/layer", idx, "%s", attr->val.clr_value.str); } Index: trunk/src_plugins/dialogs/dlg_pref_conf.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_conf.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_pref_conf.c (revision 26937) @@ -321,7 +321,7 @@ attr = &ctx->dlg[ctx->conf.wtree]; tree = (pcb_hid_tree_t *)attr->enumerations; - text = attr_inp->default_val.str_value; + text = attr_inp->val.str_value; have_filter_text = (*text != '\0'); /* hide or unhide everything */ Index: trunk/src_plugins/dialogs/dlg_pref_confedit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 26937) @@ -126,17 +126,17 @@ attr = &ctx->dlg[ctx->wnewval]; switch(ctx->nat->type) { - case CFN_STRING: val = attr->default_val.str_value; break; + case CFN_STRING: val = attr->val.str_value; break; case CFN_BOOLEAN: - case CFN_INTEGER: sprintf(buf, "%d", attr->default_val.int_value); break; - case CFN_REAL: sprintf(buf, "%f", attr->default_val.real_value); break; - case CFN_COORD: pcb_snprintf(buf, sizeof(buf), "%.08$mH", attr->default_val.coord_value); break; + case CFN_INTEGER: sprintf(buf, "%d", attr->val.int_value); break; + case CFN_REAL: sprintf(buf, "%f", attr->val.real_value); break; + case CFN_COORD: pcb_snprintf(buf, sizeof(buf), "%.08$mH", attr->val.coord_value); break; case CFN_UNIT: - if ((attr->default_val.int_value < 0) || (attr->default_val.int_value >= pcb_get_n_units(0))) + if ((attr->val.int_value < 0) || (attr->val.int_value >= pcb_get_n_units(0))) return; - val = pcb_units[attr->default_val.int_value].suffix; + val = pcb_units[attr->val.int_value].suffix; break; - case CFN_COLOR: val = attr->default_val.clr_value.str; break; + case CFN_COLOR: val = attr->val.clr_value.str; break; case CFN_LIST: { pcb_hid_attribute_t *attr = &ctx->dlg[ctx->wnewval]; Index: trunk/src_plugins/dialogs/dlg_pref_lib.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 26937) @@ -241,7 +241,7 @@ cell_edit_ctx_t *ctx = caller_data; char *tmp; - pcb_path_resolve(&PCB->hidlib, ctx->dlg[ctx->wpath].default_val.str_value, &tmp, 0, pcb_true); + pcb_path_resolve(&PCB->hidlib, ctx->dlg[ctx->wpath].val.str_value, &tmp, 0, pcb_true); if (tmp != NULL) PCB_DAD_SET_VALUE(hid_ctx, ctx->wexp, str_value, tmp); } @@ -258,7 +258,7 @@ PCB_DAD_LABEL(ctx.dlg, "Path:"); PCB_DAD_STRING(ctx.dlg); ctx.wpath = PCB_DAD_CURRENT(ctx.dlg); - ctx.dlg[ctx.wpath].default_val.str_value = pcb_strdup(cell[0]); + ctx.dlg[ctx.wpath].val.str_value = pcb_strdup(cell[0]); PCB_DAD_CHANGE_CB(ctx.dlg, lib_cell_edit_update); PCB_DAD_LABEL(ctx.dlg, "Expanded\nversion:"); @@ -279,9 +279,9 @@ } free(cell[0]); - cell[0] = pcb_strdup(ctx.dlg[ctx.wpath].default_val.str_value); + cell[0] = pcb_strdup(ctx.dlg[ctx.wpath].val.str_value); free(cell[1]); - cell[1] = pcb_strdup(ctx.dlg[ctx.wexp].default_val.str_value); + cell[1] = pcb_strdup(ctx.dlg[ctx.wexp].val.str_value); PCB_DAD_FREE(ctx.dlg); return 0; Index: trunk/src_plugins/dialogs/dlg_pref_sizes.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_sizes.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_pref_sizes.c (revision 26937) @@ -46,8 +46,8 @@ pref_ctx_t *ctx = caller_data; ctx->sizes.lock++; - 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); + 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); ctx->sizes.lock--; } @@ -77,7 +77,7 @@ static void pref_isle_dlg2brd(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { pref_ctx_t *ctx = caller_data; - double v = ctx->dlg[ctx->sizes.wisle].default_val.real_value * 1000000.0; + double v = ctx->dlg[ctx->sizes.wisle].val.real_value * 1000000.0; ctx->sizes.lock++; conf_setf(ctx->role, "design/poly_isle_area", -1, "%f", v); @@ -126,7 +126,7 @@ PCB_DAD_REAL(ctx->dlg, ""); ctx->sizes.wisle = PCB_DAD_CURRENT(ctx->dlg); PCB_DAD_MINMAX(ctx->dlg, 0, PCB_MAX_COORD); - ctx->dlg[ctx->sizes.wisle].default_val.real_value = (conf_core.design.poly_isle_area / 1000000.0); + ctx->dlg[ctx->sizes.wisle].val.real_value = (conf_core.design.poly_isle_area / 1000000.0); PCB_DAD_CHANGE_CB(ctx->dlg, pref_isle_dlg2brd); PCB_DAD_END(ctx->dlg); PCB_DAD_END(ctx->dlg); Index: trunk/src_plugins/dialogs/dlg_pref_win.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_win.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_pref_win.c (revision 26937) @@ -56,7 +56,7 @@ static void pref_win_master_cb(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { pref_ctx_t *ctx = caller_data; - conf_setf(ctx->role, "editor/auto_place", -1, "%d", attr->default_val.int_value); + conf_setf(ctx->role, "editor/auto_place", -1, "%d", attr->val.int_value); pref_win_brd2dlg(ctx); } @@ -63,7 +63,7 @@ static void pref_win_board_cb(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { pref_ctx_t *ctx = caller_data; - conf_setf(ctx->role, "plugins/dialogs/auto_save_window_geometry/to_design", -1, "%d", attr->default_val.int_value); + conf_setf(ctx->role, "plugins/dialogs/auto_save_window_geometry/to_design", -1, "%d", attr->val.int_value); pref_win_brd2dlg(ctx); } @@ -70,7 +70,7 @@ static void pref_win_project_cb(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { pref_ctx_t *ctx = caller_data; - conf_setf(ctx->role, "plugins/dialogs/auto_save_window_geometry/to_project", -1, "%d", attr->default_val.int_value); + conf_setf(ctx->role, "plugins/dialogs/auto_save_window_geometry/to_project", -1, "%d", attr->val.int_value); pref_win_brd2dlg(ctx); } @@ -77,7 +77,7 @@ static void pref_win_user_cb(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { pref_ctx_t *ctx = caller_data; - conf_setf(ctx->role, "plugins/dialogs/auto_save_window_geometry/to_user", -1, "%d", attr->default_val.int_value); + conf_setf(ctx->role, "plugins/dialogs/auto_save_window_geometry/to_user", -1, "%d", attr->val.int_value); pref_win_brd2dlg(ctx); } Index: trunk/src_plugins/dialogs/dlg_search.c =================================================================== --- trunk/src_plugins/dialogs/dlg_search.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_search.c (revision 26937) @@ -67,7 +67,7 @@ search_expr_t expr[MAX_ROW][MAX_COL]; } search_ctx_t; -#define WIZ(ctx) (ctx->dlg[ctx->wwizard].default_val.int_value) +#define WIZ(ctx) (ctx->dlg[ctx->wwizard].val.int_value) #include "dlg_search_edit.c" @@ -297,8 +297,8 @@ static void search_apply_cb(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { search_ctx_t *ctx = caller_data; - if (ctx->dlg[ctx->wexpr_str].default_val.str_value != NULL) - pcb_actionl("query", search_acts[ctx->dlg[ctx->wact].default_val.int_value], ctx->dlg[ctx->wexpr_str].default_val.str_value, NULL); + if (ctx->dlg[ctx->wexpr_str].val.str_value != NULL) + pcb_actionl("query", search_acts[ctx->dlg[ctx->wact].val.int_value], ctx->dlg[ctx->wexpr_str].val.str_value, NULL); } Index: trunk/src_plugins/dialogs/dlg_search_edit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_search_edit.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_search_edit.c (revision 26937) @@ -50,16 +50,16 @@ switch(ctx->se.expr->rtype) { case RIGHT_STR: - ctx->se.right = pcb_strdup(attr->default_val.str_value); + ctx->se.right = pcb_strdup(attr->val.str_value); break; case RIGHT_INT: - ctx->se.right = pcb_strdup_printf("%d", attr->default_val.int_value); + ctx->se.right = pcb_strdup_printf("%d", attr->val.int_value); break; case RIGHT_DOUBLE: - ctx->se.right = pcb_strdup_printf("%f", attr->default_val.real_value); + ctx->se.right = pcb_strdup_printf("%f", attr->val.real_value); break; case RIGHT_COORD: - ctx->se.right = pcb_strdup_printf("%$mm", attr->default_val.coord_value); + ctx->se.right = pcb_strdup_printf("%$mm", attr->val.coord_value); break; case RIGHT_CONST: case RIGHT_max: Index: trunk/src_plugins/dialogs/dlg_test.c =================================================================== --- trunk/src_plugins/dialogs/dlg_test.c (revision 26936) +++ trunk/src_plugins/dialogs/dlg_test.c (revision 26937) @@ -320,11 +320,11 @@ hv.str_value = tmp; - sprintf(tmp, "%d", ctx->dlg[ctx->wspin_int].default_val.int_value); + sprintf(tmp, "%d", ctx->dlg[ctx->wspin_int].val.int_value); pcb_gui->attr_dlg_set_value(hid_ctx, ctx->wspout_int, &hv); - sprintf(tmp, "%f", ctx->dlg[ctx->wspin_double].default_val.real_value); + sprintf(tmp, "%f", ctx->dlg[ctx->wspin_double].val.real_value); 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].default_val.coord_value, ctx->dlg[ctx->wspin_coord].default_val.coord_value); + 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_gui->attr_dlg_set_value(hid_ctx, ctx->wspout_coord, &hv); } @@ -332,7 +332,7 @@ static void cb_tab_chg(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { test_t *ctx = caller_data; - printf("Tab switch to %d!\n", ctx->dlg[ctx->wtab].default_val.int_value); + printf("Tab switch to %d!\n", ctx->dlg[ctx->wtab].val.int_value); } static void cb_jump(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) @@ -402,7 +402,7 @@ pcb_hid_attribute_t *treea = &ctx->dlg[ctx->tt]; pcb_hid_tree_t *tree = (pcb_hid_tree_t *)treea->enumerations; - ttbl_filt(&tree->rows, attr->default_val.int_value); + ttbl_filt(&tree->rows, attr->val.int_value); pcb_dad_tree_update_hide(treea); } @@ -410,8 +410,8 @@ static void cb_ttbl_select(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { pcb_hid_row_t *row = pcb_dad_tree_get_selected(attr); - if (attr->default_val.str_value != NULL) - pcb_trace("tt tbl selected: path=%s row=%p '%s'\n", attr->default_val.str_value, row, row->cell[0]); + if (attr->val.str_value != NULL) + pcb_trace("tt tbl selected: path=%s row=%p '%s'\n", attr->val.str_value, row, row->cell[0]); else pcb_trace("tt tbl selected: \n"); } @@ -528,7 +528,7 @@ test_t *ctx = caller_data; printf("currenct color: #%02x%02x%02x\n", - ctx->dlg[ctx->wclr].default_val.clr_value.r, ctx->dlg[ctx->wclr].default_val.clr_value.g, ctx->dlg[ctx->wclr].default_val.clr_value.b); + ctx->dlg[ctx->wclr].val.clr_value.r, ctx->dlg[ctx->wclr].val.clr_value.g, ctx->dlg[ctx->wclr].val.clr_value.b); } static void cb_color_reset(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) Index: trunk/src_plugins/export_openems/excitation.c =================================================================== --- trunk/src_plugins/export_openems/excitation.c (revision 26936) +++ trunk/src_plugins/export_openems/excitation.c (revision 26937) @@ -75,7 +75,7 @@ { if (save) { char tmp[128]; - sprintf(tmp, "%d", exc_ctx.dlg[widx].default_val.int_value); + sprintf(tmp, "%d", exc_ctx.dlg[widx].val.int_value); ser_save(tmp, attrkey); } else { @@ -102,7 +102,7 @@ { if (save) { char tmp[128]; - sprintf(tmp, "%f Hz", exc_ctx.dlg[widx].default_val.real_value); + sprintf(tmp, "%f Hz", exc_ctx.dlg[widx].val.real_value); ser_save(tmp, attrkey); } else { @@ -130,7 +130,7 @@ static void ser_str(int save, int widx, const char *attrkey) { if (save) { - ser_save(exc_ctx.dlg[widx].default_val.str_value, attrkey); + ser_save(exc_ctx.dlg[widx].val.str_value, attrkey); } else { pcb_hid_attr_val_t hv; @@ -364,7 +364,7 @@ static void select_cb(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { - exc_ctx.selected = attr->default_val.int_value; + exc_ctx.selected = attr->val.int_value; select_update(1); } Index: trunk/src_plugins/export_openems/mesh.c =================================================================== --- trunk/src_plugins/export_openems/mesh.c (revision 26936) +++ trunk/src_plugins/export_openems/mesh.c (revision 26937) @@ -86,25 +86,25 @@ static void dlg2mesh(void) { int n; - mesh.pml = ia.dlg[ia.pml].default_val.int_value; - mesh.dens_obj = ia.dlg[ia.dens_obj].default_val.coord_value; - mesh.dens_gap = ia.dlg[ia.dens_gap].default_val.coord_value; - mesh.min_space = ia.dlg[ia.min_space].default_val.coord_value; - mesh.smooth = ia.dlg[ia.smooth].default_val.int_value; - mesh.noimpl = ia.dlg[ia.noimpl].default_val.int_value; - mesh.hor = ia.dlg[ia.hor].default_val.int_value; - mesh.ver = ia.dlg[ia.ver].default_val.int_value; + mesh.pml = ia.dlg[ia.pml].val.int_value; + 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.smooth = ia.dlg[ia.smooth].val.int_value; + mesh.noimpl = ia.dlg[ia.noimpl].val.int_value; + mesh.hor = ia.dlg[ia.hor].val.int_value; + mesh.ver = ia.dlg[ia.ver].val.int_value; TODO("enum lookup"); - mesh.subslines = ia.dlg[ia.subslines].default_val.int_value; - mesh.def_subs_thick = ia.dlg[ia.def_subs_thick].default_val.coord_value; - mesh.def_copper_thick = ia.dlg[ia.def_copper_thick].default_val.coord_value; - mesh.air_top = ia.dlg[ia.air_top].default_val.int_value; - mesh.air_bot = ia.dlg[ia.air_top].default_val.int_value; - mesh.dens_air = ia.dlg[ia.dens_air].default_val.coord_value; - mesh.smoothz = ia.dlg[ia.smoothz].default_val.int_value; - mesh.max_air = ia.dlg[ia.max_air].default_val.coord_value; + mesh.subslines = ia.dlg[ia.subslines].val.int_value; + 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.air_top = ia.dlg[ia.air_top].val.int_value; + mesh.air_bot = ia.dlg[ia.air_top].val.int_value; + mesh.dens_air = ia.dlg[ia.dens_air].val.coord_value; + mesh.smoothz = ia.dlg[ia.smoothz].val.int_value; + mesh.max_air = ia.dlg[ia.max_air].val.coord_value; for(n = 0; n < 6; n++) - mesh.bnd[n] = bnds[ia.dlg[ia.bnd[n]].default_val.int_value]; + mesh.bnd[n] = bnds[ia.dlg[ia.bnd[n]].val.int_value]; } #if 1 @@ -117,9 +117,9 @@ static void mesh_auto_add_smooth(vtc0_t *v, pcb_coord_t c1, pcb_coord_t c2, pcb_coord_t d1, pcb_coord_t d, pcb_coord_t d2); #define SAVE_INT(name) \ - pcb_append_printf(dst, "%s " #name" = %d\n", prefix, (int)me->dlg[me->name].default_val.int_value); + pcb_append_printf(dst, "%s " #name" = %d\n", prefix, (int)me->dlg[me->name].val.int_value); #define SAVE_COORD(name) \ - pcb_append_printf(dst, "%s " #name" = %.08$$mm\n", prefix, (pcb_coord_t)me->dlg[me->name].default_val.coord_value); + pcb_append_printf(dst, "%s " #name" = %.08$$mm\n", prefix, (pcb_coord_t)me->dlg[me->name].val.coord_value); void pcb_mesh_save(const mesh_dlg_t *me, gds_t *dst, const char *prefix) { int n; @@ -145,7 +145,7 @@ SAVE_COORD(def_copper_thick); pcb_append_printf(dst, "%s li:boundary = {", prefix); for(n = 0; n < 6; n++) { - int bidx = me->dlg[me->bnd[n]].default_val.int_value; + int bidx = me->dlg[me->bnd[n]].val.int_value; const char *bs; if ((bidx < 0) || (bidx >= sizeof(bnds) / sizeof(bnds[0]))) bs = "invalid"; @@ -157,7 +157,7 @@ gds_append_str(dst, "}\n"); { - int sidx = me->dlg[me->subslines].default_val.int_value; + int sidx = me->dlg[me->subslines].val.int_value; const char *bs; if ((sidx < 0) || (sidx >= sizeof(subslines) / sizeof(subslines[0]))) bs = "invalid"; @@ -612,7 +612,7 @@ vtc0_truncate(&mesh->line[PCB_MESH_Z].result, 0); - lns = num_subslines[ia.dlg[ia.subslines].default_val.int_value]; + lns = num_subslines[ia.dlg[ia.subslines].val.int_value]; if (lns != 0) lns++; for(gid = 0; gid < PCB->LayerGroups.len; gid++) { @@ -652,24 +652,24 @@ } } - if (ia.dlg[ia.air_top].default_val.int_value) { - if (ia.dlg[ia.smoothz].default_val.int_value) { - mesh_auto_add_smooth(&mesh->line[PCB_MESH_Z].result, ytop - ia.dlg[ia.max_air].default_val.coord_value, ytop, - ia.dlg[ia.dens_air].default_val.coord_value, ia.dlg[ia.dens_air].default_val.coord_value, top_dens); + if (ia.dlg[ia.air_top].val.int_value) { + if (ia.dlg[ia.smoothz].val.int_value) { + 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); } else { - for(y = ytop; y > ytop - ia.dlg[ia.max_air].default_val.coord_value ; y -= ia.dlg[ia.dens_air].default_val.coord_value) + for(y = ytop; y > ytop - ia.dlg[ia.max_air].val.coord_value ; y -= ia.dlg[ia.dens_air].val.coord_value) mesh_add_result(mesh, PCB_MESH_Z, y); } } - if (ia.dlg[ia.air_bot].default_val.int_value) { - if (ia.dlg[ia.smoothz].default_val.int_value) { - mesh_auto_add_smooth(&mesh->line[PCB_MESH_Z].result, ybottom, ybottom + ia.dlg[ia.max_air].default_val.coord_value, - bottom_dens, ia.dlg[ia.dens_air].default_val.coord_value, ia.dlg[ia.dens_air].default_val.coord_value); + if (ia.dlg[ia.air_bot].val.int_value) { + if (ia.dlg[ia.smoothz].val.int_value) { + 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); } else { - for(y = ybottom; y < ybottom + ia.dlg[ia.max_air].default_val.coord_value ; y += ia.dlg[ia.dens_air].default_val.coord_value) + for(y = ybottom; y < ybottom + ia.dlg[ia.max_air].val.coord_value ; y += ia.dlg[ia.dens_air].val.coord_value) mesh_add_result(mesh, PCB_MESH_Z, y); } } @@ -1015,9 +1015,9 @@ dlg2mesh(); - if (ia.dlg[ia.hor].default_val.int_value) + if (ia.dlg[ia.hor].val.int_value) mesh_auto(&mesh, PCB_MESH_HORIZONTAL); - if (ia.dlg[ia.ver].default_val.int_value) + if (ia.dlg[ia.ver].val.int_value) mesh_auto(&mesh, PCB_MESH_VERTICAL); mesh_auto_z(&mesh); Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 26936) +++ trunk/src_plugins/export_ps/ps.c (revision 26937) @@ -1354,8 +1354,8 @@ return; } - if (ps_calib_attribute_list[0].default_val.str_value == NULL) { - ps_calib_attribute_list[0].default_val.str_value = pcb_strdup("lpr"); + if (ps_calib_attribute_list[0].val.str_value == NULL) { + ps_calib_attribute_list[0].val.str_value = pcb_strdup("lpr"); } if (pcb_attribute_dialog("ps_calibrate", ps_calib_attribute_list, 1, vals, "Print Calibration Page", NULL)) Index: trunk/src_plugins/extedit/extedit_dad.c =================================================================== --- trunk/src_plugins/extedit/extedit_dad.c (revision 26936) +++ trunk/src_plugins/extedit/extedit_dad.c (revision 26937) @@ -56,7 +56,7 @@ if (lock) return; - ee->mthi = ee->dlg[ee->wmethod].default_val.int_value; + ee->mthi = ee->dlg[ee->wmethod].val.int_value; lock = 1; ee_data2dialog(ee); @@ -71,7 +71,7 @@ if (lock) return; - methods[ee->mthi].command = pcb_strdup(ee->dlg[ee->wcmd].default_val.str_value); + methods[ee->mthi].command = pcb_strdup(ee->dlg[ee->wcmd].val.str_value); lock = 1; ee_data2dialog(ee); Index: trunk/src_plugins/hid_lesstif/dialogs.c =================================================================== --- trunk/src_plugins/hid_lesstif/dialogs.c (revision 26936) +++ trunk/src_plugins/hid_lesstif/dialogs.c (revision 26937) @@ -200,15 +200,15 @@ { switch(ctx->attrs[widx].type) { case PCB_HATT_BOOL: - ctx->attrs[widx].default_val.int_value = XmToggleButtonGetState(ctx->wl[widx]); + ctx->attrs[widx].val.int_value = XmToggleButtonGetState(ctx->wl[widx]); break; case PCB_HATT_STRING: - free((char *)ctx->attrs[widx].default_val.str_value); - ctx->attrs[widx].default_val.str_value = pcb_strdup(XmTextGetString(ctx->wl[widx])); + free((char *)ctx->attrs[widx].val.str_value); + ctx->attrs[widx].val.str_value = pcb_strdup(XmTextGetString(ctx->wl[widx])); if (ctx->results != NULL) { TODO("this is a memory leak at the moment, because ctx->results[widx].str_value may be const char * in some cases; will be gone when result is gone"); /* free((char *)ctx->results[widx].str_value);*/ - ctx->results[widx].str_value = ctx->attrs[widx].default_val.str_value; + ctx->results[widx].str_value = ctx->attrs[widx].val.str_value; } return; /* can't rely on central copy because of the allocation */ case PCB_HATT_ENUM: @@ -222,7 +222,7 @@ stdarg_n = 0; stdarg(XmNuserData, &uptr); XtGetValues(btn, stdarg_args, stdarg_n); - ctx->attrs[widx].default_val.int_value = uptr - ctx->attrs[widx].enumerations; + ctx->attrs[widx].val.int_value = uptr - ctx->attrs[widx].enumerations; } break; default: @@ -230,7 +230,7 @@ } if (ctx->results != NULL) - ctx->results[widx] = ctx->attrs[widx].default_val; + ctx->results[widx] = ctx->attrs[widx].val; } static int attr_get_idx(XtPointer dlg_widget_, lesstif_attr_dlg_t **ctx_out) @@ -461,7 +461,7 @@ btn = XmCreatePushButton(submenu, XmStrCast("menubutton"), stdarg_args, stdarg_n); XtManageChild(btn); XmStringFree(label); - if (sn == ctx->attrs[i].default_val.int_value) + if (sn == ctx->attrs[i].val.int_value) default_button = btn; XtAddCallback(btn, XmNactivateCallback, valchg, ctx->wl[i]); (ctx->btn[i])[sn] = btn; @@ -474,7 +474,7 @@ } break; case PCB_HATT_BUTTON: - stdarg(XmNlabelString, XmStringCreatePCB(ctx->attrs[i].default_val.str_value)); + stdarg(XmNlabelString, XmStringCreatePCB(ctx->attrs[i].val.str_value)); ctx->wl[i] = XmCreatePushButton(parent, XmStrCast(ctx->attrs[i].name), stdarg_args, stdarg_n); XtAddCallback(ctx->wl[i], XmNactivateCallback, valchg, ctx->wl[i]); break; @@ -532,7 +532,7 @@ break; case PCB_HATT_STRING: XtVaSetValues(ctx->wl[idx], XmNvalue, XmStrCast(val->str_value), NULL); - ctx->attrs[idx].default_val.str_value = pcb_strdup(val->str_value); + ctx->attrs[idx].val.str_value = pcb_strdup(val->str_value); copied = 1; break; case PCB_HATT_INTEGER: @@ -570,7 +570,7 @@ ok:; if (!copied) - ctx->attrs[idx].default_val = *val; + ctx->attrs[idx].val = *val; ctx->inhibit_valchg = save; return 0; @@ -649,7 +649,7 @@ ctx->id = pcb_strdup(id); for (i = 0; i < n_attrs; i++) { - results[i] = attrs[i].default_val; + results[i] = attrs[i].val; if (PCB_HAT_IS_STR(attrs[i].type) && (results[i].str_value)) results[i].str_value = pcb_strdup(results[i].str_value); else Index: trunk/src_plugins/hid_lesstif/dlg_attr_box.c =================================================================== --- trunk/src_plugins/hid_lesstif/dlg_attr_box.c (revision 26936) +++ trunk/src_plugins/hid_lesstif/dlg_attr_box.c (revision 26937) @@ -234,7 +234,7 @@ tctx->at = -1; /* make sure one of the pages is shown */ - if (ltf_tabbed_set_(tctx, ctx->attrs[i].default_val.int_value) != 0) + if (ltf_tabbed_set_(tctx, ctx->attrs[i].val.int_value) != 0) ltf_tabbed_set_(tctx, 0); return res; Index: trunk/src_plugins/hid_lesstif/dlg_attr_misc.c =================================================================== --- trunk/src_plugins/hid_lesstif/dlg_attr_misc.c (revision 26936) +++ trunk/src_plugins/hid_lesstif/dlg_attr_misc.c (revision 26937) @@ -232,7 +232,7 @@ static void ltf_colorbtn_set(lesstif_attr_dlg_t *ctx, int idx, const pcb_color_t *clr) { Widget btn = ctx->wl[idx]; - ctx->attrs[idx].default_val.clr_value = *clr; + ctx->attrs[idx].val.clr_value = *clr; pcb_ltf_color_button_recolor(display, btn, clr); } @@ -249,7 +249,7 @@ if (widx < 0) return; - clr = &ctx->attrs[widx].default_val.clr_value; + clr = &ctx->attrs[widx].val.clr_value; argv[0].type = FGW_VOID; argv[1].type = FGW_STR | FGW_DYN; @@ -273,7 +273,7 @@ fgw_arg_free(&pcb_fgw, &res); pcb_ltf_color_button_recolor(display, w, &nclr); - ctx->attrs[widx].default_val.clr_value = nclr; + ctx->attrs[widx].val.clr_value = nclr; valchg(w, dlg_widget_, w); } @@ -280,7 +280,7 @@ static Widget ltf_colorbtn_create(lesstif_attr_dlg_t *ctx, Widget parent, pcb_hid_attribute_t *attr, int readonly) { - Widget pic = pcb_ltf_color_button(display, parent, XmStrCast("dad_picture"), &attr->default_val.clr_value); + Widget pic = pcb_ltf_color_button(display, parent, XmStrCast("dad_picture"), &attr->val.clr_value); if (!readonly) XtAddCallback(pic, XmNactivateCallback, ltf_colorbtn_valchg, NULL); XtManageChild(pic); Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 26936) +++ trunk/src_plugins/io_lihata/write.c (revision 26937) @@ -1767,9 +1767,9 @@ io_lihata_save_t *save = plg_ctx; if (apply) { - int omit_font = !!sub->dlg[save->womit_font].default_val.int_value; - int omit_config = !!sub->dlg[save->womit_config].default_val.int_value; - int omit_styles = !!sub->dlg[save->womit_styles].default_val.int_value; + int omit_font = !!sub->dlg[save->womit_font].val.int_value; + int omit_config = !!sub->dlg[save->womit_config].val.int_value; + int omit_styles = !!sub->dlg[save->womit_styles].val.int_value; if (omit_font != !!conf_io_lihata.plugins.io_lihata.omit_font) conf_setf(CFR_CLI, "plugins/io_lihata/omit_font", 0, "%d", omit_font); Index: trunk/src_plugins/lib_gtk_common/dlg_attr_tree.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_attr_tree.c (revision 26936) +++ trunk/src_plugins/lib_gtk_common/dlg_attr_tree.c (revision 26937) @@ -188,9 +188,9 @@ if (ctx->inhibit_valchg) return; if (r != NULL) - attr->default_val.str_value = r->path; + attr->val.str_value = r->path; else - attr->default_val.str_value = NULL; + attr->val.str_value = NULL; change_cb(ctx, attr); if (tree->user_selected_cb != NULL) tree->user_selected_cb(attr, ctx, r); Index: trunk/src_plugins/lib_gtk_common/dlg_attribute.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_attribute.c (revision 26936) +++ trunk/src_plugins/lib_gtk_common/dlg_attribute.c (revision 26937) @@ -94,7 +94,7 @@ if (ctx->inhibit_valchg) return; - dst->default_val.int_value = gtk_toggle_button_get_active(button); + dst->val.int_value = gtk_toggle_button_get_active(button); change_cb(ctx, dst); } @@ -106,8 +106,8 @@ if (ctx->inhibit_valchg) return; - free((char *)dst->default_val.str_value); - dst->default_val.str_value = pcb_strdup(gtk_entry_get_text(entry)); + free((char *)dst->val.str_value); + dst->val.str_value = pcb_strdup(gtk_entry_get_text(entry)); change_cb(ctx, dst); } @@ -125,7 +125,7 @@ if (ctx->inhibit_valchg) return; - dst->default_val.int_value = gtk_combo_box_get_active(combo_box); + dst->val.int_value = gtk_combo_box_get_active(combo_box); change_cb(ctx, dst); } @@ -140,7 +140,7 @@ /* Gets the index (starting from 0) of the current page in the notebook. If the notebook has no pages, then -1 will be returned and no call-back occur. */ if (gtk_notebook_get_current_page(nb) >= 0) { - dst->default_val.int_value = page_num; + dst->val.int_value = page_num; change_cb(ctx, dst); } } @@ -185,7 +185,7 @@ gtkc_color_button_get_color(GTK_WIDGET(button), &clr); str = ctx->gctx->impl.get_color_name(&clr); - pcb_color_load_str(&dst->default_val.clr_value, str); + pcb_color_load_str(&dst->val.clr_value, str); change_cb(ctx, dst); } @@ -430,8 +430,8 @@ g_object_set_data(G_OBJECT(entry), PCB_OBJ_PROP, ctx); ctx->wl[j] = entry; - if (ctx->attrs[j].default_val.str_value != NULL) - gtk_entry_set_text(GTK_ENTRY(entry), ctx->attrs[j].default_val.str_value); + if (ctx->attrs[j].val.str_value != NULL) + gtk_entry_set_text(GTK_ENTRY(entry), ctx->attrs[j].val.str_value); gtk_widget_set_tooltip_text(entry, ctx->attrs[j].help_text); g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(entry_changed_cb), &(ctx->attrs[j])); g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(entry_activate_cb), &(ctx->attrs[j])); @@ -439,7 +439,7 @@ case PCB_HATT_BOOL: /* put this in a check button */ - widget = chk_btn_new(parent, ctx->attrs[j].default_val.int_value, set_flag_cb, &(ctx->attrs[j]), NULL); + widget = chk_btn_new(parent, ctx->attrs[j].val.int_value, set_flag_cb, &(ctx->attrs[j]), NULL); gtk_widget_set_tooltip_text(widget, ctx->attrs[j].help_text); g_object_set_data(G_OBJECT(widget), PCB_OBJ_PROP, ctx); ctx->wl[j] = widget; @@ -464,7 +464,7 @@ gtkc_combo_box_text_append_text(combo, ctx->attrs[j].enumerations[i]); i++; } - gtk_combo_box_set_active(GTK_COMBO_BOX(combo), ctx->attrs[j].default_val.int_value); + gtk_combo_box_set_active(GTK_COMBO_BOX(combo), ctx->attrs[j].val.int_value); g_signal_connect(G_OBJECT(combo), "changed", G_CALLBACK(enum_changed_cb), &(ctx->attrs[j])); break; @@ -509,9 +509,9 @@ gtk_box_pack_start(GTK_BOX(parent), hbox, expfill, expfill, 0); if (ctx->attrs[j].pcb_hatt_flags & PCB_HATF_TOGGLE) - ctx->wl[j] = gtk_toggle_button_new_with_label(ctx->attrs[j].default_val.str_value); + ctx->wl[j] = gtk_toggle_button_new_with_label(ctx->attrs[j].val.str_value); else - ctx->wl[j] = gtk_button_new_with_label(ctx->attrs[j].default_val.str_value); + ctx->wl[j] = gtk_button_new_with_label(ctx->attrs[j].val.str_value); gtk_box_pack_start(GTK_BOX(hbox), ctx->wl[j], expfill, expfill, 0); gtk_widget_set_tooltip_text(ctx->wl[j], ctx->attrs[j].help_text); @@ -610,7 +610,7 @@ if (strcmp(s, nv) == 0) goto nochg; gtk_entry_set_text(GTK_ENTRY(ctx->wl[idx]), val->str_value); - ctx->attrs[idx].default_val.str_value = pcb_strdup(val->str_value); + ctx->attrs[idx].val.str_value = pcb_strdup(val->str_value); *copied = 1; } break; @@ -843,7 +843,7 @@ if (ctx->rc == 0) { /* copy over the results */ for (i = 0; i < ctx->n_attrs; i++) { - ctx->results[i] = ctx->attrs[i].default_val; + ctx->results[i] = ctx->attrs[i].val; if (PCB_HAT_IS_STR(ctx->attrs[i].type) && (ctx->results[i].str_value)) ctx->results[i].str_value = pcb_strdup(ctx->results[i].str_value); else @@ -928,7 +928,7 @@ if (res == 0) { if (!copied) - ctx->attrs[idx].default_val = *val; + ctx->attrs[idx].val = *val; return 0; } else if (res == 1) Index: trunk/src_plugins/lib_hid_common/act_dad.c =================================================================== --- trunk/src_plugins/lib_hid_common/act_dad.c (revision 26936) +++ trunk/src_plugins/lib_hid_common/act_dad.c (revision 26937) @@ -502,23 +502,23 @@ return FGW_ERR_NOT_FOUND; } res->type = FGW_DOUBLE; - res->val.nat_double = pcb_coord_to_unit(u, dad->dlg[wid].default_val.coord_value); + res->val.nat_double = pcb_coord_to_unit(u, dad->dlg[wid].val.coord_value); } else { res->type = FGW_COORD; - fgw_coord(res) = dad->dlg[wid].default_val.coord_value; + fgw_coord(res) = dad->dlg[wid].val.coord_value; } break; case PCB_HATT_INTEGER: case PCB_HATT_ENUM: res->type = FGW_INT; - res->val.nat_int = dad->dlg[wid].default_val.int_value; + res->val.nat_int = dad->dlg[wid].val.int_value; break; case PCB_HATT_STRING: case PCB_HATT_LABEL: case PCB_HATT_BUTTON: res->type = FGW_STR; - res->val.str = (char *)dad->dlg[wid].default_val.str_value; + res->val.str = (char *)dad->dlg[wid].val.str_value; break; default: pcb_message(PCB_MSG_ERROR, "Invalid widget type %d - can not retrieve value (get ignored)\n", wid); Index: trunk/src_plugins/lib_hid_common/dlg_comm_m.c =================================================================== --- trunk/src_plugins/lib_hid_common/dlg_comm_m.c (revision 26936) +++ trunk/src_plugins/lib_hid_common/dlg_comm_m.c (revision 26937) @@ -60,7 +60,7 @@ PCB_DAD_LABEL(dlg, label); PCB_DAD_STRING(dlg); ws = PCB_DAD_CURRENT(dlg); - dlg[ws].default_val.str_value = pcb_strdup(default_str == NULL ? "" : default_str); + dlg[ws].val.str_value = pcb_strdup(default_str == NULL ? "" : default_str); PCB_DAD_ENTER_CB(dlg, prompt_enter_cb); dlg[ws].user_data = &dlg_ret_override; PCB_DAD_BUTTON_CLOSES(dlg, clbtn); @@ -73,7 +73,7 @@ } res->type = FGW_STR | FGW_DYN; - res->val.str = pcb_strdup(dlg[ws].default_val.str_value); + res->val.str = pcb_strdup(dlg[ws].val.str_value); PCB_DAD_FREE(dlg); return 0; @@ -143,7 +143,7 @@ pcb_hid_attr_val_t val; clrpick_t *ctx = caller_data; - pcb_color_load_int(&ctx->clr, clamp(ctx->dlg[ctx->wr].default_val.int_value), clamp(ctx->dlg[ctx->wg].default_val.int_value), clamp(ctx->dlg[ctx->wb].default_val.int_value), 255); + pcb_color_load_int(&ctx->clr, clamp(ctx->dlg[ctx->wr].val.int_value), clamp(ctx->dlg[ctx->wg].val.int_value), clamp(ctx->dlg[ctx->wb].val.int_value), 255); val.clr_value = ctx->clr; pcb_gui->attr_dlg_set_value(hid_ctx, ctx->wclr, &val); } Index: trunk/src_plugins/lib_hid_common/dlg_log.c =================================================================== --- trunk/src_plugins/lib_hid_common/dlg_log.c (revision 26936) +++ trunk/src_plugins/lib_hid_common/dlg_log.c (revision 26937) @@ -123,7 +123,7 @@ pcb_hid_attribute_t *atxt = &log_ctx.dlg[log_ctx.wtxt]; pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; - if ((log_ctx.dlg[log_ctx.wscroll].default_val.int_value) && (txt->hid_scroll_to_bottom != NULL)) + if ((log_ctx.dlg[log_ctx.wscroll].val.int_value) && (txt->hid_scroll_to_bottom != NULL)) txt->hid_scroll_to_bottom(atxt, log_ctx.dlg_hid_ctx); } Index: trunk/src_plugins/lib_hid_pcbui/routest.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/routest.c (revision 26936) +++ trunk/src_plugins/lib_hid_pcbui/routest.c (revision 26937) @@ -106,7 +106,7 @@ pcb_hid_attr_val_t hv; hv.int_value = (n == target); - if (rst.sub.dlg[rst.wlab[n]].default_val.int_value != hv.int_value) + if (rst.sub.dlg[rst.wlab[n]].val.int_value != hv.int_value) pcb_gui->attr_dlg_set_value(rst.sub.dlg_hid_ctx, rst.wchk[n], &hv); hv.str_value = PCB->RouteStyle.array[n].name; Index: trunk/src_plugins/lib_hid_pcbui/routest_dlg.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/routest_dlg.c (revision 26936) +++ trunk/src_plugins/lib_hid_pcbui/routest_dlg.c (revision 26937) @@ -127,22 +127,22 @@ TODO("This change is not undoable"); if (idx == rstdlg_ctx.wname) { - const char *s = attr->default_val.str_value; + const char *s = attr->val.str_value; while(isspace(*s)) s++; strncpy(rst->name, s, sizeof(rst->name)); } else if (idx == rstdlg_ctx.wlineth) - rst->Thick = attr->default_val.coord_value; + rst->Thick = attr->val.coord_value; else if (idx == rstdlg_ctx.wtxtth) - rst->textt = attr->default_val.coord_value; + rst->textt = attr->val.coord_value; else if (idx == rstdlg_ctx.wtxtscale) - rst->texts = attr->default_val.coord_value; + rst->texts = attr->val.coord_value; else if (idx == rstdlg_ctx.wclr) - rst->Clearance = attr->default_val.coord_value; + rst->Clearance = attr->val.coord_value; else if (idx == rstdlg_ctx.wviahole) - rst->Hole = attr->default_val.coord_value; + rst->Hole = attr->val.coord_value; else if (idx == rstdlg_ctx.wviaring) - rst->Diameter = attr->default_val.coord_value; + rst->Diameter = attr->val.coord_value; else { pcb_message(PCB_MSG_ERROR, "Internal error: route style field does not exist"); return; @@ -176,8 +176,8 @@ PCB_DAD_NEW("route_style_attr", dlg, "Edit route style attribute", NULL, pcb_true, NULL); res = PCB_DAD_RUN(dlg); if (res == 0) { - *key = pcb_strdup(dlg[wkey].default_val.str_value); - *val = pcb_strdup(dlg[wval].default_val.str_value); + *key = pcb_strdup(dlg[wkey].val.str_value); + *val = pcb_strdup(dlg[wval].val.str_value); } PCB_DAD_FREE(dlg); return res; Index: trunk/src_plugins/lib_polyhelp/polyhelp.c =================================================================== --- trunk/src_plugins/lib_polyhelp/polyhelp.c (revision 26936) +++ trunk/src_plugins/lib_polyhelp/polyhelp.c (revision 26937) @@ -408,14 +408,14 @@ return -1; } - *period = dlg[wspc].default_val.coord_value; - if (dlg[wcont].default_val.int_value) *want_contour = 1; + *period = dlg[wspc].val.coord_value; + if (dlg[wcont].val.int_value) *want_contour = 1; *dir = 0; - if (dlg[whor].default_val.int_value) *dir |= PCB_CPOLY_HATCH_HORIZONTAL; - if (dlg[wver].default_val.int_value) *dir |= PCB_CPOLY_HATCH_VERTICAL; + if (dlg[whor].val.int_value) *dir |= PCB_CPOLY_HATCH_HORIZONTAL; + if (dlg[wver].val.int_value) *dir |= PCB_CPOLY_HATCH_VERTICAL; - *flg = pcb_flag_make(dlg[wclr].default_val.int_value ? PCB_FLAG_CLEARLINE : 0); + *flg = pcb_flag_make(dlg[wclr].val.int_value ? PCB_FLAG_CLEARLINE : 0); PCB_DAD_FREE(dlg); return 0; Index: trunk/src_plugins/propedit/propdlg.c =================================================================== --- trunk/src_plugins/propedit/propdlg.c (revision 26936) +++ trunk/src_plugins/propedit/propdlg.c (revision 26937) @@ -71,7 +71,7 @@ attr = &ctx->dlg[ctx->wtree]; attr_inp = &ctx->dlg[ctx->wfilter]; tree = (pcb_hid_tree_t *)attr->enumerations; - text = attr_inp->default_val.str_value; + text = attr_inp->val.str_value; have_filter_text = (text != NULL) && (*text != '\0'); /* hide or unhide everything */ @@ -214,7 +214,7 @@ case PCB_PROPT_ANGLE: case PCB_PROPT_INT: case PCB_PROPT_BOOL: - if (!ctx->dlg[ctx->wabs[p->type]].default_val.int_value) + if (!ctx->dlg[ctx->wabs[p->type]].val.int_value) return; default: break; } @@ -319,30 +319,30 @@ case PCB_PROPT_max: return; case PCB_PROPT_STRING: - sctx.s = ctx->dlg[ctx->wedit[p->type]].default_val.str_value; + sctx.s = ctx->dlg[ctx->wedit[p->type]].val.str_value; break; case PCB_PROPT_COORD: - sctx.c = ctx->dlg[ctx->wedit[p->type]].default_val.coord_value; - sctx.c_absolute = ctx->dlg[ctx->wabs[p->type]].default_val.int_value; + sctx.c = ctx->dlg[ctx->wedit[p->type]].val.coord_value; + sctx.c_absolute = ctx->dlg[ctx->wabs[p->type]].val.int_value; sctx.c_valid = 1; break; case PCB_PROPT_ANGLE: - sctx.d = ctx->dlg[ctx->wedit[p->type]].default_val.real_value; - sctx.d_absolute = ctx->dlg[ctx->wabs[p->type]].default_val.int_value; + sctx.d = ctx->dlg[ctx->wedit[p->type]].val.real_value; + sctx.d_absolute = ctx->dlg[ctx->wabs[p->type]].val.int_value; sctx.d_valid = 1; break; case PCB_PROPT_INT: - sctx.c = ctx->dlg[ctx->wedit[p->type]].default_val.int_value; - sctx.c_absolute = ctx->dlg[ctx->wabs[p->type]].default_val.int_value; + sctx.c = ctx->dlg[ctx->wedit[p->type]].val.int_value; + sctx.c_absolute = ctx->dlg[ctx->wabs[p->type]].val.int_value; sctx.c_valid = 1; break; case PCB_PROPT_BOOL: - sctx.c = ctx->dlg[ctx->wedit[p->type]].default_val.int_value; - sctx.c_absolute = ctx->dlg[ctx->wabs[p->type]].default_val.int_value; + sctx.c = ctx->dlg[ctx->wedit[p->type]].val.int_value; + sctx.c_absolute = ctx->dlg[ctx->wabs[p->type]].val.int_value; sctx.c_valid = 1; break; case PCB_PROPT_COLOR: - sctx.color = ctx->dlg[ctx->wedit[p->type]].default_val.clr_value; + sctx.color = ctx->dlg[ctx->wedit[p->type]].val.clr_value; sctx.clr_valid = 1; break; } @@ -375,13 +375,13 @@ PCB_DAD_END(dlg); PCB_DAD_AUTORUN("propedit_add", dlg, "Propedit: add new attribute", NULL, failed); - key = dlg[wkey].default_val.str_value; + key = dlg[wkey].val.str_value; if (key == NULL) key = ""; while(isspace(*key)) key++; if ((failed == 0) && (*key != '\0')) { char *path = pcb_strdup_printf("a/%s", key); - pcb_propsel_set_str(&ctx->pe, path, dlg[wval].default_val.str_value); + pcb_propsel_set_str(&ctx->pe, path, dlg[wval].val.str_value); free(path); prop_refresh(ctx); } Index: trunk/src_plugins/script/live_script.c =================================================================== --- trunk/src_plugins/script/live_script.c (revision 26936) +++ trunk/src_plugins/script/live_script.c (revision 26937) @@ -277,7 +277,7 @@ free(src); fclose(f); - lang = lvs->lang_engines[lvs->dlg[lvs->wlang].default_val.int_value]; + lang = lvs->lang_engines[lvs->dlg[lvs->wlang].val.int_value]; live_stop(lvs); @@ -292,7 +292,7 @@ pcb_gui->attr_dlg_widget_state(lvs->dlg_hid_ctx, lvs->wrun, 0); pcb_gui->attr_dlg_widget_state(lvs->dlg_hid_ctx, lvs->wstop, 1); - if (!lvs->dlg[lvs->wpers].default_val.int_value) + if (!lvs->dlg[lvs->wpers].val.int_value) live_stop(lvs); if ((pcb_num_undo() != numu) && (lvs->undo_pre == pcb_undo_serial())) Index: trunk/src_plugins/script/script_act.c =================================================================== --- trunk/src_plugins/script/script_act.c (revision 26936) +++ trunk/src_plugins/script/script_act.c (revision 26937) @@ -206,7 +206,7 @@ tmp = strrchr(fn, PCB_DIR_SEPARATOR_C); if (tmp != NULL) { tmp++; - idlang.dlg[idlang.wid].default_val.str_value = tmp = pcb_strdup(tmp); + idlang.dlg[idlang.wid].val.str_value = tmp = pcb_strdup(tmp); tmp = strchr(tmp, '.'); if (tmp != NULL) *tmp = '\0'; @@ -218,7 +218,7 @@ idlang.wlang = PCB_DAD_CURRENT(idlang.dlg); tmp = strrchr(fn, '.'); if (tmp != NULL) - idlang.dlg[idlang.wlang].default_val.str_value = pcb_strdup(guess_lang(tmp+1)); + idlang.dlg[idlang.wlang].val.str_value = pcb_strdup(guess_lang(tmp+1)); PCB_DAD_END(idlang.dlg); PCB_DAD_BUTTON_CLOSES(idlang.dlg, clbtn); PCB_DAD_END(idlang.dlg); @@ -226,7 +226,7 @@ PCB_DAD_AUTORUN("script_load", idlang.dlg, "load script", NULL, failed); - if ((!failed) && (pcb_script_load(idlang.dlg[idlang.wid].default_val.str_value, fn, idlang.dlg[idlang.wlang].default_val.str_value) == 0)) + if ((!failed) && (pcb_script_load(idlang.dlg[idlang.wid].val.str_value, fn, idlang.dlg[idlang.wlang].val.str_value) == 0)) script_dlg_s2d(ctx); PCB_DAD_FREE(idlang.dlg); Index: trunk/src_plugins/shape/shape_dialog.c =================================================================== --- trunk/src_plugins/shape/shape_dialog.c (revision 26936) +++ trunk/src_plugins/shape/shape_dialog.c (revision 26937) @@ -48,9 +48,9 @@ ctx_t *shp = caller_data; /* elliptical logics */ - if (!shp->dlg[shp->pell].default_val.int_value) { + if (!shp->dlg[shp->pell].val.int_value) { 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].default_val.coord_value); + PCB_DAD_SET_VALUE(hid_ctx, shp->pry, coord_value, shp->dlg[shp->prx].val.coord_value); } else pcb_gui->attr_dlg_widget_state(hid_ctx, shp->pry, pcb_true); @@ -57,10 +57,10 @@ del_obj(shp); shp->obj = (pcb_any_obj_t *)regpoly_place( - shp->data, shp->layer, shp->dlg[shp->corners].default_val.int_value, - shp->dlg[shp->prx].default_val.coord_value, shp->dlg[shp->pry].default_val.coord_value, - shp->dlg[shp->prot].default_val.real_value, - shp->dlg[shp->pcx].default_val.coord_value, shp->dlg[shp->pcy].default_val.coord_value); + shp->data, shp->layer, shp->dlg[shp->corners].val.int_value, + shp->dlg[shp->prx].val.coord_value, shp->dlg[shp->pry].val.coord_value, + shp->dlg[shp->prot].val.real_value, + shp->dlg[shp->pcx].val.coord_value, shp->dlg[shp->pcy].val.coord_value); } static void shp_chg_roundrect(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) @@ -70,38 +70,38 @@ int n; /* elliptical logics */ - if (!shp->dlg[shp->rell].default_val.int_value) { + if (!shp->dlg[shp->rell].val.int_value) { 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].default_val.coord_value); + PCB_DAD_SET_VALUE(hid_ctx, shp->ry, coord_value, shp->dlg[shp->rx].val.coord_value); } else pcb_gui->attr_dlg_widget_state(hid_ctx, shp->ry, pcb_true); /* rectangular logics */ - if (!shp->dlg[shp->rrect].default_val.int_value) { + if (!shp->dlg[shp->rrect].val.int_value) { 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].default_val.coord_value); + PCB_DAD_SET_VALUE(hid_ctx, shp->h, coord_value, shp->dlg[shp->w].val.coord_value); } else pcb_gui->attr_dlg_widget_state(hid_ctx, shp->h, pcb_true); for(n = 0; n < 4; n++) - corner[n] = shp->dlg[shp->corner[n]].default_val.int_value; + corner[n] = shp->dlg[shp->corner[n]].val.int_value; del_obj(shp); shp->obj = (pcb_any_obj_t *)roundrect_place( shp->data, shp->layer, - shp->dlg[shp->w].default_val.coord_value, shp->dlg[shp->h].default_val.coord_value, - shp->dlg[shp->rx].default_val.coord_value, shp->dlg[shp->ry].default_val.coord_value, - shp->dlg[shp->rrot].default_val.real_value, - shp->dlg[shp->rcx].default_val.coord_value, shp->dlg[shp->rcy].default_val.coord_value, - corner, shp->dlg[shp->rres].default_val.real_value); + 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->rrot].val.real_value, + shp->dlg[shp->rcx].val.coord_value, shp->dlg[shp->rcy].val.coord_value, + corner, shp->dlg[shp->rres].val.real_value); } 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].default_val.coord_value; + pcb_coord_t dia = shp->dlg[shp->dia].val.coord_value; 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].default_val.coord_value, shp->dlg[shp->ccy].default_val.coord_value); + shp->dlg[shp->ccx].val.coord_value, shp->dlg[shp->ccy].val.coord_value); } @@ -124,7 +124,7 @@ return; hid_ctx = shape_active->dlg_hid_ctx; - tab = shape_active->dlg[shape_active->tab].default_val.int_value; + tab = shape_active->dlg[shape_active->tab].val.int_value; switch(tab) { case 0: shp_chg_regpoly(hid_ctx, shape_active, NULL); break; case 1: shp_chg_roundrect(hid_ctx, shape_active, NULL); break;