Index: trunk/doc/developer/dad/TEMPLATE.c =================================================================== --- trunk/doc/developer/dad/TEMPLATE.c (revision 30991) +++ trunk/doc/developer/dad/TEMPLATE.c (revision 30992) @@ -54,7 +54,7 @@ #include "core headers this file depends on (even if other dialogs include them)" typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int active; /* already open - allow only one instance */ int whatever; } foo_ctx_t; <<<- rename this @@ -64,26 +64,26 @@ static void foo_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) <<<- rename this { foo_ctx_t *ctx = caller_data; - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); memset(ctx, 0, sizeof(foo_ctx_t)); /* reset all states to the initial - includes ctx->active = 0; */ } static void pcb_dlg_foo(whatever args) <<<- edit this { - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (foo_ctx.active) return; /* do not open another */ - PCB_DAD_BEGIN_VBOX(foo_ctx.dlg); - PCB_DAD_COMPFLAG(foo_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(foo_ctx.dlg, "foo"); - PCB_DAD_BUTTON_CLOSES(foo_ctx.dlg, clbtn); - PCB_DAD_END(foo_ctx.dlg); + RND_DAD_BEGIN_VBOX(foo_ctx.dlg); + RND_DAD_COMPFLAG(foo_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(foo_ctx.dlg, "foo"); + RND_DAD_BUTTON_CLOSES(foo_ctx.dlg, clbtn); + RND_DAD_END(foo_ctx.dlg); /* set up the context */ foo_ctx.active = 1; - PCB_DAD_NEW("EDIT_THIS_ID", foo_ctx.dlg, "EDIT THIS: title", &foo_ctx, pcb_false, foo_close_cb); + RND_DAD_NEW("EDIT_THIS_ID", foo_ctx.dlg, "EDIT THIS: title", &foo_ctx, pcb_false, foo_close_cb); } static const char pcb_acts_Foo[] = "Foo(object)\n"; <<<- edit this Index: trunk/doc/developer/dad/TEMPLATE_MODAL.c =================================================================== --- trunk/doc/developer/dad/TEMPLATE_MODAL.c (revision 30991) +++ trunk/doc/developer/dad/TEMPLATE_MODAL.c (revision 30992) @@ -52,21 +52,21 @@ static void pcb_dlg_foo(whatever args) <<<- edit this { foo_ctx_t ctx; - pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; - PCB_DAD_DECL(dlg); + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; + RND_DAD_DECL(dlg); - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(dlg, "foo"); - PCB_DAD_BUTTON_CLOSES(dlg, clbtn); - PCB_DAD_END(dlg); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(dlg, "foo"); + RND_DAD_BUTTON_CLOSES(dlg, clbtn); + RND_DAD_END(dlg); /* set up the context */ ctx.attrs = dlg; - PCB_DAD_NEW("EDIT_THIS_ID", dlg, "EDIT THIS: title", &ctx, pcb_true, NULL); - PCB_DAD_RUN(dlg); - PCB_DAD_FREE(dlg); + RND_DAD_NEW("EDIT_THIS_ID", dlg, "EDIT THIS: title", &ctx, pcb_true, NULL); + RND_DAD_RUN(dlg); + RND_DAD_FREE(dlg); } static const char pcb_acts_Foo[] = "Foo(object)\n"; <<<- edit this Index: trunk/src/brave.c =================================================================== --- trunk/src/brave.c (revision 30991) +++ trunk/src/brave.c (revision 30992) @@ -143,9 +143,9 @@ for(d = desc, len=0; d->name != NULL; d++,len++) { if (pcb_brave & d->bit) - PCB_DAD_SET_VALUE(hid_ctx, d->widget, lng, 1); + RND_DAD_SET_VALUE(hid_ctx, d->widget, lng, 1); else - PCB_DAD_SET_VALUE(hid_ctx, d->widget, lng, 0); + RND_DAD_SET_VALUE(hid_ctx, d->widget, lng, 0); } } @@ -194,53 +194,53 @@ { desc_t *d; int len; - pcb_hid_dad_buttons_t btn[] = {{"Close", 0}, {NULL, 0}}; - PCB_DAD_DECL(dlg); + rnd_hid_dad_buttons_t btn[] = {{"Close", 0}, {NULL, 0}}; + RND_DAD_DECL(dlg); - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(dlg, "Experimental features for the brave"); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(dlg, "Experimental features for the brave"); - PCB_DAD_BEGIN_TABLE(dlg, 3); + RND_DAD_BEGIN_TABLE(dlg, 3); for(d = desc, len=0; d->name != NULL; d++,len++) { - PCB_DAD_LABEL(dlg, d->name); - PCB_DAD_HELP(dlg, d->lng); - PCB_DAD_BOOL(dlg, ""); - d->widget = PCB_DAD_CURRENT(dlg); - PCB_DAD_CHANGE_CB(dlg, brave_dialog_chg); - PCB_DAD_HELP(dlg, d->lng); - PCB_DAD_LABEL(dlg, d->shrt); - PCB_DAD_HELP(dlg, d->lng); + RND_DAD_LABEL(dlg, d->name); + RND_DAD_HELP(dlg, d->lng); + RND_DAD_BOOL(dlg, ""); + d->widget = RND_DAD_CURRENT(dlg); + RND_DAD_CHANGE_CB(dlg, brave_dialog_chg); + RND_DAD_HELP(dlg, d->lng); + RND_DAD_LABEL(dlg, d->shrt); + RND_DAD_HELP(dlg, d->lng); } - PCB_DAD_END(dlg); - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); - PCB_DAD_END(dlg); - PCB_DAD_BEGIN_HBOX(dlg); + RND_DAD_END(dlg); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); + RND_DAD_END(dlg); + RND_DAD_BEGIN_HBOX(dlg); if (len != 0) { - PCB_DAD_BUTTON(dlg, "all ON"); - PCB_DAD_HELP(dlg, "Tick in all boxes\nenabling all experimental features\n(Super Brave Mode)"); - PCB_DAD_CHANGE_CB(dlg, brave_dialog_allon); - PCB_DAD_BUTTON(dlg, "all OFF"); - PCB_DAD_HELP(dlg, "Tick off all boxes\ndisabling all experimental features\n(Safe Mode)"); - PCB_DAD_CHANGE_CB(dlg, brave_dialog_alloff); - PCB_DAD_BUTTON(dlg, "save in user cfg"); - PCB_DAD_HELP(dlg, "Save current brave state in the \nuser configuration file"); - PCB_DAD_CHANGE_CB(dlg, brave_dialog_save); + RND_DAD_BUTTON(dlg, "all ON"); + RND_DAD_HELP(dlg, "Tick in all boxes\nenabling all experimental features\n(Super Brave Mode)"); + RND_DAD_CHANGE_CB(dlg, brave_dialog_allon); + RND_DAD_BUTTON(dlg, "all OFF"); + RND_DAD_HELP(dlg, "Tick off all boxes\ndisabling all experimental features\n(Safe Mode)"); + RND_DAD_CHANGE_CB(dlg, brave_dialog_alloff); + RND_DAD_BUTTON(dlg, "save in user cfg"); + RND_DAD_HELP(dlg, "Save current brave state in the \nuser configuration file"); + RND_DAD_CHANGE_CB(dlg, brave_dialog_save); } - PCB_DAD_END(dlg); + RND_DAD_END(dlg); if (len == 0) - PCB_DAD_LABEL(dlg, "(There are no brave features at the moment)"); + RND_DAD_LABEL(dlg, "(There are no brave features at the moment)"); - PCB_DAD_BUTTON_CLOSES(dlg, btn); - PCB_DAD_END(dlg); + RND_DAD_BUTTON_CLOSES(dlg, btn); + RND_DAD_END(dlg); - PCB_DAD_NEW("brave", dlg, "Brave features", dlg, pcb_true, NULL); + RND_DAD_NEW("brave", dlg, "Brave features", dlg, pcb_true, NULL); brave2dlg(dlg_hid_ctx); - PCB_DAD_RUN(dlg); - PCB_DAD_FREE(dlg); + RND_DAD_RUN(dlg); + RND_DAD_FREE(dlg); return 0; } Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 30991) +++ trunk/src/buffer.c (revision 30992) @@ -485,7 +485,7 @@ } typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int wx, wy, wlock; } scale_t; @@ -515,40 +515,40 @@ scale_t ctx; int res; - pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"Apply", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"Apply", 0}, {NULL, 0}}; memset(&ctx, 0, sizeof(ctx)); - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABLE(ctx.dlg, 2); - PCB_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABLE(ctx.dlg, 2); + RND_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(ctx.dlg, "scale X"); - PCB_DAD_REAL(ctx.dlg, ""); - ctx.wx = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_DEFAULT_NUM(ctx.dlg, 1); - PCB_DAD_CHANGE_CB(ctx.dlg, scale_chg_cb); + RND_DAD_LABEL(ctx.dlg, "scale X"); + RND_DAD_REAL(ctx.dlg, ""); + ctx.wx = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_DEFAULT_NUM(ctx.dlg, 1); + RND_DAD_CHANGE_CB(ctx.dlg, scale_chg_cb); - PCB_DAD_LABEL(ctx.dlg, "same"); - PCB_DAD_BOOL(ctx.dlg, ""); - ctx.wlock = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_DEFAULT_NUM(ctx.dlg, 1); - PCB_DAD_CHANGE_CB(ctx.dlg, scale_chg_cb); + RND_DAD_LABEL(ctx.dlg, "same"); + RND_DAD_BOOL(ctx.dlg, ""); + ctx.wlock = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_DEFAULT_NUM(ctx.dlg, 1); + RND_DAD_CHANGE_CB(ctx.dlg, scale_chg_cb); - PCB_DAD_LABEL(ctx.dlg, "scale Y"); - PCB_DAD_REAL(ctx.dlg, ""); - ctx.wy = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_DEFAULT_NUM(ctx.dlg, 1); - PCB_DAD_CHANGE_CB(ctx.dlg, scale_chg_cb); + RND_DAD_LABEL(ctx.dlg, "scale Y"); + RND_DAD_REAL(ctx.dlg, ""); + ctx.wy = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_DEFAULT_NUM(ctx.dlg, 1); + RND_DAD_CHANGE_CB(ctx.dlg, scale_chg_cb); - PCB_DAD_BUTTON_CLOSES(ctx.dlg, clbtn); - PCB_DAD_END(ctx.dlg); + RND_DAD_BUTTON_CLOSES(ctx.dlg, clbtn); + RND_DAD_END(ctx.dlg); - PCB_DAD_NEW("buffer_scale", ctx.dlg, "Buffer scale factors", &ctx, pcb_true, NULL); - res = PCB_DAD_RUN(ctx.dlg); + RND_DAD_NEW("buffer_scale", ctx.dlg, "Buffer scale factors", &ctx, pcb_true, NULL); + res = RND_DAD_RUN(ctx.dlg); *x = ctx.dlg[ctx.wx].val.dbl; *y = ctx.dlg[ctx.wy].val.dbl; - PCB_DAD_FREE(ctx.dlg); + RND_DAD_FREE(ctx.dlg); return res; } Index: trunk/src/extobj_act.c =================================================================== --- trunk/src/extobj_act.c (revision 30991) +++ trunk/src/extobj_act.c (revision 30992) @@ -39,31 +39,31 @@ { int n, res; static int last = 0; - pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {NULL, 0}}; - PCB_DAD_DECL(dlg); + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {NULL, 0}}; + RND_DAD_DECL(dlg); - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(dlg, "Choose extended object:"); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(dlg, "Choose extended object:"); if ((last > 0) && (last < pcb_extobj_i2o.used)) { pcb_extobj_t *eo = pcb_extobj_i2o.array[last]; - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_LABEL(dlg, "Last used:"); - PCB_DAD_BUTTON_CLOSE(dlg, eo->name, last); - PCB_DAD_END(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_LABEL(dlg, "Last used:"); + RND_DAD_BUTTON_CLOSE(dlg, eo->name, last); + RND_DAD_END(dlg); } - PCB_DAD_BEGIN_TABLE(dlg, 3); + RND_DAD_BEGIN_TABLE(dlg, 3); for(n = 1; n < pcb_extobj_i2o.used; n++) { pcb_extobj_t *eo = pcb_extobj_i2o.array[n]; - PCB_DAD_BUTTON_CLOSE(dlg, eo->name, n); + RND_DAD_BUTTON_CLOSE(dlg, eo->name, n); } - PCB_DAD_END(dlg); - PCB_DAD_BUTTON_CLOSES(dlg, clbtn); - PCB_DAD_END(dlg); + RND_DAD_END(dlg); + RND_DAD_BUTTON_CLOSES(dlg, clbtn); + RND_DAD_END(dlg); - PCB_DAD_NEW("extobj_select", dlg, "Select extended object", NULL, pcb_true, NULL); - res = PCB_DAD_RUN(dlg); - PCB_DAD_FREE(dlg); + RND_DAD_NEW("extobj_select", dlg, "Select extended object", NULL, pcb_true, NULL); + res = RND_DAD_RUN(dlg); + RND_DAD_FREE(dlg); if (res > 0) last = res; return res; Index: trunk/src/extobj_helper.h =================================================================== --- trunk/src/extobj_helper.h (revision 30991) +++ trunk/src/extobj_helper.h (revision 30992) @@ -182,14 +182,14 @@ if (sval != NULL) \ pcb_get_value_unit(sval, NULL, 0, &d, &unit_out); \ currval = d; \ - PCB_DAD_LABEL(dlg, vis_name); \ - if (help != NULL) PCB_DAD_HELP(dlg, help); \ - PCB_DAD_COORD(dlg, ""); \ - if (help != NULL) PCB_DAD_HELP(dlg, help); \ - PCB_DAD_CHANGE_CB(dlg, pcb_exto_dlg_coord_cb); \ - wid = PCB_DAD_CURRENT(dlg); \ + RND_DAD_LABEL(dlg, vis_name); \ + if (help != NULL) RND_DAD_HELP(dlg, help); \ + RND_DAD_COORD(dlg, ""); \ + if (help != NULL) RND_DAD_HELP(dlg, help); \ + RND_DAD_CHANGE_CB(dlg, pcb_exto_dlg_coord_cb); \ + wid = RND_DAD_CURRENT(dlg); \ dlg[wid].user_data = (void *)attr_name; \ - PCB_DAD_DEFAULT_NUM(dlg, currval); \ + RND_DAD_DEFAULT_NUM(dlg, currval); \ spin = dlg[wid].wdata; \ spin->unit = unit_out; \ spin->no_unit_chg = 1; \ @@ -212,14 +212,14 @@ const char *currval = rnd_attribute_get(&subc->Attributes, attr_name); \ if (currval == NULL) currval = ""; \ currval = rnd_strdup(currval); \ - PCB_DAD_LABEL(dlg, vis_name); \ - if (help != NULL) PCB_DAD_HELP(dlg, help); \ - PCB_DAD_STRING(dlg); \ - if (help != NULL) PCB_DAD_HELP(dlg, help); \ - PCB_DAD_CHANGE_CB(dlg, pcb_exto_dlg_str_cb); \ - wid = PCB_DAD_CURRENT(dlg); \ + RND_DAD_LABEL(dlg, vis_name); \ + if (help != NULL) RND_DAD_HELP(dlg, help); \ + RND_DAD_STRING(dlg); \ + if (help != NULL) RND_DAD_HELP(dlg, help); \ + RND_DAD_CHANGE_CB(dlg, pcb_exto_dlg_str_cb); \ + wid = RND_DAD_CURRENT(dlg); \ dlg[wid].user_data = (void *)attr_name; \ - PCB_DAD_DEFAULT_PTR(dlg, currval); \ + RND_DAD_DEFAULT_PTR(dlg, currval); \ } while(0) RND_INLINE void pcb_exto_dlg_int_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) @@ -238,12 +238,12 @@ char *sval = rnd_attribute_get(&subc->Attributes, attr_name); \ if (sval != NULL) \ currval = strtol(sval, NULL, 10); \ - PCB_DAD_LABEL(dlg, vis_name); \ - if (help != NULL) PCB_DAD_HELP(dlg, help); \ - PCB_DAD_INTEGER(dlg, ""); \ - if (help != NULL) PCB_DAD_HELP(dlg, help); \ - PCB_DAD_CHANGE_CB(dlg, pcb_exto_dlg_int_cb); \ - wid = PCB_DAD_CURRENT(dlg); \ + RND_DAD_LABEL(dlg, vis_name); \ + if (help != NULL) RND_DAD_HELP(dlg, help); \ + RND_DAD_INTEGER(dlg, ""); \ + if (help != NULL) RND_DAD_HELP(dlg, help); \ + RND_DAD_CHANGE_CB(dlg, pcb_exto_dlg_int_cb); \ + wid = RND_DAD_CURRENT(dlg); \ dlg[wid].user_data = (void *)attr_name; \ - PCB_DAD_DEFAULT_NUM(dlg, currval); \ + RND_DAD_DEFAULT_NUM(dlg, currval); \ } while(0) Index: trunk/src/librnd/core/error.c =================================================================== --- trunk/src/librnd/core/error.c (revision 30991) +++ trunk/src/librnd/core/error.c (revision 30992) @@ -224,8 +224,8 @@ int wfmt; memset(&fmtsub, 0, sizeof(fmtsub)); - PCB_DAD_ENUM(fmtsub.dlg, fmts); - wfmt = PCB_DAD_CURRENT(fmtsub.dlg); + RND_DAD_ENUM(fmtsub.dlg, fmts); + wfmt = RND_DAD_CURRENT(fmtsub.dlg); fn = rnd_gui->fileselect(rnd_gui, "Export log", NULL, "log.txt", NULL, NULL, "log", RND_HID_FSD_MAY_NOT_EXIST, &fmtsub); if (fn != NULL) { ret = rnd_log_export(NULL, fn, (fmtsub.dlg[wfmt].val.lng == 1)); Index: trunk/src/librnd/core/hid_dad.c =================================================================== --- trunk/src/librnd/core/hid_dad.c (revision 30991) +++ trunk/src/librnd/core/hid_dad.c (revision 30992) @@ -65,7 +65,7 @@ return 0; } -void pcb_hid_dad_close(void *hid_ctx, pcb_dad_retovr_t *retovr, int retval) +void rnd_hid_dad_close(void *hid_ctx, rnd_dad_retovr_t *retovr, int retval) { retovr->valid = 1; retovr->value = retval; @@ -72,13 +72,13 @@ rnd_gui->attr_dlg_close(hid_ctx); } -void pcb_hid_dad_close_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) +void rnd_hid_dad_close_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) { - pcb_dad_retovr_t **retovr = attr->wdata; - pcb_hid_dad_close(hid_ctx, *retovr, attr->val.lng); + rnd_dad_retovr_t **retovr = attr->wdata; + rnd_hid_dad_close(hid_ctx, *retovr, attr->val.lng); } -int pcb_hid_dad_run(void *hid_ctx, pcb_dad_retovr_t *retovr) +int rnd_hid_dad_run(void *hid_ctx, rnd_dad_retovr_t *retovr) { int ret; Index: trunk/src/librnd/core/hid_dad.h =================================================================== --- trunk/src/librnd/core/hid_dad.h (revision 30991) +++ trunk/src/librnd/core/hid_dad.h (revision 30992) @@ -149,7 +149,7 @@ #include /*** Helpers for building dynamic attribute dialogs (DAD) ***/ -#define PCB_DAD_DECL(table) \ +#define RND_DAD_DECL(table) \ rnd_hid_attribute_t *table = NULL; \ int table ## _append_lock = 0; \ int table ## _len = 0; \ @@ -157,9 +157,9 @@ void *table ## _hid_ctx = NULL; \ int table ## _defx = 0, table ## _defy = 0; \ int table ## _minx = 0, table ## _miny = 0; \ - pcb_dad_retovr_t *table ## _ret_override; + rnd_dad_retovr_t *table ## _ret_override; -#define PCB_DAD_DECL_NOINIT(table) \ +#define RND_DAD_DECL_NOINIT(table) \ rnd_hid_attribute_t *table; \ int table ## _append_lock; \ int table ## _len; \ @@ -167,16 +167,16 @@ void *table ## _hid_ctx; \ int table ## _defx, table ## _defy; \ int table ## _minx, table ## _miny; \ - pcb_dad_retovr_t *table ## _ret_override; + rnd_dad_retovr_t *table ## _ret_override; /* Free all resources allocated by DAD macros for table */ -#define PCB_DAD_FREE(table) \ +#define RND_DAD_FREE(table) \ do { \ int __n__; \ if ((table ## _hid_ctx != NULL) && (table ## _ret_override != NULL)) \ rnd_gui->attr_dlg_free(table ## _hid_ctx); \ for(__n__ = 0; __n__ < table ## _len; __n__++) { \ - PCB_DAD_FREE_FIELD(table, __n__); \ + RND_DAD_FREE_FIELD(table, __n__); \ } \ free(table); \ table = NULL; \ @@ -190,16 +190,16 @@ } \ } while(0) -#define PCB_DAD_NEW(id, table, title, caller_data, modal, ev_cb) \ +#define RND_DAD_NEW(id, table, title, caller_data, modal, ev_cb) \ do { \ - table ## _ret_override = calloc(sizeof(pcb_dad_retovr_t), 1); \ + table ## _ret_override = calloc(sizeof(rnd_dad_retovr_t), 1); \ table ## _append_lock = 1; \ table ## _hid_ctx = rnd_gui->attr_dlg_new(rnd_gui, id, table, table ## _len, title, caller_data, modal, ev_cb, table ## _defx, table ## _defy, table ## _minx, table ## _miny); \ } while(0) /* Sets the default window size (that is only a hint) - NOTE: must be called - before PCB_DAD_NEW() */ -#define PCB_DAD_DEFSIZE(table, width, height) \ + before RND_DAD_NEW() */ +#define RND_DAD_DEFSIZE(table, width, height) \ do { \ table ## _defx = width; \ table ## _defy = height; \ @@ -206,21 +206,21 @@ } while(0) /* Sets the minimum window size (that is only a hint) - NOTE: must be called - before PCB_DAD_NEW() */ -#define PCB_DAD_MINSIZE(table, width, height) \ + before RND_DAD_NEW() */ +#define RND_DAD_MINSIZE(table, width, height) \ do { \ table ## _minx = width; \ table ## _miny = height; \ } while(0) -#define PCB_DAD_RUN(table) pcb_hid_dad_run(table ## _hid_ctx, table ## _ret_override) +#define RND_DAD_RUN(table) rnd_hid_dad_run(table ## _hid_ctx, table ## _ret_override) /* failed is zero on success and -1 on error (e.g. cancel) or an arbitrary value set by ret_override (e.g. on close buttons) */ -#define PCB_DAD_AUTORUN(id, table, title, caller_data, failed) \ +#define RND_DAD_AUTORUN(id, table, title, caller_data, failed) \ do { \ int __ok__; \ - table ## _ret_override = calloc(sizeof(pcb_dad_retovr_t), 1); \ + table ## _ret_override = calloc(sizeof(rnd_dad_retovr_t), 1); \ table ## _ret_override->dont_free++; \ table ## _ret_override->valid = 0; \ table ## _append_lock = 1; \ @@ -232,125 +232,125 @@ } while(0) /* Return the index of the item currenty being edited */ -#define PCB_DAD_CURRENT(table) (table ## _len - 1) +#define RND_DAD_CURRENT(table) (table ## _len - 1) /* Begin a new box or table */ -#define PCB_DAD_BEGIN(table, item_type) \ - PCB_DAD_ALLOC(table, item_type); +#define RND_DAD_BEGIN(table, item_type) \ + RND_DAD_ALLOC(table, item_type); -#define PCB_DAD_BEGIN_TABLE(table, cols) \ +#define RND_DAD_BEGIN_TABLE(table, cols) \ do { \ - PCB_DAD_BEGIN(table, RND_HATT_BEGIN_TABLE); \ - PCB_DAD_SET_ATTR_FIELD(table, rnd_hatt_table_cols, cols); \ + RND_DAD_BEGIN(table, RND_HATT_BEGIN_TABLE); \ + RND_DAD_SET_ATTR_FIELD(table, rnd_hatt_table_cols, cols); \ } while(0) -#define PCB_DAD_BEGIN_TABBED(table, tabs) \ +#define RND_DAD_BEGIN_TABBED(table, tabs) \ do { \ - PCB_DAD_BEGIN(table, RND_HATT_BEGIN_TABBED); \ - PCB_DAD_SET_ATTR_FIELD(table, wdata, tabs); \ + RND_DAD_BEGIN(table, RND_HATT_BEGIN_TABBED); \ + RND_DAD_SET_ATTR_FIELD(table, wdata, tabs); \ } while(0) -#define PCB_DAD_BEGIN_HBOX(table) PCB_DAD_BEGIN(table, RND_HATT_BEGIN_HBOX) -#define PCB_DAD_BEGIN_VBOX(table) PCB_DAD_BEGIN(table, RND_HATT_BEGIN_VBOX) -#define PCB_DAD_END(table) PCB_DAD_BEGIN(table, RND_HATT_END) -#define PCB_DAD_COMPFLAG(table, val) PCB_DAD_SET_ATTR_FIELD(table, rnd_hatt_flags, val | (table[table ## _len-1].rnd_hatt_flags & RND_HATF_TREE_COL)) +#define RND_DAD_BEGIN_HBOX(table) RND_DAD_BEGIN(table, RND_HATT_BEGIN_HBOX) +#define RND_DAD_BEGIN_VBOX(table) RND_DAD_BEGIN(table, RND_HATT_BEGIN_VBOX) +#define RND_DAD_END(table) RND_DAD_BEGIN(table, RND_HATT_END) +#define RND_DAD_COMPFLAG(table, val) RND_DAD_SET_ATTR_FIELD(table, rnd_hatt_flags, val | (table[table ## _len-1].rnd_hatt_flags & RND_HATF_TREE_COL)) -#define PCB_DAD_LABEL(table, text) \ +#define RND_DAD_LABEL(table, text) \ do { \ - PCB_DAD_ALLOC(table, RND_HATT_LABEL); \ - PCB_DAD_SET_ATTR_FIELD(table, name, rnd_strdup(text)); \ + RND_DAD_ALLOC(table, RND_HATT_LABEL); \ + RND_DAD_SET_ATTR_FIELD(table, name, rnd_strdup(text)); \ } while(0) -/* Add label usign printf formatting syntax: PCB_DAD_LABELF(tbl, ("a=%d", 12)); */ -#define PCB_DAD_LABELF(table, printf_args) \ +/* Add label usign printf formatting syntax: RND_DAD_LABELF(tbl, ("a=%d", 12)); */ +#define RND_DAD_LABELF(table, printf_args) \ do { \ - PCB_DAD_ALLOC(table, RND_HATT_LABEL); \ - PCB_DAD_SET_ATTR_FIELD(table, name, pcb_strdup_printf printf_args); \ + RND_DAD_ALLOC(table, RND_HATT_LABEL); \ + RND_DAD_SET_ATTR_FIELD(table, name, pcb_strdup_printf printf_args); \ } while(0) -#define PCB_DAD_ENUM(table, choices) \ +#define RND_DAD_ENUM(table, choices) \ do { \ - PCB_DAD_ALLOC(table, RND_HATT_ENUM); \ - PCB_DAD_SET_ATTR_FIELD(table, wdata, choices); \ + RND_DAD_ALLOC(table, RND_HATT_ENUM); \ + RND_DAD_SET_ATTR_FIELD(table, wdata, choices); \ } while(0) -#define PCB_DAD_BOOL(table, label) \ +#define RND_DAD_BOOL(table, label) \ do { \ - PCB_DAD_ALLOC(table, RND_HATT_BOOL); \ - PCB_DAD_SET_ATTR_FIELD(table, name, rnd_strdup(label)); \ + RND_DAD_ALLOC(table, RND_HATT_BOOL); \ + RND_DAD_SET_ATTR_FIELD(table, name, rnd_strdup(label)); \ } while(0) -#define PCB_DAD_INTEGER(table, label) \ +#define RND_DAD_INTEGER(table, label) \ do { \ PCB_DAD_SPIN_INT(table); \ - PCB_DAD_SET_ATTR_FIELD(table, name, label); \ + RND_DAD_SET_ATTR_FIELD(table, name, label); \ } while(0) -#define PCB_DAD_REAL(table, label) \ +#define RND_DAD_REAL(table, label) \ do { \ PCB_DAD_SPIN_DOUBLE(table); \ - PCB_DAD_SET_ATTR_FIELD(table, name, label); \ + RND_DAD_SET_ATTR_FIELD(table, name, label); \ } while(0) -#define PCB_DAD_COORD(table, label) \ +#define RND_DAD_COORD(table, label) \ do { \ PCB_DAD_SPIN_COORD(table); \ - PCB_DAD_SET_ATTR_FIELD(table, name, label); \ + RND_DAD_SET_ATTR_FIELD(table, name, label); \ } while(0) -#define PCB_DAD_STRING(table) \ - PCB_DAD_ALLOC(table, RND_HATT_STRING); \ +#define RND_DAD_STRING(table) \ + RND_DAD_ALLOC(table, RND_HATT_STRING); \ -#define PCB_DAD_TEXT(table, user_ctx_) \ +#define RND_DAD_TEXT(table, user_ctx_) \ do { \ rnd_hid_text_t *txt = calloc(sizeof(rnd_hid_text_t), 1); \ txt->user_ctx = user_ctx_; \ - PCB_DAD_ALLOC(table, RND_HATT_TEXT); \ - PCB_DAD_SET_ATTR_FIELD(table, wdata, txt); \ + RND_DAD_ALLOC(table, RND_HATT_TEXT); \ + RND_DAD_SET_ATTR_FIELD(table, wdata, txt); \ } while(0) -#define PCB_DAD_BUTTON(table, text) \ +#define RND_DAD_BUTTON(table, text) \ do { \ - PCB_DAD_ALLOC(table, RND_HATT_BUTTON); \ + RND_DAD_ALLOC(table, RND_HATT_BUTTON); \ table[table ## _len - 1].val.str = text; \ } while(0) -#define PCB_DAD_BUTTON_CLOSE(table, text, retval) \ +#define RND_DAD_BUTTON_CLOSE(table, text, retval) \ do { \ - PCB_DAD_ALLOC(table, RND_HATT_BUTTON); \ + RND_DAD_ALLOC(table, RND_HATT_BUTTON); \ table[table ## _len - 1].val.str = text; \ table[table ## _len - 1].val.lng = retval; \ table[table ## _len - 1].wdata = (&table ## _ret_override); \ - PCB_DAD_CHANGE_CB(table, pcb_hid_dad_close_cb); \ + RND_DAD_CHANGE_CB(table, rnd_hid_dad_close_cb); \ } while(0) /* Draw a set of close buttons without trying to fill a while hbox row */ -#define PCB_DAD_BUTTON_CLOSES_NAKED(table, buttons) \ +#define RND_DAD_BUTTON_CLOSES_NAKED(table, buttons) \ do { \ - pcb_hid_dad_buttons_t *__n__; \ - PCB_DAD_BEGIN_HBOX(table); \ - PCB_DAD_COMPFLAG(table, RND_HATF_EXPFILL); \ - PCB_DAD_END(table); \ + rnd_hid_dad_buttons_t *__n__; \ + RND_DAD_BEGIN_HBOX(table); \ + RND_DAD_COMPFLAG(table, RND_HATF_EXPFILL); \ + RND_DAD_END(table); \ for(__n__ = buttons; __n__->label != NULL; __n__++) { \ - PCB_DAD_BUTTON_CLOSE(table, __n__->label, __n__->retval); \ + RND_DAD_BUTTON_CLOSE(table, __n__->label, __n__->retval); \ } \ } while(0) /* Draw a set of close buttons, adding a new hbox that tries to fill a whole row */ -#define PCB_DAD_BUTTON_CLOSES(table, buttons) \ +#define RND_DAD_BUTTON_CLOSES(table, buttons) \ do { \ - PCB_DAD_BEGIN_HBOX(table); \ - PCB_DAD_BUTTON_CLOSES_NAKED(table, buttons); \ - PCB_DAD_END(table); \ + RND_DAD_BEGIN_HBOX(table); \ + RND_DAD_BUTTON_CLOSES_NAKED(table, buttons); \ + RND_DAD_END(table); \ } while(0) -#define PCB_DAD_PROGRESS(table) \ +#define RND_DAD_PROGRESS(table) \ do { \ - PCB_DAD_ALLOC(table, RND_HATT_PROGRESS); \ + RND_DAD_ALLOC(table, RND_HATT_PROGRESS); \ } while(0) -#define PCB_DAD_PREVIEW(table, expose_cb, mouse_cb, free_cb, initial_view_box, min_sizex_px_, min_sizey_px_, user_ctx_) \ +#define RND_DAD_PREVIEW(table, expose_cb, mouse_cb, free_cb, initial_view_box, min_sizex_px_, min_sizey_px_, user_ctx_) \ do { \ rnd_hid_preview_t *prv = calloc(sizeof(rnd_hid_preview_t), 1); \ prv->user_ctx = user_ctx_; \ @@ -366,12 +366,12 @@ prv->initial_view.Y2 = ((rnd_rnd_box_t *)(initial_view_box))->Y2; \ prv->initial_view_valid = 1; \ } \ - PCB_DAD_ALLOC(table, RND_HATT_PREVIEW); \ + RND_DAD_ALLOC(table, RND_HATT_PREVIEW); \ prv->attrib = &table[table ## _len-1]; \ - PCB_DAD_SET_ATTR_FIELD(table, wdata, prv); \ + RND_DAD_SET_ATTR_FIELD(table, wdata, prv); \ } while(0) -#define pcb_dad_preview_zoomto(attr, view) \ +#define rnd_dad_preview_zoomto(attr, view) \ do { \ rnd_hid_preview_t *prv = ((attr)->wdata); \ if (prv->hid_zoomto_cb != NULL) \ @@ -379,77 +379,77 @@ } while(0) -#define PCB_DAD_PICTURE(table, xpm) \ +#define RND_DAD_PICTURE(table, xpm) \ do { \ - PCB_DAD_ALLOC(table, RND_HATT_PICTURE); \ + RND_DAD_ALLOC(table, RND_HATT_PICTURE); \ table[table ## _len - 1].wdata = xpm; \ } while(0) -#define PCB_DAD_PICBUTTON(table, xpm) \ +#define RND_DAD_PICBUTTON(table, xpm) \ do { \ - PCB_DAD_ALLOC(table, RND_HATT_PICBUTTON); \ + RND_DAD_ALLOC(table, RND_HATT_PICBUTTON); \ table[table ## _len - 1].wdata = xpm; \ } while(0) -#define PCB_DAD_COLOR(table) \ +#define RND_DAD_COLOR(table) \ do { \ - PCB_DAD_ALLOC(table, RND_HATT_COLOR); \ + RND_DAD_ALLOC(table, RND_HATT_COLOR); \ } while(0) -#define PCB_DAD_BEGIN_HPANE(table) \ +#define RND_DAD_BEGIN_HPANE(table) \ do { \ - PCB_DAD_BEGIN(table, RND_HATT_BEGIN_HPANE); \ + RND_DAD_BEGIN(table, RND_HATT_BEGIN_HPANE); \ table[table ## _len - 1].val.dbl = 0.5; \ } while(0) -#define PCB_DAD_BEGIN_VPANE(table) \ +#define RND_DAD_BEGIN_VPANE(table) \ do { \ - PCB_DAD_BEGIN(table, RND_HATT_BEGIN_VPANE); \ + RND_DAD_BEGIN(table, RND_HATT_BEGIN_VPANE); \ table[table ## _len - 1].val.dbl = 0.5; \ } while(0) -#define PCB_DAD_TREE(table, cols, first_col_is_tree, opt_header) \ +#define RND_DAD_TREE(table, cols, first_col_is_tree, opt_header) \ do { \ rnd_hid_tree_t *tree = calloc(sizeof(rnd_hid_tree_t), 1); \ htsp_init(&tree->paths, strhash, strkeyeq); \ - PCB_DAD_ALLOC(table, RND_HATT_TREE); \ + RND_DAD_ALLOC(table, RND_HATT_TREE); \ tree->attrib = &table[table ## _len-1]; \ tree->hdr = opt_header; \ - PCB_DAD_SET_ATTR_FIELD(table, rnd_hatt_table_cols, cols); \ - PCB_DAD_SET_ATTR_FIELD(table, rnd_hatt_flags, first_col_is_tree ? RND_HATF_TREE_COL : 0); \ - PCB_DAD_SET_ATTR_FIELD(table, wdata, tree); \ + RND_DAD_SET_ATTR_FIELD(table, rnd_hatt_table_cols, cols); \ + RND_DAD_SET_ATTR_FIELD(table, rnd_hatt_flags, first_col_is_tree ? RND_HATF_TREE_COL : 0); \ + RND_DAD_SET_ATTR_FIELD(table, wdata, tree); \ } while(0) -#define PCB_DAD_TREE_APPEND(table, row_after, cells) \ - pcb_dad_tree_append(&table[table ## _len-1], row_after, cells) +#define RND_DAD_TREE_APPEND(table, row_after, cells) \ + rnd_dad_tree_append(&table[table ## _len-1], row_after, cells) -#define PCB_DAD_TREE_APPEND_UNDER(table, parent_row, cells) \ - pcb_dad_tree_append_under(&table[table ## _len-1], parent_row, cells) +#define RND_DAD_TREE_APPEND_UNDER(table, parent_row, cells) \ + rnd_dad_tree_append_under(&table[table ## _len-1], parent_row, cells) -#define PCB_DAD_TREE_INSERT(table, row_before, cells) \ - pcb_dad_tree_insert(&table[table ## _len-1], row_before, cells) +#define RND_DAD_TREE_INSERT(table, row_before, cells) \ + rnd_dad_tree_insert(&table[table ## _len-1], row_before, cells) /* set the named tree user callback to func_or_data; name is automatically appended with user_, any field prefixed with user_ in rnd_hid_tree_t can be set */ -#define PCB_DAD_TREE_SET_CB(table, name, func_or_data) \ +#define RND_DAD_TREE_SET_CB(table, name, func_or_data) \ do { \ rnd_hid_tree_t *__tree__ = table[table ## _len-1].wdata; \ __tree__->user_ ## name = func_or_data; \ } while(0) -#define PCB_DAD_DUP_ATTR(table, attr) \ +#define RND_DAD_DUP_ATTR(table, attr) \ do { \ - PCB_DAD_ALLOC(table, 0); \ + RND_DAD_ALLOC(table, 0); \ memcpy(&table[table ## _len-1], (attr), sizeof(rnd_hid_attribute_t)); \ - PCB_DAD_UPDATE_INTERNAL(table, table ## _len-1); \ + RND_DAD_UPDATE_INTERNAL(table, table ## _len-1); \ } while(0) -#define PCB_DAD_DUP_EXPOPT(table, opt) \ +#define RND_DAD_DUP_EXPOPT(table, opt) \ do { \ rnd_export_opt_t *__opt__ = (opt); \ - PCB_DAD_ALLOC(table, 0); \ + RND_DAD_ALLOC(table, 0); \ table[table ## _len-1].name = __opt__->name; \ table[table ## _len-1].help_text = __opt__->help_text; \ table[table ## _len-1].type = __opt__->type; \ @@ -457,19 +457,19 @@ table[table ## _len-1].max_val = __opt__->max_val; \ table[table ## _len-1].val = __opt__->default_val; \ table[table ## _len-1].wdata = __opt__->enumerations; \ - PCB_DAD_UPDATE_INTERNAL(table, table ## _len-1); \ + RND_DAD_UPDATE_INTERNAL(table, table ## _len-1); \ } while(0) /* Set properties of the current item */ -#define PCB_DAD_MINVAL(table, val) PCB_DAD_SET_ATTR_FIELD(table, min_val, val) -#define PCB_DAD_MAXVAL(table, val) PCB_DAD_SET_ATTR_FIELD(table, max_val, val) -#define PCB_DAD_MINMAX(table, min, max) (PCB_DAD_SET_ATTR_FIELD(table, min_val, min),PCB_DAD_SET_ATTR_FIELD(table, max_val, max)) -#define PCB_DAD_CHANGE_CB(table, cb) PCB_DAD_SET_ATTR_FIELD(table, change_cb, cb) -#define PCB_DAD_RIGHT_CB(table, cb) PCB_DAD_SET_ATTR_FIELD(table, right_cb, cb) -#define PCB_DAD_ENTER_CB(table, cb) PCB_DAD_SET_ATTR_FIELD(table, enter_cb, cb) +#define RND_DAD_MINVAL(table, val) RND_DAD_SET_ATTR_FIELD(table, min_val, val) +#define RND_DAD_MAXVAL(table, val) RND_DAD_SET_ATTR_FIELD(table, max_val, val) +#define RND_DAD_MINMAX(table, min, max) (RND_DAD_SET_ATTR_FIELD(table, min_val, min),RND_DAD_SET_ATTR_FIELD(table, max_val, max)) +#define RND_DAD_CHANGE_CB(table, cb) RND_DAD_SET_ATTR_FIELD(table, change_cb, cb) +#define RND_DAD_RIGHT_CB(table, cb) RND_DAD_SET_ATTR_FIELD(table, right_cb, cb) +#define RND_DAD_ENTER_CB(table, cb) RND_DAD_SET_ATTR_FIELD(table, enter_cb, cb) -#define PCB_DAD_HELP(table, val) \ +#define RND_DAD_HELP(table, val) \ do { \ switch(table[table ## _len - 1].type) { \ case RND_HATT_END: \ @@ -480,11 +480,11 @@ } \ break; \ default: \ - PCB_DAD_SET_ATTR_FIELD(table, help_text, val); \ + RND_DAD_SET_ATTR_FIELD(table, help_text, val); \ } \ } while(0) -#define PCB_DAD_DEFAULT_PTR(table, val_) \ +#define RND_DAD_DEFAULT_PTR(table, val_) \ do {\ switch(table[table ## _len - 1].type) { \ case RND_HATT_BEGIN_COMPOUND: \ @@ -498,11 +498,11 @@ } \ break; \ default: \ - PCB_DAD_SET_ATTR_FIELD_PTR(table, val, val_); \ + RND_DAD_SET_ATTR_FIELD_PTR(table, val, val_); \ } \ } while(0) -#define PCB_DAD_DEFAULT_NUM(table, val_) \ +#define RND_DAD_DEFAULT_NUM(table, val_) \ do {\ switch(table[table ## _len - 1].type) { \ case RND_HATT_BEGIN_COMPOUND: \ @@ -516,12 +516,12 @@ } \ break; \ default: \ - PCB_DAD_SET_ATTR_FIELD_NUM(table, val, val_); \ + RND_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 RND_DAD_SET_VALUE(hid_ctx, wid, field, val_) \ do { \ rnd_hid_attr_val_t __val__; \ memset(&__val__, 0, sizeof(__val__)); \ @@ -532,7 +532,7 @@ /*** DAD internals (do not use directly) ***/ /* Update widget internals after a potential attr pointer change */ -#define PCB_DAD_UPDATE_INTERNAL(table, widx) \ +#define RND_DAD_UPDATE_INTERNAL(table, widx) \ do { \ rnd_hid_preview_t *__prv__; \ rnd_hid_tree_t *__tree__; \ @@ -552,7 +552,7 @@ /* Allocate a new item at the end of the attribute table; updates stored attribute pointers of existing items (e.g. previews, trees) as the base address of the table may have changed. */ -#define PCB_DAD_ALLOC(table, item_type) \ +#define RND_DAD_ALLOC(table, item_type) \ do { \ assert(table ## _append_lock == 0); \ if (table ## _len >= table ## _alloced) { \ @@ -560,7 +560,7 @@ table ## _alloced += 16; \ table = realloc(table, sizeof(table[0]) * table ## _alloced); \ for(__n__ = 0; __n__ < table ## _len; __n__++) { \ - PCB_DAD_UPDATE_INTERNAL(table, __n__); \ + RND_DAD_UPDATE_INTERNAL(table, __n__); \ } \ } \ memset(&table[table ## _len], 0, sizeof(table[0])); \ @@ -568,13 +568,13 @@ table ## _len++; \ } while(0) -#define PCB_DAD_SET_ATTR_FIELD(table, field, value) \ +#define RND_DAD_SET_ATTR_FIELD(table, field, value) \ table[table ## _len - 1].field = (value) -#define PCB_DAD_OR_ATTR_FIELD(table, field, value) \ +#define RND_DAD_OR_ATTR_FIELD(table, field, value) \ table[table ## _len - 1].field |= (value) -#define PCB_DAD_SET_ATTR_FIELD_VAL(table, field, val) \ +#define RND_DAD_SET_ATTR_FIELD_VAL(table, field, val) \ do { \ switch(table[table ## _len - 1].type) { \ case RND_HATT_LABEL: \ @@ -617,7 +617,7 @@ } \ } while(0) -#define PCB_DAD_SET_ATTR_FIELD_NUM(table, field, val_) \ +#define RND_DAD_SET_ATTR_FIELD_NUM(table, field, val_) \ do { \ switch(table[table ## _len - 1].type) { \ case RND_HATT_LABEL: \ @@ -666,7 +666,7 @@ } \ } while(0) -#define PCB_DAD_SET_ATTR_FIELD_PTR(table, field, val_) \ +#define RND_DAD_SET_ATTR_FIELD_PTR(table, field, val_) \ do { \ switch(table[table ## _len - 1].type) { \ case RND_HATT_LABEL: \ @@ -725,7 +725,7 @@ } \ } while(0) -#define PCB_DAD_FREE_FIELD(table, field) \ +#define RND_DAD_FREE_FIELD(table, field) \ do { \ switch(table[field].type) { \ case RND_HATT_LABEL: \ @@ -745,7 +745,7 @@ case RND_HATT_COLOR: \ break; \ case RND_HATT_TREE: \ - pcb_dad_tree_free(&table[field]); \ + rnd_dad_tree_free(&table[field]); \ break; \ case RND_HATT_PREVIEW: \ { \ @@ -784,7 +784,7 @@ } \ } while(0) -#define PCB_DAD_WIDTH_CHR(table, width) \ +#define RND_DAD_WIDTH_CHR(table, width) \ do { \ if ((table[table ## _len - 1].type) == RND_HATT_END) { \ rnd_hid_compound_t *cmp = table[table ## _len - 1].wdata; \ @@ -792,13 +792,13 @@ cmp->set_geo(&table[table ## _len - 1], RND_HATF_HEIGHT_CHR, (width)); \ } \ else { \ - PCB_DAD_OR_ATTR_FIELD(table, hatt_flags, RND_HATF_HEIGHT_CHR); \ - PCB_DAD_SET_ATTR_FIELD(table, geo_width, (width)); \ + RND_DAD_OR_ATTR_FIELD(table, hatt_flags, RND_HATF_HEIGHT_CHR); \ + RND_DAD_SET_ATTR_FIELD(table, geo_width, (width)); \ } \ } while(0) /* Internal: free all rows and caches and the tree itself */ -void pcb_dad_tree_free(rnd_hid_attribute_t *attr); +void rnd_dad_tree_free(rnd_hid_attribute_t *attr); /* internal: retval override for the auto-close buttons */ typedef struct { @@ -805,22 +805,22 @@ int dont_free; int valid; int value; -} pcb_dad_retovr_t; +} rnd_dad_retovr_t; typedef struct { const char *label; int retval; -} pcb_hid_dad_buttons_t; +} rnd_hid_dad_buttons_t; -void pcb_hid_dad_close(void *hid_ctx, pcb_dad_retovr_t *retovr, int retval); -void pcb_hid_dad_close_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr); -int pcb_hid_dad_run(void *hid_ctx, pcb_dad_retovr_t *retovr); -void pcb_hid_iterate(rnd_hid_t *hid); +void rnd_hid_dad_close(void *hid_ctx, rnd_dad_retovr_t *retovr, int retval); +void rnd_hid_dad_close_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr); +int rnd_hid_dad_run(void *hid_ctx, rnd_dad_retovr_t *retovr); +void rnd_hid_iterate(rnd_hid_t *hid); /* sub-dialogs e.g. for the file selector dialog */ struct rnd_hid_dad_subdialog_s { /* filled in by the sub-dialog's creator */ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) /* filled in by the parent dialog's code, the subdialog's code should call this to query/change properties of the parent dialog. cmd and @@ -841,7 +841,7 @@ }; typedef struct pcb_hid_export_opt_func_dad_s { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) } pcb_hid_export_opt_func_dad_t; #endif Index: trunk/src/librnd/core/hid_dad_spin.c =================================================================== --- trunk/src/librnd/core/hid_dad_spin.c (revision 30991) +++ trunk/src/librnd/core/hid_dad_spin.c (revision 30992) @@ -123,7 +123,7 @@ } typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) rnd_hid_attribute_t *end; int wout, wunit, wstick, wglob, valid; char buf[128]; @@ -165,7 +165,7 @@ static void spin_unit_dialog(void *spin_hid_ctx, pcb_hid_dad_spin_t *spin, rnd_hid_attribute_t *end, rnd_hid_attribute_t *str) { - pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; spin_unit_t ctx; const rnd_unit_t *def_unit; int dlgfail; @@ -175,40 +175,40 @@ def_unit = spin->unit == NULL ? pcbhl_conf.editor.grid_unit : spin->unit; - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABLE(ctx.dlg, 2); - PCB_DAD_COMPFLAG(ctx.dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(ctx.dlg, "Original:"); - PCB_DAD_LABEL(ctx.dlg, str->val.str); - PCB_DAD_LABEL(ctx.dlg, "With new unit:"); - PCB_DAD_LABEL(ctx.dlg, ""); - ctx.wout = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_END(ctx.dlg); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABLE(ctx.dlg, 2); + RND_DAD_COMPFLAG(ctx.dlg, RND_HATF_FRAME); + RND_DAD_LABEL(ctx.dlg, "Original:"); + RND_DAD_LABEL(ctx.dlg, str->val.str); + RND_DAD_LABEL(ctx.dlg, "With new unit:"); + RND_DAD_LABEL(ctx.dlg, ""); + ctx.wout = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_END(ctx.dlg); - PCB_DAD_BEGIN_TABLE(ctx.dlg, 2); - PCB_DAD_LABEL(ctx.dlg, "Preferred unit"); + RND_DAD_BEGIN_TABLE(ctx.dlg, 2); + RND_DAD_LABEL(ctx.dlg, "Preferred unit"); PCB_DAD_UNIT(ctx.dlg, spin->unit_family); - ctx.wunit = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_HELP(ctx.dlg, "Convert value to this unit and rewrite\nthe text entry field with the converted value."); - PCB_DAD_DEFAULT_PTR(ctx.dlg, def_unit); - PCB_DAD_CHANGE_CB(ctx.dlg, spin_unit_chg_cb); + ctx.wunit = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_HELP(ctx.dlg, "Convert value to this unit and rewrite\nthe text entry field with the converted value."); + RND_DAD_DEFAULT_PTR(ctx.dlg, def_unit); + RND_DAD_CHANGE_CB(ctx.dlg, spin_unit_chg_cb); if (spin->unit_family == (PCB_UNIT_METRIC | PCB_UNIT_IMPERIAL)) { - PCB_DAD_LABEL(ctx.dlg, "Use the global"); - PCB_DAD_BOOL(ctx.dlg, ""); - PCB_DAD_HELP(ctx.dlg, "Ignore the above unit selection,\nuse the global unit (grid unit) in this spinbox,\nfollow changes of the global unit"); - ctx.wglob = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_DEFAULT_NUM(ctx.dlg, (spin->unit == NULL)); - PCB_DAD_CHANGE_CB(ctx.dlg, spin_unit_chg_cb); + RND_DAD_LABEL(ctx.dlg, "Use the global"); + RND_DAD_BOOL(ctx.dlg, ""); + RND_DAD_HELP(ctx.dlg, "Ignore the above unit selection,\nuse the global unit (grid unit) in this spinbox,\nfollow changes of the global unit"); + ctx.wglob = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_DEFAULT_NUM(ctx.dlg, (spin->unit == NULL)); + RND_DAD_CHANGE_CB(ctx.dlg, spin_unit_chg_cb); - PCB_DAD_LABEL(ctx.dlg, "Stick to unit"); - PCB_DAD_BOOL(ctx.dlg, ""); - PCB_DAD_HELP(ctx.dlg, "Upon any update from software, switch back to\the selected unit even if the user specified\na different unit in the text field."); - ctx.wstick = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_DEFAULT_NUM(ctx.dlg, spin->no_unit_chg); - PCB_DAD_CHANGE_CB(ctx.dlg, spin_unit_chg_cb); + RND_DAD_LABEL(ctx.dlg, "Stick to unit"); + RND_DAD_BOOL(ctx.dlg, ""); + RND_DAD_HELP(ctx.dlg, "Upon any update from software, switch back to\the selected unit even if the user specified\na different unit in the text field."); + ctx.wstick = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_DEFAULT_NUM(ctx.dlg, spin->no_unit_chg); + RND_DAD_CHANGE_CB(ctx.dlg, spin_unit_chg_cb); } else { ctx.wglob = -1; @@ -215,18 +215,18 @@ ctx.wstick = -1; } - PCB_DAD_END(ctx.dlg); + RND_DAD_END(ctx.dlg); - PCB_DAD_BEGIN_HBOX(ctx.dlg); - PCB_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HBOX(ctx.dlg); - PCB_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx.dlg); - PCB_DAD_BUTTON_CLOSES(ctx.dlg, clbtn); - PCB_DAD_END(ctx.dlg); - PCB_DAD_END(ctx.dlg); + RND_DAD_BEGIN_HBOX(ctx.dlg); + RND_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_HBOX(ctx.dlg); + RND_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx.dlg); + RND_DAD_BUTTON_CLOSES(ctx.dlg, clbtn); + RND_DAD_END(ctx.dlg); + RND_DAD_END(ctx.dlg); - PCB_DAD_AUTORUN("unit", ctx.dlg, "spinbox coord unit change", &ctx, dlgfail); + RND_DAD_AUTORUN("unit", ctx.dlg, "spinbox coord unit change", &ctx, dlgfail); if ((dlgfail == 0) && (ctx.valid)) { rnd_hid_attr_val_t hv; int unum = ctx.dlg[ctx.wunit].val.lng; @@ -248,7 +248,7 @@ rnd_gui->attr_dlg_set_value(spin_hid_ctx, spin->wstr, &hv); } - PCB_DAD_FREE(ctx.dlg); + RND_DAD_FREE(ctx.dlg); } static double get_step(pcb_hid_dad_spin_t *spin, rnd_hid_attribute_t *end, rnd_hid_attribute_t *str) Index: trunk/src/librnd/core/hid_dad_spin.h =================================================================== --- trunk/src/librnd/core/hid_dad_spin.h (revision 30991) +++ trunk/src/librnd/core/hid_dad_spin.h (revision 30992) @@ -70,46 +70,46 @@ #define PCB_DAD_SPIN_ANY(table, typ, wtyp, has_unit, unit_family_) \ do { \ pcb_hid_dad_spin_t *spin = calloc(sizeof(pcb_hid_dad_spin_t), 1); \ - PCB_DAD_BEGIN(table, RND_HATT_BEGIN_COMPOUND); \ - spin->cmp.wbegin = PCB_DAD_CURRENT(table); \ - PCB_DAD_SET_ATTR_FIELD(table, wdata, spin); \ - PCB_DAD_BEGIN_HBOX(table); \ - spin->wall = PCB_DAD_CURRENT(table); \ - PCB_DAD_COMPFLAG(table, RND_HATF_TIGHT); \ - PCB_DAD_STRING(table); \ - PCB_DAD_DEFAULT_PTR(table, rnd_strdup("")); \ - PCB_DAD_ENTER_CB(table, pcb_dad_spin_txt_enter_cb); \ - PCB_DAD_CHANGE_CB(table, pcb_dad_spin_txt_change_cb); \ - PCB_DAD_SET_ATTR_FIELD(table, user_data, (const char **)spin); \ - spin->wstr = PCB_DAD_CURRENT(table); \ - PCB_DAD_BEGIN_VBOX(table); \ - PCB_DAD_COMPFLAG(table, RND_HATF_TIGHT); \ - PCB_DAD_PICBUTTON(table, pcb_hid_dad_spin_up); \ - PCB_DAD_CHANGE_CB(table, pcb_dad_spin_up_cb); \ - PCB_DAD_SET_ATTR_FIELD(table, user_data, (const char **)spin); \ - spin->wup = PCB_DAD_CURRENT(table); \ - PCB_DAD_PICBUTTON(table, pcb_hid_dad_spin_down); \ - PCB_DAD_CHANGE_CB(table, pcb_dad_spin_down_cb); \ - PCB_DAD_SET_ATTR_FIELD(table, user_data, (const char **)spin); \ - spin->wdown = PCB_DAD_CURRENT(table); \ - PCB_DAD_END(table); \ - PCB_DAD_BEGIN_VBOX(table); \ - PCB_DAD_COMPFLAG(table, RND_HATF_TIGHT); \ + RND_DAD_BEGIN(table, RND_HATT_BEGIN_COMPOUND); \ + spin->cmp.wbegin = RND_DAD_CURRENT(table); \ + RND_DAD_SET_ATTR_FIELD(table, wdata, spin); \ + RND_DAD_BEGIN_HBOX(table); \ + spin->wall = RND_DAD_CURRENT(table); \ + RND_DAD_COMPFLAG(table, RND_HATF_TIGHT); \ + RND_DAD_STRING(table); \ + RND_DAD_DEFAULT_PTR(table, rnd_strdup("")); \ + RND_DAD_ENTER_CB(table, pcb_dad_spin_txt_enter_cb); \ + RND_DAD_CHANGE_CB(table, pcb_dad_spin_txt_change_cb); \ + RND_DAD_SET_ATTR_FIELD(table, user_data, (const char **)spin); \ + spin->wstr = RND_DAD_CURRENT(table); \ + RND_DAD_BEGIN_VBOX(table); \ + RND_DAD_COMPFLAG(table, RND_HATF_TIGHT); \ + RND_DAD_PICBUTTON(table, pcb_hid_dad_spin_up); \ + RND_DAD_CHANGE_CB(table, pcb_dad_spin_up_cb); \ + RND_DAD_SET_ATTR_FIELD(table, user_data, (const char **)spin); \ + spin->wup = RND_DAD_CURRENT(table); \ + RND_DAD_PICBUTTON(table, pcb_hid_dad_spin_down); \ + RND_DAD_CHANGE_CB(table, pcb_dad_spin_down_cb); \ + RND_DAD_SET_ATTR_FIELD(table, user_data, (const char **)spin); \ + spin->wdown = RND_DAD_CURRENT(table); \ + RND_DAD_END(table); \ + RND_DAD_BEGIN_VBOX(table); \ + RND_DAD_COMPFLAG(table, RND_HATF_TIGHT); \ if (has_unit) { \ - PCB_DAD_PICBUTTON(table, pcb_hid_dad_spin_unit); \ - PCB_DAD_CHANGE_CB(table, pcb_dad_spin_unit_cb); \ - PCB_DAD_SET_ATTR_FIELD(table, user_data, (const char **)spin); \ - spin->wunit = PCB_DAD_CURRENT(table); \ + RND_DAD_PICBUTTON(table, pcb_hid_dad_spin_unit); \ + RND_DAD_CHANGE_CB(table, pcb_dad_spin_unit_cb); \ + RND_DAD_SET_ATTR_FIELD(table, user_data, (const char **)spin); \ + spin->wunit = RND_DAD_CURRENT(table); \ } \ - PCB_DAD_PICTURE(table, pcb_hid_dad_spin_warn); \ - PCB_DAD_COMPFLAG(table, RND_HATF_HIDE); \ - PCB_DAD_SET_ATTR_FIELD(table, user_data, (const char **)spin); \ - spin->wwarn = PCB_DAD_CURRENT(table); \ - PCB_DAD_END(table); \ - PCB_DAD_END(table); \ - PCB_DAD_END(table); \ - PCB_DAD_SET_ATTR_FIELD(table, wdata, spin); \ - spin->cmp.wend = PCB_DAD_CURRENT(table); \ + RND_DAD_PICTURE(table, pcb_hid_dad_spin_warn); \ + RND_DAD_COMPFLAG(table, RND_HATF_HIDE); \ + RND_DAD_SET_ATTR_FIELD(table, user_data, (const char **)spin); \ + spin->wwarn = RND_DAD_CURRENT(table); \ + RND_DAD_END(table); \ + RND_DAD_END(table); \ + RND_DAD_END(table); \ + RND_DAD_SET_ATTR_FIELD(table, wdata, spin); \ + spin->cmp.wend = RND_DAD_CURRENT(table); \ \ spin->cmp.free = pcb_dad_spin_free; \ spin->cmp.set_val_num = pcb_dad_spin_set_num; \ Index: trunk/src/librnd/core/hid_dad_tree.c =================================================================== --- trunk/src/librnd/core/hid_dad_tree.c (revision 30991) +++ trunk/src/librnd/core/hid_dad_tree.c (revision 30992) @@ -53,7 +53,7 @@ } /* Internal: free all rows and caches and the tree itself */ -void pcb_dad_tree_free(rnd_hid_attribute_t *attr) +void rnd_dad_tree_free(rnd_hid_attribute_t *attr) { rnd_hid_tree_t *tree = attr->wdata; htsp_uninit(&tree->paths); @@ -102,7 +102,7 @@ if (parent != NULL) return parent; cell[0] = rnd_strdup(path); - return pcb_dad_tree_append(tree->attrib, NULL, cell); + return rnd_dad_tree_append(tree->attrib, NULL, cell); } /* non-root-dir: get or create parent */ @@ -112,11 +112,11 @@ if (cells == NULL) { cell[0] = rnd_strdup(last); - return pcb_dad_tree_append_under(tree->attrib, parent, cell); + return rnd_dad_tree_append_under(tree->attrib, parent, cell); } old = cell[0]; cells[0] = rnd_strdup(last); free(old); - return pcb_dad_tree_append_under(tree->attrib, parent, cells); + return rnd_dad_tree_append_under(tree->attrib, parent, cells); } Index: trunk/src/librnd/core/hid_dad_tree.h =================================================================== --- trunk/src/librnd/core/hid_dad_tree.h (revision 30991) +++ trunk/src/librnd/core/hid_dad_tree.h (revision 30992) @@ -132,7 +132,7 @@ /* allocate a new row and append it after aft; if aft is NULL, the new row is appended at the end of the list of entries in the root (== at the bottom of the list) */ -RND_INLINE rnd_hid_row_t *pcb_dad_tree_append(rnd_hid_attribute_t *attr, rnd_hid_row_t *aft, char **cols) +RND_INLINE rnd_hid_row_t *rnd_dad_tree_append(rnd_hid_attribute_t *attr, rnd_hid_row_t *aft, char **cols) { rnd_hid_tree_t *tree = attr->wdata; rnd_hid_row_t *nrow = pcb_dad_tree_new_row(cols); @@ -156,7 +156,7 @@ /* allocate a new row and inert it before bfr; if bfr is NULL, the new row is inserted at the beginning of the list of entries in the root (== at the top of the list) */ -RND_INLINE rnd_hid_row_t *pcb_dad_tree_insert(rnd_hid_attribute_t *attr, rnd_hid_row_t *bfr, char **cols) +RND_INLINE rnd_hid_row_t *rnd_dad_tree_insert(rnd_hid_attribute_t *attr, rnd_hid_row_t *bfr, char **cols) { rnd_hid_tree_t *tree = attr->wdata; rnd_hid_row_t *nrow = pcb_dad_tree_new_row(cols); @@ -180,7 +180,7 @@ /* allocate a new row and append it under prn; if aft is NULL, the new row is appended at the end of the list of entries in the root (== at the bottom of the list) */ -RND_INLINE rnd_hid_row_t *pcb_dad_tree_append_under(rnd_hid_attribute_t *attr, rnd_hid_row_t *prn, char **cols) +RND_INLINE rnd_hid_row_t *rnd_dad_tree_append_under(rnd_hid_attribute_t *attr, rnd_hid_row_t *prn, char **cols) { rnd_hid_tree_t *tree = attr->wdata; rnd_hid_row_t *nrow = pcb_dad_tree_new_row(cols); Index: trunk/src/librnd/core/hid_dad_unit.h =================================================================== --- trunk/src/librnd/core/hid_dad_unit.h (revision 30991) +++ trunk/src/librnd/core/hid_dad_unit.h (revision 30992) @@ -46,16 +46,16 @@ #define PCB_DAD_UNIT(table, family_) \ do { \ pcb_hid_dad_unit_t *unit = calloc(sizeof(pcb_hid_dad_unit_t), 1); \ - PCB_DAD_BEGIN(table, RND_HATT_BEGIN_COMPOUND); \ - unit->cmp.wbegin = PCB_DAD_CURRENT(table); \ + RND_DAD_BEGIN(table, RND_HATT_BEGIN_COMPOUND); \ + unit->cmp.wbegin = RND_DAD_CURRENT(table); \ pcb_dad_unit_init(family_); \ - PCB_DAD_ENUM(table, pcb_dad_unit_enum); \ - PCB_DAD_CHANGE_CB(table, pcb_dad_unit_change_cb); \ - PCB_DAD_SET_ATTR_FIELD(table, user_data, (const char **)unit); \ - unit->wenum = PCB_DAD_CURRENT(table); \ - PCB_DAD_END(table); \ - PCB_DAD_SET_ATTR_FIELD(table, wdata, unit); \ - unit->cmp.wend = PCB_DAD_CURRENT(table); \ + RND_DAD_ENUM(table, pcb_dad_unit_enum); \ + RND_DAD_CHANGE_CB(table, pcb_dad_unit_change_cb); \ + RND_DAD_SET_ATTR_FIELD(table, user_data, (const char **)unit); \ + unit->wenum = RND_DAD_CURRENT(table); \ + RND_DAD_END(table); \ + RND_DAD_SET_ATTR_FIELD(table, wdata, unit); \ + unit->cmp.wend = RND_DAD_CURRENT(table); \ \ unit->cmp.set_val_num = pcb_dad_unit_set_num; \ unit->cmp.widget_state = pcb_dad_unit_widget_state; \ Index: trunk/src/librnd/core/hid_dlg.c =================================================================== --- trunk/src/librnd/core/hid_dlg.c (revision 30991) +++ trunk/src/librnd/core/hid_dlg.c (revision 30992) @@ -126,7 +126,7 @@ return -1; } -void pcb_hid_iterate(rnd_hid_t *hid) +void rnd_hid_iterate(rnd_hid_t *hid) { if (hid->iterate != NULL) hid->iterate(hid); @@ -161,7 +161,7 @@ static double last = 0; static int closing = 0; static struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) } ctx; if (message == refresh) { @@ -175,7 +175,7 @@ timer = rnd_gui->add_timer(rnd_gui, progress_refresh_cb, REFRESH_RATE, timer); have_timer = 1; } - pcb_hid_iterate(rnd_gui); + rnd_hid_iterate(rnd_gui); } return 0; } @@ -196,7 +196,7 @@ } if (!closing) { closing = 1; - PCB_DAD_FREE(ctx.dlg); + RND_DAD_FREE(ctx.dlg); } active = 0; } @@ -209,22 +209,22 @@ } if (!active) { - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_LABEL(ctx.dlg, message); - PCB_DAD_PROGRESS(ctx.dlg); - wp = PCB_DAD_CURRENT(ctx.dlg); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_LABEL(ctx.dlg, message); + RND_DAD_PROGRESS(ctx.dlg); + wp = RND_DAD_CURRENT(ctx.dlg); /* need to have a manual cancel button as it needs to call the close cb before really closing the window */ - PCB_DAD_BEGIN_HBOX(ctx.dlg); - PCB_DAD_BEGIN_HBOX(ctx.dlg); - PCB_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx.dlg); - PCB_DAD_BUTTON(ctx.dlg, "cancel"); - PCB_DAD_CHANGE_CB(ctx.dlg, progress_close_btn_cb); - PCB_DAD_END(ctx.dlg); - PCB_DAD_END(ctx.dlg); + RND_DAD_BEGIN_HBOX(ctx.dlg); + RND_DAD_BEGIN_HBOX(ctx.dlg); + RND_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx.dlg); + RND_DAD_BUTTON(ctx.dlg, "cancel"); + RND_DAD_CHANGE_CB(ctx.dlg, progress_close_btn_cb); + RND_DAD_END(ctx.dlg); + RND_DAD_END(ctx.dlg); - PCB_DAD_NEW("progress", ctx.dlg, "pcb-rnd progress", &ctx, pcb_false, progress_close_cb); + RND_DAD_NEW("progress", ctx.dlg, "pcb-rnd progress", &ctx, pcb_false, progress_close_cb); active = 1; cancelled = 0; Index: trunk/src/librnd/pcb_compat.h =================================================================== --- trunk/src/librnd/pcb_compat.h (revision 30991) +++ trunk/src/librnd/pcb_compat.h (revision 30992) @@ -748,3 +748,78 @@ #define pcb_hid_preview_s rnd_hid_preview_s #define pcb_hid_preview_t rnd_hid_preview_t #define pcb_hid_compound_t rnd_hid_compound_t +#define PCB_DAD_DECL RND_DAD_DECL +#define PCB_DAD_DECL_NOINIT RND_DAD_DECL_NOINIT +#define PCB_DAD_FREE RND_DAD_FREE +#define PCB_DAD_NEW RND_DAD_NEW +#define PCB_DAD_DEFSIZE RND_DAD_DEFSIZE +#define PCB_DAD_MINSIZE RND_DAD_MINSIZE +#define PCB_DAD_RUN RND_DAD_RUN +#define PCB_DAD_AUTORUN RND_DAD_AUTORUN +#define PCB_DAD_CURRENT RND_DAD_CURRENT +#define PCB_DAD_BEGIN RND_DAD_BEGIN +#define PCB_DAD_BEGIN_TABLE RND_DAD_BEGIN_TABLE +#define PCB_DAD_BEGIN_TABBED RND_DAD_BEGIN_TABBED +#define PCB_DAD_BEGIN_HBOX RND_DAD_BEGIN_HBOX +#define PCB_DAD_BEGIN_VBOX RND_DAD_BEGIN_VBOX +#define PCB_DAD_END RND_DAD_END +#define PCB_DAD_COMPFLAG RND_DAD_COMPFLAG +#define PCB_DAD_LABEL RND_DAD_LABEL +#define PCB_DAD_LABELF RND_DAD_LABELF +#define PCB_DAD_ENUM RND_DAD_ENUM +#define PCB_DAD_BOOL RND_DAD_BOOL +#define PCB_DAD_INTEGER RND_DAD_INTEGER +#define PCB_DAD_REAL RND_DAD_REAL +#define PCB_DAD_COORD RND_DAD_COORD +#define PCB_DAD_STRING RND_DAD_STRING +#define PCB_DAD_TEXT RND_DAD_TEXT +#define PCB_DAD_BUTTON RND_DAD_BUTTON +#define PCB_DAD_BUTTON_CLOSE RND_DAD_BUTTON_CLOSE +#define PCB_DAD_BUTTON_CLOSES_NAKED RND_DAD_BUTTON_CLOSES_NAKED +#define PCB_DAD_BUTTON_CLOSES RND_DAD_BUTTON_CLOSES +#define PCB_DAD_PROGRESS RND_DAD_PROGRESS +#define PCB_DAD_PREVIEW RND_DAD_PREVIEW +#define PCB_DAD_PICTURE RND_DAD_PICTURE +#define PCB_DAD_PICBUTTON RND_DAD_PICBUTTON +#define PCB_DAD_COLOR RND_DAD_COLOR +#define PCB_DAD_BEGIN_HPANE RND_DAD_BEGIN_HPANE +#define PCB_DAD_BEGIN_VPANE RND_DAD_BEGIN_VPANE +#define PCB_DAD_TREE RND_DAD_TREE +#define PCB_DAD_TREE_APPEND RND_DAD_TREE_APPEND +#define PCB_DAD_TREE_APPEND_UNDER RND_DAD_TREE_APPEND_UNDER +#define PCB_DAD_TREE_INSERT RND_DAD_TREE_INSERT +#define PCB_DAD_TREE_SET_CB RND_DAD_TREE_SET_CB +#define PCB_DAD_DUP_ATTR RND_DAD_DUP_ATTR +#define PCB_DAD_DUP_EXPOPT RND_DAD_DUP_EXPOPT +#define PCB_DAD_MINVAL RND_DAD_MINVAL +#define PCB_DAD_MAXVAL RND_DAD_MAXVAL +#define PCB_DAD_MINMAX RND_DAD_MINMAX +#define PCB_DAD_CHANGE_CB RND_DAD_CHANGE_CB +#define PCB_DAD_RIGHT_CB RND_DAD_RIGHT_CB +#define PCB_DAD_ENTER_CB RND_DAD_ENTER_CB +#define PCB_DAD_HELP RND_DAD_HELP +#define PCB_DAD_DEFAULT_PTR RND_DAD_DEFAULT_PTR +#define PCB_DAD_DEFAULT_NUM RND_DAD_DEFAULT_NUM +#define PCB_DAD_SET_VALUE RND_DAD_SET_VALUE +#define PCB_DAD_UPDATE_INTERNAL RND_DAD_UPDATE_INTERNAL +#define PCB_DAD_ALLOC RND_DAD_ALLOC +#define PCB_DAD_SET_ATTR_FIELD RND_DAD_SET_ATTR_FIELD +#define PCB_DAD_OR_ATTR_FIELD RND_DAD_OR_ATTR_FIELD +#define PCB_DAD_SET_ATTR_FIELD_VAL RND_DAD_SET_ATTR_FIELD_VAL +#define PCB_DAD_SET_ATTR_FIELD_NUM RND_DAD_SET_ATTR_FIELD_NUM +#define PCB_DAD_SET_ATTR_FIELD_PTR RND_DAD_SET_ATTR_FIELD_PTR +#define PCB_DAD_FREE_FIELD RND_DAD_FREE_FIELD +#define PCB_DAD_WIDTH_CHR RND_DAD_WIDTH_CHR +#define pcb_dad_retovr_t rnd_dad_retovr_t +#define pcb_hid_dad_run rnd_hid_dad_run +#define pcb_hid_dad_close_cb rnd_hid_dad_close_cb +#define pcb_hid_dad_buttons_t rnd_hid_dad_buttons_t +#define pcb_dad_preview_zoomto rnd_dad_preview_zoomto +#define pcb_dad_tree_append rnd_dad_tree_append +#define pcb_dad_tree_append_under rnd_dad_tree_append_under +#define pcb_dad_tree_insert rnd_dad_tree_insert +#define pcb_dad_tree_free rnd_dad_tree_free +#define pcb_hid_dad_close rnd_hid_dad_close +#define pcb_hid_iterate rnd_hid_iterate +#define pcb_hid_export_opt_func_dad_s rnd_hid_export_opt_func_dad_s +#define pcb_hid_export_opt_func_dad_t rnd_hid_export_opt_func_dad_t Index: trunk/src_plugins/asm/asm.c =================================================================== --- trunk/src_plugins/asm/asm.c (revision 30991) +++ trunk/src_plugins/asm/asm.c (revision 30992) @@ -86,7 +86,7 @@ /* dialog context */ typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) vtp0_t grps; vtclr_t layer_colors; /* saved before greying out */ int wtbl, wskipg, wdoneg, wskipp, wdonep; @@ -326,7 +326,7 @@ } vtp0_uninit(&asm_ctx.grps); - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); memset(ctx, 0, sizeof(asm_ctx_t)); } @@ -521,7 +521,7 @@ group_t **g; part_t **p; long n, i; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (asm_ctx.active) { RND_ACT_IRES(0); @@ -534,11 +534,11 @@ asm_greyout(1); - PCB_DAD_BEGIN_VBOX(asm_ctx.dlg); - PCB_DAD_COMPFLAG(asm_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_TREE(asm_ctx.dlg, 6, 1, hdr); - asm_ctx.wtbl = PCB_DAD_CURRENT(asm_ctx.dlg); - PCB_DAD_COMPFLAG(asm_ctx.dlg, RND_HATF_SCROLL); + RND_DAD_BEGIN_VBOX(asm_ctx.dlg); + RND_DAD_COMPFLAG(asm_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_TREE(asm_ctx.dlg, 6, 1, hdr); + asm_ctx.wtbl = RND_DAD_CURRENT(asm_ctx.dlg); + RND_DAD_COMPFLAG(asm_ctx.dlg, RND_HATF_SCROLL); for(g = (group_t **)asm_ctx.grps.array, n = 0; n < asm_ctx.grps.used; g++,n++) { rnd_hid_row_t *parent, *child; row[0] = (*g)->name; @@ -548,7 +548,7 @@ row[4] = ""; row[5] = ""; row[6] = NULL; - parent = PCB_DAD_TREE_APPEND(asm_ctx.dlg, NULL, row); + parent = RND_DAD_TREE_APPEND(asm_ctx.dlg, NULL, row); parent->user_data = *g; (*g)->row = parent; for(p = (part_t **)(*g)->parts.array, i = 0; i < (*g)->parts.used; p++,i++) { @@ -579,43 +579,43 @@ row[5] = ""; } row[6] = NULL; - child = PCB_DAD_TREE_APPEND_UNDER(asm_ctx.dlg, parent, row); + child = RND_DAD_TREE_APPEND_UNDER(asm_ctx.dlg, parent, row); child->user_data = *p; (*p)->row = child; } } - PCB_DAD_TREE_SET_CB(asm_ctx.dlg, selected_cb, asm_row_selected); - PCB_DAD_BEGIN_HBOX(asm_ctx.dlg); - PCB_DAD_BUTTON(asm_ctx.dlg, "skip part"); - asm_ctx.wskipp = PCB_DAD_CURRENT(asm_ctx.dlg); - PCB_DAD_HELP(asm_ctx.dlg, "Do not populate this part,\ncontinue with the next part"); - PCB_DAD_CHANGE_CB(asm_ctx.dlg, asm_skip_part); - PCB_DAD_BUTTON(asm_ctx.dlg, "skip group"); - asm_ctx.wskipg = PCB_DAD_CURRENT(asm_ctx.dlg); - PCB_DAD_HELP(asm_ctx.dlg, "Stop populating this group,\ncontinue with the next group"); - PCB_DAD_CHANGE_CB(asm_ctx.dlg, asm_skip_group); - PCB_DAD_BUTTON(asm_ctx.dlg, "done part"); - asm_ctx.wdonep = PCB_DAD_CURRENT(asm_ctx.dlg); - PCB_DAD_HELP(asm_ctx.dlg, "Mark current part done,\ncontinue with the next part"); - PCB_DAD_CHANGE_CB(asm_ctx.dlg, asm_done_part); - PCB_DAD_BUTTON(asm_ctx.dlg, "undo part"); - asm_ctx.wdonep = PCB_DAD_CURRENT(asm_ctx.dlg); - PCB_DAD_HELP(asm_ctx.dlg, "Remove the done mark from the current part,\njump to the next part"); - PCB_DAD_CHANGE_CB(asm_ctx.dlg, asm_undo_part); - PCB_DAD_BUTTON(asm_ctx.dlg, "done group"); - asm_ctx.wdoneg = PCB_DAD_CURRENT(asm_ctx.dlg); - PCB_DAD_HELP(asm_ctx.dlg, "Mark all parts in this group done,\ncontinue with the next group"); - PCB_DAD_CHANGE_CB(asm_ctx.dlg, asm_done_group); - PCB_DAD_BUTTON(asm_ctx.dlg, "undo group"); - asm_ctx.wdoneg = PCB_DAD_CURRENT(asm_ctx.dlg); - PCB_DAD_HELP(asm_ctx.dlg, "Remove the done mark from all parts in this group done,\ncontinue with the next group"); - PCB_DAD_CHANGE_CB(asm_ctx.dlg, asm_undo_group); - PCB_DAD_END(asm_ctx.dlg); - PCB_DAD_BUTTON_CLOSES(asm_ctx.dlg, clbtn); - PCB_DAD_END(asm_ctx.dlg); + RND_DAD_TREE_SET_CB(asm_ctx.dlg, selected_cb, asm_row_selected); + RND_DAD_BEGIN_HBOX(asm_ctx.dlg); + RND_DAD_BUTTON(asm_ctx.dlg, "skip part"); + asm_ctx.wskipp = RND_DAD_CURRENT(asm_ctx.dlg); + RND_DAD_HELP(asm_ctx.dlg, "Do not populate this part,\ncontinue with the next part"); + RND_DAD_CHANGE_CB(asm_ctx.dlg, asm_skip_part); + RND_DAD_BUTTON(asm_ctx.dlg, "skip group"); + asm_ctx.wskipg = RND_DAD_CURRENT(asm_ctx.dlg); + RND_DAD_HELP(asm_ctx.dlg, "Stop populating this group,\ncontinue with the next group"); + RND_DAD_CHANGE_CB(asm_ctx.dlg, asm_skip_group); + RND_DAD_BUTTON(asm_ctx.dlg, "done part"); + asm_ctx.wdonep = RND_DAD_CURRENT(asm_ctx.dlg); + RND_DAD_HELP(asm_ctx.dlg, "Mark current part done,\ncontinue with the next part"); + RND_DAD_CHANGE_CB(asm_ctx.dlg, asm_done_part); + RND_DAD_BUTTON(asm_ctx.dlg, "undo part"); + asm_ctx.wdonep = RND_DAD_CURRENT(asm_ctx.dlg); + RND_DAD_HELP(asm_ctx.dlg, "Remove the done mark from the current part,\njump to the next part"); + RND_DAD_CHANGE_CB(asm_ctx.dlg, asm_undo_part); + RND_DAD_BUTTON(asm_ctx.dlg, "done group"); + asm_ctx.wdoneg = RND_DAD_CURRENT(asm_ctx.dlg); + RND_DAD_HELP(asm_ctx.dlg, "Mark all parts in this group done,\ncontinue with the next group"); + RND_DAD_CHANGE_CB(asm_ctx.dlg, asm_done_group); + RND_DAD_BUTTON(asm_ctx.dlg, "undo group"); + asm_ctx.wdoneg = RND_DAD_CURRENT(asm_ctx.dlg); + RND_DAD_HELP(asm_ctx.dlg, "Remove the done mark from all parts in this group done,\ncontinue with the next group"); + RND_DAD_CHANGE_CB(asm_ctx.dlg, asm_undo_group); + RND_DAD_END(asm_ctx.dlg); + RND_DAD_BUTTON_CLOSES(asm_ctx.dlg, clbtn); + RND_DAD_END(asm_ctx.dlg); asm_ctx.active = 1; - PCB_DAD_NEW("asm", asm_ctx.dlg, "Hand assembly with pcb-rnd", &asm_ctx, pcb_false, asm_close_cb); + RND_DAD_NEW("asm", asm_ctx.dlg, "Hand assembly with pcb-rnd", &asm_ctx, pcb_false, asm_close_cb); /* expand all groups by default */ for(g = (group_t **)asm_ctx.grps.array, n = 0; n < asm_ctx.grps.used; g++,n++) Index: trunk/src_plugins/cam/cam_gui.c =================================================================== --- trunk/src_plugins/cam/cam_gui.c (revision 30991) +++ trunk/src_plugins/cam/cam_gui.c (revision 30992) @@ -34,7 +34,7 @@ static const char *PREFIX_HELP = "File name prefix: every output file\npath will start with this prefix.\nIt is derived from outfile."; typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) cam_ctx_t cam; int wjobs, wdigest, wtxt, woutfile, wprefix, wopts; } cam_dlg_t; @@ -67,7 +67,7 @@ cell[1] = NULL; rnd_conf_loop_list(cn->val.list, item, idx) { cell[0] = rnd_strdup(item->name); - pcb_dad_tree_append(attr, NULL, cell); + rnd_dad_tree_append(attr, NULL, cell); } } @@ -120,7 +120,7 @@ cell[1] = ""; cell[3] = NULL; - pcb_dad_tree_append(attr, NULL, cell); + rnd_dad_tree_append(attr, NULL, cell); break; } } @@ -157,7 +157,7 @@ cell[0] = rnd_strdup(e->key); cell[1] = rnd_strdup(e->value); cell[2] = NULL; - pcb_dad_tree_append(attr, NULL, cell); + rnd_dad_tree_append(attr, NULL, cell); } /* restore cursor */ @@ -239,7 +239,7 @@ { cam_dlg_t *ctx = caller_data; cam_uninit_inst(&ctx->cam); - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); free(ctx); } @@ -246,15 +246,15 @@ /* center aligned label */ static void header_label(cam_dlg_t *ctx, const char *text) { - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, text); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, text); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); } static int cam_gui(rnd_hidlib_t *hidlib, const char *arg) @@ -263,81 +263,81 @@ const char *opt_hdr[] = {"key", "option value", NULL}; const char *script_tabs[] = {"digest", "raw", NULL}; const char *digest_hdr[] = {"file", "plugin", "layer groups", NULL}; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; ctx->cam.hidlib = hidlib; ctx->cam.vars = pcb_cam_vars_alloc(); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HPANE(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_HPANE(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); /* left */ - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_TREE(ctx->dlg, 1, 0, NULL); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - PCB_DAD_TREE_SET_CB(ctx->dlg, selected_cb, cam_job_select_cb); - PCB_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); - ctx->wjobs = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); /* command section */ - PCB_DAD_STRING(ctx->dlg); - PCB_DAD_HELP(ctx->dlg, "Filter text:\nlist jobs with matching name only"); - PCB_DAD_CHANGE_CB(ctx->dlg, cam_gui_filter_cb); - PCB_DAD_BEGIN_VBOX(ctx->dlg); /* filler */ - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "export!"); - PCB_DAD_CHANGE_CB(ctx->dlg, cam_gui_export_cb); - PCB_DAD_HELP(ctx->dlg, "Export the current board using the above selected CAM job\nand the options set on the right"); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); /* left */ + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_TREE(ctx->dlg, 1, 0, NULL); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + RND_DAD_TREE_SET_CB(ctx->dlg, selected_cb, cam_job_select_cb); + RND_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); + ctx->wjobs = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); /* command section */ + RND_DAD_STRING(ctx->dlg); + RND_DAD_HELP(ctx->dlg, "Filter text:\nlist jobs with matching name only"); + RND_DAD_CHANGE_CB(ctx->dlg, cam_gui_filter_cb); + RND_DAD_BEGIN_VBOX(ctx->dlg); /* filler */ + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "export!"); + RND_DAD_CHANGE_CB(ctx->dlg, cam_gui_export_cb); + RND_DAD_HELP(ctx->dlg, "Export the current board using the above selected CAM job\nand the options set on the right"); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); /* right */ - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_VPANE(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); /* top */ - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(ctx->dlg); /* right */ + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VPANE(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); /* top */ + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); header_label(ctx, "CAM job script"); - PCB_DAD_BEGIN_TABBED(ctx->dlg, script_tabs); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABBED(ctx->dlg, script_tabs); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_TREE(ctx->dlg, 3, 0, digest_hdr); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - ctx->wdigest = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_TREE(ctx->dlg, 3, 0, digest_hdr); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + ctx->wdigest = RND_DAD_CURRENT(ctx->dlg); - PCB_DAD_TEXT(ctx->dlg, ctx); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - ctx->wtxt = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); /* bottom */ - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_TEXT(ctx->dlg, ctx); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + ctx->wtxt = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); /* bottom */ + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); header_label(ctx, "CAM options"); - PCB_DAD_BEGIN_TABLE(ctx->dlg, 2); /* special options */ - PCB_DAD_LABEL(ctx->dlg, "outfile"); - PCB_DAD_HELP(ctx->dlg, OUTFILE_HELP); - PCB_DAD_STRING(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, cam_gui_outfile_cb); - ctx->woutfile = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_HELP(ctx->dlg, OUTFILE_HELP); - PCB_DAD_LABEL(ctx->dlg, "prefix"); - PCB_DAD_HELP(ctx->dlg, PREFIX_HELP); - PCB_DAD_LABEL(ctx->dlg, ""); - ctx->wprefix = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_HELP(ctx->dlg, PREFIX_HELP); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_TABLE(ctx->dlg, 2); /* special options */ + RND_DAD_LABEL(ctx->dlg, "outfile"); + RND_DAD_HELP(ctx->dlg, OUTFILE_HELP); + RND_DAD_STRING(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, cam_gui_outfile_cb); + ctx->woutfile = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_HELP(ctx->dlg, OUTFILE_HELP); + RND_DAD_LABEL(ctx->dlg, "prefix"); + RND_DAD_HELP(ctx->dlg, PREFIX_HELP); + RND_DAD_LABEL(ctx->dlg, ""); + ctx->wprefix = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_HELP(ctx->dlg, PREFIX_HELP); + RND_DAD_END(ctx->dlg); - PCB_DAD_TREE(ctx->dlg, 2, 0, opt_hdr); /* option table */ - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - ctx->wopts = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_TREE(ctx->dlg, 2, 0, opt_hdr); /* option table */ + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + ctx->wopts = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_NEW("cam", ctx->dlg, "CAM export", ctx, pcb_false, cam_close_cb); + RND_DAD_NEW("cam", ctx->dlg, "CAM export", ctx, pcb_false, cam_close_cb); { /* set default outfile */ rnd_hid_attr_val_t hv; Index: trunk/src_plugins/ddraft/constraint_gui.c =================================================================== --- trunk/src_plugins/ddraft/constraint_gui.c (revision 30991) +++ trunk/src_plugins/ddraft/constraint_gui.c (revision 30992) @@ -29,7 +29,7 @@ #include typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int active; /* already open - allow only one instance */ /* widget IDs */ @@ -47,7 +47,7 @@ static void cnstgui_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) { cnstgui_ctx_t *ctx = caller_data; - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); memset(ctx, 0, sizeof(cnstgui_ctx_t)); /* reset all states to the initial - includes ctx->active = 0; */ } @@ -66,17 +66,17 @@ len -= l; \ end += l; \ } \ - PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.name, str, rnd_strdup(buff)); \ + RND_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.name, str, rnd_strdup(buff)); \ } while(0) #define c2g_float(name) \ do { \ - PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.name, dbl, cons.name); \ + RND_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.name, dbl, cons.name); \ } while(0) #define c2g_coord(name) \ do { \ - PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.name, crd, cons.name); \ + RND_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.name, crd, cons.name); \ } while(0) /* copy all cons fields into the GUI struct */ @@ -140,19 +140,19 @@ static void reset_line(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) { - PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.line_angle, str, rnd_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, rnd_strdup("")); - PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.line_length_mod, crd, 0); + RND_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.line_angle, str, rnd_strdup("")); + RND_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.line_angle_mod, dbl, 0); + RND_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.line_length, str, rnd_strdup("")); + RND_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.line_length_mod, crd, 0); gui2cons(hid_ctx, caller_data, attr); } static void reset_move(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) { - PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.move_angle, str, rnd_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, rnd_strdup("")); - PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.move_length_mod, crd, 0); + RND_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.move_angle, str, rnd_strdup("")); + RND_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.move_angle_mod, dbl, 0); + RND_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.move_length, str, rnd_strdup("")); + RND_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.move_length_mod, crd, 0); gui2cons(hid_ctx, caller_data, attr); } @@ -178,7 +178,7 @@ return; cnstgui_ctx.inhibit_confchg++; - PCB_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.alldir, lng, conf_core.editor.all_direction_lines); + RND_DAD_SET_VALUE(cnstgui_ctx.dlg_hid_ctx, cnstgui_ctx.alldir, lng, conf_core.editor.all_direction_lines); cnstgui_ctx.inhibit_confchg--; } @@ -199,132 +199,132 @@ int constraint_gui(void) { const char *tab_names[] = {"line", "move", NULL}; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (cnstgui_ctx.active) return 0; /* do not open another */ - PCB_DAD_BEGIN_VBOX(cnstgui_ctx.dlg); - PCB_DAD_COMPFLAG(cnstgui_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABBED(cnstgui_ctx.dlg, tab_names); + RND_DAD_BEGIN_VBOX(cnstgui_ctx.dlg); + RND_DAD_COMPFLAG(cnstgui_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABBED(cnstgui_ctx.dlg, tab_names); /* line */ - PCB_DAD_BEGIN_VBOX(cnstgui_ctx.dlg); - PCB_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); - PCB_DAD_LABEL(cnstgui_ctx.dlg, "All direction lines:"); - PCB_DAD_BOOL(cnstgui_ctx.dlg, ""); - cnstgui_ctx.alldir = PCB_DAD_CURRENT(cnstgui_ctx.dlg); - PCB_DAD_CHANGE_CB(cnstgui_ctx.dlg, set_alldir); - PCB_DAD_HELP(cnstgui_ctx.dlg, "Constraints work well only when\nthe all-direction-lines is enabled"); - PCB_DAD_END(cnstgui_ctx.dlg); - PCB_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); - PCB_DAD_LABEL(cnstgui_ctx.dlg, "Fixed angles:"); - PCB_DAD_STRING(cnstgui_ctx.dlg); - cnstgui_ctx.line_angle = PCB_DAD_CURRENT(cnstgui_ctx.dlg); - PCB_DAD_HELP(cnstgui_ctx.dlg, "space separated list of valid line angles in degree"); - PCB_DAD_BUTTON(cnstgui_ctx.dlg, "apply"); - PCB_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); - PCB_DAD_END(cnstgui_ctx.dlg); - PCB_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); - PCB_DAD_LABEL(cnstgui_ctx.dlg, "Angle modulo:"); - PCB_DAD_REAL(cnstgui_ctx.dlg, ""); - cnstgui_ctx.line_angle_mod = PCB_DAD_CURRENT(cnstgui_ctx.dlg); - PCB_DAD_MINVAL(cnstgui_ctx.dlg, 0); - PCB_DAD_MAXVAL(cnstgui_ctx.dlg, 180); - PCB_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); - PCB_DAD_HELP(cnstgui_ctx.dlg, "if non-zero:\nline angle must be an integer multiply of this value"); - PCB_DAD_END(cnstgui_ctx.dlg); - PCB_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); - PCB_DAD_LABEL(cnstgui_ctx.dlg, "Fixed lengths:"); - PCB_DAD_STRING(cnstgui_ctx.dlg); - cnstgui_ctx.line_length = PCB_DAD_CURRENT(cnstgui_ctx.dlg); - PCB_DAD_HELP(cnstgui_ctx.dlg, "space separated list of valid line lengths"); - PCB_DAD_BUTTON(cnstgui_ctx.dlg, "apply"); - PCB_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); - PCB_DAD_END(cnstgui_ctx.dlg); - PCB_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); - PCB_DAD_LABEL(cnstgui_ctx.dlg, "Length modulo:"); - PCB_DAD_COORD(cnstgui_ctx.dlg, ""); - cnstgui_ctx.line_length_mod = PCB_DAD_CURRENT(cnstgui_ctx.dlg); - PCB_DAD_MINVAL(cnstgui_ctx.dlg, 0); - PCB_DAD_MAXVAL(cnstgui_ctx.dlg, PCB_MM_TO_COORD(1000)); - PCB_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); - PCB_DAD_HELP(cnstgui_ctx.dlg, "if non-zero:\nline length must be an integer multiply of this value"); - PCB_DAD_END(cnstgui_ctx.dlg); + RND_DAD_BEGIN_VBOX(cnstgui_ctx.dlg); + RND_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); + RND_DAD_LABEL(cnstgui_ctx.dlg, "All direction lines:"); + RND_DAD_BOOL(cnstgui_ctx.dlg, ""); + cnstgui_ctx.alldir = RND_DAD_CURRENT(cnstgui_ctx.dlg); + RND_DAD_CHANGE_CB(cnstgui_ctx.dlg, set_alldir); + RND_DAD_HELP(cnstgui_ctx.dlg, "Constraints work well only when\nthe all-direction-lines is enabled"); + RND_DAD_END(cnstgui_ctx.dlg); + RND_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); + RND_DAD_LABEL(cnstgui_ctx.dlg, "Fixed angles:"); + RND_DAD_STRING(cnstgui_ctx.dlg); + cnstgui_ctx.line_angle = RND_DAD_CURRENT(cnstgui_ctx.dlg); + RND_DAD_HELP(cnstgui_ctx.dlg, "space separated list of valid line angles in degree"); + RND_DAD_BUTTON(cnstgui_ctx.dlg, "apply"); + RND_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); + RND_DAD_END(cnstgui_ctx.dlg); + RND_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); + RND_DAD_LABEL(cnstgui_ctx.dlg, "Angle modulo:"); + RND_DAD_REAL(cnstgui_ctx.dlg, ""); + cnstgui_ctx.line_angle_mod = RND_DAD_CURRENT(cnstgui_ctx.dlg); + RND_DAD_MINVAL(cnstgui_ctx.dlg, 0); + RND_DAD_MAXVAL(cnstgui_ctx.dlg, 180); + RND_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); + RND_DAD_HELP(cnstgui_ctx.dlg, "if non-zero:\nline angle must be an integer multiply of this value"); + RND_DAD_END(cnstgui_ctx.dlg); + RND_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); + RND_DAD_LABEL(cnstgui_ctx.dlg, "Fixed lengths:"); + RND_DAD_STRING(cnstgui_ctx.dlg); + cnstgui_ctx.line_length = RND_DAD_CURRENT(cnstgui_ctx.dlg); + RND_DAD_HELP(cnstgui_ctx.dlg, "space separated list of valid line lengths"); + RND_DAD_BUTTON(cnstgui_ctx.dlg, "apply"); + RND_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); + RND_DAD_END(cnstgui_ctx.dlg); + RND_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); + RND_DAD_LABEL(cnstgui_ctx.dlg, "Length modulo:"); + RND_DAD_COORD(cnstgui_ctx.dlg, ""); + cnstgui_ctx.line_length_mod = RND_DAD_CURRENT(cnstgui_ctx.dlg); + RND_DAD_MINVAL(cnstgui_ctx.dlg, 0); + RND_DAD_MAXVAL(cnstgui_ctx.dlg, PCB_MM_TO_COORD(1000)); + RND_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); + RND_DAD_HELP(cnstgui_ctx.dlg, "if non-zero:\nline length must be an integer multiply of this value"); + RND_DAD_END(cnstgui_ctx.dlg); - PCB_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); - PCB_DAD_BUTTON(cnstgui_ctx.dlg, "perpendicular to line"); - PCB_DAD_CHANGE_CB(cnstgui_ctx.dlg, set_perp); - PCB_DAD_HELP(cnstgui_ctx.dlg, "sets the angle constraint perpendicular to a line\nselected on the drawing"); - PCB_DAD_BUTTON(cnstgui_ctx.dlg, "parallel with line"); - PCB_DAD_CHANGE_CB(cnstgui_ctx.dlg, set_paral); - PCB_DAD_HELP(cnstgui_ctx.dlg, "sets the angle constraint parallel to a line\nselected on the drawing"); - PCB_DAD_END(cnstgui_ctx.dlg); + RND_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); + RND_DAD_BUTTON(cnstgui_ctx.dlg, "perpendicular to line"); + RND_DAD_CHANGE_CB(cnstgui_ctx.dlg, set_perp); + RND_DAD_HELP(cnstgui_ctx.dlg, "sets the angle constraint perpendicular to a line\nselected on the drawing"); + RND_DAD_BUTTON(cnstgui_ctx.dlg, "parallel with line"); + RND_DAD_CHANGE_CB(cnstgui_ctx.dlg, set_paral); + RND_DAD_HELP(cnstgui_ctx.dlg, "sets the angle constraint parallel to a line\nselected on the drawing"); + RND_DAD_END(cnstgui_ctx.dlg); - PCB_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); - PCB_DAD_BUTTON(cnstgui_ctx.dlg, "tangential to arc"); - PCB_DAD_CHANGE_CB(cnstgui_ctx.dlg, set_tang); - PCB_DAD_HELP(cnstgui_ctx.dlg, "sets the angle constraint to be tangential to the circle of an arc\nselected on the drawing"); - PCB_DAD_END(cnstgui_ctx.dlg); + RND_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); + RND_DAD_BUTTON(cnstgui_ctx.dlg, "tangential to arc"); + RND_DAD_CHANGE_CB(cnstgui_ctx.dlg, set_tang); + RND_DAD_HELP(cnstgui_ctx.dlg, "sets the angle constraint to be tangential to the circle of an arc\nselected on the drawing"); + RND_DAD_END(cnstgui_ctx.dlg); - PCB_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); - PCB_DAD_BUTTON(cnstgui_ctx.dlg, "Reset"); - PCB_DAD_CHANGE_CB(cnstgui_ctx.dlg, reset_line); - PCB_DAD_HELP(cnstgui_ctx.dlg, "clear line constraint values"); - PCB_DAD_END(cnstgui_ctx.dlg); + RND_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); + RND_DAD_BUTTON(cnstgui_ctx.dlg, "Reset"); + RND_DAD_CHANGE_CB(cnstgui_ctx.dlg, reset_line); + RND_DAD_HELP(cnstgui_ctx.dlg, "clear line constraint values"); + RND_DAD_END(cnstgui_ctx.dlg); - PCB_DAD_END(cnstgui_ctx.dlg); + RND_DAD_END(cnstgui_ctx.dlg); /* move */ - PCB_DAD_BEGIN_VBOX(cnstgui_ctx.dlg); - PCB_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); - PCB_DAD_LABEL(cnstgui_ctx.dlg, "Fixed angles:"); - PCB_DAD_STRING(cnstgui_ctx.dlg); - cnstgui_ctx.move_angle = PCB_DAD_CURRENT(cnstgui_ctx.dlg); - PCB_DAD_HELP(cnstgui_ctx.dlg, "space separated list of valid move vector angles in degree"); - PCB_DAD_BUTTON(cnstgui_ctx.dlg, "apply"); - PCB_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); - PCB_DAD_END(cnstgui_ctx.dlg); - PCB_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); - PCB_DAD_LABEL(cnstgui_ctx.dlg, "Angle modulo:"); - PCB_DAD_REAL(cnstgui_ctx.dlg, ""); - cnstgui_ctx.move_angle_mod = PCB_DAD_CURRENT(cnstgui_ctx.dlg); - PCB_DAD_MINVAL(cnstgui_ctx.dlg, 0); - PCB_DAD_MAXVAL(cnstgui_ctx.dlg, 180); - PCB_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); - PCB_DAD_HELP(cnstgui_ctx.dlg, "if non-zero:\nmove vector angle must be an integer multiply of this value"); - PCB_DAD_END(cnstgui_ctx.dlg); - PCB_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); - PCB_DAD_LABEL(cnstgui_ctx.dlg, "Fixed lengths:"); - PCB_DAD_STRING(cnstgui_ctx.dlg); - cnstgui_ctx.move_length = PCB_DAD_CURRENT(cnstgui_ctx.dlg); - PCB_DAD_HELP(cnstgui_ctx.dlg, "space separated list of valid move distances"); - PCB_DAD_BUTTON(cnstgui_ctx.dlg, "apply"); - PCB_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); - PCB_DAD_END(cnstgui_ctx.dlg); - PCB_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); - PCB_DAD_LABEL(cnstgui_ctx.dlg, "Length modulo:"); - PCB_DAD_COORD(cnstgui_ctx.dlg, ""); - cnstgui_ctx.move_length_mod = PCB_DAD_CURRENT(cnstgui_ctx.dlg); - PCB_DAD_MINVAL(cnstgui_ctx.dlg, 0); - PCB_DAD_MAXVAL(cnstgui_ctx.dlg, PCB_MM_TO_COORD(1000)); - PCB_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); - PCB_DAD_HELP(cnstgui_ctx.dlg, "if non-zero:\nmove distance must be an integer multiply of this value"); - PCB_DAD_END(cnstgui_ctx.dlg); - PCB_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); - PCB_DAD_BUTTON(cnstgui_ctx.dlg, "Reset"); - PCB_DAD_CHANGE_CB(cnstgui_ctx.dlg, reset_move); - PCB_DAD_HELP(cnstgui_ctx.dlg, "clear move constraint values"); - PCB_DAD_END(cnstgui_ctx.dlg); - PCB_DAD_END(cnstgui_ctx.dlg); + RND_DAD_BEGIN_VBOX(cnstgui_ctx.dlg); + RND_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); + RND_DAD_LABEL(cnstgui_ctx.dlg, "Fixed angles:"); + RND_DAD_STRING(cnstgui_ctx.dlg); + cnstgui_ctx.move_angle = RND_DAD_CURRENT(cnstgui_ctx.dlg); + RND_DAD_HELP(cnstgui_ctx.dlg, "space separated list of valid move vector angles in degree"); + RND_DAD_BUTTON(cnstgui_ctx.dlg, "apply"); + RND_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); + RND_DAD_END(cnstgui_ctx.dlg); + RND_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); + RND_DAD_LABEL(cnstgui_ctx.dlg, "Angle modulo:"); + RND_DAD_REAL(cnstgui_ctx.dlg, ""); + cnstgui_ctx.move_angle_mod = RND_DAD_CURRENT(cnstgui_ctx.dlg); + RND_DAD_MINVAL(cnstgui_ctx.dlg, 0); + RND_DAD_MAXVAL(cnstgui_ctx.dlg, 180); + RND_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); + RND_DAD_HELP(cnstgui_ctx.dlg, "if non-zero:\nmove vector angle must be an integer multiply of this value"); + RND_DAD_END(cnstgui_ctx.dlg); + RND_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); + RND_DAD_LABEL(cnstgui_ctx.dlg, "Fixed lengths:"); + RND_DAD_STRING(cnstgui_ctx.dlg); + cnstgui_ctx.move_length = RND_DAD_CURRENT(cnstgui_ctx.dlg); + RND_DAD_HELP(cnstgui_ctx.dlg, "space separated list of valid move distances"); + RND_DAD_BUTTON(cnstgui_ctx.dlg, "apply"); + RND_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); + RND_DAD_END(cnstgui_ctx.dlg); + RND_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); + RND_DAD_LABEL(cnstgui_ctx.dlg, "Length modulo:"); + RND_DAD_COORD(cnstgui_ctx.dlg, ""); + cnstgui_ctx.move_length_mod = RND_DAD_CURRENT(cnstgui_ctx.dlg); + RND_DAD_MINVAL(cnstgui_ctx.dlg, 0); + RND_DAD_MAXVAL(cnstgui_ctx.dlg, PCB_MM_TO_COORD(1000)); + RND_DAD_CHANGE_CB(cnstgui_ctx.dlg, gui2cons); + RND_DAD_HELP(cnstgui_ctx.dlg, "if non-zero:\nmove distance must be an integer multiply of this value"); + RND_DAD_END(cnstgui_ctx.dlg); + RND_DAD_BEGIN_HBOX(cnstgui_ctx.dlg); + RND_DAD_BUTTON(cnstgui_ctx.dlg, "Reset"); + RND_DAD_CHANGE_CB(cnstgui_ctx.dlg, reset_move); + RND_DAD_HELP(cnstgui_ctx.dlg, "clear move constraint values"); + RND_DAD_END(cnstgui_ctx.dlg); + RND_DAD_END(cnstgui_ctx.dlg); - PCB_DAD_END(cnstgui_ctx.dlg); - PCB_DAD_BUTTON_CLOSES(cnstgui_ctx.dlg, clbtn); - PCB_DAD_END(cnstgui_ctx.dlg); + RND_DAD_END(cnstgui_ctx.dlg); + RND_DAD_BUTTON_CLOSES(cnstgui_ctx.dlg, clbtn); + RND_DAD_END(cnstgui_ctx.dlg); /* set up the context */ cnstgui_ctx.active = 1; - PCB_DAD_NEW("constraint", cnstgui_ctx.dlg, "Drawing constraints", &cnstgui_ctx, pcb_false, cnstgui_close_cb); + RND_DAD_NEW("constraint", cnstgui_ctx.dlg, "Drawing constraints", &cnstgui_ctx, pcb_false, cnstgui_close_cb); cons_changed(); Index: trunk/src_plugins/dialogs/dlg_about.c =================================================================== --- trunk/src_plugins/dialogs/dlg_about.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_about.c (revision 30992) @@ -35,7 +35,7 @@ #include "dlg_about.h" typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int active; /* already open - allow only one instance */ } about_ctx_t; @@ -44,7 +44,7 @@ static void about_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) { about_ctx_t *ctx = caller_data; - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); memset(ctx, 0, sizeof(about_ctx_t)); /* reset all states to the initial - includes ctx->active = 0; */ } @@ -52,7 +52,7 @@ static void pcb_dlg_about(void) { const char *tabs[] = { "About pcb-rnd", "Options", "Paths", "License", NULL }; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; htsp_entry_t *e; gds_t s; @@ -59,53 +59,53 @@ if (about_ctx.active) return; - PCB_DAD_BEGIN_VBOX(about_ctx.dlg); - PCB_DAD_COMPFLAG(about_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABBED(about_ctx.dlg, tabs); - PCB_DAD_COMPFLAG(about_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_VBOX(about_ctx.dlg); - PCB_DAD_LABEL(about_ctx.dlg, pcb_get_info_program()); - PCB_DAD_LABEL(about_ctx.dlg, pcb_get_info_copyright()); - PCB_DAD_LABEL(about_ctx.dlg, pcb_get_info_websites(NULL)); - PCB_DAD_END(about_ctx.dlg); + RND_DAD_BEGIN_VBOX(about_ctx.dlg); + RND_DAD_COMPFLAG(about_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABBED(about_ctx.dlg, tabs); + RND_DAD_COMPFLAG(about_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(about_ctx.dlg); + RND_DAD_LABEL(about_ctx.dlg, pcb_get_info_program()); + RND_DAD_LABEL(about_ctx.dlg, pcb_get_info_copyright()); + RND_DAD_LABEL(about_ctx.dlg, pcb_get_info_websites(NULL)); + RND_DAD_END(about_ctx.dlg); - PCB_DAD_BEGIN_VBOX(about_ctx.dlg); - PCB_DAD_COMPFLAG(about_ctx.dlg, /*RND_HATF_SCROLL |*/ /*RND_HATF_FRAME |*/ RND_HATF_EXPFILL); - PCB_DAD_LABEL(about_ctx.dlg, pcb_get_info_compile_options()); - PCB_DAD_COMPFLAG(about_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_END(about_ctx.dlg); + RND_DAD_BEGIN_VBOX(about_ctx.dlg); + RND_DAD_COMPFLAG(about_ctx.dlg, /*RND_HATF_SCROLL |*/ /*RND_HATF_FRAME |*/ RND_HATF_EXPFILL); + RND_DAD_LABEL(about_ctx.dlg, pcb_get_info_compile_options()); + RND_DAD_COMPFLAG(about_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_END(about_ctx.dlg); - PCB_DAD_BEGIN_VBOX(about_ctx.dlg); - PCB_DAD_COMPFLAG(about_ctx.dlg, RND_HATF_SCROLL); + RND_DAD_BEGIN_VBOX(about_ctx.dlg); + RND_DAD_COMPFLAG(about_ctx.dlg, RND_HATF_SCROLL); gds_init(&s); for (e = htsp_first(&rnd_file_loaded); e; e = htsp_next(&rnd_file_loaded, e)) { htsp_entry_t *e2; rnd_file_loaded_t *cat = e->value; - PCB_DAD_LABEL(about_ctx.dlg, cat->name); + RND_DAD_LABEL(about_ctx.dlg, cat->name); gds_truncate(&s, 0); for (e2 = htsp_first(&cat->data.category.children); e2; e2 = htsp_next(&cat->data.category.children, e2)) { rnd_file_loaded_t *file = e2->value; pcb_append_printf(&s, " %s\t%s\t%s\n", file->name, file->data.file.path, file->data.file.desc); } - PCB_DAD_LABEL(about_ctx.dlg, s.array); + RND_DAD_LABEL(about_ctx.dlg, s.array); } gds_uninit(&s); - PCB_DAD_END(about_ctx.dlg); + RND_DAD_END(about_ctx.dlg); - PCB_DAD_BEGIN_VBOX(about_ctx.dlg); - PCB_DAD_LABEL(about_ctx.dlg, pcb_get_info_license()); - PCB_DAD_END(about_ctx.dlg); + RND_DAD_BEGIN_VBOX(about_ctx.dlg); + RND_DAD_LABEL(about_ctx.dlg, pcb_get_info_license()); + RND_DAD_END(about_ctx.dlg); - PCB_DAD_END(about_ctx.dlg); - PCB_DAD_BUTTON_CLOSES(about_ctx.dlg, clbtn); - PCB_DAD_END(about_ctx.dlg); + RND_DAD_END(about_ctx.dlg); + RND_DAD_BUTTON_CLOSES(about_ctx.dlg, clbtn); + RND_DAD_END(about_ctx.dlg); /* set up the context */ about_ctx.active = 1; /* this is the modal version - please consider using the non-modal version */ - PCB_DAD_NEW("about", about_ctx.dlg, "About pcb-rnd", &about_ctx, pcb_false, about_close_cb); + RND_DAD_NEW("about", about_ctx.dlg, "About pcb-rnd", &about_ctx, pcb_false, about_close_cb); } const char pcb_acts_About[] = "About()\n"; Index: trunk/src_plugins/dialogs/dlg_export.c =================================================================== --- trunk/src_plugins/dialogs/dlg_export.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_export.c (revision 30992) @@ -37,7 +37,7 @@ #include "dlg_export.h" typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int active; /* already open - allow only one instance */ int tabs, len; @@ -128,7 +128,7 @@ copy_attrs_back(ctx); - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); free(ctx->hid); free(ctx->tab_name); for(n = 0; n < export_ctx.len; n++) @@ -144,7 +144,7 @@ { rnd_hid_t **hids; int n, i, *exp_attr; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (export_ctx.active) return; /* do not open another */ @@ -177,11 +177,11 @@ export_ctx.tab_name[i] = NULL; - PCB_DAD_BEGIN_VBOX(export_ctx.dlg); - PCB_DAD_COMPFLAG(export_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABBED(export_ctx.dlg, export_ctx.tab_name); - PCB_DAD_COMPFLAG(export_ctx.dlg, RND_HATF_LEFT_TAB|RND_HATF_EXPFILL); - export_ctx.tabs = PCB_DAD_CURRENT(export_ctx.dlg); + RND_DAD_BEGIN_VBOX(export_ctx.dlg); + RND_DAD_COMPFLAG(export_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABBED(export_ctx.dlg, export_ctx.tab_name); + RND_DAD_COMPFLAG(export_ctx.dlg, RND_HATF_LEFT_TAB|RND_HATF_EXPFILL); + export_ctx.tabs = RND_DAD_CURRENT(export_ctx.dlg); for(n = 0; n < export_ctx.len; n++) { int numo; rnd_export_opt_t *opts = export_ctx.hid[n]->get_export_options(export_ctx.hid[n], &numo); @@ -188,35 +188,35 @@ export_ctx.numo[n] = numo; export_ctx.ea[n] = opts; if (numo < 1) { - PCB_DAD_LABEL(export_ctx.dlg, "Exporter unavailable for direct export"); + RND_DAD_LABEL(export_ctx.dlg, "Exporter unavailable for direct export"); continue; } - PCB_DAD_BEGIN_VBOX(export_ctx.dlg); + RND_DAD_BEGIN_VBOX(export_ctx.dlg); if (numo > 12) - PCB_DAD_COMPFLAG(export_ctx.dlg, RND_HATF_SCROLL); + RND_DAD_COMPFLAG(export_ctx.dlg, RND_HATF_SCROLL); export_ctx.exp_attr[n] = exp_attr = malloc(sizeof(int) * numo); for(i = 0; i < numo; i++) { - PCB_DAD_BEGIN_HBOX(export_ctx.dlg) + RND_DAD_BEGIN_HBOX(export_ctx.dlg) switch(opts[i].type) { case RND_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.crd); + RND_DAD_COORD(export_ctx.dlg, opts[i].name); + RND_DAD_MINMAX(export_ctx.dlg, opts[i].min_val, opts[i].max_val); + RND_DAD_DEFAULT_NUM(export_ctx.dlg, opts[i].default_val.crd); break; case RND_HATT_INTEGER: - PCB_DAD_INTEGER(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.lng); + RND_DAD_INTEGER(export_ctx.dlg, opts[i].name); + RND_DAD_MINMAX(export_ctx.dlg, opts[i].min_val, opts[i].max_val); + RND_DAD_DEFAULT_NUM(export_ctx.dlg, opts[i].default_val.lng); break; case RND_HATT_REAL: - PCB_DAD_REAL(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.dbl); + RND_DAD_REAL(export_ctx.dlg, opts[i].name); + RND_DAD_MINMAX(export_ctx.dlg, opts[i].min_val, opts[i].max_val); + RND_DAD_DEFAULT_NUM(export_ctx.dlg, opts[i].default_val.dbl); break; case RND_HATT_UNIT: PCB_DAD_UNIT(export_ctx.dlg, PCB_UNIT_METRIC | PCB_UNIT_IMPERIAL); - PCB_DAD_DEFAULT_NUM(export_ctx.dlg, opts[i].default_val.lng); + RND_DAD_DEFAULT_NUM(export_ctx.dlg, opts[i].default_val.lng); break; default: if (RND_HATT_IS_COMPOSITE(opts[i].type)) { @@ -225,30 +225,30 @@ fnc(RND_HIDEOF_DAD, &export_ctx, &opts[i]); } else - PCB_DAD_DUP_EXPOPT(export_ctx.dlg, &(opts[i])); + RND_DAD_DUP_EXPOPT(export_ctx.dlg, &(opts[i])); } - exp_attr[i] = PCB_DAD_CURRENT(export_ctx.dlg); + exp_attr[i] = RND_DAD_CURRENT(export_ctx.dlg); if (opts[i].name != NULL) - PCB_DAD_LABEL(export_ctx.dlg, opts[i].name); - PCB_DAD_END(export_ctx.dlg); + RND_DAD_LABEL(export_ctx.dlg, opts[i].name); + RND_DAD_END(export_ctx.dlg); } - PCB_DAD_LABEL(export_ctx.dlg, " "); /* ugly way of inserting some vertical spacing */ - PCB_DAD_BEGIN_HBOX(export_ctx.dlg) - PCB_DAD_LABEL(export_ctx.dlg, "Apply attributes and export: "); - PCB_DAD_BUTTON(export_ctx.dlg, "Export!"); - export_ctx.button[n] = PCB_DAD_CURRENT(export_ctx.dlg); - PCB_DAD_CHANGE_CB(export_ctx.dlg, export_cb); - PCB_DAD_END(export_ctx.dlg); - PCB_DAD_END(export_ctx.dlg); + RND_DAD_LABEL(export_ctx.dlg, " "); /* ugly way of inserting some vertical spacing */ + RND_DAD_BEGIN_HBOX(export_ctx.dlg) + RND_DAD_LABEL(export_ctx.dlg, "Apply attributes and export: "); + RND_DAD_BUTTON(export_ctx.dlg, "Export!"); + export_ctx.button[n] = RND_DAD_CURRENT(export_ctx.dlg); + RND_DAD_CHANGE_CB(export_ctx.dlg, export_cb); + RND_DAD_END(export_ctx.dlg); + RND_DAD_END(export_ctx.dlg); } - PCB_DAD_END(export_ctx.dlg); - PCB_DAD_BUTTON_CLOSES(export_ctx.dlg, clbtn); - PCB_DAD_END(export_ctx.dlg); + RND_DAD_END(export_ctx.dlg); + RND_DAD_BUTTON_CLOSES(export_ctx.dlg, clbtn); + RND_DAD_END(export_ctx.dlg); /* set up the context */ export_ctx.active = 1; - PCB_DAD_NEW("export", export_ctx.dlg, title, &export_ctx, pcb_false, export_close_cb); + RND_DAD_NEW("export", export_ctx.dlg, title, &export_ctx, pcb_false, export_close_cb); } const char pcb_acts_ExportGUI[] = "ExportGUI()\n"; Index: trunk/src_plugins/dialogs/dlg_flag_edit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_flag_edit.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_flag_edit.c (revision 30992) @@ -88,7 +88,7 @@ fe_ctx_t ctx; rnd_hid_attr_val_t val; int type; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; memset(&ctx, 0, sizeof(ctx)); @@ -115,7 +115,7 @@ if (ctx.obj_type != 0) { /* interactive mode */ int n; char tmp[128]; - PCB_DAD_DECL(dlg); + RND_DAD_DECL(dlg); ctx.pcb = PCB; ctx.len = 0; @@ -122,38 +122,38 @@ pcb_undo_save_serial(); - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); sprintf(tmp, "Object flags of %s #%ld\n", pcb_obj_type_name(ctx.obj_type), ctx.obj->ID); - PCB_DAD_LABEL(dlg, tmp); + RND_DAD_LABEL(dlg, tmp); for(n = 0; n < pcb_object_flagbits_len; n++) { if (pcb_object_flagbits[n].object_types & ctx.obj_type) { - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_BOOL(dlg, ""); - PCB_DAD_HELP(dlg, pcb_object_flagbits[n].help); - ctx.wid[ctx.len] = PCB_DAD_CURRENT(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_BOOL(dlg, ""); + RND_DAD_HELP(dlg, pcb_object_flagbits[n].help); + ctx.wid[ctx.len] = RND_DAD_CURRENT(dlg); ctx.flag_bit[ctx.len] = pcb_object_flagbits[n].mask; if (PCB_FLAG_TEST(ctx.flag_bit[ctx.len], ctx.obj)) - PCB_DAD_DEFAULT_NUM(dlg, 1); - PCB_DAD_LABEL(dlg, pcb_object_flagbits[n].name); + RND_DAD_DEFAULT_NUM(dlg, 1); + RND_DAD_LABEL(dlg, pcb_object_flagbits[n].name); ctx.len++; - PCB_DAD_END(dlg); + RND_DAD_END(dlg); } } - PCB_DAD_BUTTON_CLOSES(dlg, clbtn); - PCB_DAD_END(dlg); + RND_DAD_BUTTON_CLOSES(dlg, clbtn); + RND_DAD_END(dlg); ctx.attrs = dlg; - PCB_DAD_NEW("flags", dlg, "Edit flags", &ctx, pcb_true, NULL); + RND_DAD_NEW("flags", dlg, "Edit flags", &ctx, pcb_true, NULL); val.func = fe_attr_chg; rnd_gui->attr_dlg_property(dlg_hid_ctx, RND_HATP_GLOBAL_CALLBACK, &val); - PCB_DAD_RUN(dlg); + RND_DAD_RUN(dlg); - PCB_DAD_FREE(dlg); + RND_DAD_FREE(dlg); pcb_undo_restore_serial(); pcb_undo_inc_serial(); } Index: trunk/src_plugins/dialogs/dlg_fontsel.c =================================================================== --- trunk/src_plugins/dialogs/dlg_fontsel.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_fontsel.c (revision 30992) @@ -37,7 +37,7 @@ #include "dlg_fontsel.h" typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) pcb_board_t *pcb; int wprev; @@ -62,7 +62,7 @@ if (ctx->txt_id != NULL) pcb_idpath_destroy(ctx->txt_id); - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); if (ctx->alloced) { gdl_remove(&fontsels, ctx, link); free(ctx); @@ -146,7 +146,7 @@ static void pcb_dlg_fontsel(pcb_board_t *pcb, int modal, int global, pcb_text_t *txt_obj) { rnd_rnd_box_t vbox = {0, 0, PCB_MM_TO_COORD(55), PCB_MM_TO_COORD(55)}; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; fontsel_ctx_t *c, *ctx = NULL; if (global) { @@ -173,28 +173,28 @@ ctx->txt_id = pcb_obj2idpath((pcb_any_obj_t *)txt_obj); else ctx->txt_id = NULL; - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_PREVIEW(ctx->dlg, fontsel_expose_cb, fontsel_mouse_cb, fontsel_free_cb, &vbox, 200, 200, ctx); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - ctx->wprev = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Load font"); - PCB_DAD_CHANGE_CB(ctx->dlg, btn_load_cb); - PCB_DAD_HELP(ctx->dlg, "Load new font from disk"); - PCB_DAD_BUTTON(ctx->dlg, "Replace font"); - PCB_DAD_CHANGE_CB(ctx->dlg, btn_replace_cb); - PCB_DAD_HELP(ctx->dlg, "Replace currently selected font\nwith new font loaded from disk"); - PCB_DAD_BUTTON(ctx->dlg, "Remove font"); - PCB_DAD_CHANGE_CB(ctx->dlg, btn_remove_cb); - PCB_DAD_HELP(ctx->dlg, "Remove currently selected font"); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_PREVIEW(ctx->dlg, fontsel_expose_cb, fontsel_mouse_cb, fontsel_free_cb, &vbox, 200, 200, ctx); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + ctx->wprev = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Load font"); + RND_DAD_CHANGE_CB(ctx->dlg, btn_load_cb); + RND_DAD_HELP(ctx->dlg, "Load new font from disk"); + RND_DAD_BUTTON(ctx->dlg, "Replace font"); + RND_DAD_CHANGE_CB(ctx->dlg, btn_replace_cb); + RND_DAD_HELP(ctx->dlg, "Replace currently selected font\nwith new font loaded from disk"); + RND_DAD_BUTTON(ctx->dlg, "Remove font"); + RND_DAD_CHANGE_CB(ctx->dlg, btn_remove_cb); + RND_DAD_HELP(ctx->dlg, "Remove currently selected font"); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); + RND_DAD_END(ctx->dlg); ctx->active = 1; - PCB_DAD_DEFSIZE(ctx->dlg, 250, 200); - PCB_DAD_NEW("fontsel", ctx->dlg, "Font selection", ctx, modal, fontsel_close_cb); + RND_DAD_DEFSIZE(ctx->dlg, 250, 200); + RND_DAD_NEW("fontsel", ctx->dlg, "Font selection", ctx, modal, fontsel_close_cb); } const char pcb_acts_Fontsel[] = "Fontsel()\n"; @@ -243,7 +243,7 @@ static void fontsel_bchanged_ev(rnd_hidlib_t *hidlib, void *user_data, int argc, rnd_event_arg_t argv[]) { fontsel_ctx_t *c, *next; - pcb_dad_retovr_t retovr; + rnd_dad_retovr_t retovr; if (fontsel_brd.active) fontsel_preview_update(&fontsel_brd); @@ -250,7 +250,7 @@ for(c = gdl_first(&fontsels); c != NULL; c = next) { next = gdl_next(&fontsels, c); - pcb_hid_dad_close(c->dlg_hid_ctx, &retovr, 0); + rnd_hid_dad_close(c->dlg_hid_ctx, &retovr, 0); } } Index: trunk/src_plugins/dialogs/dlg_infobar.c =================================================================== --- trunk/src_plugins/dialogs/dlg_infobar.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_infobar.c (revision 30992) @@ -65,30 +65,30 @@ if (strcmp(cmd, "open") == 0) { if (!active) { - PCB_DAD_BEGIN_HBOX(sub.dlg); - PCB_DAD_COMPFLAG(sub.dlg, RND_HATF_EXPFILL | RND_HATF_FRAME); - PCB_DAD_BEGIN_VBOX(sub.dlg); - PCB_DAD_PICTURE(sub.dlg, pcp_dlg_xpm_by_name("warning")); - PCB_DAD_END(sub.dlg); - PCB_DAD_BEGIN_VBOX(sub.dlg); - PCB_DAD_COMPFLAG(sub.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HBOX(sub.dlg); PCB_DAD_COMPFLAG(sub.dlg, RND_HATF_EXPFILL); PCB_DAD_END(sub.dlg); - PCB_DAD_LABEL(sub.dlg, "line0"); - wlab[0] = PCB_DAD_CURRENT(sub.dlg); - PCB_DAD_LABEL(sub.dlg, "line1"); - wlab[1] = PCB_DAD_CURRENT(sub.dlg); - PCB_DAD_BEGIN_HBOX(sub.dlg); PCB_DAD_COMPFLAG(sub.dlg, RND_HATF_EXPFILL); PCB_DAD_END(sub.dlg); - PCB_DAD_END(sub.dlg); - PCB_DAD_BEGIN_VBOX(sub.dlg); - PCB_DAD_BUTTON(sub.dlg, "Reload"); - PCB_DAD_HELP(sub.dlg, "Load the new verison of the file from disk,\ndiscarding any in-memory change on the board"); - PCB_DAD_CHANGE_CB(sub.dlg, ifb_file_chg_reload_cb); - PCB_DAD_BEGIN_HBOX(sub.dlg); PCB_DAD_COMPFLAG(sub.dlg, RND_HATF_EXPFILL); PCB_DAD_END(sub.dlg); - PCB_DAD_BUTTON(sub.dlg, "Cancel"); - PCB_DAD_HELP(sub.dlg, "Hide this info bar until the file changes again on disk"); - PCB_DAD_CHANGE_CB(sub.dlg, ifb_file_chg_close_cb); - PCB_DAD_END(sub.dlg); - PCB_DAD_END(sub.dlg); + RND_DAD_BEGIN_HBOX(sub.dlg); + RND_DAD_COMPFLAG(sub.dlg, RND_HATF_EXPFILL | RND_HATF_FRAME); + RND_DAD_BEGIN_VBOX(sub.dlg); + RND_DAD_PICTURE(sub.dlg, pcp_dlg_xpm_by_name("warning")); + RND_DAD_END(sub.dlg); + RND_DAD_BEGIN_VBOX(sub.dlg); + RND_DAD_COMPFLAG(sub.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_HBOX(sub.dlg); RND_DAD_COMPFLAG(sub.dlg, RND_HATF_EXPFILL); RND_DAD_END(sub.dlg); + RND_DAD_LABEL(sub.dlg, "line0"); + wlab[0] = RND_DAD_CURRENT(sub.dlg); + RND_DAD_LABEL(sub.dlg, "line1"); + wlab[1] = RND_DAD_CURRENT(sub.dlg); + RND_DAD_BEGIN_HBOX(sub.dlg); RND_DAD_COMPFLAG(sub.dlg, RND_HATF_EXPFILL); RND_DAD_END(sub.dlg); + RND_DAD_END(sub.dlg); + RND_DAD_BEGIN_VBOX(sub.dlg); + RND_DAD_BUTTON(sub.dlg, "Reload"); + RND_DAD_HELP(sub.dlg, "Load the new verison of the file from disk,\ndiscarding any in-memory change on the board"); + RND_DAD_CHANGE_CB(sub.dlg, ifb_file_chg_reload_cb); + RND_DAD_BEGIN_HBOX(sub.dlg); RND_DAD_COMPFLAG(sub.dlg, RND_HATF_EXPFILL); RND_DAD_END(sub.dlg); + RND_DAD_BUTTON(sub.dlg, "Cancel"); + RND_DAD_HELP(sub.dlg, "Hide this info bar until the file changes again on disk"); + RND_DAD_CHANGE_CB(sub.dlg, ifb_file_chg_close_cb); + RND_DAD_END(sub.dlg); + RND_DAD_END(sub.dlg); if (rnd_hid_dock_enter(&sub, RND_HID_DOCK_TOP_INFOBAR, "file_changed") != 0) { RND_ACT_IRES(1); return 0; Index: trunk/src_plugins/dialogs/dlg_layer_binding.c =================================================================== --- trunk/src_plugins/dialogs/dlg_layer_binding.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_layer_binding.c (revision 30992) @@ -70,7 +70,7 @@ static void set_ly_type(void *hid_ctx, int wid, pcb_layer_type_t type) { - PCB_DAD_SET_VALUE(hid_ctx, wid, lng, pcb_ly_type2enum(type)); + RND_DAD_SET_VALUE(hid_ctx, wid, lng, pcb_ly_type2enum(type)); } static pcb_layer_type_t int2side(int i) @@ -153,16 +153,16 @@ /* name and type */ if (layer_name_mismatch(w, layer)) - PCB_DAD_SET_VALUE(hid_ctx, w->name, str, rnd_strdup(layer->name)); + RND_DAD_SET_VALUE(hid_ctx, w->name, str, rnd_strdup(layer->name)); if (layer_purpose_mismatch(w, layer)) { char *purp = layer->meta.bound.purpose; if (purp == NULL) purp = ""; - PCB_DAD_SET_VALUE(hid_ctx, w->purpose, str, rnd_strdup(purp)); + RND_DAD_SET_VALUE(hid_ctx, w->purpose, str, rnd_strdup(purp)); } - PCB_DAD_SET_VALUE(hid_ctx, w->comp, lng, layer->comb); + RND_DAD_SET_VALUE(hid_ctx, w->comp, lng, layer->comb); set_ly_type(hid_ctx, w->type, layer->meta.bound.type); @@ -169,7 +169,7 @@ /* disable side for non-sided */ if (PCB_LAYER_SIDED(layer->meta.bound.type)) { /* side & offset */ - PCB_DAD_SET_VALUE(hid_ctx, w->side, lng, side2int(layer->meta.bound.type)); + RND_DAD_SET_VALUE(hid_ctx, w->side, lng, side2int(layer->meta.bound.type)); rnd_gui->attr_dlg_widget_state(hid_ctx, w->side, 1); } else @@ -177,10 +177,10 @@ ofs = layer->meta.bound.stack_offs; if (ofs < 0) { - PCB_DAD_SET_VALUE(hid_ctx, w->side, lng, 1); + RND_DAD_SET_VALUE(hid_ctx, w->side, lng, 1); ofs = -layer->meta.bound.stack_offs; } - PCB_DAD_SET_VALUE(hid_ctx, w->offs, lng, ofs); + RND_DAD_SET_VALUE(hid_ctx, w->offs, lng, ofs); /* enable offset only for copper */ enable = (layer->meta.bound.type & PCB_LYT_COPPER); @@ -192,7 +192,7 @@ lid = pcb_layer_id(PCB->Data, layer->meta.bound.real); else lid = ctx->no_layer; - PCB_DAD_SET_VALUE(hid_ctx, w->layer, lng, lid); + RND_DAD_SET_VALUE(hid_ctx, w->layer, lng, lid); rnd_gui->attr_dlg_widget_state(hid_ctx, w->layer, 0); } } @@ -289,8 +289,8 @@ { /* interactive mode */ int n; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; - PCB_DAD_DECL(dlg); + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + RND_DAD_DECL(dlg); ctx.pcb = PCB; ctx.widx = malloc(sizeof(lb_widx_t) * ctx.data->LayerN); @@ -306,77 +306,77 @@ if (pcb_layergrp_flags(PCB, n) & PCB_LYT_COPPER) num_copper++; - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABLE(dlg, 2); - PCB_DAD_COMPFLAG(dlg, RND_HATF_SCROLL | RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABLE(dlg, 2); + RND_DAD_COMPFLAG(dlg, RND_HATF_SCROLL | RND_HATF_EXPFILL); for(n = 0; n < ctx.data->LayerN; n++) { lb_widx_t *w = ctx.widx+n; /* left side */ - PCB_DAD_BEGIN_VBOX(dlg); + RND_DAD_BEGIN_VBOX(dlg); if (n == 0) - PCB_DAD_LABEL(dlg, "RECIPE"); + RND_DAD_LABEL(dlg, "RECIPE"); else - PCB_DAD_LABEL(dlg, "\n"); + RND_DAD_LABEL(dlg, "\n"); - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_LABEL(dlg, "Name:"); - PCB_DAD_STRING(dlg); - w->name = PCB_DAD_CURRENT(dlg); - PCB_DAD_END(dlg); - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_ENUM(dlg, pcb_lb_comp); /* coposite */ - w->comp = PCB_DAD_CURRENT(dlg); - PCB_DAD_ENUM(dlg, pcb_lb_types); /* lyt */ - w->type = PCB_DAD_CURRENT(dlg); - PCB_DAD_END(dlg); - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_INTEGER(dlg, NULL); - PCB_DAD_MINVAL(dlg, 0); - PCB_DAD_MAXVAL(dlg, num_copper); - w->offs = PCB_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, "from"); - w->from = PCB_DAD_CURRENT(dlg); - PCB_DAD_ENUM(dlg, pcb_lb_side); - w->side = PCB_DAD_CURRENT(dlg); - PCB_DAD_END(dlg); - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_LABEL(dlg, "Purpose:"); - PCB_DAD_STRING(dlg); - w->purpose = PCB_DAD_CURRENT(dlg); - PCB_DAD_END(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_LABEL(dlg, "Name:"); + RND_DAD_STRING(dlg); + w->name = RND_DAD_CURRENT(dlg); + RND_DAD_END(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_ENUM(dlg, pcb_lb_comp); /* coposite */ + w->comp = RND_DAD_CURRENT(dlg); + RND_DAD_ENUM(dlg, pcb_lb_types); /* lyt */ + w->type = RND_DAD_CURRENT(dlg); + RND_DAD_END(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_INTEGER(dlg, NULL); + RND_DAD_MINVAL(dlg, 0); + RND_DAD_MAXVAL(dlg, num_copper); + w->offs = RND_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "from"); + w->from = RND_DAD_CURRENT(dlg); + RND_DAD_ENUM(dlg, pcb_lb_side); + w->side = RND_DAD_CURRENT(dlg); + RND_DAD_END(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_LABEL(dlg, "Purpose:"); + RND_DAD_STRING(dlg); + w->purpose = RND_DAD_CURRENT(dlg); + RND_DAD_END(dlg); - PCB_DAD_END(dlg); + RND_DAD_END(dlg); /* right side */ - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_LABELF(dlg, ("\n\n layer #%d ", n)); - PCB_DAD_BEGIN_VBOX(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_LABELF(dlg, ("\n\n layer #%d ", n)); + RND_DAD_BEGIN_VBOX(dlg); if (n == 0) - PCB_DAD_LABEL(dlg, "BOARD LAYER"); + RND_DAD_LABEL(dlg, "BOARD LAYER"); else - PCB_DAD_LABEL(dlg, "\n\n"); - PCB_DAD_LABEL(dlg, "Automatic"); - PCB_DAD_ENUM(dlg, ctx.layer_names); - w->layer = PCB_DAD_CURRENT(dlg); - PCB_DAD_END(dlg); - PCB_DAD_END(dlg); + RND_DAD_LABEL(dlg, "\n\n"); + RND_DAD_LABEL(dlg, "Automatic"); + RND_DAD_ENUM(dlg, ctx.layer_names); + w->layer = RND_DAD_CURRENT(dlg); + RND_DAD_END(dlg); + RND_DAD_END(dlg); } - PCB_DAD_END(dlg); - PCB_DAD_BUTTON_CLOSES(dlg, clbtn); - PCB_DAD_END(dlg); + RND_DAD_END(dlg); + RND_DAD_BUTTON_CLOSES(dlg, clbtn); + RND_DAD_END(dlg); ctx.attrs = dlg; - PCB_DAD_DEFSIZE(dlg, 500, 500); - PCB_DAD_NEW("layer_binding", dlg, "Layer bindings", &ctx, pcb_true, NULL); + RND_DAD_DEFSIZE(dlg, 500, 500); + RND_DAD_NEW("layer_binding", dlg, "Layer bindings", &ctx, pcb_true, NULL); val.func = lb_attr_chg; rnd_gui->attr_dlg_property(dlg_hid_ctx, RND_HATP_GLOBAL_CALLBACK, &val); lb_data2dialog(dlg_hid_ctx, &ctx); - PCB_DAD_RUN(dlg); + RND_DAD_RUN(dlg); - PCB_DAD_FREE(dlg); + RND_DAD_FREE(dlg); free(ctx.widx); free(ctx.layer_names); } Index: trunk/src_plugins/dialogs/dlg_layer_flags.c =================================================================== --- trunk/src_plugins/dialogs/dlg_layer_flags.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_layer_flags.c (revision 30992) @@ -36,8 +36,8 @@ const char pcb_acth_LayerPropGui[] = "Change layer flags and properties"; fgw_error_t pcb_act_LayerPropGui(fgw_arg_t *res, int argc, fgw_arg_t *argv) { - PCB_DAD_DECL(dlg) - pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", 1}, {"OK", 0}, {NULL, 0}}; + RND_DAD_DECL(dlg) + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", 1}, {"OK", 0}, {NULL, 0}}; int wname, wsub, wauto, failed, ar = 0; pcb_layer_t *ly; rnd_layer_id_t lid; @@ -46,23 +46,23 @@ rnd_PCB_ACT_MAY_CONVARG(1, FGW_LONG, LayerPropGui, lid = argv[1].val.nat_long); ly = pcb_get_layer(PCB->Data, lid); - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_BEGIN_TABLE(dlg, 2); - PCB_DAD_LABEL(dlg, "name"); - PCB_DAD_STRING(dlg); - PCB_DAD_HELP(dlg, "logical layer name"); - wname = PCB_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, "sub"); - PCB_DAD_BOOL(dlg, ""); - PCB_DAD_HELP(dlg, "Layer is drawn negatively in composition\n(will not work on copper)"); - wsub = PCB_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, "auto"); - PCB_DAD_BOOL(dlg, ""); - PCB_DAD_HELP(dlg, "Layer is target for autogenerated objects\nand side effects, e.g. padstack shapes"); - wauto = PCB_DAD_CURRENT(dlg); - PCB_DAD_END(dlg); - PCB_DAD_BUTTON_CLOSES(dlg, clbtn); - PCB_DAD_END(dlg); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_BEGIN_TABLE(dlg, 2); + RND_DAD_LABEL(dlg, "name"); + RND_DAD_STRING(dlg); + RND_DAD_HELP(dlg, "logical layer name"); + wname = RND_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "sub"); + RND_DAD_BOOL(dlg, ""); + RND_DAD_HELP(dlg, "Layer is drawn negatively in composition\n(will not work on copper)"); + wsub = RND_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "auto"); + RND_DAD_BOOL(dlg, ""); + RND_DAD_HELP(dlg, "Layer is target for autogenerated objects\nand side effects, e.g. padstack shapes"); + wauto = RND_DAD_CURRENT(dlg); + RND_DAD_END(dlg); + RND_DAD_BUTTON_CLOSES(dlg, clbtn); + RND_DAD_END(dlg); dlg[wname].val.str = rnd_strdup(ly->name); @@ -69,7 +69,7 @@ dlg[wsub].val.lng = ly->comb & PCB_LYC_SUB; dlg[wauto].val.lng = ly->comb & PCB_LYC_AUTO; - PCB_DAD_AUTORUN("layer_prop", dlg, "Properties of a logical layer", NULL, failed); + RND_DAD_AUTORUN("layer_prop", dlg, "Properties of a logical layer", NULL, failed); if (failed == 0) { pcb_layer_combining_t comb = 0; @@ -86,7 +86,7 @@ } else ar = 1; - PCB_DAD_FREE(dlg); + RND_DAD_FREE(dlg); RND_ACT_IRES(ar); return 0; @@ -96,8 +96,8 @@ const char pcb_acth_GroupPropGui[] = "Change group flags and properties"; fgw_error_t pcb_act_GroupPropGui(fgw_arg_t *res, int argc, fgw_arg_t *argv) { - PCB_DAD_DECL(dlg) - pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", 1}, {"OK", 0}, {NULL, 0}}; + RND_DAD_DECL(dlg) + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", 1}, {"OK", 0}, {NULL, 0}}; int wname, wtype, wpurp, wloc; int failed, n, ar = 0, orig_type, changed = 0, omit_loc = 0, orig_loc = -1, def_loc; rnd_layergrp_id_t gid; @@ -117,30 +117,30 @@ else omit_loc = 1; - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_BEGIN_TABLE(dlg, 2); - PCB_DAD_LABEL(dlg, "name"); - PCB_DAD_STRING(dlg); - PCB_DAD_HELP(dlg, "group name"); - wname = PCB_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, "type"); - PCB_DAD_ENUM(dlg, pcb_lb_types); - PCB_DAD_HELP(dlg, "type/material of the group"); - wtype = PCB_DAD_CURRENT(dlg); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_BEGIN_TABLE(dlg, 2); + RND_DAD_LABEL(dlg, "name"); + RND_DAD_STRING(dlg); + RND_DAD_HELP(dlg, "group name"); + wname = RND_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "type"); + RND_DAD_ENUM(dlg, pcb_lb_types); + RND_DAD_HELP(dlg, "type/material of the group"); + wtype = RND_DAD_CURRENT(dlg); if (!omit_loc) { - PCB_DAD_LABEL(dlg, "location"); - PCB_DAD_ENUM(dlg, ltypes); - PCB_DAD_HELP(dlg, "location of the group in the stack"); - wloc = PCB_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "location"); + RND_DAD_ENUM(dlg, ltypes); + RND_DAD_HELP(dlg, "location of the group in the stack"); + wloc = RND_DAD_CURRENT(dlg); } - PCB_DAD_LABEL(dlg, "purpose"); - PCB_DAD_STRING(dlg); - PCB_DAD_HELP(dlg, "purpose"); - wpurp = PCB_DAD_CURRENT(dlg); - PCB_DAD_HELP(dlg, "subtype of the layer\nmeaning depends on the main type"); - PCB_DAD_END(dlg); - PCB_DAD_BUTTON_CLOSES(dlg, clbtn); - PCB_DAD_END(dlg); + RND_DAD_LABEL(dlg, "purpose"); + RND_DAD_STRING(dlg); + RND_DAD_HELP(dlg, "purpose"); + wpurp = RND_DAD_CURRENT(dlg); + RND_DAD_HELP(dlg, "subtype of the layer\nmeaning depends on the main type"); + RND_DAD_END(dlg); + RND_DAD_BUTTON_CLOSES(dlg, clbtn); + RND_DAD_END(dlg); dlg[wname].val.str = rnd_strdup(g->name); @@ -163,7 +163,7 @@ orig_loc = dlg[wloc].val.lng; } - PCB_DAD_AUTORUN("layer_grp_prop", dlg, "Edit the properties of a layer group (physical layer)", NULL, failed); + RND_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].val.str) != 0) { ar |= pcb_layergrp_rename_(g, (char *)dlg[wname].val.str, 1); @@ -214,7 +214,7 @@ else ar = 1; - PCB_DAD_FREE(dlg); + RND_DAD_FREE(dlg); RND_ACT_IRES(ar); return 0; Index: trunk/src_plugins/dialogs/dlg_lib_pstk.c =================================================================== --- trunk/src_plugins/dialogs/dlg_lib_pstk.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_lib_pstk.c (revision 30992) @@ -47,7 +47,7 @@ htip_t pstk_libs; /* id -> pstk_lib_ctx_t */ typedef struct pstk_lib_ctx_s { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) pcb_board_t *pcb; int wlist, wprev, wgrid; int wlayerv[pcb_proto_num_layers], wlayerc[pcb_proto_num_layers]; /* layer visibility/current */ @@ -116,7 +116,7 @@ cell[2] = pcb_strdup_printf("%d", ctx->stat[id]); else cell[2] = rnd_strdup(""); - pcb_dad_tree_append(attr, NULL, cell); + rnd_dad_tree_append(attr, NULL, cell); } /* restore cursor */ @@ -136,7 +136,7 @@ if (!ctx->modal) htip_pop(&pstk_libs, ctx->subc_id); pstklib_last_proto_id = ctx->proto_id; - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); free(ctx); } @@ -211,7 +211,7 @@ ps->BoundingBox.X2 += PCB_MM_TO_COORD(0.5); ps->BoundingBox.Y2 += PCB_MM_TO_COORD(0.5); memcpy(&ctx->drawbox, &ps->BoundingBox, sizeof(rnd_rnd_box_t)); - pcb_dad_preview_zoomto(&ctx->dlg[ctx->wprev], &ctx->drawbox); + rnd_dad_preview_zoomto(&ctx->dlg[ctx->wprev], &ctx->drawbox); } static void pstklib_select(rnd_hid_attribute_t *attrib, void *hid_ctx, rnd_hid_row_t *row) @@ -237,7 +237,7 @@ static void pstklib_update_prv(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) { pstk_lib_ctx_t *ctx = caller_data; - pcb_dad_preview_zoomto(&ctx->dlg[ctx->wprev], &ctx->drawbox); + rnd_dad_preview_zoomto(&ctx->dlg[ctx->wprev], &ctx->drawbox); } static void pstklib_update_layerc(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) @@ -491,8 +491,8 @@ pstk_lib_ctx_t *ctx; int n; char *name; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; - pcb_hid_dad_buttons_t clbtn_modal[] = {{"Cancel", -1}, {"Use selected", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn_modal[] = {{"Cancel", -1}, {"Use selected", 0}, {NULL, 0}}; if (subc_id <= 0) subc_id = -1; @@ -515,92 +515,92 @@ if (!modal) htip_set(&pstk_libs, subc_id, ctx); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); if (hint != NULL) - PCB_DAD_LABEL(ctx->dlg, hint); + RND_DAD_LABEL(ctx->dlg, hint); /* create the dialog box */ - PCB_DAD_BEGIN_HPANE(ctx->dlg); + RND_DAD_BEGIN_HPANE(ctx->dlg); /* left */ - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_TREE(ctx->dlg, 3, 0, hdr); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - PCB_DAD_TREE_SET_CB(ctx->dlg, selected_cb, pstklib_select); - PCB_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); - ctx->wlist = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_STRING(ctx->dlg); - PCB_DAD_HELP(ctx->dlg, "Filter text:\nlist padstacks with matching name only"); - PCB_DAD_CHANGE_CB(ctx->dlg, pstklib_filter_cb); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Edit..."); - PCB_DAD_HELP(ctx->dlg, "Edit the selected prototype\nusing the padstack editor"); - PCB_DAD_CHANGE_CB(ctx->dlg, pstklib_proto_edit); - PCB_DAD_BUTTON(ctx->dlg, "New..."); - PCB_DAD_HELP(ctx->dlg, "Create a new prototype and edit it\nusing the padstack editor"); - PCB_DAD_CHANGE_CB(ctx->dlg, pstklib_proto_new); - PCB_DAD_BUTTON(ctx->dlg, "Switch"); - PCB_DAD_HELP(ctx->dlg, "Find all padstacks using this prototype\nand modify them to use a different prototype\nmaking this prototype unused"); - PCB_DAD_CHANGE_CB(ctx->dlg, pstklib_proto_switch); - PCB_DAD_BUTTON(ctx->dlg, "Select"); - PCB_DAD_HELP(ctx->dlg, "Select all padstack ref. objects that\nreference (use) this prototype"); - PCB_DAD_CHANGE_CB(ctx->dlg, pstklib_proto_select); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Dup..."); - PCB_DAD_HELP(ctx->dlg, "Create a new prototype by duplicating\nthe currently selected on and\n edit it using the padstack editor"); - PCB_DAD_CHANGE_CB(ctx->dlg, pstklib_proto_dup); - PCB_DAD_BUTTON(ctx->dlg, "Count uses"); - PCB_DAD_HELP(ctx->dlg, "Count how many times each prototype\nis used and update the \"used\"\ncolumn of the table"); - PCB_DAD_CHANGE_CB(ctx->dlg, pstklib_count_uses); - PCB_DAD_BUTTON(ctx->dlg, "Del unused"); - PCB_DAD_HELP(ctx->dlg, "Update prototype usage stats and\nremove prototypes that are not\nused by any padstack"); - PCB_DAD_CHANGE_CB(ctx->dlg, pstklib_del_unused); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_TREE(ctx->dlg, 3, 0, hdr); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + RND_DAD_TREE_SET_CB(ctx->dlg, selected_cb, pstklib_select); + RND_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); + ctx->wlist = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_STRING(ctx->dlg); + RND_DAD_HELP(ctx->dlg, "Filter text:\nlist padstacks with matching name only"); + RND_DAD_CHANGE_CB(ctx->dlg, pstklib_filter_cb); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Edit..."); + RND_DAD_HELP(ctx->dlg, "Edit the selected prototype\nusing the padstack editor"); + RND_DAD_CHANGE_CB(ctx->dlg, pstklib_proto_edit); + RND_DAD_BUTTON(ctx->dlg, "New..."); + RND_DAD_HELP(ctx->dlg, "Create a new prototype and edit it\nusing the padstack editor"); + RND_DAD_CHANGE_CB(ctx->dlg, pstklib_proto_new); + RND_DAD_BUTTON(ctx->dlg, "Switch"); + RND_DAD_HELP(ctx->dlg, "Find all padstacks using this prototype\nand modify them to use a different prototype\nmaking this prototype unused"); + RND_DAD_CHANGE_CB(ctx->dlg, pstklib_proto_switch); + RND_DAD_BUTTON(ctx->dlg, "Select"); + RND_DAD_HELP(ctx->dlg, "Select all padstack ref. objects that\nreference (use) this prototype"); + RND_DAD_CHANGE_CB(ctx->dlg, pstklib_proto_select); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Dup..."); + RND_DAD_HELP(ctx->dlg, "Create a new prototype by duplicating\nthe currently selected on and\n edit it using the padstack editor"); + RND_DAD_CHANGE_CB(ctx->dlg, pstklib_proto_dup); + RND_DAD_BUTTON(ctx->dlg, "Count uses"); + RND_DAD_HELP(ctx->dlg, "Count how many times each prototype\nis used and update the \"used\"\ncolumn of the table"); + RND_DAD_CHANGE_CB(ctx->dlg, pstklib_count_uses); + RND_DAD_BUTTON(ctx->dlg, "Del unused"); + RND_DAD_HELP(ctx->dlg, "Update prototype usage stats and\nremove prototypes that are not\nused by any padstack"); + RND_DAD_CHANGE_CB(ctx->dlg, pstklib_del_unused); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); /* right */ - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_PREVIEW(ctx->dlg, pstklib_expose, NULL, NULL, NULL, 200, 200, ctx); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - ctx->wprev = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_PREVIEW(ctx->dlg, pstklib_expose, NULL, NULL, NULL, 200, 200, ctx); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + ctx->wprev = RND_DAD_CURRENT(ctx->dlg); - PCB_DAD_BEGIN_TABLE(ctx->dlg, 2); - PCB_DAD_LABEL(ctx->dlg, "Grid:"); - PCB_DAD_COORD(ctx->dlg, ""); - ctx->wgrid = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_MINMAX(ctx->dlg, PCB_MM_TO_COORD(0.01), PCB_MM_TO_COORD(10)); - PCB_DAD_DEFAULT_NUM(ctx->dlg, (rnd_coord_t)PCB_MM_TO_COORD(1)); - PCB_DAD_CHANGE_CB(ctx->dlg, pstklib_update_prv); + RND_DAD_BEGIN_TABLE(ctx->dlg, 2); + RND_DAD_LABEL(ctx->dlg, "Grid:"); + RND_DAD_COORD(ctx->dlg, ""); + ctx->wgrid = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, PCB_MM_TO_COORD(0.01), PCB_MM_TO_COORD(10)); + RND_DAD_DEFAULT_NUM(ctx->dlg, (rnd_coord_t)PCB_MM_TO_COORD(1)); + RND_DAD_CHANGE_CB(ctx->dlg, pstklib_update_prv); - PCB_DAD_LABEL(ctx->dlg, ""); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Vis"); - PCB_DAD_HELP(ctx->dlg, "layer is visible"); - PCB_DAD_LABEL(ctx->dlg, "Curr"); - PCB_DAD_HELP(ctx->dlg, "layer is set to current/primary\nfor display (color emphasis)"); - PCB_DAD_END(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, ""); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Vis"); + RND_DAD_HELP(ctx->dlg, "layer is visible"); + RND_DAD_LABEL(ctx->dlg, "Curr"); + RND_DAD_HELP(ctx->dlg, "layer is set to current/primary\nfor display (color emphasis)"); + RND_DAD_END(ctx->dlg); for(n = 0; n < pcb_proto_num_layers; n++) { - PCB_DAD_LABEL(ctx->dlg, pcb_proto_layers[n].name); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BOOL(ctx->dlg, ""); - PCB_DAD_DEFAULT_NUM(ctx->dlg, 1); - PCB_DAD_CHANGE_CB(ctx->dlg, pstklib_update_prv); - ctx->wlayerv[n] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BOOL(ctx->dlg, ""); - PCB_DAD_DEFAULT_NUM(ctx->dlg, (pcb_proto_layers[n].mask == (PCB_LYT_TOP | PCB_LYT_COPPER))); - PCB_DAD_CHANGE_CB(ctx->dlg, pstklib_update_layerc); - ctx->wlayerc[n] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, pcb_proto_layers[n].name); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BOOL(ctx->dlg, ""); + RND_DAD_DEFAULT_NUM(ctx->dlg, 1); + RND_DAD_CHANGE_CB(ctx->dlg, pstklib_update_prv); + ctx->wlayerv[n] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BOOL(ctx->dlg, ""); + RND_DAD_DEFAULT_NUM(ctx->dlg, (pcb_proto_layers[n].mask == (PCB_LYT_TOP | PCB_LYT_COPPER))); + RND_DAD_CHANGE_CB(ctx->dlg, pstklib_update_layerc); + ctx->wlayerc[n] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); } - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_BUTTON_CLOSES(ctx->dlg, (modal ? clbtn_modal : clbtn)); - PCB_DAD_END(ctx->dlg); + RND_DAD_BUTTON_CLOSES(ctx->dlg, (modal ? clbtn_modal : clbtn)); + RND_DAD_END(ctx->dlg); if (subc_id > 0) { if (sc->refdes != NULL) @@ -611,13 +611,13 @@ else name = rnd_strdup("pcb-rnd padstacks - board"); - PCB_DAD_NEW("pstk_lib", ctx->dlg, name, ctx, modal, pstklib_close_cb); + RND_DAD_NEW("pstk_lib", ctx->dlg, name, ctx, modal, pstklib_close_cb); pstklib_data2dlg(ctx); free(name); if (modal) { - if (PCB_DAD_RUN(ctx->dlg) != 0) + if (RND_DAD_RUN(ctx->dlg) != 0) return PCB_PADSTACK_INVALID; return pstklib_last_proto_id; } Index: trunk/src_plugins/dialogs/dlg_library.c =================================================================== --- trunk/src_plugins/dialogs/dlg_library.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_library.c (revision 30992) @@ -56,7 +56,7 @@ #define MAX_PARAMS 128 typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int wtree, wpreview, wtags, wfilt, wpend, wnopend, wedit; int active; /* already open - allow only one instance */ @@ -70,7 +70,7 @@ /* for the parametric */ int pactive; /* already open - allow only one instance */ int pwdesc; - PCB_DAD_DECL_NOINIT(pdlg) + RND_DAD_DECL_NOINIT(pdlg) pcb_fplibrary_t *last_l; char *example, *help_params; htsi_t param_names; /* param_name -> param_idx */ @@ -152,7 +152,7 @@ if (sc != NULL) { ctx->sc = pcb_subc_dup_at(ctx->prev_pcb, ctx->prev_pcb->Data, sc, 0, 0, 1); pcb_data_bbox(&bbox, ctx->sc->data, 0); - pcb_dad_preview_zoomto(&ctx->dlg[ctx->wpreview], &bbox); + rnd_dad_preview_zoomto(&ctx->dlg[ctx->wpreview], &bbox); } if (l != NULL) { @@ -243,12 +243,12 @@ if (ctx->pactive) { ctx->pactive = 0; - PCB_DAD_FREE(ctx->pdlg); + RND_DAD_FREE(ctx->pdlg); } timed_update_preview(ctx, 0); pcb_board_free(ctx->prev_pcb); - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); memset(ctx, 0, sizeof(library_ctx_t)); /* reset all states to the initial - includes ctx->active = 0; */ } @@ -263,7 +263,7 @@ rnd_hid_row_t *row; cell[0] = rnd_strdup(l->name); - row = pcb_dad_tree_append_under(attr, parent_row, cell); + row = rnd_dad_tree_append_under(attr, parent_row, cell); row->user_data = l; if (l->type == PCB_LIB_DIR) create_lib_tree_model_recurse(attr, l, row); @@ -640,7 +640,7 @@ static void pcb_dlg_library(void) { - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; const pcb_dflgmap_t *g; int n; @@ -653,63 +653,63 @@ pcb_layergrp_set_dflgly(library_ctx.prev_pcb, &(library_ctx.prev_pcb->LayerGroups.grp[n]), g, g->name, g->name); library_ctx.prev_pcb->LayerGroups.len = n; - PCB_DAD_BEGIN_VBOX(library_ctx.dlg); - PCB_DAD_COMPFLAG(library_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HPANE(library_ctx.dlg); + RND_DAD_BEGIN_VBOX(library_ctx.dlg); + RND_DAD_COMPFLAG(library_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_HPANE(library_ctx.dlg); /* left */ - PCB_DAD_BEGIN_VBOX(library_ctx.dlg); - PCB_DAD_COMPFLAG(library_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_TREE(library_ctx.dlg, 1, 1, NULL); - PCB_DAD_COMPFLAG(library_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - PCB_DAD_TREE_SET_CB(library_ctx.dlg, selected_cb, library_select); - PCB_DAD_TREE_SET_CB(library_ctx.dlg, ctx, &library_ctx); - library_ctx.wtree = PCB_DAD_CURRENT(library_ctx.dlg); - PCB_DAD_BEGIN_HBOX(library_ctx.dlg); - PCB_DAD_STRING(library_ctx.dlg); - PCB_DAD_COMPFLAG(library_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_HELP(library_ctx.dlg, "filter: display only footprints matching this text\n(if empty: display all)"); - PCB_DAD_CHANGE_CB(library_ctx.dlg, library_filter_cb); - library_ctx.wfilt = PCB_DAD_CURRENT(library_ctx.dlg); - PCB_DAD_PICBUTTON(library_ctx.dlg, xpm_edit_param); - PCB_DAD_HELP(library_ctx.dlg, "open GUI to edit the parameters\nof a parametric footprint"); - PCB_DAD_CHANGE_CB(library_ctx.dlg, library_edit_cb); - library_ctx.wedit = PCB_DAD_CURRENT(library_ctx.dlg); - PCB_DAD_PICBUTTON(library_ctx.dlg, xpm_refresh); - PCB_DAD_HELP(library_ctx.dlg, "reload and refresh the current\nmain tree of the library"); - PCB_DAD_CHANGE_CB(library_ctx.dlg, library_refresh_cb); - PCB_DAD_END(library_ctx.dlg); - PCB_DAD_END(library_ctx.dlg); + RND_DAD_BEGIN_VBOX(library_ctx.dlg); + RND_DAD_COMPFLAG(library_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_TREE(library_ctx.dlg, 1, 1, NULL); + RND_DAD_COMPFLAG(library_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + RND_DAD_TREE_SET_CB(library_ctx.dlg, selected_cb, library_select); + RND_DAD_TREE_SET_CB(library_ctx.dlg, ctx, &library_ctx); + library_ctx.wtree = RND_DAD_CURRENT(library_ctx.dlg); + RND_DAD_BEGIN_HBOX(library_ctx.dlg); + RND_DAD_STRING(library_ctx.dlg); + RND_DAD_COMPFLAG(library_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_HELP(library_ctx.dlg, "filter: display only footprints matching this text\n(if empty: display all)"); + RND_DAD_CHANGE_CB(library_ctx.dlg, library_filter_cb); + library_ctx.wfilt = RND_DAD_CURRENT(library_ctx.dlg); + RND_DAD_PICBUTTON(library_ctx.dlg, xpm_edit_param); + RND_DAD_HELP(library_ctx.dlg, "open GUI to edit the parameters\nof a parametric footprint"); + RND_DAD_CHANGE_CB(library_ctx.dlg, library_edit_cb); + library_ctx.wedit = RND_DAD_CURRENT(library_ctx.dlg); + RND_DAD_PICBUTTON(library_ctx.dlg, xpm_refresh); + RND_DAD_HELP(library_ctx.dlg, "reload and refresh the current\nmain tree of the library"); + RND_DAD_CHANGE_CB(library_ctx.dlg, library_refresh_cb); + RND_DAD_END(library_ctx.dlg); + RND_DAD_END(library_ctx.dlg); /* right */ - PCB_DAD_BEGIN_VPANE(library_ctx.dlg); - PCB_DAD_COMPFLAG(library_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_FRAME); + RND_DAD_BEGIN_VPANE(library_ctx.dlg); + RND_DAD_COMPFLAG(library_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_FRAME); /* right top */ - PCB_DAD_PREVIEW(library_ctx.dlg, library_expose, library_mouse, NULL, NULL, 100, 100, &library_ctx); - library_ctx.wpreview = PCB_DAD_CURRENT(library_ctx.dlg); + RND_DAD_PREVIEW(library_ctx.dlg, library_expose, library_mouse, NULL, NULL, 100, 100, &library_ctx); + library_ctx.wpreview = RND_DAD_CURRENT(library_ctx.dlg); /* right bottom */ - PCB_DAD_BEGIN_VBOX(library_ctx.dlg); - PCB_DAD_COMPFLAG(library_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(library_ctx.dlg, "Refreshing"); - PCB_DAD_COMPFLAG(library_ctx.dlg, RND_HATF_HIDE); - library_ctx.wpend = PCB_DAD_CURRENT(library_ctx.dlg); - PCB_DAD_LABEL(library_ctx.dlg, " "); - library_ctx.wnopend = PCB_DAD_CURRENT(library_ctx.dlg); + RND_DAD_BEGIN_VBOX(library_ctx.dlg); + RND_DAD_COMPFLAG(library_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(library_ctx.dlg, "Refreshing"); + RND_DAD_COMPFLAG(library_ctx.dlg, RND_HATF_HIDE); + library_ctx.wpend = RND_DAD_CURRENT(library_ctx.dlg); + RND_DAD_LABEL(library_ctx.dlg, " "); + library_ctx.wnopend = RND_DAD_CURRENT(library_ctx.dlg); TODO("rich text label"); - PCB_DAD_LABEL(library_ctx.dlg, ""); - library_ctx.wtags = PCB_DAD_CURRENT(library_ctx.dlg); - PCB_DAD_END(library_ctx.dlg); - PCB_DAD_END(library_ctx.dlg); - PCB_DAD_END(library_ctx.dlg); + RND_DAD_LABEL(library_ctx.dlg, ""); + library_ctx.wtags = RND_DAD_CURRENT(library_ctx.dlg); + RND_DAD_END(library_ctx.dlg); + RND_DAD_END(library_ctx.dlg); + RND_DAD_END(library_ctx.dlg); /* bottom */ - PCB_DAD_BUTTON_CLOSES(library_ctx.dlg, clbtn); - PCB_DAD_END(library_ctx.dlg); + RND_DAD_BUTTON_CLOSES(library_ctx.dlg, clbtn); + RND_DAD_END(library_ctx.dlg); /* set up the context */ library_ctx.active = 1; - PCB_DAD_NEW("library", library_ctx.dlg, "pcb-rnd Footprint Library", &library_ctx, pcb_false, library_close_cb); + RND_DAD_NEW("library", library_ctx.dlg, "pcb-rnd Footprint Library", &library_ctx, pcb_false, library_close_cb); library_lib2dlg(&library_ctx); rnd_gui->attr_dlg_widget_state(library_ctx.dlg_hid_ctx, library_ctx.wedit, 0); Index: trunk/src_plugins/dialogs/dlg_library_param.c =================================================================== --- trunk/src_plugins/dialogs/dlg_library_param.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_library_param.c (revision 30992) @@ -43,7 +43,7 @@ htsi_uninit(&ctx->param_names); if (ctx->pactive) { ctx->pactive = 0; - PCB_DAD_FREE(ctx->pdlg); + RND_DAD_FREE(ctx->pdlg); } update_edit_button(ctx); } @@ -141,37 +141,37 @@ if (curr_type == RND_HATT_END) \ break; \ pre_append(); \ - PCB_DAD_LABEL(library_ctx.pdlg, name); \ - PCB_DAD_HELP(library_ctx.pdlg, rnd_strdup(help)); \ + RND_DAD_LABEL(library_ctx.pdlg, name); \ + RND_DAD_HELP(library_ctx.pdlg, rnd_strdup(help)); \ switch(curr_type) { \ case RND_HATT_COORD: \ case RND_HATT_END: \ - PCB_DAD_COORD(library_ctx.pdlg, ""); \ - ctx->pwid[curr] = PCB_DAD_CURRENT(library_ctx.pdlg); \ - PCB_DAD_MINMAX(library_ctx.pdlg, 0, PCB_MM_TO_COORD(512)); \ - PCB_DAD_CHANGE_CB(library_ctx.pdlg, library_param_cb); \ + RND_DAD_COORD(library_ctx.pdlg, ""); \ + ctx->pwid[curr] = RND_DAD_CURRENT(library_ctx.pdlg); \ + RND_DAD_MINMAX(library_ctx.pdlg, 0, PCB_MM_TO_COORD(512)); \ + RND_DAD_CHANGE_CB(library_ctx.pdlg, library_param_cb); \ break; \ case RND_HATT_STRING: \ - PCB_DAD_STRING(library_ctx.pdlg); \ - ctx->pwid[curr] = PCB_DAD_CURRENT(library_ctx.pdlg); \ - PCB_DAD_CHANGE_CB(library_ctx.pdlg, library_param_cb); \ + RND_DAD_STRING(library_ctx.pdlg); \ + ctx->pwid[curr] = RND_DAD_CURRENT(library_ctx.pdlg); \ + RND_DAD_CHANGE_CB(library_ctx.pdlg, library_param_cb); \ break; \ case RND_HATT_BOOL: \ - PCB_DAD_BOOL(library_ctx.pdlg, ""); \ - ctx->pwid[curr] = PCB_DAD_CURRENT(library_ctx.pdlg); \ - PCB_DAD_CHANGE_CB(library_ctx.pdlg, library_param_cb); \ + RND_DAD_BOOL(library_ctx.pdlg, ""); \ + ctx->pwid[curr] = RND_DAD_CURRENT(library_ctx.pdlg); \ + RND_DAD_CHANGE_CB(library_ctx.pdlg, library_param_cb); \ break; \ case RND_HATT_ENUM: \ - PCB_DAD_ENUM(library_ctx.pdlg, (const char **)curr_enum.array); \ - ctx->pwid[curr] = PCB_DAD_CURRENT(library_ctx.pdlg); \ - PCB_DAD_CHANGE_CB(library_ctx.pdlg, library_param_cb); \ + RND_DAD_ENUM(library_ctx.pdlg, (const char **)curr_enum.array); \ + ctx->pwid[curr] = RND_DAD_CURRENT(library_ctx.pdlg); \ + RND_DAD_CHANGE_CB(library_ctx.pdlg, library_param_cb); \ vtp0_init(&curr_enum); \ vtp0_append(&curr_enum, rnd_strdup("")); \ break; \ default: \ - PCB_DAD_LABEL(library_ctx.pdlg, "internal error: invalid type"); \ + RND_DAD_LABEL(library_ctx.pdlg, "internal error: invalid type"); \ } \ - PCB_DAD_HELP(library_ctx.pdlg, rnd_strdup(help)); \ + RND_DAD_HELP(library_ctx.pdlg, rnd_strdup(help)); \ ctx->pnames[curr] = rnd_strdup(name); \ htsi_set(&ctx->param_names, ctx->pnames[curr], curr); \ post_append(); \ @@ -526,23 +526,23 @@ static int library_param_open(library_ctx_t *ctx, pcb_fplibrary_t *l, FILE *f) { - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; int w, oversized = 0; - PCB_DAD_BEGIN_VBOX(library_ctx.pdlg); - PCB_DAD_COMPFLAG(library_ctx.pdlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(library_ctx.pdlg, "n/a"); - ctx->pwdesc = PCB_DAD_CURRENT(library_ctx.pdlg); - PCB_DAD_BEGIN_TABLE(library_ctx.pdlg, 2); - PCB_DAD_COMPFLAG(library_ctx.pdlg, RND_HATF_EXPFILL); - w = PCB_DAD_CURRENT(library_ctx.pdlg); + RND_DAD_BEGIN_VBOX(library_ctx.pdlg); + RND_DAD_COMPFLAG(library_ctx.pdlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(library_ctx.pdlg, "n/a"); + ctx->pwdesc = RND_DAD_CURRENT(library_ctx.pdlg); + RND_DAD_BEGIN_TABLE(library_ctx.pdlg, 2); + RND_DAD_COMPFLAG(library_ctx.pdlg, RND_HATF_EXPFILL); + w = RND_DAD_CURRENT(library_ctx.pdlg); if (library_param_build(ctx, l, f) > 16) { library_ctx.pdlg[w].rnd_hatt_flags |= RND_HATF_SCROLL; oversized = 1; } - PCB_DAD_END(library_ctx.pdlg); - PCB_DAD_BUTTON_CLOSES(library_ctx.pdlg, clbtn); - PCB_DAD_END(library_ctx.pdlg); + RND_DAD_END(library_ctx.pdlg); + RND_DAD_BUTTON_CLOSES(library_ctx.pdlg, clbtn); + RND_DAD_END(library_ctx.pdlg); return oversized; } @@ -579,7 +579,7 @@ if (ctx->last_l != l) { if (ctx->pactive) { ctx->pactive = 0; - PCB_DAD_FREE(ctx->pdlg); + RND_DAD_FREE(ctx->pdlg); } update_edit_button(ctx); } @@ -605,11 +605,11 @@ /* oversized dialog got the scroll bar, which would make it small; set preferred size so it opens in reasonable area even when win size not persistent (window palcement code) */ - PCB_DAD_DEFSIZE(library_ctx.pdlg, 700, 500); + RND_DAD_DEFSIZE(library_ctx.pdlg, 700, 500); } pcb_pclose(f); - PCB_DAD_NEW("lib_param", library_ctx.pdlg, "pcb-rnd parametric footprint", ctx, pcb_false, library_param_close_cb); + RND_DAD_NEW("lib_param", library_ctx.pdlg, "pcb-rnd parametric footprint", ctx, pcb_false, library_param_close_cb); update_edit_button(ctx); pcb_library_param_fillin(ctx, l); Index: trunk/src_plugins/dialogs/dlg_loadsave.c =================================================================== --- trunk/src_plugins/dialogs/dlg_loadsave.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_loadsave.c (revision 30992) @@ -314,14 +314,14 @@ } save->fmt_tab_names[tabs+1] = NULL; - PCB_DAD_BEGIN_TABBED(save->fmtsub->dlg, save->fmt_tab_names); - PCB_DAD_COMPFLAG(save->fmtsub->dlg, RND_HATF_HIDE_TABLAB); - save->wopts = PCB_DAD_CURRENT(save->fmtsub->dlg); -/* pre-creation tab switch not yet supported: PCB_DAD_DEFAULT_NUM(save->fmtsub->dlg, save->opt_tab[0]);*/ + RND_DAD_BEGIN_TABBED(save->fmtsub->dlg, save->fmt_tab_names); + RND_DAD_COMPFLAG(save->fmtsub->dlg, RND_HATF_HIDE_TABLAB); + save->wopts = RND_DAD_CURRENT(save->fmtsub->dlg); +/* pre-creation tab switch not yet supported: RND_DAD_DEFAULT_NUM(save->fmtsub->dlg, save->opt_tab[0]);*/ /* the no-options tab */ - PCB_DAD_LABEL(save->fmtsub->dlg, "(no format options)"); - PCB_DAD_HELP(save->fmtsub->dlg, "Some formats offer format-specific options\nwhich are normally displayed here.\nThe currently selected format does\nnot offer any options."); + RND_DAD_LABEL(save->fmtsub->dlg, "(no format options)"); + RND_DAD_HELP(save->fmtsub->dlg, "Some formats offer format-specific options\nwhich are normally displayed here.\nThe currently selected format does\nnot offer any options."); /* all other tabs, filled in by the plug code */ for(n = 1; n < tabs+1; n++) { @@ -328,15 +328,15 @@ for(i = 0; i < save->num_fmts; i++) { if (save->opt_tab[i] == n) { const pcb_plug_io_t *plug = save->avail->plug[i]; - PCB_DAD_BEGIN_VBOX(save->fmtsub->dlg); + RND_DAD_BEGIN_VBOX(save->fmtsub->dlg); save->fmt_plug_data[n] = plug->save_as_subd_init(plug, save->fmtsub, save_type); - PCB_DAD_END(save->fmtsub->dlg); + RND_DAD_END(save->fmtsub->dlg); break; } } } save->tabs = tabs+1; - PCB_DAD_END(save->fmtsub->dlg); + RND_DAD_END(save->fmtsub->dlg); } static void setup_fmt_sub(save_t *save, pcb_plug_iot_t save_type) @@ -348,31 +348,31 @@ "(guessing will NOT change the initial format selection\n" "when the dialog box is fresh open)"; - PCB_DAD_BEGIN_VBOX(save->fmtsub->dlg); - PCB_DAD_BEGIN_HBOX(save->fmtsub->dlg); - PCB_DAD_LABEL(save->fmtsub->dlg, "File format:"); - PCB_DAD_ENUM(save->fmtsub->dlg, (const char **)save->avail->digest); - save->wfmt = PCB_DAD_CURRENT(save->fmtsub->dlg); - PCB_DAD_DEFAULT_NUM(save->fmtsub->dlg, save->pick); - PCB_DAD_CHANGE_CB(save->fmtsub->dlg, fmt_chg); - PCB_DAD_END(save->fmtsub->dlg); - PCB_DAD_BEGIN_HBOX(save->fmtsub->dlg); - PCB_DAD_LABEL(save->fmtsub->dlg, "Guess format:"); - PCB_DAD_HELP(save->fmtsub->dlg, guess_help); - PCB_DAD_BOOL(save->fmtsub->dlg, ""); - save->wguess = PCB_DAD_CURRENT(save->fmtsub->dlg); - PCB_DAD_CHANGE_CB(save->fmtsub->dlg, guess_chg); - PCB_DAD_DEFAULT_NUM(save->fmtsub->dlg, !!dialogs_conf.plugins.dialogs.file_select_dialog.save_as_format_guess); - PCB_DAD_HELP(save->fmtsub->dlg, guess_help); - PCB_DAD_LABEL(save->fmtsub->dlg, "(guess failed)"); - PCB_DAD_COMPFLAG(save->fmtsub->dlg, RND_HATF_HIDE); - PCB_DAD_HELP(save->fmtsub->dlg, "This file name is not naturally connected to\nany file format; file format\nis left on what was last selected/recognized"); - save->wguess_err = PCB_DAD_CURRENT(save->fmtsub->dlg); - PCB_DAD_END(save->fmtsub->dlg); + RND_DAD_BEGIN_VBOX(save->fmtsub->dlg); + RND_DAD_BEGIN_HBOX(save->fmtsub->dlg); + RND_DAD_LABEL(save->fmtsub->dlg, "File format:"); + RND_DAD_ENUM(save->fmtsub->dlg, (const char **)save->avail->digest); + save->wfmt = RND_DAD_CURRENT(save->fmtsub->dlg); + RND_DAD_DEFAULT_NUM(save->fmtsub->dlg, save->pick); + RND_DAD_CHANGE_CB(save->fmtsub->dlg, fmt_chg); + RND_DAD_END(save->fmtsub->dlg); + RND_DAD_BEGIN_HBOX(save->fmtsub->dlg); + RND_DAD_LABEL(save->fmtsub->dlg, "Guess format:"); + RND_DAD_HELP(save->fmtsub->dlg, guess_help); + RND_DAD_BOOL(save->fmtsub->dlg, ""); + save->wguess = RND_DAD_CURRENT(save->fmtsub->dlg); + RND_DAD_CHANGE_CB(save->fmtsub->dlg, guess_chg); + RND_DAD_DEFAULT_NUM(save->fmtsub->dlg, !!dialogs_conf.plugins.dialogs.file_select_dialog.save_as_format_guess); + RND_DAD_HELP(save->fmtsub->dlg, guess_help); + RND_DAD_LABEL(save->fmtsub->dlg, "(guess failed)"); + RND_DAD_COMPFLAG(save->fmtsub->dlg, RND_HATF_HIDE); + RND_DAD_HELP(save->fmtsub->dlg, "This file name is not naturally connected to\nany file format; file format\nis left on what was last selected/recognized"); + save->wguess_err = RND_DAD_CURRENT(save->fmtsub->dlg); + RND_DAD_END(save->fmtsub->dlg); setup_fmt_tabs(save, save_type); - PCB_DAD_END(save->fmtsub->dlg); + RND_DAD_END(save->fmtsub->dlg); } const char pcb_acts_Save[] = Index: trunk/src_plugins/dialogs/dlg_netlist.c =================================================================== --- trunk/src_plugins/dialogs/dlg_netlist.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_netlist.c (revision 30992) @@ -31,7 +31,7 @@ const char *dlg_netlist_cookie = "netlist dialog"; typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) pcb_board_t *pcb; rnd_rnd_box_t bb_prv; int wnetlist, wprev, wtermlist; @@ -44,7 +44,7 @@ static void netlist_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) { netlist_ctx_t *ctx = caller_data; - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); memset(ctx, 0, sizeof(netlist_ctx_t)); rnd_event(&PCB->hidlib, RND_EVENT_GUI_LEAD_USER, "cci", 0, 0, 0); } @@ -75,7 +75,7 @@ for(n = nets; *n != NULL; n++) { cell[0] = rnd_strdup((*n)->name); cell[1] = rnd_strdup((*n)->inhibit_rats ? "*" : ""); - pcb_dad_tree_append(attr, NULL, cell); + rnd_dad_tree_append(attr, NULL, cell); } free(nets); @@ -116,7 +116,7 @@ cell[1] = NULL; for(t = pcb_termlist_first(&net->conns); t != NULL; t = pcb_termlist_next(t)) { cell[0] = pcb_concat(t->refdes, "-", t->term, NULL); - pcb_dad_tree_append(attr, NULL, cell); + rnd_dad_tree_append(attr, NULL, cell); } /* restore cursor */ @@ -142,7 +142,7 @@ static void netlist_force_redraw(netlist_ctx_t *ctx) { - pcb_dad_preview_zoomto(&ctx->dlg[ctx->wprev], &ctx->bb_prv); + rnd_dad_preview_zoomto(&ctx->dlg[ctx->wprev], &ctx->bb_prv); } @@ -311,7 +311,7 @@ { static const char *hdr[] = {"network", "FR", NULL}; static const char *hdr2[] = {"terminals", NULL}; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; int wvpan; @@ -324,113 +324,113 @@ netlist_ctx.bb_prv.Y2 = pcb->hidlib.size_y; netlist_ctx.pcb = pcb; - PCB_DAD_BEGIN_VBOX(netlist_ctx.dlg); /* layout */ - PCB_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(netlist_ctx.dlg); /* layout */ + RND_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HPANE(netlist_ctx.dlg); - PCB_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_HPANE(netlist_ctx.dlg); + RND_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_VBOX(netlist_ctx.dlg); /* left */ - PCB_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_TREE(netlist_ctx.dlg, 2, 0, hdr); - PCB_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - netlist_ctx.wnetlist = PCB_DAD_CURRENT(netlist_ctx.dlg); - PCB_DAD_TREE_SET_CB(netlist_ctx.dlg, selected_cb, netlist_row_selected); - PCB_DAD_TREE_SET_CB(netlist_ctx.dlg, ctx, &netlist_ctx); - PCB_DAD_END(netlist_ctx.dlg); + RND_DAD_BEGIN_VBOX(netlist_ctx.dlg); /* left */ + RND_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_TREE(netlist_ctx.dlg, 2, 0, hdr); + RND_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + netlist_ctx.wnetlist = RND_DAD_CURRENT(netlist_ctx.dlg); + RND_DAD_TREE_SET_CB(netlist_ctx.dlg, selected_cb, netlist_row_selected); + RND_DAD_TREE_SET_CB(netlist_ctx.dlg, ctx, &netlist_ctx); + RND_DAD_END(netlist_ctx.dlg); - PCB_DAD_BEGIN_VBOX(netlist_ctx.dlg); /* right */ - PCB_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_VPANE(netlist_ctx.dlg); - PCB_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); - wvpan = PCB_DAD_CURRENT(netlist_ctx.dlg); - PCB_DAD_BEGIN_VBOX(netlist_ctx.dlg); /* right-top */ - PCB_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_PREVIEW(netlist_ctx.dlg, netlist_expose, netlist_mouse, NULL, &netlist_ctx.bb_prv, 100, 100, &netlist_ctx); - PCB_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_PRV_BOARD); - netlist_ctx.wprev = PCB_DAD_CURRENT(netlist_ctx.dlg); - PCB_DAD_END(netlist_ctx.dlg); - PCB_DAD_BEGIN_VBOX(netlist_ctx.dlg); /* right-bottom */ - PCB_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_TREE(netlist_ctx.dlg, 1, 0, hdr2); - PCB_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - netlist_ctx.wtermlist = PCB_DAD_CURRENT(netlist_ctx.dlg); - PCB_DAD_TREE_SET_CB(netlist_ctx.dlg, selected_cb, termlist_row_selected); - PCB_DAD_TREE_SET_CB(netlist_ctx.dlg, ctx, &netlist_ctx); - PCB_DAD_END(netlist_ctx.dlg); - PCB_DAD_END(netlist_ctx.dlg); - PCB_DAD_END(netlist_ctx.dlg); - PCB_DAD_END(netlist_ctx.dlg); + RND_DAD_BEGIN_VBOX(netlist_ctx.dlg); /* right */ + RND_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VPANE(netlist_ctx.dlg); + RND_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); + wvpan = RND_DAD_CURRENT(netlist_ctx.dlg); + RND_DAD_BEGIN_VBOX(netlist_ctx.dlg); /* right-top */ + RND_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_PREVIEW(netlist_ctx.dlg, netlist_expose, netlist_mouse, NULL, &netlist_ctx.bb_prv, 100, 100, &netlist_ctx); + RND_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_PRV_BOARD); + netlist_ctx.wprev = RND_DAD_CURRENT(netlist_ctx.dlg); + RND_DAD_END(netlist_ctx.dlg); + RND_DAD_BEGIN_VBOX(netlist_ctx.dlg); /* right-bottom */ + RND_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_TREE(netlist_ctx.dlg, 1, 0, hdr2); + RND_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + netlist_ctx.wtermlist = RND_DAD_CURRENT(netlist_ctx.dlg); + RND_DAD_TREE_SET_CB(netlist_ctx.dlg, selected_cb, termlist_row_selected); + RND_DAD_TREE_SET_CB(netlist_ctx.dlg, ctx, &netlist_ctx); + RND_DAD_END(netlist_ctx.dlg); + RND_DAD_END(netlist_ctx.dlg); + RND_DAD_END(netlist_ctx.dlg); + RND_DAD_END(netlist_ctx.dlg); - PCB_DAD_BEGIN_HBOX(netlist_ctx.dlg); /* bottom button row */ - PCB_DAD_BEGIN_VBOX(netlist_ctx.dlg); - PCB_DAD_BUTTON(netlist_ctx.dlg, "select"); - PCB_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); - netlist_ctx.wsel = PCB_DAD_CURRENT(netlist_ctx.dlg); - PCB_DAD_BUTTON(netlist_ctx.dlg, "unsel."); - PCB_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); - netlist_ctx.wunsel = PCB_DAD_CURRENT(netlist_ctx.dlg); - PCB_DAD_END(netlist_ctx.dlg); - PCB_DAD_BEGIN_VBOX(netlist_ctx.dlg); - PCB_DAD_BUTTON(netlist_ctx.dlg, "find "); - PCB_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); - netlist_ctx.wfind = PCB_DAD_CURRENT(netlist_ctx.dlg); - PCB_DAD_BUTTON(netlist_ctx.dlg, "clear"); - PCB_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); - netlist_ctx.wunfind = PCB_DAD_CURRENT(netlist_ctx.dlg); - PCB_DAD_END(netlist_ctx.dlg); - PCB_DAD_BEGIN_VBOX(netlist_ctx.dlg); - PCB_DAD_BUTTON(netlist_ctx.dlg, "rat disable"); - PCB_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); - netlist_ctx.wnorats = PCB_DAD_CURRENT(netlist_ctx.dlg); - PCB_DAD_BUTTON(netlist_ctx.dlg, "rat enable"); - netlist_ctx.wrats = PCB_DAD_CURRENT(netlist_ctx.dlg); - PCB_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); - PCB_DAD_END(netlist_ctx.dlg); - PCB_DAD_BEGIN_VBOX(netlist_ctx.dlg); - PCB_DAD_BUTTON(netlist_ctx.dlg, "add rats"); - netlist_ctx.waddrats = PCB_DAD_CURRENT(netlist_ctx.dlg); - PCB_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); - PCB_DAD_BUTTON(netlist_ctx.dlg, "rip up "); - netlist_ctx.wripup = PCB_DAD_CURRENT(netlist_ctx.dlg); - PCB_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); - PCB_DAD_END(netlist_ctx.dlg); - PCB_DAD_BEGIN_VBOX(netlist_ctx.dlg); - PCB_DAD_BUTTON(netlist_ctx.dlg, "rename"); - netlist_ctx.wrename = PCB_DAD_CURRENT(netlist_ctx.dlg); - PCB_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); + RND_DAD_BEGIN_HBOX(netlist_ctx.dlg); /* bottom button row */ + RND_DAD_BEGIN_VBOX(netlist_ctx.dlg); + RND_DAD_BUTTON(netlist_ctx.dlg, "select"); + RND_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); + netlist_ctx.wsel = RND_DAD_CURRENT(netlist_ctx.dlg); + RND_DAD_BUTTON(netlist_ctx.dlg, "unsel."); + RND_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); + netlist_ctx.wunsel = RND_DAD_CURRENT(netlist_ctx.dlg); + RND_DAD_END(netlist_ctx.dlg); + RND_DAD_BEGIN_VBOX(netlist_ctx.dlg); + RND_DAD_BUTTON(netlist_ctx.dlg, "find "); + RND_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); + netlist_ctx.wfind = RND_DAD_CURRENT(netlist_ctx.dlg); + RND_DAD_BUTTON(netlist_ctx.dlg, "clear"); + RND_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); + netlist_ctx.wunfind = RND_DAD_CURRENT(netlist_ctx.dlg); + RND_DAD_END(netlist_ctx.dlg); + RND_DAD_BEGIN_VBOX(netlist_ctx.dlg); + RND_DAD_BUTTON(netlist_ctx.dlg, "rat disable"); + RND_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); + netlist_ctx.wnorats = RND_DAD_CURRENT(netlist_ctx.dlg); + RND_DAD_BUTTON(netlist_ctx.dlg, "rat enable"); + netlist_ctx.wrats = RND_DAD_CURRENT(netlist_ctx.dlg); + RND_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); + RND_DAD_END(netlist_ctx.dlg); + RND_DAD_BEGIN_VBOX(netlist_ctx.dlg); + RND_DAD_BUTTON(netlist_ctx.dlg, "add rats"); + netlist_ctx.waddrats = RND_DAD_CURRENT(netlist_ctx.dlg); + RND_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); + RND_DAD_BUTTON(netlist_ctx.dlg, "rip up "); + netlist_ctx.wripup = RND_DAD_CURRENT(netlist_ctx.dlg); + RND_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); + RND_DAD_END(netlist_ctx.dlg); + RND_DAD_BEGIN_VBOX(netlist_ctx.dlg); + RND_DAD_BUTTON(netlist_ctx.dlg, "rename"); + netlist_ctx.wrename = RND_DAD_CURRENT(netlist_ctx.dlg); + RND_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); - PCB_DAD_BEGIN_HBOX(netlist_ctx.dlg); - PCB_DAD_BUTTON(netlist_ctx.dlg, "merge"); - netlist_ctx.wmerge = PCB_DAD_CURRENT(netlist_ctx.dlg); - PCB_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); - PCB_DAD_BUTTON(netlist_ctx.dlg, "attr"); - netlist_ctx.wattr = PCB_DAD_CURRENT(netlist_ctx.dlg); - PCB_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); - PCB_DAD_END(netlist_ctx.dlg); - PCB_DAD_END(netlist_ctx.dlg); - PCB_DAD_END(netlist_ctx.dlg); + RND_DAD_BEGIN_HBOX(netlist_ctx.dlg); + RND_DAD_BUTTON(netlist_ctx.dlg, "merge"); + netlist_ctx.wmerge = RND_DAD_CURRENT(netlist_ctx.dlg); + RND_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); + RND_DAD_BUTTON(netlist_ctx.dlg, "attr"); + netlist_ctx.wattr = RND_DAD_CURRENT(netlist_ctx.dlg); + RND_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_button_cb); + RND_DAD_END(netlist_ctx.dlg); + RND_DAD_END(netlist_ctx.dlg); + RND_DAD_END(netlist_ctx.dlg); - PCB_DAD_BEGIN_HBOX(netlist_ctx.dlg); /* bottom button row */ - PCB_DAD_LABEL(netlist_ctx.dlg, "Claim net:"); - PCB_DAD_BUTTON(netlist_ctx.dlg, "click"); - PCB_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_claim_obj_cb); - PCB_DAD_BUTTON(netlist_ctx.dlg, "select"); - PCB_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_claim_sel_cb); - PCB_DAD_BUTTON(netlist_ctx.dlg, "found"); - PCB_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_claim_fnd_cb); - PCB_DAD_BEGIN_VBOX(netlist_ctx.dlg); /* fill between buttons and close */ - PCB_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_END(netlist_ctx.dlg); - PCB_DAD_BUTTON_CLOSES(netlist_ctx.dlg, clbtn); - PCB_DAD_END(netlist_ctx.dlg); - PCB_DAD_END(netlist_ctx.dlg); + RND_DAD_BEGIN_HBOX(netlist_ctx.dlg); /* bottom button row */ + RND_DAD_LABEL(netlist_ctx.dlg, "Claim net:"); + RND_DAD_BUTTON(netlist_ctx.dlg, "click"); + RND_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_claim_obj_cb); + RND_DAD_BUTTON(netlist_ctx.dlg, "select"); + RND_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_claim_sel_cb); + RND_DAD_BUTTON(netlist_ctx.dlg, "found"); + RND_DAD_CHANGE_CB(netlist_ctx.dlg, netlist_claim_fnd_cb); + RND_DAD_BEGIN_VBOX(netlist_ctx.dlg); /* fill between buttons and close */ + RND_DAD_COMPFLAG(netlist_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_END(netlist_ctx.dlg); + RND_DAD_BUTTON_CLOSES(netlist_ctx.dlg, clbtn); + RND_DAD_END(netlist_ctx.dlg); + RND_DAD_END(netlist_ctx.dlg); /* set up the context */ netlist_ctx.active = 1; - PCB_DAD_DEFSIZE(netlist_ctx.dlg, 300, 350); - PCB_DAD_NEW("netlist", netlist_ctx.dlg, "pcb-rnd netlist", &netlist_ctx, pcb_false, netlist_close_cb); + RND_DAD_DEFSIZE(netlist_ctx.dlg, 300, 350); + RND_DAD_NEW("netlist", netlist_ctx.dlg, "pcb-rnd netlist", &netlist_ctx, pcb_false, netlist_close_cb); { rnd_hid_attr_val_t hv; Index: trunk/src_plugins/dialogs/dlg_padstack.c =================================================================== --- trunk/src_plugins/dialogs/dlg_padstack.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_padstack.c (revision 30992) @@ -85,11 +85,11 @@ if ((proto != NULL) && (proto->name != NULL)) 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, 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); + RND_DAD_SET_VALUE(hid_ctx, pse->proto_id, str, tmp); + RND_DAD_SET_VALUE(hid_ctx, pse->clearance, crd, pse->ps->Clearance); + RND_DAD_SET_VALUE(hid_ctx, pse->rot, dbl, pse->ps->rot); + RND_DAD_SET_VALUE(hid_ctx, pse->xmirror, lng, pse->ps->xmirror); + RND_DAD_SET_VALUE(hid_ctx, pse->smirror, lng, pse->ps->smirror); /* proto - layers */ memset(shp_found, 0, sizeof(shp_found)); @@ -103,10 +103,10 @@ switch(shape->shape) { case PCB_PSSH_HSHADOW: *tmp = '\0'; - PCB_DAD_SET_VALUE(hid_ctx, pse->proto_shape[n], str, "hshadow"); + RND_DAD_SET_VALUE(hid_ctx, pse->proto_shape[n], str, "hshadow"); break; case PCB_PSSH_CIRC: - PCB_DAD_SET_VALUE(hid_ctx, pse->proto_shape[n], str, "circle"); + RND_DAD_SET_VALUE(hid_ctx, pse->proto_shape[n], str, "circle"); if ((shape->data.circ.x != 0) || (shape->data.circ.y != 0)) pcb_snprintf(tmp, sizeof(tmp), "dia=%.06$mm\nat %.06$mm;%.06$mm", shape->data.circ.dia, shape->data.circ.x, shape->data.circ.y); else @@ -114,26 +114,26 @@ break; case PCB_PSSH_LINE: if (shape->data.line.square) - PCB_DAD_SET_VALUE(hid_ctx, pse->proto_shape[n], str, "square line"); + RND_DAD_SET_VALUE(hid_ctx, pse->proto_shape[n], str, "square line"); else - PCB_DAD_SET_VALUE(hid_ctx, pse->proto_shape[n], str, "round line"); + RND_DAD_SET_VALUE(hid_ctx, pse->proto_shape[n], str, "round line"); pcb_snprintf(tmp, sizeof(tmp), "thickness=%.06$mm", shape->data.line.thickness); break; case PCB_PSSH_POLY: - PCB_DAD_SET_VALUE(hid_ctx, pse->proto_shape[n], str, "polygon"); + RND_DAD_SET_VALUE(hid_ctx, pse->proto_shape[n], str, "polygon"); pcb_snprintf(tmp, sizeof(tmp), "corners=%d", shape->data.poly.len); break; default: - PCB_DAD_SET_VALUE(hid_ctx, pse->proto_shape[n], str, ""); + RND_DAD_SET_VALUE(hid_ctx, pse->proto_shape[n], str, ""); strcpy(tmp, ""); } - PCB_DAD_SET_VALUE(hid_ctx, pse->proto_info[n], str, tmp); - PCB_DAD_SET_VALUE(hid_ctx, pse->proto_clr[n], crd, shape->clearance); + RND_DAD_SET_VALUE(hid_ctx, pse->proto_info[n], str, tmp); + RND_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], crd, 0); + RND_DAD_SET_VALUE(hid_ctx, pse->proto_shape[n], str, ""); + RND_DAD_SET_VALUE(hid_ctx, pse->proto_info[n], str, ""); + RND_DAD_SET_VALUE(hid_ctx, pse->proto_clr[n], crd, 0); } } @@ -167,29 +167,29 @@ } rnd_gui->attr_dlg_widget_state(hid_ctx, pse->hdia, 1); } - PCB_DAD_SET_VALUE(hid_ctx, pse->hole_header, str, s); + RND_DAD_SET_VALUE(hid_ctx, pse->hole_header, str, s); free((char *)pse->attrs[pse->prname].val.str); pse->attrs[pse->prname].val.str = NULL; - PCB_DAD_SET_VALUE(hid_ctx, pse->prname, str, rnd_strdup(proto->name == NULL ? "" : proto->name)); - 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); + RND_DAD_SET_VALUE(hid_ctx, pse->prname, str, rnd_strdup(proto->name == NULL ? "" : proto->name)); + RND_DAD_SET_VALUE(hid_ctx, pse->hdia, crd, proto->hdia); + RND_DAD_SET_VALUE(hid_ctx, pse->hplated, lng, proto->hplated); + RND_DAD_SET_VALUE(hid_ctx, pse->htop_val, lng, proto->htop); + RND_DAD_SET_VALUE(hid_ctx, pse->hbot_val, lng, proto->hbottom); if (proto->htop == 0) strcpy(tmp, "top copper group"); else sprintf(tmp, "%d groups from\nthe %s copper group", proto->htop, proto->htop > 0 ? "top" : "bottom"); - PCB_DAD_SET_VALUE(hid_ctx, pse->htop_text, str, tmp); - PCB_DAD_SET_VALUE(hid_ctx, pse->htop_layer, str, pse_group_string(pse->pcb, top_grp, tmp, sizeof(tmp))); + RND_DAD_SET_VALUE(hid_ctx, pse->htop_text, str, tmp); + RND_DAD_SET_VALUE(hid_ctx, pse->htop_layer, str, pse_group_string(pse->pcb, top_grp, tmp, sizeof(tmp))); if (proto->hbottom == 0) strcpy(tmp, "bottom copper group"); else sprintf(tmp, "%d groups from\nthe %s copper group", proto->hbottom, proto->hbottom > 0 ? "bottom" : "top"); - PCB_DAD_SET_VALUE(hid_ctx, pse->hbot_text, str, tmp); - PCB_DAD_SET_VALUE(hid_ctx, pse->hbot_layer, str, pse_group_string(pse->pcb, bottom_grp, tmp, sizeof(tmp))); + RND_DAD_SET_VALUE(hid_ctx, pse->hbot_text, str, tmp); + RND_DAD_SET_VALUE(hid_ctx, pse->hbot_layer, str, pse_group_string(pse->pcb, bottom_grp, tmp, sizeof(tmp))); } @@ -563,8 +563,8 @@ int n; char tmp[256]; const char *copy_from_names[pcb_proto_num_layers+1]; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; - PCB_DAD_DECL(dlg); + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + RND_DAD_DECL(dlg); pse->parent_hid_ctx = hid_ctx; @@ -580,64 +580,64 @@ } } - PCB_DAD_BEGIN_VBOX(dlg); + RND_DAD_BEGIN_VBOX(dlg); sprintf(tmp, "Automatically generate shape for ..."); - PCB_DAD_LABEL(dlg, tmp); - PCB_DAD_LABEL(dlg, ""); - pse->text_shape = PCB_DAD_CURRENT(dlg); - PCB_DAD_BUTTON(dlg, "Delete (no shape)"); - pse->del = PCB_DAD_CURRENT(dlg); - PCB_DAD_CHANGE_CB(dlg, pse_shape_del); - PCB_DAD_HELP(dlg, "Remove the shape from this layer type"); - PCB_DAD_BUTTON(dlg, "Replace shape with hshadow"); - pse->hshadow = PCB_DAD_CURRENT(dlg); - PCB_DAD_CHANGE_CB(dlg, pse_shape_hshadow); - PCB_DAD_HELP(dlg, "Set shape to hshadow on this layer type\n(invisible shape with the same\ngeometry as the hole or slot, for proper clearance)"); - PCB_DAD_BUTTON(dlg, "Derive automatically"); - pse->derive = PCB_DAD_CURRENT(dlg); - PCB_DAD_CHANGE_CB(dlg, pse_shape_auto); - PCB_DAD_HELP(dlg, "Derive the shape for this layer type\nfrom other, existing shapes of this padstack\n(automatic)"); - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_BUTTON(dlg, "Copy shape from"); - pse->copy_do = PCB_DAD_CURRENT(dlg); - PCB_DAD_CHANGE_CB(dlg, pse_shape_copy); - PCB_DAD_HELP(dlg, "Copy the shape for this layer type\nfrom other, existing shapes of this padstack\nfrom the layer type selected"); - PCB_DAD_BUTTON(dlg, "Swap shape with"); - pse->copy_do = PCB_DAD_CURRENT(dlg); - PCB_DAD_CHANGE_CB(dlg, pse_shape_swap); - PCB_DAD_HELP(dlg, "Swap the shape for this layer type\nwith another, existing shapes of this padstack\nfrom the layer type selected"); - PCB_DAD_HELP(dlg, "Select the other layer type for swapping shape"); - PCB_DAD_END(dlg); - PCB_DAD_ENUM(dlg, copy_from_names); /* coposite */ - pse->copy_from = PCB_DAD_CURRENT(dlg); - PCB_DAD_HELP(dlg, "Select the source layer type for\nmanual shape copy or shape swap"); - PCB_DAD_END(dlg); + RND_DAD_LABEL(dlg, tmp); + RND_DAD_LABEL(dlg, ""); + pse->text_shape = RND_DAD_CURRENT(dlg); + RND_DAD_BUTTON(dlg, "Delete (no shape)"); + pse->del = RND_DAD_CURRENT(dlg); + RND_DAD_CHANGE_CB(dlg, pse_shape_del); + RND_DAD_HELP(dlg, "Remove the shape from this layer type"); + RND_DAD_BUTTON(dlg, "Replace shape with hshadow"); + pse->hshadow = RND_DAD_CURRENT(dlg); + RND_DAD_CHANGE_CB(dlg, pse_shape_hshadow); + RND_DAD_HELP(dlg, "Set shape to hshadow on this layer type\n(invisible shape with the same\ngeometry as the hole or slot, for proper clearance)"); + RND_DAD_BUTTON(dlg, "Derive automatically"); + pse->derive = RND_DAD_CURRENT(dlg); + RND_DAD_CHANGE_CB(dlg, pse_shape_auto); + RND_DAD_HELP(dlg, "Derive the shape for this layer type\nfrom other, existing shapes of this padstack\n(automatic)"); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_BUTTON(dlg, "Copy shape from"); + pse->copy_do = RND_DAD_CURRENT(dlg); + RND_DAD_CHANGE_CB(dlg, pse_shape_copy); + RND_DAD_HELP(dlg, "Copy the shape for this layer type\nfrom other, existing shapes of this padstack\nfrom the layer type selected"); + RND_DAD_BUTTON(dlg, "Swap shape with"); + pse->copy_do = RND_DAD_CURRENT(dlg); + RND_DAD_CHANGE_CB(dlg, pse_shape_swap); + RND_DAD_HELP(dlg, "Swap the shape for this layer type\nwith another, existing shapes of this padstack\nfrom the layer type selected"); + RND_DAD_HELP(dlg, "Select the other layer type for swapping shape"); + RND_DAD_END(dlg); + RND_DAD_ENUM(dlg, copy_from_names); /* coposite */ + pse->copy_from = RND_DAD_CURRENT(dlg); + RND_DAD_HELP(dlg, "Select the source layer type for\nmanual shape copy or shape swap"); + RND_DAD_END(dlg); - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_BUTTON(dlg, "Shrink"); - pse->shrink = PCB_DAD_CURRENT(dlg); - PCB_DAD_CHANGE_CB(dlg, pse_shape_shrink); - PCB_DAD_HELP(dlg, "Make the shape smaller by the selected amount"); - PCB_DAD_COORD(dlg, ""); - pse->amount = PCB_DAD_CURRENT(dlg); - PCB_DAD_MINMAX(dlg, 1, PCB_MM_TO_COORD(100)); - PCB_DAD_BUTTON(dlg, "Grow"); - pse->grow = PCB_DAD_CURRENT(dlg); - PCB_DAD_CHANGE_CB(dlg, pse_shape_grow); - PCB_DAD_HELP(dlg, "Make the shape larger by the selected amount"); - PCB_DAD_END(dlg); - PCB_DAD_BUTTON_CLOSES(dlg, clbtn); - PCB_DAD_END(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_BUTTON(dlg, "Shrink"); + pse->shrink = RND_DAD_CURRENT(dlg); + RND_DAD_CHANGE_CB(dlg, pse_shape_shrink); + RND_DAD_HELP(dlg, "Make the shape smaller by the selected amount"); + RND_DAD_COORD(dlg, ""); + pse->amount = RND_DAD_CURRENT(dlg); + RND_DAD_MINMAX(dlg, 1, PCB_MM_TO_COORD(100)); + RND_DAD_BUTTON(dlg, "Grow"); + pse->grow = RND_DAD_CURRENT(dlg); + RND_DAD_CHANGE_CB(dlg, pse_shape_grow); + RND_DAD_HELP(dlg, "Make the shape larger by the selected amount"); + RND_DAD_END(dlg); + RND_DAD_BUTTON_CLOSES(dlg, clbtn); + RND_DAD_END(dlg); - PCB_DAD_NEW("padstack_shape", dlg, "Edit padstack shape", pse, pcb_true, NULL); + RND_DAD_NEW("padstack_shape", dlg, "Edit padstack shape", pse, pcb_true, NULL); pse->shape_chg = dlg; /* pse_ps2dlg(dlg_hid_ctx, pse);*/ - PCB_DAD_RUN(dlg); + RND_DAD_RUN(dlg); pse->shape_chg = NULL; - PCB_DAD_FREE(dlg); + RND_DAD_FREE(dlg); pse_changed(pse); rnd_gui->invalidate_all(rnd_gui); } @@ -740,106 +740,106 @@ } pse_ps2dlg(hid_ctx, pse); - PCB_DAD_SET_VALUE(hid_ctx, pse->tab, lng, 1); /* switch to the prototype view where the new attributes are visible */ + RND_DAD_SET_VALUE(hid_ctx, pse->tab, lng, 1); /* switch to the prototype view where the new attributes are visible */ pse_changed(pse); rnd_gui->invalidate_all(rnd_gui); } #define spring(dlg) \ - PCB_DAD_BEGIN_VBOX(dlg); \ - PCB_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); \ - PCB_DAD_END(dlg); + RND_DAD_BEGIN_VBOX(dlg); \ + RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); \ + RND_DAD_END(dlg); void pcb_pstkedit_dialog(pse_t *pse, int target_tab) { int n; const char *tabs[] = { "this instance", "prototype", "generate common geometry", NULL }; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; - PCB_DAD_DECL(dlg); + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + RND_DAD_DECL(dlg); pse->disable_instance_tab = !!pse->disable_instance_tab; target_tab -= pse->disable_instance_tab; - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABBED(dlg, tabs + pse->disable_instance_tab); - pse->tab = PCB_DAD_CURRENT(dlg); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABBED(dlg, tabs + pse->disable_instance_tab); + pse->tab = RND_DAD_CURRENT(dlg); if (!pse->disable_instance_tab) { /* Tab 0: this instance */ - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(dlg, "Settings that affect only this padstack instance"); - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_LABEL(dlg, "prototype"); - PCB_DAD_BUTTON(dlg, "#5"); - pse->proto_id = PCB_DAD_CURRENT(dlg); - PCB_DAD_CHANGE_CB(dlg, pse_chg_protoid); - PCB_DAD_HELP(dlg, "Padstack prototype ID\n(click to use a different prototype)"); - PCB_DAD_BUTTON(dlg, "Duplicate"); - PCB_DAD_HELP(dlg, "Copy padstack prototype to create a new prototype\nfor this padstack instance. Changes to the new\nprototype will not affect other users of the\noriginal prototye."); - PCB_DAD_CHANGE_CB(dlg, pse_chg_protodup); - PCB_DAD_END(dlg); - PCB_DAD_BEGIN_TABLE(dlg, 2); - PCB_DAD_LABEL(dlg, "Clearance"); - PCB_DAD_COORD(dlg, ""); - pse->clearance = PCB_DAD_CURRENT(dlg); - PCB_DAD_MINVAL(dlg, 0); - PCB_DAD_MAXVAL(dlg, PCB_MM_TO_COORD(1000)); - PCB_DAD_CHANGE_CB(dlg, pse_chg_instance); - PCB_DAD_HELP(dlg, "global clearance (affects all layers)"); - PCB_DAD_LABEL(dlg, "Rotation"); - PCB_DAD_REAL(dlg, ""); - pse->rot = PCB_DAD_CURRENT(dlg); - PCB_DAD_MINVAL(dlg, 0); - PCB_DAD_MAXVAL(dlg, 360); - PCB_DAD_CHANGE_CB(dlg, pse_chg_instance); - PCB_DAD_LABEL(dlg, "X-mirror"); - PCB_DAD_BOOL(dlg, ""); - pse->xmirror = PCB_DAD_CURRENT(dlg); - PCB_DAD_CHANGE_CB(dlg, pse_chg_instance); - PCB_DAD_LABEL(dlg, "S-mirror"); - PCB_DAD_BOOL(dlg, ""); - pse->smirror = PCB_DAD_CURRENT(dlg); - PCB_DAD_CHANGE_CB(dlg, pse_chg_instance); - PCB_DAD_END(dlg); - PCB_DAD_END(dlg); - PCB_DAD_END(dlg); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_FRAME); + RND_DAD_LABEL(dlg, "Settings that affect only this padstack instance"); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_LABEL(dlg, "prototype"); + RND_DAD_BUTTON(dlg, "#5"); + pse->proto_id = RND_DAD_CURRENT(dlg); + RND_DAD_CHANGE_CB(dlg, pse_chg_protoid); + RND_DAD_HELP(dlg, "Padstack prototype ID\n(click to use a different prototype)"); + RND_DAD_BUTTON(dlg, "Duplicate"); + RND_DAD_HELP(dlg, "Copy padstack prototype to create a new prototype\nfor this padstack instance. Changes to the new\nprototype will not affect other users of the\noriginal prototye."); + RND_DAD_CHANGE_CB(dlg, pse_chg_protodup); + RND_DAD_END(dlg); + RND_DAD_BEGIN_TABLE(dlg, 2); + RND_DAD_LABEL(dlg, "Clearance"); + RND_DAD_COORD(dlg, ""); + pse->clearance = RND_DAD_CURRENT(dlg); + RND_DAD_MINVAL(dlg, 0); + RND_DAD_MAXVAL(dlg, PCB_MM_TO_COORD(1000)); + RND_DAD_CHANGE_CB(dlg, pse_chg_instance); + RND_DAD_HELP(dlg, "global clearance (affects all layers)"); + RND_DAD_LABEL(dlg, "Rotation"); + RND_DAD_REAL(dlg, ""); + pse->rot = RND_DAD_CURRENT(dlg); + RND_DAD_MINVAL(dlg, 0); + RND_DAD_MAXVAL(dlg, 360); + RND_DAD_CHANGE_CB(dlg, pse_chg_instance); + RND_DAD_LABEL(dlg, "X-mirror"); + RND_DAD_BOOL(dlg, ""); + pse->xmirror = RND_DAD_CURRENT(dlg); + RND_DAD_CHANGE_CB(dlg, pse_chg_instance); + RND_DAD_LABEL(dlg, "S-mirror"); + RND_DAD_BOOL(dlg, ""); + pse->smirror = RND_DAD_CURRENT(dlg); + RND_DAD_CHANGE_CB(dlg, pse_chg_instance); + RND_DAD_END(dlg); + RND_DAD_END(dlg); + RND_DAD_END(dlg); } /* Tab 1: prototype */ - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_BEGIN_VBOX(dlg); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_BEGIN_VBOX(dlg); - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(dlg, "Geometry of all padstacks with this proto"); - PCB_DAD_LABEL(dlg, "[SMIRROR]"); - PCB_DAD_HELP(dlg, "The layer stack of this specific padstack is mirrored.\nEditing the prototype will have mirrored effect,\ne.g. editing top side will affect the bottom side\nof this padstack instance."); - pse->prsmirror = PCB_DAD_CURRENT(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(dlg, "Geometry of all padstacks with this proto"); + RND_DAD_LABEL(dlg, "[SMIRROR]"); + RND_DAD_HELP(dlg, "The layer stack of this specific padstack is mirrored.\nEditing the prototype will have mirrored effect,\ne.g. editing top side will affect the bottom side\nof this padstack instance."); + pse->prsmirror = RND_DAD_CURRENT(dlg); spring(dlg); - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(dlg, "Prototype name:"); - PCB_DAD_STRING(dlg); - PCB_DAD_CHANGE_CB(dlg, pse_chg_prname); - pse->prname = PCB_DAD_CURRENT(dlg); - PCB_DAD_END(dlg); - PCB_DAD_END(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_FRAME); + RND_DAD_LABEL(dlg, "Prototype name:"); + RND_DAD_STRING(dlg); + RND_DAD_CHANGE_CB(dlg, pse_chg_prname); + pse->prname = RND_DAD_CURRENT(dlg); + RND_DAD_END(dlg); + RND_DAD_END(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_FRAME); - PCB_DAD_BEGIN_TABLE(dlg, 3); - PCB_DAD_COMPFLAG(dlg, RND_HATF_FRAME); + RND_DAD_COMPFLAG(dlg, RND_HATF_FRAME); + RND_DAD_BEGIN_TABLE(dlg, 3); + RND_DAD_COMPFLAG(dlg, RND_HATF_FRAME); /* header */ - PCB_DAD_LABEL(dlg, "Per layer-type shape"); - PCB_DAD_LABEL(dlg, "Shape geometry"); - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_LABEL(dlg, "Change shape"); + RND_DAD_LABEL(dlg, "Per layer-type shape"); + RND_DAD_LABEL(dlg, "Shape geometry"); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_LABEL(dlg, "Change shape"); spring(dlg); - PCB_DAD_LABEL(dlg, "Local clearance"); - PCB_DAD_END(dlg); + RND_DAD_LABEL(dlg, "Local clearance"); + RND_DAD_END(dlg); /* content */ for(n = 0; n < pcb_proto_num_layers; n++) { @@ -853,150 +853,150 @@ } /* col 1 */ - PCB_DAD_LABEL(dlg, layname); + RND_DAD_LABEL(dlg, layname); if (help != NULL) - PCB_DAD_HELP(dlg, help); + RND_DAD_HELP(dlg, help); /* col 2 */ - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_LABEL(dlg, "-"); - pse->proto_shape[n] = PCB_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, " "); - PCB_DAD_LABEL(dlg, "-"); - pse->proto_info[n] = PCB_DAD_CURRENT(dlg); - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL | RND_HATF_TIGHT); - PCB_DAD_END(dlg); - PCB_DAD_END(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_LABEL(dlg, "-"); + pse->proto_shape[n] = RND_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, " "); + RND_DAD_LABEL(dlg, "-"); + pse->proto_info[n] = RND_DAD_CURRENT(dlg); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL | RND_HATF_TIGHT); + RND_DAD_END(dlg); + RND_DAD_END(dlg); /* col 3 */ - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_BUTTON(dlg, "Change"); - pse->proto_change[n] = PCB_DAD_CURRENT(dlg); - PCB_DAD_CHANGE_CB(dlg, pse_chg_shape); - PCB_DAD_HELP(dlg, "Change the shape on this layer type"); - PCB_DAD_LABEL(dlg, " "); - PCB_DAD_COORD(dlg, ""); - pse->proto_clr[n] = PCB_DAD_CURRENT(dlg); - PCB_DAD_MINVAL(dlg, 1); - PCB_DAD_MAXVAL(dlg, PCB_MM_TO_COORD(1000)); - PCB_DAD_CHANGE_CB(dlg, pse_chg_proto_clr); - PCB_DAD_WIDTH_CHR(dlg, 8); - PCB_DAD_HELP(dlg, "local, per layer type clearance\n(only when global padstack clearance is 0)"); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_BUTTON(dlg, "Change"); + pse->proto_change[n] = RND_DAD_CURRENT(dlg); + RND_DAD_CHANGE_CB(dlg, pse_chg_shape); + RND_DAD_HELP(dlg, "Change the shape on this layer type"); + RND_DAD_LABEL(dlg, " "); + RND_DAD_COORD(dlg, ""); + pse->proto_clr[n] = RND_DAD_CURRENT(dlg); + RND_DAD_MINVAL(dlg, 1); + RND_DAD_MAXVAL(dlg, PCB_MM_TO_COORD(1000)); + RND_DAD_CHANGE_CB(dlg, pse_chg_proto_clr); + RND_DAD_WIDTH_CHR(dlg, 8); + RND_DAD_HELP(dlg, "local, per layer type clearance\n(only when global padstack clearance is 0)"); free(layname_tmp); - PCB_DAD_END(dlg); + RND_DAD_END(dlg); } - PCB_DAD_END(dlg); + RND_DAD_END(dlg); - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_LABEL(dlg, "Hole properties:"); - pse->hole_header = PCB_DAD_CURRENT(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_LABEL(dlg, "Hole properties:"); + pse->hole_header = RND_DAD_CURRENT(dlg); spring(dlg); - PCB_DAD_LABEL(dlg, "Hole diameter:"); - PCB_DAD_COORD(dlg, ""); - pse->hdia = PCB_DAD_CURRENT(dlg); - PCB_DAD_MINVAL(dlg, 0); - PCB_DAD_MAXVAL(dlg, PCB_MM_TO_COORD(1000)); - PCB_DAD_CHANGE_CB(dlg, pse_chg_hole); - PCB_DAD_WIDTH_CHR(dlg, 10); + RND_DAD_LABEL(dlg, "Hole diameter:"); + RND_DAD_COORD(dlg, ""); + pse->hdia = RND_DAD_CURRENT(dlg); + RND_DAD_MINVAL(dlg, 0); + RND_DAD_MAXVAL(dlg, PCB_MM_TO_COORD(1000)); + RND_DAD_CHANGE_CB(dlg, pse_chg_hole); + RND_DAD_WIDTH_CHR(dlg, 10); spring(dlg); - PCB_DAD_LABEL(dlg, "Hole/slot plating:"); - PCB_DAD_BOOL(dlg, ""); - pse->hplated = PCB_DAD_CURRENT(dlg); - PCB_DAD_CHANGE_CB(dlg, pse_chg_hole); - PCB_DAD_HELP(dlg, "A plated hole galvanically connects layers"); + RND_DAD_LABEL(dlg, "Hole/slot plating:"); + RND_DAD_BOOL(dlg, ""); + pse->hplated = RND_DAD_CURRENT(dlg); + RND_DAD_CHANGE_CB(dlg, pse_chg_hole); + RND_DAD_HELP(dlg, "A plated hole galvanically connects layers"); - PCB_DAD_END(dlg); + RND_DAD_END(dlg); - PCB_DAD_BEGIN_TABLE(dlg, 4); + RND_DAD_BEGIN_TABLE(dlg, 4); /* table row 1 */ - PCB_DAD_LABEL(dlg, "Hole/slot top:"); - PCB_DAD_INTEGER(dlg, ""); - pse->htop_val = PCB_DAD_CURRENT(dlg); - PCB_DAD_MINVAL(dlg, -(pse->pcb->LayerGroups.cache.copper_len-1)); - PCB_DAD_MAXVAL(dlg, pse->pcb->LayerGroups.cache.copper_len-1); - PCB_DAD_CHANGE_CB(dlg, pse_chg_hole); - PCB_DAD_HELP(dlg, "Blind/buried via/slot: top end of the hole"); - PCB_DAD_WIDTH_CHR(dlg, 6); - PCB_DAD_LABEL(dlg, ""); - pse->htop_text = PCB_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, ""); - pse->htop_layer = PCB_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "Hole/slot top:"); + RND_DAD_INTEGER(dlg, ""); + pse->htop_val = RND_DAD_CURRENT(dlg); + RND_DAD_MINVAL(dlg, -(pse->pcb->LayerGroups.cache.copper_len-1)); + RND_DAD_MAXVAL(dlg, pse->pcb->LayerGroups.cache.copper_len-1); + RND_DAD_CHANGE_CB(dlg, pse_chg_hole); + RND_DAD_HELP(dlg, "Blind/buried via/slot: top end of the hole"); + RND_DAD_WIDTH_CHR(dlg, 6); + RND_DAD_LABEL(dlg, ""); + pse->htop_text = RND_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, ""); + pse->htop_layer = RND_DAD_CURRENT(dlg); /* table row 2 */ - PCB_DAD_LABEL(dlg, "Hole/slot bottom:"); - PCB_DAD_INTEGER(dlg, ""); - pse->hbot_val = PCB_DAD_CURRENT(dlg); - PCB_DAD_MINVAL(dlg, -(pse->pcb->LayerGroups.cache.copper_len-1)); - PCB_DAD_MAXVAL(dlg, pse->pcb->LayerGroups.cache.copper_len-1); - PCB_DAD_CHANGE_CB(dlg, pse_chg_hole); - PCB_DAD_HELP(dlg, "Blind/buried via/slot: bottom end of the hole"); - PCB_DAD_WIDTH_CHR(dlg, 6); - PCB_DAD_LABEL(dlg, ""); - pse->hbot_text = PCB_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, ""); - pse->hbot_layer = PCB_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "Hole/slot bottom:"); + RND_DAD_INTEGER(dlg, ""); + pse->hbot_val = RND_DAD_CURRENT(dlg); + RND_DAD_MINVAL(dlg, -(pse->pcb->LayerGroups.cache.copper_len-1)); + RND_DAD_MAXVAL(dlg, pse->pcb->LayerGroups.cache.copper_len-1); + RND_DAD_CHANGE_CB(dlg, pse_chg_hole); + RND_DAD_HELP(dlg, "Blind/buried via/slot: bottom end of the hole"); + RND_DAD_WIDTH_CHR(dlg, 6); + RND_DAD_LABEL(dlg, ""); + pse->hbot_text = RND_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, ""); + pse->hbot_layer = RND_DAD_CURRENT(dlg); - PCB_DAD_END(dlg); - PCB_DAD_END(dlg); - PCB_DAD_END(dlg); + RND_DAD_END(dlg); + RND_DAD_END(dlg); + RND_DAD_END(dlg); /* Tab 2: generate common geometry */ - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_LABEL(dlg, "Generate a new prototype using a few numeric input"); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_LABEL(dlg, "Generate a new prototype using a few numeric input"); - PCB_DAD_BEGIN_TABLE(dlg, 2); - PCB_DAD_LABEL(dlg, "Copper shape:"); - PCB_DAD_ENUM(dlg, shapes); - pse->gen_shp = PCB_DAD_CURRENT(dlg); + RND_DAD_BEGIN_TABLE(dlg, 2); + RND_DAD_LABEL(dlg, "Copper shape:"); + RND_DAD_ENUM(dlg, shapes); + pse->gen_shp = RND_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, "Size (circle diameter or square side):"); - PCB_DAD_COORD(dlg, ""); - pse->gen_size = PCB_DAD_CURRENT(dlg); - PCB_DAD_MINVAL(dlg, 1); - PCB_DAD_MAXVAL(dlg, PCB_MM_TO_COORD(1000)); + RND_DAD_LABEL(dlg, "Size (circle diameter or square side):"); + RND_DAD_COORD(dlg, ""); + pse->gen_size = RND_DAD_CURRENT(dlg); + RND_DAD_MINVAL(dlg, 1); + RND_DAD_MAXVAL(dlg, PCB_MM_TO_COORD(1000)); - PCB_DAD_LABEL(dlg, "Drill diameter (0 means no hole):"); - PCB_DAD_COORD(dlg, ""); - pse->gen_drill = PCB_DAD_CURRENT(dlg); - PCB_DAD_MINVAL(dlg, 1); - PCB_DAD_MAXVAL(dlg, PCB_MM_TO_COORD(1000)); + RND_DAD_LABEL(dlg, "Drill diameter (0 means no hole):"); + RND_DAD_COORD(dlg, ""); + pse->gen_drill = RND_DAD_CURRENT(dlg); + RND_DAD_MINVAL(dlg, 1); + RND_DAD_MAXVAL(dlg, PCB_MM_TO_COORD(1000)); - PCB_DAD_LABEL(dlg, "Copper shapes on:"); - PCB_DAD_ENUM(dlg, sides); - pse->gen_sides = PCB_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "Copper shapes on:"); + RND_DAD_ENUM(dlg, sides); + pse->gen_sides = RND_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, "Expose top/bottom copper:"); - PCB_DAD_BOOL(dlg, ""); - pse->gen_expose = PCB_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "Expose top/bottom copper:"); + RND_DAD_BOOL(dlg, ""); + pse->gen_expose = RND_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, "Paste exposed copper:"); - PCB_DAD_BOOL(dlg, ""); - pse->gen_paste = PCB_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "Paste exposed copper:"); + RND_DAD_BOOL(dlg, ""); + pse->gen_paste = RND_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, ""); - PCB_DAD_BUTTON(dlg, "Generate!"); - pse->gen_do = PCB_DAD_CURRENT(dlg); - PCB_DAD_CHANGE_CB(dlg, pse_gen); - PCB_DAD_END(dlg); - PCB_DAD_END(dlg); - PCB_DAD_END(dlg); - PCB_DAD_END(dlg); - PCB_DAD_BUTTON_CLOSES(dlg, clbtn); - PCB_DAD_END(dlg); + RND_DAD_LABEL(dlg, ""); + RND_DAD_BUTTON(dlg, "Generate!"); + pse->gen_do = RND_DAD_CURRENT(dlg); + RND_DAD_CHANGE_CB(dlg, pse_gen); + RND_DAD_END(dlg); + RND_DAD_END(dlg); + RND_DAD_END(dlg); + RND_DAD_END(dlg); + RND_DAD_BUTTON_CLOSES(dlg, clbtn); + RND_DAD_END(dlg); - PCB_DAD_NEW("padstack", dlg, "Edit padstack", pse, pcb_true, NULL); + RND_DAD_NEW("padstack", dlg, "Edit padstack", pse, pcb_true, NULL); pse->attrs = dlg; pse_ps2dlg(dlg_hid_ctx, pse); if (target_tab > 0) - PCB_DAD_SET_VALUE(dlg_hid_ctx, pse->tab, lng, target_tab); - PCB_DAD_RUN(dlg); + RND_DAD_SET_VALUE(dlg_hid_ctx, pse->tab, lng, target_tab); + RND_DAD_RUN(dlg); free((char *)pse->attrs[pse->prname].val.str); - PCB_DAD_FREE(dlg); + RND_DAD_FREE(dlg); } const char pcb_acts_PadstackEdit[] = "PadstackEdit(object, [tab])\n"; Index: trunk/src_plugins/dialogs/dlg_pinout.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pinout.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_pinout.c (revision 30992) @@ -36,7 +36,7 @@ #include "netlist.h" typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) pcb_board_t *pcb; /* for netlist lookups */ pcb_data_t *data; long subc_id; @@ -51,7 +51,7 @@ static void pinout_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) { pinout_ctx_t *ctx = caller_data; - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); free(ctx); } @@ -75,7 +75,7 @@ sprintf(tmp, "Subcircuit #%ld not found.", ctx->subc_id); bbox.X1 = bbox.Y1 = 0; bbox.X2 = bbox.Y2 = PCB_MM_TO_COORD(10); - pcb_dad_preview_zoomto(attrib, &bbox); + rnd_dad_preview_zoomto(attrib, &bbox); rnd_render->set_color(gc, rnd_color_red); pcb_text_draw_string_simple(NULL, tmp, PCB_MM_TO_COORD(1), PCB_MM_TO_COORD(20), 100, 0, 0, 0, 0, 0, 0); } @@ -138,37 +138,37 @@ static void pcb_dlg_pinout(pcb_board_t *pcb, pcb_data_t *data, pcb_subc_t *sc) { char title[64]; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; pinout_ctx_t *ctx = calloc(sizeof(pinout_ctx_t), 1); ctx->pcb = pcb; ctx->data = data; ctx->subc_id = sc->ID; - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_PREVIEW(ctx->dlg, pinout_expose, pinout_mouse, NULL, &sc->BoundingBox, 200, 200, ctx); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Term ID:"); - PCB_DAD_LABEL(ctx->dlg, ""); - ctx->w_lab_num = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Term name:"); - PCB_DAD_LABEL(ctx->dlg, ""); - ctx->w_lab_name = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_PREVIEW(ctx->dlg, pinout_expose, pinout_mouse, NULL, &sc->BoundingBox, 200, 200, ctx); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Term ID:"); + RND_DAD_LABEL(ctx->dlg, ""); + ctx->w_lab_num = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Term name:"); + RND_DAD_LABEL(ctx->dlg, ""); + ctx->w_lab_name = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Net:"); - PCB_DAD_LABEL(ctx->dlg, ""); - ctx->w_lab_net = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Net:"); + RND_DAD_LABEL(ctx->dlg, ""); + ctx->w_lab_net = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); + RND_DAD_END(ctx->dlg); if (sc->refdes != NULL) sprintf(title, "Subcircuit #%ld (%s) pinout", sc->ID, sc->refdes); else sprintf(title, "Subcircuit #%ld pinout", sc->ID); - PCB_DAD_NEW("pinout", ctx->dlg, title, ctx, pcb_false, pinout_close_cb); + RND_DAD_NEW("pinout", ctx->dlg, title, ctx, pcb_false, pinout_close_cb); } static const char pcb_acts_Pinout[] = "Pinout()\n"; Index: trunk/src_plugins/dialogs/dlg_plugins.c =================================================================== --- trunk/src_plugins/dialogs/dlg_plugins.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_plugins.c (revision 30992) @@ -31,8 +31,8 @@ pup_plugin_t *p; int nump = 0, numb = 0; gds_t str; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; - PCB_DAD_DECL(dlg); + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + RND_DAD_DECL(dlg); gds_init(&str); @@ -73,15 +73,15 @@ gds_append_str(&str, "\n\nNOTE: this is the alpha version, can only list plugins/buildins\n"); - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_SCROLL | RND_HATF_EXPFILL); - PCB_DAD_LABEL(dlg, str.array); - PCB_DAD_BUTTON_CLOSES(dlg, clbtn); - PCB_DAD_END(dlg); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_SCROLL | RND_HATF_EXPFILL); + RND_DAD_LABEL(dlg, str.array); + RND_DAD_BUTTON_CLOSES(dlg, clbtn); + RND_DAD_END(dlg); - PCB_DAD_NEW("plugins", dlg, "Manage plugins", NULL, pcb_true, NULL); - PCB_DAD_RUN(dlg); - PCB_DAD_FREE(dlg); + RND_DAD_NEW("plugins", dlg, "Manage plugins", NULL, pcb_true, NULL); + RND_DAD_RUN(dlg); + RND_DAD_FREE(dlg); gds_uninit(&str); RND_ACT_IRES(0); Index: trunk/src_plugins/dialogs/dlg_pref.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_pref.c (revision 30992) @@ -62,17 +62,17 @@ { switch(cn->type) { case RND_CFN_COORD: - PCB_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, item->wid, crd, cn->val.coord[0]); + RND_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, item->wid, crd, cn->val.coord[0]); break; case RND_CFN_BOOLEAN: case RND_CFN_INTEGER: - PCB_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, item->wid, lng, cn->val.integer[0]); + RND_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, item->wid, lng, cn->val.integer[0]); break; case RND_CFN_REAL: - PCB_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, item->wid, dbl, cn->val.real[0]); + RND_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, item->wid, dbl, cn->val.real[0]); break; case RND_CFN_STRING: - PCB_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, item->wid, str, cn->val.string[0]); + RND_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, item->wid, str, cn->val.string[0]); break; default: rnd_message(RND_MSG_ERROR, "pcb_pref_conf2dlg_item(): widget type not handled\n"); } @@ -135,50 +135,50 @@ return; } - PCB_DAD_LABEL(ctx->dlg, item->label); - PCB_DAD_HELP(ctx->dlg, cn->description); + RND_DAD_LABEL(ctx->dlg, item->label); + RND_DAD_HELP(ctx->dlg, cn->description); switch(cn->type) { case RND_CFN_COORD: - PCB_DAD_COORD(ctx->dlg, ""); - item->wid = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_MINMAX(ctx->dlg, 0, RND_MAX_COORD); - PCB_DAD_DEFAULT_NUM(ctx->dlg, cn->val.coord[0]); - PCB_DAD_HELP(ctx->dlg, cn->description); - PCB_DAD_CHANGE_CB(ctx->dlg, change_cb); + RND_DAD_COORD(ctx->dlg, ""); + item->wid = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, 0, RND_MAX_COORD); + RND_DAD_DEFAULT_NUM(ctx->dlg, cn->val.coord[0]); + RND_DAD_HELP(ctx->dlg, cn->description); + RND_DAD_CHANGE_CB(ctx->dlg, change_cb); break; case RND_CFN_BOOLEAN: - PCB_DAD_BOOL(ctx->dlg, ""); - item->wid = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_DEFAULT_NUM(ctx->dlg, cn->val.integer[0]); - PCB_DAD_HELP(ctx->dlg, cn->description); - PCB_DAD_CHANGE_CB(ctx->dlg, change_cb); + RND_DAD_BOOL(ctx->dlg, ""); + item->wid = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_DEFAULT_NUM(ctx->dlg, cn->val.integer[0]); + RND_DAD_HELP(ctx->dlg, cn->description); + RND_DAD_CHANGE_CB(ctx->dlg, change_cb); break; case RND_CFN_INTEGER: - PCB_DAD_INTEGER(ctx->dlg, ""); - item->wid = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_MINMAX(ctx->dlg, 0, INT_MAX); - PCB_DAD_DEFAULT_NUM(ctx->dlg, cn->val.integer[0]); - PCB_DAD_HELP(ctx->dlg, cn->description); - PCB_DAD_CHANGE_CB(ctx->dlg, change_cb); + RND_DAD_INTEGER(ctx->dlg, ""); + item->wid = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, 0, INT_MAX); + RND_DAD_DEFAULT_NUM(ctx->dlg, cn->val.integer[0]); + RND_DAD_HELP(ctx->dlg, cn->description); + RND_DAD_CHANGE_CB(ctx->dlg, change_cb); break; case RND_CFN_REAL: - PCB_DAD_REAL(ctx->dlg, ""); - item->wid = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_MINMAX(ctx->dlg, 0, INT_MAX); + RND_DAD_REAL(ctx->dlg, ""); + item->wid = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, 0, INT_MAX); ctx->dlg[item->wid].val.dbl = cn->val.real[0]; - PCB_DAD_HELP(ctx->dlg, cn->description); - PCB_DAD_CHANGE_CB(ctx->dlg, change_cb); + RND_DAD_HELP(ctx->dlg, cn->description); + RND_DAD_CHANGE_CB(ctx->dlg, change_cb); break; case RND_CFN_STRING: - PCB_DAD_STRING(ctx->dlg); - item->wid = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_STRING(ctx->dlg); + item->wid = RND_DAD_CURRENT(ctx->dlg); ctx->dlg[item->wid].val.str = rnd_strdup(cn->val.string[0]); - PCB_DAD_HELP(ctx->dlg, cn->description); - PCB_DAD_CHANGE_CB(ctx->dlg, change_cb); + RND_DAD_HELP(ctx->dlg, cn->description); + RND_DAD_CHANGE_CB(ctx->dlg, change_cb); break; default: - PCB_DAD_LABEL(ctx->dlg, "Internal error: pcb_pref_create_conf_item(): unhandled type"); + RND_DAD_LABEL(ctx->dlg, "Internal error: pcb_pref_create_conf_item(): unhandled type"); item->wid = -1; return; } @@ -227,7 +227,7 @@ free(ctx->auto_free.array[n]); vtp0_uninit(&ctx->auto_free); - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); memset(ctx, 0, sizeof(pref_ctx_t)); /* reset all states to the initial - includes ctx->active = 0; */ } @@ -248,7 +248,7 @@ static void pcb_dlg_pref(const char *target_tab_str, const char *tabarg) { const char *tabs[] = { "General", "Board meta", "Sizes & DRC", "Library", "Layers", "Colors", "Window", "Config tree", NULL }; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; int target_tab = -1; if ((target_tab_str != NULL) && (*target_tab_str != '\0')) { @@ -265,66 +265,66 @@ if (pref_ctx.active) { if (target_tab >= 0) - PCB_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, pref_ctx.wtab, lng, target_tab); + RND_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, pref_ctx.wtab, lng, target_tab); return; } - PCB_DAD_BEGIN_VBOX(pref_ctx.dlg); - PCB_DAD_COMPFLAG(pref_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABBED(pref_ctx.dlg, tabs); - PCB_DAD_COMPFLAG(pref_ctx.dlg, RND_HATF_EXPFILL); - pref_ctx.wtab = PCB_DAD_CURRENT(pref_ctx.dlg); - PCB_DAD_BEGIN_VBOX(pref_ctx.dlg); /* General */ + RND_DAD_BEGIN_VBOX(pref_ctx.dlg); + RND_DAD_COMPFLAG(pref_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABBED(pref_ctx.dlg, tabs); + RND_DAD_COMPFLAG(pref_ctx.dlg, RND_HATF_EXPFILL); + pref_ctx.wtab = RND_DAD_CURRENT(pref_ctx.dlg); + RND_DAD_BEGIN_VBOX(pref_ctx.dlg); /* General */ pcb_dlg_pref_general_create(&pref_ctx); - PCB_DAD_END(pref_ctx.dlg); + RND_DAD_END(pref_ctx.dlg); - PCB_DAD_BEGIN_VBOX(pref_ctx.dlg); /* Board meta */ + RND_DAD_BEGIN_VBOX(pref_ctx.dlg); /* Board meta */ pcb_dlg_pref_board_create(&pref_ctx); - PCB_DAD_END(pref_ctx.dlg); + RND_DAD_END(pref_ctx.dlg); - PCB_DAD_BEGIN_VBOX(pref_ctx.dlg); /* Sizes & DRC */ + RND_DAD_BEGIN_VBOX(pref_ctx.dlg); /* Sizes & DRC */ pcb_dlg_pref_sizes_create(&pref_ctx); - PCB_DAD_END(pref_ctx.dlg); + RND_DAD_END(pref_ctx.dlg); - PCB_DAD_BEGIN_VBOX(pref_ctx.dlg); /* Library */ + RND_DAD_BEGIN_VBOX(pref_ctx.dlg); /* Library */ pcb_dlg_pref_lib_create(&pref_ctx); - PCB_DAD_END(pref_ctx.dlg); + RND_DAD_END(pref_ctx.dlg); - PCB_DAD_BEGIN_VBOX(pref_ctx.dlg); /* Layers */ + RND_DAD_BEGIN_VBOX(pref_ctx.dlg); /* Layers */ pcb_dlg_pref_layer_create(&pref_ctx); - PCB_DAD_END(pref_ctx.dlg); + RND_DAD_END(pref_ctx.dlg); - PCB_DAD_BEGIN_VBOX(pref_ctx.dlg); /* Colors */ + RND_DAD_BEGIN_VBOX(pref_ctx.dlg); /* Colors */ pcb_dlg_pref_color_create(&pref_ctx); - PCB_DAD_END(pref_ctx.dlg); + RND_DAD_END(pref_ctx.dlg); - PCB_DAD_BEGIN_VBOX(pref_ctx.dlg); /* Window */ + RND_DAD_BEGIN_VBOX(pref_ctx.dlg); /* Window */ pcb_dlg_pref_win_create(&pref_ctx); - PCB_DAD_END(pref_ctx.dlg); + RND_DAD_END(pref_ctx.dlg); - PCB_DAD_BEGIN_VBOX(pref_ctx.dlg); /* Config tree */ + RND_DAD_BEGIN_VBOX(pref_ctx.dlg); /* Config tree */ pcb_dlg_pref_conf_create(&pref_ctx); - PCB_DAD_END(pref_ctx.dlg); + RND_DAD_END(pref_ctx.dlg); - PCB_DAD_END(pref_ctx.dlg); - PCB_DAD_BEGIN_VBOX(pref_ctx.dlg); - PCB_DAD_BEGIN_HBOX(pref_ctx.dlg); - PCB_DAD_COMPFLAG(pref_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(pref_ctx.dlg, "All changes are made to role:"); - PCB_DAD_ENUM(pref_ctx.dlg, role_names); - pref_ctx.wrole = PCB_DAD_CURRENT(pref_ctx.dlg); - PCB_DAD_CHANGE_CB(pref_ctx.dlg, pref_role_cb); - PCB_DAD_BUTTON_CLOSES_NAKED(pref_ctx.dlg, clbtn); - PCB_DAD_END(pref_ctx.dlg); - PCB_DAD_END(pref_ctx.dlg); - PCB_DAD_END(pref_ctx.dlg); + RND_DAD_END(pref_ctx.dlg); + RND_DAD_BEGIN_VBOX(pref_ctx.dlg); + RND_DAD_BEGIN_HBOX(pref_ctx.dlg); + RND_DAD_COMPFLAG(pref_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(pref_ctx.dlg, "All changes are made to role:"); + RND_DAD_ENUM(pref_ctx.dlg, role_names); + pref_ctx.wrole = RND_DAD_CURRENT(pref_ctx.dlg); + RND_DAD_CHANGE_CB(pref_ctx.dlg, pref_role_cb); + RND_DAD_BUTTON_CLOSES_NAKED(pref_ctx.dlg, clbtn); + RND_DAD_END(pref_ctx.dlg); + RND_DAD_END(pref_ctx.dlg); + RND_DAD_END(pref_ctx.dlg); /* set up the context */ pref_ctx.active = 1; - PCB_DAD_NEW("preferences", pref_ctx.dlg, "pcb-rnd preferences", &pref_ctx, pcb_false, pref_close_cb); + RND_DAD_NEW("preferences", pref_ctx.dlg, "pcb-rnd preferences", &pref_ctx, pcb_false, pref_close_cb); - PCB_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, pref_ctx.wrole, lng, 2); + RND_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, pref_ctx.wrole, lng, 2); pref_ctx.role = RND_CFR_DESIGN; pcb_dlg_pref_lib_open(&pref_ctx); @@ -332,7 +332,7 @@ pcb_dlg_pref_win_open(&pref_ctx); pcb_dlg_pref_conf_open(&pref_ctx, (target_tab == sizeof(tabs)/sizeof(tabs[0]) - 2) ? tabarg : NULL); if (target_tab >= 0) - PCB_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, pref_ctx.wtab, lng, target_tab); + RND_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, pref_ctx.wtab, lng, target_tab); } static void pref_ev_board_changed(rnd_hidlib_t *hidlib, void *user_data, int argc, rnd_event_arg_t argv[]) Index: trunk/src_plugins/dialogs/dlg_pref.h =================================================================== --- trunk/src_plugins/dialogs/dlg_pref.h (revision 30991) +++ trunk/src_plugins/dialogs/dlg_pref.h (revision 30992) @@ -22,7 +22,7 @@ }; struct pref_ctx_s { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int wtab, wrole; int active; /* already open - allow only one instance */ Index: trunk/src_plugins/dialogs/dlg_pref_board.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_board.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_pref_board.c (revision 30992) @@ -35,9 +35,9 @@ /* Actual board meta to dialog box */ static void pref_board_brd2dlg(pref_ctx_t *ctx) { - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->board.wname, str, PCB_EMPTY(PCB->hidlib.name)); - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->board.wthermscale, dbl, PCB->ThermScale); - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->board.wtype, str, (PCB->is_footprint ? "footprint" : "PCB board")); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->board.wname, str, PCB_EMPTY(PCB->hidlib.name)); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->board.wthermscale, dbl, PCB->ThermScale); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->board.wtype, str, (PCB->is_footprint ? "footprint" : "PCB board")); } /* Dialog box to actual board meta */ @@ -81,25 +81,25 @@ void pcb_dlg_pref_board_create(pref_ctx_t *ctx) { - PCB_DAD_BEGIN_TABLE(ctx->dlg, 2); - PCB_DAD_LABEL(ctx->dlg, "Board name"); - PCB_DAD_STRING(ctx->dlg); - ctx->board.wname = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_TABLE(ctx->dlg, 2); + RND_DAD_LABEL(ctx->dlg, "Board name"); + RND_DAD_STRING(ctx->dlg); + ctx->board.wname = RND_DAD_CURRENT(ctx->dlg); ctx->dlg[ctx->board.wname].val.str = rnd_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); + RND_DAD_CHANGE_CB(ctx->dlg, pref_board_dlg2brd); + RND_DAD_LABEL(ctx->dlg, "Thermal scale"); + RND_DAD_REAL(ctx->dlg, ""); + ctx->board.wthermscale = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, 0.01, 100); ctx->dlg[ctx->board.wthermscale].val.dbl = PCB->ThermScale; - PCB_DAD_CHANGE_CB(ctx->dlg, pref_board_dlg2brd); - PCB_DAD_LABEL(ctx->dlg, "Type"); - PCB_DAD_LABEL(ctx->dlg, ""); - ctx->board.wtype = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, pref_board_dlg2brd); + RND_DAD_LABEL(ctx->dlg, "Type"); + RND_DAD_LABEL(ctx->dlg, ""); + ctx->board.wtype = RND_DAD_CURRENT(ctx->dlg); ctx->dlg[ctx->board.wtype].name = rnd_strdup((PCB->is_footprint ? "footprint" : "PCB board")); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_board_dlg2brd); - PCB_DAD_LABEL(ctx->dlg, "Board attributes"); - PCB_DAD_BUTTON(ctx->dlg, "Edit..."); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_board_edit_attr); - PCB_DAD_END(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, pref_board_dlg2brd); + RND_DAD_LABEL(ctx->dlg, "Board attributes"); + RND_DAD_BUTTON(ctx->dlg, "Edit..."); + RND_DAD_CHANGE_CB(ctx->dlg, pref_board_edit_attr); + RND_DAD_END(ctx->dlg); } Index: trunk/src_plugins/dialogs/dlg_pref_color.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_color.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_pref_color.c (revision 30992) @@ -38,7 +38,7 @@ if (ctx->color.wlayer != NULL) { nat = rnd_conf_get_field("appearance/color/layer"); for (n = 0; n < nat->used; n++) - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->color.wlayer[n], clr, nat->val.color[n]); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->color.wlayer[n], clr, nat->val.color[n]); } for(n = 0; n < ctx->color.ngen; n++) { @@ -46,7 +46,7 @@ const char *path = ctx->dlg[w].user_data; nat = rnd_conf_get_field(path); if (nat != NULL) - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, w, clr, nat->val.color[0]); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, w, clr, nat->val.color[0]); } } @@ -94,12 +94,12 @@ const char *path_prefix = "appearance/color"; - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABBED(ctx->dlg, tabs); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_LEFT_TAB); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABBED(ctx->dlg, tabs); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_LEFT_TAB); - PCB_DAD_BEGIN_VBOX(ctx->dlg); /* generic */ - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + RND_DAD_BEGIN_VBOX(ctx->dlg); /* generic */ + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); pl = strlen(path_prefix); ctx->color.ngen = 0; @@ -114,43 +114,43 @@ rnd_conf_fields_foreach(e) { nat = e->value; if ((strncmp(e->key, path_prefix, pl) == 0) && (nat->type == RND_CFN_COLOR) && (nat->array_size == 1)) { - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COLOR(ctx->dlg); - ctx->color.wgen[n] = w = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COLOR(ctx->dlg); + ctx->color.wgen[n] = w = RND_DAD_CURRENT(ctx->dlg); ctx->dlg[w].user_data = rnd_strdup(e->key); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_color_gen_cb); - PCB_DAD_END(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, nat->description); + RND_DAD_CHANGE_CB(ctx->dlg, pref_color_gen_cb); + RND_DAD_END(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, nat->description); n++; - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); } } - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); /* layer */ - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + RND_DAD_BEGIN_VBOX(ctx->dlg); /* layer */ + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); nat = rnd_conf_get_field("appearance/color/layer"); if (nat->type == RND_CFN_COLOR) { - PCB_DAD_LABEL(ctx->dlg, "NOTE: these colors are used only\nwhen creating new layers."); + RND_DAD_LABEL(ctx->dlg, "NOTE: these colors are used only\nwhen creating new layers."); ctx->color.wlayer = calloc(sizeof(int), nat->used); - PCB_DAD_BEGIN_TABLE(ctx->dlg, 2); + RND_DAD_BEGIN_TABLE(ctx->dlg, 2); for (n = 0; n < nat->used; n++) { char tmp[32]; - PCB_DAD_COLOR(ctx->dlg); - ctx->color.wlayer[n] = w = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_COLOR(ctx->dlg); + ctx->color.wlayer[n] = w = RND_DAD_CURRENT(ctx->dlg); ctx->dlg[w].user_data = &ctx->color.wlayer[n]; - PCB_DAD_CHANGE_CB(ctx->dlg, pref_color_layer_cb); + RND_DAD_CHANGE_CB(ctx->dlg, pref_color_layer_cb); sprintf(tmp, "Layer %d", n); - PCB_DAD_LABEL(ctx->dlg, tmp); + RND_DAD_LABEL(ctx->dlg, tmp); } - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); } else { ctx->color.wlayer = NULL; - PCB_DAD_LABEL(ctx->dlg, "Broken internal configuration:\nno layer colors"); + RND_DAD_LABEL(ctx->dlg, "Broken internal configuration:\nno layer colors"); } - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); } Index: trunk/src_plugins/dialogs/dlg_pref_conf.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_conf.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_pref_conf.c (revision 30992) @@ -98,12 +98,12 @@ parent = pcb_dad_tree_mkdirp(tree, path, NULL); for(i = 0; i < nat->array_size; i++) { cell[0] = pcb_strdup_printf("[%d]", i); - pcb_dad_tree_append_under(attr, parent, cell); + rnd_dad_tree_append_under(attr, parent, cell); } } else { cell[0] = rnd_strdup(basename); - pcb_dad_tree_append_under(attr, parent, cell); + rnd_dad_tree_append_under(attr, parent, cell); } } free(sorted); @@ -161,7 +161,7 @@ cell[3] = rnd_strdup(pref_conf_get_val(nd, nat, idx)); } } - r = pcb_dad_tree_append(attr, NULL, cell); + r = rnd_dad_tree_append(attr, NULL, cell); r->user_data2.lng = n; } } @@ -250,7 +250,7 @@ cell[1] = pcb_strdup_printf("%ld", n->prop.prio); cell[2] = rnd_strdup(strval); cell[3] = 0; - pcb_dad_tree_append(attr, NULL, cell); + rnd_dad_tree_append(attr, NULL, cell); } return; } @@ -345,79 +345,79 @@ { static const char *hdr_nat[] = {"role", "prio", "value", NULL}; - PCB_DAD_BEGIN_TABBED(pref_ctx.dlg, type_tabs); - PCB_DAD_COMPFLAG(pref_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_HIDE_TABLAB); - ctx->conf.wnattype = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Data type: string"); - PCB_DAD_LABEL(ctx->dlg, "role/prio"); - ctx->conf.wsrc[0] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "(data)"); - ctx->conf.wnatval[0] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Data type: boolean"); - PCB_DAD_LABEL(ctx->dlg, "role/prio"); - ctx->conf.wsrc[1] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "(data)"); - ctx->conf.wnatval[1] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Data type: integer"); - PCB_DAD_LABEL(ctx->dlg, "role/prio"); - ctx->conf.wsrc[2] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "(data)"); - ctx->conf.wnatval[2] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Data type: real"); - PCB_DAD_LABEL(ctx->dlg, "role/prio"); - ctx->conf.wsrc[3] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "(data)"); - ctx->conf.wnatval[3] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Data type: coord"); - PCB_DAD_LABEL(ctx->dlg, "role/prio"); - ctx->conf.wsrc[4] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "(data)"); - ctx->conf.wnatval[4] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Data type: unit"); - PCB_DAD_LABEL(ctx->dlg, "role/prio"); - ctx->conf.wsrc[5] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "(data)"); - ctx->conf.wnatval[5] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Data type: color"); - PCB_DAD_LABEL(ctx->dlg, "role/prio"); - ctx->conf.wsrc[6] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "(data)"); - ctx->conf.wnatval[6] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(ctx->dlg, "Data type: list of strings"); + RND_DAD_BEGIN_TABBED(pref_ctx.dlg, type_tabs); + RND_DAD_COMPFLAG(pref_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_HIDE_TABLAB); + ctx->conf.wnattype = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Data type: string"); + RND_DAD_LABEL(ctx->dlg, "role/prio"); + ctx->conf.wsrc[0] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "(data)"); + ctx->conf.wnatval[0] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Data type: boolean"); + RND_DAD_LABEL(ctx->dlg, "role/prio"); + ctx->conf.wsrc[1] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "(data)"); + ctx->conf.wnatval[1] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Data type: integer"); + RND_DAD_LABEL(ctx->dlg, "role/prio"); + ctx->conf.wsrc[2] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "(data)"); + ctx->conf.wnatval[2] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Data type: real"); + RND_DAD_LABEL(ctx->dlg, "role/prio"); + ctx->conf.wsrc[3] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "(data)"); + ctx->conf.wnatval[3] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Data type: coord"); + RND_DAD_LABEL(ctx->dlg, "role/prio"); + ctx->conf.wsrc[4] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "(data)"); + ctx->conf.wnatval[4] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Data type: unit"); + RND_DAD_LABEL(ctx->dlg, "role/prio"); + ctx->conf.wsrc[5] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "(data)"); + ctx->conf.wnatval[5] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Data type: color"); + RND_DAD_LABEL(ctx->dlg, "role/prio"); + ctx->conf.wsrc[6] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "(data)"); + ctx->conf.wnatval[6] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(ctx->dlg, "Data type: list of strings"); ctx->conf.wsrc[7] = -1; - PCB_DAD_TREE(ctx->dlg, 3, 0, hdr_nat); /* input state */ - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - ctx->conf.wnatval[7] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(ctx->dlg, "Data type: list of hash subtrees"); + RND_DAD_TREE(ctx->dlg, 3, 0, hdr_nat); /* input state */ + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + ctx->conf.wnatval[7] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(ctx->dlg, "Data type: list of hash subtrees"); ctx->conf.wsrc[8] = -1; - PCB_DAD_TREE(ctx->dlg, 3, 0, hdr_nat); /* input state */ - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - ctx->conf.wnatval[8] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "(no conf node selected)"); - ctx->conf.wnatval[9] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_TREE(ctx->dlg, 3, 0, hdr_nat); /* input state */ + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + ctx->conf.wnatval[8] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "(no conf node selected)"); + ctx->conf.wnatval[9] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); } void pcb_dlg_pref_conf_create(pref_ctx_t *ctx) @@ -424,56 +424,56 @@ { static const char *hdr_intree[] = {"role", "prio", "policy", "value", NULL}; - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HPANE(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - ctx->conf.wmainp = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_HPANE(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + ctx->conf.wmainp = RND_DAD_CURRENT(ctx->dlg); /* left: tree */ - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_TREE(ctx->dlg, 1, 1, NULL); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - ctx->conf.wtree = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_TREE_SET_CB(ctx->dlg, selected_cb, dlg_conf_select_node_cb); - PCB_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); - PCB_DAD_STRING(ctx->dlg); - PCB_DAD_HELP(ctx->dlg, "Filter text:\nlist conf nodes with\nmatching name only"); - PCB_DAD_CHANGE_CB(ctx->dlg, pcb_pref_dlg_conf_filter_cb); - ctx->conf.wfilter = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_TREE(ctx->dlg, 1, 1, NULL); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + ctx->conf.wtree = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_TREE_SET_CB(ctx->dlg, selected_cb, dlg_conf_select_node_cb); + RND_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); + RND_DAD_STRING(ctx->dlg); + RND_DAD_HELP(ctx->dlg, "Filter text:\nlist conf nodes with\nmatching name only"); + RND_DAD_CHANGE_CB(ctx->dlg, pcb_pref_dlg_conf_filter_cb); + ctx->conf.wfilter = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); /* right: details */ - PCB_DAD_BEGIN_VPANE(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VPANE(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); /* right/top: conf file */ - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(ctx->dlg, ""); - ctx->conf.wname = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, ""); - ctx->conf.wdesc = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "INPUT: configuration node (\"file\" version)"); - PCB_DAD_TREE(ctx->dlg, 4, 0, hdr_intree); /* input state */ - ctx->conf.wintree = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Edit selected..."); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_conf_edit_cb); - PCB_DAD_BUTTON(ctx->dlg, "Remove selected"); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_conf_del_cb); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); + RND_DAD_LABEL(ctx->dlg, ""); + ctx->conf.wname = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, ""); + ctx->conf.wdesc = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "INPUT: configuration node (\"file\" version)"); + RND_DAD_TREE(ctx->dlg, 4, 0, hdr_intree); /* input state */ + ctx->conf.wintree = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Edit selected..."); + RND_DAD_CHANGE_CB(ctx->dlg, pref_conf_edit_cb); + RND_DAD_BUTTON(ctx->dlg, "Remove selected"); + RND_DAD_CHANGE_CB(ctx->dlg, pref_conf_del_cb); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); /* right/bottom: native file */ - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_FRAME); - PCB_DAD_LABEL(ctx->dlg, "NATIVE: in-memory conf node after the merge"); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_FRAME); + RND_DAD_LABEL(ctx->dlg, "NATIVE: in-memory conf node after the merge"); build_natval(ctx); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); setup_tree(ctx); setup_intree(ctx, NULL, 0); Index: trunk/src_plugins/dialogs/dlg_pref_confedit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 30992) @@ -31,7 +31,7 @@ #define is_read_only(ctx) rnd_conf_is_read_only(ctx->role) typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) rnd_conf_native_t *nat; int idx; @@ -43,7 +43,7 @@ static void pref_conf_edit_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) { pref_ctx_t *ctx = caller_data; - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); free(ctx); } @@ -109,7 +109,7 @@ char *cell[2] = {NULL}; if (nl->type == LHT_TEXT) cell[0] = rnd_strdup(nl->data.text.value); - pcb_dad_tree_append(attr, NULL, cell); + rnd_dad_tree_append(attr, NULL, cell); } } break; @@ -236,9 +236,9 @@ cols[0] = rnd_strdup(""); if (trigger_attr == &ctx->dlg[ctx->winsa]) - r = pcb_dad_tree_append(attr, r, cols); + r = rnd_dad_tree_append(attr, r, cols); else - r = pcb_dad_tree_insert(attr, r, cols); + r = rnd_dad_tree_insert(attr, r, cols); if (r != NULL) pref_conf_editval_edit(hid_ctx, ctx, attr, r); } @@ -254,7 +254,7 @@ static void pref_conf_edit_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) { - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; pref_ctx_t *pctx = caller_data; confedit_ctx_t *ctx; rnd_hid_row_t *r; @@ -288,79 +288,79 @@ ctx->idx = pctx->conf.selected_idx; ctx->role = r->user_data2.lng; - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(ctx->dlg, ctx->nat->hash_path); + RND_DAD_LABEL(ctx->dlg, ctx->nat->hash_path); switch(ctx->nat->type) { case RND_CFN_STRING: - PCB_DAD_STRING(ctx->dlg); - ctx->wnewval = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "apply"); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_cb); - b[0] = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_STRING(ctx->dlg); + ctx->wnewval = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "apply"); + RND_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_cb); + b[0] = RND_DAD_CURRENT(ctx->dlg); break; case RND_CFN_BOOLEAN: - PCB_DAD_BOOL(ctx->dlg, ""); - ctx->wnewval = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_cb); + RND_DAD_BOOL(ctx->dlg, ""); + ctx->wnewval = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_cb); break; case RND_CFN_INTEGER: - PCB_DAD_INTEGER(ctx->dlg, ""); - ctx->wnewval = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_MINMAX(ctx->dlg, -(1<<30), +(1<<30)); - PCB_DAD_BUTTON(ctx->dlg, "apply"); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_cb); - b[0] = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_INTEGER(ctx->dlg, ""); + ctx->wnewval = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, -(1<<30), +(1<<30)); + RND_DAD_BUTTON(ctx->dlg, "apply"); + RND_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_cb); + b[0] = RND_DAD_CURRENT(ctx->dlg); break; case RND_CFN_REAL: - PCB_DAD_REAL(ctx->dlg, ""); - ctx->wnewval = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_MINMAX(ctx->dlg, -(1<<30), +(1<<30)); - PCB_DAD_BUTTON(ctx->dlg, "apply"); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_cb); - b[0] = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_REAL(ctx->dlg, ""); + ctx->wnewval = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, -(1<<30), +(1<<30)); + RND_DAD_BUTTON(ctx->dlg, "apply"); + RND_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_cb); + b[0] = RND_DAD_CURRENT(ctx->dlg); break; case RND_CFN_COORD: - PCB_DAD_COORD(ctx->dlg, ""); - ctx->wnewval = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_MINMAX(ctx->dlg, -PCB_MM_TO_COORD(1000), +PCB_MM_TO_COORD(1000)); - PCB_DAD_BUTTON(ctx->dlg, "apply"); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_cb); - b[0] = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_COORD(ctx->dlg, ""); + ctx->wnewval = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, -PCB_MM_TO_COORD(1000), +PCB_MM_TO_COORD(1000)); + RND_DAD_BUTTON(ctx->dlg, "apply"); + RND_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_cb); + b[0] = RND_DAD_CURRENT(ctx->dlg); break; case RND_CFN_UNIT: PCB_DAD_UNIT(ctx->dlg, 0x3fff); - ctx->wnewval = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_cb); + ctx->wnewval = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_cb); break; case RND_CFN_COLOR: - PCB_DAD_COLOR(ctx->dlg); - ctx->wnewval = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_cb); + RND_DAD_COLOR(ctx->dlg); + ctx->wnewval = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_cb); break; case RND_CFN_LIST: - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_TREE(ctx->dlg, 1, 0, NULL); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - ctx->wnewval = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Edit..."); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_edit_cb); - b[0] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Del"); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_del_cb); - b[1] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Insert before"); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_ins_cb); - b[2] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Insert after"); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_ins_cb); - b[3] = ctx->winsa = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_TREE(ctx->dlg, 1, 0, NULL); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + ctx->wnewval = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Edit..."); + RND_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_edit_cb); + b[0] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Del"); + RND_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_del_cb); + b[1] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Insert before"); + RND_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_ins_cb); + b[2] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Insert after"); + RND_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_ins_cb); + b[3] = ctx->winsa = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); break; case RND_CFN_HLIST: { @@ -367,33 +367,33 @@ gdl_iterator_t it; rnd_conf_listitem_t *i; - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); rnd_conflist_foreach(pctx->conf.selected_nat->val.list, &it, i) { lht_node_t *rule = i->prop.src; - PCB_DAD_BUTTON(ctx->dlg, rule->name); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_hlist_cb); + RND_DAD_BUTTON(ctx->dlg, rule->name); + RND_DAD_CHANGE_CB(ctx->dlg, pref_conf_editval_hlist_cb); } - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); } break; case RND_CFN_max: - PCB_DAD_LABEL(ctx->dlg, "ERROR: invalid conf node type"); + RND_DAD_LABEL(ctx->dlg, "ERROR: invalid conf node type"); } if (is_read_only(ctx)) { - PCB_DAD_LABEL(ctx->dlg, "NOTE: this value is read-only"); - PCB_DAD_HELP(ctx->dlg, "Config value with this config role\ncan not be modified.\nPlease pick another config role\nand try to edit or create\nthe value there!\n(If that role has higher priority,\nthat value will override this one)"); + RND_DAD_LABEL(ctx->dlg, "NOTE: this value is read-only"); + RND_DAD_HELP(ctx->dlg, "Config value with this config role\ncan not be modified.\nPlease pick another config role\nand try to edit or create\nthe value there!\n(If that role has higher priority,\nthat value will override this one)"); } else if (confedit_node_is_uninitialized(ctx)) { - PCB_DAD_LABEL(ctx->dlg, "NOTE: change the value to create the config node"); - PCB_DAD_HELP(ctx->dlg, "This config node does not exist\non the selected role.\nTo create it, change the value.\nSpecial case for boolean values:\nto create an unticked value,\nfirst tick then untick the checkbox."); + RND_DAD_LABEL(ctx->dlg, "NOTE: change the value to create the config node"); + RND_DAD_HELP(ctx->dlg, "This config node does not exist\non the selected role.\nTo create it, change the value.\nSpecial case for boolean values:\nto create an unticked value,\nfirst tick then untick the checkbox."); } - PCB_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); - PCB_DAD_END(ctx->dlg); + RND_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); + RND_DAD_END(ctx->dlg); - PCB_DAD_NEW("pref_confedit", ctx->dlg, "pcb-rnd conf item", ctx, pcb_false, pref_conf_edit_close_cb); + RND_DAD_NEW("pref_confedit", ctx->dlg, "pcb-rnd conf item", ctx, pcb_false, pref_conf_edit_close_cb); if (is_read_only(ctx)) { int n; Index: trunk/src_plugins/dialogs/dlg_pref_general.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_general.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_pref_general.c (revision 30992) @@ -61,27 +61,27 @@ void pcb_dlg_pref_general_create(pref_ctx_t *ctx) { - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(ctx->dlg, "Top window layout"); - PCB_DAD_BEGIN_TABLE(ctx->dlg, 2); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); + RND_DAD_LABEL(ctx->dlg, "Top window layout"); + RND_DAD_BEGIN_TABLE(ctx->dlg, 2); pcb_pref_create_conftable(ctx, perf_topwin, pref_general_dlg2conf); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(ctx->dlg, "Backup"); - PCB_DAD_BEGIN_TABLE(ctx->dlg, 2); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); + RND_DAD_LABEL(ctx->dlg, "Backup"); + RND_DAD_BEGIN_TABLE(ctx->dlg, 2); pcb_pref_create_conftable(ctx, perf_backup, pref_general_dlg2conf); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(ctx->dlg, "Command line entry"); - PCB_DAD_BEGIN_TABLE(ctx->dlg, 2); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); + RND_DAD_LABEL(ctx->dlg, "Command line entry"); + RND_DAD_BEGIN_TABLE(ctx->dlg, 2); pcb_pref_create_conftable(ctx, perf_cli, pref_general_dlg2conf); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); } Index: trunk/src_plugins/dialogs/dlg_pref_layer.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_layer.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_pref_layer.c (revision 30992) @@ -52,10 +52,10 @@ { rnd_rnd_box_t vbox = {0, 0, PCB_MM_TO_COORD(150), PCB_MM_TO_COORD(150)}; - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_PREVIEW(ctx->dlg, layersel_expose_cb, layersel_mouse_cb, layersel_free_cb, &vbox, 200, 200, ctx); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_PREVIEW(ctx->dlg, layersel_expose_cb, layersel_mouse_cb, layersel_free_cb, &vbox, 200, 200, ctx); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); } Index: trunk/src_plugins/dialogs/dlg_pref_lib.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 30992) @@ -118,7 +118,7 @@ cell[1] = rnd_strdup(tmp == NULL ? "" : tmp); cell[2] = rnd_strdup(pref_node_src(i->prop.src)); cell[3] = NULL; - pcb_dad_tree_append(attr, NULL, cell); + rnd_dad_tree_append(attr, NULL, cell); } hv.str = pref_ctx.lib.cursor_path; @@ -217,7 +217,7 @@ cell[3] = NULL; if (pcb_dad_tree_remove(attr, r) == 0) { rnd_hid_attr_val_t hv; - pcb_dad_tree_insert(attr, prev, cell); + rnd_dad_tree_insert(attr, prev, cell); pref_lib_dlg2conf(hid_ctx, caller_data, attr); hv.str = cell[0]; rnd_gui->attr_dlg_set_value(pref_ctx.dlg_hid_ctx, pref_ctx.lib.wlist, &hv); @@ -244,7 +244,7 @@ cell[3] = NULL; if (pcb_dad_tree_remove(attr, r) == 0) { rnd_hid_attr_val_t hv; - pcb_dad_tree_append(attr, next, cell); + rnd_dad_tree_append(attr, next, cell); pref_lib_dlg2conf(hid_ctx, caller_data, attr); hv.str = cell[0]; rnd_gui->attr_dlg_set_value(pref_ctx.dlg_hid_ctx, pref_ctx.lib.wlist, &hv); @@ -252,7 +252,7 @@ } typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int wpath, wexp; pref_ctx_t *pctx; } cell_edit_ctx_t; @@ -264,40 +264,40 @@ pcb_path_resolve(&PCB->hidlib, ctx->dlg[ctx->wpath].val.str, &tmp, 0, pcb_true); if (tmp != NULL) - PCB_DAD_SET_VALUE(hid_ctx, ctx->wexp, str, tmp); + RND_DAD_SET_VALUE(hid_ctx, ctx->wexp, str, tmp); } static int lib_cell_edit(pref_ctx_t *pctx, char **cell) { cell_edit_ctx_t ctx; - pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; memset(&ctx, 0, sizeof(ctx)); ctx.pctx = pctx; - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_BEGIN_TABLE(ctx.dlg, 2); - PCB_DAD_LABEL(ctx.dlg, "Path:"); - PCB_DAD_STRING(ctx.dlg); - ctx.wpath = PCB_DAD_CURRENT(ctx.dlg); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_BEGIN_TABLE(ctx.dlg, 2); + RND_DAD_LABEL(ctx.dlg, "Path:"); + RND_DAD_STRING(ctx.dlg); + ctx.wpath = RND_DAD_CURRENT(ctx.dlg); ctx.dlg[ctx.wpath].val.str = rnd_strdup(cell[0]); - PCB_DAD_CHANGE_CB(ctx.dlg, lib_cell_edit_update); + RND_DAD_CHANGE_CB(ctx.dlg, lib_cell_edit_update); - PCB_DAD_LABEL(ctx.dlg, "Expanded\nversion:"); - PCB_DAD_LABEL(ctx.dlg, rnd_strdup(cell[1])); - ctx.wexp = PCB_DAD_CURRENT(ctx.dlg); + RND_DAD_LABEL(ctx.dlg, "Expanded\nversion:"); + RND_DAD_LABEL(ctx.dlg, rnd_strdup(cell[1])); + ctx.wexp = RND_DAD_CURRENT(ctx.dlg); ctx.dlg[ctx.wexp].val.str = rnd_strdup(cell[1]); - PCB_DAD_LABEL(ctx.dlg, ""); - PCB_DAD_BUTTON(ctx.dlg, "Help..."); - PCB_DAD_CHANGE_CB(ctx.dlg, libhelp_btn); - PCB_DAD_END(ctx.dlg); - PCB_DAD_BUTTON_CLOSES(ctx.dlg, clbtn); - PCB_DAD_END(ctx.dlg); + RND_DAD_LABEL(ctx.dlg, ""); + RND_DAD_BUTTON(ctx.dlg, "Help..."); + RND_DAD_CHANGE_CB(ctx.dlg, libhelp_btn); + RND_DAD_END(ctx.dlg); + RND_DAD_BUTTON_CLOSES(ctx.dlg, clbtn); + RND_DAD_END(ctx.dlg); - PCB_DAD_NEW("pref_lib_path", ctx.dlg, "Edit library path", &ctx, pcb_true, NULL); - if (PCB_DAD_RUN(ctx.dlg) != 0) { - PCB_DAD_FREE(ctx.dlg); + RND_DAD_NEW("pref_lib_path", ctx.dlg, "Edit library path", &ctx, pcb_true, NULL); + if (RND_DAD_RUN(ctx.dlg) != 0) { + RND_DAD_FREE(ctx.dlg); return -1; } @@ -306,7 +306,7 @@ free(cell[1]); cell[1] = rnd_strdup(PCB_EMPTY(ctx.dlg[ctx.wexp].val.str)); - PCB_DAD_FREE(ctx.dlg); + RND_DAD_FREE(ctx.dlg); return 0; } @@ -355,10 +355,10 @@ switch(pos) { case -1: /* before */ - pcb_dad_tree_insert(attr, r, cell); + rnd_dad_tree_insert(attr, r, cell); break; case +1: /* after */ - pcb_dad_tree_append(attr, r, cell); + rnd_dad_tree_append(attr, r, cell); break; case 0: /* replace */ pcb_dad_tree_modify_cell(attr, r, 0, cell[0]); @@ -387,7 +387,7 @@ void pcb_dlg_pref_lib_close(pref_ctx_t *ctx) { if (ctx->lib.help.active) - PCB_DAD_FREE(ctx->lib.help.dlg); + RND_DAD_FREE(ctx->lib.help.dlg); } static void pref_libhelp_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) @@ -398,13 +398,13 @@ static void pref_libhelp_open(pref_libhelp_ctx_t *ctx) { htsp_entry_t *e; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (ctx->active) return; - PCB_DAD_LABEL(ctx->dlg, "The following $(variables) can be used in the path:"); - PCB_DAD_BEGIN_TABLE(ctx->dlg, 2); + RND_DAD_LABEL(ctx->dlg, "The following $(variables) can be used in the path:"); + RND_DAD_BEGIN_TABLE(ctx->dlg, 2); rnd_conf_fields_foreach(e) { rnd_conf_native_t *nat = e->value; char tmp[256]; @@ -413,17 +413,17 @@ continue; pcb_snprintf(tmp, sizeof(tmp), "$(rc.path.%s)", e->key + 8); - PCB_DAD_LABEL(ctx->dlg, tmp); - PCB_DAD_LABEL(ctx->dlg, nat->val.string[0] == NULL ? "" : nat->val.string[0]); + RND_DAD_LABEL(ctx->dlg, tmp); + RND_DAD_LABEL(ctx->dlg, nat->val.string[0] == NULL ? "" : nat->val.string[0]); } - PCB_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); - PCB_DAD_END(ctx->dlg); + RND_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); + RND_DAD_END(ctx->dlg); ctx->active = 1; - PCB_DAD_NEW("pref_lib_path_help", ctx->dlg, "pcb-rnd preferences: library help", ctx, pcb_true, pref_libhelp_close_cb); + RND_DAD_NEW("pref_lib_path_help", ctx->dlg, "pcb-rnd preferences: library help", ctx, pcb_true, pref_libhelp_close_cb); - PCB_DAD_RUN(ctx->dlg); - PCB_DAD_FREE(ctx->dlg); + RND_DAD_RUN(ctx->dlg); + RND_DAD_FREE(ctx->dlg); memset(ctx, 0, sizeof(pref_libhelp_ctx_t)); /* reset all states to the initial - includes ctx->active = 0; */ } @@ -437,41 +437,41 @@ static const char *hdr[] = {"configured path", "actual path on the filesystem", "config source", NULL}; rnd_hid_tree_t *tree; - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); /* get the parent vbox, which is the tab's page vbox, to expand and fill */ + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); /* get the parent vbox, which is the tab's page vbox, to expand and fill */ - PCB_DAD_LABEL(ctx->dlg, "Ordered list of footprint library search directories."); + RND_DAD_LABEL(ctx->dlg, "Ordered list of footprint library search directories."); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME | RND_HATF_SCROLL | RND_HATF_EXPFILL); - PCB_DAD_TREE(ctx->dlg, 3, 0, hdr); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - ctx->lib.wlist = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME | RND_HATF_SCROLL | RND_HATF_EXPFILL); + RND_DAD_TREE(ctx->dlg, 3, 0, hdr); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + ctx->lib.wlist = RND_DAD_CURRENT(ctx->dlg); tree = ctx->dlg[ctx->lib.wlist].wdata; tree->user_free_cb = pref_lib_row_free; - PCB_DAD_TREE_SET_CB(ctx->dlg, selected_cb, pref_lib_select_cb); - PCB_DAD_END(ctx->dlg); + RND_DAD_TREE_SET_CB(ctx->dlg, selected_cb, pref_lib_select_cb); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Move up"); - PCB_DAD_CHANGE_CB(ctx->dlg, lib_btn_up); - ctx->lib.wmoveup = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Move down"); - PCB_DAD_CHANGE_CB(ctx->dlg, lib_btn_down); - ctx->lib.wmovedown = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Insert before"); - PCB_DAD_CHANGE_CB(ctx->dlg, lib_btn_insert_before); - PCB_DAD_BUTTON(ctx->dlg, "Insert after"); - PCB_DAD_CHANGE_CB(ctx->dlg, lib_btn_insert_after); - PCB_DAD_BUTTON(ctx->dlg, "Remove"); - PCB_DAD_CHANGE_CB(ctx->dlg, lib_btn_remove); - ctx->lib.wremove = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Edit..."); - PCB_DAD_CHANGE_CB(ctx->dlg, lib_btn_edit); - ctx->lib.wedit = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Help..."); - ctx->lib.whsbutton = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, libhelp_btn); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Move up"); + RND_DAD_CHANGE_CB(ctx->dlg, lib_btn_up); + ctx->lib.wmoveup = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Move down"); + RND_DAD_CHANGE_CB(ctx->dlg, lib_btn_down); + ctx->lib.wmovedown = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Insert before"); + RND_DAD_CHANGE_CB(ctx->dlg, lib_btn_insert_before); + RND_DAD_BUTTON(ctx->dlg, "Insert after"); + RND_DAD_CHANGE_CB(ctx->dlg, lib_btn_insert_after); + RND_DAD_BUTTON(ctx->dlg, "Remove"); + RND_DAD_CHANGE_CB(ctx->dlg, lib_btn_remove); + ctx->lib.wremove = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Edit..."); + RND_DAD_CHANGE_CB(ctx->dlg, lib_btn_edit); + ctx->lib.wedit = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Help..."); + ctx->lib.whsbutton = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, libhelp_btn); + RND_DAD_END(ctx->dlg); } Index: trunk/src_plugins/dialogs/dlg_pref_lib.h =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_lib.h (revision 30991) +++ trunk/src_plugins/dialogs/dlg_pref_lib.h (revision 30992) @@ -2,7 +2,7 @@ #define PCB_DLG_PREF_LIB_H typedef struct pref_libhelp_ctx_s { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int active; /* already open - allow only one instance */ } pref_libhelp_ctx_t; Index: trunk/src_plugins/dialogs/dlg_pref_sizes.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_sizes.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_pref_sizes.c (revision 30992) @@ -37,8 +37,8 @@ { if (ctx->sizes.lock) return; - 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); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->sizes.wwidth, crd, PCB->hidlib.size_x); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->sizes.wheight, crd, PCB->hidlib.size_y); } /* Dialog box to actual board size */ @@ -77,7 +77,7 @@ { if ((pref_ctx.sizes.lock) || (!pref_ctx.active)) return; - PCB_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, pref_ctx.sizes.wisle, dbl, conf_core.design.poly_isle_area / 1000000.0); + RND_DAD_SET_VALUE(pref_ctx.dlg_hid_ctx, pref_ctx.sizes.wisle, dbl, conf_core.design.poly_isle_area / 1000000.0); } static void pref_isle_dlg2brd(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) @@ -99,61 +99,61 @@ { pcb_drc_impl_t *di; - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(ctx->dlg, "Board size"); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Width="); - PCB_DAD_COORD(ctx->dlg, ""); - ctx->sizes.wwidth = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_MINMAX(ctx->dlg, PCB_MM_TO_COORD(1), RND_MAX_COORD); - PCB_DAD_DEFAULT_NUM(ctx->dlg, PCB->hidlib.size_x); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_sizes_dlg2brd); - PCB_DAD_LABEL(ctx->dlg, "Height="); - PCB_DAD_COORD(ctx->dlg, ""); - ctx->sizes.wheight = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_MINMAX(ctx->dlg, PCB_MM_TO_COORD(1), RND_MAX_COORD); - PCB_DAD_DEFAULT_NUM(ctx->dlg, PCB->hidlib.size_y); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_sizes_dlg2brd); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); + RND_DAD_LABEL(ctx->dlg, "Board size"); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Width="); + RND_DAD_COORD(ctx->dlg, ""); + ctx->sizes.wwidth = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, PCB_MM_TO_COORD(1), RND_MAX_COORD); + RND_DAD_DEFAULT_NUM(ctx->dlg, PCB->hidlib.size_x); + RND_DAD_CHANGE_CB(ctx->dlg, pref_sizes_dlg2brd); + RND_DAD_LABEL(ctx->dlg, "Height="); + RND_DAD_COORD(ctx->dlg, ""); + ctx->sizes.wheight = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, PCB_MM_TO_COORD(1), RND_MAX_COORD); + RND_DAD_DEFAULT_NUM(ctx->dlg, PCB->hidlib.size_y); + RND_DAD_CHANGE_CB(ctx->dlg, pref_sizes_dlg2brd); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(ctx->dlg, "*OBSOLETE* DRC; do not use; details:"); - PCB_DAD_STRING(ctx->dlg); - PCB_DAD_DEFAULT_PTR(ctx->dlg, "http://repo.hu/cgi-bin/pool.cgi?cmd=show&node=deprecation#olddrc"); - PCB_DAD_WIDTH_CHR(ctx->dlg, 64); - PCB_DAD_BEGIN_TABLE(ctx->dlg, 2); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); + RND_DAD_LABEL(ctx->dlg, "*OBSOLETE* DRC; do not use; details:"); + RND_DAD_STRING(ctx->dlg); + RND_DAD_DEFAULT_PTR(ctx->dlg, "http://repo.hu/cgi-bin/pool.cgi?cmd=show&node=deprecation#olddrc"); + RND_DAD_WIDTH_CHR(ctx->dlg, 64); + RND_DAD_BEGIN_TABLE(ctx->dlg, 2); pcb_pref_create_conftable(ctx, drc_sizes, pref_sizes_drc_dlg2conf); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(ctx->dlg, "Configure DRC rules:"); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); + RND_DAD_LABEL(ctx->dlg, "Configure DRC rules:"); for(di = gdl_first(&pcb_drc_impls); di != NULL; di = di->link.next) { char *ra = rnd_strdup(di->list_rules_action); /* need to strdup it just in case the plugin is unloaded while the preferences dialog is open */ vtp0_append(&ctx->auto_free, ra); - PCB_DAD_BUTTON(ctx->dlg, di->name); - PCB_DAD_HELP(ctx->dlg, di->desc); - PCB_DAD_SET_ATTR_FIELD(ctx->dlg, user_data, ra); - PCB_DAD_CHANGE_CB(ctx->dlg, drc_rules_cb); + RND_DAD_BUTTON(ctx->dlg, di->name); + RND_DAD_HELP(ctx->dlg, di->desc); + RND_DAD_SET_ATTR_FIELD(ctx->dlg, user_data, ra); + RND_DAD_CHANGE_CB(ctx->dlg, drc_rules_cb); } - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(ctx->dlg, "misc sizes"); - PCB_DAD_BEGIN_TABLE(ctx->dlg, 2); - PCB_DAD_LABEL(ctx->dlg, "polygon isle minimum size\n[square um]"); - PCB_DAD_REAL(ctx->dlg, ""); - ctx->sizes.wisle = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_MINMAX(ctx->dlg, 0, RND_MAX_COORD); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); + RND_DAD_LABEL(ctx->dlg, "misc sizes"); + RND_DAD_BEGIN_TABLE(ctx->dlg, 2); + RND_DAD_LABEL(ctx->dlg, "polygon isle minimum size\n[square um]"); + RND_DAD_REAL(ctx->dlg, ""); + ctx->sizes.wisle = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, 0, RND_MAX_COORD); ctx->dlg[ctx->sizes.wisle].val.dbl = (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); + RND_DAD_CHANGE_CB(ctx->dlg, pref_isle_dlg2brd); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); } void pcb_dlg_pref_sizes_init(pref_ctx_t *ctx) Index: trunk/src_plugins/dialogs/dlg_pref_win.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_win.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_pref_win.c (revision 30992) @@ -38,10 +38,10 @@ static void pref_win_brd2dlg(pref_ctx_t *ctx) { - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wmaster, lng, pcbhl_conf.editor.auto_place); - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wboard, lng, dialogs_conf.plugins.dialogs.auto_save_window_geometry.to_design); - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wproject, lng, dialogs_conf.plugins.dialogs.auto_save_window_geometry.to_project); - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wuser, lng, dialogs_conf.plugins.dialogs.auto_save_window_geometry.to_user); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wmaster, lng, pcbhl_conf.editor.auto_place); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wboard, lng, dialogs_conf.plugins.dialogs.auto_save_window_geometry.to_design); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wproject, lng, dialogs_conf.plugins.dialogs.auto_save_window_geometry.to_project); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wuser, lng, dialogs_conf.plugins.dialogs.auto_save_window_geometry.to_user); } void pcb_dlg_pref_win_open(pref_ctx_t *ctx) @@ -115,76 +115,76 @@ void pcb_dlg_pref_win_create(pref_ctx_t *ctx) { - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(ctx->dlg, "Load window geometry and enable window placement:"); - PCB_DAD_BOOL(ctx->dlg, ""); - PCB_DAD_HELP(ctx->dlg, "When enabled, pcb-rnd will load window geometry from config files\nand try to resize and place windows accordingly.\nSizes can be saved once (golden arrangement)\nor at every exit (retrain last setup),\nsee below."); - ctx->win.wmaster = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_win_master_cb); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(ctx->dlg, "Save window geometry to..."); - PCB_DAD_BEGIN_TABLE(ctx->dlg, 2); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); + RND_DAD_LABEL(ctx->dlg, "Load window geometry and enable window placement:"); + RND_DAD_BOOL(ctx->dlg, ""); + RND_DAD_HELP(ctx->dlg, "When enabled, pcb-rnd will load window geometry from config files\nand try to resize and place windows accordingly.\nSizes can be saved once (golden arrangement)\nor at every exit (retrain last setup),\nsee below."); + ctx->win.wmaster = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, pref_win_master_cb); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); + RND_DAD_LABEL(ctx->dlg, "Save window geometry to..."); + RND_DAD_BEGIN_TABLE(ctx->dlg, 2); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "... in the design (board) file"); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "now"); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_win_board_now_cb); - PCB_DAD_LABEL(ctx->dlg, "before close:"); - PCB_DAD_BOOL(ctx->dlg, ""); - ctx->win.wboard = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_win_board_cb); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "... in the design (board) file"); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "now"); + RND_DAD_CHANGE_CB(ctx->dlg, pref_win_board_now_cb); + RND_DAD_LABEL(ctx->dlg, "before close:"); + RND_DAD_BOOL(ctx->dlg, ""); + ctx->win.wboard = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, pref_win_board_cb); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "... in the project file"); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "now"); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_win_project_now_cb); - PCB_DAD_LABEL(ctx->dlg, "before close:"); - PCB_DAD_BOOL(ctx->dlg, ""); - ctx->win.wproject = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_win_project_cb); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "... in the project file"); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "now"); + RND_DAD_CHANGE_CB(ctx->dlg, pref_win_project_now_cb); + RND_DAD_LABEL(ctx->dlg, "before close:"); + RND_DAD_BOOL(ctx->dlg, ""); + ctx->win.wproject = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, pref_win_project_cb); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "... in the user config"); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "now"); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_win_user_now_cb); - PCB_DAD_LABEL(ctx->dlg, "before close:"); - PCB_DAD_BOOL(ctx->dlg, ""); - ctx->win.wuser = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_win_user_cb); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "... in the user config"); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "now"); + RND_DAD_CHANGE_CB(ctx->dlg, pref_win_user_now_cb); + RND_DAD_LABEL(ctx->dlg, "before close:"); + RND_DAD_BOOL(ctx->dlg, ""); + ctx->win.wuser = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, pref_win_user_cb); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "... in a custom file"); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "now"); - PCB_DAD_CHANGE_CB(ctx->dlg, pref_win_file_now_cb); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "... in a custom file"); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "now"); + RND_DAD_CHANGE_CB(ctx->dlg, pref_win_file_now_cb); + RND_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); } Index: trunk/src_plugins/dialogs/dlg_search.c =================================================================== --- trunk/src_plugins/dialogs/dlg_search.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_search.c (revision 30992) @@ -55,7 +55,7 @@ } search_expr_t; typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int wexpr_str, wwizard, wact; int wrowbox[MAX_ROW]; int wexpr[MAX_ROW][MAX_COL]; /* expression framed box */ @@ -90,16 +90,16 @@ static void hspacer(search_ctx_t *ctx) { - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); } static void vspacer(search_ctx_t *ctx) { - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); } static void update_vis(search_ctx_t *ctx) @@ -327,89 +327,89 @@ static void search_window_create(void) { - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; search_ctx_t *ctx = calloc(sizeof(search_ctx_t), 1); int row, col; - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(ctx->dlg, "Query expression:"); - PCB_DAD_STRING(ctx->dlg); - PCB_DAD_WIDTH_CHR(ctx->dlg, 64); - ctx->wexpr_str = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Action on the results:"); - PCB_DAD_ENUM(ctx->dlg, search_acts); - ctx->wact = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME | RND_HATF_EXPFILL | RND_HATF_SCROLL); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Enable the wizard:"); - PCB_DAD_BOOL(ctx->dlg, ""); - ctx->wwizard = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_DEFAULT_NUM(ctx->dlg, 1); - PCB_DAD_CHANGE_CB(ctx->dlg, search_enable_cb); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(ctx->dlg, "Query expression:"); + RND_DAD_STRING(ctx->dlg); + RND_DAD_WIDTH_CHR(ctx->dlg, 64); + ctx->wexpr_str = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Action on the results:"); + RND_DAD_ENUM(ctx->dlg, search_acts); + ctx->wact = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME | RND_HATF_EXPFILL | RND_HATF_SCROLL); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Enable the wizard:"); + RND_DAD_BOOL(ctx->dlg, ""); + ctx->wwizard = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_DEFAULT_NUM(ctx->dlg, 1); + RND_DAD_CHANGE_CB(ctx->dlg, search_enable_cb); + RND_DAD_END(ctx->dlg); for(row = 0; row < MAX_ROW; row++) { if (row > 0) { - PCB_DAD_BEGIN_HBOX(ctx->dlg); - ctx->wand[row] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_HIDE); - PCB_DAD_LABEL(ctx->dlg, "AND"); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + ctx->wand[row] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_HIDE); + RND_DAD_LABEL(ctx->dlg, "AND"); + RND_DAD_END(ctx->dlg); } - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, /*RND_HATF_EXPFILL | */RND_HATF_HIDE); - ctx->wrowbox[row] = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, /*RND_HATF_EXPFILL | */RND_HATF_HIDE); + ctx->wrowbox[row] = RND_DAD_CURRENT(ctx->dlg); for(col = 0; col < MAX_COL; col++) { ctx->visible[row][col] = 0; if (col > 0) { - PCB_DAD_LABEL(ctx->dlg, " OR "); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE); - ctx->wor[row][col] = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, " OR "); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE); + ctx->wor[row][col] = RND_DAD_CURRENT(ctx->dlg); } - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME | RND_HATF_TIGHT | RND_HATF_HIDE); - ctx->wexpr[row][col] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, NEW_EXPR_LAB); - ctx->wexpr_lab[row][col] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_TIGHT); - PCB_DAD_PICBUTTON(ctx->dlg, icon_del); - PCB_DAD_HELP(ctx->dlg, "Remove expression"); - ctx->wexpr_del[row][col] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, search_del_cb); - PCB_DAD_PICBUTTON(ctx->dlg, icon_edit); - PCB_DAD_HELP(ctx->dlg, "Edit expression"); - ctx->wexpr_edit[row][col] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, search_edit_cb); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME | RND_HATF_TIGHT | RND_HATF_HIDE); + ctx->wexpr[row][col] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, NEW_EXPR_LAB); + ctx->wexpr_lab[row][col] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_TIGHT); + RND_DAD_PICBUTTON(ctx->dlg, icon_del); + RND_DAD_HELP(ctx->dlg, "Remove expression"); + ctx->wexpr_del[row][col] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, search_del_cb); + RND_DAD_PICBUTTON(ctx->dlg, icon_edit); + RND_DAD_HELP(ctx->dlg, "Edit expression"); + ctx->wexpr_edit[row][col] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, search_edit_cb); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); } hspacer(ctx); - PCB_DAD_BUTTON(ctx->dlg, "append OR"); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE); - ctx->wnew_or[row] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, search_append_col_cb); - PCB_DAD_END(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "append OR"); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE); + ctx->wnew_or[row] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, search_append_col_cb); + RND_DAD_END(ctx->dlg); } vspacer(ctx); - PCB_DAD_BUTTON(ctx->dlg, "append AND"); - ctx->wnew_and = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, search_append_row_cb); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Apply"); - PCB_DAD_CHANGE_CB(ctx->dlg, search_apply_cb); - PCB_DAD_HELP(ctx->dlg, "Execute the search expression\nusing the selected action"); + RND_DAD_BUTTON(ctx->dlg, "append AND"); + ctx->wnew_and = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, search_append_row_cb); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Apply"); + RND_DAD_CHANGE_CB(ctx->dlg, search_apply_cb); + RND_DAD_HELP(ctx->dlg, "Execute the search expression\nusing the selected action"); hspacer(ctx); - PCB_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_DEFSIZE(ctx->dlg, 300, 350); - PCB_DAD_NEW("search", ctx->dlg, "pcb-rnd search", ctx, pcb_false, search_close_cb); + RND_DAD_DEFSIZE(ctx->dlg, 300, 350); + RND_DAD_NEW("search", ctx->dlg, "pcb-rnd search", ctx, pcb_false, search_close_cb); ctx->visible[0][0] = 1; update_vis(ctx); Index: trunk/src_plugins/dialogs/dlg_search_edit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_search_edit.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_search_edit.c (revision 30992) @@ -33,7 +33,7 @@ #include typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) search_expr_t se; int wleft, wop, wright[RIGHT_max]; const expr_wizard_op_t *last_op; @@ -95,7 +95,7 @@ cell[1] = NULL; for(o = op->ops; *o != NULL; o++) { cell[0] = pcb_strdup_printf(*o); - r = pcb_dad_tree_append(attr, NULL, cell); + r = rnd_dad_tree_append(attr, NULL, cell); r->user_data = (void *)(*o); /* will be casted back to const char * only */ if ((!click) && (ctx->se.op == *o)) cur = r; @@ -130,7 +130,7 @@ cell[1] = NULL; for(o = s->expr->right_const->ops; *o != NULL; o++) { cell[0] = pcb_strdup_printf(*o); - pcb_dad_tree_append(attr, NULL, cell); + rnd_dad_tree_append(attr, NULL, cell); } /* set cursor to last known value */ @@ -235,9 +235,9 @@ parent = NULL; cell[0] = rnd_strdup(t->left_desc); if (parent != NULL) - r = pcb_dad_tree_append_under(attr, parent, cell); + r = rnd_dad_tree_append_under(attr, parent, cell); else - r = pcb_dad_tree_append(attr, NULL, cell); + r = rnd_dad_tree_append(attr, NULL, cell); r->user_data = (void *)t; if (t->left_var == NULL) parent = r; @@ -279,7 +279,7 @@ static int srchedit_window(search_expr_t *expr) { - pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", 1}, {"OK", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", 1}, {"OK", 0}, {NULL, 0}}; srchedit_ctx_t *ctx = &srchedit_ctx; int res; @@ -291,63 +291,63 @@ ctx->last_op = NULL; ctx->last_rtype = RIGHT_max; - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_TREE(ctx->dlg, 1, 1, NULL); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_SCROLL); - ctx->wleft = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_TREE_SET_CB(ctx->dlg, selected_cb, srch_expr_left_cb); - PCB_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_TREE(ctx->dlg, 1, 0, NULL); - ctx->wop = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_TREE_SET_CB(ctx->dlg, selected_cb, srch_expr_op_cb); - PCB_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_TREE(ctx->dlg, 1, 1, NULL); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_SCROLL); + ctx->wleft = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_TREE_SET_CB(ctx->dlg, selected_cb, srch_expr_left_cb); + RND_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_TREE(ctx->dlg, 1, 0, NULL); + ctx->wop = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_TREE_SET_CB(ctx->dlg, selected_cb, srch_expr_op_cb); + RND_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_STRING(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE); - ctx->wright[RIGHT_STR] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, srchexpr_right_cb); + RND_DAD_STRING(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE); + ctx->wright[RIGHT_STR] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, srchexpr_right_cb); - PCB_DAD_INTEGER(ctx->dlg, ""); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE); - ctx->wright[RIGHT_INT] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_MINMAX(ctx->dlg, -(1L<<30), (1L<<30)); - PCB_DAD_CHANGE_CB(ctx->dlg, srchexpr_right_cb); + RND_DAD_INTEGER(ctx->dlg, ""); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE); + ctx->wright[RIGHT_INT] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, -(1L<<30), (1L<<30)); + RND_DAD_CHANGE_CB(ctx->dlg, srchexpr_right_cb); - PCB_DAD_REAL(ctx->dlg, ""); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE); - ctx->wright[RIGHT_DOUBLE] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_MINMAX(ctx->dlg, -(1L<<30), (1L<<30)); - PCB_DAD_CHANGE_CB(ctx->dlg, srchexpr_right_cb); + RND_DAD_REAL(ctx->dlg, ""); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE); + ctx->wright[RIGHT_DOUBLE] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, -(1L<<30), (1L<<30)); + RND_DAD_CHANGE_CB(ctx->dlg, srchexpr_right_cb); - PCB_DAD_COORD(ctx->dlg, ""); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE); - ctx->wright[RIGHT_COORD] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_MINMAX(ctx->dlg, -RND_MAX_COORD, RND_MAX_COORD); - PCB_DAD_CHANGE_CB(ctx->dlg, srchexpr_right_cb); + RND_DAD_COORD(ctx->dlg, ""); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE); + ctx->wright[RIGHT_COORD] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, -RND_MAX_COORD, RND_MAX_COORD); + RND_DAD_CHANGE_CB(ctx->dlg, srchexpr_right_cb); - PCB_DAD_TREE(ctx->dlg, 1, 0, NULL); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE); - ctx->wright[RIGHT_CONST] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_TREE_SET_CB(ctx->dlg, selected_cb, srch_expr_right_table_cb); - PCB_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); + RND_DAD_TREE(ctx->dlg, 1, 0, NULL); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE); + ctx->wright[RIGHT_CONST] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_TREE_SET_CB(ctx->dlg, selected_cb, srch_expr_right_table_cb); + RND_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_DEFSIZE(ctx->dlg, 450, 450); - PCB_DAD_NEW("search_expr", ctx->dlg, "pcb-rnd search expression", ctx, pcb_true, NULL); + RND_DAD_DEFSIZE(ctx->dlg, 450, 450); + RND_DAD_NEW("search_expr", ctx->dlg, "pcb-rnd search expression", ctx, pcb_true, NULL); if (fill_in_left(ctx) != 1) { srch_expr_set_ops(ctx, op_tab, 1); /* just to get the initial tree widget width */ @@ -354,7 +354,7 @@ rnd_gui->attr_dlg_widget_hide(ctx->dlg_hid_ctx, ctx->wright[RIGHT_CONST], 0); /* just to get something harmless display on the right side after open */ } - res = PCB_DAD_RUN(ctx->dlg); + res = RND_DAD_RUN(ctx->dlg); if (res == 0) { free(expr->right); *expr = ctx->se; @@ -364,7 +364,7 @@ else free(ctx->se.right); - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); return res; } Index: trunk/src_plugins/dialogs/dlg_test.c =================================================================== --- trunk/src_plugins/dialogs/dlg_test.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_test.c (revision 30992) @@ -33,7 +33,7 @@ static const char dlg_test_help[] = "test the attribute dialog"; typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int wtab, tt, wprog, whpane, wvpane, wtxt, wtxtpos, wtxtro; int ttctr, wclr, txtro; int wspin_int, wspout_int, wspin_double, wspout_double, wspin_coord, wspout_coord; @@ -93,7 +93,7 @@ char *row2b[] = {"under_two", "ut", "uuut", NULL}; char *row3[] = {"three", "baz", "BAZ", NULL}; const char *hdr[] = {"num", "data1", "data2", NULL}; - pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; rnd_hid_row_t *row; int failed; @@ -100,186 +100,186 @@ test_t ctx; memset(&ctx, 0, sizeof(ctx)); - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABBED(ctx.dlg, tabs); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_tab_chg); - ctx.wtab = PCB_DAD_CURRENT(ctx.dlg); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABBED(ctx.dlg, tabs); + RND_DAD_CHANGE_CB(ctx.dlg, cb_tab_chg); + ctx.wtab = RND_DAD_CURRENT(ctx.dlg); /* tab 0: "original test" */ - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_LABEL(ctx.dlg, "text1"); - PCB_DAD_BEGIN_TABLE(ctx.dlg, 3); - PCB_DAD_LABEL(ctx.dlg, "text2a"); - PCB_DAD_LABEL(ctx.dlg, "text2b"); - PCB_DAD_LABEL(ctx.dlg, "text2c"); - PCB_DAD_LABEL(ctx.dlg, "text2d"); - PCB_DAD_END(ctx.dlg); - PCB_DAD_LABEL(ctx.dlg, "text3"); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_LABEL(ctx.dlg, "text1"); + RND_DAD_BEGIN_TABLE(ctx.dlg, 3); + RND_DAD_LABEL(ctx.dlg, "text2a"); + RND_DAD_LABEL(ctx.dlg, "text2b"); + RND_DAD_LABEL(ctx.dlg, "text2c"); + RND_DAD_LABEL(ctx.dlg, "text2d"); + RND_DAD_END(ctx.dlg); + RND_DAD_LABEL(ctx.dlg, "text3"); - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_COMPFLAG(ctx.dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(ctx.dlg, "spin test"); - PCB_DAD_BUTTON(ctx.dlg, "reset all to 42"); - PCB_DAD_CHANGE_CB(ctx.dlg, pcb_act_spin_reset); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_COMPFLAG(ctx.dlg, RND_HATF_FRAME); + RND_DAD_LABEL(ctx.dlg, "spin test"); + RND_DAD_BUTTON(ctx.dlg, "reset all to 42"); + RND_DAD_CHANGE_CB(ctx.dlg, pcb_act_spin_reset); - PCB_DAD_BEGIN_HBOX(ctx.dlg); - PCB_DAD_LABEL(ctx.dlg, "INT:"); + RND_DAD_BEGIN_HBOX(ctx.dlg); + RND_DAD_LABEL(ctx.dlg, "INT:"); PCB_DAD_SPIN_INT(ctx.dlg); - ctx.wspin_int = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_DEFAULT_NUM(ctx.dlg, 42); - PCB_DAD_CHANGE_CB(ctx.dlg, pcb_act_spin_upd); - PCB_DAD_LABEL(ctx.dlg, "->"); - PCB_DAD_LABEL(ctx.dlg, "n/a"); - ctx.wspout_int = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_END(ctx.dlg); + ctx.wspin_int = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_DEFAULT_NUM(ctx.dlg, 42); + RND_DAD_CHANGE_CB(ctx.dlg, pcb_act_spin_upd); + RND_DAD_LABEL(ctx.dlg, "->"); + RND_DAD_LABEL(ctx.dlg, "n/a"); + ctx.wspout_int = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_END(ctx.dlg); - PCB_DAD_BEGIN_HBOX(ctx.dlg); - PCB_DAD_LABEL(ctx.dlg, "DBL:"); + RND_DAD_BEGIN_HBOX(ctx.dlg); + RND_DAD_LABEL(ctx.dlg, "DBL:"); PCB_DAD_SPIN_DOUBLE(ctx.dlg); - ctx.wspin_double = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_DEFAULT_NUM(ctx.dlg, 42); - PCB_DAD_CHANGE_CB(ctx.dlg, pcb_act_spin_upd); - PCB_DAD_LABEL(ctx.dlg, "->"); - PCB_DAD_LABEL(ctx.dlg, "n/a"); - ctx.wspout_double = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_END(ctx.dlg); + ctx.wspin_double = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_DEFAULT_NUM(ctx.dlg, 42); + RND_DAD_CHANGE_CB(ctx.dlg, pcb_act_spin_upd); + RND_DAD_LABEL(ctx.dlg, "->"); + RND_DAD_LABEL(ctx.dlg, "n/a"); + ctx.wspout_double = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_END(ctx.dlg); - PCB_DAD_BEGIN_HBOX(ctx.dlg); - PCB_DAD_LABEL(ctx.dlg, "CRD:"); + RND_DAD_BEGIN_HBOX(ctx.dlg); + RND_DAD_LABEL(ctx.dlg, "CRD:"); PCB_DAD_SPIN_COORD(ctx.dlg); - ctx.wspin_coord = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_DEFAULT_NUM(ctx.dlg, PCB_MM_TO_COORD(42)); - PCB_DAD_CHANGE_CB(ctx.dlg, pcb_act_spin_upd); - PCB_DAD_LABEL(ctx.dlg, "->"); - PCB_DAD_LABEL(ctx.dlg, "n/a"); - ctx.wspout_coord = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_END(ctx.dlg); + ctx.wspin_coord = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_DEFAULT_NUM(ctx.dlg, PCB_MM_TO_COORD(42)); + RND_DAD_CHANGE_CB(ctx.dlg, pcb_act_spin_upd); + RND_DAD_LABEL(ctx.dlg, "->"); + RND_DAD_LABEL(ctx.dlg, "n/a"); + ctx.wspout_coord = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_END(ctx.dlg); - PCB_DAD_END(ctx.dlg); + RND_DAD_END(ctx.dlg); - PCB_DAD_ENUM(ctx.dlg, vals); - PCB_DAD_CHANGE_CB(ctx.dlg, pcb_act_attr_chg); - attr_idx = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_INTEGER(ctx.dlg, "text2e"); - PCB_DAD_MINVAL(ctx.dlg, 1); - PCB_DAD_MAXVAL(ctx.dlg, 10); - PCB_DAD_DEFAULT_NUM(ctx.dlg, 3); - PCB_DAD_CHANGE_CB(ctx.dlg, pcb_act_attr_chg); - attr_idx2 = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_BUTTON(ctx.dlg, "update!"); - PCB_DAD_CHANGE_CB(ctx.dlg, pcb_act_attr_chg); - PCB_DAD_END(ctx.dlg); + RND_DAD_ENUM(ctx.dlg, vals); + RND_DAD_CHANGE_CB(ctx.dlg, pcb_act_attr_chg); + attr_idx = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_INTEGER(ctx.dlg, "text2e"); + RND_DAD_MINVAL(ctx.dlg, 1); + RND_DAD_MAXVAL(ctx.dlg, 10); + RND_DAD_DEFAULT_NUM(ctx.dlg, 3); + RND_DAD_CHANGE_CB(ctx.dlg, pcb_act_attr_chg); + attr_idx2 = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_BUTTON(ctx.dlg, "update!"); + RND_DAD_CHANGE_CB(ctx.dlg, pcb_act_attr_chg); + RND_DAD_END(ctx.dlg); /* tab 1: "new test" */ - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_LABEL(ctx.dlg, "new test."); - PCB_DAD_PICTURE(ctx.dlg, test_xpm); - PCB_DAD_BUTTON(ctx.dlg, "jump to the first tab"); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_jump); - PCB_DAD_PICBUTTON(ctx.dlg, test_xpm); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_color_reset); - PCB_DAD_COLOR(ctx.dlg); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_color_print); - ctx.wclr = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_END(ctx.dlg); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_LABEL(ctx.dlg, "new test."); + RND_DAD_PICTURE(ctx.dlg, test_xpm); + RND_DAD_BUTTON(ctx.dlg, "jump to the first tab"); + RND_DAD_CHANGE_CB(ctx.dlg, cb_jump); + RND_DAD_PICBUTTON(ctx.dlg, test_xpm); + RND_DAD_CHANGE_CB(ctx.dlg, cb_color_reset); + RND_DAD_COLOR(ctx.dlg); + RND_DAD_CHANGE_CB(ctx.dlg, cb_color_print); + ctx.wclr = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_END(ctx.dlg); /* tab 2: tree table widget */ - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_TREE(ctx.dlg, 3, 1, hdr); - ctx.tt = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_COMPFLAG(ctx.dlg, RND_HATF_SCROLL); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_ttbl_select); - PCB_DAD_TREE_SET_CB(ctx.dlg, free_cb, cb_ttbl_free_row); - PCB_DAD_TREE_SET_CB(ctx.dlg, selected_cb, cb_ttbl_row_selected); - PCB_DAD_TREE_APPEND(ctx.dlg, NULL, row1); - row = PCB_DAD_TREE_APPEND(ctx.dlg, NULL, row2); - PCB_DAD_TREE_APPEND_UNDER(ctx.dlg, row, row2b); - PCB_DAD_TREE_APPEND(ctx.dlg, NULL, row3); - PCB_DAD_BEGIN_HBOX(ctx.dlg); - PCB_DAD_BUTTON(ctx.dlg, "insert row"); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_ttbl_insert); - PCB_DAD_BUTTON(ctx.dlg, "append row"); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_ttbl_append); - PCB_DAD_BUTTON(ctx.dlg, "jump!"); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_ttbl_jump); - PCB_DAD_BOOL(ctx.dlg, "filter"); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_ttbl_filt); - PCB_DAD_END(ctx.dlg); - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_PROGRESS(ctx.dlg); - ctx.wprog = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_END(ctx.dlg); - PCB_DAD_END(ctx.dlg); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_TREE(ctx.dlg, 3, 1, hdr); + ctx.tt = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_COMPFLAG(ctx.dlg, RND_HATF_SCROLL); + RND_DAD_CHANGE_CB(ctx.dlg, cb_ttbl_select); + RND_DAD_TREE_SET_CB(ctx.dlg, free_cb, cb_ttbl_free_row); + RND_DAD_TREE_SET_CB(ctx.dlg, selected_cb, cb_ttbl_row_selected); + RND_DAD_TREE_APPEND(ctx.dlg, NULL, row1); + row = RND_DAD_TREE_APPEND(ctx.dlg, NULL, row2); + RND_DAD_TREE_APPEND_UNDER(ctx.dlg, row, row2b); + RND_DAD_TREE_APPEND(ctx.dlg, NULL, row3); + RND_DAD_BEGIN_HBOX(ctx.dlg); + RND_DAD_BUTTON(ctx.dlg, "insert row"); + RND_DAD_CHANGE_CB(ctx.dlg, cb_ttbl_insert); + RND_DAD_BUTTON(ctx.dlg, "append row"); + RND_DAD_CHANGE_CB(ctx.dlg, cb_ttbl_append); + RND_DAD_BUTTON(ctx.dlg, "jump!"); + RND_DAD_CHANGE_CB(ctx.dlg, cb_ttbl_jump); + RND_DAD_BOOL(ctx.dlg, "filter"); + RND_DAD_CHANGE_CB(ctx.dlg, cb_ttbl_filt); + RND_DAD_END(ctx.dlg); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_PROGRESS(ctx.dlg); + ctx.wprog = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_END(ctx.dlg); + RND_DAD_END(ctx.dlg); /* tab 3: pane */ - PCB_DAD_BEGIN_HPANE(ctx.dlg); - ctx.whpane = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_LABEL(ctx.dlg, "left1"); - PCB_DAD_LABEL(ctx.dlg, "left2"); - PCB_DAD_END(ctx.dlg); - PCB_DAD_BEGIN_VPANE(ctx.dlg); - ctx.wvpane = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_LABEL(ctx.dlg, "right top1"); - PCB_DAD_LABEL(ctx.dlg, "right top2"); - PCB_DAD_END(ctx.dlg); - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_LABEL(ctx.dlg, "right bottom1"); - PCB_DAD_LABEL(ctx.dlg, "right bottom2"); - PCB_DAD_BUTTON(ctx.dlg, "set all to 30%"); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_pane_set); - PCB_DAD_END(ctx.dlg); - PCB_DAD_END(ctx.dlg); - PCB_DAD_END(ctx.dlg); + RND_DAD_BEGIN_HPANE(ctx.dlg); + ctx.whpane = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_LABEL(ctx.dlg, "left1"); + RND_DAD_LABEL(ctx.dlg, "left2"); + RND_DAD_END(ctx.dlg); + RND_DAD_BEGIN_VPANE(ctx.dlg); + ctx.wvpane = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_LABEL(ctx.dlg, "right top1"); + RND_DAD_LABEL(ctx.dlg, "right top2"); + RND_DAD_END(ctx.dlg); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_LABEL(ctx.dlg, "right bottom1"); + RND_DAD_LABEL(ctx.dlg, "right bottom2"); + RND_DAD_BUTTON(ctx.dlg, "set all to 30%"); + RND_DAD_CHANGE_CB(ctx.dlg, cb_pane_set); + RND_DAD_END(ctx.dlg); + RND_DAD_END(ctx.dlg); + RND_DAD_END(ctx.dlg); /* tab 4: preview */ - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_PREVIEW(ctx.dlg, prv_expose, prv_mouse, NULL, NULL, 200, 200, NULL); - PCB_DAD_LABEL(ctx.dlg, "This is a cool preview widget."); - PCB_DAD_END(ctx.dlg); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_PREVIEW(ctx.dlg, prv_expose, prv_mouse, NULL, NULL, 200, 200, NULL); + RND_DAD_LABEL(ctx.dlg, "This is a cool preview widget."); + RND_DAD_END(ctx.dlg); /* tab 5: text */ - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_TEXT(ctx.dlg, NULL); - PCB_DAD_COMPFLAG(ctx.dlg, RND_HATF_SCROLL | RND_HATF_EXPFILL); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_text_edit); - ctx.wtxt = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_BEGIN_HBOX(ctx.dlg); - PCB_DAD_LABEL(ctx.dlg, ""); - ctx.wtxtpos = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_BUTTON(ctx.dlg, "half the offset"); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_text_offs); - PCB_DAD_END(ctx.dlg); - PCB_DAD_BEGIN_HBOX(ctx.dlg); - PCB_DAD_BUTTON(ctx.dlg, "replace"); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_text_replace); - PCB_DAD_BUTTON(ctx.dlg, "insert"); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_text_insert); - PCB_DAD_BUTTON(ctx.dlg, "append"); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_text_append); - PCB_DAD_BUTTON(ctx.dlg, "get"); - PCB_DAD_CHANGE_CB(ctx.dlg, cb_text_get); - PCB_DAD_BUTTON(ctx.dlg, "ro"); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_COMPFLAG(ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_TEXT(ctx.dlg, NULL); + RND_DAD_COMPFLAG(ctx.dlg, RND_HATF_SCROLL | RND_HATF_EXPFILL); + RND_DAD_CHANGE_CB(ctx.dlg, cb_text_edit); + ctx.wtxt = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_BEGIN_HBOX(ctx.dlg); + RND_DAD_LABEL(ctx.dlg, ""); + ctx.wtxtpos = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_BUTTON(ctx.dlg, "half the offset"); + RND_DAD_CHANGE_CB(ctx.dlg, cb_text_offs); + RND_DAD_END(ctx.dlg); + RND_DAD_BEGIN_HBOX(ctx.dlg); + RND_DAD_BUTTON(ctx.dlg, "replace"); + RND_DAD_CHANGE_CB(ctx.dlg, cb_text_replace); + RND_DAD_BUTTON(ctx.dlg, "insert"); + RND_DAD_CHANGE_CB(ctx.dlg, cb_text_insert); + RND_DAD_BUTTON(ctx.dlg, "append"); + RND_DAD_CHANGE_CB(ctx.dlg, cb_text_append); + RND_DAD_BUTTON(ctx.dlg, "get"); + RND_DAD_CHANGE_CB(ctx.dlg, cb_text_get); + RND_DAD_BUTTON(ctx.dlg, "ro"); ctx.txtro = 0; - PCB_DAD_CHANGE_CB(ctx.dlg, cb_text_ro); - PCB_DAD_END(ctx.dlg); - PCB_DAD_END(ctx.dlg); + RND_DAD_CHANGE_CB(ctx.dlg, cb_text_ro); + RND_DAD_END(ctx.dlg); + RND_DAD_END(ctx.dlg); - PCB_DAD_END(ctx.dlg); - PCB_DAD_BUTTON_CLOSES(ctx.dlg, clbtn); - PCB_DAD_END(ctx.dlg); + RND_DAD_END(ctx.dlg); + RND_DAD_BUTTON_CLOSES(ctx.dlg, clbtn); + RND_DAD_END(ctx.dlg); - PCB_DAD_AUTORUN("dlg_test", ctx.dlg, "attribute dialog test", &ctx, failed); + RND_DAD_AUTORUN("dlg_test", ctx.dlg, "attribute dialog test", &ctx, failed); if (failed != 0) rnd_message(RND_MSG_WARNING, "Test dialog cancelled"); - PCB_DAD_FREE(ctx.dlg); + RND_DAD_FREE(ctx.dlg); RND_ACT_IRES(0); return 0; @@ -354,7 +354,7 @@ rnd_hid_attr_val_t val; rowdata[0] = pcb_strdup_printf("dyn_%d", ctx->ttctr++); - new_row = pcb_dad_tree_insert(treea, row, rowdata); + new_row = rnd_dad_tree_insert(treea, row, rowdata); new_row->user_data2.lng = 1; val.dbl = (double)ctx->ttctr / 20.0; @@ -370,7 +370,7 @@ rnd_hid_attr_val_t val; rowdata[0] = pcb_strdup_printf("dyn_%d", ctx->ttctr++); - new_row = pcb_dad_tree_append(treea, row, rowdata); + new_row = rnd_dad_tree_append(treea, row, rowdata); new_row->user_data2.lng = 1; val.dbl = (double)ctx->ttctr / 20.0; Index: trunk/src_plugins/dialogs/dlg_undo.c =================================================================== --- trunk/src_plugins/dialogs/dlg_undo.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_undo.c (revision 30992) @@ -31,7 +31,7 @@ const char *dlg_undo_cookie = "undo dialog"; typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int wlist; long serial; /* last seen undo serial, for updating the dialog on change */ int active; /* already open - allow only one instance */ @@ -44,7 +44,7 @@ static void undo_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) { undo_ctx_t *ctx = caller_data; - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); memset(ctx, 0, sizeof(undo_ctx_t)); } @@ -103,7 +103,7 @@ cell[0] = rnd_strdup(ser); cell[1] = rnd_strdup(mark); cell[2] = rnd_strdup(payload); - pcb_dad_tree_append(attr, NULL, cell); + rnd_dad_tree_append(attr, NULL, cell); } /* restore cursor */ @@ -118,33 +118,33 @@ static void pcb_dlg_undo(void) { static const char *hdr[] = {"serial", "flg", "operation", NULL}; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (undo_ctx.active) return; /* do not open another */ - PCB_DAD_BEGIN_VBOX(undo_ctx.dlg); - PCB_DAD_COMPFLAG(undo_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_TREE(undo_ctx.dlg, 3, 0, hdr); - PCB_DAD_COMPFLAG(undo_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - undo_ctx.wlist = PCB_DAD_CURRENT(undo_ctx.dlg); + RND_DAD_BEGIN_VBOX(undo_ctx.dlg); + RND_DAD_COMPFLAG(undo_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_TREE(undo_ctx.dlg, 3, 0, hdr); + RND_DAD_COMPFLAG(undo_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + undo_ctx.wlist = RND_DAD_CURRENT(undo_ctx.dlg); - PCB_DAD_BEGIN_HBOX(undo_ctx.dlg); - PCB_DAD_BUTTON(undo_ctx.dlg, "Undo"); - PCB_DAD_CHANGE_CB(undo_ctx.dlg, cb_undo); - PCB_DAD_BUTTON(undo_ctx.dlg, "Redo"); - PCB_DAD_CHANGE_CB(undo_ctx.dlg, cb_redo); - PCB_DAD_BUTTON(undo_ctx.dlg, "Clear"); - PCB_DAD_CHANGE_CB(undo_ctx.dlg, cb_clear); - PCB_DAD_END(undo_ctx.dlg); - PCB_DAD_BUTTON_CLOSES(undo_ctx.dlg, clbtn); - PCB_DAD_END(undo_ctx.dlg); + RND_DAD_BEGIN_HBOX(undo_ctx.dlg); + RND_DAD_BUTTON(undo_ctx.dlg, "Undo"); + RND_DAD_CHANGE_CB(undo_ctx.dlg, cb_undo); + RND_DAD_BUTTON(undo_ctx.dlg, "Redo"); + RND_DAD_CHANGE_CB(undo_ctx.dlg, cb_redo); + RND_DAD_BUTTON(undo_ctx.dlg, "Clear"); + RND_DAD_CHANGE_CB(undo_ctx.dlg, cb_clear); + RND_DAD_END(undo_ctx.dlg); + RND_DAD_BUTTON_CLOSES(undo_ctx.dlg, clbtn); + RND_DAD_END(undo_ctx.dlg); /* set up the context */ undo_ctx.active = 1; - PCB_DAD_DEFSIZE(undo_ctx.dlg, 300, 400); - PCB_DAD_NEW("undo", undo_ctx.dlg, "pcb-rnd undo list", &undo_ctx, pcb_false, undo_close_cb); + RND_DAD_DEFSIZE(undo_ctx.dlg, 300, 400); + RND_DAD_NEW("undo", undo_ctx.dlg, "pcb-rnd undo list", &undo_ctx, pcb_false, undo_close_cb); undo_data2dlg(&undo_ctx); } Index: trunk/src_plugins/dialogs/dlg_view.c =================================================================== --- trunk/src_plugins/dialogs/dlg_view.c (revision 30991) +++ trunk/src_plugins/dialogs/dlg_view.c (revision 30992) @@ -50,7 +50,7 @@ typedef struct view_ctx_s view_ctx_t; struct view_ctx_s { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) pcb_board_t *pcb; pcb_view_list_t *lst; pcb_view_list_t lst_local; @@ -72,7 +72,7 @@ { view_ctx_t *ctx = caller_data; - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); if (ctx->list_alloced) { pcb_view_list_free(ctx->lst); ctx->lst = NULL; @@ -110,13 +110,13 @@ if (rt == NULL) { cell[0] = rnd_strdup(v->type); cell[1] = rnd_strdup(""); - rt = pcb_dad_tree_append(attr, NULL, cell); + rt = rnd_dad_tree_append(attr, NULL, cell); rt->user_data2.lng = 0; } cell[0] = pcb_strdup_printf("%lu", v->uid); cell[1] = rnd_strdup(v->title); - r = pcb_dad_tree_append_under(attr, rt, cell); + r = rnd_dad_tree_append_under(attr, rt, cell); r->user_data2.lng = v->uid; pcb_dad_tree_expcoll(attr, rt, 1, 0); } @@ -138,10 +138,10 @@ if (cnt >= 0) { char tmp[32]; sprintf(tmp, "%ld", cnt+1); - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wpos, str, rnd_strdup(tmp)); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wpos, str, rnd_strdup(tmp)); } else - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wpos, str, rnd_strdup("")); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wpos, str, rnd_strdup("")); } static void view2dlg_count(view_ctx_t *ctx) @@ -149,7 +149,7 @@ char tmp[32]; sprintf(tmp, "%ld", (long)pcb_view_list_length(ctx->lst)); - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wcount, str, rnd_strdup(tmp)); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wcount, str, rnd_strdup(tmp)); } static void view2dlg(view_ctx_t *ctx) @@ -168,16 +168,16 @@ pcb_view_t *v = pcb_view_by_uid(ctx->lst, ctx->selected); if (v != NULL) { pcb_view_goto(v); - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wdescription, str, pcb_text_wrap(rnd_strdup(v->description), 32, '\n', ' ')); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wdescription, str, pcb_text_wrap(rnd_strdup(v->description), 32, '\n', ' ')); switch(v->data_type) { case PCB_VIEW_PLAIN: - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wmeasure, str, rnd_strdup("")); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wmeasure, str, rnd_strdup("")); break; case PCB_VIEW_DRC: if (v->data.drc.have_measured) - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wmeasure, str, pcb_strdup_printf("DRC: %m+required: %$ms\nmeasured: %$ms\n", pcbhl_conf.editor.grid_unit->allow, v->data.drc.required_value, v->data.drc.measured_value)); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wmeasure, str, pcb_strdup_printf("DRC: %m+required: %$ms\nmeasured: %$ms\n", pcbhl_conf.editor.grid_unit->allow, v->data.drc.required_value, v->data.drc.measured_value)); else - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wmeasure, str, pcb_strdup_printf("DRC: %m+required: %$ms\n", pcbhl_conf.editor.grid_unit->allow, v->data.drc.required_value)); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wmeasure, str, pcb_strdup_printf("DRC: %m+required: %$ms\n", pcbhl_conf.editor.grid_unit->allow, v->data.drc.required_value)); break; } } @@ -184,11 +184,11 @@ if (v == NULL) { ctx->selected = 0; - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wdescription, str, rnd_strdup("")); - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wmeasure, str, rnd_strdup("")); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wdescription, str, rnd_strdup("")); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wmeasure, str, rnd_strdup("")); } else - pcb_dad_preview_zoomto(&ctx->dlg[ctx->wprev], &v->bbox); + rnd_dad_preview_zoomto(&ctx->dlg[ctx->wprev], &v->bbox); } static void view_select(rnd_hid_attribute_t *attrib, void *hid_ctx, rnd_hid_row_t *row) @@ -288,7 +288,7 @@ static void view_close_btn_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) { view_ctx_t *ctx = caller_data; - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); } static void view_stepped(view_ctx_t *ctx, pcb_view_t *v) @@ -587,74 +587,74 @@ ctx->wpos = -1; - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HPANE(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_HPANE(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); /* left */ - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Number of violations:"); - PCB_DAD_LABEL(ctx->dlg, "n/a"); - ctx->wcount = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Number of violations:"); + RND_DAD_LABEL(ctx->dlg, "n/a"); + ctx->wcount = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_TREE(ctx->dlg, 2, 1, hdr); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_SCROLL | RND_HATF_EXPFILL); - PCB_DAD_TREE_SET_CB(ctx->dlg, selected_cb, view_select); - PCB_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); - ctx->wlist = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_TREE(ctx->dlg, 2, 1, hdr); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_SCROLL | RND_HATF_EXPFILL); + RND_DAD_TREE_SET_CB(ctx->dlg, selected_cb, view_select); + RND_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); + ctx->wlist = RND_DAD_CURRENT(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Copy"); - PCB_DAD_CHANGE_CB(ctx->dlg, view_copy_btn_cb); - PCB_DAD_BUTTON(ctx->dlg, "Cut"); - ctx->wbtn_cut = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, view_copy_btn_cb); - PCB_DAD_BUTTON(ctx->dlg, "Paste"); - PCB_DAD_CHANGE_CB(ctx->dlg, view_paste_btn_cb); - PCB_DAD_BUTTON(ctx->dlg, "Del"); - PCB_DAD_CHANGE_CB(ctx->dlg, view_del_btn_cb); - PCB_DAD_BUTTON(ctx->dlg, "Select"); - PCB_DAD_CHANGE_CB(ctx->dlg, view_select_btn_cb); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Copy"); + RND_DAD_CHANGE_CB(ctx->dlg, view_copy_btn_cb); + RND_DAD_BUTTON(ctx->dlg, "Cut"); + ctx->wbtn_cut = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, view_copy_btn_cb); + RND_DAD_BUTTON(ctx->dlg, "Paste"); + RND_DAD_CHANGE_CB(ctx->dlg, view_paste_btn_cb); + RND_DAD_BUTTON(ctx->dlg, "Del"); + RND_DAD_CHANGE_CB(ctx->dlg, view_del_btn_cb); + RND_DAD_BUTTON(ctx->dlg, "Select"); + RND_DAD_CHANGE_CB(ctx->dlg, view_select_btn_cb); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); /* right */ - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_PREVIEW(ctx->dlg, view_expose_cb, view_mouse_cb, NULL, NULL, 100, 100, ctx); - ctx->wprev = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_PRV_BOARD); - PCB_DAD_LABEL(ctx->dlg, "(description)"); - ctx->wdescription = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "(measure)"); - ctx->wmeasure = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_PREVIEW(ctx->dlg, view_expose_cb, view_mouse_cb, NULL, NULL, 100, 100, ctx); + ctx->wprev = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_PRV_BOARD); + RND_DAD_LABEL(ctx->dlg, "(description)"); + ctx->wdescription = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "(measure)"); + ctx->wmeasure = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Save all"); - PCB_DAD_CHANGE_CB(ctx->dlg, view_save_btn_cb); - PCB_DAD_BUTTON(ctx->dlg, "Load all"); - PCB_DAD_CHANGE_CB(ctx->dlg, view_load_btn_cb); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Save all"); + RND_DAD_CHANGE_CB(ctx->dlg, view_save_btn_cb); + RND_DAD_BUTTON(ctx->dlg, "Load all"); + RND_DAD_CHANGE_CB(ctx->dlg, view_load_btn_cb); if (ctx->refresh != NULL) { - PCB_DAD_BUTTON(ctx->dlg, "Refresh"); - PCB_DAD_CHANGE_CB(ctx->dlg, view_refresh_btn_cb); + RND_DAD_BUTTON(ctx->dlg, "Refresh"); + RND_DAD_CHANGE_CB(ctx->dlg, view_refresh_btn_cb); } - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Close"); - PCB_DAD_CHANGE_CB(ctx->dlg, view_close_btn_cb); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Close"); + RND_DAD_CHANGE_CB(ctx->dlg, view_close_btn_cb); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_NEW(id, ctx->dlg, title, ctx, pcb_false, view_close_cb); + RND_DAD_NEW(id, ctx->dlg, title, ctx, pcb_false, view_close_cb); ctx->active = 1; } @@ -665,54 +665,54 @@ ctx->wlist = -1; - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_PREVIEW(ctx->dlg, view_expose_cb, view_mouse_cb, NULL, NULL, 100, 100, ctx); - ctx->wprev = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_PRV_BOARD); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "(description)"); - ctx->wdescription = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "(measure)"); - ctx->wmeasure = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_PREVIEW(ctx->dlg, view_expose_cb, view_mouse_cb, NULL, NULL, 100, 100, ctx); + ctx->wprev = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_PRV_BOARD); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "(description)"); + ctx->wdescription = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "(measure)"); + ctx->wmeasure = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Previous"); - PCB_DAD_CHANGE_CB(ctx->dlg, view_prev_btn_cb); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(ctx->dlg, "na"); - ctx->wpos = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "/"); - PCB_DAD_LABEL(ctx->dlg, "na"); - ctx->wcount = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Del"); - PCB_DAD_CHANGE_CB(ctx->dlg, view_del_btn_cb); - PCB_DAD_BUTTON(ctx->dlg, "Next"); - PCB_DAD_CHANGE_CB(ctx->dlg, view_next_btn_cb); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Previous"); + RND_DAD_CHANGE_CB(ctx->dlg, view_prev_btn_cb); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(ctx->dlg, "na"); + ctx->wpos = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "/"); + RND_DAD_LABEL(ctx->dlg, "na"); + ctx->wcount = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Del"); + RND_DAD_CHANGE_CB(ctx->dlg, view_del_btn_cb); + RND_DAD_BUTTON(ctx->dlg, "Next"); + RND_DAD_CHANGE_CB(ctx->dlg, view_next_btn_cb); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); if (ctx->refresh != NULL) { - PCB_DAD_BUTTON(ctx->dlg, "Refresh"); - PCB_DAD_CHANGE_CB(ctx->dlg, view_refresh_btn_cb); + RND_DAD_BUTTON(ctx->dlg, "Refresh"); + RND_DAD_CHANGE_CB(ctx->dlg, view_refresh_btn_cb); } - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Close"); - PCB_DAD_CHANGE_CB(ctx->dlg, view_close_btn_cb); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Close"); + RND_DAD_CHANGE_CB(ctx->dlg, view_close_btn_cb); + RND_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_NEW(id, ctx->dlg, title, ctx, pcb_false, view_close_cb); + RND_DAD_NEW(id, ctx->dlg, title, ctx, pcb_false, view_close_cb); ctx->active = 1; Index: trunk/src_plugins/drc_query/dlg.c =================================================================== --- trunk/src_plugins/drc_query/dlg.c (revision 30991) +++ trunk/src_plugins/drc_query/dlg.c (revision 30992) @@ -40,7 +40,7 @@ static void rlist_select(rnd_hid_attribute_t *attrib, void *hid_ctx, rnd_hid_row_t *row); typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) rnd_conf_role_t role; char *rule, *path; int wtype, wtitle, wdisable, wdesc, wquery, wsave, wsaveroles; @@ -61,7 +61,7 @@ free(ctx->path); free(ctx->rule); - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); free(ctx); } @@ -77,7 +77,7 @@ static void drc_rule_pcb2dlg(rule_edit_ctx_t *ctx) { - pcb_dad_retovr_t retovr; + rnd_dad_retovr_t retovr; lht_node_t *nd = rnd_conf_lht_get_at_mainplug(ctx->role, ctx->path, 1, 0); if (nd != NULL) { rnd_hid_attribute_t *atxt = &ctx->dlg[ctx->wquery]; @@ -88,16 +88,16 @@ if (dis == NULL) dis = &dis_; - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wtype, str, textval(nd, "type")); - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wtitle, str, textval(nd, "title")); - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wdisable, str, *dis ? "yes" : "no"); - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wdesc, str, textval(nd, "desc")); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wtype, str, textval(nd, "type")); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wtitle, str, textval(nd, "title")); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wdisable, str, *dis ? "yes" : "no"); + RND_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wdesc, str, textval(nd, "desc")); txt->hid_set_text(atxt, ctx->dlg_hid_ctx, RND_HID_TEXT_REPLACE, textval(nd, "query")); } else { rnd_message(RND_MSG_ERROR, "Rule %s disappeared from the config tree.\n", ctx->rule); - pcb_hid_dad_close(ctx->dlg_hid_ctx, &retovr, -1); + rnd_hid_dad_close(ctx->dlg_hid_ctx, &retovr, -1); } } @@ -221,7 +221,7 @@ static int pcb_dlg_rule_edit(rnd_conf_role_t role, const char *rule) { - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; char *info, *path; rule_edit_ctx_t *ctx; lht_node_t *nd; @@ -258,64 +258,64 @@ } info = pcb_strdup_printf("DRC rule edit: %s on role %s", rule, rnd_conf_role_name(role)); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(ctx->dlg, info); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "DRC violation type (group):"); - PCB_DAD_STRING(ctx->dlg); - PCB_DAD_WIDTH_CHR(ctx->dlg, 24); - ctx->wtype = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "DRC violation title:"); - PCB_DAD_STRING(ctx->dlg); - PCB_DAD_WIDTH_CHR(ctx->dlg, 32); - ctx->wtitle = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Disable drc rule:"); - PCB_DAD_BOOL(ctx->dlg, ""); - ctx->wdisable = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "DRC violation description:"); - PCB_DAD_STRING(ctx->dlg); - PCB_DAD_WIDTH_CHR(ctx->dlg, 48); - ctx->wdesc = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(ctx->dlg, info); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "DRC violation type (group):"); + RND_DAD_STRING(ctx->dlg); + RND_DAD_WIDTH_CHR(ctx->dlg, 24); + ctx->wtype = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "DRC violation title:"); + RND_DAD_STRING(ctx->dlg); + RND_DAD_WIDTH_CHR(ctx->dlg, 32); + ctx->wtitle = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Disable drc rule:"); + RND_DAD_BOOL(ctx->dlg, ""); + ctx->wdisable = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "DRC violation description:"); + RND_DAD_STRING(ctx->dlg); + RND_DAD_WIDTH_CHR(ctx->dlg, 48); + ctx->wdesc = RND_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "DRC rule query script:"); - PCB_DAD_TEXT(ctx->dlg, ctx); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - ctx->wquery = PCB_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "DRC rule query script:"); + RND_DAD_TEXT(ctx->dlg, ctx); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + ctx->wquery = RND_DAD_CURRENT(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "Run"); - PCB_DAD_CHANGE_CB(ctx->dlg, rule_btn_run_cb); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "Run"); + RND_DAD_CHANGE_CB(ctx->dlg, rule_btn_run_cb); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME | RND_HATF_TIGHT); - PCB_DAD_BUTTON(ctx->dlg, "Save"); - PCB_DAD_CHANGE_CB(ctx->dlg, rule_btn_save_cb); - ctx->wsave = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_HELP(ctx->dlg, "Save rule at the selected conf role\nFor roles other than 'user', a full copy of all drc rules are saved!\n"); - PCB_DAD_ENUM(ctx->dlg, save_roles); - ctx->wsaveroles = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_DEFAULT_NUM(ctx->dlg, srolei); - PCB_DAD_HELP(ctx->dlg, "Save rule at the selected conf role\nFor roles other than 'user', a full copy of all drc rules are saved!\n"); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME | RND_HATF_TIGHT); + RND_DAD_BUTTON(ctx->dlg, "Save"); + RND_DAD_CHANGE_CB(ctx->dlg, rule_btn_save_cb); + ctx->wsave = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_HELP(ctx->dlg, "Save rule at the selected conf role\nFor roles other than 'user', a full copy of all drc rules are saved!\n"); + RND_DAD_ENUM(ctx->dlg, save_roles); + ctx->wsaveroles = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_DEFAULT_NUM(ctx->dlg, srolei); + RND_DAD_HELP(ctx->dlg, "Save rule at the selected conf role\nFor roles other than 'user', a full copy of all drc rules are saved!\n"); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); free(info); - PCB_DAD_DEFSIZE(ctx->dlg, 200, 400); - PCB_DAD_NEW("drc_query_rule_edit", ctx->dlg, "drc_query: rule editor", ctx, pcb_false, rule_edit_close_cb); + RND_DAD_DEFSIZE(ctx->dlg, 200, 400); + RND_DAD_NEW("drc_query_rule_edit", ctx->dlg, "drc_query: rule editor", ctx, pcb_false, rule_edit_close_cb); drc_rule_pcb2dlg(ctx); @@ -347,7 +347,7 @@ typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int active; /* already open - allow only one instance */ int wlist, wrule, wtype, wtitle, wdesc, wstat; } drc_rlist_ctx_t; @@ -357,7 +357,7 @@ static void drc_rlist_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) { drc_rlist_ctx_t *ctx = caller_data; - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); memset(ctx, 0, sizeof(drc_rlist_ctx_t)); /* reset all states to the initial - includes ctx->active = 0; */ } @@ -409,7 +409,7 @@ cell[3] = pcb_strdup_printf("%.3fs", st->last_run_time); else cell[3] = "-"; - pcb_dad_tree_append(attr, NULL, cell); + rnd_dad_tree_append(attr, NULL, cell); } /* restore cursor */ @@ -554,73 +554,73 @@ static int pcb_dlg_drc_rlist(void) { const char *lst_hdr[] = {"rule name", "role", "disabled", "cost", NULL}; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; int wpane; if (drc_rlist_ctx.active) return 0; /* do not open another */ - PCB_DAD_BEGIN_VBOX(drc_rlist_ctx.dlg); - PCB_DAD_COMPFLAG(drc_rlist_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HPANE(drc_rlist_ctx.dlg); - wpane = PCB_DAD_CURRENT(drc_rlist_ctx.dlg); + RND_DAD_BEGIN_VBOX(drc_rlist_ctx.dlg); + RND_DAD_COMPFLAG(drc_rlist_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_HPANE(drc_rlist_ctx.dlg); + wpane = RND_DAD_CURRENT(drc_rlist_ctx.dlg); - PCB_DAD_BEGIN_VBOX(drc_rlist_ctx.dlg); /* left */ - PCB_DAD_COMPFLAG(drc_rlist_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(drc_rlist_ctx.dlg, "Rules available:"); - PCB_DAD_TREE(drc_rlist_ctx.dlg, 4, 0, lst_hdr); - PCB_DAD_COMPFLAG(drc_rlist_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - drc_rlist_ctx.wlist = PCB_DAD_CURRENT(drc_rlist_ctx.dlg); - PCB_DAD_TREE_SET_CB(drc_rlist_ctx.dlg, selected_cb, rlist_select); - PCB_DAD_TREE_SET_CB(drc_rlist_ctx.dlg, ctx, &drc_rlist_ctx); - PCB_DAD_BEGIN_HBOX(drc_rlist_ctx.dlg); - PCB_DAD_BUTTON(drc_rlist_ctx.dlg, "Run"); - PCB_DAD_CHANGE_CB(drc_rlist_ctx.dlg, rlist_btn_run_cb); - PCB_DAD_BUTTON(drc_rlist_ctx.dlg, "Edit..."); - PCB_DAD_CHANGE_CB(drc_rlist_ctx.dlg, rlist_btn_edit_cb); - PCB_DAD_BUTTON(drc_rlist_ctx.dlg, "Toggle disable"); - PCB_DAD_CHANGE_CB(drc_rlist_ctx.dlg, rlist_btn_toggle_cb); - PCB_DAD_END(drc_rlist_ctx.dlg); - PCB_DAD_END(drc_rlist_ctx.dlg); + RND_DAD_BEGIN_VBOX(drc_rlist_ctx.dlg); /* left */ + RND_DAD_COMPFLAG(drc_rlist_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(drc_rlist_ctx.dlg, "Rules available:"); + RND_DAD_TREE(drc_rlist_ctx.dlg, 4, 0, lst_hdr); + RND_DAD_COMPFLAG(drc_rlist_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + drc_rlist_ctx.wlist = RND_DAD_CURRENT(drc_rlist_ctx.dlg); + RND_DAD_TREE_SET_CB(drc_rlist_ctx.dlg, selected_cb, rlist_select); + RND_DAD_TREE_SET_CB(drc_rlist_ctx.dlg, ctx, &drc_rlist_ctx); + RND_DAD_BEGIN_HBOX(drc_rlist_ctx.dlg); + RND_DAD_BUTTON(drc_rlist_ctx.dlg, "Run"); + RND_DAD_CHANGE_CB(drc_rlist_ctx.dlg, rlist_btn_run_cb); + RND_DAD_BUTTON(drc_rlist_ctx.dlg, "Edit..."); + RND_DAD_CHANGE_CB(drc_rlist_ctx.dlg, rlist_btn_edit_cb); + RND_DAD_BUTTON(drc_rlist_ctx.dlg, "Toggle disable"); + RND_DAD_CHANGE_CB(drc_rlist_ctx.dlg, rlist_btn_toggle_cb); + RND_DAD_END(drc_rlist_ctx.dlg); + RND_DAD_END(drc_rlist_ctx.dlg); - PCB_DAD_BEGIN_VBOX(drc_rlist_ctx.dlg); /* right */ - PCB_DAD_COMPFLAG(drc_rlist_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HBOX(drc_rlist_ctx.dlg); - PCB_DAD_LABEL(drc_rlist_ctx.dlg, "Rule: "); - PCB_DAD_LABEL(drc_rlist_ctx.dlg, ""); - drc_rlist_ctx.wrule = PCB_DAD_CURRENT(drc_rlist_ctx.dlg); - PCB_DAD_END(drc_rlist_ctx.dlg); + RND_DAD_BEGIN_VBOX(drc_rlist_ctx.dlg); /* right */ + RND_DAD_COMPFLAG(drc_rlist_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_HBOX(drc_rlist_ctx.dlg); + RND_DAD_LABEL(drc_rlist_ctx.dlg, "Rule: "); + RND_DAD_LABEL(drc_rlist_ctx.dlg, ""); + drc_rlist_ctx.wrule = RND_DAD_CURRENT(drc_rlist_ctx.dlg); + RND_DAD_END(drc_rlist_ctx.dlg); - PCB_DAD_BEGIN_VBOX(drc_rlist_ctx.dlg); - PCB_DAD_COMPFLAG(drc_rlist_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - PCB_DAD_LABEL(drc_rlist_ctx.dlg, "Type/group:"); - PCB_DAD_LABEL(drc_rlist_ctx.dlg, "-"); - drc_rlist_ctx.wtype = PCB_DAD_CURRENT(drc_rlist_ctx.dlg); - PCB_DAD_LABEL(drc_rlist_ctx.dlg, ""); - PCB_DAD_LABEL(drc_rlist_ctx.dlg, "Title:"); - PCB_DAD_LABEL(drc_rlist_ctx.dlg, "-"); - drc_rlist_ctx.wtitle = PCB_DAD_CURRENT(drc_rlist_ctx.dlg); - PCB_DAD_LABEL(drc_rlist_ctx.dlg, ""); - PCB_DAD_LABEL(drc_rlist_ctx.dlg, "Description:"); - PCB_DAD_LABEL(drc_rlist_ctx.dlg, "-"); - drc_rlist_ctx.wdesc = PCB_DAD_CURRENT(drc_rlist_ctx.dlg); - PCB_DAD_LABEL(drc_rlist_ctx.dlg, ""); - PCB_DAD_LABEL(drc_rlist_ctx.dlg, "Statistics:"); - PCB_DAD_LABEL(drc_rlist_ctx.dlg, "-"); - drc_rlist_ctx.wstat = PCB_DAD_CURRENT(drc_rlist_ctx.dlg); - PCB_DAD_END(drc_rlist_ctx.dlg); - PCB_DAD_END(drc_rlist_ctx.dlg); + RND_DAD_BEGIN_VBOX(drc_rlist_ctx.dlg); + RND_DAD_COMPFLAG(drc_rlist_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + RND_DAD_LABEL(drc_rlist_ctx.dlg, "Type/group:"); + RND_DAD_LABEL(drc_rlist_ctx.dlg, "-"); + drc_rlist_ctx.wtype = RND_DAD_CURRENT(drc_rlist_ctx.dlg); + RND_DAD_LABEL(drc_rlist_ctx.dlg, ""); + RND_DAD_LABEL(drc_rlist_ctx.dlg, "Title:"); + RND_DAD_LABEL(drc_rlist_ctx.dlg, "-"); + drc_rlist_ctx.wtitle = RND_DAD_CURRENT(drc_rlist_ctx.dlg); + RND_DAD_LABEL(drc_rlist_ctx.dlg, ""); + RND_DAD_LABEL(drc_rlist_ctx.dlg, "Description:"); + RND_DAD_LABEL(drc_rlist_ctx.dlg, "-"); + drc_rlist_ctx.wdesc = RND_DAD_CURRENT(drc_rlist_ctx.dlg); + RND_DAD_LABEL(drc_rlist_ctx.dlg, ""); + RND_DAD_LABEL(drc_rlist_ctx.dlg, "Statistics:"); + RND_DAD_LABEL(drc_rlist_ctx.dlg, "-"); + drc_rlist_ctx.wstat = RND_DAD_CURRENT(drc_rlist_ctx.dlg); + RND_DAD_END(drc_rlist_ctx.dlg); + RND_DAD_END(drc_rlist_ctx.dlg); - PCB_DAD_END(drc_rlist_ctx.dlg); - PCB_DAD_BUTTON_CLOSES(drc_rlist_ctx.dlg, clbtn); - PCB_DAD_END(drc_rlist_ctx.dlg); + RND_DAD_END(drc_rlist_ctx.dlg); + RND_DAD_BUTTON_CLOSES(drc_rlist_ctx.dlg, clbtn); + RND_DAD_END(drc_rlist_ctx.dlg); /* set up the context */ drc_rlist_ctx.active = 1; - PCB_DAD_DEFSIZE(drc_rlist_ctx.dlg, 550, 400); - PCB_DAD_NEW("drc_query_list", drc_rlist_ctx.dlg, "drc_query: list of rules", &drc_rlist_ctx, pcb_false, drc_rlist_close_cb); - PCB_DAD_SET_VALUE(drc_rlist_ctx.dlg_hid_ctx, wpane, dbl, 0.5); + RND_DAD_DEFSIZE(drc_rlist_ctx.dlg, 550, 400); + RND_DAD_NEW("drc_query_list", drc_rlist_ctx.dlg, "drc_query: list of rules", &drc_rlist_ctx, pcb_false, drc_rlist_close_cb); + RND_DAD_SET_VALUE(drc_rlist_ctx.dlg_hid_ctx, wpane, dbl, 0.5); drc_rlist_pcb2dlg(); return 0; } Index: trunk/src_plugins/export_gerber/gerber.c =================================================================== --- trunk/src_plugins/export_gerber/gerber.c (revision 30991) +++ trunk/src_plugins/export_gerber/gerber.c (revision 30992) @@ -1009,8 +1009,8 @@ static void gerber_go_to_cam_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) { - pcb_dad_retovr_t retovr; - pcb_hid_dad_close(hid_ctx, &retovr, -1); + rnd_dad_retovr_t retovr; + rnd_hid_dad_close(hid_ctx, &retovr, -1); rnd_actionva(&PCB->hidlib, "cam", NULL); } @@ -1034,18 +1034,18 @@ fprintf((FILE *)call_ctx, "******************************************************************************\n\n"); break; case RND_HIDEOF_DAD: - PCB_DAD_BEGIN_VBOX(dad->dlg); - PCB_DAD_COMPFLAG(dad->dlg, RND_HATF_EXPFILL | RND_HATF_FRAME); - PCB_DAD_BEGIN_HBOX(dad->dlg); - PCB_DAD_PICTURE(dad->dlg, pcp_dlg_xpm_by_name("warning")); - PCB_DAD_BEGIN_VBOX(dad->dlg); - PCB_DAD_LABEL(dad->dlg, warn_txt); - PCB_DAD_BUTTON(dad->dlg, "Get me to the cam export dialog"); - PCB_DAD_CHANGE_CB(dad->dlg, gerber_go_to_cam_cb); - PCB_DAD_LABEL(dad->dlg, ""); - PCB_DAD_END(dad->dlg); - PCB_DAD_END(dad->dlg); - PCB_DAD_END(dad->dlg); + RND_DAD_BEGIN_VBOX(dad->dlg); + RND_DAD_COMPFLAG(dad->dlg, RND_HATF_EXPFILL | RND_HATF_FRAME); + RND_DAD_BEGIN_HBOX(dad->dlg); + RND_DAD_PICTURE(dad->dlg, pcp_dlg_xpm_by_name("warning")); + RND_DAD_BEGIN_VBOX(dad->dlg); + RND_DAD_LABEL(dad->dlg, warn_txt); + RND_DAD_BUTTON(dad->dlg, "Get me to the cam export dialog"); + RND_DAD_CHANGE_CB(dad->dlg, gerber_go_to_cam_cb); + RND_DAD_LABEL(dad->dlg, ""); + RND_DAD_END(dad->dlg); + RND_DAD_END(dad->dlg); + RND_DAD_END(dad->dlg); break; } } Index: trunk/src_plugins/export_openems/excitation.c =================================================================== --- trunk/src_plugins/export_openems/excitation.c (revision 30991) +++ trunk/src_plugins/export_openems/excitation.c (revision 30992) @@ -38,7 +38,7 @@ } exc_data_t; typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int active; /* already open - allow only one instance */ int wselector, wtab; int selected; @@ -163,22 +163,22 @@ /** gaussian **/ static void exc_gaus_dad(int idx) { - PCB_DAD_BEGIN_TABLE(exc_ctx.dlg, 2); - PCB_DAD_LABEL(exc_ctx.dlg, "fc"); + RND_DAD_BEGIN_TABLE(exc_ctx.dlg, 2); + RND_DAD_LABEL(exc_ctx.dlg, "fc"); PCB_DAD_SPIN_FREQ(exc_ctx.dlg); - PCB_DAD_MINMAX(exc_ctx.dlg, 0, FREQ_MAX); - PCB_DAD_HELP(exc_ctx.dlg, "20db Cutoff Frequency\nbandwidth is 2*fc"); - PCB_DAD_CHANGE_CB(exc_ctx.dlg, exc_val_chg_cb); - exc_ctx.exc_data[idx].w[I_FC] = PCB_DAD_CURRENT(exc_ctx.dlg); + RND_DAD_MINMAX(exc_ctx.dlg, 0, FREQ_MAX); + RND_DAD_HELP(exc_ctx.dlg, "20db Cutoff Frequency\nbandwidth is 2*fc"); + RND_DAD_CHANGE_CB(exc_ctx.dlg, exc_val_chg_cb); + exc_ctx.exc_data[idx].w[I_FC] = RND_DAD_CURRENT(exc_ctx.dlg); - PCB_DAD_LABEL(exc_ctx.dlg, "f0"); - PCB_DAD_REAL(exc_ctx.dlg, ""); - PCB_DAD_MINMAX(exc_ctx.dlg, 0, FREQ_MAX); - PCB_DAD_HELP(exc_ctx.dlg, "Center Frequency [Hz]"); - PCB_DAD_CHANGE_CB(exc_ctx.dlg, exc_val_chg_cb); - exc_ctx.exc_data[idx].w[I_F0] = PCB_DAD_CURRENT(exc_ctx.dlg); + RND_DAD_LABEL(exc_ctx.dlg, "f0"); + RND_DAD_REAL(exc_ctx.dlg, ""); + RND_DAD_MINMAX(exc_ctx.dlg, 0, FREQ_MAX); + RND_DAD_HELP(exc_ctx.dlg, "Center Frequency [Hz]"); + RND_DAD_CHANGE_CB(exc_ctx.dlg, exc_val_chg_cb); + exc_ctx.exc_data[idx].w[I_F0] = RND_DAD_CURRENT(exc_ctx.dlg); - PCB_DAD_END(exc_ctx.dlg); + RND_DAD_END(exc_ctx.dlg); } @@ -210,14 +210,14 @@ static void exc_sin_dad(int idx) { - PCB_DAD_BEGIN_TABLE(exc_ctx.dlg, 2); - PCB_DAD_LABEL(exc_ctx.dlg, "f0"); - PCB_DAD_REAL(exc_ctx.dlg, ""); - PCB_DAD_MINMAX(exc_ctx.dlg, 0, FREQ_MAX); - PCB_DAD_HELP(exc_ctx.dlg, "Center Frequency [Hz]"); - PCB_DAD_CHANGE_CB(exc_ctx.dlg, exc_val_chg_cb); - exc_ctx.exc_data[idx].w[I_F0] = PCB_DAD_CURRENT(exc_ctx.dlg); - PCB_DAD_END(exc_ctx.dlg); + RND_DAD_BEGIN_TABLE(exc_ctx.dlg, 2); + RND_DAD_LABEL(exc_ctx.dlg, "f0"); + RND_DAD_REAL(exc_ctx.dlg, ""); + RND_DAD_MINMAX(exc_ctx.dlg, 0, FREQ_MAX); + RND_DAD_HELP(exc_ctx.dlg, "Center Frequency [Hz]"); + RND_DAD_CHANGE_CB(exc_ctx.dlg, exc_val_chg_cb); + exc_ctx.exc_data[idx].w[I_F0] = RND_DAD_CURRENT(exc_ctx.dlg); + RND_DAD_END(exc_ctx.dlg); } static char *exc_sin_get(int idx) @@ -244,20 +244,20 @@ static void exc_cust_dad(int idx) { - PCB_DAD_BEGIN_TABLE(exc_ctx.dlg, 2); - PCB_DAD_LABEL(exc_ctx.dlg, "f0"); - PCB_DAD_REAL(exc_ctx.dlg, ""); - PCB_DAD_MINMAX(exc_ctx.dlg, 0, FREQ_MAX); - PCB_DAD_HELP(exc_ctx.dlg, "Nyquest Rate [Hz]"); - PCB_DAD_CHANGE_CB(exc_ctx.dlg, exc_val_chg_cb); - exc_ctx.exc_data[idx].w[I_F0] = PCB_DAD_CURRENT(exc_ctx.dlg); + RND_DAD_BEGIN_TABLE(exc_ctx.dlg, 2); + RND_DAD_LABEL(exc_ctx.dlg, "f0"); + RND_DAD_REAL(exc_ctx.dlg, ""); + RND_DAD_MINMAX(exc_ctx.dlg, 0, FREQ_MAX); + RND_DAD_HELP(exc_ctx.dlg, "Nyquest Rate [Hz]"); + RND_DAD_CHANGE_CB(exc_ctx.dlg, exc_val_chg_cb); + exc_ctx.exc_data[idx].w[I_F0] = RND_DAD_CURRENT(exc_ctx.dlg); - PCB_DAD_LABEL(exc_ctx.dlg, "function"); - PCB_DAD_STRING(exc_ctx.dlg); - PCB_DAD_HELP(exc_ctx.dlg, "Custom function"); - PCB_DAD_CHANGE_CB(exc_ctx.dlg, exc_val_chg_cb); - exc_ctx.exc_data[idx].w[I_FUNC] = PCB_DAD_CURRENT(exc_ctx.dlg); - PCB_DAD_END(exc_ctx.dlg); + RND_DAD_LABEL(exc_ctx.dlg, "function"); + RND_DAD_STRING(exc_ctx.dlg); + RND_DAD_HELP(exc_ctx.dlg, "Custom function"); + RND_DAD_CHANGE_CB(exc_ctx.dlg, exc_val_chg_cb); + exc_ctx.exc_data[idx].w[I_FUNC] = RND_DAD_CURRENT(exc_ctx.dlg); + RND_DAD_END(exc_ctx.dlg); } static char *exc_cust_get(int idx) @@ -290,14 +290,14 @@ static void exc_user_dad(int idx) { - PCB_DAD_BEGIN_VBOX(exc_ctx.dlg); - PCB_DAD_COMPFLAG(exc_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(exc_ctx.dlg, "Specify the excitation setup script:"); - PCB_DAD_TEXT(exc_ctx.dlg, NULL); - PCB_DAD_COMPFLAG(exc_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - PCB_DAD_CHANGE_CB(exc_ctx.dlg, exc_val_chg_cb); - exc_ctx.exc_data[idx].w[I_SCRIPT] = PCB_DAD_CURRENT(exc_ctx.dlg); - PCB_DAD_END(exc_ctx.dlg); + RND_DAD_BEGIN_VBOX(exc_ctx.dlg); + RND_DAD_COMPFLAG(exc_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(exc_ctx.dlg, "Specify the excitation setup script:"); + RND_DAD_TEXT(exc_ctx.dlg, NULL); + RND_DAD_COMPFLAG(exc_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + RND_DAD_CHANGE_CB(exc_ctx.dlg, exc_val_chg_cb); + exc_ctx.exc_data[idx].w[I_SCRIPT] = RND_DAD_CURRENT(exc_ctx.dlg); + RND_DAD_END(exc_ctx.dlg); } static char *exc_user_get(int idx) @@ -332,7 +332,7 @@ static void exc_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) { exc_ctx_t *ctx = caller_data; - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); memset(ctx, 0, sizeof(exc_ctx_t)); /* reset all states to the initial - includes ctx->active = 0; */ } @@ -402,7 +402,7 @@ static const char *excnames[MAX_EXC+1]; const exc_t *e; int n; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (exc_ctx.active) return; /* do not open another */ @@ -418,31 +418,31 @@ excnames[n] = NULL; } - PCB_DAD_BEGIN_VBOX(exc_ctx.dlg); - PCB_DAD_COMPFLAG(exc_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HBOX(exc_ctx.dlg); - PCB_DAD_LABEL(exc_ctx.dlg, "Excitation type:"); - PCB_DAD_ENUM(exc_ctx.dlg, excnames); - exc_ctx.wselector = PCB_DAD_CURRENT(exc_ctx.dlg); - PCB_DAD_CHANGE_CB(exc_ctx.dlg, select_cb); - PCB_DAD_END(exc_ctx.dlg); - PCB_DAD_BEGIN_TABBED(exc_ctx.dlg, excnames); - PCB_DAD_COMPFLAG(exc_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_HIDE_TABLAB); - exc_ctx.wtab = PCB_DAD_CURRENT(exc_ctx.dlg); + RND_DAD_BEGIN_VBOX(exc_ctx.dlg); + RND_DAD_COMPFLAG(exc_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_HBOX(exc_ctx.dlg); + RND_DAD_LABEL(exc_ctx.dlg, "Excitation type:"); + RND_DAD_ENUM(exc_ctx.dlg, excnames); + exc_ctx.wselector = RND_DAD_CURRENT(exc_ctx.dlg); + RND_DAD_CHANGE_CB(exc_ctx.dlg, select_cb); + RND_DAD_END(exc_ctx.dlg); + RND_DAD_BEGIN_TABBED(exc_ctx.dlg, excnames); + RND_DAD_COMPFLAG(exc_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_HIDE_TABLAB); + exc_ctx.wtab = RND_DAD_CURRENT(exc_ctx.dlg); for(n = 0, e = excitations; e->name != NULL; n++,e++) { if (e->dad != NULL) e->dad(n); else - PCB_DAD_LABEL(exc_ctx.dlg, "Not yet available."); + RND_DAD_LABEL(exc_ctx.dlg, "Not yet available."); } - PCB_DAD_END(exc_ctx.dlg); - PCB_DAD_BUTTON_CLOSES(exc_ctx.dlg, clbtn); - PCB_DAD_END(exc_ctx.dlg); + RND_DAD_END(exc_ctx.dlg); + RND_DAD_BUTTON_CLOSES(exc_ctx.dlg, clbtn); + RND_DAD_END(exc_ctx.dlg); /* set up the context */ exc_ctx.active = 1; - PCB_DAD_NEW("openems_excitation", exc_ctx.dlg, "openems: excitation", &exc_ctx, pcb_false, exc_close_cb); + RND_DAD_NEW("openems_excitation", exc_ctx.dlg, "openems: excitation", &exc_ctx, pcb_false, exc_close_cb); load_selector(); select_update(1); Index: trunk/src_plugins/export_openems/mesh.c =================================================================== --- trunk/src_plugins/export_openems/mesh.c (revision 30991) +++ trunk/src_plugins/export_openems/mesh.c (revision 30992) @@ -46,7 +46,7 @@ static const int num_subslines[] = { 0, 1, 3, 5 }; typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int dens_obj, dens_gap, min_space, smooth, hor, ver, noimpl; int bnd[6], pml, subslines, air_top, air_bot, dens_air, smoothz, max_air, def_subs_thick, def_copper_thick; unsigned active:1; @@ -64,23 +64,23 @@ subst_thick = PCB_MM_TO_COORD(1.5); } - PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.pml, lng, mesh.pml); - 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); - PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.ver, lng, 1); + RND_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.pml, lng, mesh.pml); + RND_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.dens_obj, crd, PCB_MM_TO_COORD(0.15)); + RND_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.dens_gap, crd, PCB_MM_TO_COORD(0.5)); + RND_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.min_space, crd, PCB_MM_TO_COORD(0.1)); + RND_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.smooth, lng, 1); + RND_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.noimpl, lng, 0); + RND_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.hor, lng, 1); + RND_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, crd, subst_thick); -/* 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, 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, crd, PCB_MM_TO_COORD(4)); + RND_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.subslines, lng, 3); + RND_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.def_subs_thick, crd, subst_thick); +/* RND_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.def_copper_thick, crd, PCB_MM_TO_COORD(1.5));*/ + RND_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.air_top, lng, 1); + RND_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.air_bot, lng, 1); + RND_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.dens_air, crd, PCB_MM_TO_COORD(0.7)); + RND_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.smoothz, lng, 1); + RND_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,7 +87,7 @@ if (mesh.bnd[n] != NULL) for(i = 0, a = bnds; *a != NULL; a++,i++) if (strcmp(*a, mesh.bnd[n]) == 0) - PCB_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.bnd[n], lng, i); + RND_DAD_SET_VALUE(ia.dlg_hid_ctx, ia.bnd[n], lng, i); } } @@ -194,7 +194,7 @@ rnd_message(RND_MSG_ERROR, "Invalid mesh integer: " #name "\n"); \ return -1; \ } \ - PCB_DAD_SET_VALUE(me->dlg_hid_ctx, me->name, lng, v); \ + RND_DAD_SET_VALUE(me->dlg_hid_ctx, me->name, lng, v); \ } \ } while(0) @@ -213,7 +213,7 @@ rnd_message(RND_MSG_ERROR, "Invalid mesh coord: " #name "\n"); \ return -1; \ } \ - PCB_DAD_SET_VALUE(me->dlg_hid_ctx, me->name, crd, (rnd_coord_t)v); \ + RND_DAD_SET_VALUE(me->dlg_hid_ctx, me->name, crd, (rnd_coord_t)v); \ } \ } while(0) @@ -237,7 +237,7 @@ rnd_message(RND_MSG_ERROR, "Invalid mesh value '%s' for " #name "\n", node->data.text.value); \ return -1; \ } \ - PCB_DAD_SET_VALUE(me->dlg_hid_ctx, dst, lng, __n__); \ + RND_DAD_SET_VALUE(me->dlg_hid_ctx, dst, lng, __n__); \ } \ } while(0) @@ -958,7 +958,7 @@ static void ia_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) { - PCB_DAD_FREE(ia.dlg); + RND_DAD_FREE(ia.dlg); memset(&ia, 0, sizeof(ia)); } @@ -1053,175 +1053,175 @@ int pcb_mesh_interactive(void) { int n; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (ia.active) return 0; - PCB_DAD_BEGIN_VBOX(ia.dlg); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_BEGIN_VBOX(ia.dlg); - PCB_DAD_COMPFLAG(ia.dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(ia.dlg, "XY-mesh"); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_COORD(ia.dlg, ""); - ia.dens_obj = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_MINMAX(ia.dlg, 0, PCB_MM_TO_COORD(5)); - PCB_DAD_LABEL(ia.dlg, "copper dens."); - PCB_DAD_HELP(ia.dlg, "mesh density over copper"); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_VBOX(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_BEGIN_VBOX(ia.dlg); + RND_DAD_COMPFLAG(ia.dlg, RND_HATF_FRAME); + RND_DAD_LABEL(ia.dlg, "XY-mesh"); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_COORD(ia.dlg, ""); + ia.dens_obj = RND_DAD_CURRENT(ia.dlg); + RND_DAD_MINMAX(ia.dlg, 0, PCB_MM_TO_COORD(5)); + RND_DAD_LABEL(ia.dlg, "copper dens."); + RND_DAD_HELP(ia.dlg, "mesh density over copper"); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_COORD(ia.dlg, ""); - ia.dens_gap = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_MINMAX(ia.dlg, 0, PCB_MM_TO_COORD(5)); - PCB_DAD_LABEL(ia.dlg, "gap dens."); - PCB_DAD_HELP(ia.dlg, "mesh density over gaps"); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_COORD(ia.dlg, ""); + ia.dens_gap = RND_DAD_CURRENT(ia.dlg); + RND_DAD_MINMAX(ia.dlg, 0, PCB_MM_TO_COORD(5)); + RND_DAD_LABEL(ia.dlg, "gap dens."); + RND_DAD_HELP(ia.dlg, "mesh density over gaps"); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_COORD(ia.dlg, ""); - ia.min_space = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_MINMAX(ia.dlg, 0, PCB_MM_TO_COORD(5)); - PCB_DAD_LABEL(ia.dlg, "min. spacing"); - PCB_DAD_HELP(ia.dlg, "minimum distance between mesh lines"); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_COORD(ia.dlg, ""); + ia.min_space = RND_DAD_CURRENT(ia.dlg); + RND_DAD_MINMAX(ia.dlg, 0, PCB_MM_TO_COORD(5)); + RND_DAD_LABEL(ia.dlg, "min. spacing"); + RND_DAD_HELP(ia.dlg, "minimum distance between mesh lines"); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_BOOL(ia.dlg, ""); - ia.smooth = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_LABEL(ia.dlg, "smooth mesh"); - PCB_DAD_HELP(ia.dlg, "avoid jumps between different mesh densities,\nuse smooth (gradual) changes"); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_BOOL(ia.dlg, ""); + ia.smooth = RND_DAD_CURRENT(ia.dlg); + RND_DAD_LABEL(ia.dlg, "smooth mesh"); + RND_DAD_HELP(ia.dlg, "avoid jumps between different mesh densities,\nuse smooth (gradual) changes"); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_BOOL(ia.dlg, ""); - ia.hor = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_LABEL(ia.dlg, "horizontal"); - PCB_DAD_HELP(ia.dlg, "enable adding horizontal mesh lines"); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_BOOL(ia.dlg, ""); + ia.hor = RND_DAD_CURRENT(ia.dlg); + RND_DAD_LABEL(ia.dlg, "horizontal"); + RND_DAD_HELP(ia.dlg, "enable adding horizontal mesh lines"); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_BOOL(ia.dlg, ""); - ia.ver = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_LABEL(ia.dlg, "vertical"); - PCB_DAD_HELP(ia.dlg, "enable adding vertical mesh lines"); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_BOOL(ia.dlg, ""); + ia.ver = RND_DAD_CURRENT(ia.dlg); + RND_DAD_LABEL(ia.dlg, "vertical"); + RND_DAD_HELP(ia.dlg, "enable adding vertical mesh lines"); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_BOOL(ia.dlg, ""); - ia.noimpl = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_LABEL(ia.dlg, "omit implicit"); - PCB_DAD_HELP(ia.dlg, "add only the mesh lines for boundaries,\nomit in-material meshing"); - PCB_DAD_END(ia.dlg); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_BOOL(ia.dlg, ""); + ia.noimpl = RND_DAD_CURRENT(ia.dlg); + RND_DAD_LABEL(ia.dlg, "omit implicit"); + RND_DAD_HELP(ia.dlg, "add only the mesh lines for boundaries,\nomit in-material meshing"); + RND_DAD_END(ia.dlg); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_VBOX(ia.dlg); - PCB_DAD_COMPFLAG(ia.dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(ia.dlg, "Z-mesh"); + RND_DAD_BEGIN_VBOX(ia.dlg); + RND_DAD_COMPFLAG(ia.dlg, RND_HATF_FRAME); + RND_DAD_LABEL(ia.dlg, "Z-mesh"); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_ENUM(ia.dlg, subslines); - ia.subslines = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_LABEL(ia.dlg, "num in substrate"); - PCB_DAD_HELP(ia.dlg, "number of mesh lines in substrate"); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_ENUM(ia.dlg, subslines); + ia.subslines = RND_DAD_CURRENT(ia.dlg); + RND_DAD_LABEL(ia.dlg, "num in substrate"); + RND_DAD_HELP(ia.dlg, "number of mesh lines in substrate"); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_COORD(ia.dlg, ""); - ia.def_subs_thick = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_MINMAX(ia.dlg, 0, PCB_MM_TO_COORD(5)); - PCB_DAD_LABEL(ia.dlg, "def. subst. thick"); - PCB_DAD_HELP(ia.dlg, "default substrate thickness\n(for substrate layer groups without\nthickness specified in attribute)"); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_COORD(ia.dlg, ""); + ia.def_subs_thick = RND_DAD_CURRENT(ia.dlg); + RND_DAD_MINMAX(ia.dlg, 0, PCB_MM_TO_COORD(5)); + RND_DAD_LABEL(ia.dlg, "def. subst. thick"); + RND_DAD_HELP(ia.dlg, "default substrate thickness\n(for substrate layer groups without\nthickness specified in attribute)"); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_COORD(ia.dlg, ""); - ia.def_copper_thick = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_MINMAX(ia.dlg, 0, PCB_MM_TO_COORD(5)); - PCB_DAD_LABEL(ia.dlg, "def. copper thick"); - PCB_DAD_HELP(ia.dlg, "default copper thickness\n(for copper layer groups without\nthickness specified in attribute)"); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_COORD(ia.dlg, ""); + ia.def_copper_thick = RND_DAD_CURRENT(ia.dlg); + RND_DAD_MINMAX(ia.dlg, 0, PCB_MM_TO_COORD(5)); + RND_DAD_LABEL(ia.dlg, "def. copper thick"); + RND_DAD_HELP(ia.dlg, "default copper thickness\n(for copper layer groups without\nthickness specified in attribute)"); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_BOOL(ia.dlg, ""); - ia.air_top = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_LABEL(ia.dlg, "in air top"); - PCB_DAD_HELP(ia.dlg, "add mesh lines in air above the top of the board"); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_BOOL(ia.dlg, ""); + ia.air_top = RND_DAD_CURRENT(ia.dlg); + RND_DAD_LABEL(ia.dlg, "in air top"); + RND_DAD_HELP(ia.dlg, "add mesh lines in air above the top of the board"); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_BOOL(ia.dlg, ""); - ia.air_bot = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_LABEL(ia.dlg, "in air bottom"); - PCB_DAD_HELP(ia.dlg, "add mesh lines in air below the bottom of the board"); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_BOOL(ia.dlg, ""); + ia.air_bot = RND_DAD_CURRENT(ia.dlg); + RND_DAD_LABEL(ia.dlg, "in air bottom"); + RND_DAD_HELP(ia.dlg, "add mesh lines in air below the bottom of the board"); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_COORD(ia.dlg, ""); - ia.dens_air = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_MINMAX(ia.dlg, 0, PCB_MM_TO_COORD(5)); - PCB_DAD_LABEL(ia.dlg, "dens. air"); - PCB_DAD_HELP(ia.dlg, "mesh line density (spacing) in air"); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_COORD(ia.dlg, ""); + ia.dens_air = RND_DAD_CURRENT(ia.dlg); + RND_DAD_MINMAX(ia.dlg, 0, PCB_MM_TO_COORD(5)); + RND_DAD_LABEL(ia.dlg, "dens. air"); + RND_DAD_HELP(ia.dlg, "mesh line density (spacing) in air"); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_COORD(ia.dlg, ""); - ia.max_air = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_MINMAX(ia.dlg, 0, PCB_MM_TO_COORD(5)); - PCB_DAD_LABEL(ia.dlg, "air thickness"); - PCB_DAD_HELP(ia.dlg, "how far out to mesh in air"); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_COORD(ia.dlg, ""); + ia.max_air = RND_DAD_CURRENT(ia.dlg); + RND_DAD_MINMAX(ia.dlg, 0, PCB_MM_TO_COORD(5)); + RND_DAD_LABEL(ia.dlg, "air thickness"); + RND_DAD_HELP(ia.dlg, "how far out to mesh in air"); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_BOOL(ia.dlg, ""); - ia.smoothz = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_LABEL(ia.dlg, "smooth mesh"); - PCB_DAD_HELP(ia.dlg, "avoid jumps between different mesh densities,\nuse smooth (gradual) changes"); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_BOOL(ia.dlg, ""); + ia.smoothz = RND_DAD_CURRENT(ia.dlg); + RND_DAD_LABEL(ia.dlg, "smooth mesh"); + RND_DAD_HELP(ia.dlg, "avoid jumps between different mesh densities,\nuse smooth (gradual) changes"); + RND_DAD_END(ia.dlg); - PCB_DAD_END(ia.dlg); - PCB_DAD_END(ia.dlg); + RND_DAD_END(ia.dlg); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_BEGIN_VBOX(ia.dlg); - PCB_DAD_COMPFLAG(ia.dlg, RND_HATF_FRAME); - PCB_DAD_LABEL(ia.dlg, "Boundary"); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_BEGIN_VBOX(ia.dlg); + RND_DAD_COMPFLAG(ia.dlg, RND_HATF_FRAME); + RND_DAD_LABEL(ia.dlg, "Boundary"); for(n = 0; n < 6; n+=2) { char name[64]; sprintf(name, "%s %s", bnd_names[n], bnd_names[n+1]); - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_ENUM(ia.dlg, bnds); - ia.bnd[n] = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_LABEL(ia.dlg, name); - PCB_DAD_ENUM(ia.dlg, bnds); - ia.bnd[n+1] = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_ENUM(ia.dlg, bnds); + ia.bnd[n] = RND_DAD_CURRENT(ia.dlg); + RND_DAD_LABEL(ia.dlg, name); + RND_DAD_ENUM(ia.dlg, bnds); + ia.bnd[n+1] = RND_DAD_CURRENT(ia.dlg); + RND_DAD_END(ia.dlg); } - PCB_DAD_BEGIN_HBOX(ia.dlg); - PCB_DAD_LABEL(ia.dlg, "PML cells:"); - PCB_DAD_INTEGER(ia.dlg, ""); - ia.pml = PCB_DAD_CURRENT(ia.dlg); - PCB_DAD_MINMAX(ia.dlg, 0, 32); - PCB_DAD_DEFAULT_NUM(ia.dlg, 8); - PCB_DAD_END(ia.dlg); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_HBOX(ia.dlg); + RND_DAD_LABEL(ia.dlg, "PML cells:"); + RND_DAD_INTEGER(ia.dlg, ""); + ia.pml = RND_DAD_CURRENT(ia.dlg); + RND_DAD_MINMAX(ia.dlg, 0, 32); + RND_DAD_DEFAULT_NUM(ia.dlg, 8); + RND_DAD_END(ia.dlg); + RND_DAD_END(ia.dlg); - PCB_DAD_BEGIN_VBOX(ia.dlg); - PCB_DAD_BUTTON(ia.dlg, "Save to file"); - PCB_DAD_CHANGE_CB(ia.dlg, ia_save_cb); - PCB_DAD_BUTTON(ia.dlg, "Load from file"); - PCB_DAD_CHANGE_CB(ia.dlg, ia_load_cb); - PCB_DAD_BUTTON(ia.dlg, "Generate mesh!"); - PCB_DAD_CHANGE_CB(ia.dlg, ia_gen_cb); - PCB_DAD_END(ia.dlg); - PCB_DAD_END(ia.dlg); - PCB_DAD_BUTTON_CLOSES(ia.dlg, clbtn); - PCB_DAD_END(ia.dlg); + RND_DAD_BEGIN_VBOX(ia.dlg); + RND_DAD_BUTTON(ia.dlg, "Save to file"); + RND_DAD_CHANGE_CB(ia.dlg, ia_save_cb); + RND_DAD_BUTTON(ia.dlg, "Load from file"); + RND_DAD_CHANGE_CB(ia.dlg, ia_load_cb); + RND_DAD_BUTTON(ia.dlg, "Generate mesh!"); + RND_DAD_CHANGE_CB(ia.dlg, ia_gen_cb); + RND_DAD_END(ia.dlg); + RND_DAD_END(ia.dlg); + RND_DAD_BUTTON_CLOSES(ia.dlg, clbtn); + RND_DAD_END(ia.dlg); - PCB_DAD_NEW("mesh", ia.dlg, "mesher", &ia, 0, ia_close_cb); + RND_DAD_NEW("mesh", ia.dlg, "mesher", &ia, 0, ia_close_cb); ia.active = 1; mesh2dlg(); Index: trunk/src_plugins/extedit/extedit_dad.c =================================================================== --- trunk/src_plugins/extedit/extedit_dad.c (revision 30991) +++ trunk/src_plugins/extedit/extedit_dad.c (revision 30992) @@ -27,7 +27,7 @@ #include typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int mthi; int wmethod, wfmt, wcmd; @@ -37,9 +37,9 @@ static void ee_data2dialog(ee_t *ee) { - PCB_DAD_SET_VALUE(ee->dlg_hid_ctx, ee->wmethod, lng, ee->mthi); - PCB_DAD_SET_VALUE(ee->dlg_hid_ctx, ee->wfmt, lng, methods[ee->mthi].fmt); - PCB_DAD_SET_VALUE(ee->dlg_hid_ctx, ee->wcmd, str, rnd_strdup(methods[ee->mthi].command)); + RND_DAD_SET_VALUE(ee->dlg_hid_ctx, ee->wmethod, lng, ee->mthi); + RND_DAD_SET_VALUE(ee->dlg_hid_ctx, ee->wfmt, lng, methods[ee->mthi].fmt); + RND_DAD_SET_VALUE(ee->dlg_hid_ctx, ee->wcmd, str, rnd_strdup(methods[ee->mthi].command)); /* we have only one format, so disable the combo box for selecting it */ rnd_gui->attr_dlg_widget_state(ee->dlg_hid_ctx, ee->wfmt, pcb_false); @@ -83,7 +83,7 @@ char tmp[256]; const char *names[NUM_METHODS+1]; int n, res; - pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"Edit!", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"Edit!", 0}, {NULL, 0}}; for(n = 0; n < NUM_METHODS; n++) names[n] = methods[n].name; @@ -91,38 +91,38 @@ memset(&ee, 0, sizeof(ee)); - PCB_DAD_BEGIN_VBOX(ee.dlg); + RND_DAD_BEGIN_VBOX(ee.dlg); sprintf(tmp, "Select external editor..."); - PCB_DAD_LABEL(ee.dlg, tmp); + RND_DAD_LABEL(ee.dlg, tmp); - PCB_DAD_BEGIN_HBOX(ee.dlg); - PCB_DAD_LABEL(ee.dlg, "Method name:"); - PCB_DAD_ENUM(ee.dlg, names); - ee.wmethod = PCB_DAD_CURRENT(ee.dlg); - PCB_DAD_CHANGE_CB(ee.dlg, ee_chg_method); - PCB_DAD_END(ee.dlg); + RND_DAD_BEGIN_HBOX(ee.dlg); + RND_DAD_LABEL(ee.dlg, "Method name:"); + RND_DAD_ENUM(ee.dlg, names); + ee.wmethod = RND_DAD_CURRENT(ee.dlg); + RND_DAD_CHANGE_CB(ee.dlg, ee_chg_method); + RND_DAD_END(ee.dlg); - PCB_DAD_BEGIN_HBOX(ee.dlg); - PCB_DAD_LABEL(ee.dlg, "File format:"); - PCB_DAD_ENUM(ee.dlg, extedit_fmt_names); - ee.wfmt = PCB_DAD_CURRENT(ee.dlg); - PCB_DAD_END(ee.dlg); + RND_DAD_BEGIN_HBOX(ee.dlg); + RND_DAD_LABEL(ee.dlg, "File format:"); + RND_DAD_ENUM(ee.dlg, extedit_fmt_names); + ee.wfmt = RND_DAD_CURRENT(ee.dlg); + RND_DAD_END(ee.dlg); - PCB_DAD_BEGIN_HBOX(ee.dlg); - PCB_DAD_LABEL(ee.dlg, "Command template:"); - PCB_DAD_STRING(ee.dlg); - ee.wcmd = PCB_DAD_CURRENT(ee.dlg); - PCB_DAD_CHANGE_CB(ee.dlg, ee_chg_cmd); - PCB_DAD_END(ee.dlg); - PCB_DAD_BUTTON_CLOSES(ee.dlg, clbtn); - PCB_DAD_END(ee.dlg); + RND_DAD_BEGIN_HBOX(ee.dlg); + RND_DAD_LABEL(ee.dlg, "Command template:"); + RND_DAD_STRING(ee.dlg); + ee.wcmd = RND_DAD_CURRENT(ee.dlg); + RND_DAD_CHANGE_CB(ee.dlg, ee_chg_cmd); + RND_DAD_END(ee.dlg); + RND_DAD_BUTTON_CLOSES(ee.dlg, clbtn); + RND_DAD_END(ee.dlg); - PCB_DAD_NEW("extedit", ee.dlg, "External editor", &ee, pcb_true, NULL); + RND_DAD_NEW("extedit", ee.dlg, "External editor", &ee, pcb_true, NULL); ee_data2dialog(&ee); - res = PCB_DAD_RUN(ee.dlg); + res = RND_DAD_RUN(ee.dlg); - PCB_DAD_FREE(ee.dlg); + RND_DAD_FREE(ee.dlg); if (res != 0) return NULL; return &methods[ee.mthi]; Index: trunk/src_plugins/exto_std/bus.c =================================================================== --- trunk/src_plugins/exto_std/bus.c (revision 30991) +++ trunk/src_plugins/exto_std/bus.c (revision 30992) @@ -30,7 +30,7 @@ #define LID_TARGET 1 typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int gui_active; int width; rnd_coord_t pitch; @@ -47,7 +47,7 @@ rnd_trace("bus del_pre\n"); if ((bus != NULL) && (bus->gui_active)) - PCB_DAD_FREE(bus->dlg); + RND_DAD_FREE(bus->dlg); free(bus); subc->extobj_data = NULL; @@ -357,13 +357,13 @@ pcb_subc_t *subc = caller_data; bus_t *bus = subc->extobj_data; - PCB_DAD_FREE(bus->dlg); + RND_DAD_FREE(bus->dlg); bus->gui_active = 0; } static void pcb_bus_gui_propedit(pcb_subc_t *subc) { - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; bus_t *bus; rnd_trace("bus: gui propedit\n"); @@ -376,21 +376,21 @@ if (bus->gui_active) return; /* do not open another */ - PCB_DAD_BEGIN_VBOX(bus->dlg); - PCB_DAD_COMPFLAG(bus->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABLE(bus->dlg, 2); + RND_DAD_BEGIN_VBOX(bus->dlg); + RND_DAD_COMPFLAG(bus->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABLE(bus->dlg, 2); pcb_exto_dlg_int(bus->dlg, subc, "width", "extobj::width", "number of traces in the bus"); pcb_exto_dlg_coord(bus->dlg, subc, "thickness", "extobj::thickness", "thickness of each trace"); pcb_exto_dlg_coord(bus->dlg, subc, "clearance", "extobj::clearance", "clearance on each trace"); pcb_exto_dlg_coord(bus->dlg, subc, "pitch", "extobj::pitch", "distance between trace centerlines"); - PCB_DAD_END(bus->dlg); - PCB_DAD_BUTTON_CLOSES(bus->dlg, clbtn); - PCB_DAD_END(bus->dlg); + RND_DAD_END(bus->dlg); + RND_DAD_BUTTON_CLOSES(bus->dlg, clbtn); + RND_DAD_END(bus->dlg); /* set up the context */ bus->gui_active = 1; - PCB_DAD_NEW("bus", bus->dlg, "Bus", subc, pcb_false, pcb_bus_close_cb); + RND_DAD_NEW("bus", bus->dlg, "Bus", subc, pcb_false, pcb_bus_close_cb); } static pcb_extobj_t pcb_bus = { Index: trunk/src_plugins/exto_std/dimension.c =================================================================== --- trunk/src_plugins/exto_std/dimension.c (revision 30991) +++ trunk/src_plugins/exto_std/dimension.c (revision 30992) @@ -32,7 +32,7 @@ #define LID_TARGET 1 typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int gui_active; int style; @@ -395,13 +395,13 @@ pcb_subc_t *subc = caller_data; dimension *dim = subc->extobj_data; - PCB_DAD_FREE(dim->dlg); + RND_DAD_FREE(dim->dlg); dim->gui_active = 0; } static void pcb_dimension_gui_propedit(pcb_subc_t *subc) { - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; dimension *dim; rnd_trace("dim: gui propedit\n"); @@ -414,19 +414,19 @@ if (dim->gui_active) return; /* do not open another */ - PCB_DAD_BEGIN_VBOX(dim->dlg); - PCB_DAD_COMPFLAG(dim->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABLE(dim->dlg, 2); + RND_DAD_BEGIN_VBOX(dim->dlg); + RND_DAD_COMPFLAG(dim->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABLE(dim->dlg, 2); pcb_exto_dlg_coord(dim->dlg, subc, "displacement", "extobj::displace", "distance between base line and dimension line"); pcb_exto_dlg_str(dim->dlg, subc, "format", "extobj::format", "printf coord format string of the dimension value"); - PCB_DAD_END(dim->dlg); - PCB_DAD_BUTTON_CLOSES(dim->dlg, clbtn); - PCB_DAD_END(dim->dlg); + RND_DAD_END(dim->dlg); + RND_DAD_BUTTON_CLOSES(dim->dlg, clbtn); + RND_DAD_END(dim->dlg); /* set up the context */ dim->gui_active = 1; - PCB_DAD_NEW("dimension", dim->dlg, "Dimension line", subc, pcb_false, pcb_dimension_close_cb); + RND_DAD_NEW("dimension", dim->dlg, "Dimension line", subc, pcb_false, pcb_dimension_close_cb); } static pcb_extobj_t pcb_dimension = { Index: trunk/src_plugins/exto_std/line_of_vias.c =================================================================== --- trunk/src_plugins/exto_std/line_of_vias.c (revision 30991) +++ trunk/src_plugins/exto_std/line_of_vias.c (revision 30992) @@ -31,7 +31,7 @@ #include "../src_plugins/lib_compat_help/pstk_compat.h" typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int gui_active; rnd_coord_t pitch; rnd_coord_t clearance; @@ -43,7 +43,7 @@ rnd_trace("LoV del_pre\n"); if ((lov != NULL) && (lov->gui_active)) - PCB_DAD_FREE(lov->dlg); + RND_DAD_FREE(lov->dlg); free(lov); subc->extobj_data = NULL; @@ -295,13 +295,13 @@ pcb_subc_t *subc = caller_data; line_of_vias *lov = subc->extobj_data; - PCB_DAD_FREE(lov->dlg); + RND_DAD_FREE(lov->dlg); lov->gui_active = 0; } static void pcb_line_of_vias_gui_propedit(pcb_subc_t *subc) { - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; line_of_vias *lov; rnd_trace("LoV: gui propedit\n"); @@ -314,19 +314,19 @@ if (lov->gui_active) return; /* do not open another */ - PCB_DAD_BEGIN_VBOX(lov->dlg); - PCB_DAD_COMPFLAG(lov->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABLE(lov->dlg, 2); + RND_DAD_BEGIN_VBOX(lov->dlg); + RND_DAD_COMPFLAG(lov->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABLE(lov->dlg, 2); pcb_exto_dlg_coord(lov->dlg, subc, "pitch", "extobj::pitch", "target distance between center of vias"); pcb_exto_dlg_coord(lov->dlg, subc, "clearance", "extobj::clearance", "global clarance value on vias"); - PCB_DAD_END(lov->dlg); - PCB_DAD_BUTTON_CLOSES(lov->dlg, clbtn); - PCB_DAD_END(lov->dlg); + RND_DAD_END(lov->dlg); + RND_DAD_BUTTON_CLOSES(lov->dlg, clbtn); + RND_DAD_END(lov->dlg); /* set up the context */ lov->gui_active = 1; - PCB_DAD_NEW("line_of_vias", lov->dlg, "Line of vias", subc, pcb_false, pcb_line_of_vias_close_cb); + RND_DAD_NEW("line_of_vias", lov->dlg, "Line of vias", subc, pcb_false, pcb_line_of_vias_close_cb); } static pcb_extobj_t pcb_line_of_vias = { Index: trunk/src_plugins/import_sch2/import_sch_dlg.c =================================================================== --- trunk/src_plugins/import_sch2/import_sch_dlg.c (revision 30991) +++ trunk/src_plugins/import_sch2/import_sch_dlg.c (revision 30992) @@ -27,7 +27,7 @@ /* #included from import_sch.c to share global static variables */ typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) char **inames; int len; int wfmt, wtab, warg_ctrl, wverbose; @@ -80,7 +80,7 @@ isch_ctx_t *ctx = caller_data; isch_flush_timer(); - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); for(n = 0; n < isch_ctx.len; n++) free(isch_ctx.inames[n]); free(isch_ctx.inames); @@ -104,7 +104,7 @@ int len, n, controllable; isch_conf_lock++; - PCB_DAD_SET_VALUE(isch_ctx.dlg_hid_ctx, isch_ctx.wtab, lng, target); + RND_DAD_SET_VALUE(isch_ctx.dlg_hid_ctx, isch_ctx.wtab, lng, target); if (setconf && (p != NULL)) rnd_conf_set(RND_CFR_DESIGN, "plugins/import_sch/import_fmt", 0, p->name, RND_POL_OVERWRITE); @@ -155,10 +155,10 @@ } for(n = 0, ci = rnd_conflist_first((rnd_conflist_t *)&conf_import_sch.plugins.import_sch.args); ci != NULL; ci = rnd_conflist_next(ci), n++) - PCB_DAD_SET_VALUE(isch_ctx.dlg_hid_ctx, isch_ctx.warg[n], str, ci->val.string[0]); + RND_DAD_SET_VALUE(isch_ctx.dlg_hid_ctx, isch_ctx.warg[n], str, ci->val.string[0]); - PCB_DAD_SET_VALUE(isch_ctx.dlg_hid_ctx, isch_ctx.wfmt, lng, tab); - PCB_DAD_SET_VALUE(isch_ctx.dlg_hid_ctx, isch_ctx.wverbose, lng, conf_import_sch.plugins.import_sch.verbose); + RND_DAD_SET_VALUE(isch_ctx.dlg_hid_ctx, isch_ctx.wfmt, lng, tab); + RND_DAD_SET_VALUE(isch_ctx.dlg_hid_ctx, isch_ctx.wverbose, lng, conf_import_sch.plugins.import_sch.verbose); isch_switch_fmt(tab, 0); } @@ -252,9 +252,9 @@ static void isch_add_tab(const pcb_plug_import_t *p) { - PCB_DAD_BEGIN_VBOX(isch_ctx.dlg); - PCB_DAD_LABEL(isch_ctx.dlg, p->desc); - PCB_DAD_END(isch_ctx.dlg); + RND_DAD_BEGIN_VBOX(isch_ctx.dlg); + RND_DAD_LABEL(isch_ctx.dlg, p->desc); + RND_DAD_END(isch_ctx.dlg); } static int do_dialog(void) @@ -261,7 +261,7 @@ { int len, n; const pcb_plug_import_t *p, **pa; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (isch_ctx.active) return 0; /* do not open another */ @@ -282,71 +282,71 @@ isch_ctx.inames[n] = NULL; isch_ctx.len = len; - PCB_DAD_BEGIN_VBOX(isch_ctx.dlg); - PCB_DAD_COMPFLAG(isch_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(isch_ctx.dlg); + RND_DAD_COMPFLAG(isch_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_VBOX(isch_ctx.dlg); /* format box */ - PCB_DAD_COMPFLAG(isch_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HBOX(isch_ctx.dlg); - PCB_DAD_LABEL(isch_ctx.dlg, "Format:"); - PCB_DAD_ENUM(isch_ctx.dlg, isch_ctx.inames); - isch_ctx.wfmt = PCB_DAD_CURRENT(isch_ctx.dlg); - PCB_DAD_CHANGE_CB(isch_ctx.dlg, isch_fmt_chg_cb); - PCB_DAD_HELP(isch_ctx.dlg, "Import file format (or plugin)"); - PCB_DAD_END(isch_ctx.dlg); - PCB_DAD_BEGIN_TABBED(isch_ctx.dlg, isch_ctx.inames); - PCB_DAD_COMPFLAG(isch_ctx.dlg, RND_HATF_HIDE_TABLAB); - isch_ctx.wtab = PCB_DAD_CURRENT(isch_ctx.dlg); + RND_DAD_BEGIN_VBOX(isch_ctx.dlg); /* format box */ + RND_DAD_COMPFLAG(isch_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_HBOX(isch_ctx.dlg); + RND_DAD_LABEL(isch_ctx.dlg, "Format:"); + RND_DAD_ENUM(isch_ctx.dlg, isch_ctx.inames); + isch_ctx.wfmt = RND_DAD_CURRENT(isch_ctx.dlg); + RND_DAD_CHANGE_CB(isch_ctx.dlg, isch_fmt_chg_cb); + RND_DAD_HELP(isch_ctx.dlg, "Import file format (or plugin)"); + RND_DAD_END(isch_ctx.dlg); + RND_DAD_BEGIN_TABBED(isch_ctx.dlg, isch_ctx.inames); + RND_DAD_COMPFLAG(isch_ctx.dlg, RND_HATF_HIDE_TABLAB); + isch_ctx.wtab = RND_DAD_CURRENT(isch_ctx.dlg); for(n = 0; n < len; n++) isch_add_tab(pa[n]); - PCB_DAD_END(isch_ctx.dlg); - PCB_DAD_BEGIN_VBOX(isch_ctx.dlg); /* scrollable arg list */ - PCB_DAD_COMPFLAG(isch_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + RND_DAD_END(isch_ctx.dlg); + RND_DAD_BEGIN_VBOX(isch_ctx.dlg); /* scrollable arg list */ + RND_DAD_COMPFLAG(isch_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); for(n = 0; n < MAX_ARGS; n++) { - PCB_DAD_BEGIN_HBOX(isch_ctx.dlg); - isch_ctx.warg_box[n] = PCB_DAD_CURRENT(isch_ctx.dlg); - PCB_DAD_STRING(isch_ctx.dlg); - isch_ctx.warg[n] = PCB_DAD_CURRENT(isch_ctx.dlg); - PCB_DAD_WIDTH_CHR(isch_ctx.dlg, 32); - PCB_DAD_CHANGE_CB(isch_ctx.dlg, isch_arg_chg_cb); - PCB_DAD_BUTTON(isch_ctx.dlg, "browse"); - PCB_DAD_CHANGE_CB(isch_ctx.dlg, isch_browse_cb); - isch_ctx.warg_button[n] = PCB_DAD_CURRENT(isch_ctx.dlg); - PCB_DAD_END(isch_ctx.dlg); + RND_DAD_BEGIN_HBOX(isch_ctx.dlg); + isch_ctx.warg_box[n] = RND_DAD_CURRENT(isch_ctx.dlg); + RND_DAD_STRING(isch_ctx.dlg); + isch_ctx.warg[n] = RND_DAD_CURRENT(isch_ctx.dlg); + RND_DAD_WIDTH_CHR(isch_ctx.dlg, 32); + RND_DAD_CHANGE_CB(isch_ctx.dlg, isch_arg_chg_cb); + RND_DAD_BUTTON(isch_ctx.dlg, "browse"); + RND_DAD_CHANGE_CB(isch_ctx.dlg, isch_browse_cb); + isch_ctx.warg_button[n] = RND_DAD_CURRENT(isch_ctx.dlg); + RND_DAD_END(isch_ctx.dlg); } - PCB_DAD_BEGIN_HBOX(isch_ctx.dlg); - isch_ctx.warg_ctrl = PCB_DAD_CURRENT(isch_ctx.dlg); - PCB_DAD_BUTTON(isch_ctx.dlg, "Del last"); - PCB_DAD_CHANGE_CB(isch_ctx.dlg, isch_arg_del_cb); - PCB_DAD_HELP(isch_ctx.dlg, "Remove the last option from the end of the list"); - PCB_DAD_BUTTON(isch_ctx.dlg, "One more"); - PCB_DAD_CHANGE_CB(isch_ctx.dlg, isch_arg_add_cb); - PCB_DAD_HELP(isch_ctx.dlg, "Append one more option to the end of the list"); - PCB_DAD_END(isch_ctx.dlg); - PCB_DAD_END(isch_ctx.dlg); - PCB_DAD_END(isch_ctx.dlg); + RND_DAD_BEGIN_HBOX(isch_ctx.dlg); + isch_ctx.warg_ctrl = RND_DAD_CURRENT(isch_ctx.dlg); + RND_DAD_BUTTON(isch_ctx.dlg, "Del last"); + RND_DAD_CHANGE_CB(isch_ctx.dlg, isch_arg_del_cb); + RND_DAD_HELP(isch_ctx.dlg, "Remove the last option from the end of the list"); + RND_DAD_BUTTON(isch_ctx.dlg, "One more"); + RND_DAD_CHANGE_CB(isch_ctx.dlg, isch_arg_add_cb); + RND_DAD_HELP(isch_ctx.dlg, "Append one more option to the end of the list"); + RND_DAD_END(isch_ctx.dlg); + RND_DAD_END(isch_ctx.dlg); + RND_DAD_END(isch_ctx.dlg); - PCB_DAD_BEGIN_VBOX(isch_ctx.dlg); /* generic settings */ - PCB_DAD_BEGIN_HBOX(isch_ctx.dlg); - PCB_DAD_LABEL(isch_ctx.dlg, "Verbose import:"); - PCB_DAD_BOOL(isch_ctx.dlg, ""); - isch_ctx.wverbose = PCB_DAD_CURRENT(isch_ctx.dlg); - PCB_DAD_CHANGE_CB(isch_ctx.dlg, isch_generic_chg_cb); - PCB_DAD_END(isch_ctx.dlg); - PCB_DAD_BUTTON(isch_ctx.dlg, "Placement config..."); - PCB_DAD_CHANGE_CB(isch_ctx.dlg, isch_plc_cfg_cb); - PCB_DAD_HELP(isch_ctx.dlg, "Configure how/where newly imported subcircuits\nare placed on the board"); - PCB_DAD_END(isch_ctx.dlg); + RND_DAD_BEGIN_VBOX(isch_ctx.dlg); /* generic settings */ + RND_DAD_BEGIN_HBOX(isch_ctx.dlg); + RND_DAD_LABEL(isch_ctx.dlg, "Verbose import:"); + RND_DAD_BOOL(isch_ctx.dlg, ""); + isch_ctx.wverbose = RND_DAD_CURRENT(isch_ctx.dlg); + RND_DAD_CHANGE_CB(isch_ctx.dlg, isch_generic_chg_cb); + RND_DAD_END(isch_ctx.dlg); + RND_DAD_BUTTON(isch_ctx.dlg, "Placement config..."); + RND_DAD_CHANGE_CB(isch_ctx.dlg, isch_plc_cfg_cb); + RND_DAD_HELP(isch_ctx.dlg, "Configure how/where newly imported subcircuits\nare placed on the board"); + RND_DAD_END(isch_ctx.dlg); - PCB_DAD_BEGIN_HBOX(isch_ctx.dlg); /* bottom buttons */ - PCB_DAD_BUTTON(isch_ctx.dlg, "Import!"); - PCB_DAD_CHANGE_CB(isch_ctx.dlg, isch_import_cb); - PCB_DAD_BEGIN_HBOX(isch_ctx.dlg); - PCB_DAD_COMPFLAG(isch_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_END(isch_ctx.dlg); - PCB_DAD_BUTTON_CLOSES(isch_ctx.dlg, clbtn); - PCB_DAD_END(isch_ctx.dlg); - PCB_DAD_END(isch_ctx.dlg); + RND_DAD_BEGIN_HBOX(isch_ctx.dlg); /* bottom buttons */ + RND_DAD_BUTTON(isch_ctx.dlg, "Import!"); + RND_DAD_CHANGE_CB(isch_ctx.dlg, isch_import_cb); + RND_DAD_BEGIN_HBOX(isch_ctx.dlg); + RND_DAD_COMPFLAG(isch_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_END(isch_ctx.dlg); + RND_DAD_BUTTON_CLOSES(isch_ctx.dlg, clbtn); + RND_DAD_END(isch_ctx.dlg); + RND_DAD_END(isch_ctx.dlg); free(pa); @@ -353,8 +353,8 @@ /* set up the context */ isch_ctx.active = 1; - PCB_DAD_DEFSIZE(isch_ctx.dlg, 360, 400); - PCB_DAD_NEW("import_sch", isch_ctx.dlg, "Import schematics/netlist", &isch_ctx, pcb_false, isch_close_cb); + RND_DAD_DEFSIZE(isch_ctx.dlg, 360, 400); + RND_DAD_NEW("import_sch", isch_ctx.dlg, "Import schematics/netlist", &isch_ctx, pcb_false, isch_close_cb); isch_pcb2dlg(); return 0; } Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 30991) +++ trunk/src_plugins/io_lihata/write.c (revision 30992) @@ -1756,27 +1756,27 @@ io_lihata_save_t *save = calloc(sizeof(io_lihata_save_t), 1); if (type == PCB_IOT_PCB) { - PCB_DAD_BEGIN_HBOX(sub->dlg); - PCB_DAD_LABEL(sub->dlg, "Omit font"); - PCB_DAD_HELP(sub->dlg, "Do not save the font subtree\nWARNING: this will make the board depend on\nthe default font available on systems\nwhere it is loaded; if multiple fonts\nare used, all will be displayed using the default"); - PCB_DAD_BOOL(sub->dlg, ""); - PCB_DAD_DEFAULT_NUM(sub->dlg, !!conf_io_lihata.plugins.io_lihata.omit_font); - save->womit_font = PCB_DAD_CURRENT(sub->dlg); - PCB_DAD_END(sub->dlg); - PCB_DAD_BEGIN_HBOX(sub->dlg); - PCB_DAD_LABEL(sub->dlg, "Omit config"); - PCB_DAD_HELP(sub->dlg, "Do not save the config subtree\nWARNING: this will lose all DESIGN role\nconfig setting in the resulting file"); - PCB_DAD_BOOL(sub->dlg, ""); - PCB_DAD_DEFAULT_NUM(sub->dlg, !!conf_io_lihata.plugins.io_lihata.omit_config); - save->womit_config = PCB_DAD_CURRENT(sub->dlg); - PCB_DAD_END(sub->dlg); - PCB_DAD_BEGIN_HBOX(sub->dlg); - PCB_DAD_LABEL(sub->dlg, "Omit styles"); - PCB_DAD_HELP(sub->dlg, "Do not save the routing style subtree\nThe resulting file will have no\nrouting styles"); - PCB_DAD_BOOL(sub->dlg, ""); - PCB_DAD_DEFAULT_NUM(sub->dlg, !!conf_io_lihata.plugins.io_lihata.omit_styles); - save->womit_styles = PCB_DAD_CURRENT(sub->dlg); - PCB_DAD_END(sub->dlg); + RND_DAD_BEGIN_HBOX(sub->dlg); + RND_DAD_LABEL(sub->dlg, "Omit font"); + RND_DAD_HELP(sub->dlg, "Do not save the font subtree\nWARNING: this will make the board depend on\nthe default font available on systems\nwhere it is loaded; if multiple fonts\nare used, all will be displayed using the default"); + RND_DAD_BOOL(sub->dlg, ""); + RND_DAD_DEFAULT_NUM(sub->dlg, !!conf_io_lihata.plugins.io_lihata.omit_font); + save->womit_font = RND_DAD_CURRENT(sub->dlg); + RND_DAD_END(sub->dlg); + RND_DAD_BEGIN_HBOX(sub->dlg); + RND_DAD_LABEL(sub->dlg, "Omit config"); + RND_DAD_HELP(sub->dlg, "Do not save the config subtree\nWARNING: this will lose all DESIGN role\nconfig setting in the resulting file"); + RND_DAD_BOOL(sub->dlg, ""); + RND_DAD_DEFAULT_NUM(sub->dlg, !!conf_io_lihata.plugins.io_lihata.omit_config); + save->womit_config = RND_DAD_CURRENT(sub->dlg); + RND_DAD_END(sub->dlg); + RND_DAD_BEGIN_HBOX(sub->dlg); + RND_DAD_LABEL(sub->dlg, "Omit styles"); + RND_DAD_HELP(sub->dlg, "Do not save the routing style subtree\nThe resulting file will have no\nrouting styles"); + RND_DAD_BOOL(sub->dlg, ""); + RND_DAD_DEFAULT_NUM(sub->dlg, !!conf_io_lihata.plugins.io_lihata.omit_styles); + save->womit_styles = RND_DAD_CURRENT(sub->dlg); + RND_DAD_END(sub->dlg); } return save; } Index: trunk/src_plugins/lib_gtk_common/dlg_topwin.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_topwin.c (revision 30991) +++ trunk/src_plugins/lib_gtk_common/dlg_topwin.c (revision 30992) @@ -134,7 +134,7 @@ gtk_widget_destroy(docked->frame); gdl_remove(&tw->dock[docked->where], sub, link); free(docked); - PCB_DAD_FREE(sub->dlg); + RND_DAD_FREE(sub->dlg); } /*** static top window code ***/ Index: trunk/src_plugins/lib_hid_common/act_dad.c =================================================================== --- trunk/src_plugins/lib_hid_common/act_dad.c (revision 30991) +++ trunk/src_plugins/lib_hid_common/act_dad.c (revision 30992) @@ -61,7 +61,7 @@ }; typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) rnd_hidlib_t *hidlib; char *name; const char *row_domain; @@ -105,7 +105,7 @@ static void dad_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) { dad_t *dad = caller_data; - PCB_DAD_FREE(dad->dlg); + RND_DAD_FREE(dad->dlg); dad_destroy(dad); } @@ -231,14 +231,14 @@ if (rnd_strcasecmp(cmd, "label") == 0) { if (dad->running) goto cant_chg; RND_PCB_ACT_CONVARG(3, FGW_STR, dad, txt = argv[3].val.str); - PCB_DAD_LABEL(dad->dlg, txt); - rv = PCB_DAD_CURRENT(dad->dlg); + RND_DAD_LABEL(dad->dlg, txt); + rv = RND_DAD_CURRENT(dad->dlg); } else if (rnd_strcasecmp(cmd, "button") == 0) { if (dad->running) goto cant_chg; RND_PCB_ACT_CONVARG(3, FGW_STR, dad, txt = argv[3].val.str); - PCB_DAD_BUTTON(dad->dlg, tmp_str_dup(dad, txt)); - rv = PCB_DAD_CURRENT(dad->dlg); + RND_DAD_BUTTON(dad->dlg, tmp_str_dup(dad, txt)); + rv = RND_DAD_CURRENT(dad->dlg); } else if (rnd_strcasecmp(cmd, "button_closes") == 0) { int n, ret; @@ -245,25 +245,25 @@ if (dad->running) goto cant_chg; - PCB_DAD_BEGIN_HBOX(dad->dlg); - PCB_DAD_BEGIN_HBOX(dad->dlg); - PCB_DAD_COMPFLAG(dad->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(dad->dlg); + RND_DAD_BEGIN_HBOX(dad->dlg); + RND_DAD_BEGIN_HBOX(dad->dlg); + RND_DAD_COMPFLAG(dad->dlg, RND_HATF_EXPFILL); + RND_DAD_END(dad->dlg); for(n = 3; n < argc; n+=2) { RND_PCB_ACT_CONVARG(n+0, FGW_STR, dad, txt = argv[n+0].val.str); RND_PCB_ACT_CONVARG(n+1, FGW_INT, dad, ret = argv[n+1].val.nat_int); - PCB_DAD_BUTTON_CLOSE(dad->dlg, tmp_str_dup(dad, txt), ret); - rv = PCB_DAD_CURRENT(dad->dlg); + RND_DAD_BUTTON_CLOSE(dad->dlg, tmp_str_dup(dad, txt), ret); + rv = RND_DAD_CURRENT(dad->dlg); } - PCB_DAD_END(dad->dlg); + RND_DAD_END(dad->dlg); } else if (rnd_strcasecmp(cmd, "bool") == 0) { if (dad->running) goto cant_chg; txt = ""; rnd_PCB_ACT_MAY_CONVARG(3, FGW_STR, dad, txt = argv[3].val.str); - PCB_DAD_BOOL(dad->dlg, txt); - rv = PCB_DAD_CURRENT(dad->dlg); + RND_DAD_BOOL(dad->dlg, txt); + rv = RND_DAD_CURRENT(dad->dlg); } else if (rnd_strcasecmp(cmd, "integer") == 0) { long vmin, vmax; @@ -272,9 +272,9 @@ RND_PCB_ACT_CONVARG(3, FGW_LONG, dad, vmin = argv[3].val.nat_long); RND_PCB_ACT_CONVARG(4, FGW_LONG, dad, vmax = argv[4].val.nat_long); rnd_PCB_ACT_MAY_CONVARG(5, FGW_STR, dad, txt = argv[5].val.str); - PCB_DAD_INTEGER(dad->dlg, txt); - PCB_DAD_MINMAX(dad->dlg, vmin, vmax); - rv = PCB_DAD_CURRENT(dad->dlg); + RND_DAD_INTEGER(dad->dlg, txt); + RND_DAD_MINMAX(dad->dlg, vmin, vmax); + rv = RND_DAD_CURRENT(dad->dlg); } else if (rnd_strcasecmp(cmd, "real") == 0) { double vmin, vmax; @@ -283,9 +283,9 @@ RND_PCB_ACT_CONVARG(3, FGW_DOUBLE, dad, vmin = argv[3].val.nat_double); RND_PCB_ACT_CONVARG(4, FGW_DOUBLE, dad, vmax = argv[4].val.nat_double); rnd_PCB_ACT_MAY_CONVARG(5, FGW_STR, dad, txt = argv[5].val.str); - PCB_DAD_REAL(dad->dlg, txt); - PCB_DAD_MINMAX(dad->dlg, vmin, vmax); - rv = PCB_DAD_CURRENT(dad->dlg); + RND_DAD_REAL(dad->dlg, txt); + RND_DAD_MINMAX(dad->dlg, vmin, vmax); + rv = RND_DAD_CURRENT(dad->dlg); } else if (rnd_strcasecmp(cmd, "coord") == 0) { rnd_coord_t vmin, vmax; @@ -294,19 +294,19 @@ RND_PCB_ACT_CONVARG(3, FGW_COORD_, dad, vmin = fgw_coord(&argv[3])); RND_PCB_ACT_CONVARG(4, FGW_COORD_, dad, vmax = fgw_coord(&argv[4])); rnd_PCB_ACT_MAY_CONVARG(5, FGW_STR, dad, txt = argv[5].val.str); - PCB_DAD_COORD(dad->dlg, txt); - PCB_DAD_MINMAX(dad->dlg, vmin, vmax); - rv = PCB_DAD_CURRENT(dad->dlg); + RND_DAD_COORD(dad->dlg, txt); + RND_DAD_MINMAX(dad->dlg, vmin, vmax); + rv = RND_DAD_CURRENT(dad->dlg); } else if (rnd_strcasecmp(cmd, "string") == 0) { if (dad->running) goto cant_chg; - PCB_DAD_STRING(dad->dlg); - rv = PCB_DAD_CURRENT(dad->dlg); + RND_DAD_STRING(dad->dlg); + rv = RND_DAD_CURRENT(dad->dlg); } else if (rnd_strcasecmp(cmd, "progress") == 0) { if (dad->running) goto cant_chg; - PCB_DAD_PROGRESS(dad->dlg); - rv = PCB_DAD_CURRENT(dad->dlg); + RND_DAD_PROGRESS(dad->dlg); + rv = RND_DAD_CURRENT(dad->dlg); } else if ((rnd_strcasecmp(cmd, "enum") == 0) || (rnd_strcasecmp(cmd, "begin_tabbed") == 0)) { char **values = tmp_new_strlist(dad); @@ -317,12 +317,12 @@ if (split_tablist(dad, values, txt, cmd) == 0) { if (*cmd == 'b') { - PCB_DAD_BEGIN_TABBED(dad->dlg, (const char **)values); + RND_DAD_BEGIN_TABBED(dad->dlg, (const char **)values); dad->level++; } else - PCB_DAD_ENUM(dad->dlg, (const char **)values); - rv = PCB_DAD_CURRENT(dad->dlg); + RND_DAD_ENUM(dad->dlg, (const char **)values); + rv = RND_DAD_CURRENT(dad->dlg); } else rv = -1; @@ -339,10 +339,10 @@ rnd_PCB_ACT_MAY_CONVARG(5, FGW_STR, dad, txt = argv[5].val.str); if ((txt == NULL) || (split_tablist(dad, values, txt, cmd) == 0)) { - PCB_DAD_TREE(dad->dlg, cols, istree, (const char **)values); - PCB_DAD_TREE_SET_CB(dad->dlg, free_cb, dad_row_free_cb); - PCB_DAD_TREE_SET_CB(dad->dlg, ctx, dad); - rv = PCB_DAD_CURRENT(dad->dlg); + RND_DAD_TREE(dad->dlg, cols, istree, (const char **)values); + RND_DAD_TREE_SET_CB(dad->dlg, free_cb, dad_row_free_cb); + RND_DAD_TREE_SET_CB(dad->dlg, ctx, dad); + rv = RND_DAD_CURRENT(dad->dlg); } else rv = -1; @@ -366,11 +366,11 @@ if ((txt == NULL) || (split_tablist(dad, values, txt, cmd) == 0)) { if (cmd[5] == 'i') - nrow = PCB_DAD_TREE_INSERT(dad->dlg, row, values); + nrow = RND_DAD_TREE_INSERT(dad->dlg, row, values); else if (cmd[11] == '_') - nrow = PCB_DAD_TREE_APPEND_UNDER(dad->dlg, row, values); + nrow = RND_DAD_TREE_APPEND_UNDER(dad->dlg, row, values); else - nrow = PCB_DAD_TREE_APPEND(dad->dlg, row, values); + nrow = RND_DAD_TREE_APPEND(dad->dlg, row, values); } else nrow = NULL; @@ -379,27 +379,27 @@ } else if (rnd_strcasecmp(cmd, "begin_hbox") == 0) { if (dad->running) goto cant_chg; - PCB_DAD_BEGIN_HBOX(dad->dlg); + RND_DAD_BEGIN_HBOX(dad->dlg); dad->level++; - rv = PCB_DAD_CURRENT(dad->dlg); + rv = RND_DAD_CURRENT(dad->dlg); } else if (rnd_strcasecmp(cmd, "begin_vbox") == 0) { if (dad->running) goto cant_chg; - PCB_DAD_BEGIN_VBOX(dad->dlg); + RND_DAD_BEGIN_VBOX(dad->dlg); dad->level++; - rv = PCB_DAD_CURRENT(dad->dlg); + rv = RND_DAD_CURRENT(dad->dlg); } else if (rnd_strcasecmp(cmd, "begin_hpane") == 0) { if (dad->running) goto cant_chg; - PCB_DAD_BEGIN_HPANE(dad->dlg); + RND_DAD_BEGIN_HPANE(dad->dlg); dad->level++; - rv = PCB_DAD_CURRENT(dad->dlg); + rv = RND_DAD_CURRENT(dad->dlg); } else if (rnd_strcasecmp(cmd, "begin_vpane") == 0) { if (dad->running) goto cant_chg; - PCB_DAD_BEGIN_VPANE(dad->dlg); + RND_DAD_BEGIN_VPANE(dad->dlg); dad->level++; - rv = PCB_DAD_CURRENT(dad->dlg); + rv = RND_DAD_CURRENT(dad->dlg); } else if (rnd_strcasecmp(cmd, "begin_table") == 0) { int cols; @@ -407,16 +407,16 @@ if (dad->running) goto cant_chg; RND_PCB_ACT_CONVARG(3, FGW_INT, dad, cols = argv[3].val.nat_int); - PCB_DAD_BEGIN_TABLE(dad->dlg, cols); + RND_DAD_BEGIN_TABLE(dad->dlg, cols); dad->level++; - rv = PCB_DAD_CURRENT(dad->dlg); + rv = RND_DAD_CURRENT(dad->dlg); } else if (rnd_strcasecmp(cmd, "end") == 0) { if (dad->running) goto cant_chg; - PCB_DAD_END(dad->dlg); + RND_DAD_END(dad->dlg); dad->level--; - rv = PCB_DAD_CURRENT(dad->dlg); + rv = RND_DAD_CURRENT(dad->dlg); } else if (rnd_strcasecmp(cmd, "flags") == 0) { int n; @@ -433,13 +433,13 @@ rnd_message(RND_MSG_ERROR, "Invalid DAD flag: %s (ignored)\n", txt); flg |= tmp; } - PCB_DAD_COMPFLAG(dad->dlg, flg); - rv = PCB_DAD_CURRENT(dad->dlg); + RND_DAD_COMPFLAG(dad->dlg, flg); + rv = RND_DAD_CURRENT(dad->dlg); } else if (rnd_strcasecmp(cmd, "onchange") == 0) { RND_PCB_ACT_CONVARG(3, FGW_STR, dad, txt = argv[3].val.str); - PCB_DAD_CHANGE_CB(dad->dlg, dad_change_cb); - vts0_set(&dad->change_cb, PCB_DAD_CURRENT(dad->dlg), tmp_str_dup(dad, txt)); + RND_DAD_CHANGE_CB(dad->dlg, dad_change_cb); + vts0_set(&dad->change_cb, RND_DAD_CURRENT(dad->dlg), tmp_str_dup(dad, txt)); rv = 0; } else if (rnd_strcasecmp(cmd, "set") == 0) { @@ -462,23 +462,23 @@ switch(wtype) { case RND_HATT_COORD: RND_PCB_ACT_CONVARG(4, FGW_COORD, dad, c = fgw_coord(&argv[4])); - PCB_DAD_SET_VALUE(dad->dlg_hid_ctx, wid, crd, c); + RND_DAD_SET_VALUE(dad->dlg_hid_ctx, wid, crd, c); break; case RND_HATT_REAL: case RND_HATT_PROGRESS: RND_PCB_ACT_CONVARG(4, FGW_DOUBLE, dad, d = argv[4].val.nat_double); - PCB_DAD_SET_VALUE(dad->dlg_hid_ctx, wid, dbl, d); + RND_DAD_SET_VALUE(dad->dlg_hid_ctx, wid, dbl, d); break; case RND_HATT_INTEGER: case RND_HATT_BOOL: RND_PCB_ACT_CONVARG(4, FGW_INT, dad, i = argv[4].val.nat_int); - PCB_DAD_SET_VALUE(dad->dlg_hid_ctx, wid, lng, i); + RND_DAD_SET_VALUE(dad->dlg_hid_ctx, wid, lng, i); break; case RND_HATT_STRING: case RND_HATT_LABEL: case RND_HATT_BUTTON: RND_PCB_ACT_CONVARG(4, FGW_STR, dad, txt = argv[4].val.str); - PCB_DAD_SET_VALUE(dad->dlg_hid_ctx, wid, str, txt); + RND_DAD_SET_VALUE(dad->dlg_hid_ctx, wid, str, txt); break; default: rnd_message(RND_MSG_ERROR, "Invalid widget type %d - can not change value (set ignored)\n", wid); @@ -546,8 +546,8 @@ rv = -1; } else { - PCB_DAD_NEW(dlgname, dad->dlg, txt, dad, (cmd[3] == '_'), dad_close_cb); - rv = PCB_DAD_CURRENT(dad->dlg); + RND_DAD_NEW(dlgname, dad->dlg, txt, dad, (cmd[3] == '_'), dad_close_cb); + rv = RND_DAD_CURRENT(dad->dlg); } } else { Index: trunk/src_plugins/lib_hid_common/dlg_comm_m.c =================================================================== --- trunk/src_plugins/lib_hid_common/dlg_comm_m.c (revision 30991) +++ trunk/src_plugins/lib_hid_common/dlg_comm_m.c (revision 30992) @@ -40,8 +40,8 @@ static void prompt_enter_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) { - pcb_dad_retovr_t **ro = attr->user_data; - pcb_hid_dad_close(hid_ctx, *ro, 0); + rnd_dad_retovr_t **ro = attr->user_data; + rnd_hid_dad_close(hid_ctx, *ro, 0); } fgw_error_t pcb_act_gui_PromptFor(fgw_arg_t *res, int argc, fgw_arg_t *argv) @@ -50,39 +50,39 @@ const char *pcb_acts_gui_PromptFor = nope; char *title = NULL; int ws, ft = 0; - pcb_hid_dad_buttons_t clbtn[] = {{"ok", 0}, {NULL, 0}}; - PCB_DAD_DECL(dlg); + rnd_hid_dad_buttons_t clbtn[] = {{"ok", 0}, {NULL, 0}}; + RND_DAD_DECL(dlg); RND_PCB_ACT_CONVARG(1, FGW_STR, gui_PromptFor, label = argv[1].val.str); rnd_PCB_ACT_MAY_CONVARG(2, FGW_STR, gui_PromptFor, default_str = argv[2].val.str); rnd_PCB_ACT_MAY_CONVARG(3, FGW_STR, gui_PromptFor, title = argv[3].val.str); - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_LABEL(dlg, label); - PCB_DAD_STRING(dlg); - ws = PCB_DAD_CURRENT(dlg); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_LABEL(dlg, label); + RND_DAD_STRING(dlg); + ws = RND_DAD_CURRENT(dlg); dlg[ws].val.str = rnd_strdup(default_str == NULL ? "" : default_str); - PCB_DAD_ENTER_CB(dlg, prompt_enter_cb); + RND_DAD_ENTER_CB(dlg, prompt_enter_cb); dlg[ws].user_data = &dlg_ret_override; - PCB_DAD_BUTTON_CLOSES(dlg, clbtn); - PCB_DAD_END(dlg); + RND_DAD_BUTTON_CLOSES(dlg, clbtn); + RND_DAD_END(dlg); if (title == NULL) { title = pcb_concat(pcbhl_app_package, " user input", NULL); ft = 1; } - PCB_DAD_NEW("prompt_for", dlg, title, NULL, pcb_true, NULL); + RND_DAD_NEW("prompt_for", dlg, title, NULL, pcb_true, NULL); if (ft) free(title); - if (PCB_DAD_RUN(dlg) != 0) { - PCB_DAD_FREE(dlg); + if (RND_DAD_RUN(dlg) != 0) { + RND_DAD_FREE(dlg); return -1; } res->type = FGW_STR | FGW_DYN; res->val.str = rnd_strdup(dlg[ws].val.str); - PCB_DAD_FREE(dlg); + RND_DAD_FREE(dlg); return 0; } @@ -95,44 +95,44 @@ const char **xpm; int n, ret; - PCB_DAD_DECL(dlg); + RND_DAD_DECL(dlg); RND_PCB_ACT_CONVARG(1, FGW_STR, gui_MessageBox, icon = argv[1].val.str); RND_PCB_ACT_CONVARG(2, FGW_STR, gui_MessageBox, title = argv[2].val.str); RND_PCB_ACT_CONVARG(3, FGW_STR, gui_MessageBox, label = argv[3].val.str); - PCB_DAD_BEGIN_VBOX(dlg); + RND_DAD_BEGIN_VBOX(dlg); /* icon and label */ - PCB_DAD_BEGIN_HBOX(dlg); + RND_DAD_BEGIN_HBOX(dlg); xpm = pcp_dlg_xpm_by_name(icon); if (xpm != NULL) - PCB_DAD_PICTURE(dlg, xpm); - PCB_DAD_LABEL(dlg, label); - PCB_DAD_END(dlg); + RND_DAD_PICTURE(dlg, xpm); + RND_DAD_LABEL(dlg, label); + RND_DAD_END(dlg); /* close buttons */ - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); - PCB_DAD_END(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); + RND_DAD_END(dlg); for(n = 4; n < argc; n+=2) { RND_PCB_ACT_CONVARG(n+0, FGW_STR, gui_MessageBox, txt = argv[n+0].val.str); RND_PCB_ACT_CONVARG(n+1, FGW_INT, gui_MessageBox, ret = argv[n+1].val.nat_int); - PCB_DAD_BUTTON_CLOSE(dlg, txt, ret); + RND_DAD_BUTTON_CLOSE(dlg, txt, ret); } - PCB_DAD_END(dlg); + RND_DAD_END(dlg); - PCB_DAD_END(dlg); + RND_DAD_END(dlg); res->type = FGW_INT; - PCB_DAD_AUTORUN("message", dlg, title, NULL, res->val.nat_int); - PCB_DAD_FREE(dlg); + RND_DAD_AUTORUN("message", dlg, title, NULL, res->val.nat_int); + RND_DAD_FREE(dlg); return 0; } typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int wclr, wr, wg, wb; rnd_color_t clr; } clrpick_t; @@ -160,7 +160,7 @@ { const char *sclr; const char *pcb_acts_gui_PromptFor = nope; - pcb_hid_dad_buttons_t clbtn[] = {{"ok", 0}, {"cancel", 1}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"ok", 0}, {"cancel", 1}, {NULL, 0}}; clrpick_t ctx; rnd_hid_attr_val_t val; @@ -170,31 +170,31 @@ if (rnd_color_load_str(&ctx.clr, sclr) != 0) return -1; - PCB_DAD_BEGIN_VBOX(ctx.dlg); - PCB_DAD_COLOR(ctx.dlg); - ctx.wclr = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_COMPFLAG(ctx.dlg, RND_HATF_CLR_STATIC); - PCB_DAD_BEGIN_TABLE(ctx.dlg, 2); - PCB_DAD_LABEL(ctx.dlg, "red"); - PCB_DAD_INTEGER(ctx.dlg, ""); - PCB_DAD_MINMAX(ctx.dlg, 0, 255); - PCB_DAD_CHANGE_CB(ctx.dlg, color_change_cb); - ctx.wr = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_LABEL(ctx.dlg, "green"); - PCB_DAD_INTEGER(ctx.dlg, ""); - PCB_DAD_MINMAX(ctx.dlg, 0, 255); - PCB_DAD_CHANGE_CB(ctx.dlg, color_change_cb); - ctx.wg = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_LABEL(ctx.dlg, "blue"); - PCB_DAD_INTEGER(ctx.dlg, ""); - PCB_DAD_MINMAX(ctx.dlg, 0, 255); - PCB_DAD_CHANGE_CB(ctx.dlg, color_change_cb); - ctx.wb = PCB_DAD_CURRENT(ctx.dlg); - PCB_DAD_BUTTON_CLOSES(ctx.dlg, clbtn); - PCB_DAD_END(ctx.dlg); - PCB_DAD_END(ctx.dlg); + RND_DAD_BEGIN_VBOX(ctx.dlg); + RND_DAD_COLOR(ctx.dlg); + ctx.wclr = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_COMPFLAG(ctx.dlg, RND_HATF_CLR_STATIC); + RND_DAD_BEGIN_TABLE(ctx.dlg, 2); + RND_DAD_LABEL(ctx.dlg, "red"); + RND_DAD_INTEGER(ctx.dlg, ""); + RND_DAD_MINMAX(ctx.dlg, 0, 255); + RND_DAD_CHANGE_CB(ctx.dlg, color_change_cb); + ctx.wr = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_LABEL(ctx.dlg, "green"); + RND_DAD_INTEGER(ctx.dlg, ""); + RND_DAD_MINMAX(ctx.dlg, 0, 255); + RND_DAD_CHANGE_CB(ctx.dlg, color_change_cb); + ctx.wg = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_LABEL(ctx.dlg, "blue"); + RND_DAD_INTEGER(ctx.dlg, ""); + RND_DAD_MINMAX(ctx.dlg, 0, 255); + RND_DAD_CHANGE_CB(ctx.dlg, color_change_cb); + ctx.wb = RND_DAD_CURRENT(ctx.dlg); + RND_DAD_BUTTON_CLOSES(ctx.dlg, clbtn); + RND_DAD_END(ctx.dlg); + RND_DAD_END(ctx.dlg); - PCB_DAD_NEW("fallback_color_pick", ctx.dlg, "Change color", &ctx, pcb_true, NULL); + RND_DAD_NEW("fallback_color_pick", ctx.dlg, "Change color", &ctx, pcb_true, NULL); val.lng = ctx.clr.r; @@ -206,14 +206,14 @@ val.clr = ctx.clr; rnd_gui->attr_dlg_set_value(ctx.dlg_hid_ctx, ctx.wclr, &val); - if (PCB_DAD_RUN(ctx.dlg) != 0) { - PCB_DAD_FREE(ctx.dlg); + if (RND_DAD_RUN(ctx.dlg) != 0) { + RND_DAD_FREE(ctx.dlg); return -1; } res->type = FGW_STR | FGW_DYN; res->val.str = pcb_strdup_printf("#%02x%02x%02x", ctx.clr.r, ctx.clr.g, ctx.clr.b); - PCB_DAD_FREE(ctx.dlg); + RND_DAD_FREE(ctx.dlg); return 0; } @@ -224,9 +224,9 @@ const char *pcb_acts_gui_MayOverwriteFile = nope; const char **xpm; int multi, wdontask; - pcb_hid_dad_buttons_t clbtn_s[] = {{"yes", 1}, {"no", 0}, {NULL, 0}}; - pcb_hid_dad_buttons_t clbtn_m[] = {{"yes", 1}, {"yes to all", 2}, {"no", 0}, {NULL, 0}}; - PCB_DAD_DECL(dlg); + rnd_hid_dad_buttons_t clbtn_s[] = {{"yes", 1}, {"no", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn_m[] = {{"yes", 1}, {"yes to all", 2}, {"no", 0}, {NULL, 0}}; + RND_DAD_DECL(dlg); if (!RND_HAVE_GUI_ATTR_DLG) { RND_ACT_IRES(0); /* no gui means auto-yes (for batch) */ @@ -242,45 +242,45 @@ RND_PCB_ACT_CONVARG(1, FGW_STR, gui_MayOverwriteFile, fn = argv[1].val.str); RND_PCB_ACT_CONVARG(2, FGW_INT, gui_MayOverwriteFile, multi = argv[2].val.nat_int); - PCB_DAD_BEGIN_VBOX(dlg); + RND_DAD_BEGIN_VBOX(dlg); /* icon and label */ - PCB_DAD_BEGIN_HBOX(dlg); + RND_DAD_BEGIN_HBOX(dlg); xpm = pcp_dlg_xpm_by_name("warning"); if (xpm != NULL) - PCB_DAD_PICTURE(dlg, xpm); + RND_DAD_PICTURE(dlg, xpm); - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_LABEL(dlg, "File "); - PCB_DAD_LABEL(dlg, fn); - PCB_DAD_LABEL(dlg, " already exists."); - PCB_DAD_END(dlg); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_LABEL(dlg, "File "); + RND_DAD_LABEL(dlg, fn); + RND_DAD_LABEL(dlg, " already exists."); + RND_DAD_END(dlg); - PCB_DAD_LABEL(dlg, "Do you want to overwrite that file?"); + RND_DAD_LABEL(dlg, "Do you want to overwrite that file?"); - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_BOOL(dlg, ""); - wdontask = PCB_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, "do not ask, always overwrite"); - PCB_DAD_HELP(dlg, "saved in your user config under plugins/dialogs/file_overwrite_dialog/dont_ask"); - PCB_DAD_END(dlg); - PCB_DAD_END(dlg); - PCB_DAD_END(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_BOOL(dlg, ""); + wdontask = RND_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "do not ask, always overwrite"); + RND_DAD_HELP(dlg, "saved in your user config under plugins/dialogs/file_overwrite_dialog/dont_ask"); + RND_DAD_END(dlg); + RND_DAD_END(dlg); + RND_DAD_END(dlg); if (multi) - PCB_DAD_BUTTON_CLOSES(dlg, clbtn_m); + RND_DAD_BUTTON_CLOSES(dlg, clbtn_m); else - PCB_DAD_BUTTON_CLOSES(dlg, clbtn_s); - PCB_DAD_END(dlg); + RND_DAD_BUTTON_CLOSES(dlg, clbtn_s); + RND_DAD_END(dlg); res->type = FGW_INT; - PCB_DAD_AUTORUN("MayOverwriteFile", dlg, "File overwrite question", NULL, res->val.nat_int); + RND_DAD_AUTORUN("MayOverwriteFile", dlg, "File overwrite question", NULL, res->val.nat_int); if (dlg[wdontask].val.lng) { rnd_conf_set(RND_CFR_USER, "plugins/dialogs/file_overwrite_dialog/dont_ask", 0, "1", RND_POL_OVERWRITE); if (rnd_conf_isdirty(RND_CFR_USER)) rnd_conf_save_file(hidlib, NULL, NULL, RND_CFR_USER, NULL); } - PCB_DAD_FREE(dlg); + RND_DAD_FREE(dlg); return 0; } Index: trunk/src_plugins/lib_hid_common/dlg_log.c =================================================================== --- trunk/src_plugins/lib_hid_common/dlg_log.c (revision 30991) +++ trunk/src_plugins/lib_hid_common/dlg_log.c (revision 30992) @@ -37,7 +37,7 @@ static const char *log_cookie = "dlg_log"; typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) unsigned long last_added; int active; int wtxt, wscroll; @@ -142,34 +142,34 @@ memset(ctx, 0, sizeof(log_ctx_t)); ctx->hidlib = hidlib; - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_TEXT(ctx->dlg, NULL); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_SCROLL | RND_HATF_EXPFILL); - ctx->wtxt = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "clear"); - PCB_DAD_CHANGE_CB(ctx->dlg, btn_clear_cb); - PCB_DAD_BUTTON(ctx->dlg, "export"); - PCB_DAD_CHANGE_CB(ctx->dlg, btn_export_cb); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); - PCB_DAD_BOOL(ctx->dlg, ""); - ctx->wscroll = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "scroll"); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON_CLOSE(ctx->dlg, "close", 0); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_TEXT(ctx->dlg, NULL); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_SCROLL | RND_HATF_EXPFILL); + ctx->wtxt = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "clear"); + RND_DAD_CHANGE_CB(ctx->dlg, btn_clear_cb); + RND_DAD_BUTTON(ctx->dlg, "export"); + RND_DAD_CHANGE_CB(ctx->dlg, btn_export_cb); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_FRAME); + RND_DAD_BOOL(ctx->dlg, ""); + ctx->wscroll = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "scroll"); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON_CLOSE(ctx->dlg, "close", 0); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); ctx->active = 1; ctx->last_added = -1; - PCB_DAD_DEFSIZE(ctx->dlg, 200, 300); + RND_DAD_DEFSIZE(ctx->dlg, 200, 300); title = pcb_concat(pcbhl_app_package, " message log", NULL); - PCB_DAD_NEW("log", ctx->dlg, title, ctx, pcb_false, log_close_cb); + RND_DAD_NEW("log", ctx->dlg, title, ctx, pcb_false, log_close_cb); free(title); { Index: trunk/src_plugins/lib_hid_common/toolbar.c =================================================================== --- trunk/src_plugins/lib_hid_common/toolbar.c (revision 30991) +++ trunk/src_plugins/lib_hid_common/toolbar.c (revision 30992) @@ -88,14 +88,14 @@ help = menufile_help; if (tool->icon != NULL) - PCB_DAD_PICBUTTON(toolbar.sub.dlg, tool->icon); + RND_DAD_PICBUTTON(toolbar.sub.dlg, tool->icon); else - PCB_DAD_BUTTON(toolbar.sub.dlg, tool->name); - PCB_DAD_CHANGE_CB(toolbar.sub.dlg, toolbar_select_cb); - PCB_DAD_COMPFLAG(toolbar.sub.dlg, RND_HATF_TIGHT | RND_HATF_TOGGLE); + RND_DAD_BUTTON(toolbar.sub.dlg, tool->name); + RND_DAD_CHANGE_CB(toolbar.sub.dlg, toolbar_select_cb); + RND_DAD_COMPFLAG(toolbar.sub.dlg, RND_HATF_TIGHT | RND_HATF_TOGGLE); if (help != NULL) - PCB_DAD_HELP(toolbar.sub.dlg, help); - wid = PCB_DAD_CURRENT(toolbar.sub.dlg); + RND_DAD_HELP(toolbar.sub.dlg, help); + wid = RND_DAD_CURRENT(toolbar.sub.dlg); toolbar.sub.dlg[wid].user_data = (void *)(ptrdiff_t)tid; vti0_set(&toolbar.tid2wid, tid, wid); } @@ -128,8 +128,8 @@ } } else { - PCB_DAD_LABEL(toolbar.sub.dlg, "No toolbar found in the menu file."); - PCB_DAD_HELP(toolbar.sub.dlg, "Check your menu file. If you use a locally modified or custom\nmenu file, make sure you merge upstream changes\n(such as the new toolbar subtree)"); + RND_DAD_LABEL(toolbar.sub.dlg, "No toolbar found in the menu file."); + RND_DAD_HELP(toolbar.sub.dlg, "Check your menu file. If you use a locally modified or custom\nmenu file, make sure you merge upstream changes\n(such as the new toolbar subtree)"); } } @@ -151,20 +151,20 @@ { toolbar.tid2wid.used = 0; - PCB_DAD_BEGIN_HBOX(toolbar.sub.dlg); - PCB_DAD_COMPFLAG(toolbar.sub.dlg, RND_HATF_EXPFILL | RND_HATF_TIGHT); + RND_DAD_BEGIN_HBOX(toolbar.sub.dlg); + RND_DAD_COMPFLAG(toolbar.sub.dlg, RND_HATF_EXPFILL | RND_HATF_TIGHT); toolbar_create_static(cfg); toolbar_create_dyn_all(); /* eat up remaining space in the middle before displaying the dynamic tools */ - PCB_DAD_BEGIN_HBOX(toolbar.sub.dlg); - PCB_DAD_COMPFLAG(toolbar.sub.dlg, RND_HATF_EXPFILL); - PCB_DAD_END(toolbar.sub.dlg); + RND_DAD_BEGIN_HBOX(toolbar.sub.dlg); + RND_DAD_COMPFLAG(toolbar.sub.dlg, RND_HATF_EXPFILL); + RND_DAD_END(toolbar.sub.dlg); /* later on dynamic tools would be displayed here */ - PCB_DAD_END(toolbar.sub.dlg); + RND_DAD_END(toolbar.sub.dlg); } static void toolbar_create(void) Index: trunk/src_plugins/lib_hid_pcbui/layersel.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/layersel.c (revision 30991) +++ trunk/src_plugins/lib_hid_pcbui/layersel.c (revision 30992) @@ -488,52 +488,52 @@ static void layersel_begin_grp_open(layersel_ctx_t *ls, const char *name, ls_group_t *lsg) { - PCB_DAD_BEGIN_HBOX(ls->sub.dlg); - lsg->wopen = PCB_DAD_CURRENT(ls->sub.dlg); + RND_DAD_BEGIN_HBOX(ls->sub.dlg); + lsg->wopen = RND_DAD_CURRENT(ls->sub.dlg); /* vertical group name */ - PCB_DAD_LABEL(ls->sub.dlg, name); - PCB_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_TIGHT | RND_HATF_TEXT_VERTICAL | RND_HATF_TEXT_TRUNCATED); - PCB_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lsg); - PCB_DAD_RIGHT_CB(ls->sub.dlg, group_right_cb); - PCB_DAD_CHANGE_CB(ls->sub.dlg, group_open_cb); - PCB_DAD_HELP(ls->sub.dlg, name); + RND_DAD_LABEL(ls->sub.dlg, name); + RND_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_TIGHT | RND_HATF_TEXT_VERTICAL | RND_HATF_TEXT_TRUNCATED); + RND_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lsg); + RND_DAD_RIGHT_CB(ls->sub.dlg, group_right_cb); + RND_DAD_CHANGE_CB(ls->sub.dlg, group_open_cb); + RND_DAD_HELP(ls->sub.dlg, name); /* vert sep */ - PCB_DAD_BEGIN_HBOX(ls->sub.dlg); - PCB_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_TIGHT | RND_HATF_FRAME); - PCB_DAD_END(ls->sub.dlg); + RND_DAD_BEGIN_HBOX(ls->sub.dlg); + RND_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_TIGHT | RND_HATF_FRAME); + RND_DAD_END(ls->sub.dlg); /* layer list box */ - PCB_DAD_BEGIN_VBOX(ls->sub.dlg); - PCB_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_TIGHT); + RND_DAD_BEGIN_VBOX(ls->sub.dlg); + RND_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_TIGHT); } static void layersel_end_grp_open(layersel_ctx_t *ls) { - PCB_DAD_END(ls->sub.dlg); - PCB_DAD_END(ls->sub.dlg); + RND_DAD_END(ls->sub.dlg); + RND_DAD_END(ls->sub.dlg); } static void layersel_begin_grp_closed(layersel_ctx_t *ls, const char *name, ls_group_t *lsg) { - PCB_DAD_BEGIN_HBOX(ls->sub.dlg); - lsg->wclosed = PCB_DAD_CURRENT(ls->sub.dlg); - PCB_DAD_LABEL(ls->sub.dlg, name); - PCB_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lsg); - PCB_DAD_RIGHT_CB(ls->sub.dlg, group_right_cb); - PCB_DAD_CHANGE_CB(ls->sub.dlg, group_open_cb); + RND_DAD_BEGIN_HBOX(ls->sub.dlg); + lsg->wclosed = RND_DAD_CURRENT(ls->sub.dlg); + RND_DAD_LABEL(ls->sub.dlg, name); + RND_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lsg); + RND_DAD_RIGHT_CB(ls->sub.dlg, group_right_cb); + RND_DAD_CHANGE_CB(ls->sub.dlg, group_open_cb); /* vert sep */ - PCB_DAD_BEGIN_HBOX(ls->sub.dlg); - PCB_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_TIGHT | RND_HATF_FRAME); - PCB_DAD_END(ls->sub.dlg); + RND_DAD_BEGIN_HBOX(ls->sub.dlg); + RND_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_TIGHT | RND_HATF_FRAME); + RND_DAD_END(ls->sub.dlg); } static void layersel_end_grp_closed(layersel_ctx_t *ls) { - PCB_DAD_END(ls->sub.dlg); + RND_DAD_END(ls->sub.dlg); } @@ -542,23 +542,23 @@ layer_vis_box(&lys->on_open, 1, color, brd, hatch, 16, 16, 5); layer_vis_box(&lys->off_open, 0, color, brd, hatch, 16, 16, 5); - PCB_DAD_BEGIN_HBOX(ls->sub.dlg); - PCB_DAD_PICTURE(ls->sub.dlg, lys->on_open.xpm); - lys->wvis_on_open = PCB_DAD_CURRENT(ls->sub.dlg); - PCB_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); - PCB_DAD_CHANGE_CB(ls->sub.dlg, layer_vis_cb); - PCB_DAD_PICTURE(ls->sub.dlg, lys->off_open.xpm); - lys->wvis_off_open = PCB_DAD_CURRENT(ls->sub.dlg); - PCB_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); - PCB_DAD_CHANGE_CB(ls->sub.dlg, layer_vis_cb); - PCB_DAD_LABEL(ls->sub.dlg, name); - lys->wlab = PCB_DAD_CURRENT(ls->sub.dlg); - PCB_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); + RND_DAD_BEGIN_HBOX(ls->sub.dlg); + RND_DAD_PICTURE(ls->sub.dlg, lys->on_open.xpm); + lys->wvis_on_open = RND_DAD_CURRENT(ls->sub.dlg); + RND_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); + RND_DAD_CHANGE_CB(ls->sub.dlg, layer_vis_cb); + RND_DAD_PICTURE(ls->sub.dlg, lys->off_open.xpm); + lys->wvis_off_open = RND_DAD_CURRENT(ls->sub.dlg); + RND_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); + RND_DAD_CHANGE_CB(ls->sub.dlg, layer_vis_cb); + RND_DAD_LABEL(ls->sub.dlg, name); + lys->wlab = RND_DAD_CURRENT(ls->sub.dlg); + RND_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); if (selectable) { - PCB_DAD_CHANGE_CB(ls->sub.dlg, layer_sel_cb); - PCB_DAD_RIGHT_CB(ls->sub.dlg, layer_right_cb); + RND_DAD_CHANGE_CB(ls->sub.dlg, layer_sel_cb); + RND_DAD_RIGHT_CB(ls->sub.dlg, layer_right_cb); } - PCB_DAD_END(ls->sub.dlg); + RND_DAD_END(ls->sub.dlg); } static void layersel_create_layer_closed(layersel_ctx_t *ls, ls_layer_t *lys, const char *name, const rnd_color_t *color, int brd, int hatch, int selected, int selectable) @@ -566,39 +566,39 @@ layer_vis_box(&lys->on_closed, 1, color, brd, hatch, 10, 10, 0); layer_vis_box(&lys->off_closed, 0, color, brd, hatch, 10, 10, 0); - PCB_DAD_BEGIN_VBOX(ls->sub.dlg); - PCB_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_TIGHT); - PCB_DAD_PICTURE(ls->sub.dlg, lys->on_closed.xpm); - lys->wvis_on_closed = PCB_DAD_CURRENT(ls->sub.dlg); - PCB_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); - PCB_DAD_CHANGE_CB(ls->sub.dlg, layer_vis_cb); - PCB_DAD_HELP(ls->sub.dlg, name); - PCB_DAD_PICTURE(ls->sub.dlg, lys->off_closed.xpm); - lys->wvis_off_closed = PCB_DAD_CURRENT(ls->sub.dlg); - PCB_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); - PCB_DAD_CHANGE_CB(ls->sub.dlg, layer_vis_cb); - PCB_DAD_HELP(ls->sub.dlg, name); + RND_DAD_BEGIN_VBOX(ls->sub.dlg); + RND_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_TIGHT); + RND_DAD_PICTURE(ls->sub.dlg, lys->on_closed.xpm); + lys->wvis_on_closed = RND_DAD_CURRENT(ls->sub.dlg); + RND_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); + RND_DAD_CHANGE_CB(ls->sub.dlg, layer_vis_cb); + RND_DAD_HELP(ls->sub.dlg, name); + RND_DAD_PICTURE(ls->sub.dlg, lys->off_closed.xpm); + lys->wvis_off_closed = RND_DAD_CURRENT(ls->sub.dlg); + RND_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); + RND_DAD_CHANGE_CB(ls->sub.dlg, layer_vis_cb); + RND_DAD_HELP(ls->sub.dlg, name); if (selectable) { - PCB_DAD_PICTURE(ls->sub.dlg, closed_grp_layer_unsel); + RND_DAD_PICTURE(ls->sub.dlg, closed_grp_layer_unsel); if (selected) - PCB_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_HIDE); - lys->wunsel_closed = PCB_DAD_CURRENT(ls->sub.dlg); - PCB_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); - PCB_DAD_CHANGE_CB(ls->sub.dlg, layer_sel_cb); - PCB_DAD_HELP(ls->sub.dlg, name); - PCB_DAD_PICTURE(ls->sub.dlg, closed_grp_layer_sel); + RND_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_HIDE); + lys->wunsel_closed = RND_DAD_CURRENT(ls->sub.dlg); + RND_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); + RND_DAD_CHANGE_CB(ls->sub.dlg, layer_sel_cb); + RND_DAD_HELP(ls->sub.dlg, name); + RND_DAD_PICTURE(ls->sub.dlg, closed_grp_layer_sel); if (!selected) - PCB_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_HIDE); - lys->wsel_closed = PCB_DAD_CURRENT(ls->sub.dlg); - PCB_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); - PCB_DAD_CHANGE_CB(ls->sub.dlg, layer_sel_cb); - PCB_DAD_HELP(ls->sub.dlg, name); + RND_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_HIDE); + lys->wsel_closed = RND_DAD_CURRENT(ls->sub.dlg); + RND_DAD_SET_ATTR_FIELD(ls->sub.dlg, user_data, lys); + RND_DAD_CHANGE_CB(ls->sub.dlg, layer_sel_cb); + RND_DAD_HELP(ls->sub.dlg, name); } else { - PCB_DAD_PICTURE(ls->sub.dlg, closed_grp_layer_nosel); - lys->wunsel_closed = lys->wsel_closed = PCB_DAD_CURRENT(ls->sub.dlg); + RND_DAD_PICTURE(ls->sub.dlg, closed_grp_layer_nosel); + lys->wunsel_closed = lys->wsel_closed = RND_DAD_CURRENT(ls->sub.dlg); } - PCB_DAD_END(ls->sub.dlg); + RND_DAD_END(ls->sub.dlg); } static void layersel_create_grp(layersel_ctx_t *ls, pcb_board_t *pcb, pcb_layergrp_t *g, ls_group_t *lgs, int is_open) @@ -635,10 +635,10 @@ static void layersel_add_grpsep(layersel_ctx_t *ls) { - PCB_DAD_BEGIN_HBOX(ls->sub.dlg); - PCB_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_EXPFILL); - PCB_DAD_PICTURE(ls->sub.dlg, grpsep); - PCB_DAD_END(ls->sub.dlg); + RND_DAD_BEGIN_HBOX(ls->sub.dlg); + RND_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_EXPFILL); + RND_DAD_PICTURE(ls->sub.dlg, grpsep); + RND_DAD_END(ls->sub.dlg); } @@ -716,7 +716,7 @@ layersel_begin_grp_open(ls, "UI", lgs); if (vtp0_len(&pcb_uilayers) == 0) - PCB_DAD_LABEL(ls->sub.dlg, "(no layers)"); + RND_DAD_LABEL(ls->sub.dlg, "(no layers)"); for(n = 0; n < vtp0_len(&pcb_uilayers); n++) { pcb_layer_t *ly = pcb_uilayers.array[n]; if ((ly != NULL) && (ly->name != NULL)) { @@ -741,16 +741,16 @@ static void hsep(layersel_ctx_t *ls) { - PCB_DAD_BEGIN_VBOX(ls->sub.dlg); - PCB_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_TIGHT | RND_HATF_FRAME); - PCB_DAD_END(ls->sub.dlg); + RND_DAD_BEGIN_VBOX(ls->sub.dlg); + RND_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_TIGHT | RND_HATF_FRAME); + RND_DAD_END(ls->sub.dlg); } static void layersel_docked_create(layersel_ctx_t *ls, pcb_board_t *pcb) { lgs_reset(ls); - PCB_DAD_BEGIN_VBOX(ls->sub.dlg); - PCB_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_EXPFILL | RND_HATF_TIGHT | RND_HATF_SCROLL); + RND_DAD_BEGIN_VBOX(ls->sub.dlg); + RND_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_EXPFILL | RND_HATF_TIGHT | RND_HATF_SCROLL); layersel_create_stack(&layersel, pcb); hsep(&layersel); layersel_create_global(&layersel, pcb); @@ -759,20 +759,20 @@ layersel_add_grpsep(ls); layersel_create_ui(&layersel, pcb); layersel_add_grpsep(ls); - PCB_DAD_BEGIN_HBOX(ls->sub.dlg); - PCB_DAD_PICBUTTON(ls->sub.dlg, all_open_xpm); - PCB_DAD_HELP(ls->sub.dlg, "expand/open all layer groups\nso that layer names are\ndisplayed, one layer per row"); - PCB_DAD_CHANGE_CB(ls->sub.dlg, all_open_cb); - PCB_DAD_PICBUTTON(ls->sub.dlg, all_closed_xpm); - PCB_DAD_HELP(ls->sub.dlg, "collapse/close all layer groups\nso that layer names are\nnot displayed,\neach row is a layer group"); - PCB_DAD_CHANGE_CB(ls->sub.dlg, all_close_cb); - PCB_DAD_BEGIN_HBOX(ls->sub.dlg); - PCB_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ls->sub.dlg); - PCB_DAD_END(ls->sub.dlg); - PCB_DAD_END(ls->sub.dlg); - PCB_DAD_DEFSIZE(ls->sub.dlg, 180, 200); - PCB_DAD_MINSIZE(ls->sub.dlg, 100, 100); + RND_DAD_BEGIN_HBOX(ls->sub.dlg); + RND_DAD_PICBUTTON(ls->sub.dlg, all_open_xpm); + RND_DAD_HELP(ls->sub.dlg, "expand/open all layer groups\nso that layer names are\ndisplayed, one layer per row"); + RND_DAD_CHANGE_CB(ls->sub.dlg, all_open_cb); + RND_DAD_PICBUTTON(ls->sub.dlg, all_closed_xpm); + RND_DAD_HELP(ls->sub.dlg, "collapse/close all layer groups\nso that layer names are\nnot displayed,\neach row is a layer group"); + RND_DAD_CHANGE_CB(ls->sub.dlg, all_close_cb); + RND_DAD_BEGIN_HBOX(ls->sub.dlg); + RND_DAD_COMPFLAG(ls->sub.dlg, RND_HATF_EXPFILL); + RND_DAD_END(ls->sub.dlg); + RND_DAD_END(ls->sub.dlg); + RND_DAD_END(ls->sub.dlg); + RND_DAD_DEFSIZE(ls->sub.dlg, 180, 200); + RND_DAD_MINSIZE(ls->sub.dlg, 100, 100); ls->w_last_sel = 0; } Index: trunk/src_plugins/lib_hid_pcbui/routest.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/routest.c (revision 30991) +++ trunk/src_plugins/lib_hid_pcbui/routest.c (revision 30992) @@ -175,29 +175,29 @@ static void rst_docked_create() { int n; - PCB_DAD_BEGIN_VBOX(rst.sub.dlg); + RND_DAD_BEGIN_VBOX(rst.sub.dlg); for(n = 0; n < MAX_STYLES; n++) { - PCB_DAD_BEGIN_HBOX(rst.sub.dlg); - PCB_DAD_COMPFLAG(rst.sub.dlg, RND_HATF_HIDE); - rst.whbox[n] = PCB_DAD_CURRENT(rst.sub.dlg); - PCB_DAD_BOOL(rst.sub.dlg, ""); - rst.wchk[n] = PCB_DAD_CURRENT(rst.sub.dlg); - PCB_DAD_CHANGE_CB(rst.sub.dlg, rst_select_cb); - PCB_DAD_LABEL(rst.sub.dlg, "unused"); - rst.wlab[n] = PCB_DAD_CURRENT(rst.sub.dlg); - PCB_DAD_CHANGE_CB(rst.sub.dlg, rst_select_cb); - PCB_DAD_END(rst.sub.dlg); + RND_DAD_BEGIN_HBOX(rst.sub.dlg); + RND_DAD_COMPFLAG(rst.sub.dlg, RND_HATF_HIDE); + rst.whbox[n] = RND_DAD_CURRENT(rst.sub.dlg); + RND_DAD_BOOL(rst.sub.dlg, ""); + rst.wchk[n] = RND_DAD_CURRENT(rst.sub.dlg); + RND_DAD_CHANGE_CB(rst.sub.dlg, rst_select_cb); + RND_DAD_LABEL(rst.sub.dlg, "unused"); + rst.wlab[n] = RND_DAD_CURRENT(rst.sub.dlg); + RND_DAD_CHANGE_CB(rst.sub.dlg, rst_select_cb); + RND_DAD_END(rst.sub.dlg); } - PCB_DAD_BEGIN_HBOX(rst.sub.dlg); - PCB_DAD_BUTTON(rst.sub.dlg, "New"); - PCB_DAD_CHANGE_CB(rst.sub.dlg, rst_new_cb); - PCB_DAD_BUTTON(rst.sub.dlg, "Edit"); - PCB_DAD_CHANGE_CB(rst.sub.dlg, rst_edit_cb); - PCB_DAD_BUTTON(rst.sub.dlg, "Del"); - PCB_DAD_CHANGE_CB(rst.sub.dlg, rst_del_cb); - PCB_DAD_END(rst.sub.dlg); - PCB_DAD_END(rst.sub.dlg); + RND_DAD_BEGIN_HBOX(rst.sub.dlg); + RND_DAD_BUTTON(rst.sub.dlg, "New"); + RND_DAD_CHANGE_CB(rst.sub.dlg, rst_new_cb); + RND_DAD_BUTTON(rst.sub.dlg, "Edit"); + RND_DAD_CHANGE_CB(rst.sub.dlg, rst_edit_cb); + RND_DAD_BUTTON(rst.sub.dlg, "Del"); + RND_DAD_CHANGE_CB(rst.sub.dlg, rst_del_cb); + RND_DAD_END(rst.sub.dlg); + RND_DAD_END(rst.sub.dlg); } Index: trunk/src_plugins/lib_hid_pcbui/routest_dlg.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/routest_dlg.c (revision 30991) +++ trunk/src_plugins/lib_hid_pcbui/routest_dlg.c (revision 30992) @@ -29,7 +29,7 @@ #include typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int active; /* already open - allow only one instance */ int curr; int wname, wlineth, wclr, wtxtscale, wtxtth, wviahole, wviaring, wattr; @@ -49,7 +49,7 @@ } } - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); memset(ctx, 0, sizeof(rstdlg_ctx_t)); /* reset all states to the initial - includes ctx->active = 0; */ } @@ -100,7 +100,7 @@ char *cell[3]= {NULL}; cell[0] = rnd_strdup(a->name); cell[1] = rnd_strdup(a->value); - pcb_dad_tree_append(attr, NULL, cell); + rnd_dad_tree_append(attr, NULL, cell); } rstdlg_ctx.curr = rst_idx; @@ -168,32 +168,32 @@ static int rst_edit_attr(char **key, char **val) { int wkey, wval, res; - pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; - PCB_DAD_DECL(dlg); + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; + RND_DAD_DECL(dlg); - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABLE(dlg, 2); - PCB_DAD_LABEL(dlg, "key"); - PCB_DAD_STRING(dlg); - wkey = PCB_DAD_CURRENT(dlg); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABLE(dlg, 2); + RND_DAD_LABEL(dlg, "key"); + RND_DAD_STRING(dlg); + wkey = RND_DAD_CURRENT(dlg); if (*key != NULL) - PCB_DAD_DEFAULT_PTR(dlg, rnd_strdup(*key)); - PCB_DAD_LABEL(dlg, "value"); - PCB_DAD_STRING(dlg); - wval = PCB_DAD_CURRENT(dlg); + RND_DAD_DEFAULT_PTR(dlg, rnd_strdup(*key)); + RND_DAD_LABEL(dlg, "value"); + RND_DAD_STRING(dlg); + wval = RND_DAD_CURRENT(dlg); if (*val != NULL) - PCB_DAD_DEFAULT_PTR(dlg, rnd_strdup(*val)); - PCB_DAD_BUTTON_CLOSES(dlg, clbtn); - PCB_DAD_END(dlg); + RND_DAD_DEFAULT_PTR(dlg, rnd_strdup(*val)); + RND_DAD_BUTTON_CLOSES(dlg, clbtn); + RND_DAD_END(dlg); - PCB_DAD_NEW("route_style_attr", dlg, "Edit route style attribute", NULL, pcb_true, NULL); - res = PCB_DAD_RUN(dlg); + RND_DAD_NEW("route_style_attr", dlg, "Edit route style attribute", NULL, pcb_true, NULL); + res = RND_DAD_RUN(dlg); if (res == 0) { *key = rnd_strdup(dlg[wkey].val.str); *val = rnd_strdup(dlg[wval].val.str); } - PCB_DAD_FREE(dlg); + RND_DAD_FREE(dlg); return res; } @@ -244,7 +244,7 @@ static int pcb_dlg_rstdlg(int rst_idx) { - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; static const char *attr_hdr[] = {"attribute key", "attribute value", NULL}; if (rstdlg_ctx.active) { /* do not open another, just refresh data to target */ @@ -252,77 +252,77 @@ return 0; } - PCB_DAD_BEGIN_VBOX(rstdlg_ctx.dlg); - PCB_DAD_COMPFLAG(rstdlg_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABLE(rstdlg_ctx.dlg, 2); + RND_DAD_BEGIN_VBOX(rstdlg_ctx.dlg); + RND_DAD_COMPFLAG(rstdlg_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABLE(rstdlg_ctx.dlg, 2); - PCB_DAD_LABEL(rstdlg_ctx.dlg, "Name:"); - PCB_DAD_STRING(rstdlg_ctx.dlg); - rstdlg_ctx.wname = PCB_DAD_CURRENT(rstdlg_ctx.dlg); - PCB_DAD_HELP(rstdlg_ctx.dlg, "Name of the routing style"); - PCB_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_change_cb); + RND_DAD_LABEL(rstdlg_ctx.dlg, "Name:"); + RND_DAD_STRING(rstdlg_ctx.dlg); + rstdlg_ctx.wname = RND_DAD_CURRENT(rstdlg_ctx.dlg); + RND_DAD_HELP(rstdlg_ctx.dlg, "Name of the routing style"); + RND_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_change_cb); - PCB_DAD_LABEL(rstdlg_ctx.dlg, "Line thick.:"); - PCB_DAD_COORD(rstdlg_ctx.dlg, ""); - rstdlg_ctx.wlineth = PCB_DAD_CURRENT(rstdlg_ctx.dlg); - PCB_DAD_HELP(rstdlg_ctx.dlg, "Thickness of line/arc objects"); - PCB_DAD_MINMAX(rstdlg_ctx.dlg, 1, RND_MAX_COORD); - PCB_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_change_cb); + RND_DAD_LABEL(rstdlg_ctx.dlg, "Line thick.:"); + RND_DAD_COORD(rstdlg_ctx.dlg, ""); + rstdlg_ctx.wlineth = RND_DAD_CURRENT(rstdlg_ctx.dlg); + RND_DAD_HELP(rstdlg_ctx.dlg, "Thickness of line/arc objects"); + RND_DAD_MINMAX(rstdlg_ctx.dlg, 1, RND_MAX_COORD); + RND_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_change_cb); - PCB_DAD_LABEL(rstdlg_ctx.dlg, "Text scale:"); - PCB_DAD_COORD(rstdlg_ctx.dlg, ""); - rstdlg_ctx.wtxtscale = PCB_DAD_CURRENT(rstdlg_ctx.dlg); - PCB_DAD_HELP(rstdlg_ctx.dlg, "Text size scale in %; 100 means normal size"); - PCB_DAD_MINMAX(rstdlg_ctx.dlg, 1, RND_MAX_COORD); - PCB_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_change_cb); + RND_DAD_LABEL(rstdlg_ctx.dlg, "Text scale:"); + RND_DAD_COORD(rstdlg_ctx.dlg, ""); + rstdlg_ctx.wtxtscale = RND_DAD_CURRENT(rstdlg_ctx.dlg); + RND_DAD_HELP(rstdlg_ctx.dlg, "Text size scale in %; 100 means normal size"); + RND_DAD_MINMAX(rstdlg_ctx.dlg, 1, RND_MAX_COORD); + RND_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_change_cb); - PCB_DAD_LABEL(rstdlg_ctx.dlg, "Clearance:"); - PCB_DAD_COORD(rstdlg_ctx.dlg, ""); - rstdlg_ctx.wclr = PCB_DAD_CURRENT(rstdlg_ctx.dlg); - PCB_DAD_HELP(rstdlg_ctx.dlg, "Object clearance: any object placed with this style\nwill clear this much from sorrunding clearing-enabled polygons\n(unless the object is joined to the polygon)"); - PCB_DAD_MINMAX(rstdlg_ctx.dlg, 1, RND_MAX_COORD); - PCB_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_change_cb); + RND_DAD_LABEL(rstdlg_ctx.dlg, "Clearance:"); + RND_DAD_COORD(rstdlg_ctx.dlg, ""); + rstdlg_ctx.wclr = RND_DAD_CURRENT(rstdlg_ctx.dlg); + RND_DAD_HELP(rstdlg_ctx.dlg, "Object clearance: any object placed with this style\nwill clear this much from sorrunding clearing-enabled polygons\n(unless the object is joined to the polygon)"); + RND_DAD_MINMAX(rstdlg_ctx.dlg, 1, RND_MAX_COORD); + RND_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_change_cb); - PCB_DAD_LABEL(rstdlg_ctx.dlg, "Text thick.:"); - PCB_DAD_COORD(rstdlg_ctx.dlg, ""); - rstdlg_ctx.wtxtth = PCB_DAD_CURRENT(rstdlg_ctx.dlg); - PCB_DAD_HELP(rstdlg_ctx.dlg, "Text stroke thickness;\nif 0 use the default heuristics that\ncalculates it from text scale"); - PCB_DAD_MINMAX(rstdlg_ctx.dlg, 1, RND_MAX_COORD); - PCB_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_change_cb); + RND_DAD_LABEL(rstdlg_ctx.dlg, "Text thick.:"); + RND_DAD_COORD(rstdlg_ctx.dlg, ""); + rstdlg_ctx.wtxtth = RND_DAD_CURRENT(rstdlg_ctx.dlg); + RND_DAD_HELP(rstdlg_ctx.dlg, "Text stroke thickness;\nif 0 use the default heuristics that\ncalculates it from text scale"); + RND_DAD_MINMAX(rstdlg_ctx.dlg, 1, RND_MAX_COORD); + RND_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_change_cb); - PCB_DAD_LABEL(rstdlg_ctx.dlg, "*Via hole:"); - PCB_DAD_COORD(rstdlg_ctx.dlg, ""); - rstdlg_ctx.wviahole = PCB_DAD_CURRENT(rstdlg_ctx.dlg); - PCB_DAD_HELP(rstdlg_ctx.dlg, "Via hole diameter\nwarning: will be replaced with the padstack selector"); - PCB_DAD_MINMAX(rstdlg_ctx.dlg, 1, RND_MAX_COORD); - PCB_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_change_cb); + RND_DAD_LABEL(rstdlg_ctx.dlg, "*Via hole:"); + RND_DAD_COORD(rstdlg_ctx.dlg, ""); + rstdlg_ctx.wviahole = RND_DAD_CURRENT(rstdlg_ctx.dlg); + RND_DAD_HELP(rstdlg_ctx.dlg, "Via hole diameter\nwarning: will be replaced with the padstack selector"); + RND_DAD_MINMAX(rstdlg_ctx.dlg, 1, RND_MAX_COORD); + RND_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_change_cb); - PCB_DAD_LABEL(rstdlg_ctx.dlg, "*Via ring:"); - PCB_DAD_COORD(rstdlg_ctx.dlg, ""); - rstdlg_ctx.wviaring = PCB_DAD_CURRENT(rstdlg_ctx.dlg); - PCB_DAD_HELP(rstdlg_ctx.dlg, "Via ring diameter\nwarning: will be replaced with the padstack selector"); - PCB_DAD_MINMAX(rstdlg_ctx.dlg, 1, RND_MAX_COORD); - PCB_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_change_cb); + RND_DAD_LABEL(rstdlg_ctx.dlg, "*Via ring:"); + RND_DAD_COORD(rstdlg_ctx.dlg, ""); + rstdlg_ctx.wviaring = RND_DAD_CURRENT(rstdlg_ctx.dlg); + RND_DAD_HELP(rstdlg_ctx.dlg, "Via ring diameter\nwarning: will be replaced with the padstack selector"); + RND_DAD_MINMAX(rstdlg_ctx.dlg, 1, RND_MAX_COORD); + RND_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_change_cb); - PCB_DAD_END(rstdlg_ctx.dlg); - PCB_DAD_TREE(rstdlg_ctx.dlg, 2, 0, attr_hdr); - PCB_DAD_HELP(rstdlg_ctx.dlg, "These attributes are automatically added to\nany object drawn with this routing style"); - rstdlg_ctx.wattr = PCB_DAD_CURRENT(rstdlg_ctx.dlg); - PCB_DAD_BEGIN_HBOX(rstdlg_ctx.dlg); - PCB_DAD_BUTTON(rstdlg_ctx.dlg, "add"); - PCB_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_add_attr_cb); - PCB_DAD_BUTTON(rstdlg_ctx.dlg, "edit"); - PCB_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_edit_attr_cb); - PCB_DAD_BUTTON(rstdlg_ctx.dlg, "del"); - PCB_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_del_attr_cb); - PCB_DAD_END(rstdlg_ctx.dlg); - PCB_DAD_BUTTON_CLOSES(rstdlg_ctx.dlg, clbtn); - PCB_DAD_END(rstdlg_ctx.dlg); + RND_DAD_END(rstdlg_ctx.dlg); + RND_DAD_TREE(rstdlg_ctx.dlg, 2, 0, attr_hdr); + RND_DAD_HELP(rstdlg_ctx.dlg, "These attributes are automatically added to\nany object drawn with this routing style"); + rstdlg_ctx.wattr = RND_DAD_CURRENT(rstdlg_ctx.dlg); + RND_DAD_BEGIN_HBOX(rstdlg_ctx.dlg); + RND_DAD_BUTTON(rstdlg_ctx.dlg, "add"); + RND_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_add_attr_cb); + RND_DAD_BUTTON(rstdlg_ctx.dlg, "edit"); + RND_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_edit_attr_cb); + RND_DAD_BUTTON(rstdlg_ctx.dlg, "del"); + RND_DAD_CHANGE_CB(rstdlg_ctx.dlg, rst_del_attr_cb); + RND_DAD_END(rstdlg_ctx.dlg); + RND_DAD_BUTTON_CLOSES(rstdlg_ctx.dlg, clbtn); + RND_DAD_END(rstdlg_ctx.dlg); /* set up the context */ rstdlg_ctx.active = 1; - PCB_DAD_NEW("route_style", rstdlg_ctx.dlg, "Edit route style", &rstdlg_ctx, pcb_false, rstdlg_close_cb); + RND_DAD_NEW("route_style", rstdlg_ctx.dlg, "Edit route style", &rstdlg_ctx, pcb_false, rstdlg_close_cb); rstdlg_pcb2dlg(rst_idx); return 0; Index: trunk/src_plugins/lib_hid_pcbui/status.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/status.c (revision 30991) +++ trunk/src_plugins/lib_hid_pcbui/status.c (revision 30992) @@ -251,54 +251,54 @@ static void status_docked_create_st() { - PCB_DAD_BEGIN_VBOX(status.stsub.dlg); - PCB_DAD_COMPFLAG(status.stsub.dlg, RND_HATF_EXPFILL | RND_HATF_TIGHT); - PCB_DAD_LABEL(status.stsub.dlg, ""); - PCB_DAD_COMPFLAG(status.stsub.dlg, RND_HATF_HIDE); - status.wsttxt = PCB_DAD_CURRENT(status.stsub.dlg); - PCB_DAD_LABEL(status.stsub.dlg, ""); - status.wst1 = PCB_DAD_CURRENT(status.stsub.dlg); - PCB_DAD_LABEL(status.stsub.dlg, ""); - PCB_DAD_COMPFLAG(status.stsub.dlg, RND_HATF_HIDE); - status.wst2 = PCB_DAD_CURRENT(status.stsub.dlg); - PCB_DAD_END(status.stsub.dlg); + RND_DAD_BEGIN_VBOX(status.stsub.dlg); + RND_DAD_COMPFLAG(status.stsub.dlg, RND_HATF_EXPFILL | RND_HATF_TIGHT); + RND_DAD_LABEL(status.stsub.dlg, ""); + RND_DAD_COMPFLAG(status.stsub.dlg, RND_HATF_HIDE); + status.wsttxt = RND_DAD_CURRENT(status.stsub.dlg); + RND_DAD_LABEL(status.stsub.dlg, ""); + status.wst1 = RND_DAD_CURRENT(status.stsub.dlg); + RND_DAD_LABEL(status.stsub.dlg, ""); + RND_DAD_COMPFLAG(status.stsub.dlg, RND_HATF_HIDE); + status.wst2 = RND_DAD_CURRENT(status.stsub.dlg); + RND_DAD_END(status.stsub.dlg); } /* append an expand-vbox to eat up excess space for center-align */ static void vpad(rnd_hid_dad_subdialog_t *sub) { - PCB_DAD_BEGIN_VBOX(sub->dlg); - PCB_DAD_COMPFLAG(sub->dlg, RND_HATF_EXPFILL | RND_HATF_TIGHT); - PCB_DAD_END(sub->dlg); + RND_DAD_BEGIN_VBOX(sub->dlg); + RND_DAD_COMPFLAG(sub->dlg, RND_HATF_EXPFILL | RND_HATF_TIGHT); + RND_DAD_END(sub->dlg); } static void status_docked_create_rd() { int n; - PCB_DAD_BEGIN_HBOX(status.rdsub.dlg); - PCB_DAD_COMPFLAG(status.rdsub.dlg, RND_HATF_TIGHT); - PCB_DAD_BEGIN_VBOX(status.rdsub.dlg); - PCB_DAD_COMPFLAG(status.rdsub.dlg, RND_HATF_EXPFILL | RND_HATF_FRAME | RND_HATF_TIGHT); + RND_DAD_BEGIN_HBOX(status.rdsub.dlg); + RND_DAD_COMPFLAG(status.rdsub.dlg, RND_HATF_TIGHT); + RND_DAD_BEGIN_VBOX(status.rdsub.dlg); + RND_DAD_COMPFLAG(status.rdsub.dlg, RND_HATF_EXPFILL | RND_HATF_FRAME | RND_HATF_TIGHT); vpad(&status.rdsub); for(n = 0; n < 3; n++) { - PCB_DAD_LABEL(status.rdsub.dlg, ""); - status.wrd1[n] = PCB_DAD_CURRENT(status.rdsub.dlg); + RND_DAD_LABEL(status.rdsub.dlg, ""); + status.wrd1[n] = RND_DAD_CURRENT(status.rdsub.dlg); } vpad(&status.rdsub); - PCB_DAD_END(status.rdsub.dlg); - PCB_DAD_BEGIN_VBOX(status.rdsub.dlg); - PCB_DAD_COMPFLAG(status.rdsub.dlg, RND_HATF_EXPFILL | RND_HATF_FRAME); + RND_DAD_END(status.rdsub.dlg); + RND_DAD_BEGIN_VBOX(status.rdsub.dlg); + RND_DAD_COMPFLAG(status.rdsub.dlg, RND_HATF_EXPFILL | RND_HATF_FRAME); vpad(&status.rdsub); for(n = 0; n < 2; n++) { - PCB_DAD_LABEL(status.rdsub.dlg, ""); - status.wrd2[n] = PCB_DAD_CURRENT(status.rdsub.dlg); + RND_DAD_LABEL(status.rdsub.dlg, ""); + status.wrd2[n] = RND_DAD_CURRENT(status.rdsub.dlg); } vpad(&status.rdsub); - PCB_DAD_END(status.rdsub.dlg); - PCB_DAD_BUTTON(status.rdsub.dlg, ""); - status.wrdunit = PCB_DAD_CURRENT(status.rdsub.dlg); - PCB_DAD_CHANGE_CB(status.rdsub.dlg, unit_change_cb); - PCB_DAD_END(status.rdsub.dlg); + RND_DAD_END(status.rdsub.dlg); + RND_DAD_BUTTON(status.rdsub.dlg, ""); + status.wrdunit = RND_DAD_CURRENT(status.rdsub.dlg); + RND_DAD_CHANGE_CB(status.rdsub.dlg, unit_change_cb); + RND_DAD_END(status.rdsub.dlg); } Index: trunk/src_plugins/lib_polyhelp/polyhelp.c =================================================================== --- trunk/src_plugins/lib_polyhelp/polyhelp.c (revision 30991) +++ trunk/src_plugins/lib_polyhelp/polyhelp.c (revision 30992) @@ -374,47 +374,47 @@ static int polyhatch_gui(rnd_coord_t *period, pcb_cpoly_hatchdir_t *dir, pcb_flag_t *flg, int *want_contour) { int wspc, wcont, whor, wver, wclr; - pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; - PCB_DAD_DECL(dlg); + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; + RND_DAD_DECL(dlg); - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_BEGIN_TABLE(dlg, 2); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_BEGIN_TABLE(dlg, 2); - PCB_DAD_LABEL(dlg, "Spacing"); - PCB_DAD_COORD(dlg, ""); - PCB_DAD_HELP(dlg, "Distance between centerlines of adjacent hatch lines for vertical and horizontal hatching"); - PCB_DAD_DEFAULT_NUM(dlg, conf_core.design.line_thickness * 2); - PCB_DAD_MINMAX(dlg, 1, PCB_MM_TO_COORD(100)); - wspc = PCB_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "Spacing"); + RND_DAD_COORD(dlg, ""); + RND_DAD_HELP(dlg, "Distance between centerlines of adjacent hatch lines for vertical and horizontal hatching"); + RND_DAD_DEFAULT_NUM(dlg, conf_core.design.line_thickness * 2); + RND_DAD_MINMAX(dlg, 1, PCB_MM_TO_COORD(100)); + wspc = RND_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, "Draw contour"); - PCB_DAD_BOOL(dlg, ""); - PCB_DAD_HELP(dlg, "Draw the contour of the polygon"); - wcont = PCB_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "Draw contour"); + RND_DAD_BOOL(dlg, ""); + RND_DAD_HELP(dlg, "Draw the contour of the polygon"); + wcont = RND_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, "Draw horizontal hatch"); - PCB_DAD_BOOL(dlg, ""); - PCB_DAD_HELP(dlg, "Draw evenly spaced horizontal hatch lines"); - whor = PCB_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "Draw horizontal hatch"); + RND_DAD_BOOL(dlg, ""); + RND_DAD_HELP(dlg, "Draw evenly spaced horizontal hatch lines"); + whor = RND_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, "Draw vertical hatch"); - PCB_DAD_BOOL(dlg, ""); - PCB_DAD_HELP(dlg, "Draw evenly spaced vertical hatch lines"); - wver = PCB_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "Draw vertical hatch"); + RND_DAD_BOOL(dlg, ""); + RND_DAD_HELP(dlg, "Draw evenly spaced vertical hatch lines"); + wver = RND_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, "Clear-line"); - PCB_DAD_BOOL(dlg, ""); - PCB_DAD_HELP(dlg, "Hatch lines have clearance"); - wclr = PCB_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "Clear-line"); + RND_DAD_BOOL(dlg, ""); + RND_DAD_HELP(dlg, "Hatch lines have clearance"); + wclr = RND_DAD_CURRENT(dlg); - PCB_DAD_END(dlg); - PCB_DAD_BUTTON_CLOSES(dlg, clbtn); - PCB_DAD_END(dlg); + RND_DAD_END(dlg); + RND_DAD_BUTTON_CLOSES(dlg, clbtn); + RND_DAD_END(dlg); - PCB_DAD_NEW("poly_hatch", dlg, "Polygon hatch", NULL, pcb_true, NULL); - if (PCB_DAD_RUN(dlg) != 0) { + RND_DAD_NEW("poly_hatch", dlg, "Polygon hatch", NULL, pcb_true, NULL); + if (RND_DAD_RUN(dlg) != 0) { /* cancel */ - PCB_DAD_FREE(dlg); + RND_DAD_FREE(dlg); return -1; } @@ -427,7 +427,7 @@ *flg = pcb_flag_make(dlg[wclr].val.lng ? PCB_FLAG_CLEARLINE : 0); - PCB_DAD_FREE(dlg); + RND_DAD_FREE(dlg); return 0; } Index: trunk/src_plugins/order/order.h =================================================================== --- trunk/src_plugins/order/order.h (revision 30991) +++ trunk/src_plugins/order/order.h (revision 30992) @@ -34,7 +34,7 @@ extern conf_order_t conf_order; typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int active; /* already open - allow only one instance */ vtp0_t names; void *odata; /* implementation-specific data of the current order */ Index: trunk/src_plugins/order/order_dlg.c =================================================================== --- trunk/src_plugins/order/order_dlg.c (revision 30991) +++ trunk/src_plugins/order/order_dlg.c (revision 30992) @@ -3,13 +3,13 @@ static void order_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) { order_ctx_t *ctx = caller_data; - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); memset(ctx, 0, sizeof(order_ctx_t)); } static int order_dialog(void) { - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; pcb_order_imp_t *imp; int n; @@ -29,62 +29,62 @@ } vtp0_set(&order_ctx.names, n, NULL); - PCB_DAD_BEGIN_VBOX(order_ctx.dlg); - PCB_DAD_COMPFLAG(order_ctx.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABBED(order_ctx.dlg, order_ctx.names.array); - PCB_DAD_COMPFLAG(order_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_LEFT_TAB); + RND_DAD_BEGIN_VBOX(order_ctx.dlg); + RND_DAD_COMPFLAG(order_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABBED(order_ctx.dlg, order_ctx.names.array); + RND_DAD_COMPFLAG(order_ctx.dlg, RND_HATF_EXPFILL | RND_HATF_LEFT_TAB); for(n = 0; n < pcb_order_imps.used; n++) { imp = pcb_order_imps.array[n]; if (imp->load_fields(pcb_order_imps.array[n], &order_ctx) == 0) { - PCB_DAD_BEGIN_VBOX(order_ctx.dlg); - PCB_DAD_COMPFLAG(order_ctx.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(order_ctx.dlg); + RND_DAD_COMPFLAG(order_ctx.dlg, RND_HATF_EXPFILL); imp->populate_dad(pcb_order_imps.array[n], &order_ctx); - PCB_DAD_END(order_ctx.dlg); + RND_DAD_END(order_ctx.dlg); } else - PCB_DAD_LABEL(order_ctx.dlg, "Failed to determine form fields"); + RND_DAD_LABEL(order_ctx.dlg, "Failed to determine form fields"); } - PCB_DAD_END(order_ctx.dlg); - PCB_DAD_BUTTON_CLOSES(order_ctx.dlg, clbtn); - PCB_DAD_END(order_ctx.dlg); + RND_DAD_END(order_ctx.dlg); + RND_DAD_BUTTON_CLOSES(order_ctx.dlg, clbtn); + RND_DAD_END(order_ctx.dlg); /* set up the context */ order_ctx.active = 1; - PCB_DAD_NEW("order", order_ctx.dlg, "Order PCB", &order_ctx, pcb_false, order_close_cb); + RND_DAD_NEW("order", order_ctx.dlg, "Order PCB", &order_ctx, pcb_false, order_close_cb); return 0; } void pcb_order_dad_field(order_ctx_t *octx, pcb_order_field_t *f) { - PCB_DAD_BEGIN_HBOX(octx->dlg); - PCB_DAD_LABEL(octx->dlg, f->name); - PCB_DAD_BEGIN_VBOX(octx->dlg); - PCB_DAD_COMPFLAG(octx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(octx->dlg); + RND_DAD_BEGIN_HBOX(octx->dlg); + RND_DAD_LABEL(octx->dlg, f->name); + RND_DAD_BEGIN_VBOX(octx->dlg); + RND_DAD_COMPFLAG(octx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(octx->dlg); switch(f->type) { case RND_HATT_ENUM: - PCB_DAD_ENUM(octx->dlg, f->enum_vals); - PCB_DAD_DEFAULT_NUM(octx->dlg, f->val.lng); + RND_DAD_ENUM(octx->dlg, f->enum_vals); + RND_DAD_DEFAULT_NUM(octx->dlg, f->val.lng); break; case RND_HATT_INTEGER: - PCB_DAD_INTEGER(octx->dlg, ""); - PCB_DAD_DEFAULT_NUM(octx->dlg, f->val.lng); + RND_DAD_INTEGER(octx->dlg, ""); + RND_DAD_DEFAULT_NUM(octx->dlg, f->val.lng); break; case RND_HATT_COORD: - PCB_DAD_COORD(octx->dlg, ""); - PCB_DAD_DEFAULT_NUM(octx->dlg, f->val.crd); + RND_DAD_COORD(octx->dlg, ""); + RND_DAD_DEFAULT_NUM(octx->dlg, f->val.crd); break; case RND_HATT_STRING: - PCB_DAD_STRING(octx->dlg); - PCB_DAD_DEFAULT_PTR(octx->dlg, f->val.str); + RND_DAD_STRING(octx->dlg); + RND_DAD_DEFAULT_PTR(octx->dlg, f->val.str); break; case RND_HATT_LABEL: break; default: - PCB_DAD_LABEL(octx->dlg, ""); + RND_DAD_LABEL(octx->dlg, ""); } - f->wid = PCB_DAD_CURRENT(octx->dlg); - PCB_DAD_END(octx->dlg); + f->wid = RND_DAD_CURRENT(octx->dlg); + RND_DAD_END(octx->dlg); } Index: trunk/src_plugins/order_pcbway/pcbway.c =================================================================== --- trunk/src_plugins/order_pcbway/pcbway.c (revision 30991) +++ trunk/src_plugins/order_pcbway/pcbway.c (revision 30992) @@ -357,16 +357,16 @@ char *val = NULL; \ if ((__n__->children != NULL) && (__n__->children->type == XML_TEXT_NODE)) \ val = __n__->children->content; \ - PCB_DAD_LABEL(dlg, (char *)__n__->name); \ + RND_DAD_LABEL(dlg, (char *)__n__->name); \ if ((val != NULL) && (xmlStrcmp(__n__->name, (xmlChar *)pricetag) == 0)) { \ char *__end__, *__tmp__ = pcb_concat("$", val, NULL); \ - PCB_DAD_LABEL(dlg, __tmp__); \ + RND_DAD_LABEL(dlg, __tmp__); \ free(__tmp__); \ __prc__ = strtod(val, &__end__); \ if (*__end__ == '\0') price = __prc__; \ } \ else \ - PCB_DAD_LABEL(dlg, val); \ + RND_DAD_LABEL(dlg, val); \ } \ } while(0) @@ -375,8 +375,8 @@ double shipcost, cost; xmlNode *root, *n, *error = NULL, *status = NULL, *ship = NULL, *prices = NULL; xmlDoc *doc = pcbway_xml_load(respfn); - pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {NULL, 0}}; - PCB_DAD_DECL(dlg); + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {NULL, 0}}; + RND_DAD_DECL(dlg); if (doc == NULL) return -1; @@ -408,16 +408,16 @@ return -1; } - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABLE(dlg, 2); - PCB_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - PCB_DAD_LABEL(dlg, "=== Shipping ==="); PCB_DAD_LABEL(dlg, ""); + RND_DAD_BEGIN_TABLE(dlg, 2); + RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + RND_DAD_LABEL(dlg, "=== Shipping ==="); RND_DAD_LABEL(dlg, ""); XML_TBL(dlg, ship, shipcost, "ShipCost"); for(n = prices->children; n != NULL; n = n->next) { char tmp[128]; - PCB_DAD_LABEL(dlg, "=== Option ==="); PCB_DAD_LABEL(dlg, ""); + RND_DAD_LABEL(dlg, "=== Option ==="); RND_DAD_LABEL(dlg, ""); XML_TBL(dlg, n, cost, "Price"); if ((shipcost >= 0) && (cost >= 0)) sprintf(tmp, "$%.2f ", shipcost+cost); @@ -424,25 +424,25 @@ else *tmp = 0; - PCB_DAD_LABEL(dlg, " Total:"); - PCB_DAD_COMPFLAG(dlg, RND_HATF_TIGHT); + RND_DAD_LABEL(dlg, " Total:"); + RND_DAD_COMPFLAG(dlg, RND_HATF_TIGHT); - PCB_DAD_BEGIN_HBOX(dlg); - PCB_DAD_COMPFLAG(dlg, RND_HATF_TIGHT); - PCB_DAD_LABEL(dlg, tmp); - PCB_DAD_PICBUTTON(dlg, order_xpm); - PCB_DAD_END(dlg); + RND_DAD_BEGIN_HBOX(dlg); + RND_DAD_COMPFLAG(dlg, RND_HATF_TIGHT); + RND_DAD_LABEL(dlg, tmp); + RND_DAD_PICBUTTON(dlg, order_xpm); + RND_DAD_END(dlg); } - PCB_DAD_END(dlg); + RND_DAD_END(dlg); - PCB_DAD_BUTTON_CLOSES(dlg, clbtn); - PCB_DAD_END(dlg); + RND_DAD_BUTTON_CLOSES(dlg, clbtn); + RND_DAD_END(dlg); - PCB_DAD_NEW("pcbway_quote", dlg, "PCBWay: quote", NULL, pcb_true, NULL); - PCB_DAD_RUN(dlg); - PCB_DAD_FREE(dlg); + RND_DAD_NEW("pcbway_quote", dlg, "PCBWay: quote", NULL, pcb_true, NULL); + RND_DAD_RUN(dlg); + RND_DAD_FREE(dlg); xmlFreeDoc(doc); return 0; @@ -531,30 +531,30 @@ int n; pcbway_form_t *form = octx->odata; - PCB_DAD_BEGIN_VBOX(octx->dlg); - PCB_DAD_COMPFLAG(octx->dlg, RND_HATF_SCROLL | RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(octx->dlg); + RND_DAD_COMPFLAG(octx->dlg, RND_HATF_SCROLL | RND_HATF_EXPFILL); for(n = 0; n < form->fields.used; n++) pcb_order_dad_field(octx, form->fields.array[n]); - PCB_DAD_BEGIN_VBOX(octx->dlg); - PCB_DAD_COMPFLAG(octx->dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(octx->dlg, ""); - PCB_DAD_LABEL(octx->dlg, ""); - PCB_DAD_END(octx->dlg); + RND_DAD_BEGIN_VBOX(octx->dlg); + RND_DAD_COMPFLAG(octx->dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(octx->dlg, ""); + RND_DAD_LABEL(octx->dlg, ""); + RND_DAD_END(octx->dlg); - PCB_DAD_BEGIN_HBOX(octx->dlg); - PCB_DAD_BUTTON(octx->dlg, "Update data"); - PCB_DAD_HELP(octx->dlg, "Copy data from board to form"); - PCB_DAD_BEGIN_VBOX(octx->dlg); - PCB_DAD_COMPFLAG(octx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(octx->dlg); - PCB_DAD_BUTTON(octx->dlg, "Quote & order"); - PCB_DAD_HELP(octx->dlg, "Generate a price quote"); - PCB_DAD_CHANGE_CB(octx->dlg, pcbway_quote_cb); - PCB_DAD_END(octx->dlg); + RND_DAD_BEGIN_HBOX(octx->dlg); + RND_DAD_BUTTON(octx->dlg, "Update data"); + RND_DAD_HELP(octx->dlg, "Copy data from board to form"); + RND_DAD_BEGIN_VBOX(octx->dlg); + RND_DAD_COMPFLAG(octx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(octx->dlg); + RND_DAD_BUTTON(octx->dlg, "Quote & order"); + RND_DAD_HELP(octx->dlg, "Generate a price quote"); + RND_DAD_CHANGE_CB(octx->dlg, pcbway_quote_cb); + RND_DAD_END(octx->dlg); - PCB_DAD_END(octx->dlg); + RND_DAD_END(octx->dlg); } static pcb_order_imp_t pcbway = { Index: trunk/src_plugins/propedit/propdlg.c =================================================================== --- trunk/src_plugins/propedit/propdlg.c (revision 30991) +++ trunk/src_plugins/propedit/propdlg.c (revision 30992) @@ -41,7 +41,7 @@ #include "propsel.h" typedef struct{ - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) pcb_propedit_t pe; int wtree, wfilter, wtype, wvals, wscope; int wabs[PCB_PROPT_max], wedit[PCB_PROPT_max]; @@ -57,7 +57,7 @@ propdlg_t *ctx = caller_data; gdl_remove(&propdlgs, ctx, link); pcb_props_uninit(&ctx->pe); - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); free(ctx); } @@ -291,7 +291,7 @@ rnd_hid_row_t *r; cell[0] = pcb_strdup_printf("%ld", pvs[n].cnt); cell[1] = pcb_propsel_printval(p->type, pvs[n].val); - r = pcb_dad_tree_append(attr, NULL, cell); + r = rnd_dad_tree_append(attr, NULL, cell); r->user_data = pvs[n].val; } @@ -383,25 +383,25 @@ static void prop_add_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) { - PCB_DAD_DECL(dlg) + RND_DAD_DECL(dlg) propdlg_t *ctx = caller_data; const char *key; int wkey, wval, failed; - pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"OK", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"OK", 0}, {NULL, 0}}; - PCB_DAD_BEGIN_VBOX(dlg); - PCB_DAD_BEGIN_TABLE(dlg, 2); - PCB_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(dlg, "Attribute key:"); - PCB_DAD_STRING(dlg); - wkey = PCB_DAD_CURRENT(dlg); - PCB_DAD_LABEL(dlg, "Attribute value:"); - PCB_DAD_STRING(dlg); - wval = PCB_DAD_CURRENT(dlg); - PCB_DAD_END(dlg); - PCB_DAD_BUTTON_CLOSES(dlg, clbtn); - PCB_DAD_END(dlg); - PCB_DAD_AUTORUN("propedit_add", dlg, "Propedit: add new attribute", NULL, failed); + RND_DAD_BEGIN_VBOX(dlg); + RND_DAD_BEGIN_TABLE(dlg, 2); + RND_DAD_COMPFLAG(dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(dlg, "Attribute key:"); + RND_DAD_STRING(dlg); + wkey = RND_DAD_CURRENT(dlg); + RND_DAD_LABEL(dlg, "Attribute value:"); + RND_DAD_STRING(dlg); + wval = RND_DAD_CURRENT(dlg); + RND_DAD_END(dlg); + RND_DAD_BUTTON_CLOSES(dlg, clbtn); + RND_DAD_END(dlg); + RND_DAD_AUTORUN("propedit_add", dlg, "Propedit: add new attribute", NULL, failed); key = dlg[wkey].val.str; if (key == NULL) key = ""; @@ -413,7 +413,7 @@ free(path); prop_refresh(ctx); } - PCB_DAD_FREE(dlg); + RND_DAD_FREE(dlg); } static void prop_del_cb(void *hid_ctx, void *caller_data, rnd_hid_attribute_t *attr) @@ -470,113 +470,113 @@ static const char *type_tabs[] = {"none", "string", "coord", "angle", "int", NULL}; static const char *abshelp = "When unticked each apply is a relative change added to\nthe current value of each object"; - PCB_DAD_BEGIN_TABBED(ctx->dlg, type_tabs); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE_TABLAB); - ctx->wtype = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "(nothing to edit)"); + RND_DAD_BEGIN_TABBED(ctx->dlg, type_tabs); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_HIDE_TABLAB); + ctx->wtype = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "(nothing to edit)"); ctx->wabs[0] = 0; ctx->wedit[0] = 0; - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Data type: string"); - PCB_DAD_STRING(ctx->dlg); - ctx->wedit[1] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_ENTER_CB(ctx->dlg, prop_data_auto_cb); - PCB_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Data type: string"); + RND_DAD_STRING(ctx->dlg); + ctx->wedit[1] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_ENTER_CB(ctx->dlg, prop_data_auto_cb); + RND_DAD_BEGIN_HBOX(ctx->dlg); ctx->wabs[1] = 0; - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "apply"); - PCB_DAD_CHANGE_CB(ctx->dlg, prop_data_force_cb); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Data type: coord"); - PCB_DAD_COORD(ctx->dlg, ""); - ctx->wedit[2] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_MINMAX(ctx->dlg, -RND_MAX_COORD, RND_MAX_COORD); - PCB_DAD_ENTER_CB(ctx->dlg, prop_data_auto_cb); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "abs"); - PCB_DAD_BOOL(ctx->dlg, ""); - ctx->wabs[2] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_HELP(ctx->dlg, abshelp); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "apply"); - PCB_DAD_CHANGE_CB(ctx->dlg, prop_data_force_cb); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Data type: angle"); - PCB_DAD_REAL(ctx->dlg, ""); - ctx->wedit[3] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_MINMAX(ctx->dlg, -360.0, +360.0); - PCB_DAD_ENTER_CB(ctx->dlg, prop_data_auto_cb); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "abs"); - PCB_DAD_BOOL(ctx->dlg, ""); - ctx->wabs[3] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_HELP(ctx->dlg, abshelp); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "apply"); - PCB_DAD_CHANGE_CB(ctx->dlg, prop_data_force_cb); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "apply"); + RND_DAD_CHANGE_CB(ctx->dlg, prop_data_force_cb); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Data type: coord"); + RND_DAD_COORD(ctx->dlg, ""); + ctx->wedit[2] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, -RND_MAX_COORD, RND_MAX_COORD); + RND_DAD_ENTER_CB(ctx->dlg, prop_data_auto_cb); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "abs"); + RND_DAD_BOOL(ctx->dlg, ""); + ctx->wabs[2] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_HELP(ctx->dlg, abshelp); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "apply"); + RND_DAD_CHANGE_CB(ctx->dlg, prop_data_force_cb); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Data type: angle"); + RND_DAD_REAL(ctx->dlg, ""); + ctx->wedit[3] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_MINMAX(ctx->dlg, -360.0, +360.0); + RND_DAD_ENTER_CB(ctx->dlg, prop_data_auto_cb); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "abs"); + RND_DAD_BOOL(ctx->dlg, ""); + ctx->wabs[3] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_HELP(ctx->dlg, abshelp); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "apply"); + RND_DAD_CHANGE_CB(ctx->dlg, prop_data_force_cb); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Data type: int"); - PCB_DAD_INTEGER(ctx->dlg, ""); - ctx->wedit[4] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_ENTER_CB(ctx->dlg, prop_data_auto_cb); - PCB_DAD_MINMAX(ctx->dlg, -(1<<30), 1<<30); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "abs"); - PCB_DAD_BOOL(ctx->dlg, ""); - ctx->wabs[4] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_HELP(ctx->dlg, abshelp); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "apply"); - PCB_DAD_CHANGE_CB(ctx->dlg, prop_data_force_cb); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Data type: int"); + RND_DAD_INTEGER(ctx->dlg, ""); + ctx->wedit[4] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_ENTER_CB(ctx->dlg, prop_data_auto_cb); + RND_DAD_MINMAX(ctx->dlg, -(1<<30), 1<<30); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "abs"); + RND_DAD_BOOL(ctx->dlg, ""); + ctx->wabs[4] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_HELP(ctx->dlg, abshelp); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "apply"); + RND_DAD_CHANGE_CB(ctx->dlg, prop_data_force_cb); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Data type: boolean"); - PCB_DAD_BOOL(ctx->dlg, ""); - ctx->wedit[5] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Data type: boolean"); + RND_DAD_BOOL(ctx->dlg, ""); + ctx->wedit[5] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); ctx->wabs[5] = 0; - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "apply"); - PCB_DAD_CHANGE_CB(ctx->dlg, prop_data_force_cb); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "apply"); + RND_DAD_CHANGE_CB(ctx->dlg, prop_data_force_cb); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, "Data type: color"); - PCB_DAD_COLOR(ctx->dlg); - ctx->wedit[6] = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, "Data type: color"); + RND_DAD_COLOR(ctx->dlg); + ctx->wedit[6] = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); ctx->wabs[6] = 0; - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "apply"); - PCB_DAD_CHANGE_CB(ctx->dlg, prop_data_force_cb); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "apply"); + RND_DAD_CHANGE_CB(ctx->dlg, prop_data_force_cb); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); } static void pcb_dlg_propdlg(propdlg_t *ctx) @@ -583,64 +583,64 @@ { const char *hdr[] = {"property", "common", "min", "max", "avg", NULL}; const char *hdr_val[] = {"use", "values"}; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; static rnd_rnd_box_t prvbb = {0, 0, PCB_MM_TO_COORD(10), PCB_MM_TO_COORD(10)}; int n; rnd_hid_attr_val_t hv; - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HPANE(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_HPANE(ctx->dlg); /* left: property tree and filter */ - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_TREE(ctx->dlg, 5, 1, hdr); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - ctx->wtree = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_TREE_SET_CB(ctx->dlg, selected_cb, prop_select_node_cb); - PCB_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); - PCB_DAD_BEGIN_HBOX(ctx->dlg); - PCB_DAD_STRING(ctx->dlg); - PCB_DAD_HELP(ctx->dlg, "Filter text:\nlist properties with\nmatching name only"); - PCB_DAD_CHANGE_CB(ctx->dlg, prop_filter_cb); - ctx->wfilter = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_BUTTON(ctx->dlg, "add"); - PCB_DAD_CHANGE_CB(ctx->dlg, prop_add_cb); - PCB_DAD_HELP(ctx->dlg, "Create a new attribute\n(in the a/ subtree)"); - PCB_DAD_BUTTON(ctx->dlg, "del"); - PCB_DAD_CHANGE_CB(ctx->dlg, prop_del_cb); - PCB_DAD_HELP(ctx->dlg, "Remove the selected attribute\n(from the a/ subtree)"); - PCB_DAD_BUTTON(ctx->dlg, "rfr"); - PCB_DAD_CHANGE_CB(ctx->dlg, prop_refresh_cb); - PCB_DAD_HELP(ctx->dlg, "Refresh: rebuild the tree\nupdating all values from the board"); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_TREE(ctx->dlg, 5, 1, hdr); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + ctx->wtree = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_TREE_SET_CB(ctx->dlg, selected_cb, prop_select_node_cb); + RND_DAD_TREE_SET_CB(ctx->dlg, ctx, ctx); + RND_DAD_BEGIN_HBOX(ctx->dlg); + RND_DAD_STRING(ctx->dlg); + RND_DAD_HELP(ctx->dlg, "Filter text:\nlist properties with\nmatching name only"); + RND_DAD_CHANGE_CB(ctx->dlg, prop_filter_cb); + ctx->wfilter = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_BUTTON(ctx->dlg, "add"); + RND_DAD_CHANGE_CB(ctx->dlg, prop_add_cb); + RND_DAD_HELP(ctx->dlg, "Create a new attribute\n(in the a/ subtree)"); + RND_DAD_BUTTON(ctx->dlg, "del"); + RND_DAD_CHANGE_CB(ctx->dlg, prop_del_cb); + RND_DAD_HELP(ctx->dlg, "Remove the selected attribute\n(from the a/ subtree)"); + RND_DAD_BUTTON(ctx->dlg, "rfr"); + RND_DAD_CHANGE_CB(ctx->dlg, prop_refresh_cb); + RND_DAD_HELP(ctx->dlg, "Refresh: rebuild the tree\nupdating all values from the board"); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); /* right: preview and per type edit */ - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_PREVIEW(ctx->dlg, prop_prv_expose_cb, prop_prv_mouse_cb, NULL, &prvbb, 100, 100, ctx); - PCB_DAD_END(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, ""); - ctx->wscope = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_HELP(ctx->dlg, "Scope: list of objects affected"); - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - PCB_DAD_TREE(ctx->dlg, 2, 0, hdr_val); - ctx->wvals = PCB_DAD_CURRENT(ctx->dlg); - PCB_DAD_CHANGE_CB(ctx->dlg, prop_preset_cb); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_PREVIEW(ctx->dlg, prop_prv_expose_cb, prop_prv_mouse_cb, NULL, &prvbb, 100, 100, ctx); + RND_DAD_END(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, ""); + ctx->wscope = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_HELP(ctx->dlg, "Scope: list of objects affected"); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_COMPFLAG(ctx->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + RND_DAD_TREE(ctx->dlg, 2, 0, hdr_val); + ctx->wvals = RND_DAD_CURRENT(ctx->dlg); + RND_DAD_CHANGE_CB(ctx->dlg, prop_preset_cb); + RND_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); build_propval(ctx); - PCB_DAD_END(ctx->dlg); - PCB_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); - PCB_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); + RND_DAD_END(ctx->dlg); - PCB_DAD_NEW("propedit", ctx->dlg, "Property editor", ctx, pcb_false, propdlgclose_cb); + RND_DAD_NEW("propedit", ctx->dlg, "Property editor", ctx, pcb_false, propdlgclose_cb); prop_refresh(ctx); gdl_append(&propdlgs, ctx, link); Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 30991) +++ trunk/src_plugins/report/report.c (revision 30992) @@ -80,13 +80,13 @@ typedef struct rdialog_ctx_s { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) } rdialog_ctx_t; static void rdialog_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) { rdialog_ctx_t *ctx = caller_data; - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); free(ctx); } @@ -93,14 +93,14 @@ static void rdialog(const char *name, const char *content) { rdialog_ctx_t *ctx = calloc(sizeof(rdialog_ctx_t), 1); - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; - PCB_DAD_BEGIN_VBOX(ctx->dlg); - PCB_DAD_LABEL(ctx->dlg, content); - PCB_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); - PCB_DAD_END(ctx->dlg); + RND_DAD_BEGIN_VBOX(ctx->dlg); + RND_DAD_LABEL(ctx->dlg, content); + RND_DAD_BUTTON_CLOSES(ctx->dlg, clbtn); + RND_DAD_END(ctx->dlg); - PCB_DAD_NEW("report", ctx->dlg, name, ctx, pcb_false, rdialog_close_cb); + RND_DAD_NEW("report", ctx->dlg, name, ctx, pcb_false, rdialog_close_cb); } Index: trunk/src_plugins/script/live_script.c =================================================================== --- trunk/src_plugins/script/live_script.c (revision 30991) +++ trunk/src_plugins/script/live_script.c (revision 30992) @@ -51,7 +51,7 @@ typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) rnd_hidlib_t *hidlib; char *name, *longname, *fn; char **langs; @@ -85,7 +85,7 @@ pcb_script_unload(lvs->longname, NULL); if (rnd_gui != NULL) - PCB_DAD_FREE(lvs->dlg); + RND_DAD_FREE(lvs->dlg); lvs_free_langs(lvs); free(lvs->name); free(lvs->longname); @@ -198,7 +198,7 @@ static live_script_t *pcb_dlg_live_script(rnd_hidlib_t *hidlib, const char *name) { - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; char *title; live_script_t *lvs = calloc(sizeof(live_script_t), 1); @@ -212,55 +212,55 @@ lvs->hidlib = hidlib; lvs->name = rnd_strdup(name); lvs->longname = pcb_concat("_live_script_", name, NULL); - PCB_DAD_BEGIN_VBOX(lvs->dlg); - PCB_DAD_COMPFLAG(lvs->dlg, RND_HATF_EXPFILL); - PCB_DAD_TEXT(lvs->dlg, lvs); - PCB_DAD_COMPFLAG(lvs->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - lvs->wtxt = PCB_DAD_CURRENT(lvs->dlg); + RND_DAD_BEGIN_VBOX(lvs->dlg); + RND_DAD_COMPFLAG(lvs->dlg, RND_HATF_EXPFILL); + RND_DAD_TEXT(lvs->dlg, lvs); + RND_DAD_COMPFLAG(lvs->dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + lvs->wtxt = RND_DAD_CURRENT(lvs->dlg); - PCB_DAD_BEGIN_HBOX(lvs->dlg); - PCB_DAD_BUTTON(lvs->dlg, "re-run"); - lvs->wrerun = PCB_DAD_CURRENT(lvs->dlg); - PCB_DAD_CHANGE_CB(lvs->dlg, lvs_button_cb); - PCB_DAD_HELP(lvs->dlg, "Stop the script if it is running\nundo the changes the script performed if no\nuser modification happened since\nrun the script again"); - PCB_DAD_BUTTON(lvs->dlg, "run"); - lvs->wrun = PCB_DAD_CURRENT(lvs->dlg); - PCB_DAD_CHANGE_CB(lvs->dlg, lvs_button_cb); - PCB_DAD_HELP(lvs->dlg, "Run the script:\nonce and unload, if not persistent\nor keep it running in persistent mode"); - PCB_DAD_BUTTON(lvs->dlg, "stop"); - lvs->wstop = PCB_DAD_CURRENT(lvs->dlg); - PCB_DAD_CHANGE_CB(lvs->dlg, lvs_button_cb); - PCB_DAD_HELP(lvs->dlg, "Halt and unload the script\nand unregister any action, menu, etc. it registered"); - PCB_DAD_BUTTON(lvs->dlg, "undo"); - lvs->wundo = PCB_DAD_CURRENT(lvs->dlg); - PCB_DAD_CHANGE_CB(lvs->dlg, lvs_button_cb); - PCB_DAD_HELP(lvs->dlg, "undo the changes the script performed if no\nuser modification happened since"); - PCB_DAD_BUTTON(lvs->dlg, "save"); - lvs->wsave = PCB_DAD_CURRENT(lvs->dlg); - PCB_DAD_CHANGE_CB(lvs->dlg, lvs_button_cb); - PCB_DAD_HELP(lvs->dlg, "Save script source to a file"); - PCB_DAD_BUTTON(lvs->dlg, "load"); - lvs->wload = PCB_DAD_CURRENT(lvs->dlg); - PCB_DAD_CHANGE_CB(lvs->dlg, lvs_button_cb); - PCB_DAD_HELP(lvs->dlg, "Load script source from a file"); - PCB_DAD_END(lvs->dlg); - PCB_DAD_BEGIN_HBOX(lvs->dlg); - PCB_DAD_BOOL(lvs->dlg, ""); - lvs->wpers = PCB_DAD_CURRENT(lvs->dlg); - PCB_DAD_LABEL(lvs->dlg, "persistent"); - PCB_DAD_HELP(lvs->dlg, "Persistent mode: keep the script loaded and running\n(useful if the script registers actions)\nNon-persistent mode: run once then unload."); - PCB_DAD_ENUM(lvs->dlg, (const char **)lvs->langs); - lvs->wlang = PCB_DAD_CURRENT(lvs->dlg); - PCB_DAD_BEGIN_HBOX(lvs->dlg); - PCB_DAD_COMPFLAG(lvs->dlg, RND_HATF_EXPFILL); - PCB_DAD_END(lvs->dlg); - PCB_DAD_BUTTON_CLOSES(lvs->dlg, clbtn); - PCB_DAD_END(lvs->dlg); - PCB_DAD_END(lvs->dlg); - PCB_DAD_DEFSIZE(lvs->dlg, 300, 500); + RND_DAD_BEGIN_HBOX(lvs->dlg); + RND_DAD_BUTTON(lvs->dlg, "re-run"); + lvs->wrerun = RND_DAD_CURRENT(lvs->dlg); + RND_DAD_CHANGE_CB(lvs->dlg, lvs_button_cb); + RND_DAD_HELP(lvs->dlg, "Stop the script if it is running\nundo the changes the script performed if no\nuser modification happened since\nrun the script again"); + RND_DAD_BUTTON(lvs->dlg, "run"); + lvs->wrun = RND_DAD_CURRENT(lvs->dlg); + RND_DAD_CHANGE_CB(lvs->dlg, lvs_button_cb); + RND_DAD_HELP(lvs->dlg, "Run the script:\nonce and unload, if not persistent\nor keep it running in persistent mode"); + RND_DAD_BUTTON(lvs->dlg, "stop"); + lvs->wstop = RND_DAD_CURRENT(lvs->dlg); + RND_DAD_CHANGE_CB(lvs->dlg, lvs_button_cb); + RND_DAD_HELP(lvs->dlg, "Halt and unload the script\nand unregister any action, menu, etc. it registered"); + RND_DAD_BUTTON(lvs->dlg, "undo"); + lvs->wundo = RND_DAD_CURRENT(lvs->dlg); + RND_DAD_CHANGE_CB(lvs->dlg, lvs_button_cb); + RND_DAD_HELP(lvs->dlg, "undo the changes the script performed if no\nuser modification happened since"); + RND_DAD_BUTTON(lvs->dlg, "save"); + lvs->wsave = RND_DAD_CURRENT(lvs->dlg); + RND_DAD_CHANGE_CB(lvs->dlg, lvs_button_cb); + RND_DAD_HELP(lvs->dlg, "Save script source to a file"); + RND_DAD_BUTTON(lvs->dlg, "load"); + lvs->wload = RND_DAD_CURRENT(lvs->dlg); + RND_DAD_CHANGE_CB(lvs->dlg, lvs_button_cb); + RND_DAD_HELP(lvs->dlg, "Load script source from a file"); + RND_DAD_END(lvs->dlg); + RND_DAD_BEGIN_HBOX(lvs->dlg); + RND_DAD_BOOL(lvs->dlg, ""); + lvs->wpers = RND_DAD_CURRENT(lvs->dlg); + RND_DAD_LABEL(lvs->dlg, "persistent"); + RND_DAD_HELP(lvs->dlg, "Persistent mode: keep the script loaded and running\n(useful if the script registers actions)\nNon-persistent mode: run once then unload."); + RND_DAD_ENUM(lvs->dlg, (const char **)lvs->langs); + lvs->wlang = RND_DAD_CURRENT(lvs->dlg); + RND_DAD_BEGIN_HBOX(lvs->dlg); + RND_DAD_COMPFLAG(lvs->dlg, RND_HATF_EXPFILL); + RND_DAD_END(lvs->dlg); + RND_DAD_BUTTON_CLOSES(lvs->dlg, clbtn); + RND_DAD_END(lvs->dlg); + RND_DAD_END(lvs->dlg); + RND_DAD_DEFSIZE(lvs->dlg, 300, 500); title = pcb_concat("Live Scripting: ", name, NULL); - PCB_DAD_NEW("live_script", lvs->dlg, title, lvs, pcb_false, lvs_close_cb); + RND_DAD_NEW("live_script", lvs->dlg, title, lvs, pcb_false, lvs_close_cb); free(title); rnd_gui->attr_dlg_widget_state(lvs->dlg_hid_ctx, lvs->wstop, 0); return lvs; Index: trunk/src_plugins/script/script_act.c =================================================================== --- trunk/src_plugins/script/script_act.c (revision 30991) +++ trunk/src_plugins/script/script_act.c (revision 30992) @@ -62,7 +62,7 @@ /*** dialog box ***/ typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int active; /* already open - allow only one instance */ int wslist; /* list of scripts */ @@ -99,7 +99,7 @@ cell[1] = NULL; for(e = htsp_first(&sc->obj->func_tbl); e; e = htsp_next(&sc->obj->func_tbl, e)) { cell[0] = rnd_strdup(e->key); - pcb_dad_tree_append(attr, NULL, cell); + rnd_dad_tree_append(attr, NULL, cell); } } @@ -131,7 +131,7 @@ cell[0] = rnd_strdup(s->id); cell[1] = rnd_strdup(s->lang); cell[2] = rnd_strdup(s->fn); - pcb_dad_tree_append(attr, NULL, cell); + rnd_dad_tree_append(attr, NULL, cell); } /* restore cursor */ @@ -153,7 +153,7 @@ static void script_dlg_close_cb(void *caller_data, rnd_hid_attr_ev_t ev) { script_dlg_t *ctx = caller_data; - PCB_DAD_FREE(ctx->dlg); + RND_DAD_FREE(ctx->dlg); memset(ctx, 0, sizeof(script_dlg_t)); /* reset all states to the initial - includes ctx->active = 0; */ } @@ -189,9 +189,9 @@ script_dlg_t *ctx = caller_data; int failed; char *tmp, *fn = rnd_gui->fileselect(rnd_gui, "script to load", "Select a script file to load", NULL, NULL, NULL, "script", RND_HID_FSD_READ, NULL); - pcb_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Cancel", -1}, {"ok", 0}, {NULL, 0}}; typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) int wid, wlang; } idlang_t; idlang_t idlang; @@ -200,11 +200,11 @@ return; memset(&idlang, 0, sizeof(idlang)); - PCB_DAD_BEGIN_VBOX(idlang.dlg); - PCB_DAD_BEGIN_HBOX(idlang.dlg); - PCB_DAD_LABEL(idlang.dlg, "ID:"); - PCB_DAD_STRING(idlang.dlg); - idlang.wid = PCB_DAD_CURRENT(idlang.dlg); + RND_DAD_BEGIN_VBOX(idlang.dlg); + RND_DAD_BEGIN_HBOX(idlang.dlg); + RND_DAD_LABEL(idlang.dlg, "ID:"); + RND_DAD_STRING(idlang.dlg); + idlang.wid = RND_DAD_CURRENT(idlang.dlg); tmp = strrchr(fn, RND_DIR_SEPARATOR_C); if (tmp != NULL) { tmp++; @@ -213,74 +213,74 @@ if (tmp != NULL) *tmp = '\0'; } - PCB_DAD_END(idlang.dlg); - PCB_DAD_BEGIN_HBOX(idlang.dlg); - PCB_DAD_LABEL(idlang.dlg, "language:"); - PCB_DAD_STRING(idlang.dlg); - idlang.wlang = PCB_DAD_CURRENT(idlang.dlg); + RND_DAD_END(idlang.dlg); + RND_DAD_BEGIN_HBOX(idlang.dlg); + RND_DAD_LABEL(idlang.dlg, "language:"); + RND_DAD_STRING(idlang.dlg); + idlang.wlang = RND_DAD_CURRENT(idlang.dlg); tmp = strrchr(fn, '.'); if (tmp != NULL) idlang.dlg[idlang.wlang].val.str = rnd_strdup(guess_lang(tmp+1)); - PCB_DAD_END(idlang.dlg); - PCB_DAD_BUTTON_CLOSES(idlang.dlg, clbtn); - PCB_DAD_END(idlang.dlg); + RND_DAD_END(idlang.dlg); + RND_DAD_BUTTON_CLOSES(idlang.dlg, clbtn); + RND_DAD_END(idlang.dlg); - PCB_DAD_AUTORUN("script_load", idlang.dlg, "load script", NULL, failed); + RND_DAD_AUTORUN("script_load", idlang.dlg, "load script", NULL, failed); if ((!failed) && (pcb_script_load(idlang.dlg[idlang.wid].val.str, fn, idlang.dlg[idlang.wlang].val.str) == 0)) script_dlg_s2d(ctx); - PCB_DAD_FREE(idlang.dlg); + RND_DAD_FREE(idlang.dlg); } static void script_dlg_open(void) { static const char *hdr[] = {"ID", "language", "file", NULL}; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; if (script_dlg.active) return; /* do not open another */ - PCB_DAD_BEGIN_VBOX(script_dlg.dlg); - PCB_DAD_COMPFLAG(script_dlg.dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_HPANE(script_dlg.dlg); - PCB_DAD_COMPFLAG(script_dlg.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_VBOX(script_dlg.dlg); + RND_DAD_COMPFLAG(script_dlg.dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_HPANE(script_dlg.dlg); + RND_DAD_COMPFLAG(script_dlg.dlg, RND_HATF_EXPFILL); /* left side */ - PCB_DAD_BEGIN_VBOX(script_dlg.dlg); - PCB_DAD_COMPFLAG(script_dlg.dlg, RND_HATF_EXPFILL); - PCB_DAD_TREE(script_dlg.dlg, 3, 0, hdr); - PCB_DAD_COMPFLAG(script_dlg.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - script_dlg.wslist = PCB_DAD_CURRENT(script_dlg.dlg); - PCB_DAD_CHANGE_CB(script_dlg.dlg, slist_cb); - PCB_DAD_BEGIN_HBOX(script_dlg.dlg); - PCB_DAD_BUTTON(script_dlg.dlg, "Unload"); - PCB_DAD_HELP(script_dlg.dlg, "Unload the currently selected script"); - PCB_DAD_CHANGE_CB(script_dlg.dlg, btn_unload_cb); - PCB_DAD_BUTTON(script_dlg.dlg, "Reload"); - PCB_DAD_HELP(script_dlg.dlg, "Reload the currently selected script\n(useful if the script has changed)"); - PCB_DAD_CHANGE_CB(script_dlg.dlg, btn_reload_cb); - PCB_DAD_BUTTON(script_dlg.dlg, "Load..."); - PCB_DAD_HELP(script_dlg.dlg, "Load a new script from disk"); - PCB_DAD_CHANGE_CB(script_dlg.dlg, btn_load_cb); - PCB_DAD_END(script_dlg.dlg); - PCB_DAD_END(script_dlg.dlg); + RND_DAD_BEGIN_VBOX(script_dlg.dlg); + RND_DAD_COMPFLAG(script_dlg.dlg, RND_HATF_EXPFILL); + RND_DAD_TREE(script_dlg.dlg, 3, 0, hdr); + RND_DAD_COMPFLAG(script_dlg.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + script_dlg.wslist = RND_DAD_CURRENT(script_dlg.dlg); + RND_DAD_CHANGE_CB(script_dlg.dlg, slist_cb); + RND_DAD_BEGIN_HBOX(script_dlg.dlg); + RND_DAD_BUTTON(script_dlg.dlg, "Unload"); + RND_DAD_HELP(script_dlg.dlg, "Unload the currently selected script"); + RND_DAD_CHANGE_CB(script_dlg.dlg, btn_unload_cb); + RND_DAD_BUTTON(script_dlg.dlg, "Reload"); + RND_DAD_HELP(script_dlg.dlg, "Reload the currently selected script\n(useful if the script has changed)"); + RND_DAD_CHANGE_CB(script_dlg.dlg, btn_reload_cb); + RND_DAD_BUTTON(script_dlg.dlg, "Load..."); + RND_DAD_HELP(script_dlg.dlg, "Load a new script from disk"); + RND_DAD_CHANGE_CB(script_dlg.dlg, btn_load_cb); + RND_DAD_END(script_dlg.dlg); + RND_DAD_END(script_dlg.dlg); /* right side */ - PCB_DAD_BEGIN_VBOX(script_dlg.dlg); - PCB_DAD_COMPFLAG(script_dlg.dlg, RND_HATF_EXPFILL); - PCB_DAD_LABEL(script_dlg.dlg, "Actions:"); - PCB_DAD_TREE(script_dlg.dlg, 1, 0, NULL); - PCB_DAD_COMPFLAG(script_dlg.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); - script_dlg.walist = PCB_DAD_CURRENT(script_dlg.dlg); - PCB_DAD_END(script_dlg.dlg); - PCB_DAD_END(script_dlg.dlg); - PCB_DAD_BUTTON_CLOSES(script_dlg.dlg, clbtn); - PCB_DAD_END(script_dlg.dlg); + RND_DAD_BEGIN_VBOX(script_dlg.dlg); + RND_DAD_COMPFLAG(script_dlg.dlg, RND_HATF_EXPFILL); + RND_DAD_LABEL(script_dlg.dlg, "Actions:"); + RND_DAD_TREE(script_dlg.dlg, 1, 0, NULL); + RND_DAD_COMPFLAG(script_dlg.dlg, RND_HATF_EXPFILL | RND_HATF_SCROLL); + script_dlg.walist = RND_DAD_CURRENT(script_dlg.dlg); + RND_DAD_END(script_dlg.dlg); + RND_DAD_END(script_dlg.dlg); + RND_DAD_BUTTON_CLOSES(script_dlg.dlg, clbtn); + RND_DAD_END(script_dlg.dlg); /* set up the context */ script_dlg.active = 1; - PCB_DAD_NEW("scripts", script_dlg.dlg, "pcb-rnd Scripts", &script_dlg, pcb_false, script_dlg_close_cb); + RND_DAD_NEW("scripts", script_dlg.dlg, "pcb-rnd Scripts", &script_dlg, pcb_false, script_dlg_close_cb); script_dlg_s2d(&script_dlg); } Index: trunk/src_plugins/shape/shape_dialog.c =================================================================== --- trunk/src_plugins/shape/shape_dialog.c (revision 30991) +++ trunk/src_plugins/shape/shape_dialog.c (revision 30992) @@ -1,7 +1,7 @@ #include typedef struct { - PCB_DAD_DECL_NOINIT(dlg) + RND_DAD_DECL_NOINIT(dlg) pcb_board_t *pcb; pcb_data_t *data; pcb_layer_t *layer; @@ -31,7 +31,7 @@ if (shp == shape_active) shape_active = NULL; - PCB_DAD_FREE(shp->dlg); + RND_DAD_FREE(shp->dlg); free(shp); } @@ -50,7 +50,7 @@ /* elliptical logics */ if (!shp->dlg[shp->pell].val.lng) { rnd_gui->attr_dlg_widget_state(hid_ctx, shp->pry, pcb_false); - PCB_DAD_SET_VALUE(hid_ctx, shp->pry, crd, shp->dlg[shp->prx].val.crd); + RND_DAD_SET_VALUE(hid_ctx, shp->pry, crd, shp->dlg[shp->prx].val.crd); } else rnd_gui->attr_dlg_widget_state(hid_ctx, shp->pry, pcb_true); @@ -72,7 +72,7 @@ /* elliptical logics */ if (!shp->dlg[shp->rell].val.lng) { rnd_gui->attr_dlg_widget_state(hid_ctx, shp->ry, pcb_false); - PCB_DAD_SET_VALUE(hid_ctx, shp->ry, crd, shp->dlg[shp->rx].val.crd); + RND_DAD_SET_VALUE(hid_ctx, shp->ry, crd, shp->dlg[shp->rx].val.crd); } else rnd_gui->attr_dlg_widget_state(hid_ctx, shp->ry, pcb_true); @@ -80,7 +80,7 @@ /* rectangular logics */ if (!shp->dlg[shp->rrect].val.lng) { rnd_gui->attr_dlg_widget_state(hid_ctx, shp->h, pcb_false); - PCB_DAD_SET_VALUE(hid_ctx, shp->h, crd, shp->dlg[shp->w].val.crd); + RND_DAD_SET_VALUE(hid_ctx, shp->h, crd, shp->dlg[shp->w].val.crd); } else rnd_gui->attr_dlg_widget_state(hid_ctx, shp->h, pcb_true); @@ -143,252 +143,252 @@ rnd_coord_t mm2 = PCB_MM_TO_COORD(2); rnd_coord_t maxr = PCB_MM_TO_COORD(1000); const char *tabs[] = {"Regular polygon", "Round rectangle", "Filled circle", NULL}; - pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + rnd_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; shp->pcb = pcb; shp->data = data; shp->layer = layer; - PCB_DAD_BEGIN_VBOX(shp->dlg); - PCB_DAD_COMPFLAG(shp->dlg, RND_HATF_EXPFILL); - PCB_DAD_BEGIN_TABBED(shp->dlg, tabs); - shp->tab = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_tab); + RND_DAD_BEGIN_VBOX(shp->dlg); + RND_DAD_COMPFLAG(shp->dlg, RND_HATF_EXPFILL); + RND_DAD_BEGIN_TABBED(shp->dlg, tabs); + shp->tab = RND_DAD_CURRENT(shp->dlg); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_tab); /* regpoly tab */ - PCB_DAD_BEGIN_VBOX(shp->dlg); - PCB_DAD_LABEL(shp->dlg, "Generate regular polygon"); - PCB_DAD_BEGIN_TABLE(shp->dlg, 2); - PCB_DAD_LABEL(shp->dlg, "Number of corners"); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_INTEGER(shp->dlg, ""); - shp->corners = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINVAL(shp->dlg, 3); - PCB_DAD_MAXVAL(shp->dlg, 64); - PCB_DAD_DEFAULT_NUM(shp->dlg, 8); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_regpoly); - PCB_DAD_END(shp->dlg); + RND_DAD_BEGIN_VBOX(shp->dlg); + RND_DAD_LABEL(shp->dlg, "Generate regular polygon"); + RND_DAD_BEGIN_TABLE(shp->dlg, 2); + RND_DAD_LABEL(shp->dlg, "Number of corners"); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_INTEGER(shp->dlg, ""); + shp->corners = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINVAL(shp->dlg, 3); + RND_DAD_MAXVAL(shp->dlg, 64); + RND_DAD_DEFAULT_NUM(shp->dlg, 8); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_regpoly); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, "Shape radius"); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_COORD(shp->dlg, ""); - shp->prx = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINMAX(shp->dlg, 0, maxr); - PCB_DAD_DEFAULT_NUM(shp->dlg, mm2); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_regpoly); - PCB_DAD_LABEL(shp->dlg, "x (horizontal)"); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, "Shape radius"); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_COORD(shp->dlg, ""); + shp->prx = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINMAX(shp->dlg, 0, maxr); + RND_DAD_DEFAULT_NUM(shp->dlg, mm2); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_regpoly); + RND_DAD_LABEL(shp->dlg, "x (horizontal)"); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, ""); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_COORD(shp->dlg, ""); - shp->pry = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINMAX(shp->dlg, 0, maxr); - PCB_DAD_DEFAULT_NUM(shp->dlg, mm2); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_regpoly); - PCB_DAD_LABEL(shp->dlg, "y (vertical)"); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, ""); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_COORD(shp->dlg, ""); + shp->pry = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINMAX(shp->dlg, 0, maxr); + RND_DAD_DEFAULT_NUM(shp->dlg, mm2); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_regpoly); + RND_DAD_LABEL(shp->dlg, "y (vertical)"); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, ""); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_BOOL(shp->dlg, ""); - shp->pell = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_regpoly); - PCB_DAD_LABEL(shp->dlg, "elliptical"); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, ""); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_BOOL(shp->dlg, ""); + shp->pell = RND_DAD_CURRENT(shp->dlg); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_regpoly); + RND_DAD_LABEL(shp->dlg, "elliptical"); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, "Rotation angle:"); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_REAL(shp->dlg, ""); - shp->prot = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINVAL(shp->dlg, -360); - PCB_DAD_MAXVAL(shp->dlg, 360); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_regpoly); - PCB_DAD_LABEL(shp->dlg, "deg"); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, "Rotation angle:"); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_REAL(shp->dlg, ""); + shp->prot = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINVAL(shp->dlg, -360); + RND_DAD_MAXVAL(shp->dlg, 360); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_regpoly); + RND_DAD_LABEL(shp->dlg, "deg"); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, "Center offset"); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_COORD(shp->dlg, ""); - shp->pcx = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINMAX(shp->dlg, 0, maxr); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_regpoly); - PCB_DAD_LABEL(shp->dlg, "x (horizontal)"); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, "Center offset"); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_COORD(shp->dlg, ""); + shp->pcx = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINMAX(shp->dlg, 0, maxr); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_regpoly); + RND_DAD_LABEL(shp->dlg, "x (horizontal)"); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, ""); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_COORD(shp->dlg, ""); - shp->pcy = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINMAX(shp->dlg, 0, maxr); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_regpoly); - PCB_DAD_LABEL(shp->dlg, "y (vertical)"); - PCB_DAD_END(shp->dlg); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, ""); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_COORD(shp->dlg, ""); + shp->pcy = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINMAX(shp->dlg, 0, maxr); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_regpoly); + RND_DAD_LABEL(shp->dlg, "y (vertical)"); + RND_DAD_END(shp->dlg); + RND_DAD_END(shp->dlg); - PCB_DAD_END(shp->dlg); + RND_DAD_END(shp->dlg); /* roundrect tab */ - PCB_DAD_BEGIN_VBOX(shp->dlg); - PCB_DAD_LABEL(shp->dlg, "Generate rectange with rounded corners"); - PCB_DAD_BEGIN_TABLE(shp->dlg, 2); + RND_DAD_BEGIN_VBOX(shp->dlg); + RND_DAD_LABEL(shp->dlg, "Generate rectange with rounded corners"); + RND_DAD_BEGIN_TABLE(shp->dlg, 2); - PCB_DAD_LABEL(shp->dlg, "Rectangle size"); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_COORD(shp->dlg, ""); - shp->w = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINMAX(shp->dlg, 0, maxr); - PCB_DAD_DEFAULT_NUM(shp->dlg, mm2); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); - PCB_DAD_LABEL(shp->dlg, "width (horizontal)"); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, "Rectangle size"); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_COORD(shp->dlg, ""); + shp->w = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINMAX(shp->dlg, 0, maxr); + RND_DAD_DEFAULT_NUM(shp->dlg, mm2); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); + RND_DAD_LABEL(shp->dlg, "width (horizontal)"); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, ""); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_COORD(shp->dlg, ""); - shp->h = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINMAX(shp->dlg, 0, maxr); - PCB_DAD_DEFAULT_NUM(shp->dlg, mm2); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); - PCB_DAD_LABEL(shp->dlg, "height (vertical)"); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, ""); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_COORD(shp->dlg, ""); + shp->h = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINMAX(shp->dlg, 0, maxr); + RND_DAD_DEFAULT_NUM(shp->dlg, mm2); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); + RND_DAD_LABEL(shp->dlg, "height (vertical)"); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, ""); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_BOOL(shp->dlg, ""); - shp->rrect = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); - PCB_DAD_LABEL(shp->dlg, "rectangular"); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, ""); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_BOOL(shp->dlg, ""); + shp->rrect = RND_DAD_CURRENT(shp->dlg); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); + RND_DAD_LABEL(shp->dlg, "rectangular"); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, "Rounding radius"); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_COORD(shp->dlg, ""); - shp->rx = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINMAX(shp->dlg, 0, maxr); - PCB_DAD_DEFAULT_NUM(shp->dlg, mm2/10); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); - PCB_DAD_LABEL(shp->dlg, "x (horizontal)"); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, "Rounding radius"); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_COORD(shp->dlg, ""); + shp->rx = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINMAX(shp->dlg, 0, maxr); + RND_DAD_DEFAULT_NUM(shp->dlg, mm2/10); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); + RND_DAD_LABEL(shp->dlg, "x (horizontal)"); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, ""); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_COORD(shp->dlg, ""); - shp->ry = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINMAX(shp->dlg, 0, maxr); - PCB_DAD_DEFAULT_NUM(shp->dlg, mm2/10); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); - PCB_DAD_LABEL(shp->dlg, "y (vertical)"); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, ""); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_COORD(shp->dlg, ""); + shp->ry = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINMAX(shp->dlg, 0, maxr); + RND_DAD_DEFAULT_NUM(shp->dlg, mm2/10); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); + RND_DAD_LABEL(shp->dlg, "y (vertical)"); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, ""); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_BOOL(shp->dlg, ""); - shp->rell = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); - PCB_DAD_LABEL(shp->dlg, "elliptical"); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, ""); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_BOOL(shp->dlg, ""); + shp->rell = RND_DAD_CURRENT(shp->dlg); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); + RND_DAD_LABEL(shp->dlg, "elliptical"); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, "Arc resolution factor:"); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_REAL(shp->dlg, ""); - shp->rres = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINVAL(shp->dlg, 0.1); - PCB_DAD_MAXVAL(shp->dlg, 5); - PCB_DAD_DEFAULT_NUM(shp->dlg, 1); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, "Arc resolution factor:"); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_REAL(shp->dlg, ""); + shp->rres = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINVAL(shp->dlg, 0.1); + RND_DAD_MAXVAL(shp->dlg, 5); + RND_DAD_DEFAULT_NUM(shp->dlg, 1); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, "Rotation angle:"); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_REAL(shp->dlg, ""); - shp->rrot = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINVAL(shp->dlg, -360); - PCB_DAD_MAXVAL(shp->dlg, 360); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); - PCB_DAD_LABEL(shp->dlg, "deg"); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, "Rotation angle:"); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_REAL(shp->dlg, ""); + shp->rrot = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINVAL(shp->dlg, -360); + RND_DAD_MAXVAL(shp->dlg, 360); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); + RND_DAD_LABEL(shp->dlg, "deg"); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, "Center offset"); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_COORD(shp->dlg, ""); - shp->rcx = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINMAX(shp->dlg, 0, maxr); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); - PCB_DAD_LABEL(shp->dlg, "x (horizontal)"); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, "Center offset"); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_COORD(shp->dlg, ""); + shp->rcx = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINMAX(shp->dlg, 0, maxr); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); + RND_DAD_LABEL(shp->dlg, "x (horizontal)"); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, ""); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_COORD(shp->dlg, ""); - shp->rcy = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINMAX(shp->dlg, 0, maxr); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); - PCB_DAD_LABEL(shp->dlg, "y (vertical)"); - PCB_DAD_END(shp->dlg); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, ""); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_COORD(shp->dlg, ""); + shp->rcy = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINMAX(shp->dlg, 0, maxr); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); + RND_DAD_LABEL(shp->dlg, "y (vertical)"); + RND_DAD_END(shp->dlg); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, "Corner style:"); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_BEGIN_TABLE(shp->dlg, 2); - PCB_DAD_ENUM(shp->dlg, pcb_shape_corner_name); - shp->corner[0] = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); - PCB_DAD_ENUM(shp->dlg, pcb_shape_corner_name); - shp->corner[1] = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); - PCB_DAD_ENUM(shp->dlg, pcb_shape_corner_name); - shp->corner[2] = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); - PCB_DAD_ENUM(shp->dlg, pcb_shape_corner_name); - shp->corner[3] = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); - PCB_DAD_END(shp->dlg); - PCB_DAD_END(shp->dlg); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, "Corner style:"); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_BEGIN_TABLE(shp->dlg, 2); + RND_DAD_ENUM(shp->dlg, pcb_shape_corner_name); + shp->corner[0] = RND_DAD_CURRENT(shp->dlg); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); + RND_DAD_ENUM(shp->dlg, pcb_shape_corner_name); + shp->corner[1] = RND_DAD_CURRENT(shp->dlg); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); + RND_DAD_ENUM(shp->dlg, pcb_shape_corner_name); + shp->corner[2] = RND_DAD_CURRENT(shp->dlg); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); + RND_DAD_ENUM(shp->dlg, pcb_shape_corner_name); + shp->corner[3] = RND_DAD_CURRENT(shp->dlg); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_roundrect); + RND_DAD_END(shp->dlg); + RND_DAD_END(shp->dlg); + RND_DAD_END(shp->dlg); /* circle tab */ - PCB_DAD_BEGIN_VBOX(shp->dlg); - PCB_DAD_LABEL(shp->dlg, "Generate filled circle"); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_LABEL(shp->dlg, "Diameter:"); - PCB_DAD_COORD(shp->dlg, ""); - shp->dia = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINMAX(shp->dlg, 0, maxr); - PCB_DAD_DEFAULT_NUM(shp->dlg, mm2); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_circle); - PCB_DAD_END(shp->dlg); + RND_DAD_BEGIN_VBOX(shp->dlg); + RND_DAD_LABEL(shp->dlg, "Generate filled circle"); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_LABEL(shp->dlg, "Diameter:"); + RND_DAD_COORD(shp->dlg, ""); + shp->dia = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINMAX(shp->dlg, 0, maxr); + RND_DAD_DEFAULT_NUM(shp->dlg, mm2); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_circle); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, "Center offset"); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_COORD(shp->dlg, ""); - shp->ccx = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINMAX(shp->dlg, 0, maxr); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_circle); - PCB_DAD_LABEL(shp->dlg, "x (horizontal)"); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, "Center offset"); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_COORD(shp->dlg, ""); + shp->ccx = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINMAX(shp->dlg, 0, maxr); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_circle); + RND_DAD_LABEL(shp->dlg, "x (horizontal)"); + RND_DAD_END(shp->dlg); - PCB_DAD_LABEL(shp->dlg, ""); - PCB_DAD_BEGIN_HBOX(shp->dlg); - PCB_DAD_COORD(shp->dlg, ""); - shp->ccy = PCB_DAD_CURRENT(shp->dlg); - PCB_DAD_MINMAX(shp->dlg, 0, maxr); - PCB_DAD_CHANGE_CB(shp->dlg, shp_chg_circle); - PCB_DAD_LABEL(shp->dlg, "y (vertical)"); - PCB_DAD_END(shp->dlg); - PCB_DAD_END(shp->dlg); - PCB_DAD_END(shp->dlg); - PCB_DAD_BUTTON_CLOSES(shp->dlg, clbtn); - PCB_DAD_END(shp->dlg); + RND_DAD_LABEL(shp->dlg, ""); + RND_DAD_BEGIN_HBOX(shp->dlg); + RND_DAD_COORD(shp->dlg, ""); + shp->ccy = RND_DAD_CURRENT(shp->dlg); + RND_DAD_MINMAX(shp->dlg, 0, maxr); + RND_DAD_CHANGE_CB(shp->dlg, shp_chg_circle); + RND_DAD_LABEL(shp->dlg, "y (vertical)"); + RND_DAD_END(shp->dlg); + RND_DAD_END(shp->dlg); + RND_DAD_END(shp->dlg); + RND_DAD_BUTTON_CLOSES(shp->dlg, clbtn); + RND_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, crd, PCB_MM_TO_COORD(25.4)); /* suppress a runtime warning on invalid dia (zero) */ + RND_DAD_NEW("shape", shp->dlg, "dlg_shape", shp, modal, shp_close_cb); + RND_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 */ if (modal) { - PCB_DAD_RUN(shp->dlg); - PCB_DAD_FREE(shp->dlg); + RND_DAD_RUN(shp->dlg); + RND_DAD_FREE(shp->dlg); } else shape_active = shp;