Index: trunk/src/conf.c =================================================================== --- trunk/src/conf.c (revision 10816) +++ trunk/src/conf.c (revision 10817) @@ -799,8 +799,8 @@ if (path == NULL) { htsp_entry_t *e; conf_fields_foreach(e) { - conf_hid_global_cb((conf_native_t *)e->value, val_change_pre); - conf_hid_local_cb((conf_native_t *)e->value, val_change_pre); + conf_hid_global_cb((conf_native_t *)e->value, -1, val_change_pre); + conf_hid_local_cb((conf_native_t *)e->value, -1, val_change_pre); conf_field_clear(e->value); } } @@ -839,8 +839,8 @@ return; } conf_field_clear(n); - conf_hid_global_cb(n, val_change_pre); - conf_hid_local_cb(n, val_change_pre); + conf_hid_global_cb(n, arr_idx, val_change_pre); + conf_hid_local_cb(n, arr_idx, val_change_pre); } /* merge all memory-lht data to memory-bin */ @@ -850,13 +850,13 @@ if (path == NULL) { htsp_entry_t *e; conf_fields_foreach(e) { - conf_hid_local_cb((conf_native_t *)e->value, val_change_post); - conf_hid_global_cb((conf_native_t *)e->value, val_change_post); + conf_hid_local_cb((conf_native_t *)e->value, -1, val_change_post); + conf_hid_global_cb((conf_native_t *)e->value, -1, val_change_post); } } else { - conf_hid_local_cb(n, val_change_post); - conf_hid_global_cb(n, val_change_post); + conf_hid_local_cb(n, arr_idx, val_change_post); + conf_hid_global_cb(n, arr_idx, val_change_post); } conf_rev++; } Index: trunk/src/conf_hid.c =================================================================== --- trunk/src/conf_hid.c (revision 10816) +++ trunk/src/conf_hid.c (revision 10817) @@ -80,7 +80,7 @@ conf_native_t *cfg = e->value; len = vtp0_len(&cfg->hid_callbacks); - conf_hid_local_cb(cfg, unreg_item); + conf_hid_local_cb(cfg, -1, unreg_item); /* truncate the list if there are empty items at the end */ if (len > h->id) { @@ -97,7 +97,7 @@ if ((h->cb != NULL) && (h->cb->unreg_item != NULL)) { conf_fields_foreach(e) { conf_native_t *cfg = e->value; - h->cb->unreg_item(cfg); + h->cb->unreg_item(cfg, -1); } } @@ -104,8 +104,8 @@ free(h); } -typedef void (*cb_t)(conf_native_t *cfg); -void conf_hid_global_cb_(conf_native_t *item, int offs) +typedef void (*cb_t)(conf_native_t *cfg, int arr_idx); +void conf_hid_global_cb_(conf_native_t *item, int arr_idx, int offs) { htpp_entry_t *e; if (conf_hid_ids == NULL) @@ -117,7 +117,7 @@ char *s = (char *)&cbs->val_change_pre; cb_t *cb = (cb_t *)(s + offs); if ((*cb) != NULL) - (*cb)(item); + (*cb)(item, arr_idx); } } } Index: trunk/src/conf_hid.h =================================================================== --- trunk/src/conf_hid.h (revision 10816) +++ trunk/src/conf_hid.h (revision 10817) @@ -6,14 +6,14 @@ typedef struct conf_hid_callbacks_s { /* Called before/after a value of a config item is updated - this doesn't necessarily mean the value actually changes */ - void (*val_change_pre)(conf_native_t *cfg); - void (*val_change_post)(conf_native_t *cfg); + void (*val_change_pre)(conf_native_t *cfg, int arr_idx); + void (*val_change_post)(conf_native_t *cfg, int arr_idx); /* Called when a new config item is added to the database; global-only */ - void (*new_item_post)(conf_native_t *cfg); + void (*new_item_post)(conf_native_t *cfg, int arr_idx); /* Called during conf_hid_unreg to get hid-data cleaned up */ - void (*unreg_item)(conf_native_t *cfg); + void (*unreg_item)(conf_native_t *cfg, int arr_idx); } conf_hid_callbacks_t; typedef int conf_hid_id_t; @@ -45,22 +45,22 @@ /* Call the local callback of a native item */ -#define conf_hid_local_cb(native, cb) \ +#define conf_hid_local_cb(native, arr_idx, cb) \ do { \ unsigned int __n__; \ for(__n__ = 0; __n__ < vtp0_len(&((native)->hid_callbacks)); __n__++) { \ const conf_hid_callbacks_t *cbs = (native)->hid_callbacks.array[__n__]; \ if ((cbs != NULL) && (cbs->cb != NULL)) \ - cbs->cb(native); \ + cbs->cb(native, arr_idx); \ } \ } while(0) -/* Call the local callback of a native item */ -#define conf_hid_global_cb(native, cb) \ +/* Call the global callback of a native item */ +#define conf_hid_global_cb(native, arr_idx, cb) \ do { \ conf_hid_callbacks_t __cbs__; \ int __offs__ = ((char *)&(__cbs__.cb)) - ((char *)&(__cbs__)); \ - conf_hid_global_cb_(native, __offs__); \ + conf_hid_global_cb_(native, arr_idx, __offs__); \ } while(0) /****** Utility/helper functions ******/ @@ -69,6 +69,6 @@ void conf_loglevel_props(enum pcb_message_level level, const char **tag, int *popup); /****** Internal ******/ -void conf_hid_global_cb_(conf_native_t *item, int offs); +void conf_hid_global_cb_(conf_native_t *item, int arr_idx, int offs); #endif Index: trunk/src/layer_vis.c =================================================================== --- trunk/src/layer_vis.c (revision 10816) +++ trunk/src/layer_vis.c (revision 10817) @@ -215,7 +215,7 @@ static conf_hid_id_t layer_vis_conf_id; -void layer_vis_chg_mask(conf_native_t *cfg) +void layer_vis_chg_mask(conf_native_t *cfg, int arr_idx) { pcb_layer_id_t n; int chg = 0; @@ -277,9 +277,9 @@ } -static void pcb_layer_confchg_color(conf_native_t *cfg) +static void pcb_layer_confchg_color(conf_native_t *cfg, int arr_idx) { - pcb_trace("LAYER COLOR\n"); + pcb_trace("LAYER COLOR %d\n", arr_idx); } static const char *layer_vis_cookie = "core_layer_vis"; Index: trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c =================================================================== --- trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 10816) +++ trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 10817) @@ -490,7 +490,7 @@ gdk_gc_set_foreground(priv->grid_gc, &priv->grid_color); } -static void ghid_gdk_set_special_colors(conf_native_t *cfg) +static void ghid_gdk_set_special_colors(conf_native_t *cfg, int arr_idx) { render_priv_t *priv = gport->render_priv; Index: trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c =================================================================== --- trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 10816) +++ trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 10817) @@ -357,7 +357,7 @@ priv->grid_color.blue ^= priv->bg_color.blue; } -void ghid_gl_set_special_colors(conf_native_t *cfg) +void ghid_gl_set_special_colors(conf_native_t *cfg, int arr_idx) { render_priv_t *priv = gport->render_priv; Index: trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c =================================================================== --- trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 10816) +++ trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 10817) @@ -644,7 +644,7 @@ // // gdk_gc_set_foreground(priv->grid_gc, &gport->grid_color); //} -static void ghid_cairo_set_special_colors(conf_native_t * cfg) +static void ghid_cairo_set_special_colors(conf_native_t * cfg, int arr_idx) { render_priv_t *priv = gport->render_priv; Index: trunk/src_plugins/lib_gtk_common/bu_menu.h =================================================================== --- trunk/src_plugins/lib_gtk_common/bu_menu.h (revision 10816) +++ trunk/src_plugins/lib_gtk_common/bu_menu.h (revision 10817) @@ -21,7 +21,7 @@ typedef struct pcb_gtk_menu_ctx_s { GtkWidget *menu_bar; conf_hid_id_t ghid_menuconf_id; - void (*confchg_checkbox)(conf_native_t *cfg); + void (*confchg_checkbox)(conf_native_t *cfg, int arr_idx); } pcb_gtk_menu_ctx_t; GType ghid_main_menu_get_type(void); Index: trunk/src_plugins/lib_gtk_hid/glue_conf.c =================================================================== --- trunk/src_plugins/lib_gtk_hid/glue_conf.c (revision 10816) +++ trunk/src_plugins/lib_gtk_hid/glue_conf.c (revision 10817) @@ -33,7 +33,7 @@ #warning TODO: cleanup: make a generic status line update callback instead of this code dup -void ghid_confchg_line_refraction(conf_native_t *cfg) +void ghid_confchg_line_refraction(conf_native_t *cfg, int arr_idx) { /* test if PCB struct doesn't exist at startup */ if ((PCB == NULL) || (ghidgui->common.set_status_line_label == NULL)) @@ -41,7 +41,7 @@ ghidgui->common.set_status_line_label(); } -void ghid_confchg_all_direction_lines(conf_native_t *cfg) +void ghid_confchg_all_direction_lines(conf_native_t *cfg, int arr_idx) { /* test if PCB struct doesn't exist at startup */ if ((PCB == NULL) || (ghidgui->common.set_status_line_label == NULL)) @@ -49,7 +49,7 @@ ghidgui->common.set_status_line_label(); } -void ghid_confchg_flip(conf_native_t *cfg) +void ghid_confchg_flip(conf_native_t *cfg, int arr_idx) { /* test if PCB struct doesn't exist at startup */ if ((PCB == NULL) || (ghidgui->common.set_status_line_label == NULL)) @@ -57,7 +57,7 @@ ghidgui->common.set_status_line_label(); } -void ghid_confchg_grid(conf_native_t *cfg) +void ghid_confchg_grid(conf_native_t *cfg, int arr_idx) { /* test if PCB struct doesn't exist at startup */ if ((PCB == NULL) || (ghidgui->common.set_status_line_label == NULL)) @@ -65,7 +65,7 @@ ghidgui->common.set_status_line_label(); } -void ghid_confchg_fullscreen(conf_native_t *cfg) +void ghid_confchg_fullscreen(conf_native_t *cfg, int arr_idx) { if (ghidgui->hid_active) ghid_fullscreen_apply(&ghidgui->topwin); @@ -72,7 +72,7 @@ } -void ghid_confchg_checkbox(conf_native_t *cfg) +void ghid_confchg_checkbox(conf_native_t *cfg, int arr_idx) { if (ghidgui->hid_active) ghid_update_toggle_flags(&ghidgui->topwin); @@ -79,7 +79,7 @@ } -static void init_conf_watch(conf_hid_callbacks_t *cbs, const char *path, void (*func) (conf_native_t *)) +static void init_conf_watch(conf_hid_callbacks_t *cbs, const char *path, void (*func)(conf_native_t *, int)) { conf_native_t *n = conf_get_field(path); if (n != NULL) { Index: trunk/src_plugins/lib_gtk_hid/glue_conf.h =================================================================== --- trunk/src_plugins/lib_gtk_hid/glue_conf.h (revision 10816) +++ trunk/src_plugins/lib_gtk_hid/glue_conf.h (revision 10817) @@ -1,10 +1,10 @@ #include "conf.h" -void ghid_confchg_line_refraction(conf_native_t *cfg); -void ghid_confchg_all_direction_lines(conf_native_t *cfg); -void ghid_confchg_fullscreen(conf_native_t *cfg); -void ghid_confchg_checkbox(conf_native_t *cfg); -void ghid_confchg_flip(conf_native_t *cfg); -void ghid_confchg_grid(conf_native_t *cfg); +void ghid_confchg_line_refraction(conf_native_t *cfg, int arr_idx); +void ghid_confchg_all_direction_lines(conf_native_t *cfg, int arr_idx); +void ghid_confchg_fullscreen(conf_native_t *cfg, int arr_idx); +void ghid_confchg_checkbox(conf_native_t *cfg, int arr_idx); +void ghid_confchg_flip(conf_native_t *cfg, int arr_idx); +void ghid_confchg_grid(conf_native_t *cfg, int arr_idx); void ghid_conf_regs(const char *cookie);