Index: trunk/src/hid_attrib.h =================================================================== --- trunk/src/hid_attrib.h (revision 26944) +++ trunk/src/hid_attrib.h (revision 26945) @@ -45,13 +45,13 @@ PCB_HATT_UNIT, PCB_HATT_COORD, PCB_HATT_BUTTON, /* push button; default value is the label */ - PCB_HATT_TREE, /* tree/list/table view; number of columns: pcb_hatt_table_cols; data is in field 'enumerations' */ + PCB_HATT_TREE, /* tree/list/table view; number of columns: pcb_hatt_table_cols; data is in field 'wdata' */ PCB_HATT_PROGRESS, /* progress bar; displays dbl between 0 and 1 */ - PCB_HATT_PREVIEW, /* preview/render widget; callbacks in 'enumerations' */ - PCB_HATT_PICTURE, /* static picture from xpm - picture data in enumerations */ - PCB_HATT_PICBUTTON, /* button with static picture from xpm - picture data in enumerations */ + PCB_HATT_PREVIEW, /* preview/render widget; callbacks in 'wdata' */ + PCB_HATT_PICTURE, /* static picture from xpm - picture data in wdata */ + PCB_HATT_PICBUTTON, /* button with static picture from xpm - picture data in wdata */ PCB_HATT_COLOR, /* color pick (user input: select a color) */ - PCB_HATT_TEXT, /* plain text editor; data is in 'enumerations' as pcb_hid_text_t */ + PCB_HATT_TEXT, /* plain text editor; data is in 'wdata' as pcb_hid_text_t */ /* groups (e.g. boxes) */ PCB_HATT_BEGIN_HBOX, /* NOTE: PCB_HATT_IS_COMPOSITE() depends on it */ @@ -58,9 +58,9 @@ PCB_HATT_BEGIN_VBOX, PCB_HATT_BEGIN_HPANE, /* horizontal split and offer two vboxes; the split ratio is dbl between 0 and 1, that describes the left side's size */ PCB_HATT_BEGIN_VPANE, /* vertical split and offer two vboxes; the split ratio is dbl between 0 and 1, that describes the left side's size */ - PCB_HATT_BEGIN_TABLE, /* min_val is the number of columns */ - PCB_HATT_BEGIN_TABBED, /* tabbed view (e.g. notebook); ->enumerations stores the tab names and a NULL; default_val's integer value is the index of the current tab */ - PCB_HATT_BEGIN_COMPOUND, /* subtree emulating a single widget; (pcb_hid_compound_t *) stored in END's enumerations */ + PCB_HATT_BEGIN_TABLE, /* wdata_aux1 is the number of columns */ + PCB_HATT_BEGIN_TABBED, /* tabbed view (e.g. notebook); ->wdata stores the tab names and a NULL; default_val's integer value is the index of the current tab */ + PCB_HATT_BEGIN_COMPOUND, /* subtree emulating a single widget; (pcb_hid_compound_t *) stored in END's wdata */ PCB_HATT_END /* close one level of PCB_HATT_* */ } pcb_hids_t; @@ -71,7 +71,7 @@ /* alternative field names in struct pcb_hid_attribute_s */ #define pcb_hatt_flags hatt_flags -#define pcb_hatt_table_cols min_val +#define pcb_hatt_table_cols wdata_aux1 typedef enum { PCB_HID_TEXT_INSERT, /* insert at cursor or replace selection */ @@ -191,9 +191,11 @@ double min_val, max_val; /* for integer and real */ pcb_hid_attr_val_t val; /* Also actual value for global attributes. */ - /* NULL terminated list of values for a PCB_HATT_ENUM; - Also (ab)used as (pcb_hid_tree_t *) for a PCB_HATT_TREE and for PCB_HATT_PICTURE & PCB_HATT_PICBUTTON */ - const char **enumerations; + /* PCB_HATT_ENUM: const char ** (NULL terminated list of values) + PCB_HATT_PICTURE & PCB_HATT_PICBUTTON: const char **xpm + PCB_HATT_TREE and others: (pcb_hid_*_t *) */ + void *wdata; /* main widget data */ + int wdata_aux1; /* auixiliary widget data - should phase out long term */ /* dynamic API */ unsigned changed:1; /* 0 for initial values, 1 on user change */ Index: trunk/src/hid_dad.h =================================================================== --- trunk/src/hid_dad.h (revision 26944) +++ trunk/src/hid_dad.h (revision 26945) @@ -145,7 +145,7 @@ #define PCB_DAD_BEGIN_TABBED(table, tabs) \ do { \ PCB_DAD_BEGIN(table, PCB_HATT_BEGIN_TABBED); \ - PCB_DAD_SET_ATTR_FIELD(table, enumerations, tabs); \ + PCB_DAD_SET_ATTR_FIELD(table, wdata, tabs); \ } while(0) #define PCB_DAD_BEGIN_HBOX(table) PCB_DAD_BEGIN(table, PCB_HATT_BEGIN_HBOX) @@ -169,7 +169,7 @@ #define PCB_DAD_ENUM(table, choices) \ do { \ PCB_DAD_ALLOC(table, PCB_HATT_ENUM); \ - PCB_DAD_SET_ATTR_FIELD(table, enumerations, choices); \ + PCB_DAD_SET_ATTR_FIELD(table, wdata, choices); \ } while(0) #define PCB_DAD_BOOL(table, label) \ @@ -204,7 +204,7 @@ pcb_hid_text_t *txt = calloc(sizeof(pcb_hid_text_t), 1); \ txt->user_ctx = user_ctx_; \ PCB_DAD_ALLOC(table, PCB_HATT_TEXT); \ - PCB_DAD_SET_ATTR_FIELD(table, enumerations, (const char **)txt); \ + PCB_DAD_SET_ATTR_FIELD(table, wdata, txt); \ } while(0) #define PCB_DAD_BUTTON(table, text) \ @@ -218,7 +218,7 @@ PCB_DAD_ALLOC(table, PCB_HATT_BUTTON); \ table[table ## _len - 1].val.str = text; \ table[table ## _len - 1].val.lng = retval; \ - table[table ## _len - 1].enumerations = (const char **)(&table ## _ret_override); \ + table[table ## _len - 1].wdata = (&table ## _ret_override); \ PCB_DAD_CHANGE_CB(table, pcb_hid_dad_close_cb); \ } while(0) @@ -266,12 +266,12 @@ } \ PCB_DAD_ALLOC(table, PCB_HATT_PREVIEW); \ prv->attrib = &table[table ## _len-1]; \ - PCB_DAD_SET_ATTR_FIELD(table, enumerations, (const char **)prv); \ + PCB_DAD_SET_ATTR_FIELD(table, wdata, prv); \ } while(0) #define pcb_dad_preview_zoomto(attr, view) \ do { \ - pcb_hid_preview_t *prv = (pcb_hid_preview_t *)((attr)->enumerations); \ + pcb_hid_preview_t *prv = ((attr)->wdata); \ if (prv->hid_zoomto_cb != NULL) \ prv->hid_zoomto_cb((attr), prv->hid_wdata, view); \ } while(0) @@ -280,13 +280,13 @@ #define PCB_DAD_PICTURE(table, xpm) \ do { \ PCB_DAD_ALLOC(table, PCB_HATT_PICTURE); \ - table[table ## _len - 1].enumerations = xpm; \ + table[table ## _len - 1].wdata = xpm; \ } while(0) #define PCB_DAD_PICBUTTON(table, xpm) \ do { \ PCB_DAD_ALLOC(table, PCB_HATT_PICBUTTON); \ - table[table ## _len - 1].enumerations = xpm; \ + table[table ## _len - 1].wdata = xpm; \ } while(0) @@ -316,7 +316,7 @@ tree->hdr = opt_header; \ PCB_DAD_SET_ATTR_FIELD(table, pcb_hatt_table_cols, cols); \ PCB_DAD_SET_ATTR_FIELD(table, pcb_hatt_flags, first_col_is_tree ? PCB_HATF_TREE_COL : 0); \ - PCB_DAD_SET_ATTR_FIELD(table, enumerations, (const char **)tree); \ + PCB_DAD_SET_ATTR_FIELD(table, wdata, tree); \ } while(0) #define PCB_DAD_TREE_APPEND(table, row_after, cells) \ @@ -333,7 +333,7 @@ can be set */ #define PCB_DAD_TREE_SET_CB(table, name, func_or_data) \ do { \ - pcb_hid_tree_t *__tree__ = (pcb_hid_tree_t *)table[table ## _len-1].enumerations; \ + pcb_hid_tree_t *__tree__ = table[table ## _len-1].wdata; \ __tree__->user_ ## name = func_or_data; \ } while(0) @@ -354,7 +354,7 @@ table[table ## _len-1].min_val = __opt__->min_val; \ table[table ## _len-1].max_val = __opt__->max_val; \ table[table ## _len-1].val = __opt__->default_val; \ - table[table ## _len-1].enumerations = __opt__->enumerations; \ + table[table ## _len-1].wdata = __opt__->enumerations; \ PCB_DAD_UPDATE_INTERNAL(table, table ## _len-1); \ } while(0) @@ -372,7 +372,7 @@ switch(table[table ## _len - 1].type) { \ case PCB_HATT_END: \ { \ - pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)table[table ## _len - 1].enumerations; \ + pcb_hid_compound_t *cmp = table[table ## _len - 1].wdata; \ if ((cmp != NULL) && (cmp->set_help != NULL)) \ cmp->set_help(&table[table ## _len - 1], (val)); \ } \ @@ -388,7 +388,7 @@ case PCB_HATT_BEGIN_COMPOUND: \ case PCB_HATT_END: \ { \ - pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)table[table ## _len - 1].enumerations; \ + pcb_hid_compound_t *cmp = table[table ## _len - 1].wdata; \ if ((cmp != NULL) && (cmp->set_val_ptr != NULL)) \ cmp->set_val_ptr(&table[table ## _len - 1], (void *)(val_)); \ else \ @@ -406,7 +406,7 @@ case PCB_HATT_BEGIN_COMPOUND: \ case PCB_HATT_END: \ { \ - pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)table[table ## _len - 1].enumerations; \ + pcb_hid_compound_t *cmp = table[table ## _len - 1].wdata; \ if ((cmp != NULL) && (cmp->set_val_num != NULL)) \ cmp->set_val_num(&table[table ## _len - 1], (long)(val_), (double)(val_), (pcb_coord_t)(val_)); \ else \ @@ -436,11 +436,11 @@ pcb_hid_tree_t *__tree__; \ switch(table[(widx)].type) { \ case PCB_HATT_PREVIEW: \ - __prv__ = (pcb_hid_preview_t *)table[(widx)].enumerations; \ + __prv__ = table[(widx)].wdata; \ __prv__->attrib = &table[(widx)]; \ break; \ case PCB_HATT_TREE: \ - __tree__ = (pcb_hid_tree_t *)table[(widx)].enumerations; \ + __tree__ = table[(widx)].wdata; \ __tree__->attrib = &table[(widx)]; \ break; \ default: break; \ @@ -551,7 +551,7 @@ case PCB_HATT_BEGIN_COMPOUND: \ case PCB_HATT_END: \ { \ - pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)table[table ## _len - 1].enumerations; \ + pcb_hid_compound_t *cmp = table[table ## _len - 1].wdata; \ if ((cmp != NULL) && (cmp->set_field_num != NULL)) \ cmp->set_field_num(&table[table ## _len - 1], #field, (long)(val_), (double)(val_), (pcb_coord_t)(val_)); \ else \ @@ -610,7 +610,7 @@ case PCB_HATT_BEGIN_COMPOUND: \ case PCB_HATT_END: \ { \ - pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)table[table ## _len - 1].enumerations; \ + pcb_hid_compound_t *cmp = table[table ## _len - 1].wdata; \ if ((cmp != NULL) && (cmp->set_field_ptr != NULL)) \ cmp->set_field_ptr(&table[table ## _len - 1], #field, (void *)(val_)); \ else \ @@ -644,7 +644,7 @@ break; \ case PCB_HATT_PREVIEW: \ { \ - pcb_hid_preview_t *prv = (pcb_hid_preview_t *)table[field].enumerations; \ + pcb_hid_preview_t *prv = table[field].wdata; \ if (prv->user_free_cb != NULL) \ prv->user_free_cb(&table[field], prv->user_ctx, prv->hid_wdata); \ if (prv->hid_free_cb != NULL) \ @@ -654,7 +654,7 @@ break; \ case PCB_HATT_TEXT: \ { \ - pcb_hid_text_t *txt = (pcb_hid_text_t *)table[field].enumerations; \ + pcb_hid_text_t *txt = table[field].wdata; \ if (txt->user_free_cb != NULL) \ txt->user_free_cb(&table[field], txt->user_ctx, txt->hid_wdata); \ if (txt->hid_free_cb != NULL) \ @@ -665,7 +665,7 @@ case PCB_HATT_BEGIN_COMPOUND: \ case PCB_HATT_END: \ { \ - pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)table[field].enumerations; \ + pcb_hid_compound_t *cmp = table[field].wdata; \ if ((cmp != NULL) && (cmp->free != NULL)) \ cmp->free(&table[field]); \ } \ Index: trunk/src/hid_dad_spin.c =================================================================== --- trunk/src/hid_dad_spin.c (revision 26944) +++ trunk/src/hid_dad_spin.c (revision 26945) @@ -458,7 +458,7 @@ void pcb_dad_spin_set_num(pcb_hid_attribute_t *attr, long l, double d, pcb_coord_t c) { - pcb_hid_dad_spin_t *spin = (pcb_hid_dad_spin_t *)attr->enumerations; + pcb_hid_dad_spin_t *spin = attr->wdata; pcb_hid_attribute_t *str = attr - spin->cmp.wend + spin->wstr; switch(spin->type) { @@ -485,7 +485,7 @@ void pcb_dad_spin_free(pcb_hid_attribute_t *attr) { if (attr->type == PCB_HATT_END) { - pcb_hid_dad_spin_t *spin = (pcb_hid_dad_spin_t *)attr->enumerations; + pcb_hid_dad_spin_t *spin = attr->wdata; if (spin->type == PCB_DAD_SPIN_COORD) gdl_remove(&pcb_dad_coord_spins, spin, link); free(spin); @@ -494,19 +494,19 @@ int pcb_dad_spin_widget_state(pcb_hid_attribute_t *end, void *hid_ctx, int idx, pcb_bool enabled) { - pcb_hid_dad_spin_t *spin = (pcb_hid_dad_spin_t *)end->enumerations; + pcb_hid_dad_spin_t *spin = end->wdata; return pcb_gui->attr_dlg_widget_state(hid_ctx, spin->wall, enabled); } int pcb_dad_spin_widget_hide(pcb_hid_attribute_t *end, void *hid_ctx, int idx, pcb_bool hide) { - pcb_hid_dad_spin_t *spin = (pcb_hid_dad_spin_t *)end->enumerations; + pcb_hid_dad_spin_t *spin = end->wdata; return pcb_gui->attr_dlg_widget_hide(hid_ctx, spin->wall, hide); } int pcb_dad_spin_set_value(pcb_hid_attribute_t *end, void *hid_ctx, int idx, const pcb_hid_attr_val_t *val) { - pcb_hid_dad_spin_t *spin = (pcb_hid_dad_spin_t *)end->enumerations; + pcb_hid_dad_spin_t *spin = end->wdata; pcb_hid_attribute_t *str = end - spin->cmp.wend + spin->wstr; /* do not modify the text field if the value is the same */ @@ -533,7 +533,7 @@ void pcb_dad_spin_set_help(pcb_hid_attribute_t *end, const char *help) { - pcb_hid_dad_spin_t *spin = (pcb_hid_dad_spin_t *)end->enumerations; + pcb_hid_dad_spin_t *spin = end->wdata; pcb_hid_attribute_t *str = end - spin->cmp.wend + spin->wstr; if ((spin->hid_ctx == NULL) || (*spin->hid_ctx == NULL)) /* while building */ Index: trunk/src/hid_dad_spin.h =================================================================== --- trunk/src/hid_dad_spin.h (revision 26944) +++ trunk/src/hid_dad_spin.h (revision 26945) @@ -62,7 +62,7 @@ pcb_hid_dad_spin_t *spin = calloc(sizeof(pcb_hid_dad_spin_t), 1); \ PCB_DAD_BEGIN(table, PCB_HATT_BEGIN_COMPOUND); \ spin->cmp.wbegin = PCB_DAD_CURRENT(table); \ - PCB_DAD_SET_ATTR_FIELD(table, enumerations, (const char **)spin); \ + PCB_DAD_SET_ATTR_FIELD(table, wdata, spin); \ PCB_DAD_BEGIN_HBOX(table); \ spin->wall = PCB_DAD_CURRENT(table); \ PCB_DAD_COMPFLAG(table, PCB_HATF_TIGHT); \ @@ -98,7 +98,7 @@ PCB_DAD_END(table); \ PCB_DAD_END(table); \ PCB_DAD_END(table); \ - PCB_DAD_SET_ATTR_FIELD(table, enumerations, (const char **)spin); \ + PCB_DAD_SET_ATTR_FIELD(table, wdata, spin); \ spin->cmp.wend = PCB_DAD_CURRENT(table); \ \ spin->cmp.free = pcb_dad_spin_free; \ Index: trunk/src/hid_dad_tree.c =================================================================== --- trunk/src/hid_dad_tree.c (revision 26944) +++ trunk/src/hid_dad_tree.c (revision 26945) @@ -32,7 +32,7 @@ /* recursively free a row list subtree */ static void pcb_dad_tree_free_rowlist(pcb_hid_attribute_t *attr, gdl_list_t *list) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; pcb_hid_row_t *r; while((r = gdl_first(list)) != NULL) { @@ -55,7 +55,7 @@ /* Internal: free all rows and caches and the tree itself */ void pcb_dad_tree_free(pcb_hid_attribute_t *attr) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; htsp_uninit(&tree->paths); pcb_dad_tree_free_rowlist(attr, &tree->rows); free(tree); @@ -96,7 +96,7 @@ void pcb_hid_dad_close_cb(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { - pcb_dad_retovr_t **retovr = (pcb_dad_retovr_t **)attr->enumerations; + pcb_dad_retovr_t **retovr = attr->wdata; pcb_hid_dad_close(hid_ctx, *retovr, attr->val.lng); } Index: trunk/src/hid_dad_tree.h =================================================================== --- trunk/src/hid_dad_tree.h (revision 26944) +++ trunk/src/hid_dad_tree.h (revision 26945) @@ -2,7 +2,7 @@ * COPYRIGHT * * pcb-rnd, interactive printed circuit board design - * Copyright (C) 2018 Tibor 'Igor2' Palinkas + * Copyright (C) 2018,2019 Tibor 'Igor2' Palinkas * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -118,7 +118,7 @@ /* calculate path of a row and insert it in the tree hash */ PCB_INLINE void pcb_dad_tree_set_hash(pcb_hid_attribute_t *attr, pcb_hid_row_t *row) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; if (attr->pcb_hatt_flags & PCB_HATF_TREE_COL) { gds_t path; gds_init(&path); @@ -134,7 +134,7 @@ end of the list of entries in the root (== at the bottom of the list) */ PCB_INLINE pcb_hid_row_t *pcb_dad_tree_append(pcb_hid_attribute_t *attr, pcb_hid_row_t *aft, char **cols) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; pcb_hid_row_t *nrow = pcb_dad_tree_new_row(cols); gdl_list_t *par; /* the list that is the common parent of aft and the new row */ @@ -158,7 +158,7 @@ beginning of the list of entries in the root (== at the top of the list) */ PCB_INLINE pcb_hid_row_t *pcb_dad_tree_insert(pcb_hid_attribute_t *attr, pcb_hid_row_t *bfr, char **cols) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; pcb_hid_row_t *nrow = pcb_dad_tree_new_row(cols); gdl_list_t *par; /* the list that is the common parent of bfr and the new row */ @@ -182,7 +182,7 @@ end of the list of entries in the root (== at the bottom of the list) */ PCB_INLINE pcb_hid_row_t *pcb_dad_tree_append_under(pcb_hid_attribute_t *attr, pcb_hid_row_t *prn, char **cols) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; pcb_hid_row_t *nrow = pcb_dad_tree_new_row(cols); gdl_list_t *par; /* the list that is the common parent of aft and the new row */ @@ -202,7 +202,7 @@ PCB_INLINE int pcb_dad_tree_remove(pcb_hid_attribute_t *attr, pcb_hid_row_t *row) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; pcb_hid_row_t *r, *rn, *par = pcb_dad_tree_parent_row(tree, row); gdl_list_t *lst = (par == NULL) ? &tree->rows : &par->children; int res = 0; @@ -236,7 +236,7 @@ PCB_INLINE pcb_hid_row_t *pcb_dad_tree_get_selected(pcb_hid_attribute_t *attr) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; assert(attr == tree->attrib); @@ -248,7 +248,7 @@ PCB_INLINE void pcb_dad_tree_update_hide(pcb_hid_attribute_t *attr) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; assert(attr == tree->attrib); @@ -258,7 +258,7 @@ PCB_INLINE int pcb_dad_tree_modify_cell(pcb_hid_attribute_t *attr, pcb_hid_row_t *row, int col, char *new_val) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; assert(attr == tree->attrib); @@ -284,7 +284,7 @@ PCB_INLINE void pcb_dad_tree_jumpto(pcb_hid_attribute_t *attr, pcb_hid_row_t *row) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; assert(attr == tree->attrib); @@ -305,7 +305,7 @@ PCB_INLINE void pcb_dad_tree_expcoll(pcb_hid_attribute_t *attr, pcb_hid_row_t *row, pcb_bool expanded, pcb_bool recursive) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; assert(attr == tree->attrib); Index: trunk/src/hid_dad_unit.c =================================================================== --- trunk/src/hid_dad_unit.c (revision 26944) +++ trunk/src/hid_dad_unit.c (revision 26945) @@ -38,7 +38,8 @@ pcb_hid_dad_unit_t *unit = (pcb_hid_dad_unit_t *)attr->user_data; pcb_hid_attribute_t *enu = attr; pcb_hid_attribute_t *end = attr - unit->wenum + unit->cmp.wend; - const pcb_unit_t *u = get_unit_by_suffix(enu->enumerations[enu->val.lng]); + const char **vals = enu->wdata; + const pcb_unit_t *u = get_unit_by_suffix(vals[enu->val.lng]); int unit_id = u == NULL ? -1 : u - pcb_units; end->val.lng = unit_id; @@ -50,12 +51,13 @@ void pcb_dad_unit_set_num(pcb_hid_attribute_t *attr, long unit_id, double unused1, pcb_coord_t unused2) { int l; - pcb_hid_dad_unit_t *unit = (pcb_hid_dad_unit_t *)attr->enumerations; + pcb_hid_dad_unit_t *unit = attr->wdata; pcb_hid_attribute_t *enu = attr - unit->cmp.wend + unit->wenum; const char *target = pcb_units[unit_id].suffix; + const char **vals = enu->wdata; - for(l = 0; enu->enumerations[l] != NULL; l++) { - if (strcmp(target, enu->enumerations[l]) == 0) { + for(l = 0; vals[l] != NULL; l++) { + if (strcmp(target, vals[l]) == 0) { enu->val.lng = l; attr->val.lng = l; } @@ -78,19 +80,19 @@ int pcb_dad_unit_widget_state(pcb_hid_attribute_t *end, void *hid_ctx, int idx, pcb_bool enabled) { - pcb_hid_dad_unit_t *unit = (pcb_hid_dad_unit_t *)end->enumerations; + pcb_hid_dad_unit_t *unit = end->wdata; return pcb_gui->attr_dlg_widget_state(hid_ctx, unit->wenum, enabled); } int pcb_dad_unit_widget_hide(pcb_hid_attribute_t *end, void *hid_ctx, int idx, pcb_bool hide) { - pcb_hid_dad_unit_t *unit = (pcb_hid_dad_unit_t *)end->enumerations; + pcb_hid_dad_unit_t *unit = end->wdata; return pcb_gui->attr_dlg_widget_hide(hid_ctx, unit->wenum, hide); } int pcb_dad_unit_set_value(pcb_hid_attribute_t *end, void *hid_ctx, int idx, const pcb_hid_attr_val_t *val) { - pcb_hid_dad_unit_t *unit = (pcb_hid_dad_unit_t *)end->enumerations; + pcb_hid_dad_unit_t *unit = end->wdata; if (pcb_gui->attr_dlg_set_value(hid_ctx, unit->wenum, val) != 0) return -1; end->val.lng = val->lng; @@ -99,7 +101,7 @@ void pcb_dad_unit_set_help(pcb_hid_attribute_t *end, const char *help) { - pcb_hid_dad_unit_t *unit = (pcb_hid_dad_unit_t *)end->enumerations; + pcb_hid_dad_unit_t *unit = end->wdata; pcb_hid_attribute_t *enu = end - unit->cmp.wend + unit->wenum; if ((unit->hid_ctx == NULL) || (*unit->hid_ctx == NULL)) /* while building */ Index: trunk/src/hid_dad_unit.h =================================================================== --- trunk/src/hid_dad_unit.h (revision 26944) +++ trunk/src/hid_dad_unit.h (revision 26945) @@ -52,7 +52,7 @@ 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, enumerations, (const char **)unit); \ + PCB_DAD_SET_ATTR_FIELD(table, wdata, unit); \ unit->cmp.wend = PCB_DAD_CURRENT(table); \ \ unit->cmp.set_val_num = pcb_dad_unit_set_num; \ Index: trunk/src_plugins/cam/cam_gui.c =================================================================== --- trunk/src_plugins/cam/cam_gui.c (revision 26944) +++ trunk/src_plugins/cam/cam_gui.c (revision 26945) @@ -48,7 +48,7 @@ conf_native_t *cn; attr = &ctx->dlg[ctx->wjobs]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; /* remember cursor */ r = pcb_dad_tree_get_selected(attr); @@ -88,7 +88,7 @@ int n; attr = &ctx->dlg[ctx->wdigest]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; /* remove existing items */ pcb_dad_tree_clear(tree); @@ -141,7 +141,7 @@ pcb_gui->attr_dlg_set_value(ctx->dlg_hid_ctx, ctx->wprefix, &hv); attr = &ctx->dlg[ctx->wopts]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; /* remember cursor */ r = pcb_dad_tree_get_selected(attr); @@ -181,7 +181,7 @@ const char *text; attr = &ctx->dlg[ctx->wjobs]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; text = attr_inp->val.str; pcb_dad_tree_hide_all(tree, &tree->rows, 1); @@ -215,13 +215,13 @@ static void cam_job_select_cb(pcb_hid_attribute_t *attrib, void *hid_ctx, pcb_hid_row_t *row) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *tree = attrib->wdata; cam_dlg_t *ctx = tree->user_ctx; if (row != NULL) { char *script = kill_tabs(cam_find_job(row->cell[0])); pcb_hid_attribute_t *atxt = &ctx->dlg[ctx->wtxt]; - pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; + pcb_hid_text_t *txt = atxt->wdata; txt->hid_set_text(atxt, hid_ctx, PCB_HID_TEXT_REPLACE, script); @@ -347,7 +347,7 @@ { /* set right top text read-only */ pcb_hid_attribute_t *atxt = &ctx->dlg[ctx->wtxt]; - pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; + pcb_hid_text_t *txt = atxt->wdata; txt->hid_set_readonly(atxt, ctx->dlg_hid_ctx, 1); } Index: trunk/src_plugins/dialogs/dlg_lib_pstk.c =================================================================== --- trunk/src_plugins/dialogs/dlg_lib_pstk.c (revision 26944) +++ trunk/src_plugins/dialogs/dlg_lib_pstk.c (revision 26945) @@ -95,7 +95,7 @@ return -1; attr = &ctx->dlg[ctx->wlist]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; /* remember cursor */ r = pcb_dad_tree_get_selected(attr); @@ -217,7 +217,7 @@ static void pstklib_select(pcb_hid_attribute_t *attrib, void *hid_ctx, pcb_hid_row_t *row) { pcb_hid_attr_val_t hv; - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *tree = attrib->wdata; pstk_lib_ctx_t *ctx = tree->user_ctx; pcb_data_t *data = get_data(ctx, ctx->subc_id, NULL); pcb_pstk_t ps; @@ -276,7 +276,7 @@ return; attr = &ctx->dlg[ctx->wlist]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; text = attr_inp->val.str; if ((text == NULL) || (*text == '\0')) { Index: trunk/src_plugins/dialogs/dlg_library.c =================================================================== --- trunk/src_plugins/dialogs/dlg_library.c (revision 26944) +++ trunk/src_plugins/dialogs/dlg_library.c (revision 26945) @@ -256,7 +256,7 @@ char *cursor_path = NULL; attr = &ctx->dlg[ctx->wtree]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; /* remember cursor */ r = pcb_dad_tree_get_selected(attr); @@ -281,7 +281,7 @@ static void library_select(pcb_hid_attribute_t *attrib, void *hid_ctx, pcb_hid_row_t *row) { pcb_hid_attr_val_t hv; - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *tree = attrib->wdata; library_ctx_t *ctx = tree->user_ctx; int close_param = 1; @@ -377,7 +377,7 @@ int have_filter_text, is_para; attr = &ctx->dlg[ctx->wtree]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; otext = attr_inp->val.str; text = pcb_strdup(otext); have_filter_text = (*text != '\0'); @@ -467,7 +467,7 @@ pcb_hid_tree_t *tree; attr = &ctx->dlg[ctx->wtree]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; return find_fp_prefix_(tree, &tree->rows, name, namelen); } Index: trunk/src_plugins/dialogs/dlg_library_param.c =================================================================== --- trunk/src_plugins/dialogs/dlg_library_param.c (revision 26944) +++ trunk/src_plugins/dialogs/dlg_library_param.c (revision 26945) @@ -66,7 +66,7 @@ switch(a->type) { case PCB_HATT_ENUM: vlen = strlen(val); - for(n = 0, s = a->enumerations; *s != NULL; s++,n++) { + for(n = 0, s = a->wdata; *s != NULL; s++,n++) { desc = strstr(*s, " ("); if (desc != NULL) len = desc - *s; @@ -279,7 +279,7 @@ case PCB_HATT_BEGIN_TABLE: continue; case PCB_HATT_ENUM: - val = a->enumerations[a->val.lng]; + val = ((const char **)(a->wdata))[a->val.lng]; if (val != NULL) { desc = strstr((char *)val, " ("); if (desc != NULL) Index: trunk/src_plugins/dialogs/dlg_netlist.c =================================================================== --- trunk/src_plugins/dialogs/dlg_netlist.c (revision 26944) +++ trunk/src_plugins/dialogs/dlg_netlist.c (revision 26945) @@ -59,7 +59,7 @@ pcb_net_t **n, **nets; attr = &ctx->dlg[ctx->wnetlist]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; /* remember cursor */ r = pcb_dad_tree_get_selected(attr); @@ -98,7 +98,7 @@ pcb_net_term_t *t; attr = &ctx->dlg[ctx->wtermlist]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; /* remember cursor */ if (net != NULL) { @@ -148,7 +148,7 @@ static void netlist_row_selected(pcb_hid_attribute_t *attrib, void *hid_ctx, pcb_hid_row_t *row) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *tree = attrib->wdata; netlist_ctx_t *ctx= tree->user_ctx; const char *netname = NULL; pcb_net_t *net = NULL; @@ -164,7 +164,7 @@ static void termlist_row_selected(pcb_hid_attribute_t *attrib, void *hid_ctx, pcb_hid_row_t *row) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *tree = attrib->wdata; netlist_ctx_t *ctx= tree->user_ctx; char *refdes, *term; pcb_any_obj_t *obj; Index: trunk/src_plugins/dialogs/dlg_pref_conf.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_conf.c (revision 26944) +++ trunk/src_plugins/dialogs/dlg_pref_conf.c (revision 26945) @@ -51,7 +51,7 @@ { char *cell[2] = {NULL}; pcb_hid_attribute_t *attr = &ctx->dlg[ctx->conf.wtree]; - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; htsp_entry_t *e; htsp_entry_t **sorted; int num_paths, n; @@ -140,7 +140,7 @@ { conf_role_t n; pcb_hid_attribute_t *attr = &ctx->dlg[ctx->conf.wintree]; - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; pcb_hid_row_t *r; pcb_dad_tree_clear(tree); @@ -232,7 +232,7 @@ if (nat->type == CFN_LIST) { /* non-default: lists are manually loaded */ pcb_hid_attribute_t *attr = &ctx->dlg[ctx->conf.wnatval[CFN_LIST]]; - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; conf_listitem_t *n; char *cell[4]; @@ -267,7 +267,7 @@ static void dlg_conf_select_node_cb(pcb_hid_attribute_t *attrib, void *hid_ctx, pcb_hid_row_t *row) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *tree = attrib->wdata; char *end, *end2; conf_native_t *nat; @@ -320,7 +320,7 @@ int have_filter_text; attr = &ctx->dlg[ctx->conf.wtree]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; text = attr_inp->val.str; have_filter_text = (*text != '\0'); Index: trunk/src_plugins/dialogs/dlg_pref_confedit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 26944) +++ trunk/src_plugins/dialogs/dlg_pref_confedit.c (revision 26945) @@ -95,7 +95,7 @@ case CFN_LIST: { pcb_hid_attribute_t *attr = &ctx->dlg[ctx->wnewval]; - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; pcb_dad_tree_clear(tree); if (nd->type != LHT_LIST) @@ -140,7 +140,7 @@ case CFN_LIST: { pcb_hid_attribute_t *attr = &ctx->dlg[ctx->wnewval]; - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; pcb_hid_row_t *r; lht_node_t *nd = conf_lht_get_at(ctx->role, ctx->nat->hash_path, 0); Index: trunk/src_plugins/dialogs/dlg_pref_lib.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 26944) +++ trunk/src_plugins/dialogs/dlg_pref_lib.c (revision 26945) @@ -56,7 +56,7 @@ return; attr = &pref_ctx.dlg[pref_ctx.lib.wlist]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; r = pcb_dad_tree_get_selected(attr); if (r != NULL) { @@ -133,7 +133,7 @@ static void pref_lib_dlg2conf(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { pref_ctx_t *ctx = caller_data; - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; lht_node_t *m, *lst, *nd; pcb_hid_row_t *r; @@ -181,7 +181,7 @@ { pcb_hid_attribute_t *attr = &pref_ctx.dlg[pref_ctx.lib.wlist]; pcb_hid_row_t *prev, *r = pcb_dad_tree_get_selected(attr); - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; char *cell[4]; if (r == NULL) @@ -208,7 +208,7 @@ { pcb_hid_attribute_t *attr = &pref_ctx.dlg[pref_ctx.lib.wlist]; pcb_hid_row_t *next, *r = pcb_dad_tree_get_selected(attr); - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; char *cell[4]; if (r == NULL) @@ -294,7 +294,7 @@ char *cell[4]; if (r == NULL) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; switch(pos) { case 0: /* replace */ @@ -413,7 +413,7 @@ PCB_DAD_TREE(ctx->dlg, 3, 0, hdr); PCB_DAD_COMPFLAG(ctx->dlg, PCB_HATF_EXPFILL); ctx->lib.wlist = PCB_DAD_CURRENT(ctx->dlg); - tree = (pcb_hid_tree_t *)ctx->dlg[ctx->lib.wlist].enumerations; + tree = ctx->dlg[ctx->lib.wlist].wdata; tree->user_free_cb = pref_lib_row_free; PCB_DAD_END(ctx->dlg); Index: trunk/src_plugins/dialogs/dlg_search_edit.c =================================================================== --- trunk/src_plugins/dialogs/dlg_search_edit.c (revision 26944) +++ trunk/src_plugins/dialogs/dlg_search_edit.c (revision 26945) @@ -79,7 +79,7 @@ return; attr = &ctx->dlg[ctx->wop]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; /* remember cursor */ if (click) { @@ -121,7 +121,7 @@ const char **o; attr = &ctx->dlg[ctx->wright[RIGHT_CONST]]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; /* remove existing items */ pcb_dad_tree_clear(tree); @@ -191,7 +191,7 @@ static void srch_expr_left_cb(pcb_hid_attribute_t *attrib, void *hid_ctx, pcb_hid_row_t *row) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *tree = attrib->wdata; srchedit_ctx_t *ctx = tree->user_ctx; const expr_wizard_t *e; @@ -209,7 +209,7 @@ static void srch_expr_op_cb(pcb_hid_attribute_t *attrib, void *hid_ctx, pcb_hid_row_t *row) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *tree = attrib->wdata; srchedit_ctx_t *ctx = tree->user_ctx; if (row != NULL) @@ -268,7 +268,7 @@ static void srch_expr_right_table_cb(pcb_hid_attribute_t *attrib, void *hid_ctx, pcb_hid_row_t *row) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *tree = attrib->wdata; srchedit_ctx_t *ctx = tree->user_ctx; free(ctx->se.right); Index: trunk/src_plugins/dialogs/dlg_test.c =================================================================== --- trunk/src_plugins/dialogs/dlg_test.c (revision 26944) +++ trunk/src_plugins/dialogs/dlg_test.c (revision 26945) @@ -400,7 +400,7 @@ { test_t *ctx = caller_data; pcb_hid_attribute_t *treea = &ctx->dlg[ctx->tt]; - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)treea->enumerations; + pcb_hid_tree_t *tree = treea->wdata; ttbl_filt(&tree->rows, attr->val.lng); pcb_dad_tree_update_hide(treea); @@ -445,7 +445,7 @@ { test_t *ctx = caller_data; pcb_hid_attribute_t *atxt = &ctx->dlg[ctx->wtxt]; - pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; + pcb_hid_text_t *txt = atxt->wdata; txt->hid_set_text(atxt, hid_ctx, PCB_HID_TEXT_REPLACE, "Hello\nworld!\n"); } @@ -453,7 +453,7 @@ { test_t *ctx = caller_data; pcb_hid_attribute_t *atxt = &ctx->dlg[ctx->wtxt]; - pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; + pcb_hid_text_t *txt = atxt->wdata; txt->hid_set_text(atxt, hid_ctx, PCB_HID_TEXT_INSERT, "ins"); } @@ -461,7 +461,7 @@ { test_t *ctx = caller_data; pcb_hid_attribute_t *atxt = &ctx->dlg[ctx->wtxt]; - pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; + pcb_hid_text_t *txt = atxt->wdata; txt->hid_set_text(atxt, hid_ctx, PCB_HID_TEXT_APPEND | PCB_HID_TEXT_MARKUP, "appred\n"); } @@ -469,7 +469,7 @@ { test_t *ctx = caller_data; pcb_hid_attribute_t *atxt = &ctx->dlg[ctx->wtxt]; - pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; + pcb_hid_text_t *txt = atxt->wdata; char *s; s = txt->hid_get_text(atxt, hid_ctx); printf("text: '%s'\n", s); @@ -479,7 +479,7 @@ static void cb_text_edit(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { test_t *ctx = caller_data; - pcb_hid_text_t *txt = (pcb_hid_text_t *)attr->enumerations; + pcb_hid_text_t *txt = attr->wdata; long x, y, o; char buf[256]; pcb_hid_attr_val_t val; @@ -495,7 +495,7 @@ { test_t *ctx = caller_data; pcb_hid_attribute_t *atxt = &ctx->dlg[ctx->wtxt]; - pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; + pcb_hid_text_t *txt = atxt->wdata; txt->hid_set_offs(atxt, hid_ctx, txt->hid_get_offs(atxt, hid_ctx) / 2); } @@ -503,7 +503,7 @@ { test_t *ctx = caller_data; pcb_hid_attribute_t *atxt = &ctx->dlg[ctx->wtxt]; - pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; + pcb_hid_text_t *txt = atxt->wdata; ctx->txtro = !ctx->txtro; txt->hid_set_readonly(atxt, hid_ctx, ctx->txtro); } Index: trunk/src_plugins/dialogs/dlg_undo.c =================================================================== --- trunk/src_plugins/dialogs/dlg_undo.c (revision 26944) +++ trunk/src_plugins/dialogs/dlg_undo.c (revision 26945) @@ -74,7 +74,7 @@ char *payload, buff[8192], mark[2], ser[64]; attr = &ctx->dlg[ctx->wlist]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; /* remember cursor */ r = pcb_dad_tree_get_selected(attr); Index: trunk/src_plugins/dialogs/dlg_view.c =================================================================== --- trunk/src_plugins/dialogs/dlg_view.c (revision 26944) +++ trunk/src_plugins/dialogs/dlg_view.c (revision 26945) @@ -91,7 +91,7 @@ char *cell[3], *cursor_path = NULL; attr = &ctx->dlg[ctx->wlist]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; /* remember cursor */ r = pcb_dad_tree_get_selected(attr); @@ -192,7 +192,7 @@ static void view_select(pcb_hid_attribute_t *attrib, void *hid_ctx, pcb_hid_row_t *row) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *tree = attrib->wdata; view_ctx_t *ctx = tree->user_ctx; if (row != NULL) Index: trunk/src_plugins/export_openems/excitation.c =================================================================== --- trunk/src_plugins/export_openems/excitation.c (revision 26944) +++ trunk/src_plugins/export_openems/excitation.c (revision 26945) @@ -289,7 +289,7 @@ wscript = exc_ctx.exc_data[idx].w[I_SCRIPT]; attr = &exc_ctx.dlg[wscript]; - txt = (pcb_hid_text_t *)attr->enumerations; + txt = attr->wdata; ser_save(txt->hid_get_text(attr, exc_ctx.dlg_hid_ctx), AEPREFIX "user-defined::script"); } Index: trunk/src_plugins/hid_lesstif/dialogs.c =================================================================== --- trunk/src_plugins/hid_lesstif/dialogs.c (revision 26944) +++ trunk/src_plugins/hid_lesstif/dialogs.c (revision 26945) @@ -222,7 +222,7 @@ stdarg_n = 0; stdarg(XmNuserData, &uptr); XtGetValues(btn, stdarg_args, stdarg_n); - ctx->attrs[widx].val.lng = uptr - ctx->attrs[widx].enumerations; + ctx->attrs[widx].val.lng = uptr - (const char **)ctx->attrs[widx].wdata; } break; default: @@ -439,6 +439,7 @@ static XmString empty = 0; Widget submenu, default_button = 0; int sn = stdarg_n; + const char **vals = ctx->attrs[i].wdata; if (empty == 0) empty = XmStringCreatePCB(""); @@ -449,14 +450,14 @@ stdarg(XmNlabelString, empty); stdarg(XmNsubMenuId, submenu); ctx->wl[i] = XmCreateOptionMenu(parent, XmStrCast(ctx->attrs[i].name), stdarg_args, stdarg_n); - for (sn = 0; ctx->attrs[i].enumerations[sn]; sn++); + for (sn = 0; vals[sn]; sn++); ctx->btn[i] = calloc(sizeof(Widget), sn); - for (sn = 0; ctx->attrs[i].enumerations[sn]; sn++) { + for (sn = 0; vals[sn]; sn++) { Widget btn; XmString label; stdarg_n = 0; - label = XmStringCreatePCB(ctx->attrs[i].enumerations[sn]); - stdarg(XmNuserData, &ctx->attrs[i].enumerations[sn]); + label = XmStringCreatePCB(vals[sn]); + stdarg(XmNuserData, &vals[sn]); stdarg(XmNlabelString, label); btn = XmCreatePushButton(submenu, XmStrCast("menubutton"), stdarg_args, stdarg_n); XtManageChild(btn); @@ -507,7 +508,7 @@ goto err; case PCB_HATT_END: { - pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)ctx->attrs[idx].enumerations; + pcb_hid_compound_t *cmp = ctx->attrs[idx].wdata; if ((cmp != NULL) && (cmp->set_value != NULL)) cmp->set_value(&ctx->attrs[idx], ctx, idx, val); else @@ -555,12 +556,15 @@ ltf_tree_set(ctx, idx, val->str); break; case PCB_HATT_ENUM: - for (n = 0; ctx->attrs[idx].enumerations[n]; n++) { - if (n == val->lng) { - stdarg_n = 0; - stdarg(XmNmenuHistory, (ctx->btn[idx])[n]); - XtSetValues(ctx->wl[idx], stdarg_args, stdarg_n); - goto ok; + { + const char **vals = ctx->attrs[idx].wdata; + for (n = 0; vals[n]; n++) { + if (n == val->lng) { + stdarg_n = 0; + stdarg(XmNmenuHistory, (ctx->btn[idx])[n]); + XtSetValues(ctx->wl[idx], stdarg_args, stdarg_n); + goto ok; + } } } goto err; @@ -798,7 +802,7 @@ return -1; if (ctx->attrs[idx].type == PCB_HATT_END) { - pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)ctx->attrs[idx].enumerations; + pcb_hid_compound_t *cmp = ctx->attrs[idx].wdata; if ((cmp != NULL) && (cmp->widget_state != NULL)) cmp->widget_state(&ctx->attrs[idx], ctx, idx, enabled); else @@ -819,7 +823,7 @@ if (ctx->attrs[idx].type == PCB_HATT_BEGIN_COMPOUND) return -1; if (ctx->attrs[idx].type == PCB_HATT_END) { - pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)ctx->attrs[idx].enumerations; + pcb_hid_compound_t *cmp = ctx->attrs[idx].wdata; if ((cmp != NULL) && (cmp->widget_hide != NULL)) cmp->widget_hide(&ctx->attrs[idx], ctx, idx, hide); else Index: trunk/src_plugins/hid_lesstif/dlg_attr_box.c =================================================================== --- trunk/src_plugins/hid_lesstif/dlg_attr_box.c (revision 26944) +++ trunk/src_plugins/hid_lesstif/dlg_attr_box.c (revision 26945) @@ -170,7 +170,7 @@ const char **l; - for(l = ctx->attrs[i].enumerations, numtabs = 0; *l != NULL; l++, numtabs++) ; + for(l = ctx->attrs[i].wdata, numtabs = 0; *l != NULL; l++, numtabs++) ; tctx = calloc(1, sizeof(ltf_tab_t) + sizeof(ltf_tabbtn_t) * numtabs-1); tctx->len = numtabs; @@ -188,7 +188,7 @@ } /* create the label buttons */ - for(n = 0, l = ctx->attrs[i].enumerations; *l != NULL; l++,n++) { + for(n = 0, l = ctx->attrs[i].wdata; *l != NULL; l++,n++) { stdarg_n = 0; stdarg(XmNshadowThickness, 1); t = XmCreatePushButton(wtab, (char *)*l, stdarg_args, stdarg_n); Index: trunk/src_plugins/hid_lesstif/dlg_attr_misc.c =================================================================== --- trunk/src_plugins/hid_lesstif/dlg_attr_misc.c (revision 26944) +++ trunk/src_plugins/hid_lesstif/dlg_attr_misc.c (revision 26945) @@ -75,7 +75,7 @@ { pcb_ltf_preview_t *pd = e->draw_data; pcb_hid_attribute_t *attr = pd->attr; - pcb_hid_preview_t *prv = (pcb_hid_preview_t *)attr->enumerations; + pcb_hid_preview_t *prv = attr->wdata; prv->user_expose_cb(attr, prv, gc, e); } @@ -93,7 +93,7 @@ static void ltf_preview_zoomto(pcb_hid_attribute_t *attr, void *hid_ctx, const pcb_box_t *view) { - pcb_hid_preview_t *prv = (pcb_hid_preview_t *)attr->enumerations; + pcb_hid_preview_t *prv = attr->wdata; pcb_ltf_preview_t *pd = prv->hid_wdata; pd->x1 = view->X1; @@ -109,7 +109,7 @@ { pcb_ltf_preview_t *pd = pd_; pcb_hid_attribute_t *attr = pd->attr; - pcb_hid_preview_t *prv = (pcb_hid_preview_t *)attr->enumerations; + pcb_hid_preview_t *prv = attr->wdata; pcb_coord_t x, y; Window root, child; unsigned int keys_buttons; @@ -129,7 +129,7 @@ { pcb_ltf_preview_t *pd = pd_; pcb_hid_attribute_t *attr = pd->attr; - pcb_hid_preview_t *prv = (pcb_hid_preview_t *)attr->enumerations; + pcb_hid_preview_t *prv = attr->wdata; pcb_coord_t x, y; pcb_hid_mouse_ev_t kind = -1; @@ -163,7 +163,7 @@ { Widget pw; pcb_ltf_preview_t *pd; - pcb_hid_preview_t *prv = (pcb_hid_preview_t *)attr->enumerations; + pcb_hid_preview_t *prv = attr->wdata; pd = calloc(1, sizeof(pcb_ltf_preview_t)); prv->hid_wdata = pd; @@ -217,7 +217,7 @@ static Widget ltf_picture_create(lesstif_attr_dlg_t *ctx, Widget parent, pcb_hid_attribute_t *attr) { - Widget pic = pcb_ltf_xpm_label(display, parent, XmStrCast("dad_picture"), attr->enumerations); + Widget pic = pcb_ltf_xpm_label(display, parent, XmStrCast("dad_picture"), attr->wdata); XtManageChild(pic); return pic; } @@ -224,7 +224,7 @@ static Widget ltf_picbutton_create(lesstif_attr_dlg_t *ctx, Widget parent, pcb_hid_attribute_t *attr) { - Widget pic = pcb_ltf_xpm_button(display, parent, XmStrCast("dad_picture"), attr->enumerations); + Widget pic = pcb_ltf_xpm_button(display, parent, XmStrCast("dad_picture"), attr->wdata); XtManageChild(pic); return pic; } @@ -473,7 +473,7 @@ static Widget ltf_text_create(lesstif_attr_dlg_t *ctx, Widget parent, pcb_hid_attribute_t *attr) { Widget wtxt; - pcb_hid_text_t *txt = (pcb_hid_text_t *)attr->enumerations; + pcb_hid_text_t *txt = attr->wdata; stdarg(XmNresizePolicy, XmRESIZE_GROW); stdarg(XmNeditMode, XmMULTI_LINE_EDIT); Index: trunk/src_plugins/hid_lesstif/dlg_attr_tree.c =================================================================== --- trunk/src_plugins/hid_lesstif/dlg_attr_tree.c (revision 26944) +++ trunk/src_plugins/hid_lesstif/dlg_attr_tree.c (revision 26945) @@ -96,7 +96,7 @@ static void ltf_tree_insert_cb(pcb_hid_attribute_t *attrib, void *hid_wdata, pcb_hid_row_t *new_row) { - pcb_hid_tree_t *ht = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *ht = attrib->wdata; ltf_tree_t *lt = ht->hid_wdata; ltf_tt_insert_row(lt, new_row); @@ -106,7 +106,7 @@ static void ltf_tree_modify_cb(pcb_hid_attribute_t *attrib, void *hid_wdata, pcb_hid_row_t *row, int col) { - pcb_hid_tree_t *ht = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *ht = attrib->wdata; ltf_tree_t *lt = ht->hid_wdata; /* the caller modifies data strings directly, no need to do anything just flush */ @@ -129,7 +129,7 @@ static void ltf_tree_remove_cb(pcb_hid_attribute_t *attrib, void *hid_wdata, pcb_hid_row_t *row) { - pcb_hid_tree_t *ht = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *ht = attrib->wdata; ltf_tree_t *lt = ht->hid_wdata; tt_entry_t *e = row->hid_data; int changed = 0; @@ -150,7 +150,7 @@ static void ltf_tree_free_cb(pcb_hid_attribute_t *attrib, void *hid_wdata, pcb_hid_row_t *row) { - pcb_hid_tree_t *ht = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *ht = attrib->wdata; ltf_tree_t *lt = ht->hid_wdata; tt_entry_t *i; @@ -166,7 +166,7 @@ static pcb_hid_row_t *ltf_tree_get_selected_cb(pcb_hid_attribute_t *attrib, void *hid_wdata) { - pcb_hid_tree_t *ht = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *ht = attrib->wdata; ltf_tree_t *lt = ht->hid_wdata; if (lt->cursor == NULL) @@ -231,7 +231,7 @@ static void ltf_tree_jumpto_cb(pcb_hid_attribute_t *attrib, void *hid_wdata, pcb_hid_row_t *row) { - pcb_hid_tree_t *ht = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *ht = attrib->wdata; ltf_tree_t *lt = ht->hid_wdata; if (row != NULL) { tt_entry_t *e = row->hid_data; @@ -272,7 +272,7 @@ static void ltf_tree_set(lesstif_attr_dlg_t *ctx, int idx, const char *val) { pcb_hid_attribute_t *attr = &ctx->attrs[idx]; - pcb_hid_tree_t *ht = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *ht = attr->wdata; ltf_tree_t *lt = ht->hid_wdata; pcb_hid_row_t *r, *row; tt_entry_t *e; @@ -309,7 +309,7 @@ static void ltf_tree_expcoll_cb(pcb_hid_attribute_t *attrib, void *hid_wdata, pcb_hid_row_t *row, int expanded) { - pcb_hid_tree_t *ht = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *ht = attrib->wdata; ltf_tree_t *lt = ht->hid_wdata; ltf_tree_expcoll(lt, row->hid_data, expanded); REDRAW(); @@ -317,7 +317,7 @@ static void ltf_tree_update_hide_cb(pcb_hid_attribute_t *attrib, void *hid_wdata) { - pcb_hid_tree_t *ht = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *ht = attrib->wdata; ltf_tree_t *lt = ht->hid_wdata; tt_entry_t *e; for(e = gdl_first(<->model); e != NULL; e = gdl_next(<->model, e)) { @@ -399,7 +399,7 @@ static Widget ltf_tree_create_(lesstif_attr_dlg_t *ctx, Widget parent, pcb_hid_attribute_t *attr) { - pcb_hid_tree_t *ht = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *ht = attr->wdata; ltf_tree_t *lt = calloc(sizeof(ltf_tree_t), 1); Widget table = xm_create_tree_table_widget_cb(parent, <->model, lt, ltf_tt_xevent_cb, NULL, NULL); Index: trunk/src_plugins/lib_gtk_common/dlg_attr_misc.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_attr_misc.c (revision 26944) +++ trunk/src_plugins/lib_gtk_common/dlg_attr_misc.c (revision 26945) @@ -104,13 +104,13 @@ { GtkWidget *bparent, *prv; pcb_gtk_preview_t *p; - pcb_hid_preview_t *hp = (pcb_hid_preview_t *)attr->enumerations; + pcb_hid_preview_t *hp = attr->wdata; hp->hid_wdata = ctx; hp->hid_zoomto_cb = ghid_preview_zoomto; bparent = frame_scroll(parent, attr->pcb_hatt_flags, &ctx->wltop[j]); - prv = pcb_gtk_preview_new(ctx->gctx, ctx->gctx->impl.init_drawing_widget, ctx->gctx->impl.preview_expose, ghid_preview_expose, ghid_preview_config, attr->enumerations); + prv = pcb_gtk_preview_new(ctx->gctx, ctx->gctx->impl.init_drawing_widget, ctx->gctx->impl.preview_expose, ghid_preview_expose, ghid_preview_config, attr->wdata); gtk_box_pack_start(GTK_BOX(bparent), prv, TRUE, TRUE, 0); gtk_widget_set_tooltip_text(prv, attr->help_text); p = (pcb_gtk_preview_t *) prv; @@ -137,7 +137,7 @@ bparent = frame_scroll(parent, attr->pcb_hatt_flags, &ctx->wltop[j]); int expfill = (attr->pcb_hatt_flags & PCB_HATF_EXPFILL); - pixbuf = gdk_pixbuf_new_from_xpm_data(attr->enumerations); + pixbuf = gdk_pixbuf_new_from_xpm_data(attr->wdata); pic = gtk_image_new_from_pixbuf(pixbuf); evb = wrap_bind_click(pic, click_cb, attr); g_object_set_data(G_OBJECT(evb), PCB_OBJ_PROP, click_ctx); @@ -156,7 +156,7 @@ bparent = frame_scroll(parent, attr->pcb_hatt_flags, &ctx->wltop[j]); - pixbuf = gdk_pixbuf_new_from_xpm_data(attr->enumerations); + pixbuf = gdk_pixbuf_new_from_xpm_data(attr->wdata); img = gtk_image_new_from_pixbuf(pixbuf); if (toggle) Index: trunk/src_plugins/lib_gtk_common/dlg_attr_tree.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_attr_tree.c (revision 26944) +++ trunk/src_plugins/lib_gtk_common/dlg_attr_tree.c (revision 26945) @@ -96,7 +96,7 @@ static void ghid_tree_table_insert_cb(pcb_hid_attribute_t *attrib, void *hid_ctx, pcb_hid_row_t *new_row) { attr_dlg_t *ctx = hid_ctx; - pcb_hid_row_t *sibling, *par = pcb_dad_tree_parent_row((pcb_hid_tree_t *)attrib->enumerations, new_row); + pcb_hid_row_t *sibling, *par = pcb_dad_tree_parent_row(attrib->wdata, new_row); GtkTreeModel *model = ghid_tree_table_get_model(ctx, attrib, 0); GtkTreeIter *sibiter, *pariter; int prepnd; @@ -182,7 +182,7 @@ { attr_dlg_t *ctx = g_object_get_data(G_OBJECT(widget), PCB_OBJ_PROP); pcb_hid_row_t *r = ghid_tree_table_get_selected(attr, ctx); - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; attr->changed = 1; if (ctx->inhibit_valchg) @@ -199,7 +199,7 @@ static gboolean tree_table_filter_visible_func(GtkTreeModel *model, GtkTreeIter *iter, void *user_data) { pcb_hid_attribute_t *attr = user_data; - pcb_hid_row_t *r; + pcb_hid_row_t *r = NULL; gtk_tree_model_get(model, iter, attr->pcb_hatt_table_cols, &r, -1); @@ -249,7 +249,7 @@ /* Handle ctrl+c and ctrl+C: copy current name to clipboard */ if (((event->state & default_mod_mask) == GDK_CONTROL_MASK) && ((event->keyval == GDK_KEY_c) || (event->keyval == GDK_KEY_C))) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; pcb_hid_row_t *r; const char *cliptext; @@ -300,7 +300,7 @@ gtk_tree_model_get(model, &iter, attr->pcb_hatt_table_cols, &r, -1); if (r != NULL) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; if (tree->user_browse_activate_cb != NULL) { /* let the user callbakc decide */ force_activate = tree->user_browse_activate_cb(attr, tree->hid_wdata, r); } @@ -368,7 +368,7 @@ pcb_hid_attribute_t *attr = &ctx->attrs[idx]; GtkTreeModel *model = ghid_tree_table_get_model(ctx, attr, 0); GtkTreePath *path; - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; pcb_hid_row_t *r; const char *s = val->str; @@ -448,7 +448,7 @@ GType *types; GtkCellRenderer *renderer; GtkTreeSelection *selection; - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; tree->hid_insert_cb = ghid_tree_table_insert_cb; tree->hid_remove_cb = ghid_tree_table_remove_cb; Index: trunk/src_plugins/lib_gtk_common/dlg_attr_txt.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_attr_txt.c (revision 26944) +++ trunk/src_plugins/lib_gtk_common/dlg_attr_txt.c (revision 26945) @@ -129,7 +129,7 @@ static void txt_set_text(pcb_hid_attribute_t *attrib, void *hid_ctx, pcb_hid_text_set_t how, const char *str) { attr_dlg_t *ctx = hid_ctx; - pcb_hid_text_t *txt = (pcb_hid_text_t *)attrib->enumerations; + pcb_hid_text_t *txt = attrib->wdata; dad_txt_t *tctx = txt->hid_wdata; int idx = attrib - ctx->attrs; GtkWidget *wtxt = ctx->wl[idx]; @@ -224,7 +224,7 @@ { GtkWidget *wtxt; GtkTextBuffer *buffer; - pcb_hid_text_t *txt = (pcb_hid_text_t *)attr->enumerations; + pcb_hid_text_t *txt = attr->wdata; dad_txt_t *tctx; Index: trunk/src_plugins/lib_gtk_common/dlg_attribute.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_attribute.c (revision 26944) +++ trunk/src_plugins/lib_gtk_common/dlg_attribute.c (revision 26945) @@ -299,7 +299,7 @@ } break; case TB_TABBED: - /* Add a new notebook page with an empty vbox, using tab label present in enumerations. */ + /* Add a new notebook page with an empty vbox, using tab label present in wdata. */ parent = gtkc_vbox_new(FALSE, 4); if (*tb_st->val.tabbed.tablab) { widget = gtk_label_new(*tb_st->val.tabbed.tablab); @@ -363,7 +363,7 @@ { ghid_attr_tb_t ts; ts.type = TB_TABBED; - ts.val.tabbed.tablab = ctx->attrs[j].enumerations; + ts.val.tabbed.tablab = ctx->attrs[j].wdata; ctx->wl[j] = widget = gtk_notebook_new(); gtk_notebook_set_show_tabs(GTK_NOTEBOOK(widget), !(ctx->attrs[j].pcb_hatt_flags & PCB_HATF_HIDE_TABLAB)); if (ctx->attrs[j].pcb_hatt_flags & PCB_HATF_LEFT_TAB) @@ -459,10 +459,10 @@ * Iterate through each value and add them to the * combo box */ - i = 0; - while (ctx->attrs[j].enumerations[i]) { - gtkc_combo_box_text_append_text(combo, ctx->attrs[j].enumerations[i]); - i++; + { + const char **vals = ctx->attrs[j].wdata; + for(i = 0; vals[i] != NULL; i++) + gtkc_combo_box_text_append_text(combo, vals[i]); } gtk_combo_box_set_active(GTK_COMBO_BOX(combo), ctx->attrs[j].val.lng); g_signal_connect(G_OBJECT(combo), "changed", G_CALLBACK(enum_changed_cb), &(ctx->attrs[j])); @@ -551,7 +551,7 @@ case PCB_HATT_END: { - pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)ctx->attrs[idx].enumerations; + pcb_hid_compound_t *cmp = ctx->attrs[idx].wdata; if ((cmp != NULL) && (cmp->set_value != NULL)) cmp->set_value(&ctx->attrs[idx], ctx, idx, val); else @@ -684,7 +684,7 @@ return -1; if (ctx->attrs[idx].type == PCB_HATT_END) { - pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)ctx->attrs[idx].enumerations; + pcb_hid_compound_t *cmp = ctx->attrs[idx].wdata; if ((cmp != NULL) && (cmp->widget_hide != NULL)) return cmp->widget_hide(&ctx->attrs[idx], ctx, idx, hide); else @@ -881,7 +881,7 @@ return -1; if (ctx->attrs[idx].type == PCB_HATT_END) { - pcb_hid_compound_t *cmp = (pcb_hid_compound_t *)ctx->attrs[idx].enumerations; + pcb_hid_compound_t *cmp = ctx->attrs[idx].wdata; if ((cmp != NULL) && (cmp->widget_state != NULL)) cmp->widget_state(&ctx->attrs[idx], ctx, idx, enabled); else Index: trunk/src_plugins/lib_hid_common/act_dad.c =================================================================== --- trunk/src_plugins/lib_hid_common/act_dad.c (revision 26944) +++ trunk/src_plugins/lib_hid_common/act_dad.c (revision 26945) @@ -121,7 +121,7 @@ static void dad_row_free_cb(pcb_hid_attribute_t *attrib, void *hid_ctx, pcb_hid_row_t *row) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *tree = attrib->wdata; dad_t *dad = tree->user_ctx; fgw_arg_t res; res.type = FGW_PTR | FGW_VOID; Index: trunk/src_plugins/lib_hid_common/dlg_log.c =================================================================== --- trunk/src_plugins/lib_hid_common/dlg_log.c (revision 26944) +++ trunk/src_plugins/lib_hid_common/dlg_log.c (revision 26945) @@ -54,7 +54,7 @@ static void log_append(log_ctx_t *ctx, pcb_hid_attribute_t *atxt, pcb_logline_t *line) { - pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; + pcb_hid_text_t *txt = atxt->wdata; const char *prefix = NULL; int popup; @@ -121,7 +121,7 @@ static void maybe_scroll_to_bottom() { pcb_hid_attribute_t *atxt = &log_ctx.dlg[log_ctx.wtxt]; - pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; + pcb_hid_text_t *txt = atxt->wdata; if ((log_ctx.dlg[log_ctx.wscroll].val.lng) && (txt->hid_scroll_to_bottom != NULL)) txt->hid_scroll_to_bottom(atxt, log_ctx.dlg_hid_ctx); @@ -167,7 +167,7 @@ { pcb_hid_attribute_t *atxt = &ctx->dlg[ctx->wtxt]; - pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; + pcb_hid_text_t *txt = atxt->wdata; txt->hid_set_readonly(atxt, ctx->dlg_hid_ctx, 1); } hv.lng = 1; @@ -210,7 +210,7 @@ { if (log_ctx.active) { pcb_hid_attribute_t *atxt = &log_ctx.dlg[log_ctx.wtxt]; - pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; + pcb_hid_text_t *txt = atxt->wdata; txt->hid_set_text(atxt, log_ctx.dlg_hid_ctx, PCB_HID_TEXT_REPLACE, ""); log_import(&log_ctx); Index: trunk/src_plugins/lib_hid_pcbui/routest_dlg.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/routest_dlg.c (revision 26944) +++ trunk/src_plugins/lib_hid_pcbui/routest_dlg.c (revision 26945) @@ -66,7 +66,7 @@ return; attr = &rstdlg_ctx.dlg[rstdlg_ctx.wattr]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; if (rst_idx < 0) rst_idx = rstdlg_ctx.curr; Index: trunk/src_plugins/propedit/propdlg.c =================================================================== --- trunk/src_plugins/propedit/propdlg.c (revision 26944) +++ trunk/src_plugins/propedit/propdlg.c (revision 26945) @@ -70,7 +70,7 @@ attr = &ctx->dlg[ctx->wtree]; attr_inp = &ctx->dlg[ctx->wfilter]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; text = attr_inp->val.str; have_filter_text = (text != NULL) && (*text != '\0'); @@ -86,7 +86,7 @@ static void prop_pcb2dlg(propdlg_t *ctx) { pcb_hid_attribute_t *attr = &ctx->dlg[ctx->wtree]; - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; pcb_hid_row_t *r; htsp_entry_t *sorted, *e; char *cursor_path = NULL; @@ -249,7 +249,7 @@ { pcb_hid_attr_val_t hv; pcb_hid_attribute_t *attr = &ctx->dlg[ctx->wvals]; - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attr->enumerations; + pcb_hid_tree_t *tree = attr->wdata; htprop_entry_t *e; pvsort_t *pvs; char *cell[3] = {NULL, NULL, NULL}; @@ -289,7 +289,7 @@ static void prop_select_node_cb(pcb_hid_attribute_t *attrib, void *hid_ctx, pcb_hid_row_t *row) { - pcb_hid_tree_t *tree = (pcb_hid_tree_t *)attrib->enumerations; + pcb_hid_tree_t *tree = attrib->wdata; propdlg_t *ctx = tree->user_ctx; pcb_props_t *p = NULL; Index: trunk/src_plugins/script/live_script.c =================================================================== --- trunk/src_plugins/script/live_script.c (revision 26944) +++ trunk/src_plugins/script/live_script.c (revision 26945) @@ -258,7 +258,7 @@ static int live_run(live_script_t *lvs) { pcb_hid_attribute_t *atxt = &lvs->dlg[lvs->wtxt]; - pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; + pcb_hid_text_t *txt = atxt->wdata; FILE *f; char *src, *fn, *lang; int res = 0; @@ -328,7 +328,7 @@ static int live_load(live_script_t *lvs, const char *fn) { pcb_hid_attribute_t *atxt = &lvs->dlg[lvs->wtxt]; - pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; + pcb_hid_text_t *txt = atxt->wdata; FILE *f; gds_t tmp; @@ -369,7 +369,7 @@ static int live_save(live_script_t *lvs, const char *fn) { pcb_hid_attribute_t *atxt = &lvs->dlg[lvs->wtxt]; - pcb_hid_text_t *txt = (pcb_hid_text_t *)atxt->enumerations; + pcb_hid_text_t *txt = atxt->wdata; FILE *f; char *src; int res = 0; Index: trunk/src_plugins/script/script_act.c =================================================================== --- trunk/src_plugins/script/script_act.c (revision 26944) +++ trunk/src_plugins/script/script_act.c (revision 26945) @@ -79,7 +79,7 @@ script_t *sc; attr = &ctx->dlg[ctx->walist]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; /* remove existing items */ for(r = gdl_first(&tree->rows); r != NULL; r = gdl_first(&tree->rows)) @@ -111,7 +111,7 @@ htsp_entry_t *e; attr = &ctx->dlg[ctx->wslist]; - tree = (pcb_hid_tree_t *)attr->enumerations; + tree = attr->wdata; /* remember cursor */ r = pcb_dad_tree_get_selected(attr);