Index: trunk/src/actions.c =================================================================== --- trunk/src/actions.c (revision 25132) +++ trunk/src/actions.c (revision 25133) @@ -509,12 +509,12 @@ static char prompt[128]; int blen, slen, len; - if ((*pcbhlc_rc_cli_prompt != NULL) && (**pcbhlc_rc_cli_prompt != '\0')) - base = *pcbhlc_rc_cli_prompt; - else if ((*pcbhlc_rc_cli_backend == NULL) || (**pcbhlc_rc_cli_backend == '\0')) + if ((pcbhl_conf.rc.cli_prompt != NULL) && (*pcbhl_conf.rc.cli_prompt != '\0')) + base = pcbhl_conf.rc.cli_prompt; + else if ((pcbhl_conf.rc.cli_backend == NULL) || (*pcbhl_conf.rc.cli_backend == '\0')) base = "action"; else - base = *pcbhlc_rc_cli_backend; + base = pcbhl_conf.rc.cli_backend; if ((suffix == NULL) || (*suffix == '\0')) return base; @@ -550,8 +550,8 @@ int pcb_cli_enter(const char *backend, const char *prompt) { - cli_push(*pcbhlc_rc_cli_backend); - cli_push(*pcbhlc_rc_cli_prompt); + cli_push(pcbhl_conf.rc.cli_backend); + cli_push(pcbhl_conf.rc.cli_prompt); if (conf_set(CFR_CLI, "rc/cli_backend", 0, backend, POL_OVERWRITE) != 0) return -1; @@ -582,11 +582,11 @@ fgw_func_t *f; /* no backend: let the original action work */ - if ((*pcbhlc_rc_cli_backend == NULL) || (**pcbhlc_rc_cli_backend == '\0')) + if ((pcbhl_conf.rc.cli_backend == NULL) || (*pcbhl_conf.rc.cli_backend == '\0')) return -1; /* backend: let the backend action handle it */ - a = pcb_find_action(*pcbhlc_rc_cli_backend, &f); + a = pcb_find_action(pcbhl_conf.rc.cli_backend, &f); if (!a) return -1; @@ -660,15 +660,15 @@ const char *end; /* no backend or forced action mode: classic pcb-rnd action parse */ - if (force_action_mode || (*pcbhlc_rc_cli_backend == NULL) || (**pcbhlc_rc_cli_backend == '\0')) { + if (force_action_mode || (pcbhl_conf.rc.cli_backend == NULL) || (*pcbhl_conf.rc.cli_backend == '\0')) { pcb_event(PCB_EVENT_CLI_ENTER, "s", str_); return hid_parse_actionstring(str_, pcb_false); } /* backend: let the backend action handle it */ - a = pcb_find_action(*pcbhlc_rc_cli_backend, &f); + a = pcb_find_action(pcbhl_conf.rc.cli_backend, &f); if (!a) { - pcb_message(PCB_MSG_ERROR, "cli: no action %s; leaving mode\n", *pcbhlc_rc_cli_backend); + pcb_message(PCB_MSG_ERROR, "cli: no action %s; leaving mode\n", pcbhl_conf.rc.cli_backend); pcb_cli_leave(); return -1; } Index: trunk/src/board.c =================================================================== --- trunk/src/board.c (revision 25132) +++ trunk/src/board.c (revision 25133) @@ -29,6 +29,7 @@ #include "board.h" #include "data.h" #include "conf_core.h" +#include "hidlib_conf.h" #include "plug_io.h" #include "compat_misc.h" #include "actions.h" @@ -294,7 +295,7 @@ } PCB->hidlib.grid = Grid; conf_set_design("editor/grid", "%$mS", Grid); - if (conf_core.editor.draw_grid) + if (pcbhl_conf.editor.draw_grid) pcb_redraw(); } } Index: trunk/src/conf.h =================================================================== --- trunk/src/conf.h (revision 25132) +++ trunk/src/conf.h (revision 25133) @@ -323,9 +323,15 @@ #define conf_toggle_editor(field) \ conf_set_editor(field, !conf_core.editor.field) +#define conf_toggle_heditor(field) \ + conf_set_editor(field, !pcbhl_conf.editor.field) + #define conf_toggle_editor_(sfield, field) \ conf_set_editor_("editor/" sfield, !conf_core.editor.field) +#define conf_toggle_heditor_(sfield, field) \ + conf_set_editor_("editor/" sfield, !pcbhl_conf.editor.field) + /* For temporary modification/restoration of variables (hack) */ #define conf_force_set_bool(var, val) *((CFT_BOOLEAN *)(&var)) = val #define conf_force_set_str(var, val) *((CFT_STRING *)(&var)) = val Index: trunk/src/conf_act.c =================================================================== --- trunk/src/conf_act.c (revision 25132) +++ trunk/src/conf_act.c (revision 25133) @@ -314,7 +314,7 @@ { const char *expected; PCB_ACT_CONVARG(1, FGW_STR, ChkGridUnits, expected = argv[1].val.str); - PCB_ACT_IRES(strcmp(conf_core.editor.grid_unit->suffix, expected) == 0); + PCB_ACT_IRES(strcmp(pcbhl_conf.editor.grid_unit->suffix, expected) == 0); return 0; } Index: trunk/src/conf_core.c =================================================================== --- trunk/src/conf_core.c (revision 25132) +++ trunk/src/conf_core.c (revision 25133) @@ -1,6 +1,7 @@ #include "config.h" #include "conf.h" #include "conf_core.h" +#include "hidlib_conf.h" conf_core_t conf_core; #define conf_clamp_to(type, var, min, max, safe_val) \ @@ -46,7 +47,7 @@ conf_force_set_str(conf_core.rc.path.lib, PCBLIBDIR); pcb_conf_ro("rc/path/lib"); conf_force_set_str(conf_core.rc.path.bin, BINDIR); pcb_conf_ro("rc/path/bin"); conf_force_set_str(conf_core.rc.path.share, PCBSHAREDIR); pcb_conf_ro("rc/path/share"); - conf_force_set_str(conf_core.rc.path.home, get_homedir()); pcb_conf_ro("rc/path/home"); + conf_force_set_str(pcbhl_conf.rc.path.home, get_homedir()); pcb_conf_ro("rc/path/home"); } void conf_core_init() Index: trunk/src/conf_core.h =================================================================== --- trunk/src/conf_core.h (revision 25132) +++ trunk/src/conf_core.h (revision 25133) @@ -18,7 +18,6 @@ } temp; const struct { /* editor */ - CFT_UNIT grid_unit; /* select whether you draw in mm or mil */ CFT_COORD grid; /* grid in pcb-units */ CFT_LIST grids; /* grid in grid-string format */ CFT_INTEGER grids_idx; /* the index of the currently active grid from grids */ @@ -37,7 +36,6 @@ CFT_BOOLEAN save_last_command; /* OBSOLETE: use the session-persistent command line history instead (press the up arrow) */ CFT_INTEGER line_refraction; /* value for line lookahead setting */ CFT_BOOLEAN save_in_tmp; /* emergency save unsaved PCB data (despite the user clicks don't save) when: user starts a new PCB; user quits pcb-rnd. Does not affect the on-crash emergency save. */ - CFT_BOOLEAN draw_grid; /* draw grid points */ CFT_BOOLEAN all_direction_lines; /* enable lines to all directions */ CFT_BOOLEAN rubber_band_mode; /* move, rotate use rubberband connections */ CFT_BOOLEAN rubber_band_keep_midlinedir; /* keep line direction when a middle line is moved */ @@ -48,7 +46,6 @@ CFT_BOOLEAN show_number; /* OBSOLETE: pinout shows number */ CFT_BOOLEAN orthogonal_moves; /* move items orthogonally. */ CFT_BOOLEAN reset_after_element; /* OBSOLETE: reset connections after each element while saving all connections */ - CFT_BOOLEAN auto_place; /* force placement of GUI windows (dialogs), trying to override the window manager */ CFT_BOOLEAN lock_names; /* lock down text so they can not be moved or selected */ CFT_BOOLEAN only_names; /* lock down everything else but text so only text objects can be moved or selected */ CFT_BOOLEAN thin_draw; /* if set, objects on the screen are drawn as outlines (lines are drawn as center-lines). This lets you see line endpoints hidden under pins, for example. */ @@ -62,7 +59,6 @@ CFT_BOOLEAN name_on_pcb; /* obsolete - DO NOT USE - kept for compatibility */ CFT_STRING subc_id; /* subcircuit ID template for diplaying the subcircuit label on the subcircuit layer; default to displaying the refes, if empty; syntax if the same as for DYNTEXT */ CFT_STRING term_id; /* terminal ID template for diplaying the subcircuit label on the subcircuit layer; default to displaying termid[intconn], if empty; syntax if the same as for DYNTEXT */ - CFT_BOOLEAN fullscreen; /* hide widgets to make more room for the drawing */ CFT_BOOLEAN move_linepoint_uses_route; /* Moving a line point calculates a new line route. This allows 45/90 line modes when editing lines. */ CFT_BOOLEAN auto_via; /* when drawing traces and switching layers or when moving an object from one layer to another, try to keep connections by automatically inserting vias. */ CFT_REAL route_radius; /* temporary: route draw helper's arc radius at corners (factor of the trace thickness) */ @@ -73,11 +69,6 @@ CFT_INTEGER click_time; /* default time for click expiration, in ms */ struct { - CFT_BOOLEAN flip_x; /* view: flip the board along the X (horizontal) axis */ - CFT_BOOLEAN flip_y; /* view: flip the board along the Y (vertical) axis */ - } view; - - struct { CFT_BOOLEAN disable_negative; /* selection box behaviour: disable the negative-direction selection - any selection box will select only what's fully within the box */ CFT_BOOLEAN symmetric_negative; /* selection box behaviour: when set, the selection direction is considered negative only if the box has negative size in the X direction */ } selection; @@ -98,7 +89,6 @@ } editor; const struct { /* rc */ - CFT_BOOLEAN dup_log_to_stderr; /* copy log messages to stderr even if there is a HID that can show them */ CFT_INTEGER backup_interval; /* time between two backups in seconds; 0 means disabled (no backups) */ CFT_BOOLEAN hid_fallback; /* if there is no explicitly specified HID (--gui) and the preferred GUI fails, automatically fall back on other HIDs, eventually running in batch mode */ CFT_STRING brave; /* brave mode flags: when non-empty, enable various experimental (unstable) features - useful for testers */ @@ -107,8 +97,6 @@ CFT_STRING file_path; CFT_STRING library_shell; CFT_LIST library_search_paths; - CFT_STRING menu_file; /* where to load the default menu file from. If empty/unset, fall back to the legacy 'per hid ow menu file' setup. If contains slash, take it as a full path, if no slash, do a normal menu search for pcb-menu-NAME.lht */ - CFT_BOOLEAN export_basename; /* if an exported file contains the source file name, remove path from it, keeping the basename only */ CFT_STRING emergency_name; /* file name template for emergency save anonymous .pcb files (when pcb-rnd crashes); optional field: %ld --> pid; must be shorter than 240 characters. Don't do emergency save if this item is empty. */ CFT_STRING emergency_format; /* if set, use this format for the backups; if unset, use the default format */ @@ -130,9 +118,6 @@ CFT_STRING save_final_fallback_fmt;/* when a new file is created (by running pcb-rnd with the file name) there won't be a known format; pcb-rnd will guess from the file name (extension) but eventhat may fail. This format is the final fallback that'll be used if no other guessing mechanism worked. The user can override this by save as. */ CFT_STRING save_fp_fmt; /* when saving a buffer element/subcircuit, prefer this format by default */ - CFT_STRING cli_prompt; /* plain text prompt to prefix the command entry */ - CFT_STRING cli_backend; /* command parser action */ - /***** automatically set (in postproc) *****/ CFT_BOOLEAN have_regex; /* whether we have regex compiled in */ struct { @@ -140,9 +125,6 @@ CFT_STRING lib; /* e.g. /usr/lib/pcb-rnd */ CFT_STRING bin; /* e.g. /usr/bin */ CFT_STRING share; /* e.g. /usr/share/pcb-rnd */ - CFT_STRING home; /* user's home dir, determined run-time */ - - CFT_STRING exec_prefix; /* exec prefix path (extracted from argv[0]) */ CFT_STRING design; /* directory path of the current design, or if the current design doesn't have a file name yet */ } path; @@ -175,27 +157,14 @@ CFT_BOOLEAN compact; /* when set: optimize GUI widget arrangement for small screen; may be wasting some screen space on large screen */ CFT_COORD rat_thickness; CFT_COORD mark_size; /* relative marker size */ - CFT_REAL layer_alpha; /* alpha value for layer drawing */ - CFT_REAL drill_alpha; /* alpha value for drill drawing */ CFT_BOOLEAN text_host_bbox; /* when moving a text object, the outline thin-draw should also include the bounding box */ CFT_REAL term_label_size; /* size of terminal labels, in pcb font scale (100 is for the normal size) */ CFT_BOOLEAN subc_layer_per_side; /* hide top or bottom placed subcircuit annotations if the view is showing the other side */ CFT_BOOLEAN invis_other_groups; /* render non-current group layers with the inivisble color */ CFT_BOOLEAN black_current_group; /* render all layers of the current group black, for maximum contrast */ - struct { - CFT_STRING debug_tag; /* log style tag of debug messages */ - CFT_BOOLEAN debug_popup; /* whether a debug line should pop up the log window */ - CFT_STRING info_tag; /* log style tag of info messages */ - CFT_BOOLEAN info_popup; /* whether an info line should pop up the log window */ - CFT_STRING warning_tag; /* log style tag of warnings */ - CFT_BOOLEAN warning_popup; /* whether a warning should pop up the log window */ - CFT_STRING error_tag; /* log style tag of errors */ - CFT_BOOLEAN error_popup; /* whether an error should pop up the log window */ - } loglevels; + struct { /* color */ - CFT_COLOR background; /* background and cursor color ... */ CFT_COLOR crosshair; /* different object colors */ - CFT_COLOR cross; /* crosshair, drc outline color */ CFT_COLOR selected; /* generic object selection color */ CFT_COLOR via; /* non-terminal padstack shape on current layer */ CFT_COLOR via_far; /* non-terminal padstack shape on non-current ('far side') layer */ @@ -209,8 +178,6 @@ CFT_COLOR invisible_objects; /* other-side objects and padstack shapes on non-current layer */ CFT_COLOR connected; /* 'connected' highlight (galvanic connections found) */ CFT_COLOR warn; /* warning highlight (e.g. object found to cause a short) */ - CFT_COLOR off_limit; /* on-screen background beyond the configured drawing area */ - CFT_COLOR grid; /* on-screen grid */ CFT_COLOR layer[PCB_MAX_LAYER]; /* default layer colors; when a new layer is created, a color from this list is assigned initially */ CFT_COLOR mask; /* default mask layer color (when a new mask layer is created) */ CFT_COLOR paste; /* default paste layer color (when a new paste layer is created) */ Index: trunk/src/conf_hid.c =================================================================== --- trunk/src/conf_hid.c (revision 25132) +++ trunk/src/conf_hid.c (revision 25133) @@ -138,10 +138,10 @@ *tag = NULL; *popup = 0; switch(level) { - case PCB_MSG_DEBUG: *tag = *pcbhlc_appearance_loglevels_debug_tag; *popup = *pcbhlc_appearance_loglevels_debug_popup; break; - case PCB_MSG_INFO: *tag = *pcbhlc_appearance_loglevels_info_tag; *popup = *pcbhlc_appearance_loglevels_info_popup; break; - case PCB_MSG_WARNING: *tag = *pcbhlc_appearance_loglevels_warning_tag; *popup = *pcbhlc_appearance_loglevels_warning_popup; break; - case PCB_MSG_ERROR: *tag = *pcbhlc_appearance_loglevels_error_tag; *popup = *pcbhlc_appearance_loglevels_error_popup; break; + case PCB_MSG_DEBUG: *tag = pcbhl_conf.appearance.loglevels.debug_tag; *popup = pcbhl_conf.appearance.loglevels.debug_popup; break; + case PCB_MSG_INFO: *tag = pcbhl_conf.appearance.loglevels.info_tag; *popup = pcbhl_conf.appearance.loglevels.info_popup; break; + case PCB_MSG_WARNING: *tag = pcbhl_conf.appearance.loglevels.warning_tag; *popup = pcbhl_conf.appearance.loglevels.warning_popup; break; + case PCB_MSG_ERROR: *tag = pcbhl_conf.appearance.loglevels.error_tag; *popup = pcbhl_conf.appearance.loglevels.error_popup; break; break; } } Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 25132) +++ trunk/src/crosshair.c (revision 25133) @@ -28,7 +28,9 @@ */ #include "config.h" + #include "conf_core.h" +#include "hidlib_conf.h" #include "board.h" #include "crosshair.h" @@ -286,7 +288,7 @@ /* Draw the DRC outline if it is enabled */ if (conf_core.editor.show_drc) { - pcb_gui->set_color(pcb_crosshair.GC, &conf_core.appearance.color.cross); + pcb_gui->set_color(pcb_crosshair.GC, &pcbhl_conf.appearance.color.cross); pcb_draw_wireframe_line(pcb_crosshair.GC,line.Point1.X, line.Point1.Y, line.Point2.X, line.Point2.Y, line.Thickness + 2 * (conf_core.design.bloat + 1), 0); @@ -309,7 +311,7 @@ /* Draw the DRC outline if it is enabled */ if (conf_core.editor.show_drc) { - pcb_gui->set_color(pcb_crosshair.GC, &conf_core.appearance.color.cross); + pcb_gui->set_color(pcb_crosshair.GC, &pcbhl_conf.appearance.color.cross); arc.Thickness += 2 * (conf_core.design.bloat + 1); pcb_draw_wireframe_arc(pcb_crosshair.GC, &arc, arc.Thickness); pcb_gui->set_color(pcb_crosshair.GC, &conf_core.appearance.color.crosshair); @@ -352,7 +354,7 @@ /* Draw the DRC outline if it is enabled */ if (conf_core.editor.show_drc) { - pcb_gui->set_color(pcb_crosshair.GC, &conf_core.appearance.color.cross); + pcb_gui->set_color(pcb_crosshair.GC, &pcbhl_conf.appearance.color.cross); pcb_draw_wireframe_line(pcb_crosshair.GC,point1->X, point1->Y, point2.X, point2.Y,line->Thickness + 2 * (conf_core.design.bloat + 1), 0); pcb_gui->set_color(pcb_crosshair.GC, &conf_core.appearance.color.crosshair); @@ -407,7 +409,7 @@ /* Draw the DRC outline if it is enabled */ if (conf_core.editor.show_drc) { - pcb_gui->set_color(pcb_crosshair.GC, &conf_core.appearance.color.cross); + pcb_gui->set_color(pcb_crosshair.GC, &pcbhl_conf.appearance.color.cross); arc.Thickness += 2 * (conf_core.design.bloat + 1); pcb_draw_wireframe_arc(pcb_crosshair.GC, &arc, arc.Thickness); pcb_gui->set_color(pcb_crosshair.GC, &conf_core.appearance.color.crosshair); Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 25132) +++ trunk/src/draw.c (revision 25133) @@ -30,6 +30,7 @@ #include "config.h" #include "conf_core.h" +#include "hidlib_conf.h" #include "math_helper.h" #include "board.h" #include "data.h" @@ -1050,8 +1051,8 @@ /* vert flip magic: make sure the offset is in-line with the flip and our sick y coords for vertical */ #define PCB_TERM_LABEL_SETUP(label) \ - pcb_bool flip_x = conf_core.editor.view.flip_x; \ - pcb_bool flip_y = conf_core.editor.view.flip_y; \ + pcb_bool flip_x = pcbhl_conf.editor.view.flip_x; \ + pcb_bool flip_y = pcbhl_conf.editor.view.flip_y; \ pcb_font_t *font = pcb_font(PCB, 0, 0); \ pcb_coord_t w, h, dx, dy; \ if (vert) { \ Index: trunk/src/drc.c =================================================================== --- trunk/src/drc.c (revision 25132) +++ trunk/src/drc.c (revision 25133) @@ -82,12 +82,12 @@ for(v = pcb_view_list_first(lst); v != NULL; v = pcb_view_list_next(v)) { printf("%ld: %s: %s\n", v->uid, v->type, v->title); if (v->have_bbox) - pcb_printf("%m+within %$m4\n", conf_core.editor.grid_unit->allow, v->bbox.X1, v->bbox.Y1, v->bbox.X2, v->bbox.Y2); + pcb_printf("%m+within %$m4\n", pcbhl_conf.editor.grid_unit->allow, v->bbox.X1, v->bbox.Y1, v->bbox.X2, v->bbox.Y2); if (v->have_xy) - pcb_printf("%m+at %$m2\n", conf_core.editor.grid_unit->allow, v->x, v->y); - pcb_printf("%m+required value %$mS\n", conf_core.editor.grid_unit->allow, v->data.drc.required_value); + pcb_printf("%m+at %$m2\n", pcbhl_conf.editor.grid_unit->allow, v->x, v->y); + pcb_printf("%m+required value %$mS\n", pcbhl_conf.editor.grid_unit->allow, v->data.drc.required_value); if (v->data.drc.have_measured) - pcb_printf("%m+measured value %$mS\n", conf_core.editor.grid_unit->allow, v->data.drc.measured_value); + pcb_printf("%m+measured value %$mS\n", pcbhl_conf.editor.grid_unit->allow, v->data.drc.measured_value); printf("%s\n\n", v->description); } } @@ -96,12 +96,12 @@ for(v = pcb_view_list_first(lst); v != NULL; v = pcb_view_list_next(v)) { pcb_message(PCB_MSG_INFO, "%ld: %s: %s\n", v->uid, v->type, v->title); if (v->have_bbox) - pcb_message(PCB_MSG_INFO, "%m+within %$m4\n", conf_core.editor.grid_unit->allow, v->bbox.X1, v->bbox.Y1, v->bbox.X2, v->bbox.Y2); + pcb_message(PCB_MSG_INFO, "%m+within %$m4\n", pcbhl_conf.editor.grid_unit->allow, v->bbox.X1, v->bbox.Y1, v->bbox.X2, v->bbox.Y2); if (v->have_xy) - pcb_message(PCB_MSG_INFO, "%m+at %$m2\n", conf_core.editor.grid_unit->allow, v->x, v->y); - pcb_printf("%m+required value %$mS\n", conf_core.editor.grid_unit->allow, v->data.drc.required_value); + pcb_message(PCB_MSG_INFO, "%m+at %$m2\n", pcbhl_conf.editor.grid_unit->allow, v->x, v->y); + pcb_printf("%m+required value %$mS\n", pcbhl_conf.editor.grid_unit->allow, v->data.drc.required_value); if (v->data.drc.have_measured) - pcb_message(PCB_MSG_INFO, "%m+measured value %$mS\n", conf_core.editor.grid_unit->allow, v->data.drc.measured_value); + pcb_message(PCB_MSG_INFO, "%m+measured value %$mS\n", pcbhl_conf.editor.grid_unit->allow, v->data.drc.measured_value); pcb_message(PCB_MSG_INFO, "%s\n\n", v->description); } } Index: trunk/src/error.c =================================================================== --- trunk/src/error.c (revision 25132) +++ trunk/src/error.c (revision 25133) @@ -59,7 +59,7 @@ gds_t tmp; pcb_logline_t *line; - if ((pcb_gui == NULL) || (pcbhlc_rc_dup_log_to_stderr == NULL) || (*pcbhlc_rc_dup_log_to_stderr)) { + if ((pcb_gui == NULL) || (pcbhl_conf.rc.dup_log_to_stderr)) { if (pcbhl_conf.rc.quiet) min_level = PCB_MSG_ERROR; Index: trunk/src/gui_act.c =================================================================== --- trunk/src/gui_act.c (revision 25132) +++ trunk/src/gui_act.c (revision 25133) @@ -35,6 +35,7 @@ #include "board.h" #include "build_run.h" #include "conf_core.h" +#include "hidlib_conf.h" #include "data.h" #include "tool.h" #include "grid.h" @@ -298,7 +299,7 @@ /* toggle displaying of the grid */ case F_Grid: - conf_toggle_editor(draw_grid); + conf_toggle_heditor(draw_grid); pcb_redraw(); break; @@ -362,7 +363,7 @@ } PCB->hidlib.grid_ox = pcb_get_value(argv[2].val.str, NULL, NULL, NULL); PCB->hidlib.grid_oy = pcb_get_value(argv[3].val.str, NULL, NULL, NULL); - if (conf_core.editor.draw_grid) + if (pcbhl_conf.editor.draw_grid) pcb_redraw(); } break; @@ -939,7 +940,7 @@ switch(id) { case -2: case F_Toggle: - conf_setf(CFR_DESIGN, "editor/fullscreen", -1, "%d", !conf_core.editor.fullscreen, POL_OVERWRITE); + conf_setf(CFR_DESIGN, "editor/fullscreen", -1, "%d", !pcbhl_conf.editor.fullscreen, POL_OVERWRITE); break; case F_On: conf_set(CFR_DESIGN, "editor/fullscreen", -1, "1", POL_OVERWRITE); @@ -1002,10 +1003,10 @@ PCB_ACT_FAIL(Cursor); dx = pcb_get_value_ex(a1, a3, NULL, extra_units_x, "", NULL); - if (conf_core.editor.view.flip_x) + if (pcbhl_conf.editor.view.flip_x) dx = -dx; dy = pcb_get_value_ex(a2, a3, NULL, extra_units_y, "", NULL); - if (!conf_core.editor.view.flip_y) + if (!pcbhl_conf.editor.view.flip_y) dy = -dy; /* Allow leaving snapped pin/pad/padstack */ Index: trunk/src/hid_cfg.c =================================================================== --- trunk/src/hid_cfg.c (revision 25132) +++ trunk/src/hid_cfg.c (revision 25133) @@ -134,9 +134,9 @@ pcb_hid_cfg_t *hr; /* override HID defaults with the configured path */ - if ((*pcbhlc_rc_menu_file != NULL) && (**pcbhlc_rc_menu_file != '\0')) { - fn = *pcbhlc_rc_menu_file; - exact_fn = (strchr(*pcbhlc_rc_menu_file, '/') != NULL); + if ((pcbhl_conf.rc.menu_file != NULL) && (*pcbhl_conf.rc.menu_file != '\0')) { + fn = pcbhl_conf.rc.menu_file; + exact_fn = (strchr(pcbhl_conf.rc.menu_file, '/') != NULL); } if (!exact_fn) { Index: trunk/src/hid_dad_spin.c =================================================================== --- trunk/src/hid_dad_spin.c (revision 25132) +++ trunk/src/hid_dad_spin.c (revision 25133) @@ -99,7 +99,7 @@ if (spin->unit != NULL) unit = spin->unit; else - unit = *pcbhlc_editor_grid_unit; + unit = pcbhl_conf.editor.grid_unit; if (buf != NULL) { pcb_snprintf(buf, buflen, "%$m*", unit->suffix, c); return buf; @@ -124,7 +124,7 @@ if ((!su->dlg[su->wglob].default_val.int_value) && (unum >= 0) && (unum < pcb_get_n_units())) unit = &pcb_units[unum]; else - unit = *pcbhlc_editor_grid_unit; + unit = pcbhl_conf.editor.grid_unit; pcb_snprintf(su->buf, sizeof(su->buf), "%$m*", unit->suffix, su->end->default_val.coord_value); hv.str_value = su->buf; @@ -224,7 +224,7 @@ pcb_bool succ = pcb_get_value_unit(str->default_val.str_value, NULL, 0, &v, &unit); if (!succ) { v = end->default_val.coord_value; - unit = *pcbhlc_editor_grid_unit; + unit = pcbhl_conf.editor.grid_unit; } } else Index: trunk/src/hid_init.c =================================================================== --- trunk/src/hid_init.c (revision 25132) +++ trunk/src/hid_init.c (revision 25133) @@ -73,11 +73,11 @@ pcb_gui = pcb_hid_nogui_get_hid(); TODO("make this configurable - add to conf_board_ignores avoid plugin injection") - tmp = pcb_concat(*pcbhlc_rc_path_exec_prefix, PCB_DIR_SEPARATOR_S, "lib", PCB_DIR_SEPARATOR_S, "pcb-rnd", PCB_DIR_SEPARATOR_S, "plugins", PCB_DIR_SEPARATOR_S, HOST, NULL); + tmp = pcb_concat(pcbhl_conf.rc.path.exec_prefix, PCB_DIR_SEPARATOR_S, "lib", PCB_DIR_SEPARATOR_S, "pcb-rnd", PCB_DIR_SEPARATOR_S, "plugins", PCB_DIR_SEPARATOR_S, HOST, NULL); pcb_plugin_add_dir(tmp); free(tmp); - tmp = pcb_concat(*pcbhlc_rc_path_exec_prefix, PCB_DIR_SEPARATOR_S, "lib", PCB_DIR_SEPARATOR_S, "pcb-rnd", PCB_DIR_SEPARATOR_S, "plugins", NULL); + tmp = pcb_concat(pcbhl_conf.rc.path.exec_prefix, PCB_DIR_SEPARATOR_S, "lib", PCB_DIR_SEPARATOR_S, "pcb-rnd", PCB_DIR_SEPARATOR_S, "plugins", NULL); pcb_plugin_add_dir(tmp); free(tmp); @@ -89,13 +89,13 @@ pcb_plugin_add_dir(tmp); free(tmp); - /* *pcbhlc_rc_path_home is set by the conf_core immediately on startup */ - if (*pcbhlc_rc_path_home != NULL) { - tmp = pcb_concat(*pcbhlc_rc_path_home, PCB_DIR_SEPARATOR_S, DOT_PCB_RND, PCB_DIR_SEPARATOR_S, "plugins", PCB_DIR_SEPARATOR_S, HOST, NULL); + /* pcbhl_conf.rc.path.home is set by the conf_core immediately on startup */ + if (pcbhl_conf.rc.path.home != NULL) { + tmp = pcb_concat(pcbhl_conf.rc.path.home, PCB_DIR_SEPARATOR_S, DOT_PCB_RND, PCB_DIR_SEPARATOR_S, "plugins", PCB_DIR_SEPARATOR_S, HOST, NULL); pcb_plugin_add_dir(tmp); free(tmp); - tmp = pcb_concat(*pcbhlc_rc_path_home, PCB_DIR_SEPARATOR_S, DOT_PCB_RND, PCB_DIR_SEPARATOR_S, "plugins", NULL); + tmp = pcb_concat(pcbhl_conf.rc.path.home, PCB_DIR_SEPARATOR_S, DOT_PCB_RND, PCB_DIR_SEPARATOR_S, "plugins", NULL); pcb_plugin_add_dir(tmp); free(tmp); } @@ -259,7 +259,7 @@ const char *pcb_hid_export_fn(const char *filename) { - if (*pcbhlc_rc_export_basename) { + if (pcbhl_conf.rc.export_basename) { const char *outfn = strrchr(filename, PCB_DIR_SEPARATOR_C); if (outfn == NULL) return filename; Index: trunk/src/hidlib_conf.c =================================================================== --- trunk/src/hidlib_conf.c (revision 25132) +++ trunk/src/hidlib_conf.c (revision 25133) @@ -34,62 +34,6 @@ pcbhl_conf_t pcbhl_conf; - -CFT_BOOLEAN *pcbhlc_rc_dup_log_to_stderr; -CFT_STRING *pcbhlc_rc_cli_prompt; -CFT_STRING *pcbhlc_rc_cli_backend; -CFT_BOOLEAN *pcbhlc_rc_export_basename; -CFT_STRING *pcbhlc_rc_path_exec_prefix; -CFT_STRING *pcbhlc_rc_path_home; -CFT_STRING *pcbhlc_rc_menu_file; - -CFT_BOOLEAN *pcbhlc_appearance_loglevels_debug_popup; -CFT_BOOLEAN *pcbhlc_appearance_loglevels_info_popup; -CFT_BOOLEAN *pcbhlc_appearance_loglevels_warning_popup; -CFT_BOOLEAN *pcbhlc_appearance_loglevels_error_popup; -CFT_STRING *pcbhlc_appearance_loglevels_debug_tag; -CFT_STRING *pcbhlc_appearance_loglevels_info_tag; -CFT_STRING *pcbhlc_appearance_loglevels_warning_tag; -CFT_STRING *pcbhlc_appearance_loglevels_error_tag; -CFT_COLOR *pcbhlc_appearance_color_background; -CFT_COLOR *pcbhlc_appearance_color_grid; -CFT_COLOR *pcbhlc_appearance_color_off_limit; -CFT_COLOR *pcbhlc_appearance_color_cross; -CFT_REAL *pcbhlc_appearance_layer_alpha; -CFT_REAL *pcbhlc_appearance_drill_alpha; - - -CFT_UNIT *pcbhlc_editor_grid_unit; -CFT_BOOLEAN *pcbhlc_editor_view_flip_x; -CFT_BOOLEAN *pcbhlc_editor_view_flip_y; -CFT_BOOLEAN *pcbhlc_editor_fullscreen; -CFT_BOOLEAN *pcbhlc_editor_auto_place; -CFT_BOOLEAN *pcbhlc_editor_draw_grid; - -static union { - CFT_INTEGER i; - CFT_BOOLEAN b; - CFT_STRING s; - CFT_UNIT c; - CFT_COLOR clr; - CFT_REAL r; -} pcb_hidlib_zero; /* implicit initialized to 0 */ - - -#define SCALAR(name, sname, type, typef) \ -do { \ - int r; \ - pcb_conf_resolve_t rsv = {sname, type, 0, NULL}; \ - r = pcb_conf_resolve(&rsv); \ - cnt += r; \ - if (r <= 0) { \ - pcbhlc_ ## name = (void *)&pcb_hidlib_zero; \ - pcb_message(PCB_MSG_ERROR, "hidlib: pcb_hidlib_conf_init(): filed to resolve hidlib conf path %s\n", sname); \ - } \ - else \ - pcbhlc_ ## name = rsv.nat->val.typef; \ -} while(0) - int pcb_hidlib_conf_init() { int cnt = 0; @@ -98,36 +42,5 @@ conf_reg_field(pcbhl_conf, field,isarray,type_name,cpath,cname,desc,flags); #include "hidlib_conf_fields.h" - SCALAR(rc_dup_log_to_stderr, "rc/dup_log_to_stderr", CFN_BOOLEAN, boolean); - - SCALAR(rc_cli_prompt, "rc/cli_prompt", CFN_STRING, string); - SCALAR(rc_cli_backend, "rc/cli_backend", CFN_STRING, string); - SCALAR(rc_export_basename, "rc/export_basename", CFN_BOOLEAN, boolean); - SCALAR(rc_path_exec_prefix, "rc/path/exec_prefix", CFN_STRING, string); - SCALAR(rc_path_home, "rc/path/home", CFN_STRING, string); - SCALAR(rc_menu_file, "rc/menu_file", CFN_STRING, string); - - SCALAR(appearance_loglevels_debug_popup, "appearance/loglevels/debug_popup", CFN_BOOLEAN, boolean); - SCALAR(appearance_loglevels_info_popup, "appearance/loglevels/info_popup", CFN_BOOLEAN, boolean); - SCALAR(appearance_loglevels_warning_popup, "appearance/loglevels/warning_popup", CFN_BOOLEAN, boolean); - SCALAR(appearance_loglevels_error_popup, "appearance/loglevels/error_popup", CFN_BOOLEAN, boolean); - SCALAR(appearance_loglevels_debug_tag, "appearance/loglevels/debug_tag", CFN_STRING, string); - SCALAR(appearance_loglevels_info_tag, "appearance/loglevels/info_tag", CFN_STRING, string); - SCALAR(appearance_loglevels_warning_tag, "appearance/loglevels/warning_tag", CFN_STRING, string); - SCALAR(appearance_loglevels_error_tag, "appearance/loglevels/error_tag", CFN_STRING, string); - SCALAR(appearance_color_background, "appearance/color/background", CFN_COLOR, color); - SCALAR(appearance_color_grid, "appearance/color/grid", CFN_COLOR, color); - SCALAR(appearance_color_off_limit, "appearance/color/off_limit", CFN_COLOR, color); - SCALAR(appearance_color_cross, "appearance/color/cross", CFN_COLOR, color); - SCALAR(appearance_layer_alpha, "appearance/layer_alpha", CFN_COLOR, color); - SCALAR(appearance_drill_alpha, "appearance/drill_alpha", CFN_COLOR, color); - - SCALAR(editor_grid_unit, "editor/grid_unit", CFN_UNIT, unit); - SCALAR(editor_view_flip_x, "editor/view/flip_x", CFN_BOOLEAN, boolean); - SCALAR(editor_view_flip_y, "editor/view/flip_y", CFN_BOOLEAN, boolean); - SCALAR(editor_fullscreen, "editor/fullscreen", CFN_BOOLEAN, boolean); - SCALAR(editor_auto_place, "editor/auto_place", CFN_BOOLEAN, boolean); - SCALAR(editor_draw_grid, "editor/draw_grid", CFN_BOOLEAN, boolean); - return cnt; } Index: trunk/src/hidlib_conf.h =================================================================== --- trunk/src/hidlib_conf.h (revision 25132) +++ trunk/src/hidlib_conf.h (revision 25133) @@ -28,46 +28,62 @@ #define PCB_HIDLIB_CONF_H #include "conf.h" +#include "color.h" typedef struct { + const struct { /* rc */ CFT_INTEGER verbose; CFT_INTEGER quiet; /* print only errors on stderr */ + CFT_BOOLEAN dup_log_to_stderr; /* copy log messages to stderr even if there is a HID that can show them */ + CFT_STRING cli_prompt; /* plain text prompt to prefix the command entry */ + CFT_STRING cli_backend; /* command parser action */ + CFT_BOOLEAN export_basename; /* if an exported file contains the source file name, remove path from it, keeping the basename only */ + CFT_STRING menu_file; /* where to load the default menu file from. If empty/unset, fall back to the legacy 'per hid ow menu file' setup. If contains slash, take it as a full path, if no slash, do a normal menu search for pcb-menu-NAME.lht */ + const struct { + CFT_STRING home; /* user's home dir, determined run-time */ + CFT_STRING exec_prefix; /* exec prefix path (extracted from argv[0]) */ + } path; } rc; -} pcbhl_conf_t; -extern pcbhl_conf_t pcbhl_conf; + const struct { + CFT_REAL layer_alpha; /* alpha value for layer drawing */ + CFT_REAL drill_alpha; /* alpha value for drill drawing */ -extern CFT_BOOLEAN *pcbhlc_rc_dup_log_to_stderr; -extern CFT_STRING *pcbhlc_rc_cli_prompt; -extern CFT_STRING *pcbhlc_rc_cli_backend; -extern CFT_BOOLEAN *pcbhlc_rc_export_basename; -extern CFT_STRING *pcbhlc_rc_path_exec_prefix; -extern CFT_STRING *pcbhlc_rc_path_home; -extern CFT_STRING *pcbhlc_rc_menu_file; + const struct { + CFT_STRING debug_tag; /* log style tag of debug messages */ + CFT_BOOLEAN debug_popup; /* whether a debug line should pop up the log window */ + CFT_STRING info_tag; /* log style tag of info messages */ + CFT_BOOLEAN info_popup; /* whether an info line should pop up the log window */ + CFT_STRING warning_tag; /* log style tag of warnings */ + CFT_BOOLEAN warning_popup; /* whether a warning should pop up the log window */ + CFT_STRING error_tag; /* log style tag of errors */ + CFT_BOOLEAN error_popup; /* whether an error should pop up the log window */ + } loglevels; + const struct { + CFT_COLOR background; /* background and cursor color ... */ + CFT_COLOR off_limit; /* on-screen background beyond the configured drawing area */ + CFT_COLOR grid; /* on-screen grid */ + CFT_COLOR cross; /* crosshair, drc outline color */ + } color; + } appearance; -extern CFT_BOOLEAN *pcbhlc_appearance_loglevels_debug_popup; -extern CFT_BOOLEAN *pcbhlc_appearance_loglevels_info_popup; -extern CFT_BOOLEAN *pcbhlc_appearance_loglevels_warning_popup; -extern CFT_BOOLEAN *pcbhlc_appearance_loglevels_error_popup; -extern CFT_STRING *pcbhlc_appearance_loglevels_debug_tag; -extern CFT_STRING *pcbhlc_appearance_loglevels_info_tag; -extern CFT_STRING *pcbhlc_appearance_loglevels_warning_tag; -extern CFT_STRING *pcbhlc_appearance_loglevels_error_tag; -extern CFT_COLOR *pcbhlc_appearance_color_background; -extern CFT_COLOR *pcbhlc_appearance_color_grid; -extern CFT_COLOR *pcbhlc_appearance_color_off_limit; -extern CFT_COLOR *pcbhlc_appearance_color_cross; -extern CFT_REAL *pcbhlc_appearance_layer_alpha; -extern CFT_REAL *pcbhlc_appearance_drill_alpha; + const struct { + CFT_UNIT grid_unit; /* select whether you draw in mm or mil */ + CFT_BOOLEAN draw_grid; /* draw grid points */ + CFT_BOOLEAN auto_place; /* force placement of GUI windows (dialogs), trying to override the window manager */ + CFT_BOOLEAN fullscreen; /* hide widgets to make more room for the drawing */ -extern CFT_UNIT *pcbhlc_editor_grid_unit; -extern CFT_BOOLEAN *pcbhlc_editor_view_flip_x; -extern CFT_BOOLEAN *pcbhlc_editor_view_flip_y; -extern CFT_BOOLEAN *pcbhlc_editor_fullscreen; -extern CFT_BOOLEAN *pcbhlc_editor_auto_place; -extern CFT_BOOLEAN *pcbhlc_editor_draw_grid; + const struct { + CFT_BOOLEAN flip_x; /* view: flip the board along the X (horizontal) axis */ + CFT_BOOLEAN flip_y; /* view: flip the board along the Y (vertical) axis */ + } view; + } editor; +} pcbhl_conf_t; + +extern pcbhl_conf_t pcbhl_conf; + int pcb_hidlib_conf_init(); #endif Index: trunk/src/obj_subc.c =================================================================== --- trunk/src/obj_subc.c (revision 25132) +++ trunk/src/obj_subc.c (revision 25133) @@ -56,6 +56,7 @@ #include "math_helper.h" #include "pcb_minuid.h" #include "conf_core.h" +#include "hidlib_conf.h" #define SUBC_AUX_NAME "subc-aux" @@ -1700,7 +1701,7 @@ dx = font->MaxWidth/2; dy = font->MaxHeight/2; - if (conf_core.editor.view.flip_x) { + if (pcbhl_conf.editor.view.flip_x) { x0 = bb->X2; dx = -dx; } @@ -1707,7 +1708,7 @@ else x0 = bb->X1; - if (conf_core.editor.view.flip_y) { + if (pcbhl_conf.editor.view.flip_y) { y0 = bb->Y2; dy = -dy; } Index: trunk/src/object_act.c =================================================================== --- trunk/src/object_act.c (revision 25132) +++ trunk/src/object_act.c (revision 25133) @@ -466,11 +466,11 @@ argc = 4; /* turn of flip to avoid mirror/rotat confusion */ - fx = conf_core.editor.view.flip_x; - fy = conf_core.editor.view.flip_y; + fx = pcbhl_conf.editor.view.flip_x; + fy = pcbhl_conf.editor.view.flip_y; fs = conf_core.editor.show_solder_side; - conf_force_set_bool(conf_core.editor.view.flip_x, 0); - conf_force_set_bool(conf_core.editor.view.flip_y, 0); + conf_force_set_bool(pcbhl_conf.editor.view.flip_x, 0); + conf_force_set_bool(pcbhl_conf.editor.view.flip_y, 0); conf_force_set_bool(conf_core.editor.show_solder_side, 0); #ifdef DEBUG @@ -596,8 +596,8 @@ printf(" ... Leaving pcb_act_ElementList.\n"); #endif - conf_force_set_bool(conf_core.editor.view.flip_x, fx); - conf_force_set_bool(conf_core.editor.view.flip_y, fy); + conf_force_set_bool(pcbhl_conf.editor.view.flip_x, fx); + conf_force_set_bool(pcbhl_conf.editor.view.flip_y, fy); conf_force_set_bool(conf_core.editor.show_solder_side, fs); PCB_ACT_IRES(0); Index: trunk/src/paths.c =================================================================== --- trunk/src/paths.c (revision 25132) +++ trunk/src/paths.c (revision 25133) @@ -133,11 +133,11 @@ template++; if ((*template == '~') && (flags & PCB_SUBST_HOME)) { - if (*pcbhlc_rc_path_home == NULL) { + if (pcbhl_conf.rc.path.home == NULL) { pcb_message(PCB_MSG_ERROR, "pcb_strdup_subst(): can't resolve home dir required for path %s\n", template); goto error; } - gds_append_str(s, *pcbhlc_rc_path_home); + gds_append_str(s, pcbhl_conf.rc.path.home); template++; } Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 25132) +++ trunk/src/plug_io.c (revision 25133) @@ -38,7 +38,9 @@ #define DEFAULT_EMERGENCY_FMT "lihata" #include "config.h" + #include "conf_core.h" +#include "hidlib_conf.h" #include #include @@ -533,7 +535,7 @@ if (new_unit) conf_set(settings_dest, "editor/grid_unit", -1, unit_suffix, POL_OVERWRITE); } - pcb_attrib_put(PCB, "PCB::grid::unit", conf_core.editor.grid_unit->suffix); + pcb_attrib_put(PCB, "PCB::grid::unit", pcbhl_conf.editor.grid_unit->suffix); pcb_ratspatch_make_edited(PCB); Index: trunk/src/route.c =================================================================== --- trunk/src/route.c (revision 25132) +++ trunk/src/route.c (revision 25133) @@ -30,6 +30,7 @@ #include "compat_misc.h" #include "conf_core.h" +#include "hidlib_conf.h" #include "math_helper.h" #include "board.h" #include "data.h" @@ -708,7 +709,7 @@ pcb_coord_t thickness = p_route->thickness + 2 * conf_core.design.bloat; int i; - pcb_gui->set_color(GC, &conf_core.appearance.color.cross); + pcb_gui->set_color(GC, &pcbhl_conf.appearance.color.cross); for(i = 0; i < p_route->size; ++i) { const pcb_route_object_t *p_obj = &p_route->objects[i]; Index: trunk/src/select.c =================================================================== --- trunk/src/select.c (revision 25132) +++ trunk/src/select.c (revision 25133) @@ -31,7 +31,9 @@ */ #include "config.h" + #include "conf_core.h" +#include "hidlib_conf.h" #include "board.h" #include "data.h" @@ -153,9 +155,9 @@ /* If board view is flipped, box coords need to be flipped too to reflect the on-screen direction of draw */ - if (conf_core.editor.view.flip_x) + if (pcbhl_conf.editor.view.flip_x) swap(Box->X1, Box->X2); - if (conf_core.editor.view.flip_y) + if (pcbhl_conf.editor.view.flip_y) swap(Box->Y1, Box->Y2); if ((force_pos) || (conf_core.editor.selection.disable_negative)) { @@ -200,7 +202,7 @@ long int *list = NULL; fix_box_dir(Box, 0); -/*pcb_printf("box: %mm %mm - %mm %mm [ %d ] %d %d\n", Box->X1, Box->Y1, Box->X2, Box->Y2, PCB_IS_BOX_NEGATIVE(Box), conf_core.editor.view.flip_x, conf_core.editor.view.flip_y);*/ +/*pcb_printf("box: %mm %mm - %mm %mm [ %d ] %d %d\n", Box->X1, Box->Y1, Box->X2, Box->Y2, PCB_IS_BOX_NEGATIVE(Box), pcbhl_conf.editor.view.flip_x, pcbhl_conf.editor.view.flip_y);*/ /* append an object to the return list OR set the flag if there's no list */ #define append(undo_type, p1, obj) \ Index: trunk/src/tool_arc.c =================================================================== --- trunk/src/tool_arc.c (revision 25132) +++ trunk/src/tool_arc.c (revision 25133) @@ -33,7 +33,9 @@ */ #include "config.h" + #include "conf_core.h" +#include "hidlib_conf.h" #include "board.h" #include "crosshair.h" @@ -138,7 +140,7 @@ if (pcb_crosshair.AttachedBox.State != PCB_CH_STATE_FIRST) { pcb_xordraw_attached_arc(conf_core.design.line_thickness); if (conf_core.editor.show_drc) { - pcb_gui->set_color(pcb_crosshair.GC, &conf_core.appearance.color.cross); + pcb_gui->set_color(pcb_crosshair.GC, &pcbhl_conf.appearance.color.cross); pcb_xordraw_attached_arc(conf_core.design.line_thickness + 2 * (conf_core.design.bloat + 1)); pcb_gui->set_color(pcb_crosshair.GC, &conf_core.appearance.color.crosshair); } @@ -154,7 +156,7 @@ conf_core.design.line_thickness, 0); if(conf_core.editor.show_drc) { - pcb_gui->set_color(pcb_crosshair.GC, &conf_core.appearance.color.cross); + pcb_gui->set_color(pcb_crosshair.GC, &pcbhl_conf.appearance.color.cross); pcb_draw_wireframe_line(pcb_crosshair.GC, pcb_crosshair.X, pcb_crosshair.Y, pcb_crosshair.X, pcb_crosshair.Y, Index: trunk/src/tool_line.c =================================================================== --- trunk/src/tool_line.c (revision 25132) +++ trunk/src/tool_line.c (revision 25133) @@ -33,7 +33,9 @@ */ #include "config.h" + #include "conf_core.h" +#include "hidlib_conf.h" #include "board.h" #include "crosshair.h" @@ -369,7 +371,7 @@ conf_core.design.line_thickness,0 ); if (conf_core.editor.show_drc) { - pcb_gui->set_color(pcb_crosshair.GC, &conf_core.appearance.color.cross); + pcb_gui->set_color(pcb_crosshair.GC, &pcbhl_conf.appearance.color.cross); pcb_draw_wireframe_line(pcb_crosshair.GC, pcb_crosshair.X, pcb_crosshair.Y, pcb_crosshair.X, pcb_crosshair.Y, Index: trunk/src/tool_via.c =================================================================== --- trunk/src/tool_via.c (revision 25132) +++ trunk/src/tool_via.c (revision 25133) @@ -33,7 +33,9 @@ */ #include "config.h" + #include "conf_core.h" +#include "hidlib_conf.h" #include "board.h" #include "change.h" @@ -95,7 +97,7 @@ xor_draw_fake_via(pcb_crosshair.X, pcb_crosshair.Y, conf_core.design.via_thickness, 0); if (conf_core.editor.show_drc) { /* XXX: Naughty cheat - use the mask to draw DRC clearance! */ - pcb_gui->set_color(pcb_crosshair.GC, &conf_core.appearance.color.cross); + pcb_gui->set_color(pcb_crosshair.GC, &pcbhl_conf.appearance.color.cross); xor_draw_fake_via(pcb_crosshair.X, pcb_crosshair.Y, conf_core.design.via_thickness, conf_core.design.clearance); pcb_gui->set_color(pcb_crosshair.GC, &conf_core.appearance.color.crosshair); } Index: trunk/src_plugins/ddraft/cli.c =================================================================== --- trunk/src_plugins/ddraft/cli.c (revision 25132) +++ trunk/src_plugins/ddraft/cli.c (revision 25133) @@ -29,6 +29,7 @@ #include "hid_inlines.h" #include "compat_misc.h" #include "conf_core.h" +#include "hidlib_conf.h" #define CLI_MAX_INS_LEN 128 @@ -201,7 +202,7 @@ } memcpy(tmp, s, sep-s); tmp[sep-s] = '\0'; - dst[i-1].x = pcb_get_value_ex(tmp, NULL, NULL, NULL, conf_core.editor.grid_unit->suffix, &succ); + dst[i-1].x = pcb_get_value_ex(tmp, NULL, NULL, NULL, pcbhl_conf.editor.grid_unit->suffix, &succ); if (!succ) dst[i-1].invalid = 1; @@ -212,12 +213,12 @@ } memcpy(tmp, sep, next-sep); tmp[next-sep] = '\0'; - dst[i-1].y = pcb_get_value_ex(tmp, NULL, NULL, NULL, conf_core.editor.grid_unit->suffix, &succ); + dst[i-1].y = pcb_get_value_ex(tmp, NULL, NULL, NULL, pcbhl_conf.editor.grid_unit->suffix, &succ); if (!succ) dst[i-1].invalid = 1; break; case CLI_DIST: - dst[i-1].dist = pcb_get_value_ex(s, NULL, NULL, NULL, conf_core.editor.grid_unit->suffix, &succ); + dst[i-1].dist = pcb_get_value_ex(s, NULL, NULL, NULL, pcbhl_conf.editor.grid_unit->suffix, &succ); dst[i-1].invalid = !succ; dst[i-1].end = next - line; break; Index: trunk/src_plugins/dialogs/dlg_pref_win.c =================================================================== --- trunk/src_plugins/dialogs/dlg_pref_win.c (revision 25132) +++ trunk/src_plugins/dialogs/dlg_pref_win.c (revision 25133) @@ -29,6 +29,7 @@ #include "dlg_pref.h" #include "conf.h" #include "conf_core.h" +#include "hidlib_conf.h" #include "../src_plugins/lib_hid_common/dialogs_conf.h" extern const conf_dialogs_t dialogs_conf; @@ -37,7 +38,7 @@ static void pref_win_brd2dlg(pref_ctx_t *ctx) { - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wmaster, int_value, conf_core.editor.auto_place); + PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wmaster, int_value, pcbhl_conf.editor.auto_place); PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wboard, int_value, dialogs_conf.plugins.dialogs.auto_save_window_geometry.to_design); PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wproject, int_value, dialogs_conf.plugins.dialogs.auto_save_window_geometry.to_project); PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->win.wuser, int_value, dialogs_conf.plugins.dialogs.auto_save_window_geometry.to_user); Index: trunk/src_plugins/dialogs/dlg_view.c =================================================================== --- trunk/src_plugins/dialogs/dlg_view.c (revision 25132) +++ trunk/src_plugins/dialogs/dlg_view.c (revision 25133) @@ -33,6 +33,7 @@ #include "actions.h" #include "board.h" #include "conf_core.h" +#include "hidlib_conf.h" #include "view.h" #include "draw.h" #include "drc.h" @@ -173,9 +174,9 @@ break; case PCB_VIEW_DRC: if (v->data.drc.have_measured) - PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wmeasure, str_value, pcb_strdup_printf("DRC: %m+required: %$ms\nmeasured: %$ms\n", conf_core.editor.grid_unit->allow, v->data.drc.required_value, v->data.drc.measured_value)); + PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wmeasure, str_value, 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_value, pcb_strdup_printf("DRC: %m+required: %$ms\n", conf_core.editor.grid_unit->allow, v->data.drc.required_value)); + PCB_DAD_SET_VALUE(ctx->dlg_hid_ctx, ctx->wmeasure, str_value, pcb_strdup_printf("DRC: %m+required: %$ms\n", pcbhl_conf.editor.grid_unit->allow, v->data.drc.required_value)); break; } } Index: trunk/src_plugins/draw_fab/draw_fab.c =================================================================== --- trunk/src_plugins/draw_fab/draw_fab.c (revision 25132) +++ trunk/src_plugins/draw_fab/draw_fab.c (revision 25133) @@ -41,6 +41,7 @@ #include "stub_draw.h" #include "draw_fab_conf.h" #include "conf_core.h" +#include "hidlib_conf.h" #include "macro.h" #include "obj_pstk_inlines.h" #include "hid_inlines.h" @@ -207,7 +208,7 @@ char utcTime[64]; AllDrills = drill_get_info(PCB->Data); - if (conf_core.editor.grid_unit->family == PCB_UNIT_IMPERIAL) + if (pcbhl_conf.editor.grid_unit->family == PCB_UNIT_IMPERIAL) drill_round_info(AllDrills, PCB_MIL_TO_COORD(1)); else drill_round_info(AllDrills, PCB_MM_TO_COORD(0.01)); @@ -262,12 +263,12 @@ text_at(info, gc, PCB_MIL_TO_COORD(980), yoff, PCB_MIL_TO_COORD(2), "%d", drill->UnplatedCount); } pcb_gui->set_color(gc, &conf_core.appearance.color.element); - if (conf_core.editor.grid_unit->family == PCB_UNIT_IMPERIAL) + if (pcbhl_conf.editor.grid_unit->family == PCB_UNIT_IMPERIAL) text_at(info, gc, PCB_MIL_TO_COORD(450), yoff, PCB_MIL_TO_COORD(2), "%0.3f", PCB_COORD_TO_INCH(drill->DrillSize)); else text_at(info, gc, PCB_MIL_TO_COORD(450), yoff, PCB_MIL_TO_COORD(2), "%1.2f", PCB_COORD_TO_MM(drill->DrillSize)); if (plated_sym != -1 && unplated_sym != -1) { - if (conf_core.editor.grid_unit->family == PCB_UNIT_IMPERIAL) + if (pcbhl_conf.editor.grid_unit->family == PCB_UNIT_IMPERIAL) text_at(info, gc, PCB_MIL_TO_COORD(450), yoff + TEXT_LINE, PCB_MIL_TO_COORD(2), "%0.3f", PCB_COORD_TO_INCH(drill->DrillSize)); else text_at(info, gc, PCB_MIL_TO_COORD(450), yoff + TEXT_LINE, PCB_MIL_TO_COORD(2), "%1.2f", PCB_COORD_TO_MM(drill->DrillSize)); @@ -279,7 +280,7 @@ pcb_gui->set_color(gc, &conf_core.appearance.color.element); text_at(info, gc, 0, yoff, PCB_MIL_TO_COORD(9), "Symbol"); - if (conf_core.editor.grid_unit->family == PCB_UNIT_IMPERIAL) + if (pcbhl_conf.editor.grid_unit->family == PCB_UNIT_IMPERIAL) text_at(info, gc, PCB_MIL_TO_COORD(410), yoff, PCB_MIL_TO_COORD(9), "Diam. (Inch)"); else text_at(info, gc, PCB_MIL_TO_COORD(410), yoff, PCB_MIL_TO_COORD(9), "Diam. (mm)"); Index: trunk/src_plugins/export_gcode/gcode.c =================================================================== --- trunk/src_plugins/export_gcode/gcode.c (revision 25132) +++ trunk/src_plugins/export_gcode/gcode.c (revision 25133) @@ -39,6 +39,7 @@ #include "config.h" #include "conf_core.h" +#include "hidlib_conf.h" #include "plugins.h" #include @@ -239,8 +240,8 @@ static int last_unit_value = -1; if (gcode_attribute_list[HA_unit].default_val.int_value == last_unit_value) { - if (conf_core.editor.grid_unit) - gcode_attribute_list[HA_unit].default_val.int_value = conf_core.editor.grid_unit->index; + if (pcbhl_conf.editor.grid_unit) + gcode_attribute_list[HA_unit].default_val.int_value = pcbhl_conf.editor.grid_unit->index; else gcode_attribute_list[HA_unit].default_val.int_value = get_unit_struct("mil")->index; last_unit_value = gcode_attribute_list[HA_unit].default_val.int_value; Index: trunk/src_plugins/export_ipcd356/ipcd356.c =================================================================== --- trunk/src_plugins/export_ipcd356/ipcd356.c (revision 25132) +++ trunk/src_plugins/export_ipcd356/ipcd356.c (revision 25133) @@ -34,6 +34,7 @@ #include "data.h" #include "safe_fs.h" #include "conf_core.h" +#include "hidlib_conf.h" #include "compat_misc.h" #include "netlist2.h" #include "math_helper.h" @@ -372,7 +373,7 @@ ctx.pcb = pcb; ctx.f = f; - ctx.is_mil = (strcmp(conf_core.editor.grid_unit->suffix, "mil") == 0); + ctx.is_mil = (strcmp(pcbhl_conf.editor.grid_unit->suffix, "mil") == 0); ipcd356_write_head(&ctx); PCB_SUBC_LOOP(pcb->Data); { Index: trunk/src_plugins/export_xy/xy.c =================================================================== --- trunk/src_plugins/export_xy/xy.c (revision 25132) +++ trunk/src_plugins/export_xy/xy.c (revision 25133) @@ -1,5 +1,6 @@ #include "config.h" #include "conf_core.h" +#include "hidlib_conf.h" #include #include @@ -137,8 +138,8 @@ /* set default unit and filename */ if (xy_options[HA_unit].default_val.int_value == last_unit_value) { - if (conf_core.editor.grid_unit) - xy_options[HA_unit].default_val.int_value = conf_core.editor.grid_unit->index; + if (pcbhl_conf.editor.grid_unit) + xy_options[HA_unit].default_val.int_value = pcbhl_conf.editor.grid_unit->index; else xy_options[HA_unit].default_val.int_value = get_unit_struct("mil")->index; last_unit_value = xy_options[HA_unit].default_val.int_value; Index: trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c =================================================================== --- trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 25132) +++ trunk/src_plugins/hid_gtk2_gdk/gtkhid-gdk.c (revision 25133) @@ -162,7 +162,7 @@ rv = g_new0(hid_gc_s, 1); rv->me_pointer = >k2_gdk_hid; - rv->pcolor = (*pcbhlc_appearance_color_background); + rv->pcolor = pcbhl_conf.appearance.color.background; return rv; } @@ -305,7 +305,7 @@ if (!conf_hid_gtk.plugins.hid_gtk.local_grid.enable) return; - if ((Vz(PCB->hidlib.grid) < PCB_MIN_GRID_DISTANCE) || (!*pcbhlc_editor_draw_grid)) + if ((Vz(PCB->hidlib.grid) < PCB_MIN_GRID_DISTANCE) || (!pcbhl_conf.editor.draw_grid)) return; /* cx and cy are the actual cursor snapped to wherever - round them to the nearest real grid point */ @@ -326,13 +326,13 @@ grid_local_have_old = 0; - if (!*pcbhlc_editor_draw_grid) + if (!pcbhl_conf.editor.draw_grid) return; if (colormap == NULL) colormap = gtk_widget_get_colormap(gport->top_window); if (!priv->grid_gc) { - if (gdk_color_parse((*pcbhlc_appearance_color_grid).str, &priv->grid_color)) { + if (gdk_color_parse(pcbhl_conf.appearance.color.grid.str, &priv->grid_color)) { priv->grid_color.red ^= priv->bg_color.red; priv->grid_color.green ^= priv->bg_color.green; priv->grid_color.blue ^= priv->bg_color.blue; @@ -494,7 +494,7 @@ render_priv_t *priv = gport->render_priv; /* The color grid is combined with background color */ - map_color_string((*pcbhlc_appearance_color_grid).str, &priv->grid_color); + map_color_string(pcbhl_conf.appearance.color.grid.str, &priv->grid_color); priv->grid_color.red = (priv->grid_color.red ^ priv->bg_color.red) & 0xFF; priv->grid_color.green = (priv->grid_color.green ^ priv->bg_color.green) & 0xFF; priv->grid_color.blue = (priv->grid_color.blue ^ priv->bg_color.blue) & 0xFF; @@ -507,17 +507,17 @@ { render_priv_t *priv = gport->render_priv; - if (((CFT_COLOR *)cfg->val.color == &(*pcbhlc_appearance_color_background)) && priv->bg_gc) { + if (((CFT_COLOR *)cfg->val.color == &pcbhl_conf.appearance.color.background) && priv->bg_gc) { if (map_color_string(cfg->val.color[0].str, &priv->bg_color)) { gdk_gc_set_foreground(priv->bg_gc, &priv->bg_color); set_special_grid_color(); } } - else if (((CFT_COLOR *)cfg->val.color == &(*pcbhlc_appearance_color_off_limit)) && priv->offlimits_gc) { + else if (((CFT_COLOR *)cfg->val.color == &pcbhl_conf.appearance.color.off_limit) && priv->offlimits_gc) { if (map_color_string(cfg->val.color[0].str, &priv->offlimits_color)) gdk_gc_set_foreground(priv->offlimits_gc, &priv->offlimits_color); } - else if (((CFT_COLOR *)cfg->val.color == &(*pcbhlc_appearance_color_grid)) && priv->grid_gc) { + else if (((CFT_COLOR *)cfg->val.color == &pcbhl_conf.appearance.color.grid) && priv->grid_gc) { if (map_color_string(cfg->val.color[0].str, &priv->grid_color)) set_special_grid_color(); } @@ -745,11 +745,11 @@ delta_angle = 360; } - if (*pcbhlc_editor_view_flip_x) { + if (pcbhl_conf.editor.view.flip_x) { start_angle = 180 - start_angle; delta_angle = -delta_angle; } - if (*pcbhlc_editor_view_flip_y) { + if (pcbhl_conf.editor.view.flip_y) { start_angle = -start_angle; delta_angle = -delta_angle; } @@ -1375,7 +1375,7 @@ gdk_gc_set_clip_origin(xor_gc, 0, 0); set_clip(priv, xor_gc); /* FIXME: when CrossColor changed from config */ - map_color_string((*pcbhlc_appearance_color_cross).str, &cross_color); + map_color_string(pcbhl_conf.appearance.color.cross.str, &cross_color); } x = Vx(gport->view.crosshair_x); y = Vy(gport->view.crosshair_y); @@ -1428,13 +1428,13 @@ if (!done_once) { priv->bg_gc = gdk_gc_new(priv->out_pixel); - if (!map_color_string((*pcbhlc_appearance_color_background).str, &priv->bg_color)) + if (!map_color_string(pcbhl_conf.appearance.color.background.str, &priv->bg_color)) map_color_string("white", &priv->bg_color); gdk_gc_set_foreground(priv->bg_gc, &priv->bg_color); gdk_gc_set_clip_origin(priv->bg_gc, 0, 0); priv->offlimits_gc = gdk_gc_new(priv->out_pixel); - if (!map_color_string((*pcbhlc_appearance_color_off_limit).str, &priv->offlimits_color)) + if (!map_color_string(pcbhl_conf.appearance.color.off_limit.str, &priv->offlimits_color)) map_color_string("white", &priv->offlimits_color); gdk_gc_set_foreground(priv->offlimits_gc, &priv->offlimits_color); gdk_gc_set_clip_origin(priv->offlimits_gc, 0, 0); Index: trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c =================================================================== --- trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 25132) +++ trunk/src_plugins/hid_gtk2_gl/gtkhid-gl.c (revision 25133) @@ -158,8 +158,8 @@ glLoadIdentity(); glTranslatef(0.0f, 0.0f, -Z_NEAR); - glScalef((*pcbhlc_editor_view_flip_x ? -1. : 1.) / gport->view.coord_per_px, (*pcbhlc_editor_view_flip_y ? -1. : 1.) / gport->view.coord_per_px, ((*pcbhlc_editor_view_flip_x == *pcbhlc_editor_view_flip_y) ? 1. : -1.) / gport->view.coord_per_px); - glTranslatef(*pcbhlc_editor_view_flip_x ? gport->view.x0 - PCB->hidlib.size_x : -gport->view.x0, *pcbhlc_editor_view_flip_y ? gport->view.y0 - PCB->hidlib.size_y : -gport->view.y0, 0); + glScalef((pcbhl_conf.editor.view.flip_x ? -1. : 1.) / gport->view.coord_per_px, (pcbhl_conf.editor.view.flip_y ? -1. : 1.) / gport->view.coord_per_px, ((pcbhl_conf.editor.view.flip_x == pcbhl_conf.editor.view.flip_y) ? 1. : -1.) / gport->view.coord_per_px); + glTranslatef(pcbhl_conf.editor.view.flip_x ? gport->view.x0 - PCB->hidlib.size_x : -gport->view.x0, pcbhl_conf.editor.view.flip_y ? gport->view.y0 - PCB->hidlib.size_y : -gport->view.y0, 0); /* Put the renderer into a good state so that any drawing is done in standard mode */ @@ -255,7 +255,7 @@ { render_priv_t *priv = gport->render_priv; - if ((Vz(PCB->hidlib.grid) < PCB_MIN_GRID_DISTANCE) || (!*pcbhlc_editor_draw_grid)) + if ((Vz(PCB->hidlib.grid) < PCB_MIN_GRID_DISTANCE) || (!pcbhl_conf.editor.draw_grid)) return; glEnable(GL_COLOR_LOGIC_OP); @@ -350,7 +350,7 @@ if (map_color_string(cfg->val.color[0].str, &priv->bg_color)) set_special_grid_color(); } - else if (((CFT_COLOR *) cfg->val.color == &(*pcbhlc_appearance_color_grid))) { + else if (((CFT_COLOR *) cfg->val.color == &pcbhl_conf.appearance.color.grid)) { if (map_color_string(cfg->val.color[0].str, &priv->grid_color)) set_special_grid_color(); } @@ -747,7 +747,7 @@ if (!done_once) { done_once = 1; /* FIXME: when CrossColor changed from config */ - map_color_string((*pcbhlc_appearance_color_cross).str, &cross_color); + map_color_string(pcbhl_conf.appearance.color.cross.str, &cross_color); } x = gport->view.crosshair_x; y = gport->view.crosshair_y; @@ -814,13 +814,13 @@ gport->drawing_allowed = pcb_true; if (!done_once) { - if (!map_color_string((*pcbhlc_appearance_color_background).str, &priv->bg_color)) + if (!map_color_string(pcbhl_conf.appearance.color.background.str, &priv->bg_color)) map_color_string("white", &priv->bg_color); - if (!map_color_string((*pcbhlc_appearance_color_off_limit).str, &priv->offlimits_color)) + if (!map_color_string(pcbhl_conf.appearance.color.off_limit.str, &priv->offlimits_color)) map_color_string("white", &priv->offlimits_color); - if (!map_color_string((*pcbhlc_appearance_color_grid).str, &priv->grid_color)) + if (!map_color_string(pcbhl_conf.appearance.color.grid.str, &priv->grid_color)) map_color_string("blue", &priv->grid_color); set_special_grid_color(); @@ -940,8 +940,8 @@ pcb_gl_draw_expose_init(>k2_gl_hid, allocation.width, allocation.height, ev->area.x, allocation.height - ev->area.height - ev->area.y, ev->area.width, ev->area.height, &off_c); - glScalef((*pcbhlc_editor_view_flip_x ? -1. : 1.) / port->view.coord_per_px, (*pcbhlc_editor_view_flip_y ? -1. : 1.) / port->view.coord_per_px, ((*pcbhlc_editor_view_flip_x == *pcbhlc_editor_view_flip_y) ? 1. : -1.) / port->view.coord_per_px); - glTranslatef(*pcbhlc_editor_view_flip_x ? port->view.x0 - PCB->hidlib.size_x : -port->view.x0, *pcbhlc_editor_view_flip_y ? port->view.y0 - PCB->hidlib.size_y : -port->view.y0, 0); + glScalef((pcbhl_conf.editor.view.flip_x ? -1. : 1.) / port->view.coord_per_px, (pcbhl_conf.editor.view.flip_y ? -1. : 1.) / port->view.coord_per_px, ((pcbhl_conf.editor.view.flip_x == pcbhl_conf.editor.view.flip_y) ? 1. : -1.) / port->view.coord_per_px); + glTranslatef(pcbhl_conf.editor.view.flip_x ? port->view.x0 - PCB->hidlib.size_x : -port->view.x0, pcbhl_conf.editor.view.flip_y ? port->view.y0 - PCB->hidlib.size_y : -port->view.y0, 0); /* Draw PCB background, before PCB primitives */ glColor3f(bg_c.red, bg_c.green, bg_c.blue); @@ -1086,8 +1086,8 @@ /* call the drawing routine */ ghid_gl_invalidate_current_gc(); glPushMatrix(); - glScalef((*pcbhlc_editor_view_flip_x ? -1. : 1.) / gport->view.coord_per_px, (*pcbhlc_editor_view_flip_y ? -1. : 1.) / gport->view.coord_per_px, 1); - glTranslatef(*pcbhlc_editor_view_flip_x ? gport->view.x0 - PCB->hidlib.size_x : -gport->view.x0, *pcbhlc_editor_view_flip_y ? gport->view.y0 - PCB->hidlib.size_y : -gport->view.y0, 0); + glScalef((pcbhl_conf.editor.view.flip_x ? -1. : 1.) / gport->view.coord_per_px, (pcbhl_conf.editor.view.flip_y ? -1. : 1.) / gport->view.coord_per_px, 1); + glTranslatef(pcbhl_conf.editor.view.flip_x ? gport->view.x0 - PCB->hidlib.size_x : -gport->view.x0, pcbhl_conf.editor.view.flip_y ? gport->view.y0 - PCB->hidlib.size_y : -gport->view.y0, 0); expcall(>k2_gl_hid, ctx); Index: trunk/src_plugins/hid_lesstif/dialogs.c =================================================================== --- trunk/src_plugins/hid_lesstif/dialogs.c (revision 25132) +++ trunk/src_plugins/hid_lesstif/dialogs.c (revision 25133) @@ -2,6 +2,7 @@ #include "config.h" #include "conf_core.h" +#include "hidlib_conf.h" #include #include @@ -45,7 +46,7 @@ pcb_event(PCB_EVENT_DAD_NEW_DIALOG, "psp", NULL, id, plc); - if (conf_core.editor.auto_place) { + if (pcbhl_conf.editor.auto_place) { if ((plc[2] > 0) && (plc[3] > 0) && (plc[0] >= 0) && (plc[1] >= 0)) { XMoveResizeWindow(dsp, w, plc[0], plc[1], plc[2], plc[3]); } Index: trunk/src_plugins/hid_lesstif/main.c =================================================================== --- trunk/src_plugins/hid_lesstif/main.c (revision 25132) +++ trunk/src_plugins/hid_lesstif/main.c (revision 25133) @@ -3,6 +3,7 @@ #include "config.h" #include "math_helper.h" #include "conf_core.h" +#include "hidlib_conf.h" #include #include @@ -67,7 +68,7 @@ /* How big the viewport can be relative to the pcb size. */ #define MAX_ZOOM_SCALE 10 -#define UUNIT conf_core.editor.grid_unit->allow +#define UUNIT pcbhl_conf.editor.grid_unit->allow typedef struct hid_gc_s { pcb_core_gc_t core_gc; @@ -232,7 +233,7 @@ static inline int Vx(pcb_coord_t x) { int rv = (x - view_left_x) / view_zoom + 0.5; - if (conf_core.editor.view.flip_x) + if (pcbhl_conf.editor.view.flip_x) rv = view_width - rv; return rv; } @@ -240,7 +241,7 @@ static inline int Vy(pcb_coord_t y) { int rv = (y - view_top_y) / view_zoom + 0.5; - if (conf_core.editor.view.flip_y) + if (pcbhl_conf.editor.view.flip_y) rv = view_height - rv; return rv; } @@ -257,7 +258,7 @@ static inline pcb_coord_t Px(int x) { - if (conf_core.editor.view.flip_x) + if (pcbhl_conf.editor.view.flip_x) x = view_width - x; return x * view_zoom + view_left_x; } @@ -264,7 +265,7 @@ static inline pcb_coord_t Py(int y) { - if (conf_core.editor.view.flip_y) + if (pcbhl_conf.editor.view.flip_y) y = view_height - y; return y * view_zoom + view_top_y; } @@ -781,9 +782,9 @@ xfrac = (double) x / (double) view_width; yfrac = (double) y / (double) view_height; - if (conf_core.editor.view.flip_x) + if (pcbhl_conf.editor.view.flip_x) xfrac = 1 - xfrac; - if (conf_core.editor.view.flip_y) + if (pcbhl_conf.editor.view.flip_y) yfrac = 1 - yfrac; max_zoom = PCB->hidlib.size_x / view_width; @@ -853,9 +854,9 @@ if (pan_thumb_mode) { opx = x * PCB->hidlib.size_x / view_width; opy = y * PCB->hidlib.size_y / view_height; - if (conf_core.editor.view.flip_x) + if (pcbhl_conf.editor.view.flip_x) opx = PCB->hidlib.size_x - opx; - if (conf_core.editor.view.flip_y) + if (pcbhl_conf.editor.view.flip_y) opy = PCB->hidlib.size_y - opy; view_left_x = opx - view_width / 2 * view_zoom; view_top_y = opy - view_height / 2 * view_zoom; @@ -875,11 +876,11 @@ /* continued drag, we calculate how far we've moved the cursor and set the position accordingly. */ else { - if (conf_core.editor.view.flip_x) + if (pcbhl_conf.editor.view.flip_x) view_left_x = opx + (x - ox) * view_zoom; else view_left_x = opx - (x - ox) * view_zoom; - if (conf_core.editor.view.flip_y) + if (pcbhl_conf.editor.view.flip_y) view_top_y = opy + (y - oy) * view_zoom; else view_top_y = opy - (y - oy) * view_zoom; @@ -1241,8 +1242,8 @@ view_width = width; view_height = height; - offlimit_color = lesstif_parse_color(&conf_core.appearance.color.off_limit); - grid_color = lesstif_parse_color(&conf_core.appearance.color.grid); + offlimit_color = lesstif_parse_color(&pcbhl_conf.appearance.color.off_limit); + grid_color = lesstif_parse_color(&pcbhl_conf.appearance.color.grid); bg_gc = XCreateGC(display, window, 0, 0); XSetForeground(display, bg_gc, bgcolor); @@ -1251,7 +1252,7 @@ #ifdef HAVE_XRENDER if (use_xrender) { - double l_alpha = conf_core.appearance.layer_alpha; + double l_alpha = pcbhl_conf.appearance.layer_alpha; XRenderPictureAttributes pa; XRenderColor a = { 0, 0, 0, 0x8000}; @@ -1398,7 +1399,7 @@ XtManageChild(work_area_frame); stdarg_n = 0; - stdarg_do_color(&conf_core.appearance.color.background, XmNbackground); + stdarg_do_color(&pcbhl_conf.appearance.color.background, XmNbackground); work_area = XmCreateDrawingArea(work_area_frame, XmStrCast("work_area"), stdarg_args, stdarg_n); XtManageChild(work_area); XtAddCallback(work_area, XmNexposeCallback, (XtCallbackProc) work_area_first_expose, 0); @@ -1838,7 +1839,7 @@ int n; static GC grid_gc = 0; - if (!conf_core.editor.draw_grid) + if (!pcbhl_conf.editor.draw_grid) return; if (Vz(PCB->hidlib.grid) < PCB_MIN_GRID_DISTANCE) return; @@ -1847,7 +1848,7 @@ XSetFunction(display, grid_gc, GXxor); XSetForeground(display, grid_gc, grid_color); } - if (conf_core.editor.view.flip_x) { + if (pcbhl_conf.editor.view.flip_x) { x2 = pcb_grid_fit(Px(0), PCB->hidlib.grid, PCB->hidlib.grid_ox); x1 = pcb_grid_fit(Px(view_width), PCB->hidlib.grid, PCB->hidlib.grid_ox); if (Vx(x2) < 0) @@ -1863,7 +1864,7 @@ if (Vx(x2) >= view_width) x2 -= PCB->hidlib.grid; } - if (conf_core.editor.view.flip_y) { + if (pcbhl_conf.editor.view.flip_y) { y2 = pcb_grid_fit(Py(0), PCB->hidlib.grid, PCB->hidlib.grid_oy); y1 = pcb_grid_fit(Py(view_height), PCB->hidlib.grid, PCB->hidlib.grid_oy); if (Vy(y2) < 0) @@ -1906,7 +1907,7 @@ static void mark_delta_to_widget(pcb_coord_t dx, pcb_coord_t dy, Widget w) { char *buf; - double g = pcb_coord_to_unit(conf_core.editor.grid_unit, PCB->hidlib.grid); + double g = pcb_coord_to_unit(pcbhl_conf.editor.grid_unit, PCB->hidlib.grid); int prec; XmString ms; @@ -1914,7 +1915,7 @@ if (((int) (g * 10000 + 0.5) % 10000) == 0) prec = 0; else - prec = conf_core.editor.grid_unit->default_prec; + prec = pcbhl_conf.editor.grid_unit->default_prec; if (dx == 0 && dy == 0) buf = pcb_strdup_printf("%m+%+.*mS, %+.*mS", UUNIT, prec, dx, prec, dy); @@ -1937,7 +1938,7 @@ int this_state = prev_state; char *buf = NULL; const char *msg = ""; - double g = pcb_coord_to_unit(conf_core.editor.grid_unit, PCB->hidlib.grid); + double g = pcb_coord_to_unit(pcbhl_conf.editor.grid_unit, PCB->hidlib.grid); XmString ms; int prec; @@ -1945,11 +1946,11 @@ * on the user's grid setting */ if (((int) (g * 10000 + 0.5) % 10000) == 0) { prec = 0; - this_state = conf_core.editor.grid_unit->allow; + this_state = pcbhl_conf.editor.grid_unit->allow; } else { - prec = conf_core.editor.grid_unit->default_prec; - this_state = -conf_core.editor.grid_unit->allow; + prec = pcbhl_conf.editor.grid_unit->default_prec; + this_state = -pcbhl_conf.editor.grid_unit->allow; } if (x >= 0) { @@ -2029,12 +2030,12 @@ ctx.view.Y1 = Py(0); ctx.view.X2 = Px(view_width); ctx.view.Y2 = Py(view_height); - if (conf_core.editor.view.flip_x) { + if (pcbhl_conf.editor.view.flip_x) { pcb_coord_t tmp = ctx.view.X1; ctx.view.X1 = ctx.view.X2; ctx.view.X2 = tmp; } - if (conf_core.editor.view.flip_y) { + if (pcbhl_conf.editor.view.flip_y) { pcb_coord_t tmp = ctx.view.Y1; ctx.view.Y1 = ctx.view.Y2; ctx.view.Y2 = tmp; @@ -2108,7 +2109,7 @@ static pcb_mark_t saved_mark; static const pcb_unit_t *old_grid_unit = NULL; if (crosshair_x != c_x || crosshair_y != c_y - || conf_core.editor.grid_unit != old_grid_unit || memcmp(&saved_mark, &pcb_marked, sizeof(pcb_mark_t))) { + || pcbhl_conf.editor.grid_unit != old_grid_unit || memcmp(&saved_mark, &pcb_marked, sizeof(pcb_mark_t))) { static int last_state = 0; static int this_state = 0; @@ -2138,8 +2139,8 @@ } memcpy(&saved_mark, &pcb_marked, sizeof(pcb_mark_t)); - if (old_grid_unit != conf_core.editor.grid_unit) { - old_grid_unit = conf_core.editor.grid_unit; + if (old_grid_unit != pcbhl_conf.editor.grid_unit) { + old_grid_unit = pcbhl_conf.editor.grid_unit; /* Force a resize on units change. */ last_state++; } @@ -2177,10 +2178,10 @@ static pcb_coord_t old_gx, old_gy; static const pcb_unit_t *old_unit; XmString ms; - if (PCB->hidlib.grid != old_grid || PCB->hidlib.grid_ox != old_gx || PCB->hidlib.grid_oy != old_gy || conf_core.editor.grid_unit != old_unit) { + if (PCB->hidlib.grid != old_grid || PCB->hidlib.grid_ox != old_gx || PCB->hidlib.grid_oy != old_gy || pcbhl_conf.editor.grid_unit != old_unit) { static char buf[100]; old_grid = PCB->hidlib.grid; - old_unit = conf_core.editor.grid_unit; + old_unit = pcbhl_conf.editor.grid_unit; old_gx = PCB->hidlib.grid_ox; old_gy = PCB->hidlib.grid_oy; if (old_grid == 1) { @@ -2202,13 +2203,13 @@ { static double old_zoom = -1; static const pcb_unit_t *old_grid_unit = NULL; - if (view_zoom != old_zoom || conf_core.editor.grid_unit != old_grid_unit) { + if (view_zoom != old_zoom || pcbhl_conf.editor.grid_unit != old_grid_unit) { char *buf = pcb_strdup_printf("%m+%$mS/pix", - conf_core.editor.grid_unit->allow, (pcb_coord_t) view_zoom); + pcbhl_conf.editor.grid_unit->allow, (pcb_coord_t) view_zoom); XmString ms; old_zoom = view_zoom; - old_grid_unit = conf_core.editor.grid_unit; + old_grid_unit = pcbhl_conf.editor.grid_unit; ms = XmStringCreatePCB(buf); stdarg_n = 0; @@ -2776,11 +2777,11 @@ delta_angle = 360; } - if (conf_core.editor.view.flip_x) { + if (pcbhl_conf.editor.view.flip_x) { start_angle = 180 - start_angle; delta_angle = -delta_angle; } - if (conf_core.editor.view.flip_y) { + if (pcbhl_conf.editor.view.flip_y) { start_angle = -start_angle; delta_angle = -delta_angle; } @@ -2999,11 +3000,11 @@ unsigned int keys_buttons; int pos_x, pos_y, root_x, root_y; XQueryPointer(display, window, &root, &child, &root_x, &root_y, &pos_x, &pos_y, &keys_buttons); - if (conf_core.editor.view.flip_x) + if (pcbhl_conf.editor.view.flip_x) view_left_x = x - (view_width - pos_x) * view_zoom; else view_left_x = x - pos_x * view_zoom; - if (conf_core.editor.view.flip_y) + if (pcbhl_conf.editor.view.flip_y) view_top_y = y - (view_height - pos_y) * view_zoom; else view_top_y = y - pos_y * view_zoom; Index: trunk/src_plugins/hid_lesstif/wt_preview.c =================================================================== --- trunk/src_plugins/hid_lesstif/wt_preview.c (revision 25132) +++ trunk/src_plugins/hid_lesstif/wt_preview.c (revision 25133) @@ -71,11 +71,11 @@ { pcb_coord_t x, y; - if (conf_core.editor.view.flip_x) + if (pcbhl_conf.editor.view.flip_x) px = pd->v_width - px; x = pcb_round((double)px * pd->zoom + (double)pd->x1); - if (conf_core.editor.view.flip_y) + if (pcbhl_conf.editor.view.flip_y) py = pd->v_height - py; y = pcb_round((double)py * pd->zoom + (double)pd->y1); @@ -106,8 +106,8 @@ save_vz = view_zoom; save_vw = view_width; save_vh = view_height; - save_fx = conf_core.editor.view.flip_x; - save_fy = conf_core.editor.view.flip_y; + save_fx = pcbhl_conf.editor.view.flip_x; + save_fy = pcbhl_conf.editor.view.flip_y; save_px = main_pixmap; save_main_px = main_pixmap; save_mask_px = mask_pixmap; @@ -121,8 +121,8 @@ view_zoom = pd->zoom; view_width = pd->x2; view_height = pd->y2; - conf_force_set_bool(conf_core.editor.view.flip_x, 0); - conf_force_set_bool(conf_core.editor.view.flip_y, 0); + conf_force_set_bool(pcbhl_conf.editor.view.flip_x, 0); + conf_force_set_bool(pcbhl_conf.editor.view.flip_y, 0); XFillRectangle(display, pixmap, bg_gc, 0, 0, pd->v_width, pd->v_height); @@ -148,8 +148,8 @@ mask_pixmap = save_mask_px; mask_bitmap = save_mask_bm; pixmap = save_px; - conf_force_set_bool(conf_core.editor.view.flip_x, save_fx); - conf_force_set_bool(conf_core.editor.view.flip_y, save_fy); + conf_force_set_bool(pcbhl_conf.editor.view.flip_x, save_fx); + conf_force_set_bool(pcbhl_conf.editor.view.flip_y, save_fy); pd->expose_lock = 0; } Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 25132) +++ trunk/src_plugins/io_pcb/file.c (revision 25133) @@ -31,6 +31,7 @@ #include "config.h" #include "conf_core.h" +#include "hidlib_conf.h" #include #include @@ -290,7 +291,7 @@ fputs("\nPCB[", FP); pcb_print_quoted_string(FP, (char *) PCB_EMPTY(PCB->hidlib.name)); pcb_fprintf(FP, " %[0] %[0]]\n\n", PCB->hidlib.size_x, PCB->hidlib.size_y); - pcb_fprintf(FP, "Grid[%[0] %[0] %[0] %d]\n", PCB->hidlib.grid, PCB->hidlib.grid_ox, PCB->hidlib.grid_oy, conf_core.editor.draw_grid); + pcb_fprintf(FP, "Grid[%[0] %[0] %[0] %d]\n", PCB->hidlib.grid, PCB->hidlib.grid_ox, PCB->hidlib.grid_oy, pcbhl_conf.editor.draw_grid); pcb_fprintf(FP, "Cursor[%[0] %[0] 1000]\n", pcb_crosshair.X, pcb_crosshair.Y); /* PolyArea should be output in square cmils, no suffix */ fprintf(FP, "PolyArea[%s]\n", c_dtostr(PCB_COORD_TO_MIL(PCB_COORD_TO_MIL(conf_core.design.poly_isle_area) * 100) * 100)); Index: trunk/src_plugins/lib_gtk_common/bu_command.c =================================================================== --- trunk/src_plugins/lib_gtk_common/bu_command.c (revision 25132) +++ trunk/src_plugins/lib_gtk_common/bu_command.c (revision 25133) @@ -159,7 +159,7 @@ ctx->command_entered = NULL; /* We are aborting */ /* Hide the host widget in full screen - not enough if only the entry is gone */ - if (*pcbhlc_editor_fullscreen) { + if (pcbhl_conf.editor.fullscreen) { gtk_widget_hide(gtk_widget_get_parent(ctx->command_combo_box)); gtk_widget_hide(gtk_widget_get_parent(ctx->prompt_label)); } @@ -185,7 +185,7 @@ ctx->command_entry_status_line_active = TRUE; gtk_entry_set_text(ctx->command_entry, command ? command : ""); - if (*pcbhlc_editor_fullscreen) + if (pcbhl_conf.editor.fullscreen) gtk_widget_show(gtk_widget_get_parent(ctx->command_combo_box)); gtk_widget_show(ctx->command_combo_box); @@ -215,7 +215,7 @@ g_signal_handler_disconnect(ctx->command_entry, escape_sig2_id); /* Hide/show the widgets */ - if (*pcbhlc_editor_fullscreen) { + if (pcbhl_conf.editor.fullscreen) { gtk_widget_hide(gtk_widget_get_parent(ctx->command_combo_box)); gtk_widget_hide(gtk_widget_get_parent(ctx->prompt_label)); } Index: trunk/src_plugins/lib_gtk_common/dlg_attribute.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_attribute.c (revision 25132) +++ trunk/src_plugins/lib_gtk_common/dlg_attribute.c (revision 25133) @@ -462,7 +462,7 @@ gtk_box_pack_start(GTK_BOX(parent), hbox, FALSE, FALSE, 0); entry = pcb_gtk_coord_entry_new(ctx->attrs[j].min_val, ctx->attrs[j].max_val, - ctx->attrs[j].default_val.coord_value, *pcbhlc_editor_grid_unit, CE_SMALL); + ctx->attrs[j].default_val.coord_value, pcbhl_conf.editor.grid_unit, CE_SMALL); gtk_box_pack_start(GTK_BOX(hbox), entry, FALSE, FALSE, 0); g_object_set_data(G_OBJECT(entry), PCB_OBJ_PROP, ctx); ctx->wl[j] = entry; @@ -829,7 +829,7 @@ if (modal) gtk_window_set_transient_for(GTK_WINDOW(ctx->dialog), GTK_WINDOW(com->top_window)); - if (*pcbhlc_editor_auto_place) { + if (pcbhl_conf.editor.auto_place) { if ((plc[2] > 0) && (plc[3] > 0)) gtk_window_resize(GTK_WINDOW(ctx->dialog), plc[2], plc[3]); if ((plc[0] >= 0) && (plc[1] >= 0)) Index: trunk/src_plugins/lib_gtk_common/dlg_search.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_search.c (revision 25132) +++ trunk/src_plugins/lib_gtk_common/dlg_search.c (revision 25133) @@ -769,7 +769,7 @@ expr_wizard_dlg.right_double = gtk_spin_button_new(expr_wizard_dlg.right_adj2, 1, 8); gtk_box_pack_start(GTK_BOX(vbox), expr_wizard_dlg.right_double, FALSE, TRUE, 4); - expr_wizard_dlg.right_coord = pcb_gtk_coord_entry_new(0, PCB_MM_TO_COORD(2100), 0, *pcbhlc_editor_grid_unit, CE_MEDIUM); + expr_wizard_dlg.right_coord = pcb_gtk_coord_entry_new(0, PCB_MM_TO_COORD(2100), 0, pcbhl_conf.editor.grid_unit, CE_MEDIUM); gtk_box_pack_start(GTK_BOX(vbox), expr_wizard_dlg.right_coord, FALSE, TRUE, 4); gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, TRUE, 4); Index: trunk/src_plugins/lib_gtk_common/dlg_topwin.c =================================================================== --- trunk/src_plugins/lib_gtk_common/dlg_topwin.c (revision 25132) +++ trunk/src_plugins/lib_gtk_common/dlg_topwin.c (revision 25133) @@ -294,7 +294,7 @@ static void fullscreen_cb(GtkButton *btn, void *data) { - conf_setf(CFR_DESIGN, "editor/fullscreen", -1, "%d", !*pcbhlc_editor_fullscreen, POL_OVERWRITE); + conf_setf(CFR_DESIGN, "editor/fullscreen", -1, "%d", !pcbhl_conf.editor.fullscreen, POL_OVERWRITE); } /* XPM */ @@ -583,7 +583,7 @@ void ghid_fullscreen_apply(pcb_gtk_topwin_t *tw) { - if (*pcbhlc_editor_fullscreen) { + if (pcbhl_conf.editor.fullscreen) { gtk_widget_hide(tw->left_toolbar); gtk_widget_hide(tw->top_hbox); if (!tw->cmd.command_entry_status_line_active) Index: trunk/src_plugins/lib_gtk_common/ui_zoompan.c =================================================================== --- trunk/src_plugins/lib_gtk_common/ui_zoompan.c (revision 25132) +++ trunk/src_plugins/lib_gtk_common/ui_zoompan.c (revision 25133) @@ -188,8 +188,8 @@ yf = (y2 - y1) / v->canvas_height; v->coord_per_px = (xf > yf ? xf : yf); - v->x0 = SIDE_X(v, *pcbhlc_editor_view_flip_x ? x2 : x1); - v->y0 = SIDE_Y(v, *pcbhlc_editor_view_flip_y ? y2 : y1); + v->x0 = SIDE_X(v, pcbhl_conf.editor.view.flip_x ? x2 : x1); + v->y0 = SIDE_Y(v, pcbhl_conf.editor.view.flip_y ? y2 : y1); pcb_gtk_pan_common(v); if (setch) { Index: trunk/src_plugins/lib_gtk_common/ui_zoompan.h =================================================================== --- trunk/src_plugins/lib_gtk_common/ui_zoompan.h (revision 25132) +++ trunk/src_plugins/lib_gtk_common/ui_zoompan.h (revision 25133) @@ -34,8 +34,8 @@ #include "in_mouse.h" #include "glue.h" -#define SIDE_X_(hidlib, x) ((*pcbhlc_editor_view_flip_x ? hidlib->size_x - (x) : (x))) -#define SIDE_Y_(hidlib, y) ((*pcbhlc_editor_view_flip_y ? hidlib->size_y - (y) : (y))) +#define SIDE_X_(hidlib, x) ((pcbhl_conf.editor.view.flip_x ? hidlib->size_x - (x) : (x))) +#define SIDE_Y_(hidlib, y) ((pcbhl_conf.editor.view.flip_y ? hidlib->size_y - (y) : (y))) #define SIDE_X(v, x) SIDE_X_((v)->com->hidlib, (x)) #define SIDE_Y(v, y) SIDE_Y_((v)->com->hidlib, (y)) Index: trunk/src_plugins/lib_gtk_common/win_place.c =================================================================== --- trunk/src_plugins/lib_gtk_common/win_place.c (revision 25132) +++ trunk/src_plugins/lib_gtk_common/win_place.c (revision 25133) @@ -36,7 +36,7 @@ pcb_event(PCB_EVENT_DAD_NEW_DIALOG, "psp", NULL, id, plc); - if (*pcbhlc_editor_auto_place) { + if (pcbhl_conf.editor.auto_place) { if ((plc[2] > 0) && (plc[3] > 0)) gtk_window_resize(GTK_WINDOW(dialog), plc[2], plc[3]); if ((plc[0] >= 0) && (plc[1] >= 0)) Index: trunk/src_plugins/lib_gtk_common/wt_preview.c =================================================================== --- trunk/src_plugins/lib_gtk_common/wt_preview.c (revision 25132) +++ trunk/src_plugins/lib_gtk_common/wt_preview.c (revision 25133) @@ -233,15 +233,15 @@ preview->expose_data.view.Y1 = preview->y_min; preview->expose_data.view.X2 = preview->x_max; preview->expose_data.view.Y2 = preview->y_max; - save_fx = *pcbhlc_editor_view_flip_x; - save_fy = *pcbhlc_editor_view_flip_y; - conf_force_set_bool(*pcbhlc_editor_view_flip_x, 0); - conf_force_set_bool(*pcbhlc_editor_view_flip_y, 0); + save_fx = pcbhl_conf.editor.view.flip_x; + save_fy = pcbhl_conf.editor.view.flip_y; + conf_force_set_bool(pcbhl_conf.editor.view.flip_x, 0); + conf_force_set_bool(pcbhl_conf.editor.view.flip_y, 0); res = preview->expose(widget, ev, pcb_hid_expose_generic, &preview->expose_data); - conf_force_set_bool(*pcbhlc_editor_view_flip_x, save_fx); - conf_force_set_bool(*pcbhlc_editor_view_flip_y, save_fy); + conf_force_set_bool(pcbhl_conf.editor.view.flip_x, save_fx); + conf_force_set_bool(pcbhl_conf.editor.view.flip_y, save_fy); return res; } Index: trunk/src_plugins/lib_gtk_hid/coord_conv.h =================================================================== --- trunk/src_plugins/lib_gtk_hid/coord_conv.h (revision 25132) +++ trunk/src_plugins/lib_gtk_hid/coord_conv.h (revision 25133) @@ -6,7 +6,7 @@ static inline int Vx(pcb_coord_t x) { double rv; - if (*pcbhlc_editor_view_flip_x) + if (pcbhl_conf.editor.view.flip_x) rv = (gport->view.com->hidlib->size_x - x - gport->view.x0) / gport->view.coord_per_px + 0.5; else rv = (x - gport->view.x0) / gport->view.coord_per_px + 0.5; @@ -16,7 +16,7 @@ static inline int Vy(pcb_coord_t y) { double rv; - if (*pcbhlc_editor_view_flip_y) + if (pcbhl_conf.editor.view.flip_y) rv = (gport->view.com->hidlib->size_y - y - gport->view.y0) / gport->view.coord_per_px + 0.5; else rv = (y - gport->view.y0) / gport->view.coord_per_px + 0.5; @@ -31,7 +31,7 @@ static inline double Vxd(pcb_coord_t x) { double rv; - if (*pcbhlc_editor_view_flip_x) + if (pcbhl_conf.editor.view.flip_x) rv = (gport->view.com->hidlib->size_x - x - gport->view.x0) / gport->view.coord_per_px; else rv = (x - gport->view.x0) / gport->view.coord_per_px; @@ -41,7 +41,7 @@ static inline double Vyd(pcb_coord_t y) { double rv; - if (*pcbhlc_editor_view_flip_y) + if (pcbhl_conf.editor.view.flip_y) rv = (gport->view.com->hidlib->size_y - y - gport->view.y0) / gport->view.coord_per_px; else rv = (y - gport->view.y0) / gport->view.coord_per_px; @@ -56,7 +56,7 @@ static inline pcb_coord_t Px(int x) { pcb_coord_t rv = x * gport->view.coord_per_px + gport->view.x0; - if (*pcbhlc_editor_view_flip_x) + if (pcbhl_conf.editor.view.flip_x) rv = gport->view.com->hidlib->size_x - (x * gport->view.coord_per_px + gport->view.x0); return rv; } @@ -64,7 +64,7 @@ static inline pcb_coord_t Py(int y) { pcb_coord_t rv = y * gport->view.coord_per_px + gport->view.y0; - if (*pcbhlc_editor_view_flip_y) + if (pcbhl_conf.editor.view.flip_y) rv = gport->view.com->hidlib->size_y - (y * gport->view.coord_per_px + gport->view.y0); return rv; } Index: trunk/src_plugins/lib_hid_pcbui/act.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/act.c (revision 25132) +++ trunk/src_plugins/lib_hid_pcbui/act.c (revision 25133) @@ -31,6 +31,7 @@ #include "compat_misc.h" #include "conf.h" #include "conf_core.h" +#include "hidlib_conf.h" #include "draw.h" #include "hid.h" #include "layer_vis.h" @@ -249,18 +250,18 @@ PCB_ACT_MAY_CONVARG(2, FGW_STR, SwapSides, b = argv[2].val.str); switch (a[0]) { case 'h': case 'H': - conf_toggle_editor_("view/flip_x", view.flip_x); + conf_toggle_heditor_("view/flip_x", view.flip_x); break; case 'v': case 'V': - if (!conf_core.editor.view.flip_y) + if (!pcbhl_conf.editor.view.flip_y) yoffs = -yoffs; else yoffs = 0; - conf_toggle_editor_("view/flip_y", view.flip_y); + conf_toggle_heditor_("view/flip_y", view.flip_y); break; case 'r': case 'R': - conf_toggle_editor_("view/flip_x", view.flip_x); - conf_toggle_editor_("view/flip_y", view.flip_y); + conf_toggle_heditor_("view/flip_x", view.flip_x); + conf_toggle_heditor_("view/flip_y", view.flip_y); conf_toggle_editor(show_solder_side); /* Swapped back below */ break; Index: trunk/src_plugins/lib_hid_pcbui/layer_menu.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/layer_menu.c (revision 25132) +++ trunk/src_plugins/lib_hid_pcbui/layer_menu.c (revision 25133) @@ -29,6 +29,7 @@ #include "board.h" #include "data.h" #include "conf_core.h" +#include "hidlib_conf.h" #include "event.h" #include "layer.h" #include "layer_ui.h" @@ -138,7 +139,7 @@ pcb_layer_type_t lyt = pcb_layer_flags_(l); props.background = &l->meta.real.color; - props.foreground = &conf_core.appearance.color.background; + props.foreground = &pcbhl_conf.appearance.color.background; props.checked = chk; if (ctx->view) { sprintf(act, "ToggleView(%ld)", lid+1); Index: trunk/src_plugins/lib_hid_pcbui/status.c =================================================================== --- trunk/src_plugins/lib_hid_pcbui/status.c (revision 25132) +++ trunk/src_plugins/lib_hid_pcbui/status.c (revision 25133) @@ -33,6 +33,7 @@ #include "hid_cfg_input.h" #include "hid_dad.h" #include "conf_core.h" +#include "hidlib_conf.h" #include "crosshair.h" #include "layer.h" #include "search.h" @@ -81,7 +82,7 @@ "grid=%$mS " "line=%mS (%s%s) " "kbd=%s", - conf_core.editor.grid_unit->allow, conf_core.editor.show_solder_side ? "bottom" : "top", + pcbhl_conf.editor.grid_unit->allow, conf_core.editor.show_solder_side ? "bottom" : "top", PCB->hidlib.grid, conf_core.design.line_thickness, flag, conf_core.editor.rubber_band_mode ? ",R" : "", kbd); @@ -110,7 +111,7 @@ unit_mm = get_unit_struct("mm"); unit_mil = get_unit_struct("mil"); } - if (conf_core.editor.grid_unit == unit_mm) + if (pcbhl_conf.editor.grid_unit == unit_mm) unit_inv = unit_mil; else unit_inv = unit_mm; @@ -172,12 +173,12 @@ /* coordinate readout (right side box) */ if (conf_core.appearance.compact) { status.buf.used = 0; - pcb_append_printf(&status.buf, "%m+%-mS", conf_core.editor.grid_unit->allow, pcb_crosshair.X); + pcb_append_printf(&status.buf, "%m+%-mS", pcbhl_conf.editor.grid_unit->allow, pcb_crosshair.X); hv.str_value = status.buf.array; pcb_gui->attr_dlg_set_value(status.rdsub.dlg_hid_ctx, status.wrd2[0], &hv); status.buf.used = 0; - pcb_append_printf(&status.buf, "%m+%-mS", conf_core.editor.grid_unit->allow, pcb_crosshair.Y); + pcb_append_printf(&status.buf, "%m+%-mS", pcbhl_conf.editor.grid_unit->allow, pcb_crosshair.Y); hv.str_value = status.buf.array; pcb_gui->attr_dlg_set_value(status.rdsub.dlg_hid_ctx, status.wrd2[1], &hv); pcb_gui->attr_dlg_widget_hide(status.rdsub.dlg_hid_ctx, status.wrd2[1], 0); @@ -184,7 +185,7 @@ } else { status.buf.used = 0; - pcb_append_printf(&status.buf, "%m+%-mS %-mS", conf_core.editor.grid_unit->allow, pcb_crosshair.X, pcb_crosshair.Y); + pcb_append_printf(&status.buf, "%m+%-mS %-mS", pcbhl_conf.editor.grid_unit->allow, pcb_crosshair.X, pcb_crosshair.Y); hv.str_value = status.buf.array; pcb_gui->attr_dlg_set_value(status.rdsub.dlg_hid_ctx, status.wrd2[0], &hv); pcb_gui->attr_dlg_widget_hide(status.rdsub.dlg_hid_ctx, status.wrd2[1], 1); @@ -201,11 +202,11 @@ double a = atan2(dy, dx) * PCB_RAD_TO_DEG; s1 = status.buf.array; - pcb_append_printf(&status.buf, "%m+r %-mS%c", conf_core.editor.grid_unit->allow, r, sep); + pcb_append_printf(&status.buf, "%m+r %-mS%c", pcbhl_conf.editor.grid_unit->allow, r, sep); s2 = status.buf.array + status.buf.used; pcb_append_printf(&status.buf, "phi %-.1f%c", a, sep); s3 = status.buf.array + status.buf.used; - pcb_append_printf(&status.buf, "%m+ %-mS %-mS", conf_core.editor.grid_unit->allow, dx, dy); + pcb_append_printf(&status.buf, "%m+ %-mS %-mS", pcbhl_conf.editor.grid_unit->allow, dx, dy); } else { pcb_append_printf(&status.buf, "r __.__%cphi __._%c__.__ __.__", sep, sep, sep); @@ -229,10 +230,10 @@ pcb_gui->attr_dlg_widget_hide(status.rdsub.dlg_hid_ctx, status.wrd1[2], 1); } - if (status.last_unit != conf_core.editor.grid_unit) { + if (status.last_unit != pcbhl_conf.editor.grid_unit) { status.lock++; - status.last_unit = conf_core.editor.grid_unit; - hv.str_value = conf_core.editor.grid_unit->in_suffix; + status.last_unit = pcbhl_conf.editor.grid_unit; + hv.str_value = pcbhl_conf.editor.grid_unit->in_suffix; pcb_gui->attr_dlg_set_value(status.rdsub.dlg_hid_ctx, status.wrdunit, &hv); status.lock--; } @@ -240,7 +241,7 @@ static void unit_change_cb(void *hid_ctx, void *caller_data, pcb_hid_attribute_t *attr) { - if (conf_core.editor.grid_unit == get_unit_struct("mm")) + if (pcbhl_conf.editor.grid_unit == get_unit_struct("mm")) pcb_actionl("SetUnits", "mil", NULL); else pcb_actionl("SetUnits", "mm", NULL); Index: trunk/src_plugins/propedit/propsel.c =================================================================== --- trunk/src_plugins/propedit/propsel.c (revision 25132) +++ trunk/src_plugins/propedit/propsel.c (revision 25133) @@ -39,6 +39,7 @@ #include "obj_pstk_inlines.h" #include "pcb-printf.h" #include "conf_core.h" +#include "hidlib_conf.h" /*********** map ***********/ #define type2field_String string @@ -724,7 +725,7 @@ { switch(type) { case PCB_PROPT_STRING: return val->string == NULL ? pcb_strdup("") : pcb_strdup(val->string); - case PCB_PROPT_COORD: return pcb_strdup_printf("%m+%.02mS", conf_core.editor.grid_unit->allow, val->coord); + case PCB_PROPT_COORD: return pcb_strdup_printf("%m+%.02mS", pcbhl_conf.editor.grid_unit->allow, val->coord); case PCB_PROPT_ANGLE: return pcb_strdup_printf("%f", val->angle); case PCB_PROPT_INT: return pcb_strdup_printf("%d", val->i); case PCB_PROPT_BOOL: return pcb_strdup(val->i ? "true" : "false"); Index: trunk/src_plugins/report/report.c =================================================================== --- trunk/src_plugins/report/report.c (revision 25132) +++ trunk/src_plugins/report/report.c (revision 25133) @@ -31,8 +31,11 @@ #include "config.h" + #include "conf_core.h" +#include "hidlib_conf.h" + #include #include "report.h" @@ -71,7 +74,7 @@ static const char pcb_acts_Report[] = "Report(Object|DrillReport|FoundPins|NetLength|NetLengthTo|AllNetLengths|[,name])"; static const char pcb_acth_Report[] = "Produce various report."; -#define USER_UNITMASK (conf_core.editor.grid_unit->allow) +#define USER_UNITMASK (pcbhl_conf.editor.grid_unit->allow) typedef struct rdialog_ctx_s { @@ -123,7 +126,7 @@ sprintf(stringlist, "There are %d different drill sizes used in this layout, %d holes total\n\n" "Drill Diam. (%s)\t# of Pins\t# of Vias\t# of Elements\t# Unplated\n", - AllDrills->DrillN, total_drills, conf_core.editor.grid_unit->suffix); + AllDrills->DrillN, total_drills, pcbhl_conf.editor.grid_unit->suffix); thestring = stringlist; while (*thestring != '\0') thestring++; @@ -130,7 +133,7 @@ for (n = 0; n < AllDrills->DrillN; n++) { pcb_sprintf(thestring, "%10m*\t\t\t%d\t\t%d\t\t%d\t\t\t\t%d\n", - conf_core.editor.grid_unit->suffix, + pcbhl_conf.editor.grid_unit->suffix, AllDrills->Drill[n].DrillSize, AllDrills->Drill[n].PinCount, AllDrills->Drill[n].ViaCount, AllDrills->Drill[n].ElementN, AllDrills->Drill[n].UnplatedCount); @@ -317,7 +320,7 @@ #endif Polygon = (pcb_poly_t *) ptr2; - aunit = conf_core.editor.grid_unit->in_suffix; + aunit = pcbhl_conf.editor.grid_unit->in_suffix; if (aunit[1] == 'm') u = PCB_MM_TO_COORD(1); else @@ -553,7 +556,7 @@ pcb_obj_center(term, &x, &y); if (argc < 1) - units_name = conf_core.editor.grid_unit->suffix; + units_name = pcbhl_conf.editor.grid_unit->suffix; gds_init(&err); length = xy_to_net_length(x, y, &found, &err); @@ -616,7 +619,7 @@ char buf[50]; const char *netname = net_name_found(PCB); - pcb_snprintf(buf, sizeof(buf), "%$m*", conf_core.editor.grid_unit->suffix, length); + pcb_snprintf(buf, sizeof(buf), "%$m*", pcbhl_conf.editor.grid_unit->suffix, length); if (netname) pcb_message(PCB_MSG_INFO, "Net \"%s\" length: %s\n", netname, buf); else @@ -754,7 +757,7 @@ { char buf[50]; - pcb_snprintf(buf, sizeof(buf), "%$m*", conf_core.editor.grid_unit->suffix, length); + pcb_snprintf(buf, sizeof(buf), "%$m*", pcbhl_conf.editor.grid_unit->suffix, length); if (netname) pcb_message(PCB_MSG_INFO, "Net \"%s\" length: %s\n", netname, buf); else Index: trunk/src_plugins/rubberband_orig/rubberband.c =================================================================== --- trunk/src_plugins/rubberband_orig/rubberband.c (revision 25132) +++ trunk/src_plugins/rubberband_orig/rubberband.c (revision 25133) @@ -54,6 +54,7 @@ #include "route_draw.h" #include "plugins.h" #include "conf_core.h" +#include "hidlib_conf.h" #include "layer_grp.h" #include "fgeometry.h" #include "search.h" @@ -1161,7 +1162,7 @@ pcb_draw_wireframe_line(pcb_crosshair.GC, x[0], y[0], x[1], y[1], ptr->Line->Thickness, 0); /* Draw the DRC outline if it is enabled */ if (conf_core.editor.show_drc) { - pcb_gui->set_color(pcb_crosshair.GC, &conf_core.appearance.color.cross); + pcb_gui->set_color(pcb_crosshair.GC, &pcbhl_conf.appearance.color.cross); pcb_draw_wireframe_line(pcb_crosshair.GC, x[0], y[0], x[1], y[1], ptr->Line->Thickness + 2 * (conf_core.design.bloat + 1), 0); } } Index: trunk/src_plugins/script/script.c =================================================================== --- trunk/src_plugins/script/script.c (revision 25132) +++ trunk/src_plugins/script/script.c (revision 25133) @@ -57,7 +57,7 @@ static pup_context_t script_pup; #include "c_script.c" -#include "conf_core.h" +#include "hidlib_conf.h" #include "compat_fs.h" /* dir name under dotdir for saving script persistency data */ @@ -78,7 +78,7 @@ gds_t fn; gds_init(&fn); - gds_append_str(&fn, conf_core.rc.path.home); + gds_append_str(&fn, pcbhl_conf.rc.path.home); gds_append(&fn, PCB_DIR_SEPARATOR_C); gds_append_str(&fn, DOT_PCB_RND); pcb_mkdir(fn.array, 0755); @@ -164,7 +164,7 @@ goto err; } - fn = pcb_concat(conf_core.rc.path.home, PCB_DIR_SEPARATOR_S, DOT_PCB_RND, PCB_DIR_SEPARATOR_S, SCRIPT_PERS, PCB_DIR_SEPARATOR_S, script_persistency_id, NULL); + fn = pcb_concat(pcbhl_conf.rc.path.home, PCB_DIR_SEPARATOR_S, DOT_PCB_RND, PCB_DIR_SEPARATOR_S, SCRIPT_PERS, PCB_DIR_SEPARATOR_S, script_persistency_id, NULL); if (strcmp(cmd, "remove") == 0) { PCB_ACT_IRES(pcb_remove(fn)); Index: trunk/src_plugins/stroke/stroke.c =================================================================== --- trunk/src_plugins/stroke/stroke.c (revision 25132) +++ trunk/src_plugins/stroke/stroke.c (revision 25133) @@ -32,6 +32,7 @@ #include "board.h" #include "conf_core.h" +#include "hidlib_conf.h" #include "crosshair.h" #include "actions.h" #include "unit.h" @@ -47,8 +48,8 @@ conf_stroke_t conf_stroke; -#define SIDE_X(x) ((conf_core.editor.view.flip_x ? PCB->hidlib.size_x - (x) : (x))) -#define SIDE_Y(y) ((conf_core.editor.view.flip_y ? PCB->hidlib.size_y - (y) : (y))) +#define SIDE_X(x) ((pcbhl_conf.editor.view.flip_x ? PCB->hidlib.size_x - (x) : (x))) +#define SIDE_Y(y) ((pcbhl_conf.editor.view.flip_y ? PCB->hidlib.size_y - (y) : (y))) static const char *pcb_stroke_cookie = "stroke plugin";